summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsb <sb@openoffice.org>2010-03-04 23:05:27 +0100
committersb <sb@openoffice.org>2010-03-04 23:05:27 +0100
commitc79b576a3dbbbce2a67c6215a4180ac060131790 (patch)
tree32e1b51bf16b501fd7eea6d23f0610eee339fa5f
parentff783db420cdb801613ca46ffec6dc6812d9ad0d (diff)
parent0d0b4e1cdd842808707e570b1dea125f312f2a50 (diff)
merged in re/DEV300_next towards DEV300_m74
-rw-r--r--basic/source/app/app.cxx35
-rw-r--r--basic/source/runtime/wnt-mingw.s46
-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.lst20
-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/source/api/makefile.mk)29
-rw-r--r--configmgr/qa/unit/version.map (renamed from configmgr/version.mk)28
-rw-r--r--configmgr/qa/unoapi/cfgmgr2.sce34
-rw-r--r--configmgr/qa/unoapi/knownissues.xcl55
-rw-r--r--configmgr/qa/unoapi/makefile.mk2
-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/committer.hxx57
-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.cxx56
-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.cxx650
-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/cachefactory.hxx51
-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/localizedtreeactions.hxx52
-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/nodeconverter.hxx61
-rw-r--r--configmgr/source/inc/noderef.hxx268
-rw-r--r--configmgr/source/inc/nodevisitor.hxx77
-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.cxx56
-rw-r--r--configmgr/source/treemgr/viewaccess.hxx228
-rw-r--r--configmgr/source/treemgr/viewfactory.hxx53
-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/configmgr2.uno.xml582
-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/testmodules.hxx38
-rw-r--r--configmgr/workben/memory/treeload.cxx81
-rw-r--r--configmgr/workben/memory/treeload.hxx41
-rw-r--r--connectivity/prj/d.lst2
-rwxr-xr-xconnectivity/util/langfilter.xsl37
-rwxr-xr-xconnectivity/util/makefile.mk89
-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--fpicker/source/office/OfficeFilePicker.cxx5
-rw-r--r--framework/source/classes/addonmenu.cxx3
-rw-r--r--linguistic/source/lngsvcmgr.cxx11
-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--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/makefile.mk58
-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/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/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.mk17
-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
-rw-r--r--ucb/source/core/ucbstore.cxx12
-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
621 files changed, 22449 insertions, 112098 deletions
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/basic/source/runtime/wnt-mingw.s b/basic/source/runtime/wnt-mingw.s
index 878a2791c3e7..1168804102d0 100644
--- a/basic/source/runtime/wnt-mingw.s
+++ b/basic/source/runtime/wnt-mingw.s
@@ -1,28 +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.
+#
#*************************************************************************
# Anmerkungen
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 46edcd8b9f28..9fcccbc73b4c 100644
--- a/configmgr/prj/build.lst
+++ b/configmgr/prj/build.lst
@@ -1,18 +1,4 @@
-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
cg configmgr\qa\unoapi nmake - all cg_qa_unoapi 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 879fa8953788..000000000000
--- a/configmgr/qa/unit/export.map
+++ /dev/null
@@ -1,7 +0,0 @@
-UDK_3_0_0 {
- global:
- registerAllTestFunction;
-
- local:
- *;
-};
diff --git a/configmgr/qa/unit/makefile.mk b/configmgr/qa/unit/makefile.mk
index 94b4c58c41c9..25035d7e9dda 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,39 +23,71 @@
# <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
CFLAGSCXX += $(CPPUNIT_CFLAGS)
-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/source/api/makefile.mk b/configmgr/qa/unit/urebootstrap.ini
index eb3f348bbb5e..c413645d0f43 100644
--- a/configmgr/source/api/makefile.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,27 +23,8 @@
# <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
+#***********************************************************************/
+[Bootstrap]
+OOO_BASE_DIR = $ORIGIN/basis
+BRAND_BASE_DIR = $ORIGIN/brand
diff --git a/configmgr/version.mk b/configmgr/qa/unit/version.map
index eabf1cca63c5..6b30413b896e 100644
--- a/configmgr/version.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,24 +23,12 @@
# <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)
-
-
+#***********************************************************************/
+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 879e3bebde74..252e4a0d9af4 100644
--- a/configmgr/qa/unoapi/makefile.mk
+++ b/configmgr/qa/unoapi/makefile.mk
@@ -1,4 +1,5 @@
#*************************************************************************
+#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# Copyright 2000, 2010 Oracle and/or its affiliates.
@@ -21,6 +22,7 @@
# version 3 along with OpenOffice.org. If not, see
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
+#
#***********************************************************************/
.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
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 ve