summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2008-10-29 14:38:47 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2008-10-29 14:38:47 +0000
commited05b85a71a6c5ee3c622ce8957d5252e418c4e2 (patch)
treec488f00208fcbbde1be7e459d7b1f075d85aa6b9
parentc84dc6cb0c86ef76923a19a7f98cf59f2f734af1 (diff)
CWS-TOOLING: integrate CWS sb99
-rw-r--r--configmgr/prj/build.lst2
-rw-r--r--configmgr/qa/unit/makefile.mk3
-rw-r--r--configmgr/qa/unit/performance.cxx34
-rw-r--r--configmgr/qa/unit/threading.cxx11
-rw-r--r--configmgr/source/api/confeventhelpers.cxx362
-rw-r--r--configmgr/source/api/confeventhelpers.hxx204
-rw-r--r--configmgr/source/api/confevents.cxx299
-rw-r--r--configmgr/source/api/confsvccomponent.cxx11
-rw-r--r--configmgr/source/api/makefile.mk1
-rw-r--r--configmgr/source/api2/accessimpl.cxx360
-rw-r--r--configmgr/source/api2/accessimpl.hxx27
-rw-r--r--configmgr/source/api2/apiaccessobj.hxx85
-rw-r--r--configmgr/source/api2/apiaccessobj.inl24
-rw-r--r--configmgr/source/api2/apifactory.cxx136
-rw-r--r--configmgr/source/api2/apifactory.hxx50
-rw-r--r--configmgr/source/api2/apifactoryimpl.cxx104
-rw-r--r--configmgr/source/api2/apifactoryimpl.hxx18
-rw-r--r--configmgr/source/api2/apinodeaccess.cxx59
-rw-r--r--configmgr/source/api2/apinodeaccess.hxx93
-rw-r--r--configmgr/source/api2/apinodeupdate.cxx31
-rw-r--r--configmgr/source/api2/apinodeupdate.hxx35
-rw-r--r--configmgr/source/api2/apinotifierimpl.cxx112
-rw-r--r--configmgr/source/api2/apinotifierimpl.hxx11
-rw-r--r--configmgr/source/api2/apiserviceinfo.cxx34
-rw-r--r--configmgr/source/api2/apiserviceinfo.hxx4
-rw-r--r--configmgr/source/api2/apitreeaccess.cxx47
-rw-r--r--configmgr/source/api2/apitreeaccess.hxx78
-rw-r--r--configmgr/source/api2/apitreeimplobj.cxx212
-rw-r--r--configmgr/source/api2/apitreeimplobj.hxx76
-rw-r--r--configmgr/source/api2/broadcaster.cxx534
-rw-r--r--configmgr/source/api2/broadcaster.hxx25
-rw-r--r--configmgr/source/api2/committer.cxx20
-rw-r--r--configmgr/source/api2/committer.hxx4
-rw-r--r--configmgr/source/api2/confignotifier.cxx82
-rw-r--r--configmgr/source/api2/confignotifier.hxx58
-rw-r--r--configmgr/source/api2/confprovider2.cxx607
-rw-r--r--configmgr/source/api2/confprovider2.hxx141
-rw-r--r--configmgr/source/api2/confproviderimpl2.cxx132
-rw-r--r--configmgr/source/api2/confproviderimpl2.hxx67
-rw-r--r--configmgr/source/api2/elementaccess.cxx142
-rw-r--r--configmgr/source/api2/elementaccess.hxx91
-rw-r--r--configmgr/source/api2/elementimpl.cxx171
-rw-r--r--configmgr/source/api2/elementimpl.hxx15
-rw-r--r--configmgr/source/api2/groupaccess.cxx39
-rw-r--r--configmgr/source/api2/groupaccess.hxx19
-rw-r--r--configmgr/source/api2/groupobjects.cxx48
-rw-r--r--configmgr/source/api2/groupobjects.hxx87
-rw-r--r--configmgr/source/api2/groupupdate.cxx13
-rw-r--r--configmgr/source/api2/groupupdate.hxx8
-rw-r--r--configmgr/source/api2/listenercontainer.cxx6
-rw-r--r--configmgr/source/api2/listenercontainer.hxx112
-rw-r--r--configmgr/source/api2/makefile.mk2
-rw-r--r--configmgr/source/api2/notifierimpl.hxx99
-rw-r--r--configmgr/source/api2/objectregistry.hxx17
-rw-r--r--configmgr/source/api2/propertiesfilterednotifier.cxx26
-rw-r--r--configmgr/source/api2/propertyinfohelper.cxx4
-rw-r--r--configmgr/source/api2/propertyinfohelper.hxx3
-rw-r--r--configmgr/source/api2/propertysetaccess.cxx49
-rw-r--r--configmgr/source/api2/propertysetaccess.hxx43
-rw-r--r--configmgr/source/api2/propsetaccessimpl.cxx704
-rw-r--r--configmgr/source/api2/propsetaccessimpl.hxx31
-rw-r--r--configmgr/source/api2/provider.cxx531
-rw-r--r--configmgr/source/api2/provider.hxx95
-rw-r--r--configmgr/source/api2/providerimpl.cxx264
-rw-r--r--configmgr/source/api2/providerimpl.hxx122
-rw-r--r--configmgr/source/api2/setaccess.cxx61
-rw-r--r--configmgr/source/api2/setaccess.hxx35
-rw-r--r--configmgr/source/api2/setobjects.cxx66
-rw-r--r--configmgr/source/api2/setobjects.hxx120
-rw-r--r--configmgr/source/api2/setupdate.cxx27
-rw-r--r--configmgr/source/api2/setupdate.hxx24
-rw-r--r--configmgr/source/api2/translatechanges.cxx71
-rw-r--r--configmgr/source/api2/translatechanges.hxx12
-rw-r--r--configmgr/source/api2/treeiterators.cxx29
-rw-r--r--configmgr/source/api2/treeiterators.hxx27
-rw-r--r--configmgr/source/api2/updateimpl.cxx329
-rw-r--r--configmgr/source/api2/updateimpl.hxx15
-rw-r--r--configmgr/source/backend/backendaccess.cxx145
-rw-r--r--configmgr/source/backend/backendaccess.hxx35
-rw-r--r--configmgr/source/backend/backendfactory.cxx67
-rw-r--r--configmgr/source/backend/backendnotifier.cxx18
-rw-r--r--configmgr/source/backend/backendnotifier.hxx14
-rw-r--r--configmgr/source/backend/backendstratalistener.hxx4
-rw-r--r--configmgr/source/backend/basicimporthandler.cxx16
-rw-r--r--configmgr/source/backend/basicimporthandler.hxx25
-rw-r--r--configmgr/source/backend/basicupdatemerger.cxx64
-rw-r--r--configmgr/source/backend/basicupdatemerger.hxx65
-rw-r--r--configmgr/source/backend/binarycache.cxx48
-rw-r--r--configmgr/source/backend/binarycache.hxx11
-rw-r--r--configmgr/source/backend/binaryreader.cxx26
-rw-r--r--configmgr/source/backend/binaryreader.hxx9
-rw-r--r--configmgr/source/backend/binaryreadhandler.cxx135
-rw-r--r--configmgr/source/backend/binaryreadhandler.hxx14
-rw-r--r--configmgr/source/backend/binarytype.hxx2
-rw-r--r--configmgr/source/backend/binarywritehandler.cxx68
-rw-r--r--configmgr/source/backend/binarywritehandler.hxx10
-rw-r--r--configmgr/source/backend/binarywriter.cxx4
-rw-r--r--configmgr/source/backend/binarywriter.hxx4
-rw-r--r--configmgr/source/backend/componentdatahelper.cxx158
-rw-r--r--configmgr/source/backend/componentdatahelper.hxx119
-rw-r--r--configmgr/source/backend/emptylayer.cxx20
-rw-r--r--configmgr/source/backend/emptylayerimpl.hxx17
-rw-r--r--configmgr/source/backend/importmergehandler.cxx66
-rw-r--r--configmgr/source/backend/importmergehandler.hxx57
-rw-r--r--configmgr/source/backend/importsvc.cxx58
-rw-r--r--configmgr/source/backend/importsvc.hxx42
-rw-r--r--configmgr/source/backend/layerdefaultremover.cxx50
-rw-r--r--configmgr/source/backend/layerdefaultremover.hxx55
-rw-r--r--configmgr/source/backend/layermerge.cxx105
-rw-r--r--configmgr/source/backend/layermerge.hxx85
-rw-r--r--configmgr/source/backend/layerupdate.cxx15
-rw-r--r--configmgr/source/backend/layerupdate.hxx19
-rw-r--r--configmgr/source/backend/layerupdatebuilder.cxx34
-rw-r--r--configmgr/source/backend/layerupdatebuilder.hxx19
-rw-r--r--configmgr/source/backend/layerupdatehandler.cxx70
-rw-r--r--configmgr/source/backend/layerupdatehandler.hxx68
-rw-r--r--configmgr/source/backend/layerupdatemerger.cxx72
-rw-r--r--configmgr/source/backend/layerupdatemerger.hxx54
-rw-r--r--configmgr/source/backend/mergedcomponentdata.cxx12
-rw-r--r--configmgr/source/backend/mergedcomponentdata.hxx16
-rw-r--r--configmgr/source/backend/multistratumbackend.cxx78
-rw-r--r--configmgr/source/backend/multistratumbackend.hxx19
-rw-r--r--configmgr/source/backend/schemabuilder.cxx93
-rw-r--r--configmgr/source/backend/schemabuilder.hxx60
-rw-r--r--configmgr/source/backend/singlebackendadapter.cxx12
-rw-r--r--configmgr/source/backend/singlebackendadapter.hxx7
-rw-r--r--configmgr/source/backend/updatedata.cxx70
-rw-r--r--configmgr/source/backend/updatedata.hxx95
-rw-r--r--configmgr/source/backend/updatedispatch.cxx136
-rw-r--r--configmgr/source/backend/updatedispatch.hxx22
-rw-r--r--configmgr/source/backend/updatesvc.cxx22
-rw-r--r--configmgr/source/backend/updatesvc.hxx24
-rw-r--r--configmgr/source/backendhelper/backendlayerhelper.cxx2
-rw-r--r--configmgr/source/backendhelper/backendlayerhelper.hxx8
-rw-r--r--configmgr/source/backendhelper/componentdf.cxx13
-rw-r--r--configmgr/source/data/anydata.cxx43
-rw-r--r--configmgr/source/data/makefile.mk2
-rw-r--r--configmgr/source/data/sequence.cxx103
-rw-r--r--configmgr/source/inc/anydata.hxx21
-rw-r--r--configmgr/source/inc/anynoderef.hxx39
-rw-r--r--configmgr/source/inc/anypair.hxx22
-rw-r--r--configmgr/source/inc/autoobject.hxx20
-rw-r--r--configmgr/source/inc/autoreferencemap.hxx30
-rw-r--r--configmgr/source/inc/backendfactory.hxx14
-rw-r--r--configmgr/source/inc/bootstrap.hxx57
-rw-r--r--configmgr/source/inc/bootstrapcontext.hxx48
-rw-r--r--configmgr/source/inc/bufferedfile.hxx7
-rw-r--r--configmgr/source/inc/builddata.hxx14
-rw-r--r--configmgr/source/inc/cacheddataprovider.hxx264
-rw-r--r--configmgr/source/inc/cachefactory.hxx5
-rw-r--r--configmgr/source/inc/change.hxx59
-rw-r--r--configmgr/source/inc/commontypes.hxx68
-rw-r--r--configmgr/source/inc/confapifactory.hxx48
-rw-r--r--configmgr/source/inc/confevents.hxx186
-rw-r--r--configmgr/source/inc/configdefaultprovider.hxx11
-rw-r--r--configmgr/source/inc/configexcept.hxx23
-rw-r--r--configmgr/source/inc/configgroup.hxx37
-rw-r--r--configmgr/source/inc/configpath.hxx219
-rw-r--r--configmgr/source/inc/configset.hxx153
-rw-r--r--configmgr/source/inc/confsvccomponent.hxx14
-rw-r--r--configmgr/source/inc/datalock.hxx8
-rw-r--r--configmgr/source/inc/defaultprovider.hxx49
-rw-r--r--configmgr/source/inc/filehelper.hxx2
-rw-r--r--configmgr/source/inc/flags.hxx3
-rw-r--r--configmgr/source/inc/groupnodeaccess.hxx111
-rw-r--r--configmgr/source/inc/interactionrequest.hxx6
-rw-r--r--configmgr/source/inc/localizedtreeactions.hxx4
-rw-r--r--configmgr/source/inc/logger.hxx25
-rw-r--r--configmgr/source/inc/matchlocale.hxx62
-rw-r--r--configmgr/source/inc/mergeddataprovider.hxx124
-rw-r--r--configmgr/source/inc/namecreator.hxx18
-rw-r--r--configmgr/source/inc/node.hxx108
-rw-r--r--configmgr/source/inc/nodeaccess.hxx77
-rw-r--r--configmgr/source/inc/nodechange.hxx27
-rw-r--r--configmgr/source/inc/nodechangeinfo.hxx36
-rw-r--r--configmgr/source/inc/noderef.hxx443
-rw-r--r--configmgr/source/inc/nodevisitor.hxx144
-rw-r--r--configmgr/source/inc/options.hxx20
-rw-r--r--configmgr/source/inc/oslstream.hxx12
-rw-r--r--configmgr/source/inc/pointer.hxx29
-rw-r--r--configmgr/source/inc/request.hxx43
-rw-r--r--configmgr/source/inc/requestoptions.hxx24
-rw-r--r--configmgr/source/inc/requesttypes.hxx99
-rw-r--r--configmgr/source/inc/roottree.hxx47
-rw-r--r--configmgr/source/inc/rttimacros.hxx58
-rw-r--r--configmgr/source/inc/sequence.hxx29
-rw-r--r--configmgr/source/inc/serviceinfohelper.hxx30
-rw-r--r--configmgr/source/inc/setnodeaccess.hxx140
-rw-r--r--configmgr/source/inc/simpleinteractionrequest.hxx17
-rw-r--r--configmgr/source/inc/template.hxx40
-rw-r--r--configmgr/source/inc/tree.hxx666
-rw-r--r--configmgr/source/inc/treeaccessor.hxx88
-rw-r--r--configmgr/source/inc/treeactions.hxx7
-rw-r--r--configmgr/source/inc/treechangefactory.hxx29
-rw-r--r--configmgr/source/inc/treechangelist.hxx36
-rw-r--r--configmgr/source/inc/treefragment.hxx25
-rw-r--r--configmgr/source/inc/treemanager.hxx131
-rw-r--r--configmgr/source/inc/treenodefactory.hxx5
-rw-r--r--configmgr/source/inc/treeprovider.hxx187
-rw-r--r--configmgr/source/inc/treesegment.hxx105
-rw-r--r--configmgr/source/inc/typeconverter.hxx4
-rw-r--r--configmgr/source/inc/types.hxx81
-rw-r--r--configmgr/source/inc/updatehelper.hxx23
-rw-r--r--configmgr/source/inc/utility.hxx111
-rw-r--r--configmgr/source/inc/valuenode.hxx45
-rw-r--r--configmgr/source/inc/valuenodeaccess.hxx128
-rw-r--r--configmgr/source/inc/valueref.hxx42
-rw-r--r--configmgr/source/inc/valuetypeconverter.hxx39
-rw-r--r--configmgr/source/localbe/localdataimportsvc.cxx30
-rw-r--r--configmgr/source/localbe/localdataimportsvc.hxx17
-rw-r--r--configmgr/source/localbe/localfilehelper.cxx33
-rw-r--r--configmgr/source/localbe/localfilehelper.hxx2
-rw-r--r--configmgr/source/localbe/localfilelayer.cxx25
-rw-r--r--configmgr/source/localbe/localfilelayer.hxx12
-rw-r--r--configmgr/source/localbe/localhierarchybrowsersvc.cxx125
-rw-r--r--configmgr/source/localbe/localhierarchybrowsersvc.hxx21
-rw-r--r--configmgr/source/localbe/localmultistratum.cxx47
-rw-r--r--configmgr/source/localbe/localmultistratum.hxx6
-rw-r--r--configmgr/source/localbe/localschemasupplier.cxx12
-rw-r--r--configmgr/source/localbe/localschemasupplier.hxx6
-rw-r--r--configmgr/source/localbe/localsinglebackend.cxx38
-rw-r--r--configmgr/source/localbe/localsinglebackend.hxx8
-rw-r--r--configmgr/source/localbe/localsinglestratum.cxx18
-rw-r--r--configmgr/source/localbe/localsinglestratum.hxx6
-rw-r--r--configmgr/source/localbe/localstratumbase.cxx16
-rw-r--r--configmgr/source/localbe/localstratumbase.hxx7
-rw-r--r--configmgr/source/misc/anypair.cxx62
-rw-r--r--configmgr/source/misc/bootstrap.cxx98
-rw-r--r--configmgr/source/misc/bootstrapcontext.cxx59
-rw-r--r--configmgr/source/misc/configunoreg.cxx63
-rw-r--r--configmgr/source/misc/filehelper.cxx124
-rw-r--r--configmgr/source/misc/logger.cxx8
-rw-r--r--configmgr/source/misc/mergechange.cxx126
-rw-r--r--configmgr/source/misc/oslstream.cxx42
-rw-r--r--configmgr/source/misc/providerfactory.cxx32
-rw-r--r--configmgr/source/misc/providerfactory.hxx29
-rw-r--r--configmgr/source/misc/providerwrapper.cxx46
-rw-r--r--configmgr/source/misc/providerwrapper.hxx32
-rw-r--r--configmgr/source/misc/requestoptions.cxx8
-rw-r--r--configmgr/source/misc/serviceinfohelper.cxx44
-rw-r--r--configmgr/source/misc/simpleinteractionrequest.cxx12
-rw-r--r--configmgr/source/misc/tracer.cxx6
-rw-r--r--configmgr/source/platformbe/componentdefn.cxx13
-rw-r--r--configmgr/source/platformbe/systemintegrationmanager.cxx43
-rw-r--r--configmgr/source/platformbe/systemintegrationmanager.hxx31
-rw-r--r--configmgr/source/registry/cfgregistrykey.cxx679
-rw-r--r--configmgr/source/registry/cfgregistrykey.hxx5
-rw-r--r--configmgr/source/registry/configregistry.cxx109
-rw-r--r--configmgr/source/registry/configregistry.hxx6
-rw-r--r--configmgr/source/tree/builddata.cxx594
-rw-r--r--configmgr/source/tree/changes.cxx21
-rw-r--r--configmgr/source/tree/cmtree.cxx60
-rw-r--r--configmgr/source/tree/cmtreemodel.cxx46
-rw-r--r--configmgr/source/tree/localizedtreeactions.cxx92
-rw-r--r--configmgr/source/tree/makefile.mk2
-rw-r--r--configmgr/source/tree/mergehelper.cxx35
-rw-r--r--configmgr/source/tree/node.cxx271
-rw-r--r--configmgr/source/tree/nodeaccess.cxx185
-rw-r--r--configmgr/source/tree/nodeconverter.cxx10
-rw-r--r--configmgr/source/tree/nodevisitor.cxx232
-rw-r--r--configmgr/source/tree/subtree.hxx31
-rw-r--r--configmgr/source/tree/treechangefactory.cxx49
-rw-r--r--configmgr/source/tree/treefragment.cxx38
-rw-r--r--configmgr/source/tree/treesegment.cxx235
-rw-r--r--configmgr/source/tree/updatehelper.cxx410
-rw-r--r--configmgr/source/tree/valuenodeaccess.cxx174
-rw-r--r--configmgr/source/treecache/cacheaccess.cxx77
-rw-r--r--configmgr/source/treecache/cacheaccess.hxx52
-rw-r--r--configmgr/source/treecache/cachecontroller.cxx177
-rw-r--r--configmgr/source/treecache/cachecontroller.hxx158
-rw-r--r--configmgr/source/treecache/cachedata.cxx154
-rw-r--r--configmgr/source/treecache/cachedata.hxx70
-rw-r--r--configmgr/source/treecache/cachefactory.cxx13
-rw-r--r--configmgr/source/treecache/cacheline.cxx140
-rw-r--r--configmgr/source/treecache/cacheline.hxx63
-rw-r--r--configmgr/source/treecache/cachemulticaster.cxx60
-rw-r--r--configmgr/source/treecache/cachemulticaster.hxx42
-rw-r--r--configmgr/source/treecache/cachewritescheduler.cxx6
-rw-r--r--configmgr/source/treecache/cachewritescheduler.hxx5
-rw-r--r--configmgr/source/treecache/disposetimer.cxx33
-rw-r--r--configmgr/source/treecache/disposetimer.hxx10
-rw-r--r--configmgr/source/treecache/invalidatetree.cxx44
-rw-r--r--configmgr/source/treecache/treemanager.cxx285
-rw-r--r--configmgr/source/treemgr/collectchanges.cxx14
-rw-r--r--configmgr/source/treemgr/collectchanges.hxx20
-rw-r--r--configmgr/source/treemgr/configdefaultprovider.cxx28
-rw-r--r--configmgr/source/treemgr/configexcept.cxx36
-rw-r--r--configmgr/source/treemgr/configgroup.cxx94
-rw-r--r--configmgr/source/treemgr/configpath.cxx227
-rw-r--r--configmgr/source/treemgr/configset.cxx432
-rw-r--r--configmgr/source/treemgr/defaultproviderproxy.cxx8
-rw-r--r--configmgr/source/treemgr/defaultproviderproxy.hxx13
-rw-r--r--configmgr/source/treemgr/deferredview.cxx103
-rw-r--r--configmgr/source/treemgr/deferredview.hxx22
-rw-r--r--configmgr/source/treemgr/directview.cxx19
-rw-r--r--configmgr/source/treemgr/directview.hxx10
-rw-r--r--configmgr/source/treemgr/groupnodeimpl.hxx20
-rw-r--r--configmgr/source/treemgr/nodechange.cxx44
-rw-r--r--configmgr/source/treemgr/nodechangeimpl.cxx117
-rw-r--r--configmgr/source/treemgr/nodechangeimpl.hxx141
-rw-r--r--configmgr/source/treemgr/nodechangeinfo.cxx28
-rw-r--r--configmgr/source/treemgr/nodefactory.cxx88
-rw-r--r--configmgr/source/treemgr/nodefactory.hxx22
-rw-r--r--configmgr/source/treemgr/nodeimpl.cxx140
-rw-r--r--configmgr/source/treemgr/nodeimpl.hxx25
-rw-r--r--configmgr/source/treemgr/nodeimplobj.cxx382
-rw-r--r--configmgr/source/treemgr/nodeimplobj.hxx59
-rw-r--r--configmgr/source/treemgr/noderef.cxx1328
-rw-r--r--configmgr/source/treemgr/readonlyview.cxx8
-rw-r--r--configmgr/source/treemgr/readonlyview.hxx6
-rw-r--r--configmgr/source/treemgr/roottree.cxx49
-rw-r--r--configmgr/source/treemgr/roottreeimpl.hxx17
-rw-r--r--configmgr/source/treemgr/setnodeimpl.cxx368
-rw-r--r--configmgr/source/treemgr/setnodeimpl.hxx134
-rw-r--r--configmgr/source/treemgr/template.cxx16
-rw-r--r--configmgr/source/treemgr/templateimpl.cxx108
-rw-r--r--configmgr/source/treemgr/templateimpl.hxx59
-rw-r--r--configmgr/source/treemgr/treeimpl.cxx969
-rw-r--r--configmgr/source/treemgr/treeimpl.hxx577
-rw-r--r--configmgr/source/treemgr/valuemembernode.cxx100
-rw-r--r--configmgr/source/treemgr/valuemembernode.hxx29
-rw-r--r--configmgr/source/treemgr/valuenodeimpl.hxx18
-rw-r--r--configmgr/source/treemgr/viewaccess.cxx6
-rw-r--r--configmgr/source/treemgr/viewaccess.hxx109
-rw-r--r--configmgr/source/treemgr/viewfactory.hxx8
-rw-r--r--configmgr/source/treemgr/viewnode.cxx31
-rw-r--r--configmgr/source/treemgr/viewnode.hxx102
-rw-r--r--configmgr/source/treemgr/viewstrategy.cxx313
-rw-r--r--configmgr/source/treemgr/viewstrategy.hxx105
-rw-r--r--configmgr/source/xml/basicparser.cxx50
-rw-r--r--configmgr/source/xml/basicparser.hxx32
-rw-r--r--configmgr/source/xml/elementformatter.cxx86
-rw-r--r--configmgr/source/xml/elementformatter.hxx27
-rw-r--r--configmgr/source/xml/elementinfo.hxx10
-rw-r--r--configmgr/source/xml/elementparser.cxx76
-rw-r--r--configmgr/source/xml/elementparser.hxx38
-rw-r--r--configmgr/source/xml/layerparser.cxx10
-rw-r--r--configmgr/source/xml/layerparser.hxx11
-rw-r--r--configmgr/source/xml/layerwriter.cxx54
-rw-r--r--configmgr/source/xml/layerwriter.hxx25
-rw-r--r--configmgr/source/xml/matchlocale.cxx113
-rw-r--r--configmgr/source/xml/parsersvc.cxx72
-rw-r--r--configmgr/source/xml/parsersvc.hxx14
-rw-r--r--configmgr/source/xml/schemaparser.cxx22
-rw-r--r--configmgr/source/xml/schemaparser.hxx11
-rw-r--r--configmgr/source/xml/typeconverter.cxx4
-rw-r--r--configmgr/source/xml/valueconverter.cxx111
-rw-r--r--configmgr/source/xml/valueformatter.cxx65
-rw-r--r--configmgr/source/xml/valueformatter.hxx9
-rw-r--r--configmgr/source/xml/writersvc.cxx20
-rw-r--r--configmgr/source/xml/writersvc.hxx21
351 files changed, 11304 insertions, 17609 deletions
diff --git a/configmgr/prj/build.lst b/configmgr/prj/build.lst
index 1ef391627a..a3d93b598a 100644
--- a/configmgr/prj/build.lst
+++ b/configmgr/prj/build.lst
@@ -1,4 +1,4 @@
-cg configmgr : offapi comphelper cppuhelper tools vos NULL
+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
diff --git a/configmgr/qa/unit/makefile.mk b/configmgr/qa/unit/makefile.mk
index 856849dc68..4b57dabac7 100644
--- a/configmgr/qa/unit/makefile.mk
+++ b/configmgr/qa/unit/makefile.mk
@@ -55,9 +55,8 @@ ALLTAR: test
$(MISC)$/$(TARGET).rdb .ERRREMOVE:
$(COPY) $(SOLARBINDIR)$/types.rdb $@
regcomp -register -r $@ -c $(subst,$/,/ $(DLLDEST)$/configmgr2.uno$(DLLPOST))
- regcomp -register -r $@ -c $(subst,$/,/ $(SOLARLIBDIR)/typeconverter.uno$(DLLPOST))
regcomp -register -r $@ -c $(subst,$/,/ $(SOLARLIBDIR)/sax.uno$(DLLPOST))
- regcomp -register -r $@ -c $(subst,$/,/ $(SOLARLIBDIR)/simplereg.uno$(DLLPOST))
+ regcomp -register -r $@ -c $(subst,$/,/ $(SOLARLIBDIR)/stocservices.uno$(DLLPOST))
regcomp -register -r $@ -c $(subst,$/,/ $(SOLARLIBDIR)/streams.uno$(DLLPOST))
test .PHONY: $(SHL1TARGETN) $(MISC)$/$(TARGET).rdb
diff --git a/configmgr/qa/unit/performance.cxx b/configmgr/qa/unit/performance.cxx
index ee0db5055f..7a3e0475a4 100644
--- a/configmgr/qa/unit/performance.cxx
+++ b/configmgr/qa/unit/performance.cxx
@@ -33,8 +33,6 @@
#include "common.hxx"
-using namespace css;
-
void Test::setUp()
{
mpMagic = new Magic();
@@ -137,11 +135,11 @@ void Test::normalizePathKey (rtl::OString &rPath, rtl::OString &rKey)
}
}
-uno::Any Test::getKey (const sal_Char *pPath, rtl::OUString aName)
+css::uno::Any Test::getKey (const sal_Char *pPath, rtl::OUString aName)
{
- uno::Reference< container::XHierarchicalNameAccess > xNameAccess(
+ css::uno::Reference< css::container::XHierarchicalNameAccess > xNameAccess(
createView(pPath, false), css::uno::UNO_QUERY_THROW);
- uno::Any aVal;
+ css::uno::Any aVal;
aVal = xNameAccess->getByHierarchicalName (aName);
disposeComponent (xNameAccess);
return aVal;
@@ -149,11 +147,11 @@ uno::Any Test::getKey (const sal_Char *pPath, rtl::OUString aName)
void Test::setKey (const sal_Char *pPath, rtl::OUString aName, css::uno::Any a)
{
- uno::Reference< util::XChangesBatch > xAppView;
+ css::uno::Reference< css::util::XChangesBatch > xAppView;
- xAppView = uno::Reference< util::XChangesBatch > (
- createView(pPath, true), uno::UNO_QUERY_THROW );
- uno::Reference< container::XNameReplace > xSettings(xAppView, uno::UNO_QUERY_THROW);
+ 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
@@ -165,13 +163,13 @@ void Test::setKey (const sal_Char *pPath, rtl::OUString aName, css::uno::Any a)
void Test::resetKey (const sal_Char *pPath, rtl::OUString aName)
{
- uno::Reference< util::XChangesBatch > xAppView;
+ css::uno::Reference< css::util::XChangesBatch > xAppView;
// reset to default
- xAppView = uno::Reference< util::XChangesBatch > ( createView(pPath, true), uno::UNO_QUERY_THROW );
- uno::Reference< container::XNameReplace > xSettings(xAppView, uno::UNO_QUERY_THROW);
+ 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);
- uno::Reference< beans::XPropertyState > xSettingsState(xSettings, uno::UNO_QUERY);
+ css::uno::Reference< css::beans::XPropertyState > xSettingsState(xSettings, css::uno::UNO_QUERY);
xSettingsState->setPropertyToDefault(aName);
xAppView->commitChanges();
@@ -194,7 +192,7 @@ void Test::keySet()
try {
setKey ("/org.openoffice.Setup/Test",
rtl::OUString::createFromAscii("AString"),
- uno::makeAny (rtl::OUString::createFromAscii("baa")));
+ css::uno::makeAny (rtl::OUString::createFromAscii("baa")));
// check value
rtl::OUString aStr;
@@ -229,14 +227,14 @@ void Test::readCommands()
rtl::OUString aPropProperties( RTL_CONSTASCII_USTRINGPARAM( "Properties" ));
try {
- uno::Reference< container::XNameAccess > xNameAccess (
+ 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());
- uno::Any a;
- uno::Sequence< rtl::OUString > aNameSeq = xNameAccess->getElementNames();
+ 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();
@@ -247,7 +245,7 @@ void Test::readCommands()
try
{
{
- uno::Reference< container::XNameAccess > xChildNameAccess;
+ 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.
diff --git a/configmgr/qa/unit/threading.cxx b/configmgr/qa/unit/threading.cxx
index 44eca185f7..b04f7c3550 100644
--- a/configmgr/qa/unit/threading.cxx
+++ b/configmgr/qa/unit/threading.cxx
@@ -169,9 +169,7 @@ void Test::threadTests()
} CATCH_FAIL ("checking keys exist")
}
-typedef ::cppu::WeakImplHelper1< css::beans::XPropertyChangeListener > ListenerBase;
-
-class RecursiveListener : public ListenerBase
+class RecursiveListener : public cppu::WeakImplHelper1< css::beans::XPropertyChangeListener >
{
public:
sal_Int32 m_nRecurse;
@@ -183,8 +181,7 @@ public:
public:
RecursiveListener (Test *pTest, int nCount,
const char *pPath, const char *pKey)
- : ListenerBase()
- , m_nRecurse (nCount)
+ : m_nRecurse (nCount)
, m_pTest (pTest)
, m_pPath (pPath)
, m_pKey (pKey)
@@ -201,8 +198,8 @@ public:
disposeComponent (mxPropSet);
}
- virtual void SAL_CALL acquire() throw() { ListenerBase::acquire(); }
- virtual void SAL_CALL release() throw() { ListenerBase::acquire(); }
+ 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)
{
diff --git a/configmgr/source/api/confeventhelpers.cxx b/configmgr/source/api/confeventhelpers.cxx
deleted file mode 100644
index 1d9811f996..0000000000
--- a/configmgr/source/api/confeventhelpers.cxx
+++ /dev/null
@@ -1,362 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: confeventhelpers.cxx,v $
- * $Revision: 1.17 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <stdio.h>
-#include <string.h>
-#include "confeventhelpers.hxx"
-#include "configexcept.hxx"
-#include "change.hxx"
-#include "treechangelist.hxx"
-#include <osl/diagnose.h>
-
-#ifndef INCLUDED_ALGORITHM
-#include <algorithm>
-#define INCLUDED_ALGORITHM
-#endif
-
-namespace configmgr
-{
- namespace internal
- {
-
-////////////////////////////////////////////////////////////////////////
- using namespace configuration;
- namespace Path = configuration::Path;
-
-/////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////
-ConfigChangesBroadcasterImpl::ConfigChangesBroadcasterImpl()
-{
-}
-
-/////////////////////////////////////////////////////////////////////////
-ConfigChangesBroadcasterImpl::~ConfigChangesBroadcasterImpl()
-{
- OSL_ENSURE(m_aListeners.begin() == m_aListeners.end(), "Remaining listeners found - forgot to dispose ?");
- OSL_ENSURE(m_aPathMap.empty(), "Spurious mappings found");
-}
-
-/////////////////////////////////////////////////////////////////////////
-void ConfigChangesBroadcasterImpl::add(AbsolutePath const& aName, INodeListenerRef const& pListener)
-{
- osl::MutexGuard aGuard(m_aListeners.mutex);
-
- InfoRef aAdded = m_aListeners.addListener(NodeListenerInfo(pListener));
- aAdded->addPath(aName);
- m_aPathMap.insert(PathMap::value_type(aName,aAdded));
-}
-
-/////////////////////////////////////////////////////////////////////////
-void ConfigChangesBroadcasterImpl::remove(INodeListenerRef const& pListener)
-{
- osl::MutexGuard aGuard(m_aListeners.mutex);
-
- Listeners::Iterator const iter = m_aListeners.find(pListener);
- if (iter != m_aListeners.end())
- {
- typedef NodeListenerInfo::Pathes Pathes;
- Pathes const& pathes = iter->pathList();
-
- // first clear the Path Map
- for(Pathes::iterator itPath = pathes.begin(); itPath != pathes.end(); ++itPath)
- {
- typedef PathMap::iterator PMIter;
- typedef std::pair<PMIter, PMIter> PMRange;
-
- PMRange aRange = m_aPathMap.equal_range(*itPath);
- while (aRange.first != aRange.second)
- {
- PMIter 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, RelativePath& aRelativePath, RemoveNode const*& pRemoveNode)
-{
- RelativePath::Iterator aIter;
-
- OSL_ASSERT(pRemoveNode == NULL);
- pRemoveNode = NULL;
-
- Change const* pChange = &rChange;
- if (rChange.ISA(RemoveNode))
- pRemoveNode = static_cast<RemoveNode const*>(pChange);
-
- RelativePath::Iterator const aEnd(aRelativePath.end());
-
- for( aIter = aRelativePath.begin();
- aIter != aEnd;
- ++aIter)
- {
- OSL_ASSERT( pChange != NULL );
-
- pChange = pChange->getSubChange(aIter->getName().toString());
-
- if (pChange == NULL) break;
-
- OSL_ASSERT(pRemoveNode == NULL);
- OSL_ASSERT(aIter->getName().toString() == pChange->getNodeName());
-
- if (pChange->ISA(RemoveNode))
- pRemoveNode = static_cast<RemoveNode const*>(pChange);
- }
-
- if (pRemoveNode)
- {
- aRelativePath = RelativePath( Path::Rep(aRelativePath.begin(),aIter) );
- OSL_ASSERT( aRelativePath.getLocalName().getName().toString() == pRemoveNode->getNodeName());
- }
- else
- OSL_ASSERT( pChange == 0 || configuration::matches(aRelativePath, RelativePath( Path::Rep(aRelativePath.begin(),aIter) )) );
-
- return pChange;
-}
-
-/////////////////////////////////////////////////////////////////////////
-void ConfigChangesBroadcasterImpl::dispatchInner
-(
- INodeListenerRef const& pTarget,
- AbsolutePath const& _aTargetPath,
- Change const& rBaseChange,
- AbsolutePath const& _aChangeLocation,
- sal_Bool , //_bError,
- IConfigBroadcaster* pSource
-)
-{
- using namespace configuration;
- try
- {
- OSL_ASSERT(pTarget.is());
- OSL_ASSERT( Path::hasPrefix( _aTargetPath, _aChangeLocation ) );
-
- RelativePath aLocalPath = 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 (InvalidName& )
- {
- OSL_ENSURE(false,"ConfigChangesBroadcasterImpl: Could not dispatch notification: context path mismatch");
- }
-}
-
-/////////////////////////////////////////////////////////////////////////
-void ConfigChangesBroadcasterImpl::dispatchOuter
-(
- INodeListenerRef const& pTarget,
- AbsolutePath const& _aTargetPath,
- Change const& rBaseChange,
- AbsolutePath const& _aChangeLocation,
- sal_Bool , //_bError,
- IConfigBroadcaster* pSource
-)
-{
- { (void)_aTargetPath; }
- OSL_ASSERT(pTarget.is());
- OSL_ASSERT( Path::hasPrefix( _aChangeLocation, _aTargetPath) );
-
- pTarget->nodeChanged(rBaseChange, _aChangeLocation, pSource);
-}
-
-/////////////////////////////////////////////////////////////////////////
-void ConfigChangesBroadcasterImpl::dispatch(TreeChangeList const& rList_, sal_Bool _bError, IConfigBroadcaster* pSource)
-{
- dispatch(rList_.root, rList_.getRootNodePath(),_bError, pSource);
-}
-/////////////////////////////////////////////////////////////////////////
-namespace
-{
- struct DispatchTarget
- {
- DispatchTarget(INodeListenerRef _pTarget, AbsolutePath const* _pDispatchPath)
- : pTarget(_pTarget), pDispatchPath( _pDispatchPath) {}
-
- INodeListenerRef pTarget;
- AbsolutePath const* pDispatchPath;
- };
- typedef std::vector<DispatchTarget> DispatchTargets;
-}
-/////////////////////////////////////////////////////////////////////////
-void ConfigChangesBroadcasterImpl::dispatch
-(
- Change const& rBaseChange,
- AbsolutePath const& _aChangeLocation,
- sal_Bool _bError,
- IConfigBroadcaster* 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
- DispatchTargets aOuterTargets;
- if (_aChangeLocation.getDepth() > 1)
- {
- AbsolutePath const aModulePath( 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 ( Path::hasPrefix(_aChangeLocation,itOuter->first) )
- {
- aOuterTargets.push_back( DispatchTarget(itOuter->second->get(), &itOuter->first) );
- }
- ++itOuter;
- }
- }
-
- // Dispatch listeners to descendants of the change root
- DispatchTargets aInnerTargets;
- {
- PathMap::const_iterator itInner = m_aPathMap.lower_bound(_aChangeLocation);
-
- while( itInner != m_aPathMap.end() && 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 (DispatchTargets::const_iterator it = aOuterTargets.begin(); it != aOuterTargets.end(); ++it){
- this->dispatchOuter(it->pTarget, *it->pDispatchPath, rBaseChange, _aChangeLocation, _bError, pSource);
- }}
- {for (DispatchTargets::const_iterator it = aInnerTargets.begin(); it != aInnerTargets.end(); ++it){
- this->dispatchInner(it->pTarget, *it->pDispatchPath, rBaseChange, _aChangeLocation, _bError, pSource);
- }}
-}
-
-/////////////////////////////////////////////////////////////////////////
-void ConfigChangesBroadcasterImpl::disposing(IConfigBroadcaster* pSource)
-{
- osl::ClearableMutexGuard aGuard(m_aListeners.mutex);
- m_aPathMap.clear();
-
- aGuard.clear();
- m_aListeners.disposing(pSource);
-}
-
-/////////////////////////////////////////////////////////////////////////
-/* class ConfigMessageBroadcasterImpl
- {
- public:
- private:
- typedef BroadcastImplHelper<INodeListener*> Listeners;
- Listeners m_aListeners;
- };
-*/
-/////////////////////////////////////////////////////////////////////////
-/*void ConfigMessageBroadcasterImpl::add(IMessageHandler* pListener)
-{
- osl::MutexGuard aGuard(m_aListeners.mutex);
-
- m_aListeners.addListener(pListener);
-}
-
-/////////////////////////////////////////////////////////////////////////
-void ConfigMessageBroadcasterImpl::remove(IMessageHandler* pListener)
-{
- osl::MutexGuard aGuard(m_aListeners.mutex);
-
- m_aListeners.removeListener(pListener);
-}
-
-/////////////////////////////////////////////////////////////////////////
-void ConfigMessageBroadcasterImpl::dispatch(OUString const& _rNotifyReason, sal_Int32 _nNotificationId, IConfigBroadcaster* pSource)
-{
- osl::MutexGuard aGuard(m_aListeners.mutex);
-
- for (Listeners::Iterator it = m_aListeners.begin(); it != m_aListeners.end(); )
- {
- // incrementing here allows a listener to remove itself from within the callback
-
- // it is illegal to cause removal of another listener from the callback
- // if this occurs (dereferencing, incrementing or comparing 'it' fails)
- // we need to explicitly guard against that (which is really too expensive)
-
- IMessageHandler* pHandler = *it;
- ++it;
-
- if (pHandler)
- pHandler->message(_rNotifyReason,_nNotificationId,pSource);
- }
-
-}
-
-/////////////////////////////////////////////////////////////////////////
-void ConfigMessageBroadcasterImpl::disposing(IConfigBroadcaster* pSource)
-{
- osl::MutexGuard aGuard(m_aListeners.mutex);
-
- m_aListeners.disposing(pSource);
-}
-*/
-/////////////////////////////////////////////////////////////////////////
- } // namespace
-} // namespace
-
-
-
diff --git a/configmgr/source/api/confeventhelpers.hxx b/configmgr/source/api/confeventhelpers.hxx
deleted file mode 100644
index 319531e06b..0000000000
--- a/configmgr/source/api/confeventhelpers.hxx
+++ /dev/null
@@ -1,204 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: confeventhelpers.hxx,v $
- * $Revision: 1.12 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public 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_EVENTHELPERS_HXX_
-#define CONFIGMGR_API_EVENTHELPERS_HXX_
-
-#include "confevents.hxx"
-#include "configpath.hxx"
-#include <com/sun/star/uno/RuntimeException.hpp>
-#include <osl/diagnose.h>
-#include <osl/mutex.hxx>
-
-#ifndef INCLUDED_MAP
-#include <map>
-#define INCLUDED_MAP
-#endif
-#ifndef INCLUDED_FUNCTIONAL
-#include <functional>
-#define INCLUDED_FUNCTIONAL
-#endif
-#include <hash_set>
-#ifndef INCLUDED_SET
-#include <set>
-#define INCLUDED_SET
-#endif
-
-namespace configmgr
-{
- namespace internal
- {
-
- using namespace configuration;
- ////////////////////////////////////////////////////////////////////////
- template <class ListenerRef>
- class BroadcastImplHelper
- {
- public:
- osl::Mutex mutex;
-
- public:
- BroadcastImplHelper()
- {}
-
- ~BroadcastImplHelper()
- {
- OSL_ENSURE(m_aInterfaces.empty(), "Configuration Broadcaster was not disposed properly");
- }
-
- public:
- typedef std::set<ListenerRef> Interfaces;
- typedef typename Interfaces::iterator FullIterator;
- typedef typename Interfaces::const_iterator Iterator;
-
- public:
- FullIterator addListener(ListenerRef aListener)
- {
- return m_aInterfaces.insert(aListener).first;
- }
- void removeListener(ListenerRef aListener)
- {
- m_aInterfaces.erase(aListener);
- }
-
- void disposing(IConfigBroadcaster* pSource);
-
- public:
- Iterator begin() const { return m_aInterfaces.begin(); }
- Iterator end() const { return m_aInterfaces.end(); }
-
- Iterator find(ListenerRef aListener) const { return m_aInterfaces.find(aListener); }
- FullIterator findFull(ListenerRef aListener) { return m_aInterfaces.find(aListener); }
- private:
- Interfaces m_aInterfaces;
-
- // no implementation - not copyable
- BroadcastImplHelper(BroadcastImplHelper&);
- void operator=(BroadcastImplHelper&);
- };
-
- ////////////////////////////////////////////////////////////////////////
- template <class Listener>
- void BroadcastImplHelper<Listener>::disposing(IConfigBroadcaster* pSource)
- {
- osl::ClearableMutexGuard aGuard(this->mutex); // ensure that no notifications are running
-
- Interfaces aTargets;
- aTargets.swap(m_aInterfaces);
-
- aGuard.clear();
- for(FullIterator it = aTargets.begin(); it != aTargets.end(); )
- {
- FullIterator cur = it++;
- if (*cur)
- (*cur)->disposing(pSource);
- }
- }
-
-
- /////////////////////////////////////////////////////////////////////////
-
- class NodeListenerInfo
- {
- public:
- typedef std::hash_set<AbsolutePath, Path::Hash, Path::Equiv> Pathes;
-
- public:
- NodeListenerInfo(INodeListenerRef const& pListener)
- : m_pListener(pListener)
- {
- }
-
- // path handling
- Pathes const& pathList() const { return m_aPathes; }
-
- void addPath(AbsolutePath const& sPath) const { m_aPathes.insert(sPath); }
- void removePath(AbsolutePath const& sPath) const { m_aPathes.erase(sPath); }
- //void removeChildPathes(OUString const& sPath);
-
- // behave as pointer for use as a 'reference' class
- INodeListenerRef get() const { return m_pListener; }
- INodeListenerRef operator->() const { return get(); }
- INodeListener& operator*() const { return *m_pListener; }
- // needed to allow if (info) ...
- struct HasListener;
- operator HasListener const*() const { return reinterpret_cast<HasListener*>(m_pListener.get()); }
-
- bool operator < (NodeListenerInfo const& aInfo) const
- { return std::less<INodeListener*>()(m_pListener.get(), aInfo.m_pListener.get()); }
-
- bool operator == (NodeListenerInfo const& aInfo) const
- { return !!( m_pListener == aInfo.m_pListener); }
-
- bool operator > (NodeListenerInfo const& aInfo) const
- { return aInfo.operator < (*this); }
- bool operator >= (NodeListenerInfo const& aInfo) const
- { return !operator<(aInfo); }
- bool operator <= (NodeListenerInfo const& aInfo) const
- { return !operator>(aInfo); }
-
- bool operator != (NodeListenerInfo const& aInfo) const
- { return !operator==(aInfo); }
-
- private:
- INodeListenerRef m_pListener;
- mutable Pathes m_aPathes; // hack to be mutable even as set element
- };
- class ConfigChangesBroadcasterImpl
- {
- public:
- ConfigChangesBroadcasterImpl();
- ~ConfigChangesBroadcasterImpl();
-
- void add(AbsolutePath const& aPath, INodeListenerRef const& pListener);
- void remove(INodeListenerRef const& pListener);
-
-// void removed(OUString const& aPath, bool bRemovedFromModel, IConfigBroadcaster* pSource);
-
- void dispatch(Change const& rBaseChange, AbsolutePath const& sChangeLocation, sal_Bool _bError, IConfigBroadcaster* pSource);
- void dispatch(TreeChangeList const& rList_, sal_Bool _bError, IConfigBroadcaster* pSource);
- void disposing(IConfigBroadcaster* pSource);
- private:
- typedef BroadcastImplHelper<NodeListenerInfo> Listeners;
- typedef Listeners::FullIterator InfoRef;
- typedef std::multimap<AbsolutePath, InfoRef, Path::Before> PathMap;
- Listeners m_aListeners;
- PathMap m_aPathMap;
- private:
- void dispatchInner(INodeListenerRef const& pTarget, AbsolutePath const& sTargetPath, Change const& rBaseChange, AbsolutePath const& sChangeLocation, sal_Bool _bError, IConfigBroadcaster* pSource);
- void dispatchOuter(INodeListenerRef const& pTarget, AbsolutePath const& sTargetPath, Change const& rBaseChange, AbsolutePath const& sChangeLocation, sal_Bool _bError, IConfigBroadcaster* pSource);
- };
-
- /////////////////////////////////////////////////////////////////////////
- } // namespace
-} // namespace
-
-#endif // CONFIGMGR_API_EVENTHELPERS_HXX_
-
-
diff --git a/configmgr/source/api/confevents.cxx b/configmgr/source/api/confevents.cxx
index a1e4e59537..b99cd9b1f7 100644
--- a/configmgr/source/api/confevents.cxx
+++ b/configmgr/source/api/confevents.cxx
@@ -34,123 +34,270 @@
#include <stdio.h>
#include <string.h>
#include "confevents.hxx"
-#include "confeventhelpers.hxx"
+#include "configexcept.hxx"
#include "treechangelist.hxx"
#include <osl/diagnose.h>
namespace configmgr
{
/////////////////////////////////////////////////////////////////////////
- using internal::ConfigChangesBroadcasterImpl;
-
- /////////////////////////////////////////////////////////////////////////
- class ConfigChangeBroadcastHelper // broadcasts changes for a given set of options
- {
- ConfigChangesBroadcasterImpl m_changes;
- public:
- ConfigChangeBroadcastHelper();
- ~ConfigChangeBroadcastHelper();
-
- void broadcast(TreeChangeList const& anUpdate, sal_Bool bError, IConfigBroadcaster* pSource);
-
- public:
- // IConfigBroadcaster implementation helper
- void addListener(AbsolutePath const& aName, INodeListenerRef const& );
- void removeListener(INodeListenerRef const&);
-
- void dispose(IConfigBroadcaster* pSource);
- };
-
- /////////////////////////////////////////////////////////////////////////
- ConfigChangeBroadcaster::ConfigChangeBroadcaster()
- {
- }
-
- ConfigChangeBroadcaster::~ConfigChangeBroadcaster()
- {
- }
-
- /////////////////////////////////////////////////////////////////////////
ConfigChangeBroadcastHelper::ConfigChangeBroadcastHelper()
- : m_changes()
{
}
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(IConfigBroadcaster* pSource)
+ void ConfigChangeBroadcastHelper::dispose(TreeManager * pSource)
{
- m_changes.disposing(pSource);
+ disposing(pSource);
}
/////////////////////////////////////////////////////////////////////////
- // IConfigBroadcaster implementation
- void ConfigChangeBroadcaster::addListener(AbsolutePath const& aName, RequestOptions const & _aOptions, INodeListenerRef const& pHandler)
+ void ConfigChangeBroadcastHelper::addListener(configuration::AbsolutePath const& aName, rtl::Reference<INodeListener> const& pHandler)
{
- if (ConfigChangeBroadcastHelper* pHelper = getBroadcastHelper(_aOptions,true))
- {
- pHelper->addListener(aName, pHandler);
- }
- else
- OSL_ASSERT(false);
+ add(aName, pHandler);
}
- void ConfigChangeBroadcaster::removeListener(RequestOptions const & _aOptions, INodeListenerRef const& pHandler)
+ void ConfigChangeBroadcastHelper::removeListener(rtl::Reference<INodeListener> const& pHandler)
{
- if (ConfigChangeBroadcastHelper* pHelper = getBroadcastHelper(_aOptions,false))
- {
- pHelper->removeListener( pHandler);
- }
+ remove(pHandler);
}
/////////////////////////////////////////////////////////////////////////
- void ConfigChangeBroadcaster::fireChanges(TreeChangeList const& rList_, sal_Bool bError_)
+ 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())
{
- if (ConfigChangeBroadcastHelper* pHelper = getBroadcastHelper(rList_.getOptions(),false))
+ internal::NodeListenerInfo::Pathes const& pathes = iter->pathList();
+
+ // first clear the Path Map
+ for(internal::NodeListenerInfo::Pathes::iterator itPath = pathes.begin(); itPath != pathes.end(); ++itPath)
{
- pHelper->broadcast(rList_, bError_, this);
+ 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);
}
+}
- /////////////////////////////////////////////////////////////////////////
- ConfigChangeBroadcastHelper* ConfigChangeBroadcaster::newBroadcastHelper()
+/////////////////////////////////////////////////////////////////////////
+// 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)
{
- return new ConfigChangeBroadcastHelper();
+ 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);
}
- /////////////////////////////////////////////////////////////////////////
- void ConfigChangeBroadcaster::disposeBroadcastHelper(ConfigChangeBroadcastHelper* pHelper)
+
+ if (pRemoveNode)
{
- if (pHelper)
- {
- pHelper->dispose(this);
- delete pHelper;
- }
- }
- /////////////////////////////////////////////////////////////////////////
- // IConfigBroadcaster implementation help
- void ConfigChangeBroadcastHelper::addListener(AbsolutePath const& aName, INodeListenerRef const& pHandler)
- {
- m_changes.add(aName, pHandler);
+ 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);
- void ConfigChangeBroadcastHelper::removeListener(INodeListenerRef const& pHandler)
- {
- m_changes.remove(pHandler);
}
+ catch (configuration::InvalidName& )
+ {
+ OSL_ENSURE(false,"ConfigChangeBroadcastHelper: Could not dispatch notification: context path mismatch");
+ }
+}
-/* void ConfigChangeBroadcastHelper::removeNode(OUString const& aPath, bool bRemovedFromModel, IConfigBroadcaster* pSource)
- {
- m_changes.removed(aPath, bRemovedFromModel,pSource);
+/////////////////////////////////////////////////////////////////////////
+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;
+ }
}
-*/
- /////////////////////////////////////////////////////////////////////////
- void ConfigChangeBroadcastHelper::broadcast(TreeChangeList const& anUpdate, sal_Bool bError, IConfigBroadcaster* pSource)
+
+ // Dispatch listeners to descendants of the change root
+ std::vector<DispatchTarget> aInnerTargets;
{
- m_changes.dispatch(anUpdate, bError, pSource);
+ 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
index 88c7cce8b8..a47cf2a7c1 100644
--- a/configmgr/source/api/confsvccomponent.cxx
+++ b/configmgr/source/api/confsvccomponent.cxx
@@ -32,6 +32,7 @@
#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>
@@ -43,20 +44,20 @@ namespace configmgr {
ServiceComponentImpl::ServiceComponentImpl(ServiceImplementationInfo const* aInfo)
- : ServiceImplBase(UnoApiLock::getLock())
+ : ::cppu::WeakComponentImplHelper1< lang::XServiceInfo >(UnoApiLock::getLock())
, m_info(aInfo)
{
}
void ServiceComponentImpl::disposing()
{
- ServiceImplBase::disposing();
+ ::cppu::WeakComponentImplHelper1< lang::XServiceInfo >::disposing();
}
void ServiceComponentImpl::checkAlive() throw (uno::RuntimeException)
{
checkAlive("Object was disposed");
}
- void ServiceComponentImpl::checkAlive(OUString const& sMessage) throw (uno::RuntimeException)
+ void ServiceComponentImpl::checkAlive(rtl::OUString const& sMessage) throw (uno::RuntimeException)
{
if (rBHelper.bDisposed)
throw lang::DisposedException(sMessage, *this);
@@ -80,7 +81,7 @@ namespace configmgr {
}
// XServiceInfo
- OUString SAL_CALL ServiceComponentImpl::getImplementationName( ) throw(uno::RuntimeException)
+ rtl::OUString SAL_CALL ServiceComponentImpl::getImplementationName( ) throw(uno::RuntimeException)
{
return ServiceInfoHelper(m_info).getImplementationName();
}
@@ -90,7 +91,7 @@ namespace configmgr {
return ServiceInfoHelper(m_info).supportsService( ServiceName );
}
- uno::Sequence< OUString > SAL_CALL ServiceComponentImpl::getSupportedServiceNames( ) throw(uno::RuntimeException)
+ uno::Sequence< rtl::OUString > SAL_CALL ServiceComponentImpl::getSupportedServiceNames( ) throw(uno::RuntimeException)
{
return ServiceInfoHelper(m_info).getSupportedServiceNames( );
}
diff --git a/configmgr/source/api/makefile.mk b/configmgr/source/api/makefile.mk
index 06ef243578..d80b4c77b3 100644
--- a/configmgr/source/api/makefile.mk
+++ b/configmgr/source/api/makefile.mk
@@ -44,7 +44,6 @@ ENABLE_EXCEPTIONS=TRUE
SLOFILES= \
$(SLO)$/confevents.obj \
- $(SLO)$/confeventhelpers.obj \
$(SLO)$/confsvccomponent.obj
# --- Targets ----------------------------------
diff --git a/configmgr/source/api2/accessimpl.cxx b/configmgr/source/api2/accessimpl.cxx
index b53e4e3b4a..69098d7c12 100644
--- a/configmgr/source/api2/accessimpl.cxx
+++ b/configmgr/source/api2/accessimpl.cxx
@@ -59,22 +59,6 @@ namespace configmgr
namespace lang = css::lang;
namespace util = css::util;
- using uno::RuntimeException;
- using uno::Reference;
- using uno::Any;
- using uno::Sequence;
- using lang::NoSupportException;
-
- using configuration::AnyNodeRef;
- using configuration::NodeRef;
- using configuration::ValueRef;
-
- using configuration::Tree;
- using configuration::Name;
- using configuration::AbsolutePath;
- using configuration::RelativePath;
- using node::Attributes;
-
//-----------------------------------------------------------------------------------
// Constructors
//-----------------------------------------------------------------------------------
@@ -85,18 +69,18 @@ namespace configmgr
// XHierarchicalName
//------------------------------------------------------------------------------------------------------------------
-OUString implGetHierarchicalName( NodeAccess& rNode ) throw(RuntimeException)
+rtl::OUString implGetHierarchicalName( NodeAccess& rNode ) throw(uno::RuntimeException)
{
// RTL_LOGFILE_CONTEXT(aLog, "Configmgr::API::implGetHierarchicalName()");
- OUString sRet;
+ rtl::OUString sRet;
try
{
- GuardedNodeDataAccess lock( rNode );
+ GuardedNodeData<NodeAccess> lock( rNode );
- Tree aTree( lock.getTree());
+ rtl::Reference< configuration::Tree > aTree( lock.getTree());
- AbsolutePath const aFullPath = aTree.getAbsolutePath(lock.getNode());
+ configuration::AbsolutePath const aFullPath = aTree->getAbsolutePath(lock.getNode());
sRet = aFullPath.toString();
}
catch (configuration::Exception& ex)
@@ -110,21 +94,20 @@ OUString implGetHierarchicalName( NodeAccess& rNode ) throw(RuntimeException)
}
//------------------------------------------------------------------------------------------------------------------
-OUString implComposeHierarchicalName(NodeGroupInfoAccess& rNode, const OUString& sRelativeName )
- throw(css::lang::IllegalArgumentException, NoSupportException, RuntimeException)
+rtl::OUString implComposeHierarchicalName(NodeGroupInfoAccess& rNode, const rtl::OUString& sRelativeName )
+ throw(css::lang::IllegalArgumentException, lang::NoSupportException, uno::RuntimeException)
{
- using configuration::validateRelativePath; // should actually be found by "Koenig" lookup, but MSVC6 fails there
- OUString sRet;
+ rtl::OUString sRet;
try
{
- GuardedNodeDataAccess lock( rNode );
- NodeRef aNode( lock.getNode() );
- Tree aTree( lock.getTree() );
+ GuardedNodeData<NodeAccess> lock( rNode );
+ configuration::NodeRef aNode( lock.getNode() );
+ rtl::Reference< configuration::Tree > aTree( lock.getTree() );
- RelativePath const aAddedPath = validateRelativePath(sRelativeName, aTree, aNode);
+ configuration::RelativePath const aAddedPath = configuration::validateRelativePath(sRelativeName, aTree, aNode);
// TODO: add (relative) name validation based on node type - may then need provider lock
- AbsolutePath const aFullPath = aTree.getAbsolutePath(aNode).compose(aAddedPath);
+ configuration::AbsolutePath const aFullPath = aTree->getAbsolutePath(aNode).compose(aAddedPath);
sRet = aFullPath.toString();
}
@@ -146,22 +129,20 @@ OUString implComposeHierarchicalName(NodeGroupInfoAccess& rNode, const OUString&
}
//------------------------------------------------------------------------------------------------------------------
-OUString implComposeHierarchicalName(NodeSetInfoAccess& rNode, const OUString& sElementName )
- throw(css::lang::IllegalArgumentException, NoSupportException, RuntimeException)
+rtl::OUString implComposeHierarchicalName(NodeSetInfoAccess& rNode, const rtl::OUString& sElementName )
+ throw(css::lang::IllegalArgumentException, lang::NoSupportException, uno::RuntimeException)
{
- using configuration::validateElementPathComponent; // should actually be found by "Koenig" lookup, but MSVC6 fails there
- using configuration::Path::Component;
- OUString sRet;
+ rtl::OUString sRet;
try
{
- GuardedNodeDataAccess lock( rNode );
- NodeRef aNode( lock.getNode() );
- Tree aTree( lock.getTree() );
+ GuardedNodeData<NodeAccess> lock( rNode );
+ configuration::NodeRef aNode( lock.getNode() );
+ rtl::Reference< configuration::Tree > aTree( lock.getTree() );
- /*Path::*/Component const aAddedName = validateElementPathComponent(sElementName, aTree, aNode);
+ configuration::Path::Component const aAddedName = configuration::validateElementPathComponent(sElementName, aTree, aNode);
// TODO: add (relative) name validation based on node type - may then need provider lock
- AbsolutePath const aFullPath = aTree.getAbsolutePath(aNode).compose(aAddedName);
+ configuration::AbsolutePath const aFullPath = aTree->getAbsolutePath(aNode).compose(aAddedName);
sRet = aFullPath.toString();
}
@@ -190,7 +171,7 @@ OUString implComposeHierarchicalName(NodeSetInfoAccess& rNode, const OUString& s
//-----------------------------------------------------------------------------------
// for group nodes
-uno::Type implGetElementType(NodeGroupInfoAccess& rNode) throw(RuntimeException)
+uno::Type implGetElementType(NodeGroupInfoAccess& rNode) throw(uno::RuntimeException)
{
rNode.checkAlive();
// group nodes have a mix of types
@@ -199,14 +180,14 @@ uno::Type implGetElementType(NodeGroupInfoAccess& rNode) throw(RuntimeException)
}
// for set nodes
-uno::Type implGetElementType(NodeSetInfoAccess& rNode) throw(RuntimeException)
+uno::Type implGetElementType(NodeSetInfoAccess& rNode) throw(uno::RuntimeException)
{
uno::Type aRet;
try
{
GuardedNodeData<NodeSetInfoAccess> lock( rNode );
- aRet = rNode.getElementInfo().getElementType();
+ aRet = rNode.getElementInfo()->getInstanceType();
}
catch (configuration::Exception& ex)
{
@@ -219,7 +200,7 @@ uno::Type implGetElementType(NodeSetInfoAccess& rNode) throw(RuntimeException)
//-----------------------------------------------------------------------------------
// for group nodes
-sal_Bool implHasElements(NodeGroupInfoAccess& rNode) throw(RuntimeException)
+sal_Bool implHasElements(NodeGroupInfoAccess& rNode) throw(uno::RuntimeException)
{
// rNode.checkAlive();
// return true; // group nodes always have children
@@ -227,12 +208,12 @@ sal_Bool implHasElements(NodeGroupInfoAccess& rNode) throw(RuntimeException)
// Better: cater for the case where we are reaching the depth limit
try
{
- GuardedNodeDataAccess lock( rNode ); // no provider lock needed
+ GuardedNodeData<NodeAccess> lock( rNode ); // no provider lock needed
- Tree aThisTree( lock.getTree() );
- NodeRef aThisNode( lock.getNode() );
- OSL_ASSERT( !aThisTree.hasElements(aThisNode) );
- return aThisTree.hasChildren(aThisNode);
+ 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)
{
@@ -246,16 +227,16 @@ sal_Bool implHasElements(NodeGroupInfoAccess& rNode) throw(RuntimeException)
}
// for set nodes
-sal_Bool implHasElements(NodeSetInfoAccess& rNode) throw(RuntimeException)
+sal_Bool implHasElements(NodeSetInfoAccess& rNode) throw(uno::RuntimeException)
{
try
{
- GuardedNodeDataAccess lock( rNode ); // provider lock needed
+ GuardedNodeData<NodeAccess> lock( rNode ); // provider lock needed
- Tree aThisTree( lock.getTree() );
- NodeRef aThisNode( lock.getNode() );
- OSL_ASSERT( !aThisTree.hasChildren(aThisNode) );
- return aThisTree.hasElements(aThisNode);
+ 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)
{
@@ -275,79 +256,75 @@ sal_Bool implHasElements(NodeSetInfoAccess& rNode) throw(RuntimeException)
//------------------------------------------------------------------------------------------------------------------
namespace internal
{
- using namespace configuration;
- struct SearchExactName : private NodeVisitor
+ struct SearchExactName : private configuration::NodeVisitor
{
protected:
// warning: order dependency
- RelativePath aSearchPath;
- RelativePath::MutatingIterator pSearchComponent;
+ configuration::RelativePath aSearchPath;
+ std::vector<configuration::Path::Component>::reverse_iterator pSearchComponent;
public:
explicit
- SearchExactName(const RelativePath& aLookFor)
+ SearchExactName(const configuration::RelativePath& aLookFor)
: aSearchPath(aLookFor)
, pSearchComponent(aSearchPath.begin_mutate())
{}
bool complete() { return aSearchPath.end_mutate() == pSearchComponent; }
- bool search(NodeRef const& aNode, Tree const& aTree);
+ bool search(configuration::NodeRef const& aNode, rtl::Reference< configuration::Tree > const& aTree);
- RelativePath const& getBestMatch() const { return aSearchPath; }
+ configuration::RelativePath const& getBestMatch() const { return aSearchPath; }
private:
- bool findMatch(NodeRef& aNode, Tree& aTree);
- virtual Result handle(Tree const& aTree, NodeRef const&); // NodeVisitor
- virtual Result handle(Tree const& aTree, ValueRef const&); // NodeVisitor
+ 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(NodeRef& aNode, Tree& aTree)
+ bool SearchExactName::findMatch(configuration::NodeRef& aNode, rtl::Reference< configuration::Tree > & aTree)
{
OSL_ASSERT( !complete() );
if ( !aNode.isValid() ) return false;
- using configuration::hasChildOrElement;
- using configuration::findInnerChildOrAvailableElement;
-
// exact match ?
- if (!hasChildOrElement(aTree,aNode,*pSearchComponent))
+ if (!configuration::hasChildOrElement(aTree,aNode,*pSearchComponent))
{
- if (aTree.dispatchToChildren(aNode,*this) == CONTINUE) // not found there
+ if (aTree->dispatchToChildren(aNode,*this) == CONTINUE) // not found there
return false;
}
- OSL_ASSERT(hasChildOrElement(aTree,aNode,*pSearchComponent));
+ OSL_ASSERT(configuration::hasChildOrElement(aTree,aNode,*pSearchComponent));
- if (! findInnerChildOrAvailableElement(aTree,aNode,pSearchComponent->getName()) )
- aNode = NodeRef(); // will stop recursion (value or unloaded element found)
+ if (! configuration::findInnerChildOrAvailableElement(aTree,aNode,pSearchComponent->getName()) )
+ aNode = configuration::NodeRef(); // will stop recursion (value or unloaded element found)
++pSearchComponent;
return true;
}
//..................................................................................................................
// helper
- static Path::Component getExtendedNodeName(Tree const& aTree, NodeRef const& aNode, Name const& aSimpleNodeName)
+ static configuration::Path::Component getExtendedNodeName(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode, rtl::OUString const& aSimpleNodeName)
{
- OSL_PRECOND( !aTree.isEmpty(), "ERROR: Configuration: Tree operation requires valid tree" );
- OSL_PRECOND( !aNode.isValid() || aTree.isValidNode(aNode), "ERROR: Configuration: NodeRef does not match tree" );
+ 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.getRootName();
+ if (aTree->isRootNode(aNode))
+ return aTree->getExtendedRootName();
else
- return Path::wrapSimpleName(aSimpleNodeName);
+ return configuration::Path::wrapSimpleName(aSimpleNodeName);
}
//..................................................................................................................
- NodeVisitor::Result SearchExactName::handle(Tree const& aTree, NodeRef const& aNode)
+ 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
- Name aNodeName = aTree.getName(aNode);
- Name aSearchName = pSearchComponent->getName();
- if (aNodeName.toString().equalsIgnoreAsciiCase(aSearchName.toString()))
+ 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
@@ -356,32 +333,32 @@ namespace internal
return CONTINUE;
}
//..................................................................................................................
- NodeVisitor::Result SearchExactName::handle(Tree const& aTree, ValueRef const& aNode)
+ 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
- Name aNodeName = aTree.getName(aNode);
- OSL_ASSERT( isSimpleName(aNodeName) );
+ 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.toString().equalsIgnoreAsciiCase(pSearchComponent->getName().toString()))
+ if (aNodeName.equalsIgnoreAsciiCase(pSearchComponent->getName()))
{
- *pSearchComponent = Path::wrapSimpleName(aNodeName);
+ *pSearchComponent = configuration::Path::wrapSimpleName(aNodeName);
return DONE; // for this level
}
else
return CONTINUE;
}
//..................................................................................................................
- bool SearchExactName::search(NodeRef const & aNode, Tree const & aTree)
+ bool SearchExactName::search(configuration::NodeRef const & aNode, rtl::Reference< configuration::Tree > const & aTree)
{
if (!aNode.isValid()) return false;
- Tree aSearchTree(aTree);
- NodeRef aSearchNode(aNode);
+ rtl::Reference< configuration::Tree > aSearchTree(aTree);
+ configuration::NodeRef aSearchNode(aNode);
while (!complete())
if (! findMatch(aSearchNode, aSearchTree))
@@ -393,22 +370,19 @@ namespace internal
} // namespace internal
//..................................................................................................................
-OUString implGetExactName(NodeGroupInfoAccess& rNode, const OUString& rApproximateName ) throw(RuntimeException)
+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
{
- using internal::SearchExactName;
- using configuration::validateRelativePath;
-
- GuardedNodeDataAccess lock( rNode );
+ GuardedNodeData<NodeAccess> lock( rNode );
- Tree aTree(lock.getTree());
- NodeRef aNode(lock.getNode());
+ rtl::Reference< configuration::Tree > aTree(lock.getTree());
+ configuration::NodeRef aNode(lock.getNode());
- RelativePath aApproximatePath = validateRelativePath(rApproximateName,aTree,aNode);
+ configuration::RelativePath aApproximatePath = configuration::validateRelativePath(rApproximateName,aTree,aNode);
- SearchExactName aSearch(aApproximatePath);
+ internal::SearchExactName aSearch(aApproximatePath);
aSearch.search(aNode, aTree);
@@ -434,31 +408,27 @@ OUString implGetExactName(NodeGroupInfoAccess& rNode, const OUString& rApproxima
}
//..................................................................................................................
-OUString implGetExactName(NodeSetInfoAccess& rNode, const OUString& rApproximateName ) throw(RuntimeException)
+rtl::OUString implGetExactName(NodeSetInfoAccess& rNode, const rtl::OUString& rApproximateName ) throw(uno::RuntimeException)
{
// here we can support only local names
try
{
- using internal::SearchExactName;
- using configuration::validateElementPathComponent;
- using configuration::Path::Component;
+ GuardedNodeData<NodeAccess> lock( rNode );
- GuardedNodeDataAccess lock( rNode );
+ rtl::Reference< configuration::Tree > aTree(lock.getTree());
+ configuration::NodeRef aNode(lock.getNode());
- Tree aTree(lock.getTree());
- NodeRef aNode(lock.getNode());
+ configuration::Path::Component aApproximateName = configuration::validateElementPathComponent(rApproximateName,aTree,aNode);
- /*Path::*/Component aApproximateName = validateElementPathComponent(rApproximateName,aTree,aNode);
-
- SearchExactName aSearch(aApproximateName);
+ 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().toString();
+ return aSearch.getBestMatch().getLocalName().getName();
}
catch (configuration::InvalidName& )
{
@@ -483,20 +453,18 @@ OUString implGetExactName(NodeSetInfoAccess& rNode, const OUString& rApproximate
beans::Property implGetAsProperty(NodeAccess& rNode)
throw(uno::RuntimeException)
{
-
- using beans::Property;
try
{
- GuardedNodeDataAccess lock( rNode );
+ GuardedNodeData<NodeAccess> lock( rNode );
- Tree aTree( lock.getTree());
- NodeRef aNode( lock.getNode());
+ rtl::Reference< configuration::Tree > aTree( lock.getTree());
+ configuration::NodeRef aNode( lock.getNode());
- Name aName = aTree.getName(aNode);
- Attributes aAttributes = aTree.getAttributes(aNode);
+ 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) );
+ return helperMakeProperty( aName,aAttributes,aApiType, aTree->hasNodeDefault(aNode) );
}
catch (configuration::Exception& ex)
{
@@ -507,7 +475,7 @@ beans::Property implGetAsProperty(NodeAccess& rNode)
// unreachable, but still there to make some compilers happy
OSL_ASSERT(!"Unreachable code");
- return Property();
+ return beans::Property();
}
// XPropertySetInfo
//-----------------------------------------------------------------------------------
@@ -519,9 +487,9 @@ uno::Sequence< css::beans::Property > implGetProperties( NodeAccess& rNode ) thr
try
{
- GuardedNodeDataAccess lock( rNode );
+ GuardedNodeData<NodeAccess> lock( rNode );
- lock.getTree().dispatchToChildren(lock.getNode(), aCollect);
+ lock.getTree()->dispatchToChildren(lock.getNode(), aCollect);
}
catch (configuration::Exception& ex)
{
@@ -534,42 +502,42 @@ uno::Sequence< css::beans::Property > implGetProperties( NodeAccess& rNode ) thr
}
//-----------------------------------------------------------------------------------
-css::beans::Property implGetPropertyByName( NodeAccess& rNode, const OUString& aName )
+css::beans::Property implGetPropertyByName( NodeAccess& rNode, const rtl::OUString& aName )
throw (css::beans::UnknownPropertyException, uno::RuntimeException)
{
try
{
- GuardedNodeDataAccess lock( rNode );
+ GuardedNodeData<NodeAccess> lock( rNode );
- Tree aTree( lock.getTree() );
- NodeRef const aNode( lock.getNode() );
+ rtl::Reference< configuration::Tree > aTree( lock.getTree() );
+ configuration::NodeRef const aNode( lock.getNode() );
- Name aChildName = configuration::validateChildOrElementName(aName,aTree,aNode);
+ rtl::OUString aChildName = configuration::validateChildOrElementName(aName,aTree,aNode);
- AnyNodeRef aChildNode = configuration::getChildOrElement(aTree,aNode, aChildName);
+ 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");
- OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot get Property. Property '") );
+ rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot get Property. Property '") );
sMessage += aName;
- sMessage += OUString( RTL_CONSTASCII_USTRINGPARAM("' could not be found in ") );
- sMessage += aTree.getAbsolutePath(aNode).toString();
+ sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' could not be found in ") );
+ sMessage += aTree->getAbsolutePath(aNode).toString();
- Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
+ uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
throw css::beans::UnknownPropertyException( sMessage, xContext );
}
- Attributes aChildAttributes = aTree.getAttributes(aChildNode);
- uno::Type aApiType = aChildNode.isNode() ? getUnoInterfaceType() : aTree.getUnoType(aChildNode.toValue());
+ node::Attributes aChildAttributes = aTree->getAttributes(aChildNode);
+ uno::Type aApiType = aChildNode.isNode() ? getUnoInterfaceType() : aTree->getUnoType(aChildNode.toValue());
- return helperMakeProperty( aChildName,aChildAttributes,aApiType, aTree.hasNodeDefault(aChildNode) );
+ return helperMakeProperty( aChildName,aChildAttributes,aApiType, aTree->hasNodeDefault(aChildNode) );
}
catch (configuration::InvalidName& ex)
{
ExceptionMapper e(ex);
- Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
+ uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
throw css::beans::UnknownPropertyException( e.message(), xContext );
}
catch (configuration::Exception& ex)
@@ -586,9 +554,9 @@ css::beans::Property implGetPropertyByName( NodeAccess& rNode, const OUString& a
//-----------------------------------------------------------------------------------
-sal_Bool implHasPropertyByName( NodeAccess& rNode, const OUString& Name ) throw (uno::RuntimeException)
+sal_Bool implHasPropertyByName( NodeAccess& rNode, const rtl::OUString& name ) throw (uno::RuntimeException)
{
- return implHasByName(rNode, Name);
+ return implHasByName(rNode, name);
}
// XNameAccess
@@ -598,17 +566,15 @@ sal_Bool implHasPropertyByName( NodeAccess& rNode, const OUString& Name ) throw
// TODO: optimization - cache the node found (for subsequent getByName)
// TODO: optimization - less locking for group nodes
//-----------------------------------------------------------------------------------
-sal_Bool implHasByName(NodeAccess& rNode, const OUString& sName ) throw(RuntimeException)
+sal_Bool implHasByName(NodeAccess& rNode, const rtl::OUString& sName ) throw(uno::RuntimeException)
{
- using namespace com::sun::star::container;
- using configuration::hasChildOrElement;
try
{
- GuardedNodeDataAccess lock( rNode );
+ GuardedNodeData<NodeAccess> lock( rNode );
- Name aChildName = configuration::makeName(sName, Name::NoValidate());
+ rtl::OUString aChildName(sName);
- return hasChildOrElement(lock.getTree(), lock.getNode(), aChildName);
+ return configuration::hasChildOrElement(lock.getTree(), lock.getNode(), aChildName);
}
#if OSL_DEBUG_LEVEL > 0
catch (configuration::InvalidName& ex)
@@ -631,30 +597,28 @@ sal_Bool implHasByName(NodeAccess& rNode, const OUString& sName ) throw(RuntimeE
}
//-----------------------------------------------------------------------------------
-Any implGetByName(NodeAccess& rNode, const OUString& sName )
- throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, RuntimeException)
+uno::Any implGetByName(NodeAccess& rNode, const rtl::OUString& sName )
+ throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException)
{
- using namespace com::sun::star::container;
- using configuration::getChildOrElement;
try
{
- GuardedNodeDataAccess lock( rNode );
+ GuardedNodeData<NodeAccess> lock( rNode );
- Tree aTree( lock.getTree() );
- NodeRef aNode( lock.getNode() );
+ rtl::Reference< configuration::Tree > aTree( lock.getTree() );
+ configuration::NodeRef aNode( lock.getNode() );
- Name aChildName = configuration::validateChildOrElementName(sName,aTree,aNode);
+ rtl::OUString aChildName = configuration::validateChildOrElementName(sName,aTree,aNode);
- AnyNodeRef aChildNode = getChildOrElement(aTree,aNode, aChildName);
+ configuration::AnyNodeRef aChildNode = configuration::getChildOrElement(aTree,aNode, aChildName);
if (!aChildNode.isValid())
{
- OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Child Element '") );
+ rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Child Element '") );
sMessage += sName;
- sMessage += OUString( RTL_CONSTASCII_USTRINGPARAM("' not found in ") );
- sMessage += aTree.getAbsolutePath(aNode).toString();
+ sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' not found in ") );
+ sMessage += aTree->getAbsolutePath(aNode).toString();
- Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw NoSuchElementException( sMessage, xContext );
+ uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
+ throw com::sun::star::container::NoSuchElementException( sMessage, xContext );
}
OSL_ASSERT(aNode.isValid());
@@ -663,8 +627,8 @@ Any implGetByName(NodeAccess& rNode, const OUString& sName )
catch (configuration::InvalidName& ex)
{
ExceptionMapper e(ex);
- Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw NoSuchElementException( e.message(), xContext );
+ uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
+ throw com::sun::star::container::NoSuchElementException( e.message(), xContext );
}
catch (configuration::Exception& ex)
{
@@ -675,21 +639,21 @@ Any implGetByName(NodeAccess& rNode, const OUString& sName )
// unreachable, but still there to make some compilers happy
OSL_ASSERT(!"Unreachable code");
- return Any();
+ return uno::Any();
}
//-----------------------------------------------------------------------------------
// TODO: optimization - less locking for group nodes
//-----------------------------------------------------------------------------------
-Sequence< OUString > implGetElementNames( NodeAccess& rNode ) throw( RuntimeException)
+uno::Sequence< rtl::OUString > implGetElementNames( NodeAccess& rNode ) throw( uno::RuntimeException)
{
CollectNodeNames aCollect;
try
{
- GuardedNodeDataAccess lock( rNode );
+ GuardedNodeData<NodeAccess> lock( rNode );
- lock.getTree().dispatchToChildren(lock.getNode(), aCollect);
+ lock.getTree()->dispatchToChildren(lock.getNode(), aCollect);
}
catch (configuration::Exception& ex)
{
@@ -707,21 +671,18 @@ Sequence< OUString > implGetElementNames( NodeAccess& rNode ) throw( RuntimeExce
//-----------------------------------------------------------------------------------
// TO DO: optimization - cache the node found for subsequent getByHierarchicalName()
//-----------------------------------------------------------------------------------
-sal_Bool implHasByHierarchicalName(NodeAccess& rNode, const OUString& sHierarchicalName ) throw(RuntimeException)
+sal_Bool implHasByHierarchicalName(NodeAccess& rNode, const rtl::OUString& sHierarchicalName ) throw(uno::RuntimeException)
{
- using namespace com::sun::star::container;
- using configuration::validateAndReducePath; // should actually be found by "Koenig" lookup, but MSVC6 fails
- using configuration::getDeepDescendant; // should actually be found by "Koenig" lookup, but MSVC6 fails
try
{
- GuardedNodeDataAccess lock( rNode );
+ GuardedNodeData<NodeAccess> lock( rNode );
- Tree aTree( lock.getTree() );
- NodeRef aNode( lock.getNode() );
+ rtl::Reference< configuration::Tree > aTree( lock.getTree() );
+ configuration::NodeRef aNode( lock.getNode() );
- RelativePath aRelPath = validateAndReducePath( sHierarchicalName, aTree, aNode );
+ configuration::RelativePath aRelPath = configuration::validateAndReducePath( sHierarchicalName, aTree, aNode );
- return getDeepDescendant(aTree, aNode, aRelPath).isValid();
+ return configuration::getDeepDescendant(aTree, aNode, aRelPath).isValid();
}
catch (configuration::InvalidName& )
{
@@ -740,34 +701,31 @@ sal_Bool implHasByHierarchicalName(NodeAccess& rNode, const OUString& sHierarchi
}
//-----------------------------------------------------------------------------------
-Any implGetByHierarchicalName(NodeAccess& rNode, const OUString& sHierarchicalName )
- throw(css::container::NoSuchElementException, RuntimeException)
+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));
- using namespace com::sun::star::container;
- using configuration::validateAndReducePath; // should actually be found by "Koenig" lookup, but MSVC6 fails
- using configuration::getDeepDescendant; // should actually be found by "Koenig" lookup, but MSVC6 fails
try
{
- GuardedNodeDataAccess lock( rNode );
+ GuardedNodeData<NodeAccess> lock( rNode );
- Tree aTree( lock.getTree() );
- NodeRef aNode( lock.getNode() );
+ rtl::Reference< configuration::Tree > aTree( lock.getTree() );
+ configuration::NodeRef aNode( lock.getNode() );
- RelativePath aRelPath = validateAndReducePath( sHierarchicalName, aTree, aNode );
+ configuration::RelativePath aRelPath = configuration::validateAndReducePath( sHierarchicalName, aTree, aNode );
- AnyNodeRef aNestedNode = getDeepDescendant( aTree, aNode, aRelPath );
+ configuration::AnyNodeRef aNestedNode = configuration::getDeepDescendant( aTree, aNode, aRelPath );
if (!aNestedNode.isValid())
{
- OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Descendant Element '") );
+ rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Descendant Element '") );
sMessage += aRelPath.toString();
- sMessage += OUString( RTL_CONSTASCII_USTRINGPARAM("' not found in Node ") );
- sMessage += aTree.getAbsolutePath(aNode).toString();
+ sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' not found in Node ") );
+ sMessage += aTree->getAbsolutePath(aNode).toString();
- Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw NoSuchElementException( sMessage, xContext );
+ uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
+ throw com::sun::star::container::NoSuchElementException( sMessage, xContext );
}
OSL_ASSERT(aNode.isValid());
@@ -776,8 +734,8 @@ Any implGetByHierarchicalName(NodeAccess& rNode, const OUString& sHierarchicalNa
catch (configuration::InvalidName& ex)
{
ExceptionMapper e(ex);
- Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw NoSuchElementException( e.message(), xContext );
+ uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
+ throw com::sun::star::container::NoSuchElementException( e.message(), xContext );
}
catch (configuration::Exception& ex)
{
@@ -788,7 +746,7 @@ Any implGetByHierarchicalName(NodeAccess& rNode, const OUString& sHierarchicalNa
// unreachable, but still there to make some compilers happy
OSL_ASSERT(!"Unreachable code");
- return Any();
+ return uno::Any();
}
// XPropertyWithState
@@ -796,15 +754,13 @@ Any implGetByHierarchicalName(NodeAccess& rNode, const OUString& sHierarchicalNa
css::beans::PropertyState implGetStateAsProperty(NodeAccess& rNode)
throw (uno::RuntimeException)
{
- using namespace css::beans;
-
- PropertyState aRet = PropertyState_AMBIGUOUS_VALUE;
+ css::beans::PropertyState aRet = css::beans::PropertyState_AMBIGUOUS_VALUE;
try
{
- GuardedNodeDataAccess lock( rNode );
+ GuardedNodeData<NodeAccess> lock( rNode );
- if ( lock.getTree().isNodeDefault( lock.getNode() ) )
- aRet = PropertyState_DEFAULT_VALUE;
+ if ( lock.getTree()->isNodeDefault( lock.getNode() ) )
+ aRet = css::beans::PropertyState_DEFAULT_VALUE;
}
catch (configuration::Exception& ex)
{
@@ -815,7 +771,7 @@ css::beans::PropertyState implGetStateAsProperty(NodeAccess& rNode)
return aRet;
}
-Reference< uno::XInterface > implGetDefaultAsProperty(NodeAccess& )
+uno::Reference< uno::XInterface > implGetDefaultAsProperty(NodeAccess& )
throw (css::lang::WrappedTargetException, uno::RuntimeException)
{
// not really supported
@@ -826,7 +782,7 @@ Reference< uno::XInterface > implGetDefaultAsProperty(NodeAccess& )
return rNode.getUnoInstance();
*/
- return Reference< uno::XInterface >();
+ return uno::Reference< uno::XInterface >();
}
@@ -836,11 +792,11 @@ Reference< uno::XInterface > implGetDefaultAsProperty(NodeAccess& )
// XTemplateContainer
//-----------------------------------------------------------------------------------
-OUString SAL_CALL implGetElementTemplateName(NodeSetInfoAccess& rNode)
+rtl::OUString SAL_CALL implGetElementTemplateName(NodeSetInfoAccess& rNode)
throw(uno::RuntimeException)
{
GuardedNodeData<NodeSetInfoAccess> lock(rNode);
- return rNode.getElementInfo().getTemplateInfo().getTemplatePathString();
+ return rNode.getElementInfo()->getPathString();
}
//-----------------------------------------------------------------------------------
diff --git a/configmgr/source/api2/accessimpl.hxx b/configmgr/source/api2/accessimpl.hxx
index 4801e00f6b..b168338b6b 100644
--- a/configmgr/source/api2/accessimpl.hxx
+++ b/configmgr/source/api2/accessimpl.hxx
@@ -45,7 +45,6 @@ namespace configmgr
{
namespace css = ::com::sun::star;
namespace uno = ::com::sun::star::uno;
- using rtl::OUString;
/* implementations of the interfaces supported by a (parent) node
within the configuration tree.
@@ -58,13 +57,13 @@ namespace configmgr
class NodeGroupInfoAccess;
// XHierarchicalName
- OUString implGetHierarchicalName(NodeAccess& rNode)
+ rtl::OUString implGetHierarchicalName(NodeAccess& rNode)
throw(uno::RuntimeException);
- OUString implComposeHierarchicalName(NodeGroupInfoAccess& rNode, const OUString& aRelativeName )
+ rtl::OUString implComposeHierarchicalName(NodeGroupInfoAccess& rNode, const rtl::OUString& aRelativeName )
throw(css::lang::IllegalArgumentException, css::lang::NoSupportException, uno::RuntimeException);
- OUString implComposeHierarchicalName(NodeSetInfoAccess& rNode, const OUString& aRelativeName )
+ rtl::OUString implComposeHierarchicalName(NodeSetInfoAccess& rNode, const rtl::OUString& aRelativeName )
throw(css::lang::IllegalArgumentException, css::lang::NoSupportException, uno::RuntimeException);
// XElementAccess, base class of XNameAccess
@@ -81,27 +80,27 @@ namespace configmgr
throw(uno::RuntimeException);
// XNameAccess
- uno::Any implGetByName(NodeAccess& rNode, const OUString& aName )
+ uno::Any implGetByName(NodeAccess& rNode, const rtl::OUString& aName )
throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException);
- uno::Sequence< OUString > implGetElementNames(NodeAccess& rNode)
+ uno::Sequence< rtl::OUString > implGetElementNames(NodeAccess& rNode)
throw( uno::RuntimeException);
- sal_Bool implHasByName(NodeAccess& rNode, const OUString& aName )
+ sal_Bool implHasByName(NodeAccess& rNode, const rtl::OUString& aName )
throw(uno::RuntimeException);
// XHierarchicalNameAccess
- uno::Any implGetByHierarchicalName(NodeAccess& rNode, const OUString& aName )
+ uno::Any implGetByHierarchicalName(NodeAccess& rNode, const rtl::OUString& aName )
throw(css::container::NoSuchElementException, uno::RuntimeException);
- sal_Bool implHasByHierarchicalName(NodeAccess& rNode, const OUString& aName )
+ sal_Bool implHasByHierarchicalName(NodeAccess& rNode, const rtl::OUString& aName )
throw(uno::RuntimeException);
// XExactName
- OUString implGetExactName(NodeGroupInfoAccess& rNode, const OUString& aApproximateName )
+ rtl::OUString implGetExactName(NodeGroupInfoAccess& rNode, const rtl::OUString& aApproximateName )
throw(uno::RuntimeException);
- OUString implGetExactName(NodeSetInfoAccess& rNode, const OUString& aApproximateName )
+ rtl::OUString implGetExactName(NodeSetInfoAccess& rNode, const rtl::OUString& aApproximateName )
throw(uno::RuntimeException);
// XProperty
@@ -112,10 +111,10 @@ namespace configmgr
uno::Sequence< css::beans::Property > implGetProperties( NodeAccess& rNode )
throw (uno::RuntimeException);
- css::beans::Property implGetPropertyByName( NodeAccess& rNode, const OUString& aName )
+ css::beans::Property implGetPropertyByName( NodeAccess& rNode, const rtl::OUString& aName )
throw (css::beans::UnknownPropertyException, uno::RuntimeException);
- sal_Bool implHasPropertyByName( NodeAccess& rNode, const OUString& Name )
+ sal_Bool implHasPropertyByName( NodeAccess& rNode, const rtl::OUString& name )
throw (uno::RuntimeException);
@@ -129,7 +128,7 @@ namespace configmgr
// set-specific interfaces
// XTemplateContainer
- OUString SAL_CALL implGetElementTemplateName(NodeSetInfoAccess& rNode)
+ rtl::OUString SAL_CALL implGetElementTemplateName(NodeSetInfoAccess& rNode)
throw(uno::RuntimeException);
}
diff --git a/configmgr/source/api2/apiaccessobj.hxx b/configmgr/source/api2/apiaccessobj.hxx
index 2af7fcb930..0dae110bf8 100644
--- a/configmgr/source/api2/apiaccessobj.hxx
+++ b/configmgr/source/api2/apiaccessobj.hxx
@@ -46,40 +46,29 @@ namespace configmgr
namespace configapi
{
//-----------------------------------------------------------------------------
- using configuration::Tree;
- using configuration::NodeRef;
-
-//-----------------------------------------------------------------------------
// Inner Elements
//-----------------------------------------------------------------------------
template <class NodeClass>
class OInnerElement : public InnerElement, public NodeClass
{
- static ServiceInfo const*const s_pServiceInfo;
+ static ServiceImplementationInfo const*const s_pServiceInfo;
- UnoInterface* m_pUnoThis;
+ uno::XInterface* m_pUnoThis;
ApiTreeImpl& m_rTree;
- NodeRef m_aNode;
+ configuration::NodeRef m_aNode;
public:
- inline OInnerElement(UnoInterface* pUnoThis,ApiTreeImpl& rTree, NodeRef const& aNode);
+ inline OInnerElement(uno::XInterface* pUnoThis,ApiTreeImpl& rTree, configuration::NodeRef const& aNode);
inline ~OInnerElement();
- virtual inline NodeRef doGetNode() const;
+ virtual inline configuration::NodeRef doGetNode() const;
virtual inline ApiTreeImpl& getApiTree() const;
- virtual inline UnoInterface* doGetUnoInstance() const;
- virtual inline ServiceInfo const* doGetServiceInfo() const;
+ virtual inline uno::XInterface* doGetUnoInstance() const;
+ virtual inline ServiceImplementationInfo const* doGetServiceInfo() const;
- static inline ServiceInfo const* getStaticServiceInfo();
+ static inline ServiceImplementationInfo const* getStaticServiceInfo();
};
- //-------------------------------------------------------------------------
-
- typedef OInnerElement<NodeGroupInfoAccess> OInnerGroupInfoAccess;
- typedef OInnerElement<NodeGroupAccess> OInnerGroupUpdateAccess;
- typedef OInnerElement<NodeSetInfoAccess> OInnerSetInfoAccess;
- typedef OInnerElement<NodeTreeSetAccess> OInnerTreeSetUpdateAccess;
- typedef OInnerElement<NodeValueSetAccess> OInnerValueSetUpdateAccess;
//-----------------------------------------------------------------------------
// Set Elements
@@ -88,35 +77,26 @@ namespace configmgr
template <class NodeClass>
class OSetElement : public SetElement, public NodeClass
{
- static ServiceInfo const*const s_pServiceInfo;
+ static ServiceImplementationInfo const*const s_pServiceInfo;
mutable ApiTreeImpl m_aTree;
public:
- OSetElement(UnoInterface* pUnoThis, configuration::TreeRef const& aTree, ApiTreeImpl& rParentTree)
+ OSetElement(uno::XInterface* pUnoThis, rtl::Reference< configuration::Tree > const& aTree, ApiTreeImpl& rParentTree)
: m_aTree(pUnoThis, aTree,rParentTree)
{}
- OSetElement(UnoInterface* pUnoThis, configuration::TreeRef const& aTree, ApiProvider& rProvider, ApiTreeImpl* pParentTree = 0)
+ OSetElement(uno::XInterface* pUnoThis, rtl::Reference< configuration::Tree > const& aTree, ApiProvider& rProvider, ApiTreeImpl* pParentTree = 0)
: m_aTree(pUnoThis, rProvider,aTree,pParentTree)
{}
- virtual inline NodeRef doGetNode() const;
+ virtual inline configuration::NodeRef doGetNode() const;
virtual inline ApiTreeImpl& getApiTree() const;
- virtual inline UnoInterface* doGetUnoInstance() const;
- virtual inline ServiceInfo const* doGetServiceInfo() const;
+ virtual inline uno::XInterface* doGetUnoInstance() const;
+ virtual inline ServiceImplementationInfo const* doGetServiceInfo() const;
- static inline ServiceInfo const* getStaticServiceInfo();
+ static inline ServiceImplementationInfo const* getStaticServiceInfo();
};
- // Set Elements
- //-------------------------------------------------------------------------
-
- typedef OSetElement<NodeGroupInfoAccess> OSetElementGroupInfoAccess;
- typedef OSetElement<NodeGroupAccess> OSetElementGroupUpdateAccess;
- typedef OSetElement<NodeSetInfoAccess> OSetElementSetInfoAccess;
- typedef OSetElement<NodeTreeSetAccess> OSetElementTreeSetUpdateAccess;
- typedef OSetElement<NodeValueSetAccess> OSetElementValueSetUpdateAccess;
-
//-----------------------------------------------------------------------------
// Root Elements
//-----------------------------------------------------------------------------
@@ -124,55 +104,44 @@ namespace configmgr
template <class NodeClass>
class OReadRootElement : public RootElement, public NodeClass
{
- static ServiceInfo const*const s_pServiceInfo;
+ static ServiceImplementationInfo const*const s_pServiceInfo;
mutable ApiRootTreeImpl m_aRootTree;
public:
- OReadRootElement(UnoInterface* pUnoThis, ApiProvider& rProvider, configuration::Tree const& aTree, vos::ORef< OOptions >const& _xOptions)
+ 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 NodeRef doGetNode() const;
+ virtual inline configuration::NodeRef doGetNode() const;
virtual inline ApiTreeImpl& getApiTree() const;
virtual inline ApiRootTreeImpl& getRootTree();
- virtual inline UnoInterface* doGetUnoInstance() const;
- virtual inline ServiceInfo const* doGetServiceInfo() const;
+ virtual inline uno::XInterface* doGetUnoInstance() const;
+ virtual inline ServiceImplementationInfo const* doGetServiceInfo() const;
- static inline ServiceInfo const* getStaticServiceInfo();
+ static inline ServiceImplementationInfo const* getStaticServiceInfo();
};
//-------------------------------------------------------------------------
template <class NodeClass>
class OUpdateRootElement : public UpdateRootElement, public NodeClass
{
- static ServiceInfo const*const s_pServiceInfo;
+ static ServiceImplementationInfo const*const s_pServiceInfo;
mutable ApiRootTreeImpl m_aRootTree;
public:
- OUpdateRootElement(UnoInterface* pUnoThis, ApiProvider& rProvider, configuration::Tree const& aTree, vos::ORef< OOptions >const& _xOptions)
+ 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 NodeRef doGetNode() const;
+ virtual inline configuration::NodeRef doGetNode() const;
virtual inline ApiTreeImpl& getApiTree() const;
virtual inline ApiRootTreeImpl& getRootTree();
- virtual inline UnoInterface* doGetUnoInstance() const;
- virtual inline ServiceInfo const* doGetServiceInfo() const;
+ virtual inline uno::XInterface* doGetUnoInstance() const;
+ virtual inline ServiceImplementationInfo const* doGetServiceInfo() const;
- static inline ServiceInfo const* getStaticServiceInfo();
+ static inline ServiceImplementationInfo const* getStaticServiceInfo();
};
-
- // Root Elements
- //-------------------------------------------------------------------------
-
- typedef OReadRootElement<NodeGroupInfoAccess> ORootElementGroupInfoAccess;
- typedef OUpdateRootElement<NodeGroupAccess> ORootElementGroupUpdateAccess;
- typedef OReadRootElement<NodeSetInfoAccess> ORootElementSetInfoAccess;
- typedef OUpdateRootElement<NodeTreeSetAccess> ORootElementTreeSetUpdateAccess;
- typedef OUpdateRootElement<NodeValueSetAccess> ORootElementValueSetUpdateAccess;
-
-//-----------------------------------------------------------------------------
}
}
//-----------------------------------------------------------------------------
diff --git a/configmgr/source/api2/apiaccessobj.inl b/configmgr/source/api2/apiaccessobj.inl
index 7929de63bd..1f1eaf2c21 100644
--- a/configmgr/source/api2/apiaccessobj.inl
+++ b/configmgr/source/api2/apiaccessobj.inl
@@ -43,7 +43,7 @@ namespace configmgr
//-----------------------------------------------------------------------------
template <class NodeClass>
-OInnerElement<NodeClass>::OInnerElement(UnoInterface* pUnoThis,ApiTreeImpl& rTree, NodeRef const& aNode)
+OInnerElement<NodeClass>::OInnerElement(uno::XInterface* pUnoThis,ApiTreeImpl& rTree, configuration::NodeRef const& aNode)
: m_pUnoThis(pUnoThis)
, m_rTree(rTree)
, m_aNode(aNode)
@@ -60,7 +60,7 @@ OInnerElement<NodeClass>::~OInnerElement()
//-----------------------------------------------------------------------------
template <class NodeClass>
-NodeRef OInnerElement<NodeClass>::doGetNode() const
+configuration::NodeRef OInnerElement<NodeClass>::doGetNode() const
{
return m_aNode;
}
@@ -74,7 +74,7 @@ ApiTreeImpl& OInnerElement<NodeClass>::getApiTree() const
//-----------------------------------------------------------------------------
template <class NodeClass>
-UnoInterface* OInnerElement<NodeClass>::doGetUnoInstance() const
+uno::XInterface* OInnerElement<NodeClass>::doGetUnoInstance() const
{
return m_pUnoThis;
}
@@ -99,9 +99,9 @@ ServiceImplementationInfo const* OInnerElement<NodeClass>::getStaticServiceInfo(
//-----------------------------------------------------------------------------
template <class NodeClass>
-NodeRef OSetElement<NodeClass>::doGetNode() const
+configuration::NodeRef OSetElement<NodeClass>::doGetNode() const
{
- return m_aTree.getTree().getRootNode();
+ return m_aTree.getTree()->getRootNode();
}
//-----------------------------------------------------------------------------
@@ -113,7 +113,7 @@ ApiTreeImpl& OSetElement<NodeClass>::getApiTree() const
//-----------------------------------------------------------------------------
template <class NodeClass>
-UnoInterface* OSetElement<NodeClass>::doGetUnoInstance() const
+uno::XInterface* OSetElement<NodeClass>::doGetUnoInstance() const
{
return m_aTree.getUnoInstance();
}
@@ -138,9 +138,9 @@ ServiceImplementationInfo const* OSetElement<NodeClass>::getStaticServiceInfo()
//-----------------------------------------------------------------------------
template <class NodeClass>
-NodeRef OReadRootElement<NodeClass>::doGetNode() const
+configuration::NodeRef OReadRootElement<NodeClass>::doGetNode() const
{
- return m_aRootTree.getApiTree().getTree().getRootNode();
+ return m_aRootTree.getApiTree().getTree()->getRootNode();
}
//-----------------------------------------------------------------------------
@@ -159,7 +159,7 @@ ApiRootTreeImpl& OReadRootElement<NodeClass>::getRootTree()
//-----------------------------------------------------------------------------
template <class NodeClass>
-UnoInterface* OReadRootElement<NodeClass>::doGetUnoInstance() const
+uno::XInterface* OReadRootElement<NodeClass>::doGetUnoInstance() const
{
return m_aRootTree.getApiTree().getUnoInstance();
}
@@ -184,9 +184,9 @@ ServiceImplementationInfo const* OReadRootElement<NodeClass>::getStaticServiceIn
//-----------------------------------------------------------------------------
template <class NodeClass>
-NodeRef OUpdateRootElement<NodeClass>::doGetNode() const
+configuration::NodeRef OUpdateRootElement<NodeClass>::doGetNode() const
{
- return m_aRootTree.getApiTree().getTree().getRootNode();
+ return m_aRootTree.getApiTree().getTree()->getRootNode();
}
//-----------------------------------------------------------------------------
@@ -205,7 +205,7 @@ ApiRootTreeImpl& OUpdateRootElement<NodeClass>::getRootTree()
//-----------------------------------------------------------------------------
template <class NodeClass>
-UnoInterface* OUpdateRootElement<NodeClass>::doGetUnoInstance() const
+uno::XInterface* OUpdateRootElement<NodeClass>::doGetUnoInstance() const
{
return m_aRootTree.getApiTree().getUnoInstance();
}
diff --git a/configmgr/source/api2/apifactory.cxx b/configmgr/source/api2/apifactory.cxx
index f4680edb37..457a11a963 100644
--- a/configmgr/source/api2/apifactory.cxx
+++ b/configmgr/source/api2/apifactory.cxx
@@ -56,19 +56,6 @@ namespace configmgr
namespace configapi
{
//-----------------------------------------------------------------------------
- typedef uno::XInterface UnoInterface;
- typedef uno::Reference< uno::XInterface > UnoInterfaceRef;
- typedef uno::Any UnoAny;
-
- using uno::Reference;
- using lang::XUnoTunnel;
- using configuration::Tree;
- using configuration::ElementTree;
- using configuration::TemplateHolder;
- using configuration::NodeRef;
- using configuration::NodeID;
-
-//-----------------------------------------------------------------------------
ObjectRegistry::~ObjectRegistry()
{
OSL_ENSURE(m_aMap.empty(),"WARNING: Configuration Object Map: Some Objects were not revoked correctly");
@@ -76,7 +63,7 @@ ObjectRegistry::~ObjectRegistry()
//-----------------------------------------------------------------------------
-Factory::Factory(ObjectRegistryHolder pRegistry)
+Factory::Factory(rtl::Reference<ObjectRegistry> pRegistry)
: m_pRegistry(pRegistry)
, m_aTunnelID()
{
@@ -114,12 +101,12 @@ ApiTreeImpl& Factory::getImplementation(NodeElement& rElement)
//-----------------------------------------------------------------------------
inline
-TemplateHolder Factory::implGetSetElementTemplate(Tree const& aTree, NodeRef const& aNode)
+rtl::Reference<configuration::Template> Factory::implGetSetElementTemplate(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode)
{
- TemplateHolder aRet;
+ rtl::Reference<configuration::Template> aRet;
if (configuration::isSetNode(aTree,aNode))
{
- aRet = configuration::SetElementInfo::extractElementInfo(aTree,aNode);
+ aRet = aTree->extractElementInfo(aNode);
}
else if (!configuration::isGroupNode(aTree,aNode))
{
@@ -130,16 +117,16 @@ TemplateHolder Factory::implGetSetElementTemplate(Tree const& aTree, NodeRef con
}
//-----------------------------------------------------------------------------
inline
-UnoInterfaceRef Factory::implToUno(NodeElement* pElement)
+uno::Reference< uno::XInterface > Factory::implToUno(NodeElement* pElement)
{
if ( pElement )
- return UnoInterfaceRef(pElement->getUnoInstance(), uno::UNO_REF_NO_ACQUIRE);
+ return uno::Reference< uno::XInterface >(pElement->getUnoInstance(), uno::UNO_REF_NO_ACQUIRE);
else
- return UnoInterfaceRef();
+ return uno::Reference< uno::XInterface >();
}
//-----------------------------------------------------------------------------
inline
-void Factory::implHaveNewElement(NodeID aNodeID, NodeElement* pElement)
+void Factory::implHaveNewElement(configuration::NodeID aNodeID, NodeElement* pElement)
{
OSL_ENSURE(pElement ,"WARNING: New API object could not be created");
@@ -151,40 +138,40 @@ void Factory::implHaveNewElement(NodeID aNodeID, NodeElement* pElement)
}
//-----------------------------------------------------------------------------
-UnoInterfaceRef Factory::makeUnoElement(Tree const& aTree, NodeRef const& aNode)
+uno::Reference< uno::XInterface > Factory::makeUnoElement(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode)
{
return implToUno(makeElement(aTree,aNode));
}
//-----------------------------------------------------------------------------
-NodeElement* Factory::makeElement(Tree const& aTree, NodeRef const& aNode)
+NodeElement* Factory::makeElement(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode)
{
- OSL_PRECOND( !aTree.isEmpty() == aNode.isValid(), "ERROR: Configuration: Making element from tree requires valid node");
- if (aTree.isEmpty())
+ 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( aTree.isValidNode(aNode), "ERROR: Configuration: NodeRef does not match Tree");
+ 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");
- NodeID aNodeID(aTree,aNode);
+ configuration::NodeID aNodeID(aTree,aNode);
NodeElement* pRet = findElement(aNodeID);
if (pRet == 0)
{
- TemplateHolder aTemplate = implGetSetElementTemplate(aTree,aNode);
+ rtl::Reference<configuration::Template> aTemplate = implGetSetElementTemplate(aTree,aNode);
- if (!aTree.isRootNode(aNode))
+ if (!aTree->isRootNode(aNode))
{
pRet = doCreateGroupMember(aTree,aNode,aTemplate.get());
}
else
{
- ElementTree aElementTree = ElementTree::extract(aTree);
- if (aElementTree.isValid())
+ rtl::Reference< configuration::ElementTree > aElementTree(dynamic_cast< configuration::ElementTree * >(aTree.get()));
+ if (aElementTree.is())
{
pRet = doCreateSetElement(aElementTree,aTemplate.get());
}
else
{
- OSL_ENSURE(aTree.getContextTree().isEmpty(),"INTERNAL ERROR: Found tree (not a set element) with a parent tree.");
+ 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 >());
}
}
@@ -194,12 +181,12 @@ NodeElement* Factory::makeElement(Tree const& aTree, NodeRef const& aNode)
}
//-----------------------------------------------------------------------------
-UnoInterfaceRef Factory::findUnoElement(NodeID const& aNodeID)
+uno::Reference< uno::XInterface > Factory::findUnoElement(configuration::NodeID const& aNodeID)
{
return implToUno(findElement(aNodeID));
}
//-----------------------------------------------------------------------------
-NodeElement* Factory::findElement(NodeID const& aNodeID)
+NodeElement* Factory::findElement(configuration::NodeID const& aNodeID)
{
NodeElement* pReturn = implFind(aNodeID);
if (pReturn) pReturn->getUnoInstance()->acquire();
@@ -207,32 +194,32 @@ NodeElement* Factory::findElement(NodeID const& aNodeID)
}
//-----------------------------------------------------------------------------
-void Factory::revokeElement(NodeID const& aNodeID)
+void Factory::revokeElement(configuration::NodeID const& aNodeID)
{
if (NodeElement* pElement = implFind(aNodeID))
doRevokeElement(aNodeID, pElement);
}
//-----------------------------------------------------------------------------
-TreeElement* Factory::makeAccessRoot(Tree const& aTree, RequestOptions const& _aOptions)
+TreeElement* Factory::makeAccessRoot(rtl::Reference< configuration::Tree > const& aTree, RequestOptions const& _aOptions)
{
- OSL_PRECOND( !aTree.isEmpty() , "ERROR: Configuration: Making element from tree requires valid tree");
- if (aTree.isEmpty()) return 0;
+ OSL_PRECOND( !configuration::isEmpty(aTree.get()) , "ERROR: Configuration: Making element from tree requires valid tree");
+ if (configuration::isEmpty(aTree.get())) return 0;
- OSL_ENSURE(aTree.getContextTree().isEmpty(),"INTERNAL ERROR: Tree with parent tree should not be used for an access root");
- OSL_ENSURE(!ElementTree::extract(aTree).isValid(),"INTERNAL ERROR: Element Tree should not be used for an access root");
+ 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");
- NodeRef aRoot = aTree.getRootNode();
+ 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");
- NodeID aNodeID(aTree,aRoot);
+ 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)
{
- TemplateHolder aTemplate = implGetSetElementTemplate(aTree,aRoot);
+ rtl::Reference<configuration::Template> aTemplate = implGetSetElementTemplate(aTree,aRoot);
vos::ORef<OOptions> xOptions = new OOptions(_aOptions);
pRet = doCreateAccessRoot(aTree,aTemplate.get(), xOptions);
implHaveNewElement (aNodeID,pRet);
@@ -241,28 +228,28 @@ TreeElement* Factory::makeAccessRoot(Tree const& aTree, RequestOptions const& _a
}
//-----------------------------------------------------------------------------
-UnoInterfaceRef Factory::makeUnoGroupMember(Tree const& aTree, NodeRef const& aNode)
+uno::Reference< uno::XInterface > Factory::makeUnoGroupMember(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode)
{
return implToUno(makeGroupMember(aTree,aNode));
}
//-----------------------------------------------------------------------------
-NodeElement* Factory::makeGroupMember(Tree const& aTree, NodeRef const& aNode)
+NodeElement* Factory::makeGroupMember(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode)
{
- OSL_PRECOND( !aTree.isEmpty() , "ERROR: Configuration: Creating an object requires a valid tree");
- if (aTree.isEmpty()) return 0;
+ OSL_PRECOND( !configuration::isEmpty(aTree.get()) , "ERROR: Configuration: Creating an object requires a valid tree");
+ if (configuration::isEmpty(aTree.get())) return 0;
OSL_PRECOND( aNode.isValid() , "ERROR: Configuration: Creating an object requires a valid node");
- OSL_PRECOND( aTree.isValidNode(aNode), "ERROR: Configuration: NodeRef does not match Tree");
- if (!aTree.isValidNode(aNode)) return 0;
+ OSL_PRECOND( aTree->isValidNode(aNode.getOffset()), "ERROR: Configuration: NodeRef does not match Tree");
+ if (!aTree->isValidNode(aNode.getOffset())) return 0;
OSL_PRECOND( configuration::isStructuralNode(aTree,aNode), "ERROR: Configuration: Cannot make object for value node");
- OSL_ENSURE(!aTree.isRootNode(aNode),"INTERNAL ERROR: Root of Tree should not be used for a group member object");
+ OSL_ENSURE(!aTree->isRootNode(aNode),"INTERNAL ERROR: Root of Tree should not be used for a group member object");
- NodeID aNodeID(aTree,aNode);
+ configuration::NodeID aNodeID(aTree,aNode);
NodeElement* pRet = findElement(aNodeID);
if (0 == pRet)
{
- TemplateHolder aTemplate = implGetSetElementTemplate(aTree,aNode);
+ rtl::Reference<configuration::Template> aTemplate = implGetSetElementTemplate(aTree,aNode);
pRet = doCreateGroupMember(aTree,aNode,aTemplate.get());
@@ -274,37 +261,37 @@ NodeElement* Factory::makeGroupMember(Tree const& aTree, NodeRef const& aNode)
}
//-----------------------------------------------------------------------------
-UnoInterfaceRef Factory::makeUnoSetElement(ElementTree const& aElementTree)
+uno::Reference< uno::XInterface > Factory::makeUnoSetElement(rtl::Reference< configuration::ElementTree > const& aElementTree)
{
- UnoInterfaceRef aRet = implToUno(makeSetElement(aElementTree));
- OSL_ENSURE( uno::Reference<XUnoTunnel>::query(aRet).is(),"ERROR: API set element has no UnoTunnel");
- OSL_ENSURE( uno::Reference<XUnoTunnel>::query(aRet).is() &&
- 0 != uno::Reference<XUnoTunnel>::query(aRet)->getSomething(doGetElementTunnelID()),
+ 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(ElementTree const& aElementTree)
+SetElement* Factory::makeSetElement(rtl::Reference< configuration::ElementTree > const& aElementTree)
{
- OSL_PRECOND( aElementTree.isValid() , "ERROR: Configuration: Making element from tree requires valid tree");
- if (!aElementTree.isValid()) return 0;
+ OSL_PRECOND( aElementTree.is() , "ERROR: Configuration: Making element from tree requires valid tree");
+ if (!aElementTree.is()) return 0;
- Tree aTree = aElementTree.getTree();
- OSL_ENSURE(!aTree.isEmpty(),"INTERNAL ERROR: Element Tree has no Tree");
+ rtl::Reference< configuration::Tree > aTree(aElementTree.get());
+ OSL_ENSURE(!configuration::isEmpty(aTree.get()),"INTERNAL ERROR: Element Tree has no Tree");
- NodeRef aRoot = aTree.getRootNode();
+ 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");
- NodeID aNodeID(aTree,aRoot);
+ 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)
{
- TemplateHolder aTemplate = implGetSetElementTemplate(aTree,aRoot);
+ rtl::Reference<configuration::Template> aTemplate = implGetSetElementTemplate(aTree,aRoot);
pRet = doCreateSetElement(aElementTree,aTemplate.get());
@@ -314,18 +301,18 @@ SetElement* Factory::makeSetElement(ElementTree const& aElementTree)
}
//-----------------------------------------------------------------------------
-SetElement* Factory::findSetElement(configuration::ElementRef const& aElement)
+SetElement* Factory::findSetElement(rtl::Reference< configuration::ElementTree > const& aElement)
{
- OSL_PRECOND( aElement.isValid() , "ERROR: Configuration: Making element from tree requires valid tree");
- if (!aElement.isValid()) return 0;
+ OSL_PRECOND( aElement.is() , "ERROR: Configuration: Making element from tree requires valid tree");
+ if (!aElement.is()) return 0;
- configuration::TreeRef aTree = aElement.getTreeRef();
- OSL_ENSURE(!aTree.isEmpty(),"INTERNAL ERROR: Element Tree has no Tree");
+ rtl::Reference< configuration::Tree > aTree(aElement.get());
+ OSL_ENSURE(!isEmpty(aTree.get()),"INTERNAL ERROR: Element Tree has no Tree");
- NodeRef aRoot = aTree.getRootNode();
+ configuration::NodeRef aRoot = aTree->getRootNode();
OSL_ENSURE(aRoot.isValid(),"INTERNAL ERROR: Tree has no root node");
- NodeID aNodeID(aTree,aRoot);
+ configuration::NodeID aNodeID(aTree,aRoot);
// must be a set element if it wraps a ElementTree
SetElement* pRet = static_cast<SetElement*>( findElement(aNodeID) );
@@ -333,12 +320,11 @@ SetElement* Factory::findSetElement(configuration::ElementRef const& aElement)
}
//-----------------------------------------------------------------------------
-SetElement* Factory::extractSetElement(UnoAny const& aElement)
+SetElement* Factory::extractSetElement(uno::Any const& aElement)
{
- using configuration::ElementTreeImpl;
SetElement* pTunneledImpl = 0;
- Reference< XUnoTunnel > xElementTunnel;
+ uno::Reference< lang::XUnoTunnel > xElementTunnel;
if ( aElement.hasValue() && (aElement >>= xElementTunnel) )
{
OSL_ASSERT( xElementTunnel.is() );
diff --git a/configmgr/source/api2/apifactory.hxx b/configmgr/source/api2/apifactory.hxx
index f616e7d0fb..1c80fc9655 100644
--- a/configmgr/source/api2/apifactory.hxx
+++ b/configmgr/source/api2/apifactory.hxx
@@ -33,6 +33,7 @@
#include "options.hxx"
#include "utility.hxx"
+#include <boost/utility.hpp>
#include <rtl/ref.hxx>
#include <vos/ref.hxx>
#include <cppuhelper/typeprovider.hxx>
@@ -41,22 +42,15 @@ namespace configmgr
{
namespace configuration
{
- class Name;
class NodeID;
class NodeRef;
- class Tree;
- class ElementRef;
class ElementTree;
-
class Template;
- typedef rtl::Reference<Template> TemplateHolder;
+ class Tree;
}
namespace configapi
{
namespace uno = com::sun::star::uno;
- typedef uno::XInterface UnoInterface;
- typedef uno::Reference< uno::XInterface > UnoInterfaceRef;
- typedef uno::Any UnoAny;
class ApiTreeImpl;
class NodeElement;
@@ -67,44 +61,42 @@ namespace configmgr
// used to register objects
class ObjectRegistry;
- typedef rtl::Reference<ObjectRegistry> ObjectRegistryHolder;
- typedef cppu::OImplementationId UnoTunnelID;
// used to create UNO objects
- class Factory : Noncopyable
+ class Factory : private boost::noncopyable
{
- ObjectRegistryHolder m_pRegistry;
- UnoTunnelID const m_aTunnelID;
+ 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(ObjectRegistryHolder pRegistry);
+ Factory(rtl::Reference<ObjectRegistry> pRegistry);
virtual ~Factory();
- UnoInterfaceRef makeUnoElement(configuration::Tree const& aTree, configuration::NodeRef const& aNode);
- UnoInterfaceRef findUnoElement(configuration::NodeID const& aNode);
+ uno::Reference< uno::XInterface > makeUnoElement(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode);
+ uno::Reference< uno::XInterface > findUnoElement(configuration::NodeID const& aNode);
- UnoInterfaceRef makeUnoGroupMember(configuration::Tree const& aTree, configuration::NodeRef const& aNode);
- UnoInterfaceRef makeUnoSetElement(configuration::ElementTree const& aTree);
+ uno::Reference< uno::XInterface > makeUnoGroupMember(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode);
+ uno::Reference< uno::XInterface > makeUnoSetElement(rtl::Reference< configuration::ElementTree > const& aTree);
- NodeElement* makeElement(configuration::Tree const& aTree, configuration::NodeRef const& aNode);
+ NodeElement* makeElement(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode);
NodeElement* findElement(configuration::NodeID const& aNode);
- NodeElement* makeGroupMember(configuration::Tree const& aTree, configuration::NodeRef const& aNode);
- TreeElement* makeAccessRoot(configuration::Tree const& aTree, RequestOptions const& _aOptions);
- SetElement* makeSetElement(configuration::ElementTree const& aTree);
+ NodeElement* makeGroupMember(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode);
+ TreeElement* makeAccessRoot(rtl::Reference< configuration::Tree > const& aTree, RequestOptions const& _aOptions);
+ SetElement* makeSetElement(rtl::Reference< configuration::ElementTree > const& aTree);
- SetElement* findSetElement(configuration::ElementRef const& aElement);
+ 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(UnoAny const& aElement);
+ SetElement* extractSetElement(uno::Any const& aElement);
bool tunnelSetElement(sal_Int64& nSomething, SetElement& rElement, uno::Sequence< sal_Int8 > const& aTunnelID);
// registry operations
@@ -115,14 +107,14 @@ namespace configmgr
uno::Sequence< sal_Int8 > doGetElementTunnelID() const { return m_aTunnelID.getImplementationId(); }
- virtual NodeElement* doCreateGroupMember(configuration::Tree const& aTree, configuration::NodeRef const& aNode, configuration::Template* pSetElementTemplate) = 0;
- virtual TreeElement* doCreateAccessRoot(configuration::Tree const& aTree, configuration::Template* pSetElementTemplate, vos::ORef< OOptions >const& _xOptions) = 0;
- virtual SetElement* doCreateSetElement(configuration::ElementTree const& aTree, configuration::Template* pSetElementTemplate) = 0;
+ 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 configuration::TemplateHolder implGetSetElementTemplate(configuration::Tree const& aTree, configuration::NodeRef const& aNode);
- static UnoInterfaceRef implToUno(NodeElement* pNode);
+ 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);
};
diff --git a/configmgr/source/api2/apifactoryimpl.cxx b/configmgr/source/api2/apifactoryimpl.cxx
index 85bea01e69..8a64373153 100644
--- a/configmgr/source/api2/apifactoryimpl.cxx
+++ b/configmgr/source/api2/apifactoryimpl.cxx
@@ -47,13 +47,11 @@ namespace configmgr
{
namespace configapi
{
- using configuration::Template;
- using configuration::NodeID;
//-----------------------------------------------------------------------------
// class ReadOnlyObjectFactory
//-----------------------------------------------------------------------------
-ReadOnlyObjectFactory::ReadOnlyObjectFactory(ApiProvider& rProvider,ObjectRegistryHolder pRegistry)
+ReadOnlyObjectFactory::ReadOnlyObjectFactory(ApiProvider& rProvider,rtl::Reference<ObjectRegistry> pRegistry)
: Factory(pRegistry)
, m_rProvider(rProvider)
{
@@ -65,21 +63,21 @@ ReadOnlyObjectFactory::~ReadOnlyObjectFactory()
}
//-----------------------------------------------------------------------------
-NodeElement* ReadOnlyObjectFactory::doCreateGroupMember(configuration::Tree const& aTree, configuration::NodeRef const& aNode, Template* pSetElementTemplate)
+NodeElement* ReadOnlyObjectFactory::doCreateGroupMember(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode, configuration::Template* pSetElementTemplate)
{
- OSL_ENSURE(!aTree.isEmpty(), "ERROR: trying to create a group member without a tree");
+ 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), "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))
+ 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());
+ 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;
- UnoInterfaceRef aRootRelease(pRootElement->getUnoInstance(), uno::UNO_REF_NO_ACQUIRE);
+ uno::Reference<uno::XInterface> aRootRelease(pRootElement->getUnoInstance(), uno::UNO_REF_NO_ACQUIRE);
ApiTreeImpl& rRootContext = getImplementation(*pRootElement);
NodeElement * pResult = 0;
@@ -100,9 +98,9 @@ NodeElement* ReadOnlyObjectFactory::doCreateGroupMember(configuration::Tree cons
}
//-----------------------------------------------------------------------------
-TreeElement* ReadOnlyObjectFactory::doCreateAccessRoot(configuration::Tree const& aTree, Template* pSetElementTemplate, vos::ORef< OOptions >const& _xOptions)
+TreeElement* ReadOnlyObjectFactory::doCreateAccessRoot(rtl::Reference< configuration::Tree > const& aTree, configuration::Template* pSetElementTemplate, vos::ORef< OOptions >const& _xOptions)
{
- OSL_ENSURE(!aTree.isEmpty(), "ERROR: trying to create a root object without a tree");
+ OSL_ENSURE(!configuration::isEmpty(aTree.get()), "ERROR: trying to create a root object without a tree");
TreeElement * pResult = 0;
if (!pSetElementTemplate)
@@ -121,24 +119,24 @@ TreeElement* ReadOnlyObjectFactory::doCreateAccessRoot(configuration::Tree const
}
//-----------------------------------------------------------------------------
-SetElement* ReadOnlyObjectFactory::doCreateSetElement(configuration::ElementTree const& aElementTree, Template* pSetElementTemplate)
+SetElement* ReadOnlyObjectFactory::doCreateSetElement(rtl::Reference< configuration::ElementTree > const& aElementTree, configuration::Template* pSetElementTemplate)
{
- OSL_ENSURE(aElementTree.isValid(), "ERROR: trying to create a set element object without a tree");
+ OSL_ENSURE(aElementTree.is(), "ERROR: trying to create a set element object without a tree");
- Tree aTree( aElementTree.getTree() );
- OSL_ENSURE(!aTree.isEmpty(), "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;
- UnoInterfaceRef aParentRelease;
+ uno::Reference<uno::XInterface> aParentRelease;
- configuration::Tree aParentTree = aTree.getContextTree();
- if (!aParentTree.isEmpty())
+ rtl::Reference< configuration::Tree > aParentTree = aTree->getContextTree();
+ if (!configuration::isEmpty(aParentTree.get()))
{
- //NodeRef aParentNode = aTree.getContextNode();
- NodeRef aParentRoot = aParentTree.getRootNode();
+ //configuration::NodeRef aParentNode = aTree.getContextNode();
+ configuration::NodeRef aParentRoot = aParentTree->getRootNode();
if (NodeElement* pParentRootElement = makeElement(aParentTree,aParentRoot) )
{
- aParentRelease = UnoInterfaceRef(pParentRootElement->getUnoInstance(), uno::UNO_REF_NO_ACQUIRE);
+ aParentRelease = uno::Reference<uno::XInterface>(pParentRootElement->getUnoInstance(), uno::UNO_REF_NO_ACQUIRE);
pParentContext = &getImplementation(*pParentRootElement);
}
}
@@ -146,13 +144,13 @@ SetElement* ReadOnlyObjectFactory::doCreateSetElement(configuration::ElementTree
SetElement * pResult = 0;
if (!pSetElementTemplate)
{
- OSetElementGroupInfo * pNewObject = new OSetElementGroupInfo(aTree.getRef(),m_rProvider,pParentContext);
+ OSetElementGroupInfo * pNewObject = new OSetElementGroupInfo(aTree,m_rProvider,pParentContext);
pNewObject->acquire();
pResult = &pNewObject->getElementClass();
}
else
{
- OSetElementSetInfo * pNewObject = new OSetElementSetInfo(aTree.getRef(),m_rProvider,pParentContext);
+ OSetElementSetInfo * pNewObject = new OSetElementSetInfo(aTree,m_rProvider,pParentContext);
pNewObject->acquire();
pResult = &pNewObject->getElementClass();
}
@@ -164,7 +162,7 @@ SetElement* ReadOnlyObjectFactory::doCreateSetElement(configuration::ElementTree
// class UpdateObjectFactory
//-----------------------------------------------------------------------------
-UpdateObjectFactory::UpdateObjectFactory(ApiProvider& rProvider,ObjectRegistryHolder pRegistry)
+UpdateObjectFactory::UpdateObjectFactory(ApiProvider& rProvider,rtl::Reference<ObjectRegistry> pRegistry)
: Factory(pRegistry)
, m_rProvider(rProvider)
{
@@ -176,28 +174,28 @@ UpdateObjectFactory::~UpdateObjectFactory()
}
//-----------------------------------------------------------------------------
-bool UpdateObjectFactory::implIsReadOnly(configuration::Tree const& aTree, configuration::NodeRef const& aNode)
+bool UpdateObjectFactory::implIsReadOnly(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode)
{
- OSL_ENSURE(!aTree.isEmpty(), "ERROR: trying to create an object without a tree");
+ 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), "ERROR: node does not match tree , while trying to create an object");
+ OSL_ENSURE(aTree->isValidNode(aNode.getOffset()), "ERROR: node does not match tree , while trying to create an object");
- return aTree.getAttributes(aNode).isReadonly();
+ return aTree->getAttributes(aNode).isReadonly();
}
//-----------------------------------------------------------------------------
-NodeElement* UpdateObjectFactory::doCreateGroupMember(configuration::Tree const& aTree, configuration::NodeRef const& aNode, Template* pSetElementTemplate)
+NodeElement* UpdateObjectFactory::doCreateGroupMember(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode, configuration::Template* pSetElementTemplate)
{
- OSL_ENSURE(!aTree.isEmpty(), "ERROR: trying to create a group member without a tree");
+ 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), "ERROR: node does not match tree , while trying to create a group");
+ OSL_ENSURE(aTree->isValidNode(aNode.getOffset()), "ERROR: node does not match tree , while trying to create a group");
- NodeElement* pRootElement = makeElement(aTree,aTree.getRootNode());
+ 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;
- UnoInterfaceRef aRootRelease(pRootElement->getUnoInstance(), uno::UNO_REF_NO_ACQUIRE);
+ uno::Reference<uno::XInterface> aRootRelease(pRootElement->getUnoInstance(), uno::UNO_REF_NO_ACQUIRE);
ApiTreeImpl& rRootContext = getImplementation(*pRootElement);
NodeElement * pResult = 0;
@@ -243,12 +241,12 @@ NodeElement* UpdateObjectFactory::doCreateGroupMember(configuration::Tree const&
}
//-----------------------------------------------------------------------------
-TreeElement* UpdateObjectFactory::doCreateAccessRoot(configuration::Tree const& aTree, Template* pSetElementTemplate, vos::ORef< OOptions >const& _xOptions)
+TreeElement* UpdateObjectFactory::doCreateAccessRoot(rtl::Reference< configuration::Tree > const& aTree, configuration::Template* pSetElementTemplate, vos::ORef< OOptions >const& _xOptions)
{
- OSL_ENSURE(!aTree.isEmpty(), "ERROR: trying to create a root object without a tree");
+ OSL_ENSURE(!configuration::isEmpty(aTree.get()), "ERROR: trying to create a root object without a tree");
TreeElement * pResult = 0;
- if (implIsReadOnly(aTree,aTree.getRootNode()))
+ if (implIsReadOnly(aTree,aTree->getRootNode()))
{
OSL_ENSURE(false, "WARNING: Trying to create an 'Update Access' on a read-only tree/node");
if (!pSetElementTemplate)
@@ -290,40 +288,40 @@ TreeElement* UpdateObjectFactory::doCreateAccessRoot(configuration::Tree const&
}
//-----------------------------------------------------------------------------
-SetElement* UpdateObjectFactory::doCreateSetElement(configuration::ElementTree const& aElementTree, Template* pSetElementTemplate)
+SetElement* UpdateObjectFactory::doCreateSetElement(rtl::Reference< configuration::ElementTree > const& aElementTree, configuration::Template* pSetElementTemplate)
{
- OSL_ENSURE(aElementTree.isValid(), "ERROR: trying to create a set element object without a tree");
+ OSL_ENSURE(aElementTree.is(), "ERROR: trying to create a set element object without a tree");
- Tree aTree( aElementTree.getTree() );
- OSL_ENSURE(!aTree.isEmpty(), "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;
- UnoInterfaceRef aParentRelease;
+ uno::Reference<uno::XInterface> aParentRelease;
- configuration::Tree aParentTree = aTree.getContextTree();
- if (!aParentTree.isEmpty())
+ rtl::Reference< configuration::Tree > aParentTree = aTree->getContextTree();
+ if (!configuration::isEmpty(aParentTree.get()))
{
- //NodeRef aParentNode = aTree.getContextNode();
- NodeRef aParentRoot = aParentTree.getRootNode();
+ //configuration::NodeRef aParentNode = aTree.getContextNode();
+ configuration::NodeRef aParentRoot = aParentTree->getRootNode();
if (NodeElement* pParentRootElement = makeElement(aParentTree,aParentRoot) )
{
- aParentRelease = UnoInterfaceRef(pParentRootElement->getUnoInstance(), uno::UNO_REF_NO_ACQUIRE);
+ aParentRelease = uno::Reference<uno::XInterface>(pParentRootElement->getUnoInstance(), uno::UNO_REF_NO_ACQUIRE);
pParentContext = &getImplementation(*pParentRootElement);
}
}
SetElement * pResult = 0;
- if (implIsReadOnly(aTree,aTree.getRootNode()))
+ if (implIsReadOnly(aTree,aTree->getRootNode()))
{
if (!pSetElementTemplate)
{
- OSetElementGroupInfo * pNewObject = new OSetElementGroupInfo(aTree.getRef(),m_rProvider,pParentContext);
+ OSetElementGroupInfo * pNewObject = new OSetElementGroupInfo(aTree,m_rProvider,pParentContext);
pNewObject->acquire();
pResult = &pNewObject->getElementClass();
}
else
{
- OSetElementSetInfo * pNewObject = new OSetElementSetInfo(aTree.getRef(),m_rProvider,pParentContext);
+ OSetElementSetInfo * pNewObject = new OSetElementSetInfo(aTree,m_rProvider,pParentContext);
pNewObject->acquire();
pResult = &pNewObject->getElementClass();
}
@@ -332,19 +330,19 @@ SetElement* UpdateObjectFactory::doCreateSetElement(configuration::ElementTree c
{
if (!pSetElementTemplate)
{
- OSetElementGroupUpdate * pNewObject = new OSetElementGroupUpdate(aTree.getRef(),m_rProvider,pParentContext);
+ OSetElementGroupUpdate * pNewObject = new OSetElementGroupUpdate(aTree,m_rProvider,pParentContext);
pNewObject->acquire();
pResult = &pNewObject->getElementClass();
}
else if (pSetElementTemplate->isInstanceValue())
{
- OSetElementValueSetUpdate * pNewObject = new OSetElementValueSetUpdate(aTree.getRef(),m_rProvider,pParentContext);
+ OSetElementValueSetUpdate * pNewObject = new OSetElementValueSetUpdate(aTree,m_rProvider,pParentContext);
pNewObject->acquire();
pResult = &pNewObject->getElementClass();
}
else
{
- OSetElementTreeSetUpdate * pNewObject = new OSetElementTreeSetUpdate(aTree.getRef(),m_rProvider,pParentContext);
+ OSetElementTreeSetUpdate * pNewObject = new OSetElementTreeSetUpdate(aTree,m_rProvider,pParentContext);
pNewObject->acquire();
pResult = &pNewObject->getElementClass();
}
diff --git a/configmgr/source/api2/apifactoryimpl.hxx b/configmgr/source/api2/apifactoryimpl.hxx
index 6c0d276f54..dc355f5b71 100644
--- a/configmgr/source/api2/apifactoryimpl.hxx
+++ b/configmgr/source/api2/apifactoryimpl.hxx
@@ -43,26 +43,26 @@ namespace configmgr
{
ApiProvider& m_rProvider;
public:
- ReadOnlyObjectFactory(ApiProvider& rProvider,ObjectRegistryHolder pRegistry);
+ ReadOnlyObjectFactory(ApiProvider& rProvider,rtl::Reference<ObjectRegistry> pRegistry);
~ReadOnlyObjectFactory();
- virtual NodeElement* doCreateGroupMember(configuration::Tree const& aTree, configuration::NodeRef const& aNode, configuration::Template* pSetElementTemplate);
- virtual TreeElement* doCreateAccessRoot(configuration::Tree const& aTree, configuration::Template* pSetElementTemplate, vos::ORef< OOptions >const& _xOptions);
- virtual SetElement* doCreateSetElement(configuration::ElementTree const& aTree, configuration::Template* pSetElementTemplate);
+ 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,ObjectRegistryHolder pRegistry);
+ UpdateObjectFactory(ApiProvider& rProvider,rtl::Reference<ObjectRegistry> pRegistry);
~UpdateObjectFactory();
- virtual NodeElement* doCreateGroupMember(configuration::Tree const& aTree, configuration::NodeRef const& aNode, configuration::Template* pSetElementTemplate);
- virtual TreeElement* doCreateAccessRoot(configuration::Tree const& aTree, configuration::Template* pSetElementTemplate, vos::ORef< OOptions >const& _xOptions);
- virtual SetElement* doCreateSetElement(configuration::ElementTree const& aTree, configuration::Template* pSetElementTemplate);
+ 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(configuration::Tree const& aTree, configuration::NodeRef const& aNode);
+ bool implIsReadOnly(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode);
};
}
diff --git a/configmgr/source/api2/apinodeaccess.cxx b/configmgr/source/api2/apinodeaccess.cxx
index ed2d191562..c5f9cd0717 100644
--- a/configmgr/source/api2/apinodeaccess.cxx
+++ b/configmgr/source/api2/apinodeaccess.cxx
@@ -63,15 +63,15 @@ configuration::NodeRef NodeAccess::getNodeRef() const
}
//-----------------------------------------------------------------------------
-configuration::TreeRef NodeAccess::getTreeRef() const
+rtl::Reference< configuration::Tree > NodeAccess::getTreeRef() const
{
return getApiTree().getTree();
}
//-----------------------------------------------------------------------------
-configuration::Tree NodeAccess::getTree() const
+rtl::Reference< configuration::Tree > NodeAccess::getTree() const
{
- return configuration::Tree(getApiTree().getTree());
+ return getApiTree().getTree();
}
//-----------------------------------------------------------------------------
@@ -101,13 +101,13 @@ Notifier NodeAccess::getNotifier() const
//-----------------------------------------------------------------------------
-UnoAny makeElement(configapi::Factory& rFactory, configuration::Tree const& aTree, configuration::AnyNodeRef const& aNode)
+uno::Any makeElement(configapi::Factory& rFactory, rtl::Reference< configuration::Tree > const& aTree, configuration::AnyNodeRef const& aNode)
{
- if (!aTree.isEmpty() && aNode.isValid())
+ if (!configuration::isEmpty(aTree.get()) && aNode.isValid())
{
if (aNode.isNode())
{
- NodeRef aInnerNode = aNode.toNode();
+ configuration::NodeRef aInnerNode = aNode.toNode();
if (configuration::isStructuralNode(aTree,aInnerNode))
return uno::makeAny( rFactory.makeUnoElement(aTree,aInnerNode) );
@@ -121,75 +121,60 @@ UnoAny makeElement(configapi::Factory& rFactory, configuration::Tree const& aTre
}
}
- return UnoAny();
+ return uno::Any();
}
//-----------------------------------------------------------------------------
-UnoAny makeInnerElement(configapi::Factory& rFactory, configuration::Tree const& aTree, configuration::NodeRef const& aNode)
+uno::Any makeInnerElement(configapi::Factory& rFactory, rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode)
{
- if (!aTree.isEmpty() && aNode.isValid())
+ 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 UnoAny();
+ return uno::Any();
}
//-----------------------------------------------------------------------------
-UnoAny makeElement(configapi::Factory& rFactory, configuration::ElementTree const& aTree)
+uno::Any makeElement(configapi::Factory& rFactory, rtl::Reference< configuration::ElementTree > const& aTree)
{
- if (aTree.isValid())
+ if (aTree.is())
{
return uno::makeAny( rFactory.makeUnoSetElement(aTree) );
}
- return UnoAny();
+ return uno::Any();
}
//-----------------------------------------------------------------------------
-configuration::ElementRef extractElementRef(configapi::Factory& rFactory, UnoAny const& aElement, configuration::TemplateInfo const& aTemplateInfo )
+rtl::Reference< configuration::ElementTree > extractElementTree(configapi::Factory& rFactory, uno::Any const& aElement, rtl::Reference< configuration::Template > const& aTemplate )
{
- using configuration::ElementRef;
- configuration::TemplateHolder const aRequestedTemplate = aTemplateInfo.getTemplate();
- OSL_ENSURE(aRequestedTemplate.is(), "ERROR: Need a template to extract a matching set element");
- if (!aRequestedTemplate.is())
- return ElementRef(NULL);
+ OSL_ENSURE(aTemplate.is(), "ERROR: Need a template to extract a matching set element");
if (SetElement* pSetElement = rFactory.extractSetElement(aElement))
{
- configuration::TemplateHolder aFoundTemplate = pSetElement->getTemplateInfo().getTemplate();
+ rtl::Reference<configuration::Template> aFoundTemplate = pSetElement->getTemplateInfo();
if (aFoundTemplate.is())
{
- if (aFoundTemplate != aRequestedTemplate)
- throw configuration::TypeMismatch(aFoundTemplate->getPathString(), aRequestedTemplate->getPathString());
+ if (aFoundTemplate != aTemplate)
+ throw configuration::TypeMismatch(aFoundTemplate->getPathString(), aTemplate->getPathString());
return pSetElement->getElementRef( );
}
}
- return ElementRef(NULL);
-}
-//-----------------------------------------------------------------------------
-
-configuration::ElementTree extractElementTree(configapi::Factory& rFactory, UnoAny const& aElement, configuration::SetElementInfo const& aElementInfo )
-{
- using namespace configuration;
- ElementRef aExtractedRef = extractElementRef(rFactory,aElement,aElementInfo.getTemplateInfo());
- return aExtractedRef.getElementTree();
+ return rtl::Reference< configuration::ElementTree >();
}
//-----------------------------------------------------------------------------
-configuration::SetElementInfo NodeSetInfoAccess::getElementInfo() const
+rtl::Reference< configuration::Template > NodeSetInfoAccess::getElementInfo() const
{
- using configuration::SetElementInfo;
- using configuration::TemplateHolder;
-
- TemplateHolder aTemplate = SetElementInfo::extractElementInfo(getTree(),getNodeRef());
+ rtl::Reference<configuration::Template> aTemplate = getTree()->extractElementInfo(getNodeRef());
OSL_ENSURE(aTemplate.is(), "ERROR: Set must have an element template");
- return SetElementInfo(aTemplate);
+ return aTemplate;
}
}
diff --git a/configmgr/source/api2/apinodeaccess.hxx b/configmgr/source/api2/apinodeaccess.hxx
index d585a9bcbd..c0c80fe386 100644
--- a/configmgr/source/api2/apinodeaccess.hxx
+++ b/configmgr/source/api2/apinodeaccess.hxx
@@ -31,6 +31,11 @@
#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"
@@ -40,16 +45,9 @@ namespace configmgr
{
namespace configuration
{
- class Name;
class AnyNodeRef;
class NodeRef;
- class TreeRef;
class Tree;
-
- class SetElementInfo;
- class TemplateInfo;
- class ElementRef;
- class ElementTree;
}
namespace configapi
{
@@ -60,36 +58,34 @@ namespace configmgr
class ApiTreeImpl;
namespace uno = com::sun::star::uno;
- typedef uno::XInterface UnoInterface;
- typedef uno::Any UnoAny;
// 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 : Noncopyable
+ class NodeAccess : private boost::noncopyable
{
public:
virtual ~NodeAccess();
// model access
configuration::NodeRef getNodeRef() const;
- configuration::TreeRef getTreeRef() const;
- configuration::Tree getTree() 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
- UnoInterface* getUnoInstance() const
+ uno::XInterface* getUnoInstance() const
{ return doGetUnoInstance(); }
Factory& getFactory() const;
Notifier getNotifier() const;
protected:
virtual configuration::NodeRef doGetNode() const = 0;
- virtual UnoInterface* doGetUnoInstance() const = 0;
+ virtual uno::XInterface* doGetUnoInstance() const = 0;
virtual ApiTreeImpl& getApiTree() const = 0;
};
@@ -98,21 +94,21 @@ namespace configmgr
to create service implementations wrapping inner nodes</p>
<p> returns VOID if <var>aNode</var> is empty.</p>
*/
- UnoAny makeElement(configapi::Factory& rFactory, configuration::Tree const& aTree, configuration::AnyNodeRef const& aNode);
+ 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>
*/
- UnoAny makeInnerElement(configapi::Factory& rFactory, configuration::Tree const& aTree, configuration::NodeRef const& aNode);
+ 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>
*/
- UnoAny makeElement(configapi::Factory& rFactory, configuration::ElementTree const& aTree);
+ uno::Any makeElement(configapi::Factory& rFactory, rtl::Reference< configuration::ElementTree > const& aTree);
// Info interfaces for Group Nodes
@@ -127,88 +123,51 @@ namespace configmgr
{
friend class SetElement;
public:
- configuration::SetElementInfo getElementInfo() const;
+ 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>aElementInfo</var>.
+ 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 <type scope='configmgr::configuration'>Tree</type> if <var>aElement</var> is empty.</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>
*/
- configuration::ElementRef extractElementRef (Factory& rFactory, UnoAny const& aElement, configuration::TemplateInfo const& aElementInfo );
- configuration::ElementTree extractElementTree(Factory& rFactory, UnoAny const& aElement, configuration::SetElementInfo const& aElementInfo );
-
- // Guarding and locking implementations
- /// guards a NodeAccess; provides an object (read) lock,
- /// ensures object was not disposed
-
-// FIXME: can evaporate this class [ I think ]
- class NodeReadGuardImpl : Noncopyable
- {
- NodeAccess &m_rNode;
- public:
- NodeReadGuardImpl(NodeAccess& rNode)
- : m_rNode(rNode)
- { rNode.checkAlive(); }
- ~NodeReadGuardImpl()
- {}
- public:
- NodeAccess& get() const { return m_rNode; }
-
- configuration::Tree getTree() const
- { return m_rNode.getTree(); }
- configuration::NodeRef getNode() const
- { return m_rNode.getNodeRef(); }
- };
-
- // Thin Wrappers around NodeAccesses: Provide guarding and convenient access
- /// wraps a NodeAccess; provides an object (read) lock, ensures object was not disposed
- template <class Access>
- class GuardedNode
- {
- NodeReadGuardImpl m_aViewLock;
- public:
- GuardedNode(Access& rNode) : m_aViewLock(rNode) {}
- public:
- Access& get() const { return static_cast<Access&>(m_aViewLock.get()); }
- };
- typedef GuardedNode<NodeAccess> GuardedNodeAccess;
+ 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;
- NodeReadGuardImpl m_aViewLock;
+ Access & m_rNode;
public:
GuardedNodeData(Access& rNode);
public:
- Access& get() const { return static_cast<Access&>(m_aViewLock.get()); }
+ Access& get() const { return m_rNode; }
- configuration::Tree getTree() const;
+ rtl::Reference< configuration::Tree > getTree() const;
configuration::NodeRef getNode() const;
};
- typedef GuardedNodeData<NodeAccess> GuardedNodeDataAccess;
template <class Access>
GuardedNodeData<Access>::GuardedNodeData(Access& rNode)
- : m_aViewLock(rNode)
+ : m_rNode(rNode)
{
+ rNode.checkAlive();
}
template <class Access>
- configuration::Tree GuardedNodeData<Access>::getTree() const
+ rtl::Reference< configuration::Tree > GuardedNodeData<Access>::getTree() const
{
- return (configuration::Tree) m_aViewLock.getTree();
+ return m_rNode.getTree();
}
template <class Access>
configuration::NodeRef GuardedNodeData<Access>::getNode() const
{
- return m_aViewLock.getNode();
+ return m_rNode.getNodeRef();
}
}
}
diff --git a/configmgr/source/api2/apinodeupdate.cxx b/configmgr/source/api2/apinodeupdate.cxx
index f3e938c6dd..d7cf1d409c 100644
--- a/configmgr/source/api2/apinodeupdate.cxx
+++ b/configmgr/source/api2/apinodeupdate.cxx
@@ -68,9 +68,8 @@ configuration::GroupDefaulter NodeGroupAccess::getNodeDefaulter()
configuration::SetElementFactory NodeTreeSetAccess::getElementFactory()
{
- using namespace configuration;
- TemplateProvider aProvider = SetElementFactory::findTemplateProvider(getTree(),getNodeRef());
- return SetElementFactory(aProvider);
+ configuration::TemplateProvider aProvider = configuration::SetElementFactory::findTemplateProvider(getTree(),getNodeRef());
+ return configuration::SetElementFactory(aProvider);
}
//-----------------------------------------------------------------------------
@@ -95,29 +94,25 @@ configuration::ValueSetUpdater NodeValueSetAccess::getNodeUpdater()
void attachSetElement(NodeTreeSetAccess& aSet, SetElement& aElement)
{
- using configuration::NodeID;
- OSL_ENSURE( NodeID(aSet.getTreeRef(),aSet.getNodeRef()) ==
- NodeID(aElement.getTreeRef().getContextTree(),aElement.getTreeRef().getContextNode()),
+ 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, configuration::ElementTree const& aElementTree)
+bool attachSetElement(NodeTreeSetAccess& aSet, rtl::Reference< configuration::ElementTree > const& aElementTree)
{
- using configuration::NodeID;
- OSL_ENSURE( NodeID(aSet.getTreeRef(),aSet.getNodeRef()) ==
- NodeID(aElementTree.getTree().getContextTree(),aElementTree.getTree().getContextNode()),
+ 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();
-
- configuration::ElementRef aElementRef( aElementTree.getImpl() ); // no other conversion available
- if (SetElement* pSetElement = rFactory.findSetElement(aElementRef))
+ if (SetElement* pSetElement = rFactory.findSetElement(aElementTree))
{
// the factory always does an extra acquire
- UnoInterfaceRef xReleaseSetElement(pSetElement->getUnoInstance(), uno::UNO_REF_NO_ACQUIRE);
+ uno::Reference<uno::XInterface> xReleaseSetElement(pSetElement->getUnoInstance(), uno::UNO_REF_NO_ACQUIRE);
attachSetElement(aSet, *pSetElement);
return true;
@@ -130,22 +125,22 @@ bool attachSetElement(NodeTreeSetAccess& aSet, configuration::ElementTree const&
void detachSetElement(SetElement& aElement)
{
- OSL_ENSURE( aElement.getTreeRef().getContextTree().isEmpty(),
+ OSL_ENSURE( configuration::isEmpty(aElement.getTreeRef()->getContextTree()),
"ERROR: Detaching a SetElement that has a parent");
aElement.haveNewParent(0);
}
//-----------------------------------------------------------------------------
-bool detachSetElement(Factory& rFactory, configuration::ElementRef const& aElementTree)
+bool detachSetElement(Factory& rFactory, rtl::Reference< configuration::ElementTree > const& aElementTree)
{
- OSL_ENSURE( aElementTree.getTreeRef().getContextTree().isEmpty(),
+ 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
- UnoInterfaceRef xReleaseSetElement(pSetElement->getUnoInstance(), uno::UNO_REF_NO_ACQUIRE);
+ uno::Reference<uno::XInterface> xReleaseSetElement(pSetElement->getUnoInstance(), uno::UNO_REF_NO_ACQUIRE);
detachSetElement(*pSetElement);
return true;
diff --git a/configmgr/source/api2/apinodeupdate.hxx b/configmgr/source/api2/apinodeupdate.hxx
index 2b955ead4a..bade3975f3 100644
--- a/configmgr/source/api2/apinodeupdate.hxx
+++ b/configmgr/source/api2/apinodeupdate.hxx
@@ -31,6 +31,10 @@
#ifndef CONFIGMGR_API_NODEUPDATE_HXX_
#define CONFIGMGR_API_NODEUPDATE_HXX_
+#include "sal/config.h"
+
+#include "boost/utility.hpp"
+
#include "apinodeaccess.hxx"
#include "utility.hxx"
@@ -44,7 +48,6 @@ namespace configmgr
class ValueSetUpdater;
class SetDefaulter;
class SetElementFactory;
- class ElementTree;
class NodeUpdate;
}
@@ -52,9 +55,6 @@ namespace configmgr
{
class SetElement;
- typedef uno::XInterface UnoInterface;
- typedef uno::Any UnoAny;
-
// API object implementation wrappers
// these objects just provide the pieces needed to navigate and manipulate trees and nodes
@@ -104,17 +104,17 @@ namespace configmgr
void attachSetElement(NodeTreeSetAccess& aSet, SetElement& aElement);
/// informs a <type>SetElement</type> that it should now link to the given SetElement
- bool attachSetElement(NodeTreeSetAccess& aSet, configuration::ElementTree const& aElementTree);
+ 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, configuration::ElementRef const& aElementTree);
+ 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 : Noncopyable
+ class UpdateGuardImpl : private boost::noncopyable
{
NodeAccess& m_rNode;
public:
@@ -139,20 +139,17 @@ namespace configmgr
public:
Access& get() const { return static_cast<Access&>(m_aImpl.get()); }
- configuration::Tree getTree() const;
+ rtl::Reference< configuration::Tree > getTree() const;
configuration::NodeRef getNode() const;
- typedef typename Access::NodeUpdater Updater;
- typedef typename Access::NodeDefaulter Defaulter;
-
- Updater getNodeUpdater() const;
- Defaulter getNodeDefaulter() const;
+ typename Access::NodeUpdater getNodeUpdater() const;
+ typename Access::NodeDefaulter getNodeDefaulter() const;
void clearForBroadcast() { m_aImpl.downgrade(); }
};
template <class Access>
- configuration::Tree GuardedNodeUpdate<Access>::getTree() const
+ rtl::Reference< configuration::Tree > GuardedNodeUpdate<Access>::getTree() const
{
return get().getTree();
}
@@ -164,22 +161,16 @@ namespace configmgr
}
template <class Access>
- typename GuardedNodeUpdate<Access>::Updater GuardedNodeUpdate<Access>::getNodeUpdater() const
+ typename Access::NodeUpdater GuardedNodeUpdate<Access>::getNodeUpdater() const
{
return get().getNodeUpdater();
}
template <class Access>
- typename GuardedNodeUpdate<Access>::Defaulter GuardedNodeUpdate<Access>::getNodeDefaulter() const
+ typename Access::NodeDefaulter GuardedNodeUpdate<Access>::getNodeDefaulter() const
{
return get().getNodeDefaulter();
}
-
- /// wraps a NodeGroupAccess; provides an object (write) lock, ensures object was not disposed
- typedef GuardedNodeUpdate<NodeGroupAccess> GuardedGroupUpdateAccess;
- typedef GuardedNodeUpdate<NodeSetAccess> GuardedSetUpdateAccess;
- typedef GuardedNodeUpdate<NodeTreeSetAccess> GuardedTreeSetUpdateAccess;
- typedef GuardedNodeUpdate<NodeValueSetAccess> GuardedValueSetUpdateAccess;
}
}
diff --git a/configmgr/source/api2/apinotifierimpl.cxx b/configmgr/source/api2/apinotifierimpl.cxx
index 1313c7688b..8dca2a44a0 100644
--- a/configmgr/source/api2/apinotifierimpl.cxx
+++ b/configmgr/source/api2/apinotifierimpl.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: apinotifierimpl.cxx,v $
- * $Revision: 1.8.14.1 $
+ * $Revision: 1.8.20.5 $
*
* This file is part of OpenOffice.org.
*
@@ -48,21 +48,13 @@ namespace configmgr
namespace util = css::util;
namespace beans = css::beans;
- using uno::RuntimeException;
- using uno::Reference;
-
- using configuration::NodeRef;
- using configuration::ValueRef;
- using configuration::Tree;
-
-
// Generic Notifier Support Implementations
//-----------------------------------------------------------------------------------
/// add a Listener to the notifier of a NodeAccess
template <class Listener>
inline
-void genericAddListener(NodeAccess& rNode, const Reference< Listener >& xListener )
+void genericAddListener(NodeAccess& rNode, const uno::Reference< Listener >& xListener )
{
GuardedNotifier aGuardedNotifier( rNode ); // guard the notifier
aGuardedNotifier->add(rNode.getNodeRef(), xListener);
@@ -71,7 +63,7 @@ void genericAddListener(NodeAccess& rNode, const Reference< Listener >& xListene
/// remove a Listener from the notifier of a NodeAccess
template <class Listener>
inline
-void genericRemoveListener(NodeAccess& rNode, const Reference< Listener >& xListener )
+void genericRemoveListener(NodeAccess& rNode, const uno::Reference< Listener >& xListener )
{
GuardedNotifier aGuardedNotifier( rNode ); // guard the notifier
aGuardedNotifier->remove(rNode.getNodeRef(), xListener);
@@ -86,21 +78,19 @@ void genericRemoveListener(NodeAccess& rNode, const Reference< Listener >& xList
*/
template <class Listener>
inline
-bool genericAddChildListener(NodeGroupInfoAccess& rNode, const Reference< Listener >& xListener, const OUString& sName )
+bool genericAddChildListener(NodeGroupInfoAccess& rNode, const uno::Reference< Listener >& xListener, const rtl::OUString& sName )
{
- using configuration::validateChildName;
-
if (sName.getLength() != 0)
{
- GuardedNodeDataAccess aGuardedNode( rNode ); // guard access to children
+ GuardedNodeData<NodeAccess> aGuardedNode( rNode ); // guard access to children
GuardedNotifier aGuardedNotifier( rNode ); // guard the notifier
- Tree aTree( aGuardedNode.getTree() );
- NodeRef aNode( aGuardedNode.getNode() );
+ rtl::Reference< configuration::Tree > aTree( aGuardedNode.getTree() );
+ configuration::NodeRef aNode( aGuardedNode.getNode() );
- Name aChildName = validateChildName(sName,aTree,aNode);
+ rtl::OUString aChildName = configuration::validateChildName(sName,aTree,aNode);
- if (!aTree.hasChild(aNode,aChildName)) return false;
+ if (!aTree->hasChild(aNode,aChildName)) return false;
aGuardedNotifier->addForOne(aNode, xListener, aChildName);
}
@@ -123,21 +113,19 @@ bool genericAddChildListener(NodeGroupInfoAccess& rNode, const Reference< Listen
*/
template <class Listener>
inline
-bool genericRemoveChildListener(NodeGroupInfoAccess& rNode, const Reference< Listener >& xListener, const OUString& sName )
+bool genericRemoveChildListener(NodeGroupInfoAccess& rNode, const uno::Reference< Listener >& xListener, const rtl::OUString& sName )
{
- using configuration::validateChildName;
-
if (sName.getLength() != 0)
{
- GuardedNodeDataAccess aGuardedNode( rNode ); // guard access to children
+ GuardedNodeData<NodeAccess> aGuardedNode( rNode ); // guard access to children
GuardedNotifier aGuardedNotifier( rNode ); // guard the notifier
- Tree aTree( aGuardedNode.getTree() );
- NodeRef aNode( aGuardedNode.getNode() );
+ rtl::Reference< configuration::Tree > aTree( aGuardedNode.getTree() );
+ configuration::NodeRef aNode( aGuardedNode.getNode() );
- Name aChildName = validateChildName(sName,aTree,aNode);
+ rtl::OUString aChildName = configuration::validateChildName(sName,aTree,aNode);
- if (!aTree.hasChild(aNode,aChildName)) return false;
+ if (!aTree->hasChild(aNode,aChildName)) return false;
aGuardedNotifier->removeForOne(aNode, xListener, aChildName);
}
@@ -156,28 +144,28 @@ bool genericRemoveChildListener(NodeGroupInfoAccess& rNode, const Reference< Lis
// XComponent
//-----------------------------------------------------------------------------------
-void implAddListener(NodeAccess& rNode, const Reference< css::lang::XEventListener >& xListener )
- throw(RuntimeException)
+void implAddListener(NodeAccess& rNode, const uno::Reference< css::lang::XEventListener >& xListener )
+ throw(uno::RuntimeException)
{
genericAddListener(rNode,xListener);
}
-void implRemoveListener(NodeAccess& rNode, const Reference< css::lang::XEventListener >& xListener )
- throw(RuntimeException)
+void implRemoveListener(NodeAccess& rNode, const uno::Reference< css::lang::XEventListener >& xListener )
+ throw(uno::RuntimeException)
{
genericRemoveListener(rNode,xListener);
}
// XContainer
//-----------------------------------------------------------------------------------
-void implAddListener(NodeAccess& rNode, const Reference< css::container::XContainerListener >& xListener )
- throw(RuntimeException)
+void implAddListener(NodeAccess& rNode, const uno::Reference< css::container::XContainerListener >& xListener )
+ throw(uno::RuntimeException)
{
genericAddListener(rNode,xListener);
}
-void implRemoveListener(NodeAccess& rNode, const Reference< css::container::XContainerListener >& xListener )
- throw(RuntimeException)
+void implRemoveListener(NodeAccess& rNode, const uno::Reference< css::container::XContainerListener >& xListener )
+ throw(uno::RuntimeException)
{
genericRemoveListener(rNode,xListener);
}
@@ -185,14 +173,14 @@ void implRemoveListener(NodeAccess& rNode, const Reference< css::container::XCon
// XChangesNotifier
//-----------------------------------------------------------------------------------
-void implAddListener(NodeAccess& rNode, const Reference< css::util::XChangesListener >& xListener )
- throw(RuntimeException)
+void implAddListener(NodeAccess& rNode, const uno::Reference< css::util::XChangesListener >& xListener )
+ throw(uno::RuntimeException)
{
genericAddListener(rNode,xListener);
}
-void implRemoveListener(NodeAccess& rNode, const Reference< css::util::XChangesListener >& xListener )
- throw(RuntimeException)
+void implRemoveListener(NodeAccess& rNode, const uno::Reference< css::util::XChangesListener >& xListener )
+ throw(uno::RuntimeException)
{
genericRemoveListener(rNode,xListener);
}
@@ -200,7 +188,7 @@ void implRemoveListener(NodeAccess& rNode, const Reference< css::util::XChangesL
// XMultiPropertySet
//-----------------------------------------------------------------------------------
-void implAddListener( NodeAccess& rNode, const uno::Reference< beans::XPropertiesChangeListener >& xListener, const uno::Sequence< OUString >& aPropertyNames )
+void implAddListener( NodeAccess& rNode, const uno::Reference< beans::XPropertiesChangeListener >& xListener, const uno::Sequence< rtl::OUString >& aPropertyNames )
throw(uno::RuntimeException)
{
@@ -223,24 +211,23 @@ void implRemoveListener( NodeAccess& rNode, const uno::Reference< beans::XProper
// XPropertySet - VetoableChangeListeners
//-----------------------------------------------------------------------------------
-void implAddListener( NodeGroupInfoAccess& rNode, const uno::Reference< beans::XVetoableChangeListener >& xListener, const OUString& sPropertyName )
+void implAddListener( NodeGroupInfoAccess& rNode, const uno::Reference< beans::XVetoableChangeListener >& xListener, const rtl::OUString& sPropertyName )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
- using namespace css::beans;
try
{
if (!genericAddChildListener(rNode,xListener,sPropertyName))
{
- throw UnknownPropertyException(
- OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: cannot add listener - node not found !")),
+ 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 UnknownPropertyException(
- OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: cannot add listener - node not found:")) += ex.message(),
+ throw css::beans::UnknownPropertyException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: cannot add listener - node not found:")) += ex.message(),
rNode.getUnoInstance() );
}
catch (configuration::Exception& ex)
@@ -253,24 +240,23 @@ void implAddListener( NodeGroupInfoAccess& rNode, const uno::Reference< beans::X
}
-void implRemoveListener( NodeGroupInfoAccess& rNode, const uno::Reference< beans::XVetoableChangeListener >& xListener, const OUString& sPropertyName )
+void implRemoveListener( NodeGroupInfoAccess& rNode, const uno::Reference< beans::XVetoableChangeListener >& xListener, const rtl::OUString& sPropertyName )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
- using namespace css::beans;
try
{
if (!genericRemoveChildListener(rNode,xListener,sPropertyName))
{
- throw UnknownPropertyException(
- OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: cannot remove listener - node not found !")),
+ 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 UnknownPropertyException(
- OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: cannot remove listener - node not found:")) += ex.message(),
+ throw css::beans::UnknownPropertyException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: cannot remove listener - node not found:")) += ex.message(),
rNode.getUnoInstance() );
}
catch (configuration::Exception& ex)
@@ -284,24 +270,23 @@ void implRemoveListener( NodeGroupInfoAccess& rNode, const uno::Reference< beans
// XPropertySet - PropertyChangeListeners
//-----------------------------------------------------------------------------------
-void implAddListener( NodeGroupInfoAccess& rNode, const uno::Reference< beans::XPropertyChangeListener >& xListener, const OUString& sPropertyName )
+void implAddListener( NodeGroupInfoAccess& rNode, const uno::Reference< beans::XPropertyChangeListener >& xListener, const rtl::OUString& sPropertyName )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
- using namespace css::beans;
try
{
if (!genericAddChildListener(rNode,xListener,sPropertyName))
{
- throw UnknownPropertyException(
- OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: cannot add listener - node not found !")),
+ 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 UnknownPropertyException(
- OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: cannot add listener - node not found:")) += ex.message(),
+ throw css::beans::UnknownPropertyException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: cannot add listener - node not found:")) += ex.message(),
rNode.getUnoInstance() );
}
catch (configuration::Exception& ex)
@@ -312,24 +297,23 @@ void implAddListener( NodeGroupInfoAccess& rNode, const uno::Reference< beans::X
}
}
-void implRemoveListener( NodeGroupInfoAccess& rNode, const uno::Reference< beans::XPropertyChangeListener >& xListener, const OUString& sPropertyName )
+void implRemoveListener( NodeGroupInfoAccess& rNode, const uno::Reference< beans::XPropertyChangeListener >& xListener, const rtl::OUString& sPropertyName )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
- using namespace css::beans;
try
{
if (!genericRemoveChildListener(rNode,xListener,sPropertyName))
{
- throw UnknownPropertyException(
- OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: cannot remove listener - node not found !")),
+ 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 UnknownPropertyException(
- OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: cannot remove listener - node not found:")) += ex.message(),
+ throw css::beans::UnknownPropertyException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: cannot remove listener - node not found:")) += ex.message(),
rNode.getUnoInstance() );
}
catch (configuration::Exception& ex)
diff --git a/configmgr/source/api2/apinotifierimpl.hxx b/configmgr/source/api2/apinotifierimpl.hxx
index 474c3982d8..4a19118395 100644
--- a/configmgr/source/api2/apinotifierimpl.hxx
+++ b/configmgr/source/api2/apinotifierimpl.hxx
@@ -43,7 +43,6 @@ namespace configmgr
{
namespace css = ::com::sun::star;
namespace uno = ::com::sun::star::uno;
- using rtl::OUString;
/* implementations of the event notification interfaces
supported by a node within the configuration tree.
@@ -78,21 +77,21 @@ namespace configmgr
throw(uno::RuntimeException);
// XPropertySet - VetoableChangeListeners
- void implAddListener( NodeGroupInfoAccess& rNode, const uno::Reference< css::beans::XVetoableChangeListener >& xListener, const OUString& sPropertyName )
+ 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 OUString& sPropertyName )
+ 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 OUString& sPropertyName )
+ 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 OUString& sPropertyName )
+ 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< OUString >& sPropertyNames )
+ 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 )
diff --git a/configmgr/source/api2/apiserviceinfo.cxx b/configmgr/source/api2/apiserviceinfo.cxx
index 1aa0c41d65..21f9db4b8c 100644
--- a/configmgr/source/api2/apiserviceinfo.cxx
+++ b/configmgr/source/api2/apiserviceinfo.cxx
@@ -91,14 +91,14 @@ namespace configmgr
//-----------------------------------------------------------------------------
-const AsciiServiceName c_aNoServices[] =
+sal_Char const * const c_aNoServices[] =
{
NULL
};
//-----------------------------------------------------------------------------
-const AsciiServiceName c_aCreateAccessServiceNames[] =
+sal_Char const * const c_aCreateAccessServiceNames[] =
{
"com.sun.star.configuration.ConfigurationAccess",
"com.sun.star.configuration.HierarchyAccess",
@@ -106,7 +106,7 @@ const AsciiServiceName c_aCreateAccessServiceNames[] =
NULL
};
-const AsciiServiceName c_aCreateUpdateServiceNames[] =
+sal_Char const * const c_aCreateUpdateServiceNames[] =
{
"com.sun.star.configuration.ConfigurationUpdateAccess",
"com.sun.star.configuration.ConfigurationAccess",
@@ -117,7 +117,7 @@ const AsciiServiceName c_aCreateUpdateServiceNames[] =
//-----------------------------------------------------------------------------
-const AsciiServiceName c_aUserAdministrationServices[] =
+sal_Char const * const c_aUserAdministrationServices[] =
{
"com.sun.star.configuration.UserAdministration",
"com.sun.star.configuration.SimpleSetUpdate",
@@ -126,7 +126,7 @@ const AsciiServiceName c_aUserAdministrationServices[] =
NULL
};
-const AsciiServiceName c_aGroupAdministrationServices[] =
+sal_Char const * const c_aGroupAdministrationServices[] =
{
"com.sun.star.configuration.GroupAdministration",
"com.sun.star.configuration.SimpleSetUpdate",
@@ -139,28 +139,28 @@ const AsciiServiceName c_aGroupAdministrationServices[] =
//-- GroupElements
-const AsciiServiceName c_aInnerGroupAccessServices[] =
+sal_Char const * const c_aInnerGroupAccessServices[] =
{
CFG_SVCLIST_GROUPACCESS,
CFG_SVCLIST_GROUPELEMENT,
NULL
};
-const AsciiServiceName c_aInnerGroupUpdateServices[] =
+sal_Char const * const c_aInnerGroupUpdateServices[] =
{
CFG_SVCLIST_GROUPUPDATE,
CFG_SVCLIST_GROUPELEMENT,
NULL
};
-const AsciiServiceName c_aInnerSetAccessServices[] =
+sal_Char const * const c_aInnerSetAccessServices[] =
{
CFG_SVCLIST_SETACCESS,
CFG_SVCLIST_GROUPELEMENT,
NULL
};
-const AsciiServiceName c_aInnerSetUpdateServices[] =
+sal_Char const * const c_aInnerSetUpdateServices[] =
{
CFG_SVCLIST_SETUPDATE,
CFG_SVCLIST_GROUPELEMENT,
@@ -169,28 +169,28 @@ const AsciiServiceName c_aInnerSetUpdateServices[] =
//-- SetElements
-const AsciiServiceName c_aSetElementGroupAccessServices[] =
+sal_Char const * const c_aSetElementGroupAccessServices[] =
{
CFG_SVCLIST_GROUPACCESS,
CFG_SVCLIST_SETELEMENT,
NULL
};
-const AsciiServiceName c_aSetElementGroupUpdateServices[] =
+sal_Char const * const c_aSetElementGroupUpdateServices[] =
{
CFG_SVCLIST_GROUPUPDATE,
CFG_SVCLIST_SETELEMENT,
NULL
};
-const AsciiServiceName c_aSetElementSetAccessServices[] =
+sal_Char const * const c_aSetElementSetAccessServices[] =
{
CFG_SVCLIST_SETACCESS,
CFG_SVCLIST_SETELEMENT,
NULL
};
-const AsciiServiceName c_aSetElementSetUpdateServices[] =
+sal_Char const * const c_aSetElementSetUpdateServices[] =
{
CFG_SVCLIST_SETUPDATE,
CFG_SVCLIST_SETELEMENT,
@@ -199,28 +199,28 @@ const AsciiServiceName c_aSetElementSetUpdateServices[] =
//-- RootElements
-const AsciiServiceName c_aRootGroupAccessServices[] =
+sal_Char const * const c_aRootGroupAccessServices[] =
{
CFG_SVCLIST_GROUPACCESS,
CFG_SVCLIST_ACCESSROOTELEMENT,
NULL
};
-const AsciiServiceName c_aRootGroupUpdateServices[] =
+sal_Char const * const c_aRootGroupUpdateServices[] =
{
CFG_SVCLIST_GROUPUPDATE,
CFG_SVCLIST_UPDATEROOTELEMENT,
NULL
};
-const AsciiServiceName c_aRootSetAccessServices[] =
+sal_Char const * const c_aRootSetAccessServices[] =
{
CFG_SVCLIST_SETACCESS,
CFG_SVCLIST_ACCESSROOTELEMENT,
NULL
};
-const AsciiServiceName c_aRootSetUpdateServices[] =
+sal_Char const * const c_aRootSetUpdateServices[] =
{
CFG_SVCLIST_SETUPDATE,
CFG_SVCLIST_UPDATEROOTELEMENT,
diff --git a/configmgr/source/api2/apiserviceinfo.hxx b/configmgr/source/api2/apiserviceinfo.hxx
index 71bf24890d..c7bef47c43 100644
--- a/configmgr/source/api2/apiserviceinfo.hxx
+++ b/configmgr/source/api2/apiserviceinfo.hxx
@@ -40,8 +40,8 @@ namespace configmgr
{
//-----------------------------------------------------------------------------
- extern const AsciiServiceName c_aUserAdministrationServices[];
- extern const AsciiServiceName c_aGroupAdministrationServices[];
+ extern sal_Char const * const c_aUserAdministrationServices[];
+ extern sal_Char const * const c_aGroupAdministrationServices[];
//-----------------------------------------------------------------------------
extern ServiceImplementationInfo const aInnerGroupInfoSI;
diff --git a/configmgr/source/api2/apitreeaccess.cxx b/configmgr/source/api2/apitreeaccess.cxx
index 9c30f769fd..14c222618d 100644
--- a/configmgr/source/api2/apitreeaccess.cxx
+++ b/configmgr/source/api2/apitreeaccess.cxx
@@ -53,13 +53,13 @@ void NodeElement::checkAlive() const
}
//-----------------------------------------------------------------------------
-configuration::Tree TreeElement::getTree() const
+rtl::Reference< configuration::Tree > TreeElement::getTree() const
{
- return configuration::Tree(this->getTreeRef());
+ return getTreeRef();
}
//-----------------------------------------------------------------------------
-configuration::TreeRef TreeElement::getTreeRef() const
+rtl::Reference< configuration::Tree > TreeElement::getTreeRef() const
{
return getApiTree().getTree();
}
@@ -76,17 +76,17 @@ Factory& TreeElement::getFactory()
}
//-----------------------------------------------------------------------------
-configuration::ElementRef SetElement::getElementRef() const
+rtl::Reference< configuration::ElementTree > SetElement::getElementRef() const
{
- return configuration::ElementRef::extract(getTreeRef());
+ return dynamic_cast< configuration::ElementTree * >(getTreeRef().get());
}
//-----------------------------------------------------------------------------
-configuration::TemplateInfo SetElement::getTemplateInfo() const
+rtl::Reference< configuration::Template > SetElement::getTemplateInfo() const
{
- configuration::ElementRef aTree = configuration::ElementRef::extract(getTreeRef());
- OSL_ENSURE(aTree.isValid(), "This really must be a set element");
- return configuration::TemplateInfo(aTree.getTemplate());
+ 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();
}
//-----------------------------------------------------------------------------
@@ -97,9 +97,6 @@ void SetElement::haveNewParent(NodeSetInfoAccess* pNewParent)
this->getApiTree().haveNewParent( pNewParentImpl );
}
//-----------------------------------------------------------------------------
-// configuration::RootTree RootElement::getRootTree() const;
-
-//-----------------------------------------------------------------------------
bool RootElement::disposeTree()
{
@@ -111,32 +108,6 @@ Committer UpdateRootElement::getCommitter()
{
return Committer(getRootTree());
}
-//-----------------------------------------------------------------------------
-
-TreeReadGuardImpl::TreeReadGuardImpl(TreeElement& rTree)
-: m_rTree(rTree)
-{
- rTree.checkAlive();
-}
-//-----------------------------------------------------------------------------
-
-TreeReadGuardImpl::~TreeReadGuardImpl() throw ()
-{
-}
-//-----------------------------------------------------------------------------
-
-GuardedRootElement::GuardedRootElement(RootElement& rTree)
-: m_aImpl(rTree)
-{
-}
-//-----------------------------------------------------------------------------
-
-configuration::Tree GuardedRootElement::getTree() const
-{
- return this->get().getTree();
-}
-
-//-----------------------------------------------------------------------------
}
}
diff --git a/configmgr/source/api2/apitreeaccess.hxx b/configmgr/source/api2/apitreeaccess.hxx
index cfe03ea352..a0d8659c02 100644
--- a/configmgr/source/api2/apitreeaccess.hxx
+++ b/configmgr/source/api2/apitreeaccess.hxx
@@ -31,6 +31,12 @@
#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"
@@ -43,20 +49,15 @@ namespace configmgr
//-----------------------------------------------------------------------------
namespace configuration
{
- class Name;
+ class ElementTree;
+ class Template;
class Tree;
- class TreeRef;
- class ElementRef;
-
- class TemplateInfo;
}
//-----------------------------------------------------------------------------
namespace configapi
{
//-----------------------------------------------------------------------------
namespace uno = com::sun::star::uno;
- typedef uno::XInterface UnoInterface;
- typedef uno::Any UnoAny;
//-----------------------------------------------------------------------------
class Factory;
class Notifier;
@@ -71,25 +72,23 @@ namespace configmgr
// these objects just provide the pieces needed to navigate and manipulate trees and nodes
// A common base class for 'element' classes
- class NodeElement : Noncopyable
+ class NodeElement: private boost::noncopyable
{
public:
- typedef ServiceImplementationInfo ServiceInfo;
- public:
virtual ~NodeElement() {}
// self-locked methods for dispose handling
void checkAlive() const;
// api object handling
- UnoInterface* getUnoInstance() const
+ uno::XInterface* getUnoInstance() const
{ return doGetUnoInstance(); }
- ServiceInfo const * getServiceInfo() const
+ ServiceImplementationInfo const * getServiceInfo() const
{ return doGetServiceInfo(); }
private:
- virtual UnoInterface* doGetUnoInstance() const = 0;
- virtual ServiceInfo const* doGetServiceInfo() const = 0;
+ virtual uno::XInterface* doGetUnoInstance() const = 0;
+ virtual ServiceImplementationInfo const* doGetServiceInfo() const = 0;
virtual ApiTreeImpl& getApiTree() const = 0;
friend class Factory;
@@ -109,8 +108,8 @@ namespace configmgr
{
public:
// model access
- configuration::TreeRef getTreeRef() const;
- configuration::Tree getTree() const;
+ rtl::Reference< configuration::Tree > getTreeRef() const;
+ rtl::Reference< configuration::Tree > getTree() const;
// api object handling
Factory& getFactory();
@@ -129,8 +128,8 @@ namespace configmgr
void haveNewParent(NodeSetInfoAccess* pNewParent);
- configuration::ElementRef getElementRef() const;
- configuration::TemplateInfo getTemplateInfo() const;
+ rtl::Reference< configuration::ElementTree > getElementRef() const;
+ rtl::Reference< configuration::Template > getTemplateInfo() const;
};
//-----------------------------------------------------------------------------
@@ -150,43 +149,30 @@ namespace configmgr
public:
Committer getCommitter();
};
-//-----------------------------------------------------------------------------
- /// guards a TreeElement; provides an object (read) lock, ensures object was not disposed
- // FIXME: bin this ...
- class TreeReadGuardImpl : Noncopyable
- {
- TreeElement& m_rTree;
- public:
- TreeReadGuardImpl(TreeElement& rTree);
- ~TreeReadGuardImpl() throw ();
- public:
- TreeElement& get() const { return m_rTree; }
- };
// 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;
- TreeReadGuardImpl m_aImpl;
- public:
- GuardedTreeElement(TreeElement& rTree) : m_aImpl(rTree) {}
+ class GuardedTreeElement {
+ UnoApiLock m_aLock;
+ TreeElement & m_rTree;
+
public:
- TreeElement& get() const { return m_aImpl.get(); }
+ explicit GuardedTreeElement(TreeElement & rTree): m_rTree(rTree)
+ { rTree.checkAlive(); }
+
+ TreeElement & get() const { return m_rTree; }
};
- class GuardedRootElement
- {
- UnoApiLock m_aLock;
- TreeReadGuardImpl m_aImpl;
- public:
- GuardedRootElement(RootElement& rTree);
+ class GuardedRootElement {
+ UnoApiLock m_aLock;
+ RootElement & m_rTree;
+
public:
- RootElement& get() const { return static_cast<RootElement&>(m_aImpl.get()); }
+ explicit GuardedRootElement(RootElement & rTree): m_rTree(rTree)
+ { rTree.checkAlive(); }
- configuration::Tree getTree() const;
+ RootElement & get() const { return m_rTree; }
};
-//-----------------------------------------------------------------------------
}
}
diff --git a/configmgr/source/api2/apitreeimplobj.cxx b/configmgr/source/api2/apitreeimplobj.cxx
index 7788128b09..388f9d444b 100644
--- a/configmgr/source/api2/apitreeimplobj.cxx
+++ b/configmgr/source/api2/apitreeimplobj.cxx
@@ -33,7 +33,6 @@
#include <stdio.h>
#include "apitreeimplobj.hxx"
-#include "confproviderimpl2.hxx"
#include "confignotifier.hxx"
#include "notifierimpl.hxx"
#include "apifactory.hxx"
@@ -41,10 +40,12 @@
#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>
@@ -161,7 +162,7 @@ void SAL_CALL ApiTreeImpl::ComponentAdapter::disposing(com::sun::star::lang::Eve
{
CFG_TRACE_INFO("ApiTreeImpl:ComponentAdapter: Providing UNO object is disposed - relaying to my owner");
// ensure our owner stays alive
- UnoInterfaceRef xKeepOwnerAlive( this->pOwner->getUnoInstance() );
+ uno::Reference<uno::XInterface> xKeepOwnerAlive( this->pOwner->getUnoInstance() );
// and we stay alive too
rtl::Reference< ApiTreeImpl::ComponentAdapter > xKeepAlive( this );
@@ -200,28 +201,28 @@ void ApiTreeImpl::ComponentAdapter::clear()
class ApiRootTreeImpl::NodeListener : public INodeListener
{
ApiRootTreeImpl* pParent;
- IConfigBroadcaster* pSource;
+ TreeManager * pSource;
- TreeOptions m_xOptions;
- AbsolutePath m_aLocationPath;
+ vos::ORef< OOptions > m_xOptions;
+ configuration::AbsolutePath m_aLocationPath;
public:
NodeListener(ApiRootTreeImpl& _rParent)
: pParent(&_rParent)
, pSource(NULL)
- , m_aLocationPath( AbsolutePath::root() )
+ , m_aLocationPath( configuration::AbsolutePath::root() )
{}
~NodeListener()
{
unbind();
}
- IConfigBroadcaster* getSource()
+ TreeManager * getSource()
{
UnoApiLock aGuard;
return pSource;
}
- void setSource(IConfigBroadcaster* pNew)
+ void setSource(TreeManager * pNew)
{
UnoApiLock aGuard;
if (pParent)
@@ -247,7 +248,7 @@ public:
}
}
- void setLocation(AbsolutePath const& _aLocation, TreeOptions const& _xOptions)
+ void setLocation(configuration::AbsolutePath const& _aLocation, vos::ORef< OOptions > const& _xOptions)
{
OSL_ASSERT(_xOptions.isValid());
@@ -276,7 +277,7 @@ public:
OSL_ASSERT(m_xOptions.isValid());
pSource->removeListener(m_xOptions->getRequestOptions(), this);
m_xOptions.unbind();
- m_aLocationPath = AbsolutePath::root();
+ m_aLocationPath = configuration::AbsolutePath::root();
}
}
@@ -290,12 +291,12 @@ public:
if (pSource)
{
- IConfigBroadcaster* pOrgSource = pSource;
- TreeOptions xOptions = m_xOptions;
+ TreeManager * pOrgSource = pSource;
+ vos::ORef< OOptions > xOptions = m_xOptions;
pSource = 0;
m_xOptions.unbind();
- m_aLocationPath = AbsolutePath::root();
+ m_aLocationPath = configuration::AbsolutePath::root();
aGuard.clear();
@@ -306,9 +307,9 @@ public:
}
// Interfaces
- virtual void disposing(IConfigBroadcaster* pSource);
- virtual void nodeChanged(Change const& aChange, AbsolutePath const& sPath, IConfigBroadcaster* pSource);
- virtual void nodeDeleted(AbsolutePath const& sPath, IConfigBroadcaster* pSource);
+ 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);
};
//-------------------------------------------------------------------------
@@ -322,7 +323,7 @@ ApiProvider::ApiProvider(Factory& rFactory, OProviderImpl& rProviderImpl )
{}
//-------------------------------------------------------------------------
-UnoTypeConverter ApiProvider::getTypeConverter() const
+uno::Reference<com::sun::star::script::XTypeConverter> ApiProvider::getTypeConverter() const
{
return m_rProviderImpl.getTypeConverter();
}
@@ -331,12 +332,12 @@ static
inline
configuration::DefaultProvider createDefaultProvider(
ApiProvider& rProvider,
- configuration::Tree const& aTree,
- TreeOptions const& _xOptions
+ rtl::Reference< configuration::Tree > const& aTree,
+ vos::ORef< OOptions > const& _xOptions
)
{
OProviderImpl& rProviderImpl = rProvider.getProviderImpl();
- rtl::Reference< IConfigDefaultProvider > xDefaultProvider = rProviderImpl.getDefaultProvider();
+ rtl::Reference< TreeManager > xDefaultProvider = rProviderImpl.getDefaultProvider();
OSL_ASSERT(_xOptions.isValid());
RequestOptions const aOptions = _xOptions.isValid() ? _xOptions->getRequestOptions() : RequestOptions();
@@ -355,7 +356,7 @@ configuration::DefaultProvider extractDefaultProvider(ApiTreeImpl* pParentTree)
return configuration::DefaultProvider::createEmpty();
}
//-------------------------------------------------------------------------
-ApiTreeImpl::ApiTreeImpl(UnoInterface* pInstance, configuration::TreeRef const& aTree, ApiTreeImpl& rParentTree)
+ApiTreeImpl::ApiTreeImpl(uno::XInterface* pInstance, rtl::Reference< configuration::Tree > const& aTree, ApiTreeImpl& rParentTree)
: m_aTree(aTree)
, m_aNotifier(new NotifierImpl(aTree))
, m_aDefaultProvider(rParentTree.getDefaultProvider())
@@ -364,11 +365,11 @@ ApiTreeImpl::ApiTreeImpl(UnoInterface* pInstance, configuration::TreeRef const&
, m_pParentTree(0)
, m_pInstance(pInstance)
{
- setNodeInstance(aTree.getRootNode(), pInstance);
+ setNodeInstance(aTree->getRootNode(), pInstance);
init(&rParentTree);
}
//-------------------------------------------------------------------------
-ApiTreeImpl::ApiTreeImpl(UnoInterface* pInstance, ApiProvider& rProvider, configuration::TreeRef const& aTree, ApiTreeImpl* pParentTree)
+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))
@@ -378,11 +379,11 @@ ApiTreeImpl::ApiTreeImpl(UnoInterface* pInstance, ApiProvider& rProvider, config
, 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);
+ setNodeInstance(aTree->getRootNode(), pInstance);
init(pParentTree);
}
//-------------------------------------------------------------------------
-ApiTreeImpl::ApiTreeImpl(UnoInterface* _pInstance, ApiProvider& _rProvider, configuration::TreeRef const& _aTree, DefaultProvider const& _aDefaultProvider)
+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)
@@ -391,7 +392,7 @@ ApiTreeImpl::ApiTreeImpl(UnoInterface* _pInstance, ApiProvider& _rProvider, conf
, m_pParentTree(0)
, m_pInstance(_pInstance)
{
- setNodeInstance(_aTree.getRootNode(), _pInstance);
+ setNodeInstance(_aTree->getRootNode(), _pInstance);
init(NULL);
}
//-------------------------------------------------------------------------
@@ -403,8 +404,8 @@ ApiTreeImpl::~ApiTreeImpl()
}
//-------------------------------------------------------------------------
-ApiRootTreeImpl::ApiRootTreeImpl(UnoInterface* pInstance, ApiProvider& rProvider, configuration::Tree const& aTree, TreeOptions const& _xOptions)
-: m_aTreeImpl(pInstance, rProvider, aTree.getRef(), createDefaultProvider(rProvider, aTree, _xOptions))
+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)
@@ -423,10 +424,10 @@ ApiRootTreeImpl::~ApiRootTreeImpl()
}
//-------------------------------------------------------------------------
-void ApiTreeImpl::setNodeInstance(configuration::NodeRef const& aNode, UnoInterface* pInstance)
+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),"ERROR: foreign node being added 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 );
}
@@ -452,9 +453,9 @@ Notifier ApiTreeImpl::getNotifier() const
bool ApiRootTreeImpl::enableNotification(bool bEnable)
{
- IConfigBroadcaster* pSource = bEnable ? getApiTree().getProvider().getProviderImpl().getNotifier() : 0;
+ TreeManager * pSource = bEnable ? getApiTree().getProvider().getProviderImpl().getNotifier() : 0;
- IConfigBroadcaster* pOld = this->implSetNotificationSource(pSource);
+ TreeManager * pOld = this->implSetNotificationSource(pSource);
return pOld != 0;
}
@@ -465,9 +466,9 @@ bool ApiTreeImpl::disposeTree(bool bForce)
CFG_TRACE_INFO("ApiTreeImpl: Disposing Tree (may throw if already disposed)");
// ensure our provider stays alive
- UnoInterfaceRef xKeepParentAlive(this->getParentComponent());
+ uno::Reference<uno::XInterface> xKeepParentAlive(this->getParentComponent());
// ensure we stay alive too
- UnoInterfaceRef xKeepAlive(this->getUnoInstance());
+ uno::Reference<uno::XInterface> xKeepAlive(this->getUnoInstance());
// #109077# If already disposed, we may have no source data or data lock
if (!isAlive())
@@ -502,9 +503,9 @@ bool ApiTreeImpl::disposeTreeNow()
//-------------------------------------------------------------------------
bool ApiRootTreeImpl::disposeTree()
{
- CFG_TRACE_INFO("Api Root TreeImpl: Disposing Tree And Releasing (unless disposed)");
+ CFG_TRACE_INFO("Api Root Tree: Disposing Tree And Releasing (unless disposed)");
// ensure our provider stays alive
- UnoInterfaceRef xKeepProvider( m_aTreeImpl.getUnoProviderInstance() );
+ uno::Reference<uno::XInterface> xKeepProvider( m_aTreeImpl.getUnoProviderInstance() );
rtl::Reference<NodeListener> xListener = m_pNotificationListener;
if (xListener.is())
@@ -520,7 +521,7 @@ bool ApiRootTreeImpl::disposeTree()
if (!m_xOptions.isEmpty())
{
OSL_ENSURE(!bDisposed, "Disposing/Releasing should clear the options");
- CFG_TRACE_INFO2("Api Root TreeImpl: data was not released in disposeTree");
+ CFG_TRACE_INFO2("Api Root Tree: data was not released in disposeTree");
}
return bDisposed;
@@ -530,22 +531,17 @@ bool ApiTreeImpl::implDisposeTree()
{
OSL_ENSURE(m_pParentTree == 0,"WARNING: Disposing a tree that still has a parent tree set");
- NotifierImpl::SpecialContainer& aContainer = m_aNotifier->m_aListeners;
+ SpecialListenerContainer <configuration::SubNodeID,SubNodeHash,SubNodeEq,SubNodeToIndex>& aContainer = m_aNotifier->m_aListeners;
if (aContainer.beginDisposing())
{
CFG_TRACE_INFO("ApiTreeImpl: Tree is now disposed");
- using configuration::NodeIDList;
- using configuration::NodeID;
- using configuration::Tree;
- using configuration::getAllContainedNodes;
- using com::sun::star::lang::EventObject;
Factory& rFactory = getFactory();
- NodeIDList aChildNodes;
- getAllContainedNodes( Tree(m_aTree), aChildNodes);
+ std::vector<configuration::NodeID> aChildNodes;
+ configuration::getAllContainedNodes( m_aTree, aChildNodes);
- for (NodeIDList::reverse_iterator it = aChildNodes.rbegin(), stop = aChildNodes.rend();
+ for (std::vector<configuration::NodeID>::reverse_iterator it = aChildNodes.rbegin(), stop = aChildNodes.rend();
it != stop;
++it)
{
@@ -572,24 +568,21 @@ bool ApiTreeImpl::implDisposeTree()
}
}
//-------------------------------------------------------------------------
-void ApiTreeImpl::disposeNode(NodeRef const& aNode, UnoInterface* pInstance)
+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(NodeRef const& aNode, UnoInterface* )
+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),"INTERNAL ERROR: Disposing: node does not match tree");
- OSL_ENSURE( !m_aTree.isRootNode(aNode),"INTERNAL ERROR: Disposing the root node of the tree");
+ 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");
- using configuration::NodeID;
- using com::sun::star::lang::EventObject;
-
- NodeID aNodeID(m_aTree,aNode);
+ configuration::NodeID aNodeID(m_aTree,aNode);
if (m_aNotifier->m_aListeners.disposeOne(aNodeID.toIndex()) )
{
@@ -612,7 +605,7 @@ void ApiTreeImpl::deinit()
{
setParentTree(0);
- ComponentRef xAdapter = m_xProvider;
+ uno::Reference<ComponentAdapter> xAdapter = m_xProvider;
m_xProvider.clear();
if (xAdapter.is())
@@ -641,12 +634,11 @@ void ApiTreeImpl::setParentTree(ApiTreeImpl* pParentTree) // internal implementa
#if OSL_DEBUG_LEVEL > 0
if (pParentTree)
{
- using configuration::NodeID;
- TreeRef aContext = m_aTree.getContextTree();
- TreeRef aParent = pParentTree->m_aTree;
+ rtl::Reference< configuration::Tree > aContext = m_aTree->getContextTree();
+ rtl::Reference< configuration::Tree > aParent = pParentTree->m_aTree;
- NodeID aContextID( aContext, aContext.getRootNode() );
- NodeID aParentID( aParent, aParent.getRootNode() );
+ configuration::NodeID aContextID( aContext, aContext->getRootNode() );
+ configuration::NodeID aParentID( aParent, aParent->getRootNode() );
OSL_ENSURE( aContextID == aParentID, "Parent relationship mismatch !");
}
@@ -654,7 +646,7 @@ void ApiTreeImpl::setParentTree(ApiTreeImpl* pParentTree) // internal implementa
if (m_pParentTree != pParentTree)
{
- ComponentRef xAdapter = m_xProvider;
+ uno::Reference<ComponentAdapter> xAdapter = m_xProvider;
m_pParentTree = pParentTree;
@@ -670,11 +662,11 @@ void ApiTreeImpl::setParentTree(ApiTreeImpl* pParentTree) // internal implementa
}
//-------------------------------------------------------------------------
-UnoInterfaceRef ApiTreeImpl::getUnoProviderInstance() const
+uno::Reference<uno::XInterface> ApiTreeImpl::getUnoProviderInstance() const
{
- ComponentRef xAdapter = m_xProvider;
+ uno::Reference<ComponentAdapter> xAdapter = m_xProvider;
- UnoInterfaceRef xReturn;
+ uno::Reference<uno::XInterface> xReturn;
if (xAdapter.is())
xReturn = xAdapter->getProvider();
return xReturn;
@@ -715,9 +707,9 @@ void ApiTreeImpl::disposing(com::sun::star::lang::EventObject const& ) throw()
// if (xThis.is()) xThis->dispose();
}
//-------------------------------------------------------------------------
-IConfigBroadcaster* ApiRootTreeImpl::implSetNotificationSource(IConfigBroadcaster* pNew)
+TreeManager * ApiRootTreeImpl::implSetNotificationSource(TreeManager * pNew)
{
- IConfigBroadcaster* pOld = m_pNotificationListener.is() ? m_pNotificationListener->getSource() : 0;
+ TreeManager * pOld = m_pNotificationListener.is() ? m_pNotificationListener->getSource() : 0;
if (pOld != pNew)
{
OSL_ENSURE(m_xOptions.isValid(), "Cannot change notification source without options");
@@ -732,17 +724,17 @@ IConfigBroadcaster* ApiRootTreeImpl::implSetNotificationSource(IConfigBroadcaste
}
// ---------------------------------------------------------------------------------------------------
-void ApiRootTreeImpl::implSetLocation(configuration::Tree const& _aTree)
+void ApiRootTreeImpl::implSetLocation(rtl::Reference< configuration::Tree > const& _aTree)
{
- OSL_ASSERT( configuration::equalTreeRef(_aTree.getRef(), getApiTree().getTree()) );
- if (!_aTree.isEmpty())
+ OSL_ASSERT(_aTree == getApiTree().getTree());
+ if (!configuration::isEmpty(_aTree.get()))
{
- m_aLocationPath = _aTree.getRootPath();
- OSL_ENSURE(!m_aLocationPath.isRoot(), "Setting up a RootTree without location");
+ m_aLocationPath = _aTree->getRootPath();
+ OSL_ENSURE(!m_aLocationPath.isRoot(), "Setting up a root tree without location");
}
else
{
- OSL_ENSURE(false, "Setting up a RootTree without data");
+ OSL_ENSURE(false, "Setting up a root tree without data");
m_aLocationPath = configuration::AbsolutePath::root();
}
@@ -758,11 +750,13 @@ void ApiRootTreeImpl::implSetLocation(configuration::Tree const& _aTree)
void ApiRootTreeImpl::releaseData()
{
- CFG_TRACE_INFO("Api Root TreeImpl at %s: releasing the Data",OUSTRING2ASCII(m_aLocationPath.toString()));
- configuration::TreeRef aTree( m_aTreeImpl.getTree() );
+ CFG_TRACE_INFO("Api Root Tree at %s: releasing the Data",OUSTRING2ASCII(m_aLocationPath.toString()));
+ rtl::Reference< configuration::Tree > aTree( m_aTreeImpl.getTree() );
- aTree.disposeData();
- OSL_ASSERT(aTree.isEmpty());
+ 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" );
@@ -774,7 +768,7 @@ void ApiRootTreeImpl::releaseData()
}
// ---------------------------------------------------------------------------------------------------
-void ApiRootTreeImpl::NodeListener::disposing(IConfigBroadcaster* _pSource)
+void ApiRootTreeImpl::NodeListener::disposing(TreeManager * _pSource)
{
UnoApiLockClearable aGuard;
@@ -782,19 +776,19 @@ void ApiRootTreeImpl::NodeListener::disposing(IConfigBroadcaster* _pSource)
if (pParent)
{
// this is a non-UNO external entry point - we need to keep this object alive for the duration of the call
- UnoInterfaceRef xKeepAlive( pParent->m_aTreeImpl.getUnoInstance() );
+ uno::Reference<uno::XInterface> xKeepAlive( pParent->m_aTreeImpl.getUnoInstance() );
ApiRootTreeImpl* pKeepParent = pParent;
aGuard.clear();
pKeepParent->disposing(_pSource);
}
}
-void ApiRootTreeImpl::disposing(IConfigBroadcaster* /*pSource*/)
+void ApiRootTreeImpl::disposing(TreeManager *)
{
- CFG_TRACE_INFO("Api Root TreeImpl at %s: Cache data is disposed - dispose and release own data",
+ 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
- UnoInterfaceRef xKeepProvider( m_aTreeImpl.getUnoProviderInstance() );
+ uno::Reference<uno::XInterface> xKeepProvider( m_aTreeImpl.getUnoProviderInstance() );
rtl::Reference<NodeListener> xListener = m_pNotificationListener;
if (xListener.is())
@@ -815,13 +809,13 @@ void disposeOneRemovedNode(configuration::NodeChangeInformation const& aRemoveIn
{
OSL_ENSURE(aRemoveInfo.change.element.isDataChange(), "ERROR: Disposing replaced element: Element did not really change !");
- configuration::ElementRef aElementRef( aRemoveInfo.change.element.oldValue.get() );
+ rtl::Reference< configuration::ElementTree > aElementRef( aRemoveInfo.change.element.oldValue.get() );
SetElement* pSetElement = aFactory.findSetElement(aElementRef );
if (pSetElement)
{
// factory always does an extra acquire
- UnoInterfaceRef xReleaseSetElement(pSetElement->getUnoInstance(), uno::UNO_REF_NO_ACQUIRE);
+ uno::Reference<uno::XInterface> xReleaseSetElement(pSetElement->getUnoInstance(), uno::UNO_REF_NO_ACQUIRE);
pSetElement->haveNewParent(0);
pSetElement->disposeTree(true);
@@ -839,20 +833,18 @@ void disposeOneRemovedNode(configuration::NodeChangeInformation const& aRemoveIn
static
void disposeRemovedNodes(configuration::NodeChangesInformation const& aChanges, Factory& aFactory)
{
- using configuration::NodeChangeData;
- using configuration::NodeChangesInformation;
- for (NodeChangesInformation::Iterator it = aChanges.begin(); it != aChanges.end(); ++it)
+ for (std::vector< configuration::NodeChangeInformation >::const_iterator it = aChanges.begin(); it != aChanges.end(); ++it)
{
switch (it->change.type)
{
- case NodeChangeData::eReplaceElement:
+ 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 NodeChangeData::eRemoveElement:
+ case configuration::NodeChangeData::eRemoveElement:
disposeOneRemovedNode( *it, aFactory );
break;
@@ -862,7 +854,7 @@ void disposeRemovedNodes(configuration::NodeChangesInformation const& aChanges,
}
// ---------------------------------------------------------------------------------------------------
//INodeListener : IConfigListener
-void ApiRootTreeImpl::NodeListener::nodeChanged(Change const& aChange, AbsolutePath const& sPath, IConfigBroadcaster* _pSource)
+void ApiRootTreeImpl::NodeListener::nodeChanged(Change const& aChange, configuration::AbsolutePath const& sPath, TreeManager * _pSource)
{
UnoApiLockClearable aGuard;
@@ -870,7 +862,7 @@ void ApiRootTreeImpl::NodeListener::nodeChanged(Change const& aChange, AbsoluteP
if (pParent)
{
// this is a non-UNO external entry point - we need to keep this object alive for the duration of the call
- UnoInterfaceRef xKeepAlive( pParent->m_aTreeImpl.getUnoInstance() );
+ uno::Reference<uno::XInterface> xKeepAlive( pParent->m_aTreeImpl.getUnoInstance() );
ApiRootTreeImpl* pKeepParent = pParent;
aGuard.clear();
@@ -880,34 +872,29 @@ void ApiRootTreeImpl::NodeListener::nodeChanged(Change const& aChange, AbsoluteP
// ---------------------------------------------------------------------------------------------------
//INodeListener : IConfigListener
-void ApiRootTreeImpl::nodeChanged(Change const& aChange, AbsolutePath const& aChangePath, IConfigBroadcaster* /*pSource*/)
+void ApiRootTreeImpl::nodeChanged(Change const& aChange, configuration::AbsolutePath const& aChangePath, TreeManager *)
{
- using configuration::AnyNodeRef;
- using configuration::NodeChanges;
- using configuration::RelativePath;
- using configuration::AbsolutePath;
-
// do not dipatch if we are dying/dead anyway
if (m_aTreeImpl.isAlive())
try
{
- configuration::Tree aTree(m_aTreeImpl.getTree());
+ 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: ");
- RelativePath aLocalChangePath = configuration::Path::stripPrefix(aChangePath,m_aLocationPath);
+ configuration::RelativePath aLocalChangePath = configuration::Path::stripPrefix(aChangePath,m_aLocationPath);
// find the node and change
- NodeRef aNode;
+ configuration::NodeRef aNode;
if ( !aLocalChangePath.isEmpty() )
{
- NodeRef aBaseNode = aTree.getRootNode();
+ configuration::NodeRef aBaseNode = aTree->getRootNode();
#ifdef DBG_UTIL
try {
- RelativePath aLocalPathOld = configuration::validateAndReducePath(aChangePath.toString(), aTree, aBaseNode);
+ 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");
}
@@ -918,7 +905,7 @@ void ApiRootTreeImpl::nodeChanged(Change const& aChange, AbsolutePath const& aCh
}
#endif // DBG_UTIL
- AnyNodeRef aFoundNode = configuration::getDeepDescendant(aTree, aBaseNode, aLocalChangePath);
+ configuration::AnyNodeRef aFoundNode = configuration::getDeepDescendant(aTree, aBaseNode, aLocalChangePath);
if ( aFoundNode.isValid() )
{
if (aFoundNode.isNode())
@@ -934,22 +921,19 @@ void ApiRootTreeImpl::nodeChanged(Change const& aChange, AbsolutePath const& aCh
}
else
{
- aNode = aTree.getRootNode();
+ aNode = aTree->getRootNode();
}
SubtreeChange const* pTreeChange = NULL;
if (aNode.isValid())
{
- if (aChange.ISA(SubtreeChange))
- pTreeChange = static_cast<SubtreeChange const*>(&aChange);
-
- else // TODO: Notify set change using parent (if available) and temporary dummy change
- OSL_ENSURE( false, "Notification broken: Change to inner node is not a subtree change");
+ 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.getName(aNode).toString(),
+ OSL_ENSURE( aChange.getNodeName() == aTree->getSimpleNodeName(aNode.getOffset()),
"Change's node-name does not match found node's name - erratic notification");
configuration::NodeChangesInformation aChanges;
@@ -984,7 +968,7 @@ void ApiRootTreeImpl::nodeChanged(Change const& aChange, AbsolutePath const& aCh
}
// ---------------------------------------------------------------------------------------------------
-void ApiRootTreeImpl::NodeListener::nodeDeleted(AbsolutePath const& _aPath, IConfigBroadcaster* _pSource)
+void ApiRootTreeImpl::NodeListener::nodeDeleted(configuration::AbsolutePath const& _aPath, TreeManager * _pSource)
{
UnoApiLockClearable aGuard;
@@ -992,7 +976,7 @@ void ApiRootTreeImpl::NodeListener::nodeDeleted(AbsolutePath const& _aPath, ICon
if (pParent)
{
// this is a non-UNO external entry point - we need to keep this object alive for the duration of the call
- UnoInterfaceRef xKeepAlive( pParent->m_aTreeImpl.getUnoInstance() );
+ uno::Reference<uno::XInterface> xKeepAlive( pParent->m_aTreeImpl.getUnoInstance() );
ApiRootTreeImpl* pKeepParent = pParent;
aGuard.clear();
@@ -1000,19 +984,19 @@ void ApiRootTreeImpl::NodeListener::nodeDeleted(AbsolutePath const& _aPath, ICon
}
}
// ---------------------------------------------------------------------------------------------------
-void ApiRootTreeImpl::nodeDeleted(AbsolutePath const& _aDeletedPath, IConfigBroadcaster* /*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
- UnoInterfaceRef xKeepAlive( m_aTreeImpl.getUnoInstance() );
+ 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
- UnoInterfaceRef xKeepProvider( m_aTreeImpl.getUnoProviderInstance() );
+ uno::Reference<uno::XInterface> xKeepProvider( m_aTreeImpl.getUnoProviderInstance() );
rtl::Reference<NodeListener> xListener = m_pNotificationListener;
if (xListener.is())
diff --git a/configmgr/source/api2/apitreeimplobj.hxx b/configmgr/source/api2/apitreeimplobj.hxx
index 45e54be584..7e8bd6770d 100644
--- a/configmgr/source/api2/apitreeimplobj.hxx
+++ b/configmgr/source/api2/apitreeimplobj.hxx
@@ -37,6 +37,7 @@
#include "confevents.hxx"
#include "options.hxx"
#include "utility.hxx"
+#include <boost/utility.hpp>
#include <vos/ref.hxx>
#include <rtl/ref.hxx>
#include <osl/mutex.hxx>
@@ -63,20 +64,12 @@ namespace configmgr
class Factory;
class Notifier;
class NotifierImpl;
- typedef vos::ORef<NotifierImpl> NotifierImplHolder;
//-----------------------------------------------------------------------------
class ObjectRegistry;
- typedef rtl::Reference<ObjectRegistry> ObjectRegistryHolder;
-
- typedef uno::XInterface UnoInterface;
- typedef uno::Reference<UnoInterface> UnoInterfaceRef;
- typedef uno::Reference<com::sun::star::script::XTypeConverter> UnoTypeConverter;
-
- typedef vos::ORef< OOptions > TreeOptions;
//-----------------------------------------------------------------------------
// API object implementation wrappers
//-------------------------------------------------------------------------
- class ApiProvider : Noncopyable
+ class ApiProvider: private boost::noncopyable
{
Factory& m_rFactory;
OProviderImpl& m_rProviderImpl;
@@ -86,7 +79,7 @@ namespace configmgr
~ApiProvider()
{}
- UnoTypeConverter getTypeConverter() const;
+ uno::Reference<com::sun::star::script::XTypeConverter> getTypeConverter() const;
Factory& getFactory() { return m_rFactory; }
OProviderImpl& getProviderImpl() { return m_rProviderImpl; }
};
@@ -94,53 +87,48 @@ namespace configmgr
//-----------------------------------------------------------------------------
//-------------------------------------------------------------------------
- class ApiTreeImpl : Noncopyable
+ class ApiTreeImpl: private boost::noncopyable
{
class ComponentAdapter;
- typedef uno::Reference<ComponentAdapter> ComponentRef;
- typedef uno::Reference<com::sun::star::lang::XComponent> UnoComponent;
- typedef configuration::TreeRef TreeRef;
- typedef configuration::DefaultProvider DefaultProvider;
-
- TreeRef m_aTree;
- NotifierImplHolder m_aNotifier;
- DefaultProvider m_aDefaultProvider;
- ComponentRef m_xProvider;
+ rtl::Reference< configuration::Tree > m_aTree;
+ vos::ORef<NotifierImpl> m_aNotifier;
+ configuration::DefaultProvider m_aDefaultProvider;
+ uno::Reference<ComponentAdapter> m_xProvider;
ApiProvider& m_rProvider;
ApiTreeImpl* m_pParentTree;
- UnoInterface* m_pInstance;
+ uno::XInterface* m_pInstance;
public:
- explicit ApiTreeImpl(UnoInterface* pInstance, configuration::TreeRef const& aTree, ApiTreeImpl& rParentTree);
- explicit ApiTreeImpl(UnoInterface* pInstance, ApiProvider& rProvider, configuration::TreeRef const& aTree, ApiTreeImpl* pParentTree);
- explicit ApiTreeImpl(UnoInterface* _pInstance, ApiProvider& _rProvider, configuration::TreeRef const& _aTree, DefaultProvider const & _aDefaultProvider);
+ explicit ApiTreeImpl(uno::XInterface* pInstance, rtl::Reference< configuration::Tree > const& aTree, ApiTreeImpl& rParentTree);
+ explicit ApiTreeImpl(uno::XInterface* pInstance, ApiProvider& rProvider, rtl::Reference< configuration::Tree > const& aTree, ApiTreeImpl* pParentTree);
+ explicit ApiTreeImpl(uno::XInterface* _pInstance, ApiProvider& _rProvider, rtl::Reference< configuration::Tree > const& _aTree, configuration::DefaultProvider const & _aDefaultProvider);
~ApiTreeImpl();
// initialization
- void setNodeInstance(configuration::NodeRef const& aNode, UnoInterface* pInstance);
+ void setNodeInstance(configuration::NodeRef const& aNode, uno::XInterface* pInstance);
// model access
- TreeRef getTree() const { return m_aTree; }
+ rtl::Reference< configuration::Tree > getTree() const { return m_aTree; }
// self-locked methods for dispose handling
bool isAlive() const;
void checkAlive() const;
bool disposeTree(bool bForce);
bool disposeTreeNow();
- void disposeNode(configuration::NodeRef const& aNode, UnoInterface* pInstance);
+ void disposeNode(configuration::NodeRef const& aNode, uno::XInterface* pInstance);
// api object handling
Factory& getFactory() const { return m_rProvider.getFactory(); }
Notifier getNotifier() const;
- DefaultProvider getDefaultProvider() const { return m_aDefaultProvider; }
+ configuration::DefaultProvider getDefaultProvider() const { return m_aDefaultProvider; }
// needs external locking
ApiTreeImpl const* getRootTreeImpl() const;
uno::XInterface* getUnoInstance() const { return m_pInstance; }
ApiProvider& getProvider() { return m_rProvider; }
- UnoInterfaceRef getUnoProviderInstance() const; // { return m_xProvider; }
+ uno::Reference<uno::XInterface> getUnoProviderInstance() const; // { return m_xProvider; }
/// wire this to a new parent tree
void haveNewParent(ApiTreeImpl* pNewParent);
@@ -150,30 +138,27 @@ namespace configmgr
void deinit();
bool implDisposeTree();
- void implDisposeNode(configuration::NodeRef const& aNode, UnoInterface* pInstance);
+ void implDisposeNode(configuration::NodeRef const& aNode, uno::XInterface* pInstance);
friend class ComponentAdapter;
void disposing(com::sun::star::lang::EventObject const& rEvt) throw();
- UnoComponent getProviderComponent();
- UnoComponent getParentComponent();
+ uno::Reference<com::sun::star::lang::XComponent> getProviderComponent();
+ uno::Reference<com::sun::star::lang::XComponent> getParentComponent();
};
//-----------------------------------------------------------------------------
class ApiRootTreeImpl
{
- typedef configuration::AbsolutePath AbsolutePath;
- typedef configuration::DefaultProvider DefaultProvider;
-
public:
- explicit ApiRootTreeImpl(UnoInterface* pInstance, ApiProvider& rProvider, configuration::Tree const& aTree, TreeOptions const& _xOptions);
+ explicit ApiRootTreeImpl(uno::XInterface* pInstance, ApiProvider& rProvider, rtl::Reference< configuration::Tree > const& aTree, vos::ORef< OOptions > const& _xOptions);
~ApiRootTreeImpl();
ApiTreeImpl& getApiTree() { return m_aTreeImpl; }
ApiTreeImpl const& getApiTree() const { return m_aTreeImpl; }
- AbsolutePath const & getLocation() const { return m_aLocationPath; }
- TreeOptions getOptions() const { return m_xOptions; }
+ configuration::AbsolutePath const & getLocation() const { return m_aLocationPath; }
+ vos::ORef< OOptions > getOptions() const { return m_xOptions; }
// self-locked methods for dispose handling
bool disposeTree();
@@ -181,26 +166,25 @@ namespace configmgr
/// toggle whether this object relays notifications from the base provider
bool enableNotification(bool bEnable);
private:
- IConfigBroadcaster* implSetNotificationSource(IConfigBroadcaster* pNew);
- void implSetLocation(configuration::Tree const& _aTree);
+ TreeManager * implSetNotificationSource(TreeManager * pNew);
+ void implSetLocation(rtl::Reference< configuration::Tree > const& _aTree);
void releaseData();
private:
class NodeListener;
friend class NodeListener;
- //IConfigBroadcaster* m_pNotificationSource;
// IConfigListener
- void disposing(IConfigBroadcaster* pSource) ;
+ void disposing(TreeManager * pSource) ;
//INodeListener : IConfigListener
- void nodeChanged(Change const& aChange, AbsolutePath const& aPath, IConfigBroadcaster* pSource);
- void nodeDeleted(AbsolutePath const& aPath, IConfigBroadcaster* pSource);
+ void nodeChanged(Change const& aChange, configuration::AbsolutePath const& aPath, TreeManager * pSource);
+ void nodeDeleted(configuration::AbsolutePath const& aPath, TreeManager * pSource);
private:
ApiTreeImpl m_aTreeImpl;
- AbsolutePath m_aLocationPath;
+ configuration::AbsolutePath m_aLocationPath;
rtl::Reference<NodeListener> m_pNotificationListener;
- TreeOptions m_xOptions;
+ vos::ORef< OOptions > m_xOptions;
};
//-----------------------------------------------------------------------------
}
diff --git a/configmgr/source/api2/broadcaster.cxx b/configmgr/source/api2/broadcaster.cxx
index cfcc085d18..9bd6cf0d27 100644
--- a/configmgr/source/api2/broadcaster.cxx
+++ b/configmgr/source/api2/broadcaster.cxx
@@ -61,19 +61,12 @@ namespace configmgr
namespace configapi
{
// ---------------------------------------------------------------------------------------------------
- using configuration::Tree;
- using configuration::NodeID;
-
- using configuration::NodeChangeInformation;
- using configuration::NodeChangeLocation;
- using configuration::NodeChangesInformation;
-// ---------------------------------------------------------------------------------------------------
// Broadcaster implementation
// ---------------------------------------------------------------------------------------------------
class BroadcasterHelper
{
public:
- static NotifierHolder getImpl(Notifier const& aNotifier) { return aNotifier.m_aImpl; }
+ static vos::ORef<NotifierImpl> getImpl(Notifier const& aNotifier) { return aNotifier.m_aImpl; }
};
// ---------------------------------------------------------------------------------------------------
@@ -83,8 +76,7 @@ namespace configmgr
template <class T>
struct LessORefBodyPtr
{
- typedef vos::ORef<T> Ref;
- bool operator()(Ref const& lhs, Ref const& rhs) const
+ bool operator()(vos::ORef<T> const& lhs, vos::ORef<T> const& rhs) const
{
return ptr_less(lhs.getBodyPtr(), rhs.getBodyPtr());
}
@@ -95,7 +87,7 @@ namespace configmgr
class ApiTreeRef
{
ApiTreeImpl const* m_pApiTree;
- UnoInterfaceRef m_xKeepAlive;
+ uno::Reference<uno::XInterface> m_xKeepAlive;
public:
explicit ApiTreeRef(ApiTreeImpl const* _pApiTree = NULL)
: m_pApiTree(_pApiTree)
@@ -120,8 +112,7 @@ namespace configmgr
{ return lhs.m_pApiTree != rhs.m_pApiTree; }
};
// -----------------------------------------------------------------------------------------------
- typedef std::map< NotifierHolder, ApiTreeRef, LessORefBodyPtr<NotifierImpl> > NotifierSet;
- typedef NotifierSet::value_type NotifierData;
+ typedef std::map< vos::ORef<NotifierImpl>, ApiTreeRef, LessORefBodyPtr<NotifierImpl> > NotifierSet;
// -----------------------------------------------------------------------------------------------
}
@@ -131,219 +122,201 @@ namespace configmgr
class Broadcaster::Impl : public vos::OReference
{
private:
- NotifierData m_aNotifierData;
+ NotifierSet::value_type m_aNotifierData;
public:
- Impl(NotifierData const& aNotifierData) : m_aNotifierData(aNotifierData) {}
+ Impl(NotifierSet::value_type const& aNotifierData) : m_aNotifierData(aNotifierData) {}
- NotifierData getNotifierData() const { return m_aNotifierData; }
+ NotifierSet::value_type getNotifierData() const { return m_aNotifierData; }
- bool translateChanges(NodeChangesInformation& aInfos, NodeChanges const& aChanges, bool bSingleBase) const;
- bool translateChanges(NodeChangesInformation& aInfos, NodeChangesInformation const& aChanges, bool bSingleBase) const;
+ bool translateChanges(configuration::NodeChangesInformation& aInfos, configuration::NodeChanges const& aChanges, bool bSingleBase) const;
+ bool translateChanges(configuration::NodeChangesInformation& aInfos, configuration::NodeChangesInformation const& aChanges, bool bSingleBase) const;
- void queryConstraints(NodeChangesInformation const& aChanges) { this->doQueryConstraints(aChanges); }
- void notifyListeners(NodeChangesInformation const& aChanges) { this->doNotifyListeners(aChanges); }
+ void queryConstraints(configuration::NodeChangesInformation const& aChanges) { this->doQueryConstraints(aChanges); }
+ void notifyListeners(configuration::NodeChangesInformation const& aChanges) { this->doNotifyListeners(aChanges); }
- void notifyRootListeners(NodeChangesInformation const& aChanges);
+ void notifyRootListeners(configuration::NodeChangesInformation const& aChanges);
- static vos::ORef<Impl> create(NotifierHolder const& rNotifierImpl, ApiTreeRef const& pTreeImpl, NodeChange const& aChange, bool bLocal);
- static vos::ORef<Impl> create(NotifierHolder const& rNotifierImpl, ApiTreeRef const& pTreeImpl, NodeChanges const& aChange, bool bLocal);
- static vos::ORef<Impl> create(NotifierHolder const& rNotifierImpl, ApiTreeRef const& pTreeImpl, NodeChangeInformation const& aChange, bool bLocal);
- static vos::ORef<Impl> create(NotifierHolder const& rNotifierImpl, ApiTreeRef const& pTreeImpl, NodeChangesInformation const& aChange, bool bLocal);
+ static vos::ORef<Impl> create(vos::ORef<NotifierImpl> const& rNotifierImpl, ApiTreeRef const& pTreeImpl, configuration::NodeChange const& aChange, bool bLocal);
+ static vos::ORef<Impl> create(vos::ORef<NotifierImpl> const& rNotifierImpl, ApiTreeRef const& pTreeImpl, configuration::NodeChanges const& aChange, bool bLocal);
+ static vos::ORef<Impl> create(vos::ORef<NotifierImpl> const& rNotifierImpl, ApiTreeRef const& pTreeImpl, configuration::NodeChangeInformation const& aChange, bool bLocal);
+ static vos::ORef<Impl> create(vos::ORef<NotifierImpl> const& rNotifierImpl, ApiTreeRef const& pTreeImpl, configuration::NodeChangesInformation const& aChange, bool bLocal);
private:
- virtual void doQueryConstraints(NodeChangesInformation const& aChanges) = 0;
- virtual void doNotifyListeners(NodeChangesInformation const& aChanges) = 0;
+ virtual void doQueryConstraints(configuration::NodeChangesInformation const& aChanges) = 0;
+ virtual void doNotifyListeners(configuration::NodeChangesInformation const& aChanges) = 0;
};
// ---------------------------------------------------------------------------------------------------
namespace
{
// -----------------------------------------------------------------------------------------------
- using configuration::Tree;
- using configuration::TreeRef;
- using configuration::NodeRef;
- using configuration::NodeID;
- using configuration::SubNodeID;
- using configuration::NodeOffset;
- using configuration::NodeChange;
- using configuration::NodeChangeInformation;
- using configuration::NodeChangeData;
-
- typedef std::set< configuration::NodeID > NodeSet;
- typedef std::set< configuration::SubNodeID > SubNodeSet;
- // -----------------------------------------------------------------------------------------------
- typedef vos::ORef< Broadcaster::Impl > BroadcasterImplRef;
- // -----------------------------------------------------------------------------------------------
class EmptyBroadcaster_Impl : public Broadcaster::Impl
{
- EmptyBroadcaster_Impl(NotifierData const& rNotifierData)
+ EmptyBroadcaster_Impl(NotifierSet::value_type const& rNotifierData)
: Broadcaster::Impl(rNotifierData)
{
}
public:
static
- BroadcasterImplRef create(NotifierData const& rRootNotifier)
+ vos::ORef< Broadcaster::Impl > create(NotifierSet::value_type const& rRootNotifier)
{
return new EmptyBroadcaster_Impl(rRootNotifier);
}
private:
- virtual void doQueryConstraints(NodeChangesInformation const& aChanges);
- virtual void doNotifyListeners(NodeChangesInformation const& aChanges);
+ virtual void doQueryConstraints(configuration::NodeChangesInformation const& aChanges);
+ virtual void doNotifyListeners(configuration::NodeChangesInformation const& aChanges);
};
- void EmptyBroadcaster_Impl::doQueryConstraints(NodeChangesInformation const&) {}
- void EmptyBroadcaster_Impl::doNotifyListeners(NodeChangesInformation const&) {}
+ void EmptyBroadcaster_Impl::doQueryConstraints(configuration::NodeChangesInformation const&) {}
+ void EmptyBroadcaster_Impl::doNotifyListeners(configuration::NodeChangesInformation const&) {}
// -----------------------------------------------------------------------------------------------
class NodeLocalBroadcaster_Impl : public Broadcaster::Impl
{
- NodeID aAffectedNode;
+ configuration::NodeID aAffectedNode;
public:
- NodeLocalBroadcaster_Impl(NotifierData const& rTreeNotifierData, NodeID const& aAffectedID)
+ NodeLocalBroadcaster_Impl(NotifierSet::value_type const& rTreeNotifierData, configuration::NodeID const& aAffectedID)
: Broadcaster::Impl(rTreeNotifierData)
, aAffectedNode(aAffectedID)
{
}
- NodeID getAffectedNodeID() const { return aAffectedNode; }
- NodeOffset getNodeIndex() const { return aAffectedNode.toIndex(); }
+ configuration::NodeID getAffectedNodeID() const { return aAffectedNode; }
+ unsigned int getNodeIndex() const { return aAffectedNode.toIndex(); }
protected:
- void querySingleConstraint(NodeChangeInformation const& aChange, bool bMore);
- void notifySingleChange(NodeChangeInformation const& aChange, bool bMore, css::beans::PropertyChangeEvent*& pCurEvent);
+ void querySingleConstraint(configuration::NodeChangeInformation const& aChange, bool bMore);
+ void notifySingleChange(configuration::NodeChangeInformation const& aChange, bool bMore, css::beans::PropertyChangeEvent*& pCurEvent);
};
// -----------------------------------------------------------------------------------------------
class SingleChangeBroadcaster_Impl : public NodeLocalBroadcaster_Impl
{
- SubNodeID m_aChangingValue;
+ configuration::SubNodeID m_aChangingValue;
- SingleChangeBroadcaster_Impl(NotifierData const& rTreeNotifierData, NodeID const& aAffectedID, SubNodeID const& aChangedValue);
+ SingleChangeBroadcaster_Impl(NotifierSet::value_type const& rTreeNotifierData, configuration::NodeID const& aAffectedID, configuration::SubNodeID const& aChangedValue);
public:
static
NodeLocalBroadcaster_Impl* create(
- NotifierData const& rLocalNotifier,
- NodeChangeLocation const& aChange);
+ NotifierSet::value_type const& rLocalNotifier,
+ configuration::NodeChangeLocation const& aChange);
static
NodeLocalBroadcaster_Impl* create(
- NotifierData const& rLocalNotifier,
- NodeID const& aAffectedID,
- NodeChangeLocation const& aChange);
+ NotifierSet::value_type const& rLocalNotifier,
+ configuration::NodeID const& aAffectedID,
+ configuration::NodeChangeLocation const& aChange);
static
NodeLocalBroadcaster_Impl* create(
- NotifierData const& rLocalNotifier,
- NodeID const& aAffectedID,
- SubNodeID const& aChangedNode,
- NodeChangeLocation const& aChange);
+ NotifierSet::value_type const& rLocalNotifier,
+ configuration::NodeID const& aAffectedID,
+ configuration::SubNodeID const& aChangedNode,
+ configuration::NodeChangeLocation const& aChange);
private:
- virtual void doQueryConstraints(NodeChangesInformation const& aChanges);
- virtual void doNotifyListeners(NodeChangesInformation const& aChanges);
+ virtual void doQueryConstraints(configuration::NodeChangesInformation const& aChanges);
+ virtual void doNotifyListeners(configuration::NodeChangesInformation const& aChanges);
};
// -----------------------------------------------------------------------------------------------
class MultiChangeBroadcaster_Impl : public NodeLocalBroadcaster_Impl
{
- SubNodeSet m_aChangingNodes;
+ std::set< configuration::SubNodeID > m_aChangingNodes;
- MultiChangeBroadcaster_Impl(NotifierData const& rTreeNotifierData, NodeID const& aAffectedID, SubNodeSet& aChangedNodes);
+ MultiChangeBroadcaster_Impl(NotifierSet::value_type const& rTreeNotifierData, configuration::NodeID const& aAffectedID, std::set< configuration::SubNodeID >& aChangedNodes);
public:
static
NodeLocalBroadcaster_Impl* create(
- NotifierData const& rLocalNotifier,
- NodeChangesInformation const& aChanges);
+ NotifierSet::value_type const& rLocalNotifier,
+ configuration::NodeChangesInformation const& aChanges);
static
NodeLocalBroadcaster_Impl* create(
- NotifierData const& rLocalNotifier,
- NodeID const& aAffectedID,
- NodeChangesInformation const& aChanges);
+ NotifierSet::value_type const& rLocalNotifier,
+ configuration::NodeID const& aAffectedID,
+ configuration::NodeChangesInformation const& aChanges);
private:
- virtual void doQueryConstraints(NodeChangesInformation const& aChanges);
- virtual void doNotifyListeners(NodeChangesInformation const& aChanges);
+ virtual void doQueryConstraints(configuration::NodeChangesInformation const& aChanges);
+ virtual void doNotifyListeners(configuration::NodeChangesInformation const& aChanges);
};
// -----------------------------------------------------------------------------------------------
class SingleTreeBroadcaster_Impl : public Broadcaster::Impl
{
- typedef std::vector< vos::ORef<NodeLocalBroadcaster_Impl> > BroadcasterList;
- BroadcasterList m_aBroadcasters;
+ std::vector< vos::ORef<NodeLocalBroadcaster_Impl> > m_aBroadcasters;
- SingleTreeBroadcaster_Impl(NotifierData const& rTreeNotifierData, BroadcasterList& aBroadcasters);
+ SingleTreeBroadcaster_Impl(NotifierSet::value_type const& rTreeNotifierData, std::vector< vos::ORef<NodeLocalBroadcaster_Impl> >& aBroadcasters);
public:
//--------------------------
static
- BroadcasterImplRef create(
- NotifierData const& rRootNotifier,
- NotifierData const& rLocalNotifier,
- NodeChangesInformation const& aChanges);
+ vos::ORef< Broadcaster::Impl > create(
+ NotifierSet::value_type const& rRootNotifier,
+ NotifierSet::value_type const& rLocalNotifier,
+ configuration::NodeChangesInformation const& aChanges);
- static bool selectChanges(NodeChangesInformation& rSelected, NodeChangesInformation const& aOriginal, NodeID const& aSelector);
+ static bool selectChanges(configuration::NodeChangesInformation& rSelected, configuration::NodeChangesInformation const& aOriginal, configuration::NodeID const& aSelector);
//--------------------------
private:
- virtual void doQueryConstraints(NodeChangesInformation const& aChanges);
- virtual void doNotifyListeners(NodeChangesInformation const& aChanges);
+ virtual void doQueryConstraints(configuration::NodeChangesInformation const& aChanges);
+ virtual void doNotifyListeners(configuration::NodeChangesInformation const& aChanges);
};
// -----------------------------------------------------------------------------------------------
class MultiTreeBroadcaster_Impl : public Broadcaster::Impl
{
- typedef std::vector< BroadcasterImplRef > BroadcasterList;
- BroadcasterList m_aBroadcasters;
+ std::vector< vos::ORef< Broadcaster::Impl > > m_aBroadcasters;
- MultiTreeBroadcaster_Impl(NotifierData const& rRootNotifierData, BroadcasterList& aBroadcasters);
+ MultiTreeBroadcaster_Impl(NotifierSet::value_type const& rRootNotifierData, std::vector< vos::ORef< Broadcaster::Impl > >& aBroadcasters);
public:
//--------------------------
static
- BroadcasterImplRef create(
- NotifierData const& rRootNotifier,
+ vos::ORef< Broadcaster::Impl > create(
+ NotifierSet::value_type const& rRootNotifier,
NotifierSet const& rNotifiers,
- NodeChangesInformation const& aChanges);
+ configuration::NodeChangesInformation const& aChanges);
- static bool selectChanges(NodeChangesInformation& rSelected, NodeChangesInformation const& aOriginal, NotifierData const& aSelector);
+ static bool selectChanges(configuration::NodeChangesInformation& rSelected, configuration::NodeChangesInformation const& aOriginal, NotifierSet::value_type const& aSelector);
//--------------------------
private:
- virtual void doQueryConstraints(NodeChangesInformation const& aChanges);
- virtual void doNotifyListeners(NodeChangesInformation const& aChanges);
+ virtual void doQueryConstraints(configuration::NodeChangesInformation const& aChanges);
+ virtual void doNotifyListeners(configuration::NodeChangesInformation const& aChanges);
};
// -----------------------------------------------------------------------------------------------
- inline NodeID makeRootID( Tree const& aTree ) { return NodeID( aTree, aTree.getRootNode() ); }
- inline NodeID makeRootID( TreeRef const& aTree ) { return NodeID( aTree, aTree.getRootNode() ); }
- inline NodeID makeRootID( ApiTreeRef const& pTreeImpl ) { return makeRootID( pTreeImpl->getTree() ); }
+ inline configuration::NodeID makeRootID( rtl::Reference< configuration::Tree > const& aTree ) { return configuration::NodeID( aTree, aTree->getRootNode() ); }
+ inline configuration::NodeID makeRootID( ApiTreeRef const& pTreeImpl ) { return makeRootID( pTreeImpl->getTree() ); }
// -----------------------------------------------------------------------------------------------
- NotifierData findNotifier(NodeChangeLocation const& aChange, ApiTreeRef const& pTreeImpl)
+ NotifierSet::value_type findNotifier(configuration::NodeChangeLocation const& aChange, ApiTreeRef const& pTreeImpl)
{
OSL_ENSURE(aChange.isValidData(),"Invalid change location - cannot find notifier");
- NodeID aAffectedNode = aChange.getAffectedNodeID();
+ configuration::NodeID aAffectedNode = aChange.getAffectedNodeID();
if (aAffectedNode.isEmpty())
- return NotifierData();
+ return NotifierSet::value_type();
ApiTreeRef aAffectedImpl( Factory::findDescendantTreeImpl(aAffectedNode, pTreeImpl.get()) );
if (aAffectedImpl.is())
{
- NotifierHolder aAffectedNotifier = BroadcasterHelper::getImpl(aAffectedImpl->getNotifier());
+ vos::ORef<NotifierImpl> aAffectedNotifier = BroadcasterHelper::getImpl(aAffectedImpl->getNotifier());
- return NotifierData(aAffectedNotifier, aAffectedImpl);
+ return NotifierSet::value_type(aAffectedNotifier, aAffectedImpl);
}
else
- return NotifierData();
+ return NotifierSet::value_type();
}
// -----------------------------------------------------------------------------------------------
inline
- NotifierData findNotifier(NodeChangeInformation const& aChange, ApiTreeRef const& pTreeImpl)
+ NotifierSet::value_type findNotifier(configuration::NodeChangeInformation const& aChange, ApiTreeRef const& pTreeImpl)
{
return findNotifier(aChange.location,pTreeImpl);
}
// -----------------------------------------------------------------------------------------------
- void findNotifiers(NotifierSet& aNotifiers, NodeChangesInformation const& aChanges, ApiTreeRef const& pTreeImpl )
+ void findNotifiers(NotifierSet& aNotifiers, configuration::NodeChangesInformation const& aChanges, ApiTreeRef const& pTreeImpl )
{
- for (NodeChangesInformation::Iterator it = aChanges.begin(); it != aChanges.end(); ++it)
+ for (std::vector< configuration::NodeChangeInformation >::const_iterator it = aChanges.begin(); it != aChanges.end(); ++it)
{
- NotifierData aNotifierData( findNotifier(*it,pTreeImpl) );
+ NotifierSet::value_type aNotifierData( findNotifier(*it,pTreeImpl) );
if (aNotifierData.first.isValid())
{
@@ -355,17 +328,14 @@ namespace configmgr
// -----------------------------------------------------------------------------------------------
// NodeLocalBroadcaster_Impl
// -----------------------------------------------------------------------------------------------
- void NodeLocalBroadcaster_Impl::querySingleConstraint(NodeChangeInformation const& aChange, bool bMore)
+ void NodeLocalBroadcaster_Impl::querySingleConstraint(configuration::NodeChangeInformation const& aChange, bool bMore)
{
- using css::beans::XVetoableChangeListener;
-
- typedef ListenerContainerIterator< XVetoableChangeListener > ListenerIterator;
- uno::Reference< XVetoableChangeListener > const * const SelectListener = 0;
+ uno::Reference< css::beans::XVetoableChangeListener > const * const SelectListener = 0;
- NotifierImplHolder pNotifierImpl = getNotifierData().first;
+ vos::ORef<NotifierImpl> pNotifierImpl = getNotifierData().first;
- ListenerContainer* pListeners = pNotifierImpl->m_aListeners.getContainer( getNodeIndex(), getCppuType(SelectListener) );
- ListenerContainer* pSpecial = pNotifierImpl->m_aListeners.getSpecialContainer( aChange.location.getChangingValueID() );
+ cppu::OInterfaceContainerHelper* pListeners = pNotifierImpl->m_aListeners.getContainer( getNodeIndex(), getCppuType(SelectListener) );
+ cppu::OInterfaceContainerHelper* pSpecial = pNotifierImpl->m_aListeners.getSpecialContainer( aChange.location.getChangingValueID() );
if (pSpecial || pListeners)
{
@@ -378,7 +348,7 @@ namespace configmgr
// a PropertyVetoException (which is not a RuntimeException)
if (pListeners)
{
- ListenerIterator aIterator(*pListeners);
+ ListenerContainerIterator< css::beans::XVetoableChangeListener > aIterator(*pListeners);
UnoApiLockReleaser aGuardReleaser;
while (aIterator.hasMoreElements())
@@ -391,7 +361,7 @@ namespace configmgr
}
if (pSpecial)
{
- ListenerIterator aIterator(*pSpecial);
+ ListenerContainerIterator< css::beans::XVetoableChangeListener > aIterator(*pSpecial);
UnoApiLockReleaser aGuardReleaser;
while (aIterator.hasMoreElements())
@@ -407,19 +377,14 @@ namespace configmgr
}
// -----------------------------------------------------------------------------------------------
- void NodeLocalBroadcaster_Impl::notifySingleChange(NodeChangeInformation const& aChange, bool bMore, css::beans::PropertyChangeEvent*& pCurEvent)
+ void NodeLocalBroadcaster_Impl::notifySingleChange(configuration::NodeChangeInformation const& aChange, bool bMore, css::beans::PropertyChangeEvent*& pCurEvent)
{
- using css::beans::XPropertyChangeListener;
- using css::container::XContainerListener;
+ uno::Reference< css::beans::XPropertyChangeListener > const * const SelectPropertyListener = 0;
+ uno::Reference< css::container::XContainerListener > const * const SelectContainerListener = 0;
- typedef ListenerContainerIterator< XPropertyChangeListener > PropertyListenerIterator;
- typedef ListenerContainerIterator< XContainerListener > ContainerListenerIterator;
- uno::Reference< XPropertyChangeListener > const * const SelectPropertyListener = 0;
- uno::Reference< XContainerListener > const * const SelectContainerListener = 0;
+ vos::ORef<NotifierImpl> pNotifierImpl = getNotifierData().first;
- NotifierImplHolder pNotifierImpl = getNotifierData().first;
-
- ListenerContainer* pContainerListeners = pNotifierImpl->m_aListeners.getContainer( getNodeIndex(), getCppuType(SelectContainerListener) );
+ cppu::OInterfaceContainerHelper* pContainerListeners = pNotifierImpl->m_aListeners.getContainer( getNodeIndex(), getCppuType(SelectContainerListener) );
if (pContainerListeners)
{
@@ -429,35 +394,35 @@ namespace configmgr
if (configapi::fillEventDataFromResolved(aEvent,aChange))
{
- ContainerListenerIterator aIterator(*pContainerListeners);
+ ListenerContainerIterator< css::container::XContainerListener > aIterator(*pContainerListeners);
UnoApiLockReleaser aGuardReleaser;
while (aIterator.hasMoreElements())
try
{
- uno::Reference<XContainerListener> xListener( aIterator.next() );
+ uno::Reference<css::container::XContainerListener> xListener( aIterator.next() );
OSL_ASSERT( xListener.is() );
switch (aChange.change.type)
{
- case NodeChangeData::eSetValue:
- case NodeChangeData::eSetDefault:
- case NodeChangeData::eReplaceElement:
+ case configuration::NodeChangeData::eSetValue:
+ case configuration::NodeChangeData::eSetDefault:
+ case configuration::NodeChangeData::eReplaceElement:
xListener->elementReplaced(aEvent);
break;
- case NodeChangeData::eInsertElement:
+ case configuration::NodeChangeData::eInsertElement:
xListener->elementInserted(aEvent);
break;
- case NodeChangeData::eRemoveElement:
+ case configuration::NodeChangeData::eRemoveElement:
xListener->elementRemoved(aEvent);
break;
- case NodeChangeData::eResetSetDefault:
- case NodeChangeData::eRenameElementTree:
- case NodeChangeData::eNoChange:
+ case configuration::NodeChangeData::eResetSetDefault:
+ case configuration::NodeChangeData::eRenameElementTree:
+ case configuration::NodeChangeData::eNoChange:
OSL_ASSERT(false);
break;
}
@@ -475,19 +440,19 @@ namespace configmgr
if (configapi::fillEventDataFromResolved(rEvent,aChange,bMore))
{
- ListenerContainer* pPropertyListeners = pNotifierImpl->m_aListeners.getContainer( getNodeIndex(), getCppuType(SelectPropertyListener) );
+ cppu::OInterfaceContainerHelper* pPropertyListeners = pNotifierImpl->m_aListeners.getContainer( getNodeIndex(), getCppuType(SelectPropertyListener) );
if (pPropertyListeners)
{
- PropertyListenerIterator aIterator(*pPropertyListeners);
+ ListenerContainerIterator< css::beans::XPropertyChangeListener > aIterator(*pPropertyListeners);
UnoApiLockReleaser aGuardReleaser;
while (aIterator.hasMoreElements())
try { aIterator.next()->propertyChange(rEvent); } catch (uno::Exception & ) {}
}
- ListenerContainer* pSpecialListeners = pNotifierImpl->m_aListeners.getSpecialContainer( aChange.location.getChangingValueID() );
+ cppu::OInterfaceContainerHelper* pSpecialListeners = pNotifierImpl->m_aListeners.getSpecialContainer( aChange.location.getChangingValueID() );
if (pSpecialListeners)
{
- PropertyListenerIterator aIterator(*pSpecialListeners);
+ ListenerContainerIterator< css::beans::XPropertyChangeListener > aIterator(*pSpecialListeners);
UnoApiLockReleaser aGuardReleaser;
while (aIterator.hasMoreElements())
try { aIterator.next()->propertyChange(rEvent); } catch (uno::Exception & ) {}
@@ -503,8 +468,8 @@ namespace configmgr
// SingleBroadcaster_Impl
// -----------------------------------------------------------------------------------------------
SingleChangeBroadcaster_Impl::SingleChangeBroadcaster_Impl(
- NotifierData const& rTreeNotifierData,
- NodeID const& aAffectedID, SubNodeID const& aChangedNode
+ NotifierSet::value_type const& rTreeNotifierData,
+ configuration::NodeID const& aAffectedID, configuration::SubNodeID const& aChangedNode
)
: NodeLocalBroadcaster_Impl(rTreeNotifierData,aAffectedID)
, m_aChangingValue(aChangedNode)
@@ -512,15 +477,15 @@ namespace configmgr
}
// -----------------------------------------------------------------------------------------------
NodeLocalBroadcaster_Impl* SingleChangeBroadcaster_Impl::create(
- NotifierData const& rLocalNotifier,
- NodeChangeLocation const& aChange)
+ NotifierSet::value_type const& rLocalNotifier,
+ configuration::NodeChangeLocation const& aChange)
{
- OSL_ENSURE(configuration::equalTreeRef(rLocalNotifier.second->getTree(), aChange.getAffectedTreeRef()),
+ OSL_ENSURE(rLocalNotifier.second->getTree() == aChange.getAffectedTreeRef(),
"ERROR: Tree Mismatch creating Single Broadcaster");
OSL_ENSURE(aChange.isValidData(), "ERROR: Invalid Change Location for Broadcaster");
- NodeID aAffectedNodeID = aChange.getAffectedNodeID();
+ configuration::NodeID aAffectedNodeID = aChange.getAffectedNodeID();
if (aAffectedNodeID.isEmpty())
return 0;
@@ -528,25 +493,25 @@ namespace configmgr
}
// -----------------------------------------------------------------------------------------------
NodeLocalBroadcaster_Impl* SingleChangeBroadcaster_Impl::create(
- NotifierData const& rLocalNotifier,
- NodeID const& aAffectedID,
- NodeChangeLocation const& aChange)
+ NotifierSet::value_type const& rLocalNotifier,
+ configuration::NodeID const& aAffectedID,
+ configuration::NodeChangeLocation const& aChange)
{
return create(rLocalNotifier,aAffectedID,aChange.getChangingValueID(),aChange);
}
// -----------------------------------------------------------------------------------------------
NodeLocalBroadcaster_Impl* SingleChangeBroadcaster_Impl::create(
- NotifierData const& rLocalNotifier,
- NodeID const& aAffectedID,
- SubNodeID const& aChangedNodeID,
- NodeChangeLocation const& aChange)
+ NotifierSet::value_type const& rLocalNotifier,
+ configuration::NodeID const& aAffectedID,
+ configuration::SubNodeID const& aChangedNodeID,
+ configuration::NodeChangeLocation const& aChange)
{
{ (void)aChange; }
OSL_ENSURE(aChange.isValidData(), "ERROR: Invalid Change Location for Broadcaster");
OSL_ENSURE(aAffectedID.isValidNode(),"Cannot broadcast without affected node");
- OSL_ENSURE(configuration::equalTreeRef(rLocalNotifier.second->getTree(), aChange.getAffectedTreeRef()),
+ OSL_ENSURE(rLocalNotifier.second->getTree() == aChange.getAffectedTreeRef(),
"ERROR: Tree Mismatch creating Single Broadcaster");
OSL_ENSURE( aChange.getAffectedNodeID() == aAffectedID,
"ERROR: Node Mismatch creating Single Broadcaster");
@@ -556,12 +521,12 @@ namespace configmgr
return new SingleChangeBroadcaster_Impl(rLocalNotifier,aAffectedID,aChangedNodeID);
}
// -----------------------------------------------------------------------------------------------
- void SingleChangeBroadcaster_Impl::doQueryConstraints(NodeChangesInformation const& aChanges)
+ void SingleChangeBroadcaster_Impl::doQueryConstraints(configuration::NodeChangesInformation const& aChanges)
{
OSL_ASSERT(aChanges.size() <= 1);
if (!aChanges.empty())
{
- NodeChangesInformation::Iterator it = aChanges.begin();
+ std::vector< configuration::NodeChangeInformation >::const_iterator it = aChanges.begin();
OSL_ENSURE( m_aChangingValue == it->location.getChangingValueID(), "Broadcasting unanticipated change");
@@ -570,18 +535,15 @@ namespace configmgr
}
// -----------------------------------------------------------------------------------------------
- void SingleChangeBroadcaster_Impl::doNotifyListeners(NodeChangesInformation const& aChanges)
+ void SingleChangeBroadcaster_Impl::doNotifyListeners(configuration::NodeChangesInformation const& aChanges)
{
- using css::beans::XPropertiesChangeListener;
- using css::beans::PropertyChangeEvent;
-
OSL_ASSERT(aChanges.size() <= 1);
if (!aChanges.empty())
{
- PropertyChangeEvent aEvent;
- PropertyChangeEvent * pEventNext = &aEvent;
+ css::beans::PropertyChangeEvent aEvent;
+ css::beans::PropertyChangeEvent * pEventNext = &aEvent;
- NodeChangesInformation::Iterator it = aChanges.begin();
+ std::vector< configuration::NodeChangeInformation >::const_iterator it = aChanges.begin();
OSL_ENSURE( m_aChangingValue == it->location.getChangingValueID(), "Broadcasting unanticipated change");
@@ -589,18 +551,17 @@ namespace configmgr
if (pEventNext != &aEvent)
{
- uno::Sequence< PropertyChangeEvent > aPropertyEvents(&aEvent,1);
+ uno::Sequence< css::beans::PropertyChangeEvent > aPropertyEvents(&aEvent,1);
- typedef ListenerContainerIterator< XPropertiesChangeListener > ListenerIterator;
- uno::Reference< XPropertiesChangeListener > const * const SelectListener = 0;
+ uno::Reference< css::beans::XPropertiesChangeListener > const * const SelectListener = 0;
- NotifierImplHolder pNotifierImpl = getNotifierData().first;
+ vos::ORef<NotifierImpl> pNotifierImpl = getNotifierData().first;
- ListenerContainer* pContainer = pNotifierImpl->m_aListeners.getContainer( getNodeIndex(), getCppuType(SelectListener) );
+ cppu::OInterfaceContainerHelper* pContainer = pNotifierImpl->m_aListeners.getContainer( getNodeIndex(), getCppuType(SelectListener) );
if (pContainer)
{
- ListenerIterator aIterator(*pContainer);
+ ListenerContainerIterator< css::beans::XPropertiesChangeListener > aIterator(*pContainer);
UnoApiLockReleaser aGuardReleaser;
while (aIterator.hasMoreElements())
try { aIterator.next()->propertiesChange(aPropertyEvents); } catch (uno::Exception & ) {}
@@ -614,8 +575,8 @@ namespace configmgr
// -----------------------------------------------------------------------------------------------
MultiChangeBroadcaster_Impl::MultiChangeBroadcaster_Impl(
- NotifierData const& rTreeNotifierData,
- NodeID const& aAffectedID, SubNodeSet& aChangedNodes
+ NotifierSet::value_type const& rTreeNotifierData,
+ configuration::NodeID const& aAffectedID, std::set< configuration::SubNodeID >& aChangedNodes
)
: NodeLocalBroadcaster_Impl(rTreeNotifierData,aAffectedID)
, m_aChangingNodes()
@@ -624,15 +585,15 @@ namespace configmgr
}
// -----------------------------------------------------------------------------------------------
NodeLocalBroadcaster_Impl* MultiChangeBroadcaster_Impl::create(
- NotifierData const& rLocalNotifier,
- NodeChangesInformation const& aChanges)
+ NotifierSet::value_type const& rLocalNotifier,
+ configuration::NodeChangesInformation const& aChanges)
{
if (aChanges.empty())
return 0;
OSL_ENSURE(aChanges.begin()->hasValidLocation(), "ERROR: Invalid Change Location for Broadcaster");
- NodeID aAffectedNodeID = aChanges.begin()->location.getAffectedNodeID();
+ configuration::NodeID aAffectedNodeID = aChanges.begin()->location.getAffectedNodeID();
if (aAffectedNodeID.isEmpty())
return 0;
@@ -640,9 +601,9 @@ namespace configmgr
}
// -----------------------------------------------------------------------------------------------
NodeLocalBroadcaster_Impl* MultiChangeBroadcaster_Impl::create(
- NotifierData const& rLocalNotifier,
- NodeID const& aAffectedNodeID,
- NodeChangesInformation const& aChanges)
+ NotifierSet::value_type const& rLocalNotifier,
+ configuration::NodeID const& aAffectedNodeID,
+ configuration::NodeChangesInformation const& aChanges)
{
if (aChanges.empty())
return 0;
@@ -654,16 +615,16 @@ namespace configmgr
{
OSL_ENSURE(aAffectedNodeID.isValidNode(),"Cannot broadcast without affected node");
- SubNodeSet aChangedNodes;
- for (NodeChangesInformation::Iterator it = aChanges.begin(); it != aChanges.end(); ++it)
+ std::set< configuration::SubNodeID > aChangedNodes;
+ for (std::vector< configuration::NodeChangeInformation >::const_iterator it = aChanges.begin(); it != aChanges.end(); ++it)
{
OSL_ENSURE(it->hasValidLocation(), "ERROR: Invalid Change Location for Broadcaster");
OSL_ENSURE(it->location.getAffectedNodeID() == aAffectedNodeID, "ERROR: Change is not local to affected node (as advertised)");
- OSL_ENSURE(configuration::equalTreeRef(rLocalNotifier.second->getTree(), it->location.getAffectedTreeRef()),
+ OSL_ENSURE(rLocalNotifier.second->getTree() == it->location.getAffectedTreeRef(),
"ERROR: Tree Mismatch creating Multi Change Broadcaster");
- SubNodeID aChangedValueID = it->location.getChangingValueID();
+ configuration::SubNodeID aChangedValueID = it->location.getChangingValueID();
aChangedNodes.insert(aChangedValueID);
}
@@ -675,11 +636,11 @@ namespace configmgr
}
}
// -----------------------------------------------------------------------------------------------
- void MultiChangeBroadcaster_Impl::doQueryConstraints(NodeChangesInformation const& aChanges)
+ void MultiChangeBroadcaster_Impl::doQueryConstraints(configuration::NodeChangesInformation const& aChanges)
{
- NodeChangesInformation::Iterator const stop = aChanges.end(), last = stop-1;
+ std::vector< configuration::NodeChangeInformation >::const_iterator const stop = aChanges.end(), last = stop-1;
- for (NodeChangesInformation::Iterator it = aChanges.begin(); it != stop; ++it)
+ for (std::vector< configuration::NodeChangeInformation >::const_iterator it = aChanges.begin(); it != stop; ++it)
{
OSL_ENSURE( m_aChangingNodes.find( it->location.getChangingValueID() ) != m_aChangingNodes.end(), "Broadcasting unanticipated change");
@@ -688,19 +649,16 @@ namespace configmgr
}
// -----------------------------------------------------------------------------------------------
- void MultiChangeBroadcaster_Impl::doNotifyListeners(NodeChangesInformation const& aChanges)
+ void MultiChangeBroadcaster_Impl::doNotifyListeners(configuration::NodeChangesInformation const& aChanges)
{
- using css::beans::XPropertiesChangeListener;
- using css::beans::PropertyChangeEvent;
-
- uno::Sequence< PropertyChangeEvent > aPropertyEvents(aChanges.size());
+ uno::Sequence< css::beans::PropertyChangeEvent > aPropertyEvents(aChanges.size());
- PropertyChangeEvent * const pEventStart = aPropertyEvents.getArray();
- PropertyChangeEvent * pEventNext = pEventStart;
+ css::beans::PropertyChangeEvent * const pEventStart = aPropertyEvents.getArray();
+ css::beans::PropertyChangeEvent * pEventNext = pEventStart;
- NodeChangesInformation::Iterator const stop = aChanges.end(), last = stop-1;
+ std::vector< configuration::NodeChangeInformation >::const_iterator const stop = aChanges.end(), last = stop-1;
- for (NodeChangesInformation::Iterator it = aChanges.begin(); it != stop; ++it)
+ for (std::vector< configuration::NodeChangeInformation >::const_iterator it = aChanges.begin(); it != stop; ++it)
{
// #92463# Skip nodes that are not in the tree
if (it->location.getAffectedNodeID().isEmpty()) continue;
@@ -718,16 +676,15 @@ namespace configmgr
if (nPropertyEvents != aPropertyEvents.getLength())
aPropertyEvents.realloc(nPropertyEvents);
- typedef ListenerContainerIterator< XPropertiesChangeListener > ListenerIterator;
- uno::Reference< XPropertiesChangeListener > const * const SelectListener = 0;
+ uno::Reference< css::beans::XPropertiesChangeListener > const * const SelectListener = 0;
- NotifierImplHolder pNotifierImpl = getNotifierData().first;
+ vos::ORef<NotifierImpl> pNotifierImpl = getNotifierData().first;
- ListenerContainer* pContainer = pNotifierImpl->m_aListeners.getContainer( getNodeIndex(), getCppuType(SelectListener) );
+ cppu::OInterfaceContainerHelper* pContainer = pNotifierImpl->m_aListeners.getContainer( getNodeIndex(), getCppuType(SelectListener) );
if (pContainer)
{
- ListenerIterator aIterator(*pContainer);
+ ListenerContainerIterator< css::beans::XPropertiesChangeListener > aIterator(*pContainer);
UnoApiLockReleaser aGuardReleaser;
while (aIterator.hasMoreElements())
try { aIterator.next()->propertiesChange(aPropertyEvents); } catch (uno::Exception & ) {}
@@ -739,8 +696,8 @@ namespace configmgr
// -----------------------------------------------------------------------------------------------
SingleTreeBroadcaster_Impl::SingleTreeBroadcaster_Impl(
- NotifierData const& aTreeNotifierData,
- BroadcasterList& aBroadcasters
+ NotifierSet::value_type const& aTreeNotifierData,
+ std::vector< vos::ORef<NodeLocalBroadcaster_Impl> >& aBroadcasters
)
: Broadcaster::Impl(aTreeNotifierData)
, m_aBroadcasters()
@@ -750,11 +707,11 @@ namespace configmgr
// -----------------------------------------------------------------------------------------------
- bool SingleTreeBroadcaster_Impl::selectChanges(NodeChangesInformation& rSelected, NodeChangesInformation const& aOriginal, NodeID const& aSelector)
+ bool SingleTreeBroadcaster_Impl::selectChanges(configuration::NodeChangesInformation& rSelected, configuration::NodeChangesInformation const& aOriginal, configuration::NodeID const& aSelector)
{
OSL_ASSERT(rSelected.empty()); // nothing in there yet
- for (NodeChangesInformation::Iterator it = aOriginal.begin(); it != aOriginal.end(); ++it)
+ for (std::vector< configuration::NodeChangeInformation >::const_iterator it = aOriginal.begin(); it != aOriginal.end(); ++it)
{
if ( it->location.getAffectedNodeID() == aSelector )
{
@@ -765,27 +722,27 @@ namespace configmgr
}
// -----------------------------------------------------------------------------------------------
- BroadcasterImplRef SingleTreeBroadcaster_Impl::create(
- NotifierData const& rRootNotifier,
- NotifierData const& rLocalNotifier,
- NodeChangesInformation const& aChanges)
+ vos::ORef< Broadcaster::Impl > SingleTreeBroadcaster_Impl::create(
+ NotifierSet::value_type const& rRootNotifier,
+ NotifierSet::value_type const& rLocalNotifier,
+ configuration::NodeChangesInformation const& aChanges)
{
- NodeSet aNodes;
- for (NodeChangesInformation::Iterator itChanges = aChanges.begin(); itChanges != aChanges.end(); ++itChanges)
+ std::set< configuration::NodeID > aNodes;
+ for (std::vector< configuration::NodeChangeInformation >::const_iterator itChanges = aChanges.begin(); itChanges != aChanges.end(); ++itChanges)
{
OSL_ENSURE(itChanges->hasValidLocation(), "ERROR: Invalid Change Location for Broadcaster");
- NodeID aAffectedNodeID = itChanges->location.getAffectedNodeID();
+ configuration::NodeID aAffectedNodeID = itChanges->location.getAffectedNodeID();
if (!aAffectedNodeID.isEmpty())
aNodes.insert(aAffectedNodeID);
}
- BroadcasterList aNodecasters;
- for (NodeSet::const_iterator itNodes = aNodes.begin(); itNodes != aNodes.end(); ++itNodes)
+ std::vector< vos::ORef<NodeLocalBroadcaster_Impl> > aNodecasters;
+ for (std::set< configuration::NodeID >::const_iterator itNodes = aNodes.begin(); itNodes != aNodes.end(); ++itNodes)
{
OSL_ASSERT(itNodes->isValidNode()); // filtered empty ones above
- NodeChangesInformation aSelectedChanges;
+ configuration::NodeChangesInformation aSelectedChanges;
if ( selectChanges(aSelectedChanges, aChanges, *itNodes))
{
NodeLocalBroadcaster_Impl* pSelectedImpl = MultiChangeBroadcaster_Impl::create(rLocalNotifier, *itNodes, aSelectedChanges);
@@ -804,21 +761,21 @@ namespace configmgr
return new SingleTreeBroadcaster_Impl(rRootNotifier, aNodecasters);
}
// -----------------------------------------------------------------------------------------------
- void SingleTreeBroadcaster_Impl::doQueryConstraints(NodeChangesInformation const& aChanges)
+ void SingleTreeBroadcaster_Impl::doQueryConstraints(configuration::NodeChangesInformation const& aChanges)
{
- for(BroadcasterList::iterator it = m_aBroadcasters.begin(); it != m_aBroadcasters.end(); ++it)
+ for(std::vector< vos::ORef<NodeLocalBroadcaster_Impl> >::iterator it = m_aBroadcasters.begin(); it != m_aBroadcasters.end(); ++it)
{
- NodeChangesInformation aSelectedInfos;
+ configuration::NodeChangesInformation aSelectedInfos;
if ( selectChanges(aSelectedInfos, aChanges, (*it)->getAffectedNodeID()) )
(*it)->queryConstraints(aSelectedInfos);
}
}
// -----------------------------------------------------------------------------------------------
- void SingleTreeBroadcaster_Impl::doNotifyListeners(NodeChangesInformation const& aChanges)
+ void SingleTreeBroadcaster_Impl::doNotifyListeners(configuration::NodeChangesInformation const& aChanges)
{
- for(BroadcasterList::iterator it = m_aBroadcasters.begin(); it != m_aBroadcasters.end(); ++it)
+ for(std::vector< vos::ORef<NodeLocalBroadcaster_Impl> >::iterator it = m_aBroadcasters.begin(); it != m_aBroadcasters.end(); ++it)
{
- NodeChangesInformation aSelectedInfos;
+ configuration::NodeChangesInformation aSelectedInfos;
if ( selectChanges(aSelectedInfos, aChanges, (*it)->getAffectedNodeID()) )
(*it)->notifyListeners(aSelectedInfos);
}
@@ -826,7 +783,7 @@ namespace configmgr
// -----------------------------------------------------------------------------------------------
// MultiTreeBroadcaster_Impl
// -----------------------------------------------------------------------------------------------
- MultiTreeBroadcaster_Impl::MultiTreeBroadcaster_Impl(NotifierData const& aRootSelector, BroadcasterList& aBroadcasters)
+ MultiTreeBroadcaster_Impl::MultiTreeBroadcaster_Impl(NotifierSet::value_type const& aRootSelector, std::vector< vos::ORef< Broadcaster::Impl > >& aBroadcasters)
: Broadcaster::Impl(aRootSelector)
, m_aBroadcasters()
{
@@ -835,18 +792,18 @@ namespace configmgr
// -----------------------------------------------------------------------------------------------
- bool MultiTreeBroadcaster_Impl::selectChanges(NodeChangesInformation& rSelected, NodeChangesInformation const& aOriginal, NotifierData const& aSelector)
+ bool MultiTreeBroadcaster_Impl::selectChanges(configuration::NodeChangesInformation& rSelected, configuration::NodeChangesInformation const& aOriginal, NotifierSet::value_type const& aSelector)
{
OSL_ASSERT(aSelector.first.isValid());
OSL_ASSERT(aSelector.second.is());
OSL_ASSERT(rSelected.empty()); // nothing in there yet
- TreeRef const aSelectedTree( aSelector.second->getTree() );
+ rtl::Reference< configuration::Tree > const aSelectedTree( aSelector.second->getTree() );
- for (NodeChangesInformation::Iterator it = aOriginal.begin(); it != aOriginal.end(); ++it)
+ for (std::vector< configuration::NodeChangeInformation >::const_iterator it = aOriginal.begin(); it != aOriginal.end(); ++it)
{
- if ( configuration::equalTreeRef(it->location.getAffectedTreeRef(),aSelectedTree) )
+ if (it->location.getAffectedTreeRef() == aSelectedTree)
{
rSelected.push_back(*it);
}
@@ -855,15 +812,15 @@ namespace configmgr
}
// -------------------------------------------------------------------------------------------
- BroadcasterImplRef MultiTreeBroadcaster_Impl::create(NotifierData const& rRootNotifier, NotifierSet const& rNotifiers, NodeChangesInformation const& aChanges)
+ vos::ORef< Broadcaster::Impl > MultiTreeBroadcaster_Impl::create(NotifierSet::value_type const& rRootNotifier, NotifierSet const& rNotifiers, configuration::NodeChangesInformation const& aChanges)
{
- BroadcasterList aTreecasters;
+ std::vector< vos::ORef< Broadcaster::Impl > > aTreecasters;
for (NotifierSet::const_iterator it = rNotifiers.begin(); it != rNotifiers.end(); ++it)
{
- NodeChangesInformation aSelectedChanges;
+ configuration::NodeChangesInformation aSelectedChanges;
if ( selectChanges(aSelectedChanges, aChanges, *it))
{
- BroadcasterImplRef pSelectedImpl = SingleTreeBroadcaster_Impl::create(rRootNotifier, *it, aSelectedChanges);
+ vos::ORef< Broadcaster::Impl > pSelectedImpl = SingleTreeBroadcaster_Impl::create(rRootNotifier, *it, aSelectedChanges);
if (pSelectedImpl.isValid())
aTreecasters.push_back(pSelectedImpl);
}
@@ -880,22 +837,22 @@ namespace configmgr
}
// -------------------------------------------------------------------------------------------
- void MultiTreeBroadcaster_Impl::doQueryConstraints(NodeChangesInformation const& aChanges)
+ void MultiTreeBroadcaster_Impl::doQueryConstraints(configuration::NodeChangesInformation const& aChanges)
{
- for(BroadcasterList::iterator it = m_aBroadcasters.begin(); it != m_aBroadcasters.end(); ++it)
+ for(std::vector< vos::ORef< Broadcaster::Impl > >::iterator it = m_aBroadcasters.begin(); it != m_aBroadcasters.end(); ++it)
{
- NodeChangesInformation aSelectedInfos;
+ configuration::NodeChangesInformation aSelectedInfos;
if ( selectChanges(aSelectedInfos, aChanges, (*it)->getNotifierData()) )
(*it)->queryConstraints(aSelectedInfos);
}
}
// -------------------------------------------------------------------------------------------
- void MultiTreeBroadcaster_Impl::doNotifyListeners(NodeChangesInformation const& aChanges)
+ void MultiTreeBroadcaster_Impl::doNotifyListeners(configuration::NodeChangesInformation const& aChanges)
{
- for(BroadcasterList::iterator it = m_aBroadcasters.begin(); it != m_aBroadcasters.end(); ++it)
+ for(std::vector< vos::ORef< Broadcaster::Impl > >::iterator it = m_aBroadcasters.begin(); it != m_aBroadcasters.end(); ++it)
{
- NodeChangesInformation aSelectedInfos;
+ configuration::NodeChangesInformation aSelectedInfos;
if ( selectChanges(aSelectedInfos, aChanges, (*it)->getNotifierData()) )
(*it)->notifyListeners(aSelectedInfos);
}
@@ -904,22 +861,22 @@ namespace configmgr
}
// ---------------------------------------------------------------------------------------------------
- BroadcasterImplRef Broadcaster::Impl::create(NotifierHolder const& rNotifierImpl, ApiTreeRef const& pTreeImpl, NodeChange const& aChange, bool bLocal)
+ vos::ORef< Broadcaster::Impl > Broadcaster::Impl::create(vos::ORef<NotifierImpl> const& rNotifierImpl, ApiTreeRef const& pTreeImpl, configuration::NodeChange const& aChange, bool bLocal)
{
OSL_ASSERT(pTreeImpl.is());
- BroadcasterImplRef pRet;
+ vos::ORef< Broadcaster::Impl > pRet;
- NodeChangeLocation aLocation;
+ configuration::NodeChangeLocation aLocation;
if (aChange.getChangeLocation(aLocation))
{
if (bLocal)
{
- pRet = SingleChangeBroadcaster_Impl::create( NotifierData(rNotifierImpl,pTreeImpl), aLocation);
+ pRet = SingleChangeBroadcaster_Impl::create( NotifierSet::value_type(rNotifierImpl,pTreeImpl), aLocation);
}
else
{
- NotifierData aAffectedNotifier( findNotifier(aLocation, pTreeImpl) );
+ NotifierSet::value_type aAffectedNotifier( findNotifier(aLocation, pTreeImpl) );
if (aAffectedNotifier.second.is()) // only if we found a notifier we are able to create a broadcaster (DG)
pRet = SingleChangeBroadcaster_Impl::create( aAffectedNotifier, aLocation);
}
@@ -931,17 +888,17 @@ namespace configmgr
}
if (pRet.isEmpty())
- pRet = EmptyBroadcaster_Impl::create( NotifierData(rNotifierImpl,pTreeImpl) );
+ pRet = EmptyBroadcaster_Impl::create( NotifierSet::value_type(rNotifierImpl,pTreeImpl) );
return pRet;
}
// ---------------------------------------------------------------------------------------------------
- BroadcasterImplRef Broadcaster::Impl::create(NotifierHolder const& rNotifierImpl, ApiTreeRef const& pTreeImpl, NodeChanges const& aChanges, bool bLocal)
+ vos::ORef< Broadcaster::Impl > Broadcaster::Impl::create(vos::ORef<NotifierImpl> const& rNotifierImpl, ApiTreeRef const& pTreeImpl, configuration::NodeChanges const& aChanges, bool bLocal)
{
- NotifierData aRootData(rNotifierImpl, pTreeImpl);
+ NotifierSet::value_type aRootData(rNotifierImpl, pTreeImpl);
- NodeChangesInformation aChangeInfos;
+ configuration::NodeChangesInformation aChangeInfos;
if (aChanges.getChangesInfos(aChangeInfos))
{
return create(rNotifierImpl,pTreeImpl,aChangeInfos,bLocal);
@@ -951,7 +908,7 @@ namespace configmgr
OSL_ENSURE(aChanges.isEmpty(), "Cannot get information for changes - cannot notify");
// make an empty one below
- BroadcasterImplRef pRet = EmptyBroadcaster_Impl::create( aRootData );
+ vos::ORef< Broadcaster::Impl > pRet = EmptyBroadcaster_Impl::create( aRootData );
return pRet;
}
@@ -959,21 +916,21 @@ namespace configmgr
}
// ---------------------------------------------------------------------------------------------------
- BroadcasterImplRef Broadcaster::Impl::create(NotifierHolder const& rNotifierImpl, ApiTreeRef const& pTreeImpl, NodeChangeInformation const& aChange, bool bLocal)
+ vos::ORef< Broadcaster::Impl > Broadcaster::Impl::create(vos::ORef<NotifierImpl> const& rNotifierImpl, ApiTreeRef const& pTreeImpl, configuration::NodeChangeInformation const& aChange, bool bLocal)
{
OSL_ASSERT(pTreeImpl.is());
- BroadcasterImplRef pRet;
+ vos::ORef< Broadcaster::Impl > pRet;
if (aChange.hasValidLocation())
{
if (bLocal)
{
- pRet = SingleChangeBroadcaster_Impl::create( NotifierData(rNotifierImpl,pTreeImpl), aChange.location);
+ pRet = SingleChangeBroadcaster_Impl::create( NotifierSet::value_type(rNotifierImpl,pTreeImpl), aChange.location);
}
else
{
- NotifierData aAffectedNotifier( findNotifier(aChange.location, pTreeImpl) );
+ NotifierSet::value_type aAffectedNotifier( findNotifier(aChange.location, pTreeImpl) );
if (aAffectedNotifier.second.is()) // only if we found a notifier we are able to create a broadcaster (DG)
pRet = SingleChangeBroadcaster_Impl::create( aAffectedNotifier, aChange.location);
}
@@ -985,17 +942,17 @@ namespace configmgr
}
if (pRet.isEmpty())
- pRet = EmptyBroadcaster_Impl::create( NotifierData(rNotifierImpl,pTreeImpl) );
+ pRet = EmptyBroadcaster_Impl::create( NotifierSet::value_type(rNotifierImpl,pTreeImpl) );
return pRet;
}
// ---------------------------------------------------------------------------------------------------
- BroadcasterImplRef Broadcaster::Impl::create(NotifierHolder const& rNotifierImpl, ApiTreeRef const& pTreeImpl, NodeChangesInformation const& aChanges, bool bLocal)
+ vos::ORef< Broadcaster::Impl > Broadcaster::Impl::create(vos::ORef<NotifierImpl> const& rNotifierImpl, ApiTreeRef const& pTreeImpl, configuration::NodeChangesInformation const& aChanges, bool bLocal)
{
- BroadcasterImplRef pRet;
+ vos::ORef< Broadcaster::Impl > pRet;
- NotifierData aRootData(rNotifierImpl, pTreeImpl);
+ NotifierSet::value_type aRootData(rNotifierImpl, pTreeImpl);
if (aChanges.size() == 1)
{
@@ -1028,27 +985,24 @@ namespace configmgr
}
// ---------------------------------------------------------------------------------------------------
- bool Broadcaster::Impl::translateChanges(NodeChangesInformation& _rInfos, NodeChanges const& aChanges, bool /*bSingleBase*/) const
+ bool Broadcaster::Impl::translateChanges(configuration::NodeChangesInformation& _rInfos, configuration::NodeChanges const& aChanges, bool /*bSingleBase*/) const
{
- TreeRef aBaseTree = m_aNotifierData.second->getTree();
+ rtl::Reference< configuration::Tree > aBaseTree = m_aNotifierData.second->getTree();
Factory& rFactory = m_aNotifierData.second->getFactory();
- NodeChangesInformation aRawInfos;
+ configuration::NodeChangesInformation aRawInfos;
sal_uInt32 nChanges = aChanges.getChangesInfos(aRawInfos);
OSL_ENSURE(nChanges, "Cannot get info(s) for change - skipping for notification");
OSL_ENSURE(nChanges == aRawInfos.size(), "Incorrect change count returned");
- NodeChangesInformation aNewInfos;
+ configuration::NodeChangesInformation aNewInfos;
aNewInfos.reserve(nChanges);
- // enabling the Single base optimization requires a base node (not only a base tree) for correct accessors
- //if (!bSingleBase || !configuration::equalTree(aBaseTree,aNewChange.info.baseTree))
-
- for (NodeChangesInformation::Iterator pos = aRawInfos.begin(); pos != aRawInfos.end(); ++pos)
+ for (std::vector< configuration::NodeChangeInformation >::const_iterator pos = aRawInfos.begin(); pos != aRawInfos.end(); ++pos)
{
- NodeChangeInformation aInfo = *pos;
+ configuration::NodeChangeInformation aInfo = *pos;
if( !configapi::rebaseChange(aInfo.location,aBaseTree) )
{
OSL_TRACE("Change is not within expected tree - skipping for notification");
@@ -1069,19 +1023,17 @@ namespace configmgr
// ---------------------------------------------------------------------------------------------------
- bool Broadcaster::Impl::translateChanges(NodeChangesInformation& aInfos, NodeChangesInformation const& aChanges, bool /*bSingleBase*/) const
+ bool Broadcaster::Impl::translateChanges(configuration::NodeChangesInformation& aInfos, configuration::NodeChangesInformation const& aChanges, bool /*bSingleBase*/) const
{
- NodeChangesInformation aNewInfos;
+ configuration::NodeChangesInformation aNewInfos;
aNewInfos.reserve( aChanges.size() );
- TreeRef aBaseTree = m_aNotifierData.second->getTree();
+ rtl::Reference< configuration::Tree > aBaseTree = m_aNotifierData.second->getTree();
Factory& rFactory = m_aNotifierData.second->getFactory();
- for (NodeChangesInformation::Iterator it = aChanges.begin(); it != aChanges.end(); ++it)
+ for (std::vector< configuration::NodeChangeInformation >::const_iterator it = aChanges.begin(); it != aChanges.end(); ++it)
{
- NodeChangeInformation aInfo(*it);
- // enabling the Single base optimization requires a base node (not only a base tree) for correct accessors
- //if (!bSingleBase || !configuration::equalTree(aBaseTree,aNewChange.info.baseTree))
+ configuration::NodeChangeInformation aInfo(*it);
if( !configapi::rebaseChange(aInfo.location,aBaseTree) )
{
OSL_TRACE("Change is not within expected tree - skipping for notification");
@@ -1102,33 +1054,33 @@ namespace configmgr
}
// ---------------------------------------------------------------------------------------------------
- void Broadcaster::Impl::notifyRootListeners(NodeChangesInformation const& aChanges)
+ void Broadcaster::Impl::notifyRootListeners(configuration::NodeChangesInformation const& aChanges)
{
if (aChanges.empty()) return;
ApiTreeRef pRootTree( m_aNotifierData.second->getRootTreeImpl() );
if (pRootTree.is())
{
- NotifierHolder aRootNotifier = BroadcasterHelper::getImpl(pRootTree->getNotifier());
+ vos::ORef<NotifierImpl> aRootNotifier = BroadcasterHelper::getImpl(pRootTree->getNotifier());
if (aRootNotifier.isValid())
{
uno::Reference< css::util::XChangesListener > const * const pSelect = 0;
- NodeID aNotifiedNode = makeRootID( pRootTree );
+ configuration::NodeID aNotifiedNode = makeRootID( pRootTree );
- if (ListenerContainer* pContainer = aRootNotifier->m_aListeners.getContainer(aNotifiedNode.toIndex(), ::getCppuType(pSelect)) )
+ if (cppu::OInterfaceContainerHelper* pContainer = aRootNotifier->m_aListeners.getContainer(aNotifiedNode.toIndex(), ::getCppuType(pSelect)) )
{
css::util::ChangesEvent aEvent;
aEvent.Source = pRootTree->getUnoInstance();
- UnoInterfaceRef xBaseInstance = m_aNotifierData.second->getUnoInstance();
+ uno::Reference<uno::XInterface> xBaseInstance = m_aNotifierData.second->getUnoInstance();
aEvent.Base <<= xBaseInstance;
// translate and collect the changes
aEvent.Changes.realloc(aChanges.size());
css::util::ElementChange* pChange = aEvent.Changes.getArray();
- for (NodeChangesInformation::Iterator it = aChanges.begin(); it != aChanges.end(); ++it)
+ for (std::vector< configuration::NodeChangeInformation >::const_iterator it = aChanges.begin(); it != aChanges.end(); ++it)
{
fillChangeFromResolved(*pChange, *it);
++pChange;
@@ -1148,25 +1100,25 @@ namespace configmgr
// ---------------------------------------------------------------------------------------------------
// class Broadcaster
// ---------------------------------------------------------------------------------------------------
-Broadcaster::Broadcaster(Notifier const& aNotifier, NodeChange const& aChange, bool bLocal)
+Broadcaster::Broadcaster(Notifier const& aNotifier, configuration::NodeChange const& aChange, bool bLocal)
: m_pImpl( Impl::create(aNotifier.m_aImpl,ApiTreeRef(aNotifier.m_pTree),aChange,bLocal) )
{
OSL_ASSERT(m_pImpl.isValid());
}
// ---------------------------------------------------------------------------------------------------
-Broadcaster::Broadcaster(Notifier const& aNotifier, NodeChanges const& aChanges, bool bLocal)
+Broadcaster::Broadcaster(Notifier const& aNotifier, configuration::NodeChanges const& aChanges, bool bLocal)
: m_pImpl( Impl::create(aNotifier.m_aImpl,ApiTreeRef(aNotifier.m_pTree),aChanges,bLocal) )
{
OSL_ASSERT(m_pImpl.isValid());
}
// ---------------------------------------------------------------------------------------------------
-Broadcaster::Broadcaster(Notifier const& aNotifier, NodeChangeInformation const& aChange, bool bLocal)
+Broadcaster::Broadcaster(Notifier const& aNotifier, configuration::NodeChangeInformation const& aChange, bool bLocal)
: m_pImpl( Impl::create(aNotifier.m_aImpl,ApiTreeRef(aNotifier.m_pTree),aChange,bLocal) )
{
OSL_ASSERT(m_pImpl.isValid());
}
// ---------------------------------------------------------------------------------------------------
-Broadcaster::Broadcaster(Notifier const& aNotifier, NodeChangesInformation const& aChanges, bool bLocal)
+Broadcaster::Broadcaster(Notifier const& aNotifier, configuration::NodeChangesInformation const& aChanges, bool bLocal)
: m_pImpl( Impl::create(aNotifier.m_aImpl,ApiTreeRef(aNotifier.m_pTree),aChanges,bLocal) )
{
OSL_ASSERT(m_pImpl.isValid());
@@ -1185,23 +1137,23 @@ Broadcaster::~Broadcaster()
}
// ---------------------------------------------------------------------------------------------------
-void Broadcaster::queryConstraints(NodeChange const& aChange) throw(beans::PropertyVetoException)
+void Broadcaster::queryConstraints(configuration::NodeChange const& aChange) throw(beans::PropertyVetoException)
{
OSL_ENSURE(aChange.isChange(),"Constraint query without a change !");
- NodeChanges aChanges;
+ configuration::NodeChanges aChanges;
aChanges.add(aChange);
this->queryConstraints(aChanges,true);
}
// ---------------------------------------------------------------------------------------------------
-void Broadcaster::queryConstraints(NodeChanges const& aChanges, bool bSingleBase) throw(beans::PropertyVetoException)
+void Broadcaster::queryConstraints(configuration::NodeChanges const& aChanges, bool bSingleBase) throw(beans::PropertyVetoException)
{
OSL_ENSURE(!aChanges.isEmpty(),"Constraint query without a change !");
try
{
- NodeChangesInformation aInfos;
+ configuration::NodeChangesInformation aInfos;
if (m_pImpl->translateChanges(aInfos,aChanges,bSingleBase))
{
m_pImpl->queryConstraints(aInfos);
@@ -1222,33 +1174,33 @@ void Broadcaster::queryConstraints(NodeChanges const& aChanges, bool bSingleBase
}
// ---------------------------------------------------------------------------------------------------
-void Broadcaster::notifyListeners(NodeChange const& aChange) throw()
+void Broadcaster::notifyListeners(configuration::NodeChange const& aChange) throw()
{
OSL_ENSURE(aChange.isChange(),"Notifying without a change !");
- NodeChanges aChanges;
+ configuration::NodeChanges aChanges;
aChanges.add(aChange);
this->notifyListeners(aChanges, true);
}
// ---------------------------------------------------------------------------------------------------
-void Broadcaster::notifyListeners(NodeChangeInformation const& aChange) throw()
+void Broadcaster::notifyListeners(configuration::NodeChangeInformation const& aChange) throw()
{
OSL_ENSURE(!aChange.isEmptyChange(),"Notifying without a change !");
- NodeChangesInformation aChanges;
+ configuration::NodeChangesInformation aChanges;
aChanges.push_back(aChange);
this->notifyListeners(aChanges, true);
}
// ---------------------------------------------------------------------------------------------------
-void Broadcaster::notifyListeners(NodeChanges const& aChanges, bool bSingleBase) throw()
+void Broadcaster::notifyListeners(configuration::NodeChanges const& aChanges, bool bSingleBase) throw()
{
OSL_ENSURE(!aChanges.isEmpty(),"Notifying without a change !");
try
{
- NodeChangesInformation aInfos;
+ configuration::NodeChangesInformation aInfos;
if (m_pImpl->translateChanges(aInfos,aChanges, bSingleBase))
{
m_pImpl->notifyListeners(aInfos);
@@ -1266,13 +1218,13 @@ void Broadcaster::notifyListeners(NodeChanges const& aChanges, bool bSingleBase)
}
// ---------------------------------------------------------------------------------------------------
-void Broadcaster::notifyListeners(NodeChangesInformation const& aChanges, bool bSingleBase) throw()
+void Broadcaster::notifyListeners(configuration::NodeChangesInformation const& aChanges, bool bSingleBase) throw()
{
OSL_ENSURE(!aChanges.empty(),"Notifying without a change !");
try
{
- NodeChangesInformation aInfos;
+ configuration::NodeChangesInformation aInfos;
if (m_pImpl->translateChanges(aInfos,aChanges, bSingleBase))
{
m_pImpl->notifyListeners(aInfos);
diff --git a/configmgr/source/api2/broadcaster.hxx b/configmgr/source/api2/broadcaster.hxx
index 70b37ec089..3923e05b44 100644
--- a/configmgr/source/api2/broadcaster.hxx
+++ b/configmgr/source/api2/broadcaster.hxx
@@ -48,11 +48,6 @@ namespace configmgr
// ---------------------------------------------------------------------------------------------------
namespace configapi
{
- using configuration::NodeChange;
- using configuration::NodeChanges;
- using configuration::NodeChangeInformation;
- using configuration::NodeChangesInformation;
-
class Notifier;
namespace css = ::com::sun::star;
@@ -63,26 +58,26 @@ namespace configmgr
{
public:
/// construct a broadcaster
- Broadcaster(Notifier const& aNotifier, NodeChange const& aChange, bool bLocal);
- Broadcaster(Notifier const& aNotifier, NodeChanges const& aChanges, bool bLocal);
- Broadcaster(Notifier const& aNotifier, NodeChangeInformation const& aChange, bool bLocal);
- Broadcaster(Notifier const& aNotifier, NodeChangesInformation const& aChanges, bool bLocal);
+ Broadcaster(Notifier const& aNotifier, configuration::NodeChange const& aChange, bool bLocal);
+ Broadcaster(Notifier const& aNotifier, configuration::NodeChanges const& aChanges, bool bLocal);
+ Broadcaster(Notifier const& aNotifier, configuration::NodeChangeInformation const& aChange, bool bLocal);
+ Broadcaster(Notifier const& aNotifier, configuration::NodeChangesInformation const& aChanges, bool bLocal);
Broadcaster(Broadcaster const& aOther);
~Broadcaster();
/// give all property veto listeners on the affected node a chance to veto
- void queryConstraints(NodeChange const& aChange) throw(css::beans::PropertyVetoException);
+ void queryConstraints(configuration::NodeChange const& aChange) throw(css::beans::PropertyVetoException);
/// give all property veto listeners on any of the affected nodes a chance to veto
- void queryConstraints(NodeChanges const& aChanges, bool bSingleBase = true) throw(css::beans::PropertyVetoException);
+ void queryConstraints(configuration::NodeChanges const& aChanges, bool bSingleBase = true) throw(css::beans::PropertyVetoException);
/// notify all listeners which are affected by this change
- void notifyListeners(NodeChange const& aChange) throw();
+ void notifyListeners(configuration::NodeChange const& aChange) throw();
/// notify all listeners which are affected by any of these changes (potentially from many different bases)
- void notifyListeners(NodeChanges const& aChanges, bool bSingleBase) throw();
+ void notifyListeners(configuration::NodeChanges const& aChanges, bool bSingleBase) throw();
/// notify all listeners which are affected by this change
- void notifyListeners(NodeChangeInformation const& aChange) throw();
+ void notifyListeners(configuration::NodeChangeInformation const& aChange) throw();
/// notify all listeners which are affected by any of these changes (potentially from many different bases)
- void notifyListeners(NodeChangesInformation const& aChanges, bool bSingleBase = false) throw();
+ void notifyListeners(configuration::NodeChangesInformation const& aChanges, bool bSingleBase = false) throw();
class Impl;
private:
diff --git a/configmgr/source/api2/committer.cxx b/configmgr/source/api2/committer.cxx
index 2f50df1c7e..ffbd3bebe6 100644
--- a/configmgr/source/api2/committer.cxx
+++ b/configmgr/source/api2/committer.cxx
@@ -33,9 +33,8 @@
#include <stdio.h>
#include "committer.hxx"
#include "apitreeimplobj.hxx"
+#include "providerimpl.hxx"
#include "roottree.hxx"
-#include "confproviderimpl2.hxx"
-#include "treeaccessor.hxx"
#include "treechangelist.hxx"
namespace configmgr
@@ -44,9 +43,6 @@ namespace configmgr
namespace configapi
{
//-----------------------------------------------------------------------------
- using configuration::Tree;
- using configuration::CommitHelper;
-//-----------------------------------------------------------------------------
namespace
{
//-------------------------------------------------------------------------
@@ -78,7 +74,7 @@ Committer::Committer(ApiRootTreeImpl& rTree)
{}
//-----------------------------------------------------------------------------
-ITreeManager* Committer::getUpdateProvider()
+OProviderImpl * Committer::getUpdateProvider()
{
return &m_rTree.getApiTree().getProvider().getProviderImpl();
}
@@ -95,18 +91,18 @@ void Committer::commit()
RequestOptions aOptions = m_rTree.getOptions()->getRequestOptions();
- ITreeManager* pUpdateProvider = getUpdateProvider();
+ OProviderImpl * pUpdateProvider = getUpdateProvider();
OSL_ASSERT(pUpdateProvider);
- Tree aTree( rApiTree.getTree());
- if (!aTree.hasChanges()) return;
+ rtl::Reference< configuration::Tree > aTree( rApiTree.getTree());
+ if (!aTree->hasChanges()) return;
TreeChangeList aChangeList(aOptions,
- aTree.getRootPath(),
- aTree.getAttributes(aTree.getRootNode()));
+ aTree->getRootPath(),
+ aTree->getAttributes(aTree->getRootNode()));
// now do the commit
- CommitHelper aHelper(rApiTree.getTree());
+ configuration::CommitHelper aHelper(rApiTree.getTree());
if (aHelper.prepareCommit(aChangeList))
try
{
diff --git a/configmgr/source/api2/committer.hxx b/configmgr/source/api2/committer.hxx
index 7917bc747c..88011297c3 100644
--- a/configmgr/source/api2/committer.hxx
+++ b/configmgr/source/api2/committer.hxx
@@ -33,7 +33,7 @@
namespace configmgr
{
- class ITreeManager;
+ class OProviderImpl;
//-----------------------------------------------------------------------------
namespace configapi
{
@@ -51,7 +51,7 @@ namespace configmgr
void commit();
private:
- ITreeManager* getUpdateProvider();
+ OProviderImpl * getUpdateProvider();
};
//-----------------------------------------------------------------------------
}
diff --git a/configmgr/source/api2/confignotifier.cxx b/configmgr/source/api2/confignotifier.cxx
index 9995835c06..59413e0f4c 100644
--- a/configmgr/source/api2/confignotifier.cxx
+++ b/configmgr/source/api2/confignotifier.cxx
@@ -52,16 +52,10 @@ namespace configmgr
namespace configapi
{
// ---------------------------------------------------------------------------------------------------
-
- using configuration::Tree;
- using configuration::NodeID;
- using configuration::SubNodeID;
-
-// ---------------------------------------------------------------------------------------------------
// class Notifier (-Impl)
// ---------------------------------------------------------------------------------------------------
-Notifier::Notifier(NotifierHolder const& aImpl,ApiTreeImpl const* pTree)
+Notifier::Notifier(vos::ORef<NotifierImpl> const& aImpl,ApiTreeImpl const* pTree)
: m_aImpl(aImpl)
, m_pTree(pTree)
{
@@ -82,21 +76,21 @@ Notifier::~Notifier()
}
// ---------------------------------------------------------------------------------------------------
-Broadcaster Notifier::makeBroadcaster(NodeChange const& aChange, bool bLocal) const
+Broadcaster Notifier::makeBroadcaster(configuration::NodeChange const& aChange, bool bLocal) const
{
return Broadcaster(*this,aChange,bLocal);
}
// ---------------------------------------------------------------------------------------------------
-Broadcaster Notifier::makeBroadcaster(NodeChanges const& aChanges, bool bLocal) const
+Broadcaster Notifier::makeBroadcaster(configuration::NodeChanges const& aChanges, bool bLocal) const
{
OSL_ENSURE(!aChanges.isEmpty(),"Creating broadcaster for no changes");
return Broadcaster(*this,aChanges,bLocal);
}
// ---------------------------------------------------------------------------------------------------
-NotifierImpl::NotifierImpl(configuration::TreeRef const& aTree)
-: m_aListeners(aTree.getContainedInnerNodeCount(), SubNodeToIndex(aTree))
+NotifierImpl::NotifierImpl(rtl::Reference< configuration::Tree > const& aTree)
+: m_aListeners(aTree->nodeCount(), SubNodeToIndex(aTree))
{
}
// ---------------------------------------------------------------------------------------------------
@@ -107,120 +101,120 @@ NotifierImpl::~NotifierImpl()
// ---------------------------------------------------------------------------------------------------
-void Notifier::add(NodeRef const& aNode, uno::Reference< css::lang::XEventListener > const& xListener) const
+void Notifier::add(configuration::NodeRef const& aNode, uno::Reference< css::lang::XEventListener > const& xListener) const
{
if (xListener.is())
- m_aImpl->add( NodeID(m_pTree->getTree(),aNode), xListener );
+ m_aImpl->add( configuration::NodeID(m_pTree->getTree(),aNode), xListener );
}
// ---------------------------------------------------------------------------------------------------
-void Notifier::add(NodeRef const& aNode, uno::Reference< css::container::XContainerListener > const& xListener) const
+void Notifier::add(configuration::NodeRef const& aNode, uno::Reference< css::container::XContainerListener > const& xListener) const
{
if (xListener.is())
- m_aImpl->add( NodeID(m_pTree->getTree(),aNode), xListener );
+ m_aImpl->add( configuration::NodeID(m_pTree->getTree(),aNode), xListener );
}
// ---------------------------------------------------------------------------------------------------
-void Notifier::add(NodeRef const& aNode, uno::Reference< css::util::XChangesListener > const& xListener) const
+void Notifier::add(configuration::NodeRef const& aNode, uno::Reference< css::util::XChangesListener > const& xListener) const
{
if (xListener.is())
- m_aImpl->add( NodeID(m_pTree->getTree(),aNode), xListener );
+ m_aImpl->add( configuration::NodeID(m_pTree->getTree(),aNode), xListener );
}
// ---------------------------------------------------------------------------------------------------
-void Notifier::addForAll(NodeRef const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener) const
+void Notifier::addForAll(configuration::NodeRef const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener) const
{
if (xListener.is())
- m_aImpl->addForAll( NodeID(m_pTree->getTree(),aNode), xListener );
+ m_aImpl->addForAll( configuration::NodeID(m_pTree->getTree(),aNode), xListener );
}
// ---------------------------------------------------------------------------------------------------
-void Notifier::addForOne(NodeRef const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener, Name const& aName) const
+void Notifier::addForOne(configuration::NodeRef const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener, rtl::OUString const& aName) const
{
if (xListener.is())
- m_aImpl->addNamed( SubNodeID(m_pTree->getTree(),aNode, aName), xListener );
+ m_aImpl->addNamed( configuration::SubNodeID(m_pTree->getTree(),aNode, aName), xListener );
}
// ---------------------------------------------------------------------------------------------------
-void Notifier::addForAll(NodeRef const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener) const
+void Notifier::addForAll(configuration::NodeRef const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener) const
{
if (xListener.is())
- m_aImpl->addForAll( NodeID(m_pTree->getTree(),aNode), xListener );
+ m_aImpl->addForAll( configuration::NodeID(m_pTree->getTree(),aNode), xListener );
}
// ---------------------------------------------------------------------------------------------------
-void Notifier::addForOne(NodeRef const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener, Name const& aName) const
+void Notifier::addForOne(configuration::NodeRef const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener, rtl::OUString const& aName) const
{
if (xListener.is())
- m_aImpl->addNamed( SubNodeID(m_pTree->getTree(),aNode, aName), xListener );
+ m_aImpl->addNamed( configuration::SubNodeID(m_pTree->getTree(),aNode, aName), xListener );
}
// ---------------------------------------------------------------------------------------------------
-void Notifier::add(NodeRef const& aNode, uno::Reference< css::beans::XPropertiesChangeListener > const& xListener, uno::Sequence<OUString> const& aNames) const
+void Notifier::add(configuration::NodeRef const& aNode, uno::Reference< css::beans::XPropertiesChangeListener > const& xListener, uno::Sequence<rtl::OUString> const& aNames) const
{
if (xListener.is())
{
if (aNames.getLength() > 0)
- m_aImpl->add( NodeID(m_pTree->getTree(),aNode), xListener, aNames);
+ m_aImpl->add( configuration::NodeID(m_pTree->getTree(),aNode), xListener, aNames);
else
- m_aImpl->add( NodeID(m_pTree->getTree(),aNode), xListener );
+ m_aImpl->add( configuration::NodeID(m_pTree->getTree(),aNode), xListener );
}
}
// ---------------------------------------------------------------------------------------------------
-void Notifier::remove(NodeRef const& aNode, uno::Reference< css::lang::XEventListener > const& xListener) const
+void Notifier::remove(configuration::NodeRef const& aNode, uno::Reference< css::lang::XEventListener > const& xListener) const
{
if (xListener.is())
- m_aImpl->remove( NodeID(m_pTree->getTree(),aNode), xListener );
+ m_aImpl->remove( configuration::NodeID(m_pTree->getTree(),aNode), xListener );
}
// ---------------------------------------------------------------------------------------------------
-void Notifier::remove(NodeRef const& aNode, uno::Reference< css::container::XContainerListener > const& xListener) const
+void Notifier::remove(configuration::NodeRef const& aNode, uno::Reference< css::container::XContainerListener > const& xListener) const
{
if (xListener.is())
- m_aImpl->remove( NodeID(m_pTree->getTree(),aNode), xListener );
+ m_aImpl->remove( configuration::NodeID(m_pTree->getTree(),aNode), xListener );
}
// ---------------------------------------------------------------------------------------------------
-void Notifier::remove(NodeRef const& aNode, uno::Reference< css::util::XChangesListener > const& xListener) const
+void Notifier::remove(configuration::NodeRef const& aNode, uno::Reference< css::util::XChangesListener > const& xListener) const
{
if (xListener.is())
- m_aImpl->remove( NodeID(m_pTree->getTree(),aNode), xListener );
+ m_aImpl->remove( configuration::NodeID(m_pTree->getTree(),aNode), xListener );
}
// ---------------------------------------------------------------------------------------------------
-void Notifier::removeForAll(NodeRef const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener) const
+void Notifier::removeForAll(configuration::NodeRef const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener) const
{
if (xListener.is())
- m_aImpl->removeForAll( NodeID(m_pTree->getTree(),aNode), xListener );
+ m_aImpl->removeForAll( configuration::NodeID(m_pTree->getTree(),aNode), xListener );
}
// ---------------------------------------------------------------------------------------------------
-void Notifier::removeForOne(NodeRef const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener, Name const& aName) const
+void Notifier::removeForOne(configuration::NodeRef const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener, rtl::OUString const& aName) const
{
if (xListener.is())
- m_aImpl->removeNamed( SubNodeID(m_pTree->getTree(),aNode, aName), xListener );
+ m_aImpl->removeNamed( configuration::SubNodeID(m_pTree->getTree(),aNode, aName), xListener );
}
// ---------------------------------------------------------------------------------------------------
-void Notifier::removeForAll(NodeRef const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener) const
+void Notifier::removeForAll(configuration::NodeRef const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener) const
{
if (xListener.is())
- m_aImpl->removeForAll( NodeID(m_pTree->getTree(),aNode), xListener );
+ m_aImpl->removeForAll( configuration::NodeID(m_pTree->getTree(),aNode), xListener );
}
// ---------------------------------------------------------------------------------------------------
-void Notifier::removeForOne(NodeRef const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener, Name const& aName) const
+void Notifier::removeForOne(configuration::NodeRef const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener, rtl::OUString const& aName) const
{
if (xListener.is())
- m_aImpl->removeNamed( SubNodeID(m_pTree->getTree(),aNode, aName), xListener );
+ m_aImpl->removeNamed( configuration::SubNodeID(m_pTree->getTree(),aNode, aName), xListener );
}
// ---------------------------------------------------------------------------------------------------
-void Notifier::remove(NodeRef const& aNode, uno::Reference< css::beans::XPropertiesChangeListener > const& xListener) const
+void Notifier::remove(configuration::NodeRef const& aNode, uno::Reference< css::beans::XPropertiesChangeListener > const& xListener) const
{
if (xListener.is())
- m_aImpl->remove( NodeID(m_pTree->getTree(),aNode), xListener );
+ m_aImpl->remove( configuration::NodeID(m_pTree->getTree(),aNode), xListener );
}
// ---------------------------------------------------------------------------------------------------
diff --git a/configmgr/source/api2/confignotifier.hxx b/configmgr/source/api2/confignotifier.hxx
index 01b1191568..bd1c121db2 100644
--- a/configmgr/source/api2/confignotifier.hxx
+++ b/configmgr/source/api2/confignotifier.hxx
@@ -33,7 +33,9 @@
#include "configexcept.hxx"
#include "configpath.hxx"
+#include "datalock.hxx"
#include "utility.hxx"
+#include <boost/utility.hpp>
#include <vos/ref.hxx>
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/uno/Sequence.hxx>
@@ -66,26 +68,14 @@ namespace configmgr
class ValueRef;
class NodeChange;
class NodeChanges;
-
- class Name;
-
- typedef uno::RuntimeException UnoError;
}
// ---------------------------------------------------------------------------------------------------
namespace configapi
{
- using configuration::NodeRef;
- using configuration::ValueRef;
- using configuration::NodeChange;
- using configuration::NodeChanges;
-
- using configuration::Name;
-
// ---------------------------------------------------------------------------------------------------
class Broadcaster;
class NotifierImpl;
class ApiTreeImpl;
- typedef vos::ORef<NotifierImpl> NotifierHolder;
namespace css = ::com::sun::star;
// ---------------------------------------------------------------------------------------------------
@@ -94,72 +84,72 @@ namespace configmgr
{
friend class Broadcaster;
friend class BroadcasterHelper;
- NotifierHolder m_aImpl;
+ vos::ORef<NotifierImpl> m_aImpl;
ApiTreeImpl const*const m_pTree;
public:
/// construct this around the given Implementation, for the given tree
- explicit Notifier(NotifierHolder const & aImpl, ApiTreeImpl const* pTree);
+ explicit Notifier(vos::ORef<NotifierImpl> const & aImpl, ApiTreeImpl const* pTree);
Notifier(Notifier const& aOther);
~Notifier();
// ---------------------------------------------------------------------------------------------------
/// create a broadcaster for a single change (either local or (possibly) nested)
- Broadcaster makeBroadcaster(NodeChange const& aChange, bool bLocal) const;
+ Broadcaster makeBroadcaster(configuration::NodeChange const& aChange, bool bLocal) const;
/// create a broadcaster for a collection of changes (either local or (possibly) nested)
- Broadcaster makeBroadcaster(NodeChanges const& aChange, bool bLocal) const;
+ Broadcaster makeBroadcaster(configuration::NodeChanges const& aChange, bool bLocal) const;
// ---------------------------------------------------------------------------------------------------
bool checkAlive(uno::XInterface* pObject) const throw(css::lang::DisposedException);
// ---------------------------------------------------------------------------------------------------
/// Add a <type scope='com::sun::star::lang'>XEventListener</type> observing <var>aNode</var>.
- void add(NodeRef const& aNode, uno::Reference< css::lang::XEventListener > const& xListener) const;
+ void add(configuration::NodeRef const& aNode, uno::Reference< css::lang::XEventListener > const& xListener) const;
/// Add a <type scope='com::sun::star::container'>XContainerListener</type> observing <var>aNode</var>.
- void add(NodeRef const& aNode, uno::Reference< css::container::XContainerListener > const& xListener) const;
+ void add(configuration::NodeRef const& aNode, uno::Reference< css::container::XContainerListener > const& xListener) const;
/// Add a <type scope='com::sun::star::util'>XChangesListener</type> observing <var>aNode</var> and its descendants.
- void add(NodeRef const& aNode, uno::Reference< css::util::XChangesListener > const& xListener) const;
+ void add(configuration::NodeRef const& aNode, uno::Reference< css::util::XChangesListener > const& xListener) const;
/// Add a <type scope='com::sun::star::beans'>XPropertyChangeListener</type> observing all children of <var>aNode</var>.
- void addForAll(NodeRef const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener) const;
+ void addForAll(configuration::NodeRef const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener) const;
/// Add a <type scope='com::sun::star::beans'>XPropertyChangeListener</type> observing only the child named <var>aName</var> of <var>aNode</var>.
- void addForOne(NodeRef const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener, Name const& aName) const;
+ void addForOne(configuration::NodeRef const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener, rtl::OUString const& aName) const;
/// Add a <type scope='com::sun::star::beans'>XVetoableChangeListener</type> constraining all children of <var>aNode</var>.
- void addForAll(NodeRef const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener) const;
+ void addForAll(configuration::NodeRef const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener) const;
/// Add a <type scope='com::sun::star::beans'>XVetoableChangeListener</type> constraining only the child named <var>aName</var> of <var>aNode</var>.
- void addForOne(NodeRef const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener, Name const& aName) const;
+ void addForOne(configuration::NodeRef const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener, rtl::OUString const& aName) const;
/** Add a <type scope='com::sun::star::beans'>XPropertiesChangeListener</type>
observing the properties of <var>aNode</var> (optimally only those given by <var>aNames</var>.
*/
- void add(NodeRef const& aNode, uno::Reference< css::beans::XPropertiesChangeListener > const& xListener, uno::Sequence<OUString> const& aNames) const;
+ void add(configuration::NodeRef const& aNode, uno::Reference< css::beans::XPropertiesChangeListener > const& xListener, uno::Sequence<rtl::OUString> const& aNames) const;
// ---------------------------------------------------------------------------------------------------
/// Remove a <type scope='com::sun::star::lang'>XEventListener</type> observing <var>aNode</var>.
- void remove(NodeRef const& aNode, uno::Reference< css::lang::XEventListener > const& xListener) const;
+ void remove(configuration::NodeRef const& aNode, uno::Reference< css::lang::XEventListener > const& xListener) const;
/// Remove a <type scope='com::sun::star::container'>XContainerListener</type> observing <var>aNode</var>.
- void remove(NodeRef const& aNode, uno::Reference< css::container::XContainerListener > const& xListener) const;
+ void remove(configuration::NodeRef const& aNode, uno::Reference< css::container::XContainerListener > const& xListener) const;
/// Remove a <type scope='com::sun::star::util'>XChangesListener</type> observing <var>aNode</var> and its descendants.
- void remove(NodeRef const& aNode, uno::Reference< css::util::XChangesListener > const& xListener) const;
+ void remove(configuration::NodeRef const& aNode, uno::Reference< css::util::XChangesListener > const& xListener) const;
/// Remove a <type scope='com::sun::star::beans'>XPropertyChangeListener</type> observing <var>aNode</var>.
- void removeForAll(NodeRef const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener) const;
+ void removeForAll(configuration::NodeRef const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener) const;
/// Remove a <type scope='com::sun::star::beans'>XPropertyChangeListener</type> observing the child named <var>aName</var> of <var>aNode</var>.
- void removeForOne(NodeRef const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener, Name const& aName) const;
+ void removeForOne(configuration::NodeRef const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener, rtl::OUString const& aName) const;
/// Remove a <type scope='com::sun::star::beans'>XVetoableChangeListener</type> constraining <var>aNode</var>.
- void removeForAll(NodeRef const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener) const;
+ void removeForAll(configuration::NodeRef const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener) const;
/// Remove a <type scope='com::sun::star::beans'>XVetoableChangeListener</type> constraining the child named <var>aName</var> of <var>aNode</var>.
- void removeForOne(NodeRef const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener, Name const& aName) const;
+ void removeForOne(configuration::NodeRef const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener, rtl::OUString const& aName) const;
/// Remove a <type scope='com::sun::star::beans'>XVetoableChangeListener</type> constraining <var>aNode</var>.
- void remove(NodeRef const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener) const;
+ void remove(configuration::NodeRef const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener) const;
/** Remove a <type scope='com::sun::star::beans'>XPropertiesChangeListener</type>
observing any properties of <var>aNode</var>.
*/
- void remove(NodeRef const& aNode, uno::Reference< css::beans::XPropertiesChangeListener > const& xListener) const;
+ void remove(configuration::NodeRef const& aNode, uno::Reference< css::beans::XPropertiesChangeListener > const& xListener) const;
// ---------------------------------------------------------------------------------------------------
private:
void operator=(Notifier const& aOther);
@@ -172,7 +162,7 @@ namespace configmgr
class TreeElement;
/// guards a NodeAccess; provides a simple lock for non-data access, does not check for disposed state
- class DisposeGuardImpl : Noncopyable
+ class DisposeGuardImpl: private boost::noncopyable
{
public:
DisposeGuardImpl(Notifier const& rNotifier) throw();
diff --git a/configmgr/source/api2/confprovider2.cxx b/configmgr/source/api2/confprovider2.cxx
deleted file mode 100644
index 02df33ee31..0000000000
--- a/configmgr/source/api2/confprovider2.cxx
+++ /dev/null
@@ -1,607 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: confprovider2.cxx,v $
- * $Revision: 1.33 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://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 "confprovider2.hxx"
-#include "apiaccessobj.hxx"
-#include "confproviderimpl2.hxx"
-#ifndef CONFIGMGR_API_FACTORY_HXX_
-#include "confapifactory.hxx"
-#endif
-#include "bootstrap.hxx"
-#include "bootstrapcontext.hxx"
-#include "wrapexception.hxx"
-#include "tracer.hxx"
-#include <osl/mutex.hxx>
-#include <rtl/ustrbuf.hxx>
-#ifndef INCLUDED_ALGORITHM
-#include <algorithm>
-#define INCLUDED_ALGORITHM
-#endif
-#include <comphelper/sequence.hxx>
-#include <cppuhelper/typeprovider.hxx>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/lang/ServiceNotRegisteredException.hpp>
-
-#define THISREF() static_cast< ::cppu::OWeakObject* >(this)
-
-namespace configmgr
-{
- namespace css = ::com::sun::star;
- namespace uno = css::uno;
- namespace lang = css::lang;
- namespace beans = css::beans;
- using ::rtl::OUString;
- using ::vos::ORef;
- using namespace osl;
-
- namespace
- {
- //------------------------------------------------------------------------
- AsciiServiceName const aConfigProviderServices[] =
- {
- "com.sun.star.configuration.ConfigurationProvider",
- 0
- };
- AsciiServiceName const aAdminProviderServices[] =
- {
- "com.sun.star.configuration.AdministrationProvider",
- 0
- };
- //------------------------------------------------------------------------
-
- ServiceImplementationInfo const aConfigProviderInfo =
- {
- "com.sun.star.comp.configuration.ConfigurationProvider",
- aConfigProviderServices,
- 0
- };
- ServiceImplementationInfo const aAdminProviderInfo =
- {
- "com.sun.star.comp.configuration.AdministrationProvider",
- aAdminProviderServices,
- aConfigProviderServices
- };
- //------------------------------------------------------------------------
-
- AsciiServiceName const
- aDefaultProviderServiceAndImplName = A_DefaultProviderServiceAndImplName;
-
- //------------------------------------------------------------------------
-
- AsciiServiceName const aDefaultProviderServices[] =
- {
- aDefaultProviderServiceAndImplName,
- 0
- };
- //------------------------------------------------------------------------
-
- ServiceRegistrationInfo const aDefaultProviderInfo =
- {
- aDefaultProviderServiceAndImplName,
- aDefaultProviderServices
- };
- SingletonRegistrationInfo const aDefaultProviderSingletonInfo =
- {
- A_DefaultProviderSingletonName,
- aDefaultProviderServiceAndImplName,
- aDefaultProviderServiceAndImplName,
- 0
- };
- //------------------------------------------------------------------------
- typedef uno::Reference< uno::XInterface > (OConfigurationProviderImpl::*CreatorFunc)(const uno::Sequence< uno::Any >& aArguments);
- struct ServiceCreationInfo
- {
- ServiceRegistrationInfo const* info;
- CreatorFunc create;
- };
-
- static sal_Int32 getCreateServiceDataCount()
- {
- return 2;
- }
-
- static const ServiceCreationInfo* getCreateServiceData()
- {
- static ServiceCreationInfo const createServiceData[] =
- {
- { &configapi::aCreateReadAccessSI, &OConfigurationProviderImpl::createReadAccess },
- { &configapi::aCreateUpdateAccessSI, &OConfigurationProviderImpl::createUpdateAccess },
- };
- OSL_ENSURE(sizeof(createServiceData)/sizeof(createServiceData[0]) == getCreateServiceDataCount(),
- "getCreateServiceData : inconsistent data !");
- return createServiceData;
- }
- //------------------------------------------------------------------------
- }
-
- static ServiceCreationInfo const* findCreationInfo( const OUString& aServiceSpecifier )
- {
- for (int i= 0; i<getCreateServiceDataCount(); ++i)
- {
- ServiceCreationInfo const& rCreationInfo = getCreateServiceData()[i];
-
- ServiceRegistrationInfo const* pInfo = rCreationInfo.info;
- if (!pInfo)
- continue;
-
- if (AsciiServiceName pImplName = pInfo->implementationName)
- {
- if (0 == aServiceSpecifier.compareToAscii(pImplName))
- return &rCreationInfo;
- }
-
- if (AsciiServiceName const* pNames = pInfo->registeredServiceNames)
- {
- while(*pNames)
- {
- if (0 == aServiceSpecifier.compareToAscii(*pNames))
- return &rCreationInfo;
-
- ++pNames;
- }
- }
- }
- // not found
- return 0;
- }
-
- //#define ID_PREFETCH 1
- static const int ID_PREFETCH=1;
- static const int ID_ENABLEASYNC=2;
-
- static inline
- OUString getPrefetchPropName() { return OUString( RTL_CONSTASCII_USTRINGPARAM("PrefetchNodes") ); }
- static inline
- OUString getEnableAsyncPropName() { return OUString( RTL_CONSTASCII_USTRINGPARAM("EnableAsync") ); }
- //=============================================================================
- //= OConfigurationProvider
- //=============================================================================
- // service info export
- const ServiceRegistrationInfo* getConfigurationProviderServiceInfo()
- {
- return getRegistrationInfo(&aConfigProviderInfo);
- }
-
- const ServiceRegistrationInfo* getAdminProviderServiceInfo()
- {
- return getRegistrationInfo(&aAdminProviderInfo);
- }
-
- const ServiceRegistrationInfo* getDefaultProviderServiceInfo()
- {
- return &aDefaultProviderInfo;
- }
-
- const SingletonRegistrationInfo* getDefaultProviderSingletonInfo()
- {
- return &aDefaultProviderSingletonInfo;
- }
-
- //-----------------------------------------------------------------------------
- uno::Reference<uno::XInterface> SAL_CALL
- getDefaultConfigProviderSingleton( CreationContext const& xContext )
- {
- OSL_ENSURE( xContext.is(), "ERROR: NULL context has no singletons" );
-
- UnoContextTunnel aTunnel;
- aTunnel.passthru( xContext );
-
- uno::Reference<uno::XInterface> xResult;
-
- if (xContext.is())
- try
- {
- OUString aSingletonName = SINGLETON(A_DefaultProviderSingletonName);
- uno::Any aResult = xContext->getValueByName(aSingletonName);
- aResult >>= xResult;
- }
- catch (uno::Exception & )
- {
- // to do: really use the tunneled failure when that is set properly
- if ( aTunnel.recoverFailure(true).hasValue() )
- {
- // have a failure, but can't recover it
- // -> try to regenerate
- instantiateDefaultProvider(xContext);
-
- OSL_ENSURE(false, "Cannot recreate configuration backend instantiation failure - using generic error");
- }
- // cannot recover any failure
- throw;
- }
-
- return xResult;
- }
- // ------------------------------------------------------------------------
- // ----------------------------------------------------------------------------
- #define TUNNEL_ALL_EXCEPTIONS() \
- WRAP_CONFIGBACKEND_CREATION_EXCEPTIONS1( UnoContextTunnel::tunnelFailure, true)
-
- // ----------------------------------------------------------------------------
- // ------------------------------------------------------------------------
-
- uno::Reference< uno::XInterface > SAL_CALL instantiateDefaultProvider( OProvider::CreationContext const & xTargetContext )
- {
- CreationContext xContext = UnoContextTunnel::recoverContext(xTargetContext);
-
- ServiceImplementationInfo const * pProviderInfo =
- ContextReader::testAdminService(xContext,true) ? &aAdminProviderInfo : &aConfigProviderInfo;
-
- OConfigurationProvider* pNewProvider = new OConfigurationProvider(xContext,pProviderInfo);
- uno::Reference< lang::XMultiServiceFactory > aRet( pNewProvider );
-
- try
- {
- pNewProvider->connect();
- }
- TUNNEL_ALL_EXCEPTIONS()
-
- return uno::Reference< uno::XInterface >( aRet, uno::UNO_QUERY );
- }
-
- //-----------------------------------------------------------------------------
- //-----------------------------------------------------------------------------
- //-----------------------------------------------------------------------------
- OConfigurationProvider::OConfigurationProvider(
- CreationContext const & xContext,
- const ServiceImplementationInfo* pServices
- )
- :OProvider(xContext,pServices)
- ,m_pImpl(NULL)
- ,m_bEnableAsync(false)
- {
- registerProperty(getPrefetchPropName(), ID_PREFETCH, 0,&m_aPrefetchNodes, ::getCppuType(&m_aPrefetchNodes));
- registerProperty(getEnableAsyncPropName(), ID_ENABLEASYNC, 0, &m_bEnableAsync, ::getBooleanCppuType());
- }
-
- //-----------------------------------------------------------------------------
- OConfigurationProvider::~OConfigurationProvider()
- {
- delete m_pImpl;
- }
-
- //-----------------------------------------------------------------------------
- void OConfigurationProvider::connect() throw (uno::Exception)
- {
- OSL_ENSURE( m_pImpl == NULL, "Error: Configuration Provider already is connected");
-
- std::auto_ptr<OConfigurationProviderImpl> pNewImpl( new OConfigurationProviderImpl(this, m_xContext) );
-
- implConnect(*pNewImpl,ContextReader(m_xContext));
-
- m_pImpl = pNewImpl.release();
- if (m_pImpl)
- {
- sal_Bool isEnabled = m_pImpl->getDefaultOptions().isAsyncEnabled();
- this->setPropertyValue( getEnableAsyncPropName(), uno::makeAny(isEnabled) );
- }
- }
-
- //-----------------------------------------------------------------------------
- void SAL_CALL OConfigurationProvider::disposing()
- {
- UnoApiLock aLock;
-
- if (m_pImpl)
- m_pImpl->dispose();
-
- OProvider::disposing();
- }
-
- //-----------------------------------------------------------------------------
- uno::Reference< uno::XInterface > SAL_CALL OConfigurationProvider::createInstance( const OUString& aServiceSpecifier )
- throw(uno::Exception, uno::RuntimeException)
- {
- UnoApiLock aLock;
- // same as creating with empty sequence of arguments
- return this->createInstanceWithArguments( aServiceSpecifier, uno::Sequence< uno::Any >() );
- }
-
- //-----------------------------------------------------------------------------
- uno::Reference< uno::XInterface > SAL_CALL
- OConfigurationProvider::createInstanceWithArguments( const OUString& aServiceSpecifier, const uno::Sequence< uno::Any >& aArguments )
- throw(uno::Exception, uno::RuntimeException)
- {
- UnoApiLock aLock;
-
- OSL_ENSURE(m_pImpl, "OConfigurationProvider: no implementation available");
-
- if (ServiceCreationInfo const* pInfo = findCreationInfo(aServiceSpecifier))
- {
- // it's a known service name - try to create without args
- if (CreatorFunc create = pInfo->create)
- {
- return (m_pImpl->*create)(aArguments);
- }
- }
-
- rtl::OUStringBuffer sMsg;
- sMsg.appendAscii("ConfigurationProvider: Cannot create view - ");
- sMsg.append( aServiceSpecifier ) .appendAscii(" is not a valid configuration access service. ");
-
- throw lang::ServiceNotRegisteredException(sMsg.makeStringAndClear(),*this);
- }
-
- //-----------------------------------------------------------------------------
- uno::Sequence< OUString > SAL_CALL OConfigurationProvider::getAvailableServiceNames( )
- throw(uno::RuntimeException)
- {
- UnoApiLock aLock;
-
- sal_Int32 nCount = 0;
- {
- for (int i= 0; i< getCreateServiceDataCount(); ++i)
- nCount += countServices(getCreateServiceData()[i].info);
- }
-
- uno::Sequence< OUString > aNames(nCount);
- if (nCount > 0)
- {
- sal_Int32 n = 0;
- for (int i= 0; i<getCreateServiceDataCount(); ++i)
- {
- ServiceRegistrationInfo const* pInfo = getCreateServiceData()[i].info;
- AsciiServiceName const* pNames = pInfo ? pInfo->registeredServiceNames : 0;
-
- if (pNames)
- {
- while(*pNames)
- {
- aNames[n] = OUString::createFromAscii(*pNames);
- ++n;
- ++pNames;
- }
- }
- }
- }
-
- return aNames;
- }
-
- // XLocalizable
- //-----------------------------------------------------------------------------
- void SAL_CALL OConfigurationProvider::setLocale( const lang::Locale& eLocale )
- throw (uno::RuntimeException)
- {
- UnoApiLock aLock;
-
- OSL_ENSURE(m_pImpl, "OConfigurationProvider: no implementation available");
-
- m_pImpl->setDefaultLocale( eLocale );
- }
-
- //-----------------------------------------------------------------------------
- lang::Locale SAL_CALL OConfigurationProvider::getLocale()
- throw (uno::RuntimeException)
- {
- UnoApiLock aLock;
-
- OSL_ENSURE(m_pImpl, "OConfigurationProvider: no implementation available");
-
- return m_pImpl->getDefaultOptions().getUnoLocale();
- }
-
- //XRefreshable
- //-----------------------------------------------------------------------------
- void SAL_CALL OConfigurationProvider::refresh()
- throw (uno::RuntimeException)
- {
- UnoApiLock aLock;
-
- OSL_ENSURE(m_pImpl, "OConfigurationProvider: no implementation available");
-
- try
- {
- m_pImpl->refreshAll();
- }
- catch (uno::RuntimeException& ) { throw; }
- catch (uno::Exception& e)
- {
- // FIXME: use getCaughtException()
- throw lang::WrappedTargetRuntimeException(e.Message, *this, uno::makeAny(e));
- }
- //Broadcast the changes
- uno::Reference< css::util::XRefreshListener > const * const pRefresh = 0;
- cppu::OInterfaceContainerHelper * aInterfaceContainer=
- getBroadcastHelper().getContainer (::getCppuType(pRefresh));
-
- if(aInterfaceContainer)
- {
- lang::EventObject aEventObject(*this);
-
- cppu::OInterfaceIteratorHelper aIterator(*aInterfaceContainer);
- while(aIterator.hasMoreElements())
- {
- uno::Reference< uno::XInterface > xIface = aIterator.next();
- uno::Reference< util::XRefreshListener > xRefresh (xIface, uno::UNO_QUERY);
- if (xRefresh.is())
- {
- xRefresh->refreshed(aEventObject);
- }
- }
- }
- }
- //-----------------------------------------------------------------------------
- void SAL_CALL OConfigurationProvider::addRefreshListener(
- const uno::Reference< util::XRefreshListener >& aListener )
- throw (uno::RuntimeException)
- {
- UnoApiLock aLock;
- getBroadcastHelper().addListener(::getCppuType(&aListener), aListener);
- }
- //-----------------------------------------------------------------------------
- void SAL_CALL OConfigurationProvider::removeRefreshListener(
- const uno::Reference< util::XRefreshListener >& aListener )
- throw (uno::RuntimeException)
- {
- UnoApiLock aLock;
- getBroadcastHelper().removeListener(::getCppuType(&aListener), aListener);
- }
- //XFlushable
- //-----------------------------------------------------------------------------
- void SAL_CALL OConfigurationProvider::flush( )
- throw (uno::RuntimeException)
- {
- UnoApiLock aLock;
- OSL_ENSURE(m_pImpl, "OConfigurationProvider: no implementation available");
- m_pImpl->flushAll();
-
- //Broadcast the changes
- uno::Reference< css::util::XFlushListener > const * const pFlush = 0;
- cppu::OInterfaceContainerHelper * aInterfaceContainer=
- getBroadcastHelper().getContainer(::getCppuType(pFlush));
-
- if(aInterfaceContainer)
- {
- lang::EventObject aEventObject(*this);
-
- cppu::OInterfaceIteratorHelper aIterator(*aInterfaceContainer);
- while(aIterator.hasMoreElements())
- {
- uno::Reference< uno::XInterface > xIface = aIterator.next();
- uno::Reference< util::XFlushListener > xFlush (xIface, uno::UNO_QUERY);
- if (xFlush.is())
- {
- xFlush->flushed(aEventObject);
- }
- }
- }
- }
- //-----------------------------------------------------------------------------
- void SAL_CALL OConfigurationProvider::addFlushListener(
- const uno::Reference< util::XFlushListener >& aListener )
- throw (uno::RuntimeException)
- {
- UnoApiLock aLock;
- getBroadcastHelper().addListener(::getCppuType(&aListener), aListener);
- }
- //-----------------------------------------------------------------------------
- void SAL_CALL OConfigurationProvider::removeFlushListener(
- const uno::Reference< util::XFlushListener >& aListener )
- throw (uno::RuntimeException)
- {
- UnoApiLock aLock;
- getBroadcastHelper().removeListener(::getCppuType(&aListener), aListener);
- }
- // XInterface
- //-----------------------------------------------------------------------------
- ::com::sun::star::uno::Any SAL_CALL OConfigurationProvider::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException)
- {
- UnoApiLock aLock;
- uno::Any aRet( OProvider::queryInterface(rType) );
- if ( !aRet.hasValue() )
- aRet = queryPropertyInterface(rType);
- return aRet;
- }
-
- //XTypeProvider
- //-----------------------------------------------------------------------------
- ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL OConfigurationProvider::getTypes( ) throw(::com::sun::star::uno::RuntimeException)
- {
- cppu::OTypeCollection aCollection(::getCppuType( (const uno::Reference< beans::XPropertySet > *)0 ),
- ::getCppuType( (const uno::Reference< beans::XFastPropertySet > *)0 ),
- ::getCppuType( (const uno::Reference< beans::XMultiPropertySet > *)0 ),
- OProvider::getTypes());
- return aCollection.getTypes();
- }
-
- // OPropertyArrayUsageHelper
- // -------------------------------------------------------------------------
- ::cppu::IPropertyArrayHelper* OConfigurationProvider::createArrayHelper( ) const
- {
- UnoApiLock aLock;
- uno::Sequence< beans::Property > aProps;
- describeProperties(aProps);
- return new ::cppu::OPropertyArrayHelper(aProps);
- }
- // -------------------------------------------------------------------------
- ::cppu::IPropertyArrayHelper & OConfigurationProvider::getInfoHelper()
- {
- UnoApiLock aLock;
- return *const_cast<OConfigurationProvider*>(this)->getArrayHelper();
- }
-
- //-----------------------------------------------------------------------------
-
-
- void SAL_CALL OConfigurationProvider::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue)
- throw (::com::sun::star::uno::Exception)
- {
- UnoApiLock aLock;
-
- OProvider::setFastPropertyValue_NoBroadcast( nHandle, rValue );
-
- switch(nHandle)
- {
- case ID_PREFETCH:
- {
- uno::Sequence< OUString > aNodeList;
- rValue >>= aNodeList;
-
- RequestOptions const aOptions = m_pImpl->getDefaultOptions();
-
- for (sal_Int32 i = 0; i < aNodeList.getLength(); i++)
- {
- using namespace configuration;
- AbsolutePath aModulePath = AbsolutePath::makeModulePath(aNodeList[i], AbsolutePath::NoValidate());
- m_pImpl->fetchSubtree(aModulePath , aOptions);
- }
- }break;
-
- case ID_ENABLEASYNC:
- {
- //Forward to TreeManager
- sal_Bool bAsync;
- if (rValue >>= bAsync)
- {
- m_pImpl->enableAsync(bAsync);
- if (!bAsync)
- this->flush();
- }
- else
- OSL_ENSURE(false, "Unexpected type of new property value");
- }
- break;
- default:
- {
- OSL_ENSURE(false, "OConfigurationProvider::setFastPropertyValue_NoBroadcast -unknown property");
- }
-
- }
- }
-
-
-} // namespace configmgr
-
-
diff --git a/configmgr/source/api2/confprovider2.hxx b/configmgr/source/api2/confprovider2.hxx
deleted file mode 100644
index 640de42e21..0000000000
--- a/configmgr/source/api2/confprovider2.hxx
+++ /dev/null
@@ -1,141 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: confprovider2.hxx,v $
- * $Revision: 1.9 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONFIGMGR_API_CONFPROVIDER2_HXX_
-#define CONFIGMGR_API_CONFPROVIDER2_HXX_
-
-#include "provider.hxx"
-#include <comphelper/proparrhlp.hxx>
-
-
-namespace configmgr
-{
- namespace css = ::com::sun::star;
- namespace uno = css::uno;
- namespace lang = css::lang;
- using ::rtl::OUString;
- using ::vos::ORef;
-
- class OConfigurationProviderImpl;
-
- //==========================================================================
- //= OConfigurationProvider
- //==========================================================================
- /** Factory for receiving access for user configuration data. */
- class OConfigurationProvider : public OProvider
- , public ::comphelper::OPropertyArrayUsageHelper<OConfigurationProvider>
- {
- OConfigurationProviderImpl* m_pImpl;
- uno::Sequence< ::rtl::OUString > m_aPrefetchNodes;
- sal_Bool m_bEnableAsync;
-
- public:
- OConfigurationProvider(CreationContext const & xContext, ServiceImplementationInfo const* pServices);
- void connect() throw (uno::Exception);
-
- public:
- ~OConfigurationProvider();
-
- /// XMultiServiceFactory
- virtual uno::Reference< uno::XInterface > SAL_CALL
- createInstance( const OUString& aServiceSpecifier )
- throw(uno::Exception, uno::RuntimeException);
-
- virtual uno::Reference< uno::XInterface > SAL_CALL
- createInstanceWithArguments( const ::rtl::OUString& ServiceSpecifier, const uno::Sequence< uno::Any >& Arguments )
- throw(uno::Exception, uno::RuntimeException);
-
- virtual uno::Sequence< OUString > SAL_CALL
- getAvailableServiceNames( )
- throw(uno::RuntimeException);
-
- /// XLocalizable
- virtual void SAL_CALL
- setLocale( const lang::Locale& eLocale )
- throw (uno::RuntimeException);
-
- virtual lang::Locale SAL_CALL
- getLocale( )
- throw (uno::RuntimeException);
-
-
- //XRefreshable
- virtual void SAL_CALL
- refresh( )
- throw (uno::RuntimeException);
- virtual void SAL_CALL
- addRefreshListener(
- const uno::Reference< util::XRefreshListener >& aListener )
- throw (uno::RuntimeException);
- virtual void SAL_CALL
- removeRefreshListener(
- const uno::Reference< util::XRefreshListener >& aListener )
- throw (uno::RuntimeException);
- //XFlushable
- virtual void SAL_CALL
- flush( )
- throw (uno::RuntimeException);
- virtual void SAL_CALL
- addFlushListener(
- const uno::Reference< util::XFlushListener >& aListener )
- throw (uno::RuntimeException);
- virtual void SAL_CALL
- removeFlushListener(
- const uno::Reference< util::XFlushListener >& aListener )
- throw (uno::RuntimeException);
-
- // OPropertSetHelper
- virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
- sal_Int32 nHandle,
- const ::com::sun::star::uno::Any& rValue
- )
- throw (::com::sun::star::uno::Exception);
-
- // XInterface
- virtual uno::Any SAL_CALL queryInterface( const uno::Type & rType ) throw(uno::RuntimeException);
- //XTypeProvider
- virtual uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw(uno::RuntimeException);
-
- protected:
- using OProvider::disposing;
- virtual void SAL_CALL disposing();
-
- // OPropertyArrayUsageHelper
- virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
-
- // OPropertySetHelper
- virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
- };
-
-
-} // namespace configmgr
-
-#endif // CONFIGMGR_API_CONFPROVIDER2_HXX_
-
-
diff --git a/configmgr/source/api2/confproviderimpl2.cxx b/configmgr/source/api2/confproviderimpl2.cxx
deleted file mode 100644
index 0a518e9045..0000000000
--- a/configmgr/source/api2/confproviderimpl2.cxx
+++ /dev/null
@@ -1,132 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: confproviderimpl2.cxx,v $
- * $Revision: 1.33 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://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 "confproviderimpl2.hxx"
-#include "roottree.hxx"
-#include "noderef.hxx"
-#include "apitreeaccess.hxx"
-#include "objectregistry.hxx"
-#include "configexcept.hxx"
-#ifndef CONFIGMGR_API_PROVIDER2_HXX_
-#include "confprovider2.hxx"
-#endif
-#include "treeprovider.hxx"
-#include "tracer.hxx"
-#include <com/sun/star/beans/PropertyValue.hpp>
-
-namespace configmgr
-{
- namespace css = ::com::sun::star;
- namespace uno = css::uno;
- namespace beans = css::beans;
-
- using ::rtl::OUString;
-
- using configapi::NodeElement;
- using configuration::RootTree;
-
- //=============================================================================
- //= OConfigurationProviderImpl
- //=============================================================================
- //-----------------------------------------------------------------------------------
- OConfigurationProviderImpl::OConfigurationProviderImpl(OConfigurationProvider* _pProvider, CreationContext const & xContext)
- :OProviderImpl(_pProvider, xContext)
- {
- }
- //--------------------------------------------------------------------------
- uno::Reference<uno::XInterface> OConfigurationProviderImpl::createReadAccess( uno::Sequence<uno::Any> const& aArgs)
- CFG_UNO_THROW_ALL( )
- {
- CFG_TRACE_INFO("config provider: going to create a read access instance");
-
- // extract the args
- OUString sPath;
- sal_Int32 nLevels;
-
- RequestOptions aOptions = getDefaultOptions();
-
- OProviderImpl::FactoryArguments::extractArgs(aArgs, sPath, nLevels, aOptions);
-
- CFG_TRACE_INFO_NI("config provider: node accessor extracted from the args is %s", OUSTRING2ASCII(sPath));
- CFG_TRACE_INFO_NI("config provider: level depth extracted from the args is %i", nLevels);
-
- // create the access object
- uno::Reference< uno::XInterface > xReturn;
-
- NodeElement* pElement = buildReadAccess(sPath, aOptions, nLevels);
- if (pElement != 0)
- {
- xReturn = pElement->getUnoInstance();
- if (xReturn.is())
- // acquired once by buildReadAccess
- xReturn->release();
- }
-
- return xReturn;
- }
-
- //-----------------------------------------------------------------------------------
- uno::Reference<uno::XInterface> OConfigurationProviderImpl::createUpdateAccess( uno::Sequence<uno::Any> const& aArgs)
- CFG_UNO_THROW_ALL( )
- {
- CFG_TRACE_INFO("config provider: going to create an update access instance");
-
- // extract the args
- OUString sPath;
- sal_Int32 nLevels;
-
- RequestOptions aOptions = getDefaultOptions();
-
- OProviderImpl::FactoryArguments::extractArgs(aArgs, sPath, nLevels, aOptions);
-
- CFG_TRACE_INFO_NI("config provider: node accessor extracted from the args is %s", OUSTRING2ASCII(sPath));
- CFG_TRACE_INFO_NI("config provider: level depth extracted from the args is %i", nLevels);
-
- // create the access object
- uno::Reference< uno::XInterface > xReturn;
-
- NodeElement* pElement = buildUpdateAccess(sPath, aOptions, nLevels);
- if (pElement != 0)
- {
- xReturn = pElement->getUnoInstance();
- if (xReturn.is())
- // acquired once by buildReadAccess
- xReturn->release();
- }
-
- return xReturn;
- }
-} // namespace configmgr
-
-
diff --git a/configmgr/source/api2/confproviderimpl2.hxx b/configmgr/source/api2/confproviderimpl2.hxx
deleted file mode 100644
index 05c6b3ed24..0000000000
--- a/configmgr/source/api2/confproviderimpl2.hxx
+++ /dev/null
@@ -1,67 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: confproviderimpl2.hxx,v $
- * $Revision: 1.6 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_PROVIDERIMPL2_HXX_
-#define CONFIGMGR_API_PROVIDERIMPL2_HXX_
-
-#include "providerimpl.hxx"
-
-namespace com { namespace sun { namespace star { namespace uno {
- class Any;
- class XInterface;
- template <class> class Sequence;
- template <class> class Reference;
-} } } }
-
-namespace configmgr
-{
- namespace css = ::com::sun::star;
- namespace uno = css::uno;
- namespace script = css::script;
-
- class OConfigurationProvider;
-
- class OConfigurationProviderImpl : public OProviderImpl
- {
- friend class OConfigurationProvider;
-
- public:
- // factory methods
- uno::Reference<uno::XInterface> createReadAccess( uno::Sequence<uno::Any> const& aArgs) CFG_UNO_THROW_ALL( );
- uno::Reference<uno::XInterface> createUpdateAccess( uno::Sequence<uno::Any> const& aArgs) CFG_UNO_THROW_ALL( );
- private:
- OConfigurationProviderImpl(OConfigurationProvider* _pProvider,
- CreationContext const & xContext);
- };
-} // namespace configmgr
-
-#endif // CONFIGMGR_API_PROVIDERIMPL2_HXX_
-
-
diff --git a/configmgr/source/api2/elementaccess.cxx b/configmgr/source/api2/elementaccess.cxx
index 89ff6bd826..cb497a7a51 100644
--- a/configmgr/source/api2/elementaccess.cxx
+++ b/configmgr/source/api2/elementaccess.cxx
@@ -44,57 +44,75 @@ namespace configmgr
//-----------------------------------------------------------------------------------
namespace uno = com::sun::star::uno;
- using uno::Reference;
- using uno::Sequence;
- using uno::Any;
- using uno::RuntimeException;
//-----------------------------------------------------------------------------------
// XInterface (but not method queryInterface)
//-----------------------------------------------------------------------------------
// acuire doesn't really do anything but forward. OTOH it should always be overridden when release() is
-void SAL_CALL BasicInnerElement ::acquire() throw() { BaseImplHelper::acquire(); }
-void SAL_CALL BasicSetElement ::acquire() throw() { BaseImplHelper::acquire(); }
-void SAL_CALL BasicRootElement ::acquire() throw() { BaseImplHelper::acquire(); }
-void SAL_CALL BasicUpdateElement::acquire() throw() { BaseImplHelper::acquire(); }
-//-----------------------------------------------------------------------------------
-
-// FIXME: this looks highly flaky wrt. weak-refs etc.
-#define LOCKED_RELEASE \
- bool bLastRef = (1 == m_refCount); \
- if (bLastRef) \
- { \
- UnoApiLock::acquire(); \
- configapi::implDisposeObject( getNodeAccess(), getElementClass() ); \
- } \
- BaseImplHelper::release(); \
- if (bLastRef) \
- UnoApiLock::release()
-
-
+void SAL_CALL BasicInnerElement ::acquire() throw() { cppu::WeakImplHelper3< css::container::XChild, css::container::XNamed, css::lang::XServiceInfo >::acquire(); }
+void SAL_CALL BasicSetElement ::acquire() throw() { cppu::WeakImplHelper6< css::container::XChild, css::container::XNamed, css::lang::XComponent, css::lang::XServiceInfo, css::configuration::XTemplateInstance, css::lang::XUnoTunnel >::acquire(); }
+void SAL_CALL BasicRootElement ::acquire() throw() { cppu::WeakImplHelper5< css::container::XNamed, css::util::XChangesNotifier, css::lang::XComponent, css::lang::XServiceInfo, css::lang::XLocalizable >::acquire(); }
+void SAL_CALL BasicUpdateElement::acquire() throw() { cppu::WeakImplHelper6< css::container::XNamed, css::util::XChangesNotifier, css::lang::XComponent, css::lang::XServiceInfo, css::lang::XLocalizable, css::util::XChangesBatch >::acquire(); }
+//-----------------------------------------------------------------------------------
void SAL_CALL BasicInnerElement::release() throw()
{
- LOCKED_RELEASE;
+ // FIXME: this looks highly flaky wrt. weak-refs etc.
+ bool bLastRef = (1 == m_refCount);
+ if (bLastRef)
+ {
+ UnoApiLock::acquire();
+ configapi::implDisposeObject( getNodeAccess(), getElementClass() );
+ }
+ cppu::WeakImplHelper3< css::container::XChild, css::container::XNamed, css::lang::XServiceInfo >::release();
+ if (bLastRef)
+ UnoApiLock::release();
}
//-----------------------------------------------------------------------------------
void SAL_CALL BasicSetElement::release() throw()
{
- LOCKED_RELEASE;
+ // FIXME: this looks highly flaky wrt. weak-refs etc.
+ bool bLastRef = (1 == m_refCount);
+ if (bLastRef)
+ {
+ UnoApiLock::acquire();
+ configapi::implDisposeObject( getNodeAccess(), getElementClass() );
+ }
+ cppu::WeakImplHelper6< css::container::XChild, css::container::XNamed, css::lang::XComponent, css::lang::XServiceInfo, css::configuration::XTemplateInstance, css::lang::XUnoTunnel >::release();
+ if (bLastRef)
+ UnoApiLock::release();
}
//-----------------------------------------------------------------------------------
void SAL_CALL BasicRootElement::release() throw()
{
- LOCKED_RELEASE;
+ // FIXME: this looks highly flaky wrt. weak-refs etc.
+ bool bLastRef = (1 == m_refCount);
+ if (bLastRef)
+ {
+ UnoApiLock::acquire();
+ configapi::implDisposeObject( getNodeAccess(), getElementClass() );
+ }
+ cppu::WeakImplHelper5< css::container::XNamed, css::util::XChangesNotifier, css::lang::XComponent, css::lang::XServiceInfo, css::lang::XLocalizable >::release();
+ if (bLastRef)
+ UnoApiLock::release();
}
//-----------------------------------------------------------------------------------
void SAL_CALL BasicUpdateElement::release() throw()
{
- LOCKED_RELEASE;
+ // FIXME: this looks highly flaky wrt. weak-refs etc.
+ bool bLastRef = (1 == m_refCount);
+ if (bLastRef)
+ {
+ UnoApiLock::acquire();
+ configapi::implDisposeObject( getNodeAccess(), getElementClass() );
+ }
+ cppu::WeakImplHelper6< css::container::XNamed, css::util::XChangesNotifier, css::lang::XComponent, css::lang::XServiceInfo, css::lang::XLocalizable, css::util::XChangesBatch >::release();
+ if (bLastRef)
+ UnoApiLock::release();
}
//-----------------------------------------------------------------------------------
@@ -130,28 +148,28 @@ uno::Sequence<sal_Int8> SAL_CALL BasicUpdateElement::getImplementationId( ) thr
// XChild (not for root elements)
//-----------------------------------------------------------------------------------
-Reference< uno::XInterface > SAL_CALL BasicInnerElement::getParent( ) throw(RuntimeException)
+uno::Reference< uno::XInterface > SAL_CALL BasicInnerElement::getParent( ) throw(uno::RuntimeException)
{
return configapi::implGetParent( getNodeAccess(), getElementClass() );
}
//-----------------------------------------------------------------------------------
-Reference< uno::XInterface > SAL_CALL BasicSetElement::getParent( ) throw(RuntimeException)
+uno::Reference< uno::XInterface > SAL_CALL BasicSetElement::getParent( ) throw(uno::RuntimeException)
{
return configapi::implGetParent( getNodeAccess(), getElementClass() );
}
//-----------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------
-void SAL_CALL BasicInnerElement::setParent( const Reference< uno::XInterface >& xParent )
- throw(css::lang::NoSupportException, RuntimeException)
+void SAL_CALL BasicInnerElement::setParent( const uno::Reference< uno::XInterface >& xParent )
+ throw(css::lang::NoSupportException, uno::RuntimeException)
{
configapi::implSetParent( getNodeAccess(), getElementClass(), xParent );
}
//-----------------------------------------------------------------------------------
-void SAL_CALL BasicSetElement::setParent( const Reference< uno::XInterface >& xParent )
- throw(css::lang::NoSupportException, RuntimeException)
+void SAL_CALL BasicSetElement::setParent( const uno::Reference< uno::XInterface >& xParent )
+ throw(css::lang::NoSupportException, uno::RuntimeException)
{
configapi::implSetParent( getNodeAccess(), getElementClass(), xParent );
}
@@ -161,50 +179,50 @@ void SAL_CALL BasicSetElement::setParent( const Reference< uno::XInterface >& xP
// XNamed
//-----------------------------------------------------------------------------------
-OUString SAL_CALL BasicInnerElement::getName( ) throw(RuntimeException)
+rtl::OUString SAL_CALL BasicInnerElement::getName( ) throw(uno::RuntimeException)
{
return configapi::implGetName( getNodeAccess(), getElementClass() );
}
//-----------------------------------------------------------------------------------
-OUString SAL_CALL BasicSetElement::getName( ) throw(RuntimeException)
+rtl::OUString SAL_CALL BasicSetElement::getName( ) throw(uno::RuntimeException)
{
return configapi::implGetName( getNodeAccess(), getElementClass() );
}
//-----------------------------------------------------------------------------------
-OUString SAL_CALL BasicRootElement::getName( ) throw(RuntimeException)
+rtl::OUString SAL_CALL BasicRootElement::getName( ) throw(uno::RuntimeException)
{
return configapi::implGetName( getNodeAccess(), getElementClass() );
}
//-----------------------------------------------------------------------------------
-OUString SAL_CALL BasicUpdateElement::getName( ) throw(RuntimeException)
+rtl::OUString SAL_CALL BasicUpdateElement::getName( ) throw(uno::RuntimeException)
{
return configapi::implGetName( getNodeAccess(), getElementClass() );
}
//-----------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------
-void SAL_CALL BasicInnerElement::setName( const OUString& aName ) throw(RuntimeException)
+void SAL_CALL BasicInnerElement::setName( const rtl::OUString& aName ) throw(uno::RuntimeException)
{
configapi::implSetName( getNodeAccess(), getElementClass(), aName );
}
//-----------------------------------------------------------------------------------
-void SAL_CALL BasicSetElement::setName( const OUString& aName ) throw(RuntimeException)
+void SAL_CALL BasicSetElement::setName( const rtl::OUString& aName ) throw(uno::RuntimeException)
{
configapi::implSetName( getNodeAccess(), getElementClass(), aName );
}
//-----------------------------------------------------------------------------------
-void SAL_CALL BasicRootElement::setName( const OUString& aName ) throw(RuntimeException)
+void SAL_CALL BasicRootElement::setName( const rtl::OUString& aName ) throw(uno::RuntimeException)
{
configapi::implSetName( getNodeAccess(), getElementClass(), aName );
}
//-----------------------------------------------------------------------------------
-void SAL_CALL BasicUpdateElement::setName( const OUString& aName ) throw(RuntimeException)
+void SAL_CALL BasicUpdateElement::setName( const rtl::OUString& aName ) throw(uno::RuntimeException)
{
configapi::implSetName( getNodeAccess(), getElementClass(), aName );
}
@@ -214,30 +232,30 @@ void SAL_CALL BasicUpdateElement::setName( const OUString& aName ) throw(Runtime
// XChangesNotifier
//-----------------------------------------------------------------------------------
-void SAL_CALL BasicRootElement::addChangesListener( const Reference< css::util::XChangesListener >& xListener )
- throw(RuntimeException)
+void SAL_CALL BasicRootElement::addChangesListener( const uno::Reference< css::util::XChangesListener >& xListener )
+ throw(uno::RuntimeException)
{
configapi::implAddListener( getNodeAccess(), xListener );
}
//-----------------------------------------------------------------------------------
-void SAL_CALL BasicUpdateElement::addChangesListener( const Reference< css::util::XChangesListener >& xListener )
- throw(RuntimeException)
+void SAL_CALL BasicUpdateElement::addChangesListener( const uno::Reference< css::util::XChangesListener >& xListener )
+ throw(uno::RuntimeException)
{
configapi::implAddListener( getNodeAccess(), xListener );
}
//-----------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------
-void SAL_CALL BasicRootElement::removeChangesListener( const Reference< css::util::XChangesListener >& xListener )
- throw(RuntimeException)
+void SAL_CALL BasicRootElement::removeChangesListener( const uno::Reference< css::util::XChangesListener >& xListener )
+ throw(uno::RuntimeException)
{
configapi::implRemoveListener( getNodeAccess(), xListener );
}
//-----------------------------------------------------------------------------------
-void SAL_CALL BasicUpdateElement::removeChangesListener( const Reference< css::util::XChangesListener >& xListener )
- throw(RuntimeException)
+void SAL_CALL BasicUpdateElement::removeChangesListener( const uno::Reference< css::util::XChangesListener >& xListener )
+ throw(uno::RuntimeException)
{
configapi::implRemoveListener( getNodeAccess(), xListener );
}
@@ -313,75 +331,75 @@ void SAL_CALL BasicUpdateElement::removeEventListener( const uno::Reference< css
// XServiceInfo
//-----------------------------------------------------------------------------------
-OUString SAL_CALL BasicInnerElement::getImplementationName( ) throw(uno::RuntimeException)
+rtl::OUString SAL_CALL BasicInnerElement::getImplementationName( ) throw(uno::RuntimeException)
{
return configapi::implGetImplementationName( getNodeAccess(), getElementClass() );
}
//-----------------------------------------------------------------------------------
-OUString SAL_CALL BasicSetElement::getImplementationName( ) throw(uno::RuntimeException)
+rtl::OUString SAL_CALL BasicSetElement::getImplementationName( ) throw(uno::RuntimeException)
{
return configapi::implGetImplementationName( getNodeAccess(), getElementClass() );
}
//-----------------------------------------------------------------------------------
-OUString SAL_CALL BasicRootElement::getImplementationName( ) throw(uno::RuntimeException)
+rtl::OUString SAL_CALL BasicRootElement::getImplementationName( ) throw(uno::RuntimeException)
{
return configapi::implGetImplementationName( getNodeAccess(), getElementClass() );
}
//-----------------------------------------------------------------------------------
-OUString SAL_CALL BasicUpdateElement::getImplementationName( ) throw(uno::RuntimeException)
+rtl::OUString SAL_CALL BasicUpdateElement::getImplementationName( ) throw(uno::RuntimeException)
{
return configapi::implGetImplementationName( getNodeAccess(), getElementClass() );
}
//-----------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------
-sal_Bool SAL_CALL BasicInnerElement::supportsService( const OUString& ServiceName ) throw(uno::RuntimeException)
+sal_Bool SAL_CALL BasicInnerElement::supportsService( const rtl::OUString& ServiceName ) throw(uno::RuntimeException)
{
return configapi::implSupportsService( getNodeAccess(), getElementClass(), ServiceName );
}
//-----------------------------------------------------------------------------------
-sal_Bool SAL_CALL BasicSetElement::supportsService( const OUString& ServiceName ) throw(uno::RuntimeException)
+sal_Bool SAL_CALL BasicSetElement::supportsService( const rtl::OUString& ServiceName ) throw(uno::RuntimeException)
{
return configapi::implSupportsService( getNodeAccess(), getElementClass(), ServiceName );
}
//-----------------------------------------------------------------------------------
-sal_Bool SAL_CALL BasicRootElement::supportsService( const OUString& ServiceName ) throw(uno::RuntimeException)
+sal_Bool SAL_CALL BasicRootElement::supportsService( const rtl::OUString& ServiceName ) throw(uno::RuntimeException)
{
return configapi::implSupportsService( getNodeAccess(), getElementClass(), ServiceName );
}
//-----------------------------------------------------------------------------------
-sal_Bool SAL_CALL BasicUpdateElement::supportsService( const OUString& ServiceName ) throw(uno::RuntimeException)
+sal_Bool SAL_CALL BasicUpdateElement::supportsService( const rtl::OUString& ServiceName ) throw(uno::RuntimeException)
{
return configapi::implSupportsService( getNodeAccess(), getElementClass(), ServiceName );
}
//-----------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------
-uno::Sequence< OUString > SAL_CALL BasicInnerElement::getSupportedServiceNames( ) throw(uno::RuntimeException)
+uno::Sequence< rtl::OUString > SAL_CALL BasicInnerElement::getSupportedServiceNames( ) throw(uno::RuntimeException)
{
return configapi::implGetSupportedServiceNames( getNodeAccess(), getElementClass() );
}
//-----------------------------------------------------------------------------------
-uno::Sequence< OUString > SAL_CALL BasicSetElement::getSupportedServiceNames( ) throw(uno::RuntimeException)
+uno::Sequence< rtl::OUString > SAL_CALL BasicSetElement::getSupportedServiceNames( ) throw(uno::RuntimeException)
{
return configapi::implGetSupportedServiceNames( getNodeAccess(), getElementClass() );
}
//-----------------------------------------------------------------------------------
-uno::Sequence< OUString > SAL_CALL BasicRootElement::getSupportedServiceNames( ) throw(uno::RuntimeException)
+uno::Sequence< rtl::OUString > SAL_CALL BasicRootElement::getSupportedServiceNames( ) throw(uno::RuntimeException)
{
return configapi::implGetSupportedServiceNames( getNodeAccess(), getElementClass() );
}
//-----------------------------------------------------------------------------------
-uno::Sequence< OUString > SAL_CALL BasicUpdateElement::getSupportedServiceNames( ) throw(uno::RuntimeException)
+uno::Sequence< rtl::OUString > SAL_CALL BasicUpdateElement::getSupportedServiceNames( ) throw(uno::RuntimeException)
{
return configapi::implGetSupportedServiceNames( getNodeAccess(), getElementClass() );
}
@@ -394,7 +412,7 @@ uno::Sequence< OUString > SAL_CALL BasicUpdateElement::getSupportedServiceNames
// XTemplateInstance
//-----------------------------------------------------------------------------------
-OUString SAL_CALL BasicSetElement::getTemplateName( ) throw(uno::RuntimeException)
+rtl::OUString SAL_CALL BasicSetElement::getTemplateName( ) throw(uno::RuntimeException)
{
return configapi::implGetTemplateName( getElementClass() );
}
diff --git a/configmgr/source/api2/elementaccess.hxx b/configmgr/source/api2/elementaccess.hxx
index c982cc5bf8..8bf73774a2 100644
--- a/configmgr/source/api2/elementaccess.hxx
+++ b/configmgr/source/api2/elementaccess.hxx
@@ -49,7 +49,6 @@ namespace configmgr
//-----------------------------------------------------------------------------
namespace css = ::com::sun::star;
namespace uno = ::com::sun::star::uno;
- using rtl::OUString;
//-----------------------------------------------------------------------------
namespace configapi
@@ -68,16 +67,8 @@ namespace configmgr
<type scope='configmgr::configapi'>NodeAccess</type> and
<type scope='configmgr::configapi'>InnerElement</type>.</p>
*/
- typedef ::cppu::WeakImplHelper3
- < css::container::XChild
- , css::container::XNamed
- , css::lang::XServiceInfo
- >
- InnerElementImplHelper;
-
- class BasicInnerElement : public InnerElementImplHelper
+ class BasicInnerElement : public cppu::WeakImplHelper3< css::container::XChild, css::container::XNamed, css::lang::XServiceInfo >
{
- typedef InnerElementImplHelper BaseImplHelper;
protected:
// Destructors
virtual ~BasicInnerElement() {}
@@ -103,24 +94,24 @@ namespace configmgr
throw(css::lang::NoSupportException, css::uno::RuntimeException);
// XNamed
- virtual OUString SAL_CALL
+ virtual rtl::OUString SAL_CALL
getName( )
throw(uno::RuntimeException);
virtual void SAL_CALL // not supported (! - missing exception)
- setName( const OUString& aName )
+ setName( const rtl::OUString& aName )
throw(uno::RuntimeException);
// XServiceInfo
- virtual OUString SAL_CALL
+ virtual rtl::OUString SAL_CALL
getImplementationName( )
throw(uno::RuntimeException);
virtual sal_Bool SAL_CALL
- supportsService( const OUString& ServiceName )
+ supportsService( const rtl::OUString& ServiceName )
throw(uno::RuntimeException);
- virtual uno::Sequence< OUString > SAL_CALL
+ virtual uno::Sequence< rtl::OUString > SAL_CALL
getSupportedServiceNames( )
throw(uno::RuntimeException);
@@ -136,19 +127,8 @@ namespace configmgr
<type scope='configmgr::configapi'>NodeAccess</type> and
<type scope='configmgr::configapi'>SetElement</type>.</p>
*/
- typedef ::cppu::WeakImplHelper6
- < css::container::XChild
- , css::container::XNamed
- , css::lang::XComponent
- , css::lang::XServiceInfo
- , css::configuration::XTemplateInstance
- , css::lang::XUnoTunnel
- >
- SetElementImplHelper;
-
- class BasicSetElement : public SetElementImplHelper
+ class BasicSetElement : public cppu::WeakImplHelper6< css::container::XChild, css::container::XNamed, css::lang::XComponent, css::lang::XServiceInfo, css::configuration::XTemplateInstance, css::lang::XUnoTunnel >
{
- typedef SetElementImplHelper BaseImplHelper;
protected:
// Destructors
virtual ~BasicSetElement() {}
@@ -174,12 +154,12 @@ namespace configmgr
throw(css::lang::NoSupportException, css::uno::RuntimeException);
// XNamed
- virtual OUString SAL_CALL
+ virtual rtl::OUString SAL_CALL
getName( )
throw(uno::RuntimeException);
virtual void SAL_CALL // generally not supported (! - missing exception)
- setName( const OUString& aName )
+ setName( const rtl::OUString& aName )
throw(uno::RuntimeException);
// XComponent
@@ -196,20 +176,20 @@ namespace configmgr
throw(uno::RuntimeException);
// XServiceInfo
- virtual OUString SAL_CALL
+ virtual rtl::OUString SAL_CALL
getImplementationName( )
throw(uno::RuntimeException);
virtual sal_Bool SAL_CALL
- supportsService( const OUString& ServiceName )
+ supportsService( const rtl::OUString& ServiceName )
throw(uno::RuntimeException);
- virtual uno::Sequence< OUString > SAL_CALL
+ virtual uno::Sequence< rtl::OUString > SAL_CALL
getSupportedServiceNames( )
throw(uno::RuntimeException);
// XTemplateInstance
- virtual OUString SAL_CALL
+ virtual rtl::OUString SAL_CALL
getTemplateName( )
throw(uno::RuntimeException);
@@ -230,18 +210,8 @@ namespace configmgr
<type scope='configmgr::configapi'>NodeAccess</type> and
<type scope='configmgr::configapi'>SetElement</type>.</p>
*/
- typedef ::cppu::WeakImplHelper5
- < css::container::XNamed
- , css::util::XChangesNotifier
- , css::lang::XComponent
- , css::lang::XServiceInfo
- , css::lang::XLocalizable
- >
- RootElementImplHelper;
-
- class BasicRootElement : public RootElementImplHelper
+ class BasicRootElement : public cppu::WeakImplHelper5< css::container::XNamed, css::util::XChangesNotifier, css::lang::XComponent, css::lang::XServiceInfo, css::lang::XLocalizable >
{
- typedef RootElementImplHelper BaseImplHelper;
protected:
// Destructors
virtual ~BasicRootElement() {}
@@ -258,12 +228,12 @@ namespace configmgr
throw(uno::RuntimeException);
// XNamed
- virtual OUString SAL_CALL
+ virtual rtl::OUString SAL_CALL
getName( )
throw(uno::RuntimeException);
virtual void SAL_CALL // generally not supported (! - missing exception)
- setName( const OUString& aName )
+ setName( const rtl::OUString& aName )
throw(uno::RuntimeException);
// XChangesNotifier
@@ -289,15 +259,15 @@ namespace configmgr
throw(uno::RuntimeException);
// XServiceInfo
- virtual OUString SAL_CALL
+ virtual rtl::OUString SAL_CALL
getImplementationName( )
throw(uno::RuntimeException);
virtual sal_Bool SAL_CALL
- supportsService( const OUString& ServiceName )
+ supportsService( const rtl::OUString& ServiceName )
throw(uno::RuntimeException);
- virtual uno::Sequence< OUString > SAL_CALL
+ virtual uno::Sequence< rtl::OUString > SAL_CALL
getSupportedServiceNames( )
throw(uno::RuntimeException);
@@ -322,19 +292,8 @@ namespace configmgr
<type scope='configmgr::configapi'>NodeAccess</type> and
<type scope='configmgr::configapi'>SetElement</type>.</p>
*/
- typedef ::cppu::WeakImplHelper6
- < css::container::XNamed
- , css::util::XChangesNotifier
- , css::lang::XComponent
- , css::lang::XServiceInfo
- , css::lang::XLocalizable
- , css::util::XChangesBatch
- >
- UpdateElementImplHelper;
-
- class BasicUpdateElement : public UpdateElementImplHelper
+ class BasicUpdateElement : public cppu::WeakImplHelper6< css::container::XNamed, css::util::XChangesNotifier, css::lang::XComponent, css::lang::XServiceInfo, css::lang::XLocalizable, css::util::XChangesBatch >
{
- typedef UpdateElementImplHelper BaseImplHelper;
protected:
// Destructors
virtual ~BasicUpdateElement() {}
@@ -351,12 +310,12 @@ namespace configmgr
throw(uno::RuntimeException);
// XNamed
- virtual OUString SAL_CALL
+ virtual rtl::OUString SAL_CALL
getName( )
throw(uno::RuntimeException);
virtual void SAL_CALL // generally not supported (! - missing exception)
- setName( const OUString& aName )
+ setName( const rtl::OUString& aName )
throw(uno::RuntimeException);
// XChangesNotifier
@@ -382,15 +341,15 @@ namespace configmgr
throw(uno::RuntimeException);
// XServiceInfo
- virtual OUString SAL_CALL
+ virtual rtl::OUString SAL_CALL
getImplementationName( )
throw(uno::RuntimeException);
virtual sal_Bool SAL_CALL
- supportsService( const OUString& ServiceName )
+ supportsService( const rtl::OUString& ServiceName )
throw(uno::RuntimeException);
- virtual uno::Sequence< OUString > SAL_CALL
+ virtual uno::Sequence< rtl::OUString > SAL_CALL
getSupportedServiceNames( )
throw(uno::RuntimeException);
diff --git a/configmgr/source/api2/elementimpl.cxx b/configmgr/source/api2/elementimpl.cxx
index 640bc36896..1b6dffcbf2 100644
--- a/configmgr/source/api2/elementimpl.cxx
+++ b/configmgr/source/api2/elementimpl.cxx
@@ -57,20 +57,6 @@ namespace configmgr
namespace lang = css::lang;
namespace util = css::util;
- using uno::RuntimeException;
- using uno::Reference;
- using uno::Any;
- using uno::Sequence;
- using lang::NoSupportException;
- using lang::WrappedTargetException;
-
- using configuration::NodeRef;
- using configuration::Tree;
- using configuration::ElementTree;
- using configuration::Name;
- using configuration::AbsolutePath;
- using configuration::RelativePath;
-
//-----------------------------------------------------------------------------------
// Interface methods
@@ -79,18 +65,18 @@ namespace configmgr
// XChild
//-----------------------------------------------------------------------------------
-Reference< uno::XInterface > implGetParent(NodeAccess& rNode, InnerElement&) throw(RuntimeException)
+uno::Reference< uno::XInterface > implGetParent(NodeAccess& rNode, InnerElement&) throw(uno::RuntimeException)
{
- Reference<uno::XInterface> xRet;
+ uno::Reference<uno::XInterface> xRet;
try
{
- GuardedNodeDataAccess impl( rNode ); // no provider lock needed - tree must be prebuilt already
+ GuardedNodeData<NodeAccess> impl( rNode ); // no provider lock needed - tree must be prebuilt already
- Tree aTree(impl.getTree());
- NodeRef aParentNode = aTree.getParent(impl.getNode());
+ rtl::Reference< configuration::Tree > aTree(impl.getTree());
+ configuration::NodeRef aParentNode = aTree->getParent(impl.getNode());
- Any aAny = configapi::makeInnerElement( rNode.getFactory(), aTree, aParentNode );
+ uno::Any aAny = configapi::makeInnerElement( rNode.getFactory(), aTree, aParentNode );
if (!(aAny >>= xRet)) // no parent available
{
@@ -110,25 +96,25 @@ Reference< uno::XInterface > implGetParent(NodeAccess& rNode, InnerElement&) thr
//-----------------------------------------------------------------------------------
-Reference< uno::XInterface > implGetParent(NodeAccess& rNode, SetElement& /*rElement*/) throw(RuntimeException)
+uno::Reference< uno::XInterface > implGetParent(NodeAccess& rNode, SetElement& /*rElement*/) throw(uno::RuntimeException)
{
- Reference<uno::XInterface> xRet;
+ uno::Reference<uno::XInterface> xRet;
try
{
// assume shared lock for connected trees
- GuardedNodeDataAccess impl( rNode ); // no provider lock needed - tree must be prebuilt already
+ GuardedNodeData<NodeAccess> impl( rNode ); // no provider lock needed - tree must be prebuilt already
- Tree aTree(impl.getTree());
+ rtl::Reference< configuration::Tree > aTree(impl.getTree());
- Tree aParentTree( aTree.getContextTree() );
+ rtl::Reference< configuration::Tree > aParentTree( aTree->getContextTree() );
- if (!aParentTree.isEmpty())
+ if (!configuration::isEmpty(aParentTree.get()))
{
- NodeRef aParentNode( aTree.getContextNode() );
+ configuration::NodeRef aParentNode( aTree->getContextNodeRef() );
// assume shared factory for connected trees
- Any aAny = configapi::makeInnerElement( rNode.getFactory(), aParentTree, aParentNode );
+ uno::Any aAny = configapi::makeInnerElement( rNode.getFactory(), aParentTree, aParentNode );
if (!(aAny >>= xRet)) // no parent available
{
@@ -154,84 +140,82 @@ Reference< uno::XInterface > implGetParent(NodeAccess& rNode, SetElement& /*rEle
//-----------------------------------------------------------------------------------
// UNSUPPORTED method
-void implSetParent(NodeAccess& rNode, InnerElement& /*rElement*/, const Reference< uno::XInterface >& /*xParent*/ )
- throw(NoSupportException, RuntimeException)
+void implSetParent(NodeAccess& rNode, InnerElement& /*rElement*/, const uno::Reference< uno::XInterface >& /*xParent*/ )
+ throw(lang::NoSupportException, uno::RuntimeException)
{
UnoApiLock aLock;
rNode.checkAlive(); // Does locking internally, checks for disposed nodes
// TODO(?): allow for xParent == getParent()
- throw NoSupportException(
- OUString(RTL_CONSTASCII_USTRINGPARAM("configmgr: BasicElement::setParent: cannot move Entry")),
+ throw lang::NoSupportException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("configmgr: BasicElement::setParent: cannot move Entry")),
rNode.getUnoInstance() );
}
//-----------------------------------------------------------------------------------
// preliminary implementation
-void implSetParent(NodeAccess& rNode, SetElement& rElement, const Reference< uno::XInterface >& xParent )
- throw(NoSupportException, RuntimeException)
+void implSetParent(NodeAccess& rNode, SetElement& rElement, const uno::Reference< uno::XInterface >& xParent )
+ throw(lang::NoSupportException, uno::RuntimeException)
{
UnoApiLock aLock;
//implSetParent(rNode,xParent);
// TODO: lock the whole transaction ???? - would need Uno Tunneling ?
- using css::container::XNameContainer;
-
- Reference< uno::XInterface > xGotParent( implGetParent(rNode,rElement) );
- Reference< XNameContainer > xOldParent( xGotParent, uno::UNO_QUERY );
- Reference< XNameContainer > xNewParent( xParent, uno::UNO_QUERY );
+ uno::Reference< uno::XInterface > xGotParent( implGetParent(rNode,rElement) );
+ uno::Reference< css::container::XNameContainer > xOldParent( xGotParent, uno::UNO_QUERY );
+ uno::Reference< css::container::XNameContainer > xNewParent( xParent, uno::UNO_QUERY );
if (xGotParent.is() && !xOldParent.is())
{
- throw NoSupportException(
- OUString(RTL_CONSTASCII_USTRINGPARAM("Config API: implSetParent: this is not element of a container")),
+ throw lang::NoSupportException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Config API: implSetParent: this is not element of a container")),
rNode.getUnoInstance() );
}
if (xParent.is() && !xNewParent.is())
{
- throw NoSupportException(
- OUString(RTL_CONSTASCII_USTRINGPARAM("Config API: implSetParent: new parent is no container")),
+ throw lang::NoSupportException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Config API: implSetParent: new parent is no container")),
rNode.getUnoInstance() );
}
- Reference< uno::XInterface > xThis(rNode.getUnoInstance());
+ uno::Reference< uno::XInterface > xThis(rNode.getUnoInstance());
OSL_ASSERT(xThis.is());
if (xOldParent != xNewParent)
{
- OUString const sName( implGetName(rNode,rElement) );
+ rtl::OUString const sName( implGetName(rNode,rElement) );
if (xParent.is())
{
- OUString const sTemplate( implGetTemplateName(rElement) );
+ rtl::OUString const sTemplate( implGetTemplateName(rElement) );
if (sTemplate.getLength() == 0)
{
- throw NoSupportException(
- OUString(RTL_CONSTASCII_USTRINGPARAM("Config API: implSetParent: object has no recognizable type")),
+ throw lang::NoSupportException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Config API: implSetParent: object has no recognizable type")),
xThis );
}
- Reference< css::configuration::XTemplateContainer > xNewTemplate( xParent, uno::UNO_QUERY );
+ uno::Reference< css::configuration::XTemplateContainer > xNewTemplate( xParent, uno::UNO_QUERY );
if (!xNewTemplate.is())
{
- throw NoSupportException(
- OUString(RTL_CONSTASCII_USTRINGPARAM("Config API: implSetParent: new parent has no element template")),
+ throw lang::NoSupportException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Config API: implSetParent: new parent has no element template")),
xThis );
}
if ( sTemplate != xNewTemplate->getElementTemplateName())
{
- throw NoSupportException(
- OUString(RTL_CONSTASCII_USTRINGPARAM("Config API: implSetParent: object has wrong type")),
+ throw lang::NoSupportException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Config API: implSetParent: object has wrong type")),
xThis );
}
if ( xNewParent->hasByName( sName ) )
{
- throw NoSupportException(
- OUString(RTL_CONSTASCII_USTRINGPARAM("Config API: implSetParent: an object of this name already exists in new parent")),
+ throw lang::NoSupportException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Config API: implSetParent: an object of this name already exists in new parent")),
xThis );
}
@@ -247,7 +231,7 @@ void implSetParent(NodeAccess& rNode, SetElement& rElement, const Reference< uno
}
catch (uno::Exception& e)
{
- e.Message = OUString(RTL_CONSTASCII_USTRINGPARAM("Config API: implSetParent: changing parent failed: "))
+ e.Message = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Config API: implSetParent: changing parent failed: "))
+= e.Message;
if (xOldParent.is())
@@ -257,10 +241,10 @@ void implSetParent(NodeAccess& rNode, SetElement& rElement, const Reference< uno
}
catch(uno::Exception& bad)
{
- e.Message += OUString(RTL_CONSTASCII_USTRINGPARAM("\n\t ! Could not restore old parent: ")) += bad.Message;
+ e.Message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n\t ! Could not restore old parent: ")) += bad.Message;
}
- throw RuntimeException(e.Message,xThis);
+ throw uno::RuntimeException(e.Message,xThis);
}
}
@@ -270,17 +254,17 @@ void implSetParent(NodeAccess& rNode, SetElement& rElement, const Reference< uno
// XNamed
//-----------------------------------------------------------------------------
-OUString implGetName(NodeAccess& rNode, NodeElement& ) throw(RuntimeException)
+rtl::OUString implGetName(NodeAccess& rNode, NodeElement& ) throw(uno::RuntimeException)
{
- OUString sRet;
+ rtl::OUString sRet;
try
{
- GuardedNodeDataAccess impl( rNode ); // maybe passive only ?
+ GuardedNodeData<NodeAccess> impl( rNode ); // maybe passive only ?
- Tree aTree(impl.getTree());
- NodeRef aNode(impl.getNode());
+ rtl::Reference< configuration::Tree > aTree(impl.getTree());
+ configuration::NodeRef aNode(impl.getNode());
- sRet = aTree.getName(aNode).toString();
+ sRet = aTree->getSimpleNodeName(aNode.getOffset());
}
catch (configuration::Exception& ex)
{
@@ -294,23 +278,21 @@ OUString implGetName(NodeAccess& rNode, NodeElement& ) throw(RuntimeException)
//-----------------------------------------------------------------------------
// UNSUPPORTED method
-void implSetName(NodeAccess & rNode, NodeElement& /*rElement*/, const OUString& /*aName*/ ) throw(RuntimeException)
+void implSetName(NodeAccess & rNode, NodeElement& /*rElement*/, const rtl::OUString& /*aName*/ ) throw(uno::RuntimeException)
{
UnoApiLock aLock;
- typedef RuntimeException CantRenameException;
-
rNode.checkAlive(); // Does locking internally, checks for disposed nodes
// TODO(?): allow for aName == getName()
- throw CantRenameException(
- OUString(RTL_CONSTASCII_USTRINGPARAM("configmgr: BasicElement::setName: cannot rename Entry")),
+ throw uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("configmgr: BasicElement::setName: cannot rename Entry")),
rNode.getUnoInstance() );
}
//-----------------------------------------------------------------------------
// TODO: Implementations for elements to be added to a container node
-void implSetName(NodeAccess& rNode, SetElement& rElement, const OUString& aName ) throw(RuntimeException)
+void implSetName(NodeAccess& rNode, SetElement& rElement, const rtl::OUString& aName ) throw(uno::RuntimeException)
{
UnoApiLock aLock;
@@ -332,7 +314,7 @@ void implDispose( SetElement& rElement) throw(uno::RuntimeException)
if (!rElement.disposeTree(false))
{
throw uno::RuntimeException(
- OUString(RTL_CONSTASCII_USTRINGPARAM("CONFIGURATION: Can't dispose an object that has an owner")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CONFIGURATION: Can't dispose an object that has an owner")),
rElement.getUnoInstance() );
}
}
@@ -345,7 +327,7 @@ void implDispose( RootElement& rElement) throw(uno::RuntimeException)
if (!rElement.disposeTree())
{
throw lang::DisposedException(
- OUString(RTL_CONSTASCII_USTRINGPARAM("CONFIGURATION: Can't dispose an object that already was disposed")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CONFIGURATION: Can't dispose an object that already was disposed")),
rElement.getUnoInstance() );
}
}
@@ -390,7 +372,7 @@ uno::Sequence<sal_Int8> implGetImplementationId(NodeAccess& rNode, NodeElement&
OSL_ENSURE(pInfo, "Configuration: Object has no implementation (service) info - cannot get implementation id");
if (!pInfo)
- throw uno::RuntimeException( OUString(RTL_CONSTASCII_USTRINGPARAM("CONFIGURATION: Object has no implementation information - cannot get implementation id")),rElement.getUnoInstance() );
+ throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CONFIGURATION: Object has no implementation information - cannot get implementation id")),rElement.getUnoInstance() );
return ServiceComponentImpl::getStaticImplementationId(pInfo);
}
@@ -399,7 +381,7 @@ uno::Sequence<sal_Int8> implGetImplementationId(NodeAccess& rNode, NodeElement&
// XServiceInfo
//-----------------------------------------------------------------------------
-OUString implGetImplementationName( NodeAccess& rNode, NodeElement& rElement ) throw(uno::RuntimeException)
+rtl::OUString implGetImplementationName( NodeAccess& rNode, NodeElement& rElement ) throw(uno::RuntimeException)
{
DisposeGuard aLock(rNode);
ServiceImplementationInfo const* pInfo = rElement.getServiceInfo();
@@ -409,7 +391,7 @@ OUString implGetImplementationName( NodeAccess& rNode, NodeElement& rElement ) t
}
//-----------------------------------------------------------------------------
-sal_Bool implSupportsService( NodeAccess& rNode, NodeElement& rElement, const OUString& ServiceName ) throw(uno::RuntimeException)
+sal_Bool implSupportsService( NodeAccess& rNode, NodeElement& rElement, const rtl::OUString& ServiceName ) throw(uno::RuntimeException)
{
DisposeGuard aLock(rNode);
ServiceImplementationInfo const* pInfo = rElement.getServiceInfo();
@@ -419,7 +401,7 @@ sal_Bool implSupportsService( NodeAccess& rNode, NodeElement& rElement, const OU
}
//-----------------------------------------------------------------------------
-uno::Sequence< OUString > implGetSupportedServiceNames( NodeAccess& rNode, NodeElement& rElement ) throw(uno::RuntimeException)
+uno::Sequence< rtl::OUString > implGetSupportedServiceNames( NodeAccess& rNode, NodeElement& rElement ) throw(uno::RuntimeException)
{
DisposeGuard aLock(rNode);
ServiceImplementationInfo const* pInfo = rElement.getServiceInfo();
@@ -452,7 +434,7 @@ void implSetLocale( RootElement& rElement, const css::lang::Locale& /*eLocale*/
OSL_ENSURE(false,"CONFIGURATION: Changing the set Locale is not supported.");
throw uno::RuntimeException(
- OUString(RTL_CONSTASCII_USTRINGPARAM("CONFIGURATION: Changing the locale is currently not supported")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CONFIGURATION: Changing the locale is currently not supported")),
rElement.getUnoInstance()
);
}
@@ -481,13 +463,13 @@ void implCommitChanges( UpdateRootElement& rElement ) throw(css::lang::WrappedTa
}
// filter/wrap uno::Exceptions
- catch (WrappedTargetException& ) { throw; }
- catch (RuntimeException& ) { throw; }
+ catch (lang::WrappedTargetException& ) { throw; }
+ catch (uno::RuntimeException& ) { throw; }
catch (uno::Exception& ex)
{
- Reference<uno::XInterface> xContext( rElement.getUnoInstance() );
- OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration: can't commit Changes: ") );
- throw WrappedTargetException( sMessage += ex.Message, xContext, uno::makeAny(ex));
+ uno::Reference<uno::XInterface> xContext( rElement.getUnoInstance() );
+ rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration: can't commit Changes: ") );
+ throw lang::WrappedTargetException( sMessage += ex.Message, xContext, uno::makeAny(ex));
}
}
//-----------------------------------------------------------------------------
@@ -497,7 +479,7 @@ sal_Bool implHasPendingChanges( RootElement& rElement ) throw(uno::RuntimeExcept
try
{
GuardedRootElement aLocked(rElement);
- return aLocked.getTree().hasChanges();
+ return aLocked.get().getTree()->hasChanges();
}
catch (configuration::Exception& ex)
{
@@ -514,21 +496,18 @@ sal_Bool implHasPendingChanges( RootElement& rElement ) throw(uno::RuntimeExcept
uno::Sequence< css::util::ElementChange > implGetPendingChanges( RootElement& rElement )
throw(uno::RuntimeException)
{
- using css::util::ElementChange;
- using configuration::NodeChangesInformation;
-
- std::vector<ElementChange> aResult;
+ std::vector<css::util::ElementChange> aResult;
try
{
GuardedRootElement aLocked(rElement);
- Tree aTree( aLocked.getTree() );
+ rtl::Reference< configuration::Tree > aTree( aLocked.get().getTree() );
- NodeChangesInformation aInfos;
+ configuration::NodeChangesInformation aInfos;
{
- NodeChanges aChanges;
- if (aTree.collectChanges(aChanges))
+ configuration::NodeChanges aChanges;
+ if (aTree->collectChanges(aChanges))
{
aChanges.getChangesInfos(aInfos);
}
@@ -536,11 +515,11 @@ uno::Sequence< css::util::ElementChange > implGetPendingChanges( RootElement& rE
Factory& rFactory = rElement.getFactory();
- for(NodeChangesInformation::Iterator it = aInfos.begin(), stop = aInfos.end();
+ for(std::vector< configuration::NodeChangeInformation >::const_iterator it = aInfos.begin(), stop = aInfos.end();
it != stop;
++it)
{
- ElementChange aChange;
+ css::util::ElementChange aChange;
fillChange(aChange,*it,aTree,rFactory);
aResult.push_back(aChange);
}
@@ -561,13 +540,13 @@ uno::Sequence< css::util::ElementChange > implGetPendingChanges( RootElement& rE
// XTemplateInstance
//-----------------------------------------------------------------------------------
-OUString implGetTemplateName(SetElement& rElement)
+rtl::OUString implGetTemplateName(SetElement& rElement)
throw(uno::RuntimeException)
{
try
{
GuardedTreeElement aLocked(rElement);
- return rElement.getTemplateInfo().getTemplatePathString();
+ return rElement.getTemplateInfo()->getPathString();
}
catch (configuration::Exception& ex)
{
@@ -577,7 +556,7 @@ OUString implGetTemplateName(SetElement& rElement)
}
OSL_ENSURE(false,"Unreachable Code");
- return OUString();
+ return rtl::OUString();
}
//-----------------------------------------------------------------------------------
diff --git a/configmgr/source/api2/elementimpl.hxx b/configmgr/source/api2/elementimpl.hxx
index 0e887f7cbb..1fe4e99cfc 100644
--- a/configmgr/source/api2/elementimpl.hxx
+++ b/configmgr/source/api2/elementimpl.hxx
@@ -41,7 +41,6 @@ namespace configmgr
{
namespace css = ::com::sun::star;
namespace uno = ::com::sun::star::uno;
- using rtl::OUString;
/* implementations of the interfaces supported by a (parent) node
within the configuration tree.
@@ -96,24 +95,24 @@ namespace configmgr
// XNamed
//---------------------------------------------------------------------
- OUString implGetName(NodeAccess& rNode, NodeElement& rElement)
+ rtl::OUString implGetName(NodeAccess& rNode, NodeElement& rElement)
throw(uno::RuntimeException);
- void implSetName(NodeAccess& rNode, NodeElement& rElement, const OUString& aName ) // generally not supported (! - missing exception)
+ void implSetName(NodeAccess& rNode, NodeElement& rElement, const rtl::OUString& aName ) // generally not supported (! - missing exception)
throw(uno::RuntimeException);
- void implSetName(NodeAccess& rNode, SetElement& rElement, const OUString& aName ) // maybe supported
+ void implSetName(NodeAccess& rNode, SetElement& rElement, const rtl::OUString& aName ) // maybe supported
throw(uno::RuntimeException);
// XServiceInfo
//---------------------------------------------------------------------
- OUString implGetImplementationName( NodeAccess& rNode, NodeElement& rElement )
+ rtl::OUString implGetImplementationName( NodeAccess& rNode, NodeElement& rElement )
throw(uno::RuntimeException);
- sal_Bool implSupportsService( NodeAccess& rNode, NodeElement& rElement, const OUString& ServiceName )
+ sal_Bool implSupportsService( NodeAccess& rNode, NodeElement& rElement, const rtl::OUString& ServiceName )
throw(uno::RuntimeException);
- uno::Sequence< OUString > implGetSupportedServiceNames( NodeAccess& rNode, NodeElement& rElement )
+ uno::Sequence< rtl::OUString > implGetSupportedServiceNames( NodeAccess& rNode, NodeElement& rElement )
throw(uno::RuntimeException);
// Root only only
@@ -144,7 +143,7 @@ namespace configmgr
//-------------------------------------------------------------------------
// XTemplateInstance
//---------------------------------------------------------------------
- OUString implGetTemplateName(SetElement& rElement)
+ rtl::OUString implGetTemplateName(SetElement& rElement)
throw(uno::RuntimeException);
// XUnoTunnel
diff --git a/configmgr/source/api2/groupaccess.cxx b/configmgr/source/api2/groupaccess.cxx
index 66c0d5ff88..b5e32cca3a 100644
--- a/configmgr/source/api2/groupaccess.cxx
+++ b/configmgr/source/api2/groupaccess.cxx
@@ -39,21 +39,16 @@
namespace configmgr
{
- using uno::Reference;
- using uno::Sequence;
- using uno::Any;
- using uno::RuntimeException;
-
// XHierarchicalName
//------------------------------------------------------------------------------------------------------------------
-OUString SAL_CALL BasicGroupAccess::getHierarchicalName( ) throw(RuntimeException)
+rtl::OUString SAL_CALL BasicGroupAccess::getHierarchicalName( ) throw(uno::RuntimeException)
{
return configapi::implGetHierarchicalName( getNode() );
}
//------------------------------------------------------------------------------------------------------------------
-OUString SAL_CALL BasicGroupAccess::composeHierarchicalName( const OUString& sRelativeName )
- throw(css::lang::IllegalArgumentException, css::lang::NoSupportException, RuntimeException)
+rtl::OUString SAL_CALL BasicGroupAccess::composeHierarchicalName( const rtl::OUString& sRelativeName )
+ throw(css::lang::IllegalArgumentException, css::lang::NoSupportException, uno::RuntimeException)
{
return configapi::implComposeHierarchicalName( getNode(), sRelativeName );
}
@@ -64,13 +59,13 @@ OUString SAL_CALL BasicGroupAccess::composeHierarchicalName( const OUString& sRe
//-----------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------
-uno::Type SAL_CALL BasicGroupAccess::getElementType( ) throw(RuntimeException)
+uno::Type SAL_CALL BasicGroupAccess::getElementType( ) throw(uno::RuntimeException)
{
return configapi::implGetElementType( getNode() );
}
//-----------------------------------------------------------------------------------
-sal_Bool SAL_CALL BasicGroupAccess::hasElements( ) throw(RuntimeException)
+sal_Bool SAL_CALL BasicGroupAccess::hasElements( ) throw(uno::RuntimeException)
{
return configapi::implHasElements( getNode() );
}
@@ -78,7 +73,7 @@ sal_Bool SAL_CALL BasicGroupAccess::hasElements( ) throw(RuntimeException)
// XExactName
//-----------------------------------------------------------------------------------
-OUString SAL_CALL BasicGroupAccess::getExactName( const OUString& rApproximateName ) throw(RuntimeException)
+rtl::OUString SAL_CALL BasicGroupAccess::getExactName( const rtl::OUString& rApproximateName ) throw(uno::RuntimeException)
{
return configapi::implGetExactName( getNode(), rApproximateName);
}
@@ -94,34 +89,34 @@ css::beans::Property SAL_CALL BasicGroupAccess::getAsProperty( ) throw(uno::Run
// XNameAccess
//-----------------------------------------------------------------------------------
-sal_Bool SAL_CALL BasicGroupAccess::hasByName( const OUString& sName ) throw(RuntimeException)
+sal_Bool SAL_CALL BasicGroupAccess::hasByName( const rtl::OUString& sName ) throw(uno::RuntimeException)
{
return configapi::implHasByName( getNode(), sName);
}
//-----------------------------------------------------------------------------------
-Any SAL_CALL BasicGroupAccess::getByName( const OUString& sName )
- throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, RuntimeException)
+uno::Any SAL_CALL BasicGroupAccess::getByName( const rtl::OUString& sName )
+ throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException)
{
return configapi::implGetByName( getNode(), sName );
}
//-----------------------------------------------------------------------------------
-Sequence< OUString > SAL_CALL BasicGroupAccess::getElementNames( ) throw( RuntimeException)
+uno::Sequence< rtl::OUString > SAL_CALL BasicGroupAccess::getElementNames( ) throw( uno::RuntimeException)
{
return configapi::implGetElementNames( getNode() );
}
// XHierarchicalNameAccess
//-----------------------------------------------------------------------------------
-sal_Bool SAL_CALL BasicGroupAccess::hasByHierarchicalName( const OUString& sName ) throw(RuntimeException)
+sal_Bool SAL_CALL BasicGroupAccess::hasByHierarchicalName( const rtl::OUString& sName ) throw(uno::RuntimeException)
{
return configapi::implHasByHierarchicalName( getNode(), sName);
}
//-----------------------------------------------------------------------------------
-Any SAL_CALL BasicGroupAccess::getByHierarchicalName( const OUString& sName )
- throw(css::container::NoSuchElementException, RuntimeException)
+uno::Any SAL_CALL BasicGroupAccess::getByHierarchicalName( const rtl::OUString& sName )
+ throw(css::container::NoSuchElementException, uno::RuntimeException)
{
return configapi::implGetByHierarchicalName( getNode(), sName );
}
@@ -130,15 +125,15 @@ Any SAL_CALL BasicGroupAccess::getByHierarchicalName( const OUString& sName )
// XContainer
//-----------------------------------------------------------------------------------
-void SAL_CALL BasicGroupAccess::addContainerListener( const Reference< css::container::XContainerListener >& xListener )
- throw(RuntimeException)
+void SAL_CALL BasicGroupAccess::addContainerListener( const uno::Reference< css::container::XContainerListener >& xListener )
+ throw(uno::RuntimeException)
{
configapi::implAddListener( getNode(), xListener );
}
//-----------------------------------------------------------------------------------
-void SAL_CALL BasicGroupAccess::removeContainerListener( const Reference< css::container::XContainerListener >& xListener )
- throw(RuntimeException)
+void SAL_CALL BasicGroupAccess::removeContainerListener( const uno::Reference< css::container::XContainerListener >& xListener )
+ throw(uno::RuntimeException)
{
configapi::implRemoveListener( getNode(), xListener );
}
diff --git a/configmgr/source/api2/groupaccess.hxx b/configmgr/source/api2/groupaccess.hxx
index f1fd59abf8..7a6903c0c7 100644
--- a/configmgr/source/api2/groupaccess.hxx
+++ b/configmgr/source/api2/groupaccess.hxx
@@ -43,7 +43,6 @@ namespace configmgr
{
namespace css = ::com::sun::star;
namespace uno = ::com::sun::star::uno;
- using rtl::OUString;
namespace configapi { class NodeGroupInfoAccess; }
@@ -69,12 +68,12 @@ namespace configmgr
// Interface methods
// XHierarchicalName
- virtual OUString SAL_CALL
+ virtual rtl::OUString SAL_CALL
getHierarchicalName( )
throw(uno::RuntimeException);
- virtual OUString SAL_CALL
- composeHierarchicalName( const OUString& aRelativeName )
+ virtual rtl::OUString SAL_CALL
+ composeHierarchicalName( const rtl::OUString& aRelativeName )
throw(css::lang::IllegalArgumentException, css::lang::NoSupportException,
uno::RuntimeException);
@@ -89,25 +88,25 @@ namespace configmgr
// XNameAccess
virtual uno::Any SAL_CALL
- getByName( const OUString& aName )
+ getByName( const rtl::OUString& aName )
throw(css::container::NoSuchElementException, css::lang::WrappedTargetException,
uno::RuntimeException);
- virtual uno::Sequence< OUString > SAL_CALL
+ virtual uno::Sequence< rtl::OUString > SAL_CALL
getElementNames( )
throw( uno::RuntimeException);
virtual sal_Bool SAL_CALL
- hasByName( const OUString& aName )
+ hasByName( const rtl::OUString& aName )
throw(uno::RuntimeException);
// XHierarchicalNameAccess
virtual uno::Any SAL_CALL
- getByHierarchicalName( const OUString& aName )
+ getByHierarchicalName( const rtl::OUString& aName )
throw(css::container::NoSuchElementException, uno::RuntimeException);
virtual sal_Bool SAL_CALL
- hasByHierarchicalName( const OUString& aName )
+ hasByHierarchicalName( const rtl::OUString& aName )
throw(uno::RuntimeException);
// XContainer
@@ -121,7 +120,7 @@ namespace configmgr
// XExactName
virtual ::rtl::OUString SAL_CALL
- getExactName( const OUString& aApproximateName )
+ getExactName( const rtl::OUString& aApproximateName )
throw(uno::RuntimeException);
// XProperty
diff --git a/configmgr/source/api2/groupobjects.cxx b/configmgr/source/api2/groupobjects.cxx
index d57a11c76d..be1b7bd380 100644
--- a/configmgr/source/api2/groupobjects.cxx
+++ b/configmgr/source/api2/groupobjects.cxx
@@ -79,22 +79,22 @@ uno::Sequence< sal_Int8 > SAL_CALL OInnerGroupInfo::getImplementationId( ) throw
}
-NodeAccess& OInnerGroupInfo::getNodeAccess()
+configapi::NodeAccess& OInnerGroupInfo::getNodeAccess()
{
return m_aAccessElement;
}
-NodeGroupInfoAccess& OInnerGroupInfo::getNode()
+configapi::NodeGroupInfoAccess& OInnerGroupInfo::getNode()
{
return m_aAccessElement;
}
-NodeGroupAccess* OInnerGroupInfo::maybeGetUpdateAccess()
+configapi::NodeGroupAccess* OInnerGroupInfo::maybeGetUpdateAccess()
{
return 0;
}
-InnerElement& OInnerGroupInfo::getElementClass()
+configapi::InnerElement& OInnerGroupInfo::getElementClass()
{
return m_aAccessElement;
}
@@ -140,22 +140,22 @@ uno::Sequence< sal_Int8 > SAL_CALL OInnerGroupUpdate::getImplementationId( ) thr
}
-NodeAccess& OInnerGroupUpdate::getNodeAccess()
+configapi::NodeAccess& OInnerGroupUpdate::getNodeAccess()
{
return m_aAccessElement;
}
-NodeGroupInfoAccess& OInnerGroupUpdate::getNode()
+configapi::NodeGroupInfoAccess& OInnerGroupUpdate::getNode()
{
return m_aAccessElement;
}
-NodeGroupAccess* OInnerGroupUpdate::maybeGetUpdateAccess()
+configapi::NodeGroupAccess* OInnerGroupUpdate::maybeGetUpdateAccess()
{
return &m_aAccessElement;
}
-InnerElement& OInnerGroupUpdate::getElementClass()
+configapi::InnerElement& OInnerGroupUpdate::getElementClass()
{
return m_aAccessElement;
}
@@ -201,22 +201,22 @@ uno::Sequence< sal_Int8 > SAL_CALL OSetElementGroupInfo::getImplementationId( )
}
-NodeAccess& OSetElementGroupInfo::getNodeAccess()
+configapi::NodeAccess& OSetElementGroupInfo::getNodeAccess()
{
return m_aAccessElement;
}
-NodeGroupInfoAccess& OSetElementGroupInfo::getNode()
+configapi::NodeGroupInfoAccess& OSetElementGroupInfo::getNode()
{
return m_aAccessElement;
}
-NodeGroupAccess* OSetElementGroupInfo::maybeGetUpdateAccess()
+configapi::NodeGroupAccess* OSetElementGroupInfo::maybeGetUpdateAccess()
{
return 0;
}
-SetElement& OSetElementGroupInfo::getElementClass()
+configapi::SetElement& OSetElementGroupInfo::getElementClass()
{
return m_aAccessElement;
}
@@ -262,22 +262,22 @@ uno::Sequence< sal_Int8 > SAL_CALL OSetElementGroupUpdate::getImplementationId(
}
-NodeAccess& OSetElementGroupUpdate::getNodeAccess()
+configapi::NodeAccess& OSetElementGroupUpdate::getNodeAccess()
{
return m_aAccessElement;
}
-NodeGroupInfoAccess& OSetElementGroupUpdate::getNode()
+configapi::NodeGroupInfoAccess& OSetElementGroupUpdate::getNode()
{
return m_aAccessElement;
}
-NodeGroupAccess* OSetElementGroupUpdate::maybeGetUpdateAccess()
+configapi::NodeGroupAccess* OSetElementGroupUpdate::maybeGetUpdateAccess()
{
return &m_aAccessElement;
}
-SetElement& OSetElementGroupUpdate::getElementClass()
+configapi::SetElement& OSetElementGroupUpdate::getElementClass()
{
return m_aAccessElement;
}
@@ -323,22 +323,22 @@ uno::Sequence< sal_Int8 > SAL_CALL ORootElementGroupInfo::getImplementationId( )
}
-NodeAccess& ORootElementGroupInfo::getNodeAccess()
+configapi::NodeAccess& ORootElementGroupInfo::getNodeAccess()
{
return m_aAccessElement;
}
-NodeGroupInfoAccess& ORootElementGroupInfo::getNode()
+configapi::NodeGroupInfoAccess& ORootElementGroupInfo::getNode()
{
return m_aAccessElement;
}
-NodeGroupAccess* ORootElementGroupInfo::maybeGetUpdateAccess()
+configapi::NodeGroupAccess* ORootElementGroupInfo::maybeGetUpdateAccess()
{
return 0;
}
-RootElement& ORootElementGroupInfo::getElementClass()
+configapi::RootElement& ORootElementGroupInfo::getElementClass()
{
return m_aAccessElement;
}
@@ -384,22 +384,22 @@ uno::Sequence< sal_Int8 > SAL_CALL ORootElementGroupUpdate::getImplementationId(
}
-NodeAccess& ORootElementGroupUpdate::getNodeAccess()
+configapi::NodeAccess& ORootElementGroupUpdate::getNodeAccess()
{
return m_aAccessElement;
}
-NodeGroupInfoAccess& ORootElementGroupUpdate::getNode()
+configapi::NodeGroupInfoAccess& ORootElementGroupUpdate::getNode()
{
return m_aAccessElement;
}
-NodeGroupAccess* ORootElementGroupUpdate::maybeGetUpdateAccess()
+configapi::NodeGroupAccess* ORootElementGroupUpdate::maybeGetUpdateAccess()
{
return &m_aAccessElement;
}
-UpdateRootElement& ORootElementGroupUpdate::getElementClass()
+configapi::UpdateRootElement& ORootElementGroupUpdate::getElementClass()
{
return m_aAccessElement;
}
diff --git a/configmgr/source/api2/groupobjects.hxx b/configmgr/source/api2/groupobjects.hxx
index 1551e61f54..7393c929f3 100644
--- a/configmgr/source/api2/groupobjects.hxx
+++ b/configmgr/source/api2/groupobjects.hxx
@@ -42,17 +42,6 @@
namespace configmgr
{
//........................................................................
- using configapi::ApiTreeImpl;
- using configapi::ApiProvider;
-
- using configapi::NodeAccess;
- using configapi::NodeGroupInfoAccess;
- using configapi::NodeGroupAccess;
-
- using configapi::InnerElement;
- using configapi::SetElement;
- using configapi::RootElement;
- using configapi::UpdateRootElement;
//==========================================================================
//= Inner Group Instances
@@ -67,7 +56,7 @@ namespace configmgr
{
public:
// Construction/Destruction
- OInnerGroupInfo(ApiTreeImpl& rTree, configuration::NodeRef const& aNode)
+ OInnerGroupInfo(configapi::ApiTreeImpl& rTree, configuration::NodeRef const& aNode)
: m_aAccessElement(static_cast<css::container::XChild*>(this),rTree,aNode)
{
}
@@ -84,12 +73,12 @@ namespace configmgr
uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException );
// Base class implementation
- virtual NodeAccess& getNodeAccess();
- virtual NodeGroupInfoAccess& getNode();
- virtual NodeGroupAccess* maybeGetUpdateAccess();
- virtual InnerElement& getElementClass();
+ virtual configapi::NodeAccess& getNodeAccess();
+ virtual configapi::NodeGroupInfoAccess& getNode();
+ virtual configapi::NodeGroupAccess* maybeGetUpdateAccess();
+ virtual configapi::InnerElement& getElementClass();
private:
- configapi::OInnerGroupInfoAccess m_aAccessElement;
+ configapi::OInnerElement<configapi::NodeGroupInfoAccess> m_aAccessElement;
};
/** updating access class for configuration nodes which are inner nodes and groups of other nodes
@@ -101,7 +90,7 @@ namespace configmgr
{
public:
// Construction/Destruction
- OInnerGroupUpdate(ApiTreeImpl& rTree, configuration::NodeRef const& aNode)
+ OInnerGroupUpdate(configapi::ApiTreeImpl& rTree, configuration::NodeRef const& aNode)
: m_aAccessElement(static_cast<css::container::XChild*>(this),rTree,aNode)
{
}
@@ -118,12 +107,12 @@ namespace configmgr
uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException );
// Base class implementation
- virtual NodeAccess& getNodeAccess();
- virtual NodeGroupInfoAccess& getNode();
- virtual NodeGroupAccess* maybeGetUpdateAccess();
- virtual InnerElement& getElementClass();
+ virtual configapi::NodeAccess& getNodeAccess();
+ virtual configapi::NodeGroupInfoAccess& getNode();
+ virtual configapi::NodeGroupAccess* maybeGetUpdateAccess();
+ virtual configapi::InnerElement& getElementClass();
private:
- configapi::OInnerGroupUpdateAccess m_aAccessElement;
+ configapi::OInnerElement<configapi::NodeGroupAccess> m_aAccessElement;
};
@@ -140,11 +129,11 @@ namespace configmgr
{
public:
// Construction/Destruction
- OSetElementGroupInfo(configuration::TreeRef const& aTree, ApiTreeImpl& rParentTree)
+ OSetElementGroupInfo(rtl::Reference< configuration::Tree > const& aTree, configapi::ApiTreeImpl& rParentTree)
: m_aAccessElement(static_cast<css::container::XChild*>(this),aTree,rParentTree)
{
}
- OSetElementGroupInfo(configuration::TreeRef const& aTree, ApiProvider& rProvider, ApiTreeImpl* pParentTree = 0)
+ OSetElementGroupInfo(rtl::Reference< configuration::Tree > const& aTree, configapi::ApiProvider& rProvider, configapi::ApiTreeImpl* pParentTree = 0)
: m_aAccessElement(static_cast<css::container::XChild*>(this),aTree,rProvider,pParentTree)
{
}
@@ -161,12 +150,12 @@ namespace configmgr
uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException );
// Base class implementation
- virtual NodeAccess& getNodeAccess();
- virtual NodeGroupInfoAccess& getNode();
- virtual NodeGroupAccess* maybeGetUpdateAccess();
- virtual SetElement& getElementClass();
+ virtual configapi::NodeAccess& getNodeAccess();
+ virtual configapi::NodeGroupInfoAccess& getNode();
+ virtual configapi::NodeGroupAccess* maybeGetUpdateAccess();
+ virtual configapi::SetElement& getElementClass();
private:
- configapi::OSetElementGroupInfoAccess m_aAccessElement;
+ configapi::OSetElement<configapi::NodeGroupInfoAccess> m_aAccessElement;
};
/** updating access class for configuration nodes which are set elements and groups of other nodes
@@ -178,11 +167,11 @@ namespace configmgr
{
public:
// Construction/Destruction
- OSetElementGroupUpdate(configuration::TreeRef const& aTree, ApiTreeImpl& rParentTree)
+ OSetElementGroupUpdate(rtl::Reference< configuration::Tree > const& aTree, configapi::ApiTreeImpl& rParentTree)
: m_aAccessElement(static_cast<css::container::XChild*>(this),aTree,rParentTree)
{
}
- OSetElementGroupUpdate(configuration::TreeRef const& aTree, ApiProvider& rProvider, ApiTreeImpl* pParentTree = 0)
+ OSetElementGroupUpdate(rtl::Reference< configuration::Tree > const& aTree, configapi::ApiProvider& rProvider, configapi::ApiTreeImpl* pParentTree = 0)
: m_aAccessElement(static_cast<css::container::XChild*>(this),aTree,rProvider,pParentTree)
{
}
@@ -199,12 +188,12 @@ namespace configmgr
uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException );
// Base class implementation
- virtual NodeAccess& getNodeAccess();
- virtual NodeGroupInfoAccess& getNode();
- virtual NodeGroupAccess* maybeGetUpdateAccess();
- virtual SetElement& getElementClass();
+ virtual configapi::NodeAccess& getNodeAccess();
+ virtual configapi::NodeGroupInfoAccess& getNode();
+ virtual configapi::NodeGroupAccess* maybeGetUpdateAccess();
+ virtual configapi::SetElement& getElementClass();
private:
- configapi::OSetElementGroupUpdateAccess m_aAccessElement;
+ configapi::OSetElement<configapi::NodeGroupAccess> m_aAccessElement;
};
@@ -221,7 +210,7 @@ namespace configmgr
{
public:
// Construction/Destruction
- ORootElementGroupInfo(ApiProvider& rProvider, configuration::Tree const& aTree, vos::ORef< OOptions >const& _xOptions)
+ ORootElementGroupInfo(configapi::ApiProvider& rProvider, rtl::Reference< configuration::Tree > const& aTree, vos::ORef< OOptions >const& _xOptions)
: m_aAccessElement(static_cast<css::lang::XComponent*>(this),rProvider,aTree, _xOptions)
{
}
@@ -238,12 +227,12 @@ namespace configmgr
uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException );
// Base class implementation
- virtual NodeAccess& getNodeAccess();
- virtual NodeGroupInfoAccess& getNode();
- virtual NodeGroupAccess* maybeGetUpdateAccess();
- virtual RootElement& getElementClass();
+ virtual configapi::NodeAccess& getNodeAccess();
+ virtual configapi::NodeGroupInfoAccess& getNode();
+ virtual configapi::NodeGroupAccess* maybeGetUpdateAccess();
+ virtual configapi::RootElement& getElementClass();
private:
- configapi::ORootElementGroupInfoAccess m_aAccessElement;
+ configapi::OReadRootElement<configapi::NodeGroupInfoAccess> m_aAccessElement;
};
/** updating access class for configuration nodes which are root nodes and groups of other nodes
@@ -255,7 +244,7 @@ namespace configmgr
{
public:
// Construction/Destruction
- ORootElementGroupUpdate(ApiProvider& rProvider, configuration::Tree const& aTree, vos::ORef< OOptions >const& _xOptions)
+ ORootElementGroupUpdate(configapi::ApiProvider& rProvider, rtl::Reference< configuration::Tree > const& aTree, vos::ORef< OOptions >const& _xOptions)
: m_aAccessElement(static_cast<css::lang::XComponent*>(this),rProvider,aTree, _xOptions)
{
}
@@ -272,12 +261,12 @@ namespace configmgr
uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException );
// Base class implementation
- virtual NodeAccess& getNodeAccess();
- virtual NodeGroupInfoAccess& getNode();
- virtual NodeGroupAccess* maybeGetUpdateAccess();
- virtual UpdateRootElement& getElementClass();
+ virtual configapi::NodeAccess& getNodeAccess();
+ virtual configapi::NodeGroupInfoAccess& getNode();
+ virtual configapi::NodeGroupAccess* maybeGetUpdateAccess();
+ virtual configapi::UpdateRootElement& getElementClass();
private:
- configapi::ORootElementGroupUpdateAccess m_aAccessElement;
+ configapi::OUpdateRootElement<configapi::NodeGroupAccess> m_aAccessElement;
};
diff --git a/configmgr/source/api2/groupupdate.cxx b/configmgr/source/api2/groupupdate.cxx
index a9ffbc7dc4..15ce940d4d 100644
--- a/configmgr/source/api2/groupupdate.cxx
+++ b/configmgr/source/api2/groupupdate.cxx
@@ -42,13 +42,6 @@
namespace configmgr
{
//////////////////////////////////////////////////////////////////////////////////
-
- using uno::Reference;
- using uno::Sequence;
- using uno::Any;
- using uno::RuntimeException;
-
-//////////////////////////////////////////////////////////////////////////////////
// class BasicGroup
//////////////////////////////////////////////////////////////////////////////////
@@ -56,7 +49,7 @@ namespace configmgr
//////////////////////////////////////////////////////////////////////////////////
uno::Any SAL_CALL BasicGroup::queryInterface( uno::Type const& rType ) throw (uno::RuntimeException )
{
- Any aRet = BasicGroupAccess::queryInterface( rType );
+ uno::Any aRet = BasicGroupAccess::queryInterface( rType );
if (!aRet.hasValue())
{
aRet = cppu::queryInterface(rType
@@ -92,7 +85,7 @@ configapi::NodeGroupAccess& BasicGroup::getGroupNode()
if (!pAccess)
{
throw uno::RuntimeException(
- OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: Invalid Object - internal update interface missing.")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: Invalid Object - internal update interface missing.")),
static_cast< css::container::XNameReplace * >(this)
);
}
@@ -102,7 +95,7 @@ configapi::NodeGroupAccess& BasicGroup::getGroupNode()
// New Interface methods
// XNameReplace
//////////////////////////////////////////////////////////////////////////////////
-void SAL_CALL BasicGroup::replaceByName( const OUString& rName, const uno::Any& rElement )
+void SAL_CALL BasicGroup::replaceByName( const rtl::OUString& rName, const uno::Any& rElement )
throw(css::lang::IllegalArgumentException, css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException)
{
configapi::implReplaceByName( getGroupNode(), rName, rElement );
diff --git a/configmgr/source/api2/groupupdate.hxx b/configmgr/source/api2/groupupdate.hxx
index cf40a0685b..ad85036b7c 100644
--- a/configmgr/source/api2/groupupdate.hxx
+++ b/configmgr/source/api2/groupupdate.hxx
@@ -71,20 +71,20 @@ namespace configmgr
{ return BasicGroupAccess::hasElements(); }
// XNameAccess forwarding
- virtual uno::Any SAL_CALL getByName( const OUString& aName )
+ virtual uno::Any SAL_CALL getByName( const rtl::OUString& aName )
throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException)
{ return BasicGroupAccess::getByName(aName); }
- virtual uno::Sequence< OUString > SAL_CALL getElementNames( ) throw( uno::RuntimeException)
+ virtual uno::Sequence< rtl::OUString > SAL_CALL getElementNames( ) throw( uno::RuntimeException)
{ return BasicGroupAccess::getElementNames(); }
- virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) throw(uno::RuntimeException)
+ virtual sal_Bool SAL_CALL hasByName( const rtl::OUString& aName ) throw(uno::RuntimeException)
{ return BasicGroupAccess::hasByName(aName); }
// New Interface methods
// XNameReplace
virtual void SAL_CALL
- replaceByName( const OUString& rName, const uno::Any& rElement )
+ replaceByName( const rtl::OUString& rName, const uno::Any& rElement )
throw(css::lang::IllegalArgumentException, css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException);
protected:
diff --git a/configmgr/source/api2/listenercontainer.cxx b/configmgr/source/api2/listenercontainer.cxx
index bad5ad4997..5f54d6f77f 100644
--- a/configmgr/source/api2/listenercontainer.cxx
+++ b/configmgr/source/api2/listenercontainer.cxx
@@ -46,7 +46,7 @@ namespace configmgr
// class DisposeNotifier
//-----------------------------------------------------------------------------
-void DisposeNotifier::appendAndClearContainer(ListenerContainer* pContainer)
+void DisposeNotifier::appendAndClearContainer(cppu::OInterfaceContainerHelper* pContainer)
{
if (pContainer)
{
@@ -54,7 +54,7 @@ void DisposeNotifier::appendAndClearContainer(ListenerContainer* pContainer)
cppu::OInterfaceIteratorHelper aIterator(*pContainer);
while (aIterator.hasMoreElements())
{
- aListeners.push_back(Listener::query(aIterator.next()));
+ aListeners.push_back(uno::Reference< lang::XEventListener >::query(aIterator.next()));
}
}
pContainer->clear();
@@ -63,7 +63,7 @@ void DisposeNotifier::appendAndClearContainer(ListenerContainer* pContainer)
//-----------------------------------------------------------------------------
void DisposeNotifier::notify()
{
- for(Listeners::iterator it = aListeners.begin(); it != aListeners.end(); ++it)
+ for(std::vector< uno::Reference< lang::XEventListener > >::iterator it = aListeners.begin(); it != aListeners.end(); ++it)
{
if (it->is())
{
diff --git a/configmgr/source/api2/listenercontainer.hxx b/configmgr/source/api2/listenercontainer.hxx
index 67445c69da..cff7a1ff92 100644
--- a/configmgr/source/api2/listenercontainer.hxx
+++ b/configmgr/source/api2/listenercontainer.hxx
@@ -34,6 +34,7 @@
#include <com/sun/star/lang/XEventListener.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
#include <cppuhelper/interfacecontainer.hxx>
+#include "datalock.hxx"
#include "utility.hxx"
#include <osl/diagnose.h>
@@ -47,13 +48,7 @@ namespace configmgr
namespace css = ::com::sun::star;
namespace uno = css::uno;
namespace lang = css::lang;
-
- typedef uno::Type UnoType;
- typedef uno::XInterface UnoInterface;
- typedef uno::Reference<uno::XInterface> UnoInterfaceRef;
//-----------------------------------------------------------------------------
- typedef cppu::OInterfaceContainerHelper ListenerContainer;
-
template <class Listener>
class ListenerContainerIterator
{
@@ -67,7 +62,7 @@ namespace configmgr
*
* @param rCont the container of the elements.
*/
- ListenerContainerIterator( ListenerContainer& rCont )
+ ListenerContainerIterator( cppu::OInterfaceContainerHelper& rCont )
: m_aIter(rCont)
, m_xNext()
{ advance(); }
@@ -94,42 +89,31 @@ namespace configmgr
//-----------------------------------------------------------------------------
class DisposeNotifier
{
- typedef uno::Reference< lang::XEventListener > Listener;
- typedef std::vector< Listener > Listeners;
lang::EventObject aEvent;
- Listeners aListeners;
+ std::vector< uno::Reference< lang::XEventListener > > aListeners;
public:
explicit
- DisposeNotifier(UnoInterfaceRef const& aInterface) : aEvent(aInterface) {}
+ DisposeNotifier(uno::Reference<uno::XInterface> const& aInterface) : aEvent(aInterface) {}
- void appendAndClearContainer(ListenerContainer* pContainer);
+ void appendAndClearContainer(cppu::OInterfaceContainerHelper* pContainer);
void notify();
};
//-----------------------------------------------------------------------------
+ struct BasicContainerInfo
+ {
+ uno::XInterface* pInterface;
+ cppu::OMultiTypeInterfaceContainerHelper* pContainer;
+ BasicContainerInfo() : pInterface(0), pContainer(0) {}
+ };
+
template <class Key_, class KeyHash_, class KeyEq_, class KeyToIndex_>
class SpecialListenerContainer
{
public:
- typedef cppu::OMultiTypeInterfaceContainerHelper BasicContainerHelper;
- struct BasicContainerInfo
- {
- UnoInterface* pInterface;
- BasicContainerHelper* pContainer;
- BasicContainerInfo() : pInterface(0), pContainer(0) {}
- };
- typedef std::vector<BasicContainerInfo> BasicContainerHelperArray;
- typedef typename BasicContainerHelperArray::size_type Index;
-
- typedef Key_ Key;
- typedef cppu::OMultiTypeInterfaceContainerHelperVar< Key_,KeyHash_,KeyEq_ > SpecialContainerHelper;
- typedef cppu::OBroadcastHelperVar< SpecialContainerHelper, Key > SpecialBroadcastHelper;
- typedef std::vector<Key> KeyList;
-
- public:
/**
* Create a container of interface containers.
*/
- SpecialListenerContainer(Index nCount, KeyToIndex_ aMapper)
+ SpecialListenerContainer(std::vector<BasicContainerInfo>::size_type nCount, KeyToIndex_ aMapper)
: m_aSpecialHelper(UnoApiLock::getLock())
, m_aContainers(nCount)
, m_aMapper(aMapper)
@@ -160,18 +144,18 @@ namespace configmgr
bool isDisposed()volatile const throw();
/// return whether the object is present in this container
- bool isAvailable(Index nIndex) const throw()
+ bool isAvailable(std::vector<BasicContainerInfo>::size_type nIndex) const throw()
{
return nIndex < m_aContainers.size() && m_aContainers[nIndex].pInterface;
}
- Index getSize() const
+ std::vector<BasicContainerInfo>::size_type getSize() const
{
return m_aContainers.size();
}
/// return the interface associated with an index
- void setObjectAt(Index nIndex, UnoInterface* pInterface)
+ void setObjectAt(std::vector<BasicContainerInfo>::size_type nIndex, uno::XInterface* pInterface)
{
OSL_ENSURE( !isDisposed(), "object is disposed" );
@@ -191,17 +175,17 @@ namespace configmgr
/// return the interface associated with an index
- UnoInterfaceRef getObjectAt(Index nIndex) const
+ uno::Reference<uno::XInterface> getObjectAt(std::vector<BasicContainerInfo>::size_type nIndex) const
{
- UnoInterfaceRef xRet( nIndex < m_aContainers.size() ? m_aContainers[nIndex].pInterface : 0 );
+ uno::Reference<uno::XInterface> xRet( nIndex < m_aContainers.size() ? m_aContainers[nIndex].pInterface : 0 );
return xRet;
}
/// return the interface associated with an index
- UnoInterfaceRef getObjectForKey(Key const& aKey ) const
+ uno::Reference<uno::XInterface> getObjectForKey(Key_ const& aKey ) const
{
- Index nIndex = m_aMapper.findIndexForKey(aKey);
- UnoInterfaceRef xRet( nIndex < m_aContainers.size() ? m_aContainers[nIndex].pInterface : 0 );
+ std::vector<BasicContainerInfo>::size_type nIndex = m_aMapper.findIndexForKey(aKey);
+ uno::Reference<uno::XInterface> xRet( nIndex < m_aContainers.size() ? m_aContainers[nIndex].pInterface : 0 );
return xRet;
}
@@ -210,7 +194,7 @@ namespace configmgr
* and in the containers for the associated indices
* support XEventListener. Then clear the container.
*/
- bool disposeOne( Index anIndex ) throw();
+ bool disposeOne( std::vector<BasicContainerInfo>::size_type anIndex ) throw();
/**
* Start disposing this object
@@ -241,7 +225,7 @@ namespace configmgr
* @return the container created under this key. If the container
* was not created, null was returned.
*/
- ListenerContainer * getSpecialContainer( const Key_ & aKey) const
+ cppu::OInterfaceContainerHelper * getSpecialContainer( const Key_ & aKey) const
{ return m_aSpecialHelper.aLC.getContainer(aKey); }
/**
@@ -249,7 +233,7 @@ namespace configmgr
* @return the container helper created under this key. If the container helper
* was not created, null was returned.
*/
- BasicContainerHelper * getContainerHelper( Index nIndex) const
+ cppu::OMultiTypeInterfaceContainerHelper * getContainerHelper( std::vector<BasicContainerInfo>::size_type nIndex) const
{
return ((nIndex < m_aContainers.size()) ? m_aContainers[nIndex].pContainer : 0 );
}
@@ -258,9 +242,9 @@ namespace configmgr
* @return the container created under this key. If the container
* was not created, null was returned.
*/
- ListenerContainer * getContainer( Index nIndex, const UnoType & aType) const
+ cppu::OInterfaceContainerHelper * getContainer( std::vector<BasicContainerInfo>::size_type nIndex, const uno::Type & aType) const
{
- BasicContainerHelper* pContainer = (nIndex < m_aContainers.size()) ? m_aContainers[nIndex].pContainer : 0 ;
+ cppu::OMultiTypeInterfaceContainerHelper* pContainer = (nIndex < m_aContainers.size()) ? m_aContainers[nIndex].pContainer : 0 ;
return pContainer ? pContainer->getContainer(aType) : 0;
}
@@ -273,7 +257,7 @@ namespace configmgr
* the same pointer more than once.
* @return the new count of elements in the container (or 0 if the object is ready being disposed).
*/
- sal_Int32 addListener( Index nIndex, const UnoType& aType, uno::Reference< lang::XEventListener > const& xListener) throw();
+ sal_Int32 addListener( std::vector<BasicContainerInfo>::size_type nIndex, const uno::Type& aType, uno::Reference< lang::XEventListener > const& xListener) throw();
/**
* Remove an element from the container specified with the index and type.
@@ -282,7 +266,7 @@ namespace configmgr
* @param xListener the removed interface.
* @return the new count of elements in the container (or 0 if the object is ready being disposed).
*/
- sal_Int32 removeListener( Index nIndex, const UnoType& aType, uno::Reference< lang::XEventListener > const& xListener) throw();
+ sal_Int32 removeListener( std::vector<BasicContainerInfo>::size_type nIndex, const uno::Type& aType, uno::Reference< lang::XEventListener > const& xListener) throw();
/**
@@ -305,10 +289,10 @@ namespace configmgr
sal_Int32 removeSpecialListener( const Key_& aKey, uno::Reference< lang::XEventListener > const& xListener) throw();
private:
- void implFillDisposer(DisposeNotifier& aNotifier, Index nIndex);
+ void implFillDisposer(DisposeNotifier& aNotifier, std::vector<BasicContainerInfo>::size_type nIndex);
- SpecialBroadcastHelper m_aSpecialHelper;
- BasicContainerHelperArray m_aContainers;
+ cppu::OBroadcastHelperVar< cppu::OMultiTypeInterfaceContainerHelperVar< Key_,KeyHash_,KeyEq_ >, Key_ > m_aSpecialHelper;
+ std::vector<BasicContainerInfo> m_aContainers;
KeyToIndex_ m_aMapper;
bool m_bDisposeLock;
};
@@ -348,14 +332,14 @@ namespace configmgr
}
//-----------------------------------------------------------------------------
template <class Key_, class KeyHash_, class KeyEq_, class KeyToIndex_>
- bool SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::disposeOne(Index nIndex) throw()
+ bool SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::disposeOne(std::vector<BasicContainerInfo>::size_type nIndex) throw()
{
// OSL_ENSURE(!isDisposed(),"Object is already disposed in toto");
if (isAlive())
{
if (nIndex < m_aContainers.size())
{
- if (UnoInterface* pObject = m_aContainers[nIndex].pInterface)
+ if (uno::XInterface* pObject = m_aContainers[nIndex].pInterface)
{
DisposeNotifier aNotifier(pObject);
@@ -398,12 +382,12 @@ namespace configmgr
lang::EventObject aBaseEvt;
std::vector<DisposeNotifier> aNotifiers;
- if (Index size = m_aContainers.size())
+ if (std::vector<BasicContainerInfo>::size_type size = m_aContainers.size())
{
aNotifiers.reserve(m_aContainers.size());
aBaseEvt.Source = m_aContainers[0].pInterface;
- for(Index ix = 0; ix < size; ++ix)
+ for(std::vector<BasicContainerInfo>::size_type ix = 0; ix < size; ++ix)
{
if (m_aContainers[ix].pInterface)
{
@@ -417,7 +401,7 @@ namespace configmgr
m_bDisposeLock = false;
- for(Index jx = 0, count = aNotifiers.size(); jx < count; ++jx)
+ for(std::vector<BasicContainerInfo>::size_type jx = 0, count = aNotifiers.size(); jx < count; ++jx)
{
aNotifiers[jx].notify();
}
@@ -446,14 +430,14 @@ namespace configmgr
}
//-----------------------------------------------------------------------------
template <class Key_, class KeyHash_, class KeyEq_, class KeyToIndex_>
- sal_Int32 SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::addListener( Index nIndex, const UnoType& aType, const uno::Reference< lang::XEventListener > & xListener ) throw()
+ sal_Int32 SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::addListener( std::vector<BasicContainerInfo>::size_type nIndex, const uno::Type& aType, const uno::Reference< lang::XEventListener > & xListener ) throw()
{
if ( nIndex < m_aContainers.size() && m_aContainers[nIndex].pInterface )
{
if ( isAlive() )
{
if (m_aContainers[nIndex].pContainer == 0)
- m_aContainers[nIndex].pContainer = new BasicContainerHelper(UnoApiLock::getLock());
+ m_aContainers[nIndex].pContainer = new cppu::OMultiTypeInterfaceContainerHelper(UnoApiLock::getLock());
return m_aContainers[nIndex].pContainer->addInterface(aType,xListener);
}
@@ -474,7 +458,7 @@ namespace configmgr
template <class Key_, class KeyHash_, class KeyEq_, class KeyToIndex_>
sal_Int32 SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::addSpecialListener( const Key_& aKey, const uno::Reference< lang::XEventListener > & xListener ) throw()
{
- Index nIndex = m_aMapper.findIndexForKey(aKey);
+ std::vector<BasicContainerInfo>::size_type nIndex = m_aMapper.findIndexForKey(aKey);
if ( nIndex < m_aContainers.size() && m_aContainers[nIndex].pInterface )
{
if ( isAlive() )
@@ -496,7 +480,7 @@ namespace configmgr
//-----------------------------------------------------------------------------
template <class Key_, class KeyHash_, class KeyEq_, class KeyToIndex_>
- sal_Int32 SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::removeListener( Index nIndex, const UnoType& aType, const uno::Reference< lang::XEventListener > & xListener ) throw()
+ sal_Int32 SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::removeListener( std::vector<BasicContainerInfo>::size_type nIndex, const uno::Type& aType, const uno::Reference< lang::XEventListener > & xListener ) throw()
{
OSL_ENSURE( !isDisposed(), "object is disposed" );
@@ -533,7 +517,7 @@ namespace configmgr
//-----------------------------------------------------------------------------
// relation function. Uses KeyToIndex
template <class Key_, class KeyHash_, class KeyEq_, class KeyToIndex_>
- bool SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::findKeysForIndex(Index nIndex, KeyList & aKeys)
+ bool SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::findKeysForIndex(std::vector<BasicContainerInfo>::size_type nIndex, std::vector<Key_> & aKeys)
{
aKeys.clear();
m_aMapper.findKeysForIndex(nIndex,aKeys);
@@ -542,25 +526,25 @@ namespace configmgr
*///-----------------------------------------------------------------------------
// relation function. Uses KeyToIndex
template <class Key_, class KeyHash_, class KeyEq_, class KeyToIndex_>
- void SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::implFillDisposer(DisposeNotifier& aNotifier, Index nIndex)
+ void SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::implFillDisposer(DisposeNotifier& aNotifier, std::vector<BasicContainerInfo>::size_type nIndex)
{
- if (BasicContainerHelper* pMultiContainer = m_aContainers[nIndex].pContainer)
+ if (cppu::OMultiTypeInterfaceContainerHelper* pMultiContainer = m_aContainers[nIndex].pContainer)
{
- uno::Sequence< UnoType > aTypes(pMultiContainer->getContainedTypes());
+ uno::Sequence< uno::Type > aTypes(pMultiContainer->getContainedTypes());
for (sal_Int32 ix = 0; ix < aTypes.getLength(); ++ix)
{
- ListenerContainer* pContainer = pMultiContainer->getContainer(aTypes[ix]);
+ cppu::OInterfaceContainerHelper* pContainer = pMultiContainer->getContainer(aTypes[ix]);
OSL_ENSURE(pContainer,"No container, but the type ?");
if (pContainer)
aNotifier.appendAndClearContainer(pContainer);
}
}
- KeyList aKeys;
+ std::vector<Key_> aKeys;
if (m_aMapper.findKeysForIndex(nIndex,aKeys))
{
- for(typename KeyList::iterator it = aKeys.begin(); it != aKeys.end(); ++it)
+ for(typename std::vector<Key_>::iterator it = aKeys.begin(); it != aKeys.end(); ++it)
{
- if (ListenerContainer* pContainer = m_aSpecialHelper.aLC.getContainer(*it))
+ if (cppu::OInterfaceContainerHelper* pContainer = m_aSpecialHelper.aLC.getContainer(*it))
{
aNotifier.appendAndClearContainer(pContainer);
}
diff --git a/configmgr/source/api2/makefile.mk b/configmgr/source/api2/makefile.mk
index 140e7b0643..f5c9ca4792 100644
--- a/configmgr/source/api2/makefile.mk
+++ b/configmgr/source/api2/makefile.mk
@@ -47,8 +47,6 @@ SLOFILES= \
$(SLO)$/listenercontainer.obj \
$(SLO)$/provider.obj \
$(SLO)$/providerimpl.obj \
- $(SLO)$/confprovider2.obj \
- $(SLO)$/confproviderimpl2.obj \
$(SLO)$/accessimpl.obj \
$(SLO)$/apiaccessobj.obj \
$(SLO)$/apiserviceinfo.obj \
diff --git a/configmgr/source/api2/notifierimpl.hxx b/configmgr/source/api2/notifierimpl.hxx
index b0fffe2215..445ef00d31 100644
--- a/configmgr/source/api2/notifierimpl.hxx
+++ b/configmgr/source/api2/notifierimpl.hxx
@@ -53,55 +53,46 @@ namespace configmgr
{
// ---------------------------------------------------------------------------------------------------
+ struct SubNodeHash
+ {
+ size_t operator() (const configuration::SubNodeID& rKey) const {return rKey.hashCode();}
+ };
+ struct SubNodeEq
+ {
+ bool operator() (const configuration::SubNodeID& lhs,const configuration::SubNodeID& rhs) const {return lhs == rhs;}
+ };
+ struct SubNodeToIndex
+ {
+ rtl::Reference< configuration::Tree > aTree;
+
+ SubNodeToIndex( rtl::Reference< configuration::Tree > const& rTree ) : aTree(rTree) {}
+
+ bool findKeysForIndex(unsigned int nNode, std::vector<configuration::SubNodeID>& aList)
+ {
+ aList.clear();
+ configuration::getAllChildrenHelper(configuration::findNodeFromIndex(aTree,nNode), aList);
+ return !aList.empty();
+ }
+ unsigned int findIndexForKey(configuration::SubNodeID const& aNode)
+ {
+ return aNode.getParentID().toIndex();
+ }
+ };
+
/// manages collections of event listeners observing a whole config tree, thread-safe
class NotifierImpl : public vos::OReference
{
public:
- typedef configuration::SubNodeID SubNodeID;
- typedef configuration::SubNodeIDList SubNodeList;
- typedef configuration::NodeID NodeID;
- typedef configuration::NodeOffset NodeOffset;
-
- struct SubNodeHash
- {
- size_t operator() (const SubNodeID& rKey) const {return rKey.hashCode();}
- };
- struct SubNodeEq
- {
- bool operator() (const SubNodeID& lhs,const SubNodeID& rhs) const {return lhs == rhs;}
- };
- struct SubNodeToIndex
- {
- configuration::TreeRef aTree;
-
- SubNodeToIndex( configuration::TreeRef const& rTree ) : aTree(rTree) {}
-
- bool findKeysForIndex(NodeOffset nNode, SubNodeList& aList)
- {
- using configuration::getAllChildrenHelper;
- using configuration::findNodeFromIndex;
- aList.clear();
- getAllChildrenHelper(findNodeFromIndex(aTree,nNode), aList);
- return !aList.empty();
- }
- NodeOffset findIndexForKey(SubNodeID const& aNode)
- {
- return aNode.getParentID().toIndex();
- }
- };
- typedef SpecialListenerContainer <SubNodeID,SubNodeHash,SubNodeEq,SubNodeToIndex> SpecialContainer;
-
- public:
- SpecialContainer m_aListeners;
+ SpecialListenerContainer <configuration::SubNodeID,SubNodeHash,SubNodeEq,SubNodeToIndex> m_aListeners;
public:
/// construct this around the given Implementation, for the given tree
explicit
- NotifierImpl(configuration::TreeRef const& aTree);
+ NotifierImpl(rtl::Reference< configuration::Tree > const& aTree);
~NotifierImpl();
/// Add a <type scope='com::sun::star::lang'>XEventListener</type> observing <var>aNode</var>.
- void add(NodeID const& aNode, uno::Reference< css::lang::XEventListener > const& xListener)
+ void add(configuration::NodeID const& aNode, uno::Reference< css::lang::XEventListener > const& xListener)
{
OSL_PRECOND(xListener.is(), "ERROR: Unexpected NULL listener");
@@ -110,7 +101,7 @@ namespace configmgr
}
/// Add a <type scope='com::sun::star::container'>XContainerListener</type> observing <var>aNode</var>.
- void add(NodeID const& aNode, uno::Reference< css::container::XContainerListener > const& xListener)
+ void add(configuration::NodeID const& aNode, uno::Reference< css::container::XContainerListener > const& xListener)
{
OSL_PRECOND(xListener.is(), "ERROR: Unexpected NULL listener");
@@ -119,7 +110,7 @@ namespace configmgr
}
/// Add a <type scope='com::sun::star::util'>XChangesListener</type> observing <var>aNode</var> and its descendants.
- void add(NodeID const& aNode, uno::Reference< css::util::XChangesListener > const& xListener)
+ void add(configuration::NodeID const& aNode, uno::Reference< css::util::XChangesListener > const& xListener)
{
OSL_PRECOND(xListener.is(), "ERROR: Unexpected NULL listener");
@@ -128,7 +119,7 @@ namespace configmgr
}
/// Add a <type scope='com::sun::star::beans'>XPropertyChangeListener</type> observing <var>aNode</var>.
- void addNamed(SubNodeID const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener)
+ void addNamed(configuration::SubNodeID const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener)
{
OSL_PRECOND(xListener.is(), "ERROR: Unexpected NULL listener");
@@ -136,7 +127,7 @@ namespace configmgr
m_aListeners.addSpecialListener(aNode,xListener.get());
}
/// Add a <type scope='com::sun::star::beans'>XPropertyChangeListener</type> observing <var>aNode</var>.
- void addForAll(NodeID const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener)
+ void addForAll(configuration::NodeID const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener)
{
OSL_PRECOND(xListener.is(), "ERROR: Unexpected NULL listener");
@@ -144,7 +135,7 @@ namespace configmgr
m_aListeners.addListener(aNode.toIndex(),getCppuType(&xListener),xListener.get());
}
/// Add a <type scope='com::sun::star::beans'>XVetoableChangeListener</type> constraining <var>aNode</var>.
- void addNamed(SubNodeID const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener)
+ void addNamed(configuration::SubNodeID const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener)
{
OSL_PRECOND(xListener.is(), "ERROR: Unexpected NULL listener");
@@ -152,7 +143,7 @@ namespace configmgr
m_aListeners.addSpecialListener(aNode,xListener.get());
}
/// Add a <type scope='com::sun::star::beans'>XVetoableChangeListener</type> constraining <var>aNode</var>.
- void addForAll(NodeID const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener)
+ void addForAll(configuration::NodeID const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener)
{
OSL_PRECOND(xListener.is(), "ERROR: Unexpected NULL listener");
@@ -163,7 +154,7 @@ namespace configmgr
/** Add a <type scope='com::sun::star::beans'>XPropertiesChangeListener</type>
observing all properties of <var>aNode</var>.
*/
- void add(NodeID const& aNode, uno::Reference< css::beans::XPropertiesChangeListener > const& xListener)
+ void add(configuration::NodeID const& aNode, uno::Reference< css::beans::XPropertiesChangeListener > const& xListener)
{
OSL_PRECOND(xListener.is(), "ERROR: Unexpected NULL listener");
@@ -174,7 +165,7 @@ namespace configmgr
/** Add a <type scope='com::sun::star::beans'>XPropertiesChangeListener</type>
observing the properties of <var>aNode</var> (optimally only those given by <var>aNames</var>.
*/
- void add(NodeID const& aNode, uno::Reference< css::beans::XPropertiesChangeListener > const& xListener, uno::Sequence< OUString> const& aNames)
+ void add(configuration::NodeID const& aNode, uno::Reference< css::beans::XPropertiesChangeListener > const& xListener, uno::Sequence< rtl::OUString> const& aNames)
{
OSL_PRECOND(xListener.is(), "ERROR: Unexpected NULL listener");
OSL_PRECOND(aNames.getLength() > 0, "ERROR: Unexpected empty sequence");
@@ -186,46 +177,46 @@ namespace configmgr
// ---------------------------------------------------------------------------------------------------
/// Remove a <type scope='com::sun::star::lang'>XEventListener</type> observing <var>aNode</var>.
- void remove(NodeID const& aNode, uno::Reference< css::lang::XEventListener > const& xListener)
+ void remove(configuration::NodeID const& aNode, uno::Reference< css::lang::XEventListener > const& xListener)
{
// ignore the names for now
m_aListeners.removeListener(aNode.toIndex(),getCppuType(&xListener),xListener.get());
}
/// Remove a <type scope='com::sun::star::container'>XContainerListener</type> observing <var>aNode</var>.
- void remove(NodeID const& aNode, uno::Reference< css::container::XContainerListener > const& xListener)
+ void remove(configuration::NodeID const& aNode, uno::Reference< css::container::XContainerListener > const& xListener)
{
// ignore the names for now
m_aListeners.removeListener(aNode.toIndex(),getCppuType(&xListener),xListener.get());
}
/// Remove a <type scope='com::sun::star::util'>XChangesListener</type> observing <var>aNode</var> and its descendants.
- void remove(NodeID const& aNode, uno::Reference< css::util::XChangesListener > const& xListener)
+ void remove(configuration::NodeID const& aNode, uno::Reference< css::util::XChangesListener > const& xListener)
{
// ignore the names for now
m_aListeners.removeListener(aNode.toIndex(),getCppuType(&xListener),xListener.get());
}
/// Remove a <type scope='com::sun::star::beans'>XPropertyChangeListener</type> observing <var>aNode</var>.
- void removeNamed(SubNodeID const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener)
+ void removeNamed(configuration::SubNodeID const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener)
{
// ignore the names for now
m_aListeners.removeSpecialListener(aNode,xListener.get());
}
/// Remove a <type scope='com::sun::star::beans'>XPropertyChangeListener</type> observing <var>aNode</var>.
- void removeForAll(NodeID const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener)
+ void removeForAll(configuration::NodeID const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener)
{
// ignore the names for now
m_aListeners.removeListener(aNode.toIndex(),getCppuType(&xListener),xListener.get());
}
/// Remove a <type scope='com::sun::star::beans'>XVetoableChangeListener</type> constraining <var>aNode</var>.
- void removeNamed(SubNodeID const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener)
+ void removeNamed(configuration::SubNodeID const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener)
{
// ignore the names for now
m_aListeners.removeSpecialListener(aNode,xListener.get());
}
/// Remove a <type scope='com::sun::star::beans'>XVetoableChangeListener</type> constraining <var>aNode</var>.
- void removeForAll(NodeID const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener)
+ void removeForAll(configuration::NodeID const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener)
{
// ignore the names for now
m_aListeners.removeListener(aNode.toIndex(),getCppuType(&xListener),xListener.get());
@@ -235,7 +226,7 @@ namespace configmgr
/** Remove a <type scope='com::sun::star::beans'>XPropertiesChangeListener</type>
observing any properties of <var>aNode</var>.
*/
- void remove(NodeID const& aNode, uno::Reference< css::beans::XPropertiesChangeListener > const& xListener)
+ void remove(configuration::NodeID const& aNode, uno::Reference< css::beans::XPropertiesChangeListener > const& xListener)
{
// ignore the names for now
m_aListeners.removeListener(aNode.toIndex(),getCppuType(&xListener),xListener.get());
diff --git a/configmgr/source/api2/objectregistry.hxx b/configmgr/source/api2/objectregistry.hxx
index e43505d652..5e28fdad5a 100644
--- a/configmgr/source/api2/objectregistry.hxx
+++ b/configmgr/source/api2/objectregistry.hxx
@@ -49,37 +49,34 @@ namespace configmgr
class ObjectRegistry : public vos::OReference
{
public:
- typedef configuration::NodeID Key;
- typedef NodeElement* Element;
- typedef NodeElement* ElementArg;
- static Element notFound() { return 0; }
+ static NodeElement* notFound() { return 0; }
struct KeyHash
{
- size_t operator() (const Key& rKey) const {return rKey.hashCode();}
+ size_t operator() (const configuration::NodeID& rKey) const {return rKey.hashCode();}
};
struct KeyEq
{
- bool operator() (const Key& lhs,const Key& rhs) const {return lhs == rhs;}
+ bool operator() (const configuration::NodeID& lhs,const configuration::NodeID& rhs) const {return lhs == rhs;}
};
- typedef std::hash_map<Key,Element,KeyHash, KeyEq> ObjectMap;
+ typedef std::hash_map<configuration::NodeID,NodeElement*,KeyHash, KeyEq> ObjectMap;
public:
ObjectRegistry() {}
~ObjectRegistry();
- Element findElement(Key const& aNode) const
+ NodeElement* findElement(configuration::NodeID const& aNode) const
{
ObjectMap::const_iterator aFound = m_aMap.find(aNode);
return (aFound != m_aMap.end()) ? aFound->second : notFound();
}
- void registerElement(Key const& aNode, ElementArg aElement)
+ void registerElement(configuration::NodeID const& aNode, NodeElement* aElement)
{
OSL_ENSURE(m_aMap.find(aNode) == m_aMap.end(), "ERROR: Node is already registered");
m_aMap[aNode] = aElement;
}
- void revokeElement(Key const& aNode, ElementArg aElement)
+ void revokeElement(configuration::NodeID const& aNode, NodeElement* aElement)
{
ObjectMap::iterator aFound = m_aMap.find(aNode);
diff --git a/configmgr/source/api2/propertiesfilterednotifier.cxx b/configmgr/source/api2/propertiesfilterednotifier.cxx
index fd93a60e0d..7e4a13f9b9 100644
--- a/configmgr/source/api2/propertiesfilterednotifier.cxx
+++ b/configmgr/source/api2/propertiesfilterednotifier.cxx
@@ -41,23 +41,13 @@ namespace configmgr
namespace lang = ::com::sun::star::lang;
namespace beans = ::com::sun::star::beans;
- using ::rtl::OUString;
-
- using uno::Any;
- using uno::Type;
- using uno::Reference;
- using uno::Sequence;
-
- using lang::EventObject;
-
- using beans::PropertyChangeEvent;
//-----------------------------------------------------------------------------
// class PropertiesFilteredNotifier
//-----------------------------------------------------------------------------
PropertiesFilteredNotifier::PropertiesFilteredNotifier(
- Reference< beans::XPropertiesChangeListener >const& xTarget,
- Sequence< OUString > const& aFilterNames
+ uno::Reference< beans::XPropertiesChangeListener >const& xTarget,
+ uno::Sequence< rtl::OUString > const& aFilterNames
)
: m_aRefCount()
, m_xTarget(xTarget)
@@ -86,7 +76,7 @@ void SAL_CALL PropertiesFilteredNotifier::release( ) throw()
}
//-----------------------------------------------------------------------------
-uno::Any SAL_CALL PropertiesFilteredNotifier::queryInterface( const Type& aType )
+uno::Any SAL_CALL PropertiesFilteredNotifier::queryInterface( const uno::Type& aType )
throw(uno::RuntimeException)
{
return cppu::queryInterface(aType
@@ -97,7 +87,7 @@ uno::Any SAL_CALL PropertiesFilteredNotifier::queryInterface( const Type& aType
}
//-----------------------------------------------------------------------------
-void SAL_CALL PropertiesFilteredNotifier::disposing( const EventObject& Source )
+void SAL_CALL PropertiesFilteredNotifier::disposing( const lang::EventObject& Source )
throw(uno::RuntimeException)
{
if (m_xTarget.is())
@@ -119,7 +109,7 @@ bool PropertiesFilteredNotifier::implAccept(const ::com::sun::star::beans::Prope
//-----------------------------------------------------------------------------
// private and only used once
-Sequence< PropertyChangeEvent > PropertiesFilteredNotifier::implFilter(const Sequence< PropertyChangeEvent >& evt) const
+uno::Sequence< beans::PropertyChangeEvent > PropertiesFilteredNotifier::implFilter(const uno::Sequence< beans::PropertyChangeEvent >& evt) const
{
sal_Int32 const nSize = evt.getLength();
sal_Int32 nAccepted = 0;
@@ -131,7 +121,7 @@ Sequence< PropertyChangeEvent > PropertiesFilteredNotifier::implFilter(const Seq
return evt;
// create a modified copy
- Sequence< PropertyChangeEvent > aResult(evt);
+ uno::Sequence< beans::PropertyChangeEvent > aResult(evt);
for (sal_Int32 nCur = nAccepted+1; nCur<nSize; ++nCur)
{
if (implAccept(evt[nCur]))
@@ -146,10 +136,10 @@ Sequence< PropertyChangeEvent > PropertiesFilteredNotifier::implFilter(const Seq
}
//-----------------------------------------------------------------------------
-void SAL_CALL PropertiesFilteredNotifier::propertiesChange( const Sequence< PropertyChangeEvent >& evt )
+void SAL_CALL PropertiesFilteredNotifier::propertiesChange( const uno::Sequence< beans::PropertyChangeEvent >& evt )
throw(uno::RuntimeException)
{
- Sequence< PropertyChangeEvent > aFilteredEvt( implFilter(evt) );
+ uno::Sequence< beans::PropertyChangeEvent > aFilteredEvt( implFilter(evt) );
if (aFilteredEvt.getLength() > 0)
{
diff --git a/configmgr/source/api2/propertyinfohelper.cxx b/configmgr/source/api2/propertyinfohelper.cxx
index cb2c33fce1..2b9acdfd94 100644
--- a/configmgr/source/api2/propertyinfohelper.cxx
+++ b/configmgr/source/api2/propertyinfohelper.cxx
@@ -48,7 +48,7 @@ namespace configmgr
namespace configapi
{
//-----------------------------------------------------------------------------
-beans::Property helperMakeProperty(configuration::Name const& aName,
+beans::Property helperMakeProperty(rtl::OUString const& aName,
node::Attributes const aAttributes,
uno::Type const& aType,
bool bDefaultable )
@@ -65,7 +65,7 @@ beans::Property helperMakeProperty(configuration::Name const& aName,
if ( aAttributes.isRemovable()) nPropAttributes |= PropertyAttribute::REMOVABLE;
if ( bDefaultable) nPropAttributes |= PropertyAttribute::MAYBEDEFAULT;
- return beans::Property(aName.toString(), -1, aType, nPropAttributes);
+ return beans::Property(aName, -1, aType, nPropAttributes);
}
//-----------------------------------------------------------------------------
}
diff --git a/configmgr/source/api2/propertyinfohelper.hxx b/configmgr/source/api2/propertyinfohelper.hxx
index 3575beb813..657ee983cc 100644
--- a/configmgr/source/api2/propertyinfohelper.hxx
+++ b/configmgr/source/api2/propertyinfohelper.hxx
@@ -44,12 +44,11 @@ namespace configmgr
(read-only operation)
*/
namespace node { struct Attributes; }
- namespace configuration { class Name; }
namespace configapi
{
// translation helper
- beans::Property helperMakeProperty( configuration::Name const& aName, node::Attributes const aAttributes, uno::Type const& aType, bool bDefaultable )
+ beans::Property helperMakeProperty( rtl::OUString const& aName, node::Attributes const aAttributes, uno::Type const& aType, bool bDefaultable )
throw(uno::RuntimeException);
}
diff --git a/configmgr/source/api2/propertysetaccess.cxx b/configmgr/source/api2/propertysetaccess.cxx
index 48a9bd6c33..7a9be49a33 100644
--- a/configmgr/source/api2/propertysetaccess.cxx
+++ b/configmgr/source/api2/propertysetaccess.cxx
@@ -40,13 +40,6 @@
namespace configmgr
{
//////////////////////////////////////////////////////////////////////////////////
-
- using uno::Reference;
- using uno::Sequence;
- using uno::Any;
- using uno::RuntimeException;
-
-//////////////////////////////////////////////////////////////////////////////////
// class BasicPropertySet
//////////////////////////////////////////////////////////////////////////////////
@@ -83,7 +76,7 @@ configapi::NodeGroupAccess& BasicPropertySet::getGroupNode()
if (!pAccess)
{
throw beans::PropertyVetoException(
- OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: INTERNAL VETO - Write operation invoked on a read-only node access")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: INTERNAL VETO - Write operation invoked on a read-only node access")),
static_cast< beans::XPropertySet * >(this)
);
}
@@ -92,7 +85,7 @@ configapi::NodeGroupAccess& BasicPropertySet::getGroupNode()
// XPropertySet
//////////////////////////////////////////////////////////////////////////////////
-void SAL_CALL BasicPropertySet::setPropertyValue( const OUString& aPropertyName, const uno::Any& aValue )
+void SAL_CALL BasicPropertySet::setPropertyValue( const rtl::OUString& aPropertyName, const uno::Any& aValue )
throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException,
lang::WrappedTargetException, uno::RuntimeException)
{
@@ -101,7 +94,7 @@ void SAL_CALL BasicPropertySet::setPropertyValue( const OUString& aPropertyName,
// XMultiPropertySet
//////////////////////////////////////////////////////////////////////////////////
-void SAL_CALL BasicPropertySet::setPropertyValues( const uno::Sequence< OUString >& PropertyNames, const uno::Sequence< uno::Any >& Values )
+void SAL_CALL BasicPropertySet::setPropertyValues( const uno::Sequence< rtl::OUString >& PropertyNames, const uno::Sequence< uno::Any >& Values )
throw(beans::PropertyVetoException, lang::IllegalArgumentException,
lang::WrappedTargetException, uno::RuntimeException)
{
@@ -110,7 +103,7 @@ void SAL_CALL BasicPropertySet::setPropertyValues( const uno::Sequence< OUString
// XHierarchicalPropertySet
//////////////////////////////////////////////////////////////////////////////////
-void SAL_CALL BasicPropertySet::setHierarchicalPropertyValue( const OUString& aPropertyName, const uno::Any& aValue )
+void SAL_CALL BasicPropertySet::setHierarchicalPropertyValue( const rtl::OUString& aPropertyName, const uno::Any& aValue )
throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException,
lang::WrappedTargetException, uno::RuntimeException)
{
@@ -119,7 +112,7 @@ void SAL_CALL BasicPropertySet::setHierarchicalPropertyValue( const OUString& aP
// XMultiHierarchicalPropertySet
//////////////////////////////////////////////////////////////////////////////////
-void SAL_CALL BasicPropertySet::setHierarchicalPropertyValues( const uno::Sequence< OUString >& PropertyNames, const uno::Sequence< uno::Any >& Values )
+void SAL_CALL BasicPropertySet::setHierarchicalPropertyValues( const uno::Sequence< rtl::OUString >& PropertyNames, const uno::Sequence< uno::Any >& Values )
throw(beans::PropertyVetoException, lang::IllegalArgumentException,
lang::WrappedTargetException, uno::RuntimeException)
{
@@ -132,7 +125,7 @@ void SAL_CALL BasicPropertySet::setHierarchicalPropertyValues( const uno::Sequen
//////////////////////////////////////////////////////////////////////////////////
// XPropertySet
//////////////////////////////////////////////////////////////////////////////////
-uno::Any SAL_CALL BasicPropertySet::getPropertyValue( const OUString& aPropertyName )
+uno::Any SAL_CALL BasicPropertySet::getPropertyValue( const rtl::OUString& aPropertyName )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
return configapi::implGetPropertyValue( getNode(), aPropertyName );
@@ -140,7 +133,7 @@ uno::Any SAL_CALL BasicPropertySet::getPropertyValue( const OUString& aPropertyN
// XMultiPropertySet
//////////////////////////////////////////////////////////////////////////////////
-uno::Sequence< uno::Any > SAL_CALL BasicPropertySet::getPropertyValues( const uno::Sequence< OUString >& aPropertyNames )
+uno::Sequence< uno::Any > SAL_CALL BasicPropertySet::getPropertyValues( const uno::Sequence< rtl::OUString >& aPropertyNames )
throw(uno::RuntimeException)
{
return configapi::implGetPropertyValues( getNode(), aPropertyNames );
@@ -148,7 +141,7 @@ uno::Sequence< uno::Any > SAL_CALL BasicPropertySet::getPropertyValues( const un
// XHierarchicalPropertySet
//////////////////////////////////////////////////////////////////////////////////
-uno::Any SAL_CALL BasicPropertySet::getHierarchicalPropertyValue( const OUString& aPropertyName )
+uno::Any SAL_CALL BasicPropertySet::getHierarchicalPropertyValue( const rtl::OUString& aPropertyName )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
return configapi::implGetHierarchicalPropertyValue( getNode(), aPropertyName );
@@ -156,7 +149,7 @@ uno::Any SAL_CALL BasicPropertySet::getHierarchicalPropertyValue( const OUString
// XMultiHierarchicalPropertySet
//////////////////////////////////////////////////////////////////////////////////
-uno::Sequence< uno::Any > SAL_CALL BasicPropertySet::getHierarchicalPropertyValues( const uno::Sequence< OUString >& aPropertyNames )
+uno::Sequence< uno::Any > SAL_CALL BasicPropertySet::getHierarchicalPropertyValues( const uno::Sequence< rtl::OUString >& aPropertyNames )
throw(uno::RuntimeException)
{
return configapi::implGetHierarchicalPropertyValues( getNode(), aPropertyNames );
@@ -166,33 +159,33 @@ uno::Sequence< uno::Any > SAL_CALL BasicPropertySet::getHierarchicalPropertyValu
// adding/removing listeners
//////////////////////////////////////////////////////////////////////////////////
-void SAL_CALL BasicPropertySet::addVetoableChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XVetoableChangeListener >& xListener )
+void SAL_CALL BasicPropertySet::addVetoableChangeListener( const rtl::OUString& aPropertyName, const uno::Reference< beans::XVetoableChangeListener >& xListener )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
configapi::implAddListener( getNode(), xListener, aPropertyName );
}
-void SAL_CALL BasicPropertySet::addPropertyChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener )
+void SAL_CALL BasicPropertySet::addPropertyChangeListener( const rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
configapi::implAddListener( getNode(), xListener, aPropertyName );
}
-void SAL_CALL BasicPropertySet::addPropertiesChangeListener( const uno::Sequence< OUString >& aPropertyNames, const uno::Reference< beans::XPropertiesChangeListener >& xListener )
+void SAL_CALL BasicPropertySet::addPropertiesChangeListener( const uno::Sequence< rtl::OUString >& aPropertyNames, const uno::Reference< beans::XPropertiesChangeListener >& xListener )
throw(uno::RuntimeException)
{
configapi::implAddListener( getNode(), xListener, aPropertyNames );
}
//////////////////////////////////////////////////////////////////////////////////
-void SAL_CALL BasicPropertySet::removeVetoableChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XVetoableChangeListener >& xListener )
+void SAL_CALL BasicPropertySet::removeVetoableChangeListener( const rtl::OUString& aPropertyName, const uno::Reference< beans::XVetoableChangeListener >& xListener )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
configapi::implRemoveListener( getNode(), xListener, aPropertyName );
}
//---------------------------------------------------------------------------------
-void SAL_CALL BasicPropertySet::removePropertyChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener )
+void SAL_CALL BasicPropertySet::removePropertyChangeListener( const rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
configapi::implRemoveListener( getNode(), xListener, aPropertyName );
@@ -210,7 +203,7 @@ void SAL_CALL BasicPropertySet::removePropertiesChangeListener( const uno::Refer
//////////////////////////////////////////////////////////////////////////////////
// SPECIAL: XMultiPropertySet::firePropertiesChangeEvent
//////////////////////////////////////////////////////////////////////////////////
-void SAL_CALL BasicPropertySet::firePropertiesChangeEvent( const uno::Sequence< OUString >& aPropertyNames, const uno::Reference< beans::XPropertiesChangeListener >& xListener )
+void SAL_CALL BasicPropertySet::firePropertiesChangeEvent( const uno::Sequence< rtl::OUString >& aPropertyNames, const uno::Reference< beans::XPropertiesChangeListener >& xListener )
throw(uno::RuntimeException)
{
configapi::implFirePropertiesChangeEvent( getNode(),aPropertyNames , xListener );
@@ -223,14 +216,14 @@ void SAL_CALL BasicPropertySet::firePropertiesChangeEvent( const uno::Sequence<
// getting property states
//////////////////////////////////////////////////////////////////////////////////
-beans::PropertyState SAL_CALL BasicPropertySet::getPropertyState( const OUString& sPropertyName )
+beans::PropertyState SAL_CALL BasicPropertySet::getPropertyState( const rtl::OUString& sPropertyName )
throw(beans::UnknownPropertyException, uno::RuntimeException)
{
return configapi::implGetPropertyState( getNode(), sPropertyName);
}
//---------------------------------------------------------------------------------
-uno::Sequence< beans::PropertyState > SAL_CALL BasicPropertySet::getPropertyStates( const uno::Sequence< OUString >& aPropertyNames )
+uno::Sequence< beans::PropertyState > SAL_CALL BasicPropertySet::getPropertyStates( const uno::Sequence< rtl::OUString >& aPropertyNames )
throw(beans::UnknownPropertyException, uno::RuntimeException)
{
return configapi::implGetPropertyStates( getNode(), aPropertyNames );
@@ -240,14 +233,14 @@ uno::Sequence< beans::PropertyState > SAL_CALL BasicPropertySet::getPropertyStat
// setting to default state
//////////////////////////////////////////////////////////////////////////////////
-void SAL_CALL BasicPropertySet::setPropertyToDefault( const OUString& sPropertyName )
+void SAL_CALL BasicPropertySet::setPropertyToDefault( const rtl::OUString& sPropertyName )
throw(beans::UnknownPropertyException, uno::RuntimeException)
{
configapi::implSetPropertyToDefault( getGroupNode(), sPropertyName);
}
//---------------------------------------------------------------------------------
-void SAL_CALL BasicPropertySet::setPropertiesToDefault( const uno::Sequence< OUString >& aPropertyNames )
+void SAL_CALL BasicPropertySet::setPropertiesToDefault( const uno::Sequence< rtl::OUString >& aPropertyNames )
throw (beans::UnknownPropertyException, uno::RuntimeException)
{
configapi::implSetPropertiesToDefault( getGroupNode(), aPropertyNames);
@@ -264,7 +257,7 @@ void SAL_CALL BasicPropertySet::setAllPropertiesToDefault( )
// getting defaults
//////////////////////////////////////////////////////////////////////////////////
-uno::Any SAL_CALL BasicPropertySet::getPropertyDefault( const OUString& sPropertyName )
+uno::Any SAL_CALL BasicPropertySet::getPropertyDefault( const rtl::OUString& sPropertyName )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
@@ -272,7 +265,7 @@ uno::Any SAL_CALL BasicPropertySet::getPropertyDefault( const OUString& sPropert
}
//---------------------------------------------------------------------------------
-uno::Sequence< uno::Any > SAL_CALL BasicPropertySet::getPropertyDefaults( const uno::Sequence< OUString >& aPropertyNames )
+uno::Sequence< uno::Any > SAL_CALL BasicPropertySet::getPropertyDefaults( const uno::Sequence< rtl::OUString >& aPropertyNames )
throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
return configapi::implGetPropertyDefaults( getNode(), aPropertyNames);
diff --git a/configmgr/source/api2/propertysetaccess.hxx b/configmgr/source/api2/propertysetaccess.hxx
index c5712bccaa..0cf8d0580f 100644
--- a/configmgr/source/api2/propertysetaccess.hxx
+++ b/configmgr/source/api2/propertysetaccess.hxx
@@ -46,7 +46,6 @@ namespace configmgr
namespace uno = css::uno;
namespace lang = css::lang;
namespace beans = css::beans;
- using rtl::OUString;
namespace configapi
{
@@ -89,64 +88,64 @@ public:
// setting values - may all throw (PropertyVeto)Exceptions on read-only property sets
// XPropertySet
virtual void SAL_CALL
- setPropertyValue( const OUString& aPropertyName, const uno::Any& aValue )
+ setPropertyValue( const rtl::OUString& aPropertyName, const uno::Any& aValue )
throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException,
lang::WrappedTargetException, uno::RuntimeException);
// XMultiPropertySet
virtual void SAL_CALL
- setPropertyValues( const uno::Sequence< OUString >& PropertyNames, const uno::Sequence< uno::Any >& Values )
+ setPropertyValues( const uno::Sequence< rtl::OUString >& PropertyNames, const uno::Sequence< uno::Any >& Values )
throw(beans::PropertyVetoException, lang::IllegalArgumentException,
lang::WrappedTargetException, uno::RuntimeException);
// XHierarchicalPropertySet
virtual void SAL_CALL
- setHierarchicalPropertyValue( const OUString& aPropertyName, const uno::Any& aValue )
+ setHierarchicalPropertyValue( const rtl::OUString& aPropertyName, const uno::Any& aValue )
throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException,
lang::WrappedTargetException, uno::RuntimeException);
// XMultiHierarchicalPropertySet
virtual void SAL_CALL
- setHierarchicalPropertyValues( const uno::Sequence< OUString >& PropertyNames, const uno::Sequence< uno::Any >& Values )
+ setHierarchicalPropertyValues( const uno::Sequence< rtl::OUString >& PropertyNames, const uno::Sequence< uno::Any >& Values )
throw(beans::PropertyVetoException, lang::IllegalArgumentException,
lang::WrappedTargetException, uno::RuntimeException);
// getting values
// XPropertySet
virtual uno::Any SAL_CALL
- getPropertyValue( const OUString& PropertyName )
+ getPropertyValue( const rtl::OUString& PropertyName )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
// XMultiPropertySet
virtual uno::Sequence< uno::Any > SAL_CALL
- getPropertyValues( const uno::Sequence< OUString >& aPropertyNames )
+ getPropertyValues( const uno::Sequence< rtl::OUString >& aPropertyNames )
throw(uno::RuntimeException);
// XHierarchicalPropertySet
virtual uno::Any SAL_CALL
- getHierarchicalPropertyValue( const OUString& PropertyName )
+ getHierarchicalPropertyValue( const rtl::OUString& PropertyName )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
// XMultiHierarchicalPropertySet
virtual uno::Sequence< uno::Any > SAL_CALL
- getHierarchicalPropertyValues( const uno::Sequence< OUString >& aPropertyNames )
+ getHierarchicalPropertyValues( const uno::Sequence< rtl::OUString >& aPropertyNames )
throw(uno::RuntimeException);
// adding listeners
// XPropertySet
virtual void SAL_CALL
- addPropertyChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener )
+ addPropertyChangeListener( const rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
// XMultiPropertySet
virtual void SAL_CALL
- addPropertiesChangeListener( const uno::Sequence< OUString >& aPropertyNames, const uno::Reference< beans::XPropertiesChangeListener >& xListener )
+ addPropertiesChangeListener( const uno::Sequence< rtl::OUString >& aPropertyNames, const uno::Reference< beans::XPropertiesChangeListener >& xListener )
throw(uno::RuntimeException);
// removing listeners
// XPropertySet
virtual void SAL_CALL
- removePropertyChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener )
+ removePropertyChangeListener( const rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
// XMultiPropertySet
@@ -157,40 +156,40 @@ public:
// SPECIAL: support for VetoableChangeListeners
// XPropertySet
virtual void SAL_CALL
- addVetoableChangeListener( const OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener )
+ addVetoableChangeListener( const rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
virtual void SAL_CALL
- removeVetoableChangeListener( const OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener )
+ removeVetoableChangeListener( const rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
// SPECIAL: firePropertiesChangeEvent
// XMultiPropertySet
virtual void SAL_CALL
- firePropertiesChangeEvent( const uno::Sequence< OUString >& aPropertyNames, const uno::Reference< beans::XPropertiesChangeListener >& xListener )
+ firePropertiesChangeEvent( const uno::Sequence< rtl::OUString >& aPropertyNames, const uno::Reference< beans::XPropertiesChangeListener >& xListener )
throw(uno::RuntimeException);
// XPropertyState
virtual beans::PropertyState SAL_CALL
- getPropertyState( const OUString& PropertyName )
+ getPropertyState( const rtl::OUString& PropertyName )
throw(beans::UnknownPropertyException, uno::RuntimeException);
// see below:
// virtual uno::Sequence< beans::PropertyState > SAL_CALL
- // getPropertyStates( const uno::Sequence< OUString >& aPropertyName )
+ // getPropertyStates( const uno::Sequence< rtl::OUString >& aPropertyName )
// throw(beans::UnknownPropertyException, uno::RuntimeException);
virtual void SAL_CALL
- setPropertyToDefault( const OUString& PropertyName )
+ setPropertyToDefault( const rtl::OUString& PropertyName )
throw(beans::UnknownPropertyException, uno::RuntimeException);
virtual uno::Any SAL_CALL
- getPropertyDefault( const OUString& aPropertyName )
+ getPropertyDefault( const rtl::OUString& aPropertyName )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
// XMultiPropertyStates
virtual uno::Sequence< beans::PropertyState > SAL_CALL
- getPropertyStates( const uno::Sequence< OUString >& aPropertyName )
+ getPropertyStates( const uno::Sequence< rtl::OUString >& aPropertyName )
throw (beans::UnknownPropertyException, uno::RuntimeException);
virtual void SAL_CALL
@@ -198,11 +197,11 @@ public:
throw (uno::RuntimeException);
virtual void SAL_CALL
- setPropertiesToDefault( const uno::Sequence< OUString >& aPropertyNames )
+ setPropertiesToDefault( const uno::Sequence< rtl::OUString >& aPropertyNames )
throw (beans::UnknownPropertyException, uno::RuntimeException);
virtual uno::Sequence< uno::Any > SAL_CALL
- getPropertyDefaults( const uno::Sequence< OUString >& aPropertyNames )
+ getPropertyDefaults( const uno::Sequence< rtl::OUString >& aPropertyNames )
throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
protected:
diff --git a/configmgr/source/api2/propsetaccessimpl.cxx b/configmgr/source/api2/propsetaccessimpl.cxx
index 238d66400b..be1f571076 100644
--- a/configmgr/source/api2/propsetaccessimpl.cxx
+++ b/configmgr/source/api2/propsetaccessimpl.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: propsetaccessimpl.cxx,v $
- * $Revision: 1.24.4.1 $
+ * $Revision: 1.24.10.5 $
*
* This file is part of OpenOffice.org.
*
@@ -63,40 +63,13 @@ namespace configmgr
namespace lang = css::lang;
namespace beans = css::beans;
- using uno::RuntimeException;
- using uno::Reference;
- using uno::Any;
- using uno::Sequence;
-
- using lang::IllegalArgumentException;
- using lang::WrappedTargetException;
- using beans::UnknownPropertyException;
- using beans::PropertyVetoException;
-
- using configuration::AnyNodeRef;
- using configuration::NodeRef;
- using configuration::ValueRef;
-
- using configuration::Tree;
- using configuration::NodeChange;
- using configuration::NodeChanges;
-
- using configuration::Name;
- using configuration::AbsolutePath;
- using configuration::RelativePath;
- using configuration::validateChildName;
- using configuration::validateChildOrElementName;
-
- using namespace beans;
- using namespace uno;
-
//-----------------------------------------------------------------------------------
// a helper class
//-----------------------------------------------------------------------------------
class CollectProperties : configuration::NodeVisitor
{
- std::vector< Property > m_aProperties;
+ std::vector< beans::Property > m_aProperties;
sal_Bool m_bReadonly;
public:
CollectProperties(sal_Bool _bReadonly)
@@ -106,27 +79,25 @@ public:
: m_bReadonly(_bReadonly)
{ m_aProperties.reserve(_nCount); }
- Sequence<Property> forChildren(Tree const& _aPropertyTree, NodeRef const& _rNode)
+ uno::Sequence<beans::Property> forChildren(rtl::Reference< configuration::Tree > const& _aPropertyTree, configuration::NodeRef const& _rNode)
{
- OSL_ENSURE( _aPropertyTree.isValidNode(_rNode), "Node to retrieve properties from does not match tree");
+ OSL_ENSURE( _rNode.isValid() && _aPropertyTree->isValidNode(_rNode.getOffset()), "Node to retrieve properties from does not match tree");
reset();
- _aPropertyTree.dispatchToChildren(_rNode, *this);
+ _aPropertyTree->dispatchToChildren(_rNode, *this);
return makeSequence(m_aProperties);
}
private:
- typedef node::Attributes NodeAttributes;
-
void reset() { m_aProperties.clear(); }
- NodeAttributes adjustAttributes(NodeAttributes nNodeAttr);
+ node::Attributes adjustAttributes(node::Attributes nNodeAttr);
- Result handle(Tree const& _aTree, NodeRef const& _rValue);
- Result handle(Tree const& _aTree, ValueRef const& _rValue);
+ Result handle(rtl::Reference< configuration::Tree > const& _aTree, configuration::NodeRef const& _rValue);
+ Result handle(rtl::Reference< configuration::Tree > const& _aTree, configuration::ValueRef const& _rValue);
};
//-----------------------------------------------------------------------------------
-CollectProperties::NodeAttributes CollectProperties::adjustAttributes(NodeAttributes nNodeAttr)
+node::Attributes CollectProperties::adjustAttributes(node::Attributes nNodeAttr)
{
if (m_bReadonly) nNodeAttr.markReadonly();
@@ -134,14 +105,14 @@ CollectProperties::NodeAttributes CollectProperties::adjustAttributes(NodeAttrib
}
//-----------------------------------------------------------------------------------
-CollectProperties::Result CollectProperties::handle(Tree const& _aTree, ValueRef const& _rValue)
+CollectProperties::Result CollectProperties::handle(rtl::Reference< configuration::Tree > const& _aTree, configuration::ValueRef const& _rValue)
{
// can be default ?
m_aProperties.push_back(
- helperMakeProperty( _aTree.getName(_rValue),
- adjustAttributes(_aTree.getAttributes(_rValue)),
- _aTree.getUnoType(_rValue),
- _aTree.hasNodeDefault(_rValue)
+ helperMakeProperty( _rValue.m_sNodeName,
+ adjustAttributes(_aTree->getAttributes(_rValue)),
+ _aTree->getUnoType(_rValue),
+ _aTree->hasNodeDefault(_rValue)
)
);
@@ -149,17 +120,17 @@ CollectProperties::Result CollectProperties::handle(Tree const& _aTree, ValueRef
}
//-----------------------------------------------------------------------------------
-CollectProperties::Result CollectProperties::handle(Tree const& _aTree, NodeRef const& _rNode)
+CollectProperties::Result CollectProperties::handle(rtl::Reference< configuration::Tree > const& _aTree, configuration::NodeRef const& _rNode)
{
// can be default ?
OSL_ENSURE( configuration::isStructuralNode(_aTree,_rNode),
"Unexpected value element node. Cannot get proper type for this node as property" );
m_aProperties.push_back(
- helperMakeProperty( _aTree.getName(_rNode),
- adjustAttributes(_aTree.getAttributes(_rNode)),
+ helperMakeProperty( _aTree->getSimpleNodeName(_rNode.getOffset()),
+ adjustAttributes(_aTree->getAttributes(_rNode)),
getUnoInterfaceType(),
- _aTree.hasNodeDefault(_rNode)
+ _aTree->hasNodeDefault(_rNode)
)
);
@@ -173,100 +144,100 @@ CollectProperties::Result CollectProperties::handle(Tree const& _aTree, NodeRef
class NodePropertySetInfo
:public ::cppu::WeakImplHelper1< beans::XPropertySetInfo >
{
- Sequence< Property > const m_aProperties;
+ uno::Sequence< beans::Property > const m_aProperties;
public:
- NodePropertySetInfo(Sequence< Property > const& _aProperties) throw(RuntimeException)
+ NodePropertySetInfo(uno::Sequence< beans::Property > const& _aProperties) throw(uno::RuntimeException)
: m_aProperties(_aProperties)
{
}
- static NodePropertySetInfo* create(NodeGroupInfoAccess& _rNode, sal_Bool _bReadonly ) throw(RuntimeException);
- Property const* begin() const throw() { return m_aProperties.getConstArray(); }
- Property const* end() const throw() { return m_aProperties.getConstArray() + m_aProperties.getLength(); }
+ static NodePropertySetInfo* create(NodeGroupInfoAccess& _rNode, sal_Bool _bReadonly ) throw(uno::RuntimeException);
+ beans::Property const* begin() const throw() { return m_aProperties.getConstArray(); }
+ beans::Property const* end() const throw() { return m_aProperties.getConstArray() + m_aProperties.getLength(); }
- Property const* find(const OUString& _rPropertyName) const throw(RuntimeException);
+ beans::Property const* find(const rtl::OUString& _rPropertyName) const throw(uno::RuntimeException);
// XPropertySetInfo
- virtual Sequence< Property > SAL_CALL getProperties() throw(RuntimeException);
- virtual Property SAL_CALL getPropertyByName(const OUString& _rPropertyName) throw(UnknownPropertyException, RuntimeException);
- virtual sal_Bool SAL_CALL hasPropertyByName(const OUString& _rPropertyName) throw(RuntimeException);
+ virtual uno::Sequence< beans::Property > SAL_CALL getProperties() throw(uno::RuntimeException);
+ virtual beans::Property SAL_CALL getPropertyByName(const rtl::OUString& _rPropertyName) throw(beans::UnknownPropertyException, uno::RuntimeException);
+ virtual sal_Bool SAL_CALL hasPropertyByName(const rtl::OUString& _rPropertyName) throw(uno::RuntimeException);
};
//-----------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------
-NodePropertySetInfo* NodePropertySetInfo::create(NodeGroupInfoAccess& _rNode, sal_Bool _bReadonly ) throw(RuntimeException)
+NodePropertySetInfo* NodePropertySetInfo::create(NodeGroupInfoAccess& _rNode, sal_Bool _bReadonly ) throw(uno::RuntimeException)
{
UnoApiLock aLock;
- configuration::Tree aTree( _rNode.getTree() );
- OSL_ENSURE( !aTree.isEmpty(), "WARNING: Getting Tree information requires a valid tree");
- if (aTree.isEmpty()) return NULL;
+ rtl::Reference< configuration::Tree > aTree( _rNode.getTree() );
+ OSL_ENSURE( !configuration::isEmpty(aTree.get()), "WARNING: Getting Tree information requires a valid tree");
+ if (configuration::isEmpty(aTree.get())) return NULL;
configuration::NodeRef aNode( _rNode.getNodeRef() );
- OSL_ENSURE( aTree.isValidNode(aNode), "ERROR: Tree does not match node");
+ OSL_ENSURE( aNode.isValid() && aTree->isValidNode(aNode.getOffset()), "ERROR: Tree does not match node");
- Sequence< Property > aProperties = CollectProperties(_bReadonly).forChildren(aTree,aNode);
+ uno::Sequence< beans::Property > aProperties = CollectProperties(_bReadonly).forChildren(aTree,aNode);
OSL_ENSURE( aProperties.getLength() > 0, "ERROR: PropertySet (Configuration group) has no Properties");
return new NodePropertySetInfo( aProperties );
}
//-----------------------------------------------------------------------------------
-struct MatchName // : std::unary_function< Property, bool >
+struct MatchName // : std::unary_function< beans::Property, bool >
{
- OUString sName;
- MatchName(OUString const& _sName) throw(RuntimeException)
+ rtl::OUString sName;
+ MatchName(rtl::OUString const& _sName) throw(uno::RuntimeException)
: sName(_sName)
{
}
- bool operator()(Property const& _aProperty) const
+ bool operator()(beans::Property const& _aProperty) const
{
return !!(_aProperty.Name == this->sName);
}
};
-Property const* NodePropertySetInfo::find(const OUString& _rPropertyName) const throw(RuntimeException)
+beans::Property const* NodePropertySetInfo::find(const rtl::OUString& _rPropertyName) const throw(uno::RuntimeException)
{
- Property const* const first = this->begin();
- Property const* const last = this->end();
+ beans::Property const* const first = this->begin();
+ beans::Property const* const last = this->end();
return std::find_if(first,last,MatchName(_rPropertyName));
}
//-----------------------------------------------------------------------------------
-uno::Sequence< beans::Property > SAL_CALL NodePropertySetInfo::getProperties() throw(RuntimeException)
+uno::Sequence< beans::Property > SAL_CALL NodePropertySetInfo::getProperties() throw(uno::RuntimeException)
{
return m_aProperties;
}
//-----------------------------------------------------------------------------------
-Property SAL_CALL NodePropertySetInfo::getPropertyByName(const OUString& _rPropertyName)
- throw(UnknownPropertyException, RuntimeException)
+beans::Property SAL_CALL NodePropertySetInfo::getPropertyByName(const rtl::OUString& _rPropertyName)
+ throw(beans::UnknownPropertyException, uno::RuntimeException)
{
UnoApiLock aLock;
- Property const* pFound = find(_rPropertyName);
+ beans::Property const* pFound = find(_rPropertyName);
if (pFound == this->end())
{
- OUString sMessage = OUString::createFromAscii("Configuration - ");
- sMessage += OUString::createFromAscii("No Property named '");
+ rtl::OUString sMessage = rtl::OUString::createFromAscii("Configuration - ");
+ sMessage += rtl::OUString::createFromAscii("No Property named '");
sMessage += _rPropertyName;
- sMessage += OUString::createFromAscii("' in this PropertySetInfo");
- throw UnknownPropertyException(sMessage, static_cast<XPropertySetInfo*>(this));
+ sMessage += rtl::OUString::createFromAscii("' in this PropertySetInfo");
+ throw beans::UnknownPropertyException(sMessage, static_cast<XPropertySetInfo*>(this));
}
return *pFound;
}
//-----------------------------------------------------------------------------------
-sal_Bool SAL_CALL NodePropertySetInfo::hasPropertyByName(const OUString& _rPropertyName)
- throw(RuntimeException)
+sal_Bool SAL_CALL NodePropertySetInfo::hasPropertyByName(const rtl::OUString& _rPropertyName)
+ throw(uno::RuntimeException)
{
UnoApiLock aLock;
- Property const* pFound = find(_rPropertyName);
+ beans::Property const* pFound = find(_rPropertyName);
return (pFound != this->end());
}
@@ -280,17 +251,17 @@ sal_Bool SAL_CALL NodePropertySetInfo::hasPropertyByName(const OUString& _rPrope
// XPropertySet & XMultiPropertySet
//-----------------------------------------------------------------------------------
-Reference< beans::XPropertySetInfo > implGetPropertySetInfo( NodeGroupInfoAccess& rNode, sal_Bool _bWriteable )
- throw(RuntimeException)
+uno::Reference< beans::XPropertySetInfo > implGetPropertySetInfo( NodeGroupInfoAccess& rNode, sal_Bool _bWriteable )
+ throw(uno::RuntimeException)
{
- GuardedNodeDataAccess lock( rNode );
+ GuardedNodeData<NodeAccess> lock( rNode );
return NodePropertySetInfo::create(rNode, !_bWriteable);
}
// XHierarchicalPropertySet & XHierarchicalMultiPropertySet
//-----------------------------------------------------------------------------------
-Reference< beans::XHierarchicalPropertySetInfo > implGetHierarchicalPropertySetInfo( NodeGroupInfoAccess& /*rNode*/ )
- throw(RuntimeException)
+uno::Reference< beans::XHierarchicalPropertySetInfo > implGetHierarchicalPropertySetInfo( NodeGroupInfoAccess& /*rNode*/ )
+ throw(uno::RuntimeException)
{
// TODO: Implement
return 0;
@@ -302,56 +273,56 @@ Reference< beans::XHierarchicalPropertySetInfo > implGetHierarchicalPropertySetI
// XPropertySet
//-----------------------------------------------------------------------------------
-void implSetPropertyValue( NodeGroupAccess& rNode, const OUString& sPropertyName, const Any& aValue )
+void implSetPropertyValue( NodeGroupAccess& rNode, const rtl::OUString& sPropertyName, const uno::Any& aValue )
throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, RuntimeException)
+ lang::WrappedTargetException, uno::RuntimeException)
{
try
{
- GuardedGroupUpdateAccess lock( rNode );
+ GuardedNodeUpdate<NodeGroupAccess> lock( rNode );
- Tree const aTree( lock.getTree() );
- NodeRef const aNode( lock.getNode() );
+ rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
+ configuration::NodeRef const aNode( lock.getNode() );
- Name aChildName = validateChildName(sPropertyName,aTree,aNode);
+ rtl::OUString aChildName = configuration::validateChildName(sPropertyName,aTree,aNode);
- ValueRef aChild( aTree.getChildValue(aNode, aChildName) );
+ configuration::ValueRef aChild( aTree->getChildValue(aNode, aChildName) );
if (!aChild.isValid())
{
if ( configuration::hasChildOrElement(aTree, aNode, aChildName) )
{
- OSL_ENSURE(aTree.hasChildNode(aNode, aChildName),"ERROR: Configuration: Existing Property not found by implementation");
+ OSL_ENSURE(aTree->hasChildNode(aNode, aChildName),"ERROR: Configuration: Existing Property not found by implementation");
- OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value.") );
- sMessage += OUString( RTL_CONSTASCII_USTRINGPARAM(" Property '") );
+ rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value.") );
+ sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(" Property '") );
sMessage += sPropertyName;
- sMessage += OUString( RTL_CONSTASCII_USTRINGPARAM("' is not a simple value.") );
+ sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' is not a simple value.") );
- Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw PropertyVetoException( sMessage, xContext );
+ uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
+ throw beans::PropertyVetoException( sMessage, xContext );
}
else
{
- OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value.") );
- sMessage += OUString( RTL_CONSTASCII_USTRINGPARAM(" Property '") );
+ rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value.") );
+ sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(" Property '") );
sMessage += sPropertyName;
- sMessage += OUString( RTL_CONSTASCII_USTRINGPARAM("' not found in ") );
- sMessage += aTree.getAbsolutePath(aNode).toString();
+ sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' not found in ") );
+ sMessage += aTree->getAbsolutePath(aNode).toString();
- Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw UnknownPropertyException( sMessage, xContext );
+ uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
+ throw beans::UnknownPropertyException( sMessage, xContext );
}
}
- NodeChange aChange = lock.getNodeUpdater().validateSetValue( aChild, aValue );
+ configuration::NodeChange aChange = lock.getNodeUpdater().validateSetValue( aChild, aValue );
if (aChange.test().isChange())
{
Broadcaster aSender(rNode.getNotifier().makeBroadcaster(aChange,true));
aSender.queryConstraints(aChange);
- aTree.integrate(aChange, aNode, true);
+ aTree->integrate(aChange, aNode, true);
lock.clearForBroadcast();
aSender.notifyListeners(aChange);
@@ -360,9 +331,9 @@ void implSetPropertyValue( NodeGroupAccess& rNode, const OUString& sPropertyName
catch (configuration::InvalidName& ex)
{
ExceptionMapper e(ex);
- OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value: ") );
- Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw UnknownPropertyException( sMessage += e.message(), xContext );
+ rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value: ") );
+ uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
+ throw beans::UnknownPropertyException( sMessage += e.message(), xContext );
}
catch (configuration::TypeMismatch& ex)
{
@@ -373,9 +344,9 @@ void implSetPropertyValue( NodeGroupAccess& rNode, const OUString& sPropertyName
catch (configuration::ConstraintViolation& ex)
{
ExceptionMapper e(ex);
- OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value: ") );
- Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw PropertyVetoException( sMessage += e.message(), xContext );
+ rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value: ") );
+ uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
+ throw beans::PropertyVetoException( sMessage += e.message(), xContext );
}
catch (configuration::Exception& ex)
{
@@ -387,44 +358,44 @@ void implSetPropertyValue( NodeGroupAccess& rNode, const OUString& sPropertyName
// XMultiPropertySet
//-----------------------------------------------------------------------------------
-void implSetPropertyValues( NodeGroupAccess& rNode, const Sequence< OUString >& aPropertyNames, const Sequence< Any >& aValues )
+void implSetPropertyValues( NodeGroupAccess& rNode, const uno::Sequence< rtl::OUString >& aPropertyNames, const uno::Sequence< uno::Any >& aValues )
throw(beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, RuntimeException)
+ lang::WrappedTargetException, uno::RuntimeException)
{
try
{
- GuardedGroupUpdateAccess lock( rNode );
+ GuardedNodeUpdate<NodeGroupAccess> lock( rNode );
- Tree const aTree( lock.getTree() );
- NodeRef const aNode( lock.getNode() );
+ rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
+ configuration::NodeRef const aNode( lock.getNode() );
- NodeChanges aChanges;
+ configuration::NodeChanges aChanges;
for(sal_Int32 i = 0, count= aValues.getLength(); i < count; ++i)
{
- Name aChildName = configuration::makeNodeName( aPropertyNames[i], Name::NoValidate() ); // not validated
+ rtl::OUString aChildName( aPropertyNames[i] ); // not validated
- ValueRef aChild( aTree.getChildValue(aNode, aChildName) );
+ configuration::ValueRef aChild( aTree->getChildValue(aNode, aChildName) );
if (!aChild.isValid())
{
if ( configuration::hasChildOrElement(aTree, aNode, aChildName) )
{
- OSL_ENSURE(aTree.hasChildNode(aNode, aChildName),"ERROR: Configuration: Existing Property not found by implementation");
+ OSL_ENSURE(aTree->hasChildNode(aNode, aChildName),"ERROR: Configuration: Existing Property not found by implementation");
- OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Values.") );
- sMessage += OUString( RTL_CONSTASCII_USTRINGPARAM(" Property '") );
- sMessage += aChildName.toString();
- sMessage += OUString( RTL_CONSTASCII_USTRINGPARAM("' is not a simple value.") );
+ rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Values.") );
+ sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(" Property '") );
+ sMessage += aChildName;
+ sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' is not a simple value.") );
- Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw PropertyVetoException( sMessage, xContext );
+ uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
+ throw beans::PropertyVetoException( sMessage, xContext );
}
OSL_TRACE("Configuration: MultiPropertySet: trying to set unknown property - ignored");
continue;
}
- NodeChange aChange = lock.getNodeUpdater().validateSetValue( aChild, aValues[i] );
+ configuration::NodeChange aChange = lock.getNodeUpdater().validateSetValue( aChild, aValues[i] );
if (aChange.maybeChange())
{
aChanges.add(aChange);
@@ -437,7 +408,7 @@ void implSetPropertyValues( NodeGroupAccess& rNode, const Sequence< OUString >&
aSender.queryConstraints(aChanges);
- aTree.integrate(aChanges, aNode, true);
+ aTree->integrate(aChanges, aNode, true);
lock.clearForBroadcast();
aSender.notifyListeners(aChanges, true);
@@ -452,9 +423,9 @@ void implSetPropertyValues( NodeGroupAccess& rNode, const Sequence< OUString >&
catch (configuration::ConstraintViolation& ex)
{
ExceptionMapper e(ex);
- OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value: ") );
- Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw PropertyVetoException( sMessage += e.message(), xContext );
+ rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value: ") );
+ uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
+ throw beans::PropertyVetoException( sMessage += e.message(), xContext );
}
catch (configuration::Exception& ex)
{
@@ -466,53 +437,50 @@ void implSetPropertyValues( NodeGroupAccess& rNode, const Sequence< OUString >&
// XHierarchicalPropertySet
//-----------------------------------------------------------------------------------
-void implSetHierarchicalPropertyValue( NodeGroupAccess& rNode, const OUString& aPropertyName, const Any& aValue )
+void implSetHierarchicalPropertyValue( NodeGroupAccess& rNode, const rtl::OUString& aPropertyName, const uno::Any& aValue )
throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, RuntimeException)
+ lang::WrappedTargetException, uno::RuntimeException)
{
- using configuration::validateRelativePath; // should actually be found by "Koenig" lookup, but MSVC6 fails
- using configuration::getLocalDescendant; // should actually be found by "Koenig" lookup, but MSVC6 fails
-
try
{
- GuardedGroupUpdateAccess lock( rNode );
+ GuardedNodeUpdate<NodeGroupAccess> lock( rNode );
- Tree const aTree( lock.getTree() );
- NodeRef const aNode( lock.getNode() );
+ rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
+ configuration::NodeRef const aNode( lock.getNode() );
- RelativePath const aRelPath = validateRelativePath( aPropertyName, aTree, aNode );
+ configuration::RelativePath const aRelPath = configuration::validateRelativePath( aPropertyName, aTree, aNode );
- AnyNodeRef aNestedValue = getLocalDescendant( aTree, aNode, aRelPath );
+ configuration::AnyNodeRef aNestedValue = configuration::getLocalDescendant( aTree, aNode, aRelPath );
if (!aNestedValue.isValid())
{
- OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value. Property '") );
+ rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value. Property '") );
sMessage += aRelPath.toString();
- sMessage += OUString( RTL_CONSTASCII_USTRINGPARAM("' was not found in ") );
- sMessage += aTree.getAbsolutePath(aNode).toString();
+ sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' was not found in ") );
+ sMessage += aTree->getAbsolutePath(aNode).toString();
- Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw UnknownPropertyException( sMessage, xContext );
+ uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
+ throw beans::UnknownPropertyException( sMessage, xContext );
}
if (aNestedValue.isNode())
{
- OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value. Property '") );
+ rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value. Property '") );
sMessage += aRelPath.toString();
- sMessage += OUString( RTL_CONSTASCII_USTRINGPARAM("' is not a simple value property.") );
+ sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' is not a simple value property.") );
- Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw PropertyVetoException( sMessage, xContext );
+ uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
+ throw beans::PropertyVetoException( sMessage, xContext );
}
OSL_ASSERT(aNode.isValid());
- NodeChange aChange = lock.getNodeUpdater().validateSetValue( aNestedValue.toValue(), aValue );
+ configuration::NodeChange aChange = lock.getNodeUpdater().validateSetValue( aNestedValue.toValue(), aValue );
if (aChange.test().isChange())
{
Broadcaster aSender(rNode.getNotifier().makeBroadcaster(aChange,false));
aSender.queryConstraints(aChange);
- aTree.integrate(aChange, aNode, false);
+ aTree->integrate(aChange, aNode, false);
lock.clearForBroadcast();
aSender.notifyListeners(aChange);
@@ -521,9 +489,9 @@ void implSetHierarchicalPropertyValue( NodeGroupAccess& rNode, const OUString& a
catch (configuration::InvalidName& ex)
{
ExceptionMapper e(ex);
- OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value: ") );
- Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw UnknownPropertyException( e.message(), xContext );
+ rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value: ") );
+ uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
+ throw beans::UnknownPropertyException( e.message(), xContext );
}
catch (configuration::TypeMismatch& ex)
{
@@ -534,9 +502,9 @@ void implSetHierarchicalPropertyValue( NodeGroupAccess& rNode, const OUString& a
catch (configuration::ConstraintViolation& ex)
{
ExceptionMapper e(ex);
- OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value: ") );
- Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw PropertyVetoException( sMessage += e.message(), xContext );
+ rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value: ") );
+ uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
+ throw beans::PropertyVetoException( sMessage += e.message(), xContext );
}
catch (configuration::Exception& ex)
{
@@ -548,27 +516,24 @@ void implSetHierarchicalPropertyValue( NodeGroupAccess& rNode, const OUString& a
// XMultiHierarchicalPropertySet
//-----------------------------------------------------------------------------------
-void implSetHierarchicalPropertyValues( NodeGroupAccess& rNode, const Sequence< OUString >& aPropertyNames, const Sequence< Any >& aValues )
+void implSetHierarchicalPropertyValues( NodeGroupAccess& rNode, const uno::Sequence< rtl::OUString >& aPropertyNames, const uno::Sequence< uno::Any >& aValues )
throw(beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, RuntimeException)
+ lang::WrappedTargetException, uno::RuntimeException)
{
- using configuration::validateRelativePath; // should actually be found by "Koenig" lookup, but MSVC6 fails
- using configuration::getLocalDescendant; // should actually be found by "Koenig" lookup, but MSVC6 fails
-
try
{
- GuardedGroupUpdateAccess lock( rNode );
+ GuardedNodeUpdate<NodeGroupAccess> lock( rNode );
- Tree const aTree( lock.getTree() );
- NodeRef const aNode( lock.getNode() );
+ rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
+ configuration::NodeRef const aNode( lock.getNode() );
- NodeChanges aChanges;
+ configuration::NodeChanges aChanges;
for(sal_Int32 i = 0, count= aValues.getLength(); i < count; ++i)
try
{
- RelativePath aRelPath = validateRelativePath( aPropertyNames[i], aTree, aNode );
+ configuration::RelativePath aRelPath = configuration::validateRelativePath( aPropertyNames[i], aTree, aNode );
- AnyNodeRef aNestedValue = getLocalDescendant( aTree, aNode, aRelPath );
+ configuration::AnyNodeRef aNestedValue = configuration::getLocalDescendant( aTree, aNode, aRelPath );
if (!aNestedValue.isValid())
{
@@ -577,17 +542,17 @@ void implSetHierarchicalPropertyValues( NodeGroupAccess& rNode, const Sequence<
}
if ( aNestedValue.isNode() )
{
- OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Values.") );
- sMessage += OUString( RTL_CONSTASCII_USTRINGPARAM(" Property '") );
+ rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Values.") );
+ sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(" Property '") );
sMessage += aRelPath.toString();
- sMessage += OUString( RTL_CONSTASCII_USTRINGPARAM("' is not a simple value property.") );
+ sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' is not a simple value property.") );
- Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw PropertyVetoException( sMessage, xContext );
+ uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
+ throw beans::PropertyVetoException( sMessage, xContext );
}
OSL_ASSERT(aNode.isValid());
- NodeChange aChange = lock.getNodeUpdater().validateSetValue( aNestedValue.toValue(), aValues[i] );
+ configuration::NodeChange aChange = lock.getNodeUpdater().validateSetValue( aNestedValue.toValue(), aValues[i] );
if (aChange.maybeChange())
{
aChanges.add(aChange);
@@ -605,7 +570,7 @@ void implSetHierarchicalPropertyValues( NodeGroupAccess& rNode, const Sequence<
aSender.queryConstraints(aChanges);
- aTree.integrate(aChanges, aNode, false);
+ aTree->integrate(aChanges, aNode, false);
lock.clearForBroadcast();
aSender.notifyListeners(aChanges, true); // if we use 'false' we don't need 'Deep' change objects
@@ -620,9 +585,9 @@ void implSetHierarchicalPropertyValues( NodeGroupAccess& rNode, const Sequence<
catch (configuration::ConstraintViolation& ex)
{
ExceptionMapper e(ex);
- OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value: ") );
- Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw PropertyVetoException( sMessage += e.message(), xContext );
+ rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value: ") );
+ uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
+ throw beans::PropertyVetoException( sMessage += e.message(), xContext );
}
catch (configuration::Exception& ex)
{
@@ -638,31 +603,31 @@ void implSetHierarchicalPropertyValues( NodeGroupAccess& rNode, const Sequence<
// XPropertySet
//-----------------------------------------------------------------------------------
-Any implGetPropertyValue( NodeGroupInfoAccess& rNode,const OUString& aPropertyName )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, RuntimeException)
+uno::Any implGetPropertyValue( NodeGroupInfoAccess& rNode,const rtl::OUString& aPropertyName )
+ throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
try
{
- GuardedNodeDataAccess lock( rNode );
+ GuardedNodeData<NodeAccess> lock( rNode );
- Tree const aTree( lock.getTree() );
- NodeRef const aNode( lock.getNode() );
+ rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
+ configuration::NodeRef const aNode( lock.getNode() );
- Name aChildName = validateChildName(aPropertyName,aTree,aNode);
+ rtl::OUString aChildName = configuration::validateChildName(aPropertyName,aTree,aNode);
- AnyNodeRef aChild( aTree.getAnyChild(aNode, aChildName) );
+ configuration::AnyNodeRef aChild( aTree->getAnyChild(aNode, aChildName) );
if (!aChild.isValid())
{
OSL_ENSURE(!configuration::hasChildOrElement(aTree,aNode,aChildName),"ERROR: Configuration: Existing Property not found by implementation");
- OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot get Property Value. Property '") );
+ rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot get Property Value. Property '") );
sMessage += aPropertyName;
- sMessage += OUString( RTL_CONSTASCII_USTRINGPARAM("' could not be found in ") );
- sMessage += aTree.getAbsolutePath(aNode).toString();
+ sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' could not be found in ") );
+ sMessage += aTree->getAbsolutePath(aNode).toString();
- Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw UnknownPropertyException( sMessage, xContext );
+ uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
+ throw beans::UnknownPropertyException( sMessage, xContext );
}
return configapi::makeElement( rNode.getFactory(), aTree, aChild );
@@ -670,8 +635,8 @@ Any implGetPropertyValue( NodeGroupInfoAccess& rNode,const OUString& aPropertyNa
catch (configuration::InvalidName& ex)
{
ExceptionMapper e(ex);
- Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw UnknownPropertyException( e.message(), xContext );
+ uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
+ throw beans::UnknownPropertyException( e.message(), xContext );
}
catch (configuration::Exception& ex)
{
@@ -682,29 +647,29 @@ Any implGetPropertyValue( NodeGroupInfoAccess& rNode,const OUString& aPropertyNa
// unreachable, but still there to make some compilers happy
OSL_ASSERT(!"Unreachable code");
- return Any();
+ return uno::Any();
}
// XMultiPropertySet
//-----------------------------------------------------------------------------------
-Sequence< Any > implGetPropertyValues( NodeGroupInfoAccess& rNode, const Sequence< OUString >& aPropertyNames )
- throw(RuntimeException)
+uno::Sequence< uno::Any > implGetPropertyValues( NodeGroupInfoAccess& rNode, const uno::Sequence< rtl::OUString >& aPropertyNames )
+ throw(uno::RuntimeException)
{
sal_Int32 const count = aPropertyNames.getLength();
- Sequence<Any> aRet(count);
+ uno::Sequence<uno::Any> aRet(count);
try
{
- GuardedNodeDataAccess lock( rNode );
+ GuardedNodeData<NodeAccess> lock( rNode );
- Tree const aTree( lock.getTree() );
- NodeRef const aNode( lock.getNode() );
+ rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
+ configuration::NodeRef const aNode( lock.getNode() );
for(sal_Int32 i = 0; i < count; ++i)
{
- Name aChildName = configuration::makeNodeName( aPropertyNames[i], Name::NoValidate() ); // not validated
+ rtl::OUString aChildName( aPropertyNames[i] ); // not validated
- AnyNodeRef aChild( aTree.getAnyChild(aNode, aChildName) );
+ configuration::AnyNodeRef aChild( aTree->getAnyChild(aNode, aChildName) );
if (aChild.isValid())
{
@@ -729,31 +694,29 @@ Sequence< Any > implGetPropertyValues( NodeGroupInfoAccess& rNode, const Sequenc
// XHierarchicalPropertySet
//-----------------------------------------------------------------------------------
-Any implGetHierarchicalPropertyValue( NodeGroupInfoAccess& rNode, const OUString& aPropertyName )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, RuntimeException)
+uno::Any implGetHierarchicalPropertyValue( NodeGroupInfoAccess& rNode, const rtl::OUString& aPropertyName )
+ throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
- using configuration::validateRelativePath; // should actually be found by "Koenig" lookup, but MSVC6 fails
- using configuration::getLocalDescendant; // should actually be found by "Koenig" lookup, but MSVC6 fails
try
{
- GuardedNodeDataAccess lock( rNode );
+ GuardedNodeData<NodeAccess> lock( rNode );
- Tree const aTree( lock.getTree() );
- NodeRef const aNode( lock.getNode() );
+ rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
+ configuration::NodeRef const aNode( lock.getNode() );
- RelativePath aRelPath = validateRelativePath( aPropertyName, aTree, aNode );
+ configuration::RelativePath aRelPath = configuration::validateRelativePath( aPropertyName, aTree, aNode );
- AnyNodeRef aNestedNode = getLocalDescendant( aTree, aNode, aRelPath );
+ configuration::AnyNodeRef aNestedNode = configuration::getLocalDescendant( aTree, aNode, aRelPath );
if (!aNestedNode.isValid())
{
- OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot get Property Value. Property '") );
+ rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot get Property Value. Property '") );
sMessage += aRelPath.toString();
- sMessage += OUString( RTL_CONSTASCII_USTRINGPARAM("' could not be found in ") );
- sMessage += aTree.getAbsolutePath(aNode).toString();
+ sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' could not be found in ") );
+ sMessage += aTree->getAbsolutePath(aNode).toString();
- Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw UnknownPropertyException( sMessage, xContext );
+ uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
+ throw beans::UnknownPropertyException( sMessage, xContext );
}
OSL_ASSERT(aNode.isValid());
@@ -762,8 +725,8 @@ Any implGetHierarchicalPropertyValue( NodeGroupInfoAccess& rNode, const OUString
catch (configuration::InvalidName& ex)
{
ExceptionMapper e(ex);
- Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw UnknownPropertyException( e.message(), xContext );
+ uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
+ throw beans::UnknownPropertyException( e.message(), xContext );
}
catch (configuration::Exception& ex)
{
@@ -774,33 +737,30 @@ Any implGetHierarchicalPropertyValue( NodeGroupInfoAccess& rNode, const OUString
// unreachable, but still there to make some compilers happy
OSL_ASSERT(!"Unreachable code");
- return Any();
+ return uno::Any();
}
// XMultiHierarchicalPropertySet
//-----------------------------------------------------------------------------------
-Sequence< Any > implGetHierarchicalPropertyValues( NodeGroupInfoAccess& rNode, const Sequence< OUString >& aPropertyNames )
- throw(RuntimeException)
+uno::Sequence< uno::Any > implGetHierarchicalPropertyValues( NodeGroupInfoAccess& rNode, const uno::Sequence< rtl::OUString >& aPropertyNames )
+ throw(uno::RuntimeException)
{
- using configuration::validateRelativePath; // should actually be found by "Koenig" lookup, but MSVC6 fails
- using configuration::getLocalDescendant; // should actually be found by "Koenig" lookup, but MSVC6 fails
-
sal_Int32 const count = aPropertyNames.getLength();
- Sequence<Any> aRet(count);
+ uno::Sequence<uno::Any> aRet(count);
try
{
- GuardedNodeDataAccess lock( rNode );
+ GuardedNodeData<NodeAccess> lock( rNode );
- Tree const aTree( lock.getTree() );
- NodeRef const aNode( lock.getNode() );
+ rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
+ configuration::NodeRef const aNode( lock.getNode() );
for(sal_Int32 i = 0; i < count; ++i)
try
{
- RelativePath aRelPath = validateRelativePath( aPropertyNames[i], aTree, aNode );
+ configuration::RelativePath aRelPath = configuration::validateRelativePath( aPropertyNames[i], aTree, aNode );
- AnyNodeRef aNestedValue = getLocalDescendant( aTree, aNode, aRelPath );
+ configuration::AnyNodeRef aNestedValue = configuration::getLocalDescendant( aTree, aNode, aRelPath );
if (aNestedValue.isValid())
{
@@ -831,8 +791,8 @@ Sequence< Any > implGetHierarchicalPropertyValues( NodeGroupInfoAccess& rNode, c
// SPECIAL: XMultiPropertySet::firePropertiesChangeEvent
//------------------------------------------------------------------------------------------------------------------
-void implFirePropertiesChangeEvent( NodeGroupInfoAccess& rNode, const Sequence< OUString >& aPropertyNames, const Reference< beans::XPropertiesChangeListener >& xListener )
- throw(RuntimeException)
+void implFirePropertiesChangeEvent( NodeGroupInfoAccess& rNode, const uno::Sequence< rtl::OUString >& aPropertyNames, const uno::Reference< beans::XPropertiesChangeListener >& xListener )
+ throw(uno::RuntimeException)
{
OSL_ENSURE(xListener.is(), "ERROR: requesting to fire Events to a NULL listener.");
if (!xListener.is())
@@ -841,28 +801,28 @@ void implFirePropertiesChangeEvent( NodeGroupInfoAccess& rNode, const Sequence<
}
sal_Int32 const count = aPropertyNames.getLength();
- Sequence<beans::PropertyChangeEvent> aEvents(count);
+ uno::Sequence<beans::PropertyChangeEvent> aEvents(count);
try
{
- GuardedNodeDataAccess lock( rNode );
+ GuardedNodeData<NodeAccess> lock( rNode );
- Tree const aTree( lock.getTree() );
- NodeRef const aNode( lock.getNode() );
+ rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
+ configuration::NodeRef const aNode( lock.getNode() );
configapi::Factory& rFactory = rNode.getFactory();
sal_Int32 nFire = 0;
for(sal_Int32 i = 0; i < count; ++i)
{
- Name aChildName = configuration::makeNodeName( aPropertyNames[i], Name::NoValidate() ); // not validated
+ rtl::OUString aChildName( aPropertyNames[i] ); // not validated
- AnyNodeRef aChild( aTree.getAnyChild(aNode, aChildName) );
+ configuration::AnyNodeRef aChild( aTree->getAnyChild(aNode, aChildName) );
if (aChild.isValid())
{
aEvents[nFire].Source = rNode.getUnoInstance();
- aEvents[nFire].PropertyName = aChildName.toString();
+ aEvents[nFire].PropertyName = aChildName;
aEvents[nFire].PropertyHandle = -1;
aEvents[nFire].NewValue = aEvents[nFire].OldValue = configapi::makeElement( rFactory, aTree, aChild );
@@ -891,42 +851,40 @@ void implFirePropertiesChangeEvent( NodeGroupInfoAccess& rNode, const Sequence<
// XPropertyState
//------------------------------------------------------------------------------------------------------------------
-beans::PropertyState implGetPropertyState( NodeAccess& rNode, const OUString& sPropertyName )
- throw(beans::UnknownPropertyException, RuntimeException)
+beans::PropertyState implGetPropertyState( NodeAccess& rNode, const rtl::OUString& sPropertyName )
+ throw(beans::UnknownPropertyException, uno::RuntimeException)
{
try
{
- using configuration::getChildOrElement;
+ GuardedNodeData<NodeAccess> lock( rNode );
- GuardedNodeDataAccess lock( rNode );
+ rtl::Reference< configuration::Tree > aTree( lock.getTree() );
+ configuration::NodeRef const aNode( lock.getNode() );
- Tree aTree( lock.getTree() );
- NodeRef const aNode( lock.getNode() );
+ rtl::OUString aChildName = configuration::validateChildOrElementName(sPropertyName,aTree,aNode);
- Name aChildName = validateChildOrElementName(sPropertyName,aTree,aNode);
-
- AnyNodeRef aChild = getChildOrElement(aTree,aNode,aChildName);
+ configuration::AnyNodeRef aChild = configuration::getChildOrElement(aTree,aNode,aChildName);
if (!aChild.isValid())
{
- OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot get PropertyState. Property '") );
+ rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot get PropertyState. Property '") );
sMessage += sPropertyName;
- sMessage += OUString( RTL_CONSTASCII_USTRINGPARAM("' not found in ") );
- sMessage += aTree.getAbsolutePath(aNode).toString();
+ sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' not found in ") );
+ sMessage += aTree->getAbsolutePath(aNode).toString();
- Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw UnknownPropertyException( sMessage, xContext );
+ uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
+ throw beans::UnknownPropertyException( sMessage, xContext );
}
OSL_ASSERT(aNode.isValid());
- return aTree.isNodeDefault(aChild) ? beans::PropertyState_DEFAULT_VALUE :
+ return aTree->isNodeDefault(aChild) ? beans::PropertyState_DEFAULT_VALUE :
aChild.isNode() ? beans::PropertyState_AMBIGUOUS_VALUE :
beans::PropertyState_DIRECT_VALUE;
}
catch (configuration::InvalidName& ex)
{
ExceptionMapper e(ex);
- Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw UnknownPropertyException( e.message(), xContext );
+ uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
+ throw beans::UnknownPropertyException( e.message(), xContext );
}
catch (configuration::Exception& ex)
{
@@ -941,41 +899,39 @@ beans::PropertyState implGetPropertyState( NodeAccess& rNode, const OUString& sP
}
//-----------------------------------------------------------------------------------
-Sequence< beans::PropertyState > implGetPropertyStates( NodeAccess& rNode, const Sequence< OUString >& aPropertyNames )
- throw(beans::UnknownPropertyException, RuntimeException)
+uno::Sequence< beans::PropertyState > implGetPropertyStates( NodeAccess& rNode, const uno::Sequence< rtl::OUString >& aPropertyNames )
+ throw(beans::UnknownPropertyException, uno::RuntimeException)
{
sal_Int32 const count = aPropertyNames.getLength();
- Sequence<beans::PropertyState> aRet(count);
+ uno::Sequence<beans::PropertyState> aRet(count);
try
{
- GuardedNodeDataAccess lock( rNode );
+ GuardedNodeData<NodeAccess> lock( rNode );
- Tree const aTree( lock.getTree() );
- NodeRef const aNode( lock.getNode() );
+ rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
+ configuration::NodeRef const aNode( lock.getNode() );
for(sal_Int32 i = 0; i < count; ++i)
{
- using configuration::getChildOrElement;
-
- Name aChildName = validateChildOrElementName(aPropertyNames[i],aTree,aNode);
+ rtl::OUString aChildName = configuration::validateChildOrElementName(aPropertyNames[i],aTree,aNode);
- Tree aChildTree( aTree);
+ rtl::Reference< configuration::Tree > aChildTree( aTree);
- AnyNodeRef aChildNode = getChildOrElement(aChildTree,aNode,aChildName);
+ configuration::AnyNodeRef aChildNode = configuration::getChildOrElement(aChildTree,aNode,aChildName);
if (!aChildNode.isValid())
{
- OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot get PropertyStates. Property '") );
+ rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot get PropertyStates. Property '") );
sMessage += aPropertyNames[i];
- sMessage += OUString( RTL_CONSTASCII_USTRINGPARAM("' could not be found in ") );
- sMessage += aTree.getAbsolutePath(aNode).toString();
+ sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' could not be found in ") );
+ sMessage += aTree->getAbsolutePath(aNode).toString();
- Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw UnknownPropertyException( sMessage, xContext );
+ uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
+ throw beans::UnknownPropertyException( sMessage, xContext );
}
OSL_ASSERT(aChildNode.isValid());
- aRet[i] = aChildTree.isNodeDefault(aChildNode) ? beans::PropertyState_DEFAULT_VALUE :
+ aRet[i] = aChildTree->isNodeDefault(aChildNode) ? beans::PropertyState_DEFAULT_VALUE :
aChildNode.isNode() ? beans::PropertyState_AMBIGUOUS_VALUE :
beans::PropertyState_DIRECT_VALUE;
}
@@ -984,8 +940,8 @@ Sequence< beans::PropertyState > implGetPropertyStates( NodeAccess& rNode, const
catch (configuration::InvalidName& ex)
{
ExceptionMapper e(ex);
- Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw UnknownPropertyException( e.message(), xContext );
+ uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
+ throw beans::UnknownPropertyException( e.message(), xContext );
}
catch (configuration::Exception& ex)
{
@@ -998,7 +954,7 @@ Sequence< beans::PropertyState > implGetPropertyStates( NodeAccess& rNode, const
}
//-----------------------------------------------------------------------------------
-static inline NodeChange validateSetToDefaultHelper(configuration::GroupDefaulter& _rDefaulter, AnyNodeRef _aNode)
+static inline configuration::NodeChange validateSetToDefaultHelper(configuration::GroupDefaulter& _rDefaulter, configuration::AnyNodeRef _aNode)
{
if (!_aNode.isNode())
return _rDefaulter.validateSetToDefaultValue( _aNode.toValue() );
@@ -1007,24 +963,24 @@ static inline NodeChange validateSetToDefaultHelper(configuration::GroupDefaulte
return _rDefaulter.validateSetToDefaultState( _aNode.toNode() );
}
//-----------------------------------------------------------------------------------
-void implSetPropertyToDefault( NodeGroupAccess& rNode, const OUString& sPropertyName )
- throw(beans::UnknownPropertyException, RuntimeException)
+void implSetPropertyToDefault( NodeGroupAccess& rNode, const rtl::OUString& sPropertyName )
+ throw(beans::UnknownPropertyException, uno::RuntimeException)
{
try
{
UnoApiLock aWithDefaultLock;
- GuardedGroupUpdateAccess lock( withDefaultData( rNode ) );
+ GuardedNodeUpdate<NodeGroupAccess> lock( withDefaultData( rNode ) );
- Tree const aTree( lock.getTree() );
- NodeRef const aNode( lock.getNode() );
+ rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
+ configuration::NodeRef const aNode( lock.getNode() );
configuration::GroupDefaulter aDefaulter = lock.getNodeDefaulter();
- Name aChildName = validateChildName(sPropertyName,aTree,aNode);
+ rtl::OUString aChildName = configuration::validateChildName(sPropertyName,aTree,aNode);
- AnyNodeRef aChild( aTree.getAnyChild(aNode, aChildName) );
+ configuration::AnyNodeRef aChild( aTree->getAnyChild(aNode, aChildName) );
- NodeChange aChange = validateSetToDefaultHelper( aDefaulter, aChild );
+ configuration::NodeChange aChange = validateSetToDefaultHelper( aDefaulter, aChild );
const bool bLocal = !aDefaulter.hasDoneSet();
@@ -1034,7 +990,7 @@ void implSetPropertyToDefault( NodeGroupAccess& rNode, const OUString& sProperty
aSender.queryConstraints(aChange);
- aTree.integrate(aChange, aNode, bLocal);
+ aTree->integrate(aChange, aNode, bLocal);
lock.clearForBroadcast();
aSender.notifyListeners(aChange);
@@ -1043,16 +999,16 @@ void implSetPropertyToDefault( NodeGroupAccess& rNode, const OUString& sProperty
catch (configuration::InvalidName& ex)
{
ExceptionMapper e(ex);
- OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot restore Default: ") );
- Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw UnknownPropertyException( sMessage += e.message(), xContext );
+ rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot restore Default: ") );
+ uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
+ throw beans::UnknownPropertyException( sMessage += e.message(), xContext );
}
catch (configuration::ConstraintViolation & ex)
{
ExceptionMapper e(ex);
- OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot restore Default: ") );
- Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw UnknownPropertyException( sMessage += e.message(), xContext );
+ rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot restore Default: ") );
+ uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
+ throw beans::UnknownPropertyException( sMessage += e.message(), xContext );
}
catch (configuration::Exception& ex)
{
@@ -1062,58 +1018,58 @@ void implSetPropertyToDefault( NodeGroupAccess& rNode, const OUString& sProperty
}
}
//-----------------------------------------------------------------------------------
-void implSetPropertiesToDefault( NodeGroupAccess& rNode, const Sequence< OUString >& aPropertyNames )
- throw(beans::UnknownPropertyException, RuntimeException)
+void implSetPropertiesToDefault( NodeGroupAccess& rNode, const uno::Sequence< rtl::OUString >& aPropertyNames )
+ throw(beans::UnknownPropertyException, uno::RuntimeException)
{
try
{
UnoApiLock aWithDefaultLock;
- GuardedGroupUpdateAccess lock( withDefaultData( rNode ) );
+ GuardedNodeUpdate<NodeGroupAccess> lock( withDefaultData( rNode ) );
- Tree const aTree( lock.getTree() );
- NodeRef const aNode( lock.getNode() );
+ rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
+ configuration::NodeRef const aNode( lock.getNode() );
configuration::GroupDefaulter aDefaulter = lock.getNodeDefaulter();
- NodeChanges aChanges;
+ configuration::NodeChanges aChanges;
for(sal_Int32 i = 0, count= aPropertyNames.getLength(); i < count; ++i)
{
- Name aChildName = validateChildName( aPropertyNames[i], aTree, aNode ); // validated
+ rtl::OUString aChildName = configuration::validateChildName( aPropertyNames[i], aTree, aNode ); // validated
- AnyNodeRef aChild( aTree.getAnyChild(aNode, aChildName) );
+ configuration::AnyNodeRef aChild( aTree->getAnyChild(aNode, aChildName) );
if (!aChild.isValid())
{
OSL_ENSURE(!configuration::hasChildOrElement(aTree, aNode, aChildName),"ERROR: Configuration: Existing Property not found by implementation");
- OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot restore Default.") );
- sMessage += OUString( RTL_CONSTASCII_USTRINGPARAM(" Property '") );
- sMessage += aChildName.toString();
- sMessage += OUString( RTL_CONSTASCII_USTRINGPARAM("' not found in ") );
- sMessage += aTree.getAbsolutePath(aNode).toString();
+ rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot restore Default.") );
+ sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(" Property '") );
+ sMessage += aChildName;
+ sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' not found in ") );
+ sMessage += aTree->getAbsolutePath(aNode).toString();
- Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw UnknownPropertyException( sMessage, xContext );
+ uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
+ throw beans::UnknownPropertyException( sMessage, xContext );
}
OSL_ASSERT(aNode.isValid());
- if (!aTree.hasNodeDefault(aChild))
+ if (!aTree->hasNodeDefault(aChild))
{
- OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot restore Default.") );
- sMessage += OUString( RTL_CONSTASCII_USTRINGPARAM(" Property '") );
- sMessage += aChildName.toString();
+ rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot restore Default.") );
+ sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(" Property '") );
+ sMessage += aChildName;
if (aChild.isNode())
- sMessage += OUString( RTL_CONSTASCII_USTRINGPARAM("' is not a simple value.") );
+ sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' is not a simple value.") );
else
- sMessage += OUString( RTL_CONSTASCII_USTRINGPARAM("' does not have a default value.") );
+ sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' does not have a default value.") );
- Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw UnknownPropertyException( sMessage, xContext );
+ uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
+ throw beans::UnknownPropertyException( sMessage, xContext );
}
- NodeChange aChildChange = validateSetToDefaultHelper(aDefaulter, aChild );
+ configuration::NodeChange aChildChange = validateSetToDefaultHelper(aDefaulter, aChild );
if (aChildChange.maybeChange())
aChanges.add(aChildChange);
}
@@ -1126,7 +1082,7 @@ void implSetPropertiesToDefault( NodeGroupAccess& rNode, const Sequence< OUStrin
aSender.queryConstraints(aChanges);
- aTree.integrate(aChanges, aNode, bLocal);
+ aTree->integrate(aChanges, aNode, bLocal);
lock.clearForBroadcast();
aSender.notifyListeners(aChanges, bLocal);
@@ -1136,16 +1092,16 @@ void implSetPropertiesToDefault( NodeGroupAccess& rNode, const Sequence< OUStrin
catch (configuration::InvalidName& ex)
{
ExceptionMapper e(ex);
- OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot restore Defaults: ") );
- Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw UnknownPropertyException( sMessage += e.message(), xContext );
+ rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot restore Defaults: ") );
+ uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
+ throw beans::UnknownPropertyException( sMessage += e.message(), xContext );
}
catch (configuration::ConstraintViolation & ex)
{
ExceptionMapper e(ex);
- OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot restore Defaults: ") );
- Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw UnknownPropertyException( sMessage += e.message(), xContext );
+ rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot restore Defaults: ") );
+ uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
+ throw beans::UnknownPropertyException( sMessage += e.message(), xContext );
}
catch (configuration::Exception& ex)
{
@@ -1157,19 +1113,19 @@ void implSetPropertiesToDefault( NodeGroupAccess& rNode, const Sequence< OUStrin
//-----------------------------------------------------------------------------------
void implSetAllPropertiesToDefault( NodeGroupAccess& rNode )
- throw(RuntimeException)
+ throw(uno::RuntimeException)
{
try
{
UnoApiLock aWithDefaultLock;
- GuardedGroupUpdateAccess lock( withDefaultData( rNode ) );
+ GuardedNodeUpdate<NodeGroupAccess> lock( withDefaultData( rNode ) );
- Tree const aTree( lock.getTree() );
- NodeRef const aNode( lock.getNode() );
+ rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
+ configuration::NodeRef const aNode( lock.getNode() );
configuration::GroupDefaulter aDefaulter = lock.getNodeDefaulter();
- NodeChanges aChanges = aDefaulter.validateSetAllToDefault( );
+ configuration::NodeChanges aChanges = aDefaulter.validateSetAllToDefault( );
const bool bLocal = !aDefaulter.hasDoneSet();
@@ -1179,7 +1135,7 @@ void implSetAllPropertiesToDefault( NodeGroupAccess& rNode )
aSender.queryConstraints(aChanges);
- aTree.integrate(aChanges, aNode, bLocal);
+ aTree->integrate(aChanges, aNode, bLocal);
lock.clearForBroadcast();
aSender.notifyListeners(aChanges, bLocal);
@@ -1189,16 +1145,16 @@ void implSetAllPropertiesToDefault( NodeGroupAccess& rNode )
catch (configuration::InvalidName& ex)
{
ExceptionMapper e(ex);
- OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot restore Defaults: ") );
- Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw UnknownPropertyException( sMessage += e.message(), xContext );
+ rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot restore Defaults: ") );
+ uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
+ throw beans::UnknownPropertyException( sMessage += e.message(), xContext );
}
catch (configuration::ConstraintViolation & ex)
{
ExceptionMapper e(ex);
- OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot restore Defaults: ") );
- Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw UnknownPropertyException( sMessage += e.message(), xContext );
+ rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot restore Defaults: ") );
+ uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
+ throw beans::UnknownPropertyException( sMessage += e.message(), xContext );
}
catch (configuration::Exception& ex)
{
@@ -1209,49 +1165,49 @@ void implSetAllPropertiesToDefault( NodeGroupAccess& rNode )
}
//-----------------------------------------------------------------------------------
-Any implGetPropertyDefault( NodeGroupInfoAccess& rNode, const OUString& sPropertyName )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, RuntimeException)
+uno::Any implGetPropert