summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Lohmaier <cloph@openoffice.org>2010-04-23 21:45:49 +0200
committerChristian Lohmaier <cloph@openoffice.org>2010-04-23 21:45:49 +0200
commit5f6d30c5b1f7d539200dacc1e2929b371a5a4ccf (patch)
tree8b41623c4aefcfb2ca209fb55de0b684850ab468
parentfce3cb9ef649ab0047e28b2f54dcbd87806940c1 (diff)
parenteeaf2f34f56d815040b0e80b5e3abd6b08400bdc (diff)
cloph14: merge with DEV300_m77
-rw-r--r--avmedia/source/quicktime/avmediaQuickTime.map8
-rw-r--r--avmedia/source/quicktime/makefile.mk2
-rw-r--r--basic/source/app/app.cxx35
-rw-r--r--basic/source/app/basic.src4
-rw-r--r--basic/source/basmgr/basmgr.cxx27
-rw-r--r--basic/source/classes/sb.cxx7
-rw-r--r--basic/source/classes/sbunoobj.cxx111
-rw-r--r--basic/source/inc/sbunoobj.hxx18
-rw-r--r--basic/source/uno/namecont.cxx157
-rw-r--r--configmgr/inc/configmgr/detail/configmgrdllapi.hxx41
-rw-r--r--configmgr/inc/configmgr/update.hxx51
-rw-r--r--configmgr/inc/makefile.mk34
-rw-r--r--configmgr/inc/pch/precompiled_configmgr.cxx51
-rw-r--r--configmgr/inc/pch/precompiled_configmgr.hxx267
-rw-r--r--configmgr/prj/build.lst22
-rw-r--r--configmgr/prj/d.lst16
-rw-r--r--configmgr/qa/unit/common.hxx111
-rw-r--r--configmgr/qa/unit/configmgrrc22
-rw-r--r--configmgr/qa/unit/data.xcd (renamed from configmgr/qa/unit/data/org/openoffice/UI/GenericCommands.xcu)175
-rw-r--r--configmgr/qa/unit/data/org/openoffice/Setup.xcu43
-rw-r--r--configmgr/qa/unit/export.map7
-rw-r--r--configmgr/qa/unit/makefile.mk80
-rw-r--r--[-rwxr-xr-x]configmgr/qa/unit/no_localization (renamed from connectivity/util/delzip)0
-rw-r--r--configmgr/qa/unit/performance.cxx268
-rw-r--r--configmgr/qa/unit/schema/org/openoffice/Setup.xcs72
-rw-r--r--configmgr/qa/unit/schema/org/openoffice/UI/Commands.xcs62
-rw-r--r--configmgr/qa/unit/schema/org/openoffice/UI/GenericCommands.xcs49
-rw-r--r--configmgr/qa/unit/test.cxx678
-rw-r--r--configmgr/qa/unit/threading.cxx259
-rw-r--r--configmgr/qa/unit/ubootstrap.cxx120
-rw-r--r--configmgr/qa/unit/urebootstrap.ini (renamed from configmgr/source/api/makefile.mk)29
-rw-r--r--configmgr/qa/unit/version.map (renamed from configmgr/version.mk)28
-rw-r--r--configmgr/qa/unoapi/Test.java50
-rw-r--r--configmgr/qa/unoapi/cfgmgr2.sce34
-rw-r--r--configmgr/qa/unoapi/knownissues.xcl55
-rw-r--r--configmgr/qa/unoapi/makefile.mk34
-rw-r--r--configmgr/qa/unoapi/module.sce (renamed from configmgr/makefile.pmk)7
-rw-r--r--configmgr/source/README156
-rw-r--r--configmgr/source/access.cxx2186
-rw-r--r--configmgr/source/access.hxx582
-rw-r--r--configmgr/source/api/confevents.cxx302
-rw-r--r--configmgr/source/api/confsvccomponent.cxx100
-rw-r--r--configmgr/source/api2/accessimpl.cxx804
-rw-r--r--configmgr/source/api2/accessimpl.hxx136
-rw-r--r--configmgr/source/api2/apiaccessobj.cxx290
-rw-r--r--configmgr/source/api2/apiaccessobj.hxx145
-rw-r--r--configmgr/source/api2/apiaccessobj.inl260
-rw-r--r--configmgr/source/api2/apifactory.cxx335
-rw-r--r--configmgr/source/api2/apifactory.hxx119
-rw-r--r--configmgr/source/api2/apifactoryimpl.cxx352
-rw-r--r--configmgr/source/api2/apifactoryimpl.hxx68
-rw-r--r--configmgr/source/api2/apinodeaccess.cxx178
-rw-r--r--configmgr/source/api2/apinodeaccess.hxx172
-rw-r--r--configmgr/source/api2/apinodeupdate.cxx169
-rw-r--r--configmgr/source/api2/apinodeupdate.hxx174
-rw-r--r--configmgr/source/api2/apinotifierimpl.cxx329
-rw-r--r--configmgr/source/api2/apinotifierimpl.hxx102
-rw-r--r--configmgr/source/api2/apiserviceinfo.cxx337
-rw-r--r--configmgr/source/api2/apiserviceinfo.hxx69
-rw-r--r--configmgr/source/api2/apitreeaccess.cxx110
-rw-r--r--configmgr/source/api2/apitreeaccess.hxx176
-rw-r--r--configmgr/source/api2/apitreeimplobj.cxx1001
-rw-r--r--configmgr/source/api2/apitreeimplobj.hxx189
-rw-r--r--configmgr/source/api2/broadcaster.cxx1226
-rw-r--r--configmgr/source/api2/broadcaster.hxx88
-rw-r--r--configmgr/source/api2/committer.cxx130
-rw-r--r--configmgr/source/api2/committer.hxx57
-rw-r--r--configmgr/source/api2/confignotifier.cxx243
-rw-r--r--configmgr/source/api2/confignotifier.hxx197
-rw-r--r--configmgr/source/api2/elementaccess.cxx486
-rw-r--r--configmgr/source/api2/elementaccess.hxx383
-rw-r--r--configmgr/source/api2/elementimpl.cxx588
-rw-r--r--configmgr/source/api2/elementimpl.hxx157
-rw-r--r--configmgr/source/api2/groupaccess.cxx144
-rw-r--r--configmgr/source/api2/groupaccess.hxx135
-rw-r--r--configmgr/source/api2/groupobjects.cxx407
-rw-r--r--configmgr/source/api2/groupobjects.hxx268
-rw-r--r--configmgr/source/api2/groupupdate.cxx104
-rw-r--r--configmgr/source/api2/groupupdate.hxx98
-rw-r--r--configmgr/source/api2/listenercontainer.cxx80
-rw-r--r--configmgr/source/api2/listenercontainer.hxx581
-rw-r--r--configmgr/source/api2/makefile.mk79
-rw-r--r--configmgr/source/api2/notifierimpl.hxx238
-rw-r--r--configmgr/source/api2/objectregistry.hxx95
-rw-r--r--configmgr/source/api2/propertiesfilterednotifier.cxx151
-rw-r--r--configmgr/source/api2/propertiesfilterednotifier.hxx76
-rw-r--r--configmgr/source/api2/propertyinfohelper.cxx72
-rw-r--r--configmgr/source/api2/propertyinfohelper.hxx56
-rw-r--r--configmgr/source/api2/propertysetaccess.cxx275
-rw-r--r--configmgr/source/api2/propertysetaccess.hxx215
-rw-r--r--configmgr/source/api2/propsetaccessimpl.cxx1284
-rw-r--r--configmgr/source/api2/propsetaccessimpl.hxx138
-rw-r--r--configmgr/source/api2/provider.cxx711
-rw-r--r--configmgr/source/api2/provider.hxx198
-rw-r--r--configmgr/source/api2/providerimpl.cxx893
-rw-r--r--configmgr/source/api2/providerimpl.hxx228
-rw-r--r--configmgr/source/api2/setaccess.cxx185
-rw-r--r--configmgr/source/api2/setaccess.hxx167
-rw-r--r--configmgr/source/api2/setobjects.cxx547
-rw-r--r--configmgr/source/api2/setobjects.hxx358
-rw-r--r--configmgr/source/api2/setupdate.cxx241
-rw-r--r--configmgr/source/api2/setupdate.hxx208
-rw-r--r--configmgr/source/api2/translatechanges.cxx283
-rw-r--r--configmgr/source/api2/translatechanges.hxx117
-rw-r--r--configmgr/source/api2/treeiterators.cxx93
-rw-r--r--configmgr/source/api2/treeiterators.hxx85
-rw-r--r--configmgr/source/api2/updateimpl.cxx647
-rw-r--r--configmgr/source/api2/updateimpl.hxx95
-rw-r--r--configmgr/source/backend/backendaccess.cxx827
-rw-r--r--configmgr/source/backend/backendaccess.hxx157
-rw-r--r--configmgr/source/backend/backendfactory.cxx329
-rw-r--r--configmgr/source/backend/backendnotifier.cxx195
-rw-r--r--configmgr/source/backend/backendnotifier.hxx120
-rw-r--r--configmgr/source/backend/backendstratalistener.cxx56
-rw-r--r--configmgr/source/backend/backendstratalistener.hxx74
-rw-r--r--configmgr/source/backend/basicimporthandler.cxx114
-rw-r--r--configmgr/source/backend/basicimporthandler.hxx96
-rw-r--r--configmgr/source/backend/basicupdatemerger.cxx338
-rw-r--r--configmgr/source/backend/basicupdatemerger.hxx157
-rw-r--r--configmgr/source/backend/binarycache.cxx248
-rw-r--r--configmgr/source/backend/binarycache.hxx100
-rw-r--r--configmgr/source/backend/binaryreader.cxx690
-rw-r--r--configmgr/source/backend/binaryreader.hxx85
-rw-r--r--configmgr/source/backend/binaryreadhandler.cxx687
-rw-r--r--configmgr/source/backend/binaryreadhandler.hxx133
-rw-r--r--configmgr/source/backend/binarytype.hxx61
-rw-r--r--configmgr/source/backend/binarywritehandler.cxx489
-rw-r--r--configmgr/source/backend/binarywritehandler.hxx117
-rw-r--r--configmgr/source/backend/binarywriter.cxx215
-rw-r--r--configmgr/source/backend/binarywriter.hxx76
-rw-r--r--configmgr/source/backend/componentdatahelper.cxx614
-rw-r--r--configmgr/source/backend/componentdatahelper.hxx219
-rw-r--r--configmgr/source/backend/emptylayer.cxx225
-rw-r--r--configmgr/source/backend/emptylayerimpl.hxx136
-rw-r--r--configmgr/source/backend/importmergehandler.cxx296
-rw-r--r--configmgr/source/backend/importmergehandler.hxx134
-rw-r--r--configmgr/source/backend/importsvc.cxx335
-rw-r--r--configmgr/source/backend/importsvc.hxx154
-rw-r--r--configmgr/source/backend/layerdefaultremover.cxx275
-rw-r--r--configmgr/source/backend/layerdefaultremover.hxx132
-rw-r--r--configmgr/source/backend/layermerge.cxx1036
-rw-r--r--configmgr/source/backend/layermerge.hxx188
-rw-r--r--configmgr/source/backend/layerupdate.cxx110
-rw-r--r--configmgr/source/backend/layerupdate.hxx87
-rw-r--r--configmgr/source/backend/layerupdatebuilder.cxx299
-rw-r--r--configmgr/source/backend/layerupdatebuilder.hxx105
-rw-r--r--configmgr/source/backend/layerupdatehandler.cxx313
-rw-r--r--configmgr/source/backend/layerupdatehandler.hxx154
-rw-r--r--configmgr/source/backend/layerupdatemerger.cxx512
-rw-r--r--configmgr/source/backend/layerupdatemerger.hxx130
-rw-r--r--configmgr/source/backend/makefile.mk77
-rw-r--r--configmgr/source/backend/mergedcomponentdata.cxx173
-rw-r--r--configmgr/source/backend/mergedcomponentdata.hxx99
-rw-r--r--configmgr/source/backend/multistratumbackend.cxx931
-rw-r--r--configmgr/source/backend/multistratumbackend.hxx219
-rw-r--r--configmgr/source/backend/schemabuilder.cxx536
-rw-r--r--configmgr/source/backend/schemabuilder.hxx151
-rw-r--r--configmgr/source/backend/singlebackendadapter.cxx336
-rw-r--r--configmgr/source/backend/singlebackendadapter.hxx142
-rw-r--r--configmgr/source/backend/updatedata.cxx455
-rw-r--r--configmgr/source/backend/updatedata.hxx266
-rw-r--r--configmgr/source/backend/updatedispatch.cxx496
-rw-r--r--configmgr/source/backend/updatedispatch.hxx103
-rw-r--r--configmgr/source/backend/updatesvc.cxx278
-rw-r--r--configmgr/source/backend/updatesvc.hxx122
-rw-r--r--configmgr/source/backendhelper/backendlayerhelper.cxx361
-rw-r--r--configmgr/source/backendhelper/backendlayerhelper.hxx165
-rw-r--r--configmgr/source/backendhelper/behelper.uno.xml35
-rw-r--r--configmgr/source/backendhelper/componentdf.cxx88
-rw-r--r--configmgr/source/backendhelper/exports.dxp3
-rw-r--r--configmgr/source/backendhelper/makefile.mk69
-rw-r--r--configmgr/source/broadcaster.cxx237
-rw-r--r--configmgr/source/broadcaster.hxx181
-rw-r--r--configmgr/source/childaccess.cxx391
-rw-r--r--configmgr/source/childaccess.hxx157
-rw-r--r--configmgr/source/components.cxx652
-rw-r--r--configmgr/source/components.hxx151
-rw-r--r--configmgr/source/configurationprovider.cxx519
-rw-r--r--configmgr/source/configurationprovider.hxx67
-rw-r--r--configmgr/source/configurationregistry.cxx950
-rw-r--r--configmgr/source/configurationregistry.hxx57
-rw-r--r--configmgr/source/data.cxx318
-rw-r--r--configmgr/source/data.hxx86
-rw-r--r--configmgr/source/data/anydata.cxx468
-rw-r--r--configmgr/source/data/makefile.mk50
-rw-r--r--configmgr/source/data/sequence.cxx490
-rw-r--r--configmgr/source/defaultprovider.cxx131
-rw-r--r--configmgr/source/defaultprovider.hxx59
-rw-r--r--configmgr/source/groupnode.cxx88
-rw-r--r--configmgr/source/groupnode.hxx75
-rw-r--r--configmgr/source/inc/anydata.hxx78
-rw-r--r--configmgr/source/inc/anynoderef.hxx157
-rw-r--r--configmgr/source/inc/anypair.hxx118
-rw-r--r--configmgr/source/inc/apitypes.hxx89
-rw-r--r--configmgr/source/inc/attributes.hxx133
-rw-r--r--configmgr/source/inc/autoobject.hxx97
-rw-r--r--configmgr/source/inc/autoreferencemap.hxx129
-rw-r--r--configmgr/source/inc/backendfactory.hxx68
-rw-r--r--configmgr/source/inc/bootstrap.hxx240
-rw-r--r--configmgr/source/inc/bootstrapcontext.hxx168
-rw-r--r--configmgr/source/inc/builddata.hxx69
-rw-r--r--configmgr/source/inc/cachefactory.hxx51
-rw-r--r--configmgr/source/inc/change.hxx504
-rw-r--r--configmgr/source/inc/confapifactory.hxx178
-rw-r--r--configmgr/source/inc/confevents.hxx213
-rw-r--r--configmgr/source/inc/configdefaultprovider.hxx95
-rw-r--r--configmgr/source/inc/configexcept.hxx117
-rw-r--r--configmgr/source/inc/configgroup.hxx114
-rw-r--r--configmgr/source/inc/configinteractionhandler.hxx81
-rw-r--r--configmgr/source/inc/configpath.hxx446
-rw-r--r--configmgr/source/inc/configset.hxx143
-rw-r--r--configmgr/source/inc/confsvccomponent.hxx88
-rw-r--r--configmgr/source/inc/datalock.hxx68
-rw-r--r--configmgr/source/inc/defaultprovider.hxx73
-rw-r--r--configmgr/source/inc/emptylayer.hxx53
-rw-r--r--configmgr/source/inc/filehelper.hxx114
-rw-r--r--configmgr/source/inc/flags.hxx133
-rw-r--r--configmgr/source/inc/interactionrequest.hxx163
-rw-r--r--configmgr/source/inc/localizedtreeactions.hxx52
-rw-r--r--configmgr/source/inc/logger.hxx113
-rw-r--r--configmgr/source/inc/matchlocale.hxx215
-rw-r--r--configmgr/source/inc/mergechange.hxx68
-rw-r--r--configmgr/source/inc/mergeddataprovider.hxx173
-rw-r--r--configmgr/source/inc/namecreator.hxx73
-rw-r--r--configmgr/source/inc/node.hxx229
-rw-r--r--configmgr/source/inc/nodechange.hxx157
-rw-r--r--configmgr/source/inc/nodechangeinfo.hxx246
-rw-r--r--configmgr/source/inc/nodeconverter.hxx61
-rw-r--r--configmgr/source/inc/noderef.hxx268
-rw-r--r--configmgr/source/inc/nodevisitor.hxx77
-rw-r--r--configmgr/source/inc/options.hxx102
-rw-r--r--configmgr/source/inc/oslstream.hxx131
-rw-r--r--configmgr/source/inc/propertysethelper.hxx110
-rw-r--r--configmgr/source/inc/request.hxx152
-rw-r--r--configmgr/source/inc/requestoptions.hxx121
-rw-r--r--configmgr/source/inc/requesttypes.hxx234
-rw-r--r--configmgr/source/inc/roottree.hxx112
-rw-r--r--configmgr/source/inc/sequence.hxx105
-rw-r--r--configmgr/source/inc/serviceinfohelper.hxx135
-rw-r--r--configmgr/source/inc/simpleinteractionrequest.hxx101
-rw-r--r--configmgr/source/inc/simpletypehelper.hxx53
-rw-r--r--configmgr/source/inc/stack.hxx58
-rw-r--r--configmgr/source/inc/strdecl.hxx60
-rw-r--r--configmgr/source/inc/strings.hxx74
-rw-r--r--configmgr/source/inc/template.hxx107
-rw-r--r--configmgr/source/inc/tracer.hxx135
-rw-r--r--configmgr/source/inc/tree.hxx665
-rw-r--r--configmgr/source/inc/treeactions.hxx89
-rw-r--r--configmgr/source/inc/treechangefactory.hxx104
-rw-r--r--configmgr/source/inc/treechangelist.hxx120
-rw-r--r--configmgr/source/inc/treefragment.hxx138
-rw-r--r--configmgr/source/inc/treemanager.hxx157
-rw-r--r--configmgr/source/inc/treenodefactory.hxx96
-rw-r--r--configmgr/source/inc/treesegment.hxx73
-rw-r--r--configmgr/source/inc/typeconverter.hxx80
-rw-r--r--configmgr/source/inc/updatehelper.hxx46
-rw-r--r--configmgr/source/inc/valuenode.hxx293
-rw-r--r--configmgr/source/inc/valueref.hxx132
-rw-r--r--configmgr/source/inc/valuetypeconverter.hxx155
-rw-r--r--configmgr/source/inc/wrapexception.hxx128
-rw-r--r--configmgr/source/localbe/localdataimportsvc.cxx357
-rw-r--r--configmgr/source/localbe/localdataimportsvc.hxx98
-rw-r--r--configmgr/source/localbe/localfilehelper.cxx242
-rw-r--r--configmgr/source/localbe/localfilehelper.hxx124
-rw-r--r--configmgr/source/localbe/localfilelayer.cxx608
-rw-r--r--configmgr/source/localbe/localfilelayer.hxx492
-rw-r--r--configmgr/source/localbe/localhierarchybrowsersvc.cxx533
-rw-r--r--configmgr/source/localbe/localhierarchybrowsersvc.hxx100
-rw-r--r--configmgr/source/localbe/localmultistratum.cxx247
-rw-r--r--configmgr/source/localbe/localmultistratum.hxx97
-rw-r--r--configmgr/source/localbe/localoutputstream.cxx196
-rw-r--r--configmgr/source/localbe/localoutputstream.hxx103
-rw-r--r--configmgr/source/localbe/localschemasupplier.cxx288
-rw-r--r--configmgr/source/localbe/localschemasupplier.hxx115
-rw-r--r--configmgr/source/localbe/localsinglebackend.cxx798
-rw-r--r--configmgr/source/localbe/localsinglebackend.hxx245
-rw-r--r--configmgr/source/localbe/localsinglestratum.cxx230
-rw-r--r--configmgr/source/localbe/localsinglestratum.hxx147
-rw-r--r--configmgr/source/localbe/localstratumbase.cxx253
-rw-r--r--configmgr/source/localbe/localstratumbase.hxx199
-rw-r--r--configmgr/source/localbe/makefile.mk57
-rw-r--r--configmgr/source/localizedpropertynode.cxx87
-rw-r--r--configmgr/source/localizedpropertynode.hxx76
-rw-r--r--configmgr/source/localizedvaluenode.cxx78
-rw-r--r--configmgr/source/localizedvaluenode.hxx66
-rw-r--r--configmgr/source/lock.cxx39
-rw-r--r--configmgr/source/lock.hxx41
-rw-r--r--configmgr/source/makefile.mk83
-rw-r--r--configmgr/source/misc/anypair.cxx688
-rw-r--r--configmgr/source/misc/bootstrap.cxx701
-rw-r--r--configmgr/source/misc/bootstrapcontext.cxx414
-rw-r--r--configmgr/source/misc/bufferedfile.cxx130
-rw-r--r--configmgr/source/misc/configinteractionhandler.cxx112
-rw-r--r--configmgr/source/misc/configunoreg.cxx386
-rw-r--r--configmgr/source/misc/filehelper.cxx387
-rw-r--r--configmgr/source/misc/interactionrequest.cxx115
-rw-r--r--configmgr/source/misc/logger.cxx93
-rw-r--r--configmgr/source/misc/makefile.mk73
-rw-r--r--configmgr/source/misc/mergechange.cxx828
-rw-r--r--configmgr/source/misc/oslstream.cxx261
-rw-r--r--configmgr/source/misc/propertysethelper.cxx131
-rw-r--r--configmgr/source/misc/providerfactory.cxx241
-rw-r--r--configmgr/source/misc/providerfactory.hxx88
-rw-r--r--configmgr/source/misc/providerwrapper.cxx193
-rw-r--r--configmgr/source/misc/providerwrapper.hxx98
-rw-r--r--configmgr/source/misc/requestoptions.cxx104
-rw-r--r--configmgr/source/misc/serviceinfohelper.cxx189
-rw-r--r--configmgr/source/misc/simpleinteractionrequest.cxx97
-rw-r--r--configmgr/source/misc/strimpl.cxx60
-rw-r--r--configmgr/source/misc/tracer.cxx471
-rw-r--r--configmgr/source/modifications.cxx66
-rw-r--r--configmgr/source/modifications.hxx65
-rw-r--r--configmgr/source/node.cxx108
-rw-r--r--configmgr/source/node.hxx86
-rw-r--r--configmgr/source/nodemap.cxx50
-rw-r--r--configmgr/source/nodemap.hxx49
-rw-r--r--configmgr/source/pad.cxx91
-rw-r--r--configmgr/source/pad.hxx61
-rw-r--r--configmgr/source/parsemanager.cxx85
-rw-r--r--configmgr/source/parsemanager.hxx69
-rw-r--r--configmgr/source/parser.hxx62
-rw-r--r--configmgr/source/path.hxx43
-rw-r--r--configmgr/source/platformbe/componentdefn.cxx90
-rw-r--r--configmgr/source/platformbe/exports.dxp3
-rw-r--r--configmgr/source/platformbe/makefile.mk72
-rw-r--r--configmgr/source/platformbe/sysmgr1.uno.xml49
-rw-r--r--configmgr/source/platformbe/systemintegrationmanager.cxx366
-rw-r--r--configmgr/source/platformbe/systemintegrationmanager.hxx161
-rw-r--r--configmgr/source/propertynode.cxx110
-rw-r--r--configmgr/source/propertynode.hxx83
-rw-r--r--configmgr/source/registry/cfgregistrykey.cxx1479
-rw-r--r--configmgr/source/registry/cfgregistrykey.hxx244
-rw-r--r--configmgr/source/registry/configregistry.cxx376
-rw-r--r--configmgr/source/registry/configregistry.hxx118
-rw-r--r--configmgr/source/registry/makefile.mk48
-rw-r--r--configmgr/source/rootaccess.cxx319
-rw-r--r--configmgr/source/rootaccess.hxx155
-rw-r--r--configmgr/source/services.cxx118
-rw-r--r--configmgr/source/setnode.cxx126
-rw-r--r--configmgr/source/setnode.hxx84
-rw-r--r--configmgr/source/span.hxx64
-rw-r--r--configmgr/source/tree/builddata.cxx1134
-rw-r--r--configmgr/source/tree/changes.cxx244
-rw-r--r--configmgr/source/tree/cmtree.cxx378
-rw-r--r--configmgr/source/tree/cmtreemodel.cxx371
-rw-r--r--configmgr/source/tree/localizedtreeactions.cxx543
-rw-r--r--configmgr/source/tree/makefile.mk66
-rw-r--r--configmgr/source/tree/mergehelper.cxx456
-rw-r--r--configmgr/source/tree/node.cxx535
-rw-r--r--configmgr/source/tree/nodeconverter.cxx210
-rw-r--r--configmgr/source/tree/nodevisitor.cxx104
-rw-r--r--configmgr/source/tree/subtree.hxx110
-rw-r--r--configmgr/source/tree/treeactions.cxx64
-rw-r--r--configmgr/source/tree/treechangefactory.cxx123
-rw-r--r--configmgr/source/tree/treefragment.cxx130
-rw-r--r--configmgr/source/tree/treenodefactory.cxx110
-rw-r--r--configmgr/source/tree/treesegment.cxx88
-rw-r--r--configmgr/source/tree/updatehelper.cxx622
-rw-r--r--configmgr/source/treecache/cacheaccess.cxx352
-rw-r--r--configmgr/source/treecache/cacheaccess.hxx157
-rw-r--r--configmgr/source/treecache/cachecontroller.cxx716
-rw-r--r--configmgr/source/treecache/cachecontroller.hxx338
-rw-r--r--configmgr/source/treecache/cachedata.cxx495
-rw-r--r--configmgr/source/treecache/cachedata.hxx176
-rw-r--r--configmgr/source/treecache/cachefactory.cxx75
-rw-r--r--configmgr/source/treecache/cacheline.cxx353
-rw-r--r--configmgr/source/treecache/cacheline.hxx137
-rw-r--r--configmgr/source/treecache/cachemulticaster.cxx144
-rw-r--r--configmgr/source/treecache/cachemulticaster.hxx88
-rw-r--r--configmgr/source/treecache/cachewritescheduler.cxx213
-rw-r--r--configmgr/source/treecache/cachewritescheduler.hxx125
-rw-r--r--configmgr/source/treecache/disposetimer.cxx302
-rw-r--r--configmgr/source/treecache/disposetimer.hxx169
-rw-r--r--configmgr/source/treecache/invalidatetree.cxx173
-rw-r--r--configmgr/source/treecache/makefile.mk58
-rw-r--r--configmgr/source/treecache/timestamp.cxx60
-rw-r--r--configmgr/source/treecache/timestamp.hxx125
-rw-r--r--configmgr/source/treecache/treemanager.cxx512
-rw-r--r--configmgr/source/treemgr/collectchanges.cxx241
-rw-r--r--configmgr/source/treemgr/collectchanges.hxx121
-rw-r--r--configmgr/source/treemgr/configdefaultprovider.cxx150
-rw-r--r--configmgr/source/treemgr/configexcept.cxx181
-rw-r--r--configmgr/source/treemgr/configgroup.cxx404
-rw-r--r--configmgr/source/treemgr/configpath.cxx998
-rw-r--r--configmgr/source/treemgr/configset.cxx574
-rw-r--r--configmgr/source/treemgr/defaultproviderproxy.cxx91
-rw-r--r--configmgr/source/treemgr/defaultproviderproxy.hxx86
-rw-r--r--configmgr/source/treemgr/deferredview.cxx443
-rw-r--r--configmgr/source/treemgr/deferredview.hxx97
-rw-r--r--configmgr/source/treemgr/directview.cxx127
-rw-r--r--configmgr/source/treemgr/directview.hxx75
-rw-r--r--configmgr/source/treemgr/groupnodeimpl.hxx88
-rw-r--r--configmgr/source/treemgr/makefile.mk74
-rw-r--r--configmgr/source/treemgr/nodechange.cxx273
-rw-r--r--configmgr/source/treemgr/nodechangeimpl.cxx785
-rw-r--r--configmgr/source/treemgr/nodechangeimpl.hxx429
-rw-r--r--configmgr/source/treemgr/nodechangeinfo.cxx221
-rw-r--r--configmgr/source/treemgr/nodefactory.cxx133
-rw-r--r--configmgr/source/treemgr/nodefactory.hxx64
-rw-r--r--configmgr/source/treemgr/nodeimpl.cxx137
-rw-r--r--configmgr/source/treemgr/nodeimpl.hxx89
-rw-r--r--configmgr/source/treemgr/nodeimplobj.cxx1162
-rw-r--r--configmgr/source/treemgr/nodeimplobj.hxx198
-rw-r--r--configmgr/source/treemgr/noderef.cxx917
-rw-r--r--configmgr/source/treemgr/readonlyview.cxx105
-rw-r--r--configmgr/source/treemgr/readonlyview.hxx71
-rw-r--r--configmgr/source/treemgr/roottree.cxx171
-rw-r--r--configmgr/source/treemgr/roottreeimpl.hxx67
-rw-r--r--configmgr/source/treemgr/setnodeimpl.cxx994
-rw-r--r--configmgr/source/treemgr/setnodeimpl.hxx306
-rw-r--r--configmgr/source/treemgr/template.cxx124
-rw-r--r--configmgr/source/treemgr/templateimpl.cxx361
-rw-r--r--configmgr/source/treemgr/templateimpl.hxx172
-rw-r--r--configmgr/source/treemgr/treeimpl.cxx1370
-rw-r--r--configmgr/source/treemgr/valuemembernode.cxx333
-rw-r--r--configmgr/source/treemgr/valuemembernode.hxx114
-rw-r--r--configmgr/source/treemgr/valuenodeimpl.hxx69
-rw-r--r--configmgr/source/treemgr/viewaccess.hxx228
-rw-r--r--configmgr/source/treemgr/viewfactory.hxx53
-rw-r--r--configmgr/source/treemgr/viewnode.cxx105
-rw-r--r--configmgr/source/treemgr/viewnode.hxx200
-rw-r--r--configmgr/source/treemgr/viewstrategy.cxx620
-rw-r--r--configmgr/source/treemgr/viewstrategy.hxx228
-rw-r--r--configmgr/source/type.cxx187
-rw-r--r--configmgr/source/type.hxx56
-rw-r--r--configmgr/source/update.cxx66
-rw-r--r--configmgr/source/valueparser.cxx476
-rw-r--r--configmgr/source/valueparser.hxx94
-rw-r--r--configmgr/source/writemodfile.cxx631
-rw-r--r--configmgr/source/writemodfile.hxx45
-rw-r--r--configmgr/source/xcdparser.cxx183
-rw-r--r--configmgr/source/xcdparser.hxx78
-rw-r--r--configmgr/source/xcsparser.cxx598
-rw-r--r--configmgr/source/xcsparser.hxx106
-rw-r--r--configmgr/source/xcuparser.cxx1077
-rw-r--r--configmgr/source/xcuparser.hxx142
-rw-r--r--configmgr/source/xml/basicparser.cxx533
-rw-r--r--configmgr/source/xml/basicparser.hxx175
-rw-r--r--configmgr/source/xml/elementformatter.cxx321
-rw-r--r--configmgr/source/xml/elementformatter.hxx115
-rw-r--r--configmgr/source/xml/elementinfo.hxx116
-rw-r--r--configmgr/source/xml/elementparser.cxx582
-rw-r--r--configmgr/source/xml/elementparser.hxx122
-rw-r--r--configmgr/source/xml/layerparser.cxx368
-rw-r--r--configmgr/source/xml/layerparser.hxx116
-rw-r--r--configmgr/source/xml/layerwriter.cxx541
-rw-r--r--configmgr/source/xml/layerwriter.hxx166
-rw-r--r--configmgr/source/xml/makefile.mk66
-rw-r--r--configmgr/source/xml/matchlocale.cxx384
-rw-r--r--configmgr/source/xml/parsersvc.cxx382
-rw-r--r--configmgr/source/xml/parsersvc.hxx114
-rw-r--r--configmgr/source/xml/schemaparser.cxx406
-rw-r--r--configmgr/source/xml/schemaparser.hxx132
-rw-r--r--configmgr/source/xml/simpletypehelper.cxx54
-rw-r--r--configmgr/source/xml/typeconverter.cxx351
-rw-r--r--configmgr/source/xml/valueconverter.cxx501
-rw-r--r--configmgr/source/xml/valueformatter.cxx495
-rw-r--r--configmgr/source/xml/valueformatter.hxx81
-rw-r--r--configmgr/source/xml/writersvc.cxx258
-rw-r--r--configmgr/source/xml/writersvc.hxx121
-rw-r--r--configmgr/source/xml/xmlstrings.cxx137
-rw-r--r--configmgr/source/xml/xmlstrings.hxx131
-rw-r--r--configmgr/source/xmldata.cxx204
-rw-r--r--configmgr/source/xmldata.hxx58
-rw-r--r--configmgr/source/xmlreader.cxx1054
-rw-r--r--configmgr/source/xmlreader.hxx186
-rw-r--r--configmgr/util/cfgmgr.mxp.map4
-rw-r--r--configmgr/util/configmgr.map8
-rw-r--r--configmgr/util/configmgr2.uno.xml582
-rw-r--r--configmgr/util/configmgrl.map8
-rw-r--r--configmgr/util/exports.dxp3
-rw-r--r--configmgr/util/makefile.mk78
-rw-r--r--configmgr/workben/apitest/cfgadduser.cxx355
-rw-r--r--configmgr/workben/apitest/cfgadmin.cxx517
-rw-r--r--configmgr/workben/apitest/cfgapi.cxx865
-rw-r--r--configmgr/workben/apitest/cfgapi_timetest.cxx957
-rw-r--r--configmgr/workben/apitest/cfgregistry.cxx169
-rw-r--r--configmgr/workben/apitest/cfgupdate.cxx432
-rw-r--r--configmgr/workben/apitest/makefile.mk124
-rw-r--r--configmgr/workben/apitest/sregistry8
-rw-r--r--configmgr/workben/local_io/cfgfile.cxx94
-rw-r--r--configmgr/workben/local_io/cfglocal.cxx620
-rw-r--r--configmgr/workben/local_io/com.sun.star.office.Setup.xml29
-rw-r--r--configmgr/workben/local_io/filetest.cxx90
-rw-r--r--configmgr/workben/local_io/makefile.mk110
-rw-r--r--configmgr/workben/local_io/org.openoffice.test.xml70
-rw-r--r--configmgr/workben/local_io/simpletest.cxx758
-rw-r--r--configmgr/workben/local_io/xmlexport.cxx236
-rw-r--r--configmgr/workben/local_io/xmlimport.cxx469
-rw-r--r--configmgr/workben/logger/exports.dxp3
-rw-r--r--configmgr/workben/logger/loggerdfn.cxx151
-rw-r--r--configmgr/workben/logger/makefile.mk69
-rw-r--r--configmgr/workben/logger/simplelogger.cxx174
-rw-r--r--configmgr/workben/logger/simplelogger.hxx86
-rw-r--r--configmgr/workben/memory/logmechanism.hxx102
-rw-r--r--configmgr/workben/memory/main.cxx77
-rw-r--r--configmgr/workben/memory/makefile.mk255
-rw-r--r--configmgr/workben/memory/memorymeasure.hxx225
-rw-r--r--configmgr/workben/memory/memorytests.cxx1241
-rw-r--r--configmgr/workben/memory/testmodules.cxx84
-rw-r--r--configmgr/workben/memory/testmodules.hxx38
-rw-r--r--configmgr/workben/memory/treeload.cxx81
-rw-r--r--configmgr/workben/memory/treeload.hxx41
-rw-r--r--connectivity/com/sun/star/sdbcx/comp/hsqldb/makefile.mk7
-rw-r--r--connectivity/inc/connectivity/TTableHelper.hxx9
-rw-r--r--connectivity/inc/connectivity/dbtools.hxx27
-rw-r--r--connectivity/inc/connectivity/formattedcolumnvalue.hxx14
-rw-r--r--connectivity/prj/d.lst2
-rw-r--r--connectivity/source/commontools/TIndexes.cxx164
-rw-r--r--connectivity/source/commontools/TKeys.cxx154
-rw-r--r--connectivity/source/commontools/TTableHelper.cxx121
-rw-r--r--connectivity/source/commontools/dbtools.cxx4
-rw-r--r--connectivity/source/commontools/dbtools2.cxx32
-rw-r--r--connectivity/source/commontools/formattedcolumnvalue.cxx90
-rw-r--r--connectivity/source/cpool/dbpool.map8
-rw-r--r--connectivity/source/cpool/makefile.mk2
-rw-r--r--connectivity/source/dbtools/dbt.map8
-rw-r--r--connectivity/source/drivers/adabas/adabas.map8
-rw-r--r--connectivity/source/drivers/adabas/makefile.mk2
-rwxr-xr-xconnectivity/source/drivers/ado/ado.xcu5
-rw-r--r--connectivity/source/drivers/calc/calc.map8
-rw-r--r--connectivity/source/drivers/calc/makefile.mk2
-rw-r--r--connectivity/source/drivers/dbase/DTable.cxx1
-rw-r--r--connectivity/source/drivers/dbase/dbase.map10
-rw-r--r--connectivity/source/drivers/dbase/makefile.mk2
-rw-r--r--connectivity/source/drivers/evoab/evoab.map8
-rw-r--r--connectivity/source/drivers/evoab/makefile.mk2
-rw-r--r--connectivity/source/drivers/evoab2/evoab2.map8
-rw-r--r--connectivity/source/drivers/evoab2/makefile.mk2
-rw-r--r--connectivity/source/drivers/flat/flat.map8
-rw-r--r--connectivity/source/drivers/flat/makefile.mk2
-rw-r--r--connectivity/source/drivers/hsqldb/HTable.cxx2
-rw-r--r--connectivity/source/drivers/jdbc/JStatement.cxx68
-rw-r--r--connectivity/source/drivers/jdbc/jdbc.map8
-rw-r--r--connectivity/source/drivers/jdbc/makefile.mk2
-rw-r--r--connectivity/source/drivers/kab/kab.map8
-rw-r--r--connectivity/source/drivers/kab/kabdrv.map2
-rw-r--r--connectivity/source/drivers/kab/makefile.mk2
-rwxr-xr-xconnectivity/source/drivers/macab/MacabConnection.cxx3
-rwxr-xr-xconnectivity/source/drivers/macab/MacabServices.cxx6
-rwxr-xr-xconnectivity/source/drivers/macab/macab.map8
-rwxr-xr-xconnectivity/source/drivers/macab/macab.xcu2
-rwxr-xr-xconnectivity/source/drivers/macab/macabdrv.map6
-rwxr-xr-xconnectivity/source/drivers/macab/makefile.mk4
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx6
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx1
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/makefile.mk2
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/mozbootstrap.map8
-rw-r--r--connectivity/source/drivers/mozab/makefile.mk2
-rw-r--r--connectivity/source/drivers/mozab/mozab.map8
-rw-r--r--connectivity/source/drivers/mozab/mozabdrv.map2
-rw-r--r--connectivity/source/drivers/mysql/YTable.cxx4
-rw-r--r--connectivity/source/drivers/mysql/YTables.cxx19
-rw-r--r--connectivity/source/drivers/mysql/makefile.mk2
-rw-r--r--connectivity/source/drivers/mysql/mysql.map8
-rw-r--r--connectivity/source/drivers/odbc/makefile.mk2
-rw-r--r--connectivity/source/drivers/odbc/odbc.map8
-rw-r--r--connectivity/source/drivers/odbcbase/OResultSet.cxx28
-rw-r--r--connectivity/source/inc/mysql/YTables.hxx5
-rw-r--r--connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx2
-rw-r--r--connectivity/source/inc/odbc/OResultSet.hxx1
-rw-r--r--connectivity/source/manager/makefile.mk2
-rw-r--r--connectivity/source/manager/mdrivermanager.cxx2
-rw-r--r--connectivity/source/manager/sdbc.map8
-rw-r--r--connectivity/source/parse/sqlflex.l2
-rwxr-xr-xconnectivity/util/langfilter.xsl37
-rwxr-xr-xconnectivity/util/makefile.mk91
-rw-r--r--desktop/prj/build.lst2
-rw-r--r--desktop/prj/d.lst4
-rw-r--r--desktop/qa/deployment_misc/makefile.mk1
-rw-r--r--desktop/source/app/app.cxx36
-rw-r--r--desktop/source/app/appinit.cxx5
-rw-r--r--desktop/source/app/cmdlineargs.cxx97
-rw-r--r--desktop/source/app/cmdlineargs.hxx4
-rw-r--r--desktop/source/app/copyright_ascii_ooo.c8
-rw-r--r--desktop/source/app/copyright_ascii_sun.c14
-rw-r--r--desktop/source/app/desktop.src2
-rw-r--r--desktop/source/app/langselect.cxx137
-rw-r--r--desktop/source/app/langselect.hxx1
-rw-r--r--desktop/source/app/userinstall.cxx2
-rw-r--r--desktop/source/app/version.map2
-rw-r--r--desktop/source/deployment/deployment.map8
-rw-r--r--desktop/source/deployment/gui/dp_gui_dialog2.cxx3
-rw-r--r--desktop/source/deployment/gui/dp_gui_extlistbox.cxx8
-rw-r--r--desktop/source/deployment/gui/dp_gui_extlistbox.hxx5
-rw-r--r--desktop/source/deployment/gui/dp_gui_theextmgr.cxx18
-rw-r--r--desktop/source/deployment/gui/makefile.mk2
-rw-r--r--desktop/source/deployment/inc/dp_descriptioninfoset.hxx16
-rw-r--r--desktop/source/deployment/makefile.mk5
-rw-r--r--desktop/source/deployment/manager/dp_manager.cxx14
-rw-r--r--desktop/source/deployment/misc/dp_descriptioninfoset.cxx44
-rw-r--r--desktop/source/deployment/registry/component/dp_component.cxx174
-rw-r--r--desktop/source/deployment/registry/configuration/dp_configuration.cxx581
-rw-r--r--desktop/source/deployment/registry/dp_backend.cxx6
-rw-r--r--desktop/source/deployment/registry/inc/dp_backend.h14
-rw-r--r--desktop/source/deployment/registry/package/dp_package.cxx76
-rw-r--r--desktop/source/inc/exithelper.hxx4
-rw-r--r--desktop/source/migration/migration.cxx134
-rw-r--r--desktop/source/migration/migration_impl.hxx38
-rw-r--r--desktop/source/migration/pages.cxx63
-rw-r--r--desktop/source/migration/pages.hxx5
-rwxr-xr-x[-rw-r--r--]desktop/source/migration/services/cexportsoo3.cxx (renamed from configmgr/source/treemgr/viewaccess.cxx)49
-rw-r--r--desktop/source/migration/services/makefile.mk50
-rwxr-xr-x[-rw-r--r--]desktop/source/migration/services/migrationoo3.map (renamed from desktop/source/migration/services/migrationoo2.map)0
-rwxr-xr-xdesktop/source/migration/services/oo3extensionmigration.cxx656
-rwxr-xr-xdesktop/source/migration/services/oo3extensionmigration.hxx171
-rw-r--r--desktop/source/migration/wizard.cxx124
-rw-r--r--desktop/source/migration/wizard.hrc1
-rw-r--r--desktop/source/migration/wizard.hxx6
-rw-r--r--desktop/source/offacc/exports.map10
-rw-r--r--desktop/source/offacc/makefile.mk2
-rw-r--r--desktop/source/pagein/makefile.mk2
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_app.cxx11
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx34
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_shared.h3
-rw-r--r--desktop/source/pkgchk/unopkg/version.map2
-rw-r--r--desktop/source/so_comp/exports.map10
-rw-r--r--desktop/source/so_comp/makefile.mk2
-rw-r--r--desktop/source/splash/exports.map10
-rw-r--r--desktop/source/splash/makefile.mk2
-rw-r--r--desktop/source/splash/splash.cxx65
-rw-r--r--desktop/source/splash/splash.hxx5
-rwxr-xr-xdesktop/test/deployment/simple_license/suppress_license.oxtbin0 -> 2143 bytes
-rw-r--r--desktop/test/deployment/simple_license/tests_simple_license.odtbin15621 -> 16629 bytes
-rw-r--r--desktop/util/ooverinfo.rc67
-rw-r--r--desktop/util/ooverinfo2.rc61
-rw-r--r--desktop/util/verinfo.rc12
-rw-r--r--desktop/win32/source/applauncher/makefile.mk2
-rw-r--r--desktop/win32/source/applauncher/ooo/makefile.mk2
-rw-r--r--desktop/zipintro/makefile.mk35
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/fillattribute.hxx130
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/fillbitmapattribute.hxx42
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/fillgradientattribute.hxx121
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/fillhatchattribute.hxx112
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx81
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/lineattribute.hxx61
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/linestartendattribute.hxx47
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/materialattribute3d.hxx12
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/sdrallattribute3d.hxx66
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/sdrattribute.hxx215
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/sdrattribute3d.hxx209
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/sdrfillattribute.hxx99
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/sdrfillbitmapattribute.hxx61
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/sdrlightattribute3d.hxx96
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/sdrlightingattribute3d.hxx99
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/sdrlineattribute.hxx104
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/sdrlinestartendattribute.hxx102
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/sdrobjectattribute3d.hxx111
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/sdrsceneattribute3d.hxx94
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/sdrshadowattribute.hxx93
-rw-r--r--drawinglayer/inc/drawinglayer/attribute/strokeattribute.hxx54
-rw-r--r--drawinglayer/inc/drawinglayer/geometry/viewinformation2d.hxx6
-rw-r--r--drawinglayer/inc/drawinglayer/geometry/viewinformation3d.hxx6
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/alphaprimitive2d.hxx95
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx8
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx20
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx2
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx3
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/gridprimitive2d.hxx2
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/groupprimitive2d.hxx2
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx79
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/hittestprimitive2d.hxx78
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/markerarrayprimitive2d.hxx2
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/metafileprimitive2d.hxx2
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx2
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx6
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx4
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/sdrdecompositiontools2d.hxx85
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx21
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/transparenceprimitive2d.hxx103
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx80
-rw-r--r--drawinglayer/inc/drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx91
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx38
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/groupprimitive3d.hxx2
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx1
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/hiddengeometryprimitive3d.hxx81
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/hittestprimitive3d.hxx80
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx2
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrdecompositiontools3d.hxx11
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx2
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx2
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx2
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrprimitive3d.hxx8
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx2
-rw-r--r--drawinglayer/inc/drawinglayer/primitive3d/textureprimitive3d.hxx26
-rw-r--r--drawinglayer/inc/drawinglayer/processor2d/baseprocessor2d.hxx177
-rw-r--r--drawinglayer/inc/drawinglayer/processor2d/canvasprocessor.hxx13
-rw-r--r--drawinglayer/inc/drawinglayer/processor2d/contourextractor2d.hxx9
-rw-r--r--drawinglayer/inc/drawinglayer/processor2d/hittestprocessor2d.hxx37
-rw-r--r--drawinglayer/inc/drawinglayer/processor2d/linegeometryextractor2d.hxx9
-rw-r--r--drawinglayer/inc/drawinglayer/processor2d/textaspolygonextractor2d.hxx8
-rw-r--r--drawinglayer/inc/drawinglayer/processor2d/vclmetafileprocessor2d.hxx56
-rw-r--r--drawinglayer/inc/drawinglayer/processor2d/vclpixelprocessor2d.hxx23
-rw-r--r--drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx13
-rw-r--r--drawinglayer/inc/drawinglayer/processor3d/baseprocessor3d.hxx27
-rw-r--r--drawinglayer/inc/drawinglayer/processor3d/cutfindprocessor3d.hxx37
-rw-r--r--drawinglayer/inc/drawinglayer/processor3d/defaultprocessor3d.hxx52
-rw-r--r--drawinglayer/inc/drawinglayer/processor3d/geometry2dextractor.hxx19
-rw-r--r--drawinglayer/inc/drawinglayer/processor3d/shadow3dextractor.hxx35
-rw-r--r--drawinglayer/inc/drawinglayer/processor3d/zbufferprocessor3d.hxx41
-rw-r--r--drawinglayer/prj/d.lst22
-rw-r--r--drawinglayer/source/attribute/fillattribute.cxx94
-rw-r--r--drawinglayer/source/attribute/fillbitmapattribute.cxx153
-rw-r--r--drawinglayer/source/attribute/fillgradientattribute.cxx250
-rw-r--r--drawinglayer/source/attribute/fillhatchattribute.cxx219
-rw-r--r--drawinglayer/source/attribute/fontattribute.cxx220
-rw-r--r--drawinglayer/source/attribute/lineattribute.cxx142
-rw-r--r--drawinglayer/source/attribute/linestartendattribute.cxx148
-rw-r--r--drawinglayer/source/attribute/makefile.mk27
-rw-r--r--drawinglayer/source/attribute/materialattribute3d.cxx93
-rw-r--r--drawinglayer/source/attribute/sdrallattribute3d.cxx169
-rw-r--r--drawinglayer/source/attribute/sdrattribute.cxx285
-rw-r--r--drawinglayer/source/attribute/sdrattribute3d.cxx211
-rw-r--r--drawinglayer/source/attribute/sdrfillattribute.cxx221
-rw-r--r--drawinglayer/source/attribute/sdrfillbitmapattribute.cxx259
-rw-r--r--drawinglayer/source/attribute/sdrlightattribute3d.cxx196
-rw-r--r--drawinglayer/source/attribute/sdrlightingattribute3d.cxx235
-rw-r--r--drawinglayer/source/attribute/sdrlineattribute.cxx250
-rw-r--r--drawinglayer/source/attribute/sdrlinestartendattribute.cxx254
-rw-r--r--drawinglayer/source/attribute/sdrobjectattribute3d.cxx292
-rw-r--r--drawinglayer/source/attribute/sdrsceneattribute3d.cxx218
-rw-r--r--drawinglayer/source/attribute/sdrshadowattribute.cxx193
-rw-r--r--drawinglayer/source/attribute/strokeattribute.cxx139
-rw-r--r--drawinglayer/source/geometry/viewinformation2d.cxx47
-rw-r--r--drawinglayer/source/geometry/viewinformation3d.cxx47
-rw-r--r--drawinglayer/source/primitive2d/fillbitmapprimitive2d.cxx78
-rw-r--r--drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx46
-rw-r--r--drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx109
-rw-r--r--drawinglayer/source/primitive2d/graphicprimitive2d.cxx6
-rw-r--r--drawinglayer/source/primitive2d/hiddengeometryprimitive2d.cxx75
-rw-r--r--drawinglayer/source/primitive2d/hittestprimitive2d.cxx68
-rw-r--r--drawinglayer/source/primitive2d/makefile.mk89
-rw-r--r--drawinglayer/source/primitive2d/mediaprimitive2d.cxx17
-rw-r--r--drawinglayer/source/primitive2d/metafileprimitive2d.cxx207
-rw-r--r--drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx5
-rw-r--r--drawinglayer/source/primitive2d/polygonprimitive2d.cxx31
-rw-r--r--drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx105
-rw-r--r--drawinglayer/source/primitive2d/sceneprimitive2d.cxx14
-rw-r--r--drawinglayer/source/primitive2d/sdrdecompositiontools2d.cxx130
-rw-r--r--drawinglayer/source/primitive2d/shadowprimitive2d.cxx4
-rw-r--r--drawinglayer/source/primitive2d/textlayoutdevice.cxx69
-rw-r--r--drawinglayer/source/primitive2d/transparenceprimitive2d.cxx78
-rw-r--r--drawinglayer/source/primitive2d/unifiedalphaprimitive2d.cxx121
-rw-r--r--drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx136
-rw-r--r--drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx3
-rw-r--r--drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx6
-rw-r--r--drawinglayer/source/primitive3d/hiddengeometryprimitive3d.cxx76
-rw-r--r--drawinglayer/source/primitive3d/makefile.mk2
-rw-r--r--drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx4
-rw-r--r--drawinglayer/source/primitive3d/sdrcubeprimitive3d.cxx37
-rw-r--r--drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx88
-rw-r--r--drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx45
-rw-r--r--drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx47
-rw-r--r--drawinglayer/source/primitive3d/sdrpolypolygonprimitive3d.cxx44
-rw-r--r--drawinglayer/source/primitive3d/sdrprimitive3d.cxx16
-rw-r--r--drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx38
-rw-r--r--drawinglayer/source/primitive3d/textureprimitive3d.cxx28
-rw-r--r--drawinglayer/source/processor2d/canvasprocessor.cxx141
-rw-r--r--drawinglayer/source/processor2d/contourextractor2d.cxx10
-rw-r--r--drawinglayer/source/processor2d/hittestprocessor2d.cxx73
-rw-r--r--drawinglayer/source/processor2d/vclhelperbufferdevice.cxx4
-rw-r--r--drawinglayer/source/processor2d/vclhelperbufferdevice.hxx2
-rw-r--r--drawinglayer/source/processor2d/vclhelpergradient.cxx16
-rw-r--r--drawinglayer/source/processor2d/vclhelpergradient.hxx3
-rw-r--r--drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx262
-rw-r--r--drawinglayer/source/processor2d/vclpixelprocessor2d.cxx76
-rw-r--r--drawinglayer/source/processor2d/vclprocessor2d.cxx201
-rw-r--r--drawinglayer/source/processor3d/cutfindprocessor3d.cxx50
-rw-r--r--drawinglayer/source/processor3d/defaultprocessor3d.cxx64
-rw-r--r--drawinglayer/source/processor3d/geometry2dextractor.cxx4
-rw-r--r--drawinglayer/source/processor3d/shadow3dextractor.cxx4
-rw-r--r--drawinglayer/source/processor3d/zbufferprocessor3d.cxx335
-rw-r--r--drawinglayer/source/texture/texture.cxx130
-rw-r--r--drawinglayer/source/texture/texture3d.cxx3
-rw-r--r--editeng/inc/editeng/AccessibleEditableTextPara.hxx11
-rw-r--r--editeng/inc/editeng/unoedprx.hxx9
-rw-r--r--editeng/inc/editeng/unoedsrc.hxx5
-rw-r--r--editeng/inc/editeng/unofored.hxx3
-rw-r--r--editeng/inc/editeng/unoforou.hxx2
-rw-r--r--editeng/inc/editeng/unotext.hxx4
-rw-r--r--editeng/source/accessibility/AccessibleEditableTextPara.cxx98
-rw-r--r--editeng/source/accessibility/AccessibleHyperlink.cxx146
-rw-r--r--editeng/source/accessibility/AccessibleHyperlink.hxx82
-rw-r--r--[-rwxr-xr-x]editeng/source/accessibility/makefile.mk1
-rw-r--r--editeng/source/editeng/editdbg.cxx2
-rw-r--r--editeng/source/uno/unoedprx.cxx27
-rw-r--r--editeng/source/uno/unofored.cxx5
-rw-r--r--editeng/source/uno/unoforou.cxx5
-rw-r--r--editeng/source/uno/unotext.cxx4
-rw-r--r--embeddedobj/source/commonembedding/embedobj.cxx2
-rw-r--r--embeddedobj/source/commonembedding/miscobj.cxx5
-rw-r--r--embeddedobj/source/commonembedding/persistence.cxx235
-rw-r--r--embeddedobj/source/inc/commonembobj.hxx31
-rw-r--r--eventattacher/source/exports.map10
-rw-r--r--eventattacher/source/makefile.mk2
-rw-r--r--fileaccess/source/exports.map10
-rw-r--r--fileaccess/source/makefile.mk2
-rw-r--r--formula/inc/formula/errorcodes.hxx10
-rw-r--r--formula/source/ui/dlg/formula.cxx1
-rw-r--r--formula/util/for.map8
-rw-r--r--formula/util/forui.map8
-rw-r--r--formula/util/makefile.mk1
-rw-r--r--fpicker/source/aqua/FilterHelper.cxx28
-rw-r--r--fpicker/source/aqua/exports.map8
-rw-r--r--fpicker/source/aqua/makefile.mk2
-rw-r--r--fpicker/source/generic/exports.map8
-rw-r--r--fpicker/source/generic/makefile.mk2
-rw-r--r--fpicker/source/office/OfficeFilePicker.cxx5
-rw-r--r--fpicker/source/office/exports.map8
-rw-r--r--fpicker/source/office/makefile.mk2
-rw-r--r--fpicker/source/unx/gnome/exports.map8
-rw-r--r--fpicker/source/unx/gnome/makefile.mk2
-rw-r--r--fpicker/source/unx/kde4/KDE4FilePicker.cxx10
-rw-r--r--fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx40
-rw-r--r--fpicker/source/win32/filepicker/makefile.mk1
-rw-r--r--framework/inc/classes/checkediterator.hxx2
-rw-r--r--framework/inc/framework.hrc9
-rw-r--r--framework/inc/interaction/preventduplicateinteraction.hxx28
-rw-r--r--framework/inc/jobs/jobdata.hxx2
-rw-r--r--framework/inc/services/autorecovery.hxx25
-rw-r--r--framework/prj/build.lst2
-rw-r--r--framework/qa/unoapi/Test.java51
-rwxr-xr-xframework/qa/unoapi/makefile.mk33
-rw-r--r--framework/source/classes/addonmenu.cxx3
-rw-r--r--framework/source/classes/resource.src2
-rw-r--r--framework/source/inc/loadenv/loaddispatchlistener.hxx165
-rw-r--r--framework/source/inc/loadenv/loadenv.hxx11
-rw-r--r--framework/source/inc/loadenv/loadenvexception.hxx8
-rw-r--r--framework/source/interaction/preventduplicateinteraction.cxx73
-rw-r--r--framework/source/interaction/quietinteraction.cxx16
-rw-r--r--framework/source/jobs/jobdata.cxx8
-rw-r--r--framework/source/jobs/jobresult.cxx4
-rw-r--r--framework/source/loadenv/loaddispatchlistener.cxx141
-rw-r--r--framework/source/loadenv/loadenv.cxx70
-rw-r--r--framework/source/loadenv/makefile.mk1
-rw-r--r--framework/source/services/autorecovery.cxx416
-rw-r--r--framework/source/services/backingwindow.cxx409
-rw-r--r--framework/source/services/backingwindow.hxx31
-rw-r--r--framework/source/services/frame.cxx16
-rw-r--r--framework/source/services/fwk_services.src56
-rw-r--r--framework/util/exports.map10
-rw-r--r--framework/util/makefile.mk7
-rw-r--r--idl/util/svidl.hdb25
-rw-r--r--linguistic/prj/build.lst1
-rw-r--r--linguistic/qa/unoapi/Test.java51
-rw-r--r--linguistic/qa/unoapi/makefile.mk30
-rw-r--r--linguistic/source/convdiclist.cxx37
-rw-r--r--linguistic/source/lngsvcmgr.cxx11
-rw-r--r--linguistic/source/staticmb.cxx29
-rw-r--r--linguistic/workben/lex.map8
-rw-r--r--linguistic/workben/makefile.mk2
-rw-r--r--officecfg/prj/build.lst1
-rw-r--r--officecfg/prj/d.lst6
-rw-r--r--officecfg/registry/component-schema.dtd151
-rw-r--r--officecfg/registry/component-schema.xsd224
-rw-r--r--officecfg/registry/component-types.xsd135
-rw-r--r--officecfg/registry/component-update.dtd144
-rw-r--r--officecfg/registry/component-update.xsd113
-rw-r--r--officecfg/registry/data.dtd40
-rw-r--r--officecfg/registry/data/org/openoffice/Inet.xcu64
-rw-r--r--officecfg/registry/data/org/openoffice/Interaction.xcu56
-rw-r--r--officecfg/registry/data/org/openoffice/LDAP.xcu.sample70
-rwxr-xr-x[-rw-r--r--]officecfg/registry/data/org/openoffice/Office/Accelerators.xcu85
-rw-r--r--officecfg/registry/data/org/openoffice/Office/Common.xcu128
-rw-r--r--officecfg/registry/data/org/openoffice/Office/Labels.xcu4631
-rw-r--r--officecfg/registry/data/org/openoffice/Office/Paths.xcu9
-rw-r--r--officecfg/registry/data/org/openoffice/Office/Recovery.xcu42
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/BasicIDEWindowState.xcu2
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/ChartCommands.xcu25
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/ChartWindowState.xcu14
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu74
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu3
-rw-r--r--officecfg/registry/data/org/openoffice/Office/makefile.mk7
-rwxr-xr-x[-rw-r--r--]officecfg/registry/data/org/openoffice/Setup.xcu359
-rw-r--r--officecfg/registry/data/org/openoffice/System.xcu45
-rw-r--r--officecfg/registry/data/org/openoffice/UserProfile.xcu7
-rw-r--r--officecfg/registry/data/org/openoffice/VCL.xcu9
-rwxr-xr-x[-rw-r--r--]officecfg/registry/data/org/openoffice/makefile.mk22
-rw-r--r--officecfg/registry/schema/oo-ad-ldap-attr.map50
-rw-r--r--officecfg/registry/schema/oo-ad-ldap.xcd.sample153
-rw-r--r--officecfg/registry/schema/oo-ldap-attr.map50
-rw-r--r--officecfg/registry/schema/oo-ldap.xcd.sample156
-rw-r--r--officecfg/registry/schema/org/openoffice/Interaction.xcs86
-rw-r--r--officecfg/registry/schema/org/openoffice/LDAP.xcs2
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Calc.xcs91
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Chart.xcs3
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Common.xcs17
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Recovery.xcs39
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Writer.xcs8
-rw-r--r--officecfg/registry/schema/org/openoffice/Setup.xcs158
-rw-r--r--officecfg/registry/schema/org/openoffice/makefile.mk3
-rw-r--r--officecfg/registry/schema/org/openoffice/ucb/InteractionHandler.xcs59
-rw-r--r--officecfg/util/alllang.xsl3
-rw-r--r--officecfg/util/data_val.xsl3
-rw-r--r--officecfg/util/makefile.mk2
-rw-r--r--readlicense_oo/source/license/license_en-US.html6
-rw-r--r--readlicense_oo/source/license/license_en-US.rtf645
-rw-r--r--readlicense_oo/source/license/license_en-US.txt4
-rwxr-xr-xreadlicense_oo/util/makefile.pmk4
-rw-r--r--scripting/source/basprov/basprov.map9
-rw-r--r--scripting/source/basprov/makefile.mk2
-rw-r--r--scripting/source/dlgprov/dlgprov.map9
-rw-r--r--scripting/source/dlgprov/makefile.mk2
-rw-r--r--scripting/source/pyprov/pythonscript.py51
-rw-r--r--scripting/source/stringresource/makefile.mk2
-rw-r--r--scripting/source/stringresource/stringresource.map9
-rw-r--r--[-rwxr-xr-x]scripting/source/vbaevents/makefile.mk2
-rwxr-xr-xscripting/source/vbaevents/vbaevents.map9
-rw-r--r--sfx2/inc/about.hxx10
-rw-r--r--sfx2/inc/frmload.hxx150
-rw-r--r--sfx2/inc/inettbc.hxx13
-rw-r--r--sfx2/inc/pch/precompiled_sfx2.hxx1
-rw-r--r--sfx2/inc/sfx2/app.hxx4
-rw-r--r--sfx2/inc/sfx2/bindings.hxx3
-rw-r--r--sfx2/inc/sfx2/docfac.hxx5
-rw-r--r--sfx2/inc/sfx2/docfile.hxx15
-rw-r--r--sfx2/inc/sfx2/frame.hxx150
-rw-r--r--sfx2/inc/sfx2/linkmgr.hxx2
-rw-r--r--sfx2/inc/sfx2/objsh.hxx35
-rw-r--r--sfx2/inc/sfx2/sfx.hrc1
-rw-r--r--sfx2/inc/sfx2/sfxbasecontroller.hxx170
-rw-r--r--sfx2/inc/sfx2/sfxbasemodel.hxx72
-rw-r--r--sfx2/inc/sfx2/sfxmodelfactory.hxx2
-rw-r--r--sfx2/inc/sfx2/sfxsids.hrc215
-rw-r--r--sfx2/inc/sfx2/shell.hxx1
-rw-r--r--sfx2/inc/sfx2/topfrm.hxx122
-rw-r--r--sfx2/inc/sfx2/viewfrm.hxx142
-rw-r--r--sfx2/inc/sfx2/viewsh.hxx35
-rw-r--r--sfx2/inc/viewfac.hxx3
-rw-r--r--sfx2/prj/build.lst1
-rw-r--r--sfx2/qa/complex/DocumentMetaData.java10
-rw-r--r--sfx2/qa/complex/docinfo/makefile.mk2
-rw-r--r--sfx2/qa/unoapi/Test.java51
-rw-r--r--sfx2/qa/unoapi/makefile.mk30
-rw-r--r--sfx2/sdi/frmslots.sdi30
-rw-r--r--sfx2/sdi/makefile.mk1
-rw-r--r--sfx2/sdi/mdislots.sdi44
-rw-r--r--sfx2/sdi/sfx.sdi639
-rw-r--r--sfx2/sdi/sfxitems.sdi1
-rw-r--r--sfx2/sdi/sfxslots.sdi1
-rw-r--r--sfx2/source/appl/app.cxx21
-rw-r--r--sfx2/source/appl/app.src5
-rw-r--r--sfx2/source/appl/appbas.cxx12
-rw-r--r--sfx2/source/appl/appcfg.cxx15
-rw-r--r--sfx2/source/appl/appchild.cxx4
-rw-r--r--sfx2/source/appl/appdata.cxx2
-rw-r--r--sfx2/source/appl/appdde.cxx9
-rw-r--r--sfx2/source/appl/appmisc.cxx9
-rw-r--r--sfx2/source/appl/appopen.cxx268
-rw-r--r--sfx2/source/appl/appquit.cxx3
-rw-r--r--sfx2/source/appl/appreg.cxx4
-rw-r--r--sfx2/source/appl/appserv.cxx135
-rw-r--r--sfx2/source/appl/appuno.cxx334
-rw-r--r--sfx2/source/appl/fileobj.cxx10
-rw-r--r--sfx2/source/appl/fileobj.hxx1
-rw-r--r--sfx2/source/appl/linkmgr2.cxx10
-rw-r--r--sfx2/source/appl/sfxhelp.cxx18
-rw-r--r--sfx2/source/appl/sfxpicklist.cxx2
-rw-r--r--sfx2/source/appl/shutdownicon.cxx23
-rw-r--r--sfx2/source/appl/shutdownicon.hxx1
-rw-r--r--sfx2/source/appl/shutdowniconw32.cxx50
-rw-r--r--sfx2/source/appl/workwin.cxx6
-rw-r--r--sfx2/source/bastyp/fltfnc.cxx2
-rw-r--r--sfx2/source/bastyp/helper.cxx14
-rw-r--r--sfx2/source/bastyp/progress.cxx35
-rw-r--r--sfx2/source/control/bindings.cxx20
-rw-r--r--[-rwxr-xr-x]sfx2/source/control/dispatch.cxx112
-rw-r--r--sfx2/source/control/request.cxx2
-rw-r--r--sfx2/source/control/statcach.cxx2
-rw-r--r--sfx2/source/control/unoctitm.cxx12
-rw-r--r--sfx2/source/dialog/about.cxx84
-rw-r--r--sfx2/source/dialog/basedlgs.cxx4
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx21
-rw-r--r--sfx2/source/dialog/dinfdlg.hrc4
-rw-r--r--sfx2/source/dialog/dinfdlg.src8
-rw-r--r--sfx2/source/dialog/dockwin.cxx4
-rw-r--r--sfx2/source/dialog/mailmodelapi.cxx16
-rw-r--r--sfx2/source/dialog/partwnd.cxx2
-rw-r--r--sfx2/source/dialog/tabdlg.cxx2
-rw-r--r--sfx2/source/doc/SfxDocumentMetaData.cxx17
-rw-r--r--sfx2/source/doc/commitlistener.cxx81
-rw-r--r--sfx2/source/doc/commitlistener.hxx57
-rw-r--r--sfx2/source/doc/docfac.cxx38
-rw-r--r--sfx2/source/doc/docfile.cxx120
-rw-r--r--sfx2/source/doc/makefile.mk1
-rw-r--r--sfx2/source/doc/objcont.cxx275
-rw-r--r--sfx2/source/doc/objembed.cxx2
-rw-r--r--sfx2/source/doc/objmisc.cxx45
-rw-r--r--sfx2/source/doc/objserv.cxx65
-rw-r--r--sfx2/source/doc/objstor.cxx49
-rw-r--r--sfx2/source/doc/objxtor.cxx266
-rw-r--r--sfx2/source/doc/opostponedtruncationstream.cxx491
-rw-r--r--sfx2/source/doc/opostponedtruncationstream.hxx122
-rwxr-xr-xsfx2/source/doc/printhelper.cxx26
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx1066
-rw-r--r--sfx2/source/doc/sfxmodelfactory.cxx9
-rw-r--r--sfx2/source/inc/appdata.hxx2
-rw-r--r--sfx2/source/inc/objshimp.hxx31
-rw-r--r--sfx2/source/inet/inettbc.cxx100
-rw-r--r--sfx2/source/menu/mnuitem.cxx2
-rw-r--r--sfx2/source/menu/virtmenu.cxx10
-rw-r--r--sfx2/source/notify/eventsupplier.cxx2
-rw-r--r--sfx2/source/view/frame.cxx684
-rw-r--r--sfx2/source/view/frame2.cxx484
-rw-r--r--sfx2/source/view/frmload.cxx998
-rw-r--r--sfx2/source/view/impframe.cxx55
-rw-r--r--sfx2/source/view/impframe.hxx67
-rw-r--r--sfx2/source/view/impviewframe.hxx94
-rw-r--r--sfx2/source/view/ipclient.cxx20
-rw-r--r--sfx2/source/view/makefile.mk6
-rw-r--r--sfx2/source/view/prnmon.cxx2
-rw-r--r--sfx2/source/view/sfxbasecontroller.cxx456
-rw-r--r--sfx2/source/view/topfrm.cxx1643
-rw-r--r--sfx2/source/view/view.hxx27
-rw-r--r--sfx2/source/view/viewfac.cxx12
-rw-r--r--sfx2/source/view/viewfrm.cxx1411
-rw-r--r--sfx2/source/view/viewfrm2.cxx523
-rw-r--r--sfx2/source/view/viewimp.hxx30
-rw-r--r--sfx2/source/view/viewprn.cxx10
-rw-r--r--sfx2/source/view/viewsh.cxx91
-rw-r--r--sfx2/util/hidother.src30
-rwxr-xr-xshell/qa/makefile.mk2
-rw-r--r--shell/source/backends/desktopbe/desktopbackend.cxx290
-rw-r--r--shell/source/backends/desktopbe/desktopbe.xml37
-rw-r--r--shell/source/backends/desktopbe/desktopbe1-ucd.txt3
-rw-r--r--shell/source/backends/desktopbe/desktopbecdef.cxx202
-rw-r--r--shell/source/backends/desktopbe/exports.map10
-rw-r--r--shell/source/backends/desktopbe/makefile.mk58
-rw-r--r--shell/source/backends/gconfbe/exports.map10
-rw-r--r--shell/source/backends/gconfbe/gconfaccess.cxx (renamed from shell/source/backends/gconfbe/gconflayer.cxx)590
-rw-r--r--shell/source/backends/gconfbe/gconfaccess.hxx119
-rw-r--r--shell/source/backends/gconfbe/gconfbackend.cxx1180
-rw-r--r--shell/source/backends/gconfbe/gconfbackend.hxx223
-rw-r--r--shell/source/backends/gconfbe/gconfbe.xml35
-rw-r--r--shell/source/backends/gconfbe/gconfbecdef.cxx148
-rw-r--r--shell/source/backends/gconfbe/gconflayer.hxx133
-rw-r--r--shell/source/backends/gconfbe/makefile.mk9
-rw-r--r--shell/source/backends/kde4be/exports.map10
-rw-r--r--shell/source/backends/kde4be/kde4access.cxx319
-rw-r--r--shell/source/backends/kde4be/kde4access.hxx47
-rw-r--r--shell/source/backends/kde4be/kde4backend.cxx343
-rw-r--r--shell/source/backends/kde4be/kde4backend.hxx120
-rw-r--r--shell/source/backends/kde4be/kde4be.xml35
-rw-r--r--shell/source/backends/kde4be/kde4becdef.cxx140
-rw-r--r--shell/source/backends/kde4be/kde4commonlayer.cxx154
-rw-r--r--shell/source/backends/kde4be/kde4commonlayer.hxx51
-rw-r--r--shell/source/backends/kde4be/kde4inetlayer.cxx252
-rw-r--r--shell/source/backends/kde4be/kde4inetlayer.hxx59
-rw-r--r--shell/source/backends/kde4be/kde4pathslayer.cxx121
-rw-r--r--shell/source/backends/kde4be/kde4pathslayer.hxx79
-rw-r--r--shell/source/backends/kde4be/kde4vcllayer.cxx112
-rw-r--r--shell/source/backends/kde4be/kde4vcllayer.hxx53
-rw-r--r--shell/source/backends/kde4be/makefile.mk17
-rw-r--r--shell/source/backends/kdebe/exports.map10
-rw-r--r--shell/source/backends/kdebe/kdeaccess.cxx315
-rw-r--r--shell/source/backends/kdebe/kdeaccess.hxx47
-rw-r--r--shell/source/backends/kdebe/kdebackend.cxx343
-rw-r--r--shell/source/backends/kdebe/kdebackend.hxx125
-rw-r--r--shell/source/backends/kdebe/kdebe.xml35
-rw-r--r--shell/source/backends/kdebe/kdebecdef.cxx140
-rw-r--r--shell/source/backends/kdebe/kdecommonlayer.cxx150
-rw-r--r--shell/source/backends/kdebe/kdecommonlayer.hxx56
-rw-r--r--shell/source/backends/kdebe/kdeinetlayer.cxx251
-rwxr-xr-xshell/source/backends/kdebe/kdeinetlayer.hxx62
-rw-r--r--shell/source/backends/kdebe/kdepathslayer.cxx118
-rw-r--r--shell/source/backends/kdebe/kdepathslayer.hxx83
-rw-r--r--shell/source/backends/kdebe/kdevcllayer.cxx113
-rw-r--r--shell/source/backends/kdebe/kdevcllayer.hxx56
-rw-r--r--shell/source/backends/kdebe/makefile.mk17
-rw-r--r--shell/source/backends/localebe/exports.map10
-rw-r--r--shell/source/backends/localebe/localebackend.cxx115
-rw-r--r--shell/source/backends/localebe/localebackend.hxx94
-rw-r--r--shell/source/backends/localebe/localebe.xml1
-rw-r--r--shell/source/backends/localebe/localebecdef.cxx44
-rw-r--r--shell/source/backends/localebe/localelayer.cxx85
-rw-r--r--shell/source/backends/localebe/localelayer.hxx64
-rw-r--r--shell/source/backends/localebe/makefile.mk7
-rw-r--r--shell/source/backends/macbe/exports.map10
-rw-r--r--shell/source/backends/macbe/macbackend.cxx447
-rw-r--r--shell/source/backends/macbe/macbackend.hxx86
-rw-r--r--shell/source/backends/macbe/macbe.xml1
-rw-r--r--shell/source/backends/macbe/macbecdef.cxx43
-rw-r--r--shell/source/backends/macbe/macbelayer.cxx440
-rw-r--r--shell/source/backends/macbe/macbelayer.hxx101
-rw-r--r--shell/source/backends/macbe/makefile.mk5
-rw-r--r--shell/source/backends/wininetbe/exports.map10
-rw-r--r--shell/source/backends/wininetbe/makefile.mk7
-rw-r--r--shell/source/backends/wininetbe/wininetbackend.cxx366
-rw-r--r--shell/source/backends/wininetbe/wininetbackend.hxx118
-rw-r--r--shell/source/backends/wininetbe/wininetbe.xml1
-rw-r--r--shell/source/backends/wininetbe/wininetbecdef.cxx43
-rw-r--r--shell/source/backends/wininetbe/wininetlayer.cxx374
-rw-r--r--shell/source/backends/wininetbe/wininetlayer.hxx73
-rw-r--r--shell/source/cmdmail/exports.map10
-rw-r--r--shell/source/cmdmail/makefile.mk2
-rw-r--r--shell/source/tools/lngconvex/lngconvex.cxx3
-rw-r--r--shell/source/unix/exec/exports.map10
-rw-r--r--shell/source/unix/exec/makefile.mk2
-rwxr-xr-xshell/source/unix/sysshell/recfile.map2
-rw-r--r--[-rwxr-xr-x]shell/source/win32/shlxthandler/makefile.mk10
-rw-r--r--[-rwxr-xr-x]shell/source/win32/shlxthandler/ooofilt/makefile.mk7
-rw-r--r--[-rwxr-xr-x]shell/source/win32/shlxthandler/prophdl/makefile.mk6
-rw-r--r--[-rwxr-xr-x]shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx4
-rw-r--r--shell/source/win32/shlxthandler/propsheets/makefile.mk11
-rw-r--r--svx/inc/globlmn_tmpl.hrc6
-rw-r--r--svx/inc/pch/precompiled_svx.hxx1
-rw-r--r--svx/inc/svx/cube3d.hxx5
-rw-r--r--svx/inc/svx/extrud3d.hxx7
-rw-r--r--svx/inc/svx/lathe3d.hxx7
-rw-r--r--svx/inc/svx/obj3d.hxx10
-rw-r--r--svx/inc/svx/polygn3d.hxx6
-rw-r--r--svx/inc/svx/scene3d.hxx11
-rw-r--r--svx/inc/svx/sdr/attribute/sdrallattribute.hxx198
-rw-r--r--svx/inc/svx/sdr/attribute/sdrfilltextattribute.hxx80
-rw-r--r--svx/inc/svx/sdr/attribute/sdrformtextattribute.hxx66
-rw-r--r--svx/inc/svx/sdr/attribute/sdrformtextoutlineattribute.hxx30
-rw-r--r--svx/inc/svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx81
-rw-r--r--svx/inc/svx/sdr/attribute/sdrlineshadowtextattribute.hxx79
-rw-r--r--svx/inc/svx/sdr/attribute/sdrshadowtextattribute.hxx76
-rw-r--r--svx/inc/svx/sdr/attribute/sdrtextattribute.hxx108
-rw-r--r--svx/inc/svx/sdr/contact/viewcontactofe3dscene.hxx23
-rw-r--r--svx/inc/svx/sdr/contact/viewobjectcontactofgroup.hxx3
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrattributecreator.hxx63
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx4
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrconnectorprimitive2d.hxx4
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx2
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrdecompositiontools.hxx18
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrellipseprimitive2d.hxx2
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrgrafprimitive2d.hxx3
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx3
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrole2primitive2d.hxx3
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrpathprimitive2d.hxx4
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrprimitivetools.hxx5
-rw-r--r--svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx4
-rw-r--r--svx/inc/svx/sdr/properties/oleproperties.hxx (renamed from drawinglayer/source/primitive2d/alphaprimitive2d.cxx)59
-rw-r--r--svx/inc/svx/sdrmasterpagedescriptor.hxx9
-rw-r--r--svx/inc/svx/sphere3d.hxx7
-rw-r--r--svx/inc/svx/svdoashp.hxx9
-rw-r--r--svx/inc/svx/svdoattr.hxx5
-rw-r--r--svx/inc/svx/svdobj.hxx7
-rw-r--r--svx/inc/svx/svdocapt.hxx7
-rw-r--r--svx/inc/svx/svdocirc.hxx9
-rw-r--r--svx/inc/svx/svdoedge.hxx7
-rw-r--r--svx/inc/svx/svdograf.hxx10
-rw-r--r--svx/inc/svx/svdogrp.hxx8
-rw-r--r--svx/inc/svx/svdomeas.hxx7
-rw-r--r--svx/inc/svx/svdomedia.hxx3
-rw-r--r--svx/inc/svx/svdoole2.hxx5
-rw-r--r--svx/inc/svx/svdopage.hxx11
-rw-r--r--svx/inc/svx/svdopath.hxx5
-rw-r--r--svx/inc/svx/svdorect.hxx11
-rw-r--r--svx/inc/svx/svdotable.hxx8
-rw-r--r--svx/inc/svx/svdotext.hxx8
-rw-r--r--svx/inc/svx/svdovirt.hxx4
-rw-r--r--svx/inc/svx/svdpage.hxx111
-rw-r--r--svx/inc/svx/unomodel.hxx12
-rw-r--r--svx/prj/build.lst1
-rw-r--r--svx/prj/d.lst3
-rw-r--r--svx/qa/unoapi/Test.java51
-rw-r--r--svx/qa/unoapi/makefile.mk30
-rw-r--r--svx/sdi/svx.sdi25
-rw-r--r--svx/source/accessibility/AccessibleEmptyEditSource.cxx4
-rw-r--r--svx/source/accessibility/AccessibleTextHelper.cxx4
-rw-r--r--svx/source/customshapes/EnhancedCustomShape2d.cxx13
-rw-r--r--svx/source/dialog/dlgctl3d.cxx21
-rw-r--r--svx/source/dialog/docrecovery.src4
-rw-r--r--svx/source/dialog/hyprlink.cxx4
-rw-r--r--svx/source/dialog/rubydialog.cxx2
-rw-r--r--svx/source/dialog/srchdlg.src8
-rw-r--r--svx/source/engine3d/dragmt3d.cxx27
-rw-r--r--svx/source/engine3d/makefile.mk8
-rw-r--r--svx/source/engine3d/scene3d.cxx6
-rw-r--r--svx/source/engine3d/view3d.cxx6
-rw-r--r--svx/source/engine3d/viewpt3d.cxx32
-rw-r--r--svx/source/engine3d/volume3d.cxx32
-rw-r--r--svx/source/form/datanavi.cxx2
-rw-r--r--svx/source/form/fmPropBrw.cxx2
-rw-r--r--svx/source/form/fmobj.cxx15
-rw-r--r--svx/source/form/fmshell.cxx11
-rw-r--r--svx/source/form/fmshimp.cxx581
-rw-r--r--svx/source/form/fmstring.src4
-rw-r--r--svx/source/form/formcontroller.cxx2
-rw-r--r--svx/source/inc/fmresids.hrc2
-rw-r--r--svx/source/inc/fmservs.hxx1
-rw-r--r--svx/source/inc/fmshimp.hxx175
-rw-r--r--svx/source/intro/iso.src16
-rw-r--r--svx/source/intro/ooo.src18
-rw-r--r--svx/source/items/svxitems.src4
-rw-r--r--svx/source/sdr/attribute/makefile.mk5
-rw-r--r--svx/source/sdr/attribute/sdrallattribute.cxx408
-rw-r--r--svx/source/sdr/attribute/sdrfilltextattribute.cxx92
-rw-r--r--svx/source/sdr/attribute/sdrformtextattribute.cxx339
-rw-r--r--svx/source/sdr/attribute/sdrformtextoutlineattribute.cxx143
-rw-r--r--svx/source/sdr/attribute/sdrlinefillshadowtextattribute.cxx95
-rw-r--r--svx/source/sdr/attribute/sdrlineshadowtextattribute.cxx93
-rw-r--r--svx/source/sdr/attribute/sdrshadowtextattribute.cxx85
-rw-r--r--svx/source/sdr/attribute/sdrtextattribute.cxx467
-rw-r--r--svx/source/sdr/contact/viewcontact.cxx3
-rw-r--r--svx/source/sdr/contact/viewcontactofe3d.cxx30
-rw-r--r--svx/source/sdr/contact/viewcontactofe3dcube.cxx19
-rw-r--r--svx/source/sdr/contact/viewcontactofe3dextrude.cxx22
-rw-r--r--svx/source/sdr/contact/viewcontactofe3dlathe.cxx24
-rw-r--r--svx/source/sdr/contact/viewcontactofe3dpolygon.cxx18
-rw-r--r--svx/source/sdr/contact/viewcontactofe3dscene.cxx117
-rw-r--r--svx/source/sdr/contact/viewcontactofe3dsphere.cxx20
-rw-r--r--svx/source/sdr/contact/viewcontactofgraphic.cxx236
-rw-r--r--svx/source/sdr/contact/viewcontactofgroup.cxx26
-rw-r--r--svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx65
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx194
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrcircobj.cxx93
-rw-r--r--svx/source/sdr/contact/viewcontactofsdredgeobj.cxx43
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx149
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrmediaobj.cxx13
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx191
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrole2obj.cxx93
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrpage.cxx68
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrpathobj.cxx163
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrrectobj.cxx97
-rw-r--r--svx/source/sdr/contact/viewcontactofunocontrol.cxx45
-rw-r--r--svx/source/sdr/contact/viewcontactofvirtobj.cxx41
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofe3d.cxx1
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx11
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofgroup.cxx14
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx8
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofpageobj.cxx25
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx4
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx3
-rw-r--r--svx/source/sdr/overlay/overlayobjectcell.cxx8
-rw-r--r--svx/source/sdr/overlay/overlayselection.cxx10
-rw-r--r--svx/source/sdr/primitive2d/sdrattributecreator.cxx417
-rw-r--r--svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx67
-rw-r--r--svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx44
-rw-r--r--svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx27
-rw-r--r--svx/source/sdr/primitive2d/sdrdecompositiontools.cxx58
-rw-r--r--svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx116
-rw-r--r--svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx66
-rw-r--r--svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx130
-rw-r--r--svx/source/sdr/primitive2d/sdrole2primitive2d.cxx74
-rw-r--r--svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx2
-rw-r--r--svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx67
-rw-r--r--svx/source/sdr/primitive2d/sdrprimitivetools.cxx17
-rw-r--r--svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx59
-rw-r--r--svx/source/sdr/primitive3d/sdrattributecreator3d.cxx5
-rw-r--r--svx/source/sdr/properties/attributeproperties.cxx30
-rw-r--r--svx/source/sdr/properties/makefile.mk1
-rw-r--r--svx/source/sdr/properties/oleproperties.cxx (renamed from drawinglayer/source/primitive3d/hittestprimitive3d.cxx)56
-rw-r--r--svx/source/svdraw/makefile.mk2
-rw-r--r--svx/source/svdraw/sdrmasterpagedescriptor.cxx47
-rw-r--r--svx/source/svdraw/svdcrtmt.hxx32
-rw-r--r--svx/source/svdraw/svddrgmt.cxx57
-rw-r--r--svx/source/svdraw/svdedtv.cxx97
-rw-r--r--svx/source/svdraw/svdhdl.cxx4
-rw-r--r--svx/source/svdraw/svdobj.cxx72
-rw-r--r--svx/source/svdraw/svdocapt.cxx2
-rw-r--r--svx/source/svdraw/svdogrp.cxx8
-rw-r--r--svx/source/svdraw/svdoimp.cxx33
-rw-r--r--svx/source/svdraw/svdoole2.cxx9
-rw-r--r--svx/source/svdraw/svdopath.cxx12
-rw-r--r--svx/source/svdraw/svdorect.cxx79
-rw-r--r--svx/source/svdraw/svdotext.cxx1
-rw-r--r--svx/source/svdraw/svdotextpathdecomposition.cxx78
-rw-r--r--svx/source/svdraw/svdpage.cxx215
-rwxr-xr-x[-rw-r--r--]svx/source/svdraw/svdpntv.cxx20
-rw-r--r--svx/source/svdraw/svdscrol.cxx33
-rw-r--r--svx/source/svdraw/svdscrol.hxx31
-rw-r--r--svx/source/table/tablehandles.cxx7
-rw-r--r--svx/source/table/viewcontactoftableobj.cxx125
-rw-r--r--svx/source/tbxctrls/tbxcolor.cxx2
-rw-r--r--svx/source/unodialogs/textconversiondlgs/export.map8
-rw-r--r--svx/source/unodialogs/textconversiondlgs/makefile.mk2
-rw-r--r--svx/source/unodraw/UnoGraphicExporter.cxx74
-rw-r--r--svx/source/xml/xmlexport.cxx84
-rw-r--r--svx/xml/AccessibleEditableTextPara.xml1
-rw-r--r--sysui/desktop/freedesktop/freedesktop-menus.spec1
-rw-r--r--sysui/desktop/icons/database.icnsbin0 -> 48416 bytes
-rw-r--r--sysui/desktop/icons/database.icobin0 -> 295606 bytes
-rw-r--r--sysui/desktop/icons/drawing-template.icnsbin10935 -> 48006 bytes
-rw-r--r--sysui/desktop/icons/drawing-template.icobin0 -> 295606 bytes
-rw-r--r--sysui/desktop/icons/drawing.icnsbin11290 -> 46878 bytes
-rw-r--r--sysui/desktop/icons/drawing.icobin0 -> 295606 bytes
-rw-r--r--sysui/desktop/icons/empty-document.icnsbin50465 -> 37502 bytes
-rw-r--r--sysui/desktop/icons/empty-document.icobin0 -> 295606 bytes
-rw-r--r--sysui/desktop/icons/empty-template.icnsbin47059 -> 39059 bytes
-rw-r--r--sysui/desktop/icons/empty-template.icobin0 -> 295606 bytes
-rw-r--r--sysui/desktop/icons/formula.icnsbin10380 -> 41940 bytes
-rw-r--r--sysui/desktop/icons/formula.icobin0 -> 295606 bytes
-rwxr-xr-xsysui/desktop/icons/hicolor/128x128/apps/base.pngbin16745 -> 17674 bytes
-rw-r--r--sysui/desktop/icons/hicolor/128x128/apps/calc.pngbin12968 -> 15582 bytes
-rwxr-xr-xsysui/desktop/icons/hicolor/128x128/apps/draw.pngbin16732 -> 16479 bytes
-rwxr-xr-xsysui/desktop/icons/hicolor/128x128/apps/impress.pngbin14614 -> 17785 bytes
-rwxr-xr-xsysui/desktop/icons/hicolor/128x128/apps/main.pngbin12442 -> 15601 bytes
-rwxr-xr-xsysui/desktop/icons/hicolor/128x128/apps/math.pngbin12934 -> 15536 bytes
-rwxr-xr-xsysui/desktop/icons/hicolor/128x128/apps/writer.pngbin11861 -> 14510 bytes
-rw-r--r--sysui/desktop/icons/hicolor/128x128/mimetypes/database.pngbin0 -> 5874 bytes
-rw-r--r--sysui/desktop/icons/hicolor/128x128/mimetypes/drawing-template.pngbin0 -> 6217 bytes
-rw-r--r--sysui/desktop/icons/hicolor/128x128/mimetypes/drawing.pngbin0 -> 6387 bytes
-rw-r--r--sysui/desktop/icons/hicolor/128x128/mimetypes/formula.pngbin0 -> 4353 bytes
-rw-r--r--sysui/desktop/icons/hicolor/128x128/mimetypes/master-document.pngbin0 -> 2662 bytes
-rwxr-xr-xsysui/desktop/icons/hicolor/128x128/mimetypes/oasis-database.pngbin15854 -> 6845 bytes
-rwxr-xr-xsysui/desktop/icons/hicolor/128x128/mimetypes/oasis-drawing-template.pngbin16120 -> 7206 bytes
-rwxr-xr-xsysui/desktop/icons/hicolor/128x128/mimetypes/oasis-drawing.pngbin16063 -> 7373 bytes
-rwxr-xr-xsysui/desktop/icons/hicolor/128x128/mimetypes/oasis-formula.pngbin12936 -> 5370 bytes
-rwxr-xr-xsysui/desktop/icons/hicolor/128x128/mimetypes/oasis-master-document.pngbin11992 -> 3703 bytes
-rwxr-xr-xsysui/desktop/icons/hicolor/128x128/mimetypes/oasis-presentation-template.pngbin13955 -> 6193 bytes
-rwxr-xr-xsysui/desktop/icons/hicolor/128x128/mimetypes/oasis-presentation.pngbin13654 -> 5434 bytes
-rw-r--r--sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-spreadsheet-template.pngbin12792 -> 5753 bytes
-rw-r--r--sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-spreadsheet.pngbin12338 -> 4617 bytes
-rwxr-xr-xsysui/desktop/icons/hicolor/128x128/mimetypes/oasis-text-template.pngbin12100 -> 6763 bytes
-rwxr-xr-xsysui/desktop/icons/hicolor/128x128/mimetypes/oasis-text.pngbin11770 -> 6847 bytes
-rwxr-xr-xsysui/desktop/icons/hicolor/128x128/mimetypes/oasis-web-template.pngbin17754 -> 3493 bytes
-rw-r--r--sysui/desktop/icons/hicolor/128x128/mimetypes/presentation-template.pngbin0 -> 5212 bytes
-rw-r--r--sysui/desktop/icons/hicolor/128x128/mimetypes/presentation.pngbin0 -> 4459 bytes
-rw-r--r--sysui/desktop/icons/hicolor/128x128/mimetypes/spreadsheet-template.pngbin0 -> 4764 bytes
-rw-r--r--sysui/desktop/icons/hicolor/128x128/mimetypes/spreadsheet.pngbin0 -> 3598 bytes
-rw-r--r--sysui/desktop/icons/hicolor/128x128/mimetypes/text-template.pngbin0 -> 5772 bytes
-rw-r--r--sysui/desktop/icons/hicolor/128x128/mimetypes/text.pngbin0 -> 5817 bytes
-rw-r--r--sysui/desktop/icons/hicolor/16x16/apps/base.pngbin3618 -> 869 bytes
-rw-r--r--sysui/desktop/icons/hicolor/16x16/apps/calc.pngbin3629 -> 779 bytes
-rw-r--r--sysui/desktop/icons/hicolor/16x16/apps/draw.pngbin3606 -> 875 bytes
-rw-r--r--sysui/desktop/icons/hicolor/16x16/apps/impress.pngbin3608 -> 837 bytes
-rwxr-xr-xsysui/desktop/icons/hicolor/16x16/apps/main.pngbin0 -> 893 bytes
-rw-r--r--sysui/desktop/icons/hicolor/16x16/apps/math.pngbin3607 -> 791 bytes
-rwxr-xr-x[-rw-r--r--]sysui/desktop/icons/hicolor/16x16/apps/printeradmin.pngbin963 -> 4259 bytes
-rw-r--r--sysui/desktop/icons/hicolor/16x16/apps/writer.pngbin3586 -> 776 bytes
-rw-r--r--sysui/desktop/icons/hicolor/16x16/mimetypes/database.pngbin291 -> 555 bytes
-rw-r--r--sysui/desktop/icons/hicolor/16x16/mimetypes/drawing-template.pngbin348 -> 522 bytes
-rw-r--r--sysui/desktop/icons/hicolor/16x16/mimetypes/drawing.pngbin354 -> 555 bytes
-rw-r--r--sysui/desktop/icons/hicolor/16x16/mimetypes/formula.pngbin252 -> 562 bytes
-rw-r--r--sysui/desktop/icons/hicolor/16x16/mimetypes/master-document.pngbin310 -> 450 bytes
-rw-r--r--sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-database.pngbin1009 -> 574 bytes
-rw-r--r--sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-drawing-template.pngbin1094 -> 554 bytes
-rw-r--r--sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-drawing.pngbin1082 -> 572 bytes
-rw-r--r--sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-formula.pngbin1014 -> 580 bytes
-rw-r--r--sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-master-document.pngbin929 -> 472 bytes
-rw-r--r--sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-presentation-template.pngbin1025 -> 532 bytes
-rw-r--r--sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-presentation.pngbin960 -> 441 bytes
-rw-r--r--sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-spreadsheet-template.pngbin1018 -> 538 bytes
-rw-r--r--sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-spreadsheet.pngbin961 -> 436 bytes
-rw-r--r--sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-text-template.pngbin986 -> 444 bytes
-rw-r--r--sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-text.pngbin923 -> 420 bytes
-rw-r--r--sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-web-template.pngbin1023 -> 436 bytes
-rw-r--r--sysui/desktop/icons/hicolor/16x16/mimetypes/presentation-template.pngbin303 -> 515 bytes
-rw-r--r--sysui/desktop/icons/hicolor/16x16/mimetypes/presentation.pngbin302 -> 425 bytes
-rw-r--r--sysui/desktop/icons/hicolor/16x16/mimetypes/spreadsheet-template.pngbin287 -> 513 bytes
-rw-r--r--sysui/desktop/icons/hicolor/16x16/mimetypes/spreadsheet.pngbin271 -> 412 bytes
-rw-r--r--sysui/desktop/icons/hicolor/16x16/mimetypes/text-template.pngbin240 -> 413 bytes
-rw-r--r--sysui/desktop/icons/hicolor/16x16/mimetypes/text.pngbin245 -> 392 bytes
-rw-r--r--sysui/desktop/icons/hicolor/32x32/apps/base.pngbin3153 -> 2594 bytes
-rw-r--r--sysui/desktop/icons/hicolor/32x32/apps/calc.pngbin2731 -> 2258 bytes
-rw-r--r--sysui/desktop/icons/hicolor/32x32/apps/draw.pngbin3147 -> 2491 bytes
-rw-r--r--sysui/desktop/icons/hicolor/32x32/apps/impress.pngbin2903 -> 2576 bytes
-rwxr-xr-xsysui/desktop/icons/hicolor/32x32/apps/main.pngbin0 -> 2429 bytes
-rw-r--r--sysui/desktop/icons/hicolor/32x32/apps/math.pngbin2715 -> 2371 bytes
-rwxr-xr-x[-rw-r--r--]sysui/desktop/icons/hicolor/32x32/apps/printeradmin.pngbin2534 -> 5595 bytes
-rw-r--r--sysui/desktop/icons/hicolor/32x32/apps/writer.pngbin2485 -> 2158 bytes
-rw-r--r--sysui/desktop/icons/hicolor/32x32/mimetypes/database.pngbin529 -> 1319 bytes
-rw-r--r--sysui/desktop/icons/hicolor/32x32/mimetypes/drawing-template.pngbin1344 -> 1307 bytes
-rw-r--r--sysui/desktop/icons/hicolor/32x32/mimetypes/drawing.pngbin1483 -> 1363 bytes
-rw-r--r--sysui/desktop/icons/hicolor/32x32/mimetypes/formula.pngbin1349 -> 1172 bytes
-rw-r--r--sysui/desktop/icons/hicolor/32x32/mimetypes/master-document.pngbin1559 -> 909 bytes
-rw-r--r--sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-database.pngbin2922 -> 1497 bytes
-rw-r--r--sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-drawing-template.pngbin2957 -> 1506 bytes
-rw-r--r--sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-drawing.pngbin2828 -> 1548 bytes
-rw-r--r--sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-formula.pngbin2622 -> 1346 bytes
-rw-r--r--sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-master-document.pngbin2338 -> 1110 bytes
-rw-r--r--sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-presentation-template.pngbin2812 -> 1370 bytes
-rw-r--r--sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-presentation.pngbin2623 -> 1180 bytes
-rw-r--r--sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-spreadsheet-template.pngbin2856 -> 1130 bytes
-rw-r--r--sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-spreadsheet.pngbin2618 -> 917 bytes
-rw-r--r--sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-text-template.pngbin2575 -> 1153 bytes
-rw-r--r--sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-text.pngbin2311 -> 1106 bytes
-rw-r--r--sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-web-template.pngbin2908 -> 966 bytes
-rw-r--r--sysui/desktop/icons/hicolor/32x32/mimetypes/presentation-template.pngbin1403 -> 1166 bytes
-rw-r--r--sysui/desktop/icons/hicolor/32x32/mimetypes/presentation.pngbin1515 -> 982 bytes
-rw-r--r--sysui/desktop/icons/hicolor/32x32/mimetypes/spreadsheet-template.pngbin1211 -> 919 bytes
-rw-r--r--sysui/desktop/icons/hicolor/32x32/mimetypes/spreadsheet.pngbin1301 -> 692 bytes
-rw-r--r--sysui/desktop/icons/hicolor/32x32/mimetypes/text-template.pngbin1211 -> 941 bytes
-rw-r--r--sysui/desktop/icons/hicolor/32x32/mimetypes/text.pngbin1406 -> 903 bytes
-rw-r--r--sysui/desktop/icons/hicolor/48x48/apps/base.pngbin5196 -> 4740 bytes
-rw-r--r--sysui/desktop/icons/hicolor/48x48/apps/calc.pngbin4319 -> 4298 bytes
-rw-r--r--sysui/desktop/icons/hicolor/48x48/apps/draw.pngbin5207 -> 4415 bytes
-rw-r--r--sysui/desktop/icons/hicolor/48x48/apps/impress.pngbin4974 -> 4672 bytes
-rwxr-xr-xsysui/desktop/icons/hicolor/48x48/apps/main.pngbin0 -> 4184 bytes
-rw-r--r--sysui/desktop/icons/hicolor/48x48/apps/math.pngbin4489 -> 4263 bytes
-rwxr-xr-x[-rw-r--r--]sysui/desktop/icons/hicolor/48x48/apps/printeradmin.pngbin4058 -> 7337 bytes
-rw-r--r--sysui/desktop/icons/hicolor/48x48/apps/writer.pngbin3938 -> 3983 bytes
-rw-r--r--sysui/desktop/icons/hicolor/48x48/mimetypes/database.pngbin652 -> 1862 bytes
-rw-r--r--sysui/desktop/icons/hicolor/48x48/mimetypes/drawing-template.pngbin1819 -> 1923 bytes
-rw-r--r--sysui/desktop/icons/hicolor/48x48/mimetypes/drawing.pngbin1913 -> 1962 bytes
-rw-r--r--sysui/desktop/icons/hicolor/48x48/mimetypes/formula.pngbin1803 -> 1589 bytes
-rw-r--r--sysui/desktop/icons/hicolor/48x48/mimetypes/master-document.pngbin2003 -> 1160 bytes
-rw-r--r--sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-database.pngbin5032 -> 2430 bytes
-rw-r--r--sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-drawing-template.pngbin4919 -> 2482 bytes
-rw-r--r--sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-drawing.pngbin4935 -> 2518 bytes
-rw-r--r--sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-formula.pngbin4422 -> 2171 bytes
-rw-r--r--sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-master-document.pngbin3808 -> 1741 bytes
-rw-r--r--sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-presentation-template.pngbin4650 -> 2376 bytes
-rw-r--r--sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-presentation.pngbin4611 -> 2125 bytes
-rw-r--r--sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-spreadsheet-template.pngbin4409 -> 2400 bytes
-rw-r--r--sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-spreadsheet.pngbin4211 -> 2079 bytes
-rw-r--r--sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-text-template.pngbin4023 -> 2125 bytes
-rw-r--r--sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-text.pngbin3785 -> 2094 bytes
-rw-r--r--sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-web-template.pngbin4854 -> 1537 bytes
-rw-r--r--sysui/desktop/icons/hicolor/48x48/mimetypes/presentation-template.pngbin2044 -> 1792 bytes
-rw-r--r--sysui/desktop/icons/hicolor/48x48/mimetypes/presentation.pngbin2043 -> 1551 bytes
-rw-r--r--sysui/desktop/icons/hicolor/48x48/mimetypes/spreadsheet-template.pngbin1599 -> 1829 bytes
-rw-r--r--sysui/desktop/icons/hicolor/48x48/mimetypes/spreadsheet.pngbin1684 -> 1476 bytes
-rw-r--r--sysui/desktop/icons/hicolor/48x48/mimetypes/text-template.pngbin1687 -> 1552 bytes
-rw-r--r--sysui/desktop/icons/hicolor/48x48/mimetypes/text.pngbin1764 -> 1525 bytes
-rwxr-xr-x[-rw-r--r--]sysui/desktop/icons/main.icnsbin45712 -> 51889 bytes
-rw-r--r--sysui/desktop/icons/makefile.mk29
-rw-r--r--sysui/desktop/icons/master-document.icnsbin11003 -> 41443 bytes
-rw-r--r--sysui/desktop/icons/master-document.icobin0 -> 295606 bytes
-rw-r--r--sysui/desktop/icons/oasis-database.icnsbin53983 -> 51503 bytes
-rw-r--r--sysui/desktop/icons/oasis-database.icobin0 -> 295606 bytes
-rw-r--r--sysui/desktop/icons/oasis-drawing-template.icnsbin53400 -> 51093 bytes
-rw-r--r--sysui/desktop/icons/oasis-drawing-template.icobin0 -> 295606 bytes
-rw-r--r--sysui/desktop/icons/oasis-drawing.icnsbin52603 -> 49965 bytes
-rw-r--r--sysui/desktop/icons/oasis-drawing.icobin0 -> 295606 bytes
-rw-r--r--sysui/desktop/icons/oasis-empty-document.icnsbin0 -> 40589 bytes
-rw-r--r--sysui/desktop/icons/oasis-empty-document.icobin0 -> 295606 bytes
-rw-r--r--sysui/desktop/icons/oasis-empty-template.icnsbin0 -> 42146 bytes
-rw-r--r--sysui/desktop/icons/oasis-empty-template.icobin0 -> 295606 bytes
-rw-r--r--sysui/desktop/icons/oasis-formula.icnsbin50335 -> 45027 bytes
-rw-r--r--sysui/desktop/icons/oasis-formula.icobin0 -> 295606 bytes
-rw-r--r--sysui/desktop/icons/oasis-master-document.icnsbin48904 -> 44531 bytes
-rw-r--r--sysui/desktop/icons/oasis-master-document.icobin0 -> 295606 bytes
-rw-r--r--sysui/desktop/icons/oasis-presentation-template.icnsbin51890 -> 47163 bytes
-rw-r--r--sysui/desktop/icons/oasis-presentation-template.icobin0 -> 295606 bytes
-rw-r--r--sysui/desktop/icons/oasis-presentation.icnsbin51073 -> 43638 bytes
-rw-r--r--sysui/desktop/icons/oasis-presentation.icobin0 -> 295606 bytes
-rw-r--r--sysui/desktop/icons/oasis-spreadsheet-template.icnsbin51919 -> 52924 bytes
-rw-r--r--sysui/desktop/icons/oasis-spreadsheet-template.icobin0 -> 295606 bytes
-rw-r--r--sysui/desktop/icons/oasis-spreadsheet.icnsbin50953 -> 51578 bytes
-rw-r--r--sysui/desktop/icons/oasis-spreadsheet.icobin0 -> 295606 bytes
-rw-r--r--sysui/desktop/icons/oasis-text-template.icnsbin49196 -> 49722 bytes
-rw-r--r--sysui/desktop/icons/oasis-text-template.icobin0 -> 295606 bytes
-rw-r--r--sysui/desktop/icons/oasis-text.icnsbin47545 -> 48791 bytes
-rw-r--r--sysui/desktop/icons/oasis-text.icobin0 -> 295606 bytes
-rw-r--r--sysui/desktop/icons/oasis-web-template.icnsbin55853 -> 42146 bytes
-rw-r--r--sysui/desktop/icons/oasis-web-template.icobin0 -> 295606 bytes
-rwxr-xr-x[-rw-r--r--]sysui/desktop/icons/ooo3_base_app.icobin295606 -> 295606 bytes
-rwxr-xr-x[-rw-r--r--]sysui/desktop/icons/ooo3_calc_app.icobin295606 -> 295606 bytes
-rwxr-xr-x[-rw-r--r--]sysui/desktop/icons/ooo3_draw_app.icobin295606 -> 295606 bytes
-rwxr-xr-x[-rw-r--r--]sysui/desktop/icons/ooo3_impress_app.icobin295606 -> 295606 bytes
-rwxr-xr-x[-rw-r--r--]sysui/desktop/icons/ooo3_main_app.icobin295606 -> 295606 bytes
-rwxr-xr-x[-rw-r--r--]sysui/desktop/icons/ooo3_math_app.icobin295606 -> 295606 bytes
-rwxr-xr-xsysui/desktop/icons/ooo3_open.icobin0 -> 295606 bytes
-rwxr-xr-x[-rw-r--r--]sysui/desktop/icons/ooo3_writer_app.icobin295606 -> 295606 bytes
-rw-r--r--sysui/desktop/icons/presentation-template.icnsbin10690 -> 44076 bytes
-rw-r--r--sysui/desktop/icons/presentation-template.icobin0 -> 295606 bytes
-rw-r--r--sysui/desktop/icons/presentation.icnsbin10947 -> 40551 bytes
-rw-r--r--sysui/desktop/icons/presentation.icobin0 -> 295606 bytes
-rwxr-xr-x[-rw-r--r--]sysui/desktop/icons/so9_base_app.icobin295606 -> 295606 bytes
-rwxr-xr-x[-rw-r--r--]sysui/desktop/icons/so9_calc_app.icobin295606 -> 295606 bytes
-rwxr-xr-x[-rw-r--r--]sysui/desktop/icons/so9_draw_app.icobin295606 -> 295606 bytes
-rwxr-xr-x[-rw-r--r--]sysui/desktop/icons/so9_impress_app.icobin295606 -> 295606 bytes
-rwxr-xr-x[-rw-r--r--]sysui/desktop/icons/so9_main_app.icobin295606 -> 295606 bytes
-rwxr-xr-x[-rw-r--r--]sysui/desktop/icons/so9_math_app.icobin295606 -> 295606 bytes
-rwxr-xr-xsysui/desktop/icons/so9_open.icobin0 -> 295606 bytes
-rwxr-xr-x[-rw-r--r--]sysui/desktop/icons/so9_writer_app.icobin295606 -> 295606 bytes
-rw-r--r--sysui/desktop/icons/spreadsheet-template.icnsbin10085 -> 49837 bytes
-rw-r--r--sysui/desktop/icons/spreadsheet-template.icobin0 -> 295606 bytes
-rw-r--r--sysui/desktop/icons/spreadsheet.icnsbin10457 -> 48491 bytes
-rw-r--r--sysui/desktop/icons/spreadsheet.icobin0 -> 295606 bytes
-rw-r--r--sysui/desktop/icons/text-template.icnsbin10095 -> 46635 bytes
-rw-r--r--sysui/desktop/icons/text-template.icobin0 -> 295606 bytes
-rw-r--r--sysui/desktop/icons/text.icnsbin10401 -> 45704 bytes
-rw-r--r--sysui/desktop/icons/text.icobin0 -> 295606 bytes
-rw-r--r--sysui/desktop/menus/javafilter.desktop9
-rw-r--r--sysui/desktop/redhat/redhat-menus.spec2
-rw-r--r--sysui/desktop/share/launcher_comment.ulf2
-rw-r--r--sysui/desktop/share/launcher_genericname.ulf3
-rw-r--r--sysui/desktop/share/makefile.mk6
-rw-r--r--sysui/desktop/slackware/makefile.mk6
-rw-r--r--sysui/desktop/suse/suse-menus.spec1
-rw-r--r--sysui/prj/d.lst2
-rw-r--r--sysui/source/win32/QuickStart/OOQuickStart.rc8
-rw-r--r--sysui/source/win32/QuickStart/so/QuickStart.rc10
-rw-r--r--ucb/prj/build.lst1
-rw-r--r--ucb/qa/unoapi/Test.java51
-rw-r--r--ucb/qa/unoapi/makefile.mk30
-rw-r--r--ucb/source/cacher/exports.map8
-rw-r--r--ucb/source/cacher/makefile.mk2
-rw-r--r--ucb/source/core/exports.map8
-rw-r--r--ucb/source/core/makefile.mk2
-rw-r--r--ucb/source/core/ucbstore.cxx12
-rw-r--r--ucb/source/sorter/exports.map8
-rw-r--r--ucb/source/sorter/makefile.mk2
-rw-r--r--ucb/source/ucp/expand/makefile.mk2
-rw-r--r--ucb/source/ucp/expand/ucpexpand1.uno.map8
-rw-r--r--ucb/source/ucp/file/exports.map8
-rw-r--r--ucb/source/ucp/file/makefile.mk2
-rw-r--r--ucb/source/ucp/ftp/makefile.mk2
-rw-r--r--ucb/source/ucp/ftp/ucpftp.map8
-rw-r--r--ucb/source/ucp/gio/exports.map8
-rw-r--r--ucb/source/ucp/gio/gio_content.hxx2
-rw-r--r--ucb/source/ucp/gio/gio_datasupplier.cxx30
-rw-r--r--ucb/source/ucp/gio/makefile.mk2
-rw-r--r--ucb/source/ucp/gvfs/exports.map8
-rw-r--r--ucb/source/ucp/gvfs/makefile.mk2
-rw-r--r--ucb/source/ucp/hierarchy/makefile.mk2
-rw-r--r--ucb/source/ucp/hierarchy/ucphier.map8
-rw-r--r--ucb/source/ucp/odma/exports.map8
-rw-r--r--ucb/source/ucp/odma/makefile.mk2
-rw-r--r--ucb/source/ucp/package/exports.map8
-rw-r--r--ucb/source/ucp/package/makefile.mk2
-rw-r--r--ucb/source/ucp/tdoc/exports.map8
-rw-r--r--ucb/source/ucp/tdoc/makefile.mk2
-rw-r--r--ucb/source/ucp/webdav/DAVResourceAccess.cxx2
-rw-r--r--ucb/source/ucp/webdav/DAVResourceAccess.hxx2
-rw-r--r--ucb/source/ucp/webdav/NeonSession.cxx2
-rw-r--r--ucb/source/ucp/webdav/NeonUri.cxx3
-rw-r--r--ucb/source/ucp/webdav/exports.map8
-rw-r--r--ucb/source/ucp/webdav/makefile.mk2
-rw-r--r--uui/source/iahndl.cxx211
-rw-r--r--uui/source/iahndl.hxx26
-rw-r--r--uui/source/lockfailed.src2
-rw-r--r--uui/util/exports.map10
-rw-r--r--uui/util/makefile.mk2
-rw-r--r--vbahelper/source/vbahelper/vbahelper.cxx2
-rw-r--r--vbahelper/util/makefile.mk2
-rw-r--r--vbahelper/util/msforms.map9
-rw-r--r--xmlhelp/source/com/sun/star/help/makefile.mk32
-rw-r--r--xmlhelp/source/cxxhelp/provider/databases.cxx73
-rw-r--r--xmlhelp/source/cxxhelp/provider/databases.hxx6
-rw-r--r--xmlhelp/source/cxxhelp/provider/provider.cxx35
-rw-r--r--xmlhelp/source/cxxhelp/provider/urlparameter.cxx15
-rw-r--r--xmlhelp/source/treeview/makefile.mk2
-rw-r--r--xmlhelp/source/treeview/tvhlp.map9
-rw-r--r--xmlhelp/source/treeview/tvread.cxx37
-rw-r--r--xmlhelp/util/exports.map8
-rw-r--r--xmlhelp/util/makefile.mk2
-rw-r--r--xmloff/inc/SchXMLExport.hxx1
-rw-r--r--xmloff/inc/xmloff/SchXMLExportHelper.hxx4
-rw-r--r--xmloff/inc/xmloff/SchXMLImportHelper.hxx4
-rw-r--r--xmloff/inc/xmloff/SettingsExportHelper.hxx16
-rw-r--r--xmloff/inc/xmloff/XMLSettingsExportContext.hxx66
-rw-r--r--xmloff/inc/xmloff/odffields.hxx (renamed from configmgr/source/inc/utility.hxx)40
-rw-r--r--xmloff/prj/build.lst1
-rw-r--r--xmloff/prj/d.lst2
-rw-r--r--xmloff/qa/unoapi/Test.java51
-rw-r--r--xmloff/qa/unoapi/makefile.mk30
-rw-r--r--xmloff/source/chart/SchXMLChartContext.cxx17
-rw-r--r--xmloff/source/chart/SchXMLExport.cxx409
-rw-r--r--xmloff/source/chart/SchXMLImport.cxx108
-rw-r--r--xmloff/source/chart/SchXMLTableContext.cxx303
-rw-r--r--xmloff/source/chart/SchXMLTableContext.hxx17
-rw-r--r--xmloff/source/chart/SchXMLTextListContext.cxx136
-rw-r--r--xmloff/source/chart/SchXMLTextListContext.hxx (renamed from configmgr/source/inc/bufferedfile.hxx)57
-rw-r--r--xmloff/source/chart/contexts.cxx7
-rw-r--r--xmloff/source/chart/makefile.mk1
-rw-r--r--xmloff/source/chart/transporttypes.hxx24
-rw-r--r--xmloff/source/core/SettingsExportHelper.cxx131
-rw-r--r--xmloff/source/core/xmlexp.cxx97
-rw-r--r--xmloff/source/style/styleexp.cxx32
-rw-r--r--xmloff/source/text/XMLTextMarkImportContext.cxx46
-rw-r--r--xmloff/source/text/XMLTextNumRuleInfo.cxx9
-rw-r--r--xmloff/source/text/txtimp.cxx83
-rw-r--r--xmloff/source/text/txtparae.cxx110
-rw-r--r--xmloff/source/transform/makefile.mk2
-rw-r--r--xmloff/source/transform/xof.map8
1562 files changed, 44891 insertions, 131865 deletions
diff --git a/avmedia/source/quicktime/avmediaQuickTime.map b/avmedia/source/quicktime/avmediaQuickTime.map
deleted file mode 100644
index bf1fbe0696..0000000000
--- a/avmedia/source/quicktime/avmediaQuickTime.map
+++ /dev/null
@@ -1,8 +0,0 @@
-LEXPS_1_0 {
- global:
- component_getFactory;
- component_getImplementationEnvironment;
- component_writeInfo;
- local:
- *;
-};
diff --git a/avmedia/source/quicktime/makefile.mk b/avmedia/source/quicktime/makefile.mk
index 088f3b5d0e..f3c9f244f3 100644
--- a/avmedia/source/quicktime/makefile.mk
+++ b/avmedia/source/quicktime/makefile.mk
@@ -73,7 +73,7 @@ SHL1LIBS=$(SLB)$/$(TARGET).lib
SHL1IMPLIB=i$(TARGET)
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
-SHL1VERSIONMAP= $(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
# --- Targets ------------------------------------------------------
diff --git a/basic/source/app/app.cxx b/basic/source/app/app.cxx
index b742aace2d..f8b2d66239 100644
--- a/basic/source/app/app.cxx
+++ b/basic/source/app/app.cxx
@@ -191,41 +191,6 @@ BOOL IsTTSignatureForUnicodeTextfile( String aLine )
BasicApp aBasicApp; // Application instance
-static const char * const components[] =
-{
- SAL_MODULENAME( "ucb1" ) // KSO, ABI
- , SAL_MODULENAME( "ucpfile1" )
- , "configmgr2.uno" SAL_DLLEXTENSION
- , "sax.uno" SAL_DLLEXTENSION
- , "stocservices.uno" SAL_DLLEXTENSION
- , SAL_MODULENAME( "fileacc" )
- , SAL_MODULENAME( "mcnttype" ) // Clipboard Ask Oliver Braun
- , "i18npool.uno" SAL_DLLEXTENSION
- // Reading of files in specific encodings like UTF-8 using
- // createUnoService( "com.sun.star.io.TextInputStream" ) and such
- , "textinstream.uno" SAL_DLLEXTENSION
- , "textoutstream.uno" SAL_DLLEXTENSION
- , "introspection.uno" SAL_DLLEXTENSION
- , "reflection.uno" SAL_DLLEXTENSION
- // RemoteUno
- , "connector.uno" SAL_DLLEXTENSION
- , "bridgefac.uno" SAL_DLLEXTENSION
- , "remotebridge.uno" SAL_DLLEXTENSION
-#ifdef SAL_UNX
-#ifdef QUARTZ
- , SVLIBRARY( "dtransaqua" ) // Mac OS X Aqua uses a dedicated libdtransaqua
-#else
- , SVLIBRARY( "dtransX11" ) // OBR
-#endif
-#endif
-#ifdef SAL_W32
- , SAL_MODULENAME( "sysdtrans" )
- , SAL_MODULENAME( "ftransl" )
- , SAL_MODULENAME( "dnd" )
-#endif
- , 0
-};
-
uno::Reference< XContentProviderManager > InitializeUCB( void )
{
uno::Reference< XMultiServiceFactory > xSMgr;
diff --git a/basic/source/app/basic.src b/basic/source/app/basic.src
index 1e520add50..d93ca2fa23 100644
--- a/basic/source/app/basic.src
+++ b/basic/source/app/basic.src
@@ -87,7 +87,7 @@ ModalDialog IDD_ABOUT_DIALOG {
FixedText {
Pos = MAP_APPFONT( 40, 60 );
Size = MAP_APPFONT( 110, 10 );
- TEXT = "®1995 Sun Microsystems, Inc.";
+ TEXT = "®1995-2010 Oracle";
CENTER = TRUE;
};
};
@@ -127,7 +127,7 @@ ModalDialog IDD_TT_ABOUT_DIALOG {
Pos = MAP_APPFONT( 5, 40 );
Size = MAP_APPFONT( 110, 10 );
CENTER = TRUE;
- TEXT[ en-US ] = "©1995-2005 Sun Microsystems, Inc.";
+ TEXT[ en-US ] = "©1995-2010 Oracle";
};
OKButton RID_OK {
Pos = MAP_APPFONT( 40, 60 );
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index 41c596dedb..ffb23f9710 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -97,20 +97,13 @@ typedef WeakImplHelper1< XStarBasicAccess > StarBasicAccessHelper;
// + BOOL bReference
static const char* szStdLibName = "Standard";
-static const char* szBasicStorage = "StarBASIC";
+static const char szBasicStorage[] = "StarBASIC";
static const char* szOldManagerStream = "BasicManager";
-static const char* szManagerStream = "BasicManager2";
+static const char szManagerStream[] = "BasicManager2";
static const char* szImbedded = "LIBIMBEDDED";
static const char* szCryptingKey = "CryptedBasic";
static const char* szScriptLanguage = "StarBasic";
-static const String BasicStreamName( String::CreateFromAscii(szBasicStorage) );
-static const String ManagerStreamName( String::CreateFromAscii(szManagerStream) );
-
-
-#define DEFINE_CONST_UNICODE(CONSTASCII) UniString(RTL_CONSTASCII_USTRINGPARAM(CONSTASCII))
-
-
TYPEINIT1( BasicManager, SfxBroadcaster );
DBG_NAME( BasicManager );
@@ -666,7 +659,7 @@ BasicManager::BasicManager( SotStorage& rStorage, const String& rBaseURL, StarBA
// DBG_ASSERT(aStorageName.Len() != 0, "Bad storage name");
// If there is no Manager Stream, no further actions are necessary
- if ( rStorage.IsStream( ManagerStreamName ) )
+ if ( rStorage.IsStream( String(RTL_CONSTASCII_USTRINGPARAM(szManagerStream)) ) )
{
LoadBasicManager( rStorage, rBaseURL );
// StdLib contains Parent:
@@ -707,12 +700,12 @@ BasicManager::BasicManager( SotStorage& rStorage, const String& rBaseURL, StarBA
// #91626 Save all stream data to save it unmodified if basic isn't modified
// in an 6.0+ office. So also the old basic dialogs can be saved.
SotStorageStreamRef xManagerStream = rStorage.OpenSotStream
- ( ManagerStreamName, eStreamReadMode );
+ ( String(RTL_CONSTASCII_USTRINGPARAM(szManagerStream)), eStreamReadMode );
mpImpl->mpManagerStream = new SvMemoryStream();
*static_cast<SvStream*>(&xManagerStream) >> *mpImpl->mpManagerStream;
SotStorageRef xBasicStorage = rStorage.OpenSotStorage
- ( BasicStreamName, eStorageReadMode, FALSE );
+ ( String(RTL_CONSTASCII_USTRINGPARAM(szBasicStorage)), eStorageReadMode, FALSE );
if( xBasicStorage.Is() && !xBasicStorage->GetError() )
{
USHORT nLibs = GetLibCount();
@@ -921,7 +914,7 @@ void BasicManager::LoadBasicManager( SotStorage& rStorage, const String& rBaseUR
// StreamMode eStreamMode = STREAM_READ | STREAM_NOCREATE | STREAM_SHARE_DENYWRITE;
SotStorageStreamRef xManagerStream = rStorage.OpenSotStream
- ( ManagerStreamName, eStreamReadMode );
+ ( String(RTL_CONSTASCII_USTRINGPARAM(szManagerStream)), eStreamReadMode );
String aStorName( rStorage.GetName() );
// #i13114 removed, DBG_ASSERT( aStorName.Len(), "No Storage Name!" );
@@ -1169,7 +1162,7 @@ BOOL BasicManager::ImpLoadLibary( BasicLibInfo* pLibInfo, SotStorage* pCurStorag
xStorage = new SotStorage( FALSE, aStorageName, eStorageReadMode );
SotStorageRef xBasicStorage = xStorage->OpenSotStorage
- ( BasicStreamName, eStorageReadMode, FALSE );
+ ( String(RTL_CONSTASCII_USTRINGPARAM(szBasicStorage)), eStorageReadMode, FALSE );
if ( !xBasicStorage.Is() || xBasicStorage->GetError() )
{
@@ -1422,10 +1415,10 @@ BOOL BasicManager::RemoveLib( USHORT nLib, BOOL bDelBasicFromStorage )
else
xStorage = new SotStorage( FALSE, pLibInfo->GetStorageName() );
- if ( xStorage->IsStorage( BasicStreamName ) )
+ if ( xStorage->IsStorage( String(RTL_CONSTASCII_USTRINGPARAM(szBasicStorage)) ) )
{
SotStorageRef xBasicStorage = xStorage->OpenSotStorage
- ( BasicStreamName, STREAM_STD_READWRITE, FALSE );
+ ( String(RTL_CONSTASCII_USTRINGPARAM(szBasicStorage)), STREAM_STD_READWRITE, FALSE );
if ( !xBasicStorage.Is() || xBasicStorage->GetError() )
{
@@ -1445,7 +1438,7 @@ BOOL BasicManager::RemoveLib( USHORT nLib, BOOL bDelBasicFromStorage )
if ( !aInfoList.Count() )
{
xBasicStorage.Clear();
- xStorage->Remove( BasicStreamName );
+ xStorage->Remove( String(RTL_CONSTASCII_USTRINGPARAM(szBasicStorage)) );
xStorage->Commit();
// If no further Streams or SubStorages available,
// delete the Storage, too.
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index 1b52880f23..213cd8b883 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -64,20 +64,17 @@ TYPEINIT1(StarBASIC,SbxObject)
#define RTLNAME "@SBRTL"
// i#i68894#
-const static String aThisComponent( RTL_CONSTASCII_USTRINGPARAM("ThisComponent") );
-const static String aVBAHook( RTL_CONSTASCII_USTRINGPARAM( "VBAGlobals" ) );
-
SbxObject* StarBASIC::getVBAGlobals( )
{
if ( !pVBAGlobals )
- pVBAGlobals = (SbUnoObject*)Find( aVBAHook , SbxCLASS_DONTCARE );
+ pVBAGlobals = (SbUnoObject*)Find( String(RTL_CONSTASCII_USTRINGPARAM("VBAGlobals")), SbxCLASS_DONTCARE );
return pVBAGlobals;
}
// i#i68894#
SbxVariable* StarBASIC::VBAFind( const String& rName, SbxClassType t )
{
- if( rName == aThisComponent )
+ if( rName.EqualsAscii("ThisComponent") )
return NULL;
// rename to init globals
if ( getVBAGlobals( ) )
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index 8580b3f5a4..cebf92c58a 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -103,6 +103,7 @@ TYPEINIT1(SbUnoObject,SbxObject)
TYPEINIT1(SbUnoClass,SbxObject)
TYPEINIT1(SbUnoService,SbxObject)
TYPEINIT1(SbUnoServiceCtor,SbxMethod)
+TYPEINIT1(SbUnoSingleton,SbxObject)
typedef WeakImplHelper1< XAllListener > BasicAllListenerHelper;
@@ -111,9 +112,9 @@ typedef WeakImplHelper1< XAllListener > BasicAllListenerHelper;
// Identifier fuer die dbg_-Properies als Strings anlegen
-static String ID_DBG_SUPPORTEDINTERFACES( RTL_CONSTASCII_USTRINGPARAM("Dbg_SupportedInterfaces") );
-static String ID_DBG_PROPERTIES( RTL_CONSTASCII_USTRINGPARAM("Dbg_Properties") );
-static String ID_DBG_METHODS( RTL_CONSTASCII_USTRINGPARAM("Dbg_Methods") );
+static char const ID_DBG_SUPPORTEDINTERFACES[] = "Dbg_SupportedInterfaces";
+static char const ID_DBG_PROPERTIES[] = "Dbg_Properties";
+static char const ID_DBG_METHODS[] = "Dbg_Methods";
static ::rtl::OUString aSeqLevelStr( RTL_CONSTASCII_USTRINGPARAM("[]") );
static ::rtl::OUString defaultNameSpace( RTL_CONSTASCII_USTRINGPARAM("ooo.vba") );
@@ -1629,7 +1630,7 @@ String Impl_GetSupportedInterfaces( SbUnoObject* pUnoObj )
String aRet;
if( eType != TypeClass_INTERFACE )
{
- aRet += ID_DBG_SUPPORTEDINTERFACES;
+ aRet.AppendAscii( RTL_CONSTASCII_STRINGPARAM(ID_DBG_SUPPORTEDINTERFACES) );
aRet.AppendAscii( " not available.\n(TypeClass is not TypeClass_INTERFACE)\n" );
}
else
@@ -2652,15 +2653,15 @@ void SbUnoObject::implCreateDbgProperties( void )
Property aProp;
// Id == -1: Implementierte Interfaces gemaess ClassProvider anzeigen
- SbxVariableRef xVarRef = new SbUnoProperty( ID_DBG_SUPPORTEDINTERFACES, SbxSTRING, aProp, -1, false );
+ SbxVariableRef xVarRef = new SbUnoProperty( String(RTL_CONSTASCII_USTRINGPARAM(ID_DBG_SUPPORTEDINTERFACES)), SbxSTRING, aProp, -1, false );
QuickInsert( (SbxVariable*)xVarRef );
// Id == -2: Properties ausgeben
- xVarRef = new SbUnoProperty( ID_DBG_PROPERTIES, SbxSTRING, aProp, -2, false );
+ xVarRef = new SbUnoProperty( String(RTL_CONSTASCII_USTRINGPARAM(ID_DBG_PROPERTIES)), SbxSTRING, aProp, -2, false );
QuickInsert( (SbxVariable*)xVarRef );
// Id == -3: Methoden ausgeben
- xVarRef = new SbUnoProperty( ID_DBG_METHODS, SbxSTRING, aProp, -3, false );
+ xVarRef = new SbUnoProperty( String(RTL_CONSTASCII_USTRINGPARAM(ID_DBG_METHODS)), SbxSTRING, aProp, -3, false );
QuickInsert( (SbxVariable*)xVarRef );
}
@@ -3299,6 +3300,18 @@ SbxVariable* SbUnoClass::Find( const XubString& rName, SbxClassType t )
pRes->PutObject( xWrapper );
}
}
+
+ // An UNO singleton?
+ if( !pRes )
+ {
+ SbUnoSingleton* pUnoSingleton = findUnoSingleton( aNewName );
+ if( pUnoSingleton )
+ {
+ pRes = new SbxVariable( SbxVARIANT );
+ SbxObjectRef xWrapper = (SbxObject*)pUnoSingleton;
+ pRes->PutObject( xWrapper );
+ }
+ }
}
}
@@ -3579,6 +3592,90 @@ SbxInfo* SbUnoServiceCtor::GetInfo()
}
+SbUnoSingleton* findUnoSingleton( const String& rName )
+{
+ SbUnoSingleton* pSbUnoSingleton = NULL;
+
+ Reference< XHierarchicalNameAccess > xTypeAccess = getTypeProvider_Impl();
+ if( xTypeAccess->hasByHierarchicalName( rName ) )
+ {
+ Any aRet = xTypeAccess->getByHierarchicalName( rName );
+ Reference< XTypeDescription > xTypeDesc;
+ aRet >>= xTypeDesc;
+
+ if( xTypeDesc.is() )
+ {
+ TypeClass eTypeClass = xTypeDesc->getTypeClass();
+ if( eTypeClass == TypeClass_SINGLETON )
+ {
+ Reference< XSingletonTypeDescription > xSingletonTypeDesc( xTypeDesc, UNO_QUERY );
+ if( xSingletonTypeDesc.is() )
+ pSbUnoSingleton = new SbUnoSingleton( rName, xSingletonTypeDesc );
+ }
+ }
+ }
+ return pSbUnoSingleton;
+}
+
+SbUnoSingleton::SbUnoSingleton( const String& aName_,
+ const Reference< XSingletonTypeDescription >& xSingletonTypeDesc )
+ : SbxObject( aName_ )
+ , m_xSingletonTypeDesc( xSingletonTypeDesc )
+{
+ SbxVariableRef xGetMethodRef =
+ new SbxMethod( String( RTL_CONSTASCII_USTRINGPARAM( "get" ) ), SbxOBJECT );
+ QuickInsert( (SbxVariable*)xGetMethodRef );
+}
+
+void SbUnoSingleton::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
+ const SfxHint& rHint, const TypeId& rHintType )
+{
+ const SbxHint* pHint = PTR_CAST(SbxHint,&rHint);
+ if( pHint )
+ {
+ SbxVariable* pVar = pHint->GetVar();
+ SbxArray* pParams = pVar->GetParameters();
+ UINT32 nParamCount = pParams ? ((UINT32)pParams->Count() - 1) : 0;
+ UINT32 nAllowedParamCount = 1;
+
+ Reference < XComponentContext > xContextToUse;
+ if( nParamCount > 0 )
+ {
+ // Check if first parameter is a context and use it then
+ Reference < XComponentContext > xFirstParamContext;
+ Any aArg1 = sbxToUnoValue( pParams->Get( 1 ) );
+ if( (aArg1 >>= xFirstParamContext) && xFirstParamContext.is() )
+ xContextToUse = xFirstParamContext;
+ }
+
+ if( !xContextToUse.is() )
+ {
+ Reference < XPropertySet > xProps( ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW );
+ xContextToUse.set( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" )) ), UNO_QUERY_THROW );
+ --nAllowedParamCount;
+ }
+
+ if( nParamCount > nAllowedParamCount )
+ {
+ StarBASIC::Error( SbERR_BAD_ARGUMENT );
+ return;
+ }
+
+ Any aRetAny;
+ if( xContextToUse.is() )
+ {
+ String aSingletonName( RTL_CONSTASCII_USTRINGPARAM("/singletons/") );
+ aSingletonName += GetName();
+ Reference < XInterface > xRet;
+ xContextToUse->getValueByName( aSingletonName ) >>= xRet;
+ aRetAny <<= xRet;
+ }
+ unoToSbxValue( pVar, aRetAny );
+ }
+ else
+ SbxObject::SFX_NOTIFY( rBC, rBCType, rHint, rHintType );
+}
+
//========================================================================
//========================================================================
diff --git a/basic/source/inc/sbunoobj.hxx b/basic/source/inc/sbunoobj.hxx
index f9d857c6a1..b8993c1e71 100644
--- a/basic/source/inc/sbunoobj.hxx
+++ b/basic/source/inc/sbunoobj.hxx
@@ -41,6 +41,7 @@
#include <com/sun/star/script/XInvocation.hpp>
#include <com/sun/star/reflection/XIdlClass.hpp>
#include <com/sun/star/reflection/XServiceTypeDescription2.hpp>
+#include <com/sun/star/reflection/XSingletonTypeDescription.hpp>
#include <rtl/ustring.hxx>
class SbUnoObject: public SbxObject
@@ -226,6 +227,23 @@ public:
};
+// Wrapper for UNO Singleton
+class SbUnoSingleton : public SbxObject
+{
+ const ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XSingletonTypeDescription > m_xSingletonTypeDesc;
+
+public:
+ TYPEINFO();
+ SbUnoSingleton( const String& aName_,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XSingletonTypeDescription >& xSingletonTypeDesc );
+
+ void SFX_NOTIFY( SfxBroadcaster&, const TypeId&, const SfxHint& rHint, const TypeId& );
+};
+SV_DECL_IMPL_REF(SbUnoSingleton);
+
+SbUnoSingleton* findUnoSingleton( const String& rName );
+
+
// #105565 Special Object to wrap a strongly typed Uno Any
class SbUnoAnyObject: public SbxObject
{
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index 8ca150b445..657ecd03f4 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -1744,7 +1744,7 @@ void SfxLibraryContainer::implImportLibDescriptor
// Methods of new XLibraryStorage interface?
-void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XStorage >& xStorage, sal_Bool bComplete )
+void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XStorage >& i_rStorage, sal_Bool bComplete )
{
const Sequence< OUString > aNames = maNameContainer.getElementNames();
sal_Int32 nNameCount = aNames.getLength();
@@ -1765,35 +1765,13 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto
::xmlscript::LibDescriptorArray* pLibArray = new ::xmlscript::LibDescriptorArray( nLibsToSave );
// Write to storage?
- sal_Bool bStorage = xStorage.is();
- uno::Reference< embed::XStorage > xLibrariesStor;
+ sal_Bool bStorage = i_rStorage.is();
uno::Reference< embed::XStorage > xSourceLibrariesStor;
- if( bStorage )
+ uno::Reference< embed::XStorage > xTargetLibrariesStor;
+ ::rtl::OUString sTempTargetStorName;
+ const bool bInplaceStorage = bStorage && ( i_rStorage == mxStorage );
+ if ( bStorage )
{
- // when we save to our root storage, ensure the libs are all loaded. Else the below cleaning
- // of the target storage will loose them.
- if ( xStorage == mxStorage )
- {
- pName = aNames.getConstArray();
- for ( ; pName != pNamesEnd; ++pName )
- {
- if ( !isLibraryLoaded( *pName ) )
- loadLibrary( *pName );
- }
- }
-
- // first of all, clean the target library storage, since the storing procedure must do overwrite
- try
- {
- if ( xStorage->hasByName( maLibrariesDir ) )
- xStorage->removeElement( maLibrariesDir );
- }
- catch( const uno::Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- return;
- }
-
// Don't write if only empty standard lib exists
if ( ( nNameCount == 1 ) && ( aNames[0].equalsAscii( "Standard" ) ) )
{
@@ -1804,29 +1782,54 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto
return;
}
- try {
- xLibrariesStor.set( xStorage->openStorageElement( maLibrariesDir, embed::ElementModes::READWRITE ), UNO_QUERY_THROW );
+ // create the empty target storage
+ try
+ {
+ ::rtl::OUString sTargetLibrariesStoreName;
+ if ( bInplaceStorage )
+ {
+ // create a temporary target storage
+ const ::rtl::OUStringBuffer aTempTargetNameBase = maLibrariesDir + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_temp_" ) );
+ sal_Int32 index = 0;
+ do
+ {
+ ::rtl::OUStringBuffer aTempTargetName( aTempTargetNameBase );
+ aTempTargetName.append( index++ );
+
+ sTargetLibrariesStoreName = aTempTargetName.makeStringAndClear();
+ if ( !i_rStorage->hasByName( sTargetLibrariesStoreName ) )
+ break;
+ }
+ while ( true );
+ sTempTargetStorName = sTargetLibrariesStoreName;
+ }
+ else
+ {
+ sTargetLibrariesStoreName = maLibrariesDir;
+ if ( i_rStorage->hasByName( sTargetLibrariesStoreName ) )
+ i_rStorage->removeElement( sTargetLibrariesStoreName );
+ }
+
+ xTargetLibrariesStor.set( i_rStorage->openStorageElement( sTargetLibrariesStoreName, embed::ElementModes::READWRITE ), UNO_QUERY_THROW );
}
- catch( uno::Exception& )
+ catch( const uno::Exception& )
{
- #if OSL_DEBUG_LEVEL > 0
- Any aError( ::cppu::getCaughtException() );
- ::rtl::OStringBuffer aMessage;
- aMessage.append( "couln't open source library storage.\n\nException:" );
- aMessage.append( ::rtl::OUStringToOString( ::comphelper::anyToString( aError ), osl_getThreadTextEncoding() ) );
- OSL_ENSURE( false, aMessage.makeStringAndClear().getStr() );
- #endif
+ DBG_UNHANDLED_EXCEPTION();
return;
}
+ // open the source storage which might be used to copy yet-unmodified libraries
try
{
- if ( ( mxStorage != xStorage ) && ( mxStorage->hasByName( maLibrariesDir ) ) )
- xSourceLibrariesStor = mxStorage->openStorageElement( maLibrariesDir, embed::ElementModes::READ );
+ if ( mxStorage->hasByName( maLibrariesDir ) )
+ xSourceLibrariesStor = mxStorage->openStorageElement( maLibrariesDir, bInplaceStorage ? embed::ElementModes::READWRITE : embed::ElementModes::READ );
+ else if ( bInplaceStorage )
+ xSourceLibrariesStor = mxStorage->openStorageElement( maLibrariesDir, embed::ElementModes::READWRITE );
}
catch( const uno::Exception& )
{
DBG_UNHANDLED_EXCEPTION();
+ return;
}
}
@@ -1838,7 +1841,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto
SfxLibrary* pImplLib = getImplLib( *pName );
if( pImplLib->mbSharedIndexFile )
continue;
- bool bExtensionLib = pImplLib->mbExtension;
+ const bool bExtensionLib = pImplLib->mbExtension;
::xmlscript::LibDescriptor& rLib = bExtensionLib ?
aLibDescriptorForExtensionLibs : pLibArray->mpLibs[iArray];
if( !bExtensionLib )
@@ -1858,12 +1861,14 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto
if( pImplLib->implIsModified() || bComplete )
{
- // Can we copy the storage?
+ // Can we simply copy the storage?
if( !mbOldInfoFormat && !pImplLib->implIsModified() && !mbOasis2OOoFormat && xSourceLibrariesStor.is() )
{
- try {
- xSourceLibrariesStor->copyElementTo( rLib.aName, xLibrariesStor, rLib.aName );
- } catch( uno::Exception& )
+ try
+ {
+ xSourceLibrariesStor->copyElementTo( rLib.aName, xTargetLibrariesStor, rLib.aName );
+ }
+ catch( const uno::Exception& )
{
DBG_UNHANDLED_EXCEPTION();
// TODO: error handling?
@@ -1876,7 +1881,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto
{
try
{
- xLibraryStor = xLibrariesStor->openStorageElement(
+ xLibraryStor = xTargetLibrariesStor->openStorageElement(
rLib.aName,
embed::ElementModes::READWRITE );
}
@@ -1908,7 +1913,8 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto
implStoreLibraryIndexFile( pImplLib, rLib, xLibraryStor );
if( bStorage )
{
- try {
+ try
+ {
uno::Reference< embed::XTransactedObject > xTransact( xLibraryStor, uno::UNO_QUERY_THROW );
xTransact->commit();
}
@@ -1928,6 +1934,59 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto
rLib.bReadOnly = pImplLib->mbReadOnlyLink;
}
+ // if we did an in-place save into a storage (i.e. a save into the storage we were already based on),
+ // then we need to clean up the temporary storage we used for this
+ if ( bInplaceStorage && sTempTargetStorName.getLength() )
+ {
+ OSL_ENSURE( xSourceLibrariesStor.is(), "SfxLibrariesContainer::storeLibraries_impl: unexpected: we should have a source storage here!" );
+ try
+ {
+ // for this, we first remove everything from the source storage, then copy the complete content
+ // from the temporary target storage. From then on, what used to be the "source storage" becomes
+ // the "targt storage" for all subsequent operations.
+
+ // (We cannot simply remove the storage, denoted by maLibrariesDir, from i_rStorage - there might be
+ // open references to it.)
+
+ if ( xSourceLibrariesStor.is() )
+ {
+ // remove
+ const Sequence< ::rtl::OUString > aRemoveNames( xSourceLibrariesStor->getElementNames() );
+ for ( const ::rtl::OUString* pRemoveName = aRemoveNames.getConstArray();
+ pRemoveName != aRemoveNames.getConstArray() + aRemoveNames.getLength();
+ ++pRemoveName
+ )
+ {
+ xSourceLibrariesStor->removeElement( *pRemoveName );
+ }
+
+ // copy
+ const Sequence< ::rtl::OUString > aCopyNames( xTargetLibrariesStor->getElementNames() );
+ for ( const ::rtl::OUString* pCopyName = aCopyNames.getConstArray();
+ pCopyName != aCopyNames.getConstArray() + aCopyNames.getLength();
+ ++pCopyName
+ )
+ {
+ xTargetLibrariesStor->copyElementTo( *pCopyName, xSourceLibrariesStor, *pCopyName );
+ }
+ }
+
+ // close and remove temp target
+ xTargetLibrariesStor->dispose();
+ i_rStorage->removeElement( sTempTargetStorName );
+ xTargetLibrariesStor.clear();
+ sTempTargetStorName = ::rtl::OUString();
+
+ // adjust target
+ xTargetLibrariesStor = xSourceLibrariesStor;
+ xSourceLibrariesStor.clear();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
if( !mbOldInfoFormat && !maModifiable.isModified() )
return;
maModifiable.setModified( sal_False );
@@ -1953,7 +2012,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto
aStreamName += String( RTL_CONSTASCII_USTRINGPARAM("-lc.xml") );
try {
- xInfoStream = xLibrariesStor->openStreamElement( aStreamName, embed::ElementModes::READWRITE );
+ xInfoStream = xTargetLibrariesStor->openStreamElement( aStreamName, embed::ElementModes::READWRITE );
uno::Reference< beans::XPropertySet > xProps( xInfoStream, uno::UNO_QUERY );
OSL_ENSURE ( xProps.is(), "The stream must implement XPropertySet!\n" );
if ( !xProps.is() )
@@ -2012,7 +2071,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto
xmlscript::exportLibraryContainer( xHandler, pLibArray );
if ( bStorage )
{
- uno::Reference< embed::XTransactedObject > xTransact( xLibrariesStor, uno::UNO_QUERY );
+ uno::Reference< embed::XTransactedObject > xTransact( xTargetLibrariesStor, uno::UNO_QUERY );
OSL_ENSURE( xTransact.is(), "The storage must implement XTransactedObject!\n" );
if ( !xTransact.is() )
throw uno::RuntimeException();
diff --git a/configmgr/inc/configmgr/detail/configmgrdllapi.hxx b/configmgr/inc/configmgr/detail/configmgrdllapi.hxx
new file mode 100644
index 0000000000..6eb2ea7bc9
--- /dev/null
+++ b/configmgr/inc/configmgr/detail/configmgrdllapi.hxx
@@ -0,0 +1,41 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_DETAIL_CONFIGMGRDLLAPI_HXX
+#define INCLUDED_CONFIGMGR_DETAIL_CONFIGMGRDLLAPI_HXX
+
+#include "sal/config.h"
+
+#include "sal/types.h"
+
+#if defined OOO_DLLIMPLEMENTATION_CONFIGMGR
+#define OOO_DLLPUBLIC_CONFIGMGR SAL_DLLPUBLIC_EXPORT
+#else
+#define OOO_DLLPUBLIC_CONFIGMGR SAL_DLLPUBLIC_IMPORT
+#endif
+
+#endif
diff --git a/configmgr/inc/configmgr/update.hxx b/configmgr/inc/configmgr/update.hxx
new file mode 100644
index 0000000000..b27a324874
--- /dev/null
+++ b/configmgr/inc/configmgr/update.hxx
@@ -0,0 +1,51 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_UPDATE_HXX
+#define INCLUDED_CONFIGMGR_UPDATE_HXX
+
+#include "sal/config.h"
+
+#include "configmgr/detail/configmgrdllapi.hxx"
+
+namespace rtl { class OUString; }
+
+namespace configmgr {
+
+namespace update {
+
+OOO_DLLPUBLIC_CONFIGMGR void insertExtensionXcsFile(
+ bool shared, rtl::OUString const & fileUri);
+
+OOO_DLLPUBLIC_CONFIGMGR void insertExtensionXcuFile(
+ bool shared, rtl::OUString const & fileUri);
+
+}
+
+}
+
+#endif
diff --git a/configmgr/inc/makefile.mk b/configmgr/inc/makefile.mk
index a9732db36f..3dd2fc4d48 100644
--- a/configmgr/inc/makefile.mk
+++ b/configmgr/inc/makefile.mk
@@ -1,7 +1,6 @@
#*************************************************************************
-#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -22,27 +21,18 @@
# version 3 along with OpenOffice.org. If not, see
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-PRJ=..
-
-PRJNAME=configmgr
-TARGET=inc
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/makefile.pmk
+#***********************************************************************/
-# --- Files --------------------------------------------------------
-# --- Targets -------------------------------------------------------
+PRJ = ..
+PRJNAME = configmgr
+TARGET = inc
-.INCLUDE : target.mk
+ENABLE_EXCEPTIONS = TRUE
+VISIBILITY_HIDDEN = TRUE
-.IF "$(ENABLE_PCH)"!=""
-ALLTAR : \
- $(SLO)$/precompiled.pch \
- $(SLO)$/precompiled_ex.pch
-
-.ENDIF # "$(ENABLE_PCH)"!=""
+.INCLUDE: settings.mk
+.INCLUDE: target.mk
+.IF "$(ENABLE_PCH)" != ""
+ALLTAR: $(SLO)/precompiled.pch $(SLO)/precompiled_ex.pch
+.ENDIF
diff --git a/configmgr/inc/pch/precompiled_configmgr.cxx b/configmgr/inc/pch/precompiled_configmgr.cxx
index c6349f6f96..abfb44ccb7 100644
--- a/configmgr/inc/pch/precompiled_configmgr.cxx
+++ b/configmgr/inc/pch/precompiled_configmgr.cxx
@@ -1,29 +1,28 @@
/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
#include "precompiled_configmgr.hxx"
-
diff --git a/configmgr/inc/pch/precompiled_configmgr.hxx b/configmgr/inc/pch/precompiled_configmgr.hxx
index 9bbe258eaa..7561fe89f7 100644
--- a/configmgr/inc/pch/precompiled_configmgr.hxx
+++ b/configmgr/inc/pch/precompiled_configmgr.hxx
@@ -1,245 +1,32 @@
/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#if defined PRECOMPILED_HEADERS
-// MARKER(update_precomp.py): Generated on 2006-09-01 17:49:35.077252
-
-#ifdef PRECOMPILED_HEADERS
-
-//---MARKER---
#include "sal/config.h"
-#include "sal/types.h"
-
-#include "com/sun/star/beans/IllegalTypeException.hpp"
-#include "com/sun/star/beans/NamedValue.hpp"
-#include "com/sun/star/beans/Property.hpp"
-#include "com/sun/star/beans/PropertyAttribute.hpp"
-#include "com/sun/star/beans/PropertyExistException.hpp"
-#include "com/sun/star/beans/PropertyValue.hpp"
-#include "com/sun/star/beans/PropertyVetoException.hpp"
-#include "com/sun/star/beans/UnknownPropertyException.hpp"
-#include "com/sun/star/beans/XExactName.hpp"
-#include "com/sun/star/beans/XHierarchicalPropertySet.hpp"
-#include "com/sun/star/beans/XMultiHierarchicalPropertySet.hpp"
-#include "com/sun/star/beans/XMultiPropertySet.hpp"
-#include "com/sun/star/beans/XMultiPropertyStates.hpp"
-#include "com/sun/star/beans/XPropertiesChangeListener.hpp"
-#include "com/sun/star/beans/XProperty.hpp"
-#include "com/sun/star/beans/XPropertyChangeListener.hpp"
-#include "com/sun/star/beans/XPropertySet.hpp"
-#include "com/sun/star/beans/XPropertySetInfo.hpp"
-#include "com/sun/star/beans/XPropertyState.hpp"
-#include "com/sun/star/beans/XPropertyWithState.hpp"
-#include "com/sun/star/beans/XVetoableChangeListener.hpp"
-#include "com/sun/star/configuration/CannotLoadConfigurationException.hpp"
-#include "com/sun/star/configuration/InstallationIncompleteException.hpp"
-#include "com/sun/star/configuration/InvalidBootstrapFileException.hpp"
-#include "com/sun/star/configuration/MissingBootstrapFileException.hpp"
-#include "com/sun/star/configuration/XTemplateContainer.hpp"
-#include "com/sun/star/configuration/XTemplateInstance.hpp"
-#include "com/sun/star/configuration/backend/AuthenticationFailedException.hpp"
-#include "com/sun/star/configuration/backend/BackendAccessException.hpp"
-#include "com/sun/star/configuration/backend/BackendSetupException.hpp"
-#include "com/sun/star/configuration/backend/CannotConnectException.hpp"
-#include "com/sun/star/configuration/backend/ComponentChangeEvent.hpp"
-#include "com/sun/star/configuration/backend/ConnectionLostException.hpp"
-#include "com/sun/star/configuration/backend/InsufficientAccessRightsException.hpp"
-#include "com/sun/star/configuration/backend/InvalidAuthenticationMechanismException.hpp"
-#include "com/sun/star/configuration/backend/MalformedDataException.hpp"
-#include "com/sun/star/configuration/backend/MergeRecoveryRequest.hpp"
-#include "com/sun/star/configuration/backend/NodeAttribute.hpp"
-#include "com/sun/star/configuration/backend/PropertyInfo.hpp"
-#include "com/sun/star/configuration/backend/SchemaAttribute.hpp"
-#include "com/sun/star/configuration/backend/StratumCreationException.hpp"
-#include "com/sun/star/configuration/backend/TemplateIdentifier.hpp"
-#include "com/sun/star/configuration/backend/XBackend.hpp"
-#include "com/sun/star/configuration/backend/XBackendChangesListener.hpp"
-#include "com/sun/star/configuration/backend/XBackendChangesNotifier.hpp"
-#include "com/sun/star/configuration/backend/XBackendEntities.hpp"
-#include "com/sun/star/configuration/backend/XCompositeLayer.hpp"
-#include "com/sun/star/configuration/backend/XLayer.hpp"
-#include "com/sun/star/configuration/backend/XLayerContentDescriber.hpp"
-#include "com/sun/star/configuration/backend/XLayerHandler.hpp"
-#include "com/sun/star/configuration/backend/XLayerImporter.hpp"
-#include "com/sun/star/configuration/backend/XMultiLayerStratum.hpp"
-#include "com/sun/star/configuration/backend/XSchema.hpp"
-#include "com/sun/star/configuration/backend/XSchemaHandler.hpp"
-#include "com/sun/star/configuration/backend/XSchemaSupplier.hpp"
-#include "com/sun/star/configuration/backend/XSingleLayerStratum.hpp"
-#include "com/sun/star/configuration/backend/XUpdatableLayer.hpp"
-#include "com/sun/star/configuration/backend/XUpdateHandler.hpp"
-#include "com/sun/star/configuration/backend/XVersionedSchemaSupplier.hpp"
-#include "com/sun/star/container/ElementExistException.hpp"
-#include "com/sun/star/container/NoSuchElementException.hpp"
-#include "com/sun/star/container/XChild.hpp"
-#include "com/sun/star/container/XContainer.hpp"
-#include "com/sun/star/container/XContainerListener.hpp"
-#include "com/sun/star/container/XContentEnumerationAccess.hpp"
-#include "com/sun/star/container/XEnumeration.hpp"
-#include "com/sun/star/container/XHierarchicalName.hpp"
-#include "com/sun/star/container/XHierarchicalNameAccess.hpp"
-#include "com/sun/star/container/XNameAccess.hpp"
-#include "com/sun/star/container/XNameContainer.hpp"
-#include "com/sun/star/container/XNameReplace.hpp"
-#include "com/sun/star/container/XNamed.hpp"
-#include "com/sun/star/io/BufferSizeExceededException.hpp"
-#include "com/sun/star/io/IOException.hpp"
-#include "com/sun/star/io/UnexpectedEOFException.hpp"
-#include "com/sun/star/io/WrongFormatException.hpp"
-#include "com/sun/star/io/XActiveDataControl.hpp"
-#include "com/sun/star/io/XActiveDataSink.hpp"
-#include "com/sun/star/io/XActiveDataSource.hpp"
-#include "com/sun/star/io/XDataExporter.hpp"
-#include "com/sun/star/io/XDataImporter.hpp"
-#include "com/sun/star/io/XDataInputStream.hpp"
-#include "com/sun/star/io/XDataOutputStream.hpp"
-#include "com/sun/star/io/XDataTransferEventListener.hpp"
-#include "com/sun/star/io/XInputStream.hpp"
-#include "com/sun/star/io/XOutputStream.hpp"
-#include "com/sun/star/lang/DisposedException.hpp"
-#include "com/sun/star/lang/IllegalAccessException.hpp"
-#include "com/sun/star/lang/IllegalArgumentException.hpp"
-#include "com/sun/star/lang/Locale.hpp"
-#include "com/sun/star/lang/NoSupportException.hpp"
-#include "com/sun/star/lang/NullPointerException.hpp"
-#include "com/sun/star/lang/ServiceNotRegisteredException.hpp"
-#include "com/sun/star/lang/WrappedTargetException.hpp"
-#include "com/sun/star/lang/WrappedTargetRuntimeException.hpp"
-#include "com/sun/star/lang/XComponent.hpp"
-#include "com/sun/star/lang/XEventListener.hpp"
-#include "com/sun/star/lang/XInitialization.hpp"
-#include "com/sun/star/lang/XLocalizable.hpp"
-#include "com/sun/star/lang/XMultiServiceFactory.hpp"
-#include "com/sun/star/lang/XServiceInfo.hpp"
-#include "com/sun/star/lang/XSingleComponentFactory.hpp"
-#include "com/sun/star/lang/XSingleServiceFactory.hpp"
-#include "com/sun/star/lang/XTypeProvider.hpp"
-#include "com/sun/star/lang/XUnoTunnel.hpp"
-#include "com/sun/star/registry/XRegistryKey.hpp"
-#include "com/sun/star/registry/XSimpleRegistry.hpp"
-#include "com/sun/star/script/FailReason.hpp"
-#include "com/sun/star/script/XTypeConverter.hpp"
-#include "com/sun/star/task/XInteractionAbort.hpp"
-#include "com/sun/star/task/XInteractionApprove.hpp"
-#include "com/sun/star/task/XInteractionDisapprove.hpp"
-#include "com/sun/star/task/XInteractionHandler.hpp"
-#include "com/sun/star/task/XInteractionRequest.hpp"
-#include "com/sun/star/task/XInteractionRetry.hpp"
-#include "com/sun/star/task/XJob.hpp"
-#include "com/sun/star/uno/Any.h"
-#include "com/sun/star/uno/Any.hxx"
-#include "com/sun/star/uno/Exception.hpp"
-#include "com/sun/star/uno/Reference.h"
-#include "com/sun/star/uno/Reference.hxx"
-#include "com/sun/star/uno/RuntimeException.hpp"
-#include "com/sun/star/uno/Sequence.h"
-#include "com/sun/star/uno/Sequence.hxx"
-#include "com/sun/star/uno/Type.hxx"
-#include "com/sun/star/uno/TypeClass.hpp"
-#include "com/sun/star/uno/XComponentContext.hpp"
-#include "com/sun/star/uno/XCurrentContext.hpp"
-#include "com/sun/star/uno/XInterface.hpp"
-#include "com/sun/star/util/XChangesBatch.hpp"
-#include "com/sun/star/util/XChangesListener.hpp"
-#include "com/sun/star/util/XChangesNotifier.hpp"
-#include "com/sun/star/util/XFlushable.hpp"
-#include "com/sun/star/util/XRefreshable.hpp"
-#include "com/sun/star/util/XStringEscape.hpp"
-#include "com/sun/star/util/XTimeStamped.hpp"
-#include "com/sun/star/util/logging/LogLevel.hpp"
-#include "com/sun/star/util/logging/XLogger.hpp"
-#include "com/sun/star/xml/sax/InputSource.hpp"
-#include "com/sun/star/xml/sax/SAXException.hpp"
-#include "com/sun/star/xml/sax/SAXParseException.hpp"
-#include "com/sun/star/xml/sax/XAttributeList.hpp"
-#include "com/sun/star/xml/sax/XDocumentHandler.hpp"
-#include "com/sun/star/xml/sax/XExtendedDocumentHandler.hpp"
-#include "com/sun/star/xml/sax/XParser.hpp"
-
-#include "comphelper/processfactory.hxx"
-#include "comphelper/propertycontainer.hxx"
-#include "comphelper/sequence.hxx"
-#include "comphelper/stl_types.hxx"
-
-#include "cppuhelper/bootstrap.hxx"
-#include "cppuhelper/component_context.hxx"
-#include "cppuhelper/exc_hlp.hxx"
-#include "cppuhelper/factory.hxx"
-#include "cppuhelper/implementationentry.hxx"
-#include "cppuhelper/interfacecontainer.hxx"
-#include "cppuhelper/propshlp.hxx"
-#include "cppuhelper/queryinterface.hxx"
-#include "cppuhelper/servicefactory.hxx"
-#include "cppuhelper/typeprovider.hxx"
-#include "cppuhelper/weak.hxx"
-
-#include "osl/conditn.hxx"
-#include "osl/diagnose.h"
-#include "osl/file.h"
-#include "osl/file.hxx"
-#include "osl/interlck.h"
-#include "osl/module.hxx"
-#include "osl/mutex.hxx"
-#include "osl/process.h"
-#include "osl/thread.h"
-#include "osl/time.h"
-
-#include "rtl/alloc.h"
-#include "rtl/bootstrap.h"
-#include "rtl/bootstrap.hxx"
-#include "rtl/logfile.hxx"
-#include "rtl/process.h"
-#include "rtl/ref.hxx"
-#include "rtl/strbuf.hxx"
-#include "rtl/string.h"
-#include "rtl/string.hxx"
-#include "rtl/ustrbuf.hxx"
-#include "rtl/ustring.h"
-#include "rtl/ustring.hxx"
-
-#include "sal/main.h"
-
-#include "salhelper/simplereferenceobject.hxx"
-
-#include "sys/timeb.h"
-
-#include "typelib/typedescription.hxx"
-
-#include "uno/any2.h"
-#include "uno/current_context.hxx"
-
-
-
-#include "vos/conditn.hxx"
-#include "vos/pipe.hxx"
-#include "vos/ref.hxx"
-#include "vos/refernce.hxx"
-#include "vos/socket.hxx"
-#include "vos/thread.hxx"
-#include "vos/timer.hxx"
-//---MARKER---
#endif
diff --git a/configmgr/prj/build.lst b/configmgr/prj/build.lst
index a3d93b598a..9fcccbc73b 100644
--- a/configmgr/prj/build.lst
+++ b/configmgr/prj/build.lst
@@ -1,18 +1,4 @@
-cg configmgr : BOOST:boost offapi comphelper cppuhelper salhelper tools vos NULL
-cg configmgr usr1 - all cg_mkout NULL
-cg configmgr\inc nmake - all cg_inc NULL
-cg configmgr\source\misc nmake - all cg_misc cg_inc NULL
-cg configmgr\source\data nmake - all cg_data cg_inc NULL
-cg configmgr\source\tree nmake - all cg_tree cg_inc NULL
-cg configmgr\source\treecache nmake - all cg_trcache cg_inc NULL
-cg configmgr\source\xml nmake - all cg_xml cg_inc NULL
-cg configmgr\source\backend nmake - all cg_backend cg_inc NULL
-cg configmgr\source\backendhelper nmake - all cg_backendhelper cg_inc NULL
-cg configmgr\source\api nmake - all cg_api cg_inc NULL
-cg configmgr\source\api2 nmake - all cg_api2 cg_inc NULL
-cg configmgr\source\treemgr nmake - all cg_treemgr cg_inc NULL
-cg configmgr\source\registry nmake - all cg_reg cg_inc NULL
-cg configmgr\source\platformbe nmake - all cg_platformbe cg_inc NULL
-cg configmgr\util nmake - all cg_util cg_platformbe cg_api cg_api2 cg_misc cg_reg cg_trcache cg_data cg_tree cg_treemgr cg_xml cg_backend cg_localbe NULL
-cg configmgr\source\localbe nmake - all cg_localbe cg_inc NULL
-
+cg configmgr : BOOST:boost comphelper cppu cppuhelper offuh sal salhelper stlport NULL
+cg configmgr\inc nmake - all cg_inc NULL
+cg configmgr\source nmake - all cg_source cg_inc NULL
+cg configmgr\qa\unoapi nmake - all cg_qa_unoapi NULL
diff --git a/configmgr/prj/d.lst b/configmgr/prj/d.lst
index 3f4a1d35a1..a9d91980b2 100644
--- a/configmgr/prj/d.lst
+++ b/configmgr/prj/d.lst
@@ -1,10 +1,8 @@
mkdir: %_DEST%\inc%_EXT%\configmgr
-..\%__SRC%\lib\behelper.uno.so %_DEST%\lib%_EXT%\behelper.uno.so
-..\%__SRC%\lib\configmgr*.uno.so %_DEST%\lib%_EXT%\configmgr*.uno.so
-..\%__SRC%\lib\sysmgr*.uno.so %_DEST%\lib%_EXT%\sysmgr*.uno.so
-..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib
-..\%__SRC%\bin\behelper*.dll %_DEST%\bin%_EXT%\behelper*.dll
-..\%__SRC%\bin\configmg*.dll %_DEST%\bin%_EXT%\configmg*.dll
-..\%__SRC%\bin\sysmgr*.dll %_DEST%\bin%_EXT%\sysmgr*.dll
-
-..\%__SRC%\misc\configmgr2.uno.xml %_DEST%\xml%_EXT%\configmgr2.uno.xml
+mkdir: %_DEST%\inc%_EXT%\configmgr\detail
+..\%__SRC%\bin\configmgr.dll %_DEST%\bin%_EXT%\configmgr.dll
+..\%__SRC%\lib\iconfigmgr.lib %_DEST%\lib%_EXT%\iconfigmgr.lib
+..\%__SRC%\lib\libconfigmgr.dylib %_DEST%\lib%_EXT%\libconfigmgr.dylib
+..\%__SRC%\lib\libconfigmgr.so %_DEST%\lib%_EXT%\libconfigmgr.so
+..\inc\configmgr\detail\configmgrdllapi.hxx %_DEST%\inc%_EXT%\configmgr\detail\configmgrdllapi.hxx
+..\inc\configmgr\update.hxx %_DEST%\inc%_EXT%\configmgr\update.hxx
diff --git a/configmgr/qa/unit/common.hxx b/configmgr/qa/unit/common.hxx
deleted file mode 100644
index 0e33eab7d0..0000000000
--- a/configmgr/qa/unit/common.hxx
+++ /dev/null
@@ -1,111 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "sal/config.h"
-#include <cstdlib>
-#include "com/sun/star/beans/NamedValue.hpp"
-#include "com/sun/star/beans/XPropertySet.hpp"
-#include "com/sun/star/beans/XPropertyState.hpp"
-#include "com/sun/star/lang/XComponent.hpp"
-#include "com/sun/star/lang/XMultiComponentFactory.hpp"
-#include "com/sun/star/lang/XMultiServiceFactory.hpp"
-#include "com/sun/star/container/XNameReplace.hpp"
-#include "com/sun/star/container/XHierarchicalNameAccess.hpp"
-#include "com/sun/star/util/XChangesBatch.hpp"
-#include "com/sun/star/uno/Any.hxx"
-#include "com/sun/star/uno/Reference.hxx"
-#include "com/sun/star/uno/XComponentContext.hpp"
-#include "cppuhelper/component_context.hxx"
-#include "cppuhelper/servicefactory.hxx"
-#include "testshl/simpleheader.hxx"
-#include "osl/file.hxx"
-#include "osl/thread.h"
-#include "osl/process.h"
-#include "rtl/string.h"
-#include "rtl/bootstrap.h"
-#include "rtl/ustring.h"
-#include "rtl/ustring.hxx"
-#include "sal/types.h"
-
-namespace css = com::sun::star;
-
-#define CATCH_FAIL(msg) \
- catch (const css::uno::Exception &e) { \
- t_print ("msg '%s'\n", rtl::OUStringToOString (e.Message, RTL_TEXTENCODING_UTF8).getStr()); \
- CPPUNIT_FAIL( msg ); \
- throw; \
- }
-
-class Magic
-{
- rtl::OUString maTempDir;
- public:
- Magic();
- ~Magic();
-};
-
-class Test: public CppUnit::TestFixture {
- Magic *mpMagic;
-public:
- // init
- virtual void setUp();
- virtual void tearDown();
-
- // helpers
- void normalizePathKey (rtl::OString &rPath, rtl::OString &rKey);
- css::uno::Reference< css::uno::XInterface > createView(const sal_Char *pNodepath, bool bUpdate);
- css::uno::Any getKey (const sal_Char *pPath, rtl::OUString aName);
- css::uno::Any getKey (const sal_Char *pPath, const sal_Char *pName)
- { return getKey (pPath, rtl::OUString::createFromAscii (pName)); }
- void setKey (const sal_Char *pPath, rtl::OUString aName, css::uno::Any a);
- void resetKey (const sal_Char *pPath, rtl::OUString aName);
-
- // tests
- void keyFetch();
- void keySet();
- void keyReset();
- void readCommands();
- void threadTests();
- void recursiveTests();
- void eventTests();
-
- CPPUNIT_TEST_SUITE(Test);
- CPPUNIT_TEST(keyFetch);
- CPPUNIT_TEST(keySet);
- CPPUNIT_TEST(keyReset);
- CPPUNIT_TEST(readCommands);
- CPPUNIT_TEST(threadTests);
- CPPUNIT_TEST(recursiveTests);
- CPPUNIT_TEST(eventTests);
- CPPUNIT_TEST_SUITE_END();
-
-private:
- css::uno::Reference< css::uno::XComponentContext > mxContext;
- css::uno::Reference< css::lang::XMultiServiceFactory > mxProvider;
-};
-
-void disposeComponent (const css::uno::Reference<css::uno::XInterface> &xComp);
diff --git a/configmgr/qa/unit/configmgrrc b/configmgr/qa/unit/configmgrrc
deleted file mode 100644
index b162e77c2e..0000000000
--- a/configmgr/qa/unit/configmgrrc
+++ /dev/null
@@ -1,22 +0,0 @@
-[Bootstrap]
-CFG_ServerType=uno
-BootstrapFile=$ORIGIN/bootstraprc
-VersionFile=$ORIGIN/versionrc
-UnoFile=$ORIGIN/unorc
-BaseInstallation=${$BootstrapFile:BaseInstallation}
-UserInstallation=${$BootstrapFile:UserInstallation}
-CFG_SchemaVersion=${$VersionFile:buildid}
-CFG_SchemaDataUrl=$BaseInstallation/schema
-CFG_DefaultLayerUrls=$BaseInstallation
-CFG_CacheDisposeDelay=900
-CFG_CacheDisposeInterval=60
-CFG_CacheWriteInterval=2
-CFG_UserLayerUrl=$UserInstallation
-CFG_CacheUrl=$BaseInstallation/cache
-CFG_DefaultLayerUrl=$BaseInstallation
-CFG_BackendService=com.sun.star.comp.configuration.backend.MultiStratumBackend
-CFG_SchemaSupplier=com.sun.star.comp.configuration.backend.LocalSchemaSupplier
-CFG_LocalDataSvc=com.sun.star.comp.configuration.backend.LocalStratum
-CFG_LocalModuleDataSvc=com.sun.star.comp.configuration.backend.LocalMultiStratum
-# CFG_Strata=${CFG_LocalDataSvc}:$CFG_DefaultLayerUrl;?com.sun.star.comp.configuration.backend.SystemIntegration:;${CFG_LocalDataSvc}:$CFG_UserLayerUrl
-CFG_Strata=${CFG_LocalDataSvc}:$CFG_DefaultLayerUrl;${CFG_LocalDataSvc}:$CFG_UserLayerUrl
diff --git a/configmgr/qa/unit/data/org/openoffice/UI/GenericCommands.xcu b/configmgr/qa/unit/data.xcd
index 6fbcec3946..506a82928e 100644
--- a/configmgr/qa/unit/data/org/openoffice/UI/GenericCommands.xcu
+++ b/configmgr/qa/unit/data.xcd
@@ -1,31 +1,150 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!--***********************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************ -->
-<!DOCTYPE oor:component-data SYSTEM "../../../../../component-update.dtd">
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+<oor:data xmlns:oor="http://openoffice.org/2001/registry">
+
+<oor:component-schema xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="Setup" oor:package="org.openoffice" xml:lang="en-US">
+ <info>
+ <author>mmeeks</author>
+ <desc >Setup prefs (for configmgr) and unit test schema bits.</desc>
+ </info>
+ <component>
+ <group oor:name="L10N">
+ <info>
+ <author>PB</author>
+ <desc>Specifies the installation locales.</desc>
+ </info>
+ <prop oor:name="ooLocale" oor:type="xs:string">
+ <info>
+ <author>PB</author>
+ <desc>Indicates the Office language selected by the user.</desc>
+ <label>Locale</label>
+ </info>
+ <value/>
+ </prop>
+ </group>
+ <group oor:name="Test">
+ <info>
+ <author>mmeeks</author>
+ <desc>Misc test pieces</desc>
+ </info>
+ <prop oor:name="ABoolean" oor:type="xs:boolean">
+ <info>
+ <author>mmeeks</author>
+ <desc>A boolean</desc>
+ <label>Boolean</label>
+ </info>
+ <value>false</value>
+ </prop>
+ <prop oor:name="AString" oor:type="xs:string">
+ <info>
+ <author>mmeeks</author>
+ <desc>A string</desc>
+ <label>String</label>
+ </info>
+ <value>Foo</value>
+ </prop>
+ </group>
+ </component>
+</oor:component-schema>
+
+<oor:component-schema xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="Commands" oor:package="org.openoffice.UI" xml:lang="en-US"> <info>
+ <author>CD</author>
+ <desc >Contains general information about ~ and rules, and about actions based on office commands.</desc>
+ </info>
+ <templates>
+ <group oor:name="LabelType">
+ <info>
+ <desc>Provides a mapping between commands and their textual representation on the user interface.</desc>
+ </info>
+ <prop oor:name="Label" oor:type="xs:string" oor:localized="true">
+ <info>
+ <desc>A localized text that describes the command or identifier. Can be used as a label inside a menu or as short tool tip help.</desc>
+ </info>
+ </prop>
+ <prop oor:name="ContextLabel" oor:type="xs:string" oor:localized="true">
+ <info>
+ <desc>A localized text that describes the identifier of a command in a structured menu. </desc>
+ </info>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <info>
+ <desc>
+ Additional information about a single command.
+ Bit 0 = Command has an image.
+ Bit 1 = Image must be mirrored (CTL/vertical text).
+ Bit 2 = Image must be rotated (CTL/vertical text).
+ </desc>
+ </info>
+ <value>0</value>
+ </prop>
+ </group>
+ </templates>
+ <component/>
+</oor:component-schema>
+
+<oor:component-schema xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="GenericCommands" oor:package="org.openoffice.UI" xml:lang="en-US">
+ <info>
+ <author>CD</author>
+ <desc >Contains general information about ~ and rules, and about actions based on office commands.</desc>
+ </info>
+ <import oor:component="org.openoffice.UI.Commands"/>
+ <uses oor:component="org.openoffice.UI.Commands"/>
+ <templates/>
+ <component>
+ <group oor:name="UserInterface">
+ <info>
+ <desc>Contains user interface data for Office commands and identifiers that are used by the user interface."</desc>
+ </info>
+ <set oor:name="Commands" oor:node-type="LabelType" oor:component="org.openoffice.UI.Commands">
+ <info>
+ <desc>Contains label text for Office commands and identifiers that are used by the user interface."</desc>
+ </info>
+ </set>
+ </group>
+ </component>
+</oor:component-schema>
+
+<oor:component-data oor:name="Setup" oor:package="org.openoffice" xmlns:oor="http://openoffice.org/2001/registry" xmlns:install="http://openoffice.org/2004/installation" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <node oor:name="L10N">
+ <prop oor:name="ooLocale" oor:type="xs:string">
+ <value>en-US</value>
+ </prop>
+ </node>
+ <node oor:name="Test">
+ <prop oor:name="ABoolean" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="AString" oor:type="xs:string">
+ <value>Foo</value>
+ </prop>
+ </node>
+</oor:component-data>
+
<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="GenericCommands" oor:package="org.openoffice.UI">
<node oor:name="UserInterface">
<node oor:name="Commands">
@@ -5067,3 +5186,5 @@
</node>
</node>
</oor:component-data>
+
+</oor:data>
diff --git a/configmgr/qa/unit/data/org/openoffice/Setup.xcu b/configmgr/qa/unit/data/org/openoffice/Setup.xcu
deleted file mode 100644
index 0578bf6691..0000000000
--- a/configmgr/qa/unit/data/org/openoffice/Setup.xcu
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--***********************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************ -->
-<!DOCTYPE oor:component-data SYSTEM "../../../component-update.dtd">
-<oor:component-data oor:name="Setup" oor:package="org.openoffice" xmlns:oor="http://openoffice.org/2001/registry" xmlns:install="http://openoffice.org/2004/installation" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <node oor:name="L10N">
- <prop oor:name="ooLocale" oor:type="xs:string">
- <value>en-US</value>
- </prop>
- </node>
- <node oor:name="Test">
- <prop oor:name="ABoolean" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- <prop oor:name="AString" oor:type="xs:string">
- <value>Foo</value>
- </prop>
- </node>
-</oor:component-data>
diff --git a/configmgr/qa/unit/export.map b/configmgr/qa/unit/export.map
deleted file mode 100644
index 4ca70fa854..0000000000
--- a/configmgr/qa/unit/export.map
+++ /dev/null
@@ -1,7 +0,0 @@
-UDK_3.0 {
- global:
- registerAllTestFunction;
-
- local:
- *;
-};
diff --git a/configmgr/qa/unit/makefile.mk b/configmgr/qa/unit/makefile.mk
index 39f73183a9..25035d7e9d 100644
--- a/configmgr/qa/unit/makefile.mk
+++ b/configmgr/qa/unit/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -23,37 +23,71 @@
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
-#*************************************************************************
+#***********************************************************************/
-PRJ := ..$/..
-PRJNAME := configmgr
-TARGET := qa_unit
+PRJ = ../..
+PRJNAME = configmgr
+TARGET = unit
-ENABLE_EXCEPTIONS := TRUE
+ENABLE_EXCEPTIONS = TRUE
.INCLUDE: settings.mk
-DLLPRE = # no leading "lib" on .so files
+CFLAGSCXX += $(CPPUNIT_CFLAGS)
-SHL1TARGET = $(TARGET)
-SHL1OBJS = $(SLO)$/performance.obj $(SLO)$/threading.obj $(SLO)$/ubootstrap.obj
-SHL1STDLIBS = $(CPPULIB) $(CPPUHELPERLIB) $(CPPUNITLIB) $(TESTSHL2LIB) $(SALLIB)
-SHL1VERSIONMAP = export.map
-SHL1IMPLIB = i$(SHL1TARGET)
-DEF1NAME = $(SHL1TARGET)
+SLOFILES = $(SLO)/test.obj
-SLOFILES = $(SHL1OBJS)
+SHL1OBJS = $(SLOFILES)
+SHL1STDLIBS = \
+ $(CPPUHELPERLIB) \
+ $(CPPULIB) \
+ $(CPPUNITLIB) \
+ $(SALLIB) \
+ $(TESTSHL2LIB)
+SHL1TARGET = unit
+SHL1VERSIONMAP = version.map
+DEF1NAME = $(SHL1TARGET)
.INCLUDE: target.mk
-ALLTAR: test
+ALLTAR: TEST
+
+.IF "$(OS)" == "OS2" || "$(OS)" == "WNT"
+MY_INI = .ini
+.ELSE
+MY_INI = rc
+.ENDIF
-$(MISC)$/$(TARGET).rdb .ERRREMOVE:
- $(COPY) $(SOLARBINDIR)$/types.rdb $@
- $(REGCOMP) -register -r $@ -c $(subst,$/,/ $(DLLDEST)$/configmgr2.uno$(DLLPOST))
- $(REGCOMP) -register -r $@ -c $(subst,$/,/ $(SOLARLIBDIR)/sax.uno$(DLLPOST))
- $(REGCOMP) -register -r $@ -c $(subst,$/,/ $(SOLARLIBDIR)/stocservices.uno$(DLLPOST))
- $(REGCOMP) -register -r $@ -c $(subst,$/,/ $(SOLARLIBDIR)/streams.uno$(DLLPOST))
+$(MISC)/unit.rdb .ERRREMOVE:
+ cp $(SOLARBINDIR)/types.rdb $@
+ $(REGCOMP) -register -r $@ -c $(DLLDEST)/$(DLLPRE)configmgr$(DLLPOST)
-test .PHONY: $(SHL1TARGETN) $(MISC)$/$(TARGET).rdb
- $(AUGMENT_LIBRARY_PATH) testshl2 $(SHL1TARGETN) -forward "$(MISC)$/$(TARGET).rdb#$(PWD)$/$(MISC)$/$(TARGET).registry"
+TEST .PHONY: $(SHL1TARGETN) $(MISC)/unit.rdb
+ rm -rf $(MISC)/unitdata
+ mkdir $(MISC)/unitdata
+ cp urebootstrap.ini $(MISC)/unitdata
+ mkdir $(MISC)/unitdata/basis
+ mkdir $(MISC)/unitdata/basis/program
+ echo '[Bootstrap]' > $(MISC)/unitdata/basis/program/uno$(MY_INI)
+ echo 'UNO_SHARED_PACKAGES_CACHE = $$OOO_BASE_DIR' \
+ >> $(MISC)/unitdata/basis/program/uno$(MY_INI)
+ echo 'UNO_USER_PACKAGES_CACHE =' \
+ '$${$$BRAND_BASE_DIR/program/bootstrap$(MY_INI):UserInstallation}' \
+ >> $(MISC)/unitdata/basis/program/uno$(MY_INI)
+ mkdir $(MISC)/unitdata/basis/share
+ mkdir $(MISC)/unitdata/basis/share/registry
+ cp data.xcd $(MISC)/unitdata/basis/share/registry
+ mkdir $(MISC)/unitdata/brand
+ mkdir $(MISC)/unitdata/brand/program
+ echo '[Bootstrap]' > $(MISC)/unitdata/brand/program/bootstrap$(MY_INI)
+ echo 'UserInstallation = $$ORIGIN/../../user' \
+ >> $(MISC)/unitdata/brand/program/bootstrap$(MY_INI)
+.IF "$(USE_SHELL)" == "bash"
+ export \
+ URE_BOOTSTRAP=vnd.sun.star.pathname:$(MISC)/unitdata/urebootstrap.ini \
+ && $(TESTSHL2) $(SHL1TARGETN) -forward $(MISC)/unit.rdb
+.ELSE
+ setenv \
+ URE_BOOTSTRAP vnd.sun.star.pathname:$(MISC)/unitdata/urebootstrap.ini \
+ && $(TESTSHL2) $(SHL1TARGETN) -forward $(MISC)/unit.rdb
+.ENDIF
diff --git a/connectivity/util/delzip b/configmgr/qa/unit/no_localization
index e69de29bb2..e69de29bb2 100755..100644
--- a/connectivity/util/delzip
+++ b/configmgr/qa/unit/no_localization
diff --git a/configmgr/qa/unit/performance.cxx b/configmgr/qa/unit/performance.cxx
deleted file mode 100644
index cd561606d9..0000000000
--- a/configmgr/qa/unit/performance.cxx
+++ /dev/null
@@ -1,268 +0,0 @@
-// To debug me use:
-// $ export ENVCFGFLAGS='-me -ti -tw -tp -td'
-
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "common.hxx"
-
-void Test::setUp()
-{
- mpMagic = new Magic();
-
- char const * f = getForwardString();
- rtl::OUString args(
- f, rtl_str_getLength(f), osl_getThreadTextEncoding());
- //TODO: handle conversion failure
- sal_Int32 i = args.indexOf('#');
- if (i < 0)
- std::abort();
-
- rtl::OUString rdb(args.copy(0, i));
- rtl::OUString regpath(args.copy(i + 1));
- rtl::OUString regurl;
- if (osl::FileBase::getFileURLFromSystemPath(regpath, regurl) !=
- osl::FileBase::E_None)
- std::abort();
-
- css::uno::Reference< css::beans::XPropertySet > factory(
- cppu::createRegistryServiceFactory(rdb), css::uno::UNO_QUERY_THROW);
- css::uno::Reference< css::uno::XComponentContext > context(
- factory->getPropertyValue(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext"))),
- css::uno::UNO_QUERY_THROW);
- cppu::ContextEntry_Init entry(
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "/modules/com.sun.star.configuration/bootstrap/Strata")),
- css::uno::makeAny(
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.configuration.backend.LocalStratum:"))
- + regurl));
- mxContext = cppu::createComponentContext(&entry, 1, context);
-
- CPPUNIT_ASSERT_MESSAGE ("component context is valid", mxContext.is());
-
- try {
- mxProvider = css::uno::Reference< css::lang::XMultiServiceFactory >(
- (css::uno::Reference< css::lang::XMultiComponentFactory >(
- mxContext->getServiceManager(), css::uno::UNO_QUERY_THROW)->
- createInstanceWithContext(
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.ConfigurationProvider")),
- mxContext)),
- css::uno::UNO_QUERY_THROW);
-
- } catch (css::uno::Exception&e) {
- CPPUNIT_FAIL( "exception creating provider" );
- throw;
- }
-}
-
-css::uno::Reference< css::uno::XInterface >
-Test::createView(const sal_Char *pNodepath, bool bUpdate)
-{
- rtl::OUString aNodePath = rtl::OUString::createFromAscii(pNodepath);
- static const rtl::OUString kInfoViewService(
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationAccess")) ;
- static const rtl::OUString kUpdateViewService(
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationUpdateAccess")) ;
- static const rtl::OUString kNodepath(RTL_CONSTASCII_USTRINGPARAM("nodepath")) ;
- static const rtl::OUString kAsync(RTL_CONSTASCII_USTRINGPARAM("EnableAsync")) ;
-
- const rtl::OUString & kViewService = bUpdate ? kUpdateViewService : kInfoViewService;
- css::uno::Sequence< css::uno::Any > aViewArgs(2);
- aViewArgs[0] <<= css::beans::NamedValue( kNodepath, css::uno::makeAny(aNodePath) );
- aViewArgs[1] <<= css::beans::NamedValue( kAsync, css::uno::makeAny(sal_False) );
-
- css::uno::Reference< css::uno::XInterface > xView(
- mxProvider->createInstanceWithArguments( kViewService, aViewArgs ) );
- return xView;
-}
-
-void disposeComponent (const css::uno::Reference<css::uno::XInterface> &xComp)
-{
- css::uno::Reference< css::lang::XComponent >(
- xComp, css::uno::UNO_QUERY_THROW)->dispose();
-}
-
-void Test::tearDown()
-{
- disposeComponent (mxProvider);
- disposeComponent (mxContext);
-
- delete mpMagic;
-}
-
-void Test::normalizePathKey (rtl::OString &rPath, rtl::OString &rKey)
-{
- sal_Int32 idx = rKey.lastIndexOf("/");
- if (idx > 0) {
- rPath += "/";
- rPath += rKey.copy (0, idx);
- rKey = rKey.copy (idx + 1);
-// t_print ("write to '%s' '%s'\n", (const sal_Char *)rPath,
-// (const sal_Char *)rKey);
- }
-}
-
-css::uno::Any Test::getKey (const sal_Char *pPath, rtl::OUString aName)
-{
- css::uno::Reference< css::container::XHierarchicalNameAccess > xNameAccess(
- createView(pPath, false), css::uno::UNO_QUERY_THROW);
- css::uno::Any aVal;
- aVal = xNameAccess->getByHierarchicalName (aName);
- disposeComponent (xNameAccess);
- return aVal;
-}
-
-void Test::setKey (const sal_Char *pPath, rtl::OUString aName, css::uno::Any a)
-{
- css::uno::Reference< css::util::XChangesBatch > xAppView;
-
- xAppView = css::uno::Reference< css::util::XChangesBatch > (
- createView(pPath, true), css::uno::UNO_QUERY_THROW );
- css::uno::Reference< css::container::XNameReplace > xSettings(xAppView, css::uno::UNO_QUERY_THROW);
- rtl::OUString aStr;
-
- // set key
- xSettings->replaceByName(aName, a);
- xAppView->commitChanges();
-
- disposeComponent(xAppView);
-}
-
-void Test::resetKey (const sal_Char *pPath, rtl::OUString aName)
-{
- css::uno::Reference< css::util::XChangesBatch > xAppView;
-
- // reset to default
- xAppView = css::uno::Reference< css::util::XChangesBatch > ( createView(pPath, true), css::uno::UNO_QUERY_THROW );
- css::uno::Reference< css::container::XNameReplace > xSettings(xAppView, css::uno::UNO_QUERY_THROW);
-
- css::uno::Reference< css::beans::XPropertyState > xSettingsState(xSettings, css::uno::UNO_QUERY);
- xSettingsState->setPropertyToDefault(aName);
- xAppView->commitChanges();
-
- disposeComponent(xAppView);
-}
-
-void Test::keyFetch()
-{
- try {
- rtl::OUString aStr;
- if (!(getKey ("/org.openoffice.Setup", "L10N/ooLocale") >>= aStr))
- CPPUNIT_FAIL("to fetch key");
- if (!(getKey ("/org.openoffice.Setup", "Test/AString") >>= aStr))
- CPPUNIT_FAIL("to fetch key");
- } CATCH_FAIL ("fetching key")
-}
-
-void Test::keySet()
-{
- try {
- setKey ("/org.openoffice.Setup/Test",
- rtl::OUString::createFromAscii("AString"),
- css::uno::makeAny (rtl::OUString::createFromAscii("baa")));
-
- // check value
- rtl::OUString aStr;
- if (!(getKey ("/org.openoffice.Setup/Test", "AString") >>= aStr))
- CPPUNIT_FAIL("to fetch key");
-
- CPPUNIT_ASSERT_MESSAGE ("check set value valid", aStr.equalsAscii("baa"));
- } CATCH_FAIL ("exception setting keys" )
-}
-
-void Test::keyReset()
-{
- try {
- resetKey ("/org.openoffice.Setup/Test",
- rtl::OUString::createFromAscii("AString"));
-
- // check value
- rtl::OUString aStr;
- if (!(getKey ("/org.openoffice.Setup/Test", "AString") >>= aStr))
- CPPUNIT_FAIL("to fetch key");
-
- CPPUNIT_ASSERT_MESSAGE ("check default value valid",
- aStr == rtl::OUString::createFromAscii("Foo"));
- } CATCH_FAIL ("exception setting keys" )
-}
-
-// This simulates the framework UI description code paths
-void Test::readCommands()
-{
- rtl::OUString aPropUILabel( RTL_CONSTASCII_USTRINGPARAM( "Label" ));
- rtl::OUString aPropUIContextLabel( RTL_CONSTASCII_USTRINGPARAM( "ContextLabel" ));
- rtl::OUString aPropProperties( RTL_CONSTASCII_USTRINGPARAM( "Properties" ));
-
- try {
- css::uno::Reference< css::container::XNameAccess > xNameAccess (
- createView("/org.openoffice.UI.GenericCommands/UserInterface/Commands", false),
- css::uno::UNO_QUERY_THROW);
-
- CPPUNIT_ASSERT_MESSAGE ("fetched UI generic commands", xNameAccess.is());
-
- css::uno::Any a;
- css::uno::Sequence< rtl::OUString > aNameSeq = xNameAccess->getElementNames();
-
- CPPUNIT_ASSERT_MESSAGE ("right element / sequence", aNameSeq.getLength() == 696);
- sal_uInt32 end, start = osl_getGlobalTimer();
- for ( sal_Int32 j = 0; j < 8; j++ )
- {
- for ( sal_Int32 i = 0; i < aNameSeq.getLength(); i++ )
- {
- try
- {
- {
- css::uno::Reference< css::container::XNameAccess > xChildNameAccess;
- // This is the slow bit ! ...
- // Creating the @#$@#$ing XNameAccess object [ 650 times ]
- // which we then use to 'getByName' etc.
- a = xNameAccess->getByName( aNameSeq[i] );
- if ( a >>= xChildNameAccess )
- {
- a = xChildNameAccess->getByName( aPropUILabel );
- a = xChildNameAccess->getByName( aPropUIContextLabel );
- a = xChildNameAccess->getByName( aPropProperties );
- }
- }
- } CATCH_FAIL( "fetching keys" );
- }
- }
- end = osl_getGlobalTimer();
- t_print ("Reading elements took %d ms\n", (int)(end-start));
- disposeComponent (xNameAccess);
- } CATCH_FAIL( "accessing commands" );
-}
-
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(Test, "alltests");
-
-NOADDITIONAL;
diff --git a/configmgr/qa/unit/schema/org/openoffice/Setup.xcs b/configmgr/qa/unit/schema/org/openoffice/Setup.xcs
deleted file mode 100644
index 990e424707..0000000000
--- a/configmgr/qa/unit/schema/org/openoffice/Setup.xcs
+++ /dev/null
@@ -1,72 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--***********************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************ -->
-<!DOCTYPE oor:component-schema SYSTEM "../../../component-schema.dtd">
-<oor:component-schema xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="Setup" oor:package="org.openoffice" xml:lang="en-US">
- <info>
- <author>mmeeks</author>
- <desc >Setup prefs (for configmgr) and unit test schema bits.</desc>
- </info>
- <component>
- <group oor:name="L10N">
- <info>
- <author>PB</author>
- <desc>Specifies the installation locales.</desc>
- </info>
- <prop oor:name="ooLocale" oor:type="xs:string">
- <info>
- <author>PB</author>
- <desc>Indicates the Office language selected by the user.</desc>
- <label>Locale</label>
- </info>
- <value/>
- </prop>
- </group>
- <group oor:name="Test">
- <info>
- <author>mmeeks</author>
- <desc>Misc test pieces</desc>
- </info>
- <prop oor:name="ABoolean" oor:type="xs:boolean">
- <info>
- <author>mmeeks</author>
- <desc>A boolean</desc>
- <label>Boolean</label>
- </info>
- <value>false</value>
- </prop>
- <prop oor:name="AString" oor:type="xs:string">
- <info>
- <author>mmeeks</author>
- <desc>A string</desc>
- <label>String</label>
- </info>
- <value>Foo</value>
- </prop>
- </group>
- </component>
-</oor:component-schema>
diff --git a/configmgr/qa/unit/schema/org/openoffice/UI/Commands.xcs b/configmgr/qa/unit/schema/org/openoffice/UI/Commands.xcs
deleted file mode 100644
index 35f365aa71..0000000000
--- a/configmgr/qa/unit/schema/org/openoffice/UI/Commands.xcs
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--***********************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************ -->
-<!DOCTYPE oor:component-schema SYSTEM "../../../../../component-schema.dtd">
-<oor:component-schema xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="Commands" oor:package="org.openoffice.UI" xml:lang="en-US"> <info>
- <author>CD</author>
- <desc >Contains general information about ~ and rules, and about actions based on office commands.</desc>
- </info>
- <templates>
- <group oor:name="LabelType">
- <info>
- <desc>Provides a mapping between commands and their textual representation on the user interface.</desc>
- </info>
- <prop oor:name="Label" oor:type="xs:string" oor:localized="true">
- <info>
- <desc>A localized text that describes the command or identifier. Can be used as a label inside a menu or as short tool tip help.</desc>
- </info>
- </prop>
- <prop oor:name="ContextLabel" oor:type="xs:string" oor:localized="true">
- <info>
- <desc>A localized text that describes the identifier of a command in a structured menu. </desc>
- </info>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <info>
- <desc>
- Additional information about a single command.
- Bit 0 = Command has an image.
- Bit 1 = Image must be mirrored (CTL/vertical text).
- Bit 2 = Image must be rotated (CTL/vertical text).
- </desc>
- </info>
- <value>0</value>
- </prop>
- </group>
- </templates>
- <component/>
-</oor:component-schema>
diff --git a/configmgr/qa/unit/schema/org/openoffice/UI/GenericCommands.xcs b/configmgr/qa/unit/schema/org/openoffice/UI/GenericCommands.xcs
deleted file mode 100644
index dcfbe38abb..0000000000
--- a/configmgr/qa/unit/schema/org/openoffice/UI/GenericCommands.xcs
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--***********************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************ -->
-<!DOCTYPE oor:component-schema SYSTEM "../../../../../component-schema.dtd">
-<oor:component-schema xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="GenericCommands" oor:package="org.openoffice.UI" xml:lang="en-US">
- <info>
- <author>CD</author>
- <desc >Contains general information about ~ and rules, and about actions based on office commands.</desc>
- </info>
- <import oor:component="org.openoffice.UI.Commands"/>
- <uses oor:component="org.openoffice.UI.Commands"/>
- <templates/>
- <component>
- <group oor:name="UserInterface">
- <info>
- <desc>Contains user interface data for Office commands and identifiers that are used by the user interface."</desc>
- </info>
- <set oor:name="Commands" oor:node-type="LabelType" oor:component="org.openoffice.UI.Commands">
- <info>
- <desc>Contains label text for Office commands and identifiers that are used by the user interface."</desc>
- </info>
- </set>
- </group>
- </component>
-</oor:component-schema>
diff --git a/configmgr/qa/unit/test.cxx b/configmgr/qa/unit/test.cxx
new file mode 100644
index 0000000000..8e5e873103
--- /dev/null
+++ b/configmgr/qa/unit/test.cxx
@@ -0,0 +1,678 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include <cstddef>
+
+#include "com/sun/star/beans/NamedValue.hpp"
+#include "com/sun/star/beans/PropertyChangeEvent.hpp"
+#include "com/sun/star/beans/XPropertyChangeListener.hpp"
+#include "com/sun/star/beans/XPropertySet.hpp"
+#include "com/sun/star/beans/XPropertyState.hpp"
+#include "com/sun/star/container/XHierarchicalNameAccess.hpp"
+#include "com/sun/star/container/XNameReplace.hpp"
+#include "com/sun/star/container/XNamed.hpp"
+#include "com/sun/star/lang/EventObject.hpp"
+#include "com/sun/star/lang/XComponent.hpp"
+#include "com/sun/star/lang/XMultiServiceFactory.hpp"
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "com/sun/star/util/XChangesBatch.hpp"
+#include "cppuhelper/implbase1.hxx"
+#include "cppuhelper/servicefactory.hxx"
+#include "osl/conditn.hxx"
+#include "osl/thread.h"
+#include "osl/thread.hxx"
+#include "osl/time.h"
+#include "rtl/ref.hxx"
+#include "rtl/string.h"
+#include "rtl/textcvt.h"
+#include "rtl/ustrbuf.hxx"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+#include "testshl/simpleheader.hxx"
+
+namespace {
+
+namespace css = com::sun::star;
+
+void normalize(
+ rtl::OUString const & path, rtl::OUString const & relative,
+ rtl::OUString * normalizedPath, rtl::OUString * name)
+{
+ sal_Int32 i = relative.lastIndexOf('/');
+ if (i == -1) {
+ *normalizedPath = path;
+ *name = relative;
+ } else {
+ rtl::OUStringBuffer buf(path);
+ buf.append(sal_Unicode('/'));
+ buf.append(relative.copy(0, i));
+ *normalizedPath = buf.makeStringAndClear();
+ *name = relative.copy(i + 1);
+ }
+}
+
+class Test: public CppUnit::TestFixture {
+public:
+ virtual void setUp();
+
+ virtual void tearDown();
+
+ void testKeyFetch();
+
+ void testKeySet();
+
+ void testKeyReset();
+
+ void testSetSetMemberName();
+
+ void testReadCommands();
+
+ void testThreads();
+
+ void testRecursive();
+
+ void testCrossThreads();
+
+ css::uno::Any getKey(
+ rtl::OUString const & path, rtl::OUString const & relative) const;
+
+ void setKey(
+ rtl::OUString const & path, rtl::OUString const & name,
+ css::uno::Any const & value) const;
+
+ bool resetKey(rtl::OUString const & path, rtl::OUString const & name) const;
+
+ css::uno::Reference< css::uno::XInterface > createViewAccess(
+ rtl::OUString const & path) const;
+
+ css::uno::Reference< css::uno::XInterface > createUpdateAccess(
+ rtl::OUString const & path) const;
+
+ CPPUNIT_TEST_SUITE(Test);
+ CPPUNIT_TEST(testKeyFetch);
+ CPPUNIT_TEST(testKeySet);
+ CPPUNIT_TEST(testKeyReset);
+ CPPUNIT_TEST(testSetSetMemberName);
+ CPPUNIT_TEST(testReadCommands);
+ CPPUNIT_TEST(testThreads);
+ CPPUNIT_TEST(testRecursive);
+ CPPUNIT_TEST(testCrossThreads);
+ CPPUNIT_TEST_SUITE_END();
+
+private:
+ css::uno::Reference< css::uno::XComponentContext > context_;
+ css::uno::Reference< css::lang::XMultiServiceFactory > provider_;
+};
+
+class TestThread: public osl::Thread {
+public:
+ TestThread(osl::Condition & stop);
+
+ bool getSuccess() const;
+
+protected:
+ virtual bool iteration() = 0;
+
+private:
+ virtual void SAL_CALL run();
+
+ osl::Condition & stop_;
+ bool success_;
+};
+
+TestThread::TestThread(
+ osl::Condition & stop):
+ stop_(stop), success_(true)
+{}
+
+bool TestThread::getSuccess() const {
+ return success_;
+}
+
+void TestThread::run() {
+ try {
+ while (!stop_.check()) {
+ if (!iteration()) {
+ success_ = false;
+ }
+ }
+ } catch (...) {
+ success_ = false;
+ }
+}
+
+class ReaderThread: public TestThread {
+public:
+ ReaderThread(
+ osl::Condition & stop, Test const & test, rtl::OUString const & path,
+ rtl::OUString const & relative);
+
+private:
+ virtual bool iteration();
+
+ Test const & test_;
+ rtl::OUString path_;
+ rtl::OUString relative_;
+};
+
+ReaderThread::ReaderThread(
+ osl::Condition & stop, Test const & test, rtl::OUString const & path,
+ rtl::OUString const & relative):
+ TestThread(stop), test_(test), path_(path), relative_(relative)
+{
+ create();
+}
+
+bool ReaderThread::iteration() {
+ return test_.getKey(path_, relative_).hasValue();
+}
+
+class WriterThread: public TestThread {
+public:
+ WriterThread(
+ osl::Condition & stop, Test const & test, rtl::OUString const & path,
+ rtl::OUString const & relative);
+
+private:
+ virtual bool iteration();
+
+ Test const & test_;
+ rtl::OUString path_;
+ rtl::OUString name_;
+ std::size_t index_;
+};
+
+WriterThread::WriterThread(
+ osl::Condition & stop, Test const & test, rtl::OUString const & path,
+ rtl::OUString const & relative):
+ TestThread(stop), test_(test), index_(0)
+{
+ normalize(path, relative, &path_, &name_);
+ create();
+}
+
+bool WriterThread::iteration() {
+ rtl::OUString options[] = {
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("fish")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("chips")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("kippers")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bloaters")) };
+ test_.setKey(path_, name_, css::uno::makeAny(options[index_]));
+ index_ = (index_ + 1) % (sizeof options / sizeof (rtl::OUString));
+ return true;
+}
+
+class RecursiveTest:
+ public cppu::WeakImplHelper1< css::beans::XPropertyChangeListener >
+{
+public:
+ RecursiveTest(Test const & theTest, int count, bool * destroyed);
+
+ void test();
+
+protected:
+ virtual ~RecursiveTest();
+
+ virtual void step() const = 0;
+
+ Test const & test_;
+
+private:
+ virtual void SAL_CALL disposing(css::lang::EventObject const &)
+ throw (css::uno::RuntimeException);
+
+ virtual void SAL_CALL propertyChange(
+ css::beans::PropertyChangeEvent const &)
+ throw (css::uno::RuntimeException);
+
+ int count_;
+ bool * destroyed_;
+ css::uno::Reference< css::beans::XPropertySet > properties_;
+};
+
+RecursiveTest::RecursiveTest(
+ Test const & theTest, int count, bool * destroyed):
+ test_(theTest), count_(count), destroyed_(destroyed)
+{}
+
+void RecursiveTest::test() {
+ properties_ = css::uno::Reference< css::beans::XPropertySet >(
+ test_.createUpdateAccess(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "/org.openoffice.UI.GenericCommands/UserInterface/Commands/"
+ "dotuno:WebHtml"))),
+ css::uno::UNO_QUERY_THROW);
+ properties_->addPropertyChangeListener(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Label")), this);
+ step();
+ CPPUNIT_ASSERT(count_ == 0);
+ css::uno::Reference< css::lang::XComponent >(
+ properties_, css::uno::UNO_QUERY_THROW)->dispose();
+}
+
+RecursiveTest::~RecursiveTest() {
+ *destroyed_ = true;
+}
+
+void RecursiveTest::disposing(css::lang::EventObject const & Source)
+ throw (css::uno::RuntimeException)
+{
+ CPPUNIT_ASSERT(properties_.is() && Source.Source == properties_);
+ properties_.clear();
+}
+
+void RecursiveTest::propertyChange(css::beans::PropertyChangeEvent const & evt)
+ throw (css::uno::RuntimeException)
+{
+ CPPUNIT_ASSERT(
+ evt.Source == properties_ &&
+ evt.PropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Label")));
+ if (count_ > 0) {
+ --count_;
+ step();
+ }
+}
+
+class SimpleRecursiveTest: public RecursiveTest {
+public:
+ SimpleRecursiveTest(Test const & theTest, int count, bool * destroyed);
+
+private:
+ virtual void step() const;
+};
+
+SimpleRecursiveTest::SimpleRecursiveTest(
+ Test const & theTest, int count, bool * destroyed):
+ RecursiveTest(theTest, count, destroyed)
+{}
+
+void SimpleRecursiveTest::step() const {
+ test_.setKey(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "/org.openoffice.UI.GenericCommands/UserInterface/Commands/"
+ "dotuno:WebHtml")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Label")),
+ css::uno::makeAny(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("step"))));
+}
+
+class CrossThreadTest: public RecursiveTest {
+public:
+ CrossThreadTest(Test const & theTest, int count, bool * destroyed);
+
+private:
+ virtual void step() const;
+};
+
+CrossThreadTest::CrossThreadTest(
+ Test const & theTest, int count, bool * destroyed):
+ RecursiveTest(theTest, count, destroyed)
+{}
+
+void CrossThreadTest::step() const {
+ osl::Condition stop;
+ stop.set();
+ WriterThread(
+ stop, test_,
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "/org.openoffice.UI.GenericCommands/UserInterface/Commands/"
+ "dotuno:WebHtml")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Label"))).join();
+ test_.resetKey(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "/org.openoffice.UI.GenericCommands/UserInterface/Commands/"
+ "dotuno:WebHtml")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Label")));
+}
+
+void Test::setUp() {
+ char const * forward = getForwardString();
+ rtl_uString * registry = 0;
+ CPPUNIT_ASSERT(
+ rtl_convertStringToUString(
+ &registry, forward, rtl_str_getLength(forward),
+ osl_getThreadTextEncoding(),
+ (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR |
+ RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR |
+ RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR)));
+ context_ = css::uno::Reference< css::uno::XComponentContext >(
+ css::uno::Reference< css::beans::XPropertySet >(
+ cppu::createRegistryServiceFactory(
+ rtl::OUString(registry, SAL_NO_ACQUIRE)),
+ css::uno::UNO_QUERY_THROW)->getPropertyValue(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext"))),
+ css::uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT(
+ context_->getValueByName(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "/singletons/"
+ "com.sun.star.configuration.theDefaultProvider"))) >>=
+ provider_);
+}
+
+void Test::tearDown() {
+ css::uno::Reference< css::lang::XComponent >(
+ context_, css::uno::UNO_QUERY_THROW)->dispose();
+}
+
+void Test::testKeyFetch() {
+ rtl::OUString s;
+ CPPUNIT_ASSERT(
+ getKey(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Setup")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("L10N/ooLocale"))) >>=
+ s);
+ CPPUNIT_ASSERT(
+ getKey(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Setup")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Test/AString"))) >>=
+ s);
+}
+
+void Test::testKeySet() {
+ setKey(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Setup/Test")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AString")),
+ css::uno::makeAny(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("baa"))));
+ rtl::OUString s;
+ CPPUNIT_ASSERT(
+ getKey(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Setup/Test")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AString"))) >>=
+ s);
+ CPPUNIT_ASSERT(s.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("baa")));
+}
+
+void Test::testKeyReset() {
+ if (resetKey(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Setup/Test")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AString"))))
+ {
+ rtl::OUString s;
+ CPPUNIT_ASSERT(
+ getKey(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Setup/Test")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AString"))) >>=
+ s);
+ CPPUNIT_ASSERT(s.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Foo")));
+ }
+}
+
+void Test::testSetSetMemberName() {
+ rtl::OUString s;
+ CPPUNIT_ASSERT(
+ getKey(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "/org.openoffice.UI.GenericCommands/UserInterface/Commands/"
+ ".uno:FontworkShapeType")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Label"))) >>=
+ s);
+ CPPUNIT_ASSERT(
+ s.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Fontwork Shape")));
+
+ css::uno::Reference< css::container::XNameAccess > access(
+ createUpdateAccess(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "/org.openoffice.UI.GenericCommands/UserInterface/"
+ "Commands"))),
+ css::uno::UNO_QUERY_THROW);
+ css::uno::Reference< css::container::XNamed > member;
+ access->getByName(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(".uno:FontworkGalleryFloater"))) >>=
+ member;
+ CPPUNIT_ASSERT(member.is());
+ member->setName(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(".uno:FontworkShapeType")));
+ css::uno::Reference< css::util::XChangesBatch >(
+ access, css::uno::UNO_QUERY_THROW)->commitChanges();
+ css::uno::Reference< css::lang::XComponent >(
+ access, css::uno::UNO_QUERY_THROW)->dispose();
+
+ CPPUNIT_ASSERT(
+ getKey(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "/org.openoffice.UI.GenericCommands/UserInterface/Commands/"
+ ".uno:FontworkShapeType")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Label"))) >>=
+ s);
+ CPPUNIT_ASSERT(
+ s.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Fontwork Gallery")));
+}
+
+void Test::testReadCommands() {
+ css::uno::Reference< css::container::XNameAccess > access(
+ createViewAccess(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "/org.openoffice.UI.GenericCommands/UserInterface/"
+ "Commands"))),
+ css::uno::UNO_QUERY_THROW);
+ css::uno::Sequence< rtl::OUString > names(access->getElementNames());
+ CPPUNIT_ASSERT(names.getLength() == 695);
+ // testSetSetMemberName() already removed ".uno:FontworkGalleryFloater"
+ sal_uInt32 n = osl_getGlobalTimer();
+ for (int i = 0; i < 8; ++i) {
+ for (sal_Int32 j = 0; j < names.getLength(); ++j) {
+ css::uno::Reference< css::container::XNameAccess > child;
+ if (access->getByName(names[j]) >>= child) {
+ CPPUNIT_ASSERT(child.is());
+ child->getByName(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Label")));
+ child->getByName(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ContextLabel")));
+ child->getByName(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Properties")));
+ }
+ }
+ }
+ n = osl_getGlobalTimer() - n;
+ t_print("Reading elements took %" SAL_PRIuUINT32 " ms\n", n);
+ css::uno::Reference< css::lang::XComponent >(
+ access, css::uno::UNO_QUERY_THROW)->dispose();
+}
+
+void Test::testThreads() {
+ struct Entry { rtl::OUString path; rtl::OUString relative; };
+ Entry list[] = {
+ { rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Setup")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Test/AString")) },
+ { rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Setup")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Test/AString")) },
+ { rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "/org.openoffice.UI.GenericCommands")),
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "UserInterface/Commands/dotuno:WebHtml/Label")) },
+ { rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "/org.openoffice.UI.GenericCommands")),
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "UserInterface/Commands/dotuno:NewPresentation/Label")) },
+ { rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "/org.openoffice.UI.GenericCommands")),
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "UserInterface/Commands/dotuno:RecentFileList/Label")) },
+ { rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Setup")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("L10N/ooLocale")) },
+ { rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Setup")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Test/ABoolean")) }
+ };
+ std::size_t const numReaders = sizeof list / sizeof (Entry);
+ std::size_t const numWriters = numReaders - 2;
+ ReaderThread * readers[numReaders];
+ WriterThread * writers[numWriters];
+ osl::Condition stop;
+ for (std::size_t i = 0; i < numReaders; ++i) {
+ CPPUNIT_ASSERT(getKey(list[i].path, list[i].relative).hasValue());
+ readers[i] = new ReaderThread(
+ stop, *this, list[i].path, list[i].relative);
+ }
+ for (std::size_t i = 0; i < numWriters; ++i) {
+ writers[i] = new WriterThread(
+ stop, *this, list[i].path, list[i].relative);
+ }
+ for (int i = 0; i < 5; ++i) {
+ for (std::size_t j = 0; j < numReaders; ++j) {
+ rtl::OUString path;
+ rtl::OUString name;
+ normalize(list[j].path, list[j].relative, &path, &name);
+ resetKey(path, name);
+ osl::Thread::yield();
+ }
+ }
+ stop.set();
+ bool success = true;
+ for (std::size_t i = 0; i < numReaders; ++i) {
+ readers[i]->join();
+ success = success && readers[i]->getSuccess();
+ delete readers[i];
+ }
+ for (std::size_t i = 0; i < numWriters; ++i) {
+ writers[i]->join();
+ success = success && writers[i]->getSuccess();
+ delete writers[i];
+ }
+ CPPUNIT_ASSERT(success);
+}
+
+void Test::testRecursive() {
+ bool destroyed = false;
+ rtl::Reference< RecursiveTest >(
+ new SimpleRecursiveTest(*this, 100, &destroyed))->test();
+ CPPUNIT_ASSERT(destroyed);
+}
+
+void Test::testCrossThreads() {
+ bool destroyed = false;
+ rtl::Reference< RecursiveTest >(
+ new SimpleRecursiveTest(*this, 10, &destroyed))->test();
+ CPPUNIT_ASSERT(destroyed);
+}
+
+css::uno::Any Test::getKey(
+ rtl::OUString const & path, rtl::OUString const & relative) const
+{
+ css::uno::Reference< css::container::XHierarchicalNameAccess > access(
+ createViewAccess(path), css::uno::UNO_QUERY_THROW);
+ css::uno::Any value(access->getByHierarchicalName(relative));
+ css::uno::Reference< css::lang::XComponent >(
+ access, css::uno::UNO_QUERY_THROW)->dispose();
+ return value;
+}
+
+void Test::setKey(
+ rtl::OUString const & path, rtl::OUString const & name,
+ css::uno::Any const & value) const
+{
+ css::uno::Reference< css::container::XNameReplace > access(
+ createUpdateAccess(path), css::uno::UNO_QUERY_THROW);
+ access->replaceByName(name, value);
+ css::uno::Reference< css::util::XChangesBatch >(
+ access, css::uno::UNO_QUERY_THROW)->commitChanges();
+ css::uno::Reference< css::lang::XComponent >(
+ access, css::uno::UNO_QUERY_THROW)->dispose();
+}
+
+bool Test::resetKey(rtl::OUString const & path, rtl::OUString const & name)
+ const
+{
+ //TODO: support setPropertyToDefault
+ css::uno::Reference< css::util::XChangesBatch > access(
+ createUpdateAccess(path), css::uno::UNO_QUERY_THROW);
+ css::uno::Reference< css::beans::XPropertyState > state(
+ access, css::uno::UNO_QUERY);
+ if (!state.is()) {
+ return false;
+ }
+ state->setPropertyToDefault(name);
+ access->commitChanges();
+ css::uno::Reference< css::lang::XComponent >(
+ access, css::uno::UNO_QUERY_THROW)->dispose();
+ return true;
+}
+
+css::uno::Reference< css::uno::XInterface > Test::createViewAccess(
+ rtl::OUString const & path) const
+{
+ css::uno::Any arg(
+ css::uno::makeAny(
+ css::beans::NamedValue(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath")),
+ css::uno::makeAny(path))));
+ return provider_->createInstanceWithArguments(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationAccess")),
+ css::uno::Sequence< css::uno::Any >(&arg, 1));
+}
+
+css::uno::Reference< css::uno::XInterface > Test::createUpdateAccess(
+ rtl::OUString const & path) const
+{
+ css::uno::Any arg(
+ css::uno::makeAny(
+ css::beans::NamedValue(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath")),
+ css::uno::makeAny(path))));
+ return provider_->createInstanceWithArguments(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationUpdateAccess")),
+ css::uno::Sequence< css::uno::Any >(&arg, 1));
+}
+
+CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(Test, "alltest");
+
+}
+
+NOADDITIONAL;
diff --git a/configmgr/qa/unit/threading.cxx b/configmgr/qa/unit/threading.cxx
deleted file mode 100644
index e3ccd52b73..0000000000
--- a/configmgr/qa/unit/threading.cxx
+++ /dev/null
@@ -1,259 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "common.hxx"
-#include <osl/thread.hxx>
-#include <osl/conditn.hxx>
-#include <cppuhelper/implbase1.hxx>
-#include "com/sun/star/beans/XPropertyChangeListener.hpp"
-
-class KeyTester : public osl::Thread
-{
- osl::Condition *m_pCond;
- protected:
- rtl::OString m_aPath;
- rtl::OString m_aKey;
- Test *m_pTest;
- public:
- KeyTester (osl::Condition *pCond, Test *pTest,
- const char *pPath, const char *pKey)
- : m_pCond (pCond)
- , m_aPath (pPath)
- , m_aKey (pKey)
- , m_pTest (pTest)
- {
- }
- virtual ~KeyTester ()
- {
- }
- virtual void SAL_CALL run ()
- {
- testIteration();
- while (!m_pCond->check())
- testIteration();
- }
- virtual void testIteration()
- {
- css::uno::Any a = m_pTest->getKey (m_aPath, m_aKey);
- CPPUNIT_ASSERT_MESSAGE ("no value", a.hasValue());
- }
-};
-
-class KeyReader : public KeyTester
-{
-public:
- KeyReader (osl::Condition *pCond, Test *pTest,
- const char *pPath, const char *pKey)
- : KeyTester (pCond, pTest, pPath, pKey)
- {
- // to ensure we have the right vtable when we hit 'run'
- create();
- }
-};
-
-class KeyWriter : public KeyTester
-{
- int curOpt;
- public:
- KeyWriter (osl::Condition *pCond, Test *pTest,
- const char *pPath, const char *pKey)
- : KeyTester (pCond, pTest, pPath, pKey)
- , curOpt(0)
- {
- m_pTest->normalizePathKey (m_aPath, m_aKey);
- create();
- }
- virtual void testIteration ()
- {
- try {
- static const char *options[] = { "fish", "chips", "kippers", "bloaters" };
-// fprintf (stderr, "set key %d\n",
-// (int) osl_getThreadIdentifier(NULL));
- m_pTest->setKey (m_aPath, rtl::OUString::createFromAscii (m_aKey),
- css::uno::makeAny (rtl::OUString::createFromAscii(options[(curOpt++ & 3)])));
- } CATCH_FAIL ("setting keys")
- }
-};
-
-void Test::threadTests()
-{
- osl::Condition stop;
- stop.reset();
-
- struct {
- const char *pPath;
- const char *pKey;
- } keyList[] = {
- { "/org.openoffice.Setup", "Test/AString" },
- { "/org.openoffice.Setup", "Test/AString" },
- { "/org.openoffice.UI.GenericCommands", "UserInterface/Commands/dotuno:WebHtml/Label" },
- { "/org.openoffice.UI.GenericCommands", "UserInterface/Commands/dotuno:NewPresentation/Label" },
- { "/org.openoffice.UI.GenericCommands", "UserInterface/Commands/dotuno:RecentFileList/Label" },
-
- { "/org.openoffice.Setup", "L10N/ooLocale" },
- { "/org.openoffice.Setup", "Test/ABoolean" }
- };
- const int numReaders = sizeof (keyList) / sizeof (keyList[0]);
- const int numWriters = (sizeof (keyList) / sizeof (keyList[0])) - 2;
- KeyReader *pReaders[numReaders];
- KeyWriter *pWriters[numReaders];
-
- int i;
- try {
- for (i = 0; i < numReaders; i++) {
- css::uno::Any a = getKey (keyList[i].pPath, keyList[i].pKey);
- CPPUNIT_ASSERT_MESSAGE ("check key", a.hasValue());
- }
-
- // a few readers
- for (i = 0; i < numReaders; i++)
- pReaders[i] = new KeyReader (&stop, this, keyList[i].pPath,
- keyList[i].pKey);
- // a few writers
- for (i = 0; i < numWriters; i++)
- pWriters[i] = new KeyWriter (&stop, this, keyList[i].pPath,
- keyList[i].pKey);
-
- // Threads are running ...
- const int numIters = 5;
- for (int j = 0; j < numIters; j++) {
- for (i = 0; i < numReaders; i++)
- {
- try {
- rtl::OString aPath (keyList[i].pPath);
- rtl::OString aKey (keyList[i].pKey);
- normalizePathKey (aPath, aKey);
- resetKey (aPath, rtl::OUString::createFromAscii (aKey));
- osl::Thread::yield();
- } CATCH_FAIL ("resetting keys");
- }
- }
- stop.set();
-
- for (i = 0; i < numReaders; i++) {
- pReaders[i]->join();
- delete pReaders[i];
- }
- for (i = 0; i < numWriters; i++) {
- pWriters[i]->join();
- delete pWriters[i];
- }
-
- } CATCH_FAIL ("checking keys exist")
-}
-
-class RecursiveListener : public cppu::WeakImplHelper1< css::beans::XPropertyChangeListener >
-{
-public:
- sal_Int32 m_nRecurse;
- css::uno::Reference< css::beans::XPropertySet > mxPropSet;
- protected:
- Test *m_pTest;
- rtl::OString m_pPath;
- rtl::OString m_pKey;
- public:
- RecursiveListener (Test *pTest, int nCount,
- const char *pPath, const char *pKey)
- : m_nRecurse (nCount)
- , m_pTest (pTest)
- , m_pPath (pPath)
- , m_pKey (pKey)
- {
- mxPropSet = css::uno::Reference< css::beans::XPropertySet > (
- pTest->createView (pPath, true), css::uno::UNO_QUERY_THROW );
-
- CPPUNIT_ASSERT_MESSAGE ("is prop set", mxPropSet.is());
- mxPropSet->addPropertyChangeListener (rtl::OUString::createFromAscii (m_pKey),
- css::uno::Reference<css::beans::XPropertyChangeListener>(this));
- }
- virtual ~RecursiveListener()
- {
- disposeComponent (mxPropSet);
- }
-
- virtual void SAL_CALL acquire() throw() { cppu::WeakImplHelper1< css::beans::XPropertyChangeListener >::acquire(); }
- virtual void SAL_CALL release() throw() { cppu::WeakImplHelper1< css::beans::XPropertyChangeListener >::acquire(); }
- // XPropertyChangeListener
- virtual void SAL_CALL propertyChange( const ::css::beans::PropertyChangeEvent& ) throw (::css::uno::RuntimeException)
- {
- if (m_nRecurse-- > 0)
- runTest();
- }
- // XEventListener
- virtual void SAL_CALL disposing( const ::css::lang::EventObject& ) throw (::css::uno::RuntimeException)
- {
- }
- virtual void runTest()
- {
- m_pTest->setKey (m_pPath, rtl::OUString::createFromAscii (m_pKey),
- css::uno::makeAny(
- rtl::OUString::valueOf (m_nRecurse) ) );
- }
-};
-
-class CrossThreadListener : public RecursiveListener
-{
- public:
- CrossThreadListener (Test *pTest, int nCount,
- const char *pPath, const char *pKey)
- : RecursiveListener (pTest, nCount, pPath, pKey)
- {
- }
- virtual ~CrossThreadListener()
- {
- }
- virtual void runTest()
- {
- osl::Condition stopAfterOne;
- stopAfterOne.set();
- KeyWriter aWriter (&stopAfterOne, m_pTest, m_pPath, m_pKey);
- aWriter.join();
-
- rtl::OString aPath (m_pPath), aKey (m_pKey);
- m_pTest->normalizePathKey (aPath, aKey);
- m_pTest->resetKey (aPath, rtl::OUString::createFromAscii (aKey));
- }
-};
-
-void Test::recursiveTests()
-{
- RecursiveListener *pList = new RecursiveListener(this, 100,
- "/org.openoffice.UI.GenericCommands/UserInterface/Commands/dotuno:WebHtml",
- "Label");
- css::uno::Reference< css::beans::XPropertyChangeListener > xListener(pList);
- pList->runTest();
-}
-
-void Test::eventTests()
-{
- CrossThreadListener *pList = new CrossThreadListener(this, 10,
- "/org.openoffice.UI.GenericCommands/UserInterface/Commands/dotuno:WebHtml",
- "Label");
- css::uno::Reference< css::beans::XPropertyChangeListener > xListener(pList);
- pList->runTest();
-}
-
diff --git a/configmgr/qa/unit/ubootstrap.cxx b/configmgr/qa/unit/ubootstrap.cxx
deleted file mode 100644
index 36acd71bd2..0000000000
--- a/configmgr/qa/unit/ubootstrap.cxx
+++ /dev/null
@@ -1,120 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "common.hxx"
-#include <osl/file.hxx>
-
-// Do all those evil things to make the tests actually work ...
-Magic::Magic()
-{
- rtl_uString *curWd = NULL;
- osl_getProcessWorkingDir( &curWd );
-
- rtl::OUString aKey;
- rtl::OUString aValue( curWd );
-
- // Unless you do this, obviously you don't want your paths to be correct
- // or file access to work properly
- aKey = rtl::OUString::createFromAscii( "BaseInstallation" );
- rtl_bootstrap_set( aKey.pData, aValue.pData );
- // Unless you do this, obviously you don't deserve to have anything work
- aKey = rtl::OUString::createFromAscii( "CFG_INIFILE" );
- aValue += rtl::OUString::createFromAscii( "/configmgrrc" );
- rtl_bootstrap_set( aKey.pData, aValue.pData );
-
- // FIXME: Create a safe /tmp directory - unfotunately that
- // either requires dependencies we don't have, or some cut &
- // paste action of unotools/source/ucbhelper/tempfile.cxx
- if (osl::File::getTempDirURL(maTempDir) != osl::FileBase::E_None) {
- t_print ("no tmp dir");
- CPPUNIT_FAIL ("no tmp dir");
- }
- maTempDir += rtl::OUString::createFromAscii("/unittstconfig");
- osl::FileBase::RC err = osl::Directory::create (maTempDir);
-
- if (err != osl::FileBase::E_None) {
- t_print ("tmp dir '%s' already exists\n",
- rtl::OUStringToOString (maTempDir, RTL_TEXTENCODING_UTF8).getStr());
- CPPUNIT_FAIL ("tmp user config dir already exists!");
- }
-
- aKey = rtl::OUString::createFromAscii( "UserInstallation" );
- rtl_bootstrap_set( aKey.pData, maTempDir.pData );
-}
-
-void removeRecursive (const rtl::OUString& aPath)
-{
- sal_Int32 nMask = FileStatusMask_Type | FileStatusMask_FileURL;
-
-// fprintf (stderr, "Remove recursive '%s'\n", rtl::OUStringToOString (aPath, RTL_TEXTENCODING_UTF8).getStr());
-
- osl::DirectoryItem aItem;
- osl::FileStatus aStatus( nMask );
- osl::FileBase::RC nError;
-
- nError = osl::DirectoryItem::get( aPath, aItem );
- CPPUNIT_ASSERT_MESSAGE ("invalid path", nError == osl::FileBase::E_None);
-
- nError = aItem.getFileStatus( aStatus );
- CPPUNIT_ASSERT_MESSAGE ("invalid file", nError == osl::FileBase::E_None);
-
- if (aStatus.getFileType() == osl::FileStatus::Regular ||
- aStatus.getFileType() == osl::FileStatus::Link )
- {
- nError = osl::File::remove( aPath );
-// fprintf (stderr, "Remove file '%s'\n", rtl::OUStringToOString (aPath, RTL_TEXTENCODING_UTF8).getStr());
- CPPUNIT_ASSERT_MESSAGE ("removing file", nError == osl::FileBase::E_None);
- }
- else if (aStatus.getFileType() == osl::FileStatus::Directory)
- {
- osl::Directory aDirectory (aPath);
- nError = aDirectory.open();
- CPPUNIT_ASSERT_MESSAGE ("opening dir", nError == osl::FileBase::E_None);
-
- rtl::OUString name;
-
- while (true) {
- nError = aDirectory.getNextItem( aItem );
- if ( nError != osl::FileBase::E_None )
- break;
- nError = aItem.getFileStatus( aStatus );
- CPPUNIT_ASSERT_MESSAGE ("getting status", nError == osl::FileBase::E_None);
- removeRecursive (aStatus.getFileURL());
- }
- aDirectory.close();
-
- nError = osl::Directory::remove( aPath );
-// fprintf (stderr, "Remove dir '%s'\n", rtl::OUStringToOString (aPath, RTL_TEXTENCODING_UTF8).getStr());
-
- CPPUNIT_ASSERT_MESSAGE ("removing directory", nError == osl::FileBase::E_None);
- }
-}
-
-Magic::~Magic()
-{
- removeRecursive (maTempDir);
-}
diff --git a/configmgr/source/api/makefile.mk b/configmgr/qa/unit/urebootstrap.ini
index eb3f348bbb..c413645d0f 100644
--- a/configmgr/source/api/makefile.mk
+++ b/configmgr/qa/unit/urebootstrap.ini
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -23,27 +23,8 @@
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
-#*************************************************************************
-
-PRJ=..$/..
-PRJINC=$(PRJ)$/source$/inc
-PRJNAME=configmgr
-TARGET=api
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings ----------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/makefile.pmk
-
-# --- Files -------------------------------------
-
-SLOFILES= \
- $(SLO)$/confevents.obj \
- $(SLO)$/confsvccomponent.obj
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
+#***********************************************************************/
+[Bootstrap]
+OOO_BASE_DIR = $ORIGIN/basis
+BRAND_BASE_DIR = $ORIGIN/brand
diff --git a/configmgr/version.mk b/configmgr/qa/unit/version.map
index eabf1cca63..6b30413b89 100644
--- a/configmgr/version.mk
+++ b/configmgr/qa/unit/version.map
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -23,24 +23,12 @@
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
-#*************************************************************************
-
-# ----------------------------CFGMGR settings------------------------------------#
-# target
-CFGMGR_TARGET=configmgr
-
-# the major
-CFGMGR_MAJOR=2
-# the minor
-CFGMGR_MINOR=0
-# the micro
-CFGMGR_MICRO=0
-
-# this is a c++ compatible library
-CFGMGR_CPP=1
-
-CFGMGR=$(CFGMGR_TARGET_TARGET)_$(CMPEXT)
-
-
+#***********************************************************************/
+UDK_3_0_0 {
+ global:
+ registerAllTestFunction;
+ local:
+ *;
+};
diff --git a/configmgr/qa/unoapi/Test.java b/configmgr/qa/unoapi/Test.java
new file mode 100644
index 0000000000..4d1f5a3c4b
--- /dev/null
+++ b/configmgr/qa/unoapi/Test.java
@@ -0,0 +1,50 @@
+/*************************************************************************
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+************************************************************************/
+
+package org.openoffice.configmgr.qa.unoapi;
+
+import org.openoffice.Runner;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
+
+public final class Test {
+ @org.junit.Before public void setUp() throws Exception {
+ connection.setUp();
+ }
+
+ @org.junit.After public void tearDown()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ connection.tearDown();
+ }
+
+ @org.junit.Test public void test() {
+ assertTrue(
+ Runner.run(
+ "-sce", "module.sce", "-cs", connection.getDescription()));
+ }
+
+ private final OfficeConnection connection = new OfficeConnection();
+}
diff --git a/configmgr/qa/unoapi/cfgmgr2.sce b/configmgr/qa/unoapi/cfgmgr2.sce
deleted file mode 100644
index e7c4adcb6e..0000000000
--- a/configmgr/qa/unoapi/cfgmgr2.sce
+++ /dev/null
@@ -1,34 +0,0 @@
--o cfgmgr2.LocalSchemaSupplier
--o cfgmgr2.LocalSingleStratum
--o cfgmgr2.MultiStratumBackend
--o sysmgr1.SystemIntegration
-#i46913# -o cfgmgr2.BootstrapContext
--o cfgmgr2.LayerUpdateMerger
--o cfgmgr2.LayerWriter
--o cfgmgr2.LocalDataImporter
--o cfgmgr2.LocalHierarchyBrowser
--o cfgmgr2.LocalSingleBackend
--o cfgmgr2.MergeImporter
--o cfgmgr2.OConfigurationRegistry
--o cfgmgr2.OInnerGroupInfoAccess
--o cfgmgr2.OInnerGroupUpdateAccess
--o cfgmgr2.OInnerSetInfoAccess
-#i46185# -o cfgmgr2.OInnerTreeSetUpdateAccess
--o cfgmgr2.OInnerValueSetUpdateAccess
--o cfgmgr2.ORootElementGroupInfoAccess
--o cfgmgr2.ORootElementGroupUpdateAccess
--o cfgmgr2.ORootElementSetInfoAccess
-#i46185# -o cfgmgr2.ORootElementTreeSetUpdateAccess
--o cfgmgr2.ORootElementValueSetUpdateAccess
--o cfgmgr2.OSetElementGroupInfoAccess
--o cfgmgr2.OSetElementGroupUpdateAccess
--o cfgmgr2.OSetElementSetInfoAccess
-#i46185# -o cfgmgr2.OSetElementTreeSetUpdateAccess
-#i84221# -o cfgmgr2.OSetElementValueSetUpdateAccess
--o cfgmgr2.SchemaParser
--o cfgmgr2.SingleBackendAdapter
--o cfgmgr2.ConfigurationProviderWrapper
-#i87744# -o cfgmgr2.LayerParser
--o cfgmgr2.CopyImporter
--o cfgmgr2.AdministrationProvider
--o cfgmgr2.ConfigurationProvider
diff --git a/configmgr/qa/unoapi/knownissues.xcl b/configmgr/qa/unoapi/knownissues.xcl
deleted file mode 100644
index d8956a6e8d..0000000000
--- a/configmgr/qa/unoapi/knownissues.xcl
+++ /dev/null
@@ -1,55 +0,0 @@
-### i84222 ###
-cfgmgr2.LocalSingleBackend::com::sun::star::configuration::backend::XMultiLayerStratum
-
-### i23145 ###
-cfgmgr2.OSetElementGroupUpdateAccess::com::sun::star::container::XChild
-
-### i38211 ###
-cfgmgr2.ConfigurationProvider::com::sun::star::lang::XComponent
-
-### i46185 ###
-cfgmgr2.OInnerTreeSetUpdateAccess::com::sun::star::container::XNameContainer
-cfgmgr2.OSetElementTreeSetUpdateAccess::com::sun::star::container::XNameContainer
-cfgmgr2.ORootElementTreeSetUpdateAccess::com::sun::star::container::XNameContainer
-# -> test is disbaled in cfgmgr2.sce
-
-### i46913 ###
-cfgmgr2.BootstrapContext::com::sun::star::uno::XComponentContext
-# -> test is disbaled in cfgmgr2.sce
-
-### i83881 ###
-cfgmgr2.OInnerValueSetUpdateAccess::com::sun::star::container::XNameReplace
-
-### i65847 ###
-cfgmgr2.OInnerTreeSetUpdateAccess::com::sun::star::beans::XPropertyWithState
-# -> test is disbaled in cfgmgr2.sce
-
-### i68673 ###
-cfgmgr2.ORootElementTreeSetUpdateAccess::com::sun::star::beans::XPropertyWithState
-# -> test is disbaled in cfgmgr2.sce
-
-### i79114 ###
-sysmgr1.SystemIntegration::com::sun::star::configuration::backend::XBackend
-
-### i83880 ###
-cfgmgr2.ORootElementValueSetUpdateAccess::com::sun::star::container::XNameReplace
-
-### i84221 ###
-cfgmgr2.OSetElementValueSetUpdateAccess
-
-### i87744 ###
-cfgmgr2.LayerParser
-# -> test is disbaled in cfgmgr2.sce
-
-### i88358 ###
-cfgmgr2.OInnerValueSetUpdateAccess::com::sun::star::container::XHierarchicalNameAccess
-cfgmgr2.OInnerValueSetUpdateAccess::com::sun::star::beans::XExactName
-
-### i88360 ###
-cfgmgr2.ORootElementValueSetUpdateAccess::com::sun::star::util::XChangesBatch
-
-### i89412 ###
-cfgmgr2.OInnerValueSetUpdateAccess::com::sun::star::container::XElementAccess
-
-### i89413 ###
-cfgmgr2.ORootElementValueSetUpdateAccess::com::sun::star::container::XHierarchicalNameAccess
diff --git a/configmgr/qa/unoapi/makefile.mk b/configmgr/qa/unoapi/makefile.mk
index c90cca92ce..252e4a0d9a 100644
--- a/configmgr/qa/unoapi/makefile.mk
+++ b/configmgr/qa/unoapi/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -23,22 +23,28 @@
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
-#*************************************************************************
+#***********************************************************************/
-PRJ=..$/..
-PRJNAME=configmgr
-TARGET=qa_unoapi
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
-.INCLUDE: settings.mk
+PRJ = ../..
+PRJNAME = configmgr
+TARGET = qa_unoapi
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = org/openoffice/configmgr/qa/unoapi
+JAVATESTFILES = Test.java
+JAVAFILES = $(JAVATESTFILES)
+JARFILES = OOoRunner.jar ridl.jar test.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+.END
+
+.INCLUDE: settings.mk
.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
-ALLTAR : UNOAPI_TEST
+ALLTAR : javatest
-UNOAPI_TEST:
- +$(SOLARENV)$/bin$/checkapi -sce cfgmgr2.sce -xcl knownissues.xcl -tdoc $(PWD)$/testdocuments
- @echo =======================================================================
- @echo In case of problems with sysmgr1.SystemIntegration make sure that you
- @echo =======================================================================
- @echo built and registered qadevOOo/testsdocs/backend/org/openoffice/JavaSystemBackend
- @echo =======================================================================
+.END
diff --git a/configmgr/makefile.pmk b/configmgr/qa/unoapi/module.sce
index ccb15e7095..d9b1c8b540 100644
--- a/configmgr/makefile.pmk
+++ b/configmgr/qa/unoapi/module.sce
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -23,6 +23,7 @@
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
-#*************************************************************************
+#***********************************************************************/
-VISIBILITY_HIDDEN = TRUE
+-o configmgr.ConfigurationProvider
+-o configmgr.DefaultProvider
diff --git a/configmgr/source/README b/configmgr/source/README
new file mode 100644
index 0000000000..6d19a3b786
--- /dev/null
+++ b/configmgr/source/README
@@ -0,0 +1,156 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#***********************************************************************/
+
+Source Overview
+===============
+
+configurationprovider.cxx
+configurationregistry.cxx
+defaultprovider.cxx
+services.cxx
+ UNO service implementations.
+
+access.cxx
+childaccess.cxx
+rootaccess.cxx
+ UNO objects passed to clients.
+
+components.cxx
+ Central singleton that aggregates all data (reads in the XML files, manages
+ modifications and global notifications).
+
+groupnode.cxx
+localizedpropertynode.cxx
+localizedvaluenode.cxx
+node.cxx
+propertynode.cxx
+setnode.cxx
+ Internal representations of data nodes.
+
+pad.cxx
+parsemanager.cxx
+parser.hxx
+span.hxx
+valueparser.cxx
+xcdparser.cxx
+xcsparser.cxx
+xcuparser.cxx
+xmldata.cxx
+xmlreader.cxx
+ XML file reading.
+
+modifications.cxx
+writemodfile.cxx
+ Modification management.
+
+broadcaster.cxx
+ Notification management.
+
+update.cxx
+ Extension manager interface.
+
+data.cxx
+lock.cxx
+nodemap.cxx
+path.hxx
+type.cxx
+ Utilities.
+
+
+Mandatory Set Members
+=====================
+
+- A set member can be marked as "mandatory," meaning that a member of that name
+must always be present in a set.
+
+- The above definition implies that calling replaceByName on a mandatory set
+member is OK.
+
+- The XCU format can contain oor:mandatory attributes on nodes. (The XCS format
+does not support them. In the registrymodifications file, oor:mandatory
+attributes should never be needed, as being mandatory cannot be controlled via
+the UNO API.) The XCU reading code only evaluates the oor:mandatory attribute
+for set members, and ignores it everywhere else.
+
+- Only true sets support mandatory members. A localized property for the "*"
+locale, though acting much like a set, does not support mandatory members.
+
+- The OpenOffice.org Registry Format document claims that group extension
+properties are implicitly mandatory, but at least the new configmgr code does
+not treat them like that (i.e., they can be removed again).
+
+- For simplicity, setMandatory/getMandatory are available as virtual functions
+at the base Node, even though they can only make sense for GroupNodes and
+SetNodes that are set members. The default getMandatory implementation returns
+NO_LAYER, meaning oor:mandatory is not set to true in any layer. (Returning
+NO_LAYER simplifies the code, e.g., removeByName does not have to check whether
+getMandatory is called on a member of a true set to decide whether to forbid
+removal.)
+
+- When committing changes (made through the UNO API), the "mandatory" status of
+inserted nodes must be updated (in case the insert is due to a replaceByName, or
+the "mandatory" flag was added by a concurrent modification of a lower layer).
+Also, for to-be-removed nodes, removal is ignored for (newly; due to concurrent
+modification of a lower layer) mandatory nodes (but still recorded in
+registrymodifications, so may take effect once the lower layer addition is
+removed again---whether or not that is a good idea).
+
+
+XcuParser Modification Recording
+================================
+
+- XcuParser records modifications when reading user layer data
+(valueParser_.getLayer() == Data::NO_LAYER).
+
+- oor:finalized and oor:mandatory attributes cannot be set via the UNO API, so
+it is assumed that user layer data does not contain them (for one, they are not
+written by writeModFile; for another, the logic to record modifications expects
+a locprop(modify,fuse) to be followed by one or more value(fuse,remove), which
+would not necessarily be true if the locprop were only present in the user layer
+data to flag it as finalized).
+
+- The logic to record modifications considers the top of the XML element stack.
+In the following list of all possible cases, items marked with an asterisk are
+recorded:
+ ... group(modify,fuse) - group(modify,fuse) - ...
+ ... group(modify,fuse) - set(modify,fuse) - ...
+ ... group(modify,fuse) - *prop(modify,fuse,replace) - value(fuse)
+ ... group(modify,fuse) - *prop(remove)
+ ... group(modify,fuse) - locprop(modify,fuse) - *value(fuse)
+ ... group(modify,fuse) - locprop(modify,fuse) - *value(remove)
+ ... group(modify,fuse) - *locprop(replace) ...
+ ... set(modify,fuse,replace) - group(modify/fuse) - ...
+ ... set(modify,fuse,replace) - *group(replace/fuse) - ...
+ ... set(modify,fuse,replace) - *group(remove)
+ ... set(modify,fuse,replace) - set(modify/fuse) - ...
+ ... set(modify,fuse,replace) - *set(replace/fuse) - ...
+ ... set(modify,fuse,replace) - *set(remove)
+Legend: "...": zero or more further items
+ "- ...": one or more further items
+ "modify,fuse" etc.: any of those operations
+ "modify/fuse": a modify or a fuse on an existing member
+ "replace/fuse": a replace or a fuse on a non-existing member
diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
new file mode 100644
index 0000000000..7af9c1f8d9
--- /dev/null
+++ b/configmgr/source/access.cxx
@@ -0,0 +1,2186 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include <vector>
+
+#include "com/sun/star/beans/Property.hpp"
+#include "com/sun/star/beans/PropertyAttribute.hpp"
+#include "com/sun/star/beans/PropertyChangeEvent.hpp"
+#include "com/sun/star/beans/PropertyVetoException.hpp"
+#include "com/sun/star/beans/UnknownPropertyException.hpp"
+#include "com/sun/star/beans/XExactName.hpp"
+#include "com/sun/star/beans/XHierarchicalPropertySet.hpp"
+#include "com/sun/star/beans/XHierarchicalPropertySetInfo.hpp"
+#include "com/sun/star/beans/XMultiHierarchicalPropertySet.hpp"
+#include "com/sun/star/beans/XMultiPropertySet.hpp"
+#include "com/sun/star/beans/XPropertiesChangeListener.hpp"
+#include "com/sun/star/beans/XProperty.hpp"
+#include "com/sun/star/beans/XPropertyChangeListener.hpp"
+#include "com/sun/star/beans/XPropertySet.hpp"
+#include "com/sun/star/beans/XPropertySetInfo.hpp"
+#include "com/sun/star/beans/XVetoableChangeListener.hpp"
+#include "com/sun/star/container/ContainerEvent.hpp"
+#include "com/sun/star/container/NoSuchElementException.hpp"
+#include "com/sun/star/container/XContainer.hpp"
+#include "com/sun/star/container/XContainerListener.hpp"
+#include "com/sun/star/container/XElementAccess.hpp"
+#include "com/sun/star/container/XHierarchicalName.hpp"
+#include "com/sun/star/container/XHierarchicalNameAccess.hpp"
+#include "com/sun/star/container/XNameAccess.hpp"
+#include "com/sun/star/container/XNameContainer.hpp"
+#include "com/sun/star/container/XNamed.hpp"
+#include "com/sun/star/lang/DisposedException.hpp"
+#include "com/sun/star/lang/EventObject.hpp"
+#include "com/sun/star/lang/IllegalArgumentException.hpp"
+#include "com/sun/star/lang/NoSupportException.hpp"
+#include "com/sun/star/lang/WrappedTargetException.hpp"
+#include "com/sun/star/lang/XComponent.hpp"
+#include "com/sun/star/lang/XEventListener.hpp"
+#include "com/sun/star/lang/XServiceInfo.hpp"
+#include "com/sun/star/lang/XSingleServiceFactory.hpp"
+#include "com/sun/star/lang/XTypeProvider.hpp"
+#include "com/sun/star/lang/XUnoTunnel.hpp"
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "com/sun/star/uno/Type.hxx"
+#include "com/sun/star/uno/TypeClass.hpp"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "com/sun/star/uno/XWeak.hpp"
+#include "com/sun/star/util/ElementChange.hpp"
+#include "comphelper/sequenceasvector.hxx"
+#include "cppu/unotype.hxx"
+#include "cppuhelper/queryinterface.hxx"
+#include "cppuhelper/weak.hxx"
+#include "osl/diagnose.h"
+#include "osl/interlck.h"
+#include "osl/mutex.hxx"
+#include "rtl/ref.hxx"
+#include "rtl/ustrbuf.hxx"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+
+#include "access.hxx"
+#include "broadcaster.hxx"
+#include "childaccess.hxx"
+#include "components.hxx"
+#include "data.hxx"
+#include "groupnode.hxx"
+#include "localizedpropertynode.hxx"
+#include "localizedvaluenode.hxx"
+#include "lock.hxx"
+#include "modifications.hxx"
+#include "node.hxx"
+#include "nodemap.hxx"
+#include "path.hxx"
+#include "propertynode.hxx"
+#include "rootaccess.hxx"
+#include "setnode.hxx"
+#include "type.hxx"
+
+namespace configmgr {
+
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
+oslInterlockedCount Access::acquireCounting() {
+ return osl_incrementInterlockedCount(&m_refCount);
+}
+
+void Access::releaseNondeleting() {
+ osl_decrementInterlockedCount(&m_refCount);
+}
+
+bool Access::isValue() {
+ rtl::Reference< Node > p(getNode());
+ switch (p->kind()) {
+ case Node::KIND_PROPERTY:
+ case Node::KIND_LOCALIZED_VALUE:
+ return true;
+ case Node::KIND_LOCALIZED_PROPERTY:
+ return !Components::allLocales(getRootAccess()->getLocale());
+ default:
+ return false;
+ }
+}
+
+void Access::markChildAsModified(rtl::Reference< ChildAccess > const & child) {
+ OSL_ASSERT(child.is() && child->getParentAccess() == this);
+ modifiedChildren_[child->getNameInternal()] = ModifiedChild(child, true);
+ for (rtl::Reference< Access > p(this);;) {
+ rtl::Reference< Access > parent(p->getParentAccess());
+ if (!parent.is()) {
+ break;
+ }
+ OSL_ASSERT(dynamic_cast< ChildAccess * >(p.get()) != 0);
+ parent->modifiedChildren_.insert(
+ ModifiedChildren::value_type(
+ p->getNameInternal(),
+ ModifiedChild(dynamic_cast< ChildAccess * >(p.get()), false)));
+ p = parent;
+ }
+}
+
+void Access::releaseChild(rtl::OUString const & name) {
+ cachedChildren_.erase(name);
+}
+
+void Access::initBroadcaster(
+ Modifications::Node const & modifications, Broadcaster * broadcaster)
+{
+ initBroadcasterAndChanges(modifications, broadcaster, 0);
+}
+
+Access::Access(Components & components):
+ components_(components), disposed_(false)
+{}
+
+Access::~Access() {}
+
+void Access::initDisposeBroadcaster(Broadcaster * broadcaster) {
+ OSL_ASSERT(broadcaster != 0);
+ for (DisposeListeners::iterator i(disposeListeners_.begin());
+ i != disposeListeners_.end(); ++i)
+ {
+ broadcaster->addDisposeNotification(
+ *i,
+ css::lang::EventObject(static_cast< cppu::OWeakObject * >(this)));
+ }
+ for (ContainerListeners::iterator i(containerListeners_.begin());
+ i != containerListeners_.end(); ++i)
+ {
+ broadcaster->addDisposeNotification(
+ i->get(),
+ css::lang::EventObject(static_cast< cppu::OWeakObject * >(this)));
+ }
+ for (PropertyChangeListeners::iterator i(propertyChangeListeners_.begin());
+ i != propertyChangeListeners_.end(); ++i)
+ {
+ for (PropertyChangeListenersElement::iterator j(i->second.begin());
+ j != i->second.end(); ++j)
+ {
+ broadcaster->addDisposeNotification(
+ j->get(),
+ css::lang::EventObject(
+ static_cast< cppu::OWeakObject * >(this)));
+ }
+ }
+ for (VetoableChangeListeners::iterator i(vetoableChangeListeners_.begin());
+ i != vetoableChangeListeners_.end(); ++i)
+ {
+ for (VetoableChangeListenersElement::iterator j(i->second.begin());
+ j != i->second.end(); ++j)
+ {
+ broadcaster->addDisposeNotification(
+ j->get(),
+ css::lang::EventObject(
+ static_cast< cppu::OWeakObject * >(this)));
+ }
+ }
+ for (PropertiesChangeListeners::iterator i(
+ propertiesChangeListeners_.begin());
+ i != propertiesChangeListeners_.end(); ++i)
+ {
+ broadcaster->addDisposeNotification(
+ i->get(),
+ css::lang::EventObject(static_cast< cppu::OWeakObject * >(this)));
+ }
+ //TODO: iterate over children w/ listeners (incl. unmodified ones):
+ for (ModifiedChildren::iterator i(modifiedChildren_.begin());
+ i != modifiedChildren_.end(); ++i)
+ {
+ rtl::Reference< ChildAccess > child(getModifiedChild(i));
+ if (child.is()) {
+ child->initDisposeBroadcaster(broadcaster);
+ }
+ }
+}
+
+void Access::clearListeners() throw() {
+ disposeListeners_.clear();
+ containerListeners_.clear();
+ propertyChangeListeners_.clear();
+ vetoableChangeListeners_.clear();
+ propertiesChangeListeners_.clear();
+ //TODO: iterate over children w/ listeners (incl. unmodified ones):
+ for (ModifiedChildren::iterator i(modifiedChildren_.begin());
+ i != modifiedChildren_.end(); ++i)
+ {
+ rtl::Reference< ChildAccess > child(getModifiedChild(i));
+ if (child.is()) {
+ child->clearListeners();
+ }
+ }
+}
+
+css::uno::Any Access::queryInterface(css::uno::Type const & aType)
+ throw (css::uno::RuntimeException)
+{
+ css::uno::Any res(OWeakObject::queryInterface(aType));
+ if (res.hasValue()) {
+ return res;
+ }
+ res = cppu::queryInterface(
+ aType, static_cast< css::lang::XTypeProvider * >(this),
+ static_cast< css::lang::XServiceInfo * >(this),
+ static_cast< css::lang::XComponent * >(this),
+ static_cast< css::container::XHierarchicalNameAccess * >(this),
+ static_cast< css::container::XContainer * >(this),
+ static_cast< css::beans::XExactName * >(this),
+ static_cast< css::container::XHierarchicalName * >(this),
+ static_cast< css::container::XNamed * >(this),
+ static_cast< css::beans::XProperty * >(this),
+ static_cast< css::container::XElementAccess * >(this),
+ static_cast< css::container::XNameAccess * >(this));
+ if (res.hasValue()) {
+ return res;
+ }
+ if (getNode()->kind() == Node::KIND_GROUP) {
+ res = cppu::queryInterface(
+ aType, static_cast< css::beans::XPropertySetInfo * >(this),
+ static_cast< css::beans::XPropertySet * >(this),
+ static_cast< css::beans::XMultiPropertySet * >(this),
+ static_cast< css::beans::XHierarchicalPropertySet * >(this),
+ static_cast< css::beans::XMultiHierarchicalPropertySet * >(this),
+ static_cast< css::beans::XHierarchicalPropertySetInfo * >(this));
+ if (res.hasValue()) {
+ return res;
+ }
+ }
+ if (getRootAccess()->isUpdate()) {
+ res = cppu::queryInterface(
+ aType, static_cast< css::container::XNameReplace * >(this));
+ if (res.hasValue()) {
+ return res;
+ }
+ if (getNode()->kind() != Node::KIND_GROUP ||
+ dynamic_cast< GroupNode * >(getNode().get())->isExtensible())
+ {
+ res = cppu::queryInterface(
+ aType, static_cast< css::container::XNameContainer * >(this));
+ if (res.hasValue()) {
+ return res;
+ }
+ }
+ if (getNode()->kind() == Node::KIND_SET) {
+ res = cppu::queryInterface(
+ aType, static_cast< css::lang::XSingleServiceFactory * >(this));
+ }
+ }
+ return res;
+}
+
+Components & Access::getComponents() const {
+ return components_;
+}
+
+void Access::checkLocalizedPropertyAccess() {
+ if (getNode()->kind() == Node::KIND_LOCALIZED_PROPERTY &&
+ !Components::allLocales(getRootAccess()->getLocale()))
+ {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr Access to specialized LocalizedPropertyNode")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+}
+
+rtl::Reference< Node > Access::getParentNode() {
+ rtl::Reference< Access > parent(getParentAccess());
+ return parent.is() ? parent->getNode() : rtl::Reference< Node >();
+}
+
+rtl::Reference< ChildAccess > Access::getChild(rtl::OUString const & name) {
+ ModifiedChildren::iterator i(modifiedChildren_.find(name));
+ return i == modifiedChildren_.end()
+ ? getUnmodifiedChild(name) : getModifiedChild(i);
+}
+
+std::vector< rtl::Reference< ChildAccess > > Access::getAllChildren() {
+ std::vector< rtl::Reference< ChildAccess > > vec;
+ NodeMap & members = getNode()->getMembers();
+ for (NodeMap::iterator i(members.begin()); i != members.end(); ++i) {
+ if (modifiedChildren_.find(i->first) == modifiedChildren_.end()) {
+ vec.push_back(getUnmodifiedChild(i->first));
+ OSL_ASSERT(vec.back().is());
+ }
+ }
+ for (ModifiedChildren::iterator i(modifiedChildren_.begin());
+ i != modifiedChildren_.end(); ++i)
+ {
+ rtl::Reference< ChildAccess > child(getModifiedChild(i));
+ if (child.is()) {
+ vec.push_back(child);
+ }
+ }
+ return vec;
+}
+
+void Access::checkValue(css::uno::Any const & value, Type type, bool nillable) {
+ bool ok;
+ switch (type) {
+ case TYPE_NIL:
+ OSL_ASSERT(false);
+ // fall through (cannot happen)
+ case TYPE_ERROR:
+ ok = false;
+ break;
+ case TYPE_ANY:
+ switch (getDynamicType(value)) {
+ case TYPE_ANY:
+ OSL_ASSERT(false);
+ // fall through (cannot happen)
+ case TYPE_ERROR:
+ ok = false;
+ break;
+ case TYPE_NIL:
+ ok = nillable;
+ break;
+ default:
+ ok = true;
+ break;
+ }
+ break;
+ default:
+ ok = value.hasValue() ? value.isExtractableTo(mapType(type)) : nillable;
+ break;
+ }
+ if (!ok) {
+ throw css::lang::IllegalArgumentException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr inappropriate property value")),
+ static_cast< cppu::OWeakObject * >(this), -1);
+ }
+}
+
+void Access::insertLocalizedValueChild(
+ rtl::OUString const & name, css::uno::Any const & value,
+ Modifications * localModifications)
+{
+ OSL_ASSERT(localModifications != 0);
+ LocalizedPropertyNode * locprop = dynamic_cast< LocalizedPropertyNode * >(
+ getNode().get());
+ checkValue(value, locprop->getStaticType(), locprop->isNillable());
+ rtl::Reference< ChildAccess > child(
+ new ChildAccess(
+ components_, getRootAccess(), this, name,
+ new LocalizedValueNode(Data::NO_LAYER, value)));
+ markChildAsModified(child);
+ localModifications->add(child->getRelativePath());
+}
+
+void Access::reportChildChanges(
+ std::vector< css::util::ElementChange > * changes)
+{
+ OSL_ASSERT(changes != 0);
+ for (ModifiedChildren::iterator i(modifiedChildren_.begin());
+ i != modifiedChildren_.end(); ++i)
+ {
+ rtl::Reference< ChildAccess > child(getModifiedChild(i));
+ if (child.is()) {
+ child->reportChildChanges(changes);
+ changes->push_back(css::util::ElementChange());
+ //TODO: changed value and/or inserted node
+ } else {
+ changes->push_back(css::util::ElementChange()); //TODO: removed node
+ }
+ }
+}
+
+void Access::commitChildChanges(
+ bool valid, Modifications * globalModifications)
+{
+ OSL_ASSERT(globalModifications != 0);
+ while (!modifiedChildren_.empty()) {
+ bool childValid = valid;
+ ModifiedChildren::iterator i(modifiedChildren_.begin());
+ rtl::Reference< ChildAccess > child(getModifiedChild(i));
+ if (child.is()) {
+ childValid = childValid && !child->isFinalized();
+ child->commitChanges(childValid, globalModifications);
+ //TODO: currently, this is called here for directly inserted
+ // children as well as for children whose sub-children were
+ // modified (and should never be called for directly removed
+ // children); clarify what exactly should happen here for
+ // directly inserted children
+ }
+ NodeMap & members = getNode()->getMembers();
+ NodeMap::iterator j(members.find(i->first));
+ if (child.is()) {
+ // Inserted:
+ if (j != members.end()) {
+ childValid = childValid &&
+ j->second->getFinalized() == Data::NO_LAYER;
+ if (childValid) {
+ child->getNode()->setMandatory(j->second->getMandatory());
+ }
+ }
+ if (childValid) {
+ members[i->first] = child->getNode();
+ }
+ } else {
+ // Removed:
+ childValid = childValid && j != members.end() &&
+ j->second->getFinalized() == Data::NO_LAYER &&
+ j->second->getMandatory() == Data::NO_LAYER;
+ if (childValid) {
+ members.erase(j);
+ }
+ }
+ if (childValid && i->second.directlyModified) {
+ Path path(getAbsolutePath());
+ path.push_back(i->first);
+ components_.addModification(path);
+ globalModifications->add(path);
+ }
+ i->second.child->committed();
+ modifiedChildren_.erase(i);
+ }
+}
+
+void Access::initBroadcasterAndChanges(
+ Modifications::Node const & modifications, Broadcaster * broadcaster,
+ std::vector< css::util::ElementChange > * allChanges)
+{
+ OSL_ASSERT(broadcaster != 0);
+ comphelper::SequenceAsVector< css::beans::PropertyChangeEvent > propChanges;
+ bool collectPropChanges = !propertiesChangeListeners_.empty();
+ for (Modifications::Node::Children::const_iterator i(
+ modifications.children.begin());
+ i != modifications.children.end(); ++i)
+ {
+ rtl::Reference< ChildAccess > child(getChild(i->first));
+ if (child.is()) {
+ switch (child->getNode()->kind()) {
+ case Node::KIND_LOCALIZED_PROPERTY:
+ if (!i->second.children.empty()) {
+ if (Components::allLocales(getRootAccess()->getLocale())) {
+ child->initBroadcasterAndChanges(
+ i->second, broadcaster, allChanges);
+ //TODO: if allChanges==0, recurse only into children
+ // w/ listeners
+ } else {
+ //TODO: filter child mods that are irrelevant for
+ // locale:
+ for (ContainerListeners::iterator j(
+ containerListeners_.begin());
+ j != containerListeners_.end(); ++j)
+ {
+ broadcaster->
+ addContainerElementReplacedNotification(
+ *j,
+ css::container::ContainerEvent(
+ static_cast< cppu::OWeakObject * >(
+ this),
+ css::uno::makeAny(i->first),
+ css::uno::Any(), css::uno::Any()));
+ //TODO: non-void Element, ReplacedElement
+ }
+ PropertyChangeListeners::iterator j(
+ propertyChangeListeners_.find(i->first));
+ if (j != propertyChangeListeners_.end()) {
+ for (PropertyChangeListenersElement::iterator k(
+ j->second.begin());
+ k != j->second.end(); ++k)
+ {
+ broadcaster->addPropertyChangeNotification(
+ *k,
+ css::beans::PropertyChangeEvent(
+ static_cast< cppu::OWeakObject * >(
+ this),
+ i->first, false, -1, css::uno::Any(),
+ css::uno::Any()));
+ }
+ }
+ j = propertyChangeListeners_.find(rtl::OUString());
+ if (j != propertyChangeListeners_.end()) {
+ for (PropertyChangeListenersElement::iterator k(
+ j->second.begin());
+ k != j->second.end(); ++k)
+ {
+ broadcaster->addPropertyChangeNotification(
+ *k,
+ css::beans::PropertyChangeEvent(
+ static_cast< cppu::OWeakObject * >(
+ this),
+ i->first, false, -1, css::uno::Any(),
+ css::uno::Any()));
+ }
+ }
+ if (allChanges != 0) {
+ allChanges->push_back(
+ css::util::ElementChange(
+ css::uno::makeAny(
+ child->getRelativePathRepresentation()),
+ css::uno::Any(), css::uno::Any()));
+ //TODO: non-void Element, ReplacedElement
+ }
+ if (collectPropChanges) {
+ propChanges.push_back(
+ css::beans::PropertyChangeEvent(
+ static_cast< cppu::OWeakObject * >(this),
+ i->first, false, -1, css::uno::Any(),
+ css::uno::Any()));
+ }
+ }
+ }
+ // else: spurious Modifications::Node not representing a change
+ break;
+ case Node::KIND_LOCALIZED_VALUE:
+ OSL_ASSERT(
+ Components::allLocales(getRootAccess()->getLocale()));
+ for (ContainerListeners::iterator j(
+ containerListeners_.begin());
+ j != containerListeners_.end(); ++j)
+ {
+ broadcaster->addContainerElementReplacedNotification(
+ *j,
+ css::container::ContainerEvent(
+ static_cast< cppu::OWeakObject * >(this),
+ css::uno::makeAny(i->first), child->asValue(),
+ css::uno::Any()));
+ //TODO: distinguish add/modify; non-void ReplacedElement
+ }
+ if (allChanges != 0) {
+ allChanges->push_back(
+ css::util::ElementChange(
+ css::uno::makeAny(
+ child->getRelativePathRepresentation()),
+ child->asValue(), css::uno::Any()));
+ //TODO: non-void ReplacedElement
+ }
+ OSL_ASSERT(!collectPropChanges);
+ break;
+ case Node::KIND_PROPERTY:
+ {
+ for (ContainerListeners::iterator j(
+ containerListeners_.begin());
+ j != containerListeners_.end(); ++j)
+ {
+ broadcaster->addContainerElementReplacedNotification(
+ *j,
+ css::container::ContainerEvent(
+ static_cast< cppu::OWeakObject * >(this),
+ css::uno::makeAny(i->first), child->asValue(),
+ css::uno::Any()));
+ //TODO: distinguish add/remove/modify; non-void
+ // ReplacedElement
+ }
+ PropertyChangeListeners::iterator j(
+ propertyChangeListeners_.find(i->first));
+ if (j != propertyChangeListeners_.end()) {
+ for (PropertyChangeListenersElement::iterator k(
+ j->second.begin());
+ k != j->second.end(); ++k)
+ {
+ broadcaster->addPropertyChangeNotification(
+ *k,
+ css::beans::PropertyChangeEvent(
+ static_cast< cppu::OWeakObject * >(this),
+ i->first, false, -1, css::uno::Any(),
+ css::uno::Any()));
+ }
+ }
+ j = propertyChangeListeners_.find(rtl::OUString());
+ if (j != propertyChangeListeners_.end()) {
+ for (PropertyChangeListenersElement::iterator k(
+ j->second.begin());
+ k != j->second.end(); ++k)
+ {
+ broadcaster->addPropertyChangeNotification(
+ *k,
+ css::beans::PropertyChangeEvent(
+ static_cast< cppu::OWeakObject * >(this),
+ i->first, false, -1, css::uno::Any(),
+ css::uno::Any()));
+ }
+ }
+ if (allChanges != 0) {
+ allChanges->push_back(
+ css::util::ElementChange(
+ css::uno::makeAny(
+ child->getRelativePathRepresentation()),
+ child->asValue(), css::uno::Any()));
+ //TODO: non-void ReplacedElement
+ }
+ if (collectPropChanges) {
+ propChanges.push_back(
+ css::beans::PropertyChangeEvent(
+ static_cast< cppu::OWeakObject * >(this),
+ i->first, false, -1, css::uno::Any(),
+ css::uno::Any()));
+ }
+ }
+ break;
+ case Node::KIND_GROUP:
+ case Node::KIND_SET:
+ if (i->second.children.empty()) {
+ if (child->getNode()->getTemplateName().getLength() != 0) {
+ for (ContainerListeners::iterator j(
+ containerListeners_.begin());
+ j != containerListeners_.end(); ++j)
+ {
+ broadcaster->
+ addContainerElementInsertedNotification(
+ *j,
+ css::container::ContainerEvent(
+ static_cast< cppu::OWeakObject * >(
+ this),
+ css::uno::makeAny(i->first),
+ child->asValue(), css::uno::Any()));
+ }
+ if (allChanges != 0) {
+ allChanges->push_back(
+ css::util::ElementChange(
+ css::uno::makeAny(
+ child->getRelativePathRepresentation()),
+ css::uno::Any(), css::uno::Any()));
+ //TODO: non-void Element, ReplacedElement
+ }
+ }
+ // else: spurious Modifications::Node not representing a
+ // change
+ } else {
+ child->initBroadcasterAndChanges(
+ i->second, broadcaster, allChanges);
+ //TODO: if allChanges==0, recurse only into children w/
+ // listeners
+ }
+ break;
+ }
+ } else {
+ switch (getNode()->kind()) {
+ case Node::KIND_LOCALIZED_PROPERTY:
+ // Removed localized property value:
+ OSL_ASSERT(
+ Components::allLocales(getRootAccess()->getLocale()));
+ for (ContainerListeners::iterator j(
+ containerListeners_.begin());
+ j != containerListeners_.end(); ++j)
+ {
+ broadcaster->addContainerElementRemovedNotification(
+ *j,
+ css::container::ContainerEvent(
+ static_cast< cppu::OWeakObject * >(this),
+ css::uno::makeAny(i->first), css::uno::Any(),
+ css::uno::Any()));
+ //TODO: non-void ReplacedElement
+ }
+ if (allChanges != 0) {
+ rtl::OUStringBuffer path(getRelativePathRepresentation());
+ if (path.getLength() != 0) {
+ path.append(sal_Unicode('/'));
+ }
+ path.append(
+ Data::createSegment(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*")),
+ i->first));
+ allChanges->push_back(
+ css::util::ElementChange(
+ css::uno::makeAny(path.makeStringAndClear()),
+ css::uno::Any(), css::uno::Any()));
+ //TODO: non-void ReplacedElement
+ }
+ OSL_ASSERT(!collectPropChanges);
+ break;
+ case Node::KIND_GROUP:
+ {
+ // Removed (non-localized) extension property:
+ for (ContainerListeners::iterator j(
+ containerListeners_.begin());
+ j != containerListeners_.end(); ++j)
+ {
+ broadcaster->addContainerElementRemovedNotification(
+ *j,
+ css::container::ContainerEvent(
+ static_cast< cppu::OWeakObject * >(this),
+ css::uno::makeAny(i->first), css::uno::Any(),
+ css::uno::Any()));
+ //TODO: non-void ReplacedElement
+ }
+ PropertyChangeListeners::iterator j(
+ propertyChangeListeners_.find(i->first));
+ if (j != propertyChangeListeners_.end()) {
+ for (PropertyChangeListenersElement::iterator k(
+ j->second.begin());
+ k != j->second.end(); ++k)
+ {
+ broadcaster->addPropertyChangeNotification(
+ *k,
+ css::beans::PropertyChangeEvent(
+ static_cast< cppu::OWeakObject * >(this),
+ i->first, false, -1, css::uno::Any(),
+ css::uno::Any()));
+ }
+ }
+ j = propertyChangeListeners_.find(rtl::OUString());
+ if (j != propertyChangeListeners_.end()) {
+ for (PropertyChangeListenersElement::iterator k(
+ j->second.begin());
+ k != j->second.end(); ++k)
+ {
+ broadcaster->addPropertyChangeNotification(
+ *k,
+ css::beans::PropertyChangeEvent(
+ static_cast< cppu::OWeakObject * >(this),
+ i->first, false, -1, css::uno::Any(),
+ css::uno::Any()));
+ }
+ }
+ if (allChanges != 0) {
+ rtl::OUStringBuffer path(
+ getRelativePathRepresentation());
+ if (path.getLength() != 0) {
+ path.append(sal_Unicode('/'));
+ }
+ path.append(i->first);
+ allChanges->push_back(
+ css::util::ElementChange(
+ css::uno::makeAny(path.makeStringAndClear()),
+ css::uno::Any(), css::uno::Any()));
+ //TODO: non-void ReplacedElement
+ }
+ if (collectPropChanges) {
+ propChanges.push_back(
+ css::beans::PropertyChangeEvent(
+ static_cast< cppu::OWeakObject * >(this),
+ i->first, false, -1, css::uno::Any(),
+ css::uno::Any()));
+ }
+ }
+ break;
+ case Node::KIND_SET:
+ // Removed set member:
+ if (i->second.children.empty()) {
+ for (ContainerListeners::iterator j(
+ containerListeners_.begin());
+ j != containerListeners_.end(); ++j)
+ {
+ broadcaster->addContainerElementRemovedNotification(
+ *j,
+ css::container::ContainerEvent(
+ static_cast< cppu::OWeakObject * >(this),
+ css::uno::makeAny(i->first),
+ css::uno::Any(), css::uno::Any()));
+ //TODO: non-void ReplacedElement
+ }
+ //TODO: if (allChanges != 0) {
+ // allChanges->push_back(
+ // css::util::ElementChange(
+ // css::uno::makeAny(...),
+ // css::uno::Any(), css::uno::Any()));
+ // //TODO: non-void ReplacedElement
+ //}
+ }
+ // else: spurious Modifications::Node not representing a change
+ break;
+ default:
+ OSL_ASSERT(false); // this cannot happen
+ break;
+ }
+ }
+ }
+ if (!propChanges.empty()) {
+ css::uno::Sequence< css::beans::PropertyChangeEvent > seq(
+ propChanges.getAsConstList());
+ for (PropertiesChangeListeners::iterator i(
+ propertiesChangeListeners_.begin());
+ i != propertiesChangeListeners_.end(); ++i)
+ {
+ broadcaster->addPropertiesChangeNotification(*i, seq);
+ }
+ }
+}
+
+bool Access::isDisposed() const {
+ return disposed_;
+}
+
+Access::ModifiedChild::ModifiedChild() {}
+
+Access::ModifiedChild::ModifiedChild(
+ rtl::Reference< ChildAccess > const & theChild, bool theDirectlyModified):
+ child(theChild), directlyModified(theDirectlyModified)
+{}
+
+css::uno::Sequence< css::uno::Type > Access::getTypes()
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ comphelper::SequenceAsVector< css::uno::Type > types;
+ types.push_back(cppu::UnoType< css::uno::XInterface >::get());
+ types.push_back(cppu::UnoType< css::uno::XWeak >::get());
+ types.push_back(cppu::UnoType< css::lang::XTypeProvider >::get());
+ types.push_back(cppu::UnoType< css::lang::XServiceInfo >::get());
+ types.push_back(cppu::UnoType< css::lang::XComponent >::get());
+ types.push_back(
+ cppu::UnoType< css::container::XHierarchicalNameAccess >::get());
+ types.push_back(cppu::UnoType< css::container::XContainer >::get());
+ types.push_back(cppu::UnoType< css::beans::XExactName >::get());
+ types.push_back(cppu::UnoType< css::container::XHierarchicalName >::get());
+ types.push_back(cppu::UnoType< css::container::XNamed >::get());
+ types.push_back(cppu::UnoType< css::beans::XProperty >::get());
+ types.push_back(cppu::UnoType< css::container::XElementAccess >::get());
+ types.push_back(cppu::UnoType< css::container::XNameAccess >::get());
+ if (getNode()->kind() == Node::KIND_GROUP) {
+ types.push_back(cppu::UnoType< css::beans::XPropertySetInfo >::get());
+ types.push_back(cppu::UnoType< css::beans::XPropertySet >::get());
+ types.push_back(cppu::UnoType< css::beans::XMultiPropertySet >::get());
+ types.push_back(
+ cppu::UnoType< css::beans::XHierarchicalPropertySet >::get());
+ types.push_back(
+ cppu::UnoType< css::beans::XMultiHierarchicalPropertySet >::get());
+ types.push_back(
+ cppu::UnoType< css::beans::XHierarchicalPropertySetInfo >::get());
+ }
+ if (getRootAccess()->isUpdate()) {
+ types.push_back(cppu::UnoType< css::container::XNameReplace >::get());
+ if (getNode()->kind() != Node::KIND_GROUP ||
+ dynamic_cast< GroupNode * >(getNode().get())->isExtensible())
+ {
+ types.push_back(
+ cppu::UnoType< css::container::XNameContainer >::get());
+ }
+ if (getNode()->kind() == Node::KIND_SET) {
+ types.push_back(
+ cppu::UnoType< css::lang::XSingleServiceFactory >::get());
+ }
+ }
+ addTypes(&types);
+ return types.getAsConstList();
+}
+
+css::uno::Sequence< sal_Int8 > Access::getImplementationId()
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ return css::uno::Sequence< sal_Int8 >();
+}
+
+rtl::OUString Access::getImplementationName() throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr Access has no service implementation name")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+sal_Bool Access::supportsService(rtl::OUString const & ServiceName)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ css::uno::Sequence< rtl::OUString > names(getSupportedServiceNames());
+ for (sal_Int32 i = 0; i < names.getLength(); ++i) {
+ if (names[i] == ServiceName) {
+ return true;
+ }
+ }
+ return false;
+}
+
+css::uno::Sequence< rtl::OUString > Access::getSupportedServiceNames()
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ comphelper::SequenceAsVector< rtl::OUString > services;
+ services.push_back(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationAccess")));
+ if (getRootAccess()->isUpdate()) {
+ services.push_back(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationUpdateAccess")));
+ }
+ services.push_back(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.HierarchyAccess")));
+ services.push_back(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.HierarchyElement")));
+ if (getNode()->kind() == Node::KIND_GROUP) {
+ services.push_back(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.GroupAccess")));
+ services.push_back(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.PropertyHierarchy")));
+ if (getRootAccess()->isUpdate()) {
+ services.push_back(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.GroupUpdate")));
+ }
+ } else {
+ services.push_back(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.SetAccess")));
+ services.push_back(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.SimpleSetAccess")));
+ if (getRootAccess()->isUpdate()) {
+ services.push_back(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.SetUpdate")));
+ services.push_back(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.SimpleSetUpdate")));
+ }
+ }
+ addSupportedServiceNames(&services);
+ return services.getAsConstList();
+}
+
+void Access::dispose() throw (css::uno::RuntimeException) {
+ OSL_ASSERT(thisIs(IS_ANY));
+ Broadcaster bc;
+ {
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ if (getParentAccess().is()) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr dispose inappropriate Access")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ if (disposed_) {
+ return;
+ }
+ initDisposeBroadcaster(&bc);
+ clearListeners();
+ disposed_ = true;
+ }
+ bc.send();
+}
+
+void Access::addEventListener(
+ css::uno::Reference< css::lang::XEventListener > const & xListener)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ {
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ if (!xListener.is()) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("null listener")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ if (!disposed_) {
+ disposeListeners_.insert(xListener);
+ return;
+ }
+ }
+ try {
+ xListener->disposing(
+ css::lang::EventObject(static_cast< cppu::OWeakObject * >(this)));
+ } catch (css::lang::DisposedException &) {}
+}
+
+void Access::removeEventListener(
+ css::uno::Reference< css::lang::XEventListener > const & aListener)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ DisposeListeners::iterator i(disposeListeners_.find(aListener));
+ if (i != disposeListeners_.end()) {
+ disposeListeners_.erase(i);
+ }
+}
+
+css::uno::Type Access::getElementType() throw (css::uno::RuntimeException) {
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ rtl::Reference< Node > p(getNode());
+ switch (p->kind()) {
+ case Node::KIND_LOCALIZED_PROPERTY:
+ return mapType(
+ dynamic_cast< LocalizedPropertyNode * >(p.get())->getStaticType());
+ case Node::KIND_GROUP:
+ //TODO: Should a specific type be returned for a non-extensible group
+ // with homogeneous members or for an extensible group that currently
+ // has only homegeneous members?
+ return cppu::UnoType< cppu::UnoVoidType >::get();
+ case Node::KIND_SET:
+ return cppu::UnoType< cppu::UnoVoidType >::get(); //TODO: correct?
+ default:
+ OSL_ASSERT(false);
+ throw css::uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("this cannot happen")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+}
+
+sal_Bool Access::hasElements() throw (css::uno::RuntimeException) {
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ return !getAllChildren().empty(); //TODO: optimize
+}
+
+css::uno::Any Access::getByName(rtl::OUString const & aName)
+ throw (
+ css::container::NoSuchElementException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ rtl::Reference< ChildAccess > child(getChild(aName));
+ if (!child.is()) {
+ throw css::container::NoSuchElementException(
+ aName, static_cast< cppu::OWeakObject * >(this));
+ }
+ return child->asValue();
+}
+
+css::uno::Sequence< rtl::OUString > Access::getElementNames()
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ std::vector< rtl::Reference< ChildAccess > > children(getAllChildren());
+ comphelper::SequenceAsVector< rtl::OUString > names;
+ for (std::vector< rtl::Reference< ChildAccess > >::iterator i(
+ children.begin());
+ i != children.end(); ++i)
+ {
+ names.push_back((*i)->getNameInternal());
+ }
+ return names.getAsConstList();
+}
+
+sal_Bool Access::hasByName(rtl::OUString const & aName)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ return getChild(aName).is();
+}
+
+css::uno::Any Access::getByHierarchicalName(rtl::OUString const & aName)
+ throw (css::container::NoSuchElementException, css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ rtl::Reference< ChildAccess > child(getSubChild(aName));
+ if (!child.is()) {
+ throw css::container::NoSuchElementException(
+ aName, static_cast< cppu::OWeakObject * >(this));
+ }
+ return child->asValue();
+}
+
+sal_Bool Access::hasByHierarchicalName(rtl::OUString const & aName)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ return getSubChild(aName).is();
+}
+
+void Access::addContainerListener(
+ css::uno::Reference< css::container::XContainerListener > const & xListener)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ {
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ if (!xListener.is()) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("null listener")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ if (!disposed_) {
+ containerListeners_.insert(xListener);
+ return;
+ }
+ }
+ try {
+ xListener->disposing(
+ css::lang::EventObject(static_cast< cppu::OWeakObject * >(this)));
+ } catch (css::lang::DisposedException &) {}
+}
+
+void Access::removeContainerListener(
+ css::uno::Reference< css::container::XContainerListener > const & xListener)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ ContainerListeners::iterator i(containerListeners_.find(xListener));
+ if (i != containerListeners_.end()) {
+ containerListeners_.erase(i);
+ }
+}
+
+rtl::OUString Access::getExactName(rtl::OUString const & aApproximateName)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ return aApproximateName;
+}
+
+css::uno::Sequence< css::beans::Property > Access::getProperties()
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ osl::MutexGuard g(lock);
+ std::vector< rtl::Reference< ChildAccess > > children(getAllChildren());
+ comphelper::SequenceAsVector< css::beans::Property > properties;
+ for (std::vector< rtl::Reference< ChildAccess > >::iterator i(
+ children.begin());
+ i != children.end(); ++i)
+ {
+ properties.push_back((*i)->asProperty());
+ }
+ return properties.getAsConstList();
+}
+
+css::beans::Property Access::getPropertyByName(rtl::OUString const & aName)
+ throw (css::beans::UnknownPropertyException, css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ osl::MutexGuard g(lock);
+ rtl::Reference< ChildAccess > child(getChild(aName));
+ if (!child.is()) {
+ throw css::beans::UnknownPropertyException(
+ aName, static_cast< cppu::OWeakObject * >(this));
+ }
+ return child->asProperty();
+}
+
+sal_Bool Access::hasPropertyByName(rtl::OUString const & Name)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ osl::MutexGuard g(lock);
+ return getChild(Name).is();
+}
+
+rtl::OUString Access::getHierarchicalName() throw (css::uno::RuntimeException) {
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ return getRelativePathRepresentation();
+}
+
+rtl::OUString Access::composeHierarchicalName(
+ rtl::OUString const & aRelativeName)
+ throw (
+ css::lang::IllegalArgumentException, css::lang::NoSupportException,
+ css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ if (aRelativeName.getLength() == 0 || aRelativeName[0] == '/') {
+ throw css::lang::IllegalArgumentException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr composeHierarchicalName inappropriate relative"
+ " name")),
+ static_cast< cppu::OWeakObject * >(this), -1);
+ }
+ rtl::OUStringBuffer path(getRelativePathRepresentation());
+ if (path.getLength() != 0) {
+ path.append(sal_Unicode('/'));
+ }
+ path.append(aRelativeName);
+ return path.makeStringAndClear();
+}
+
+rtl::OUString Access::getName() throw (css::uno::RuntimeException) {
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ return getNameInternal();
+}
+
+void Access::setName(rtl::OUString const & aName)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ Broadcaster bc;
+ {
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ checkFinalized();
+ Modifications localMods;
+ switch (getNode()->kind()) {
+ case Node::KIND_GROUP:
+ case Node::KIND_SET:
+ {
+ rtl::Reference< Access > parent(getParentAccess());
+ if (parent.is()) {
+ rtl::Reference< Node > node(getNode());
+ if (node->getTemplateName().getLength() != 0) {
+ rtl::Reference< ChildAccess > other(
+ parent->getChild(aName));
+ if (other.get() == this) {
+ break;
+ }
+ if (node->getMandatory() == Data::NO_LAYER &&
+ !(other.is() && other->isFinalized()))
+ {
+ rtl::Reference< RootAccess > root(getRootAccess());
+ rtl::Reference< ChildAccess > childAccess(
+ dynamic_cast< ChildAccess * >(this));
+ localMods.add(getRelativePath());
+ // unbind() modifies the parent chain that
+ // markChildAsModified() walks, so order is
+ // important:
+ parent->markChildAsModified(childAccess);
+ //TODO: must not throw
+ childAccess->unbind(); // must not throw
+ if (other.is()) {
+ other->unbind(); // must not throw
+ }
+ childAccess->bind(root, parent, aName);
+ // must not throw
+ parent->markChildAsModified(childAccess);
+ //TODO: must not throw
+ localMods.add(getRelativePath());
+ break;
+ }
+ }
+ }
+ }
+ // fall through
+ case Node::KIND_LOCALIZED_PROPERTY:
+ // renaming a property could only work for an extension property,
+ // but a localized property is never an extension property
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr setName inappropriate node")),
+ static_cast< cppu::OWeakObject * >(this));
+ default:
+ OSL_ASSERT(false); // this cannot happen
+ break;
+ }
+ getNotificationRoot()->initBroadcaster(localMods.getRoot(), &bc);
+ }
+ bc.send();
+}
+
+css::beans::Property Access::getAsProperty() throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ return asProperty();
+}
+
+css::uno::Reference< css::beans::XPropertySetInfo > Access::getPropertySetInfo()
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ return this;
+}
+
+void Access::setPropertyValue(
+ rtl::OUString const & aPropertyName, css::uno::Any const & aValue)
+ throw (
+ css::beans::UnknownPropertyException, css::beans::PropertyVetoException,
+ css::lang::IllegalArgumentException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ Broadcaster bc;
+ {
+ osl::MutexGuard g(lock);
+ if (!getRootAccess()->isUpdate()) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr setPropertyValue on non-update access")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ Modifications localMods;
+ if (!setChildProperty(aPropertyName, aValue, &localMods)) {
+ throw css::beans::UnknownPropertyException(
+ aPropertyName, static_cast< cppu::OWeakObject * >(this));
+ }
+ getNotificationRoot()->initBroadcaster(localMods.getRoot(), &bc);
+ }
+ bc.send();
+}
+
+css::uno::Any Access::getPropertyValue(rtl::OUString const & PropertyName)
+ throw (
+ css::beans::UnknownPropertyException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ osl::MutexGuard g(lock);
+ rtl::Reference< ChildAccess > child(getChild(PropertyName));
+ if (!child.is()) {
+ throw css::beans::UnknownPropertyException(
+ PropertyName, static_cast< cppu::OWeakObject * >(this));
+ }
+ return child->asValue();
+}
+
+void Access::addPropertyChangeListener(
+ rtl::OUString const & aPropertyName,
+ css::uno::Reference< css::beans::XPropertyChangeListener > const &
+ xListener)
+ throw (
+ css::beans::UnknownPropertyException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ {
+ osl::MutexGuard g(lock);
+ if (!xListener.is()) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("null listener")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ checkKnownProperty(aPropertyName);
+ if (!disposed_) {
+ propertyChangeListeners_[aPropertyName].insert(xListener);
+ return;
+ }
+ }
+ try {
+ xListener->disposing(
+ css::lang::EventObject(static_cast< cppu::OWeakObject * >(this)));
+ } catch (css::lang::DisposedException &) {}
+}
+
+void Access::removePropertyChangeListener(
+ rtl::OUString const & aPropertyName,
+ css::uno::Reference< css::beans::XPropertyChangeListener > const &
+ aListener)
+ throw (
+ css::beans::UnknownPropertyException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ osl::MutexGuard g(lock);
+ checkKnownProperty(aPropertyName);
+ PropertyChangeListeners::iterator i(
+ propertyChangeListeners_.find(aPropertyName));
+ if (i != propertyChangeListeners_.end()) {
+ PropertyChangeListenersElement::iterator j(i->second.find(aListener));
+ if (j != i->second.end()) {
+ i->second.erase(j);
+ if (i->second.empty()) {
+ propertyChangeListeners_.erase(i);
+ }
+ }
+ }
+}
+
+void Access::addVetoableChangeListener(
+ rtl::OUString const & PropertyName,
+ css::uno::Reference< css::beans::XVetoableChangeListener > const &
+ aListener)
+ throw (
+ css::beans::UnknownPropertyException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ {
+ osl::MutexGuard g(lock);
+ if (!aListener.is()) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("null listener")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ checkKnownProperty(PropertyName);
+ if (!disposed_) {
+ vetoableChangeListeners_[PropertyName].insert(aListener);
+ //TODO: actually call vetoableChangeListeners_
+ return;
+ }
+ }
+ try {
+ aListener->disposing(
+ css::lang::EventObject(static_cast< cppu::OWeakObject * >(this)));
+ } catch (css::lang::DisposedException &) {}
+}
+
+void Access::removeVetoableChangeListener(
+ rtl::OUString const & PropertyName,
+ css::uno::Reference< css::beans::XVetoableChangeListener > const &
+ aListener)
+ throw (
+ css::beans::UnknownPropertyException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ osl::MutexGuard g(lock);
+ checkKnownProperty(PropertyName);
+ VetoableChangeListeners::iterator i(
+ vetoableChangeListeners_.find(PropertyName));
+ if (i != vetoableChangeListeners_.end()) {
+ VetoableChangeListenersElement::iterator j(i->second.find(aListener));
+ if (j != i->second.end()) {
+ i->second.erase(j);
+ if (i->second.empty()) {
+ vetoableChangeListeners_.erase(i);
+ }
+ }
+ }
+}
+
+void Access::setPropertyValues(
+ css::uno::Sequence< rtl::OUString > const & aPropertyNames,
+ css::uno::Sequence< css::uno::Any > const & aValues)
+ throw (
+ css::beans::PropertyVetoException, css::lang::IllegalArgumentException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ Broadcaster bc;
+ {
+ osl::MutexGuard g(lock);
+ if (!getRootAccess()->isUpdate()) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr setPropertyValues on non-update access")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ if (aPropertyNames.getLength() != aValues.getLength()) {
+ throw css::lang::IllegalArgumentException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr setPropertyValues: aPropertyNames/aValues of"
+ " different length")),
+ static_cast< cppu::OWeakObject * >(this), -1);
+ }
+ Modifications localMods;
+ for (sal_Int32 i = 0; i < aPropertyNames.getLength(); ++i) {
+ if (!setChildProperty(aPropertyNames[i], aValues[i], &localMods)) {
+ throw css::lang::IllegalArgumentException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr setPropertyValues inappropriate property"
+ " name")),
+ static_cast< cppu::OWeakObject * >(this), -1);
+ }
+ }
+ getNotificationRoot()->initBroadcaster(localMods.getRoot(), &bc);
+ }
+ bc.send();
+}
+
+css::uno::Sequence< css::uno::Any > Access::getPropertyValues(
+ css::uno::Sequence< rtl::OUString > const & aPropertyNames)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ osl::MutexGuard g(lock);
+ css::uno::Sequence< css::uno::Any > vals(aPropertyNames.getLength());
+ for (sal_Int32 i = 0; i < aPropertyNames.getLength(); ++i) {
+ rtl::Reference< ChildAccess > child(getChild(aPropertyNames[i]));
+ if (!child.is()) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr getPropertyValues inappropriate property"
+ " name")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ vals[i] = child->asValue();
+ }
+ return vals;
+}
+
+void Access::addPropertiesChangeListener(
+ css::uno::Sequence< rtl::OUString > const &,
+ css::uno::Reference< css::beans::XPropertiesChangeListener > const &
+ xListener)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ {
+ osl::MutexGuard g(lock);
+ if (!xListener.is()) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("null listener")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ if (!disposed_) {
+ propertiesChangeListeners_.insert(xListener);
+ return;
+ }
+ }
+ try {
+ xListener->disposing(
+ css::lang::EventObject(static_cast< cppu::OWeakObject * >(this)));
+ } catch (css::lang::DisposedException &) {}
+}
+
+void Access::removePropertiesChangeListener(
+ css::uno::Reference< css::beans::XPropertiesChangeListener > const &
+ xListener)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ osl::MutexGuard g(lock);
+ PropertiesChangeListeners::iterator i(
+ propertiesChangeListeners_.find(xListener));
+ if (i != propertiesChangeListeners_.end()) {
+ propertiesChangeListeners_.erase(i);
+ }
+}
+
+void Access::firePropertiesChangeEvent(
+ css::uno::Sequence< rtl::OUString > const & aPropertyNames,
+ css::uno::Reference< css::beans::XPropertiesChangeListener > const &
+ xListener)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ css::uno::Sequence< css::beans::PropertyChangeEvent > events(
+ aPropertyNames.getLength());
+ for (sal_Int32 i = 0; i < events.getLength(); ++i) {
+ events[i].Source = static_cast< cppu::OWeakObject * >(this);
+ events[i].PropertyName = aPropertyNames[i];
+ events[i].Further = false;
+ events[i].PropertyHandle = -1;
+ }
+ xListener->propertiesChange(events);
+}
+
+css::uno::Reference< css::beans::XHierarchicalPropertySetInfo >
+Access::getHierarchicalPropertySetInfo() throw (css::uno::RuntimeException) {
+ OSL_ASSERT(thisIs(IS_GROUP));
+ return this;
+}
+
+void Access::setHierarchicalPropertyValue(
+ rtl::OUString const & aHierarchicalPropertyName,
+ css::uno::Any const & aValue)
+ throw (
+ css::beans::UnknownPropertyException, css::beans::PropertyVetoException,
+ css::lang::IllegalArgumentException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ Broadcaster bc;
+ {
+ osl::MutexGuard g(lock);
+ if (!getRootAccess()->isUpdate()) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr setHierarchicalPropertyName on non-update"
+ " access")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ rtl::Reference< ChildAccess > child(
+ getSubChild(aHierarchicalPropertyName));
+ if (!child.is()) {
+ throw css::beans::UnknownPropertyException(
+ aHierarchicalPropertyName,
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ child->checkFinalized();
+ Modifications localMods;
+ child->setProperty(aValue, &localMods);
+ getNotificationRoot()->initBroadcaster(localMods.getRoot(), &bc);
+ }
+ bc.send();
+}
+
+css::uno::Any Access::getHierarchicalPropertyValue(
+ rtl::OUString const & aHierarchicalPropertyName)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::IllegalArgumentException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ osl::MutexGuard g(lock);
+ rtl::Reference< ChildAccess > child(getSubChild(aHierarchicalPropertyName));
+ if (!child.is()) {
+ throw css::beans::UnknownPropertyException(
+ aHierarchicalPropertyName,
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ return child->asValue();
+}
+
+void Access::setHierarchicalPropertyValues(
+ css::uno::Sequence< rtl::OUString > const & aHierarchicalPropertyNames,
+ css::uno::Sequence< css::uno::Any > const & Values)
+ throw (
+ css::beans::PropertyVetoException, css::lang::IllegalArgumentException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ Broadcaster bc;
+ {
+ osl::MutexGuard g(lock);
+ if (!getRootAccess()->isUpdate()) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr setPropertyValues on non-update access")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ if (aHierarchicalPropertyNames.getLength() != Values.getLength()) {
+ throw css::lang::IllegalArgumentException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr setHierarchicalPropertyValues:"
+ " aHierarchicalPropertyNames/Values of different"
+ " length")),
+ static_cast< cppu::OWeakObject * >(this), -1);
+ }
+ Modifications localMods;
+ for (sal_Int32 i = 0; i < aHierarchicalPropertyNames.getLength(); ++i) {
+ rtl::Reference< ChildAccess > child(
+ getSubChild(aHierarchicalPropertyNames[i]));
+ if (!child.is()) {
+ throw css::lang::IllegalArgumentException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr setHierarchicalPropertyValues"
+ " inappropriate property name")),
+ static_cast< cppu::OWeakObject * >(this), -1);
+ }
+ child->checkFinalized();
+ child->setProperty(Values[i], &localMods);
+ }
+ getNotificationRoot()->initBroadcaster(localMods.getRoot(), &bc);
+ }
+ bc.send();
+}
+
+css::uno::Sequence< css::uno::Any > Access::getHierarchicalPropertyValues(
+ css::uno::Sequence< rtl::OUString > const & aHierarchicalPropertyNames)
+ throw (
+ css::lang::IllegalArgumentException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ osl::MutexGuard g(lock);
+ css::uno::Sequence< css::uno::Any > vals(
+ aHierarchicalPropertyNames.getLength());
+ for (sal_Int32 i = 0; i < aHierarchicalPropertyNames.getLength(); ++i) {
+ rtl::Reference< ChildAccess > child(
+ getSubChild(aHierarchicalPropertyNames[i]));
+ if (!child.is()) {
+ throw css::lang::IllegalArgumentException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr getHierarchicalPropertyValues inappropriate"
+ " hierarchical property name")),
+ static_cast< cppu::OWeakObject * >(this), -1);
+ }
+ vals[i] = child->asValue();
+ }
+ return vals;
+}
+
+css::beans::Property Access::getPropertyByHierarchicalName(
+ rtl::OUString const & aHierarchicalName)
+ throw (css::beans::UnknownPropertyException, css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ osl::MutexGuard g(lock);
+ rtl::Reference< ChildAccess > child(getSubChild(aHierarchicalName));
+ if (!child.is()) {
+ throw css::beans::UnknownPropertyException(
+ aHierarchicalName, static_cast< cppu::OWeakObject * >(this));
+ }
+ return child->asProperty();
+}
+
+sal_Bool Access::hasPropertyByHierarchicalName(
+ rtl::OUString const & aHierarchicalName)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_GROUP));
+ osl::MutexGuard g(lock);
+ return getSubChild(aHierarchicalName).is();
+}
+
+void Access::replaceByName(
+ rtl::OUString const & aName, css::uno::Any const & aElement)
+ throw (
+ css::lang::IllegalArgumentException,
+ css::container::NoSuchElementException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_UPDATE));
+ Broadcaster bc;
+ {
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ rtl::Reference< ChildAccess > child(getChild(aName));
+ if (!child.is()) {
+ throw css::container::NoSuchElementException(
+ aName, static_cast< cppu::OWeakObject * >(this));
+ }
+ child->checkFinalized();
+ Modifications localMods;
+ switch (getNode()->kind()) {
+ case Node::KIND_LOCALIZED_PROPERTY:
+ case Node::KIND_GROUP:
+ child->setProperty(aElement, &localMods);
+ break;
+ case Node::KIND_SET:
+ {
+ rtl::Reference< ChildAccess > freeAcc(
+ getFreeSetMember(aElement));
+ rtl::Reference< RootAccess > root(getRootAccess());
+ localMods.add(child->getRelativePath());
+ child->unbind(); // must not throw
+ freeAcc->bind(root, this, aName); // must not throw
+ markChildAsModified(freeAcc); //TODO: must not throw
+ }
+ break;
+ default:
+ OSL_ASSERT(false); // this cannot happen
+ break;
+ }
+ getNotificationRoot()->initBroadcaster(localMods.getRoot(), &bc);
+ }
+ bc.send();
+}
+
+void Access::insertByName(
+ rtl::OUString const & aName, css::uno::Any const & aElement)
+ throw (
+ css::lang::IllegalArgumentException,
+ css::container::ElementExistException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_EXTENSIBLE|IS_UPDATE));
+ Broadcaster bc;
+ {
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ checkFinalized();
+ if (getChild(aName).is()) {
+ throw css::container::ElementExistException(
+ aName, static_cast< cppu::OWeakObject * >(this));
+ }
+ Modifications localMods;
+ switch (getNode()->kind()) {
+ case Node::KIND_LOCALIZED_PROPERTY:
+ insertLocalizedValueChild(aName, aElement, &localMods);
+ break;
+ case Node::KIND_GROUP:
+ {
+ checkValue(aElement, TYPE_ANY, true);
+ rtl::Reference< ChildAccess > child(
+ new ChildAccess(
+ components_, getRootAccess(), this, aName,
+ new PropertyNode(
+ Data::NO_LAYER, TYPE_ANY, true, aElement, true)));
+ markChildAsModified(child);
+ localMods.add(child->getRelativePath());
+ }
+ break;
+ case Node::KIND_SET:
+ {
+ rtl::Reference< ChildAccess > freeAcc(
+ getFreeSetMember(aElement));
+ freeAcc->bind(getRootAccess(), this, aName); // must not throw
+ markChildAsModified(freeAcc); //TODO: must not throw
+ localMods.add(freeAcc->getRelativePath());
+ }
+ break;
+ default:
+ OSL_ASSERT(false); // this cannot happen
+ break;
+ }
+ getNotificationRoot()->initBroadcaster(localMods.getRoot(), &bc);
+ }
+ bc.send();
+}
+
+void Access::removeByName(rtl::OUString const & aName)
+ throw (
+ css::container::NoSuchElementException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_EXTENSIBLE|IS_UPDATE));
+ Broadcaster bc;
+ {
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ rtl::Reference< ChildAccess > child(getChild(aName));
+ if (!child.is() || child->isFinalized() ||
+ child->getNode()->getMandatory() != Data::NO_LAYER)
+ {
+ throw css::container::NoSuchElementException(
+ aName, static_cast< cppu::OWeakObject * >(this));
+ }
+ if (getNode()->kind() == Node::KIND_GROUP) {
+ rtl::Reference< Node > p(child->getNode());
+ if (p->kind() != Node::KIND_PROPERTY ||
+ !dynamic_cast< PropertyNode * >(p.get())->isExtension())
+ {
+ throw css::container::NoSuchElementException(
+ aName, static_cast< cppu::OWeakObject * >(this));
+ }
+ }
+ Modifications localMods;
+ localMods.add(child->getRelativePath());
+ // unbind() modifies the parent chain that markChildAsModified() walks,
+ // so order is important:
+ markChildAsModified(child); //TODO: must not throw
+ child->unbind();
+ getNotificationRoot()->initBroadcaster(localMods.getRoot(), &bc);
+ }
+ bc.send();
+}
+
+css::uno::Reference< css::uno::XInterface > Access::createInstance()
+ throw (css::uno::Exception, css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_SET|IS_UPDATE));
+ rtl::OUString tmplName(
+ dynamic_cast< SetNode * >(getNode().get())->getDefaultTemplateName());
+ rtl::Reference< Node > tmpl(
+ components_.getTemplate(Data::NO_LAYER, tmplName));
+ if (!tmpl.is()) {
+ throw css::uno::Exception(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("unknown template ")) +
+ tmplName),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ rtl::Reference< Node > node(tmpl->clone());
+ node->setLayer(Data::NO_LAYER);
+ return static_cast< cppu::OWeakObject * >(
+ new ChildAccess(components_, getRootAccess(), node));
+}
+
+css::uno::Reference< css::uno::XInterface > Access::createInstanceWithArguments(
+ css::uno::Sequence< css::uno::Any > const & aArguments)
+ throw (css::uno::Exception, css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_SET|IS_UPDATE));
+ if (aArguments.getLength() != 0) {
+ throw css::uno::Exception(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configuration SimpleSetUpdate createInstanceWithArguments"
+ " must not specify any arguments")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ return createInstance();
+}
+
+rtl::Reference< ChildAccess > Access::getModifiedChild(
+ ModifiedChildren::iterator const & childIterator)
+{
+ return (childIterator->second.child->getParentAccess() == this &&
+ (childIterator->second.child->getNameInternal() ==
+ childIterator->first))
+ ? childIterator->second.child : rtl::Reference< ChildAccess >();
+}
+
+rtl::Reference< ChildAccess > Access::getUnmodifiedChild(
+ rtl::OUString const & name)
+{
+ OSL_ASSERT(modifiedChildren_.find(name) == modifiedChildren_.end());
+ rtl::Reference< Node > node(getNode()->getMember(name));
+ if (!node.is()) {
+ return rtl::Reference< ChildAccess >();
+ }
+ WeakChildMap::iterator i(cachedChildren_.find(name));
+ if (i != cachedChildren_.end()) {
+ rtl::Reference< ChildAccess > child;
+ if (i->second->acquireCounting() > 1) {
+ child.set(i->second); // must not throw
+ }
+ i->second->releaseNondeleting();
+ if (child.is()) {
+ child->setNode(node);
+ return child;
+ }
+ }
+ rtl::Reference< ChildAccess > child(
+ new ChildAccess(components_, getRootAccess(), this, name, node));
+ cachedChildren_[name] = child.get();
+ return child;
+}
+
+rtl::Reference< ChildAccess > Access::getSubChild(rtl::OUString const & path) {
+ rtl::OUString name;
+ bool setElement;
+ rtl::OUString templateName;
+ sal_Int32 i = Data::parseSegment(
+ path, 0, &name, &setElement, &templateName);
+ if (i == -1 || (i != path.getLength() && path[i] != '/')) {
+ return rtl::Reference< ChildAccess >();
+ }
+ rtl::Reference< ChildAccess > child(getChild(name));
+ if (!child.is()) {
+ return rtl::Reference< ChildAccess >();
+ }
+ if (setElement) {
+ rtl::Reference< Node > p(getNode());
+ switch (p->kind()) {
+ case Node::KIND_LOCALIZED_PROPERTY:
+ if (!Components::allLocales(getRootAccess()->getLocale()) ||
+ templateName.getLength() != 0)
+ {
+ return rtl::Reference< ChildAccess >();
+ }
+ break;
+ case Node::KIND_SET:
+ if (templateName.getLength() != 0 &&
+ !dynamic_cast< SetNode * >(p.get())->isValidTemplate(
+ templateName))
+ {
+ return rtl::Reference< ChildAccess >();
+ }
+ break;
+ default:
+ return rtl::Reference< ChildAccess >();
+ }
+ }
+ // For backwards compatibility, ignore a final slash after non-value nodes:
+ return child->isValue()
+ ? (i == path.getLength() ? child : rtl::Reference< ChildAccess >())
+ : (i >= path.getLength() - 1
+ ? child : child->getSubChild(path.copy(i + 1)));
+}
+
+bool Access::setChildProperty(
+ rtl::OUString const & name, css::uno::Any const & value,
+ Modifications * localModifications)
+{
+ OSL_ASSERT(localModifications != 0);
+ rtl::Reference< ChildAccess > child(getChild(name));
+ if (!child.is()) {
+ return false;
+ }
+ child->checkFinalized();
+ child->setProperty(value, localModifications);
+ return true;
+}
+
+css::beans::Property Access::asProperty() {
+ css::uno::Type type;
+ bool nillable;
+ bool removable;
+ rtl::Reference< Node > p(getNode());
+ switch (p->kind()) {
+ case Node::KIND_PROPERTY:
+ {
+ PropertyNode * prop = dynamic_cast< PropertyNode * >(p.get());
+ type = mapType(prop->getStaticType());
+ nillable = prop->isNillable();
+ removable = prop->isExtension();
+ }
+ break;
+ case Node::KIND_LOCALIZED_PROPERTY:
+ {
+ LocalizedPropertyNode * locprop =
+ dynamic_cast< LocalizedPropertyNode *>(p.get());
+ if (Components::allLocales(getRootAccess()->getLocale())) {
+ type = cppu::UnoType< css::uno::XInterface >::get();
+ //TODO: correct?
+ removable = false;
+ } else {
+ type = mapType(locprop->getStaticType());
+ removable = false; //TODO ???
+ }
+ nillable = locprop->isNillable();
+ }
+ break;
+ case Node::KIND_LOCALIZED_VALUE:
+ {
+ LocalizedPropertyNode * locprop =
+ dynamic_cast< LocalizedPropertyNode * >(getParentNode().get());
+ type = mapType(locprop->getStaticType());
+ nillable = locprop->isNillable();
+ removable = false; //TODO ???
+ }
+ break;
+ default:
+ type = cppu::UnoType< css::uno::XInterface >::get(); //TODO: correct?
+ nillable = false;
+ removable = getParentNode()->kind() == Node::KIND_SET;
+ break;
+ }
+ return css::beans::Property(
+ getNameInternal(), -1, type,
+ (css::beans::PropertyAttribute::BOUND | //TODO: correct for group/set?
+ css::beans::PropertyAttribute::CONSTRAINED |
+ (nillable ? css::beans::PropertyAttribute::MAYBEVOID : 0) |
+ (getRootAccess()->isUpdate()
+ ? (removable ? css::beans::PropertyAttribute::REMOVEABLE : 0)
+ : css::beans::PropertyAttribute::READONLY))); //TODO: MAYBEDEFAULT
+}
+
+void Access::checkFinalized() {
+ if (isFinalized()) {
+ throw css::lang::IllegalArgumentException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr modification of finalized item")),
+ static_cast< cppu::OWeakObject * >(this), -1);
+ }
+}
+
+void Access::checkKnownProperty(rtl::OUString const & descriptor) {
+ if (descriptor.getLength() == 0) {
+ return;
+ }
+ rtl::Reference< ChildAccess > child(getChild(descriptor));
+ if (child.is()) {
+ switch (child->getNode()->kind()) {
+ case Node::KIND_PROPERTY:
+ return;
+ case Node::KIND_LOCALIZED_PROPERTY:
+ if (!Components::allLocales(getRootAccess()->getLocale())) {
+ return;
+ }
+ break;
+ case Node::KIND_LOCALIZED_VALUE:
+ if (Components::allLocales(getRootAccess()->getLocale())) {
+ return;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ throw css::beans::UnknownPropertyException(
+ descriptor, static_cast< cppu::OWeakObject * >(this));
+}
+
+rtl::Reference< ChildAccess > Access::getFreeSetMember(
+ css::uno::Any const & value)
+{
+ rtl::Reference< ChildAccess > freeAcc;
+ css::uno::Reference< css::lang::XUnoTunnel > tunnel;
+ value >>= tunnel;
+ if (tunnel.is()) {
+ freeAcc.set(
+ reinterpret_cast< ChildAccess * >(
+ tunnel->getSomething(ChildAccess::getTunnelId())));
+ }
+ if (!freeAcc.is() || freeAcc->getParentAccess().is() ||
+ (freeAcc->isInTransaction() &&
+ freeAcc->getRootAccess() != getRootAccess()))
+ {
+ throw css::lang::IllegalArgumentException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr inappropriate set element")),
+ static_cast< cppu::OWeakObject * >(this), 1);
+ }
+ OSL_ASSERT(dynamic_cast< SetNode * >(getNode().get()) != 0);
+ if (!dynamic_cast< SetNode * >(getNode().get())->isValidTemplate(
+ freeAcc->getNode()->getTemplateName()))
+ {
+ throw css::lang::IllegalArgumentException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr inappropriate set element")),
+ static_cast< cppu::OWeakObject * >(this), 1);
+ }
+ return freeAcc;
+}
+
+rtl::Reference< Access > Access::getNotificationRoot() {
+ for (rtl::Reference< Access > p(this);;) {
+ rtl::Reference< Access > parent(p->getParentAccess());
+ if (!parent.is()) {
+ return p;
+ }
+ p = parent;
+ }
+}
+
+#if OSL_DEBUG_LEVEL > 0
+bool Access::thisIs(int what) {
+ osl::MutexGuard g(lock);
+ rtl::Reference< Node > p(getNode());
+ Node::Kind k(p->kind());
+ return k != Node::KIND_PROPERTY && k != Node::KIND_LOCALIZED_VALUE &&
+ ((what & IS_GROUP) == 0 || k == Node::KIND_GROUP) &&
+ ((what & IS_SET) == 0 || k == Node::KIND_SET) &&
+ ((what & IS_EXTENSIBLE) == 0 || k != Node::KIND_GROUP ||
+ dynamic_cast< GroupNode * >(p.get())->isExtensible()) &&
+ ((what & IS_GROUP_MEMBER) == 0 ||
+ getParentNode()->kind() == Node::KIND_GROUP) ||
+ ((what & IS_SET_MEMBER) == 0 ||
+ getParentNode()->kind() == Node::KIND_SET) ||
+ ((what & IS_UPDATE) == 0 || getRootAccess()->isUpdate());
+}
+#endif
+
+}
diff --git a/configmgr/source/access.hxx b/configmgr/source/access.hxx
new file mode 100644
index 0000000000..8c10aa8cce
--- /dev/null
+++ b/configmgr/source/access.hxx
@@ -0,0 +1,582 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_ACCESS_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_ACCESS_HXX
+
+#include "sal/config.h"
+
+#include <map>
+#include <set>
+#include <vector>
+
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/beans/PropertyVetoException.hpp"
+#include "com/sun/star/beans/UnknownPropertyException.hpp"
+#include "com/sun/star/beans/XExactName.hpp"
+#include "com/sun/star/beans/XHierarchicalPropertySet.hpp"
+#include "com/sun/star/beans/XHierarchicalPropertySetInfo.hpp"
+#include "com/sun/star/beans/XMultiHierarchicalPropertySet.hpp"
+#include "com/sun/star/beans/XMultiPropertySet.hpp"
+#include "com/sun/star/beans/XProperty.hpp"
+#include "com/sun/star/beans/XPropertySet.hpp"
+#include "com/sun/star/beans/XPropertySetInfo.hpp"
+#include "com/sun/star/container/ElementExistException.hpp"
+#include "com/sun/star/container/NoSuchElementException.hpp"
+#include "com/sun/star/container/XContainer.hpp"
+#include "com/sun/star/container/XHierarchicalName.hpp"
+#include "com/sun/star/container/XHierarchicalNameAccess.hpp"
+#include "com/sun/star/container/XNameContainer.hpp"
+#include "com/sun/star/container/XNamed.hpp"
+#include "com/sun/star/lang/IllegalArgumentException.hpp"
+#include "com/sun/star/lang/NoSupportException.hpp"
+#include "com/sun/star/lang/WrappedTargetException.hpp"
+#include "com/sun/star/lang/XComponent.hpp"
+#include "com/sun/star/lang/XServiceInfo.hpp"
+#include "com/sun/star/lang/XTypeProvider.hpp"
+#include "com/sun/star/lang/XSingleServiceFactory.hpp"
+#include "com/sun/star/uno/Exception.hpp"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "cppuhelper/weak.hxx"
+#include "osl/interlck.h"
+#include "rtl/ref.hxx"
+#include "sal/types.h"
+
+#include "modifications.hxx"
+#include "path.hxx"
+#include "type.hxx"
+
+namespace com { namespace sun { namespace star {
+ namespace beans {
+ class XHierarchicalPropertySetInfo;
+ class XPropertiesChangeListener;
+ class XPropertyChangeListener;
+ class XVetoableChangeListener;
+ struct Property;
+ }
+ namespace container { class XContainerListener; }
+ namespace lang { class XEventListener; }
+ namespace uno {
+ class Any;
+ class Type;
+ class XInterface;
+ }
+ namespace util { struct ElementChange; }
+} } }
+namespace rtl { class OUString; }
+
+namespace configmgr {
+
+class Broadcaster;
+class Change;
+class ChildAccess;
+class Components;
+class Node;
+class RootAccess;
+
+class Access:
+ public cppu::OWeakObject, public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::lang::XServiceInfo,
+ public com::sun::star::lang::XComponent,
+ public com::sun::star::container::XHierarchicalNameAccess,
+ public com::sun::star::container::XContainer,
+ public com::sun::star::beans::XExactName,
+ public com::sun::star::beans::XPropertySetInfo,
+ public com::sun::star::container::XHierarchicalName,
+ public com::sun::star::container::XNamed,
+ public com::sun::star::beans::XProperty,
+ public com::sun::star::beans::XPropertySet,
+ public com::sun::star::beans::XMultiPropertySet,
+ public com::sun::star::beans::XHierarchicalPropertySet,
+ public com::sun::star::beans::XMultiHierarchicalPropertySet,
+ public com::sun::star::beans::XHierarchicalPropertySetInfo,
+ public com::sun::star::container::XNameContainer,
+ public com::sun::star::lang::XSingleServiceFactory,
+ private boost::noncopyable
+{
+public:
+ oslInterlockedCount acquireCounting();
+
+ void releaseNondeleting();
+
+ bool isValue();
+
+ void markChildAsModified(rtl::Reference< ChildAccess > const & child);
+
+ void releaseChild(rtl::OUString const & name);
+
+ virtual Path getAbsolutePath() = 0;
+
+ virtual Path getRelativePath() = 0;
+
+ virtual rtl::OUString getRelativePathRepresentation() = 0;
+
+ virtual rtl::Reference< Node > getNode() = 0;
+
+ virtual bool isFinalized() = 0;
+
+ virtual void initBroadcaster(
+ Modifications::Node const & modifications, Broadcaster * broadcaster);
+
+ using OWeakObject::acquire;
+ using OWeakObject::release;
+
+protected:
+ Access(Components & components);
+
+ virtual ~Access();
+
+ virtual rtl::OUString getNameInternal() = 0;
+
+ virtual rtl::Reference< RootAccess > getRootAccess() = 0;
+
+ virtual rtl::Reference< Access > getParentAccess() = 0;
+
+ virtual void addTypes(std::vector< com::sun::star::uno::Type > * types)
+ const = 0;
+
+ virtual void addSupportedServiceNames(
+ std::vector< rtl::OUString > * services) = 0;
+
+ virtual void initDisposeBroadcaster(Broadcaster * broadcaster);
+
+ virtual void clearListeners() throw ();
+
+ virtual com::sun::star::uno::Any SAL_CALL queryInterface(
+ com::sun::star::uno::Type const & aType)
+ throw (com::sun::star::uno::RuntimeException);
+
+ Components & getComponents() const;
+
+ void checkLocalizedPropertyAccess();
+
+ rtl::Reference< Node > getParentNode();
+
+ rtl::Reference< ChildAccess > getChild(rtl::OUString const & name);
+
+ std::vector< rtl::Reference< ChildAccess > > getAllChildren();
+
+ void checkValue(
+ com::sun::star::uno::Any const & value, Type type, bool nillable);
+
+ void insertLocalizedValueChild(
+ rtl::OUString const & name, com::sun::star::uno::Any const & value,
+ Modifications * localModifications);
+
+ void reportChildChanges(
+ std::vector< com::sun::star::util::ElementChange > * changes);
+
+ void commitChildChanges(bool valid, Modifications * globalModifications);
+
+ void initBroadcasterAndChanges(
+ Modifications::Node const & modifications, Broadcaster * broadcaster,
+ std::vector< com::sun::star::util::ElementChange > * changes);
+
+ bool isDisposed() const;
+
+private:
+ struct ModifiedChild {
+ rtl::Reference< ChildAccess > child;
+ bool directlyModified;
+
+ ModifiedChild();
+
+ ModifiedChild(
+ rtl::Reference< ChildAccess > const & theChild,
+ bool theDirectlyModified);
+ };
+
+ typedef std::map< rtl::OUString, ModifiedChild > ModifiedChildren;
+
+ virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL
+ getTypes() throw (com::sun::star::uno::RuntimeException);
+
+ virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
+ getImplementationId() throw (com::sun::star::uno::RuntimeException);
+
+ virtual rtl::OUString SAL_CALL getImplementationName()
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL supportsService(rtl::OUString const & ServiceName)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL
+ getSupportedServiceNames() throw (com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL dispose()
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL addEventListener(
+ com::sun::star::uno::Reference< com::sun::star::lang::XEventListener >
+ const & xListener)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL removeEventListener(
+ com::sun::star::uno::Reference< com::sun::star::lang::XEventListener >
+ const & aListener)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual com::sun::star::uno::Type SAL_CALL getElementType()
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL hasElements()
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual com::sun::star::uno::Any SAL_CALL getByName(
+ rtl::OUString const & aName)
+ throw (
+ com::sun::star::container::NoSuchElementException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL
+ getElementNames() throw (com::sun::star::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL hasByName(rtl::OUString const & aName)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual com::sun::star::uno::Any SAL_CALL getByHierarchicalName(
+ rtl::OUString const & aName)
+ throw (
+ com::sun::star::container::NoSuchElementException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL hasByHierarchicalName(rtl::OUString const & aName)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL addContainerListener(
+ com::sun::star::uno::Reference<
+ com::sun::star::container::XContainerListener > const & xListener)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL removeContainerListener(
+ com::sun::star::uno::Reference<
+ com::sun::star::container::XContainerListener > const & xListener)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual rtl::OUString SAL_CALL getExactName(
+ rtl::OUString const & aApproximateName)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual com::sun::star::uno::Sequence< com::sun::star::beans::Property >
+ SAL_CALL getProperties() throw (com::sun::star::uno::RuntimeException);
+
+ virtual com::sun::star::beans::Property SAL_CALL getPropertyByName(
+ rtl::OUString const & aName)
+ throw (
+ com::sun::star::beans::UnknownPropertyException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL hasPropertyByName(rtl::OUString const & Name)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual rtl::OUString SAL_CALL getHierarchicalName()
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual rtl::OUString SAL_CALL composeHierarchicalName(
+ rtl::OUString const & aRelativeName)
+ throw (
+ com::sun::star::lang::IllegalArgumentException,
+ com::sun::star::lang::NoSupportException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual rtl::OUString SAL_CALL getName()
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL setName(rtl::OUString const & aName)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual com::sun::star::beans::Property SAL_CALL getAsProperty()
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual
+ com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo >
+ SAL_CALL getPropertySetInfo() throw (com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL setPropertyValue(
+ rtl::OUString const & aPropertyName,
+ com::sun::star::uno::Any const & aValue)
+ throw (
+ com::sun::star::beans::UnknownPropertyException,
+ com::sun::star::beans::PropertyVetoException,
+ com::sun::star::lang::IllegalArgumentException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual com::sun::star::uno::Any SAL_CALL getPropertyValue(
+ rtl::OUString const & PropertyName)
+ throw (
+ com::sun::star::beans::UnknownPropertyException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL addPropertyChangeListener(
+ rtl::OUString const & aPropertyName,
+ com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertyChangeListener > const & xListener)
+ throw (
+ com::sun::star::beans::UnknownPropertyException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL removePropertyChangeListener(
+ rtl::OUString const & aPropertyName,
+ com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertyChangeListener > const & aListener)
+ throw (
+ com::sun::star::beans::UnknownPropertyException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL addVetoableChangeListener(
+ rtl::OUString const & PropertyName,
+ com::sun::star::uno::Reference<
+ com::sun::star::beans::XVetoableChangeListener > const & aListener)
+ throw (
+ com::sun::star::beans::UnknownPropertyException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL removeVetoableChangeListener(
+ rtl::OUString const & PropertyName,
+ com::sun::star::uno::Reference<
+ com::sun::star::beans::XVetoableChangeListener > const & aListener)
+ throw (
+ com::sun::star::beans::UnknownPropertyException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL setPropertyValues(
+ com::sun::star::uno::Sequence< rtl::OUString > const & aPropertyNames,
+ com::sun::star::uno::Sequence< com::sun::star::uno::Any > const &
+ aValues)
+ throw (
+ com::sun::star::beans::PropertyVetoException,
+ com::sun::star::lang::IllegalArgumentException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual com::sun::star::uno::Sequence< com::sun::star::uno::Any > SAL_CALL
+ getPropertyValues(
+ com::sun::star::uno::Sequence< rtl::OUString > const & aPropertyNames)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL addPropertiesChangeListener(
+ com::sun::star::uno::Sequence< rtl::OUString > const & aPropertyNames,
+ com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertiesChangeListener > const &
+ xListener)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL removePropertiesChangeListener(
+ com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertiesChangeListener > const &
+ xListener)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL firePropertiesChangeEvent(
+ com::sun::star::uno::Sequence< rtl::OUString > const & aPropertyNames,
+ com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertiesChangeListener > const &
+ xListener)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual
+ com::sun::star::uno::Reference<
+ com::sun::star::beans::XHierarchicalPropertySetInfo > SAL_CALL
+ getHierarchicalPropertySetInfo()
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL setHierarchicalPropertyValue(
+ rtl::OUString const & aHierarchicalPropertyName,
+ com::sun::star::uno::Any const & aValue)
+ throw (
+ com::sun::star::beans::UnknownPropertyException,
+ com::sun::star::beans::PropertyVetoException,
+ com::sun::star::lang::IllegalArgumentException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual com::sun::star::uno::Any SAL_CALL getHierarchicalPropertyValue(
+ rtl::OUString const & aHierarchicalPropertyName)
+ throw (
+ com::sun::star::beans::UnknownPropertyException,
+ com::sun::star::lang::IllegalArgumentException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL setHierarchicalPropertyValues(
+ com::sun::star::uno::Sequence< rtl::OUString > const &
+ aHierarchicalPropertyNames,
+ com::sun::star::uno::Sequence< com::sun::star::uno::Any > const &
+ Values)
+ throw (
+ com::sun::star::beans::PropertyVetoException,
+ com::sun::star::lang::IllegalArgumentException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual com::sun::star::uno::Sequence< com::sun::star::uno::Any > SAL_CALL
+ getHierarchicalPropertyValues(
+ com::sun::star::uno::Sequence< rtl::OUString > const &
+ aHierarchicalPropertyNames)
+ throw (
+ com::sun::star::lang::IllegalArgumentException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual com::sun::star::beans::Property SAL_CALL
+ getPropertyByHierarchicalName(rtl::OUString const & aHierarchicalName)
+ throw (
+ com::sun::star::beans::UnknownPropertyException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL hasPropertyByHierarchicalName(
+ rtl::OUString const & aHierarchicalName)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL replaceByName(
+ rtl::OUString const & aName, com::sun::star::uno::Any const & aElement)
+ throw (
+ com::sun::star::lang::IllegalArgumentException,
+ com::sun::star::container::NoSuchElementException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL insertByName(
+ rtl::OUString const & aName, com::sun::star::uno::Any const & aElement)
+ throw (
+ com::sun::star::lang::IllegalArgumentException,
+ com::sun::star::container::ElementExistException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL removeByName(rtl::OUString const & aName)
+ throw (
+ com::sun::star::container::NoSuchElementException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
+ SAL_CALL createInstance()
+ throw (
+ com::sun::star::uno::Exception,
+ com::sun::star::uno::RuntimeException);
+
+ virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
+ SAL_CALL createInstanceWithArguments(
+ com::sun::star::uno::Sequence< com::sun::star::uno::Any > const &
+ aArguments)
+ throw (
+ com::sun::star::uno::Exception,
+ com::sun::star::uno::RuntimeException);
+
+ rtl::Reference< ChildAccess > getModifiedChild(
+ ModifiedChildren::iterator const & childIterator);
+
+ rtl::Reference< ChildAccess > getUnmodifiedChild(
+ rtl::OUString const & name);
+
+ rtl::Reference< ChildAccess > getSubChild(rtl::OUString const & path);
+
+ bool setChildProperty(
+ rtl::OUString const & name, com::sun::star::uno::Any const & value,
+ Modifications * localModifications);
+
+ com::sun::star::beans::Property asProperty();
+
+ void checkFinalized();
+
+ void checkKnownProperty(rtl::OUString const & descriptor);
+
+ rtl::Reference< ChildAccess > getFreeSetMember(
+ com::sun::star::uno::Any const & value);
+
+ rtl::Reference< Access > getNotificationRoot();
+
+ typedef std::map< rtl::OUString, ChildAccess * > WeakChildMap;
+
+ typedef
+ std::multiset<
+ com::sun::star::uno::Reference<
+ com::sun::star::lang::XEventListener > >
+ DisposeListeners;
+
+ typedef
+ std::multiset<
+ com::sun::star::uno::Reference<
+ com::sun::star::container::XContainerListener > >
+ ContainerListeners;
+
+ typedef
+ std::multiset<
+ com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertyChangeListener > >
+ PropertyChangeListenersElement;
+
+ typedef std::map< rtl::OUString, PropertyChangeListenersElement >
+ PropertyChangeListeners;
+
+ typedef
+ std::multiset<
+ com::sun::star::uno::Reference<
+ com::sun::star::beans::XVetoableChangeListener > >
+ VetoableChangeListenersElement;
+
+ typedef std::map< rtl::OUString, VetoableChangeListenersElement >
+ VetoableChangeListeners;
+
+ typedef
+ std::multiset<
+ com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertiesChangeListener > >
+ PropertiesChangeListeners;
+
+ Components & components_;
+ ModifiedChildren modifiedChildren_;
+ WeakChildMap cachedChildren_;
+ DisposeListeners disposeListeners_;
+ ContainerListeners containerListeners_;
+ PropertyChangeListeners propertyChangeListeners_;
+ VetoableChangeListeners vetoableChangeListeners_;
+ PropertiesChangeListeners propertiesChangeListeners_;
+ bool disposed_;
+
+#if OSL_DEBUG_LEVEL > 0
+protected:
+ enum {
+ IS_ANY = 0, IS_GROUP = 0x01, IS_SET = 0x02, IS_EXTENSIBLE = 0x04,
+ IS_GROUP_MEMBER = 0x08, IS_SET_MEMBER = 0x10, IS_UPDATE = 0x20 };
+ bool thisIs(int what);
+#endif
+};
+
+}
+
+#endif
diff --git a/configmgr/source/api/confevents.cxx b/configmgr/source/api/confevents.cxx
deleted file mode 100644
index 186141cd7b..0000000000
--- a/configmgr/source/api/confevents.cxx
+++ /dev/null
@@ -1,302 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <stdio.h>
-#include <string.h>
-#include "confevents.hxx"
-#include "configexcept.hxx"
-#include "treechangelist.hxx"
-#include <osl/diagnose.h>
-namespace configmgr
-{
- /////////////////////////////////////////////////////////////////////////
- ConfigChangeBroadcastHelper::ConfigChangeBroadcastHelper()
- {
- }
-
- ConfigChangeBroadcastHelper::~ConfigChangeBroadcastHelper()
- {
- OSL_ENSURE(m_aListeners.begin() == m_aListeners.end(), "Remaining listeners found - forgot to dispose ?");
- OSL_ENSURE(m_aPathMap.empty(), "Spurious mappings found");
- }
-
- /////////////////////////////////////////////////////////////////////////
- void ConfigChangeBroadcastHelper::dispose(TreeManager * pSource)
- {
- disposing(pSource);
- }
-
- /////////////////////////////////////////////////////////////////////////
- void ConfigChangeBroadcastHelper::addListener(configuration::AbsolutePath const& aName, rtl::Reference<INodeListener> const& pHandler)
- {
- add(aName, pHandler);
- }
-
- void ConfigChangeBroadcastHelper::removeListener(rtl::Reference<INodeListener> const& pHandler)
- {
- remove(pHandler);
- }
-
- /////////////////////////////////////////////////////////////////////////
- void ConfigChangeBroadcastHelper::broadcast(TreeChangeList const& anUpdate, sal_Bool bError, TreeManager * pSource)
- {
- dispatch(anUpdate, bError, pSource);
- }
-
-/////////////////////////////////////////////////////////////////////////
-void ConfigChangeBroadcastHelper::add(configuration::AbsolutePath const& aName, rtl::Reference<INodeListener> const& pListener)
-{
- osl::MutexGuard aGuard(m_aListeners.mutex);
-
- internal::BroadcastImplHelper<internal::NodeListenerInfo>::Interfaces::iterator aAdded = m_aListeners.addListener(internal::NodeListenerInfo(pListener));
- aAdded->addPath(aName);
- m_aPathMap.insert(PathMap::value_type(aName,aAdded));
-}
-
-/////////////////////////////////////////////////////////////////////////
-void ConfigChangeBroadcastHelper::remove(rtl::Reference<INodeListener> const& pListener)
-{
- osl::MutexGuard aGuard(m_aListeners.mutex);
-
- internal::BroadcastImplHelper<internal::NodeListenerInfo>::Interfaces::const_iterator const iter = m_aListeners.find(pListener);
- if (iter != m_aListeners.end())
- {
- internal::NodeListenerInfo::Pathes const& pathes = iter->pathList();
-
- // first clear the Path Map
- for(internal::NodeListenerInfo::Pathes::iterator itPath = pathes.begin(); itPath != pathes.end(); ++itPath)
- {
- std::pair<PathMap::iterator, PathMap::iterator> aRange = m_aPathMap.equal_range(*itPath);
- while (aRange.first != aRange.second)
- {
- PathMap::iterator cur = aRange.first++;
- if (cur->second == iter)
- m_aPathMap.erase(cur);
- }
- }
-
- // the remove the broadcast helper entry
- m_aListeners.removeListener(pListener);
- }
-}
-
-/////////////////////////////////////////////////////////////////////////
-// This should actually be available from the TreeChangeList
-/////////////////////////////////////////////////////////////////////////
-
-static Change const* resolvePath(Change const& rChange, configuration::RelativePath& aRelativePath, RemoveNode const*& pRemoveNode)
-{
- std::vector<configuration::Path::Component>::const_reverse_iterator aIter;
-
- OSL_ASSERT(pRemoveNode == NULL);
- pRemoveNode = NULL;
-
- Change const* pChange = &rChange;
- pRemoveNode = dynamic_cast<RemoveNode const*>(pChange);
-
- std::vector<configuration::Path::Component>::const_reverse_iterator const aEnd(aRelativePath.end());
-
- for( aIter = aRelativePath.begin();
- aIter != aEnd;
- ++aIter)
- {
- OSL_ASSERT( pChange != NULL );
-
- pChange = pChange->getSubChange(aIter->getName());
-
- if (pChange == NULL) break;
-
- OSL_ASSERT(pRemoveNode == NULL);
- OSL_ASSERT(aIter->getName() == pChange->getNodeName());
-
- pRemoveNode = dynamic_cast<RemoveNode const*>(pChange);
- }
-
- if (pRemoveNode)
- {
- aRelativePath = configuration::RelativePath( configuration::Path::Rep(aRelativePath.begin(),aIter) );
- OSL_ASSERT( aRelativePath.getLocalName().getName() == pRemoveNode->getNodeName());
- }
- else
- OSL_ASSERT( pChange == 0 || configuration::matches(aRelativePath, configuration::RelativePath( configuration::Path::Rep(aRelativePath.begin(),aIter) )) );
-
- return pChange;
-}
-
-/////////////////////////////////////////////////////////////////////////
-void ConfigChangeBroadcastHelper::dispatchInner
-(
- rtl::Reference<INodeListener> const& pTarget,
- configuration::AbsolutePath const& _aTargetPath,
- Change const& rBaseChange,
- configuration::AbsolutePath const& _aChangeLocation,
- sal_Bool , //_bError,
- TreeManager * pSource
-)
-{
- try
- {
- OSL_ASSERT(pTarget.is());
- OSL_ASSERT( configuration::Path::hasPrefix( _aTargetPath, _aChangeLocation ) );
-
- configuration::RelativePath aLocalPath = configuration::Path::stripPrefix( _aTargetPath, _aChangeLocation );
-
- RemoveNode const* pRemoved = 0;
- Change const* pTargetChange = resolvePath(rBaseChange, aLocalPath, pRemoved );
-
- OSL_ASSERT( !pTargetChange || matches(_aChangeLocation.compose(aLocalPath),_aTargetPath) );
-
- if (pRemoved)
- pTarget->nodeDeleted(_aChangeLocation.compose(aLocalPath), pSource);
-
- else if (pTargetChange)
- pTarget->nodeChanged(*pTargetChange, _aTargetPath, pSource);
-
- }
- catch (configuration::InvalidName& )
- {
- OSL_ENSURE(false,"ConfigChangeBroadcastHelper: Could not dispatch notification: context path mismatch");
- }
-}
-
-/////////////////////////////////////////////////////////////////////////
-void ConfigChangeBroadcastHelper::dispatchOuter
-(
- rtl::Reference<INodeListener> const& pTarget,
- configuration::AbsolutePath const& _aTargetPath,
- Change const& rBaseChange,
- configuration::AbsolutePath const& _aChangeLocation,
- sal_Bool , //_bError,
- TreeManager * pSource
-)
-{
- { (void)_aTargetPath; }
- OSL_ASSERT(pTarget.is());
- OSL_ASSERT( configuration::Path::hasPrefix( _aChangeLocation, _aTargetPath) );
-
- pTarget->nodeChanged(rBaseChange, _aChangeLocation, pSource);
-}
-
-/////////////////////////////////////////////////////////////////////////
-void ConfigChangeBroadcastHelper::dispatch(TreeChangeList const& rList_, sal_Bool _bError, TreeManager * pSource)
-{
- dispatch(rList_.root, rList_.getRootNodePath(),_bError, pSource);
-}
-
-/////////////////////////////////////////////////////////////////////////
-namespace
-{
- struct DispatchTarget
- {
- DispatchTarget(rtl::Reference<INodeListener> _pTarget, configuration::AbsolutePath const* _pDispatchPath)
- : pTarget(_pTarget), pDispatchPath( _pDispatchPath) {}
-
- rtl::Reference<INodeListener> pTarget;
- configuration::AbsolutePath const* pDispatchPath;
- };
-}
-/////////////////////////////////////////////////////////////////////////
-void ConfigChangeBroadcastHelper::dispatch
-(
- Change const& rBaseChange,
- configuration::AbsolutePath const& _aChangeLocation,
- sal_Bool _bError,
- TreeManager * pSource
-)
-{
- OSL_ENSURE(!_aChangeLocation.isRoot(),"Cannot dispatch changes directly to the root node");
-
- // listeners registered under multiple sub-pathes will be called multiple times !
-
- // Collect the targets
- osl::ClearableMutexGuard aGuard(m_aListeners.mutex);
-
- // Dispatch listeners to ancestors of the change root
- std::vector<DispatchTarget> aOuterTargets;
- if (_aChangeLocation.getDepth() > 1)
- {
- configuration::AbsolutePath const aModulePath( configuration::Path::Rep(*_aChangeLocation.begin()) );
-
- PathMap::const_iterator itOuter = m_aPathMap.lower_bound( aModulePath );
- PathMap::const_iterator const endOuter = m_aPathMap.upper_bound(_aChangeLocation.getParentPath());
-
- // TODO: Both loops are so similar - they should be a single function
- while (itOuter != endOuter)
- {
- OSL_ASSERT( m_aListeners.find(itOuter->second->get()) != m_aListeners.end() );
-
- // check whether this should be dispatched at all
- if ( configuration::Path::hasPrefix(_aChangeLocation,itOuter->first) )
- {
- aOuterTargets.push_back( DispatchTarget(itOuter->second->get(), &itOuter->first) );
- }
- ++itOuter;
- }
- }
-
- // Dispatch listeners to descendants of the change root
- std::vector<DispatchTarget> aInnerTargets;
- {
- PathMap::const_iterator itInner = m_aPathMap.lower_bound(_aChangeLocation);
-
- while( itInner != m_aPathMap.end() && configuration::Path::hasPrefix(itInner->first,_aChangeLocation) )
- {
- OSL_ASSERT( m_aListeners.find(itInner->second->get()) != m_aListeners.end() );
-
- aInnerTargets.push_back( DispatchTarget(itInner->second->get(), &itInner->first) );
-
- ++itInner;
- }
- }
-
- aGuard.clear();
-
- {for (std::vector<DispatchTarget>::const_iterator it = aOuterTargets.begin(); it != aOuterTargets.end(); ++it){
- this->dispatchOuter(it->pTarget, *it->pDispatchPath, rBaseChange, _aChangeLocation, _bError, pSource);
- }}
- {for (std::vector<DispatchTarget>::const_iterator it = aInnerTargets.begin(); it != aInnerTargets.end(); ++it){
- this->dispatchInner(it->pTarget, *it->pDispatchPath, rBaseChange, _aChangeLocation, _bError, pSource);
- }}
-}
-
-/////////////////////////////////////////////////////////////////////////
-void ConfigChangeBroadcastHelper::disposing(TreeManager * pSource)
-{
- osl::ClearableMutexGuard aGuard(m_aListeners.mutex);
- m_aPathMap.clear();
-
- aGuard.clear();
- m_aListeners.disposing(pSource);
-}
-
-} // namespace
-
-
-
diff --git a/configmgr/source/api/confsvccomponent.cxx b/configmgr/source/api/confsvccomponent.cxx
deleted file mode 100644
index 6467acb8b3..0000000000
--- a/configmgr/source/api/confsvccomponent.cxx
+++ /dev/null
@@ -1,100 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "confsvccomponent.hxx"
-#include "datalock.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <cppuhelper/typeprovider.hxx>
-#include <osl/mutex.hxx>
-#include "utility.hxx"
-
-#include <map>
-
-namespace configmgr {
-
-
- ServiceComponentImpl::ServiceComponentImpl(ServiceImplementationInfo const* aInfo)
- : ::cppu::WeakComponentImplHelper1< lang::XServiceInfo >(UnoApiLock::getLock())
- , m_info(aInfo)
- {
- }
-
- void ServiceComponentImpl::disposing()
- {
- ::cppu::WeakComponentImplHelper1< lang::XServiceInfo >::disposing();
- }
- void ServiceComponentImpl::checkAlive() throw (uno::RuntimeException)
- {
- checkAlive("Object was disposed");
- }
- void ServiceComponentImpl::checkAlive(rtl::OUString const& sMessage) throw (uno::RuntimeException)
- {
- if (rBHelper.bDisposed)
- throw lang::DisposedException(sMessage, *this);
- }
-
- // XTypeProvider
- uno::Sequence<sal_Int8> ServiceComponentImpl::getStaticImplementationId(ServiceImplementationInfo const* pServiceInfo)
- throw(uno::RuntimeException)
- {
- static osl::Mutex aMapMutex;
- static std::map<ServiceImplementationInfo const*, ::cppu::OImplementationId> aIdMap;
-
- osl::MutexGuard aMapGuard(aMapMutex);
- return aIdMap[pServiceInfo].getImplementationId();
- }
-
- uno::Sequence<sal_Int8> SAL_CALL ServiceComponentImpl::getImplementationId()
- throw(uno::RuntimeException)
- {
- return getStaticImplementationId(m_info);
- }
-
- // XServiceInfo
- rtl::OUString SAL_CALL ServiceComponentImpl::getImplementationName( ) throw(uno::RuntimeException)
- {
- return ServiceInfoHelper(m_info).getImplementationName();
- }
-
- sal_Bool SAL_CALL ServiceComponentImpl::supportsService( const ::rtl::OUString& ServiceName ) throw(uno::RuntimeException)
- {
- return ServiceInfoHelper(m_info).supportsService( ServiceName );
- }
-
- uno::Sequence< rtl::OUString > SAL_CALL ServiceComponentImpl::getSupportedServiceNames( ) throw(uno::RuntimeException)
- {
- return ServiceInfoHelper(m_info).getSupportedServiceNames( );
- }
-
- //ServiceComponentImpl::
-
-} // namespace configmgr
-
-
diff --git a/configmgr/source/api2/accessimpl.cxx b/configmgr/source/api2/accessimpl.cxx
deleted file mode 100644
index 9ae77ccad1..0000000000
--- a/configmgr/source/api2/accessimpl.cxx
+++ /dev/null
@@ -1,804 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-
-#include "accessimpl.hxx"
-#include "apinodeaccess.hxx"
-#include "valueref.hxx"
-#include "anynoderef.hxx"
-#include "noderef.hxx"
-#include "configset.hxx"
-#include "confignotifier.hxx"
-#include "propertyinfohelper.hxx"
-#include "treeiterators.hxx"
-#include "attributes.hxx"
-#include "apitypes.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/lang/WrappedTargetException.hpp>
-#include <com/sun/star/beans/PropertyVetoException.hpp>
-#include <osl/diagnose.h>
-#include <rtl/logfile.hxx>
-
-#define RTL_LOGFILE_OU2A(rtlOUString) (::rtl::OString((rtlOUString).getStr(), (rtlOUString).getLength(), RTL_TEXTENCODING_ASCII_US).getStr())
-
-namespace configmgr
-{
- namespace configapi
- {
-//-----------------------------------------------------------------------------------
- namespace lang = css::lang;
- namespace util = css::util;
-
-//-----------------------------------------------------------------------------------
-// Constructors
-//-----------------------------------------------------------------------------------
-
-// Interface methods
-//-----------------------------------------------------------------------------------
-
-
-// XHierarchicalName
-//------------------------------------------------------------------------------------------------------------------
-rtl::OUString implGetHierarchicalName( NodeAccess& rNode ) throw(uno::RuntimeException)
-{
- // RTL_LOGFILE_CONTEXT(aLog, "Configmgr::API::implGetHierarchicalName()");
-
- rtl::OUString sRet;
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > aTree( lock.getTree());
-
- configuration::AbsolutePath const aFullPath = aTree->getAbsolutePath(lock.getNode());
- sRet = aFullPath.toString();
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- return sRet;
-}
-
-//------------------------------------------------------------------------------------------------------------------
-rtl::OUString implComposeHierarchicalName(NodeGroupInfoAccess& rNode, const rtl::OUString& sRelativeName )
- throw(css::lang::IllegalArgumentException, lang::NoSupportException, uno::RuntimeException)
-{
- rtl::OUString sRet;
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
- configuration::NodeRef aNode( lock.getNode() );
- rtl::Reference< configuration::Tree > aTree( lock.getTree() );
-
- configuration::RelativePath const aAddedPath = configuration::validateRelativePath(sRelativeName, aTree, aNode);
-
- // TODO: add (relative) name validation based on node type - may then need provider lock
- configuration::AbsolutePath const aFullPath = aTree->getAbsolutePath(aNode).compose(aAddedPath);
-
- sRet = aFullPath.toString();
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.illegalArgument(1);
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
-
- return sRet;
-}
-
-//------------------------------------------------------------------------------------------------------------------
-rtl::OUString implComposeHierarchicalName(NodeSetInfoAccess& rNode, const rtl::OUString& sElementName )
- throw(css::lang::IllegalArgumentException, lang::NoSupportException, uno::RuntimeException)
-{
- rtl::OUString sRet;
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
- configuration::NodeRef aNode( lock.getNode() );
- rtl::Reference< configuration::Tree > aTree( lock.getTree() );
-
- configuration::Path::Component const aAddedName = configuration::validateElementPathComponent(sElementName, aTree, aNode);
-
- // TODO: add (relative) name validation based on node type - may then need provider lock
- configuration::AbsolutePath const aFullPath = aTree->getAbsolutePath(aNode).compose(aAddedName);
-
- sRet = aFullPath.toString();
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.illegalArgument(1);
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
-
- return sRet;
-}
-
-//------------------------------------------------------------------------------------------------------------------
-
-// XElementAccess, base class of XNameAccess (and XHierarchicalNameAccess ? )
-//-----------------------------------------------------------------------------------
-
-
-//-----------------------------------------------------------------------------------
-// for group nodes
-uno::Type implGetElementType(NodeGroupInfoAccess& rNode) throw(uno::RuntimeException)
-{
- rNode.checkAlive();
- // group nodes have a mix of types
- // TODO(?): Discover single common type
- return ::getCppuType( static_cast< uno::Any const*>(0) );
-}
-
-// for set nodes
-uno::Type implGetElementType(NodeSetInfoAccess& rNode) throw(uno::RuntimeException)
-{
- uno::Type aRet;
- try
- {
- GuardedNodeData<NodeSetInfoAccess> lock( rNode );
-
- aRet = rNode.getElementInfo()->getInstanceType();
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
- return aRet;
-}
-
-//-----------------------------------------------------------------------------------
-// for group nodes
-sal_Bool implHasElements(NodeGroupInfoAccess& rNode) throw(uno::RuntimeException)
-{
- // rNode.checkAlive();
-// return true; // group nodes always have children
-
-// Better: cater for the case where we are reaching the depth limit
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode ); // no provider lock needed
-
- rtl::Reference< configuration::Tree > aThisTree( lock.getTree() );
- configuration::NodeRef aThisNode( lock.getNode() );
- OSL_ASSERT( !aThisTree->hasElements(aThisNode) );
- return aThisTree->hasChildren(aThisNode);
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
- // unreachable, but still there to make compiler happy
- OSL_ASSERT(!"Unreachable code");
- return false;
-}
-
-// for set nodes
-sal_Bool implHasElements(NodeSetInfoAccess& rNode) throw(uno::RuntimeException)
-{
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode ); // provider lock needed
-
- rtl::Reference< configuration::Tree > aThisTree( lock.getTree() );
- configuration::NodeRef aThisNode( lock.getNode() );
- OSL_ASSERT( !aThisTree->hasChildren(aThisNode) );
- return aThisTree->hasElements(aThisNode);
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
- // unreachable, but still there to make compiler happy
- OSL_ASSERT(!"Unreachable code");
- return false;
-}
-
-// XExactName
-//-----------------------------------------------------------------------------------
-
-
-//------------------------------------------------------------------------------------------------------------------
-namespace internal
-{
- struct SearchExactName : private configuration::NodeVisitor
- {
- protected:
- // warning: order dependency
- configuration::RelativePath aSearchPath;
- std::vector<configuration::Path::Component>::reverse_iterator pSearchComponent;
- public:
- explicit
- SearchExactName(const configuration::RelativePath& aLookFor)
- : aSearchPath(aLookFor)
- , pSearchComponent(aSearchPath.begin_mutate())
- {}
-
- bool complete() { return aSearchPath.end_mutate() == pSearchComponent; }
-
- bool search(configuration::NodeRef const& aNode, rtl::Reference< configuration::Tree > const& aTree);
-
- configuration::RelativePath const& getBestMatch() const { return aSearchPath; }
-
- private:
- bool findMatch(configuration::NodeRef& aNode, rtl::Reference< configuration::Tree > & aTree);
- virtual Result handle(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const&); // NodeVisitor
- virtual Result handle(rtl::Reference< configuration::Tree > const& aTree, configuration::ValueRef const&); // NodeVisitor
- };
-//..................................................................................................................
- bool SearchExactName::findMatch(configuration::NodeRef& aNode, rtl::Reference< configuration::Tree > & aTree)
- {
- OSL_ASSERT( !complete() );
-
- if ( !aNode.isValid() ) return false;
-
- // exact match ?
- if (!configuration::hasChildOrElement(aTree,aNode,*pSearchComponent))
- {
- if (aTree->dispatchToChildren(aNode,*this) == CONTINUE) // not found there
- return false;
- }
- OSL_ASSERT(configuration::hasChildOrElement(aTree,aNode,*pSearchComponent));
-
- if (! configuration::findInnerChildOrAvailableElement(aTree,aNode,pSearchComponent->getName()) )
- aNode = configuration::NodeRef(); // will stop recursion (value or unloaded element found)
- ++pSearchComponent;
-
- return true;
- }
- //..................................................................................................................
- // helper
- static configuration::Path::Component getExtendedNodeName(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode, rtl::OUString const& aSimpleNodeName)
- {
- OSL_PRECOND( !configuration::isEmpty(aTree.get()), "ERROR: Configuration: Tree operation requires valid tree" );
- OSL_PRECOND( !aNode.isValid() || aTree->isValidNode(aNode.getOffset()), "ERROR: Configuration: NodeRef does not match tree" );
-
- if (aTree->isRootNode(aNode))
- return aTree->getExtendedRootName();
-
- else
- return configuration::Path::wrapSimpleName(aSimpleNodeName);
- }
- //..................................................................................................................
- configuration::NodeVisitor::Result SearchExactName::handle(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode)
- {
- OSL_ASSERT( aNode.isValid() );
- OSL_ASSERT( !complete() );
-
- // find inexact match (the first one, but the order is unspecified)
- // TODO: Add support for node-type-specific element names
- rtl::OUString aNodeName = aTree->getSimpleNodeName(aNode.getOffset());
- rtl::OUString aSearchName = pSearchComponent->getName();
- if (aNodeName.equalsIgnoreAsciiCase(aSearchName))
- {
- *pSearchComponent = getExtendedNodeName(aTree,aNode,aNodeName);
- return DONE; // for this level
- }
- else
- return CONTINUE;
- }
- //..................................................................................................................
- configuration::NodeVisitor::Result SearchExactName::handle(rtl::Reference< configuration::Tree > const&, configuration::ValueRef const& aNode)
- {
- OSL_ASSERT( aNode.isValid() );
- OSL_ASSERT( !complete() );
-
- // find inexact match (the first one, but the order is unspecified)
- // TODO: Add support for node-type-specific element names
- rtl::OUString aNodeName = aNode.m_sNodeName;
- OSL_ASSERT( configuration::isSimpleName(aNodeName) );
-
- // value refs are group members and thus have to have simple names
- if (aNodeName.equalsIgnoreAsciiCase(pSearchComponent->getName()))
- {
- *pSearchComponent = configuration::Path::wrapSimpleName(aNodeName);
- return DONE; // for this level
- }
- else
- return CONTINUE;
- }
-//..................................................................................................................
- bool SearchExactName::search(configuration::NodeRef const & aNode, rtl::Reference< configuration::Tree > const & aTree)
- {
- if (!aNode.isValid()) return false;
-
- rtl::Reference< configuration::Tree > aSearchTree(aTree);
- configuration::NodeRef aSearchNode(aNode);
-
- while (!complete())
- if (! findMatch(aSearchNode, aSearchTree))
- break;
-
- return complete();
- }
-
-} // namespace internal
-
-//..................................................................................................................
-rtl::OUString implGetExactName(NodeGroupInfoAccess& rNode, const rtl::OUString& rApproximateName ) throw(uno::RuntimeException)
-{
- // here we try to support both tree-fragment-local pathes and simple names (the latter ones are just an instance of the first)
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > aTree(lock.getTree());
- configuration::NodeRef aNode(lock.getNode());
-
- configuration::RelativePath aApproximatePath = configuration::validateRelativePath(rApproximateName,aTree,aNode);
-
- internal::SearchExactName aSearch(aApproximatePath);
-
- aSearch.search(aNode, aTree);
-
- OSL_ENSURE( aSearch.getBestMatch().getDepth() == aApproximatePath.getDepth(),
- "Search for exact names changed number of path components !?");
-
- return aSearch.getBestMatch().toString();
- }
- catch (configuration::InvalidName& )
- {
- OSL_TRACE("WARNING: Configuration::getExactName: query uses locally invalid Path");
- return rApproximateName;
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
- // unreachable, but still there to make compiler happy
- OSL_ASSERT(!"Unreachable code");
- return rApproximateName;
-}
-
-//..................................................................................................................
-rtl::OUString implGetExactName(NodeSetInfoAccess& rNode, const rtl::OUString& rApproximateName ) throw(uno::RuntimeException)
-{
-
- // here we can support only local names
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > aTree(lock.getTree());
- configuration::NodeRef aNode(lock.getNode());
-
- configuration::Path::Component aApproximateName = configuration::validateElementPathComponent(rApproximateName,aTree,aNode);
-
- internal::SearchExactName aSearch(aApproximateName);
-
- aSearch.search(aNode, aTree);
-
- OSL_ENSURE( aSearch.getBestMatch().getDepth() == 1,
- "Search for exact names changed number of path components !?");
-
- return aSearch.getBestMatch().getLocalName().getName();
- }
- catch (configuration::InvalidName& )
- {
- OSL_TRACE("WARNING: Configuration::getExactName: query uses locally invalid Path");
- return rApproximateName;
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
- // unreachable, but still there to make compiler happy
- OSL_ASSERT(!"Unreachable code");
- return rApproximateName;
-}
-
-// XProperty
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-beans::Property implGetAsProperty(NodeAccess& rNode)
- throw(uno::RuntimeException)
-{
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > aTree( lock.getTree());
- configuration::NodeRef aNode( lock.getNode());
-
- rtl::OUString aName = aTree->getSimpleNodeName(aNode.getOffset());
- node::Attributes aAttributes = aTree->getAttributes(aNode);
- uno::Type aApiType = getUnoInterfaceType();
-
- return helperMakeProperty( aName,aAttributes,aApiType, aTree->hasNodeDefault(aNode) );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- // unreachable, but still there to make some compilers happy
- OSL_ASSERT(!"Unreachable code");
- return beans::Property();
-}
-// XPropertySetInfo
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-uno::Sequence< css::beans::Property > implGetProperties( NodeAccess& rNode ) throw (uno::RuntimeException)
-{
- CollectPropertyInfo aCollect;
-
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- lock.getTree()->dispatchToChildren(lock.getNode(), aCollect);
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- return makeSequence( aCollect.list() );
-}
-
-//-----------------------------------------------------------------------------------
-css::beans::Property implGetPropertyByName( NodeAccess& rNode, const rtl::OUString& aName )
- throw (css::beans::UnknownPropertyException, uno::RuntimeException)
-{
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- rtl::OUString aChildName = configuration::validateChildOrElementName(aName,aTree,aNode);
-
- configuration::AnyNodeRef aChildNode = configuration::getChildOrElement(aTree,aNode, aChildName);
-
- if (!aChildNode.isValid())
- {
- OSL_ENSURE(!configuration::hasChildOrElement(aTree,aNode,aChildName),"ERROR: Configuration: Existing Property not found by implementation");
-
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot get Property. Property '") );
- sMessage += aName;
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' could not be found in ") );
- sMessage += aTree->getAbsolutePath(aNode).toString();
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw css::beans::UnknownPropertyException( sMessage, xContext );
- }
-
- node::Attributes aChildAttributes = aTree->getAttributes(aChildNode);
- uno::Type aApiType = aChildNode.isNode() ? getUnoInterfaceType() : aTree->getUnoType(aChildNode.toValue());
-
- return helperMakeProperty( aChildName,aChildAttributes,aApiType, aTree->hasNodeDefault(aChildNode) );
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw css::beans::UnknownPropertyException( e.message(), xContext );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- // unreachable, but still there to make some compilers happy
- OSL_ASSERT(!"Unreachable code");
- return css::beans::Property();
-}
-
-
-//-----------------------------------------------------------------------------------
-sal_Bool implHasPropertyByName( NodeAccess& rNode, const rtl::OUString& name ) throw (uno::RuntimeException)
-{
- return implHasByName(rNode, name);
-}
-
-// XNameAccess
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-// TODO: optimization - cache the node found (for subsequent getByName)
-// TODO: optimization - less locking for group nodes
-//-----------------------------------------------------------------------------------
-sal_Bool implHasByName(NodeAccess& rNode, const rtl::OUString& sName ) throw(uno::RuntimeException)
-{
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- rtl::OUString aChildName(sName);
-
- return configuration::hasChildOrElement(lock.getTree(), lock.getNode(), aChildName);
- }
-#if OSL_DEBUG_LEVEL > 0
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- OSL_ENSURE(false,"configmgr: BasicAccess::hasByName: Unexpected exception <InvalidName>");
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-#endif
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
- // unreachable, but still there to make compiler happy
- OSL_ASSERT(!"Unreachable code");
- return false;
-}
-
-//-----------------------------------------------------------------------------------
-uno::Any implGetByName(NodeAccess& rNode, const rtl::OUString& sName )
- throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException)
-{
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > aTree( lock.getTree() );
- configuration::NodeRef aNode( lock.getNode() );
-
- rtl::OUString aChildName = configuration::validateChildOrElementName(sName,aTree,aNode);
-
- configuration::AnyNodeRef aChildNode = configuration::getChildOrElement(aTree,aNode, aChildName);
- if (!aChildNode.isValid())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Child Element '") );
- sMessage += sName;
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' not found in ") );
- sMessage += aTree->getAbsolutePath(aNode).toString();
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw com::sun::star::container::NoSuchElementException( sMessage, xContext );
- }
- OSL_ASSERT(aNode.isValid());
-
- return configapi::makeElement( rNode.getFactory(), aTree, aChildNode );
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw com::sun::star::container::NoSuchElementException( e.message(), xContext );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- // unreachable, but still there to make some compilers happy
- OSL_ASSERT(!"Unreachable code");
- return uno::Any();
-}
-
-//-----------------------------------------------------------------------------------
-// TODO: optimization - less locking for group nodes
-//-----------------------------------------------------------------------------------
-uno::Sequence< rtl::OUString > implGetElementNames( NodeAccess& rNode ) throw( uno::RuntimeException)
-{
- CollectNodeNames aCollect;
-
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- lock.getTree()->dispatchToChildren(lock.getNode(), aCollect);
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- return makeSequence( aCollect.list() );
-}
-
-// XHierarchicalNameAccess
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-// TO DO: optimization - cache the node found for subsequent getByHierarchicalName()
-//-----------------------------------------------------------------------------------
-sal_Bool implHasByHierarchicalName(NodeAccess& rNode, const rtl::OUString& sHierarchicalName ) throw(uno::RuntimeException)
-{
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > aTree( lock.getTree() );
- configuration::NodeRef aNode( lock.getNode() );
-
- configuration::RelativePath aRelPath = configuration::validateAndReducePath( sHierarchicalName, aTree, aNode );
-
- return configuration::getDeepDescendant(aTree, aNode, aRelPath).isValid();
- }
- catch (configuration::InvalidName& )
- {
- OSL_TRACE("WARNING: Configuration::hasByHierarchicalName: query uses locally invalid Path");
- return false;
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
- // unreachable, but still there to make some compilers happy
- OSL_ASSERT(!"Unreachable code");
- return false;
-}
-
-//-----------------------------------------------------------------------------------
-uno::Any implGetByHierarchicalName(NodeAccess& rNode, const rtl::OUString& sHierarchicalName )
- throw(css::container::NoSuchElementException, uno::RuntimeException)
-{
- // rtl::OUString aTmpStr(implGetHierarchicalName(rNode));
- // RTL_LOGFILE_CONTEXT_TRACE2(aLog, "Node: %s HierachicalName: %s",RTL_LOGFILE_OU2A(aTmpStr), RTL_LOGFILE_OU2A(sHierarchicalName));
-
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > aTree( lock.getTree() );
- configuration::NodeRef aNode( lock.getNode() );
-
- configuration::RelativePath aRelPath = configuration::validateAndReducePath( sHierarchicalName, aTree, aNode );
-
- configuration::AnyNodeRef aNestedNode = configuration::getDeepDescendant( aTree, aNode, aRelPath );
- if (!aNestedNode.isValid())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Descendant Element '") );
- sMessage += aRelPath.toString();
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' not found in Node ") );
- sMessage += aTree->getAbsolutePath(aNode).toString();
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw com::sun::star::container::NoSuchElementException( sMessage, xContext );
- }
-
- OSL_ASSERT(aNode.isValid());
- return configapi::makeElement( rNode.getFactory(), aTree, aNestedNode );
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw com::sun::star::container::NoSuchElementException( e.message(), xContext );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- // unreachable, but still there to make some compilers happy
- OSL_ASSERT(!"Unreachable code");
- return uno::Any();
-}
-
-// XPropertyWithState
-//---------------------------------------------------------------------
-css::beans::PropertyState implGetStateAsProperty(NodeAccess& rNode)
- throw (uno::RuntimeException)
-{
- css::beans::PropertyState aRet = css::beans::PropertyState_AMBIGUOUS_VALUE;
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- if ( lock.getTree()->isNodeDefault( lock.getNode() ) )
- aRet = css::beans::PropertyState_DEFAULT_VALUE;
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
- return aRet;
-}
-
-uno::Reference< uno::XInterface > implGetDefaultAsProperty(NodeAccess& )
- throw (css::lang::WrappedTargetException, uno::RuntimeException)
-{
- // not really supported
-
- /* possible, but nor really useful:
- GuardedNodeAccess lock( rNode );
- if (implGetStateAsProperty(rNode) == PropertyState_DEFAULT_VALUE)
- return rNode.getUnoInstance();
- */
-
- return uno::Reference< uno::XInterface >();
-}
-
-
-// set-specific Interfaces
-//-----------------------------------------------------------------------------------
-
-
-// XTemplateContainer
-//-----------------------------------------------------------------------------------
-rtl::OUString SAL_CALL implGetElementTemplateName(NodeSetInfoAccess& rNode)
- throw(uno::RuntimeException)
-{
- GuardedNodeData<NodeSetInfoAccess> lock(rNode);
- return rNode.getElementInfo()->getPathString();
-}
-
-//-----------------------------------------------------------------------------------
- } // namespace configapi
-
-} // namespace configmgr
-
-
diff --git a/configmgr/source/api2/accessimpl.hxx b/configmgr/source/api2/accessimpl.hxx
deleted file mode 100644
index 0539d8bf1e..0000000000
--- a/configmgr/source/api2/accessimpl.hxx
+++ /dev/null
@@ -1,136 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_BASEACCESSIMPL_HXX_
-#define CONFIGMGR_API_BASEACCESSIMPL_HXX_
-
-#include <com/sun/star/container/XHierarchicalName.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
-#include <com/sun/star/configuration/XTemplateInstance.hpp>
-#include <com/sun/star/configuration/XTemplateContainer.hpp>
-#include <com/sun/star/beans/XExactName.hpp>
-#include <com/sun/star/beans/XProperty.hpp>
-#include <com/sun/star/beans/XPropertySetInfo.hpp>
-#include <com/sun/star/beans/XPropertyWithState.hpp>
-
-namespace configmgr
-{
- namespace css = ::com::sun::star;
- namespace uno = ::com::sun::star::uno;
-
- /* implementations of the interfaces supported by a (parent) node
- within the configuration tree.
- (read-only operation)
- */
- namespace configapi
- {
- class NodeAccess;
- class NodeSetInfoAccess;
- class NodeGroupInfoAccess;
-
- // XHierarchicalName
- rtl::OUString implGetHierarchicalName(NodeAccess& rNode)
- throw(uno::RuntimeException);
-
- rtl::OUString implComposeHierarchicalName(NodeGroupInfoAccess& rNode, const rtl::OUString& aRelativeName )
- throw(css::lang::IllegalArgumentException, css::lang::NoSupportException, uno::RuntimeException);
-
- rtl::OUString implComposeHierarchicalName(NodeSetInfoAccess& rNode, const rtl::OUString& aRelativeName )
- throw(css::lang::IllegalArgumentException, css::lang::NoSupportException, uno::RuntimeException);
-
- // XElementAccess, base class of XNameAccess
- uno::Type implGetElementType(NodeGroupInfoAccess& rNode)
- throw(uno::RuntimeException);
-
- uno::Type implGetElementType(NodeSetInfoAccess& rNode)
- throw(uno::RuntimeException);
-
- sal_Bool implHasElements(NodeGroupInfoAccess& rNode)
- throw(uno::RuntimeException);
-
- sal_Bool implHasElements(NodeSetInfoAccess& rNode)
- throw(uno::RuntimeException);
-
- // XNameAccess
- uno::Any implGetByName(NodeAccess& rNode, const rtl::OUString& aName )
- throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException);
-
- uno::Sequence< rtl::OUString > implGetElementNames(NodeAccess& rNode)
- throw( uno::RuntimeException);
-
- sal_Bool implHasByName(NodeAccess& rNode, const rtl::OUString& aName )
- throw(uno::RuntimeException);
-
- // XHierarchicalNameAccess
- uno::Any implGetByHierarchicalName(NodeAccess& rNode, const rtl::OUString& aName )
- throw(css::container::NoSuchElementException, uno::RuntimeException);
-
- sal_Bool implHasByHierarchicalName(NodeAccess& rNode, const rtl::OUString& aName )
- throw(uno::RuntimeException);
-
- // XExactName
- rtl::OUString implGetExactName(NodeGroupInfoAccess& rNode, const rtl::OUString& aApproximateName )
- throw(uno::RuntimeException);
-
- rtl::OUString implGetExactName(NodeSetInfoAccess& rNode, const rtl::OUString& aApproximateName )
- throw(uno::RuntimeException);
-
- // XProperty
- css::beans::Property implGetAsProperty(NodeAccess& rNode)
- throw(uno::RuntimeException);
-
- // XPropertySetInfo
- uno::Sequence< css::beans::Property > implGetProperties( NodeAccess& rNode )
- throw (uno::RuntimeException);
-
- css::beans::Property implGetPropertyByName( NodeAccess& rNode, const rtl::OUString& aName )
- throw (css::beans::UnknownPropertyException, uno::RuntimeException);
-
- sal_Bool implHasPropertyByName( NodeAccess& rNode, const rtl::OUString& name )
- throw (uno::RuntimeException);
-
-
- // XPropertyWithState
- css::beans::PropertyState implGetStateAsProperty(NodeAccess& rNode)
- throw (uno::RuntimeException);
-
- uno::Reference< uno::XInterface > implGetDefaultAsProperty(NodeAccess& rNode)
- throw (css::lang::WrappedTargetException, uno::RuntimeException);
-
- // set-specific interfaces
-
- // XTemplateContainer
- rtl::OUString SAL_CALL implGetElementTemplateName(NodeSetInfoAccess& rNode)
- throw(uno::RuntimeException);
-
- }
-
-}
-#endif // CONFIGMGR_API_BASEACCESSIMPL_HXX_
-
-
diff --git a/configmgr/source/api2/apiaccessobj.cxx b/configmgr/source/api2/apiaccessobj.cxx
deleted file mode 100644
index 24902d3277..0000000000
--- a/configmgr/source/api2/apiaccessobj.cxx
+++ /dev/null
@@ -1,290 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-#include "apiaccessobj.hxx"
-
-#include "apiserviceinfo.hxx"
-#include "confsvccomponent.hxx"
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace configapi
- {
-//========================================================================
-//= service infos
-//========================================================================
-/*
-const AsciiServiceName c_aUserContainerServices[] =
-{
- "com.sun.star.configuration.UserAdministration",
- "com.sun.star.configuration.ConfigurationContainer",
- "com.sun.star.configuration.ConfigurationUpdateAccess",
- "com.sun.star.configuration.ConfigurationAccess",
- NULL
-};
-const AsciiServiceName c_aContainerServices[] =
-{
- "com.sun.star.configuration.ConfigurationContainer",
- "com.sun.star.configuration.ConfigurationUpdateAccess",
- "com.sun.star.configuration.ConfigurationAccess",
- NULL
-};
-const AsciiServiceName c_aUpdateServices[] =
-{
- "com.sun.star.configuration.ConfigurationUpdateAccess",
- "com.sun.star.configuration.ConfigurationAccess",
- NULL
-};
-
-const AsciiServiceName c_aAccessServices[] =
-{
- "com.sun.star.configuration.ConfigurationAccess",
- NULL
-};
-
-const AsciiServiceName c_aNoServices[] =
-{
- NULL
-};
-//-----------------------------------------------------------------------------
-
-ServiceInfo const aInnerGroupInfoSI =
-{
- "com.sun.star.configuration.configmgr.OInnerGroupInfoAccess",
- c_aNoServices
-};
-ServiceInfo const aInnerGroupUpdateSI =
-{
- "com.sun.star.configuration.configmgr.OInnerGroupUpdateAccess",
- c_aNoServices
-};
-ServiceInfo const aInnerSetInfoSI =
-{
- "com.sun.star.configuration.configmgr.OInnerSetInfoAccess",
- c_aNoServices
-};
-ServiceInfo const aInnerTreeSetSI =
-{
- "com.sun.star.configuration.configmgr.OInnerTreeSetUpdateAccess",
- c_aNoServices
-};
-ServiceInfo const aInnerValueSetSI =
-{
- "com.sun.star.configuration.configmgr.OInnerValueSetUpdateAccess",
- c_aNoServices
-};
-//-----------------------------------------------------------------------------
-
-ServiceInfo const aSetElementGroupInfoSI =
-{
- "com.sun.star.configuration.configmgr.OSetElementGroupInfoAccess",
- c_aAccessServices
-};
-ServiceInfo const aSetElementGroupUpdateSI =
-{
- "com.sun.star.configuration.configmgr.OSetElementGroupUpdateAccess",
- c_aUpdateServices
-};
-ServiceInfo const aSetElementSetInfoSI =
-{
- "com.sun.star.configuration.configmgr.OSetElementSetInfoAccess",
- c_aAccessServices
-};
-ServiceInfo const aSetElementTreeSetSI =
-{
- "com.sun.star.configuration.configmgr.OSetElementTreeSetUpdateAccess",
- c_aContainerServices
-};
-ServiceInfo const aSetElementValueSetSI =
-{
- "com.sun.star.configuration.configmgr.OSetElementValueSetUpdateAccess",
- c_aContainerServices
-};
-//-----------------------------------------------------------------------------
-
-ServiceInfo const aRootElementGroupInfoSI =
-{
- "com.sun.star.configuration.configmgr.ORootElementGroupInfoAccess",
- c_aAccessServices
-};
-ServiceInfo const aRootElementGroupUpdateSI =
-{
- "com.sun.star.configuration.configmgr.ORootElementGroupUpdateAccess",
- c_aUpdateServices
-};
-ServiceInfo const aRootElementSetInfoSI =
-{
- "com.sun.star.configuration.configmgr.ORootElementSetInfoAccess",
- c_aAccessServices
-};
-ServiceInfo const aRootElementTreeSetUpdateSI =
-{
- "com.sun.star.configuration.configmgr.ORootElementTreeSetUpdateAccess",
- c_aContainerServices
-};
-ServiceInfo const aRootElementValueSetUpdateSI =
-{
- "com.sun.star.configuration.configmgr.ORootElementValueSetUpdateAccess",
- c_aContainerServices
-};
-//-----------------------------------------------------------------------------
-
-ServiceInfo const aRootElementReadAccessSI =
-{
- "com.sun.star.configuration.configmgr.ORootElementReadAccess",
- c_aAccessServices
-};
-ServiceInfo const aRootElementUpdateAccessSI =
-{
- "com.sun.star.configuration.configmgr.ORootElementUpdateAccess",
- c_aUpdateServices
-};
-ServiceInfo const aRootElementAdminAccessSI =
-{
- "com.sun.star.configuration.configmgr.ORootElementUserAdminAccess",
- c_aUserContainerServices
-};*/
-
-//========================================================================
-//= service info static members
-//========================================================================
-
-//-----------------------------------------------------------------------------
-// Inner Elements
-//-----------------------------------------------------------------------------
-
-template <>
-ServiceImplementationInfo const *
-const OInnerElement<NodeGroupInfoAccess>::s_pServiceInfo = &aInnerGroupInfoSI;
-
-template <>
-ServiceImplementationInfo const *
-const OInnerElement<NodeGroupAccess>::s_pServiceInfo = &aInnerGroupUpdateSI;
-
-template <>
-ServiceImplementationInfo const *
-const OInnerElement<NodeSetInfoAccess>::s_pServiceInfo = &aInnerSetInfoSI;
-
-template <>
-ServiceImplementationInfo const *
-const OInnerElement<NodeTreeSetAccess>::s_pServiceInfo = &aInnerTreeSetSI;
-
-template <>
-ServiceImplementationInfo const *
-const OInnerElement<NodeValueSetAccess>::s_pServiceInfo = &aInnerValueSetSI;
-
-
-//-----------------------------------------------------------------------------
-// Set Elements
-//-----------------------------------------------------------------------------
-
-template <>
-ServiceImplementationInfo const *
-const OSetElement<NodeGroupInfoAccess>::s_pServiceInfo = &aSetElementGroupInfoSI;
-
-template <>
-ServiceImplementationInfo const *
-const OSetElement<NodeGroupAccess>::s_pServiceInfo = &aSetElementGroupUpdateSI;
-
-template <>
-ServiceImplementationInfo const *
-const OSetElement<NodeSetInfoAccess>::s_pServiceInfo = &aSetElementSetInfoSI;
-
-template <>
-ServiceImplementationInfo const *
-const OSetElement<NodeTreeSetAccess>::s_pServiceInfo = &aSetElementTreeSetSI;
-
-template <>
-ServiceImplementationInfo const *
-const OSetElement<NodeValueSetAccess>::s_pServiceInfo = &aSetElementValueSetSI;
-
-//-----------------------------------------------------------------------------
-// Root Elements
-//-----------------------------------------------------------------------------
-
-template <>
-ServiceImplementationInfo const *
-const OReadRootElement<NodeGroupInfoAccess>::s_pServiceInfo = &aRootElementGroupInfoSI;
-
-template <>
-ServiceImplementationInfo const *
-const OUpdateRootElement<NodeGroupAccess>::s_pServiceInfo = &aRootElementGroupUpdateSI;
-
-template <>
-ServiceImplementationInfo const *
-const OReadRootElement<NodeSetInfoAccess>::s_pServiceInfo = &aRootElementSetInfoSI;
-
-template <>
-ServiceImplementationInfo const *
-const OUpdateRootElement<NodeTreeSetAccess>::s_pServiceInfo = &aRootElementTreeSetUpdateSI;
-
-template <>
-ServiceImplementationInfo const *
-const OUpdateRootElement<NodeValueSetAccess>::s_pServiceInfo = &aRootElementValueSetUpdateSI;
-
-
-
-//========================================================================
-//= Instantiations
-//========================================================================
-/*
-//-----------------------------------------------------------------------------
-// Inner Elements
-//-----------------------------------------------------------------------------
-
-template class OInnerElement<NodeGroupInfoAccess>; // OInnerGroupInfoAccess
-template class OInnerElement<NodeGroupAccess>; // OInnerGroupUpdateAccess
-template class OInnerElement<NodeSetInfoAccess>; // OInnerSetInfoAccess
-template class OInnerElement<NodeTreeSetAccess>; // OInnerTreeSetUpdateAccess
-template class OInnerElement<NodeValueSetAccess>; // OInnerValueSetUpdateAccess
-
-//-----------------------------------------------------------------------------
-// Set Elements
-//-----------------------------------------------------------------------------
-template class OSetElement<NodeGroupInfoAccess>; // OSetElementGroupInfoAccess
-template class OSetElement<NodeGroupAccess>; // OSetElementGroupUpdateAccess
-template class OSetElement<NodeSetInfoAccess>; // OSetElementSetInfoAccess
-template class OSetElement<NodeTreeSetAccess>; // OSetElementTreeSetUpdateAccess
-template class OSetElement<NodeValueSetAccess>; // OSetElementValueSetUpdateAccess
-
-//-----------------------------------------------------------------------------
-// Root Elements
-//-----------------------------------------------------------------------------
-
-template class OReadRootElement<NodeGroupInfoAccess>; // ORootElementGroupInfoAccess
-template class OUpdateRootElement<NodeGroupAccess>; // ORootElementGroupUpdateAccess
-template class OReadRootElement<NodeSetInfoAccess>; // ORootElementSetInfoAccess
-template class OUpdateRootElement<NodeTreeSetAccess>; // ORootElementTreeSetUpdateAccess
-template class OUpdateRootElement<NodeValueSetAccess>; // ORootElementValueSetUpdateAccess
-*/
-//-----------------------------------------------------------------------------
- }
-}
diff --git a/configmgr/source/api2/apiaccessobj.hxx b/configmgr/source/api2/apiaccessobj.hxx
deleted file mode 100644
index e12c30d40e..0000000000
--- a/configmgr/source/api2/apiaccessobj.hxx
+++ /dev/null
@@ -1,145 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_ACCESSOBJECTS_HXX_
-#define CONFIGMGR_API_ACCESSOBJECTS_HXX_
-
-#include "apitreeaccess.hxx"
-#include "apinodeaccess.hxx"
-#include "apinodeupdate.hxx"
-
-#include "apitreeimplobj.hxx"
-#include "noderef.hxx"
-
-#include "apiserviceinfo.hxx"
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace configapi
- {
-//-----------------------------------------------------------------------------
-// Inner Elements
-//-----------------------------------------------------------------------------
-
- template <class NodeClass>
- class OInnerElement : public InnerElement, public NodeClass
- {
- static ServiceImplementationInfo const*const s_pServiceInfo;
-
- uno::XInterface* m_pUnoThis;
- ApiTreeImpl& m_rTree;
- configuration::NodeRef m_aNode;
- public:
- inline OInnerElement(uno::XInterface* pUnoThis,ApiTreeImpl& rTree, configuration::NodeRef const& aNode);
- inline ~OInnerElement();
-
- virtual inline configuration::NodeRef doGetNode() const;
- virtual inline ApiTreeImpl& getApiTree() const;
-
- virtual inline uno::XInterface* doGetUnoInstance() const;
- virtual inline ServiceImplementationInfo const* doGetServiceInfo() const;
-
- static inline ServiceImplementationInfo const* getStaticServiceInfo();
- };
-
-//-----------------------------------------------------------------------------
-// Set Elements
-//-----------------------------------------------------------------------------
-
- template <class NodeClass>
- class OSetElement : public SetElement, public NodeClass
- {
- static ServiceImplementationInfo const*const s_pServiceInfo;
-
- mutable ApiTreeImpl m_aTree;
- public:
- OSetElement(uno::XInterface* pUnoThis, rtl::Reference< configuration::Tree > const& aTree, ApiProvider& rProvider, ApiTreeImpl* pParentTree = 0)
- : m_aTree(pUnoThis, rProvider,aTree,pParentTree)
- {}
-
- virtual inline configuration::NodeRef doGetNode() const;
- virtual inline ApiTreeImpl& getApiTree() const;
-
- virtual inline uno::XInterface* doGetUnoInstance() const;
- virtual inline ServiceImplementationInfo const* doGetServiceInfo() const;
-
- static inline ServiceImplementationInfo const* getStaticServiceInfo();
- };
-
-//-----------------------------------------------------------------------------
-// Root Elements
-//-----------------------------------------------------------------------------
-
- template <class NodeClass>
- class OReadRootElement : public RootElement, public NodeClass
- {
- static ServiceImplementationInfo const*const s_pServiceInfo;
- mutable ApiRootTreeImpl m_aRootTree;
- public:
- OReadRootElement(uno::XInterface* pUnoThis, ApiProvider& rProvider, rtl::Reference< configuration::Tree > const& aTree, vos::ORef< OOptions >const& _xOptions)
- : m_aRootTree(pUnoThis, rProvider,aTree, _xOptions)
- {}
-
- virtual inline configuration::NodeRef doGetNode() const;
- virtual inline ApiTreeImpl& getApiTree() const;
- virtual inline ApiRootTreeImpl& getRootTree();
-
- virtual inline uno::XInterface* doGetUnoInstance() const;
- virtual inline ServiceImplementationInfo const* doGetServiceInfo() const;
-
- static inline ServiceImplementationInfo const* getStaticServiceInfo();
- };
- //-------------------------------------------------------------------------
-
- template <class NodeClass>
- class OUpdateRootElement : public UpdateRootElement, public NodeClass
- {
- static ServiceImplementationInfo const*const s_pServiceInfo;
-
- mutable ApiRootTreeImpl m_aRootTree;
- public:
- OUpdateRootElement(uno::XInterface* pUnoThis, ApiProvider& rProvider, rtl::Reference< configuration::Tree > const& aTree, vos::ORef< OOptions >const& _xOptions)
- : m_aRootTree(pUnoThis, rProvider,aTree,_xOptions)
- {}
-
- virtual inline configuration::NodeRef doGetNode() const;
- virtual inline ApiTreeImpl& getApiTree() const;
- virtual inline ApiRootTreeImpl& getRootTree();
-
- virtual inline uno::XInterface* doGetUnoInstance() const;
- virtual inline ServiceImplementationInfo const* doGetServiceInfo() const;
-
- static inline ServiceImplementationInfo const* getStaticServiceInfo();
- };
- }
-}
-//-----------------------------------------------------------------------------
-#include "apiaccessobj.inl"
-//-----------------------------------------------------------------------------
-
-#endif // CONFIGMGR_API_ACCESSOBJECTS_HXX_
diff --git a/configmgr/source/api2/apiaccessobj.inl b/configmgr/source/api2/apiaccessobj.inl
deleted file mode 100644
index ae8319f4a9..0000000000
--- a/configmgr/source/api2/apiaccessobj.inl
+++ /dev/null
@@ -1,260 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace configapi
- {
-
-//========================================================================
-//= member functions
-//========================================================================
-
-//-----------------------------------------------------------------------------
-// Inner Elements
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-OInnerElement<NodeClass>::OInnerElement(uno::XInterface* pUnoThis,ApiTreeImpl& rTree, configuration::NodeRef const& aNode)
-: m_pUnoThis(pUnoThis)
-, m_rTree(rTree)
-, m_aNode(aNode)
-{
- m_rTree.setNodeInstance(aNode,pUnoThis);
- m_rTree.getUnoInstance()->acquire();
-}
-
-template <class NodeClass>
-OInnerElement<NodeClass>::~OInnerElement()
-{
- m_rTree.getUnoInstance()->release();
-}
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-configuration::NodeRef OInnerElement<NodeClass>::doGetNode() const
-{
- return m_aNode;
-}
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-ApiTreeImpl& OInnerElement<NodeClass>::getApiTree() const
-{
- return m_rTree;
-}
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-uno::XInterface* OInnerElement<NodeClass>::doGetUnoInstance() const
-{
- return m_pUnoThis;
-}
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-ServiceImplementationInfo const* OInnerElement<NodeClass>::doGetServiceInfo() const
-{
- return s_pServiceInfo;
-}
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-ServiceImplementationInfo const* OInnerElement<NodeClass>::getStaticServiceInfo()
-{
- return s_pServiceInfo;
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// Set Elements
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-configuration::NodeRef OSetElement<NodeClass>::doGetNode() const
-{
- return m_aTree.getTree()->getRootNode();
-}
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-ApiTreeImpl& OSetElement<NodeClass>::getApiTree() const
-{
- return m_aTree;
-}
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-uno::XInterface* OSetElement<NodeClass>::doGetUnoInstance() const
-{
- return m_aTree.getUnoInstance();
-}
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-ServiceImplementationInfo const* OSetElement<NodeClass>::doGetServiceInfo() const
-{
- return s_pServiceInfo;
-}
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-ServiceImplementationInfo const* OSetElement<NodeClass>::getStaticServiceInfo()
-{
- return s_pServiceInfo;
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// Read-only Root Elements
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-configuration::NodeRef OReadRootElement<NodeClass>::doGetNode() const
-{
- return m_aRootTree.getApiTree().getTree()->getRootNode();
-}
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-ApiTreeImpl& OReadRootElement<NodeClass>::getApiTree() const
-{
- return m_aRootTree.getApiTree();
-}
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-ApiRootTreeImpl& OReadRootElement<NodeClass>::getRootTree()
-{
- return m_aRootTree;
-}
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-uno::XInterface* OReadRootElement<NodeClass>::doGetUnoInstance() const
-{
- return m_aRootTree.getApiTree().getUnoInstance();
-}
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-ServiceImplementationInfo const* OReadRootElement<NodeClass>::doGetServiceInfo() const
-{
- return s_pServiceInfo;
-}
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-ServiceImplementationInfo const* OReadRootElement<NodeClass>::getStaticServiceInfo()
-{
- return s_pServiceInfo;
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// Update Root Elements
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-configuration::NodeRef OUpdateRootElement<NodeClass>::doGetNode() const
-{
- return m_aRootTree.getApiTree().getTree()->getRootNode();
-}
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-ApiTreeImpl& OUpdateRootElement<NodeClass>::getApiTree() const
-{
- return m_aRootTree.getApiTree();
-}
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-ApiRootTreeImpl& OUpdateRootElement<NodeClass>::getRootTree()
-{
- return m_aRootTree;
-}
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-uno::XInterface* OUpdateRootElement<NodeClass>::doGetUnoInstance() const
-{
- return m_aRootTree.getApiTree().getUnoInstance();
-}
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-ServiceImplementationInfo const* OUpdateRootElement<NodeClass>::doGetServiceInfo() const
-{
- return s_pServiceInfo;
-}
-//-----------------------------------------------------------------------------
-
-template <class NodeClass>
-ServiceImplementationInfo const* OUpdateRootElement<NodeClass>::getStaticServiceInfo()
-{
- return s_pServiceInfo;
-}
-//-----------------------------------------------------------------------------
-
-//========================================================================
-//= Instantiations
-//========================================================================
-/*
-//-----------------------------------------------------------------------------
-// Inner Elements
-//-----------------------------------------------------------------------------
-
-template class OInnerElement<NodeGroupInfoAccess>; // OInnerGroupInfoAccess
-template class OInnerElement<NodeGroupAccess>; // OInnerGroupUpdateAccess
-template class OInnerElement<NodeSetInfoAccess>; // OInnerSetInfoAccess
-template class OInnerElement<NodeTreeSetAccess>; // OInnerTreeSetUpdateAccess
-template class OInnerElement<NodeValueSetAccess>; // OInnerValueSetUpdateAccess
-
-//-----------------------------------------------------------------------------
-// Set Elements
-//-----------------------------------------------------------------------------
-template class OSetElement<NodeGroupInfoAccess>; // OSetElementGroupInfoAccess
-template class OSetElement<NodeGroupAccess>; // OSetElementGroupUpdateAccess
-template class OSetElement<NodeSetInfoAccess>; // OSetElementSetInfoAccess
-template class OSetElement<NodeTreeSetAccess>; // OSetElementTreeSetUpdateAccess
-template class OSetElement<NodeValueSetAccess>; // OSetElementValueSetUpdateAccess
-
-//-----------------------------------------------------------------------------
-// Root Elements
-//-----------------------------------------------------------------------------
-
-template class OReadRootElement<NodeGroupInfoAccess>; // ORootElementGroupInfoAccess
-template class OUpdateRootElement<NodeGroupAccess>; // ORootElementGroupUpdateAccess
-template class OReadRootElement<NodeSetInfoAccess>; // ORootElementSetInfoAccess
-template class OUpdateRootElement<NodeTreeSetAccess>; // ORootElementTreeSetUpdateAccess
-template class OUpdateRootElement<NodeValueSetAccess>; // ORootElementValueSetUpdateAccess
-*/
-//-----------------------------------------------------------------------------
- }
-}
diff --git a/configmgr/source/api2/apifactory.cxx b/configmgr/source/api2/apifactory.cxx
deleted file mode 100644
index 6e644eb598..0000000000
--- a/configmgr/source/api2/apifactory.cxx
+++ /dev/null
@@ -1,335 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "apifactory.hxx"
-#include "objectregistry.hxx"
-
-#include "apitreeaccess.hxx"
-#include "apitreeimplobj.hxx"
-
-#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/lang/XUnoTunnel.hpp>
-
-#include "noderef.hxx"
-#include "anynoderef.hxx"
-
-#include "configexcept.hxx"
-#include "configset.hxx"
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace css = ::com::sun::star;
- namespace uno = css::uno;
- namespace lang = css::lang;
-//-----------------------------------------------------------------------------
- namespace configapi
- {
-//-----------------------------------------------------------------------------
-ObjectRegistry::~ObjectRegistry()
-{
- OSL_ENSURE(m_aMap.empty(),"WARNING: Configuration Object Map: Some Objects were not revoked correctly");
-}
-
-//-----------------------------------------------------------------------------
-
-Factory::Factory(rtl::Reference<ObjectRegistry> pRegistry)
-: m_pRegistry(pRegistry)
-, m_aTunnelID()
-{
- OSL_ENSURE(pRegistry.is(), "ERROR: Factory requires a Object Registry");
-}
-//-----------------------------------------------------------------------------
-
-Factory::~Factory()
-{
-}
-//-----------------------------------------------------------------------------
-inline
-NodeElement* Factory::implFind(configuration::NodeID const& aNode)
-{
- return m_pRegistry->findElement(aNode);
-}
-//-----------------------------------------------------------------------------
-inline
-void Factory::doRegisterElement(configuration::NodeID const& aNode, NodeElement* pElement)
-{
- m_pRegistry->registerElement(aNode,pElement);
-}
-//-----------------------------------------------------------------------------
-inline
-void Factory::doRevokeElement(configuration::NodeID const& aNode, NodeElement* pElement)
-{
- m_pRegistry->revokeElement(aNode,pElement);
-}
-//-----------------------------------------------------------------------------
-
-ApiTreeImpl& Factory::getImplementation(NodeElement& rElement)
-{
- return rElement.getApiTree();
-}
-//-----------------------------------------------------------------------------
-
-inline
-rtl::Reference<configuration::Template> Factory::implGetSetElementTemplate(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode)
-{
- rtl::Reference<configuration::Template> aRet;
- if (configuration::isSetNode(aTree,aNode))
- {
- aRet = aTree->extractElementInfo(aNode);
- }
- else if (!configuration::isGroupNode(aTree,aNode))
- {
- OSL_ENSURE( !configuration::isStructuralNode(aTree,aNode), "ERROR: Configuration: unknown kind of object");
- throw configuration::Exception("INTERNAL ERROR: Cannot create template - Unexpected node type");
- }
- return aRet;
-}
-//-----------------------------------------------------------------------------
-inline
-uno::Reference< uno::XInterface > Factory::implToUno(NodeElement* pElement)
-{
- if ( pElement )
- return uno::Reference< uno::XInterface >(pElement->getUnoInstance(), uno::UNO_REF_NO_ACQUIRE);
- else
- return uno::Reference< uno::XInterface >();
-}
-//-----------------------------------------------------------------------------
-inline
-void Factory::implHaveNewElement(configuration::NodeID aNodeID, NodeElement* pElement)
-{
- OSL_ENSURE(pElement ,"WARNING: New API object could not be created");
-
- if (pElement)
- {
- doRegisterElement(aNodeID,pElement);
- OSL_ENSURE(implFind(aNodeID) == pElement,"WARNING: New API object could not be registered with its factory");
- }
-}
-//-----------------------------------------------------------------------------
-
-uno::Reference< uno::XInterface > Factory::makeUnoElement(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode)
-{
- return implToUno(makeElement(aTree,aNode));
-}
-//-----------------------------------------------------------------------------
-NodeElement* Factory::makeElement(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode)
-{
- OSL_PRECOND( !configuration::isEmpty(aTree.get()) == aNode.isValid(), "ERROR: Configuration: Making element from tree requires valid node");
- if (configuration::isEmpty(aTree.get()))
- return 0;
-
- OSL_PRECOND( aNode.isValid() && aTree->isValidNode(aNode.getOffset()), "ERROR: Configuration: NodeRef does not match Tree");
- OSL_PRECOND( configuration::isStructuralNode(aTree,aNode), "ERROR: Configuration: Cannot make object for value node");
-
- configuration::NodeID aNodeID(aTree,aNode);
- NodeElement* pRet = findElement(aNodeID);
- if (pRet == 0)
- {
- rtl::Reference<configuration::Template> aTemplate = implGetSetElementTemplate(aTree,aNode);
-
- if (!aTree->isRootNode(aNode))
- {
- pRet = doCreateGroupMember(aTree,aNode,aTemplate.get());
- }
- else
- {
- rtl::Reference< configuration::ElementTree > aElementTree(dynamic_cast< configuration::ElementTree * >(aTree.get()));
- if (aElementTree.is())
- {
- pRet = doCreateSetElement(aElementTree,aTemplate.get());
- }
- else
- {
- OSL_ENSURE(configuration::isEmpty(aTree->getContextTree()),"INTERNAL ERROR: Found tree (not a set element) with a parent tree.");
- pRet = doCreateAccessRoot(aTree,aTemplate.get(), vos::ORef< OOptions >());
- }
- }
- implHaveNewElement(aNodeID,pRet);
- }
- return pRet;
-}
-//-----------------------------------------------------------------------------
-
-uno::Reference< uno::XInterface > Factory::findUnoElement(configuration::NodeID const& aNodeID)
-{
- return implToUno(findElement(aNodeID));
-}
-//-----------------------------------------------------------------------------
-NodeElement* Factory::findElement(configuration::NodeID const& aNodeID)
-{
- NodeElement* pReturn = implFind(aNodeID);
- if (pReturn) pReturn->getUnoInstance()->acquire();
- return pReturn;
-}
-//-----------------------------------------------------------------------------
-
-void Factory::revokeElement(configuration::NodeID const& aNodeID)
-{
- if (NodeElement* pElement = implFind(aNodeID))
- doRevokeElement(aNodeID, pElement);
-}
-//-----------------------------------------------------------------------------
-
-TreeElement* Factory::makeAccessRoot(rtl::Reference< configuration::Tree > const& aTree, RequestOptions const& _aOptions)
-{
- OSL_PRECOND( !configuration::isEmpty(aTree.get()) , "ERROR: Configuration: Making element from tree requires valid tree");
- if (configuration::isEmpty(aTree.get())) return 0;
-
- OSL_ENSURE(configuration::isEmpty(aTree->getContextTree()),"INTERNAL ERROR: Tree with parent tree should not be used for an access root");
- OSL_ENSURE(dynamic_cast< configuration::ElementTree * >(aTree.get()) == 0, "INTERNAL ERROR: Element Tree should not be used for an access root");
-
- configuration::NodeRef aRoot = aTree->getRootNode();
- OSL_ENSURE(aRoot.isValid(),"INTERNAL ERROR: Tree has no root node");
-
- OSL_PRECOND( configuration::isStructuralNode(aTree,aRoot), "ERROR: Configuration: Cannot make object for value node");
-
- configuration::NodeID aNodeID(aTree,aRoot);
- // must be a tree element if it is a tree root
- TreeElement* pRet = static_cast<TreeElement*>(findElement(aNodeID));
- if (0 == pRet)
- {
- rtl::Reference<configuration::Template> aTemplate = implGetSetElementTemplate(aTree,aRoot);
- vos::ORef<OOptions> xOptions = new OOptions(_aOptions);
- pRet = doCreateAccessRoot(aTree,aTemplate.get(), xOptions);
- implHaveNewElement (aNodeID,pRet);
- }
- return pRet;
-}
-//-----------------------------------------------------------------------------
-
-uno::Reference< uno::XInterface > Factory::makeUnoSetElement(rtl::Reference< configuration::ElementTree > const& aElementTree)
-{
- uno::Reference< uno::XInterface > aRet = implToUno(makeSetElement(aElementTree));
- OSL_ENSURE( uno::Reference<lang::XUnoTunnel>::query(aRet).is(),"ERROR: API set element has no UnoTunnel");
- OSL_ENSURE( uno::Reference<lang::XUnoTunnel>::query(aRet).is() &&
- 0 != uno::Reference<lang::XUnoTunnel>::query(aRet)->getSomething(doGetElementTunnelID()),
- "ERROR: API set element does not support the right tunnel ID");
-
- return aRet;
-}
-//-----------------------------------------------------------------------------
-
-SetElement* Factory::makeSetElement(rtl::Reference< configuration::ElementTree > const& aElementTree)
-{
- OSL_PRECOND( aElementTree.is() , "ERROR: Configuration: Making element from tree requires valid tree");
- if (!aElementTree.is()) return 0;
-
- rtl::Reference< configuration::Tree > aTree(aElementTree.get());
- OSL_ENSURE(!configuration::isEmpty(aTree.get()),"INTERNAL ERROR: Element Tree has no Tree");
-
- configuration::NodeRef aRoot = aTree->getRootNode();
- OSL_ENSURE(aRoot.isValid(),"INTERNAL ERROR: Tree has no root node");
-
- OSL_ENSURE( configuration::isStructuralNode(aTree,aRoot), "ERROR: Configuration: Cannot make object for value node");
-
- configuration::NodeID aNodeID(aTree,aRoot);
- // must be a set element if it wraps a ElementTree
- SetElement* pRet = static_cast<SetElement*>( findElement(aNodeID) );
- if (0 == pRet)
- {
- rtl::Reference<configuration::Template> aTemplate = implGetSetElementTemplate(aTree,aRoot);
-
- pRet = doCreateSetElement(aElementTree,aTemplate.get());
-
- implHaveNewElement(aNodeID,pRet);
- }
- return pRet;
-}
-//-----------------------------------------------------------------------------
-
-SetElement* Factory::findSetElement(rtl::Reference< configuration::ElementTree > const& aElement)
-{
- OSL_PRECOND( aElement.is() , "ERROR: Configuration: Making element from tree requires valid tree");
- if (!aElement.is()) return 0;
-
- rtl::Reference< configuration::Tree > aTree(aElement.get());
- OSL_ENSURE(!isEmpty(aTree.get()),"INTERNAL ERROR: Element Tree has no Tree");
-
- configuration::NodeRef aRoot = aTree->getRootNode();
- OSL_ENSURE(aRoot.isValid(),"INTERNAL ERROR: Tree has no root node");
-
- configuration::NodeID aNodeID(aTree,aRoot);
- // must be a set element if it wraps a ElementTree
- SetElement* pRet = static_cast<SetElement*>( findElement(aNodeID) );
-
- return pRet;
-}
-//-----------------------------------------------------------------------------
-
-SetElement* Factory::extractSetElement(uno::Any const& aElement)
-{
- SetElement* pTunneledImpl = 0;
-
- uno::Reference< lang::XUnoTunnel > xElementTunnel;
- if ( aElement.hasValue() && (aElement >>= xElementTunnel) )
- {
- OSL_ASSERT( xElementTunnel.is() );
-
- sal_Int64 nSomething = xElementTunnel->getSomething(doGetElementTunnelID());
- if (0 != nSomething)
- {
- void* pVoid = reinterpret_cast<void*>(nSomething);
- pTunneledImpl = static_cast<SetElement*>(pVoid);
- }
- }
- return pTunneledImpl;
-}
-//-----------------------------------------------------------------------------
-
-bool Factory::tunnelSetElement(sal_Int64& nSomething, SetElement& rElement, uno::Sequence< sal_Int8 > const& aTunnelID)
-{
- if (aTunnelID == doGetElementTunnelID())
- {
- void* pVoid = &rElement;
- nSomething = reinterpret_cast<sal_Int64>(pVoid);
-
- return true;
- }
- else
- return false;
-}
-
-//-----------------------------------------------------------------------------
-
-ApiTreeImpl const* Factory::findDescendantTreeImpl(configuration::NodeID const& aNode, ApiTreeImpl const* pImpl)
-{
- ApiTreeImpl* pRet = 0;
- if (pImpl)
- {
- if ( NodeElement* pElement = pImpl->getFactory().implFind( aNode ) )
- pRet = &pElement->getApiTree();
- }
- return pRet;
-}
-
-//-----------------------------------------------------------------------------
- }
-}
diff --git a/configmgr/source/api2/apifactory.hxx b/configmgr/source/api2/apifactory.hxx
deleted file mode 100644
index 892121a4d6..0000000000
--- a/configmgr/source/api2/apifactory.hxx
+++ /dev/null
@@ -1,119 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_FACTORY_HXX_
-#define CONFIGMGR_API_FACTORY_HXX_
-
-#include "options.hxx"
-#include "utility.hxx"
-#include <boost/utility.hpp>
-#include <rtl/ref.hxx>
-#include <vos/ref.hxx>
-#include <cppuhelper/typeprovider.hxx>
-
-namespace configmgr
-{
- namespace configuration
- {
- class NodeID;
- class NodeRef;
- class ElementTree;
- class Template;
- class Tree;
- }
- namespace configapi
- {
- namespace uno = com::sun::star::uno;
-
- class ApiTreeImpl;
- class NodeElement;
- class InnerElement;
- class TreeElement;
- class SetElement;
- class RootElement;
-
- // used to register objects
- class ObjectRegistry;
-
- // used to create UNO objects
- class Factory : private boost::noncopyable
- {
- rtl::Reference<ObjectRegistry> m_pRegistry;
- cppu::OImplementationId const m_aTunnelID;
-
- private:
- /// return the element _without_ acquiring it
- NodeElement* implFind(configuration::NodeID const& aNode);
-
- public:
- Factory(rtl::Reference<ObjectRegistry> pRegistry);
- virtual ~Factory();
-
- uno::Reference< uno::XInterface > makeUnoElement(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode);
- uno::Reference< uno::XInterface > findUnoElement(configuration::NodeID const& aNode);
-
- uno::Reference< uno::XInterface > makeUnoSetElement(rtl::Reference< configuration::ElementTree > const& aTree);
-
- NodeElement* makeElement(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode);
- NodeElement* findElement(configuration::NodeID const& aNode);
-
- TreeElement* makeAccessRoot(rtl::Reference< configuration::Tree > const& aTree, RequestOptions const& _aOptions);
- SetElement* makeSetElement(rtl::Reference< configuration::ElementTree > const& aTree);
-
- SetElement* findSetElement(rtl::Reference< configuration::ElementTree > const& aElement);
-
- /// check for the existence of an element
- sal_Bool hasElement(configuration::NodeID const& _rNode) { return NULL != implFind(_rNode); }
-
- void revokeElement(configuration::NodeID const& aNode);
-
- SetElement* extractSetElement(uno::Any const& aElement);
- bool tunnelSetElement(sal_Int64& nSomething, SetElement& rElement, uno::Sequence< sal_Int8 > const& aTunnelID);
- // registry operations
-
- static ApiTreeImpl const* findDescendantTreeImpl(configuration::NodeID const& aNode, ApiTreeImpl const* pImpl);
- protected:
- void doRegisterElement(configuration::NodeID const& aNode, NodeElement* pElement);
- void doRevokeElement(configuration::NodeID const& aNode, NodeElement* pElement);
-
- uno::Sequence< sal_Int8 > doGetElementTunnelID() const { return m_aTunnelID.getImplementationId(); }
-
- virtual NodeElement* doCreateGroupMember(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode, configuration::Template* pSetElementTemplate) = 0;
- virtual TreeElement* doCreateAccessRoot(rtl::Reference< configuration::Tree > const& aTree, configuration::Template* pSetElementTemplate, vos::ORef< OOptions >const& _xOptions) = 0;
- virtual SetElement* doCreateSetElement(rtl::Reference< configuration::ElementTree > const& aTree, configuration::Template* pSetElementTemplate) = 0;
-
- static ApiTreeImpl& getImplementation(NodeElement& pElement);
- private:
- static rtl::Reference<configuration::Template> implGetSetElementTemplate(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode);
- static uno::Reference< uno::XInterface > implToUno(NodeElement* pNode);
- void implHaveNewElement(configuration::NodeID aNodeID, NodeElement* pNode);
- };
-
- }
-}
-
-#endif // CONFIGMGR_API_FACTORY_HXX_
diff --git a/configmgr/source/api2/apifactoryimpl.cxx b/configmgr/source/api2/apifactoryimpl.cxx
deleted file mode 100644
index 50e76d4e04..0000000000
--- a/configmgr/source/api2/apifactoryimpl.cxx
+++ /dev/null
@@ -1,352 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-#include "apifactoryimpl.hxx"
-
-#include "setobjects.hxx"
-#include "groupobjects.hxx"
-
-#include "configset.hxx"
-#include "configpath.hxx"
-#include "template.hxx"
-#include "noderef.hxx"
-#include "objectregistry.hxx"
-#include "attributes.hxx"
-
-namespace configmgr
-{
- namespace configapi
- {
-//-----------------------------------------------------------------------------
-// class ReadOnlyObjectFactory
-//-----------------------------------------------------------------------------
-
-ReadOnlyObjectFactory::ReadOnlyObjectFactory(ApiProvider& rProvider,rtl::Reference<ObjectRegistry> pRegistry)
-: Factory(pRegistry)
-, m_rProvider(rProvider)
-{
-}
-//-----------------------------------------------------------------------------
-
-ReadOnlyObjectFactory::~ReadOnlyObjectFactory()
-{
-}
-//-----------------------------------------------------------------------------
-
-NodeElement* ReadOnlyObjectFactory::doCreateGroupMember(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode, configuration::Template* pSetElementTemplate)
-{
- OSL_ENSURE(!configuration::isEmpty(aTree.get()), "ERROR: trying to create a group member without a tree");
- OSL_ENSURE(aNode.isValid(), "ERROR: trying to create a group member without a node");
- OSL_ENSURE(aTree->isValidNode(aNode.getOffset()), "ERROR: node does not match tree , while trying to create a group member");
- OSL_ENSURE(!aTree->isRootNode(aNode), "ERROR: trying to create a group member on a root node");
- if (aTree->isRootNode(aNode))
- return 0;
-
- NodeElement* pRootElement = makeElement(aTree,aTree->getRootNode());
- OSL_ENSURE(pRootElement, "Could not create root element of tree - cannot create group member object");
- if (!pRootElement)
- return 0;
-
- uno::Reference<uno::XInterface> aRootRelease(pRootElement->getUnoInstance(), uno::UNO_REF_NO_ACQUIRE);
- ApiTreeImpl& rRootContext = getImplementation(*pRootElement);
-
- NodeElement * pResult = 0;
- if (!pSetElementTemplate)
- {
- OInnerGroupInfo * pNewObject = new OInnerGroupInfo(rRootContext, aNode);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- else
- {
- OInnerSetInfo * pNewObject = new OInnerSetInfo(rRootContext, aNode);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
-
- return pResult;
-}
-//-----------------------------------------------------------------------------
-
-TreeElement* ReadOnlyObjectFactory::doCreateAccessRoot(rtl::Reference< configuration::Tree > const& aTree, configuration::Template* pSetElementTemplate, vos::ORef< OOptions >const& _xOptions)
-{
- OSL_ENSURE(!configuration::isEmpty(aTree.get()), "ERROR: trying to create a root object without a tree");
-
- TreeElement * pResult = 0;
- if (!pSetElementTemplate)
- {
- ORootElementGroupInfo * pNewObject = new ORootElementGroupInfo(m_rProvider, aTree, _xOptions);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- else
- {
- ORootElementSetInfo * pNewObject = new ORootElementSetInfo(m_rProvider, aTree, _xOptions);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- return pResult;
-}
-
-//-----------------------------------------------------------------------------
-SetElement* ReadOnlyObjectFactory::doCreateSetElement(rtl::Reference< configuration::ElementTree > const& aElementTree, configuration::Template* pSetElementTemplate)
-{
- OSL_ENSURE(aElementTree.is(), "ERROR: trying to create a set element object without a tree");
-
- rtl::Reference< configuration::Tree > aTree( aElementTree.get() );
- OSL_ENSURE(!configuration::isEmpty(aTree.get()), "ERROR: trying to create a set element object without a tree");
-
- ApiTreeImpl * pParentContext = 0;
- uno::Reference<uno::XInterface> aParentRelease;
-
- rtl::Reference< configuration::Tree > aParentTree = aTree->getContextTree();
- if (!configuration::isEmpty(aParentTree.get()))
- {
- //configuration::NodeRef aParentNode = aTree.getContextNode();
- configuration::NodeRef aParentRoot = aParentTree->getRootNode();
- if (NodeElement* pParentRootElement = makeElement(aParentTree,aParentRoot) )
- {
- aParentRelease = uno::Reference<uno::XInterface>(pParentRootElement->getUnoInstance(), uno::UNO_REF_NO_ACQUIRE);
- pParentContext = &getImplementation(*pParentRootElement);
- }
- }
-
- SetElement * pResult = 0;
- if (!pSetElementTemplate)
- {
- OSetElementGroupInfo * pNewObject = new OSetElementGroupInfo(aTree,m_rProvider,pParentContext);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- else
- {
- OSetElementSetInfo * pNewObject = new OSetElementSetInfo(aTree,m_rProvider,pParentContext);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- return pResult;
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// class UpdateObjectFactory
-//-----------------------------------------------------------------------------
-
-UpdateObjectFactory::UpdateObjectFactory(ApiProvider& rProvider,rtl::Reference<ObjectRegistry> pRegistry)
-: Factory(pRegistry)
-, m_rProvider(rProvider)
-{
-}
-//-----------------------------------------------------------------------------
-
-UpdateObjectFactory::~UpdateObjectFactory()
-{
-}
-//-----------------------------------------------------------------------------
-
-bool UpdateObjectFactory::implIsReadOnly(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode)
-{
- OSL_ENSURE(!configuration::isEmpty(aTree.get()), "ERROR: trying to create an object without a tree");
- OSL_ENSURE(aNode.isValid(), "ERROR: trying to create an object without a node");
- OSL_ENSURE(aTree->isValidNode(aNode.getOffset()), "ERROR: node does not match tree , while trying to create an object");
-
- return aTree->getAttributes(aNode).isReadonly();
-}
-//-----------------------------------------------------------------------------
-
-NodeElement* UpdateObjectFactory::doCreateGroupMember(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode, configuration::Template* pSetElementTemplate)
-{
- OSL_ENSURE(!configuration::isEmpty(aTree.get()), "ERROR: trying to create a group member without a tree");
- OSL_ENSURE(aNode.isValid(), "ERROR: trying to create a group member without a node");
- OSL_ENSURE(aTree->isValidNode(aNode.getOffset()), "ERROR: node does not match tree , while trying to create a group");
-
- NodeElement* pRootElement = makeElement(aTree,aTree->getRootNode());
- OSL_ENSURE(pRootElement, "Could not create root element of tree - cannot create group member object");
- if (!pRootElement)
- return 0;
-
- uno::Reference<uno::XInterface> aRootRelease(pRootElement->getUnoInstance(), uno::UNO_REF_NO_ACQUIRE);
- ApiTreeImpl& rRootContext = getImplementation(*pRootElement);
-
- NodeElement * pResult = 0;
-
- if (implIsReadOnly(aTree,aNode))
- {
- if (!pSetElementTemplate)
- {
- OInnerGroupInfo * pNewObject = new OInnerGroupInfo(rRootContext, aNode);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- else
- {
- OInnerSetInfo * pNewObject = new OInnerSetInfo(rRootContext, aNode);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- }
- else
- {
- if (!pSetElementTemplate)
- {
- OInnerGroupUpdate * pNewObject = new OInnerGroupUpdate(rRootContext, aNode);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- else if (pSetElementTemplate->isInstanceValue())
- {
- OInnerValueSetUpdate * pNewObject = new OInnerValueSetUpdate(rRootContext, aNode);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- else
- {
- OInnerTreeSetUpdate * pNewObject = new OInnerTreeSetUpdate(rRootContext, aNode);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- }
-
- return pResult;
-}
-//-----------------------------------------------------------------------------
-
-TreeElement* UpdateObjectFactory::doCreateAccessRoot(rtl::Reference< configuration::Tree > const& aTree, configuration::Template* pSetElementTemplate, vos::ORef< OOptions >const& _xOptions)
-{
- OSL_ENSURE(!configuration::isEmpty(aTree.get()), "ERROR: trying to create a root object without a tree");
-
- TreeElement * pResult = 0;
- if (implIsReadOnly(aTree,aTree->getRootNode()))
- {
- OSL_ENSURE(false, "WARNING: Trying to create an 'Update Access' on a read-only tree/node");
- if (!pSetElementTemplate)
- {
- ORootElementGroupInfo * pNewObject = new ORootElementGroupInfo(m_rProvider, aTree, _xOptions);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- else
- {
- ORootElementSetInfo * pNewObject = new ORootElementSetInfo(m_rProvider, aTree, _xOptions);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- }
- else
- {
- if (!pSetElementTemplate)
- {
- ORootElementGroupUpdate * pNewObject = new ORootElementGroupUpdate(m_rProvider, aTree, _xOptions);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- else if (pSetElementTemplate->isInstanceValue())
- {
- ORootElementValueSetUpdate * pNewObject = new ORootElementValueSetUpdate(m_rProvider, aTree, _xOptions);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- else
- {
- ORootElementTreeSetUpdate * pNewObject = new ORootElementTreeSetUpdate(m_rProvider, aTree, _xOptions);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- }
-
- return pResult;
-}
-
-//-----------------------------------------------------------------------------
-SetElement* UpdateObjectFactory::doCreateSetElement(rtl::Reference< configuration::ElementTree > const& aElementTree, configuration::Template* pSetElementTemplate)
-{
- OSL_ENSURE(aElementTree.is(), "ERROR: trying to create a set element object without a tree");
-
- rtl::Reference< configuration::Tree > aTree( aElementTree.get() );
- OSL_ENSURE(!configuration::isEmpty(aTree.get()), "ERROR: trying to create a set element object without a tree");
-
- ApiTreeImpl * pParentContext = 0;
- uno::Reference<uno::XInterface> aParentRelease;
-
- rtl::Reference< configuration::Tree > aParentTree = aTree->getContextTree();
- if (!configuration::isEmpty(aParentTree.get()))
- {
- //configuration::NodeRef aParentNode = aTree.getContextNode();
- configuration::NodeRef aParentRoot = aParentTree->getRootNode();
- if (NodeElement* pParentRootElement = makeElement(aParentTree,aParentRoot) )
- {
- aParentRelease = uno::Reference<uno::XInterface>(pParentRootElement->getUnoInstance(), uno::UNO_REF_NO_ACQUIRE);
- pParentContext = &getImplementation(*pParentRootElement);
- }
- }
-
- SetElement * pResult = 0;
- if (implIsReadOnly(aTree,aTree->getRootNode()))
- {
- if (!pSetElementTemplate)
- {
- OSetElementGroupInfo * pNewObject = new OSetElementGroupInfo(aTree,m_rProvider,pParentContext);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- else
- {
- OSetElementSetInfo * pNewObject = new OSetElementSetInfo(aTree,m_rProvider,pParentContext);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- }
- else
- {
- if (!pSetElementTemplate)
- {
- OSetElementGroupUpdate * pNewObject = new OSetElementGroupUpdate(aTree,m_rProvider,pParentContext);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- else if (pSetElementTemplate->isInstanceValue())
- {
- OSetElementValueSetUpdate * pNewObject = new OSetElementValueSetUpdate(aTree,m_rProvider,pParentContext);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- else
- {
- OSetElementTreeSetUpdate * pNewObject = new OSetElementTreeSetUpdate(aTree,m_rProvider,pParentContext);
- pNewObject->acquire();
- pResult = &pNewObject->getElementClass();
- }
- }
- return pResult;
-}
-//-----------------------------------------------------------------------------
- }
-}
-
diff --git a/configmgr/source/api2/apifactoryimpl.hxx b/configmgr/source/api2/apifactoryimpl.hxx
deleted file mode 100644
index dd8a1b8850..0000000000
--- a/configmgr/source/api2/apifactoryimpl.hxx
+++ /dev/null
@@ -1,68 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_FACTORYIMPL_HXX_
-#define CONFIGMGR_API_FACTORYIMPL_HXX_
-
-#include "apifactory.hxx"
-
-namespace configmgr
-{
- namespace configapi
- {
- class ApiProvider;
- // used to create UNO objects
- class ReadOnlyObjectFactory : public Factory
- {
- ApiProvider& m_rProvider;
- public:
- ReadOnlyObjectFactory(ApiProvider& rProvider,rtl::Reference<ObjectRegistry> pRegistry);
- ~ReadOnlyObjectFactory();
-
- virtual NodeElement* doCreateGroupMember(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode, configuration::Template* pSetElementTemplate);
- virtual TreeElement* doCreateAccessRoot(rtl::Reference< configuration::Tree > const& aTree, configuration::Template* pSetElementTemplate, vos::ORef< OOptions >const& _xOptions);
- virtual SetElement* doCreateSetElement(rtl::Reference< configuration::ElementTree > const& aTree, configuration::Template* pSetElementTemplate);
- };
- // used to create UNO objects
- class UpdateObjectFactory : public Factory
- {
- ApiProvider& m_rProvider;
- public:
- UpdateObjectFactory(ApiProvider& rProvider,rtl::Reference<ObjectRegistry> pRegistry);
- ~UpdateObjectFactory();
-
- virtual NodeElement* doCreateGroupMember(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode, configuration::Template* pSetElementTemplate);
- virtual TreeElement* doCreateAccessRoot(rtl::Reference< configuration::Tree > const& aTree, configuration::Template* pSetElementTemplate, vos::ORef< OOptions >const& _xOptions);
- virtual SetElement* doCreateSetElement(rtl::Reference< configuration::ElementTree > const& aTree, configuration::Template* pSetElementTemplate);
- private:
- bool implIsReadOnly(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode);
- };
-
- }
-}
-
-#endif // CONFIGMGR_API_FACTORYIMPL_HXX_
diff --git a/configmgr/source/api2/apinodeaccess.cxx b/configmgr/source/api2/apinodeaccess.cxx
deleted file mode 100644
index 4ee2a98db8..0000000000
--- a/configmgr/source/api2/apinodeaccess.cxx
+++ /dev/null
@@ -1,178 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-#include "apinodeaccess.hxx"
-
-#include "apitreeimplobj.hxx"
-#include "apifactory.hxx"
-
-#include "apitreeaccess.hxx"
-#include "noderef.hxx"
-
-#include "anynoderef.hxx"
-#include "valueref.hxx"
-
-#include "configset.hxx"
-#include "configpath.hxx"
-#include "confignotifier.hxx"
-
-namespace configmgr
-{
- namespace configapi
- {
-//-----------------------------------------------------------------------------
-
-NodeAccess::~NodeAccess()
-{
-}
-//-----------------------------------------------------------------------------
-
-configuration::NodeRef NodeAccess::getNodeRef() const
-{
- return doGetNode();
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference< configuration::Tree > NodeAccess::getTreeRef() const
-{
- return getApiTree().getTree();
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference< configuration::Tree > NodeAccess::getTree() const
-{
- return getApiTree().getTree();
-}
-//-----------------------------------------------------------------------------
-
-void NodeAccess::checkAlive() const
-{
- getApiTree().checkAlive();
-}
-//-----------------------------------------------------------------------------
-
-void NodeAccess::disposeNode()
-{
- getApiTree().disposeNode(getNodeRef(), getUnoInstance());
-}
-//-----------------------------------------------------------------------------
-
-
-Factory& NodeAccess::getFactory() const
-{
- return getApiTree().getFactory();
-}
-//-----------------------------------------------------------------------------
-
-Notifier NodeAccess::getNotifier() const
-{
- return getApiTree().getNotifier();
-}
-
-//-----------------------------------------------------------------------------
-
-uno::Any makeElement(configapi::Factory& rFactory, rtl::Reference< configuration::Tree > const& aTree, configuration::AnyNodeRef const& aNode)
-{
- if (!configuration::isEmpty(aTree.get()) && aNode.isValid())
- {
- if (aNode.isNode())
- {
- configuration::NodeRef aInnerNode = aNode.toNode();
-
- if (configuration::isStructuralNode(aTree,aInnerNode))
- return uno::makeAny( rFactory.makeUnoElement(aTree,aInnerNode) );
-
- else
- return configuration::getSimpleElementValue(aTree,aInnerNode);
- }
- else
- {
- return configuration::getSimpleValue(aTree,aNode.toValue());
- }
- }
-
- return uno::Any();
-}
-//-----------------------------------------------------------------------------
-
-uno::Any makeInnerElement(configapi::Factory& rFactory, rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode)
-{
- if (!configuration::isEmpty(aTree.get()) && aNode.isValid())
- {
- OSL_ENSURE(configuration::isStructuralNode(aTree,aNode), "Trying to makeInnerElement for a simple value");
-
- return uno::makeAny( rFactory.makeUnoElement(aTree,aNode) );
- }
-
- return uno::Any();
-}
-//-----------------------------------------------------------------------------
-
-uno::Any makeElement(configapi::Factory& rFactory, rtl::Reference< configuration::ElementTree > const& aTree)
-{
- if (aTree.is())
- {
- return uno::makeAny( rFactory.makeUnoSetElement(aTree) );
- }
-
- return uno::Any();
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference< configuration::ElementTree > extractElementTree(configapi::Factory& rFactory, uno::Any const& aElement, rtl::Reference< configuration::Template > const& aTemplate )
-{
- OSL_ENSURE(aTemplate.is(), "ERROR: Need a template to extract a matching set element");
-
- if (SetElement* pSetElement = rFactory.extractSetElement(aElement))
- {
- rtl::Reference<configuration::Template> aFoundTemplate = pSetElement->getTemplateInfo();
- if (aFoundTemplate.is())
- {
- if (aFoundTemplate != aTemplate)
- throw configuration::TypeMismatch(aFoundTemplate->getPathString(), aTemplate->getPathString());
-
- return pSetElement->getElementRef( );
- }
- }
- return rtl::Reference< configuration::ElementTree >();
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference< configuration::Template > NodeSetInfoAccess::getElementInfo() const
-{
- rtl::Reference<configuration::Template> aTemplate = getTree()->extractElementInfo(getNodeRef());
-
- OSL_ENSURE(aTemplate.is(), "ERROR: Set must have an element template");
-
- return aTemplate;
-}
-
-}
-}
diff --git a/configmgr/source/api2/apinodeaccess.hxx b/configmgr/source/api2/apinodeaccess.hxx
deleted file mode 100644
index e6fc665e6a..0000000000
--- a/configmgr/source/api2/apinodeaccess.hxx
+++ /dev/null
@@ -1,172 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_NODEACCESS_HXX_
-#define CONFIGMGR_API_NODEACCESS_HXX_
-
-#include "sal/config.h"
-
-#include "boost/utility.hpp"
-
-#include "datalock.hxx"
-#include "utility.hxx"
-#include "noderef.hxx"
-
-namespace osl { class Mutex; }
-
-namespace configmgr
-{
- namespace configuration
- {
- class AnyNodeRef;
- class NodeRef;
- class Tree;
- }
- namespace configapi
- {
- class Factory;
- class Notifier;
- class SetElement;
-
- class ApiTreeImpl;
-
- namespace uno = com::sun::star::uno;
-
- // API object implementation wrappers
- // these objects just provide the pieces needed to navigate and manipulate trees and nodes
-
- // The common part of all nodes, provides all you need to read and listen
- class NodeAccess : private boost::noncopyable
- {
- public:
- virtual ~NodeAccess();
-
- // model access
- configuration::NodeRef getNodeRef() const;
- rtl::Reference< configuration::Tree > getTreeRef() const;
- rtl::Reference< configuration::Tree > getTree() const;
-
- // self-locked methods for dispose handling
- void checkAlive() const;
- void disposeNode();
-
- // api object handling
- uno::XInterface* getUnoInstance() const
- { return doGetUnoInstance(); }
- Factory& getFactory() const;
- Notifier getNotifier() const;
-
- protected:
- virtual configuration::NodeRef doGetNode() const = 0;
- virtual uno::XInterface* doGetUnoInstance() const = 0;
- virtual ApiTreeImpl& getApiTree() const = 0;
- };
-
- /** builds a Uno <type scope='com::sun::star::uno'>Any</type> representing node <var>aNode</var>.
- <p> Uses the <type scope='configmgr::configapi'>Factory</type> provided
- to create service implementations wrapping inner nodes</p>
- <p> returns VOID if <var>aNode</var> is empty.</p>
- */
- uno::Any makeElement(configapi::Factory& rFactory, rtl::Reference< configuration::Tree > const& aTree, configuration::AnyNodeRef const& aNode);
-
- /** builds a Uno <type scope='com::sun::star::uno'>Any</type> representing inner node <var>aNode</var>.
- <p> Uses the <type scope='configmgr::configapi'>Factory</type> provided
- to create service implementations wrapping inner nodes</p>
- <p> returns VOID if <var>aNode</var> is empty.</p>
- */
- uno::Any makeInnerElement(configapi::Factory& rFactory, rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode);
-
- /** builds a Uno <type scope='com::sun::star::uno'>Any</type> representing set element <var>aElement</var>.
- <p> Uses the <type scope='configmgr::configapi'>Factory</type> provided
- to create service implementations wrapping inner nodes</p>
- <p> returns VOID if <var>aNode</var> is empty.</p>
- */
- uno::Any makeElement(configapi::Factory& rFactory, rtl::Reference< configuration::ElementTree > const& aTree);
-
-
- // Info interfaces for Group Nodes
- class NodeGroupInfoAccess : public NodeAccess
- {
- public:
- // currently only used for tagging group nodes
- };
-
- // Info interfaces for Set Nodes
- class NodeSetInfoAccess : public NodeAccess
- {
- friend class SetElement;
- public:
- rtl::Reference< configuration::Template > getElementInfo() const;
- };
-
- /** extracts a <type scope='configmgr::configuration'>ElementTree</type> from a <type scope='com::sun::star::uno'>Any</type>
- which must contain an object which wraps an instance of the template available in <var>aTemplate</var>.
- <p> Uses the <type scope='configmgr::configapi'>Factory</type> provided
- to resolve inner nodes (which may suppose that the object was created using the same factory)</p>
- <p> returns an empty tree if <var>aElement</var> is empty.</p>
- <p> May throw exceptions if the type doesn't match the template.</p>
- */
- rtl::Reference< configuration::ElementTree > extractElementTree(Factory& rFactory, uno::Any const& aElement, rtl::Reference< configuration::Template > const& aTemplate );
-
- /// wraps a NodeAccess; provides both object and provider (read) locks,
- // ensures object was not disposed
- template <class Access>
- class GuardedNodeData
- {
- UnoApiLock m_aLock;
- Access & m_rNode;
- public:
- GuardedNodeData(Access& rNode);
- public:
- Access& get() const { return m_rNode; }
-
- rtl::Reference< configuration::Tree > getTree() const;
- configuration::NodeRef getNode() const;
- };
-
- template <class Access>
- GuardedNodeData<Access>::GuardedNodeData(Access& rNode)
- : m_rNode(rNode)
- {
- rNode.checkAlive();
- }
-
- template <class Access>
- rtl::Reference< configuration::Tree > GuardedNodeData<Access>::getTree() const
- {
- return m_rNode.getTree();
- }
-
- template <class Access>
- configuration::NodeRef GuardedNodeData<Access>::getNode() const
- {
- return m_rNode.getNodeRef();
- }
- }
-}
-
-#endif // CONFIGMGR_API_NODEACCESS_HXX_
diff --git a/configmgr/source/api2/apinodeupdate.cxx b/configmgr/source/api2/apinodeupdate.cxx
deleted file mode 100644
index dfe28a0c9d..0000000000
--- a/configmgr/source/api2/apinodeupdate.cxx
+++ /dev/null
@@ -1,169 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-#include "apinodeupdate.hxx"
-#include "apitreeimplobj.hxx"
-#include "apitreeaccess.hxx"
-#include "noderef.hxx"
-#include "configset.hxx"
-#include "configgroup.hxx"
-#include "configpath.hxx"
-#include "apifactory.hxx"
-
-namespace configmgr
-{
- namespace configapi
- {
-//-----------------------------------------------------------------------------
-
-NodeGroupAccess& withDefaultData(NodeGroupAccess& _aGroup)
-{
- configuration::GroupDefaulter::ensureDataAvailable(_aGroup.getTreeRef(),_aGroup.getNodeRef(),
- _aGroup.getApiTree().getDefaultProvider());
- return _aGroup;
-}
-//-----------------------------------------------------------------------------
-
-configuration::GroupUpdater NodeGroupAccess::getNodeUpdater()
-{
- return configuration::GroupUpdater(getTree(),getNodeRef(), getApiTree().getProvider().getTypeConverter());
-}
-//-----------------------------------------------------------------------------
-
-configuration::GroupDefaulter NodeGroupAccess::getNodeDefaulter()
-{
- return configuration::GroupDefaulter(getTree(),getNodeRef(), getApiTree().getDefaultProvider());
-}
-//-----------------------------------------------------------------------------
-
-configuration::SetElementFactory NodeTreeSetAccess::getElementFactory()
-{
- configuration::TemplateProvider aProvider = configuration::SetElementFactory::findTemplateProvider(getTree(),getNodeRef());
- return configuration::SetElementFactory(aProvider);
-}
-//-----------------------------------------------------------------------------
-
-configuration::SetDefaulter NodeSetAccess::getNodeDefaulter()
-{
- return configuration::SetDefaulter(getTree(),getNodeRef(), getApiTree().getDefaultProvider());
-}
-//-----------------------------------------------------------------------------
-
-configuration::TreeSetUpdater NodeTreeSetAccess::getNodeUpdater()
-{
- return configuration::TreeSetUpdater(getTree(),getNodeRef(),getElementInfo());
-}
-//-----------------------------------------------------------------------------
-
-
-configuration::ValueSetUpdater NodeValueSetAccess::getNodeUpdater()
-{
- return configuration::ValueSetUpdater(getTree(),getNodeRef(),getElementInfo(), getApiTree().getProvider().getTypeConverter());
-}
-//-----------------------------------------------------------------------------
-
-void attachSetElement(NodeTreeSetAccess& aSet, SetElement& aElement)
-{
- OSL_ENSURE( configuration::NodeID(aSet.getTreeRef(),aSet.getNodeRef()) ==
- configuration::NodeID(rtl::Reference< configuration::Tree >(aElement.getTreeRef()->getContextTree()),aElement.getTreeRef()->getContextNodeRef()),
- "ERROR: Attaching an unrelated SetElement to a SetInfoAccess");
-
- aElement.haveNewParent(&aSet);
-}
-//-----------------------------------------------------------------------------
-
-bool attachSetElement(NodeTreeSetAccess& aSet, rtl::Reference< configuration::ElementTree > const& aElementTree)
-{
- OSL_ENSURE( configuration::NodeID(aSet.getTreeRef(),aSet.getNodeRef()) ==
- configuration::NodeID(rtl::Reference< configuration::Tree >(aElementTree->getContextTree()), aElementTree->getContextNodeRef()),
- "ERROR: Attaching an unrelated ElementTree to a SetInfoAccess");
-
- Factory& rFactory = aSet.getFactory();
- if (SetElement* pSetElement = rFactory.findSetElement(aElementTree))
- {
- // the factory always does an extra acquire
- uno::Reference<uno::XInterface> xReleaseSetElement(pSetElement->getUnoInstance(), uno::UNO_REF_NO_ACQUIRE);
-
- attachSetElement(aSet, *pSetElement);
- return true;
- }
- else
- return false;
-
-}
-//-----------------------------------------------------------------------------
-
-void detachSetElement(SetElement& aElement)
-{
- OSL_ENSURE( configuration::isEmpty(aElement.getTreeRef()->getContextTree()),
- "ERROR: Detaching a SetElement that has a parent");
-
- aElement.haveNewParent(0);
-}
-//-----------------------------------------------------------------------------
-
-bool detachSetElement(Factory& rFactory, rtl::Reference< configuration::ElementTree > const& aElementTree)
-{
- OSL_ENSURE( configuration::isEmpty(aElementTree->getContextTree()),
- "ERROR: Detaching an ElementTree that has a parent");
-
- if (SetElement* pSetElement = rFactory.findSetElement(aElementTree))
- {
- // the factory always does an extra acquire
- uno::Reference<uno::XInterface> xReleaseSetElement(pSetElement->getUnoInstance(), uno::UNO_REF_NO_ACQUIRE);
-
- detachSetElement(*pSetElement);
- return true;
- }
- else
- return false;
-
-}
-//-----------------------------------------------------------------------------
-
-UpdateGuardImpl::UpdateGuardImpl(NodeGroupAccess& rNode)
-: m_rNode(rNode)
-{
- rNode.checkAlive();
-}
-//-----------------------------------------------------------------------------
-
-UpdateGuardImpl::UpdateGuardImpl(NodeSetAccess& rNode)
-: m_rNode(rNode)
-{
-}
-//-----------------------------------------------------------------------------
-
-UpdateGuardImpl::~UpdateGuardImpl() throw ()
-{
-}
-//-----------------------------------------------------------------------------
- }
-}
diff --git a/configmgr/source/api2/apinodeupdate.hxx b/configmgr/source/api2/apinodeupdate.hxx
deleted file mode 100644
index db23f1f212..0000000000
--- a/configmgr/source/api2/apinodeupdate.hxx
+++ /dev/null
@@ -1,174 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_NODEUPDATE_HXX_
-#define CONFIGMGR_API_NODEUPDATE_HXX_
-
-#include "sal/config.h"
-
-#include "boost/utility.hpp"
-
-#include "apinodeaccess.hxx"
-#include "utility.hxx"
-
-namespace configmgr
-{
- namespace configuration
- {
- class GroupUpdater;
- class GroupDefaulter;
- class TreeSetUpdater;
- class ValueSetUpdater;
- class SetDefaulter;
- class SetElementFactory;
-
- class NodeUpdate;
- }
- namespace configapi
- {
- class SetElement;
-
- // API object implementation wrappers
- // these objects just provide the pieces needed to navigate and manipulate trees and nodes
-
- // Updating access for Group Nodes
- class NodeGroupAccess : public NodeGroupInfoAccess
- {
- public:
- typedef configuration::GroupUpdater NodeUpdater;
- typedef configuration::GroupDefaulter NodeDefaulter;
- NodeUpdater getNodeUpdater();
- NodeDefaulter getNodeDefaulter();
-
- /** ensures that the default data for a group is loaded (if possible)
- <p>Must be called outside of any locks !</p>
- */
- friend NodeGroupAccess& withDefaultData(NodeGroupAccess& aGroup);
- };
-
- // Updating access for Set Nodes
- class NodeSetAccess : public NodeSetInfoAccess
- {
- public:
- typedef struct SetUpdater_PlaceHolder NodeUpdater;
- typedef configuration::SetDefaulter NodeDefaulter;
- NodeDefaulter getNodeDefaulter();
- };
-
- // Updating access for Set Nodes containing whole trees
- class NodeTreeSetAccess : public NodeSetAccess
- {
- public:
- typedef configuration::TreeSetUpdater NodeUpdater;
- NodeUpdater getNodeUpdater();
-
- configuration::SetElementFactory getElementFactory();
- };
-
- // Updating access for Set Nodes containing simple values
- class NodeValueSetAccess : public NodeSetAccess
- {
- public:
- typedef configuration::ValueSetUpdater NodeUpdater;
- NodeUpdater getNodeUpdater();
- };
-
- /// informs a <type>SetElement</type> that it should now link to the given SetElement
- void attachSetElement(NodeTreeSetAccess& aSet, SetElement& aElement);
-
- /// informs a <type>SetElement</type> that it should now link to the given SetElement
- bool attachSetElement(NodeTreeSetAccess& aSet, rtl::Reference< configuration::ElementTree > const& aElementTree);
-
- /// informs a <type>SetElement</type> that it should now unlink from its owning SetElement
- void detachSetElement(SetElement& aElement);
-
- /// informs a <type>SetElement</type> that it should now unlink from its owning SetElement
- bool detachSetElement(Factory& rFactory, rtl::Reference< configuration::ElementTree > const& aElementTree);
-
- /// Guarding and locking implementations
- /// guards a NodeGroupAccess, or NodeSetAccess; provides an object (write)/provider(read) lock; ensures object was not disposed
- class UpdateGuardImpl : private boost::noncopyable
- {
- NodeAccess& m_rNode;
- public:
- UpdateGuardImpl(NodeGroupAccess& rNode);
- UpdateGuardImpl(NodeSetAccess& rNode);
- ~UpdateGuardImpl() throw ();
- public:
- NodeAccess& get() const { return m_rNode; }
-
- void downgrade() { }
- };
-
- // Thin Wrappers around NodeAccesses: Provide guarding and convenient access
- /// wraps a NodeAccess; provides an object (write)/provider(read) lock, ensures object was not disposed
- template <class Access>
- class GuardedNodeUpdate
- {
- UnoApiLock m_aLock;
- UpdateGuardImpl m_aImpl;
- public:
- GuardedNodeUpdate(Access& rNode) : m_aImpl(rNode) {}
- public:
- Access& get() const { return static_cast<Access&>(m_aImpl.get()); }
-
- rtl::Reference< configuration::Tree > getTree() const;
- configuration::NodeRef getNode() const;
-
- typename Access::NodeUpdater getNodeUpdater() const;
- typename Access::NodeDefaulter getNodeDefaulter() const;
-
- void clearForBroadcast() { m_aImpl.downgrade(); }
- };
-
- template <class Access>
- rtl::Reference< configuration::Tree > GuardedNodeUpdate<Access>::getTree() const
- {
- return get().getTree();
- }
-
- template <class Access>
- configuration::NodeRef GuardedNodeUpdate<Access>::getNode() const
- {
- return get().getNodeRef();
- }
-
- template <class Access>
- typename Access::NodeUpdater GuardedNodeUpdate<Access>::getNodeUpdater() const
- {
- return get().getNodeUpdater();
- }
-
- template <class Access>
- typename Access::NodeDefaulter GuardedNodeUpdate<Access>::getNodeDefaulter() const
- {
- return get().getNodeDefaulter();
- }
- }
-}
-
-#endif // CONFIGMGR_API_NODEUPDATE_HXX_
diff --git a/configmgr/source/api2/apinotifierimpl.cxx b/configmgr/source/api2/apinotifierimpl.cxx
deleted file mode 100644
index 5e1fba4f5f..0000000000
--- a/configmgr/source/api2/apinotifierimpl.cxx
+++ /dev/null
@@ -1,329 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "apinotifierimpl.hxx"
-#include "apinodeaccess.hxx"
-#include "noderef.hxx"
-#include "valueref.hxx"
-#include "confignotifier.hxx"
-#include "configexcept.hxx"
-#include <osl/diagnose.h>
-
-namespace configmgr
-{
- namespace configapi
- {
-//-----------------------------------------------------------------------------------
- namespace lang = css::lang;
- namespace util = css::util;
- namespace beans = css::beans;
-
-// Generic Notifier Support Implementations
-//-----------------------------------------------------------------------------------
-
-/// add a Listener to the notifier of a NodeAccess
-template <class Listener>
-inline
-void genericAddListener(NodeAccess& rNode, const uno::Reference< Listener >& xListener )
-{
- GuardedNotifier aGuardedNotifier( rNode ); // guard the notifier
- aGuardedNotifier->add(rNode.getNodeRef(), xListener);
-}
-
-/// remove a Listener from the notifier of a NodeAccess
-template <class Listener>
-inline
-void genericRemoveListener(NodeAccess& rNode, const uno::Reference< Listener >& xListener )
-{
- GuardedNotifier aGuardedNotifier( rNode ); // guard the notifier
- aGuardedNotifier->remove(rNode.getNodeRef(), xListener);
-}
-
-
-/** add a Listener for all or some children of a NodeAccess to its notifier
- <p> If the name given is empty, the listener will be added to all children of the node</p>
- @returns
- <TRUE/> if the node was found, or the name was empty
- <FALSE/> if the named node wasn't found
-*/
-template <class Listener>
-inline
-bool genericAddChildListener(NodeGroupInfoAccess& rNode, const uno::Reference< Listener >& xListener, const rtl::OUString& sName )
-{
- if (sName.getLength() != 0)
- {
- GuardedNodeData<NodeAccess> aGuardedNode( rNode ); // guard access to children
- GuardedNotifier aGuardedNotifier( rNode ); // guard the notifier
-
- rtl::Reference< configuration::Tree > aTree( aGuardedNode.getTree() );
- configuration::NodeRef aNode( aGuardedNode.getNode() );
-
- rtl::OUString aChildName = configuration::validateChildName(sName,aTree,aNode);
-
- if (!aTree->hasChild(aNode,aChildName)) return false;
-
- aGuardedNotifier->addForOne(aNode, xListener, aChildName);
- }
- else
- {
- GuardedNotifier aGuardedNotifier( rNode ); // guard the notifier
-
- aGuardedNotifier->addForAll(rNode.getNodeRef(), xListener);
-
- // always ok, as we addreess no specific NodeRef
- }
- return true;
-}
-
-/** remove a Listener from all or some children of a NodeAccess to its notifier
- <p> If the name given is empty, the listener will be removed from any children of the node</p>
- @returns
- <TRUE/> if the node was found, or the name was empty
- <FALSE/> if the named node wasn't found
-*/
-template <class Listener>
-inline
-bool genericRemoveChildListener(NodeGroupInfoAccess& rNode, const uno::Reference< Listener >& xListener, const rtl::OUString& sName )
-{
- if (sName.getLength() != 0)
- {
- GuardedNodeData<NodeAccess> aGuardedNode( rNode ); // guard access to children
- GuardedNotifier aGuardedNotifier( rNode ); // guard the notifier
-
- rtl::Reference< configuration::Tree > aTree( aGuardedNode.getTree() );
- configuration::NodeRef aNode( aGuardedNode.getNode() );
-
- rtl::OUString aChildName = configuration::validateChildName(sName,aTree,aNode);
-
- if (!aTree->hasChild(aNode,aChildName)) return false;
-
- aGuardedNotifier->removeForOne(aNode, xListener, aChildName);
- }
- else
- {
- GuardedNotifier aGuardedNotifier( rNode ); // guard the notifier
-
- aGuardedNotifier->removeForAll(rNode.getNodeRef(), xListener);
-
- // always ok, as we addreess no specific NodeRef
- }
- return true;
-}
-
-
-
-// XComponent
-//-----------------------------------------------------------------------------------
-void implAddListener(NodeAccess& rNode, const uno::Reference< css::lang::XEventListener >& xListener )
- throw(uno::RuntimeException)
-{
- genericAddListener(rNode,xListener);
-}
-
-void implRemoveListener(NodeAccess& rNode, const uno::Reference< css::lang::XEventListener >& xListener )
- throw(uno::RuntimeException)
-{
- genericRemoveListener(rNode,xListener);
-}
-
-// XContainer
-//-----------------------------------------------------------------------------------
-void implAddListener(NodeAccess& rNode, const uno::Reference< css::container::XContainerListener >& xListener )
- throw(uno::RuntimeException)
-{
- genericAddListener(rNode,xListener);
-}
-
-void implRemoveListener(NodeAccess& rNode, const uno::Reference< css::container::XContainerListener >& xListener )
- throw(uno::RuntimeException)
-{
- genericRemoveListener(rNode,xListener);
-}
-
-// XChangesNotifier
-//-----------------------------------------------------------------------------------
-
-void implAddListener(NodeAccess& rNode, const uno::Reference< css::util::XChangesListener >& xListener )
- throw(uno::RuntimeException)
-{
- genericAddListener(rNode,xListener);
-}
-
-void implRemoveListener(NodeAccess& rNode, const uno::Reference< css::util::XChangesListener >& xListener )
- throw(uno::RuntimeException)
-{
- genericRemoveListener(rNode,xListener);
-}
-
-// XMultiPropertySet
-//-----------------------------------------------------------------------------------
-
-void implAddListener( NodeAccess& rNode, const uno::Reference< beans::XPropertiesChangeListener >& xListener, const uno::Sequence< rtl::OUString >& aPropertyNames )
- throw(uno::RuntimeException)
-{
-
- GuardedNotifier impl( rNode );
-
- // TODO: is an exception for unknown names allowed/needed ?
- impl->add(rNode.getNodeRef(), xListener, aPropertyNames);
-}
-
-
-void implRemoveListener( NodeAccess& rNode, const uno::Reference< beans::XPropertiesChangeListener >& xListener )
- throw(uno::RuntimeException)
-{
- genericRemoveListener(rNode,xListener);
-}
-
-// XPropertySet (manages listeners associated with named child node)
-//-----------------------------------------------------------------------------------
-
-// XPropertySet - VetoableChangeListeners
-//-----------------------------------------------------------------------------------
-
-void implAddListener( NodeGroupInfoAccess& rNode, const uno::Reference< beans::XVetoableChangeListener >& xListener, const rtl::OUString& sPropertyName )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- try
- {
- if (!genericAddChildListener(rNode,xListener,sPropertyName))
- {
- throw css::beans::UnknownPropertyException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: cannot add listener - node not found !")),
- rNode.getUnoInstance() );
- }
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- throw css::beans::UnknownPropertyException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: cannot add listener - node not found:")) += ex.message(),
- rNode.getUnoInstance() );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
-}
-
-
-void implRemoveListener( NodeGroupInfoAccess& rNode, const uno::Reference< beans::XVetoableChangeListener >& xListener, const rtl::OUString& sPropertyName )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- try
- {
- if (!genericRemoveChildListener(rNode,xListener,sPropertyName))
- {
- throw css::beans::UnknownPropertyException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: cannot remove listener - node not found !")),
- rNode.getUnoInstance() );
- }
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- throw css::beans::UnknownPropertyException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: cannot remove listener - node not found:")) += ex.message(),
- rNode.getUnoInstance() );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-}
-
-// XPropertySet - PropertyChangeListeners
-//-----------------------------------------------------------------------------------
-
-void implAddListener( NodeGroupInfoAccess& rNode, const uno::Reference< beans::XPropertyChangeListener >& xListener, const rtl::OUString& sPropertyName )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- try
- {
- if (!genericAddChildListener(rNode,xListener,sPropertyName))
- {
- throw css::beans::UnknownPropertyException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: cannot add listener - node not found !")),
- rNode.getUnoInstance() );
- }
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- throw css::beans::UnknownPropertyException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: cannot add listener - node not found:")) += ex.message(),
- rNode.getUnoInstance() );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-}
-
-void implRemoveListener( NodeGroupInfoAccess& rNode, const uno::Reference< beans::XPropertyChangeListener >& xListener, const rtl::OUString& sPropertyName )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- try
- {
- if (!genericRemoveChildListener(rNode,xListener,sPropertyName))
- {
- throw css::beans::UnknownPropertyException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: cannot remove listener - node not found !")),
- rNode.getUnoInstance() );
- }
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- throw css::beans::UnknownPropertyException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: cannot remove listener - node not found:")) += ex.message(),
- rNode.getUnoInstance() );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-}
-
-//-----------------------------------------------------------------------------------
- } // namespace configapi
-
-} // namespace configmgr
-
-
diff --git a/configmgr/source/api2/apinotifierimpl.hxx b/configmgr/source/api2/apinotifierimpl.hxx
deleted file mode 100644
index eae5976796..0000000000
--- a/configmgr/source/api2/apinotifierimpl.hxx
+++ /dev/null
@@ -1,102 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_NOTIFIERIMPL_HXX_
-#define CONFIGMGR_API_NOTIFIERIMPL_HXX_
-
-#ifndef _COM_SUN_STAR_LANG_XCOMPONENT_HPP_
-#include <com/sun/star/container/XChild.hpp>
-#endif
-#include <com/sun/star/container/XContainer.hpp>
-#include <com/sun/star/util/XChangesNotifier.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/beans/XMultiPropertySet.hpp>
-
-namespace configmgr
-{
- namespace css = ::com::sun::star;
- namespace uno = ::com::sun::star::uno;
-
- /* implementations of the event notification interfaces
- supported by a node within the configuration tree.
- */
- namespace configapi
- {
- class NodeAccess;
- class NodeSetInfoAccess;
- class NodeGroupInfoAccess;
-
- // Notification support
-
- // XComponent
- void implAddListener(NodeAccess& rNode, const uno::Reference< css::lang::XEventListener >& xListener )
- throw(uno::RuntimeException);
-
- void implRemoveListener(NodeAccess& rNode, const uno::Reference< css::lang::XEventListener >& xListener )
- throw(uno::RuntimeException);
-
- // XContainer
- void implAddListener(NodeAccess& rNode, const uno::Reference< css::container::XContainerListener >& xListener )
- throw(uno::RuntimeException);
-
- void implRemoveListener(NodeAccess& rNode, const uno::Reference< css::container::XContainerListener >& xListener )
- throw(uno::RuntimeException);
-
- // XChangesNotifier
- void implAddListener(NodeAccess& rNode, const uno::Reference< css::util::XChangesListener >& xListener )
- throw(uno::RuntimeException);
-
- void implRemoveListener(NodeAccess& rNode, const uno::Reference< css::util::XChangesListener >& xListener )
- throw(uno::RuntimeException);
-
- // XPropertySet - VetoableChangeListeners
- void implAddListener( NodeGroupInfoAccess& rNode, const uno::Reference< css::beans::XVetoableChangeListener >& xListener, const rtl::OUString& sPropertyName )
- throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, uno::RuntimeException);
-
- void implRemoveListener( NodeGroupInfoAccess& rNode, const uno::Reference< css::beans::XVetoableChangeListener >& xListener, const rtl::OUString& sPropertyName )
- throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, uno::RuntimeException);
-
- // XPropertySet
- void implAddListener( NodeGroupInfoAccess& rNode, const uno::Reference< css::beans::XPropertyChangeListener >& xListener, const rtl::OUString& sPropertyName )
- throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, uno::RuntimeException);
-
- void implRemoveListener( NodeGroupInfoAccess& rNode, const uno::Reference< css::beans::XPropertyChangeListener >& xListener, const rtl::OUString& sPropertyName )
- throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException, uno::RuntimeException);
-
- // XMultiPropertySet
- void implAddListener( NodeAccess& rNode, const uno::Reference< css::beans::XPropertiesChangeListener >& xListener, const uno::Sequence< rtl::OUString >& sPropertyNames )
- throw(uno::RuntimeException);
-
- void implRemoveListener( NodeAccess& rNode, const uno::Reference< css::beans::XPropertiesChangeListener >& xListener )
- throw(uno::RuntimeException);
-
- }
-
-}
-#endif // CONFIGMGR_API_NOTIFIERIMPL_HXX_
-
-
diff --git a/configmgr/source/api2/apiserviceinfo.cxx b/configmgr/source/api2/apiserviceinfo.cxx
deleted file mode 100644
index d42182c35f..0000000000
--- a/configmgr/source/api2/apiserviceinfo.cxx
+++ /dev/null
@@ -1,337 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include "apiserviceinfo.hxx"
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace configapi
- {
-//========================================================================
-//= service names
-//========================================================================
-
-//========================================================================
-//= service infos
-//========================================================================
-
-//-- ACCESS (CONTAINER) ROLES -----------------------------
-
-#define CFG_SVCLIST_SETACCESS \
- "com.sun.star.configuration.ConfigurationAccess", \
- "com.sun.star.configuration.SetAccess", \
- "com.sun.star.configuration.HierarchyAccess", \
- "com.sun.star.configuration.SimpleSetAccess"
-
-#define CFG_SVCLIST_GROUPACCESS \
- "com.sun.star.configuration.ConfigurationAccess", \
- "com.sun.star.configuration.GroupAccess", \
- "com.sun.star.configuration.HierarchyAccess", \
- "com.sun.star.configuration.PropertyHierarchy"
-
-#define CFG_SVCLIST_SETUPDATE \
- "com.sun.star.configuration.ConfigurationUpdateAccess", \
- "com.sun.star.configuration.SetUpdate", \
- "com.sun.star.configuration.SimpleSetUpdate", \
- "com.sun.star.configuration.ConfigurationContainer", /* Obsolete */ \
- CFG_SVCLIST_SETACCESS
-
-#define CFG_SVCLIST_GROUPUPDATE \
- "com.sun.star.configuration.ConfigurationUpdateAccess", \
- "com.sun.star.configuration.GroupUpdate", \
- CFG_SVCLIST_GROUPACCESS
-
-//-- ELEMENT ROLES ----------------------------------------
-
-#define CFG_SVCLIST_SETELEMENT \
- "com.sun.star.configuration.SetElement", \
- "com.sun.star.configuration.HierarchyElement"
-
-#define CFG_SVCLIST_GROUPELEMENT \
- "com.sun.star.configuration.GroupElement", \
- "com.sun.star.configuration.HierarchyElement"
-
-#define CFG_SVCLIST_ACCESSROOTELEMENT \
- "com.sun.star.configuration.AccessRootElement", \
- "com.sun.star.configuration.HierarchyElement"
-
-#define CFG_SVCLIST_UPDATEROOTELEMENT \
- "com.sun.star.configuration.UpdateRootElement", \
- CFG_SVCLIST_ACCESSROOTELEMENT
-
-//-----------------------------------------------------------------------------
-
-sal_Char const * const c_aNoServices[] =
-{
- NULL
-};
-
-//-----------------------------------------------------------------------------
-
-sal_Char const * const c_aCreateAccessServiceNames[] =
-{
- "com.sun.star.configuration.ConfigurationAccess",
- "com.sun.star.configuration.HierarchyAccess",
- "com.sun.star.configuration.HierarchyElement",
- NULL
-};
-
-sal_Char const * const c_aCreateUpdateServiceNames[] =
-{
- "com.sun.star.configuration.ConfigurationUpdateAccess",
- "com.sun.star.configuration.ConfigurationAccess",
- "com.sun.star.configuration.HierarchyAccess",
- "com.sun.star.configuration.HierarchyElement",
- NULL
-};
-
-//-----------------------------------------------------------------------------
-
-sal_Char const * const c_aUserAdministrationServices[] =
-{
- "com.sun.star.configuration.UserAdministration",
- "com.sun.star.configuration.SimpleSetUpdate",
- "com.sun.star.configuration.SimpleSetAccess",
- "com.sun.star.configuration.ConfigurationContainer", // Obsolete
- NULL
-};
-
-sal_Char const * const c_aGroupAdministrationServices[] =
-{
- "com.sun.star.configuration.GroupAdministration",
- "com.sun.star.configuration.SimpleSetUpdate",
- "com.sun.star.configuration.SimpleSetAccess",
- "com.sun.star.configuration.ConfigurationContainer", // Obsolete
- NULL
-};
-
-//-- ROLE COMBINATIONS ------------------
-
-//-- GroupElements
-
-sal_Char const * const c_aInnerGroupAccessServices[] =
-{
- CFG_SVCLIST_GROUPACCESS,
- CFG_SVCLIST_GROUPELEMENT,
- NULL
-};
-
-sal_Char const * const c_aInnerGroupUpdateServices[] =
-{
- CFG_SVCLIST_GROUPUPDATE,
- CFG_SVCLIST_GROUPELEMENT,
- NULL
-};
-
-sal_Char const * const c_aInnerSetAccessServices[] =
-{
- CFG_SVCLIST_SETACCESS,
- CFG_SVCLIST_GROUPELEMENT,
- NULL
-};
-
-sal_Char const * const c_aInnerSetUpdateServices[] =
-{
- CFG_SVCLIST_SETUPDATE,
- CFG_SVCLIST_GROUPELEMENT,
- NULL
-};
-
-//-- SetElements
-
-sal_Char const * const c_aSetElementGroupAccessServices[] =
-{
- CFG_SVCLIST_GROUPACCESS,
- CFG_SVCLIST_SETELEMENT,
- NULL
-};
-
-sal_Char const * const c_aSetElementGroupUpdateServices[] =
-{
- CFG_SVCLIST_GROUPUPDATE,
- CFG_SVCLIST_SETELEMENT,
- NULL
-};
-
-sal_Char const * const c_aSetElementSetAccessServices[] =
-{
- CFG_SVCLIST_SETACCESS,
- CFG_SVCLIST_SETELEMENT,
- NULL
-};
-
-sal_Char const * const c_aSetElementSetUpdateServices[] =
-{
- CFG_SVCLIST_SETUPDATE,
- CFG_SVCLIST_SETELEMENT,
- NULL
-};
-
-//-- RootElements
-
-sal_Char const * const c_aRootGroupAccessServices[] =
-{
- CFG_SVCLIST_GROUPACCESS,
- CFG_SVCLIST_ACCESSROOTELEMENT,
- NULL
-};
-
-sal_Char const * const c_aRootGroupUpdateServices[] =
-{
- CFG_SVCLIST_GROUPUPDATE,
- CFG_SVCLIST_UPDATEROOTELEMENT,
- NULL
-};
-
-sal_Char const * const c_aRootSetAccessServices[] =
-{
- CFG_SVCLIST_SETACCESS,
- CFG_SVCLIST_ACCESSROOTELEMENT,
- NULL
-};
-
-sal_Char const * const c_aRootSetUpdateServices[] =
-{
- CFG_SVCLIST_SETUPDATE,
- CFG_SVCLIST_UPDATEROOTELEMENT,
- NULL
-};
-//-----------------------------------------------------------------------------
-
-ServiceImplementationInfo const aInnerGroupInfoSI =
-{
- "com.sun.star.comp.configuration.OInnerGroupInfoAccess",
- c_aInnerGroupAccessServices,
- NULL
-};
-ServiceImplementationInfo const aInnerGroupUpdateSI =
-{
- "com.sun.star.comp.configuration.OInnerGroupUpdateAccess",
- c_aInnerGroupUpdateServices,
- NULL
-};
-ServiceImplementationInfo const aInnerSetInfoSI =
-{
- "com.sun.star.comp.configuration.OInnerSetInfoAccess",
- c_aInnerSetAccessServices,
- NULL
-};
-ServiceImplementationInfo const aInnerTreeSetSI =
-{
- "com.sun.star.comp.configuration.OInnerTreeSetUpdateAccess",
- c_aInnerSetUpdateServices,
- NULL
-};
-ServiceImplementationInfo const aInnerValueSetSI =
-{
- "com.sun.star.comp.configuration.OInnerValueSetUpdateAccess",
- c_aInnerSetUpdateServices,
- NULL
-};
-//-----------------------------------------------------------------------------
-
-ServiceImplementationInfo const aSetElementGroupInfoSI =
-{
- "com.sun.star.comp.configuration.OSetElementGroupInfoAccess",
- c_aSetElementGroupUpdateServices,
- NULL
-};
-ServiceImplementationInfo const aSetElementGroupUpdateSI =
-{
- "com.sun.star.comp.configuration.OSetElementGroupUpdateAccess",
- c_aSetElementGroupUpdateServices,
- NULL
-};
-ServiceImplementationInfo const aSetElementSetInfoSI =
-{
- "com.sun.star.comp.configuration.OSetElementSetInfoAccess",
- c_aSetElementSetAccessServices,
- NULL
-};
-ServiceImplementationInfo const aSetElementTreeSetSI =
-{
- "com.sun.star.comp.configuration.OSetElementTreeSetUpdateAccess",
- c_aSetElementSetUpdateServices,
- NULL
-};
-ServiceImplementationInfo const aSetElementValueSetSI =
-{
- "com.sun.star.comp.configuration.OSetElementValueSetUpdateAccess",
- c_aSetElementSetUpdateServices,
- NULL
-};
-//-----------------------------------------------------------------------------
-
-ServiceImplementationInfo const aRootElementGroupInfoSI =
-{
- "com.sun.star.comp.configuration.ORootElementGroupInfoAccess",
- c_aRootGroupAccessServices,
- NULL
-};
-ServiceImplementationInfo const aRootElementGroupUpdateSI =
-{
- "com.sun.star.comp.configuration.ORootElementGroupUpdateAccess",
- c_aRootGroupUpdateServices,
- NULL
-};
-ServiceImplementationInfo const aRootElementSetInfoSI =
-{
- "com.sun.star.comp.configuration.ORootElementSetInfoAccess",
- c_aRootSetAccessServices,
- NULL
-};
-ServiceImplementationInfo const aRootElementTreeSetUpdateSI =
-{
- "com.sun.star.comp.configuration.ORootElementTreeSetUpdateAccess",
- c_aRootSetUpdateServices,
- NULL
-};
-ServiceImplementationInfo const aRootElementValueSetUpdateSI =
-{
- "com.sun.star.comp.configuration.ORootElementValueSetUpdateAccess",
- c_aRootSetUpdateServices,
- NULL
-};
-//-----------------------------------------------------------------------------
-
-ServiceRegistrationInfo const aCreateReadAccessSI =
-{
- NULL, //"com.sun.star.comp.configuration.ORootElementReadAccess",
- c_aCreateAccessServiceNames
-};
-ServiceRegistrationInfo const aCreateUpdateAccessSI =
-{
- NULL, //"com.sun.star.comp.configuration.ORootElementUpdateAccess",
- c_aCreateUpdateServiceNames
-};
-//-----------------------------------------------------------------------------
-
- }
-}
diff --git a/configmgr/source/api2/apiserviceinfo.hxx b/configmgr/source/api2/apiserviceinfo.hxx
deleted file mode 100644
index 6e207562f5..0000000000
--- a/configmgr/source/api2/apiserviceinfo.hxx
+++ /dev/null
@@ -1,69 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_SERVICEINFO_HXX_
-#define CONFIGMGR_API_SERVICEINFO_HXX_
-
-#include "serviceinfohelper.hxx"
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace configapi
- {
-//-----------------------------------------------------------------------------
-
- extern sal_Char const * const c_aUserAdministrationServices[];
- extern sal_Char const * const c_aGroupAdministrationServices[];
-
-//-----------------------------------------------------------------------------
- extern ServiceImplementationInfo const aInnerGroupInfoSI;
- extern ServiceImplementationInfo const aInnerGroupUpdateSI;
- extern ServiceImplementationInfo const aInnerSetInfoSI;
- extern ServiceImplementationInfo const aInnerTreeSetSI;
- extern ServiceImplementationInfo const aInnerValueSetSI;
- extern ServiceImplementationInfo const aSetElementGroupInfoSI;
- extern ServiceImplementationInfo const aSetElementGroupUpdateSI;
- extern ServiceImplementationInfo const aSetElementSetInfoSI;
- extern ServiceImplementationInfo const aSetElementTreeSetSI;
- extern ServiceImplementationInfo const aSetElementValueSetSI;
- extern ServiceImplementationInfo const aRootElementGroupInfoSI;
- extern ServiceImplementationInfo const aRootElementGroupUpdateSI;
- extern ServiceImplementationInfo const aRootElementSetInfoSI;
- extern ServiceImplementationInfo const aRootElementTreeSetUpdateSI;
- extern ServiceImplementationInfo const aRootElementValueSetUpdateSI;
-
-//-----------------------------------------------------------------------------
- extern ServiceRegistrationInfo const aCreateReadAccessSI;
- extern ServiceRegistrationInfo const aCreateUpdateAccessSI;
-
-//-----------------------------------------------------------------------------
- }
-}
-//-----------------------------------------------------------------------------
-
-#endif // CONFIGMGR_API_SERVICEINFO_HXX_
diff --git a/configmgr/source/api2/apitreeaccess.cxx b/configmgr/source/api2/apitreeaccess.cxx
deleted file mode 100644
index 33afae1e42..0000000000
--- a/configmgr/source/api2/apitreeaccess.cxx
+++ /dev/null
@@ -1,110 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-#include "apitreeaccess.hxx"
-
-#include "apitreeimplobj.hxx"
-#include "configset.hxx"
-#include "confignotifier.hxx"
-#include "committer.hxx"
-#include "apinodeaccess.hxx"
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace configapi
- {
-//-----------------------------------------------------------------------------
-
- // self-locked methods for dispose handling
-void NodeElement::checkAlive() const
-{
- getApiTree().checkAlive();
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference< configuration::Tree > TreeElement::getTree() const
-{
- return getTreeRef();
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference< configuration::Tree > TreeElement::getTreeRef() const
-{
- return getApiTree().getTree();
-}
-//-----------------------------------------------------------------------------
- // self-locked methods for dispose handling
-bool SetElement::disposeTree(bool bForce)
-{
- return getApiTree().disposeTree(bForce);
-}
-//-----------------------------------------------------------------------------
-Factory& TreeElement::getFactory()
-{
- return getApiTree().getFactory();
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference< configuration::ElementTree > SetElement::getElementRef() const
-{
- return dynamic_cast< configuration::ElementTree * >(getTreeRef().get());
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference< configuration::Template > SetElement::getTemplateInfo() const
-{
- rtl::Reference< configuration::ElementTree > aTree(dynamic_cast< configuration::ElementTree * >(getTreeRef().get()));
- OSL_ENSURE(aTree.is(), "This really must be a set element");
- return aTree->getTemplate();
-}
-//-----------------------------------------------------------------------------
-
-void SetElement::haveNewParent(NodeSetInfoAccess* pNewParent)
-{
- ApiTreeImpl* pNewParentImpl = pNewParent ? &pNewParent->getApiTree() : 0;
-
- this->getApiTree().haveNewParent( pNewParentImpl );
-}
-//-----------------------------------------------------------------------------
-
-bool RootElement::disposeTree()
-{
- return getRootTree().disposeTree();
-}
-//-----------------------------------------------------------------------------
-
-Committer UpdateRootElement::getCommitter()
-{
- return Committer(getRootTree());
-}
- }
-}
-
diff --git a/configmgr/source/api2/apitreeaccess.hxx b/configmgr/source/api2/apitreeaccess.hxx
deleted file mode 100644
index 8f9975829a..0000000000
--- a/configmgr/source/api2/apitreeaccess.hxx
+++ /dev/null
@@ -1,176 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_TREEACCESS_HXX_
-#define CONFIGMGR_API_TREEACCESS_HXX_
-
-#include "sal/config.h"
-
-#include "boost/utility.hpp"
-#include "rtl/ref.hxx"
-
-#include "datalock.hxx"
-#include "options.hxx"
-#include "utility.hxx"
-
-namespace osl { class Mutex; }
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- struct ServiceImplementationInfo;
-//-----------------------------------------------------------------------------
- namespace configuration
- {
- class ElementTree;
- class Template;
- class Tree;
- }
-//-----------------------------------------------------------------------------
- namespace configapi
- {
-//-----------------------------------------------------------------------------
- namespace uno = com::sun::star::uno;
-//-----------------------------------------------------------------------------
- class Factory;
- class Notifier;
- class Committer;
- class NodeSetInfoAccess;
-//-----------------------------------------------------------------------------
- // API object implementation wrappers
- //-------------------------------------------------------------------------
- class ApiTreeImpl;
- class ApiRootTreeImpl;
-
- // these objects just provide the pieces needed to navigate and manipulate trees and nodes
-
- // A common base class for 'element' classes
- class NodeElement: private boost::noncopyable
- {
- public:
- virtual ~NodeElement() {}
-
- // self-locked methods for dispose handling
- void checkAlive() const;
-
- // api object handling
- uno::XInterface* getUnoInstance() const
- { return doGetUnoInstance(); }
-
- ServiceImplementationInfo const * getServiceInfo() const
- { return doGetServiceInfo(); }
- private:
- virtual uno::XInterface* doGetUnoInstance() const = 0;
- virtual ServiceImplementationInfo const* doGetServiceInfo() const = 0;
- virtual ApiTreeImpl& getApiTree() const = 0;
-
- friend class Factory;
- };
-//-----------------------------------------------------------------------------
-
- // A class for tagging inner nodes
- class InnerElement : public NodeElement
- {
- public:
- // Only used as a tag
- };
-//-----------------------------------------------------------------------------
-
- // A common base class for tree-owning elemnt classes
- class TreeElement : public NodeElement
- {
- public:
- // model access
- rtl::Reference< configuration::Tree > getTreeRef() const;
- rtl::Reference< configuration::Tree > getTree() const;
-
- // api object handling
- Factory& getFactory();
-
- protected:
- virtual ApiTreeImpl& getApiTree() const = 0;
- };
-//-----------------------------------------------------------------------------
-
- // Info interfaces for Set Elements
- class SetElement : public TreeElement
- {
- public:
- // self-locked methods for dispose handling
- bool disposeTree(bool bForceDispose);
-
- void haveNewParent(NodeSetInfoAccess* pNewParent);
-
- rtl::Reference< configuration::ElementTree > getElementRef() const;
- rtl::Reference< configuration::Template > getTemplateInfo() const;
- };
-//-----------------------------------------------------------------------------
-
- // Info interfaces for Set Elements
- class RootElement : public TreeElement
- {
- public:
- bool disposeTree();
- protected:
- virtual ApiRootTreeImpl& getRootTree() = 0;
- };
-//-----------------------------------------------------------------------------
-
- // Info interfaces for Set Elements
- class UpdateRootElement : public RootElement
- {
- public:
- Committer getCommitter();
- };
-
- // Thin Wrappers around TreeElements: Provide guarding and convenient access
- /// wraps a TreeElement; provides an object (read) lock, ensures object was not disposed
- class GuardedTreeElement {
- UnoApiLock m_aLock;
- TreeElement & m_rTree;
-
- public:
- explicit GuardedTreeElement(TreeElement & rTree): m_rTree(rTree)
- { rTree.checkAlive(); }
-
- TreeElement & get() const { return m_rTree; }
- };
-
- class GuardedRootElement {
- UnoApiLock m_aLock;
- RootElement & m_rTree;
-
- public:
- explicit GuardedRootElement(RootElement & rTree): m_rTree(rTree)
- { rTree.checkAlive(); }
-
- RootElement & get() const { return m_rTree; }
- };
- }
-}
-
-#endif // CONFIGMGR_API_TREEACCESS_HXX_
diff --git a/configmgr/source/api2/apitreeimplobj.cxx b/configmgr/source/api2/apitreeimplobj.cxx
deleted file mode 100644
index e2597cbaba..0000000000
--- a/configmgr/source/api2/apitreeimplobj.cxx
+++ /dev/null
@@ -1,1001 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-
-#include "apitreeimplobj.hxx"
-#include "confignotifier.hxx"
-#include "notifierimpl.hxx"
-#include "apifactory.hxx"
-#include "apitreeaccess.hxx"
-#include "nodechangeinfo.hxx"
-#include "broadcaster.hxx"
-#include "change.hxx"
-#include "providerimpl.hxx"
-#include "roottree.hxx"
-#include "noderef.hxx"
-#include "anynoderef.hxx"
-#include "tracer.hxx"
-#include "treemanager.hxx"
-#include <cppuhelper/queryinterface.hxx>
-#include <vos/refernce.hxx>
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace configapi
- {
-//-----------------------------------------------------------------------------
- namespace lang = ::com::sun::star::lang;
-//-----------------------------------------------------------------------------
- class Factory;
- class Notifier;
-//-----------------------------------------------------------------------------
-class ApiTreeImpl::ComponentAdapter : public lang::XEventListener
-{
- vos::ORefCount m_refs;
-
- ApiTreeImpl* pOwner;
-
- uno::Reference< lang::XComponent > xProvider;
- uno::Reference< lang::XComponent > xParent;
-public:
- ComponentAdapter(ApiTreeImpl& rParent) : pOwner(&rParent) {}
- virtual ~ComponentAdapter() {}
-
- void clear();
-
- void setProvider(uno::Reference< lang::XComponent > const& xProvider);
- void setParent(uno::Reference< lang::XComponent > const& xParent);
- uno::Reference< lang::XComponent > getProvider() const;
-
-// XEventListener
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
-private:
- void setComponent(uno::Reference< lang::XComponent >& rxSlot,uno::Reference< lang::XComponent > const& xComp);
- uno::Reference< lang::XComponent > getComponent(uno::Reference< lang::XComponent > const& rxSlot) const;
-
- virtual uno::Any SAL_CALL queryInterface(uno::Type const& rType) throw();
- virtual void SAL_CALL disposing(com::sun::star::lang::EventObject const& rEvt) throw();
-};
-//-----------------------------------------------------------------------------
-inline
-uno::Reference< lang::XComponent >
- ApiTreeImpl::ComponentAdapter::getComponent(
- uno::Reference< lang::XComponent > const& rxSlot
- ) const
-{
- return rxSlot;
-}
-//-----------------------------------------------------------------------------
-inline
-void ApiTreeImpl::ComponentAdapter::setComponent(
- uno::Reference< lang::XComponent >& rxSlot,
- uno::Reference< lang::XComponent > const& xComp
- )
-{
- UnoApiLockClearable aGuard;
-
- uno::Reference< lang::XComponent > xOld = rxSlot;
- if (xOld != xComp)
- {
- rxSlot = xComp;
-
- aGuard.clear();
-
- if (xOld.is()) try { xOld->removeEventListener(this); } catch (uno::Exception & ) {}
- if (xComp.is()) xComp->addEventListener(this);
- }
-}
-//-----------------------------------------------------------------------------
-uno::Reference< lang::XComponent > ApiTreeImpl::ComponentAdapter::getProvider() const
-{
- return this->getComponent( this->xProvider );
-}
-void ApiTreeImpl::ComponentAdapter::setProvider(uno::Reference< lang::XComponent > const& rProvider)
-{
- this->setComponent( this->xProvider, rProvider);
-}
-void ApiTreeImpl::ComponentAdapter::setParent(uno::Reference< lang::XComponent > const& rParent)
-{
- this->setComponent( this->xParent, rParent);
-}
-//-----------------------------------------------------------------------------
-
-void SAL_CALL ApiTreeImpl::ComponentAdapter::acquire() throw()
-{
- ++m_refs;
-}
-//-------------------------------------------------------------------------
-
-void SAL_CALL ApiTreeImpl::ComponentAdapter::release() throw()
-{
- if (--m_refs == 0)
- delete this;
-}
-//-------------------------------------------------------------------------
-
-uno::Any SAL_CALL ApiTreeImpl::ComponentAdapter::queryInterface(uno::Type const& rType) throw()
-{
- return cppu::queryInterface( rType
- , static_cast< com::sun::star::lang::XEventListener*>(this)
- , static_cast< uno::XInterface*>(this)
- );
-}
-//-------------------------------------------------------------------------
-
-void SAL_CALL ApiTreeImpl::ComponentAdapter::disposing(com::sun::star::lang::EventObject const& rEvt) throw()
-{
- UnoApiLockClearable aGuard;
-
- if (this->pOwner != NULL)
- {
- CFG_TRACE_INFO("ApiTreeImpl:ComponentAdapter: Providing UNO object is disposed - relaying to my owner");
- // ensure our owner stays alive
- uno::Reference<uno::XInterface> xKeepOwnerAlive( this->pOwner->getUnoInstance() );
- // and we stay alive too
- rtl::Reference< ApiTreeImpl::ComponentAdapter > xKeepAlive( this );
-
- aGuard.clear();
-
- pOwner->disposing( rEvt );
-
- UnoApiLock aClearGuard;
- if (rEvt.Source == this->xParent) this->xParent.clear();
- if (rEvt.Source == this->xProvider) this->xProvider.clear();
- }
- else
- CFG_TRACE_INFO("ApiTreeImpl:ComponentAdapter: Providing UNO object is disposed - but my owner is already gone");
-}
-
-//-------------------------------------------------------------------------
-
-void ApiTreeImpl::ComponentAdapter::clear()
-{
- UnoApiLockClearable aGuard;
-
- this->pOwner = 0;
-
- uno::Reference< lang::XComponent > aProvider = this->xProvider;
- uno::Reference< lang::XComponent > aParent = this->xParent;
- this->xProvider = 0;
- this->xParent = 0;
-
- aGuard.clear();
-
- if (aParent.is()) try { aParent ->removeEventListener(this); } catch (uno::Exception & ) {}
- if (aProvider.is()) try { aProvider->removeEventListener(this); } catch (uno::Exception & ) {}
-}
-
-//-----------------------------------------------------------------------------
-class ApiRootTreeImpl::NodeListener : public INodeListener
-{
- ApiRootTreeImpl* pParent;
- TreeManager * pSource;
-
- vos::ORef< OOptions > m_xOptions;
- configuration::AbsolutePath m_aLocationPath;
-public:
- NodeListener(ApiRootTreeImpl& _rParent)
- : pParent(&_rParent)
- , pSource(NULL)
- , m_aLocationPath( configuration::AbsolutePath::root() )
- {}
- ~NodeListener()
- {
- unbind();
- }
-
- TreeManager * getSource()
- {
- UnoApiLock aGuard;
- return pSource;
- }
-
- void setSource(TreeManager * pNew)
- {
- UnoApiLock aGuard;
- if (pParent)
- {
- if (pNew != pSource)
- {
- OSL_ENSURE(m_xOptions.isValid(),"Cannot set IConfigListener without Options");
- if (m_xOptions.isValid())
- {
- if (pSource)
- pSource->removeListener(m_xOptions->getRequestOptions(), this);
-
- pSource = pNew;
- if (pNew)
- {
- OSL_ENSURE(!m_aLocationPath.isRoot(), "Cannot register for notifications: no location set");
- pNew->addListener(m_aLocationPath, m_xOptions->getRequestOptions(), this);
- }
- }
- else
- pSource = 0;
- }
- }
- }
-
- void setLocation(configuration::AbsolutePath const& _aLocation, vos::ORef< OOptions > const& _xOptions)
- {
- OSL_ASSERT(_xOptions.isValid());
-
- UnoApiLock aGuard;
-
- if (pSource && pParent)
- {
- OSL_ASSERT(m_xOptions.isValid());
- pSource->removeListener(m_xOptions->getRequestOptions(), this);
- }
-
- m_aLocationPath = _aLocation;
- m_xOptions = _xOptions;
-
- if (pSource && pParent)
- pSource->addListener(m_aLocationPath, m_xOptions->getRequestOptions(), this);
- }
-
- void unbind()
- {
- UnoApiLock aGuard;
- OSL_ASSERT(pParent == 0);
- pParent = 0;
- if (pSource)
- {
- OSL_ASSERT(m_xOptions.isValid());
- pSource->removeListener(m_xOptions->getRequestOptions(), this);
- m_xOptions.unbind();
- m_aLocationPath = configuration::AbsolutePath::root();
- }
-
- }
-
- void clearParent()
- {
- UnoApiLockClearable aGuard;
- if (pParent)
- {
- pParent = 0;
-
- if (pSource)
- {
- TreeManager * pOrgSource = pSource;
- vos::ORef< OOptions > xOptions = m_xOptions;
-
- pSource = 0;
- m_xOptions.unbind();
- m_aLocationPath = configuration::AbsolutePath::root();
-
- aGuard.clear();
-
- OSL_ASSERT(xOptions.isValid());
- pOrgSource->removeListener(xOptions->getRequestOptions(), this);
- }
- }
- }
-
- // Interfaces
- virtual void disposing(TreeManager * pSource);
- virtual void nodeChanged(Change const& aChange, configuration::AbsolutePath const& sPath, TreeManager * pSource);
- virtual void nodeDeleted(configuration::AbsolutePath const& sPath, TreeManager * pSource);
-};
-
-//-------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// API object implementation wrappers
-//-------------------------------------------------------------------------
-ApiProvider::ApiProvider(Factory& rFactory, OProviderImpl& rProviderImpl )
- : m_rFactory(rFactory)
- , m_rProviderImpl(rProviderImpl)
-{}
-//-------------------------------------------------------------------------
-
-uno::Reference<com::sun::star::script::XTypeConverter> ApiProvider::getTypeConverter() const
-{
- return m_rProviderImpl.getTypeConverter();
-}
-//-------------------------------------------------------------------------
-static
-inline
-configuration::DefaultProvider createDefaultProvider(
- ApiProvider& rProvider,
- rtl::Reference< configuration::Tree > const& aTree,
- vos::ORef< OOptions > const& _xOptions
- )
-{
- OProviderImpl& rProviderImpl = rProvider.getProviderImpl();
- rtl::Reference< TreeManager > xDefaultProvider = rProviderImpl.getDefaultProvider();
-
- OSL_ASSERT(_xOptions.isValid());
- RequestOptions const aOptions = _xOptions.isValid() ? _xOptions->getRequestOptions() : RequestOptions();
-
- return configuration::DefaultProvider::create(aTree,aOptions,xDefaultProvider,&rProviderImpl);
-}
-//-------------------------------------------------------------------------
-static
-inline
-configuration::DefaultProvider extractDefaultProvider(ApiTreeImpl* pParentTree)
-{
- if (pParentTree)
- return pParentTree->getDefaultProvider();
-
- else
- return configuration::DefaultProvider::createEmpty();
-}
-//-------------------------------------------------------------------------
-ApiTreeImpl::ApiTreeImpl(uno::XInterface* pInstance, ApiProvider& rProvider, rtl::Reference< configuration::Tree > const& aTree, ApiTreeImpl* pParentTree)
-: m_aTree(aTree)
-, m_aNotifier(new NotifierImpl(aTree))
-, m_aDefaultProvider(extractDefaultProvider(pParentTree))
-, m_xProvider()
-, m_rProvider(rProvider)
-, m_pParentTree(0)
-, m_pInstance(pInstance)
-{
- OSL_ENSURE(pParentTree == NULL || &rProvider == &pParentTree->m_rProvider,"WARNING: Parent tree has a different provider - trouble may be ahead");
- setNodeInstance(aTree->getRootNode(), pInstance);
- init(pParentTree);
-}
-//-------------------------------------------------------------------------
-ApiTreeImpl::ApiTreeImpl(uno::XInterface* _pInstance, ApiProvider& _rProvider, rtl::Reference< configuration::Tree > const& _aTree, configuration::DefaultProvider const& _aDefaultProvider)
-: m_aTree(_aTree)
-, m_aNotifier(new NotifierImpl(_aTree))
-, m_aDefaultProvider(_aDefaultProvider)
-, m_xProvider()
-, m_rProvider(_rProvider)
-, m_pParentTree(0)
-, m_pInstance(_pInstance)
-{
- setNodeInstance(_aTree->getRootNode(), _pInstance);
- init(NULL);
-}
-//-------------------------------------------------------------------------
-
-ApiTreeImpl::~ApiTreeImpl()
-{
- OSL_ENSURE(m_aNotifier->m_aListeners.isDisposed(),"ApiTree Object was not disposed properly");
- deinit();
-}
-//-------------------------------------------------------------------------
-
-ApiRootTreeImpl::ApiRootTreeImpl(uno::XInterface* pInstance, ApiProvider& rProvider, rtl::Reference< configuration::Tree > const& aTree, vos::ORef< OOptions > const& _xOptions)
-: m_aTreeImpl(pInstance, rProvider, aTree, createDefaultProvider(rProvider, aTree, _xOptions))
-, m_aLocationPath( configuration::Path::Rep() )
-, m_pNotificationListener(NULL)
-, m_xOptions(_xOptions)
-{
- implSetLocation(aTree);
- enableNotification(true);
-}
-//-------------------------------------------------------------------------
-ApiRootTreeImpl::~ApiRootTreeImpl()
-{
- if (m_pNotificationListener.is())
- {
- m_pNotificationListener->setSource(0);
- m_pNotificationListener->clearParent();
- }
-}
-//-------------------------------------------------------------------------
-
-void ApiTreeImpl::setNodeInstance(configuration::NodeRef const& aNode, uno::XInterface* pInstance)
-{
- OSL_ENSURE(aNode.isValid(),"ERROR: adding invalid node to ApiTree");
- OSL_ENSURE(m_aTree->isValidNode(aNode.getOffset()),"ERROR: foreign node being added to ApiTree");
- m_aNotifier->m_aListeners.setObjectAt( configuration::NodeID(m_aTree, aNode).toIndex(), pInstance );
-}
-
-//-------------------------------------------------------------------------
-
-bool ApiTreeImpl::isAlive() const
-{
- return m_aNotifier->m_aListeners.isAlive();
-}
-//-------------------------------------------------------------------------
-void ApiTreeImpl::checkAlive() const
-{
- m_aNotifier->m_aListeners.checkAlive( getUnoInstance() );
-}
-
-//-------------------------------------------------------------------------
-
-Notifier ApiTreeImpl::getNotifier() const
-{
- return Notifier(m_aNotifier,this);
-}
-//-------------------------------------------------------------------------
-
-bool ApiRootTreeImpl::enableNotification(bool bEnable)
-{
- TreeManager * pSource = bEnable ? getApiTree().getProvider().getProviderImpl().getNotifier() : 0;
-
- TreeManager * pOld = this->implSetNotificationSource(pSource);
-
- return pOld != 0;
-}
-//-------------------------------------------------------------------------
-
-bool ApiTreeImpl::disposeTree(bool bForce)
-{
- CFG_TRACE_INFO("ApiTreeImpl: Disposing Tree (may throw if already disposed)");
-
- // ensure our provider stays alive
- uno::Reference<uno::XInterface> xKeepParentAlive(this->getParentComponent());
- // ensure we stay alive too
- uno::Reference<uno::XInterface> xKeepAlive(this->getUnoInstance());
-
- // #109077# If already disposed, we may have no source data or data lock
- if (!isAlive())
- return false;
-
- if (!bForce)
- {
- if (m_pParentTree != 0)
- return false;
-
- // recheck after having the mutex
- checkAlive(); // may throw
- }
- else if (m_pParentTree)
- setParentTree(NULL);
-
- implDisposeTree();
- OSL_ASSERT(!isAlive()); // post condition
-
- return true;
-}
-//-------------------------------------------------------------------------
-
-bool ApiTreeImpl::disposeTreeNow()
-{
- CFG_TRACE_INFO("ApiTreeImpl: Disposing Tree Now (unless disposed)");
- if (isAlive() )
- return implDisposeTree();
- else
- return false;
-}
-//-------------------------------------------------------------------------
-bool ApiRootTreeImpl::disposeTree()
-{
- CFG_TRACE_INFO("Api Root Tree: Disposing Tree And Releasing (unless disposed)");
- // ensure our provider stays alive
- uno::Reference<uno::XInterface> xKeepProvider( m_aTreeImpl.getUnoProviderInstance() );
-
- rtl::Reference<NodeListener> xListener = m_pNotificationListener;
- if (xListener.is())
- {
- xListener->clearParent();
- xListener.clear();
- }
-
- bool bDisposed = m_aTreeImpl.disposeTreeNow();
-
- if (bDisposed) releaseData();
-
- if (!m_xOptions.isEmpty())
- {
- OSL_ENSURE(!bDisposed, "Disposing/Releasing should clear the options");
- CFG_TRACE_INFO2("Api Root Tree: data was not released in disposeTree");
- }
-
- return bDisposed;
-}
-//-------------------------------------------------------------------------
-bool ApiTreeImpl::implDisposeTree()
-{
- OSL_ENSURE(m_pParentTree == 0,"WARNING: Disposing a tree that still has a parent tree set");
-
- SpecialListenerContainer <configuration::SubNodeID,SubNodeHash,SubNodeEq,SubNodeToIndex>& aContainer = m_aNotifier->m_aListeners;
- if (aContainer.beginDisposing())
- {
- CFG_TRACE_INFO("ApiTreeImpl: Tree is now disposed");
-
- Factory& rFactory = getFactory();
-
- std::vector<configuration::NodeID> aChildNodes;
- configuration::getAllContainedNodes( m_aTree, aChildNodes);
-
- for (std::vector<configuration::NodeID>::reverse_iterator it = aChildNodes.rbegin(), stop = aChildNodes.rend();
- it != stop;
- ++it)
- {
- rFactory.revokeElement( *it );
- }
-
- CFG_TRACE_INFO_NI("ApiTreeImpl: Listeners are now informed");
- aContainer.notifyDisposing();
-
- OSL_ASSERT(!aContainer.isDisposed());
-
- CFG_TRACE_INFO_NI("ApiTreeImpl: Deinitializing");
- deinit(); // releases the provider and parent
- aContainer.endDisposing();
-
- OSL_ASSERT(aContainer.isDisposed());
-
- return true;
- }
- else
- {
- CFG_TRACE_INFO("ApiTreeImpl: Tree was already disposed.");
- return false;
- }
-}
-//-------------------------------------------------------------------------
-void ApiTreeImpl::disposeNode(configuration::NodeRef const& aNode, uno::XInterface* pInstance)
-{
- // This used to contain 3 nested 'isAlive()' calls; why !?
- if (isAlive())
- implDisposeNode(aNode,pInstance);
-}
-//-------------------------------------------------------------------------
-void ApiTreeImpl::implDisposeNode(configuration::NodeRef const& aNode, uno::XInterface* )
-{
- CFG_TRACE_INFO("ApiTreeImpl: Disposing a single node.");
- OSL_ENSURE(aNode.isValid(),"INTERNAL ERROR: Disposing NULL node");
- OSL_ENSURE(m_aTree->isValidNode(aNode.getOffset()),"INTERNAL ERROR: Disposing: node does not match tree");
- OSL_ENSURE( !m_aTree->isRootNode(aNode),"INTERNAL ERROR: Disposing the root node of the tree");
-
- configuration::NodeID aNodeID(m_aTree,aNode);
-
- if (m_aNotifier->m_aListeners.disposeOne(aNodeID.toIndex()) )
- {
- getFactory().revokeElement(aNodeID);
- }
-}
-//-------------------------------------------------------------------------
-void ApiTreeImpl::init(ApiTreeImpl* pParentTree)
-{
- m_xProvider = new ComponentAdapter(*this);
- m_xProvider->setProvider( this->getProviderComponent() );
-
- OSL_ENSURE(m_xProvider->getProvider().is(),"WARNING: Provider is no Component - Lifetime trouble ahead");
-
- OSL_ASSERT(m_pParentTree == 0);
- setParentTree(pParentTree);
-}
-//-------------------------------------------------------------------------
-void ApiTreeImpl::deinit()
-{
- setParentTree(0);
-
- uno::Reference<ComponentAdapter> xAdapter = m_xProvider;
- m_xProvider.clear();
-
- if (xAdapter.is())
- xAdapter->clear();
-}
-//-------------------------------------------------------------------------
-void ApiTreeImpl::haveNewParent(ApiTreeImpl* pNewParent) // public interface
-{
- setParentTree(pNewParent);
-}
-
-//-------------------------------------------------------------------------
-
-ApiTreeImpl const* ApiTreeImpl::getRootTreeImpl() const
-{
- ApiTreeImpl const* pRet = this;
- while (pRet->m_pParentTree)
- pRet = pRet->m_pParentTree;
-
- return pRet;
-}
-
-//-------------------------------------------------------------------------
-void ApiTreeImpl::setParentTree(ApiTreeImpl* pParentTree) // internal implementation
-{
-#if OSL_DEBUG_LEVEL > 0
- if (pParentTree)
- {
- rtl::Reference< configuration::Tree > aContext = m_aTree->getContextTree();
- rtl::Reference< configuration::Tree > aParent = pParentTree->m_aTree;
-
- configuration::NodeID aContextID( aContext, aContext->getRootNode() );
- configuration::NodeID aParentID( aParent, aParent->getRootNode() );
-
- OSL_ENSURE( aContextID == aParentID, "Parent relationship mismatch !");
- }
-#endif
-
- if (m_pParentTree != pParentTree)
- {
- uno::Reference<ComponentAdapter> xAdapter = m_xProvider;
-
- m_pParentTree = pParentTree;
-
- uno::Reference<com::sun::star::lang::XComponent> xNew = getParentComponent();
- OSL_ENSURE( xNew.is() == (pParentTree != 0), "WARNING: Parent Tree is no Component");
-
- if (xAdapter.is())
- xAdapter->setParent(xNew);
- else
- OSL_ENSURE( pParentTree == 0, "ERROR: Setting New Parent at deinitialized ApiTreeImpl");
-
- }
-}
-//-------------------------------------------------------------------------
-
-uno::Reference<uno::XInterface> ApiTreeImpl::getUnoProviderInstance() const
-{
- uno::Reference<ComponentAdapter> xAdapter = m_xProvider;
-
- uno::Reference<uno::XInterface> xReturn;
- if (xAdapter.is())
- xReturn = xAdapter->getProvider();
- return xReturn;
-}
-
-//-------------------------------------------------------------------------
-uno::Reference<com::sun::star::lang::XComponent> ApiTreeImpl::getParentComponent()
-{
- uno::XInterface* pInterface = m_pParentTree ? m_pParentTree->getUnoInstance() : 0;
- return uno::Reference<com::sun::star::lang::XComponent>::query(pInterface);
-}
-//-------------------------------------------------------------------------
-
-uno::Reference<com::sun::star::lang::XComponent> ApiTreeImpl::getProviderComponent()
-{
- uno::XInterface* pInterface = m_rProvider.getProviderImpl().getProviderInstance();
- return uno::Reference<com::sun::star::lang::XComponent>::query(pInterface);
-}
-
-//-------------------------------------------------------------------------
-
-void ApiTreeImpl::disposing(com::sun::star::lang::EventObject const& ) throw()
-{
- // this is a non-UNO external entry point - we need to keep this object alive for the duration of the call
- CFG_TRACE_INFO("ApiTreeImpl: Providing UNO object is disposed - disposing the tree");
-
- // Tree write Lock should be set by sender
-
- CFG_TRACE_INFO_NI("Clearing parent reference");
- setParentTree(0);
-
- CFG_TRACE_INFO_NI("Trying to dispose");
- //implDisposeTree();
- disposeTreeNow();
-
- CFG_TRACE_INFO_NI("Done disposing Tree");
- // uno::Reference<com::sun::star::lang::XComponent> xThis(getUnoInstance(),UNO_QUERY);
- // if (xThis.is()) xThis->dispose();
-}
-//-------------------------------------------------------------------------
-TreeManager * ApiRootTreeImpl::implSetNotificationSource(TreeManager * pNew)
-{
- TreeManager * pOld = m_pNotificationListener.is() ? m_pNotificationListener->getSource() : 0;
- if (pOld != pNew)
- {
- OSL_ENSURE(m_xOptions.isValid(), "Cannot change notification source without options");
-
- if (!m_pNotificationListener.is())
- m_pNotificationListener = new NodeListener(*this);
-
- m_pNotificationListener->setSource(pNew);
-
- }
- return pOld;
-}
-// ---------------------------------------------------------------------------------------------------
-
-void ApiRootTreeImpl::implSetLocation(rtl::Reference< configuration::Tree > const& _aTree)
-{
- OSL_ASSERT(_aTree == getApiTree().getTree());
- if (!configuration::isEmpty(_aTree.get()))
- {
- m_aLocationPath = _aTree->getRootPath();
- OSL_ENSURE(!m_aLocationPath.isRoot(), "Setting up a root tree without location");
- }
- else
- {
- OSL_ENSURE(false, "Setting up a root tree without data");
- m_aLocationPath = configuration::AbsolutePath::root();
- }
-
- if (!m_pNotificationListener.is())
- m_pNotificationListener = new NodeListener(*this);
-
- OSL_ENSURE(!m_aLocationPath.isRoot() && !m_aLocationPath.isDetached(), "Cannot reregister for notifications: setting empty location");
- OSL_ENSURE( m_xOptions.isValid(), "Cannot reregister for notifications: no options available" );
-
- m_pNotificationListener->setLocation(m_aLocationPath, m_xOptions);
-}
-// ---------------------------------------------------------------------------------------------------
-
-void ApiRootTreeImpl::releaseData()
-{
- CFG_TRACE_INFO("Api Root Tree at %s: releasing the Data",OUSTRING2ASCII(m_aLocationPath.toString()));
- rtl::Reference< configuration::Tree > aTree( m_aTreeImpl.getTree() );
-
- if (aTree.is()) {
- aTree->disposeData();
- }
- OSL_ASSERT(configuration::isEmpty(aTree.get()));
-
- OSL_ENSURE( !m_aLocationPath.isRoot() && !m_aLocationPath.isDetached(), "Location still needed to release data" );
- OSL_ENSURE( m_xOptions.isValid(), "Options still needed to release data" );
-
- getApiTree().getProvider().getProviderImpl().releaseSubtree(m_aLocationPath,m_xOptions->getRequestOptions());
- m_xOptions.unbind();
-
- m_aLocationPath = configuration::AbsolutePath::detachedRoot();
-}
-// ---------------------------------------------------------------------------------------------------
-
-void ApiRootTreeImpl::NodeListener::disposing(TreeManager * _pSource)
-{
- UnoApiLockClearable aGuard;
-
- OSL_ASSERT( !pSource || _pSource == pSource );
- if (pParent)
- {
- // this is a non-UNO external entry point - we need to keep this object alive for the duration of the call
- uno::Reference<uno::XInterface> xKeepAlive( pParent->m_aTreeImpl.getUnoInstance() );
- ApiRootTreeImpl* pKeepParent = pParent;
- aGuard.clear();
-
- pKeepParent->disposing(_pSource);
- }
-}
-void ApiRootTreeImpl::disposing(TreeManager *)
-{
- CFG_TRACE_INFO("Api Root Tree at %s: Cache data is disposed - dispose and release own data",
- OUSTRING2ASCII(m_aLocationPath.toString()));
- // ensure our provider stays alive
- uno::Reference<uno::XInterface> xKeepProvider( m_aTreeImpl.getUnoProviderInstance() );
-
- rtl::Reference<NodeListener> xListener = m_pNotificationListener;
- if (xListener.is())
- {
- xListener->clearParent();
- xListener.clear();
- }
-
- if (m_aTreeImpl.disposeTreeNow())
- releaseData(); // not really needed: the whole data is going away anyways
-}
-// ---------------------------------------------------------------------------------------------------
-
-static
-void disposeOneRemovedNode(configuration::NodeChangeInformation const& aRemoveInfo, Factory& aFactory)
-{
- if (aRemoveInfo.change.element.oldValue.is())
- {
- OSL_ENSURE(aRemoveInfo.change.element.isDataChange(), "ERROR: Disposing replaced element: Element did not really change !");
-
- rtl::Reference< configuration::ElementTree > aElementRef( aRemoveInfo.change.element.oldValue.get() );
-
- SetElement* pSetElement = aFactory.findSetElement(aElementRef );
- if (pSetElement)
- {
- // factory always does an extra acquire
- uno::Reference<uno::XInterface> xReleaseSetElement(pSetElement->getUnoInstance(), uno::UNO_REF_NO_ACQUIRE);
-
- pSetElement->haveNewParent(0);
- pSetElement->disposeTree(true);
- }
- }
- else
- {
- // This must apply to a node for which no element tree had been loaded in this view
- // thus there should not be one now after the change (even if the change was replacing)
- OSL_ENSURE(!aRemoveInfo.change.element.newValue.is(), "Cannot dispose replaced element: No tree object available");
- }
-}
-// ---------------------------------------------------------------------------------------------------
-
-static
-void disposeRemovedNodes(configuration::NodeChangesInformation const& aChanges, Factory& aFactory)
-{
- for (std::vector< configuration::NodeChangeInformation >::const_iterator it = aChanges.begin(); it != aChanges.end(); ++it)
- {
- switch (it->change.type)
- {
- case configuration::NodeChangeData::eReplaceElement:
- // check if element is actually unchanged !
- // (cannot dispose of the tree, if it is still in use)
- if (! it->change.element.isDataChange()) break;
-
- // else dispose the old one: fall thru
-
- case configuration::NodeChangeData::eRemoveElement:
- disposeOneRemovedNode( *it, aFactory );
- break;
-
- default: break;
- }
- }
-}
-// ---------------------------------------------------------------------------------------------------
-//INodeListener : IConfigListener
-void ApiRootTreeImpl::NodeListener::nodeChanged(Change const& aChange, configuration::AbsolutePath const& sPath, TreeManager * _pSource)
-{
- UnoApiLockClearable aGuard;
-
- OSL_ASSERT( !pSource || _pSource == pSource );
- if (pParent)
- {
- // this is a non-UNO external entry point - we need to keep this object alive for the duration of the call
- uno::Reference<uno::XInterface> xKeepAlive( pParent->m_aTreeImpl.getUnoInstance() );
- ApiRootTreeImpl* pKeepParent = pParent;
- aGuard.clear();
-
- pKeepParent->nodeChanged(aChange,sPath,_pSource);
- }
-}
-// ---------------------------------------------------------------------------------------------------
-
-//INodeListener : IConfigListener
-void ApiRootTreeImpl::nodeChanged(Change const& aChange, configuration::AbsolutePath const& aChangePath, TreeManager *)
-{
- // do not dipatch if we are dying/dead anyway
- if (m_aTreeImpl.isAlive())
- try
- {
- rtl::Reference< configuration::Tree > aTree(m_aTreeImpl.getTree());
-
- OSL_ENSURE(configuration::Path::hasPrefix(aChangePath, m_aLocationPath),
- "'changed' Path does not indicate this tree or its context: ");
-
- configuration::RelativePath aLocalChangePath = configuration::Path::stripPrefix(aChangePath,m_aLocationPath);
-
- // find the node and change
- configuration::NodeRef aNode;
-
- if ( !aLocalChangePath.isEmpty() )
- {
- configuration::NodeRef aBaseNode = aTree->getRootNode();
-
-#ifdef DBG_UTIL
- try {
- configuration::RelativePath aLocalPathOld = configuration::validateAndReducePath(aChangePath.toString(), aTree, aBaseNode);
- OSL_ENSURE( configuration::matches(aLocalPathOld,aLocalChangePath),
- "New local path different from validateAndReducePath(...) result in notification dispatch");
- }
- catch (configuration::Exception& e) {
- rtl::OString sMsg("Cannot validate new path handling for notification dispatch: ");
- sMsg += e.what();
- OSL_ENSURE(false, sMsg.getStr() );
- }
-#endif // DBG_UTIL
-
- configuration::AnyNodeRef aFoundNode = configuration::getDeepDescendant(aTree, aBaseNode, aLocalChangePath);
- if ( aFoundNode.isValid() )
- {
- if (aFoundNode.isNode())
- {
- aNode = aFoundNode.toNode();
- }
- else
- {
- // TODO: Notify using parent node and temporary dummy change
- OSL_ENSURE( false, "Notification broken: Node being adressed is a Value");
- }
- }
- }
- else
- {
- aNode = aTree->getRootNode();
- }
-
- SubtreeChange const* pTreeChange = NULL;
- if (aNode.isValid())
- {
- pTreeChange = dynamic_cast<SubtreeChange const*>(&aChange);
- OSL_ENSURE(pTreeChange != 0, "Notification broken: Change to inner node is not a subtree change"); // TODO: Notify set change using parent (if available) and temporary dummy change
- }
-
- if (pTreeChange != NULL) // implies aNode.isValid()
- {
- OSL_ENSURE( aChange.getNodeName() == aTree->getSimpleNodeName(aNode.getOffset()),
- "Change's node-name does not match found node's name - erratic notification");
-
- configuration::NodeChangesInformation aChanges;
-
- if (configuration::adjustToChanges(aChanges, aTree,aNode, *pTreeChange))
- {
- OSL_ASSERT(aChanges.size() > 0);
-
- Broadcaster aSender(m_aTreeImpl.getNotifier(),aChanges,false);
-
- // Should be improved later. Maybe this is the wrong lock for disposeTree ?
- // aLocalGuard.downgrade(); // partial clear for broadcast
-
- aSender.notifyListeners(aChanges, false);
-
- disposeRemovedNodes(aChanges, m_aTreeImpl.getFactory());
- }
- }
- }
- catch (configuration::InvalidName& i)
- {
- rtl::OString sMsg("Cannot locate change within this tree: ");
- sMsg += i.what();
- OSL_ENSURE(false, sMsg.getStr() );
- }
- catch (configuration::Exception& e)
- {
- rtl::OString sMsg("Unexpected error trying to react on update: ");
- sMsg += e.what();
- OSL_ENSURE(false, sMsg.getStr() );
- }
-}
-// ---------------------------------------------------------------------------------------------------
-
-void ApiRootTreeImpl::NodeListener::nodeDeleted(configuration::AbsolutePath const& _aPath, TreeManager * _pSource)
-{
- UnoApiLockClearable aGuard;
-
- OSL_ASSERT( !pSource || _pSource == pSource );
- if (pParent)
- {
- // this is a non-UNO external entry point - we need to keep this object alive for the duration of the call
- uno::Reference<uno::XInterface> xKeepAlive( pParent->m_aTreeImpl.getUnoInstance() );
- ApiRootTreeImpl* pKeepParent = pParent;
- aGuard.clear();
-
- pKeepParent->nodeDeleted(_aPath,_pSource);
- }
-}
-// ---------------------------------------------------------------------------------------------------
-void ApiRootTreeImpl::nodeDeleted(configuration::AbsolutePath const& _aDeletedPath, TreeManager *)
-{
- { (void)_aDeletedPath; }
-
- // this is a non-UNO external entry point - we need to keep this object alive for the duration of the call
- uno::Reference<uno::XInterface> xKeepAlive( m_aTreeImpl.getUnoInstance() );
-
-#ifdef DBG_UTIL
- OSL_ENSURE(configuration::Path::hasPrefix(m_aLocationPath, _aDeletedPath),
- "'deleted' Path does not indicate this tree or its context: ");
-#endif
- // ensure our provider stays alive
- uno::Reference<uno::XInterface> xKeepProvider( m_aTreeImpl.getUnoProviderInstance() );
-
- rtl::Reference<NodeListener> xListener = m_pNotificationListener;
- if (xListener.is())
- {
- xListener->clearParent();
- xListener.clear();
- }
-
- if (m_aTreeImpl.disposeTreeNow())
- releaseData();
-}
-
-// ---------------------------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
- }
-}
-
diff --git a/configmgr/source/api2/apitreeimplobj.hxx b/configmgr/source/api2/apitreeimplobj.hxx
deleted file mode 100644
index 6123b4f994..0000000000
--- a/configmgr/source/api2/apitreeimplobj.hxx
+++ /dev/null
@@ -1,189 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_TREEIMPLOBJECTS_HXX_
-#define CONFIGMGR_API_TREEIMPLOBJECTS_HXX_
-
-#include "noderef.hxx"
-#include "configset.hxx"
-#include "configdefaultprovider.hxx"
-#include "confevents.hxx"
-#include "options.hxx"
-#include "utility.hxx"
-#include <boost/utility.hpp>
-#include <vos/ref.hxx>
-#include <rtl/ref.hxx>
-#include <osl/mutex.hxx>
-
-#ifndef INCLUDED_MEMORY
-#include <memory>
-#define INCLUDED_MEMORY
-#endif
-#include <com/sun/star/lang/XEventListener.hpp>
-#include <com/sun/star/lang/XComponent.hpp>
-
-namespace com { namespace sun { namespace star {
- namespace script { class XTypeConverter; }
-} } }
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- class OProviderImpl;
-//-----------------------------------------------------------------------------
- namespace configapi
- {
-//-----------------------------------------------------------------------------
- class Factory;
- class Notifier;
- class NotifierImpl;
-//-----------------------------------------------------------------------------
- class ObjectRegistry;
-//-----------------------------------------------------------------------------
-// API object implementation wrappers
-//-------------------------------------------------------------------------
- class ApiProvider: private boost::noncopyable
- {
- Factory& m_rFactory;
- OProviderImpl& m_rProviderImpl;
- public:
- ApiProvider(Factory& rFactory, OProviderImpl& rProviderImpl );
-
- ~ApiProvider()
- {}
-
- uno::Reference<com::sun::star::script::XTypeConverter> getTypeConverter() const;
- Factory& getFactory() { return m_rFactory; }
- OProviderImpl& getProviderImpl() { return m_rProviderImpl; }
- };
-
- //-----------------------------------------------------------------------------
-
- //-------------------------------------------------------------------------
- class ApiTreeImpl: private boost::noncopyable
- {
- class ComponentAdapter;
-
- rtl::Reference< configuration::Tree > m_aTree;
- vos::ORef<NotifierImpl> m_aNotifier;
- configuration::DefaultProvider m_aDefaultProvider;
- uno::Reference<ComponentAdapter> m_xProvider;
- ApiProvider& m_rProvider;
- ApiTreeImpl* m_pParentTree;
- uno::XInterface* m_pInstance;
-
- public:
- explicit ApiTreeImpl(uno::XInterface* pInstance, ApiProvider& rProvider, rtl::Reference< configuration::Tree > const& aTree, ApiTreeImpl* pParentTree);
- explicit ApiTreeImpl(uno::XInterface* _pInstance, ApiProvider& _rProvider, rtl::Reference< configuration::Tree > const& _aTree, configuration::DefaultProvider const & _aDefaultProvider);
- ~ApiTreeImpl();
-
- // initialization
- void setNodeInstance(configuration::NodeRef const& aNode, uno::XInterface* pInstance);
-
- // model access
- rtl::Reference< configuration::Tree > getTree() const { return m_aTree; }
-
- // self-locked methods for dispose handling
- bool isAlive() const;
- void checkAlive() const;
- bool disposeTree(bool bForce);
- bool disposeTreeNow();
- void disposeNode(configuration::NodeRef const& aNode, uno::XInterface* pInstance);
-
- // api object handling
- Factory& getFactory() const { return m_rProvider.getFactory(); }
- Notifier getNotifier() const;
- configuration::DefaultProvider getDefaultProvider() const { return m_aDefaultProvider; }
-
- // needs external locking
- ApiTreeImpl const* getRootTreeImpl() const;
-
- uno::XInterface* getUnoInstance() const { return m_pInstance; }
- ApiProvider& getProvider() { return m_rProvider; }
- uno::Reference<uno::XInterface> getUnoProviderInstance() const; // { return m_xProvider; }
-
- /// wire this to a new parent tree
- void haveNewParent(ApiTreeImpl* pNewParent);
- private:
- void init(ApiTreeImpl* pParentTree);
- void setParentTree(ApiTreeImpl* pNewParentTree);
- void deinit();
-
- bool implDisposeTree();
- void implDisposeNode(configuration::NodeRef const& aNode, uno::XInterface* pInstance);
-
- friend class ComponentAdapter;
- void disposing(com::sun::star::lang::EventObject const& rEvt) throw();
- uno::Reference<com::sun::star::lang::XComponent> getProviderComponent();
- uno::Reference<com::sun::star::lang::XComponent> getParentComponent();
-
- };
-
- //-----------------------------------------------------------------------------
- class ApiRootTreeImpl
- {
- public:
- explicit ApiRootTreeImpl(uno::XInterface* pInstance, ApiProvider& rProvider, rtl::Reference< configuration::Tree > const& aTree, vos::ORef< OOptions > const& _xOptions);
- ~ApiRootTreeImpl();
-
- ApiTreeImpl& getApiTree() { return m_aTreeImpl; }
- ApiTreeImpl const& getApiTree() const { return m_aTreeImpl; }
-
- configuration::AbsolutePath const & getLocation() const { return m_aLocationPath; }
- vos::ORef< OOptions > getOptions() const { return m_xOptions; }
-
- // self-locked methods for dispose handling
- bool disposeTree();
-
- /// toggle whether this object relays notifications from the base provider
- bool enableNotification(bool bEnable);
- private:
- TreeManager * implSetNotificationSource(TreeManager * pNew);
- void implSetLocation(rtl::Reference< configuration::Tree > const& _aTree);
- void releaseData();
-
- private:
- class NodeListener;
- friend class NodeListener;
-
- // IConfigListener
- void disposing(TreeManager * pSource) ;
- //INodeListener : IConfigListener
- void nodeChanged(Change const& aChange, configuration::AbsolutePath const& aPath, TreeManager * pSource);
- void nodeDeleted(configuration::AbsolutePath const& aPath, TreeManager * pSource);
-
- private:
- ApiTreeImpl m_aTreeImpl;
- configuration::AbsolutePath m_aLocationPath;
- rtl::Reference<NodeListener> m_pNotificationListener;
- vos::ORef< OOptions > m_xOptions;
- };
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_API_TREEIMPLOBJECTS_HXX_
diff --git a/configmgr/source/api2/broadcaster.cxx b/configmgr/source/api2/broadcaster.cxx
deleted file mode 100644
index 1f449c3d0d..0000000000
--- a/configmgr/source/api2/broadcaster.cxx
+++ /dev/null
@@ -1,1226 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "broadcaster.hxx"
-#include "notifierimpl.hxx"
-#include "confignotifier.hxx"
-#include "noderef.hxx"
-#include "nodechange.hxx"
-#include "nodechangeinfo.hxx"
-#include "translatechanges.hxx"
-#include "apifactory.hxx"
-#include "apitreeaccess.hxx"
-#include "apitreeimplobj.hxx"
-#include <vos/refernce.hxx>
-
-#ifndef INCLUDED_MAP
-#include <map>
-#define INCLUDED_MAP
-#endif
-#ifndef INCLUDED_SET
-#include <set>
-#define INCLUDED_SET
-#endif
-#ifndef INCLUDED_FUNCTIONAL
-#include <functional>
-#define INCLUDED_FUNCTIONAL
-#endif
-
-namespace configmgr
-{
- namespace configapi
- {
-// ---------------------------------------------------------------------------------------------------
-// Broadcaster implementation
-// ---------------------------------------------------------------------------------------------------
- class BroadcasterHelper
- {
- public:
- static vos::ORef<NotifierImpl> getImpl(Notifier const& aNotifier) { return aNotifier.m_aImpl; }
- };
-// ---------------------------------------------------------------------------------------------------
-
- namespace
- {
- // -----------------------------------------------------------------------------------------------
- template <class T>
- struct LessORefBodyPtr
- {
- bool operator()(vos::ORef<T> const& lhs, vos::ORef<T> const& rhs) const
- {
- return ptr_less(lhs.getBodyPtr(), rhs.getBodyPtr());
- }
-
- std::less<T*> ptr_less;
- };
- // -----------------------------------------------------------------------------------------------
- class ApiTreeRef
- {
- ApiTreeImpl const* m_pApiTree;
- uno::Reference<uno::XInterface> m_xKeepAlive;
- public:
- explicit ApiTreeRef(ApiTreeImpl const* _pApiTree = NULL)
- : m_pApiTree(_pApiTree)
- , m_xKeepAlive()
- {
- if (m_pApiTree) m_xKeepAlive = m_pApiTree->getUnoInstance();
- }
-
- bool is() const
- {
- OSL_ASSERT(!m_pApiTree == !m_xKeepAlive.is());
- return m_pApiTree != NULL;
- }
-
- ApiTreeImpl const* get() const { return m_pApiTree; }
- ApiTreeImpl const* operator->() const { return m_pApiTree; }
-
- friend bool operator==(ApiTreeRef const& lhs,ApiTreeRef const& rhs)
- { return lhs.m_pApiTree == rhs.m_pApiTree; }
-
- friend bool operator!=(ApiTreeRef const& lhs,ApiTreeRef const& rhs)
- { return lhs.m_pApiTree != rhs.m_pApiTree; }
- };
- // -----------------------------------------------------------------------------------------------
- typedef std::map< vos::ORef<NotifierImpl>, ApiTreeRef, LessORefBodyPtr<NotifierImpl> > NotifierSet;
- // -----------------------------------------------------------------------------------------------
-
- }
-// ---------------------------------------------------------------------------------------------------
-// class Broadcaster::Impl
-// ---------------------------------------------------------------------------------------------------
- class Broadcaster::Impl : public vos::OReference
- {
- private:
- NotifierSet::value_type m_aNotifierData;
- public:
- Impl(NotifierSet::value_type const& aNotifierData) : m_aNotifierData(aNotifierData) {}
-
- NotifierSet::value_type getNotifierData() const { return m_aNotifierData; }
-
- bool translateChanges(configuration::NodeChangesInformation& aInfos, configuration::NodeChanges const& aChanges, bool bSingleBase) const;
- bool translateChanges(configuration::NodeChangesInformation& aInfos, configuration::NodeChangesInformation const& aChanges, bool bSingleBase) const;
-
- void queryConstraints(configuration::NodeChangesInformation const& aChanges) { this->doQueryConstraints(aChanges); }
- void notifyListeners(configuration::NodeChangesInformation const& aChanges) { this->doNotifyListeners(aChanges); }
-
- void notifyRootListeners(configuration::NodeChangesInformation const& aChanges);
-
- static vos::ORef<Impl> create(vos::ORef<NotifierImpl> const& rNotifierImpl, ApiTreeRef const& pTreeImpl, configuration::NodeChange const& aChange, bool bLocal);
- static vos::ORef<Impl> create(vos::ORef<NotifierImpl> const& rNotifierImpl, ApiTreeRef const& pTreeImpl, configuration::NodeChanges const& aChange, bool bLocal);
- static vos::ORef<Impl> create(vos::ORef<NotifierImpl> const& rNotifierImpl, ApiTreeRef const& pTreeImpl, configuration::NodeChangeInformation const& aChange, bool bLocal);
- static vos::ORef<Impl> create(vos::ORef<NotifierImpl> const& rNotifierImpl, ApiTreeRef const& pTreeImpl, configuration::NodeChangesInformation const& aChange, bool bLocal);
-
- private:
- virtual void doQueryConstraints(configuration::NodeChangesInformation const& aChanges) = 0;
- virtual void doNotifyListeners(configuration::NodeChangesInformation const& aChanges) = 0;
- };
-// ---------------------------------------------------------------------------------------------------
- namespace
- {
- // -----------------------------------------------------------------------------------------------
-
- class EmptyBroadcaster_Impl : public Broadcaster::Impl
- {
- EmptyBroadcaster_Impl(NotifierSet::value_type const& rNotifierData)
- : Broadcaster::Impl(rNotifierData)
- {
- }
- public:
- static
- vos::ORef< Broadcaster::Impl > create(NotifierSet::value_type const& rRootNotifier)
- {
- return new EmptyBroadcaster_Impl(rRootNotifier);
- }
- private:
- virtual void doQueryConstraints(configuration::NodeChangesInformation const& aChanges);
- virtual void doNotifyListeners(configuration::NodeChangesInformation const& aChanges);
- };
-
- void EmptyBroadcaster_Impl::doQueryConstraints(configuration::NodeChangesInformation const&) {}
- void EmptyBroadcaster_Impl::doNotifyListeners(configuration::NodeChangesInformation const&) {}
- // -----------------------------------------------------------------------------------------------
-
- class NodeLocalBroadcaster_Impl : public Broadcaster::Impl
- {
- configuration::NodeID aAffectedNode;
-
- public:
- NodeLocalBroadcaster_Impl(NotifierSet::value_type const& rTreeNotifierData, configuration::NodeID const& aAffectedID)
- : Broadcaster::Impl(rTreeNotifierData)
- , aAffectedNode(aAffectedID)
- {
- }
-
- configuration::NodeID getAffectedNodeID() const { return aAffectedNode; }
- unsigned int getNodeIndex() const { return aAffectedNode.toIndex(); }
-
- protected:
- void querySingleConstraint(configuration::NodeChangeInformation const& aChange, bool bMore);
- void notifySingleChange(configuration::NodeChangeInformation const& aChange, bool bMore, css::beans::PropertyChangeEvent*& pCurEvent);
- };
- // -----------------------------------------------------------------------------------------------
-
- class SingleChangeBroadcaster_Impl : public NodeLocalBroadcaster_Impl
- {
- configuration::SubNodeID m_aChangingValue;
-
- SingleChangeBroadcaster_Impl(NotifierSet::value_type const& rTreeNotifierData, configuration::NodeID const& aAffectedID, configuration::SubNodeID const& aChangedValue);
-
- public:
- static
- NodeLocalBroadcaster_Impl* create(
- NotifierSet::value_type const& rLocalNotifier,
- configuration::NodeChangeLocation const& aChange);
- static
- NodeLocalBroadcaster_Impl* create(
- NotifierSet::value_type const& rLocalNotifier,
- configuration::NodeID const& aAffectedID,
- configuration::NodeChangeLocation const& aChange);
- static
- NodeLocalBroadcaster_Impl* create(
- NotifierSet::value_type const& rLocalNotifier,
- configuration::NodeID const& aAffectedID,
- configuration::SubNodeID const& aChangedNode,
- configuration::NodeChangeLocation const& aChange);
- private:
- virtual void doQueryConstraints(configuration::NodeChangesInformation const& aChanges);
- virtual void doNotifyListeners(configuration::NodeChangesInformation const& aChanges);
- };
-
- // -----------------------------------------------------------------------------------------------
- class MultiChangeBroadcaster_Impl : public NodeLocalBroadcaster_Impl
- {
- std::set< configuration::SubNodeID > m_aChangingNodes;
-
- MultiChangeBroadcaster_Impl(NotifierSet::value_type const& rTreeNotifierData, configuration::NodeID const& aAffectedID, std::set< configuration::SubNodeID >& aChangedNodes);
-
- public:
- static
- NodeLocalBroadcaster_Impl* create(
- NotifierSet::value_type const& rLocalNotifier,
- configuration::NodeChangesInformation const& aChanges);
- static
- NodeLocalBroadcaster_Impl* create(
- NotifierSet::value_type const& rLocalNotifier,
- configuration::NodeID const& aAffectedID,
- configuration::NodeChangesInformation const& aChanges);
- private:
- virtual void doQueryConstraints(configuration::NodeChangesInformation const& aChanges);
- virtual void doNotifyListeners(configuration::NodeChangesInformation const& aChanges);
- };
- // -----------------------------------------------------------------------------------------------
- class SingleTreeBroadcaster_Impl : public Broadcaster::Impl
- {
- std::vector< vos::ORef<NodeLocalBroadcaster_Impl> > m_aBroadcasters;
-
- SingleTreeBroadcaster_Impl(NotifierSet::value_type const& rTreeNotifierData, std::vector< vos::ORef<NodeLocalBroadcaster_Impl> >& aBroadcasters);
-
- public:
- //--------------------------
- static
- vos::ORef< Broadcaster::Impl > create(
- NotifierSet::value_type const& rRootNotifier,
- NotifierSet::value_type const& rLocalNotifier,
- configuration::NodeChangesInformation const& aChanges);
-
- static bool selectChanges(configuration::NodeChangesInformation& rSelected, configuration::NodeChangesInformation const& aOriginal, configuration::NodeID const& aSelector);
- //--------------------------
- private:
- virtual void doQueryConstraints(configuration::NodeChangesInformation const& aChanges);
- virtual void doNotifyListeners(configuration::NodeChangesInformation const& aChanges);
- };
- // -----------------------------------------------------------------------------------------------
- class MultiTreeBroadcaster_Impl : public Broadcaster::Impl
- {
- std::vector< vos::ORef< Broadcaster::Impl > > m_aBroadcasters;
-
- MultiTreeBroadcaster_Impl(NotifierSet::value_type const& rRootNotifierData, std::vector< vos::ORef< Broadcaster::Impl > >& aBroadcasters);
- public:
- //--------------------------
- static
- vos::ORef< Broadcaster::Impl > create(
- NotifierSet::value_type const& rRootNotifier,
- NotifierSet const& rNotifiers,
- configuration::NodeChangesInformation const& aChanges);
-
- static bool selectChanges(configuration::NodeChangesInformation& rSelected, configuration::NodeChangesInformation const& aOriginal, NotifierSet::value_type const& aSelector);
- //--------------------------
- private:
- virtual void doQueryConstraints(configuration::NodeChangesInformation const& aChanges);
- virtual void doNotifyListeners(configuration::NodeChangesInformation const& aChanges);
- };
-
- // -----------------------------------------------------------------------------------------------
-
- inline configuration::NodeID makeRootID( rtl::Reference< configuration::Tree > const& aTree ) { return configuration::NodeID( aTree, aTree->getRootNode() ); }
- inline configuration::NodeID makeRootID( ApiTreeRef const& pTreeImpl ) { return makeRootID( pTreeImpl->getTree() ); }
- // -----------------------------------------------------------------------------------------------
- NotifierSet::value_type findNotifier(configuration::NodeChangeLocation const& aChange, ApiTreeRef const& pTreeImpl)
- {
- OSL_ENSURE(aChange.isValidData(),"Invalid change location - cannot find notifier");
-
- configuration::NodeID aAffectedNode = aChange.getAffectedNodeID();
- if (aAffectedNode.isEmpty())
- return NotifierSet::value_type();
-
- ApiTreeRef aAffectedImpl( Factory::findDescendantTreeImpl(aAffectedNode, pTreeImpl.get()) );
- if (aAffectedImpl.is())
- {
- vos::ORef<NotifierImpl> aAffectedNotifier = BroadcasterHelper::getImpl(aAffectedImpl->getNotifier());
-
- return NotifierSet::value_type(aAffectedNotifier, aAffectedImpl);
- }
- else
- return NotifierSet::value_type();
- }
- // -----------------------------------------------------------------------------------------------
- inline
- NotifierSet::value_type findNotifier(configuration::NodeChangeInformation const& aChange, ApiTreeRef const& pTreeImpl)
- {
- return findNotifier(aChange.location,pTreeImpl);
- }
- // -----------------------------------------------------------------------------------------------
-
- void findNotifiers(NotifierSet& aNotifiers, configuration::NodeChangesInformation const& aChanges, ApiTreeRef const& pTreeImpl )
- {
- for (std::vector< configuration::NodeChangeInformation >::const_iterator it = aChanges.begin(); it != aChanges.end(); ++it)
- {
- NotifierSet::value_type aNotifierData( findNotifier(*it,pTreeImpl) );
-
- if (aNotifierData.first.isValid())
- {
- aNotifiers.insert( aNotifierData );
- OSL_ENSURE( aNotifiers[aNotifierData.first] == aNotifierData.second, "Different Api Trees for the same notifier" );
- }
- }
- }
- // -----------------------------------------------------------------------------------------------
- // NodeLocalBroadcaster_Impl
- // -----------------------------------------------------------------------------------------------
- void NodeLocalBroadcaster_Impl::querySingleConstraint(configuration::NodeChangeInformation const& aChange, bool bMore)
- {
- uno::Reference< css::beans::XVetoableChangeListener > const * const SelectListener = 0;
-
- vos::ORef<NotifierImpl> pNotifierImpl = getNotifierData().first;
-
- cppu::OInterfaceContainerHelper* pListeners = pNotifierImpl->m_aListeners.getContainer( getNodeIndex(), getCppuType(SelectListener) );
- cppu::OInterfaceContainerHelper* pSpecial = pNotifierImpl->m_aListeners.getSpecialContainer( aChange.location.getChangingValueID() );
-
- if (pSpecial || pListeners)
- {
- css::beans::PropertyChangeEvent aEvent;
- aEvent.Source = pNotifierImpl->m_aListeners.getObjectAt( getNodeIndex() );
-
- if (configapi::fillEventDataFromResolved(aEvent,aChange,bMore))
- {
- // Catch only RuntimeExceptions here: vetoableChange issues its veto by throwing
- // a PropertyVetoException (which is not a RuntimeException)
- if (pListeners)
- {
- ListenerContainerIterator< css::beans::XVetoableChangeListener > aIterator(*pListeners);
-
- UnoApiLockReleaser aGuardReleaser;
- while (aIterator.hasMoreElements())
- try
- {
- aIterator.next()->vetoableChange(aEvent);
- }
- catch (uno::RuntimeException & )
- {}
- }
- if (pSpecial)
- {
- ListenerContainerIterator< css::beans::XVetoableChangeListener > aIterator(*pSpecial);
-
- UnoApiLockReleaser aGuardReleaser;
- while (aIterator.hasMoreElements())
- try
- {
- aIterator.next()->vetoableChange(aEvent);
- }
- catch (uno::RuntimeException & )
- {}
- }
- }
- }
-
- }
- // -----------------------------------------------------------------------------------------------
- void NodeLocalBroadcaster_Impl::notifySingleChange(configuration::NodeChangeInformation const& aChange, bool bMore, css::beans::PropertyChangeEvent*& pCurEvent)
- {
- uno::Reference< css::beans::XPropertyChangeListener > const * const SelectPropertyListener = 0;
- uno::Reference< css::container::XContainerListener > const * const SelectContainerListener = 0;
-
- vos::ORef<NotifierImpl> pNotifierImpl = getNotifierData().first;
-
- cppu::OInterfaceContainerHelper* pContainerListeners = pNotifierImpl->m_aListeners.getContainer( getNodeIndex(), getCppuType(SelectContainerListener) );
-
- if (pContainerListeners)
- {
- css::container::ContainerEvent aEvent;
- aEvent.Source = pNotifierImpl->m_aListeners.getObjectAt( getNodeIndex() );
-
- if (configapi::fillEventDataFromResolved(aEvent,aChange))
- {
-
- ListenerContainerIterator< css::container::XContainerListener > aIterator(*pContainerListeners);
-
- UnoApiLockReleaser aGuardReleaser;
- while (aIterator.hasMoreElements())
- try
- {
- uno::Reference<css::container::XContainerListener> xListener( aIterator.next() );
- OSL_ASSERT( xListener.is() );
-
- switch (aChange.change.type)
- {
- case configuration::NodeChangeData::eSetValue:
- case configuration::NodeChangeData::eSetDefault:
- case configuration::NodeChangeData::eReplaceElement:
- xListener->elementReplaced(aEvent);
- break;
-
- case configuration::NodeChangeData::eInsertElement:
- xListener->elementInserted(aEvent);
- break;
-
- case configuration::NodeChangeData::eRemoveElement:
- xListener->elementRemoved(aEvent);
- break;
-
-
- case configuration::NodeChangeData::eResetSetDefault:
- case configuration::NodeChangeData::eRenameElementTree:
- case configuration::NodeChangeData::eNoChange:
- OSL_ASSERT(false);
- break;
- }
- }
- catch (uno::Exception &)
- {}
- }
- }
-
-
- OSL_ASSERT(pCurEvent);
- css::beans::PropertyChangeEvent& rEvent = *pCurEvent;
-
- rEvent.Source = pNotifierImpl->m_aListeners.getObjectAt( getNodeIndex() );
-
- if (configapi::fillEventDataFromResolved(rEvent,aChange,bMore))
- {
- cppu::OInterfaceContainerHelper* pPropertyListeners = pNotifierImpl->m_aListeners.getContainer( getNodeIndex(), getCppuType(SelectPropertyListener) );
- if (pPropertyListeners)
- {
- ListenerContainerIterator< css::beans::XPropertyChangeListener > aIterator(*pPropertyListeners);
- UnoApiLockReleaser aGuardReleaser;
- while (aIterator.hasMoreElements())
- try { aIterator.next()->propertyChange(rEvent); } catch (uno::Exception & ) {}
- }
-
- cppu::OInterfaceContainerHelper* pSpecialListeners = pNotifierImpl->m_aListeners.getSpecialContainer( aChange.location.getChangingValueID() );
- if (pSpecialListeners)
- {
- ListenerContainerIterator< css::beans::XPropertyChangeListener > aIterator(*pSpecialListeners);
- UnoApiLockReleaser aGuardReleaser;
- while (aIterator.hasMoreElements())
- try { aIterator.next()->propertyChange(rEvent); } catch (uno::Exception & ) {}
- }
-
- ++pCurEvent;
- }
-
- }
- // -----------------------------------------------------------------------------------------------
-
- // -----------------------------------------------------------------------------------------------
- // SingleBroadcaster_Impl
- // -----------------------------------------------------------------------------------------------
- SingleChangeBroadcaster_Impl::SingleChangeBroadcaster_Impl(
- NotifierSet::value_type const& rTreeNotifierData,
- configuration::NodeID const& aAffectedID, configuration::SubNodeID const& aChangedNode
- )
- : NodeLocalBroadcaster_Impl(rTreeNotifierData,aAffectedID)
- , m_aChangingValue(aChangedNode)
- {
- }
- // -----------------------------------------------------------------------------------------------
- NodeLocalBroadcaster_Impl* SingleChangeBroadcaster_Impl::create(
- NotifierSet::value_type const& rLocalNotifier,
- configuration::NodeChangeLocation const& aChange)
- {
- OSL_ENSURE(rLocalNotifier.second->getTree() == aChange.getAffectedTreeRef(),
- "ERROR: Tree Mismatch creating Single Broadcaster");
-
- OSL_ENSURE(aChange.isValidData(), "ERROR: Invalid Change Location for Broadcaster");
-
- configuration::NodeID aAffectedNodeID = aChange.getAffectedNodeID();
- if (aAffectedNodeID.isEmpty())
- return 0;
-
- return create(rLocalNotifier,aAffectedNodeID,aChange.getChangingValueID(),aChange);
- }
- // -----------------------------------------------------------------------------------------------
- NodeLocalBroadcaster_Impl* SingleChangeBroadcaster_Impl::create(
- NotifierSet::value_type const& rLocalNotifier,
- configuration::NodeID const& aAffectedID,
- configuration::NodeChangeLocation const& aChange)
- {
-
- return create(rLocalNotifier,aAffectedID,aChange.getChangingValueID(),aChange);
- }
- // -----------------------------------------------------------------------------------------------
- NodeLocalBroadcaster_Impl* SingleChangeBroadcaster_Impl::create(
- NotifierSet::value_type const& rLocalNotifier,
- configuration::NodeID const& aAffectedID,
- configuration::SubNodeID const& aChangedNodeID,
- configuration::NodeChangeLocation const& aChange)
- {
- { (void)aChange; }
- OSL_ENSURE(aChange.isValidData(), "ERROR: Invalid Change Location for Broadcaster");
- OSL_ENSURE(aAffectedID.isValidNode(),"Cannot broadcast without affected node");
-
- OSL_ENSURE(rLocalNotifier.second->getTree() == aChange.getAffectedTreeRef(),
- "ERROR: Tree Mismatch creating Single Broadcaster");
- OSL_ENSURE( aChange.getAffectedNodeID() == aAffectedID,
- "ERROR: Node Mismatch creating Single Broadcaster");
- OSL_ENSURE( aChange.getChangingValueID() == aChangedNodeID,
- "ERROR: Value Node Mismatch creating Single Broadcaster");
-
- return new SingleChangeBroadcaster_Impl(rLocalNotifier,aAffectedID,aChangedNodeID);
- }
- // -----------------------------------------------------------------------------------------------
- void SingleChangeBroadcaster_Impl::doQueryConstraints(configuration::NodeChangesInformation const& aChanges)
- {
- OSL_ASSERT(aChanges.size() <= 1);
- if (!aChanges.empty())
- {
- std::vector< configuration::NodeChangeInformation >::const_iterator it = aChanges.begin();
-
- OSL_ENSURE( m_aChangingValue == it->location.getChangingValueID(), "Broadcasting unanticipated change");
-
- querySingleConstraint(*it, false);
- }
-
- }
- // -----------------------------------------------------------------------------------------------
- void SingleChangeBroadcaster_Impl::doNotifyListeners(configuration::NodeChangesInformation const& aChanges)
- {
- OSL_ASSERT(aChanges.size() <= 1);
- if (!aChanges.empty())
- {
- css::beans::PropertyChangeEvent aEvent;
- css::beans::PropertyChangeEvent * pEventNext = &aEvent;
-
- std::vector< configuration::NodeChangeInformation >::const_iterator it = aChanges.begin();
-
- OSL_ENSURE( m_aChangingValue == it->location.getChangingValueID(), "Broadcasting unanticipated change");
-
- notifySingleChange(*it, false, pEventNext);
-
- if (pEventNext != &aEvent)
- {
- uno::Sequence< css::beans::PropertyChangeEvent > aPropertyEvents(&aEvent,1);
-
- uno::Reference< css::beans::XPropertiesChangeListener > const * const SelectListener = 0;
-
- vos::ORef<NotifierImpl> pNotifierImpl = getNotifierData().first;
-
- cppu::OInterfaceContainerHelper* pContainer = pNotifierImpl->m_aListeners.getContainer( getNodeIndex(), getCppuType(SelectListener) );
-
- if (pContainer)
- {
- ListenerContainerIterator< css::beans::XPropertiesChangeListener > aIterator(*pContainer);
- UnoApiLockReleaser aGuardReleaser;
- while (aIterator.hasMoreElements())
- try { aIterator.next()->propertiesChange(aPropertyEvents); } catch (uno::Exception & ) {}
- }
- }
- }
- }
-
- // -----------------------------------------------------------------------------------------------
- // MultiChangeBroadcaster_Impl
- // -----------------------------------------------------------------------------------------------
-
- MultiChangeBroadcaster_Impl::MultiChangeBroadcaster_Impl(
- NotifierSet::value_type const& rTreeNotifierData,
- configuration::NodeID const& aAffectedID, std::set< configuration::SubNodeID >& aChangedNodes
- )
- : NodeLocalBroadcaster_Impl(rTreeNotifierData,aAffectedID)
- , m_aChangingNodes()
- {
- m_aChangingNodes.swap(aChangedNodes);
- }
- // -----------------------------------------------------------------------------------------------
- NodeLocalBroadcaster_Impl* MultiChangeBroadcaster_Impl::create(
- NotifierSet::value_type const& rLocalNotifier,
- configuration::NodeChangesInformation const& aChanges)
- {
- if (aChanges.empty())
- return 0;
-
- OSL_ENSURE(aChanges.begin()->hasValidLocation(), "ERROR: Invalid Change Location for Broadcaster");
-
- configuration::NodeID aAffectedNodeID = aChanges.begin()->location.getAffectedNodeID();
- if (aAffectedNodeID.isEmpty())
- return 0;
-
- return create(rLocalNotifier, aAffectedNodeID, aChanges);
- }
- // -----------------------------------------------------------------------------------------------
- NodeLocalBroadcaster_Impl* MultiChangeBroadcaster_Impl::create(
- NotifierSet::value_type const& rLocalNotifier,
- configuration::NodeID const& aAffectedNodeID,
- configuration::NodeChangesInformation const& aChanges)
- {
- if (aChanges.empty())
- return 0;
-
- else if (aChanges.size() == 1)
- return SingleChangeBroadcaster_Impl::create(rLocalNotifier,aAffectedNodeID,aChanges.begin()->location);
-
- else
- {
- OSL_ENSURE(aAffectedNodeID.isValidNode(),"Cannot broadcast without affected node");
-
- std::set< configuration::SubNodeID > aChangedNodes;
- for (std::vector< configuration::NodeChangeInformation >::const_iterator it = aChanges.begin(); it != aChanges.end(); ++it)
- {
- OSL_ENSURE(it->hasValidLocation(), "ERROR: Invalid Change Location for Broadcaster");
-
- OSL_ENSURE(it->location.getAffectedNodeID() == aAffectedNodeID, "ERROR: Change is not local to affected node (as advertised)");
- OSL_ENSURE(rLocalNotifier.second->getTree() == it->location.getAffectedTreeRef(),
- "ERROR: Tree Mismatch creating Multi Change Broadcaster");
-
- configuration::SubNodeID aChangedValueID = it->location.getChangingValueID();
-
- aChangedNodes.insert(aChangedValueID);
- }
- OSL_ENSURE(!aChangedNodes.empty(), "Changes don't affect any nodes");
-
- if (aChangedNodes.size() == 1) OSL_TRACE("WARNING: Different changes all affect the same node !");
-
- return new MultiChangeBroadcaster_Impl(rLocalNotifier, aAffectedNodeID, aChangedNodes);
- }
- }
- // -----------------------------------------------------------------------------------------------
- void MultiChangeBroadcaster_Impl::doQueryConstraints(configuration::NodeChangesInformation const& aChanges)
- {
- std::vector< configuration::NodeChangeInformation >::const_iterator const stop = aChanges.end(), last = stop-1;
-
- for (std::vector< configuration::NodeChangeInformation >::const_iterator it = aChanges.begin(); it != stop; ++it)
- {
- OSL_ENSURE( m_aChangingNodes.find( it->location.getChangingValueID() ) != m_aChangingNodes.end(), "Broadcasting unanticipated change");
-
- querySingleConstraint(*it, it != last);
- }
-
- }
- // -----------------------------------------------------------------------------------------------
- void MultiChangeBroadcaster_Impl::doNotifyListeners(configuration::NodeChangesInformation const& aChanges)
- {
- uno::Sequence< css::beans::PropertyChangeEvent > aPropertyEvents(aChanges.size());
-
- css::beans::PropertyChangeEvent * const pEventStart = aPropertyEvents.getArray();
- css::beans::PropertyChangeEvent * pEventNext = pEventStart;
-
- std::vector< configuration::NodeChangeInformation >::const_iterator const stop = aChanges.end(), last = stop-1;
-
- for (std::vector< configuration::NodeChangeInformation >::const_iterator it = aChanges.begin(); it != stop; ++it)
- {
- // #92463# Skip nodes that are not in the tree
- if (it->location.getAffectedNodeID().isEmpty()) continue;
-
- OSL_ENSURE( m_aChangingNodes.find( it->location.getChangingValueID() ) != m_aChangingNodes.end(), "Broadcasting unanticipated change");
-
- notifySingleChange(*it, it != last, pEventNext);
- }
-
- sal_Int32 nPropertyEvents = pEventNext-pEventStart;
-
- if (nPropertyEvents > 0)
- {
- OSL_ASSERT(nPropertyEvents <= aPropertyEvents.getLength());
- if (nPropertyEvents != aPropertyEvents.getLength())
- aPropertyEvents.realloc(nPropertyEvents);
-
- uno::Reference< css::beans::XPropertiesChangeListener > const * const SelectListener = 0;
-
- vos::ORef<NotifierImpl> pNotifierImpl = getNotifierData().first;
-
- cppu::OInterfaceContainerHelper* pContainer = pNotifierImpl->m_aListeners.getContainer( getNodeIndex(), getCppuType(SelectListener) );
-
- if (pContainer)
- {
- ListenerContainerIterator< css::beans::XPropertiesChangeListener > aIterator(*pContainer);
- UnoApiLockReleaser aGuardReleaser;
- while (aIterator.hasMoreElements())
- try { aIterator.next()->propertiesChange(aPropertyEvents); } catch (uno::Exception & ) {}
- }
- }
- }
- // -----------------------------------------------------------------------------------------------
- // TreeLocalBroadcaster_Impl
- // -----------------------------------------------------------------------------------------------
-
- SingleTreeBroadcaster_Impl::SingleTreeBroadcaster_Impl(
- NotifierSet::value_type const& aTreeNotifierData,
- std::vector< vos::ORef<NodeLocalBroadcaster_Impl> >& aBroadcasters
- )
- : Broadcaster::Impl(aTreeNotifierData)
- , m_aBroadcasters()
- {
- m_aBroadcasters.swap(aBroadcasters);
- }
-
- // -----------------------------------------------------------------------------------------------
-
- bool SingleTreeBroadcaster_Impl::selectChanges(configuration::NodeChangesInformation& rSelected, configuration::NodeChangesInformation const& aOriginal, configuration::NodeID const& aSelector)
- {
- OSL_ASSERT(rSelected.empty()); // nothing in there yet
-
- for (std::vector< configuration::NodeChangeInformation >::const_iterator it = aOriginal.begin(); it != aOriginal.end(); ++it)
- {
- if ( it->location.getAffectedNodeID() == aSelector )
- {
- rSelected.push_back(*it);
- }
- }
- return !rSelected.empty();
- }
- // -----------------------------------------------------------------------------------------------
-
- vos::ORef< Broadcaster::Impl > SingleTreeBroadcaster_Impl::create(
- NotifierSet::value_type const& rRootNotifier,
- NotifierSet::value_type const& rLocalNotifier,
- configuration::NodeChangesInformation const& aChanges)
- {
- std::set< configuration::NodeID > aNodes;
- for (std::vector< configuration::NodeChangeInformation >::const_iterator itChanges = aChanges.begin(); itChanges != aChanges.end(); ++itChanges)
- {
- OSL_ENSURE(itChanges->hasValidLocation(), "ERROR: Invalid Change Location for Broadcaster");
-
- configuration::NodeID aAffectedNodeID = itChanges->location.getAffectedNodeID();
- if (!aAffectedNodeID.isEmpty())
- aNodes.insert(aAffectedNodeID);
- }
-
- std::vector< vos::ORef<NodeLocalBroadcaster_Impl> > aNodecasters;
- for (std::set< configuration::NodeID >::const_iterator itNodes = aNodes.begin(); itNodes != aNodes.end(); ++itNodes)
- {
- OSL_ASSERT(itNodes->isValidNode()); // filtered empty ones above
-
- configuration::NodeChangesInformation aSelectedChanges;
- if ( selectChanges(aSelectedChanges, aChanges, *itNodes))
- {
- NodeLocalBroadcaster_Impl* pSelectedImpl = MultiChangeBroadcaster_Impl::create(rLocalNotifier, *itNodes, aSelectedChanges);
- if (pSelectedImpl)
- aNodecasters.push_back(pSelectedImpl);
- }
- }
-
- if (aNodecasters.empty())
- return 0;
-
- else if (aNodecasters.size() == 1)
- return aNodecasters.begin()->getBodyPtr();
-
- else
- return new SingleTreeBroadcaster_Impl(rRootNotifier, aNodecasters);
- }
- // -----------------------------------------------------------------------------------------------
- void SingleTreeBroadcaster_Impl::doQueryConstraints(configuration::NodeChangesInformation const& aChanges)
- {
- for(std::vector< vos::ORef<NodeLocalBroadcaster_Impl> >::iterator it = m_aBroadcasters.begin(); it != m_aBroadcasters.end(); ++it)
- {
- configuration::NodeChangesInformation aSelectedInfos;
- if ( selectChanges(aSelectedInfos, aChanges, (*it)->getAffectedNodeID()) )
- (*it)->queryConstraints(aSelectedInfos);
- }
- }
- // -----------------------------------------------------------------------------------------------
- void SingleTreeBroadcaster_Impl::doNotifyListeners(configuration::NodeChangesInformation const& aChanges)
- {
- for(std::vector< vos::ORef<NodeLocalBroadcaster_Impl> >::iterator it = m_aBroadcasters.begin(); it != m_aBroadcasters.end(); ++it)
- {
- configuration::NodeChangesInformation aSelectedInfos;
- if ( selectChanges(aSelectedInfos, aChanges, (*it)->getAffectedNodeID()) )
- (*it)->notifyListeners(aSelectedInfos);
- }
- }
- // -----------------------------------------------------------------------------------------------
- // MultiTreeBroadcaster_Impl
- // -----------------------------------------------------------------------------------------------
- MultiTreeBroadcaster_Impl::MultiTreeBroadcaster_Impl(NotifierSet::value_type const& aRootSelector, std::vector< vos::ORef< Broadcaster::Impl > >& aBroadcasters)
- : Broadcaster::Impl(aRootSelector)
- , m_aBroadcasters()
- {
- m_aBroadcasters.swap(aBroadcasters);
- }
-
- // -----------------------------------------------------------------------------------------------
-
- bool MultiTreeBroadcaster_Impl::selectChanges(configuration::NodeChangesInformation& rSelected, configuration::NodeChangesInformation const& aOriginal, NotifierSet::value_type const& aSelector)
- {
- OSL_ASSERT(aSelector.first.isValid());
- OSL_ASSERT(aSelector.second.is());
-
- OSL_ASSERT(rSelected.empty()); // nothing in there yet
-
- rtl::Reference< configuration::Tree > const aSelectedTree( aSelector.second->getTree() );
-
- for (std::vector< configuration::NodeChangeInformation >::const_iterator it = aOriginal.begin(); it != aOriginal.end(); ++it)
- {
- if (it->location.getAffectedTreeRef() == aSelectedTree)
- {
- rSelected.push_back(*it);
- }
- }
- return !rSelected.empty();
- }
- // -------------------------------------------------------------------------------------------
-
- vos::ORef< Broadcaster::Impl > MultiTreeBroadcaster_Impl::create(NotifierSet::value_type const& rRootNotifier, NotifierSet const& rNotifiers, configuration::NodeChangesInformation const& aChanges)
- {
- std::vector< vos::ORef< Broadcaster::Impl > > aTreecasters;
- for (NotifierSet::const_iterator it = rNotifiers.begin(); it != rNotifiers.end(); ++it)
- {
- configuration::NodeChangesInformation aSelectedChanges;
- if ( selectChanges(aSelectedChanges, aChanges, *it))
- {
- vos::ORef< Broadcaster::Impl > pSelectedImpl = SingleTreeBroadcaster_Impl::create(rRootNotifier, *it, aSelectedChanges);
- if (pSelectedImpl.isValid())
- aTreecasters.push_back(pSelectedImpl);
- }
- }
-
- if (aTreecasters.empty())
- return 0;
-
- else if (aTreecasters.size() == 1)
- return *aTreecasters.begin();
-
- else
- return new MultiTreeBroadcaster_Impl(rRootNotifier, aTreecasters);
- }
- // -------------------------------------------------------------------------------------------
-
- void MultiTreeBroadcaster_Impl::doQueryConstraints(configuration::NodeChangesInformation const& aChanges)
- {
- for(std::vector< vos::ORef< Broadcaster::Impl > >::iterator it = m_aBroadcasters.begin(); it != m_aBroadcasters.end(); ++it)
- {
- configuration::NodeChangesInformation aSelectedInfos;
- if ( selectChanges(aSelectedInfos, aChanges, (*it)->getNotifierData()) )
- (*it)->queryConstraints(aSelectedInfos);
- }
- }
- // -------------------------------------------------------------------------------------------
-
- void MultiTreeBroadcaster_Impl::doNotifyListeners(configuration::NodeChangesInformation const& aChanges)
- {
- for(std::vector< vos::ORef< Broadcaster::Impl > >::iterator it = m_aBroadcasters.begin(); it != m_aBroadcasters.end(); ++it)
- {
- configuration::NodeChangesInformation aSelectedInfos;
- if ( selectChanges(aSelectedInfos, aChanges, (*it)->getNotifierData()) )
- (*it)->notifyListeners(aSelectedInfos);
- }
- }
- // -----------------------------------------------------------------------------------------------
- }
-// ---------------------------------------------------------------------------------------------------
-
- vos::ORef< Broadcaster::Impl > Broadcaster::Impl::create(vos::ORef<NotifierImpl> const& rNotifierImpl, ApiTreeRef const& pTreeImpl, configuration::NodeChange const& aChange, bool bLocal)
- {
- OSL_ASSERT(pTreeImpl.is());
-
- vos::ORef< Broadcaster::Impl > pRet;
-
- configuration::NodeChangeLocation aLocation;
- if (aChange.getChangeLocation(aLocation))
- {
- if (bLocal)
- {
- pRet = SingleChangeBroadcaster_Impl::create( NotifierSet::value_type(rNotifierImpl,pTreeImpl), aLocation);
- }
- else
- {
- NotifierSet::value_type aAffectedNotifier( findNotifier(aLocation, pTreeImpl) );
- if (aAffectedNotifier.second.is()) // only if we found a notifier we are able to create a broadcaster (DG)
- pRet = SingleChangeBroadcaster_Impl::create( aAffectedNotifier, aLocation);
- }
- }
- else
- {
- OSL_ENSURE(false, "Invalid change location set in node change - cannot broadcast");
- // can't create a matching change - must still create an empty one
- }
-
- if (pRet.isEmpty())
- pRet = EmptyBroadcaster_Impl::create( NotifierSet::value_type(rNotifierImpl,pTreeImpl) );
-
- return pRet;
- }
-// ---------------------------------------------------------------------------------------------------
-
- vos::ORef< Broadcaster::Impl > Broadcaster::Impl::create(vos::ORef<NotifierImpl> const& rNotifierImpl, ApiTreeRef const& pTreeImpl, configuration::NodeChanges const& aChanges, bool bLocal)
- {
- NotifierSet::value_type aRootData(rNotifierImpl, pTreeImpl);
-
- configuration::NodeChangesInformation aChangeInfos;
- if (aChanges.getChangesInfos(aChangeInfos))
- {
- return create(rNotifierImpl,pTreeImpl,aChangeInfos,bLocal);
- }
- else
- {
- OSL_ENSURE(aChanges.isEmpty(), "Cannot get information for changes - cannot notify");
-
- // make an empty one below
- vos::ORef< Broadcaster::Impl > pRet = EmptyBroadcaster_Impl::create( aRootData );
-
- return pRet;
- }
-
- }
-// ---------------------------------------------------------------------------------------------------
-
- vos::ORef< Broadcaster::Impl > Broadcaster::Impl::create(vos::ORef<NotifierImpl> const& rNotifierImpl, ApiTreeRef const& pTreeImpl, configuration::NodeChangeInformation const& aChange, bool bLocal)
- {
- OSL_ASSERT(pTreeImpl.is());
-
- vos::ORef< Broadcaster::Impl > pRet;
-
- if (aChange.hasValidLocation())
- {
- if (bLocal)
- {
- pRet = SingleChangeBroadcaster_Impl::create( NotifierSet::value_type(rNotifierImpl,pTreeImpl), aChange.location);
- }
- else
- {
- NotifierSet::value_type aAffectedNotifier( findNotifier(aChange.location, pTreeImpl) );
- if (aAffectedNotifier.second.is()) // only if we found a notifier we are able to create a broadcaster (DG)
- pRet = SingleChangeBroadcaster_Impl::create( aAffectedNotifier, aChange.location);
- }
- }
- else
- {
- OSL_ENSURE(false, "Invalid change location set in node change - cannot broadcast");
- // can't create a matching change - must still create an empty one
- }
-
- if (pRet.isEmpty())
- pRet = EmptyBroadcaster_Impl::create( NotifierSet::value_type(rNotifierImpl,pTreeImpl) );
-
- return pRet;
- }
-// ---------------------------------------------------------------------------------------------------
-
- vos::ORef< Broadcaster::Impl > Broadcaster::Impl::create(vos::ORef<NotifierImpl> const& rNotifierImpl, ApiTreeRef const& pTreeImpl, configuration::NodeChangesInformation const& aChanges, bool bLocal)
- {
- vos::ORef< Broadcaster::Impl > pRet;
-
- NotifierSet::value_type aRootData(rNotifierImpl, pTreeImpl);
-
- if (aChanges.size() == 1)
- {
- pRet = create(rNotifierImpl, pTreeImpl, *aChanges.begin(), bLocal);
- }
- else if (bLocal)
- {
- pRet = MultiChangeBroadcaster_Impl::create( aRootData, aChanges);
- }
- else
- {
- NotifierSet aNotifiers;
- findNotifiers( aNotifiers, aChanges, pTreeImpl);
-
- if (aNotifiers.size() > 1)
- {
- pRet = MultiTreeBroadcaster_Impl::create(aRootData, aNotifiers, aChanges);
- }
- else if (!aNotifiers.empty())
- {
- pRet = SingleTreeBroadcaster_Impl::create(aRootData, *aNotifiers.begin(), aChanges);
- }
- // else: empty
- }
-
- if (pRet.isEmpty())
- pRet = EmptyBroadcaster_Impl::create( aRootData );
-
- return pRet;
- }
-// ---------------------------------------------------------------------------------------------------
-
- bool Broadcaster::Impl::translateChanges(configuration::NodeChangesInformation& _rInfos, configuration::NodeChanges const& aChanges, bool /*bSingleBase*/) const
- {
- rtl::Reference< configuration::Tree > aBaseTree = m_aNotifierData.second->getTree();
- Factory& rFactory = m_aNotifierData.second->getFactory();
-
- configuration::NodeChangesInformation aRawInfos;
-
- sal_uInt32 nChanges = aChanges.getChangesInfos(aRawInfos);
-
- OSL_ENSURE(nChanges, "Cannot get info(s) for change - skipping for notification");
- OSL_ENSURE(nChanges == aRawInfos.size(), "Incorrect change count returned");
-
- configuration::NodeChangesInformation aNewInfos;
- aNewInfos.reserve(nChanges);
-
- for (std::vector< configuration::NodeChangeInformation >::const_iterator pos = aRawInfos.begin(); pos != aRawInfos.end(); ++pos)
- {
- configuration::NodeChangeInformation aInfo = *pos;
- if( !configapi::rebaseChange(aInfo.location,aBaseTree) )
- {
- OSL_TRACE("Change is not within expected tree - skipping for notification");
- continue;
- }
-
- OSL_ENSURE(!pos->isEmptyChange(), "Empty Change Found for Notification");
- // it actually is expected that elements may not be found - thus ignoring result
- configapi::resolveToUno(aInfo.change, rFactory);
-
- aNewInfos.push_back( aInfo );
- }
-
- aNewInfos.swap(_rInfos);
-
- return !_rInfos.empty();
- }
-
-// ---------------------------------------------------------------------------------------------------
-
- bool Broadcaster::Impl::translateChanges(configuration::NodeChangesInformation& aInfos, configuration::NodeChangesInformation const& aChanges, bool /*bSingleBase*/) const
- {
- configuration::NodeChangesInformation aNewInfos;
- aNewInfos.reserve( aChanges.size() );
-
- rtl::Reference< configuration::Tree > aBaseTree = m_aNotifierData.second->getTree();
- Factory& rFactory = m_aNotifierData.second->getFactory();
-
- for (std::vector< configuration::NodeChangeInformation >::const_iterator it = aChanges.begin(); it != aChanges.end(); ++it)
- {
- configuration::NodeChangeInformation aInfo(*it);
- if( !configapi::rebaseChange(aInfo.location,aBaseTree) )
- {
- OSL_TRACE("Change is not within expected tree - skipping for notification");
- continue;
- }
-
- if( !configapi::resolveToUno(aInfo.change,rFactory) )
- {
- // it actually is expected that elements may not be found
- // OSL_TRACE("Cannot find affected elements of Change");
- }
-
- aNewInfos.push_back( aInfo );
- }
-
- aNewInfos.swap(aInfos);
- return !aInfos.empty();
- }
-
-// ---------------------------------------------------------------------------------------------------
- void Broadcaster::Impl::notifyRootListeners(configuration::NodeChangesInformation const& aChanges)
- {
- if (aChanges.empty()) return;
-
- ApiTreeRef pRootTree( m_aNotifierData.second->getRootTreeImpl() );
- if (pRootTree.is())
- {
- vos::ORef<NotifierImpl> aRootNotifier = BroadcasterHelper::getImpl(pRootTree->getNotifier());
- if (aRootNotifier.isValid())
- {
- uno::Reference< css::util::XChangesListener > const * const pSelect = 0;
-
- configuration::NodeID aNotifiedNode = makeRootID( pRootTree );
-
- if (cppu::OInterfaceContainerHelper* pContainer = aRootNotifier->m_aListeners.getContainer(aNotifiedNode.toIndex(), ::getCppuType(pSelect)) )
- {
- css::util::ChangesEvent aEvent;
- aEvent.Source = pRootTree->getUnoInstance();
-
- uno::Reference<uno::XInterface> xBaseInstance = m_aNotifierData.second->getUnoInstance();
- aEvent.Base <<= xBaseInstance;
-
- // translate and collect the changes
- aEvent.Changes.realloc(aChanges.size());
- css::util::ElementChange* pChange = aEvent.Changes.getArray();
-
- for (std::vector< configuration::NodeChangeInformation >::const_iterator it = aChanges.begin(); it != aChanges.end(); ++it)
- {
- fillChangeFromResolved(*pChange, *it);
- ++pChange;
- }
-
- // now notify
- ListenerContainerIterator< css::util::XChangesListener > aIter(*pContainer);
-
- UnoApiLockReleaser aGuardReleaser;
- while (aIter.hasMoreElements())
- try { aIter.next()->changesOccurred(aEvent); } catch (uno::Exception & ) {}
- }
- }
- }
- }
-
-// ---------------------------------------------------------------------------------------------------
-// class Broadcaster
-// ---------------------------------------------------------------------------------------------------
-Broadcaster::Broadcaster(Notifier const& aNotifier, configuration::NodeChange const& aChange, bool bLocal)
-: m_pImpl( Impl::create(aNotifier.m_aImpl,ApiTreeRef(aNotifier.m_pTree),aChange,bLocal) )
-{
- OSL_ASSERT(m_pImpl.isValid());
-}
-// ---------------------------------------------------------------------------------------------------
-Broadcaster::Broadcaster(Notifier const& aNotifier, configuration::NodeChanges const& aChanges, bool bLocal)
-: m_pImpl( Impl::create(aNotifier.m_aImpl,ApiTreeRef(aNotifier.m_pTree),aChanges,bLocal) )
-{
- OSL_ASSERT(m_pImpl.isValid());
-}
-// ---------------------------------------------------------------------------------------------------
-Broadcaster::Broadcaster(Notifier const& aNotifier, configuration::NodeChangesInformation const& aChanges, bool bLocal)
-: m_pImpl( Impl::create(aNotifier.m_aImpl,ApiTreeRef(aNotifier.m_pTree),aChanges,bLocal) )
-{
- OSL_ASSERT(m_pImpl.isValid());
-}
-// ---------------------------------------------------------------------------------------------------
-
-Broadcaster::Broadcaster(Broadcaster const& aOther)
-: m_pImpl(aOther.m_pImpl)
-{
- OSL_ASSERT(m_pImpl.isValid());
-}
-// ---------------------------------------------------------------------------------------------------
-
-Broadcaster::~Broadcaster()
-{
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Broadcaster::queryConstraints(configuration::NodeChange const& aChange) throw(beans::PropertyVetoException)
-{
- OSL_ENSURE(aChange.isChange(),"Constraint query without a change !");
-
- configuration::NodeChanges aChanges;
- aChanges.add(aChange);
- this->queryConstraints(aChanges,true);
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Broadcaster::queryConstraints(configuration::NodeChanges const& aChanges, bool bSingleBase) throw(beans::PropertyVetoException)
-{
- OSL_ENSURE(!aChanges.isEmpty(),"Constraint query without a change !");
-
- try
- {
- configuration::NodeChangesInformation aInfos;
- if (m_pImpl->translateChanges(aInfos,aChanges,bSingleBase))
- {
- m_pImpl->queryConstraints(aInfos);
- }
- }
- catch (beans::PropertyVetoException & )
- {
- throw;
- }
- catch (uno::Exception & )
- {
- OSL_ENSURE(false, "configmgr::Broadcaster: Unexpected UNO exception in notifyListeners");
- }
- catch (configuration::Exception & )
- {
- OSL_ENSURE(false, "configmgr::Broadcaster: Unexpected internal exception in notifyListeners");
- }
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Broadcaster::notifyListeners(configuration::NodeChange const& aChange) throw()
-{
- OSL_ENSURE(aChange.isChange(),"Notifying without a change !");
-
- configuration::NodeChanges aChanges;
- aChanges.add(aChange);
- this->notifyListeners(aChanges, true);
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Broadcaster::notifyListeners(configuration::NodeChanges const& aChanges, bool bSingleBase) throw()
-{
- OSL_ENSURE(!aChanges.isEmpty(),"Notifying without a change !");
-
- try
- {
- configuration::NodeChangesInformation aInfos;
- if (m_pImpl->translateChanges(aInfos,aChanges, bSingleBase))
- {
- m_pImpl->notifyListeners(aInfos);
- m_pImpl->notifyRootListeners(aInfos);
- }
- }
- catch (uno::Exception & )
- {
- OSL_ENSURE(false, "configmgr::Broadcaster: Unexpected UNO exception in notifyListeners");
- }
- catch (configuration::Exception & )
- {
- OSL_ENSURE(false, "configmgr::Broadcaster: Unexpected internal exception in notifyListeners");
- }
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Broadcaster::notifyListeners(configuration::NodeChangesInformation const& aChanges, bool bSingleBase) throw()
-{
- OSL_ENSURE(!aChanges.empty(),"Notifying without a change !");
-
- try
- {
- configuration::NodeChangesInformation aInfos;
- if (m_pImpl->translateChanges(aInfos,aChanges, bSingleBase))
- {
- m_pImpl->notifyListeners(aInfos);
- m_pImpl->notifyRootListeners(aInfos);
- }
- }
- catch (uno::Exception & )
- {
- OSL_ENSURE(false, "configmgr::Broadcaster: Unexpected UNO exception in notifyListeners");
- }
- catch (configuration::Exception & )
- {
- OSL_ENSURE(false, "configmgr::Broadcaster: Unexpected internal exception in notifyListeners");
- }
-}
-// ---------------------------------------------------------------------------------------------------
- }
-}
diff --git a/configmgr/source/api2/broadcaster.hxx b/configmgr/source/api2/broadcaster.hxx
deleted file mode 100644
index a97294334f..0000000000
--- a/configmgr/source/api2/broadcaster.hxx
+++ /dev/null
@@ -1,88 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_BROADCASTER_HXX_
-#define CONFIGMGR_API_BROADCASTER_HXX_
-
-#include <com/sun/star/beans/PropertyVetoException.hpp>
-
-#include <vos/ref.hxx>
-
-namespace configmgr
-{
- namespace configuration
- {
-// ---------------------------------------------------------------------------------------------------
- class NodeChange;
- class NodeChanges;
- class NodeChangeInformation;
- class NodeChangesInformation;
- }
-// ---------------------------------------------------------------------------------------------------
- namespace configapi
- {
- class Notifier;
-
- namespace css = ::com::sun::star;
-// ---------------------------------------------------------------------------------------------------
-
- /// broadcasts events for changes to a single config node or several sibling nodes
- class Broadcaster
- {
- public:
- /// construct a broadcaster
- Broadcaster(Notifier const& aNotifier, configuration::NodeChange const& aChange, bool bLocal);
- Broadcaster(Notifier const& aNotifier, configuration::NodeChanges const& aChanges, bool bLocal);
- Broadcaster(Notifier const& aNotifier, configuration::NodeChangesInformation const& aChanges, bool bLocal);
- Broadcaster(Broadcaster const& aOther);
- ~Broadcaster();
-
- /// give all property veto listeners on the affected node a chance to veto
- void queryConstraints(configuration::NodeChange const& aChange) throw(css::beans::PropertyVetoException);
- /// give all property veto listeners on any of the affected nodes a chance to veto
- void queryConstraints(configuration::NodeChanges const& aChanges, bool bSingleBase = true) throw(css::beans::PropertyVetoException);
-
- /// notify all listeners which are affected by this change
- void notifyListeners(configuration::NodeChange const& aChange) throw();
- /// notify all listeners which are affected by any of these changes (potentially from many different bases)
- void notifyListeners(configuration::NodeChanges const& aChanges, bool bSingleBase) throw();
- /// notify all listeners which are affected by any of these changes (potentially from many different bases)
- void notifyListeners(configuration::NodeChangesInformation const& aChanges, bool bSingleBase = false) throw();
-
- class Impl;
- private:
- vos::ORef<Impl> m_pImpl;
- private:
- void operator=(Broadcaster const& aOther);
- };
-
-// ---------------------------------------------------------------------------------------------------
-
- }
-}
-
-#endif // CONFIGMGR_API_BROADCASTER_HXX_
diff --git a/configmgr/source/api2/committer.cxx b/configmgr/source/api2/committer.cxx
deleted file mode 100644
index 77d0de310f..0000000000
--- a/configmgr/source/api2/committer.cxx
+++ /dev/null
@@ -1,130 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-#include "committer.hxx"
-#include "apitreeimplobj.hxx"
-#include "providerimpl.hxx"
-#include "roottree.hxx"
-#include "treechangelist.hxx"
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace configapi
- {
-//-----------------------------------------------------------------------------
-namespace
-{
- //-------------------------------------------------------------------------
- struct NotifyDisabler
- {
- ApiRootTreeImpl& m_rTree;
- bool m_bOldState;
-
- NotifyDisabler(ApiRootTreeImpl& rTree)
- : m_rTree(rTree)
- , m_bOldState(rTree .enableNotification(false) )
- {
- }
-
- ~NotifyDisabler()
- {
- m_rTree.enableNotification(m_bOldState);
- }
- };
- //-------------------------------------------------------------------------
-}
-
-//-----------------------------------------------------------------------------
-// class Committer
-//-----------------------------------------------------------------------------
-
-Committer::Committer(ApiRootTreeImpl& rTree)
-: m_rTree(rTree)
-{}
-//-----------------------------------------------------------------------------
-
-OProviderImpl * Committer::getUpdateProvider()
-{
- return &m_rTree.getApiTree().getProvider().getProviderImpl();
-}
-
-//-----------------------------------------------------------------------------
-void Committer::commit()
-{
- ApiTreeImpl& rApiTree = m_rTree.getApiTree();
-
- OSL_PRECOND(!m_rTree.getLocation().isRoot(),"INTERNAL ERROR: Empty location used.");
- OSL_PRECOND(m_rTree.getOptions().isValid(),"INTERNAL ERROR: Invalid Options used.");
-
- if (!m_rTree.getOptions().isValid()) return;
-
- RequestOptions aOptions = m_rTree.getOptions()->getRequestOptions();
-
- OProviderImpl * pUpdateProvider = getUpdateProvider();
- OSL_ASSERT(pUpdateProvider);
-
- rtl::Reference< configuration::Tree > aTree( rApiTree.getTree());
- if (!aTree->hasChanges()) return;
-
- TreeChangeList aChangeList(aOptions,
- aTree->getRootPath(),
- aTree->getAttributes(aTree->getRootNode()));
-
- // now do the commit
- configuration::CommitHelper aHelper(rApiTree.getTree());
- if (aHelper.prepareCommit(aChangeList))
- try
- {
- pUpdateProvider->updateTree(aChangeList);
-
- aHelper.finishCommit(aChangeList);
-
- NotifyDisabler aDisableNotify(m_rTree); // do not notify self
- pUpdateProvider->saveAndNotifyUpdate(aChangeList);
- }
- catch(...)
- {
- // should be a special clean-up routine, but for now we just need a consistent state
- try
- {
- aHelper.failedCommit(aChangeList);
- }
- catch(configuration::Exception&)
- {
- OSL_ENSURE(false, "Cleanup really should not throw");
- }
- throw;
- }
-}
-//-----------------------------------------------------------------------------
- }
-}
-
diff --git a/configmgr/source/api2/committer.hxx b/configmgr/source/api2/committer.hxx
deleted file mode 100644
index 622374ea78..0000000000
--- a/configmgr/source/api2/committer.hxx
+++ /dev/null
@@ -1,57 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_COMMITTER_HXX_
-#define CONFIGMGR_API_COMMITTER_HXX_
-
-namespace configmgr
-{
- class OProviderImpl;
-//-----------------------------------------------------------------------------
- namespace configapi
- {
-//-----------------------------------------------------------------------------
-
- class ApiRootTreeImpl;
-//-----------------------------------------------------------------------------
-
- /// allows to update values of a simple type within a <type>NodeRef</type> that refers to a Group
- class Committer
- {
- ApiRootTreeImpl& m_rTree;
- public:
- Committer(ApiRootTreeImpl& rTree);
-
- void commit();
- private:
- OProviderImpl * getUpdateProvider();
- };
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_API_COMMITTER_HXX_
diff --git a/configmgr/source/api2/confignotifier.cxx b/configmgr/source/api2/confignotifier.cxx
deleted file mode 100644
index 98ef092f70..0000000000
--- a/configmgr/source/api2/confignotifier.cxx
+++ /dev/null
@@ -1,243 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "confignotifier.hxx"
-
-#include "notifierimpl.hxx"
-#include "broadcaster.hxx"
-
-#include "noderef.hxx"
-#include "valueref.hxx"
-#include "nodechange.hxx"
-
-#include "apinodeaccess.hxx"
-#include "apitreeaccess.hxx"
-#include "apitreeimplobj.hxx"
-
-#include <set>
-#include <functional>
-
-namespace configmgr
-{
- namespace configapi
- {
-// ---------------------------------------------------------------------------------------------------
-// class Notifier (-Impl)
-// ---------------------------------------------------------------------------------------------------
-
-Notifier::Notifier(vos::ORef<NotifierImpl> const& aImpl,ApiTreeImpl const* pTree)
-: m_aImpl(aImpl)
-, m_pTree(pTree)
-{
- OSL_ENSURE(aImpl.isValid(),"Invalid initialization of a Notifier: No impl");
- OSL_ENSURE(pTree,"Invalid initialization of a Notifier: No tree");
-}
-// ---------------------------------------------------------------------------------------------------
-
-Notifier::Notifier(Notifier const& aOther)
-: m_aImpl(aOther.m_aImpl)
-, m_pTree(aOther.m_pTree)
-{
-}
-// ---------------------------------------------------------------------------------------------------
-
-Notifier::~Notifier()
-{
-}
-// ---------------------------------------------------------------------------------------------------
-
-Broadcaster Notifier::makeBroadcaster(configuration::NodeChange const& aChange, bool bLocal) const
-{
- return Broadcaster(*this,aChange,bLocal);
-}
-// ---------------------------------------------------------------------------------------------------
-
-Broadcaster Notifier::makeBroadcaster(configuration::NodeChanges const& aChanges, bool bLocal) const
-{
- OSL_ENSURE(!aChanges.isEmpty(),"Creating broadcaster for no changes");
- return Broadcaster(*this,aChanges,bLocal);
-}
-// ---------------------------------------------------------------------------------------------------
-
-NotifierImpl::NotifierImpl(rtl::Reference< configuration::Tree > const& aTree)
-: m_aListeners(aTree->nodeCount(), SubNodeToIndex(aTree))
-{
-}
-// ---------------------------------------------------------------------------------------------------
-
-NotifierImpl::~NotifierImpl()
-{
-}
-
-// ---------------------------------------------------------------------------------------------------
-
-void Notifier::add(configuration::NodeRef const& aNode, uno::Reference< css::lang::XEventListener > const& xListener) const
-{
- if (xListener.is())
- m_aImpl->add( configuration::NodeID(m_pTree->getTree(),aNode), xListener );
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Notifier::add(configuration::NodeRef const& aNode, uno::Reference< css::container::XContainerListener > const& xListener) const
-{
- if (xListener.is())
- m_aImpl->add( configuration::NodeID(m_pTree->getTree(),aNode), xListener );
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Notifier::add(configuration::NodeRef const& aNode, uno::Reference< css::util::XChangesListener > const& xListener) const
-{
- if (xListener.is())
- m_aImpl->add( configuration::NodeID(m_pTree->getTree(),aNode), xListener );
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Notifier::addForAll(configuration::NodeRef const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener) const
-{
- if (xListener.is())
- m_aImpl->addForAll( configuration::NodeID(m_pTree->getTree(),aNode), xListener );
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Notifier::addForOne(configuration::NodeRef const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener, rtl::OUString const& aName) const
-{
- if (xListener.is())
- m_aImpl->addNamed( configuration::SubNodeID(m_pTree->getTree(),aNode, aName), xListener );
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Notifier::addForAll(configuration::NodeRef const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener) const
-{
- if (xListener.is())
- m_aImpl->addForAll( configuration::NodeID(m_pTree->getTree(),aNode), xListener );
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Notifier::addForOne(configuration::NodeRef const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener, rtl::OUString const& aName) const
-{
- if (xListener.is())
- m_aImpl->addNamed( configuration::SubNodeID(m_pTree->getTree(),aNode, aName), xListener );
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Notifier::add(configuration::NodeRef const& aNode, uno::Reference< css::beans::XPropertiesChangeListener > const& xListener, uno::Sequence<rtl::OUString> const& aNames) const
-{
- if (xListener.is())
- {
- if (aNames.getLength() > 0)
- m_aImpl->add( configuration::NodeID(m_pTree->getTree(),aNode), xListener, aNames);
- else
- m_aImpl->add( configuration::NodeID(m_pTree->getTree(),aNode), xListener );
- }
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Notifier::remove(configuration::NodeRef const& aNode, uno::Reference< css::lang::XEventListener > const& xListener) const
-{
- if (xListener.is())
- m_aImpl->remove( configuration::NodeID(m_pTree->getTree(),aNode), xListener );
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Notifier::remove(configuration::NodeRef const& aNode, uno::Reference< css::container::XContainerListener > const& xListener) const
-{
- if (xListener.is())
- m_aImpl->remove( configuration::NodeID(m_pTree->getTree(),aNode), xListener );
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Notifier::remove(configuration::NodeRef const& aNode, uno::Reference< css::util::XChangesListener > const& xListener) const
-{
- if (xListener.is())
- m_aImpl->remove( configuration::NodeID(m_pTree->getTree(),aNode), xListener );
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Notifier::removeForAll(configuration::NodeRef const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener) const
-{
- if (xListener.is())
- m_aImpl->removeForAll( configuration::NodeID(m_pTree->getTree(),aNode), xListener );
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Notifier::removeForOne(configuration::NodeRef const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener, rtl::OUString const& aName) const
-{
- if (xListener.is())
- m_aImpl->removeNamed( configuration::SubNodeID(m_pTree->getTree(),aNode, aName), xListener );
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Notifier::removeForAll(configuration::NodeRef const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener) const
-{
- if (xListener.is())
- m_aImpl->removeForAll( configuration::NodeID(m_pTree->getTree(),aNode), xListener );
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Notifier::removeForOne(configuration::NodeRef const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener, rtl::OUString const& aName) const
-{
- if (xListener.is())
- m_aImpl->removeNamed( configuration::SubNodeID(m_pTree->getTree(),aNode, aName), xListener );
-}
-// ---------------------------------------------------------------------------------------------------
-
-void Notifier::remove(configuration::NodeRef const& aNode, uno::Reference< css::beans::XPropertiesChangeListener > const& xListener) const
-{
- if (xListener.is())
- m_aImpl->remove( configuration::NodeID(m_pTree->getTree(),aNode), xListener );
-}
-
-// ---------------------------------------------------------------------------------------------------
-// ---------------------------------------------------------------------------------------------------
-
-DisposeGuardImpl::DisposeGuardImpl(Notifier const&) throw()
-{
-}
-// ---------------------------------------------------------------------------------------------------
-DisposeGuardImpl::~DisposeGuardImpl() throw ()
-{
-}
-// ---------------------------------------------------------------------------------------------------
-GuardedNotifier::GuardedNotifier(NodeAccess& rNode) throw()
-: m_aNotifier(rNode.getNotifier())
-, m_aImpl(m_aNotifier)
-{
-}
-// ---------------------------------------------------------------------------------------------------
-
-DisposeGuard::DisposeGuard(NodeAccess& rNode) throw(css::lang::DisposedException)
-: m_aImpl(rNode.getNotifier())
-{
- rNode.checkAlive();
-}
-// ---------------------------------------------------------------------------------------------------
- }
-}
-
diff --git a/configmgr/source/api2/confignotifier.hxx b/configmgr/source/api2/confignotifier.hxx
deleted file mode 100644
index 9bc5b20584..0000000000
--- a/configmgr/source/api2/confignotifier.hxx
+++ /dev/null
@@ -1,197 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CONFIGNOTIFIER_HXX_
-#define CONFIGMGR_CONFIGNOTIFIER_HXX_
-
-#include "configexcept.hxx"
-#include "configpath.hxx"
-#include "datalock.hxx"
-#include "utility.hxx"
-#include <boost/utility.hpp>
-#include <vos/ref.hxx>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/uno/Sequence.hxx>
-
-namespace com { namespace sun { namespace star {
- namespace beans
- {
- class XPropertyChangeListener;
- class XVetoableChangeListener;
- class XPropertiesChangeListener;
- class PropertyVetoException;
- }
- namespace lang
- {
- class XEventListener;
- struct EventObject;
- }
- namespace container { class XContainerListener; }
- namespace util { class XChangesListener; }
- namespace uno { class RuntimeException; }
-} } }
-namespace osl { class Mutex; }
-
-namespace configmgr
-{
- namespace configuration
- {
-// ---------------------------------------------------------------------------------------------------
- class NodeRef;
- class ValueRef;
- class NodeChange;
- class NodeChanges;
- }
-// ---------------------------------------------------------------------------------------------------
- namespace configapi
- {
-// ---------------------------------------------------------------------------------------------------
- class Broadcaster;
- class NotifierImpl;
- class ApiTreeImpl;
-
- namespace css = ::com::sun::star;
-// ---------------------------------------------------------------------------------------------------
- /// manages collections of event listeners observing a config tree, thread-safe
- class Notifier
- {
- friend class Broadcaster;
- friend class BroadcasterHelper;
- vos::ORef<NotifierImpl> m_aImpl;
- ApiTreeImpl const*const m_pTree;
- public:
- /// construct this around the given Implementation, for the given tree
- explicit Notifier(vos::ORef<NotifierImpl> const & aImpl, ApiTreeImpl const* pTree);
- Notifier(Notifier const& aOther);
- ~Notifier();
-
- // ---------------------------------------------------------------------------------------------------
- /// create a broadcaster for a single change (either local or (possibly) nested)
- Broadcaster makeBroadcaster(configuration::NodeChange const& aChange, bool bLocal) const;
- /// create a broadcaster for a collection of changes (either local or (possibly) nested)
- Broadcaster makeBroadcaster(configuration::NodeChanges const& aChange, bool bLocal) const;
-
- // ---------------------------------------------------------------------------------------------------
- bool checkAlive(uno::XInterface* pObject) const throw(css::lang::DisposedException);
-
- // ---------------------------------------------------------------------------------------------------
- /// Add a <type scope='com::sun::star::lang'>XEventListener</type> observing <var>aNode</var>.
- void add(configuration::NodeRef const& aNode, uno::Reference< css::lang::XEventListener > const& xListener) const;
-
- /// Add a <type scope='com::sun::star::container'>XContainerListener</type> observing <var>aNode</var>.
- void add(configuration::NodeRef const& aNode, uno::Reference< css::container::XContainerListener > const& xListener) const;
-
- /// Add a <type scope='com::sun::star::util'>XChangesListener</type> observing <var>aNode</var> and its descendants.
- void add(configuration::NodeRef const& aNode, uno::Reference< css::util::XChangesListener > const& xListener) const;
-
- /// Add a <type scope='com::sun::star::beans'>XPropertyChangeListener</type> observing all children of <var>aNode</var>.
- void addForAll(configuration::NodeRef const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener) const;
- /// Add a <type scope='com::sun::star::beans'>XPropertyChangeListener</type> observing only the child named <var>aName</var> of <var>aNode</var>.
- void addForOne(configuration::NodeRef const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener, rtl::OUString const& aName) const;
- /// Add a <type scope='com::sun::star::beans'>XVetoableChangeListener</type> constraining all children of <var>aNode</var>.
- void addForAll(configuration::NodeRef const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener) const;
- /// Add a <type scope='com::sun::star::beans'>XVetoableChangeListener</type> constraining only the child named <var>aName</var> of <var>aNode</var>.
- void addForOne(configuration::NodeRef const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener, rtl::OUString const& aName) const;
-
- /** Add a <type scope='com::sun::star::beans'>XPropertiesChangeListener</type>
- observing the properties of <var>aNode</var> (optimally only those given by <var>aNames</var>.
- */
- void add(configuration::NodeRef const& aNode, uno::Reference< css::beans::XPropertiesChangeListener > const& xListener, uno::Sequence<rtl::OUString> const& aNames) const;
-
- // ---------------------------------------------------------------------------------------------------
- /// Remove a <type scope='com::sun::star::lang'>XEventListener</type> observing <var>aNode</var>.
- void remove(configuration::NodeRef const& aNode, uno::Reference< css::lang::XEventListener > const& xListener) const;
-
- /// Remove a <type scope='com::sun::star::container'>XContainerListener</type> observing <var>aNode</var>.
- void remove(configuration::NodeRef const& aNode, uno::Reference< css::container::XContainerListener > const& xListener) const;
-
- /// Remove a <type scope='com::sun::star::util'>XChangesListener</type> observing <var>aNode</var> and its descendants.
- void remove(configuration::NodeRef const& aNode, uno::Reference< css::util::XChangesListener > const& xListener) const;
-
- /// Remove a <type scope='com::sun::star::beans'>XPropertyChangeListener</type> observing <var>aNode</var>.
- void removeForAll(configuration::NodeRef const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener) const;
- /// Remove a <type scope='com::sun::star::beans'>XPropertyChangeListener</type> observing the child named <var>aName</var> of <var>aNode</var>.
- void removeForOne(configuration::NodeRef const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener, rtl::OUString const& aName) const;
- /// Remove a <type scope='com::sun::star::beans'>XVetoableChangeListener</type> constraining <var>aNode</var>.
- void removeForAll(configuration::NodeRef const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener) const;
- /// Remove a <type scope='com::sun::star::beans'>XVetoableChangeListener</type> constraining the child named <var>aName</var> of <var>aNode</var>.
- void removeForOne(configuration::NodeRef const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener, rtl::OUString const& aName) const;
-
- /// Remove a <type scope='com::sun::star::beans'>XVetoableChangeListener</type> constraining <var>aNode</var>.
- void remove(configuration::NodeRef const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener) const;
- /** Remove a <type scope='com::sun::star::beans'>XPropertiesChangeListener</type>
- observing any properties of <var>aNode</var>.
- */
- void remove(configuration::NodeRef const& aNode, uno::Reference< css::beans::XPropertiesChangeListener > const& xListener) const;
- // ---------------------------------------------------------------------------------------------------
- private:
- void operator=(Notifier const& aOther);
- };
-// ---------------------------------------------------------------------------------------------------
-
-// Thin Wrappers around Notifiers: Provide guarding and convenient access
- // Guarding and locking implementations
- class NodeAccess;
- class TreeElement;
-
- /// guards a NodeAccess; provides a simple lock for non-data access, does not check for disposed state
- class DisposeGuardImpl: private boost::noncopyable
- {
- public:
- DisposeGuardImpl(Notifier const& rNotifier) throw();
- ~DisposeGuardImpl() throw ();
- };
-
- /// wraps a Notifier (from a node or tree); provides a simple lock for notifier access, does not check for disposed state
- class GuardedNotifier
- {
- UnoApiLock m_aLock;
- Notifier m_aNotifier;
- DisposeGuardImpl m_aImpl;
- public:
- GuardedNotifier(NodeAccess& rNode) throw();
- public:
- Notifier const& get() const { return m_aNotifier; }
-
- Notifier const& operator *() const { return get(); }
- Notifier const* operator->() const { return &get(); }
- };
-
- /// guards a Node or Tree provides a simple lock for non-data access, does (!) check for disposed state
- class DisposeGuard
- {
- DisposeGuardImpl m_aImpl;
- UnoApiLock m_aLock;
- public:
- DisposeGuard(NodeAccess& rNode) throw(css::lang::DisposedException);
- };
-
-// ---------------------------------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_CONFIGNOTIFIER_HXX_
diff --git a/configmgr/source/api2/elementaccess.cxx b/configmgr/source/api2/elementaccess.cxx
deleted file mode 100644
index 5ce9c08a13..0000000000
--- a/configmgr/source/api2/elementaccess.cxx
+++ /dev/null
@@ -1,486 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "elementaccess.hxx"
-
-#include "elementimpl.hxx"
-#include "apinotifierimpl.hxx"
-
-#include "apitreeaccess.hxx"
-
-//-----------------------------------------------------------------------------------
-namespace configmgr
-{
-//-----------------------------------------------------------------------------------
-
- namespace uno = com::sun::star::uno;
-
-//-----------------------------------------------------------------------------------
-// XInterface (but not method queryInterface)
-//-----------------------------------------------------------------------------------
-
-// acuire doesn't really do anything but forward. OTOH it should always be overridden when release() is
-void SAL_CALL BasicInnerElement ::acquire() throw() { cppu::WeakImplHelper3< css::container::XChild, css::container::XNamed, css::lang::XServiceInfo >::acquire(); }
-void SAL_CALL BasicSetElement ::acquire() throw() { cppu::WeakImplHelper6< css::container::XChild, css::container::XNamed, css::lang::XComponent, css::lang::XServiceInfo, css::configuration::XTemplateInstance, css::lang::XUnoTunnel >::acquire(); }
-void SAL_CALL BasicRootElement ::acquire() throw() { cppu::WeakImplHelper5< css::container::XNamed, css::util::XChangesNotifier, css::lang::XComponent, css::lang::XServiceInfo, css::lang::XLocalizable >::acquire(); }
-void SAL_CALL BasicUpdateElement::acquire() throw() { cppu::WeakImplHelper6< css::container::XNamed, css::util::XChangesNotifier, css::lang::XComponent, css::lang::XServiceInfo, css::lang::XLocalizable, css::util::XChangesBatch >::acquire(); }
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicInnerElement::release() throw()
-{
- // FIXME: this looks highly flaky wrt. weak-refs etc.
- bool bLastRef = (1 == m_refCount);
- if (bLastRef)
- {
- UnoApiLock::acquire();
- configapi::implDisposeObject( getNodeAccess(), getElementClass() );
- }
- cppu::WeakImplHelper3< css::container::XChild, css::container::XNamed, css::lang::XServiceInfo >::release();
- if (bLastRef)
- UnoApiLock::release();
-}
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicSetElement::release() throw()
-{
- // FIXME: this looks highly flaky wrt. weak-refs etc.
- bool bLastRef = (1 == m_refCount);
- if (bLastRef)
- {
- UnoApiLock::acquire();
- configapi::implDisposeObject( getNodeAccess(), getElementClass() );
- }
- cppu::WeakImplHelper6< css::container::XChild, css::container::XNamed, css::lang::XComponent, css::lang::XServiceInfo, css::configuration::XTemplateInstance, css::lang::XUnoTunnel >::release();
- if (bLastRef)
- UnoApiLock::release();
-}
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicRootElement::release() throw()
-{
- // FIXME: this looks highly flaky wrt. weak-refs etc.
- bool bLastRef = (1 == m_refCount);
- if (bLastRef)
- {
- UnoApiLock::acquire();
- configapi::implDisposeObject( getNodeAccess(), getElementClass() );
- }
- cppu::WeakImplHelper5< css::container::XNamed, css::util::XChangesNotifier, css::lang::XComponent, css::lang::XServiceInfo, css::lang::XLocalizable >::release();
- if (bLastRef)
- UnoApiLock::release();
-}
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateElement::release() throw()
-{
- // FIXME: this looks highly flaky wrt. weak-refs etc.
- bool bLastRef = (1 == m_refCount);
- if (bLastRef)
- {
- UnoApiLock::acquire();
- configapi::implDisposeObject( getNodeAccess(), getElementClass() );
- }
- cppu::WeakImplHelper6< css::container::XNamed, css::util::XChangesNotifier, css::lang::XComponent, css::lang::XServiceInfo, css::lang::XLocalizable, css::util::XChangesBatch >::release();
- if (bLastRef)
- UnoApiLock::release();
-}
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-// XTypeProvider (but not method getTypes)
-//-----------------------------------------------------------------------------------
-
-uno::Sequence<sal_Int8> SAL_CALL BasicInnerElement::getImplementationId( ) throw(uno::RuntimeException)
-{
- return configapi::implGetImplementationId( getNodeAccess(), getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-uno::Sequence<sal_Int8> SAL_CALL BasicSetElement::getImplementationId( ) throw(uno::RuntimeException)
-{
- return configapi::implGetImplementationId( getNodeAccess(), getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-uno::Sequence<sal_Int8> SAL_CALL BasicRootElement::getImplementationId( ) throw(uno::RuntimeException)
-{
- return configapi::implGetImplementationId( getNodeAccess(), getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-uno::Sequence<sal_Int8> SAL_CALL BasicUpdateElement::getImplementationId( ) throw(uno::RuntimeException)
-{
- return configapi::implGetImplementationId( getNodeAccess(), getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-// XChild (not for root elements)
-//-----------------------------------------------------------------------------------
-
-uno::Reference< uno::XInterface > SAL_CALL BasicInnerElement::getParent( ) throw(uno::RuntimeException)
-{
- return configapi::implGetParent( getNodeAccess(), getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-uno::Reference< uno::XInterface > SAL_CALL BasicSetElement::getParent( ) throw(uno::RuntimeException)
-{
- return configapi::implGetParent( getNodeAccess(), getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-void SAL_CALL BasicInnerElement::setParent( const uno::Reference< uno::XInterface >& xParent )
- throw(css::lang::NoSupportException, uno::RuntimeException)
-{
- configapi::implSetParent( getNodeAccess(), getElementClass(), xParent );
-}
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicSetElement::setParent( const uno::Reference< uno::XInterface >& xParent )
- throw(css::lang::NoSupportException, uno::RuntimeException)
-{
- configapi::implSetParent( getNodeAccess(), getElementClass(), xParent );
-}
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-// XNamed
-//-----------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL BasicInnerElement::getName( ) throw(uno::RuntimeException)
-{
- return configapi::implGetName( getNodeAccess(), getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL BasicSetElement::getName( ) throw(uno::RuntimeException)
-{
- return configapi::implGetName( getNodeAccess(), getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL BasicRootElement::getName( ) throw(uno::RuntimeException)
-{
- return configapi::implGetName( getNodeAccess(), getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL BasicUpdateElement::getName( ) throw(uno::RuntimeException)
-{
- return configapi::implGetName( getNodeAccess(), getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-void SAL_CALL BasicInnerElement::setName( const rtl::OUString& aName ) throw(uno::RuntimeException)
-{
- configapi::implSetName( getNodeAccess(), getElementClass(), aName );
-}
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicSetElement::setName( const rtl::OUString& aName ) throw(uno::RuntimeException)
-{
- configapi::implSetName( getNodeAccess(), getElementClass(), aName );
-}
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicRootElement::setName( const rtl::OUString& aName ) throw(uno::RuntimeException)
-{
- configapi::implSetName( getNodeAccess(), getElementClass(), aName );
-}
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateElement::setName( const rtl::OUString& aName ) throw(uno::RuntimeException)
-{
- configapi::implSetName( getNodeAccess(), getElementClass(), aName );
-}
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-// XChangesNotifier
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicRootElement::addChangesListener( const uno::Reference< css::util::XChangesListener >& xListener )
- throw(uno::RuntimeException)
-{
- configapi::implAddListener( getNodeAccess(), xListener );
-}
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateElement::addChangesListener( const uno::Reference< css::util::XChangesListener >& xListener )
- throw(uno::RuntimeException)
-{
- configapi::implAddListener( getNodeAccess(), xListener );
-}
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-void SAL_CALL BasicRootElement::removeChangesListener( const uno::Reference< css::util::XChangesListener >& xListener )
- throw(uno::RuntimeException)
-{
- configapi::implRemoveListener( getNodeAccess(), xListener );
-}
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateElement::removeChangesListener( const uno::Reference< css::util::XChangesListener >& xListener )
- throw(uno::RuntimeException)
-{
- configapi::implRemoveListener( getNodeAccess(), xListener );
-}
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-// XComponent
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicSetElement::dispose( ) throw(uno::RuntimeException)
-{
- configapi::implDispose( getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicRootElement::dispose( ) throw(uno::RuntimeException)
-{
- configapi::implDispose( getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateElement::dispose( ) throw(uno::RuntimeException)
-{
- configapi::implDispose( getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-void SAL_CALL BasicSetElement::addEventListener( const uno::Reference< css::lang::XEventListener >& xListener )
- throw(uno::RuntimeException)
-{
- configapi::implAddListener( getNodeAccess(), xListener );
-}
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicRootElement::addEventListener( const uno::Reference< css::lang::XEventListener >& xListener )
- throw(uno::RuntimeException)
-{
- configapi::implAddListener( getNodeAccess(), xListener );
-}
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateElement::addEventListener( const uno::Reference< css::lang::XEventListener >& xListener )
- throw(uno::RuntimeException)
-{
- configapi::implAddListener( getNodeAccess(), xListener );
-}
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-void SAL_CALL BasicSetElement::removeEventListener( const uno::Reference< css::lang::XEventListener >& xListener )
- throw(uno::RuntimeException)
-{
- configapi::implRemoveListener( getNodeAccess(), xListener );
-}
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicRootElement::removeEventListener( const uno::Reference< css::lang::XEventListener >& xListener )
- throw(uno::RuntimeException)
-{
- configapi::implRemoveListener( getNodeAccess(), xListener );
-}
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateElement::removeEventListener( const uno::Reference< css::lang::XEventListener >& xListener )
- throw(uno::RuntimeException)
-{
- configapi::implRemoveListener( getNodeAccess(), xListener );
-}
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-// XServiceInfo
-//-----------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL BasicInnerElement::getImplementationName( ) throw(uno::RuntimeException)
-{
- return configapi::implGetImplementationName( getNodeAccess(), getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL BasicSetElement::getImplementationName( ) throw(uno::RuntimeException)
-{
- return configapi::implGetImplementationName( getNodeAccess(), getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL BasicRootElement::getImplementationName( ) throw(uno::RuntimeException)
-{
- return configapi::implGetImplementationName( getNodeAccess(), getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL BasicUpdateElement::getImplementationName( ) throw(uno::RuntimeException)
-{
- return configapi::implGetImplementationName( getNodeAccess(), getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-sal_Bool SAL_CALL BasicInnerElement::supportsService( const rtl::OUString& ServiceName ) throw(uno::RuntimeException)
-{
- return configapi::implSupportsService( getNodeAccess(), getElementClass(), ServiceName );
-}
-//-----------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL BasicSetElement::supportsService( const rtl::OUString& ServiceName ) throw(uno::RuntimeException)
-{
- return configapi::implSupportsService( getNodeAccess(), getElementClass(), ServiceName );
-}
-//-----------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL BasicRootElement::supportsService( const rtl::OUString& ServiceName ) throw(uno::RuntimeException)
-{
- return configapi::implSupportsService( getNodeAccess(), getElementClass(), ServiceName );
-}
-//-----------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL BasicUpdateElement::supportsService( const rtl::OUString& ServiceName ) throw(uno::RuntimeException)
-{
- return configapi::implSupportsService( getNodeAccess(), getElementClass(), ServiceName );
-}
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-uno::Sequence< rtl::OUString > SAL_CALL BasicInnerElement::getSupportedServiceNames( ) throw(uno::RuntimeException)
-{
- return configapi::implGetSupportedServiceNames( getNodeAccess(), getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-uno::Sequence< rtl::OUString > SAL_CALL BasicSetElement::getSupportedServiceNames( ) throw(uno::RuntimeException)
-{
- return configapi::implGetSupportedServiceNames( getNodeAccess(), getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-uno::Sequence< rtl::OUString > SAL_CALL BasicRootElement::getSupportedServiceNames( ) throw(uno::RuntimeException)
-{
- return configapi::implGetSupportedServiceNames( getNodeAccess(), getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-uno::Sequence< rtl::OUString > SAL_CALL BasicUpdateElement::getSupportedServiceNames( ) throw(uno::RuntimeException)
-{
- return configapi::implGetSupportedServiceNames( getNodeAccess(), getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-// ONLY set elements
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-// XTemplateInstance
-//-----------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL BasicSetElement::getTemplateName( ) throw(uno::RuntimeException)
-{
- return configapi::implGetTemplateName( getElementClass() );
-}
-
-//-----------------------------------------------------------------------------------
-// XUnoTunnel
-//-----------------------------------------------------------------------------------
-
-sal_Int64 SAL_CALL BasicSetElement::getSomething( const uno::Sequence< sal_Int8 >& aIdentifier )
- throw(uno::RuntimeException)
-{
- return configapi::implGetSomething( getElementClass(), aIdentifier);
-}
-
-//-----------------------------------------------------------------------------------
-
-// ONLY root elements
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-// XLocalizable
-//-----------------------------------------------------------------------------------
-
-css::lang::Locale SAL_CALL BasicRootElement::getLocale( ) throw(uno::RuntimeException)
-{
- return configapi::implGetLocale( getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-css::lang::Locale SAL_CALL BasicUpdateElement::getLocale( ) throw(uno::RuntimeException)
-{
- return configapi::implGetLocale( getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-void SAL_CALL BasicRootElement::setLocale( const css::lang::Locale& eLocale ) throw(uno::RuntimeException)
-{
- configapi::implSetLocale( getElementClass(), eLocale );
-}
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateElement::setLocale( const css::lang::Locale& eLocale ) throw(uno::RuntimeException)
-{
- configapi::implSetLocale( getElementClass(), eLocale );
-}
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-// XChangesBatch (only on update root)
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateElement::commitChanges( ) throw(css::lang::WrappedTargetException, uno::RuntimeException)
-{
- configapi::implCommitChanges( getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL BasicUpdateElement::hasPendingChanges( ) throw(uno::RuntimeException)
-{
- return configapi::implHasPendingChanges( getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-uno::Sequence< css::util::ElementChange > SAL_CALL BasicUpdateElement::getPendingChanges( ) throw(uno::RuntimeException)
-{
- return configapi::implGetPendingChanges( getElementClass() );
-}
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-} // namespace configmgr
-
-
diff --git a/configmgr/source/api2/elementaccess.hxx b/configmgr/source/api2/elementaccess.hxx
deleted file mode 100644
index 0cabc3c035..0000000000
--- a/configmgr/source/api2/elementaccess.hxx
+++ /dev/null
@@ -1,383 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_ELEMENTACCESS_HXX_
-#define CONFIGMGR_API_ELEMENTACCESS_HXX_
-
-#include <com/sun/star/container/XChild.hpp>
-#include <com/sun/star/container/XNamed.hpp>
-#include <com/sun/star/configuration/XTemplateInstance.hpp>
-#include <com/sun/star/lang/XLocalizable.hpp>
-#include <com/sun/star/lang/XUnoTunnel.hpp>
-#include <com/sun/star/lang/XComponent.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/util/XChangesNotifier.hpp>
-#include <com/sun/star/util/XChangesBatch.hpp>
-#include <cppuhelper/implbase3.hxx>
-#include <cppuhelper/implbase5.hxx>
-#include <cppuhelper/implbase6.hxx>
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace css = ::com::sun::star;
- namespace uno = ::com::sun::star::uno;
-
-//-----------------------------------------------------------------------------
- namespace configapi
- {
- class NodeAccess;
- class InnerElement;
- class SetElement;
- class RootElement;
- class UpdateRootElement;
- }
-//-----------------------------------------------------------------------------
-
- /** implements the interfaces supported by a inner node
- within the configuration tree that is a plain node (group member).
- <p> Is an interface adapter around
- <type scope='configmgr::configapi'>NodeAccess</type> and
- <type scope='configmgr::configapi'>InnerElement</type>.</p>
- */
- class BasicInnerElement : public cppu::WeakImplHelper3< css::container::XChild, css::container::XNamed, css::lang::XServiceInfo >
- {
- protected:
- // Destructors
- virtual ~BasicInnerElement() {}
-
- public:
- // Interface methods
- // XInterface ('dispose' management) - partial implementation
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
-
- // XTypeProvider (from implhelper) - partial implementation
- virtual uno::Sequence<sal_Int8> SAL_CALL
- getImplementationId( )
- throw(uno::RuntimeException);
-
- // XChild
- virtual uno::Reference< uno::XInterface > SAL_CALL
- getParent( )
- throw(uno::RuntimeException);
-
- virtual void SAL_CALL // not supported
- setParent( const uno::Reference< uno::XInterface >& Parent )
- throw(css::lang::NoSupportException, css::uno::RuntimeException);
-
- // XNamed
- virtual rtl::OUString SAL_CALL
- getName( )
- throw(uno::RuntimeException);
-
- virtual void SAL_CALL // not supported (! - missing exception)
- setName( const rtl::OUString& aName )
- throw(uno::RuntimeException);
-
- // XServiceInfo
- virtual rtl::OUString SAL_CALL
- getImplementationName( )
- throw(uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- supportsService( const rtl::OUString& ServiceName )
- throw(uno::RuntimeException);
-
- virtual uno::Sequence< rtl::OUString > SAL_CALL
- getSupportedServiceNames( )
- throw(uno::RuntimeException);
-
- protected:
- virtual configapi::InnerElement& getElementClass() = 0;
- virtual configapi::NodeAccess& getNodeAccess() = 0;
- };
-//-----------------------------------------------------------------------------
-
- /** implements the interfaces supported by a node
- within the configuration tree that is a set element (or floating free).
- <p> Is an interface adapter around
- <type scope='configmgr::configapi'>NodeAccess</type> and
- <type scope='configmgr::configapi'>SetElement</type>.</p>
- */
- class BasicSetElement : public cppu::WeakImplHelper6< css::container::XChild, css::container::XNamed, css::lang::XComponent, css::lang::XServiceInfo, css::configuration::XTemplateInstance, css::lang::XUnoTunnel >
- {
- protected:
- // Destructors
- virtual ~BasicSetElement() {}
-
- public:
- // Interface methods
- // XInterface ('dispose' management) - partial implementation
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
-
- // XTypeProvider (from implhelper) - partial implementation
- virtual uno::Sequence<sal_Int8> SAL_CALL
- getImplementationId( )
- throw(uno::RuntimeException);
-
- // XChild
- virtual uno::Reference< uno::XInterface > SAL_CALL
- getParent( )
- throw(uno::RuntimeException);
-
- virtual void SAL_CALL // currently not supported
- setParent( const uno::Reference< uno::XInterface >& Parent )
- throw(css::lang::NoSupportException, css::uno::RuntimeException);
-
- // XNamed
- virtual rtl::OUString SAL_CALL
- getName( )
- throw(uno::RuntimeException);
-
- virtual void SAL_CALL // generally not supported (! - missing exception)
- setName( const rtl::OUString& aName )
- throw(uno::RuntimeException);
-
- // XComponent
- virtual void SAL_CALL
- dispose( )
- throw(uno::RuntimeException);
-
- virtual void SAL_CALL
- addEventListener( const uno::Reference< css::lang::XEventListener >& xListener )
- throw(uno::RuntimeException);
-
- virtual void SAL_CALL
- removeEventListener( const uno::Reference< css::lang::XEventListener >& aListener )
- throw(uno::RuntimeException);
-
- // XServiceInfo
- virtual rtl::OUString SAL_CALL
- getImplementationName( )
- throw(uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- supportsService( const rtl::OUString& ServiceName )
- throw(uno::RuntimeException);
-
- virtual uno::Sequence< rtl::OUString > SAL_CALL
- getSupportedServiceNames( )
- throw(uno::RuntimeException);
-
- // XTemplateInstance
- virtual rtl::OUString SAL_CALL
- getTemplateName( )
- throw(uno::RuntimeException);
-
- // XUnoTunnel
- virtual sal_Int64 SAL_CALL
- getSomething( const uno::Sequence< sal_Int8 >& aIdentifier )
- throw(uno::RuntimeException);
-
- protected:
- virtual configapi::SetElement& getElementClass() = 0;
- virtual configapi::NodeAccess& getNodeAccess() = 0;
- };
-//-----------------------------------------------------------------------------
-
- /** implements the interfaces supported by a node
- within the configuration that is the root of a read-only access
- <p> Is an interface adapter around
- <type scope='configmgr::configapi'>NodeAccess</type> and
- <type scope='configmgr::configapi'>SetElement</type>.</p>
- */
- class BasicRootElement : public cppu::WeakImplHelper5< css::container::XNamed, css::util::XChangesNotifier, css::lang::XComponent, css::lang::XServiceInfo, css::lang::XLocalizable >
- {
- protected:
- // Destructors
- virtual ~BasicRootElement() {}
-
- public:
- // Interface methods
- // XInterface ('dispose' management) - partial implementation
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
-
- // XTypeProvider (from implhelper) - partial implementation
- virtual uno::Sequence<sal_Int8> SAL_CALL
- getImplementationId( )
- throw(uno::RuntimeException);
-
- // XNamed
- virtual rtl::OUString SAL_CALL
- getName( )
- throw(uno::RuntimeException);
-
- virtual void SAL_CALL // generally not supported (! - missing exception)
- setName( const rtl::OUString& aName )
- throw(uno::RuntimeException);
-
- // XChangesNotifier
- virtual void SAL_CALL
- addChangesListener( const uno::Reference< css::util::XChangesListener >& xListener )
- throw(uno::RuntimeException);
-
- virtual void SAL_CALL
- removeChangesListener( const uno::Reference< css::util::XChangesListener >& xListener )
- throw(uno::RuntimeException);
-
- // XComponent
- virtual void SAL_CALL
- dispose( )
- throw(uno::RuntimeException);
-
- virtual void SAL_CALL
- addEventListener( const uno::Reference< css::lang::XEventListener >& xListener )
- throw(uno::RuntimeException);
-
- virtual void SAL_CALL
- removeEventListener( const uno::Reference< css::lang::XEventListener >& aListener )
- throw(uno::RuntimeException);
-
- // XServiceInfo
- virtual rtl::OUString SAL_CALL
- getImplementationName( )
- throw(uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- supportsService( const rtl::OUString& ServiceName )
- throw(uno::RuntimeException);
-
- virtual uno::Sequence< rtl::OUString > SAL_CALL
- getSupportedServiceNames( )
- throw(uno::RuntimeException);
-
- // XLocalizable
- virtual css::lang::Locale SAL_CALL
- getLocale( )
- throw(uno::RuntimeException);
-
- virtual void SAL_CALL // maybe not supported (! - missing exception)
- setLocale( const css::lang::Locale& eLocale )
- throw(uno::RuntimeException);
-
- protected:
- virtual configapi::RootElement& getElementClass() = 0;
- virtual configapi::NodeAccess& getNodeAccess() = 0;
- };
-//-----------------------------------------------------------------------------
-
- /** implements the interfaces supported by a node
- within the configuration that is the root of an update access
- <p> Is an interface adapter around
- <type scope='configmgr::configapi'>NodeAccess</type> and
- <type scope='configmgr::configapi'>SetElement</type>.</p>
- */
- class BasicUpdateElement : public cppu::WeakImplHelper6< css::container::XNamed, css::util::XChangesNotifier, css::lang::XComponent, css::lang::XServiceInfo, css::lang::XLocalizable, css::util::XChangesBatch >
- {
- protected:
- // Destructors
- virtual ~BasicUpdateElement() {}
-
- public:
- // Interface methods
- // XInterface ('dispose' management) - partial implementation
- virtual void SAL_CALL acquire() throw();
- virtual void SAL_CALL release() throw();
-
- // XTypeProvider (from implhelper) - partial implementation
- virtual uno::Sequence<sal_Int8> SAL_CALL
- getImplementationId( )
- throw(uno::RuntimeException);
-
- // XNamed
- virtual rtl::OUString SAL_CALL
- getName( )
- throw(uno::RuntimeException);
-
- virtual void SAL_CALL // generally not supported (! - missing exception)
- setName( const rtl::OUString& aName )
- throw(uno::RuntimeException);
-
- // XChangesNotifier
- virtual void SAL_CALL
- addChangesListener( const uno::Reference< css::util::XChangesListener >& xListener )
- throw(uno::RuntimeException);
-
- virtual void SAL_CALL
- removeChangesListener( const uno::Reference< css::util::XChangesListener >& xListener )
- throw(uno::RuntimeException);
-
- // XComponent
- virtual void SAL_CALL
- dispose( )
- throw(uno::RuntimeException);
-
- virtual void SAL_CALL
- addEventListener( const uno::Reference< css::lang::XEventListener >& xListener )
- throw(uno::RuntimeException);
-
- virtual void SAL_CALL
- removeEventListener( const uno::Reference< css::lang::XEventListener >& aListener )
- throw(uno::RuntimeException);
-
- // XServiceInfo
- virtual rtl::OUString SAL_CALL
- getImplementationName( )
- throw(uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- supportsService( const rtl::OUString& ServiceName )
- throw(uno::RuntimeException);
-
- virtual uno::Sequence< rtl::OUString > SAL_CALL
- getSupportedServiceNames( )
- throw(uno::RuntimeException);
-
- // XChangesBatch
- virtual void SAL_CALL
- commitChanges( )
- throw(css::lang::WrappedTargetException, uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- hasPendingChanges( )
- throw(uno::RuntimeException);
-
- virtual uno::Sequence< css::util::ElementChange > SAL_CALL
- getPendingChanges( )
- throw(uno::RuntimeException);
-
- // XLocalizable
- virtual css::lang::Locale SAL_CALL
- getLocale( )
- throw(uno::RuntimeException);
-
- virtual void SAL_CALL // maybe not supported (! - missing exception)
- setLocale( const css::lang::Locale& eLocale )
- throw(uno::RuntimeException);
-
- protected:
- virtual configapi::UpdateRootElement& getElementClass() = 0;
- virtual configapi::NodeAccess& getNodeAccess() = 0;
- };
-//-----------------------------------------------------------------------------
-}
-#endif // CONFIGMGR_API_ELEMENTACCESS_HXX_
-
-
diff --git a/configmgr/source/api2/elementimpl.cxx b/configmgr/source/api2/elementimpl.cxx
deleted file mode 100644
index e518103c63..0000000000
--- a/configmgr/source/api2/elementimpl.cxx
+++ /dev/null
@@ -1,588 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "elementimpl.hxx"
-#include "apitreeaccess.hxx"
-#include "apinodeaccess.hxx"
-#include "apifactory.hxx"
-#include "noderef.hxx"
-#include "nodechange.hxx"
-#include "nodechangeinfo.hxx"
-#include "translatechanges.hxx"
-#include "apitypes.hxx"
-#include "configset.hxx"
-#include "confignotifier.hxx"
-#include "confsvccomponent.hxx"
-#include "committer.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/container/XNameContainer.hpp>
-#include <com/sun/star/configuration/XTemplateContainer.hpp>
-#include <osl/diagnose.h>
-
-namespace configmgr
-{
- namespace configapi
- {
-//-----------------------------------------------------------------------------------
- namespace lang = css::lang;
- namespace util = css::util;
-
-//-----------------------------------------------------------------------------------
-
-// Interface methods
-//-----------------------------------------------------------------------------------
-
-// XChild
-//-----------------------------------------------------------------------------------
-
-uno::Reference< uno::XInterface > implGetParent(NodeAccess& rNode, InnerElement&) throw(uno::RuntimeException)
-{
- uno::Reference<uno::XInterface> xRet;
-
- try
- {
- GuardedNodeData<NodeAccess> impl( rNode ); // no provider lock needed - tree must be prebuilt already
-
- rtl::Reference< configuration::Tree > aTree(impl.getTree());
- configuration::NodeRef aParentNode = aTree->getParent(impl.getNode());
-
- uno::Any aAny = configapi::makeInnerElement( rNode.getFactory(), aTree, aParentNode );
-
- if (!(aAny >>= xRet)) // no parent available
- {
- OSL_ASSERT(!xRet.is()); // make sure we return NULL
- OSL_ENSURE(!aAny.hasValue(), "configmgr: BasicElement::getParent: could not extract parent - node is not an object");
- }
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- return xRet;
-}
-
-//-----------------------------------------------------------------------------------
-
-uno::Reference< uno::XInterface > implGetParent(NodeAccess& rNode, SetElement& /*rElement*/) throw(uno::RuntimeException)
-{
- uno::Reference<uno::XInterface> xRet;
-
- try
- {
- // assume shared lock for connected trees
- GuardedNodeData<NodeAccess> impl( rNode ); // no provider lock needed - tree must be prebuilt already
-
- rtl::Reference< configuration::Tree > aTree(impl.getTree());
-
- rtl::Reference< configuration::Tree > aParentTree( aTree->getContextTree() );
-
- if (!configuration::isEmpty(aParentTree.get()))
- {
- configuration::NodeRef aParentNode( aTree->getContextNodeRef() );
-
- // assume shared factory for connected trees
- uno::Any aAny = configapi::makeInnerElement( rNode.getFactory(), aParentTree, aParentNode );
-
- if (!(aAny >>= xRet)) // no parent available
- {
- // should occur only if the any is void
- OSL_ENSURE(!aAny.hasValue(), "configmgr: BasicSetElement::getParent: could not extract parent - node is not an object");
- OSL_ASSERT(!xRet.is()); // make sure we return NULL
- }
- }
- else
- {
- OSL_ASSERT(!xRet.is()); // make sure we return NULL
- }
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- return xRet;
-}
-//-----------------------------------------------------------------------------------
-
-// UNSUPPORTED method
-void implSetParent(NodeAccess& rNode, InnerElement& /*rElement*/, const uno::Reference< uno::XInterface >& /*xParent*/ )
- throw(lang::NoSupportException, uno::RuntimeException)
-{
- UnoApiLock aLock;
-
- rNode.checkAlive(); // Does locking internally, checks for disposed nodes
-
- // TODO(?): allow for xParent == getParent()
- throw lang::NoSupportException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("configmgr: BasicElement::setParent: cannot move Entry")),
- rNode.getUnoInstance() );
-}
-//-----------------------------------------------------------------------------------
-
-// preliminary implementation
-void implSetParent(NodeAccess& rNode, SetElement& rElement, const uno::Reference< uno::XInterface >& xParent )
- throw(lang::NoSupportException, uno::RuntimeException)
-{
- UnoApiLock aLock;
-
- //implSetParent(rNode,xParent);
- // TODO: lock the whole transaction ???? - would need Uno Tunneling ?
- uno::Reference< uno::XInterface > xGotParent( implGetParent(rNode,rElement) );
- uno::Reference< css::container::XNameContainer > xOldParent( xGotParent, uno::UNO_QUERY );
- uno::Reference< css::container::XNameContainer > xNewParent( xParent, uno::UNO_QUERY );
-
- if (xGotParent.is() && !xOldParent.is())
- {
- throw lang::NoSupportException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Config API: implSetParent: this is not element of a container")),
- rNode.getUnoInstance() );
- }
- if (xParent.is() && !xNewParent.is())
- {
- throw lang::NoSupportException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Config API: implSetParent: new parent is no container")),
- rNode.getUnoInstance() );
- }
-
- uno::Reference< uno::XInterface > xThis(rNode.getUnoInstance());
- OSL_ASSERT(xThis.is());
-
- if (xOldParent != xNewParent)
- {
- rtl::OUString const sName( implGetName(rNode,rElement) );
-
- if (xParent.is())
- {
- rtl::OUString const sTemplate( implGetTemplateName(rElement) );
-
- if (sTemplate.getLength() == 0)
- {
- throw lang::NoSupportException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Config API: implSetParent: object has no recognizable type")),
- xThis );
- }
-
- uno::Reference< css::configuration::XTemplateContainer > xNewTemplate( xParent, uno::UNO_QUERY );
- if (!xNewTemplate.is())
- {
- throw lang::NoSupportException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Config API: implSetParent: new parent has no element template")),
- xThis );
- }
-
- if ( sTemplate != xNewTemplate->getElementTemplateName())
- {
- throw lang::NoSupportException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Config API: implSetParent: object has wrong type")),
- xThis );
- }
-
- if ( xNewParent->hasByName( sName ) )
- {
- throw lang::NoSupportException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Config API: implSetParent: an object of this name already exists in new parent")),
- xThis );
- }
-
- // TODO: check for circularity (i.e. that This is not one of new parent's ancestors) !!
- }
-
- // now do it
-
- try
- {
- if ( xOldParent.is()) xOldParent->removeByName(sName);
- if ( xNewParent.is()) xNewParent->insertByName(sName, uno::makeAny(xThis));
- }
- catch (uno::Exception& e)
- {
- e.Message = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Config API: implSetParent: changing parent failed: "))
- += e.Message;
-
- if (xOldParent.is())
- try
- {
- xOldParent->insertByName(sName, uno::makeAny(xThis));
- }
- catch(uno::Exception& bad)
- {
- e.Message += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n\t ! Could not restore old parent: ")) += bad.Message;
- }
-
- throw uno::RuntimeException(e.Message,xThis);
- }
-
- }
-}
-//-----------------------------------------------------------------------------
-
-
-// XNamed
-//-----------------------------------------------------------------------------
-rtl::OUString implGetName(NodeAccess& rNode, NodeElement& ) throw(uno::RuntimeException)
-{
- rtl::OUString sRet;
- try
- {
- GuardedNodeData<NodeAccess> impl( rNode ); // maybe passive only ?
-
- rtl::Reference< configuration::Tree > aTree(impl.getTree());
- configuration::NodeRef aNode(impl.getNode());
-
- sRet = aTree->getSimpleNodeName(aNode.getOffset());
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- return sRet;
-}
-//-----------------------------------------------------------------------------
-
-// UNSUPPORTED method
-void implSetName(NodeAccess & rNode, NodeElement& /*rElement*/, const rtl::OUString& /*aName*/ ) throw(uno::RuntimeException)
-{
- UnoApiLock aLock;
-
- rNode.checkAlive(); // Does locking internally, checks for disposed nodes
-
- // TODO(?): allow for aName == getName()
- throw uno::RuntimeException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("configmgr: BasicElement::setName: cannot rename Entry")),
- rNode.getUnoInstance() );
-}
-//-----------------------------------------------------------------------------
-
-// TODO: Implementations for elements to be added to a container node
-void implSetName(NodeAccess& rNode, SetElement& rElement, const rtl::OUString& aName ) throw(uno::RuntimeException)
-{
- UnoApiLock aLock;
-
- // TODO: Implement
- NodeElement& rDelegate = rElement;
- implSetName(rNode,rDelegate,aName); // delegate to unsupported version
-}
-//-----------------------------------------------------------------------------
-
-// XComponent & XInterface
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-
-void implDispose( SetElement& rElement) throw(uno::RuntimeException)
-{
- UnoApiLock aLock;
-
- if (!rElement.disposeTree(false))
- {
- throw uno::RuntimeException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CONFIGURATION: Can't dispose an object that has an owner")),
- rElement.getUnoInstance() );
- }
-}
-//-----------------------------------------------------------------------------
-
-void implDispose( RootElement& rElement) throw(uno::RuntimeException)
-{
- UnoApiLock aLock;
-
- if (!rElement.disposeTree())
- {
- throw lang::DisposedException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CONFIGURATION: Can't dispose an object that already was disposed")),
- rElement.getUnoInstance() );
- }
-}
-//-----------------------------------------------------------------------------
-
-void implDisposeObject( NodeAccess& ,SetElement& rElement) throw(uno::RuntimeException)
-{
- UnoApiLock aLock;
-// FIXME: should we hold a ref on the element over this ?
-// call apitreeaccess.hxx (doGetUnoInterface) & hold a ref / unref ?
-// [or!] - call getApiTree & ref/unref on that ?
-// [or!] - hold the ref inside the dispose method itself ...
- rElement.disposeTree(true);
-}
-//-----------------------------------------------------------------------------
-
-void implDisposeObject( NodeAccess& , RootElement& rElement) throw(uno::RuntimeException)
-{
- UnoApiLock aLock;
-
- rElement.disposeTree();
-}
-//-----------------------------------------------------------------------------
-
-void implDisposeObject( NodeAccess& rNode, InnerElement& ) throw(uno::RuntimeException)
-{
- UnoApiLock aLock;
-
- rNode.disposeNode();
-}
-//-----------------------------------------------------------------------------
-
-
-// XTypeProvider
-//-----------------------------------------------------------------------------
-
-uno::Sequence<sal_Int8> implGetImplementationId(NodeAccess& rNode, NodeElement& rElement)
- throw(uno::RuntimeException)
-{
- DisposeGuard aLock(rNode);
- ServiceImplementationInfo const* pInfo = rElement.getServiceInfo();
-
- OSL_ENSURE(pInfo, "Configuration: Object has no implementation (service) info - cannot get implementation id");
- if (!pInfo)
- throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CONFIGURATION: Object has no implementation information - cannot get implementation id")),rElement.getUnoInstance() );
-
- return ServiceComponentImpl::getStaticImplementationId(pInfo);
-}
-//-----------------------------------------------------------------------------
-
-// XServiceInfo
-//-----------------------------------------------------------------------------
-
-rtl::OUString implGetImplementationName( NodeAccess& rNode, NodeElement& rElement ) throw(uno::RuntimeException)
-{
- DisposeGuard aLock(rNode);
- ServiceImplementationInfo const* pInfo = rElement.getServiceInfo();
- OSL_ENSURE(pInfo, "Configuration: Object has no service info");
-
- return ServiceInfoHelper(pInfo).getImplementationName();
-}
-//-----------------------------------------------------------------------------
-
-sal_Bool implSupportsService( NodeAccess& rNode, NodeElement& rElement, const rtl::OUString& ServiceName ) throw(uno::RuntimeException)
-{
- DisposeGuard aLock(rNode);
- ServiceImplementationInfo const* pInfo = rElement.getServiceInfo();
- OSL_ENSURE(pInfo, "Configuration: Object has no service info");
-
- return ServiceInfoHelper(pInfo).supportsService(ServiceName);
-}
-//-----------------------------------------------------------------------------
-
-uno::Sequence< rtl::OUString > implGetSupportedServiceNames( NodeAccess& rNode, NodeElement& rElement ) throw(uno::RuntimeException)
-{
- DisposeGuard aLock(rNode);
- ServiceImplementationInfo const* pInfo = rElement.getServiceInfo();
- OSL_ENSURE(pInfo, "Configuration: Object has no service info");
-
- return ServiceInfoHelper(pInfo).getSupportedServiceNames();
-}
-//-----------------------------------------------------------------------------
-
-// Root only ------------------------------------------------------------------
-
-// XLocalizable
-// TODO: Implement locale support
-//-----------------------------------------------------------------------------
-
-lang::Locale implGetLocale( RootElement& rElement ) throw(uno::RuntimeException)
-{
- GuardedRootElement aLocked(rElement);
-
- OSL_ENSURE(false,"CONFIGURATION: Locale information is not yetsupported.");
- return lang::Locale();
-}
-//-----------------------------------------------------------------------------
-
-void implSetLocale( RootElement& rElement, const css::lang::Locale& /*eLocale*/ ) throw(uno::RuntimeException)
-{
- UnoApiLock aLock;
- // TODO: Implement if possible
- rElement.checkAlive();
-
- OSL_ENSURE(false,"CONFIGURATION: Changing the set Locale is not supported.");
- throw uno::RuntimeException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CONFIGURATION: Changing the locale is currently not supported")),
- rElement.getUnoInstance()
- );
-}
-//-----------------------------------------------------------------------------
-
-// XChangesBatch
-//-----------------------------------------------------------------------------
-
-void implCommitChanges( UpdateRootElement& rElement ) throw(css::lang::WrappedTargetException, uno::RuntimeException)
-{
- UnoApiLock aLock;
-
- // quick check to avoid big locks for nothing (has its own locking)
- if (!implHasPendingChanges(rElement)) return;
-
- try
- {
- rElement.getCommitter().commit();
- }
-
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rElement.getUnoInstance() );
- e.unhandled();
- }
-
- // filter/wrap uno::Exceptions
- catch (lang::WrappedTargetException& ) { throw; }
- catch (uno::RuntimeException& ) { throw; }
- catch (uno::Exception& ex)
- {
- uno::Reference<uno::XInterface> xContext( rElement.getUnoInstance() );
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration: can't commit Changes: ") );
- throw lang::WrappedTargetException( sMessage += ex.Message, xContext, uno::makeAny(ex));
- }
-}
-//-----------------------------------------------------------------------------
-
-sal_Bool implHasPendingChanges( RootElement& rElement ) throw(uno::RuntimeException)
-{
- try
- {
- GuardedRootElement aLocked(rElement);
- return aLocked.get().getTree()->hasChanges();
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rElement.getUnoInstance() );
- e.unhandled();
- }
-
- OSL_ENSURE(false,"Unreachable Code");
- return false;
-}
-//-----------------------------------------------------------------------------
-
-uno::Sequence< css::util::ElementChange > implGetPendingChanges( RootElement& rElement )
- throw(uno::RuntimeException)
-{
- std::vector<css::util::ElementChange> aResult;
- try
- {
- GuardedRootElement aLocked(rElement);
-
- rtl::Reference< configuration::Tree > aTree( aLocked.get().getTree() );
-
- configuration::NodeChangesInformation aInfos;
-
- {
- configuration::NodeChanges aChanges;
- if (aTree->collectChanges(aChanges))
- {
- aChanges.getChangesInfos(aInfos);
- }
- }
-
- Factory& rFactory = rElement.getFactory();
-
- for(std::vector< configuration::NodeChangeInformation >::const_iterator it = aInfos.begin(), stop = aInfos.end();
- it != stop;
- ++it)
- {
- css::util::ElementChange aChange;
- fillChange(aChange,*it,aTree,rFactory);
- aResult.push_back(aChange);
- }
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rElement.getUnoInstance() );
- e.unhandled();
- }
-
- return makeSequence(aResult);
-}
-//-----------------------------------------------------------------------------
-
-// Set only -------------------------------------------------------------------------
-
-// XTemplateInstance
-//-----------------------------------------------------------------------------------
-
-rtl::OUString implGetTemplateName(SetElement& rElement)
- throw(uno::RuntimeException)
-{
- try
- {
- GuardedTreeElement aLocked(rElement);
- return rElement.getTemplateInfo()->getPathString();
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rElement.getUnoInstance() );
- e.unhandled();
- }
-
- OSL_ENSURE(false,"Unreachable Code");
- return rtl::OUString();
-}
-//-----------------------------------------------------------------------------------
-
-// XUnoTunnel
-//-----------------------------------------------------------------------------------
-sal_Int64 implGetSomething(SetElement& rElement, const uno::Sequence< sal_Int8 >& aIdentifier )
- throw(uno::RuntimeException)
-{
- sal_Int64 nSomething = 0;
- try
- {
- GuardedTreeElement aLocked(rElement);
-
- if (!rElement.getFactory().tunnelSetElement(nSomething, rElement, aIdentifier))
- OSL_ASSERT(nSomething == 0);
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rElement.getUnoInstance() );
- e.unhandled();
- }
-
- return nSomething;
-}
-//-----------------------------------------------------------------------------------
-
- } // namespace configapi
-
-} // namespace configmgr
-
-
diff --git a/configmgr/source/api2/elementimpl.hxx b/configmgr/source/api2/elementimpl.hxx
deleted file mode 100644
index 763bab61b4..0000000000
--- a/configmgr/source/api2/elementimpl.hxx
+++ /dev/null
@@ -1,157 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_ELEMENTIMPL_HXX_
-#define CONFIGMGR_API_ELEMENTIMPL_HXX_
-
-#include <com/sun/star/container/XChild.hpp>
-#include <com/sun/star/container/XNamed.hpp>
-#include <com/sun/star/configuration/XTemplateInstance.hpp>
-#include <com/sun/star/lang/XLocalizable.hpp>
-#include <com/sun/star/util/XChangesBatch.hpp>
-
-namespace configmgr
-{
- namespace css = ::com::sun::star;
- namespace uno = ::com::sun::star::uno;
-
- /* implementations of the interfaces supported by a (parent) node
- within the configuration tree.
- (read-only operation)
- */
- namespace configapi
- {
- //-------------------------------------------------------------------------
- class NodeAccess;
- class NodeElement;
- class InnerElement;
- class TreeElement;
- class SetElement;
- class RootElement;
- class UpdateRootElement;
- //-------------------------------------------------------------------------
-
- // XComponent and XInterface (EOL handling)
- //---------------------------------------------------------------------
- void implDispose( SetElement& rElement)
- throw(uno::RuntimeException);
-
- void implDispose( RootElement& rElement)
- throw(uno::RuntimeException);
-
- void implDisposeObject( NodeAccess& aNode, SetElement& rElement)
- throw(uno::RuntimeException);
-
- void implDisposeObject( NodeAccess& aNode, RootElement& rElement)
- throw(uno::RuntimeException);
-
- void implDisposeObject( NodeAccess& aNode, InnerElement& rElement)
- throw(uno::RuntimeException);
-
- // XTypeProvider
- //---------------------------------------------------------------------
- uno::Sequence<sal_Int8> implGetImplementationId(NodeAccess& rNode, NodeElement& rElement ) throw(uno::RuntimeException);
-
- // XChild
- //---------------------------------------------------------------------
- uno::Reference< uno::XInterface > implGetParent(NodeAccess& rNode, InnerElement& rElement)
- throw(uno::RuntimeException);
-
- uno::Reference< uno::XInterface > implGetParent(NodeAccess& rNode, SetElement& rElement)
- throw(uno::RuntimeException);
-
- void implSetParent(NodeAccess& rNode, InnerElement& rElement, const uno::Reference< uno::XInterface >& Parent ) // generally not supported
- throw(css::lang::NoSupportException, css::uno::RuntimeException);
-
- void implSetParent(NodeAccess& rNode, SetElement& rElement, const uno::Reference< uno::XInterface >& Parent ) // maybe supported
- throw(css::lang::NoSupportException, css::uno::RuntimeException);
-
- // XNamed
- //---------------------------------------------------------------------
- rtl::OUString implGetName(NodeAccess& rNode, NodeElement& rElement)
- throw(uno::RuntimeException);
-
- void implSetName(NodeAccess& rNode, NodeElement& rElement, const rtl::OUString& aName ) // generally not supported (! - missing exception)
- throw(uno::RuntimeException);
-
- void implSetName(NodeAccess& rNode, SetElement& rElement, const rtl::OUString& aName ) // maybe supported
- throw(uno::RuntimeException);
-
- // XServiceInfo
- //---------------------------------------------------------------------
- rtl::OUString implGetImplementationName( NodeAccess& rNode, NodeElement& rElement )
- throw(uno::RuntimeException);
-
- sal_Bool implSupportsService( NodeAccess& rNode, NodeElement& rElement, const rtl::OUString& ServiceName )
- throw(uno::RuntimeException);
-
- uno::Sequence< rtl::OUString > implGetSupportedServiceNames( NodeAccess& rNode, NodeElement& rElement )
- throw(uno::RuntimeException);
-
- // Root only only
- //-------------------------------------------------------------------------
-
- // XLocalizable
- //---------------------------------------------------------------------
-
- css::lang::Locale implGetLocale( RootElement& rElement )
- throw(uno::RuntimeException);
-
- void implSetLocale( RootElement& rElement, const css::lang::Locale& eLocale )
- throw(uno::RuntimeException);
-
- // XChangesBatch
- //---------------------------------------------------------------------
-
- void implCommitChanges( UpdateRootElement& rElement )
- throw(css::lang::WrappedTargetException, uno::RuntimeException);
-
- sal_Bool implHasPendingChanges( RootElement& rElement )
- throw(uno::RuntimeException);
-
- uno::Sequence< css::util::ElementChange > implGetPendingChanges( RootElement& rElement )
- throw(uno::RuntimeException);
-
- // Set only
- //-------------------------------------------------------------------------
- // XTemplateInstance
- //---------------------------------------------------------------------
- rtl::OUString implGetTemplateName(SetElement& rElement)
- throw(uno::RuntimeException);
-
- // XUnoTunnel
- //---------------------------------------------------------------------
- sal_Int64 implGetSomething(SetElement& rElement, const uno::Sequence< sal_Int8 >& aIdentifier )
- throw(uno::RuntimeException);
-
- //-------------------------------------------------------------------------
- }
-
-}
-#endif // CONFIGMGR_API_BASEACCESSIMPL_HXX_
-
-
diff --git a/configmgr/source/api2/groupaccess.cxx b/configmgr/source/api2/groupaccess.cxx
deleted file mode 100644
index ccc77374b4..0000000000
--- a/configmgr/source/api2/groupaccess.cxx
+++ /dev/null
@@ -1,144 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "groupaccess.hxx"
-#include "accessimpl.hxx"
-#include "apinotifierimpl.hxx"
-#include "apinodeaccess.hxx"
-
-namespace configmgr
-{
-
-// XHierarchicalName
-//------------------------------------------------------------------------------------------------------------------
-rtl::OUString SAL_CALL BasicGroupAccess::getHierarchicalName( ) throw(uno::RuntimeException)
-{
- return configapi::implGetHierarchicalName( getNode() );
-}
-
-//------------------------------------------------------------------------------------------------------------------
-rtl::OUString SAL_CALL BasicGroupAccess::composeHierarchicalName( const rtl::OUString& sRelativeName )
- throw(css::lang::IllegalArgumentException, css::lang::NoSupportException, uno::RuntimeException)
-{
- return configapi::implComposeHierarchicalName( getNode(), sRelativeName );
-}
-
-//------------------------------------------------------------------------------------------------------------------
-
-// XElementAccess, base class of XNameAccess (and XHierarchicalNameAccess ? )
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-uno::Type SAL_CALL BasicGroupAccess::getElementType( ) throw(uno::RuntimeException)
-{
- return configapi::implGetElementType( getNode() );
-}
-
-//-----------------------------------------------------------------------------------
-sal_Bool SAL_CALL BasicGroupAccess::hasElements( ) throw(uno::RuntimeException)
-{
- return configapi::implHasElements( getNode() );
-}
-
-// XExactName
-//-----------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL BasicGroupAccess::getExactName( const rtl::OUString& rApproximateName ) throw(uno::RuntimeException)
-{
- return configapi::implGetExactName( getNode(), rApproximateName);
-}
-
-// XProperty
-//-----------------------------------------------------------------------------------
-
-css::beans::Property SAL_CALL BasicGroupAccess::getAsProperty( ) throw(uno::RuntimeException)
-{
- return configapi::implGetAsProperty( getNode() );
-}
-
-// XNameAccess
-//-----------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL BasicGroupAccess::hasByName( const rtl::OUString& sName ) throw(uno::RuntimeException)
-{
- return configapi::implHasByName( getNode(), sName);
-}
-
-//-----------------------------------------------------------------------------------
-uno::Any SAL_CALL BasicGroupAccess::getByName( const rtl::OUString& sName )
- throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException)
-{
- return configapi::implGetByName( getNode(), sName );
-}
-
-//-----------------------------------------------------------------------------------
-uno::Sequence< rtl::OUString > SAL_CALL BasicGroupAccess::getElementNames( ) throw( uno::RuntimeException)
-{
- return configapi::implGetElementNames( getNode() );
-}
-
-// XHierarchicalNameAccess
-//-----------------------------------------------------------------------------------
-sal_Bool SAL_CALL BasicGroupAccess::hasByHierarchicalName( const rtl::OUString& sName ) throw(uno::RuntimeException)
-{
- return configapi::implHasByHierarchicalName( getNode(), sName);
-}
-
-//-----------------------------------------------------------------------------------
-uno::Any SAL_CALL BasicGroupAccess::getByHierarchicalName( const rtl::OUString& sName )
- throw(css::container::NoSuchElementException, uno::RuntimeException)
-{
- return configapi::implGetByHierarchicalName( getNode(), sName );
-}
-
-
-// XContainer
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicGroupAccess::addContainerListener( const uno::Reference< css::container::XContainerListener >& xListener )
- throw(uno::RuntimeException)
-{
- configapi::implAddListener( getNode(), xListener );
-}
-
-//-----------------------------------------------------------------------------------
-void SAL_CALL BasicGroupAccess::removeContainerListener( const uno::Reference< css::container::XContainerListener >& xListener )
- throw(uno::RuntimeException)
-{
- configapi::implRemoveListener( getNode(), xListener );
-}
-
-
-
-//-----------------------------------------------------------------------------------
-
-} // namespace configmgr
-
-
diff --git a/configmgr/source/api2/groupaccess.hxx b/configmgr/source/api2/groupaccess.hxx
deleted file mode 100644
index 14c1da3fef..0000000000
--- a/configmgr/source/api2/groupaccess.hxx
+++ /dev/null
@@ -1,135 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_GROUPACCESS_HXX_
-#define CONFIGMGR_API_GROUPACCESS_HXX_
-
-#include <com/sun/star/container/XHierarchicalName.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
-#include <com/sun/star/container/XContainer.hpp>
-#include <com/sun/star/beans/XExactName.hpp>
-#include <com/sun/star/beans/XProperty.hpp>
-#include <cppuhelper/implbase6.hxx>
-
-namespace configmgr
-{
- namespace css = ::com::sun::star;
- namespace uno = ::com::sun::star::uno;
-
- namespace configapi { class NodeGroupInfoAccess; }
-
- /** implements the (read-only) interfaces supported by a group node
- within the configuration tree.
- <p> Is an interface adapter around <type scope='configmgr::configapi'>NodeAccess</type>.</p>
- */
- class BasicGroupAccess
- : public ::cppu::ImplHelper6
- < css::container::XNameAccess
- , css::container::XHierarchicalName
- , css::container::XHierarchicalNameAccess
- , css::container::XContainer
- , css::beans::XExactName
- , css::beans::XProperty
- >
- {
- protected:
- // Destructors
- virtual ~BasicGroupAccess() {}
-
- public:
- // Interface methods
-
- // XHierarchicalName
- virtual rtl::OUString SAL_CALL
- getHierarchicalName( )
- throw(uno::RuntimeException);
-
- virtual rtl::OUString SAL_CALL
- composeHierarchicalName( const rtl::OUString& aRelativeName )
- throw(css::lang::IllegalArgumentException, css::lang::NoSupportException,
- uno::RuntimeException);
-
- // XElementAccess, base class of XNameAccess
- virtual uno::Type SAL_CALL
- getElementType( )
- throw(uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- hasElements( )
- throw(uno::RuntimeException);
-
- // XNameAccess
- virtual uno::Any SAL_CALL
- getByName( const rtl::OUString& aName )
- throw(css::container::NoSuchElementException, css::lang::WrappedTargetException,
- uno::RuntimeException);
-
- virtual uno::Sequence< rtl::OUString > SAL_CALL
- getElementNames( )
- throw( uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- hasByName( const rtl::OUString& aName )
- throw(uno::RuntimeException);
-
- // XHierarchicalNameAccess
- virtual uno::Any SAL_CALL
- getByHierarchicalName( const rtl::OUString& aName )
- throw(css::container::NoSuchElementException, uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- hasByHierarchicalName( const rtl::OUString& aName )
- throw(uno::RuntimeException);
-
- // XContainer
- virtual void SAL_CALL
- addContainerListener( const uno::Reference< css::container::XContainerListener >& xListener )
- throw(uno::RuntimeException);
-
- virtual void SAL_CALL
- removeContainerListener( const uno::Reference< css::container::XContainerListener >& xListener )
- throw(uno::RuntimeException);
-
- // XExactName
- virtual ::rtl::OUString SAL_CALL
- getExactName( const rtl::OUString& aApproximateName )
- throw(uno::RuntimeException);
-
- // XProperty
- virtual css::beans::Property SAL_CALL
- getAsProperty( )
- throw(uno::RuntimeException);
-
- protected:
- virtual configapi::NodeGroupInfoAccess& getNode() = 0;
- };
-
-}
-#endif // CONFIGMGR_API_GROUPACCESS_HXX_
-
-
diff --git a/configmgr/source/api2/groupobjects.cxx b/configmgr/source/api2/groupobjects.cxx
deleted file mode 100644
index 60765506ab..0000000000
--- a/configmgr/source/api2/groupobjects.cxx
+++ /dev/null
@@ -1,407 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-#include "groupobjects.hxx"
-#include "comphelper/sequence.hxx"
-
-//........................................................................
-namespace configmgr
-{
-
-//==========================================================================
-//= OInnerGroupInfo
-//==========================================================================
-
-// XInterface refcounting
-void SAL_CALL OInnerGroupInfo::acquire( ) throw ()
-{
- BasicInnerElement::acquire();
-}
-
-void SAL_CALL OInnerGroupInfo::release( ) throw ()
-{
- BasicInnerElement::release();
-}
-
-// XInterface joining
-uno::Any SAL_CALL OInnerGroupInfo::queryInterface( uno::Type const& rType ) throw (uno::RuntimeException )
-{
- uno::Any aRet = BasicInnerElement::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicGroupAccess::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicPropertySet::queryInterface(rType);
-
- return aRet;
-}
-
-// XTypeProvider joining
-uno::Sequence< uno::Type > SAL_CALL OInnerGroupInfo::getTypes( ) throw (uno::RuntimeException )
-{
- return comphelper::concatSequences(BasicInnerElement::getTypes(), BasicGroupAccess::getTypes(), BasicPropertySet::getTypes());
-}
-
-uno::Sequence< sal_Int8 > SAL_CALL OInnerGroupInfo::getImplementationId( ) throw (uno::RuntimeException )
-{
- return BasicInnerElement::getImplementationId();
-}
-
-
-configapi::NodeAccess& OInnerGroupInfo::getNodeAccess()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeGroupInfoAccess& OInnerGroupInfo::getNode()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeGroupAccess* OInnerGroupInfo::maybeGetUpdateAccess()
-{
- return 0;
-}
-
-configapi::InnerElement& OInnerGroupInfo::getElementClass()
-{
- return m_aAccessElement;
-}
-
-//==========================================================================
-//= OInnerGroupUpdate
-//==========================================================================
-
-// XInterface refcounting
-void SAL_CALL OInnerGroupUpdate::acquire( ) throw ()
-{
- BasicInnerElement::acquire();
-}
-
-void SAL_CALL OInnerGroupUpdate::release( ) throw ()
-{
- BasicInnerElement::release();
-}
-
-// XInterface joining
-uno::Any SAL_CALL OInnerGroupUpdate::queryInterface( uno::Type const& rType ) throw (uno::RuntimeException )
-{
- uno::Any aRet = BasicInnerElement::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicGroup::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicPropertySet::queryInterface(rType);
-
- return aRet;
-}
-
-// XTypeProvider joining
-uno::Sequence< uno::Type > SAL_CALL OInnerGroupUpdate::getTypes( ) throw (uno::RuntimeException )
-{
- return comphelper::concatSequences(BasicInnerElement::getTypes(), BasicGroup::getTypes(), BasicPropertySet::getTypes());
-}
-
-uno::Sequence< sal_Int8 > SAL_CALL OInnerGroupUpdate::getImplementationId( ) throw (uno::RuntimeException )
-{
- return BasicInnerElement::getImplementationId();
-}
-
-
-configapi::NodeAccess& OInnerGroupUpdate::getNodeAccess()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeGroupInfoAccess& OInnerGroupUpdate::getNode()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeGroupAccess* OInnerGroupUpdate::maybeGetUpdateAccess()
-{
- return &m_aAccessElement;
-}
-
-configapi::InnerElement& OInnerGroupUpdate::getElementClass()
-{
- return m_aAccessElement;
-}
-
-//==========================================================================
-//= OSetElementGroupInfo
-//==========================================================================
-
-// XInterface refcounting
-void SAL_CALL OSetElementGroupInfo::acquire( ) throw ()
-{
- BasicSetElement::acquire();
-}
-
-void SAL_CALL OSetElementGroupInfo::release( ) throw ()
-{
- BasicSetElement::release();
-}
-
-// XInterface joining
-uno::Any SAL_CALL OSetElementGroupInfo::queryInterface( uno::Type const& rType ) throw (uno::RuntimeException )
-{
- uno::Any aRet = BasicSetElement::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicGroupAccess::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicPropertySet::queryInterface(rType);
-
- return aRet;
-}
-
-// XTypeProvider joining
-uno::Sequence< uno::Type > SAL_CALL OSetElementGroupInfo::getTypes( ) throw (uno::RuntimeException )
-{
- return comphelper::concatSequences(BasicSetElement::getTypes(), BasicGroupAccess::getTypes(), BasicPropertySet::getTypes() );
-}
-
-uno::Sequence< sal_Int8 > SAL_CALL OSetElementGroupInfo::getImplementationId( ) throw (uno::RuntimeException )
-{
- return BasicSetElement::getImplementationId();
-}
-
-
-configapi::NodeAccess& OSetElementGroupInfo::getNodeAccess()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeGroupInfoAccess& OSetElementGroupInfo::getNode()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeGroupAccess* OSetElementGroupInfo::maybeGetUpdateAccess()
-{
- return 0;
-}
-
-configapi::SetElement& OSetElementGroupInfo::getElementClass()
-{
- return m_aAccessElement;
-}
-
-//==========================================================================
-//= OSetElementGroupUpdate
-//==========================================================================
-
-// XInterface refcounting
-void SAL_CALL OSetElementGroupUpdate::acquire( ) throw ()
-{
- BasicSetElement::acquire();
-}
-
-void SAL_CALL OSetElementGroupUpdate::release( ) throw ()
-{
- BasicSetElement::release();
-}
-
-// XInterface joining
-uno::Any SAL_CALL OSetElementGroupUpdate::queryInterface( uno::Type const& rType ) throw (uno::RuntimeException )
-{
- uno::Any aRet = BasicSetElement::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicGroup::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicPropertySet::queryInterface(rType);
-
- return aRet;
-}
-
-// XTypeProvider joining
-uno::Sequence< uno::Type > SAL_CALL OSetElementGroupUpdate::getTypes( ) throw (uno::RuntimeException )
-{
- return comphelper::concatSequences(BasicSetElement::getTypes(), BasicGroup::getTypes(), BasicPropertySet::getTypes());
-}
-
-uno::Sequence< sal_Int8 > SAL_CALL OSetElementGroupUpdate::getImplementationId( ) throw (uno::RuntimeException )
-{
- return BasicSetElement::getImplementationId();
-}
-
-
-configapi::NodeAccess& OSetElementGroupUpdate::getNodeAccess()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeGroupInfoAccess& OSetElementGroupUpdate::getNode()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeGroupAccess* OSetElementGroupUpdate::maybeGetUpdateAccess()
-{
- return &m_aAccessElement;
-}
-
-configapi::SetElement& OSetElementGroupUpdate::getElementClass()
-{
- return m_aAccessElement;
-}
-
-//==========================================================================
-//= ORootElementGroupInfo
-//==========================================================================
-
-// XInterface refcounting
-void SAL_CALL ORootElementGroupInfo::acquire( ) throw ()
-{
- BasicRootElement::acquire();
-}
-
-void SAL_CALL ORootElementGroupInfo::release( ) throw ()
-{
- BasicRootElement::release();
-}
-
-// XInterface joining
-uno::Any SAL_CALL ORootElementGroupInfo::queryInterface( uno::Type const& rType ) throw (uno::RuntimeException )
-{
- uno::Any aRet = BasicRootElement::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicGroupAccess::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicPropertySet::queryInterface(rType);
-
- return aRet;
-}
-
-// XTypeProvider joining
-uno::Sequence< uno::Type > SAL_CALL ORootElementGroupInfo::getTypes( ) throw (uno::RuntimeException )
-{
- return comphelper::concatSequences(BasicRootElement::getTypes(), BasicGroupAccess::getTypes(), BasicPropertySet::getTypes());
-}
-
-uno::Sequence< sal_Int8 > SAL_CALL ORootElementGroupInfo::getImplementationId( ) throw (uno::RuntimeException )
-{
- return BasicRootElement::getImplementationId();
-}
-
-
-configapi::NodeAccess& ORootElementGroupInfo::getNodeAccess()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeGroupInfoAccess& ORootElementGroupInfo::getNode()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeGroupAccess* ORootElementGroupInfo::maybeGetUpdateAccess()
-{
- return 0;
-}
-
-configapi::RootElement& ORootElementGroupInfo::getElementClass()
-{
- return m_aAccessElement;
-}
-
-//==========================================================================
-//= ORootElementGroupUpdate
-//==========================================================================
-
-// XInterface refcounting
-void SAL_CALL ORootElementGroupUpdate::acquire( ) throw ()
-{
- BasicUpdateElement::acquire();
-}
-
-void SAL_CALL ORootElementGroupUpdate::release( ) throw ()
-{
- BasicUpdateElement::release();
-}
-
-// XInterface joining
-uno::Any SAL_CALL ORootElementGroupUpdate::queryInterface( uno::Type const& rType ) throw (uno::RuntimeException )
-{
- uno::Any aRet = BasicUpdateElement::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicGroup::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicPropertySet::queryInterface(rType);
-
- return aRet;
-}
-
-// XTypeProvider joining
-uno::Sequence< uno::Type > SAL_CALL ORootElementGroupUpdate::getTypes( ) throw (uno::RuntimeException )
-{
- return comphelper::concatSequences(BasicUpdateElement::getTypes(),BasicGroup::getTypes(), BasicPropertySet::getTypes());
-}
-
-uno::Sequence< sal_Int8 > SAL_CALL ORootElementGroupUpdate::getImplementationId( ) throw (uno::RuntimeException )
-{
- return BasicUpdateElement::getImplementationId();
-}
-
-
-configapi::NodeAccess& ORootElementGroupUpdate::getNodeAccess()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeGroupInfoAccess& ORootElementGroupUpdate::getNode()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeGroupAccess* ORootElementGroupUpdate::maybeGetUpdateAccess()
-{
- return &m_aAccessElement;
-}
-
-configapi::UpdateRootElement& ORootElementGroupUpdate::getElementClass()
-{
- return m_aAccessElement;
-}
-
-//........................................................................
-} // namespace configmgr
-//........................................................................
-
diff --git a/configmgr/source/api2/groupobjects.hxx b/configmgr/source/api2/groupobjects.hxx
deleted file mode 100644
index dca3b1cd57..0000000000
--- a/configmgr/source/api2/groupobjects.hxx
+++ /dev/null
@@ -1,268 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_GROUPOBJECTS_HXX_
-#define CONFIGMGR_API_GROUPOBJECTS_HXX_
-
-#include "groupaccess.hxx"
-#include "groupupdate.hxx"
-#include "propertysetaccess.hxx"
-#include "elementaccess.hxx"
-
-#include "apiaccessobj.hxx"
-
-//........................................................................
-namespace configmgr
-{
-//........................................................................
-
-//==========================================================================
-//= Inner Group Instances
-//==========================================================================
-
-/** read-only access class for configuration nodes which are inner nodes and groups of other nodes
-*/
- class OInnerGroupInfo
- : public BasicInnerElement
- , public BasicGroupAccess
- , public BasicPropertySet
- {
- public:
- // Construction/Destruction
- OInnerGroupInfo(configapi::ApiTreeImpl& rTree, configuration::NodeRef const& aNode)
- : m_aAccessElement(static_cast<css::container::XChild*>(this),rTree,aNode)
- {
- }
-
- // XInterface refcounting
- void SAL_CALL acquire( ) throw ();
- void SAL_CALL release( ) throw ();
-
- // XInterface joining
- uno::Any SAL_CALL queryInterface( uno::Type const& rType ) throw (uno::RuntimeException );
-
- // XTypeProvider joining
- uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw (uno::RuntimeException );
- uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException );
-
- // Base class implementation
- virtual configapi::NodeAccess& getNodeAccess();
- virtual configapi::NodeGroupInfoAccess& getNode();
- virtual configapi::NodeGroupAccess* maybeGetUpdateAccess();
- virtual configapi::InnerElement& getElementClass();
- private:
- configapi::OInnerElement<configapi::NodeGroupInfoAccess> m_aAccessElement;
- };
-
-/** updating access class for configuration nodes which are inner nodes and groups of other nodes
-*/
- class OInnerGroupUpdate
- : public BasicInnerElement
- , public BasicGroup
- , public BasicPropertySet
- {
- public:
- // Construction/Destruction
- OInnerGroupUpdate(configapi::ApiTreeImpl& rTree, configuration::NodeRef const& aNode)
- : m_aAccessElement(static_cast<css::container::XChild*>(this),rTree,aNode)
- {
- }
-
- // XInterface refcounting
- void SAL_CALL acquire( ) throw ();
- void SAL_CALL release( ) throw ();
-
- // XInterface joining
- uno::Any SAL_CALL queryInterface( uno::Type const& rType ) throw (uno::RuntimeException );
-
- // XTypeProvider joining
- uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw (uno::RuntimeException );
- uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException );
-
- // Base class implementation
- virtual configapi::NodeAccess& getNodeAccess();
- virtual configapi::NodeGroupInfoAccess& getNode();
- virtual configapi::NodeGroupAccess* maybeGetUpdateAccess();
- virtual configapi::InnerElement& getElementClass();
- private:
- configapi::OInnerElement<configapi::NodeGroupAccess> m_aAccessElement;
- };
-
-
-//==========================================================================
-//= Set Element Group Instances
-//==========================================================================
-
-/** read-only access class for configuration nodes which are set elements and groups of other nodes
-*/
- class OSetElementGroupInfo
- : public BasicSetElement
- , public BasicGroupAccess
- , public BasicPropertySet
- {
- public:
- // Construction/Destruction
- OSetElementGroupInfo(rtl::Reference< configuration::Tree > const& aTree, configapi::ApiProvider& rProvider, configapi::ApiTreeImpl* pParentTree = 0)
- : m_aAccessElement(static_cast<css::container::XChild*>(this),aTree,rProvider,pParentTree)
- {
- }
-
- // XInterface refcounting
- void SAL_CALL acquire( ) throw ();
- void SAL_CALL release( ) throw ();
-
- // XInterface joining
- uno::Any SAL_CALL queryInterface( uno::Type const& rType ) throw (uno::RuntimeException );
-
- // XTypeProvider joining
- uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw (uno::RuntimeException );
- uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException );
-
- // Base class implementation
- virtual configapi::NodeAccess& getNodeAccess();
- virtual configapi::NodeGroupInfoAccess& getNode();
- virtual configapi::NodeGroupAccess* maybeGetUpdateAccess();
- virtual configapi::SetElement& getElementClass();
- private:
- configapi::OSetElement<configapi::NodeGroupInfoAccess> m_aAccessElement;
- };
-
-/** updating access class for configuration nodes which are set elements and groups of other nodes
-*/
- class OSetElementGroupUpdate
- : public BasicSetElement
- , public BasicGroup
- , public BasicPropertySet
- {
- public:
- // Construction/Destruction
- OSetElementGroupUpdate(rtl::Reference< configuration::Tree > const& aTree, configapi::ApiProvider& rProvider, configapi::ApiTreeImpl* pParentTree = 0)
- : m_aAccessElement(static_cast<css::container::XChild*>(this),aTree,rProvider,pParentTree)
- {
- }
-
- // XInterface refcounting
- void SAL_CALL acquire( ) throw ();
- void SAL_CALL release( ) throw ();
-
- // XInterface joining
- uno::Any SAL_CALL queryInterface( uno::Type const& rType ) throw (uno::RuntimeException );
-
- // XTypeProvider joining
- uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw (uno::RuntimeException );
- uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException );
-
- // Base class implementation
- virtual configapi::NodeAccess& getNodeAccess();
- virtual configapi::NodeGroupInfoAccess& getNode();
- virtual configapi::NodeGroupAccess* maybeGetUpdateAccess();
- virtual configapi::SetElement& getElementClass();
- private:
- configapi::OSetElement<configapi::NodeGroupAccess> m_aAccessElement;
- };
-
-
-//==========================================================================
-//= Root Element Set Instances
-//==========================================================================
-
-/** read-only access class for configuration nodes which are root nodes and groups of other nodes
-*/
- class ORootElementGroupInfo
- : public BasicRootElement
- , public BasicGroupAccess
- , public BasicPropertySet
- {
- public:
- // Construction/Destruction
- ORootElementGroupInfo(configapi::ApiProvider& rProvider, rtl::Reference< configuration::Tree > const& aTree, vos::ORef< OOptions >const& _xOptions)
- : m_aAccessElement(static_cast<css::lang::XComponent*>(this),rProvider,aTree, _xOptions)
- {
- }
-
- // XInterface refcounting
- void SAL_CALL acquire( ) throw ();
- void SAL_CALL release( ) throw ();
-
- // XInterface joining
- uno::Any SAL_CALL queryInterface( uno::Type const& rType ) throw (uno::RuntimeException );
-
- // XTypeProvider joining
- uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw (uno::RuntimeException );
- uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException );
-
- // Base class implementation
- virtual configapi::NodeAccess& getNodeAccess();
- virtual configapi::NodeGroupInfoAccess& getNode();
- virtual configapi::NodeGroupAccess* maybeGetUpdateAccess();
- virtual configapi::RootElement& getElementClass();
- private:
- configapi::OReadRootElement<configapi::NodeGroupInfoAccess> m_aAccessElement;
- };
-
-/** updating access class for configuration nodes which are root nodes and groups of other nodes
-*/
- class ORootElementGroupUpdate
- : public BasicUpdateElement
- , public BasicGroup
- , public BasicPropertySet
- {
- public:
- // Construction/Destruction
- ORootElementGroupUpdate(configapi::ApiProvider& rProvider, rtl::Reference< configuration::Tree > const& aTree, vos::ORef< OOptions >const& _xOptions)
- : m_aAccessElement(static_cast<css::lang::XComponent*>(this),rProvider,aTree, _xOptions)
- {
- }
-
- // XInterface refcounting
- void SAL_CALL acquire( ) throw ();
- void SAL_CALL release( ) throw ();
-
- // XInterface joining
- uno::Any SAL_CALL queryInterface( uno::Type const& rType ) throw (uno::RuntimeException );
-
- // XTypeProvider joining
- uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw (uno::RuntimeException );
- uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException );
-
- // Base class implementation
- virtual configapi::NodeAccess& getNodeAccess();
- virtual configapi::NodeGroupInfoAccess& getNode();
- virtual configapi::NodeGroupAccess* maybeGetUpdateAccess();
- virtual configapi::UpdateRootElement& getElementClass();
- private:
- configapi::OUpdateRootElement<configapi::NodeGroupAccess> m_aAccessElement;
- };
-
-
-//........................................................................
-} // namespace configmgr
-//........................................................................
-
-#endif // CONFIGMGR_API_GROUPOBJECTS_HXX_
-
-
diff --git a/configmgr/source/api2/groupupdate.cxx b/configmgr/source/api2/groupupdate.cxx
deleted file mode 100644
index 7cebdcd1fb..0000000000
--- a/configmgr/source/api2/groupupdate.cxx
+++ /dev/null
@@ -1,104 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "groupupdate.hxx"
-#include "updateimpl.hxx"
-#include "apinodeaccess.hxx"
-#include "apitypes.hxx"
-
-#include <cppuhelper/queryinterface.hxx>
-#include <cppuhelper/typeprovider.hxx>
-
-namespace configmgr
-{
-//////////////////////////////////////////////////////////////////////////////////
-// class BasicGroup
-//////////////////////////////////////////////////////////////////////////////////
-
-// XInterface joining
-//////////////////////////////////////////////////////////////////////////////////
-uno::Any SAL_CALL BasicGroup::queryInterface( uno::Type const& rType ) throw (uno::RuntimeException )
-{
- uno::Any aRet = BasicGroupAccess::queryInterface( rType );
- if (!aRet.hasValue())
- {
- aRet = cppu::queryInterface(rType
- , static_cast< css::container::XNameReplace *>(this)
- );
- }
- return aRet;
-}
-
-// XTypeProvider joining
-//////////////////////////////////////////////////////////////////////////////////
-uno::Sequence< uno::Type > SAL_CALL BasicGroup::getTypes( ) throw (uno::RuntimeException )
-{
- /*static ?*/
- cppu::OTypeCollection aTypes(
- configapi::getReferenceType(static_cast< css::container::XNameReplace *>(this)),
- BasicGroupAccess::getTypes());
-
- return aTypes.getTypes();
-}
-
-//uno::Sequence< sal_Int8 > SAL_CALL BasicGroup::getImplementationId( ) throw (uno::RuntimeException ) = 0;
-
-//////////////////////////////////////////////////////////////////////////////////
-
-// safe write access
-/////////////////////////////////////////////////////////////
-configapi::NodeGroupAccess& BasicGroup::getGroupNode()
-{
- configapi::NodeGroupAccess* pAccess = maybeGetUpdateAccess();
- OSL_ENSURE(pAccess, "Write operation invoked on a read-only node access - failing with RuntimeException");
-
- if (!pAccess)
- {
- throw uno::RuntimeException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: Invalid Object - internal update interface missing.")),
- static_cast< css::container::XNameReplace * >(this)
- );
- }
- return *pAccess;
-}
-
-// New Interface methods
-// XNameReplace
-//////////////////////////////////////////////////////////////////////////////////
-void SAL_CALL BasicGroup::replaceByName( const rtl::OUString& rName, const uno::Any& rElement )
- throw(css::lang::IllegalArgumentException, css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException)
-{
- configapi::implReplaceByName( getGroupNode(), rName, rElement );
-}
-
-//-----------------------------------------------------------------------------------
-} // namespace configmgr
-
-
diff --git a/configmgr/source/api2/groupupdate.hxx b/configmgr/source/api2/groupupdate.hxx
deleted file mode 100644
index 5c8148f9a1..0000000000
--- a/configmgr/source/api2/groupupdate.hxx
+++ /dev/null
@@ -1,98 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_GROUPUPDATE_HXX_
-#define CONFIGMGR_API_GROUPUPDATE_HXX_
-
-#include "groupaccess.hxx"
-#include <com/sun/star/container/XNameReplace.hpp>
-
-//........................................................................
-namespace configmgr
-{
-//........................................................................
- namespace configapi { class NodeGroupAccess; }
-
-//==========================================================================
-//= BasicGroup
-//==========================================================================
-
-/** base class for configuration nodes which are dynamic sets of complex types (trees)
-*/
- class BasicGroup
- : public BasicGroupAccess
- , public css::container::XNameReplace
- {
- protected:
- // Destructors
- virtual ~BasicGroup() {}
-
- public:
- // Base class Interface methods
- // XInterface joining
- uno::Any SAL_CALL queryInterface( uno::Type const& rType ) throw (uno::RuntimeException );
-
- // XTypeProvider joining
- uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw (uno::RuntimeException );
- uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException ) = 0;
-
- // XElementAccess forwarding
- virtual uno::Type SAL_CALL getElementType( ) throw(uno::RuntimeException)
- { return BasicGroupAccess::getElementType(); }
-
- virtual sal_Bool SAL_CALL hasElements( ) throw(uno::RuntimeException)
- { return BasicGroupAccess::hasElements(); }
-
- // XNameAccess forwarding
- virtual uno::Any SAL_CALL getByName( const rtl::OUString& aName )
- throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException)
- { return BasicGroupAccess::getByName(aName); }
-
- virtual uno::Sequence< rtl::OUString > SAL_CALL getElementNames( ) throw( uno::RuntimeException)
- { return BasicGroupAccess::getElementNames(); }
-
- virtual sal_Bool SAL_CALL hasByName( const rtl::OUString& aName ) throw(uno::RuntimeException)
- { return BasicGroupAccess::hasByName(aName); }
-
- // New Interface methods
- // XNameReplace
- virtual void SAL_CALL
- replaceByName( const rtl::OUString& rName, const uno::Any& rElement )
- throw(css::lang::IllegalArgumentException, css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException);
-
- protected:
- configapi::NodeGroupAccess& getGroupNode();
- virtual configapi::NodeGroupAccess* maybeGetUpdateAccess() = 0;
- };
-
-//........................................................................
-} // namespace configmgr
-//........................................................................
-
-#endif // CONFIGMGR_API_GROUPUPDATE_HXX_
-
-
diff --git a/configmgr/source/api2/listenercontainer.cxx b/configmgr/source/api2/listenercontainer.cxx
deleted file mode 100644
index 59e99503d7..0000000000
--- a/configmgr/source/api2/listenercontainer.cxx
+++ /dev/null
@@ -1,80 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "listenercontainer.hxx"
-#include <com/sun/star/lang/XEventListener.hpp>
-
-#include <osl/diagnose.h>
-
-namespace configmgr
-{
- namespace configapi
- {
-/////////////////////////////////////////////////////////////////////////////////////////////
-
-//-----------------------------------------------------------------------------
-// class DisposeNotifier
-//-----------------------------------------------------------------------------
-
-void DisposeNotifier::appendAndClearContainer(cppu::OInterfaceContainerHelper* pContainer)
-{
- if (pContainer)
- {
- {
- cppu::OInterfaceIteratorHelper aIterator(*pContainer);
- while (aIterator.hasMoreElements())
- {
- aListeners.push_back(uno::Reference< lang::XEventListener >::query(aIterator.next()));
- }
- }
- pContainer->clear();
- }
-}
-//-----------------------------------------------------------------------------
-void DisposeNotifier::notify()
-{
- for(std::vector< uno::Reference< lang::XEventListener > >::iterator it = aListeners.begin(); it != aListeners.end(); ++it)
- {
- if (it->is())
- {
- try { (*it)->disposing(aEvent); } catch (uno::Exception & ) {}
- it->clear();
- }
- }
- aListeners.clear();
-}
-
-//-----------------------------------------------------------------------------
-
-/////////////////////////////////////////////////////////////////////////////////////////////
- }
-}
-
-
diff --git a/configmgr/source/api2/listenercontainer.hxx b/configmgr/source/api2/listenercontainer.hxx
deleted file mode 100644
index 673fefdba7..0000000000
--- a/configmgr/source/api2/listenercontainer.hxx
+++ /dev/null
@@ -1,581 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_LISTENERCONTAINER_HXX_
-#define CONFIGMGR_API_LISTENERCONTAINER_HXX_
-
-#include <com/sun/star/lang/XEventListener.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <cppuhelper/interfacecontainer.hxx>
-#include "datalock.hxx"
-#include "utility.hxx"
-
-#include <osl/diagnose.h>
-
-namespace configmgr
-{
- namespace configapi
- {
-/////////////////////////////////////////////////////////////////////////////////////////////
-
- namespace css = ::com::sun::star;
- namespace uno = css::uno;
- namespace lang = css::lang;
-//-----------------------------------------------------------------------------
- template <class Listener>
- class ListenerContainerIterator
- {
- public:
- /**
- * Create an iterator over the elements of the container. The iterator
- * copies the elements of the conatainer. A change to the container does not
- * affect the iterator.<BR>
- * Remark: The copy is on demand. The iterator copy the elements only if the container
- * change the contens. It is not allowed to destroy the container if a iterator exist.
- *
- * @param rCont the container of the elements.
- */
- ListenerContainerIterator( cppu::OInterfaceContainerHelper& rCont )
- : m_aIter(rCont)
- , m_xNext()
- { advance(); }
-
- /**
- * Release the connection to the container.
- */
- ~ListenerContainerIterator() {}
-
- /** Return true, if there are more elements in the iterator. */
- sal_Bool hasMoreElements() const { return m_xNext.is() != 0; }
-
- /** Return the next element of the iterator. Call this method if
- * hasMoreElements return false, is an error.
- */
- uno::Reference<Listener> next();
-
- private:
- void advance();
-
- cppu::OInterfaceIteratorHelper m_aIter;
- uno::Reference<Listener> m_xNext;
- };
-//-----------------------------------------------------------------------------
- class DisposeNotifier
- {
- lang::EventObject aEvent;
- std::vector< uno::Reference< lang::XEventListener > > aListeners;
- public:
- explicit
- DisposeNotifier(uno::Reference<uno::XInterface> const& aInterface) : aEvent(aInterface) {}
-
- void appendAndClearContainer(cppu::OInterfaceContainerHelper* pContainer);
- void notify();
- };
-//-----------------------------------------------------------------------------
- struct BasicContainerInfo
- {
- uno::XInterface* pInterface;
- cppu::OMultiTypeInterfaceContainerHelper* pContainer;
- BasicContainerInfo() : pInterface(0), pContainer(0) {}
- };
-
- template <class Key_, class KeyHash_, class KeyEq_, class KeyToIndex_>
- class SpecialListenerContainer
- {
- public:
- /**
- * Create a container of interface containers.
- */
- SpecialListenerContainer(std::vector<BasicContainerInfo>::size_type nCount, KeyToIndex_ aMapper)
- : m_aSpecialHelper(UnoApiLock::getLock())
- , m_aContainers(nCount)
- , m_aMapper(aMapper)
- , m_bDisposeLock(false)
- {}
-
- ~SpecialListenerContainer()
- {
- OSL_ENSURE(isDisposed(), "ERROR: Object was not disposed properly");
- }
- public:
- /**
- * check whether this is disposed or still alive
- * @param pObject
- * an interface on the object on which's behalf the operation was started
- * @return <FALSE/>
- * if the object is being disposed
- * @throw com::sun::star::lang::DisposedException
- * if the object was disposed completely
- */
- bool checkAlive(uno::XInterface* pObject = 0) volatile const throw(lang::DisposedException);
-
- /// return whether the object is completely alive
- bool isAlive() volatile const throw();
- /// return whether the object is currently being disposed
- bool isDisposing()volatile const throw();
- /// return whether the object is completely disposed
- bool isDisposed()volatile const throw();
-
- /// return whether the object is present in this container
- bool isAvailable(std::vector<BasicContainerInfo>::size_type nIndex) const throw()
- {
- return nIndex < m_aContainers.size() && m_aContainers[nIndex].pInterface;
- }
-
- std::vector<BasicContainerInfo>::size_type getSize() const
- {
- return m_aContainers.size();
- }
-
- /// return the interface associated with an index
- void setObjectAt(std::vector<BasicContainerInfo>::size_type nIndex, uno::XInterface* pInterface)
- {
- OSL_ENSURE( !isDisposed(), "object is disposed" );
-
- if (isAlive())
- {
- OSL_ENSURE( nIndex < m_aContainers.size(), " Invalid Index into Notifier");
- OSL_ENSURE( pInterface, "Invalid NULL Interface passed into Notifier");
-
- if ( nIndex < m_aContainers.size() && pInterface != NULL)
- {
- OSL_ENSURE( m_aContainers[nIndex].pInterface == NULL, "Interface already set");
- if (m_aContainers[nIndex].pInterface == NULL)
- m_aContainers[nIndex].pInterface = pInterface;
- }
- }
- }
-
-
- /// return the interface associated with an index
- uno::Reference<uno::XInterface> getObjectAt(std::vector<BasicContainerInfo>::size_type nIndex) const
- {
- uno::Reference<uno::XInterface> xRet( nIndex < m_aContainers.size() ? m_aContainers[nIndex].pInterface : 0 );
- return xRet;
- }
-
- /// return the interface associated with an index
- uno::Reference<uno::XInterface> getObjectForKey(Key_ const& aKey ) const
- {
- std::vector<BasicContainerInfo>::size_type nIndex = m_aMapper.findIndexForKey(aKey);
- uno::Reference<uno::XInterface> xRet( nIndex < m_aContainers.size() ? m_aContainers[nIndex].pInterface : 0 );
- return xRet;
- }
-
- /**
- * Call disposing on all object in all the container for anIndex
- * and in the containers for the associated indices
- * support XEventListener. Then clear the container.
- */
- bool disposeOne( std::vector<BasicContainerInfo>::size_type anIndex ) throw();
-
- /**
- * Start disposing this object
- * @return <TRUE/>
- * if disposing has been started
- * @return <FALSE/>
- * if disposing had already been started before
- */
- bool beginDisposing() throw();
- /**
- * Continue disposing this object
- * <p> Call disposing on all object in all the containers that
- * support XEventListener. Then clear the container.
- * </p>
- * @return <TRUE/>
- * if disposing has been started
- * @return <FALSE/>
- * if disposing had already been started before
- */
- void notifyDisposing() throw();
-
- /// mark the end of the dispose processing
- void endDisposing() throw();
-
- public:
- /**
- * Return the specuial container created under this key.
- * @return the container created under this key. If the container
- * was not created, null was returned.
- */
- cppu::OInterfaceContainerHelper * getSpecialContainer( const Key_ & aKey) const
- { return m_aSpecialHelper.aLC.getContainer(aKey); }
-
- /**
- * Return the containerhelper created under this index.
- * @return the container helper created under this key. If the container helper
- * was not created, null was returned.
- */
- cppu::OMultiTypeInterfaceContainerHelper * getContainerHelper( std::vector<BasicContainerInfo>::size_type nIndex) const
- {
- return ((nIndex < m_aContainers.size()) ? m_aContainers[nIndex].pContainer : 0 );
- }
- /**
- * Return the container for the given type created under this index.
- * @return the container created under this key. If the container
- * was not created, null was returned.
- */
- cppu::OInterfaceContainerHelper * getContainer( std::vector<BasicContainerInfo>::size_type nIndex, const uno::Type & aType) const
- {
- cppu::OMultiTypeInterfaceContainerHelper* pContainer = (nIndex < m_aContainers.size()) ? m_aContainers[nIndex].pContainer : 0 ;
-
- return pContainer ? pContainer->getContainer(aType) : 0;
- }
-
- /**
- * Insert an element in the container specified with the index and type. The position is not specified.
- * The interface at the given index must be set already.
- * @param aKey the id of the container.
- * @param xListener the added interface. It is allowed to insert null or
- * the same pointer more than once.
- * @return the new count of elements in the container (or 0 if the object is ready being disposed).
- */
- sal_Int32 addListener( std::vector<BasicContainerInfo>::size_type nIndex, const uno::Type& aType, uno::Reference< lang::XEventListener > const& xListener) throw();
-
- /**
- * Remove an element from the container specified with the index and type.
- * It uses the equal definition of uno objects to remove the interfaces.
- * @param aKey the id of the container.
- * @param xListener the removed interface.
- * @return the new count of elements in the container (or 0 if the object is ready being disposed).
- */
- sal_Int32 removeListener( std::vector<BasicContainerInfo>::size_type nIndex, const uno::Type& aType, uno::Reference< lang::XEventListener > const& xListener) throw();
-
-
- /**
- * Insert an element in the special container specified with the key. The position is not specified.
- * The interface at the given index must be set already.
- * @param aKey the id of the container.
- * @param xListener the added interface. It is allowed to insert null or
- * the same pointer more than once.
- * @return the new count of elements in the container (or 0 if the object is ready being disposed).
- */
- sal_Int32 addSpecialListener( const Key_& aKey, uno::Reference< lang::XEventListener > const& xListener) throw();
-
- /**
- * Remove an element from the container specified with the key.
- * It uses the equal definition of uno objects to remove the interfaces.
- * @param aKey the id of the container.
- * @param xListener the removed interface.
- * @return the new count of elements in the container (or 0 if the object is ready being disposed).
- */
- sal_Int32 removeSpecialListener( const Key_& aKey, uno::Reference< lang::XEventListener > const& xListener) throw();
-
- private:
- void implFillDisposer(DisposeNotifier& aNotifier, std::vector<BasicContainerInfo>::size_type nIndex);
-
- cppu::OBroadcastHelperVar< cppu::OMultiTypeInterfaceContainerHelperVar< Key_,KeyHash_,KeyEq_ >, Key_ > m_aSpecialHelper;
- std::vector<BasicContainerInfo> m_aContainers;
- KeyToIndex_ m_aMapper;
- bool m_bDisposeLock;
- };
-//-----------------------------------------------------------------------------
-
-/////////////////////////////////////////////////////////////////////////////////////////////
- template <class Key_, class KeyHash_, class KeyEq_, class KeyToIndex_>
- bool SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::checkAlive(uno::XInterface* pObject) volatile const throw(lang::DisposedException)
- {
- bool bAlive = !m_aSpecialHelper.bInDispose;
- if (m_aSpecialHelper.bDisposed)
- {
- throw lang::DisposedException(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("The object has already been disposed")),pObject);
- }
- return bAlive;
- }
-//-----------------------------------------------------------------------------
- template <class Key_, class KeyHash_, class KeyEq_, class KeyToIndex_>
- inline
- bool SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::isAlive() volatile const throw()
- {
- return !m_aSpecialHelper.bInDispose && !m_aSpecialHelper.bDisposed;
- }
-//-----------------------------------------------------------------------------
- template <class Key_, class KeyHash_, class KeyEq_, class KeyToIndex_>
- inline
- bool SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::isDisposing() volatile const throw()
- {
- return !!m_aSpecialHelper.bInDispose;
- }
-//-----------------------------------------------------------------------------
- template <class Key_, class KeyHash_, class KeyEq_, class KeyToIndex_>
- inline
- bool SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::isDisposed() volatile const throw()
- {
- return !!m_aSpecialHelper.bDisposed;
- }
-//-----------------------------------------------------------------------------
- template <class Key_, class KeyHash_, class KeyEq_, class KeyToIndex_>
- bool SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::disposeOne(std::vector<BasicContainerInfo>::size_type nIndex) throw()
- {
- // OSL_ENSURE(!isDisposed(),"Object is already disposed in toto");
- if (isAlive())
- {
- if (nIndex < m_aContainers.size())
- {
- if (uno::XInterface* pObject = m_aContainers[nIndex].pInterface)
- {
- DisposeNotifier aNotifier(pObject);
-
- implFillDisposer(aNotifier, nIndex);
- m_aContainers[nIndex].pInterface = 0;
- delete m_aContainers[nIndex].pContainer;
-
- aNotifier.notify();
- }
- }
- return true;
- }
- else
- return false;
- }
-//-----------------------------------------------------------------------------
- template <class Key_, class KeyHash_, class KeyEq_, class KeyToIndex_>
- bool SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::beginDisposing() throw()
- {
- if (isAlive())
- {
- m_aSpecialHelper.bInDispose = sal_True;
- m_bDisposeLock = true;
-
- return true;
- }
- return false;
- }
-//-----------------------------------------------------------------------------
- template <class Key_, class KeyHash_, class KeyEq_, class KeyToIndex_>
- void SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::notifyDisposing() throw()
- {
- OSL_ENSURE(isDisposing(),"Disposing isn't in progress on this object");
- OSL_ENSURE(m_bDisposeLock,"Duplicate call for dispose notification or disposing is not taking place");
-
- if (m_bDisposeLock)
- {
- OSL_ASSERT(m_aSpecialHelper.bInDispose);
-
- lang::EventObject aBaseEvt;
- std::vector<DisposeNotifier> aNotifiers;
-
- if (std::vector<BasicContainerInfo>::size_type size = m_aContainers.size())
- {
- aNotifiers.reserve(m_aContainers.size());
-
- aBaseEvt.Source = m_aContainers[0].pInterface;
- for(std::vector<BasicContainerInfo>::size_type ix = 0; ix < size; ++ix)
- {
- if (m_aContainers[ix].pInterface)
- {
- aNotifiers.push_back(DisposeNotifier(m_aContainers[ix].pInterface));
- implFillDisposer(aNotifiers.back(), ix);
- m_aContainers[ix].pInterface = 0;
- delete m_aContainers[ix].pContainer;
- }
- }
- }
-
- m_bDisposeLock = false;
-
- for(std::vector<BasicContainerInfo>::size_type jx = 0, count = aNotifiers.size(); jx < count; ++jx)
- {
- aNotifiers[jx].notify();
- }
- // in case we missed something
- m_aSpecialHelper.aLC.disposeAndClear( aBaseEvt );
- }
- }
-//-----------------------------------------------------------------------------
- template <class Key_, class KeyHash_, class KeyEq_, class KeyToIndex_>
- void SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::endDisposing() throw()
- {
- OSL_ENSURE(isDisposing(),"Disposing isn't in progress on this object");
-
- if (!isAlive())
- {
- OSL_ENSURE(!m_bDisposeLock,"Did you forget to notify ?");
-
- m_aSpecialHelper.bDisposed = sal_True;
- m_aSpecialHelper.bInDispose = sal_False;
-
- if (m_bDisposeLock)
- {
- m_bDisposeLock = false;
- }
- }
- }
-//-----------------------------------------------------------------------------
- template <class Key_, class KeyHash_, class KeyEq_, class KeyToIndex_>
- sal_Int32 SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::addListener( std::vector<BasicContainerInfo>::size_type nIndex, const uno::Type& aType, const uno::Reference< lang::XEventListener > & xListener ) throw()
- {
- if ( nIndex < m_aContainers.size() && m_aContainers[nIndex].pInterface )
- {
- if ( isAlive() )
- {
- if (m_aContainers[nIndex].pContainer == 0)
- m_aContainers[nIndex].pContainer = new cppu::OMultiTypeInterfaceContainerHelper(UnoApiLock::getLock());
-
- return m_aContainers[nIndex].pContainer->addInterface(aType,xListener);
- }
-
- else if (xListener.is())
- {
- lang::EventObject aEvent(m_aContainers[nIndex].pInterface);
- try { xListener->disposing(aEvent); } catch (uno::Exception & ) {}
- }
-
- }
- else
- OSL_ENSURE(false, "Invalid index or interface not set");
-
- return 0;
- }
-//-----------------------------------------------------------------------------
- template <class Key_, class KeyHash_, class KeyEq_, class KeyToIndex_>
- sal_Int32 SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::addSpecialListener( const Key_& aKey, const uno::Reference< lang::XEventListener > & xListener ) throw()
- {
- std::vector<BasicContainerInfo>::size_type nIndex = m_aMapper.findIndexForKey(aKey);
- if ( nIndex < m_aContainers.size() && m_aContainers[nIndex].pInterface )
- {
- if ( isAlive() )
- {
- return m_aSpecialHelper.aLC.addInterface(aKey,xListener);
- }
-
- else if (xListener.is())
- {
- lang::EventObject aEvent(m_aContainers[nIndex].pInterface);
- try { xListener->disposing(aEvent); } catch (uno::Exception & ) {}
- }
- }
- else
- OSL_ENSURE(false, "Invalid index or interface not set");
-
- return 0;
- }
-//-----------------------------------------------------------------------------
-
- template <class Key_, class KeyHash_, class KeyEq_, class KeyToIndex_>
- sal_Int32 SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::removeListener( std::vector<BasicContainerInfo>::size_type nIndex, const uno::Type& aType, const uno::Reference< lang::XEventListener > & xListener ) throw()
- {
- OSL_ENSURE( !isDisposed(), "object is disposed" );
-
- if ( isAlive() )
- {
- if ( nIndex < m_aContainers.size() && m_aContainers[nIndex].pContainer )
- {
- return m_aContainers[nIndex].pContainer->removeInterface(aType,xListener);
- }
- }
- return 0;
- }
-//-----------------------------------------------------------------------------
-
- template <class Key_, class KeyHash_, class KeyEq_, class KeyToIndex_>
- sal_Int32 SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::removeSpecialListener( const Key_& aKey, const uno::Reference< lang::XEventListener > & xListener ) throw()
- {
- OSL_ENSURE( !isDisposed(), "object is disposed" );
-
- if ( isAlive() )
- return m_aSpecialHelper.aLC.removeInterface(aKey, xListener );
-
- else
- return 0;
- }
-//-----------------------------------------------------------------------------
- // relation function. Uses KeyToIndex
-/* template <class Key_, class KeyHash_, class KeyEq_, class KeyToIndex_>
- SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::Index
- SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::findIndexForKey(Key const& aKey)
- {
- m_aMapper.findIndexForKey(aKey);
- }
-//-----------------------------------------------------------------------------
- // relation function. Uses KeyToIndex
- template <class Key_, class KeyHash_, class KeyEq_, class KeyToIndex_>
- bool SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::findKeysForIndex(std::vector<BasicContainerInfo>::size_type nIndex, std::vector<Key_> & aKeys)
- {
- aKeys.clear();
- m_aMapper.findKeysForIndex(nIndex,aKeys);
- return !aKeys.empty();
- }
-*///-----------------------------------------------------------------------------
- // relation function. Uses KeyToIndex
- template <class Key_, class KeyHash_, class KeyEq_, class KeyToIndex_>
- void SpecialListenerContainer<Key_,KeyHash_,KeyEq_, KeyToIndex_>::implFillDisposer(DisposeNotifier& aNotifier, std::vector<BasicContainerInfo>::size_type nIndex)
- {
- if (cppu::OMultiTypeInterfaceContainerHelper* pMultiContainer = m_aContainers[nIndex].pContainer)
- {
- uno::Sequence< uno::Type > aTypes(pMultiContainer->getContainedTypes());
- for (sal_Int32 ix = 0; ix < aTypes.getLength(); ++ix)
- {
- cppu::OInterfaceContainerHelper* pContainer = pMultiContainer->getContainer(aTypes[ix]);
- OSL_ENSURE(pContainer,"No container, but the type ?");
- if (pContainer)
- aNotifier.appendAndClearContainer(pContainer);
- }
- }
- std::vector<Key_> aKeys;
- if (m_aMapper.findKeysForIndex(nIndex,aKeys))
- {
- for(typename std::vector<Key_>::iterator it = aKeys.begin(); it != aKeys.end(); ++it)
- {
- if (cppu::OInterfaceContainerHelper* pContainer = m_aSpecialHelper.aLC.getContainer(*it))
- {
- aNotifier.appendAndClearContainer(pContainer);
- }
- }
- }
- }
-//-----------------------------------------------------------------------------
-
-/////////////////////////////////////////////////////////////////////////////////////////////
-
- template <class Listener>
- inline
- void ListenerContainerIterator<Listener>::advance()
- {
- while (!m_xNext.is() && m_aIter.hasMoreElements())
- {
- m_xNext = m_xNext.query( m_aIter.next() );
- }
- }
-//-----------------------------------------------------------------------------
-
- template <class Listener>
- uno::Reference<Listener> ListenerContainerIterator<Listener>::next()
- {
- uno::Reference<Listener> xRet(m_xNext);
- m_xNext.clear();
- advance();
- return xRet;
- }
-//-----------------------------------------------------------------------------
-
-/////////////////////////////////////////////////////////////////////////////////////////////
- }
-}
-#endif // CONFIGMGR_API_LISTENERCONTAINER_HXX_
-
-
diff --git a/configmgr/source/api2/makefile.mk b/configmgr/source/api2/makefile.mk
deleted file mode 100644
index 314ca98752..0000000000
--- a/configmgr/source/api2/makefile.mk
+++ /dev/null
@@ -1,79 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJINC=$(PRJ)$/source$/inc
-PRJNAME=configmgr
-TARGET=api2
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings ----------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/makefile.pmk
-
-# --- Files -------------------------------------
-
-SLOFILES= \
- $(SLO)$/broadcaster.obj \
- $(SLO)$/listenercontainer.obj \
- $(SLO)$/provider.obj \
- $(SLO)$/providerimpl.obj \
- $(SLO)$/accessimpl.obj \
- $(SLO)$/apiaccessobj.obj \
- $(SLO)$/apiserviceinfo.obj \
- $(SLO)$/apifactory.obj \
- $(SLO)$/apifactoryimpl.obj \
- $(SLO)$/apinodeaccess.obj \
- $(SLO)$/apinodeupdate.obj \
- $(SLO)$/apinotifierimpl.obj \
- $(SLO)$/apitreeaccess.obj \
- $(SLO)$/apitreeimplobj.obj \
- $(SLO)$/confignotifier.obj \
- $(SLO)$/committer.obj \
- $(SLO)$/elementaccess.obj \
- $(SLO)$/elementimpl.obj \
- $(SLO)$/groupaccess.obj \
- $(SLO)$/groupobjects.obj \
- $(SLO)$/groupupdate.obj \
- $(SLO)$/propertiesfilterednotifier.obj \
- $(SLO)$/propertyinfohelper.obj \
- $(SLO)$/propertysetaccess.obj \
- $(SLO)$/propsetaccessimpl.obj \
- $(SLO)$/setaccess.obj \
- $(SLO)$/setobjects.obj \
- $(SLO)$/setupdate.obj \
- $(SLO)$/translatechanges.obj \
- $(SLO)$/treeiterators.obj \
- $(SLO)$/updateimpl.obj \
-
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/configmgr/source/api2/notifierimpl.hxx b/configmgr/source/api2/notifierimpl.hxx
deleted file mode 100644
index b2bd55b992..0000000000
--- a/configmgr/source/api2/notifierimpl.hxx
+++ /dev/null
@@ -1,238 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_NOTIFIERIMPL_HXX_
-#define CONFIGMGR_API_NOTIFIERIMPL_HXX_
-
-#include "listenercontainer.hxx"
-
-#include "noderef.hxx"
-#include "valueref.hxx"
-
-#include <com/sun/star/beans/XPropertyChangeListener.hpp>
-#include <com/sun/star/beans/XVetoableChangeListener.hpp>
-#include <com/sun/star/beans/XPropertiesChangeListener.hpp>
-#include <com/sun/star/beans/PropertyVetoException.hpp>
-#include <com/sun/star/container/XContainerListener.hpp>
-#include <com/sun/star/util/XChangesListener.hpp>
-
-#include "propertiesfilterednotifier.hxx"
-
-#include <vos/refernce.hxx>
-
-namespace configmgr
-{
- namespace configapi
- {
-// ---------------------------------------------------------------------------------------------------
-
- struct SubNodeHash
- {
- size_t operator() (const configuration::SubNodeID& rKey) const {return rKey.hashCode();}
- };
- struct SubNodeEq
- {
- bool operator() (const configuration::SubNodeID& lhs,const configuration::SubNodeID& rhs) const {return lhs == rhs;}
- };
- struct SubNodeToIndex
- {
- rtl::Reference< configuration::Tree > aTree;
-
- SubNodeToIndex( rtl::Reference< configuration::Tree > const& rTree ) : aTree(rTree) {}
-
- bool findKeysForIndex(unsigned int nNode, std::vector<configuration::SubNodeID>& aList)
- {
- aList.clear();
- configuration::getAllChildrenHelper(configuration::findNodeFromIndex(aTree,nNode), aList);
- return !aList.empty();
- }
- unsigned int findIndexForKey(configuration::SubNodeID const& aNode)
- {
- return aNode.getParentID().toIndex();
- }
- };
-
- /// manages collections of event listeners observing a whole config tree, thread-safe
- class NotifierImpl : public vos::OReference
- {
- public:
- SpecialListenerContainer <configuration::SubNodeID,SubNodeHash,SubNodeEq,SubNodeToIndex> m_aListeners;
-
- public:
- /// construct this around the given Implementation, for the given tree
- explicit
- NotifierImpl(rtl::Reference< configuration::Tree > const& aTree);
- ~NotifierImpl();
-
- /// Add a <type scope='com::sun::star::lang'>XEventListener</type> observing <var>aNode</var>.
- void add(configuration::NodeID const& aNode, uno::Reference< css::lang::XEventListener > const& xListener)
- {
- OSL_PRECOND(xListener.is(), "ERROR: Unexpected NULL listener");
-
- // ignore the names for now
- m_aListeners.addListener(aNode.toIndex(),getCppuType(&xListener),xListener.get());
- }
-
- /// Add a <type scope='com::sun::star::container'>XContainerListener</type> observing <var>aNode</var>.
- void add(configuration::NodeID const& aNode, uno::Reference< css::container::XContainerListener > const& xListener)
- {
- OSL_PRECOND(xListener.is(), "ERROR: Unexpected NULL listener");
-
- // ignore the names for now
- m_aListeners.addListener(aNode.toIndex(),getCppuType(&xListener),xListener.get());
- }
-
- /// Add a <type scope='com::sun::star::util'>XChangesListener</type> observing <var>aNode</var> and its descendants.
- void add(configuration::NodeID const& aNode, uno::Reference< css::util::XChangesListener > const& xListener)
- {
- OSL_PRECOND(xListener.is(), "ERROR: Unexpected NULL listener");
-
- // ignore the names for now
- m_aListeners.addListener(aNode.toIndex(),getCppuType(&xListener),xListener.get());
- }
-
- /// Add a <type scope='com::sun::star::beans'>XPropertyChangeListener</type> observing <var>aNode</var>.
- void addNamed(configuration::SubNodeID const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener)
- {
- OSL_PRECOND(xListener.is(), "ERROR: Unexpected NULL listener");
-
- // ignore the names for now
- m_aListeners.addSpecialListener(aNode,xListener.get());
- }
- /// Add a <type scope='com::sun::star::beans'>XPropertyChangeListener</type> observing <var>aNode</var>.
- void addForAll(configuration::NodeID const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener)
- {
- OSL_PRECOND(xListener.is(), "ERROR: Unexpected NULL listener");
-
- // ignore the names for now
- m_aListeners.addListener(aNode.toIndex(),getCppuType(&xListener),xListener.get());
- }
- /// Add a <type scope='com::sun::star::beans'>XVetoableChangeListener</type> constraining <var>aNode</var>.
- void addNamed(configuration::SubNodeID const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener)
- {
- OSL_PRECOND(xListener.is(), "ERROR: Unexpected NULL listener");
-
- // ignore the names for now
- m_aListeners.addSpecialListener(aNode,xListener.get());
- }
- /// Add a <type scope='com::sun::star::beans'>XVetoableChangeListener</type> constraining <var>aNode</var>.
- void addForAll(configuration::NodeID const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener)
- {
- OSL_PRECOND(xListener.is(), "ERROR: Unexpected NULL listener");
-
- // ignore the names for now
- m_aListeners.addListener(aNode.toIndex(),getCppuType(&xListener),xListener.get());
- }
-
- /** Add a <type scope='com::sun::star::beans'>XPropertiesChangeListener</type>
- observing all properties of <var>aNode</var>.
- */
- void add(configuration::NodeID const& aNode, uno::Reference< css::beans::XPropertiesChangeListener > const& xListener)
- {
- OSL_PRECOND(xListener.is(), "ERROR: Unexpected NULL listener");
-
- // ignore the names for now
- m_aListeners.addListener(aNode.toIndex(),getCppuType(&xListener),xListener.get());
- }
-
- /** Add a <type scope='com::sun::star::beans'>XPropertiesChangeListener</type>
- observing the properties of <var>aNode</var> (optimally only those given by <var>aNames</var>.
- */
- void add(configuration::NodeID const& aNode, uno::Reference< css::beans::XPropertiesChangeListener > const& xListener, uno::Sequence< rtl::OUString> const& aNames)
- {
- OSL_PRECOND(xListener.is(), "ERROR: Unexpected NULL listener");
- OSL_PRECOND(aNames.getLength() > 0, "ERROR: Unexpected empty sequence");
-
- uno::Reference< css::beans::XPropertiesChangeListener > xForwarder( new PropertiesFilteredNotifier(xListener,aNames) );
- // ignore the names for now
- add(aNode,xForwarder);
- }
-
- // ---------------------------------------------------------------------------------------------------
- /// Remove a <type scope='com::sun::star::lang'>XEventListener</type> observing <var>aNode</var>.
- void remove(configuration::NodeID const& aNode, uno::Reference< css::lang::XEventListener > const& xListener)
- {
- // ignore the names for now
- m_aListeners.removeListener(aNode.toIndex(),getCppuType(&xListener),xListener.get());
- }
-
- /// Remove a <type scope='com::sun::star::container'>XContainerListener</type> observing <var>aNode</var>.
- void remove(configuration::NodeID const& aNode, uno::Reference< css::container::XContainerListener > const& xListener)
- {
- // ignore the names for now
- m_aListeners.removeListener(aNode.toIndex(),getCppuType(&xListener),xListener.get());
- }
-
- /// Remove a <type scope='com::sun::star::util'>XChangesListener</type> observing <var>aNode</var> and its descendants.
- void remove(configuration::NodeID const& aNode, uno::Reference< css::util::XChangesListener > const& xListener)
- {
- // ignore the names for now
- m_aListeners.removeListener(aNode.toIndex(),getCppuType(&xListener),xListener.get());
- }
-
- /// Remove a <type scope='com::sun::star::beans'>XPropertyChangeListener</type> observing <var>aNode</var>.
- void removeNamed(configuration::SubNodeID const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener)
- {
- // ignore the names for now
- m_aListeners.removeSpecialListener(aNode,xListener.get());
- }
- /// Remove a <type scope='com::sun::star::beans'>XPropertyChangeListener</type> observing <var>aNode</var>.
- void removeForAll(configuration::NodeID const& aNode, uno::Reference< css::beans::XPropertyChangeListener > const& xListener)
- {
- // ignore the names for now
- m_aListeners.removeListener(aNode.toIndex(),getCppuType(&xListener),xListener.get());
- }
- /// Remove a <type scope='com::sun::star::beans'>XVetoableChangeListener</type> constraining <var>aNode</var>.
- void removeNamed(configuration::SubNodeID const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener)
- {
- // ignore the names for now
- m_aListeners.removeSpecialListener(aNode,xListener.get());
- }
- /// Remove a <type scope='com::sun::star::beans'>XVetoableChangeListener</type> constraining <var>aNode</var>.
- void removeForAll(configuration::NodeID const& aNode, uno::Reference< css::beans::XVetoableChangeListener > const& xListener)
- {
- // ignore the names for now
- m_aListeners.removeListener(aNode.toIndex(),getCppuType(&xListener),xListener.get());
- }
-
-
- /** Remove a <type scope='com::sun::star::beans'>XPropertiesChangeListener</type>
- observing any properties of <var>aNode</var>.
- */
- void remove(configuration::NodeID const& aNode, uno::Reference< css::beans::XPropertiesChangeListener > const& xListener)
- {
- // ignore the names for now
- m_aListeners.removeListener(aNode.toIndex(),getCppuType(&xListener),xListener.get());
- }
- // ---------------------------------------------------------------------------------------------------
- };
-
-// ---------------------------------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_API_NOTIFIERIMPL_HXX_
diff --git a/configmgr/source/api2/objectregistry.hxx b/configmgr/source/api2/objectregistry.hxx
deleted file mode 100644
index 30d47b3bf3..0000000000
--- a/configmgr/source/api2/objectregistry.hxx
+++ /dev/null
@@ -1,95 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_OBJECTREGISTRY_HXX_
-#define CONFIGMGR_API_OBJECTREGISTRY_HXX_
-
-#include "noderef.hxx"
-
-#include <osl/mutex.hxx>
-#include <vos/refernce.hxx>
-
-#include <hash_map>
-#include "tracer.hxx"
-
-namespace configmgr
-{
- namespace configapi
- {
-
- class NodeElement;
-
- class ObjectRegistry : public vos::OReference
- {
- public:
- static NodeElement* notFound() { return 0; }
-
- struct KeyHash
- {
- size_t operator() (const configuration::NodeID& rKey) const {return rKey.hashCode();}
- };
- struct KeyEq
- {
- bool operator() (const configuration::NodeID& lhs,const configuration::NodeID& rhs) const {return lhs == rhs;}
- };
- typedef std::hash_map<configuration::NodeID,NodeElement*,KeyHash, KeyEq> ObjectMap;
- public:
- ObjectRegistry() {}
- ~ObjectRegistry();
-
- NodeElement* findElement(configuration::NodeID const& aNode) const
- {
- ObjectMap::const_iterator aFound = m_aMap.find(aNode);
-
- return (aFound != m_aMap.end()) ? aFound->second : notFound();
- }
- void registerElement(configuration::NodeID const& aNode, NodeElement* aElement)
- {
- OSL_ENSURE(m_aMap.find(aNode) == m_aMap.end(), "ERROR: Node is already registered");
-
- m_aMap[aNode] = aElement;
- }
- void revokeElement(configuration::NodeID const& aNode, NodeElement* aElement)
- {
- ObjectMap::iterator aFound = m_aMap.find(aNode);
-
- if (aFound != m_aMap.end())
- {
- OSL_ENSURE(aFound->second == aElement,"Found unexpected element in map");
-
- if (aFound->second == aElement)
- m_aMap.erase(aFound);
- }
- }
- private:
- ObjectMap m_aMap;
- };
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_API_FACTORY_HXX_
diff --git a/configmgr/source/api2/propertiesfilterednotifier.cxx b/configmgr/source/api2/propertiesfilterednotifier.cxx
deleted file mode 100644
index 8da631242f..0000000000
--- a/configmgr/source/api2/propertiesfilterednotifier.cxx
+++ /dev/null
@@ -1,151 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "propertiesfilterednotifier.hxx"
-
-#include <cppuhelper/queryinterface.hxx>
-
-namespace configmgr
-{
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace beans = ::com::sun::star::beans;
-
-//-----------------------------------------------------------------------------
-// class PropertiesFilteredNotifier
-//-----------------------------------------------------------------------------
-
-PropertiesFilteredNotifier::PropertiesFilteredNotifier(
- uno::Reference< beans::XPropertiesChangeListener >const& xTarget,
- uno::Sequence< rtl::OUString > const& aFilterNames
-)
-: m_aRefCount()
-, m_xTarget(xTarget)
-, m_aFilterNames(aFilterNames)
-{
- OSL_ENSURE(xTarget.is(),"PropertiesFilteredNotifier: FORWARDING TO NULL LISTENER");
- OSL_ENSURE(aFilterNames.getLength() > 0,"PropertiesFilteredNotifier: FILTER IS EMPTY (no target)");
-}
-//-----------------------------------------------------------------------------
-
-PropertiesFilteredNotifier::~PropertiesFilteredNotifier()
-{
-}
-//-----------------------------------------------------------------------------
-
-void SAL_CALL PropertiesFilteredNotifier::acquire() throw()
-{
- m_aRefCount.acquire();
-}
-//-----------------------------------------------------------------------------
-
-void SAL_CALL PropertiesFilteredNotifier::release( ) throw()
-{
- if (m_aRefCount.release() == 0)
- delete this;
-}
-//-----------------------------------------------------------------------------
-
-uno::Any SAL_CALL PropertiesFilteredNotifier::queryInterface( const uno::Type& aType )
- throw(uno::RuntimeException)
-{
- return cppu::queryInterface(aType
- , static_cast< beans::XPropertiesChangeListener *>(this)
- , static_cast< lang::XEventListener *>(this)
- , static_cast< uno::XInterface *>(this)
- );
-}
-//-----------------------------------------------------------------------------
-
-void SAL_CALL PropertiesFilteredNotifier::disposing( const lang::EventObject& Source )
- throw(uno::RuntimeException)
-{
- if (m_xTarget.is())
- m_xTarget->disposing(Source);
-}
-//-----------------------------------------------------------------------------
-
-inline // private and only used twice
-bool PropertiesFilteredNotifier::implAccept(const ::com::sun::star::beans::PropertyChangeEvent& evt) const
-{
- // todo: optimize by presorting and binary searching
- sal_Int32 const nCount = m_aFilterNames.getLength();
-
- for (sal_Int32 i = 0; i<nCount; ++i)
- if (evt.PropertyName == m_aFilterNames[i])
- return true;
- return false;
-}
-//-----------------------------------------------------------------------------
-
-// private and only used once
-uno::Sequence< beans::PropertyChangeEvent > PropertiesFilteredNotifier::implFilter(const uno::Sequence< beans::PropertyChangeEvent >& evt) const
-{
- sal_Int32 const nSize = evt.getLength();
- sal_Int32 nAccepted = 0;
-
- while ( nAccepted < nSize && implAccept(evt[nAccepted]) )
- ++nAccepted;
-
- if (nAccepted == nSize) // all accepted
- return evt;
-
- // create a modified copy
- uno::Sequence< beans::PropertyChangeEvent > aResult(evt);
- for (sal_Int32 nCur = nAccepted+1; nCur<nSize; ++nCur)
- {
- if (implAccept(evt[nCur]))
- {
- aResult[nAccepted++] = evt[nCur];
- }
- }
- aResult.realloc(nAccepted);
- OSL_ASSERT(aResult.getLength() == nAccepted);
-
- return aResult;
-}
-//-----------------------------------------------------------------------------
-
-void SAL_CALL PropertiesFilteredNotifier::propertiesChange( const uno::Sequence< beans::PropertyChangeEvent >& evt )
- throw(uno::RuntimeException)
-{
- uno::Sequence< beans::PropertyChangeEvent > aFilteredEvt( implFilter(evt) );
-
- if (aFilteredEvt.getLength() > 0)
- {
- if (m_xTarget.is())
- m_xTarget->propertiesChange(aFilteredEvt);
- }
-}
-//-----------------------------------------------------------------------------
-
-}
-
-
diff --git a/configmgr/source/api2/propertiesfilterednotifier.hxx b/configmgr/source/api2/propertiesfilterednotifier.hxx
deleted file mode 100644
index e9d32fd56f..0000000000
--- a/configmgr/source/api2/propertiesfilterednotifier.hxx
+++ /dev/null
@@ -1,76 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_PROPERTIESFILTEREDNOTIFIER_HXX_
-#define CONFIGMGR_PROPERTIESFILTEREDNOTIFIER_HXX_
-
-#include <com/sun/star/beans/XPropertiesChangeListener.hpp>
-
-#include <vos/refernce.hxx>
-
-namespace configmgr
-{
- class PropertiesFilteredNotifier
- : public ::com::sun::star::beans::XPropertiesChangeListener
- {
- public:
- PropertiesFilteredNotifier(
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener > const& xTarget,
- ::com::sun::star::uno::Sequence< ::rtl::OUString > const& aFilterNames
- );
- virtual ~PropertiesFilteredNotifier();
-
- public:
- virtual void SAL_CALL acquire( ) throw();
- virtual void SAL_CALL release( ) throw();
-
- virtual ::com::sun::star::uno::Any SAL_CALL
- queryInterface( const ::com::sun::star::uno::Type& aType )
- throw(::com::sun::star::uno::RuntimeException);
-
- virtual void SAL_CALL
- disposing( const ::com::sun::star::lang::EventObject& Source )
- throw(::com::sun::star::uno::RuntimeException) ;
-
- virtual void SAL_CALL
- propertiesChange( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyChangeEvent >& evt )
- throw(::com::sun::star::uno::RuntimeException);
- private:
- ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyChangeEvent >
- implFilter(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyChangeEvent >& evt)
- const;
-
- bool implAccept(const ::com::sun::star::beans::PropertyChangeEvent& evt) const;
-
- ::vos::ORefCount m_aRefCount;
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener > m_xTarget;
- ::com::sun::star::uno::Sequence< ::rtl::OUString > m_aFilterNames;
- };
-}
-
-#endif // CONFIGMGR_PROPERTIESFILTEREDNOTIFIER_HXX_
-
diff --git a/configmgr/source/api2/propertyinfohelper.cxx b/configmgr/source/api2/propertyinfohelper.cxx
deleted file mode 100644
index bc848e3862..0000000000
--- a/configmgr/source/api2/propertyinfohelper.cxx
+++ /dev/null
@@ -1,72 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "propertyinfohelper.hxx"
-#include "configpath.hxx"
-#include "attributes.hxx"
-
-#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HDL_
-#include <com/sun/star/beans/PropertyAttribute.hdl>
-#endif
-
-namespace configmgr
-{
- namespace css = ::com::sun::star;
- namespace uno = ::com::sun::star::uno;
- namespace beans = ::com::sun::star::beans;
-
- namespace configapi
- {
-//-----------------------------------------------------------------------------
-beans::Property helperMakeProperty(rtl::OUString const& aName,
- node::Attributes const aAttributes,
- uno::Type const& aType,
- bool bDefaultable )
- throw(uno::RuntimeException)
-{
- namespace PropertyAttribute = com::sun::star::beans::PropertyAttribute;
-
- sal_Int16 nPropAttributes = 0;
- if (aAttributes.isReadonly()) nPropAttributes |= PropertyAttribute::READONLY;
- if (aAttributes.isNullable()) nPropAttributes |= PropertyAttribute::MAYBEVOID;
- /*if ( aAttributes.bNotified)*/ nPropAttributes |= PropertyAttribute::BOUND;
- /*if ( aAttributes.bConstrained)nPropAttributes |= PropertyAttribute::CONSTRAINED;*/
-
- if ( aAttributes.isRemovable()) nPropAttributes |= PropertyAttribute::REMOVABLE;
- if ( bDefaultable) nPropAttributes |= PropertyAttribute::MAYBEDEFAULT;
-
- return beans::Property(aName, -1, aType, nPropAttributes);
-}
-//-----------------------------------------------------------------------------
- }
-
-}
-
-
diff --git a/configmgr/source/api2/propertyinfohelper.hxx b/configmgr/source/api2/propertyinfohelper.hxx
deleted file mode 100644
index f2f6af6cdd..0000000000
--- a/configmgr/source/api2/propertyinfohelper.hxx
+++ /dev/null
@@ -1,56 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_PROPERTYINFOIMPL_HXX_
-#define CONFIGMGR_API_PROPERTYINFOIMPL_HXX_
-
-#include <com/sun/star/beans/Property.hpp>
-#include <com/sun/star/uno/RuntimeException.hpp>
-
-namespace configmgr
-{
- namespace uno = ::com::sun::star::uno;
- namespace beans = ::com::sun::star::beans;
-
- /* implementations of the interfaces supported by a (parent) node
- within the configuration tree.
- (read-only operation)
- */
- namespace node { struct Attributes; }
-
- namespace configapi
- {
- // translation helper
- beans::Property helperMakeProperty( rtl::OUString const& aName, node::Attributes const aAttributes, uno::Type const& aType, bool bDefaultable )
- throw(uno::RuntimeException);
-
- }
-
-}
-#endif // CONFIGMGR_API_PROPERTYINFOIMPL_HXX_
-
-
diff --git a/configmgr/source/api2/propertysetaccess.cxx b/configmgr/source/api2/propertysetaccess.cxx
deleted file mode 100644
index 73d126d6c1..0000000000
--- a/configmgr/source/api2/propertysetaccess.cxx
+++ /dev/null
@@ -1,275 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "propertysetaccess.hxx"
-#include "propsetaccessimpl.hxx"
-#include "apinotifierimpl.hxx"
-#include "apinodeaccess.hxx"
-#include "apinodeupdate.hxx"
-
-namespace configmgr
-{
-//////////////////////////////////////////////////////////////////////////////////
-// class BasicPropertySet
-//////////////////////////////////////////////////////////////////////////////////
-
-//////////////////////////////////////////////////////////////////////////////////
-// getting Property Metadata
-//////////////////////////////////////////////////////////////////////////////////
-
-// XPropertySet & XMultiPropertySet
-//////////////////////////////////////////////////////////////////////////////////
-uno::Reference< beans::XPropertySetInfo > SAL_CALL BasicPropertySet::getPropertySetInfo( )
- throw(uno::RuntimeException)
-{
- return configapi::implGetPropertySetInfo( getNode(), NULL != maybeGetUpdateAccess() );
-}
-
-// XHierarchicalPropertySet & XHierarchicalMultiPropertySet
-//////////////////////////////////////////////////////////////////////////////////
-uno::Reference< beans::XHierarchicalPropertySetInfo > SAL_CALL BasicPropertySet::getHierarchicalPropertySetInfo( )
- throw(uno::RuntimeException)
-{
- return configapi::implGetHierarchicalPropertySetInfo( getNode() );
-}
-
-//////////////////////////////////////////////////////////////////////////////////
-// setting values - may all throw (PropertyVeto)Exceptions on read-only property sets
-//////////////////////////////////////////////////////////////////////////////////
-
-/// get the access for updating, check that it is present
-configapi::NodeGroupAccess& BasicPropertySet::getGroupNode()
-{
- configapi::NodeGroupAccess* pAccess = maybeGetUpdateAccess();
- OSL_ENSURE(pAccess, "Write operation invoked on a read-only node access - failing with PropertyVetoException");
-
- if (!pAccess)
- {
- throw beans::PropertyVetoException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: INTERNAL VETO - Write operation invoked on a read-only node access")),
- static_cast< beans::XPropertySet * >(this)
- );
- }
- return *pAccess;
-}
-
-// XPropertySet
-//////////////////////////////////////////////////////////////////////////////////
-void SAL_CALL BasicPropertySet::setPropertyValue( const rtl::OUString& aPropertyName, const uno::Any& aValue )
- throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- configapi::implSetPropertyValue( getGroupNode(), aPropertyName, aValue );
-}
-
-// XMultiPropertySet
-//////////////////////////////////////////////////////////////////////////////////
-void SAL_CALL BasicPropertySet::setPropertyValues( const uno::Sequence< rtl::OUString >& PropertyNames, const uno::Sequence< uno::Any >& Values )
- throw(beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- configapi::implSetPropertyValues( getGroupNode(), PropertyNames, Values );
-}
-
-// XHierarchicalPropertySet
-//////////////////////////////////////////////////////////////////////////////////
-void SAL_CALL BasicPropertySet::setHierarchicalPropertyValue( const rtl::OUString& aPropertyName, const uno::Any& aValue )
- throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- configapi::implSetHierarchicalPropertyValue( getGroupNode(), aPropertyName, aValue );
-}
-
-// XMultiHierarchicalPropertySet
-//////////////////////////////////////////////////////////////////////////////////
-void SAL_CALL BasicPropertySet::setHierarchicalPropertyValues( const uno::Sequence< rtl::OUString >& PropertyNames, const uno::Sequence< uno::Any >& Values )
- throw(beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- configapi::implSetHierarchicalPropertyValues( getGroupNode(), PropertyNames, Values );
-}
-
-
-//////////////////////////////////////////////////////////////////////////////////
-// getting values
-//////////////////////////////////////////////////////////////////////////////////
-// XPropertySet
-//////////////////////////////////////////////////////////////////////////////////
-uno::Any SAL_CALL BasicPropertySet::getPropertyValue( const rtl::OUString& aPropertyName )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- return configapi::implGetPropertyValue( getNode(), aPropertyName );
-}
-
-// XMultiPropertySet
-//////////////////////////////////////////////////////////////////////////////////
-uno::Sequence< uno::Any > SAL_CALL BasicPropertySet::getPropertyValues( const uno::Sequence< rtl::OUString >& aPropertyNames )
- throw(uno::RuntimeException)
-{
- return configapi::implGetPropertyValues( getNode(), aPropertyNames );
-}
-
-// XHierarchicalPropertySet
-//////////////////////////////////////////////////////////////////////////////////
-uno::Any SAL_CALL BasicPropertySet::getHierarchicalPropertyValue( const rtl::OUString& aPropertyName )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- return configapi::implGetHierarchicalPropertyValue( getNode(), aPropertyName );
-}
-
-// XMultiHierarchicalPropertySet
-//////////////////////////////////////////////////////////////////////////////////
-uno::Sequence< uno::Any > SAL_CALL BasicPropertySet::getHierarchicalPropertyValues( const uno::Sequence< rtl::OUString >& aPropertyNames )
- throw(uno::RuntimeException)
-{
- return configapi::implGetHierarchicalPropertyValues( getNode(), aPropertyNames );
-}
-
-//////////////////////////////////////////////////////////////////////////////////
-// adding/removing listeners
-//////////////////////////////////////////////////////////////////////////////////
-
-void SAL_CALL BasicPropertySet::addVetoableChangeListener( const rtl::OUString& aPropertyName, const uno::Reference< beans::XVetoableChangeListener >& xListener )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- configapi::implAddListener( getNode(), xListener, aPropertyName );
-}
-
-void SAL_CALL BasicPropertySet::addPropertyChangeListener( const rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- configapi::implAddListener( getNode(), xListener, aPropertyName );
-}
-
-void SAL_CALL BasicPropertySet::addPropertiesChangeListener( const uno::Sequence< rtl::OUString >& aPropertyNames, const uno::Reference< beans::XPropertiesChangeListener >& xListener )
- throw(uno::RuntimeException)
-{
- configapi::implAddListener( getNode(), xListener, aPropertyNames );
-}
-
-//////////////////////////////////////////////////////////////////////////////////
-void SAL_CALL BasicPropertySet::removeVetoableChangeListener( const rtl::OUString& aPropertyName, const uno::Reference< beans::XVetoableChangeListener >& xListener )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- configapi::implRemoveListener( getNode(), xListener, aPropertyName );
-}
-//---------------------------------------------------------------------------------
-
-void SAL_CALL BasicPropertySet::removePropertyChangeListener( const rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- configapi::implRemoveListener( getNode(), xListener, aPropertyName );
-}
-//---------------------------------------------------------------------------------
-
-void SAL_CALL BasicPropertySet::removePropertiesChangeListener( const uno::Reference< beans::XPropertiesChangeListener >& xListener )
- throw(uno::RuntimeException)
-{
- configapi::implRemoveListener( getNode(), xListener );
-}
-//---------------------------------------------------------------------------------
-
-
-//////////////////////////////////////////////////////////////////////////////////
-// SPECIAL: XMultiPropertySet::firePropertiesChangeEvent
-//////////////////////////////////////////////////////////////////////////////////
-void SAL_CALL BasicPropertySet::firePropertiesChangeEvent( const uno::Sequence< rtl::OUString >& aPropertyNames, const uno::Reference< beans::XPropertiesChangeListener >& xListener )
- throw(uno::RuntimeException)
-{
- configapi::implFirePropertiesChangeEvent( getNode(),aPropertyNames , xListener );
-}
-
-//////////////////////////////////////////////////////////////////////////////////
-// XPropertyState / XMultiPropertyStates
-//////////////////////////////////////////////////////////////////////////////////
-
-// getting property states
-//////////////////////////////////////////////////////////////////////////////////
-
-beans::PropertyState SAL_CALL BasicPropertySet::getPropertyState( const rtl::OUString& sPropertyName )
- throw(beans::UnknownPropertyException, uno::RuntimeException)
-{
- return configapi::implGetPropertyState( getNode(), sPropertyName);
-}
-//---------------------------------------------------------------------------------
-
-uno::Sequence< beans::PropertyState > SAL_CALL BasicPropertySet::getPropertyStates( const uno::Sequence< rtl::OUString >& aPropertyNames )
- throw(beans::UnknownPropertyException, uno::RuntimeException)
-{
- return configapi::implGetPropertyStates( getNode(), aPropertyNames );
-}
-//---------------------------------------------------------------------------------
-
-// setting to default state
-//////////////////////////////////////////////////////////////////////////////////
-
-void SAL_CALL BasicPropertySet::setPropertyToDefault( const rtl::OUString& sPropertyName )
- throw(beans::UnknownPropertyException, uno::RuntimeException)
-{
- configapi::implSetPropertyToDefault( getGroupNode(), sPropertyName);
-}
-//---------------------------------------------------------------------------------
-
-void SAL_CALL BasicPropertySet::setPropertiesToDefault( const uno::Sequence< rtl::OUString >& aPropertyNames )
- throw (beans::UnknownPropertyException, uno::RuntimeException)
-{
- configapi::implSetPropertiesToDefault( getGroupNode(), aPropertyNames);
-}
-//---------------------------------------------------------------------------------
-
-void SAL_CALL BasicPropertySet::setAllPropertiesToDefault( )
- throw (uno::RuntimeException)
-{
- configapi::implSetAllPropertiesToDefault( getGroupNode() );
-}
-//---------------------------------------------------------------------------------
-
-// getting defaults
-//////////////////////////////////////////////////////////////////////////////////
-
-uno::Any SAL_CALL BasicPropertySet::getPropertyDefault( const rtl::OUString& sPropertyName )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-
-{
- return configapi::implGetPropertyDefault( getNode(), sPropertyName);
-}
-//---------------------------------------------------------------------------------
-
-uno::Sequence< uno::Any > SAL_CALL BasicPropertySet::getPropertyDefaults( const uno::Sequence< rtl::OUString >& aPropertyNames )
- throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- return configapi::implGetPropertyDefaults( getNode(), aPropertyNames);
-}
-//---------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-} // namespace configmgr
-
-
diff --git a/configmgr/source/api2/propertysetaccess.hxx b/configmgr/source/api2/propertysetaccess.hxx
deleted file mode 100644
index 58bbe38883..0000000000
--- a/configmgr/source/api2/propertysetaccess.hxx
+++ /dev/null
@@ -1,215 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_PROPERTYSET_HXX_
-#define CONFIGMGR_API_PROPERTYSET_HXX_
-
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/beans/XHierarchicalPropertySet.hpp>
-#include <com/sun/star/beans/XMultiPropertySet.hpp>
-#include <com/sun/star/beans/XMultiHierarchicalPropertySet.hpp>
-#include <com/sun/star/beans/XPropertyState.hpp>
-#include <com/sun/star/beans/XMultiPropertyStates.hpp>
-#include <cppuhelper/implbase6.hxx>
-
-namespace configmgr
-{
-/////////////////////////////////////////////////////////////////////////////////////////////
- namespace css = ::com::sun::star;
- namespace uno = css::uno;
- namespace lang = css::lang;
- namespace beans = css::beans;
-
- namespace configapi
- {
- class NodeGroupAccess;
- class NodeGroupInfoAccess;
- }
-
-/////////////////////////////////////////////////////////////////////////////////////////////
-
-/** implements the interfaces supported by a group node, viewed as a property set
- within the configuration tree.
- <p> Is an interface adapter around <type scope='configmgr::configapi'>NodeGroup(Info)Access</type>.</p>
-*/
-class BasicPropertySet
-: public ::cppu::ImplHelper6
- < beans::XPropertySet
- , beans::XMultiPropertySet
- , beans::XHierarchicalPropertySet
- , beans::XMultiHierarchicalPropertySet
- , beans::XPropertyState
- , beans::XMultiPropertyStates
- >
-{
-protected:
-// Constructors & Destructors
- virtual ~BasicPropertySet() {}
-
-public:
-// getting Property Metadata
- // XPropertySet & XMultiPropertySet
- virtual uno::Reference< beans::XPropertySetInfo > SAL_CALL
- getPropertySetInfo( )
- throw(uno::RuntimeException);
-
- // XHierarchicalPropertySet & XHierarchicalMultiPropertySet
- virtual uno::Reference< beans::XHierarchicalPropertySetInfo > SAL_CALL
- getHierarchicalPropertySetInfo( )
- throw(uno::RuntimeException);
-
-// setting values - may all throw (PropertyVeto)Exceptions on read-only property sets
- // XPropertySet
- virtual void SAL_CALL
- setPropertyValue( const rtl::OUString& aPropertyName, const uno::Any& aValue )
- throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, uno::RuntimeException);
-
- // XMultiPropertySet
- virtual void SAL_CALL
- setPropertyValues( const uno::Sequence< rtl::OUString >& PropertyNames, const uno::Sequence< uno::Any >& Values )
- throw(beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, uno::RuntimeException);
-
- // XHierarchicalPropertySet
- virtual void SAL_CALL
- setHierarchicalPropertyValue( const rtl::OUString& aPropertyName, const uno::Any& aValue )
- throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, uno::RuntimeException);
-
- // XMultiHierarchicalPropertySet
- virtual void SAL_CALL
- setHierarchicalPropertyValues( const uno::Sequence< rtl::OUString >& PropertyNames, const uno::Sequence< uno::Any >& Values )
- throw(beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, uno::RuntimeException);
-
-// getting values
- // XPropertySet
- virtual uno::Any SAL_CALL
- getPropertyValue( const rtl::OUString& PropertyName )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
-
- // XMultiPropertySet
- virtual uno::Sequence< uno::Any > SAL_CALL
- getPropertyValues( const uno::Sequence< rtl::OUString >& aPropertyNames )
- throw(uno::RuntimeException);
-
- // XHierarchicalPropertySet
- virtual uno::Any SAL_CALL
- getHierarchicalPropertyValue( const rtl::OUString& PropertyName )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
-
- // XMultiHierarchicalPropertySet
- virtual uno::Sequence< uno::Any > SAL_CALL
- getHierarchicalPropertyValues( const uno::Sequence< rtl::OUString >& aPropertyNames )
- throw(uno::RuntimeException);
-
-// adding listeners
- // XPropertySet
- virtual void SAL_CALL
- addPropertyChangeListener( const rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
-
- // XMultiPropertySet
- virtual void SAL_CALL
- addPropertiesChangeListener( const uno::Sequence< rtl::OUString >& aPropertyNames, const uno::Reference< beans::XPropertiesChangeListener >& xListener )
- throw(uno::RuntimeException);
-
-// removing listeners
- // XPropertySet
- virtual void SAL_CALL
- removePropertyChangeListener( const rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
-
- // XMultiPropertySet
- virtual void SAL_CALL
- removePropertiesChangeListener( const uno::Reference< beans::XPropertiesChangeListener >& Listener )
- throw(uno::RuntimeException);
-
-// SPECIAL: support for VetoableChangeListeners
- // XPropertySet
- virtual void SAL_CALL
- addVetoableChangeListener( const rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- removeVetoableChangeListener( const rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
-
-// SPECIAL: firePropertiesChangeEvent
- // XMultiPropertySet
- virtual void SAL_CALL
- firePropertiesChangeEvent( const uno::Sequence< rtl::OUString >& aPropertyNames, const uno::Reference< beans::XPropertiesChangeListener >& xListener )
- throw(uno::RuntimeException);
-
-// XPropertyState
- virtual beans::PropertyState SAL_CALL
- getPropertyState( const rtl::OUString& PropertyName )
- throw(beans::UnknownPropertyException, uno::RuntimeException);
-
- // see below:
- // virtual uno::Sequence< beans::PropertyState > SAL_CALL
- // getPropertyStates( const uno::Sequence< rtl::OUString >& aPropertyName )
- // throw(beans::UnknownPropertyException, uno::RuntimeException);
-
- virtual void SAL_CALL
- setPropertyToDefault( const rtl::OUString& PropertyName )
- throw(beans::UnknownPropertyException, uno::RuntimeException);
-
- virtual uno::Any SAL_CALL
- getPropertyDefault( const rtl::OUString& aPropertyName )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
-
-// XMultiPropertyStates
- virtual uno::Sequence< beans::PropertyState > SAL_CALL
- getPropertyStates( const uno::Sequence< rtl::OUString >& aPropertyName )
- throw (beans::UnknownPropertyException, uno::RuntimeException);
-
- virtual void SAL_CALL
- setAllPropertiesToDefault( )
- throw (uno::RuntimeException);
-
- virtual void SAL_CALL
- setPropertiesToDefault( const uno::Sequence< rtl::OUString >& aPropertyNames )
- throw (beans::UnknownPropertyException, uno::RuntimeException);
-
- virtual uno::Sequence< uno::Any > SAL_CALL
- getPropertyDefaults( const uno::Sequence< rtl::OUString >& aPropertyNames )
- throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
-
-protected:
- virtual configapi::NodeGroupInfoAccess& getNode() = 0;
- configapi::NodeGroupAccess& getGroupNode();
- virtual configapi::NodeGroupAccess* maybeGetUpdateAccess() = 0;
-};
-
-//--------------------------------------------------------------------------
-
-}
-#endif // CONFIGMGR_API_PROPERTYSET_HXX_
-
-
diff --git a/configmgr/source/api2/propsetaccessimpl.cxx b/configmgr/source/api2/propsetaccessimpl.cxx
deleted file mode 100644
index 9bac184bd4..0000000000
--- a/configmgr/source/api2/propsetaccessimpl.cxx
+++ /dev/null
@@ -1,1284 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "propsetaccessimpl.hxx"
-#include "propertyinfohelper.hxx"
-#include "apinodeaccess.hxx"
-#include "apinodeupdate.hxx"
-#include "noderef.hxx"
-#include "valueref.hxx"
-#include "anynoderef.hxx"
-#include "nodechange.hxx"
-#include "configgroup.hxx"
-#include "confignotifier.hxx"
-#include "broadcaster.hxx"
-#include "apitypes.hxx"
-#include "attributes.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/beans/XPropertySetInfo.hpp>
-#include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <osl/diagnose.h>
-#include <cppuhelper/implbase1.hxx>
-
-#ifndef INCLUDED_ALGORITHM
-#include <algorithm>
-#define INCLUDED_ALGORITHM
-#endif
-
-namespace configmgr
-{
- namespace configapi
- {
-//-----------------------------------------------------------------------------------
- namespace lang = css::lang;
- namespace beans = css::beans;
-
-//-----------------------------------------------------------------------------------
-// a helper class
-//-----------------------------------------------------------------------------------
-
-class CollectProperties : configuration::NodeVisitor
-{
- std::vector< beans::Property > m_aProperties;
- sal_Bool m_bReadonly;
-public:
- CollectProperties(sal_Bool _bReadonly)
- : m_bReadonly(_bReadonly)
- { }
- CollectProperties(sal_Bool _bReadonly, sal_Int32 _nCount)
- : m_bReadonly(_bReadonly)
- { m_aProperties.reserve(_nCount); }
-
- uno::Sequence<beans::Property> forChildren(rtl::Reference< configuration::Tree > const& _aPropertyTree, configuration::NodeRef const& _rNode)
- {
- OSL_ENSURE( _rNode.isValid() && _aPropertyTree->isValidNode(_rNode.getOffset()), "Node to retrieve properties from does not match tree");
- reset();
- _aPropertyTree->dispatchToChildren(_rNode, *this);
- return makeSequence(m_aProperties);
- }
-
-private:
- void reset() { m_aProperties.clear(); }
-
- node::Attributes adjustAttributes(node::Attributes nNodeAttr);
-
- Result handle(rtl::Reference< configuration::Tree > const& _aTree, configuration::NodeRef const& _rValue);
- Result handle(rtl::Reference< configuration::Tree > const& _aTree, configuration::ValueRef const& _rValue);
-};
-
-//-----------------------------------------------------------------------------------
-node::Attributes CollectProperties::adjustAttributes(node::Attributes nNodeAttr)
-{
- if (m_bReadonly) nNodeAttr.markReadonly();
-
- return nNodeAttr;
-}
-
-//-----------------------------------------------------------------------------------
-CollectProperties::Result CollectProperties::handle(rtl::Reference< configuration::Tree > const& _aTree, configuration::ValueRef const& _rValue)
-{
- // can be default ?
- m_aProperties.push_back(
- helperMakeProperty( _rValue.m_sNodeName,
- adjustAttributes(_aTree->getAttributes(_rValue)),
- _aTree->getUnoType(_rValue),
- _aTree->hasNodeDefault(_rValue)
- )
- );
-
- return CONTINUE;
-}
-
-//-----------------------------------------------------------------------------------
-CollectProperties::Result CollectProperties::handle(rtl::Reference< configuration::Tree > const& _aTree, configuration::NodeRef const& _rNode)
-{
- // can be default ?
- OSL_ENSURE( configuration::isStructuralNode(_aTree,_rNode),
- "Unexpected value element node. Cannot get proper type for this node as property" );
-
- m_aProperties.push_back(
- helperMakeProperty( _aTree->getSimpleNodeName(_rNode.getOffset()),
- adjustAttributes(_aTree->getAttributes(_rNode)),
- getUnoInterfaceType(),
- _aTree->hasNodeDefault(_rNode)
- )
- );
-
- return CONTINUE;
-}
-
-//-----------------------------------------------------------------------------------
-// yet another helper class (more robust, but can't well be extended to be a HierarchicalPropertySetInfo though)
-//-----------------------------------------------------------------------------------
-
-class NodePropertySetInfo
- :public ::cppu::WeakImplHelper1< beans::XPropertySetInfo >
-{
- uno::Sequence< beans::Property > const m_aProperties;
-
-public:
- NodePropertySetInfo(uno::Sequence< beans::Property > const& _aProperties) throw(uno::RuntimeException)
- : m_aProperties(_aProperties)
- {
- }
-
- static NodePropertySetInfo* create(NodeGroupInfoAccess& _rNode, sal_Bool _bReadonly ) throw(uno::RuntimeException);
- beans::Property const* begin() const throw() { return m_aProperties.getConstArray(); }
- beans::Property const* end() const throw() { return m_aProperties.getConstArray() + m_aProperties.getLength(); }
-
- beans::Property const* find(const rtl::OUString& _rPropertyName) const throw(uno::RuntimeException);
-
- // XPropertySetInfo
- virtual uno::Sequence< beans::Property > SAL_CALL getProperties() throw(uno::RuntimeException);
- virtual beans::Property SAL_CALL getPropertyByName(const rtl::OUString& _rPropertyName) throw(beans::UnknownPropertyException, uno::RuntimeException);
- virtual sal_Bool SAL_CALL hasPropertyByName(const rtl::OUString& _rPropertyName) throw(uno::RuntimeException);
-};
-
-//-----------------------------------------------------------------------------------
-//-----------------------------------------------------------------------------------
-NodePropertySetInfo* NodePropertySetInfo::create(NodeGroupInfoAccess& _rNode, sal_Bool _bReadonly ) throw(uno::RuntimeException)
-{
- UnoApiLock aLock;
-
- rtl::Reference< configuration::Tree > aTree( _rNode.getTree() );
- OSL_ENSURE( !configuration::isEmpty(aTree.get()), "WARNING: Getting Tree information requires a valid tree");
- if (configuration::isEmpty(aTree.get())) return NULL;
-
- configuration::NodeRef aNode( _rNode.getNodeRef() );
- OSL_ENSURE( aNode.isValid() && aTree->isValidNode(aNode.getOffset()), "ERROR: Tree does not match node");
-
- uno::Sequence< beans::Property > aProperties = CollectProperties(_bReadonly).forChildren(aTree,aNode);
- OSL_ENSURE( aProperties.getLength() > 0, "ERROR: PropertySet (Configuration group) has no Properties");
-
- return new NodePropertySetInfo( aProperties );
-}
-
-//-----------------------------------------------------------------------------------
-struct MatchName // : std::unary_function< beans::Property, bool >
-{
- rtl::OUString sName;
- MatchName(rtl::OUString const& _sName) throw(uno::RuntimeException)
- : sName(_sName)
- {
- }
-
- bool operator()(beans::Property const& _aProperty) const
- {
- return !!(_aProperty.Name == this->sName);
- }
-};
-
-beans::Property const* NodePropertySetInfo::find(const rtl::OUString& _rPropertyName) const throw(uno::RuntimeException)
-{
- beans::Property const* const first = this->begin();
- beans::Property const* const last = this->end();
-
- return std::find_if(first,last,MatchName(_rPropertyName));
-}
-
-//-----------------------------------------------------------------------------------
-uno::Sequence< beans::Property > SAL_CALL NodePropertySetInfo::getProperties() throw(uno::RuntimeException)
-{
- return m_aProperties;
-}
-//-----------------------------------------------------------------------------------
-beans::Property SAL_CALL NodePropertySetInfo::getPropertyByName(const rtl::OUString& _rPropertyName)
- throw(beans::UnknownPropertyException, uno::RuntimeException)
-{
- UnoApiLock aLock;
-
- beans::Property const* pFound = find(_rPropertyName);
-
- if (pFound == this->end())
- {
- rtl::OUString sMessage = rtl::OUString::createFromAscii("Configuration - ");
- sMessage += rtl::OUString::createFromAscii("No Property named '");
- sMessage += _rPropertyName;
- sMessage += rtl::OUString::createFromAscii("' in this PropertySetInfo");
- throw beans::UnknownPropertyException(sMessage, static_cast<XPropertySetInfo*>(this));
- }
-
- return *pFound;
-}
-
-//-----------------------------------------------------------------------------------
-sal_Bool SAL_CALL NodePropertySetInfo::hasPropertyByName(const rtl::OUString& _rPropertyName)
- throw(uno::RuntimeException)
-{
- UnoApiLock aLock;
-
- beans::Property const* pFound = find(_rPropertyName);
-
- return (pFound != this->end());
-}
-
-// Interface methods
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-// getting Property Metadata
-//-----------------------------------------------------------------------------------
-
-// XPropertySet & XMultiPropertySet
-//-----------------------------------------------------------------------------------
-uno::Reference< beans::XPropertySetInfo > implGetPropertySetInfo( NodeGroupInfoAccess& rNode, sal_Bool _bWriteable )
- throw(uno::RuntimeException)
-{
- GuardedNodeData<NodeAccess> lock( rNode );
- return NodePropertySetInfo::create(rNode, !_bWriteable);
-}
-
-// XHierarchicalPropertySet & XHierarchicalMultiPropertySet
-//-----------------------------------------------------------------------------------
-uno::Reference< beans::XHierarchicalPropertySetInfo > implGetHierarchicalPropertySetInfo( NodeGroupInfoAccess& /*rNode*/ )
- throw(uno::RuntimeException)
-{
- // TODO: Implement
- return 0;
-}
-
-//-----------------------------------------------------------------------------------
-// setting values - may all throw (PropertyVeto)Exceptions on read-only property sets
-//-----------------------------------------------------------------------------------
-
-// XPropertySet
-//-----------------------------------------------------------------------------------
-void implSetPropertyValue( NodeGroupAccess& rNode, const rtl::OUString& sPropertyName, const uno::Any& aValue )
- throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- try
- {
- GuardedNodeUpdate<NodeGroupAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- rtl::OUString aChildName = configuration::validateChildName(sPropertyName,aTree,aNode);
-
- configuration::ValueRef aChild( aTree->getChildValue(aNode, aChildName) );
-
- if (!aChild.isValid())
- {
- if ( configuration::hasChildOrElement(aTree, aNode, aChildName) )
- {
- OSL_ENSURE(aTree->hasChildNode(aNode, aChildName),"ERROR: Configuration: Existing Property not found by implementation");
-
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value.") );
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(" Property '") );
- sMessage += sPropertyName;
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' is not a simple value.") );
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::PropertyVetoException( sMessage, xContext );
- }
- else
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value.") );
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(" Property '") );
- sMessage += sPropertyName;
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' not found in ") );
- sMessage += aTree->getAbsolutePath(aNode).toString();
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( sMessage, xContext );
- }
- }
-
- configuration::NodeChange aChange = lock.getNodeUpdater().validateSetValue( aChild, aValue );
- if (aChange.test().isChange())
- {
- Broadcaster aSender(rNode.getNotifier().makeBroadcaster(aChange,true));
-
- aSender.queryConstraints(aChange);
-
- aTree->integrate(aChange, aNode, true);
-
- lock.clearForBroadcast();
- aSender.notifyListeners(aChange);
- }
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( sMessage += e.message(), xContext );
- }
- catch (configuration::TypeMismatch& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.illegalArgument(2);
- }
- catch (configuration::ConstraintViolation& ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::PropertyVetoException( sMessage += e.message(), xContext );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-}
-
-// XMultiPropertySet
-//-----------------------------------------------------------------------------------
-void implSetPropertyValues( NodeGroupAccess& rNode, const uno::Sequence< rtl::OUString >& aPropertyNames, const uno::Sequence< uno::Any >& aValues )
- throw(beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- try
- {
- GuardedNodeUpdate<NodeGroupAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- configuration::NodeChanges aChanges;
- for(sal_Int32 i = 0, count= aValues.getLength(); i < count; ++i)
- {
- rtl::OUString aChildName( aPropertyNames[i] ); // not validated
-
- configuration::ValueRef aChild( aTree->getChildValue(aNode, aChildName) );
-
- if (!aChild.isValid())
- {
- if ( configuration::hasChildOrElement(aTree, aNode, aChildName) )
- {
- OSL_ENSURE(aTree->hasChildNode(aNode, aChildName),"ERROR: Configuration: Existing Property not found by implementation");
-
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Values.") );
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(" Property '") );
- sMessage += aChildName;
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' is not a simple value.") );
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::PropertyVetoException( sMessage, xContext );
- }
-
- OSL_TRACE("Configuration: MultiPropertySet: trying to set unknown property - ignored");
- continue;
- }
-
- configuration::NodeChange aChange = lock.getNodeUpdater().validateSetValue( aChild, aValues[i] );
- if (aChange.maybeChange())
- {
- aChanges.add(aChange);
- }
- }
-
- if (!aChanges.test().compact().isEmpty())
- {
- Broadcaster aSender(rNode.getNotifier().makeBroadcaster(aChanges,true));
-
- aSender.queryConstraints(aChanges);
-
- aTree->integrate(aChanges, aNode, true);
-
- lock.clearForBroadcast();
- aSender.notifyListeners(aChanges, true);
- }
- }
- catch (configuration::TypeMismatch& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.illegalArgument(2);
- }
- catch (configuration::ConstraintViolation& ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::PropertyVetoException( sMessage += e.message(), xContext );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-}
-
-// XHierarchicalPropertySet
-//-----------------------------------------------------------------------------------
-void implSetHierarchicalPropertyValue( NodeGroupAccess& rNode, const rtl::OUString& aPropertyName, const uno::Any& aValue )
- throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- try
- {
- GuardedNodeUpdate<NodeGroupAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- configuration::RelativePath const aRelPath = configuration::validateRelativePath( aPropertyName, aTree, aNode );
-
- configuration::AnyNodeRef aNestedValue = configuration::getLocalDescendant( aTree, aNode, aRelPath );
-
- if (!aNestedValue.isValid())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value. Property '") );
- sMessage += aRelPath.toString();
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' was not found in ") );
- sMessage += aTree->getAbsolutePath(aNode).toString();
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( sMessage, xContext );
- }
- if (aNestedValue.isNode())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value. Property '") );
- sMessage += aRelPath.toString();
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' is not a simple value property.") );
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::PropertyVetoException( sMessage, xContext );
- }
- OSL_ASSERT(aNode.isValid());
-
- configuration::NodeChange aChange = lock.getNodeUpdater().validateSetValue( aNestedValue.toValue(), aValue );
- if (aChange.test().isChange())
- {
- Broadcaster aSender(rNode.getNotifier().makeBroadcaster(aChange,false));
-
- aSender.queryConstraints(aChange);
-
- aTree->integrate(aChange, aNode, false);
-
- lock.clearForBroadcast();
- aSender.notifyListeners(aChange);
- }
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( e.message(), xContext );
- }
- catch (configuration::TypeMismatch& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.illegalArgument(2);
- }
- catch (configuration::ConstraintViolation& ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::PropertyVetoException( sMessage += e.message(), xContext );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-}
-
-// XMultiHierarchicalPropertySet
-//-----------------------------------------------------------------------------------
-void implSetHierarchicalPropertyValues( NodeGroupAccess& rNode, const uno::Sequence< rtl::OUString >& aPropertyNames, const uno::Sequence< uno::Any >& aValues )
- throw(beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- try
- {
- GuardedNodeUpdate<NodeGroupAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- configuration::NodeChanges aChanges;
- for(sal_Int32 i = 0, count= aValues.getLength(); i < count; ++i)
- try
- {
- configuration::RelativePath aRelPath = configuration::validateRelativePath( aPropertyNames[i], aTree, aNode );
-
- configuration::AnyNodeRef aNestedValue = configuration::getLocalDescendant( aTree, aNode, aRelPath );
-
- if (!aNestedValue.isValid())
- {
- OSL_TRACE("Configuration: MultiPropertySet: trying to set unknown property - ignored");
- continue;
- }
- if ( aNestedValue.isNode() )
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Values.") );
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(" Property '") );
- sMessage += aRelPath.toString();
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' is not a simple value property.") );
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::PropertyVetoException( sMessage, xContext );
- }
- OSL_ASSERT(aNode.isValid());
-
- configuration::NodeChange aChange = lock.getNodeUpdater().validateSetValue( aNestedValue.toValue(), aValues[i] );
- if (aChange.maybeChange())
- {
- aChanges.add(aChange);
- }
- }
- catch (configuration::InvalidName& )
- {
- OSL_TRACE("Configuration: MultiHierarchicalPropertySet: trying to set property <invalid path> - ignored");
- continue;
- }
-
- if (!aChanges.test().compact().isEmpty())
- {
- Broadcaster aSender(rNode.getNotifier().makeBroadcaster(aChanges,false));
-
- aSender.queryConstraints(aChanges);
-
- aTree->integrate(aChanges, aNode, false);
-
- lock.clearForBroadcast();
- aSender.notifyListeners(aChanges, true); // if we use 'false' we don't need 'Deep' change objects
- }
- }
- catch (configuration::TypeMismatch& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.illegalArgument(2);
- }
- catch (configuration::ConstraintViolation& ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Property Value: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::PropertyVetoException( sMessage += e.message(), xContext );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-}
-
-//-----------------------------------------------------------------------------------
-// getting values
-//-----------------------------------------------------------------------------------
-
-// XPropertySet
-//-----------------------------------------------------------------------------------
-uno::Any implGetPropertyValue( NodeGroupInfoAccess& rNode,const rtl::OUString& aPropertyName )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- rtl::OUString aChildName = configuration::validateChildName(aPropertyName,aTree,aNode);
-
- configuration::AnyNodeRef aChild( aTree->getAnyChild(aNode, aChildName) );
-
- if (!aChild.isValid())
- {
- OSL_ENSURE(!configuration::hasChildOrElement(aTree,aNode,aChildName),"ERROR: Configuration: Existing Property not found by implementation");
-
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot get Property Value. Property '") );
- sMessage += aPropertyName;
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' could not be found in ") );
- sMessage += aTree->getAbsolutePath(aNode).toString();
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( sMessage, xContext );
- }
-
- return configapi::makeElement( rNode.getFactory(), aTree, aChild );
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( e.message(), xContext );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- // unreachable, but still there to make some compilers happy
- OSL_ASSERT(!"Unreachable code");
- return uno::Any();
-}
-
-// XMultiPropertySet
-//-----------------------------------------------------------------------------------
-uno::Sequence< uno::Any > implGetPropertyValues( NodeGroupInfoAccess& rNode, const uno::Sequence< rtl::OUString >& aPropertyNames )
- throw(uno::RuntimeException)
-{
- sal_Int32 const count = aPropertyNames.getLength();
- uno::Sequence<uno::Any> aRet(count);
-
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- for(sal_Int32 i = 0; i < count; ++i)
- {
- rtl::OUString aChildName( aPropertyNames[i] ); // not validated
-
- configuration::AnyNodeRef aChild( aTree->getAnyChild(aNode, aChildName) );
-
- if (aChild.isValid())
- {
- aRet[i] = configapi::makeElement( rNode.getFactory(), aTree, aChild );
- }
- else
- {
- OSL_ENSURE(!configuration::hasChildOrElement(aTree,aNode,aChildName),"ERROR: Configuration: Existing Property not found by implementation");
- OSL_TRACE("Configuration: MultiPropertySet: trying to get unknown property - returning void");
- }
- }
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- return aRet;
-}
-
-// XHierarchicalPropertySet
-//-----------------------------------------------------------------------------------
-uno::Any implGetHierarchicalPropertyValue( NodeGroupInfoAccess& rNode, const rtl::OUString& aPropertyName )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- configuration::RelativePath aRelPath = configuration::validateRelativePath( aPropertyName, aTree, aNode );
-
- configuration::AnyNodeRef aNestedNode = configuration::getLocalDescendant( aTree, aNode, aRelPath );
-
- if (!aNestedNode.isValid())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot get Property Value. Property '") );
- sMessage += aRelPath.toString();
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' could not be found in ") );
- sMessage += aTree->getAbsolutePath(aNode).toString();
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( sMessage, xContext );
- }
- OSL_ASSERT(aNode.isValid());
-
- return configapi::makeElement( rNode.getFactory(), aTree, aNestedNode );
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( e.message(), xContext );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- // unreachable, but still there to make some compilers happy
- OSL_ASSERT(!"Unreachable code");
- return uno::Any();
-}
-
-// XMultiHierarchicalPropertySet
-//-----------------------------------------------------------------------------------
-uno::Sequence< uno::Any > implGetHierarchicalPropertyValues( NodeGroupInfoAccess& rNode, const uno::Sequence< rtl::OUString >& aPropertyNames )
- throw(uno::RuntimeException)
-{
- sal_Int32 const count = aPropertyNames.getLength();
- uno::Sequence<uno::Any> aRet(count);
-
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- for(sal_Int32 i = 0; i < count; ++i)
- try
- {
- configuration::RelativePath aRelPath = configuration::validateRelativePath( aPropertyNames[i], aTree, aNode );
-
- configuration::AnyNodeRef aNestedValue = configuration::getLocalDescendant( aTree, aNode, aRelPath );
-
- if (aNestedValue.isValid())
- {
- aRet[i] = configapi::makeElement( rNode.getFactory(), aTree, aNestedValue );
- }
- else
- {
- OSL_TRACE("Configuration: MultiPropertySet: trying to get unknown property - returning void");
- }
- }
- catch (configuration::InvalidName& )
- {
- OSL_TRACE("Configuration: MultiPropertySet: trying to get property from unknown path - returning void");
- OSL_ASSERT(!aRet[i].hasValue());
- }
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- return aRet;
-}
-
-//------------------------------------------------------------------------------------------------------------------
-// SPECIAL: XMultiPropertySet::firePropertiesChangeEvent
-//------------------------------------------------------------------------------------------------------------------
-
-void implFirePropertiesChangeEvent( NodeGroupInfoAccess& rNode, const uno::Sequence< rtl::OUString >& aPropertyNames, const uno::Reference< beans::XPropertiesChangeListener >& xListener )
- throw(uno::RuntimeException)
-{
- OSL_ENSURE(xListener.is(), "ERROR: requesting to fire Events to a NULL listener.");
- if (!xListener.is())
- {
- return; // should this be an exception ??
- }
-
- sal_Int32 const count = aPropertyNames.getLength();
- uno::Sequence<beans::PropertyChangeEvent> aEvents(count);
-
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
- configapi::Factory& rFactory = rNode.getFactory();
-
- sal_Int32 nFire = 0;
-
- for(sal_Int32 i = 0; i < count; ++i)
- {
- rtl::OUString aChildName( aPropertyNames[i] ); // not validated
-
- configuration::AnyNodeRef aChild( aTree->getAnyChild(aNode, aChildName) );
-
- if (aChild.isValid())
- {
- aEvents[nFire].Source = rNode.getUnoInstance();
- aEvents[nFire].PropertyName = aChildName;
- aEvents[nFire].PropertyHandle = -1;
-
- aEvents[nFire].NewValue = aEvents[nFire].OldValue = configapi::makeElement( rFactory, aTree, aChild );
- nFire++;
- }
- else
- {
- OSL_ENSURE(!configuration::hasChildOrElement(aTree,aNode,aChildName),"ERROR: Configuration: Existing Property not found by implementation");
- OSL_TRACE("Configuration: MultiPropertySet: request to fire unknown property - skipping");
- }
- }
-
- if (nFire < count) aEvents.realloc(nFire);;
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- xListener->propertiesChange(aEvents);
-}
-
-//------------------------------------------------------------------------------------------------------------------
-// XPropertyState
-//------------------------------------------------------------------------------------------------------------------
-
-beans::PropertyState implGetPropertyState( NodeAccess& rNode, const rtl::OUString& sPropertyName )
- throw(beans::UnknownPropertyException, uno::RuntimeException)
-{
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- rtl::OUString aChildName = configuration::validateChildOrElementName(sPropertyName,aTree,aNode);
-
- configuration::AnyNodeRef aChild = configuration::getChildOrElement(aTree,aNode,aChildName);
- if (!aChild.isValid())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot get PropertyState. Property '") );
- sMessage += sPropertyName;
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' not found in ") );
- sMessage += aTree->getAbsolutePath(aNode).toString();
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( sMessage, xContext );
- }
- OSL_ASSERT(aNode.isValid());
-
- return aTree->isNodeDefault(aChild) ? beans::PropertyState_DEFAULT_VALUE :
- aChild.isNode() ? beans::PropertyState_AMBIGUOUS_VALUE :
- beans::PropertyState_DIRECT_VALUE;
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( e.message(), xContext );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- // unreachable, but still there to make some compilers happy
- OSL_ASSERT(!"Unreachable code");
- return beans::PropertyState_AMBIGUOUS_VALUE;
-}
-
-//-----------------------------------------------------------------------------------
-uno::Sequence< beans::PropertyState > implGetPropertyStates( NodeAccess& rNode, const uno::Sequence< rtl::OUString >& aPropertyNames )
- throw(beans::UnknownPropertyException, uno::RuntimeException)
-{
- sal_Int32 const count = aPropertyNames.getLength();
- uno::Sequence<beans::PropertyState> aRet(count);
-
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- for(sal_Int32 i = 0; i < count; ++i)
- {
- rtl::OUString aChildName = configuration::validateChildOrElementName(aPropertyNames[i],aTree,aNode);
-
- rtl::Reference< configuration::Tree > aChildTree( aTree);
-
- configuration::AnyNodeRef aChildNode = configuration::getChildOrElement(aChildTree,aNode,aChildName);
- if (!aChildNode.isValid())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot get PropertyStates. Property '") );
- sMessage += aPropertyNames[i];
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' could not be found in ") );
- sMessage += aTree->getAbsolutePath(aNode).toString();
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( sMessage, xContext );
- }
- OSL_ASSERT(aChildNode.isValid());
-
- aRet[i] = aChildTree->isNodeDefault(aChildNode) ? beans::PropertyState_DEFAULT_VALUE :
- aChildNode.isNode() ? beans::PropertyState_AMBIGUOUS_VALUE :
- beans::PropertyState_DIRECT_VALUE;
- }
-
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( e.message(), xContext );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- return aRet;
-}
-
-//-----------------------------------------------------------------------------------
-static inline configuration::NodeChange validateSetToDefaultHelper(configuration::GroupDefaulter& _rDefaulter, configuration::AnyNodeRef _aNode)
-{
- if (!_aNode.isNode())
- return _rDefaulter.validateSetToDefaultValue( _aNode.toValue() );
-
- else
- return _rDefaulter.validateSetToDefaultState( _aNode.toNode() );
-}
-//-----------------------------------------------------------------------------------
-void implSetPropertyToDefault( NodeGroupAccess& rNode, const rtl::OUString& sPropertyName )
- throw(beans::UnknownPropertyException, uno::RuntimeException)
-{
- try
- {
- UnoApiLock aWithDefaultLock;
- GuardedNodeUpdate<NodeGroupAccess> lock( withDefaultData( rNode ) );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- configuration::GroupDefaulter aDefaulter = lock.getNodeDefaulter();
-
- rtl::OUString aChildName = configuration::validateChildName(sPropertyName,aTree,aNode);
-
- configuration::AnyNodeRef aChild( aTree->getAnyChild(aNode, aChildName) );
-
- configuration::NodeChange aChange = validateSetToDefaultHelper( aDefaulter, aChild );
-
- const bool bLocal = !aDefaulter.hasDoneSet();
-
- if (aChange.test().isChange() )
- {
- Broadcaster aSender(rNode.getNotifier().makeBroadcaster(aChange,bLocal));
-
- aSender.queryConstraints(aChange);
-
- aTree->integrate(aChange, aNode, bLocal);
-
- lock.clearForBroadcast();
- aSender.notifyListeners(aChange);
- }
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot restore Default: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( sMessage += e.message(), xContext );
- }
- catch (configuration::ConstraintViolation & ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot restore Default: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( sMessage += e.message(), xContext );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-}
-//-----------------------------------------------------------------------------------
-void implSetPropertiesToDefault( NodeGroupAccess& rNode, const uno::Sequence< rtl::OUString >& aPropertyNames )
- throw(beans::UnknownPropertyException, uno::RuntimeException)
-{
- try
- {
- UnoApiLock aWithDefaultLock;
- GuardedNodeUpdate<NodeGroupAccess> lock( withDefaultData( rNode ) );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- configuration::GroupDefaulter aDefaulter = lock.getNodeDefaulter();
-
- configuration::NodeChanges aChanges;
- for(sal_Int32 i = 0, count= aPropertyNames.getLength(); i < count; ++i)
- {
- rtl::OUString aChildName = configuration::validateChildName( aPropertyNames[i], aTree, aNode ); // validated
-
- configuration::AnyNodeRef aChild( aTree->getAnyChild(aNode, aChildName) );
-
- if (!aChild.isValid())
- {
- OSL_ENSURE(!configuration::hasChildOrElement(aTree, aNode, aChildName),"ERROR: Configuration: Existing Property not found by implementation");
-
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot restore Default.") );
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(" Property '") );
- sMessage += aChildName;
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' not found in ") );
- sMessage += aTree->getAbsolutePath(aNode).toString();
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( sMessage, xContext );
- }
- OSL_ASSERT(aNode.isValid());
-
- if (!aTree->hasNodeDefault(aChild))
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot restore Default.") );
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(" Property '") );
- sMessage += aChildName;
-
- if (aChild.isNode())
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' is not a simple value.") );
-
- else
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' does not have a default value.") );
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( sMessage, xContext );
- }
-
- configuration::NodeChange aChildChange = validateSetToDefaultHelper(aDefaulter, aChild );
- if (aChildChange.maybeChange())
- aChanges.add(aChildChange);
- }
-
- const bool bLocal = !aDefaulter.hasDoneSet();
-
- if (!aChanges.test().compact().isEmpty())
- {
- Broadcaster aSender(rNode.getNotifier().makeBroadcaster(aChanges,bLocal));
-
- aSender.queryConstraints(aChanges);
-
- aTree->integrate(aChanges, aNode, bLocal);
-
- lock.clearForBroadcast();
- aSender.notifyListeners(aChanges, bLocal);
- }
-
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot restore Defaults: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( sMessage += e.message(), xContext );
- }
- catch (configuration::ConstraintViolation & ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot restore Defaults: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( sMessage += e.message(), xContext );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-}
-
-//-----------------------------------------------------------------------------------
-void implSetAllPropertiesToDefault( NodeGroupAccess& rNode )
- throw(uno::RuntimeException)
-{
- try
- {
- UnoApiLock aWithDefaultLock;
- GuardedNodeUpdate<NodeGroupAccess> lock( withDefaultData( rNode ) );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- configuration::GroupDefaulter aDefaulter = lock.getNodeDefaulter();
-
- configuration::NodeChanges aChanges = aDefaulter.validateSetAllToDefault( );
-
- const bool bLocal = !aDefaulter.hasDoneSet();
-
- if (!aChanges.test().compact().isEmpty())
- {
- Broadcaster aSender(rNode.getNotifier().makeBroadcaster(aChanges,bLocal));
-
- aSender.queryConstraints(aChanges);
-
- aTree->integrate(aChanges, aNode, bLocal);
-
- lock.clearForBroadcast();
- aSender.notifyListeners(aChanges, bLocal);
- }
-
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot restore Defaults: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( sMessage += e.message(), xContext );
- }
- catch (configuration::ConstraintViolation & ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot restore Defaults: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( sMessage += e.message(), xContext );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-}
-
-//-----------------------------------------------------------------------------------
-uno::Any implGetPropertyDefault( NodeGroupInfoAccess& rNode, const rtl::OUString& sPropertyName )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- uno::Any aDefault;
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- rtl::OUString aChildName = configuration::validateChildName(sPropertyName,aTree,aNode);
-
- configuration::AnyNodeRef aChildNode = aTree->getAnyChild(aNode, aChildName);
- if (!aChildNode.isValid())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot get Default. Property '") );
- sMessage += sPropertyName;
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' not found in ") );
- sMessage += aTree->getAbsolutePath(aNode).toString();
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( sMessage, xContext );
- }
- OSL_ASSERT(aNode.isValid());
-
- if (!aChildNode.isNode())
- {
- aDefault = aTree->getNodeDefaultValue(aChildNode.toValue());
- }
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( e.message(), xContext );
- }
- catch (configuration::ConstraintViolation & ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot get Default: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( sMessage += e.message(), xContext );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- return aDefault;
-}
-
-//-----------------------------------------------------------------------------------
-uno::Sequence< uno::Any > implGetPropertyDefaults( NodeGroupInfoAccess& rNode, const uno::Sequence< rtl::OUString >& aPropertyNames )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
-{
- sal_Int32 const count = aPropertyNames.getLength();
- uno::Sequence<uno::Any> aDefaults(count);
-
- try
- {
- GuardedNodeData<NodeAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- for(sal_Int32 i = 0; i < count; ++i)
- {
- rtl::OUString aChildName = configuration::validateChildName(aPropertyNames[i],aTree,aNode);
-
- configuration::AnyNodeRef aChildNode = aTree->getAnyChild(aNode, aChildName);
- if (!aChildNode.isValid())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot get Default. Property '") );
- sMessage += aPropertyNames[i];
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' not found in ") );
- sMessage += aTree->getAbsolutePath(aNode).toString();
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( sMessage, xContext );
- }
- OSL_ASSERT(aNode.isValid());
-
- if (!aChildNode.isNode())
- {
- aDefaults[i] = aTree->getNodeDefaultValue(aChildNode.toValue());
- }
- }
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( e.message(), xContext );
- }
- catch (configuration::ConstraintViolation & ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot get Default: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw beans::UnknownPropertyException( sMessage += e.message(), xContext );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- return aDefaults;
-}
-
-//-----------------------------------------------------------------------------------
- } // namespace configapi
-
-} // namespace configmgr
-
-
diff --git a/configmgr/source/api2/propsetaccessimpl.hxx b/configmgr/source/api2/propsetaccessimpl.hxx
deleted file mode 100644
index 3026afee2c..0000000000
--- a/configmgr/source/api2/propsetaccessimpl.hxx
+++ /dev/null
@@ -1,138 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_PROPERTYSETIMPL_HXX_
-#define CONFIGMGR_API_PROPERTYSETIMPL_HXX_
-
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/beans/XHierarchicalPropertySet.hpp>
-#include <com/sun/star/beans/XMultiPropertySet.hpp>
-#include <com/sun/star/beans/XMultiHierarchicalPropertySet.hpp>
-
-#ifndef CONFIGMGR_NO_PROPERTYSTATE
-#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSTATE_HPP_
-#include <com/sun/star/beans/XPropertyState.hpp>
-#endif
-#endif
-
-namespace configmgr
-{
- namespace css = ::com::sun::star;
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace beans = ::com::sun::star::beans;
-
- /* implementations of the interfaces supported by a (parent) node
- within the configuration tree.
- (read-only operation)
- */
- namespace configapi
- {
- class NodeAccess;
- class NodeGroupInfoAccess;
- class NodeGroupAccess;
-
- // getting Property Metadata
- // XPropertySet & XMultiPropertySet
- uno::Reference< beans::XPropertySetInfo > implGetPropertySetInfo( NodeGroupInfoAccess& rNode, sal_Bool _bWriteable )
- throw(uno::RuntimeException);
-
- // XHierarchicalPropertySet & XHierarchicalMultiPropertySet
- uno::Reference< beans::XHierarchicalPropertySetInfo > implGetHierarchicalPropertySetInfo( NodeGroupInfoAccess& rNode )
- throw(uno::RuntimeException);
-
- // setting values - may all throw (PropertyVeto)Exceptions on read-only property sets
- // XPropertySet
- void implSetPropertyValue( NodeGroupAccess& rNode, const rtl::OUString& aPropertyName, const uno::Any& aValue )
- throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, uno::RuntimeException);
-
- // XMultiPropertySet
- void implSetPropertyValues( NodeGroupAccess& rNode, const uno::Sequence< rtl::OUString >& PropertyNames, const uno::Sequence< uno::Any >& Values )
- throw(beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, uno::RuntimeException);
-
- // XHierarchicalPropertySet
- void implSetHierarchicalPropertyValue( NodeGroupAccess& rNode, const rtl::OUString& aPropertyName, const uno::Any& aValue )
- throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, uno::RuntimeException);
-
- // XMultiHierarchicalPropertySet
- void implSetHierarchicalPropertyValues( NodeGroupAccess& rNode, const uno::Sequence< rtl::OUString >& PropertyNames, const uno::Sequence< uno::Any >& Values )
- throw(beans::PropertyVetoException, lang::IllegalArgumentException,
- lang::WrappedTargetException, uno::RuntimeException);
-
- // getting values
- // XPropertySet
- uno::Any implGetPropertyValue( NodeGroupInfoAccess& rNode,const rtl::OUString& PropertyName )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
-
- // XMultiPropertySet
- uno::Sequence< uno::Any > implGetPropertyValues( NodeGroupInfoAccess& rNode, const uno::Sequence< rtl::OUString >& aPropertyNames )
- throw(uno::RuntimeException);
-
- // XHierarchicalPropertySet
- uno::Any implGetHierarchicalPropertyValue( NodeGroupInfoAccess& rNode, const rtl::OUString& PropertyName )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
-
- // XMultiHierarchicalPropertySet
- uno::Sequence< uno::Any > implGetHierarchicalPropertyValues( NodeGroupInfoAccess& rNode, const uno::Sequence< rtl::OUString >& aPropertyNames )
- throw(uno::RuntimeException);
-
- // SPECIAL: firePropertiesChangeEvent
- // XMultiPropertySet
- void implFirePropertiesChangeEvent( NodeGroupInfoAccess& rNode, const uno::Sequence< rtl::OUString >& aPropertyNames, const uno::Reference< beans::XPropertiesChangeListener >& xListener )
- throw(uno::RuntimeException);
-
- // XPropertyState
- beans::PropertyState implGetPropertyState( NodeAccess& rNode, const rtl::OUString& sPropertyName )
- throw(beans::UnknownPropertyException, uno::RuntimeException);
-
- void implSetPropertyToDefault( NodeGroupAccess& rNode, const rtl::OUString& sPropertyName )
- throw(beans::UnknownPropertyException, uno::RuntimeException);
-
- uno::Any implGetPropertyDefault( NodeGroupInfoAccess& rNode, const rtl::OUString& sPropertyName )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
-
- // XMultiPropertyState
- uno::Sequence< beans::PropertyState > implGetPropertyStates( NodeAccess& rNode, const uno::Sequence< rtl::OUString >& aPropertyName )
- throw(beans::UnknownPropertyException, uno::RuntimeException);
-
- void implSetPropertiesToDefault( NodeGroupAccess& rNode, const uno::Sequence< rtl::OUString >& aPropertyNames )
- throw(beans::UnknownPropertyException, uno::RuntimeException);
-
- void implSetAllPropertiesToDefault( NodeGroupAccess& rNode )
- throw(uno::RuntimeException);
-
- uno::Sequence< uno::Any > implGetPropertyDefaults( NodeGroupInfoAccess& rNode, const uno::Sequence< rtl::OUString >& aPropertyNames )
- throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
- }
-
-}
-#endif // CONFIGMGR_API_PROPERTYSETIMPL_HXX_
-
-
diff --git a/configmgr/source/api2/provider.cxx b/configmgr/source/api2/provider.cxx
deleted file mode 100644
index a89fef2e43..0000000000
--- a/configmgr/source/api2/provider.cxx
+++ /dev/null
@@ -1,711 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "apiserviceinfo.hxx"
-#include "confapifactory.hxx"
-#include "configpath.hxx"
-#include "datalock.hxx"
-#include "provider.hxx"
-#include "providerimpl.hxx"
-#include "tracer.hxx"
-#include "bootstrap.hxx"
-#include "wrapexception.hxx"
-#include <osl/mutex.hxx>
-#include <rtl/ustrbuf.hxx>
-#ifndef __SGI_STL_ALGORITHM
-#include <algorithm>
-#endif
-#include <comphelper/sequence.hxx>
-#include <cppuhelper/typeprovider.hxx>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <cppuhelper/typeprovider.hxx>
-#include <com/sun/star/lang/ServiceNotRegisteredException.hpp>
-#include <com/sun/star/lang/XEventListener.hpp>
-
-namespace configmgr
-{
- namespace css = ::com::sun::star;
- namespace uno = css::uno;
- namespace lang = css::lang;
- namespace beans = css::beans;
-
- namespace
- {
- //------------------------------------------------------------------------
- sal_Char const * const aConfigProviderServices[] =
- {
- "com.sun.star.configuration.ConfigurationProvider",
- 0
- };
- sal_Char const * const aAdminProviderServices[] =
- {
- "com.sun.star.configuration.AdministrationProvider",
- 0
- };
- //------------------------------------------------------------------------
-
- ServiceImplementationInfo const aConfigProviderInfo =
- {
- "com.sun.star.comp.configuration.ConfigurationProvider",
- aConfigProviderServices,
- 0
- };
- ServiceImplementationInfo const aAdminProviderInfo =
- {
- "com.sun.star.comp.configuration.AdministrationProvider",
- aAdminProviderServices,
- aConfigProviderServices
- };
- //------------------------------------------------------------------------
-
- sal_Char const * const
- aDefaultProviderServiceAndImplName = A_DefaultProviderServiceAndImplName;
-
- //------------------------------------------------------------------------
-
- sal_Char const * const aDefaultProviderServices[] =
- {
- aDefaultProviderServiceAndImplName,
- 0
- };
- //------------------------------------------------------------------------
-
- ServiceRegistrationInfo const aDefaultProviderInfo =
- {
- aDefaultProviderServiceAndImplName,
- aDefaultProviderServices
- };
- SingletonRegistrationInfo const aDefaultProviderSingletonInfo =
- {
- A_DefaultProviderSingletonName,
- aDefaultProviderServiceAndImplName,
- aDefaultProviderServiceAndImplName,
- 0
- };
- //------------------------------------------------------------------------
- typedef uno::Reference< uno::XInterface > (OProviderImpl::*CreatorFunc)(const uno::Sequence< uno::Any >& aArguments);
- struct ServiceCreationInfo
- {
- ServiceRegistrationInfo const* info;
- CreatorFunc create;
- };
-
- static sal_Int32 getCreateServiceDataCount()
- {
- return 2;
- }
-
- static const ServiceCreationInfo* getCreateServiceData()
- {
- static ServiceCreationInfo const createServiceData[] =
- {
- { &configapi::aCreateReadAccessSI, &OProviderImpl::createReadAccess },
- { &configapi::aCreateUpdateAccessSI, &OProviderImpl::createUpdateAccess },
- };
- OSL_ENSURE(sizeof(createServiceData)/sizeof(createServiceData[0]) == getCreateServiceDataCount(),
- "getCreateServiceData : inconsistent data !");
- return createServiceData;
- }
- //------------------------------------------------------------------------
- }
-
- static ServiceCreationInfo const* findCreationInfo( const rtl::OUString& aServiceSpecifier )
- {
- for (int i= 0; i<getCreateServiceDataCount(); ++i)
- {
- ServiceCreationInfo const& rCreationInfo = getCreateServiceData()[i];
-
- ServiceRegistrationInfo const* pInfo = rCreationInfo.info;
- if (!pInfo)
- continue;
-
- if (sal_Char const * pImplName = pInfo->implementationName)
- {
- if (0 == aServiceSpecifier.compareToAscii(pImplName))
- return &rCreationInfo;
- }
-
- if (sal_Char const * const* pNames = pInfo->registeredServiceNames)
- {
- while(*pNames)
- {
- if (0 == aServiceSpecifier.compareToAscii(*pNames))
- return &rCreationInfo;
-
- ++pNames;
- }
- }
- }
- // not found
- return 0;
- }
-
- //#define ID_PREFETCH 1
- static const int ID_PREFETCH=1;
- static const int ID_ENABLEASYNC=2;
-
- static inline
- rtl::OUString getPrefetchPropName() { return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PrefetchNodes") ); }
- static inline
- rtl::OUString getEnableAsyncPropName() { return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("EnableAsync") ); }
- //=============================================================================
- //= OProvider
- //=============================================================================
- // service info export
- const ServiceRegistrationInfo* getConfigurationProviderServiceInfo()
- {
- return getRegistrationInfo(&aConfigProviderInfo);
- }
-
- const ServiceRegistrationInfo* getAdminProviderServiceInfo()
- {
- return getRegistrationInfo(&aAdminProviderInfo);
- }
-
- const ServiceRegistrationInfo* getDefaultProviderServiceInfo()
- {
- return &aDefaultProviderInfo;
- }
-
- const SingletonRegistrationInfo* getDefaultProviderSingletonInfo()
- {
- return &aDefaultProviderSingletonInfo;
- }
-
- //-----------------------------------------------------------------------------
- uno::Reference<uno::XInterface> SAL_CALL
- getDefaultConfigProviderSingleton( uno::Reference< uno::XComponentContext > const& xContext )
- {
- OSL_ENSURE( xContext.is(), "ERROR: NULL context has no singletons" );
-
- UnoContextTunnel aTunnel;
- aTunnel.passthru( xContext );
-
- uno::Reference<uno::XInterface> xResult;
-
- if (xContext.is())
- try
- {
- rtl::OUString aSingletonName = SINGLETON(A_DefaultProviderSingletonName);
- uno::Any aResult = xContext->getValueByName(aSingletonName);
- aResult >>= xResult;
- }
- catch (uno::Exception & )
- {
- // to do: really use the tunneled failure when that is set properly
- if ( aTunnel.recoverFailure(true).hasValue() )
- {
- // have a failure, but can't recover it
- // -> try to regenerate
- instantiateDefaultProvider(xContext);
-
- OSL_ENSURE(false, "Cannot recreate configuration backend instantiation failure - using generic error");
- }
- // cannot recover any failure
- throw;
- }
-
- return xResult;
- }
- // ------------------------------------------------------------------------
- // ----------------------------------------------------------------------------
- #define TUNNEL_ALL_EXCEPTIONS() \
- WRAP_CONFIGBACKEND_CREATION_EXCEPTIONS1( UnoContextTunnel::tunnelFailure, true)
-
- // ----------------------------------------------------------------------------
- // ------------------------------------------------------------------------
-
- uno::Reference< uno::XInterface > SAL_CALL instantiateDefaultProvider( uno::Reference< uno::XComponentContext > const & xTargetContext )
- {
- uno::Reference< uno::XComponentContext > xContext = UnoContextTunnel::recoverContext(xTargetContext);
-
- ServiceImplementationInfo const * pProviderInfo =
- ContextReader::testAdminService(xContext,true) ? &aAdminProviderInfo : &aConfigProviderInfo;
-
- OProvider* pNewProvider = new OProvider(xContext,pProviderInfo);
- uno::Reference< lang::XMultiServiceFactory > aRet( pNewProvider );
-
- try
- {
- pNewProvider->connect();
- }
- TUNNEL_ALL_EXCEPTIONS()
-
- return uno::Reference< uno::XInterface >( aRet, uno::UNO_QUERY );
- }
-
- // -----------------------------------------------------------------------------
- class OProviderDisposingListener : public cppu::WeakImplHelper1<lang::XEventListener>
- {
- OProvider* m_pProvider;
-
- public:
- OProviderDisposingListener(OProvider* pProvider)
- :m_pProvider(pProvider){}
-
- virtual void SAL_CALL disposing(com::sun::star::lang::EventObject const& rEvt) throw()
- {
- CFG_TRACE_INFO("Service Manager or context disposed, disposing the provider");
- if (OProvider* pProvider = m_pProvider)
- {
- m_pProvider = NULL;
- pProvider->disposing(rEvt);
- }
- }
- };
-
- //=============================================================================
- //= OProvider
- //=============================================================================
- //-----------------------------------------------------------------------------
- OProvider::OProvider(uno::Reference< uno::XComponentContext > const & xContext, ServiceImplementationInfo const* pInfo)
- :ServiceComponentImpl(pInfo)
- ,OPropertyContainer(ServiceComponentImpl::rBHelper)
- ,m_xContext(xContext)
- ,m_pImpl(NULL)
- ,m_bEnableAsync(false)
- {
- OSL_ENSURE(m_xContext.is(), "Creating a provider without a context");
- attachToContext();
- registerProperty(getPrefetchPropName(), ID_PREFETCH, 0,&m_aPrefetchNodes, ::getCppuType(&m_aPrefetchNodes));
- registerProperty(getEnableAsyncPropName(), ID_ENABLEASYNC, 0, &m_bEnableAsync, ::getBooleanCppuType());
- }
-
- //-----------------------------------------------------------------------------
- OProvider::~OProvider()
- {
- delete m_pImpl;
- discardContext(releaseContext());
- }
-
- //-----------------------------------------------------------------------------
- void OProvider::connect() throw (uno::Exception)
- {
- OSL_ENSURE( m_pImpl == NULL, "Error: Configuration Provider already is connected");
-
- std::auto_ptr<OProviderImpl> pNewImpl( new OProviderImpl(this, m_xContext) );
-
- implConnect(*pNewImpl,ContextReader(m_xContext));
-
- m_pImpl = pNewImpl.release();
- if (m_pImpl)
- {
- sal_Bool isEnabled = m_pImpl->getDefaultOptions().isAsyncEnabled();
- this->setPropertyValue( getEnableAsyncPropName(), uno::makeAny(isEnabled) );
- }
- }
-
- //-----------------------------------------------------------------------------
- void OProvider::attachToContext()
- {
- UnoApiLock aLock;
- ::osl::MutexGuard aGuard(ServiceComponentImpl::rBHelper.rMutex);
- OSL_ASSERT(!m_xDisposeListener.is());
- if (m_xContext.is())
- {
- uno::Reference< lang::XComponent > xContextComp(m_xContext, uno::UNO_QUERY);
- uno::Reference< lang::XComponent > xServiceMgrComp(m_xContext->getServiceManager(), uno::UNO_QUERY);
-
- m_xDisposeListener = new OProviderDisposingListener(this);
-
- if (xContextComp.is()) xContextComp ->addEventListener(m_xDisposeListener);
- if (xServiceMgrComp.is()) xServiceMgrComp->addEventListener(m_xDisposeListener);
-
- OSL_ENSURE(xServiceMgrComp.is() || xContextComp.is(),
- "Provider cannot detect shutdown -> no XComponent found");
- }
- }
-
- //-----------------------------------------------------------------------------
- uno::Reference< lang::XComponent > OProvider::releaseContext()
- {
- UnoApiLock aLock;
- ::osl::MutexGuard aGuard(ServiceComponentImpl::rBHelper.rMutex);
-
- uno::Reference< lang::XComponent > xContextComp(m_xContext, uno::UNO_QUERY);
- if (m_xDisposeListener.is() && m_xContext.is())
- {
- uno::Reference< lang::XComponent > xServiceMgrComp(m_xContext->getServiceManager(), uno::UNO_QUERY);
-
- if (xContextComp.is())
- {
- try { xContextComp ->removeEventListener(m_xDisposeListener); }
- catch (uno::Exception & ) {}
- }
-
- if (xServiceMgrComp.is())
- {
- try { xServiceMgrComp->removeEventListener(m_xDisposeListener); }
- catch (uno::Exception & ) {}
- }
- }
- m_xDisposeListener = NULL;
- m_xContext = NULL;
-
- return xContextComp;
- }
- //-----------------------------------------------------------------------------
-
- void OProvider::discardContext(uno::Reference< lang::XComponent > const & xContext)
- {
- UnoApiLock aLock;
- if (xContext.is())
- {
- uno::Reference< uno::XComponentContext > xCC(xContext,uno::UNO_QUERY);
- OSL_ASSERT(xCC.is());
-
- if (BootstrapContext::isWrapper(xCC))
- {
- try { xContext->dispose(); }
- catch (uno::Exception & ) {}
- }
- }
- }
- //-----------------------------------------------------------------------------
- // XTypeProvider
- //-----------------------------------------------------------------------------
- uno::Sequence< uno::Type > SAL_CALL OProvider::getTypes( ) throw(uno::RuntimeException)
- {
- cppu::OTypeCollection aCollection(::getCppuType( (const uno::Reference< beans::XPropertySet > *)0 ),
- ::getCppuType( (const uno::Reference< beans::XFastPropertySet > *)0 ),
- ::getCppuType( (const uno::Reference< beans::XMultiPropertySet > *)0 ),
- ::comphelper::concatSequences(ServiceComponentImpl::getTypes(), cppu::ImplHelper4< lang::XMultiServiceFactory, lang::XLocalizable, util::XRefreshable, util::XFlushable >::getTypes()));
- return aCollection.getTypes();
- }
-
- // XPropertySet
- //-----------------------------------------------------------------------------
- uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL OProvider::getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException)
- {
- return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
- }
-
- //-----------------------------------------------------------------------------
- uno::Reference< uno::XInterface > SAL_CALL OProvider::createInstance( const rtl::OUString& aServiceSpecifier )
- throw(uno::Exception, uno::RuntimeException)
- {
- UnoApiLock aLock;
- // same as creating with empty sequence of arguments
- return this->createInstanceWithArguments( aServiceSpecifier, uno::Sequence< uno::Any >() );
- }
-
- //-----------------------------------------------------------------------------
- uno::Reference< uno::XInterface > SAL_CALL
- OProvider::createInstanceWithArguments( const rtl::OUString& aServiceSpecifier, const uno::Sequence< uno::Any >& aArguments )
- throw(uno::Exception, uno::RuntimeException)
- {
- UnoApiLock aLock;
-
- OSL_ENSURE(m_pImpl, "OProvider: no implementation available");
-
- if (ServiceCreationInfo const* pInfo = findCreationInfo(aServiceSpecifier))
- {
- // it's a known service name - try to create without args
- if (CreatorFunc create = pInfo->create)
- {
- return (m_pImpl->*create)(aArguments);
- }
- }
-
- rtl::OUStringBuffer sMsg;
- sMsg.appendAscii("ConfigurationProvider: Cannot create view - ");
- sMsg.append( aServiceSpecifier ) .appendAscii(" is not a valid configuration access service. ");
-
- throw lang::ServiceNotRegisteredException(sMsg.makeStringAndClear(),*this);
- }
-
- //-----------------------------------------------------------------------------
- uno::Sequence< rtl::OUString > SAL_CALL OProvider::getAvailableServiceNames( )
- throw(uno::RuntimeException)
- {
- UnoApiLock aLock;
-
- sal_Int32 nCount = 0;
- {
- for (int i= 0; i< getCreateServiceDataCount(); ++i)
- nCount += countServices(getCreateServiceData()[i].info);
- }
-
- uno::Sequence< rtl::OUString > aNames(nCount);
- if (nCount > 0)
- {
- sal_Int32 n = 0;
- for (int i= 0; i<getCreateServiceDataCount(); ++i)
- {
- ServiceRegistrationInfo const* pInfo = getCreateServiceData()[i].info;
- sal_Char const * const* pNames = pInfo ? pInfo->registeredServiceNames : 0;
-
- if (pNames)
- {
- while(*pNames)
- {
- aNames[n] = rtl::OUString::createFromAscii(*pNames);
- ++n;
- ++pNames;
- }
- }
- }
- }
-
- return aNames;
- }
-
- // XLocalizable
- //-----------------------------------------------------------------------------
- void SAL_CALL OProvider::setLocale( const lang::Locale& eLocale )
- throw (uno::RuntimeException)
- {
- UnoApiLock aLock;
-
- OSL_ENSURE(m_pImpl, "OProvider: no implementation available");
-
- m_pImpl->setDefaultLocale( eLocale );
- }
-
- //-----------------------------------------------------------------------------
- lang::Locale SAL_CALL OProvider::getLocale()
- throw (uno::RuntimeException)
- {
- UnoApiLock aLock;
-
- OSL_ENSURE(m_pImpl, "OProvider: no implementation available");
-
- return m_pImpl->getDefaultOptions().getUnoLocale();
- }
-
- //XRefreshable
- //-----------------------------------------------------------------------------
- void SAL_CALL OProvider::refresh()
- throw (uno::RuntimeException)
- {
- UnoApiLock aLock;
-
- OSL_ENSURE(m_pImpl, "OProvider: no implementation available");
-
- try
- {
- m_pImpl->refreshAll();
- }
- catch (uno::RuntimeException& ) { throw; }
- catch (uno::Exception& e)
- {
- // FIXME: use getCaughtException()
- throw lang::WrappedTargetRuntimeException(e.Message, *this, uno::makeAny(e));
- }
- //Broadcast the changes
- uno::Reference< css::util::XRefreshListener > const * const pRefresh = 0;
- cppu::OInterfaceContainerHelper * aInterfaceContainer=
- getBroadcastHelper().getContainer (::getCppuType(pRefresh));
-
- if(aInterfaceContainer)
- {
- lang::EventObject aEventObject(*this);
-
- cppu::OInterfaceIteratorHelper aIterator(*aInterfaceContainer);
- while(aIterator.hasMoreElements())
- {
- uno::Reference< uno::XInterface > xIface = aIterator.next();
- uno::Reference< util::XRefreshListener > xRefresh (xIface, uno::UNO_QUERY);
- if (xRefresh.is())
- {
- xRefresh->refreshed(aEventObject);
- }
- }
- }
- }
- //-----------------------------------------------------------------------------
- void SAL_CALL OProvider::addRefreshListener(
- const uno::Reference< util::XRefreshListener >& aListener )
- throw (uno::RuntimeException)
- {
- UnoApiLock aLock;
- getBroadcastHelper().addListener(::getCppuType(&aListener), aListener);
- }
- //-----------------------------------------------------------------------------
- void SAL_CALL OProvider::removeRefreshListener(
- const uno::Reference< util::XRefreshListener >& aListener )
- throw (uno::RuntimeException)
- {
- UnoApiLock aLock;
- getBroadcastHelper().removeListener(::getCppuType(&aListener), aListener);
- }
- //XFlushable
- //-----------------------------------------------------------------------------
- void SAL_CALL OProvider::flush( )
- throw (uno::RuntimeException)
- {
- UnoApiLock aLock;
- OSL_ENSURE(m_pImpl, "OProvider: no implementation available");
- m_pImpl->flushAll();
-
- //Broadcast the changes
- uno::Reference< css::util::XFlushListener > const * const pFlush = 0;
- cppu::OInterfaceContainerHelper * aInterfaceContainer=
- getBroadcastHelper().getContainer(::getCppuType(pFlush));
-
- if(aInterfaceContainer)
- {
- lang::EventObject aEventObject(*this);
-
- cppu::OInterfaceIteratorHelper aIterator(*aInterfaceContainer);
- while(aIterator.hasMoreElements())
- {
- uno::Reference< uno::XInterface > xIface = aIterator.next();
- uno::Reference< util::XFlushListener > xFlush (xIface, uno::UNO_QUERY);
- if (xFlush.is())
- {
- xFlush->flushed(aEventObject);
- }
- }
- }
- }
- //-----------------------------------------------------------------------------
- void SAL_CALL OProvider::addFlushListener(
- const uno::Reference< util::XFlushListener >& aListener )
- throw (uno::RuntimeException)
- {
- UnoApiLock aLock;
- getBroadcastHelper().addListener(::getCppuType(&aListener), aListener);
- }
- //-----------------------------------------------------------------------------
- void SAL_CALL OProvider::removeFlushListener(
- const uno::Reference< util::XFlushListener >& aListener )
- throw (uno::RuntimeException)
- {
- UnoApiLock aLock;
- getBroadcastHelper().removeListener(::getCppuType(&aListener), aListener);
- }
-
- // XInterface
- //-----------------------------------------------------------------------------
- uno::Any SAL_CALL OProvider::queryInterface(uno::Type const& rType) throw(uno::RuntimeException)
- {
- UnoApiLock aLock;
- uno::Any aRet( ServiceComponentImpl::queryInterface(rType) );
- if ( !aRet.hasValue() )
- aRet = cppu::ImplHelper4< lang::XMultiServiceFactory, lang::XLocalizable, util::XRefreshable, util::XFlushable >::queryInterface(rType);
- if ( !aRet.hasValue() )
- aRet = queryPropertyInterface(rType);
- return aRet;
- }
-
- //-----------------------------------------------------------------------------
- void OProvider::implConnect(OProviderImpl& _rFreshProviderImpl, const ContextReader& _rSettings) throw(uno::Exception)
- {
- UnoApiLock aLock;
- if (!_rFreshProviderImpl.initSession(_rSettings))
- throw uno::Exception(::rtl::OUString::createFromAscii("Could not connect to the configuration. Please check your settings."), static_cast< ::cppu::OWeakObject* >(this) );
- }
-
- //-----------------------------------------------------------------------------
- void SAL_CALL OProvider::disposing(com::sun::star::lang::EventObject const& /*rEvt*/) throw()
- {
- UnoApiLock aLock;
- releaseContext();
- this->dispose();
- }
-
- //-----------------------------------------------------------------------------
- void SAL_CALL OProvider::disposing()
- {
- UnoApiLock aLock;
-
- if (m_pImpl)
- m_pImpl->dispose();
-
- uno::Reference< lang::XComponent > xComp = releaseContext();
-
- ServiceComponentImpl::disposing();
- OPropertyContainer::disposing();
-
- discardContext( xComp );
- }
-
- // OPropertyArrayUsageHelper
- // -------------------------------------------------------------------------
- ::cppu::IPropertyArrayHelper* OProvider::createArrayHelper( ) const
- {
- UnoApiLock aLock;
- uno::Sequence< beans::Property > aProps;
- describeProperties(aProps);
- return new ::cppu::OPropertyArrayHelper(aProps);
- }
- // -------------------------------------------------------------------------
- ::cppu::IPropertyArrayHelper & OProvider::getInfoHelper()
- {
- UnoApiLock aLock;
- return *getArrayHelper();
- }
-
- void SAL_CALL OProvider::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue)
- throw (::com::sun::star::uno::Exception)
- {
- UnoApiLock aLock;
-
- OPropertyContainer::setFastPropertyValue_NoBroadcast( nHandle, rValue );
-
- switch(nHandle)
- {
- case ID_PREFETCH:
- {
- uno::Sequence< rtl::OUString > aNodeList;
- rValue >>= aNodeList;
-
- RequestOptions const aOptions = m_pImpl->getDefaultOptions();
-
- for (sal_Int32 i = 0; i < aNodeList.getLength(); i++)
- {
- configuration::AbsolutePath aModulePath = configuration::AbsolutePath::makeModulePath(aNodeList[i]);
- m_pImpl->fetchSubtree(aModulePath , aOptions);
- }
- }break;
-
- case ID_ENABLEASYNC:
- {
- //Forward to TreeManager
- sal_Bool bAsync;
- if (rValue >>= bAsync)
- {
- m_pImpl->enableAsync(bAsync);
- if (!bAsync)
- this->flush();
- }
- else
- OSL_ENSURE(false, "Unexpected type of new property value");
- }
- break;
- default:
- {
- OSL_ENSURE(false, "OProvider::setFastPropertyValue_NoBroadcast -unknown property");
- }
-
- }
- }
-} // namespace configmgr
diff --git a/configmgr/source/api2/provider.hxx b/configmgr/source/api2/provider.hxx
deleted file mode 100644
index 190bc67e9f..0000000000
--- a/configmgr/source/api2/provider.hxx
+++ /dev/null
@@ -1,198 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_PROVIDER_HXX_
-#define CONFIGMGR_API_PROVIDER_HXX_
-
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/lang/XLocalizable.hpp>
-#include <com/sun/star/util/XRefreshable.hpp>
-#include <com/sun/star/util/XFlushable.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#ifndef _COM_SUN_STAR_LANG_ILLEGALARGUMENTEXCEPTION_HDL_
-#include <com/sun/star/lang/IllegalArgumentException.hdl>
-#endif
-#include "confsvccomponent.hxx"
-#include <rtl/ustring.hxx>
-#include <vos/ref.hxx>
-#include <cppuhelper/implbase4.hxx>
-#include <comphelper/proparrhlp.hxx>
-#include <comphelper/propertycontainer.hxx>
-
-namespace configmgr
-{
- namespace css = ::com::sun::star;
- namespace uno = css::uno;
- namespace lang = css::lang;
- namespace beans = css::beans;
- namespace util = css::util;
-
- class Module;
- class ContextReader;
- class OProviderImpl;
-
- //==========================================================================
- //= OProvider
- //==========================================================================
- /** Base class to receive access to the configuration data. A provider for configuration is
- a factory for service which allow a readonly or update access to the configuration trees.
- */
- class OProvider:
- private ServiceComponentImpl, private comphelper::OPropertyContainer,
- public comphelper::OPropertyArrayUsageHelper< OProvider >
- // don't want to allow our derivees to access the mutex of ServiceComponentImpl
- // (this helps to prevent deadlocks: The mutex of the base class is used by the OComponentHelper to
- // protect addEvenetListener calls. Unfortunately these calls are made from within API object we create,
- // too, which can lead do deadlocks ....)
- , public cppu::ImplHelper4< lang::XMultiServiceFactory, lang::XLocalizable, util::XRefreshable, util::XFlushable >
- {
- private:
- friend class OProviderDisposingListener;
-
- uno::Reference< uno::XComponentContext > m_xContext;
- uno::Reference< lang::XEventListener > m_xDisposeListener;
- OProviderImpl * m_pImpl;
- uno::Sequence< ::rtl::OUString > m_aPrefetchNodes;
- sal_Bool m_bEnableAsync;
-
- public:
- // make ServiceComponentImpl allocation functions public
- static void * SAL_CALL operator new( size_t nSize ) throw()
- { return ServiceComponentImpl::operator new( nSize ); }
- static void SAL_CALL operator delete( void * pMem ) throw()
- { ServiceComponentImpl::operator delete( pMem ); }
-
- OProvider(uno::Reference< uno::XComponentContext > const & xContext, ServiceImplementationInfo const* pInfo);
- virtual ~OProvider();
-
- void connect() throw (uno::Exception);
-
- /// XTypeOProvider
- virtual uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw(uno::RuntimeException);
-
- /// XInterface
- virtual void SAL_CALL acquire() throw() { ServiceComponentImpl::acquire(); }
- virtual void SAL_CALL release() throw() { ServiceComponentImpl::release(); }
- virtual uno::Any SAL_CALL queryInterface(uno::Type const& rType) throw (uno::RuntimeException);
-
- // XPropertySet
- virtual uno::Reference< beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(uno::RuntimeException);
-
- /// XMultiServiceFactory
- virtual uno::Reference< uno::XInterface > SAL_CALL
- createInstance( const rtl::OUString& aServiceSpecifier )
- throw(uno::Exception, uno::RuntimeException);
-
- virtual uno::Reference< uno::XInterface > SAL_CALL
- createInstanceWithArguments( const ::rtl::OUString& ServiceSpecifier, const uno::Sequence< uno::Any >& Arguments )
- throw(uno::Exception, uno::RuntimeException);
-
- virtual uno::Sequence< rtl::OUString > SAL_CALL
- getAvailableServiceNames( )
- throw(uno::RuntimeException);
-
- /// XLocalizable
- virtual void SAL_CALL
- setLocale( const lang::Locale& eLocale )
- throw (uno::RuntimeException);
-
- virtual lang::Locale SAL_CALL
- getLocale( )
- throw (uno::RuntimeException);
-
-
- //XRefreshable
- virtual void SAL_CALL
- refresh( )
- throw (uno::RuntimeException);
- virtual void SAL_CALL
- addRefreshListener(
- const uno::Reference< util::XRefreshListener >& aListener )
- throw (uno::RuntimeException);
- virtual void SAL_CALL
- removeRefreshListener(
- const uno::Reference< util::XRefreshListener >& aListener )
- throw (uno::RuntimeException);
- //XFlushable
- virtual void SAL_CALL
- flush( )
- throw (uno::RuntimeException);
- virtual void SAL_CALL
- addFlushListener(
- const uno::Reference< util::XFlushListener >& aListener )
- throw (uno::RuntimeException);
- virtual void SAL_CALL
- removeFlushListener(
- const uno::Reference< util::XFlushListener >& aListener )
- throw (uno::RuntimeException);
-
- // OPropertSetHelper
- virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
- sal_Int32 nHandle, const uno::Any& rValue) throw (uno::Exception);
-
- static sal_Int32 countServices(ServiceRegistrationInfo const* aInfo) { return ServiceRegistrationHelper(aInfo).countServices(); }
-
- private:
- // creates a new session
- void implConnect(OProviderImpl& rFreshProviderImpl, const ContextReader& _rSettings) throw (uno::Exception);
-
- // disambuiguated access
- cppu::OBroadcastHelper & getBroadcastHelper()
- { return ServiceComponentImpl::rBHelper; }
-
- /// Component Helper override
- virtual void SAL_CALL disposing();
- virtual void SAL_CALL disposing(lang::EventObject const& rEvt) throw();
-
- // OPropertyArrayUsageHelper
- virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
-
- // OPropertySetHelper
- virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
-
- // OPropertyContainer
- void registerProperty(const rtl::OUString& _rName, sal_Int32 _nHandle, sal_Int32 _nAttributes,
- void* _pPointerToMember, const uno::Type& _rMemberType)
- { OPropertyContainer::registerProperty(_rName, _nHandle, _nAttributes, _pPointerToMember, _rMemberType);}
-
- void describeProperties(uno::Sequence< beans::Property >& /* [out] */ _rProps) const
- { OPropertyContainer::describeProperties(_rProps);}
-
-
- uno::Any SAL_CALL queryPropertyInterface(uno::Type const& rType) throw (uno::RuntimeException)
- { return OPropertyContainer::queryInterface(rType);}
-
- void attachToContext();
- uno::Reference< lang::XComponent > releaseContext();
- void discardContext(uno::Reference< lang::XComponent > const & xContext);
- };
-
-} // namespace configmgr
-
-#endif // CONFIGMGR_API_PROVIDER_HXX_
-
-
diff --git a/configmgr/source/api2/providerimpl.cxx b/configmgr/source/api2/providerimpl.cxx
deleted file mode 100644
index 99df7c95a7..0000000000
--- a/configmgr/source/api2/providerimpl.cxx
+++ /dev/null
@@ -1,893 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <stdio.h>
-#include "providerimpl.hxx"
-#include "options.hxx"
-#include "apifactoryimpl.hxx"
-#include "apitreeimplobj.hxx"
-#include "apitreeaccess.hxx"
-#include "roottree.hxx"
-#include "node.hxx"
-#include "noderef.hxx"
-#include "objectregistry.hxx"
-#include "bootstrap.hxx"
-#include "cachefactory.hxx"
-#include "provider.hxx"
-#include "treemanager.hxx"
-#include "tracer.hxx"
-#include <osl/interlck.h>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/lang/Locale.hpp>
-#include <rtl/ustrbuf.hxx>
-#include <rtl/logfile.hxx>
-
-#define RTL_LOGFILE_OU2A(rtlOUString) (::rtl::OUStringToOString((rtlOUString), RTL_TEXTENCODING_ASCII_US).getStr())
-
-namespace configmgr
-{
- namespace css = ::com::sun::star;
- namespace uno = css::uno;
- namespace beans = css::beans;
-
- namespace configapi
- {
-
- class ApiProviderInstances
- {
- rtl::Reference<ObjectRegistry> m_aObjectRegistry;
- ReadOnlyObjectFactory m_aReaderFactory;
- UpdateObjectFactory m_aWriterFactory;
- ApiProvider m_aReaderProvider;
- ApiProvider m_aWriterProvider;
- public:
- ApiProviderInstances(OProviderImpl& rProviderImpl)
- : m_aObjectRegistry(new ObjectRegistry())
- , m_aReaderFactory(m_aReaderProvider,m_aObjectRegistry)
- , m_aWriterFactory(m_aWriterProvider,m_aObjectRegistry)
- , m_aReaderProvider(m_aReaderFactory,rProviderImpl)
- , m_aWriterProvider(m_aWriterFactory,rProviderImpl)
- {
- }
-
- ~ApiProviderInstances()
- {}
-
- ApiProvider& getReaderProvider() { return m_aReaderProvider; }
- ApiProvider& getWriterProvider() { return m_aWriterProvider; }
- Factory& getReaderFactory() { return m_aReaderFactory; }
- Factory& getWriterFactory() { return m_aWriterFactory; }
- };
- }
-
- //=============================================================================
-
- //=============================================================================
- //= OProviderImpl
- //=============================================================================
- //-----------------------------------------------------------------------------
- OProviderImpl::OProviderImpl(OProvider* _pProvider, uno::Reference< uno::XComponentContext > const & _xContext)
- :m_pProvider(_pProvider)
- ,m_xTypeConverter()
- ,m_aDefaultOptions()
- ,m_pNewProviders(NULL)
- ,m_aTreeManagerMutex()
- ,m_pTreeManager(NULL)
- {
- OSL_ENSURE(_xContext.is(), "OProviderImpl : NULL context !");
-
- uno::Reference< lang::XMultiComponentFactory > xFactory = _xContext->getServiceManager();
- OSL_ENSURE(xFactory.is(), "OProviderImpl : missing service factory !");
-
- m_xTypeConverter = m_xTypeConverter.query(
- xFactory->createInstanceWithContext( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.script.Converter" )),
- _xContext));
-
- OSL_ENSURE(m_xTypeConverter.is(), "Module::Module : could not create an instance of the type converter !");
- }
- //-----------------------------------------------------------------------------
- rtl::Reference< TreeManager > OProviderImpl::maybeGetTreeManager() const SAL_THROW(())
- {
- osl::MutexGuard aGuard(m_aTreeManagerMutex);
- rtl::Reference< TreeManager > xResult(m_pTreeManager);
- return xResult;
- }
- //-----------------------------------------------------------------------------
- rtl::Reference< TreeManager > OProviderImpl::getTreeManager() const SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- osl::MutexGuard aGuard(m_aTreeManagerMutex);
- if (m_pTreeManager == NULL)
- {
- rtl::OUString sMsg = rtl::OUString::createFromAscii("OProviderImpl: No cache available - provider was already disposed.");
- throw com::sun::star::lang::DisposedException(sMsg,static_cast<lang::XMultiServiceFactory*>(m_pProvider));
- }
- rtl::Reference< TreeManager > xResult(m_pTreeManager);
- return xResult;
- }
- //-----------------------------------------------------------------------------
- void OProviderImpl::setTreeManager(TreeManager * pTreeManager) SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- osl::MutexGuard aGuard(m_aTreeManagerMutex);
-
- OSL_PRECOND(m_pTreeManager == NULL, "OProviderImpl: TreeManager is already set");
- OSL_PRECOND(pTreeManager != NULL, "OProviderImpl: Trying to set a NULL TreeManager");
-
- if (pTreeManager == NULL)
- {
- rtl::OUString sMsg = rtl::OUString::createFromAscii("OProviderImpl: No cache available - cache creation failed.");
- throw com::sun::star::uno::RuntimeException(sMsg,NULL);
- }
-
- (m_pTreeManager = pTreeManager) -> acquire();
- }
- //-----------------------------------------------------------------------------
- void OProviderImpl::clearTreeManager() SAL_THROW(())
- {
- osl::ClearableMutexGuard aGuard(m_aTreeManagerMutex);
- if (TreeManager * pTM = m_pTreeManager)
- {
- m_pTreeManager = NULL;
- pTM->release();
- }
- }
- //-----------------------------------------------------------------------------
- bool OProviderImpl::initSession(const ContextReader& _rSettings)
- {
- bool bNeedProfile = false;
- rtl::Reference< TreeManager > xNewTreeManager;
- if (_rSettings.isUnoBackend())
- {
- this->implInitFromSettings(_rSettings,bNeedProfile);
-
- xNewTreeManager = CacheFactory::instance().createCacheManager(_rSettings.getBaseContext());
- }
- else
- {
- throw com::sun::star::uno::RuntimeException(rtl::OUString::createFromAscii("OProviderImpl: Only UNO Backends Supported"),NULL);
- }
-
- setTreeManager( xNewTreeManager.get() );
- OSL_ASSERT( xNewTreeManager.get() );
-
- // put out of line to get rid of the order dependency (and to have a acquired configuration)
- m_pNewProviders = new configapi::ApiProviderInstances(*this);
-
- // now complete our state from the user's profile, if necessary
- if (bNeedProfile)
- try
- {
- static ::rtl::OUString ssUserProfile(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Setup"));
- configuration::AbsolutePath aProfileModule = configuration::AbsolutePath::makeModulePath(ssUserProfile);
-
- sharable::Node * profileTree = xNewTreeManager->requestSubtree(aProfileModule, m_aDefaultOptions);
- if (profileTree != 0)
- {
- implInitFromProfile(profileTree);
-
- // should we clean this up ?
- // xNewTreeManager->releaseSubtree(aProfileModule, xTempOptions);
- }
- }
- catch (uno::Exception& e)
- {
- // could not read profile
- (void)e;
- CFG_TRACE_ERROR_NI("Provider bootstrapping: Caught an exception trying to get 'Setup' data: %s", OUSTRING2ASCII(e.Message));
- }
-
- return true;
- }
- //-----------------------------------------------------------------------------
-
- // these can be overridden. default does nothing
- void OProviderImpl::initFromSettings(const ContextReader& , bool& )
- {
- }
- //-----------------------------------------------------------------------------
- void OProviderImpl::initFromProfile(sharable::Node *)
- {
- }
- //-----------------------------------------------------------------------------
- // these implement the base class behavior
- void OProviderImpl::implInitFromSettings(const ContextReader& _rSettings, bool& rNeedProfile)
- {
- bool bIntrinsicNeedProfile = true;
-
- if (_rSettings.hasLocale())
- {
- bIntrinsicNeedProfile = false;
- rtl::OUString sDefaultLocale = _rSettings.getLocale();
- m_aDefaultOptions.setIsoLocale(sDefaultLocale);
- }
- else if (_rSettings.isAdminService())
- {
- bIntrinsicNeedProfile = false;
- m_aDefaultOptions.setAllLocales();
- }
- else
- OSL_ASSERT(!m_aDefaultOptions.hasLocale());
-
- if (_rSettings.hasAsyncSetting())
- {
- m_aDefaultOptions.enableAsync( !!_rSettings.getAsyncSetting() );
- }
-
-
- // call the template method
- this->initFromSettings(_rSettings, rNeedProfile);
-
- if (bIntrinsicNeedProfile)
- rNeedProfile = true; // to get locale
- }
- //-----------------------------------------------------------------------------
- void OProviderImpl::implInitFromProfile(sharable::Node * profile)
- {
- OSL_ASSERT(profile != 0);
-
- sharable::GroupNode * profileNode = sharable::GroupNode::from(profile);
-
- OSL_ASSERT(profileNode != 0);
-
- // read the default locale for the user
- if (!m_aDefaultOptions.hasLocale())
- {
- static rtl::OUString ssSubGroup(RTL_CONSTASCII_USTRINGPARAM("L10N"));
- static rtl::OUString ssLocale(RTL_CONSTASCII_USTRINGPARAM("ooLocale"));
-
- sharable::GroupNode * l10nNode = sharable::GroupNode::from(profileNode->getChild(ssSubGroup));
- if (l10nNode != 0)
- {
- sharable::ValueNode * value = sharable::ValueNode::from(l10nNode->getChild(ssLocale));
-
- if (value != 0)
- {
- rtl::OUString sDefaultLocale;
- if (value->getValue() >>= sDefaultLocale)
- {
- m_aDefaultOptions.setIsoLocale(sDefaultLocale);
- }
- else
- OSL_ENSURE(false, "Could not extract locale parameter into string");
- }
- }
- }
-
- // call the template method
- this->initFromProfile(profile);
-
- // last fallback, if there is no locale - even in ooLocale
- m_aDefaultOptions.ensureLocaleSet();
- }
-
- //-----------------------------------------------------------------------------
- void OProviderImpl::setDefaultLocale( com::sun::star::lang::Locale const & aLocale )
- {
- m_aDefaultOptions.setLocale( aLocale );
- // ensure that the locale is never cleared to 'empty'
- m_aDefaultOptions.ensureLocaleSet();
- }
-
- //-----------------------------------------------------------------------------
- OProviderImpl::~OProviderImpl()
- {
- UnoApiLock aLock; // hmm...
- clearTreeManager();
-
- delete m_pNewProviders;
- }
-
- // --------------------------------- disposing ---------------------------------
- void SAL_CALL OProviderImpl::dispose() throw()
- {
- try
- {
- rtl::Reference< TreeManager > xTM = maybeGetTreeManager();
-
- if (xTM.is())
- xTM->dispose();
-
- clearTreeManager();
- }
- catch (uno::Exception& e)
- {
- (void)e;
- CFG_TRACE_ERROR("Disposing the TreeManager or closing the session caused an exception: %s", OUSTRING2ASCII(e.Message));
- clearTreeManager();
- }
- }
-
- //-----------------------------------------------------------------------------
- // access to the raw notifications
- TreeManager * OProviderImpl::getNotifier() SAL_THROW(())
- {
- rtl::Reference< TreeManager > xTM = maybeGetTreeManager();
- return xTM.get();
- }
-
- // DefaultProvider access
- //-----------------------------------------------------------------------------
- rtl::Reference< TreeManager > OProviderImpl::getDefaultProvider() const SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- return getTreeManager().get();
- }
-
- //-----------------------------------------------------------------------------
- sharable::Node * OProviderImpl::requestSubtree( configuration::AbsolutePath const& aSubtreePath,
- RequestOptions const & _aOptions
- ) SAL_THROW((com::sun::star::uno::Exception))
- {
- rtl::Reference< TreeManager > xTreeManager = getTreeManager();
-
- sharable::Node * tree = 0;
- try
- {
- tree = xTreeManager->requestSubtree(aSubtreePath, _aOptions);
- }
- catch(uno::Exception&e)
- {
- ::rtl::OUString sMessage = getErrorMessage(aSubtreePath, _aOptions);
- // append the error message given by the tree provider
- sMessage += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n\nThe backend returned the following error:\n"));
- sMessage += e.Message;
-
- throw lang::WrappedTargetException(sMessage, getProviderInstance(), uno::makeAny(e));
- }
-
- if (tree == 0)
- {
- ::rtl::OUString sMessage = getErrorMessage(aSubtreePath, _aOptions);
-
- sMessage += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n\nNo backend error message available\n"));
-
- throw uno::Exception(sMessage, getProviderInstance());
- }
-
- return tree;
- }
-
- //-----------------------------------------------------------------------------
- void OProviderImpl::updateTree(TreeChangeList& aChanges) SAL_THROW((com::sun::star::uno::Exception))
- {
- getTreeManager()->updateTree(aChanges);
- }
-
- //-----------------------------------------------------------------------------
- void OProviderImpl::releaseSubtree( configuration::AbsolutePath const& aSubtreePath, RequestOptions const& _aOptions ) SAL_THROW(())
- {
- rtl::Reference< TreeManager > xTM = maybeGetTreeManager();
- if (xTM.is())
- xTM->releaseSubtree(aSubtreePath, _aOptions);
- }
-
- //-----------------------------------------------------------------------------
- void OProviderImpl::saveAndNotifyUpdate(TreeChangeList const& aChanges) SAL_THROW((com::sun::star::uno::Exception))
- {
- getTreeManager()->saveAndNotifyUpdate(aChanges);
- }
-
- //-----------------------------------------------------------------------------
- void OProviderImpl::fetchSubtree(configuration::AbsolutePath const& aSubtreePath, RequestOptions const& _aOptions) SAL_THROW(())
- {
- rtl::Reference< TreeManager > xTM = maybeGetTreeManager();
- if (xTM.is())
- xTM->fetchSubtree(aSubtreePath, _aOptions);
- }
-
- //-----------------------------------------------------------------------------
- sal_Bool OProviderImpl::fetchDefaultData(configuration::AbsolutePath const& aSubtreePath, RequestOptions const& _aOptions) SAL_THROW((com::sun::star::uno::Exception))
- {
- return getTreeManager()->fetchDefaultData(aSubtreePath, _aOptions);
- }
- //-----------------------------------------------------------------------------------
- void OProviderImpl::refreshAll()SAL_THROW((com::sun::star::uno::Exception))
- {
- m_pTreeManager->refreshAll();
- }
- //-----------------------------------------------------------------------------------
- void OProviderImpl::flushAll()SAL_THROW(())
- {
- m_pTreeManager->flushAll();
- }
- //-----------------------------------------------------------------------------------
- void OProviderImpl::enableAsync(const sal_Bool& bEnableAsync) SAL_THROW(())
- {
- m_pTreeManager->enableAsync(bEnableAsync);
- }
- //-----------------------------------------------------------------------------
- uno::XInterface* OProviderImpl::getProviderInstance()
- {
- return static_cast<com::sun::star::lang::XMultiServiceFactory*>(m_pProvider);
- }
-
- //-----------------------------------------------------------------------------------
- rtl::OUString OProviderImpl::getErrorMessage(configuration::AbsolutePath const& _rAccessor, RequestOptions const& _aOptions)
- {
- rtl::OUString const sAccessor = _rAccessor.toString();
-
- CFG_TRACE_ERROR("config provider: the cache manager could not provide the tree (neither from the cache nor from the session)");
- ::rtl::OUString sMessage;
- ::rtl::OUString sEntity(_aOptions.getEntity());
- ::rtl::OUString sLocale(_aOptions.getLocale());
- CFG_TRACE_INFO_NI("config provider: the entity we tried this for is \"%s\", the locale \"%s\", the path \"%s\"", OUSTRING2ASCII(sEntity), OUSTRING2ASCII(sLocale), OUSTRING2ASCII(sAccessor));
- sMessage += sAccessor;
-
- if (sEntity.getLength())
- {
- sMessage += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" (and for entity "));
- sMessage += sEntity;
- sMessage += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")"));
- }
-
- if (sLocale.getLength())
- {
- sMessage += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" (and for locale "));
- sMessage += sLocale;
- sMessage += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")"));
- }
-
- sMessage += ::rtl::OUString::createFromAscii(" could not be created. Unable to retrieve the node from the configuration server.");
- return sMessage;
- }
-
- // actual factory methods
- //-----------------------------------------------------------------------------------
- configapi::NodeElement* OProviderImpl::buildReadAccess(rtl::OUString const& _rAccessor, RequestOptions const& _aOptions, sal_Int32 nMinLevels) SAL_THROW((com::sun::star::uno::Exception))
- {
- CFG_TRACE_INFO("config provider: requesting the tree from the cache manager");
-
- OSL_ASSERT(sal_Int16(nMinLevels) == nMinLevels);
-
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::OProviderImpl", "jb99855", "configmgr::OProviderImpl::buildReadAccess()");
- RTL_LOGFILE_CONTEXT_TRACE1(aLog, "request path: %s", RTL_LOGFILE_OU2A(_rAccessor) );
-
- try
- {
- configuration::AbsolutePath aAccessorPath = configuration::AbsolutePath::parse(_rAccessor);
-
- sharable::Node * tree = requestSubtree(aAccessorPath,_aOptions);
-
- RTL_LOGFILE_CONTEXT_TRACE(aLog, "data loaded" );
-
- unsigned int nDepth = (nMinLevels == treeop::ALL_LEVELS) ? configuration::C_TreeDepthAll : (unsigned int)(nMinLevels);
-
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog2, "configmgr::OProviderImpl", "jb99855", "configmgr: createReadOnlyTree()");
-
- rtl::Reference< configuration::Tree > aRootTree( configuration::createReadOnlyTree(
- aAccessorPath, tree, nDepth,
- configuration::TemplateProvider( getTreeManager(), _aOptions )
- ));
-
- return m_pNewProviders->getReaderFactory().makeAccessRoot(aRootTree, _aOptions);
- }
- catch (configuration::Exception& e)
- {
- configapi::ExceptionMapper ec(e);
- ec.setContext(this->getProviderInstance());
- //ec.unhandled();
- throw lang::WrappedTargetException(ec.message(), ec.context(), uno::Any());
- }
- }
-
-
- //-----------------------------------------------------------------------------------
- configapi::NodeElement* OProviderImpl::buildUpdateAccess(rtl::OUString const& _rAccessor, RequestOptions const& _aOptions,
- sal_Int32 nMinLevels) SAL_THROW((com::sun::star::uno::Exception))
- {
- CFG_TRACE_INFO("config provider: requesting the tree from the cache manager");
- OSL_ASSERT(sal_Int16(nMinLevels) == nMinLevels);
-
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::OProviderImpl", "jb99855", "configmgr: buildUpdateAccess()");
- RTL_LOGFILE_CONTEXT_TRACE1(aLog, "request path: %s", RTL_LOGFILE_OU2A(_rAccessor) );
-
- try
- {
- configuration::AbsolutePath aAccessorPath = configuration::AbsolutePath::parse(_rAccessor);
-
- sharable::Node * tree = requestSubtree(aAccessorPath, _aOptions);
-
- RTL_LOGFILE_CONTEXT_TRACE(aLog, "data loaded" );
-
- unsigned int nDepth = (nMinLevels == treeop::ALL_LEVELS) ? configuration::C_TreeDepthAll : (unsigned int)(nMinLevels);
-
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog2, "configmgr::OProviderImpl", "jb99855", "createUpdatableTree()");
-
- rtl::Reference< configuration::Tree > aRootTree( configuration::createUpdatableTree(
- aAccessorPath, tree, nDepth,
- configuration::TemplateProvider( getTreeManager(), _aOptions )
- ));
-
-
- return m_pNewProviders->getWriterFactory().makeAccessRoot(aRootTree, _aOptions);
- }
- catch (configuration::Exception& e)
- {
- configapi::ExceptionMapper ec(e);
- ec.setContext(this->getProviderInstance());
- //ec.unhandled();
- throw lang::WrappedTargetException(ec.message(), ec.context(), uno::Any());
- }
- }
-
- //=============================================================================
- //= OProvider::FactoryArguments
- //=============================================================================
-
- sal_Char const * const OProviderImpl::FactoryArguments::asciiArgumentNames[] =
- {
- "nodepath", // ARG_NODEPATH, // requested node path
- "depth", // ARG_DEPTH, // depth of the tree
- "user", // ARG_USER_DEPRECATED, // name of the user - only for admin
- "locale", // ARG_LOCALE, // desired locale
- "nocache", // ARG_NOCACHE_OBSOLETE, // cache disabling
- "lazywrite", // ARG_ASYNC_DEPRECATED, // lasy write data
- "enableasync", // ARG_ASYNC, // lasy write data
- "entity", // ARG_ENTITY, // name of the entity to be manipulated - only for admin
- "reload", //ARG_REFRESH // refresh component
-
- };
-
- OProviderImpl::FactoryArguments::Argument
- OProviderImpl::FactoryArguments::lookupArgument(const rtl::OUString& rName)
- SAL_THROW(())
- {
- rtl::OUString sCheck( rName.toAsciiLowerCase() );
-
- sal_Char const * const * const pFirst = asciiArgumentNames;
- sal_Char const * const * const pLast = pFirst + _arg_count;
-
- sal_Char const * const * it = pFirst;
-
- for(; it != pLast; ++it)
- {
- if (0 == sCheck.compareToAscii(*it))
- {
- break;
- }
- }
-
- OSL_ASSERT( Argument(pLast-pFirst) == ARG_NOT_FOUND );
- return static_cast<Argument>(it - pFirst);
- }
-
- //-----------------------------------------------------------------------------------
- bool OProviderImpl::FactoryArguments::extractOneArgument(
- rtl::OUString const& aName, uno::Any const& aValue,
- rtl::OUString& /* [out] */ _rNodeAccessor,
- sal_Int32& /* [out] */ _nLevels,
- RequestOptions& /* [in/out] */ _rOptions )
- SAL_THROW(())
- {
- switch ( lookupArgument(aName) )
- {
- case ARG_NODEPATH:
- {
- rtl::OUString sStringVal;
- if (aValue >>= sStringVal)
- _rNodeAccessor = sStringVal;
- else
- return false;
- }
- break;
-
- case ARG_DEPTH:
- {
- sal_Int32 nIntVal = 0;
- if (aValue >>= nIntVal)
- _nLevels = nIntVal;
- else
- return false;
- }
- break;
-
- case ARG_ENTITY:
- case ARG_USER_DEPRECATED:
- {
- rtl::OUString sStringVal;
- if (aValue >>= sStringVal)
- _rOptions.setEntity(sStringVal);
- else
- return false;
- }
- break;
-
- case ARG_LOCALE:
- {
- rtl::OUString sStringVal;
- if (aValue >>= sStringVal)
- {
- _rOptions.setIsoLocale(sStringVal);
- break;
- }
-
- lang::Locale aLocale;
- if (aValue >>= aLocale)
- {
- _rOptions.setLocale(aLocale);
- break;
- }
-
- return false;
- }
-
- case ARG_NOCACHE_OBSOLETE:
- {
- sal_Bool bBoolVal;
- if (aValue >>= bBoolVal)
- OSL_ENSURE(false,"ConfigurationProvider: Parameter \"nocache\" is obsolete and has no effect");
- else
- return false;
- }
- break;
-
- case ARG_ASYNC:
- case ARG_ASYNC_DEPRECATED:
- {
- sal_Bool bBoolVal = sal_False;
- if (aValue >>= bBoolVal)
- _rOptions.enableAsync(!!bBoolVal);
- else
- return false;
- }
- break;
- case ARG_REFRESH:
- {
- sal_Bool bBoolVal = sal_False;
- if (aValue >>= bBoolVal)
- _rOptions.forceRefresh(!!bBoolVal);
- else
- return false;
- }
- break;
-
- case ARG_NOT_FOUND:
- {
- rtl::OString sMessage(RTL_CONSTASCII_STRINGPARAM("Unknown argument \""));
- sMessage += rtl::OUStringToOString(aName, RTL_TEXTENCODING_ASCII_US);
- sMessage += rtl::OString(RTL_CONSTASCII_STRINGPARAM("\" !\n- Parameter will be ignored -\n"));
- CFG_TRACE_WARNING( "provider: %s", sMessage.getStr() );
- #ifdef DBG_UTIL
- OSL_ENSURE(false, sMessage.getStr());
- #endif
- }
- break;
-
- default:
- CFG_TRACE_ERROR( "Known argument is not handled" );
- OSL_ENSURE(false, "Known argument is not handled");
- break;
- }
- return true;
- }
-
- //-----------------------------------------------------------------------------------
- static
- void failInvalidArg(uno::Any const & aArg, sal_Int32 _nArg = -1)
- SAL_THROW((lang::IllegalArgumentException))
- {
- OSL_ENSURE( sal_Int16(_nArg) == _nArg, "Argument number out of range. Raising imprecise exception.");
-
- rtl::OUStringBuffer sMessage;
- sMessage.appendAscii("Configuration Provider: An argument");
- sMessage.appendAscii(" has the wrong type.");
- sMessage.appendAscii("\n- Expected a NamedValue or PropertyValue");
- sMessage.appendAscii("\n- Found type ").append( aArg.getValueType().getTypeName() );
-
- throw lang::IllegalArgumentException( sMessage.makeStringAndClear(),
- uno::Reference<uno::XInterface>(),
- sal_Int16(_nArg+1));
- }
-
- //-----------------------------------------------------------------------------------
- static
- void failInvalidArgValue(rtl::OUString const & aName, uno::Any const & aValue, sal_Int32 _nArg = -1)
- SAL_THROW((lang::IllegalArgumentException))
- {
- OSL_ENSURE( sal_Int16(_nArg) == _nArg, "Argument number out of range. Raising imprecise exception.");
-
- rtl::OUStringBuffer sMessage;
- sMessage.appendAscii("Configuration Provider: The argument ").append(aName);
- sMessage.appendAscii(" has the wrong type.");
- sMessage.appendAscii("\n- Found type ").append( aValue.getValueType().getTypeName() );
-
- throw lang::IllegalArgumentException( sMessage.makeStringAndClear(),
- uno::Reference<uno::XInterface>(),
- sal_Int16(_nArg+1));
- }
-
- //-----------------------------------------------------------------------------------
- static
- bool extractLegacyArguments( const uno::Sequence<uno::Any>& _rArgs,
- rtl::OUString& /* [out] */ _rNodeAccessor,
- sal_Int32& /* [out] */ _nLevels )
- SAL_THROW((lang::IllegalArgumentException))
- {
- OSL_ASSERT( _rArgs.getLength() != 0 );
-
- // compatibility : formerly, you could specify the node path as first arg and the (optional) depth
- // as second arg
- if (! (_rArgs[0] >>= _rNodeAccessor) )
- return false;
-
- switch (_rArgs.getLength() )
- {
- case 1:
- // valid single argument
- return true;
-
- case 2:
- // valid second argument
- if (_rArgs[1] >>= _nLevels)
- return true;
-
- break;
-
- default:
- if (_rArgs[1] >>= _nLevels)
- {
- // valid second argument, but too many arguments altogether
- throw lang::IllegalArgumentException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "Configuration Provider: Too many arguments. "
- "Additional arguments are not supported when passing the node path as string (deprecated convention).")),
- uno::Reference<uno::XInterface>(),
- sal_Int16(3)
- );
- }
-
- break;
-
- }
- // here we have an invalid second argument
-
- if (_rArgs[1].getValueTypeClass() != uno::TypeClass_STRUCT)
- {
- // completely invalid second argument
- failInvalidArgValue(rtl::OUString::createFromAscii("<depth>"),_rArgs[1],1);
- }
-
- // Assume PropertyValue or NamedValue,
- // which should be handled consistently by caller
- return false;
- }
-
- //-----------------------------------------------------------------------------------
- void OProviderImpl::FactoryArguments::extractArgs( const uno::Sequence<uno::Any>& _rArgs,
- rtl::OUString& /* [out] */ _rNodeAccessor,
- sal_Int32& /* [out] */ _nLevels,
- RequestOptions & /* [in/out] */ _aOptions )
- SAL_THROW((lang::IllegalArgumentException))
- {
- UnoApiLock aLock;
-
- _nLevels = treeop::ALL_LEVELS; // setting a fallback
-
- // the args have to be a sequence of property or named values
- beans::NamedValue aNV;
- beans::PropertyValue aPV;
- for (sal_Int32 i=0; i<_rArgs.getLength(); ++i)
- {
- if (_rArgs[i] >>= aPV)
- {
- if ( !extractOneArgument(aPV.Name,aPV.Value,_rNodeAccessor,_nLevels,_aOptions) )
- failInvalidArgValue(aPV.Name,aPV.Value,i);
- }
- else if (_rArgs[i] >>= aNV)
- {
- if ( !extractOneArgument(aNV.Name,aNV.Value,_rNodeAccessor,_nLevels,_aOptions) )
- failInvalidArgValue(aNV.Name,aNV.Value,i);
- }
- else
- {
- if (i == 0)// try compatibility format
- if ( extractLegacyArguments(_rArgs,_rNodeAccessor,_nLevels))
- break;
-
- failInvalidArg(_rArgs[i],i);
- OSL_ASSERT(false);
- }
- }
-
- if (_rNodeAccessor.getLength() == 0)
- {
- rtl::OUString sMessage(RTL_CONSTASCII_USTRINGPARAM("Configuration Provider: Missing argument: no nodepath was provided"));
- throw lang::IllegalArgumentException(sMessage,uno::Reference<uno::XInterface>(),0);
- }
- }
-
- //--------------------------------------------------------------------------
- uno::Reference<uno::XInterface> OProviderImpl::createReadAccess( uno::Sequence<uno::Any> const& aArgs)
- SAL_THROW((com::sun::star::uno::Exception))
- {
- CFG_TRACE_INFO("config provider: going to create a read access instance");
-
- // extract the args
- rtl::OUString sPath;
- sal_Int32 nLevels;
-
- RequestOptions aOptions = getDefaultOptions();
-
- OProviderImpl::FactoryArguments::extractArgs(aArgs, sPath, nLevels, aOptions);
-
- CFG_TRACE_INFO_NI("config provider: node accessor extracted from the args is %s", OUSTRING2ASCII(sPath));
- CFG_TRACE_INFO_NI("config provider: level depth extracted from the args is %i", nLevels);
-
- // create the access object
- uno::Reference< uno::XInterface > xReturn;
-
- configapi::NodeElement* pElement = buildReadAccess(sPath, aOptions, nLevels);
- if (pElement != 0)
- {
- xReturn = pElement->getUnoInstance();
- if (xReturn.is())
- // acquired once by buildReadAccess
- xReturn->release();
- }
-
- return xReturn;
- }
-
- //-----------------------------------------------------------------------------------
- uno::Reference<uno::XInterface> OProviderImpl::createUpdateAccess( uno::Sequence<uno::Any> const& aArgs)
- SAL_THROW((com::sun::star::uno::Exception))
- {
- CFG_TRACE_INFO("config provider: going to create an update access instance");
-
- // extract the args
- rtl::OUString sPath;
- sal_Int32 nLevels;
-
- RequestOptions aOptions = getDefaultOptions();
-
- OProviderImpl::FactoryArguments::extractArgs(aArgs, sPath, nLevels, aOptions);
-
- CFG_TRACE_INFO_NI("config provider: node accessor extracted from the args is %s", OUSTRING2ASCII(sPath));
- CFG_TRACE_INFO_NI("config provider: level depth extracted from the args is %i", nLevels);
-
- // create the access object
- uno::Reference< uno::XInterface > xReturn;
-
- configapi::NodeElement* pElement = buildUpdateAccess(sPath, aOptions, nLevels);
- if (pElement != 0)
- {
- xReturn = pElement->getUnoInstance();
- if (xReturn.is())
- // acquired once by buildReadAccess
- xReturn->release();
- }
-
- return xReturn;
- }
-//-----------------------------------------------------------------------------------
-
-
-} // namespace configmgr
-
-
diff --git a/configmgr/source/api2/providerimpl.hxx b/configmgr/source/api2/providerimpl.hxx
deleted file mode 100644
index 37daa1dc7b..0000000000
--- a/configmgr/source/api2/providerimpl.hxx
+++ /dev/null
@@ -1,228 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_PROVIDERIMPL_HXX_
-#define CONFIGMGR_API_PROVIDERIMPL_HXX_
-
-#include "defaultprovider.hxx"
-#include "requestoptions.hxx"
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/script/XTypeConverter.hpp>
-#include <com/sun/star/lang/XEventListener.hpp>
-#include <com/sun/star/lang/XComponent.hpp>
-#include <cppuhelper/implbase1.hxx>
-#include <osl/mutex.hxx>
-
-namespace com { namespace sun { namespace star {
- namespace uno
- {
- class Any;
- class XInterface;
- template <class> class Sequence;
- template <class> class Reference;
- }
- namespace beans
- {
- struct PropertyValue;
- }
-} } }
-
-namespace rtl
-{
- class OUString;
- template <class RCType> class Reference;
-}
-
-namespace configmgr
-{
- namespace css = ::com::sun::star;
- namespace uno = css::uno;
- namespace script = css::script;
- namespace lang = css::lang;
- namespace beans = css::beans;
-
- class ISubtree;
- struct TreeChangeList;
- class TreeManager;
- class ContextReader;
- class OProvider;
-
- namespace configapi
- {
- class NodeElement;
- class ApiProviderInstances;
- class Factory;
- }
- namespace sharable { union Node; }
-
- // -----------------------------------------------------------------------------
- class OProviderImpl : public IDefaultableTreeManager
- {
- friend class OProvider;
- public:
- //==========================================================================
- //= FactoryArguments
- //==========================================================================
- /** Helper class for evaluation of the arguments for creating a service instance.*/
- struct FactoryArguments
- {
- /// possible arguments, given only in small letters.
- enum Argument
- {
- ARG_NODEPATH, // requested node path
- ARG_DEPTH, // depth of the tree
- ARG_USER_DEPRECATED, // name of the entity to be manipulated - deprecated version
- ARG_LOCALE, // desired locale
- ARG_NOCACHE_OBSOLETE, // cache disabling - obsolete and nonfunctional
- ARG_ASYNC_DEPRECATED, // lasy write data - deprecated version
- ARG_ASYNC, // lazy write data
- ARG_ENTITY, // name of the entity to be manipulated - only for admin
- ARG_REFRESH, // force refresh of data into cache
-
- _arg_count,
- ARG_NOT_FOUND = _arg_count
- };
- static sal_Char const * const asciiArgumentNames[];
-
- static Argument lookupArgument(rtl::OUString const& sArgumentName) SAL_THROW(());
- public:
- /** extracts arguments from the argument sequence into to the parameter variables
-
- <p>unknown arguments are ignored</p>
-
- @throws com::sun::star::lang::IllegalArgumentException
- if an element of _rArgs had the wrong type or
- if the value of a known argument has the wrong type or
- if the value of a known argument is out of range (sometimes)
- or if no non-empty node path argument could be extracted,
- */
- static void extractArgs( const uno::Sequence<uno::Any>& _rArgs,
- rtl::OUString& /* [out] */ _rNodeAccessor,
- sal_Int32& /* [out] */ _nLevels,
- RequestOptions& /* [in/out] */ xOptions)
- SAL_THROW((lang::IllegalArgumentException));
-
- static bool extractOneArgument( rtl::OUString const& aName, uno::Any const& aValue,
- rtl::OUString& /* [out] */ _rNodeAccessor,
- sal_Int32& /* [out] */ _nLevels,
- RequestOptions& /* [in/out] */ xOptions
- ) SAL_THROW(());
-
- };
-
- private:
- OProvider* m_pProvider; /// used for ref counting, uno representation
-
- uno::Reference< script::XTypeConverter > m_xTypeConverter;
- RequestOptions m_aDefaultOptions;
- configapi::ApiProviderInstances* m_pNewProviders;
- mutable osl::Mutex m_aTreeManagerMutex;
- TreeManager* m_pTreeManager; /// the tree cache. Will hold a reference to us as long as it life
-
- rtl::Reference< TreeManager > maybeGetTreeManager() const SAL_THROW(());
- rtl::Reference< TreeManager > getTreeManager() const SAL_THROW((com::sun::star::uno::RuntimeException));
- void setTreeManager(TreeManager * pTreeManager) SAL_THROW((com::sun::star::uno::RuntimeException));
- void clearTreeManager() SAL_THROW(());
-
- OProviderImpl(OProvider* _pProvider,
- uno::Reference< uno::XComponentContext > const & xContext);
-
- public:
- virtual ~OProviderImpl();
-
- /** request that the tree named by a path is added to the collection of managed trees
- respecting certain options and requiring a specific loading depth.
- Return a reference to that managed tree.
- The reference must later be released by calling releaseSubtree with the same path and options.
- */
- sharable::Node * requestSubtree(configuration::AbsolutePath const& aSubtreePath, const RequestOptions& _aOptions) SAL_THROW((com::sun::star::uno::Exception));
-
- /// update the managed data according to a changes list - update the changes list accordingly with old values
- void updateTree(TreeChangeList& aChanges) SAL_THROW((com::sun::star::uno::Exception));
-
- // bookkeeping support
- void releaseSubtree( configuration::AbsolutePath const& aSubtreePath, const RequestOptions& _aOptions ) SAL_THROW(());
-
- // notification
- void saveAndNotifyUpdate(TreeChangeList const& aChanges) SAL_THROW((com::sun::star::uno::Exception));
-
- /** request that the tree named by a path is added to the collection of managed trees
- respecting certain options and requiring a specific loading depth.
- */
- void fetchSubtree(configuration::AbsolutePath const& aSubtreePath, const RequestOptions& _aOptions) SAL_THROW(());
-
- //Refresh all components in the cache
- void refreshAll() SAL_THROW((com::sun::star::uno::Exception));
-
- //Flush all components in the cache
- void flushAll() SAL_THROW(());
-
- //Enable/Disable Asynchronous write-back to cache
- void enableAsync(const sal_Bool& bEnableAsync) SAL_THROW(());
-
- /// IDefaultableTreeManager
- virtual sal_Bool fetchDefaultData(configuration::AbsolutePath const& aSubtreePath, const RequestOptions& _aOptions
- ) SAL_THROW((com::sun::star::uno::Exception));
-
- // DefaultProvider access
- rtl::Reference< TreeManager > getDefaultProvider() const SAL_THROW((com::sun::star::uno::RuntimeException));
-
- protected:
- static rtl::OUString getErrorMessage(configuration::AbsolutePath const& _rAccessor, const RequestOptions& _aOptions);
-
- void SAL_CALL dispose() throw();
- public:
- void setDefaultLocale( com::sun::star::lang::Locale const & aLocale );
-
- RequestOptions const& getDefaultOptions() const {return m_aDefaultOptions;}
- uno::Reference< script::XTypeConverter > getTypeConverter() const {return m_xTypeConverter;}
- TreeManager * getNotifier() SAL_THROW(());
- uno::XInterface* getProviderInstance();
-
- // actual factory methods
- // the returned object (if any) has to be acquired once)
- configapi::NodeElement* buildReadAccess( rtl::OUString const& _rAccessor, const RequestOptions& _aOptions, sal_Int32 nMinLevels) SAL_THROW((com::sun::star::uno::Exception));
- // the returned object (if any) has to be acquired once)
- configapi::NodeElement* buildUpdateAccess(rtl::OUString const& _rAccessor, const RequestOptions& _aOptions, sal_Int32 nMinLevels) SAL_THROW((com::sun::star::uno::Exception));
- // factory methods
- uno::Reference<uno::XInterface> createReadAccess( uno::Sequence<uno::Any> const& aArgs) SAL_THROW((com::sun::star::uno::Exception));
- uno::Reference<uno::XInterface> createUpdateAccess( uno::Sequence<uno::Any> const& aArgs) SAL_THROW((com::sun::star::uno::Exception));
-
- private:
- bool initSession(const ContextReader& _rSettings);
- private:
- void implInitFromSettings(const ContextReader& _rSettings, bool& rNeedProfile);
- void implInitFromProfile(sharable::Node * aProfile);
-
- void initFromSettings(const ContextReader& _rSettings, bool& rNeedProfile);
- void initFromProfile(sharable::Node * aProfile);
- };
-} // namespace configmgr
-
-#endif // CONFIGMGR_API_PROVIDERIMPL_HXX_
-
-
diff --git a/configmgr/source/api2/setaccess.cxx b/configmgr/source/api2/setaccess.cxx
deleted file mode 100644
index 005b764a6d..0000000000
--- a/configmgr/source/api2/setaccess.cxx
+++ /dev/null
@@ -1,185 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "setaccess.hxx"
-#include "accessimpl.hxx"
-#include "apinotifierimpl.hxx"
-#include "apinodeaccess.hxx"
-
-namespace configmgr
-{
-
-// XHierarchicalName
-//------------------------------------------------------------------------------------------------------------------
-rtl::OUString SAL_CALL BasicSetAccess::getHierarchicalName( ) throw(uno::RuntimeException)
-{
- return configapi::implGetHierarchicalName( getNode() );
-}
-
-//------------------------------------------------------------------------------------------------------------------
-rtl::OUString SAL_CALL BasicSetAccess::composeHierarchicalName( const rtl::OUString& sRelativeName )
- throw(css::lang::IllegalArgumentException, css::lang::NoSupportException, uno::RuntimeException)
-{
- return configapi::implComposeHierarchicalName( getNode(), sRelativeName );
-}
-
-//------------------------------------------------------------------------------------------------------------------
-
-// XElementAccess, base class of XNameAccess (and XHierarchicalNameAccess ? )
-//-----------------------------------------------------------------------------------
-
-uno::Type SAL_CALL BasicSetAccess::getElementType( ) throw(uno::RuntimeException)
-{
- return configapi::implGetElementType( getNode() );
-}
-
-//-----------------------------------------------------------------------------------
-sal_Bool SAL_CALL BasicSetAccess::hasElements( ) throw(uno::RuntimeException)
-{
- return configapi::implHasElements( getNode() );
-}
-
-// XExactName
-//-----------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL BasicSetAccess::getExactName( const rtl::OUString& rApproximateName ) throw(uno::RuntimeException)
-{
- return configapi::implGetExactName( getNode(), rApproximateName);
-}
-
-// XProperty
-//-----------------------------------------------------------------------------------
-
-css::beans::Property SAL_CALL BasicSetAccess::getAsProperty( ) throw(uno::RuntimeException)
-{
- return configapi::implGetAsProperty( getNode() );
-}
-
-// XPropertySetInfo
-//-----------------------------------------------------------------------------------
-
-uno::Sequence< css::beans::Property > SAL_CALL BasicSetAccess::getProperties( ) throw (uno::RuntimeException)
-{
- return configapi::implGetProperties( getNode() );
-}
-
-css::beans::Property SAL_CALL BasicSetAccess::getPropertyByName( const rtl::OUString& aName )
- throw (css::beans::UnknownPropertyException, uno::RuntimeException)
-{
- return configapi::implGetPropertyByName( getNode(), aName );
-}
-
-sal_Bool SAL_CALL BasicSetAccess::hasPropertyByName( const rtl::OUString& name ) throw (uno::RuntimeException)
-{
- return configapi::implHasPropertyByName( getNode(), name );
-}
-
-
-// XNameAccess
-//-----------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL BasicSetAccess::hasByName( const rtl::OUString& sName ) throw(uno::RuntimeException)
-{
- return configapi::implHasByName( getNode(), sName);
-}
-
-//-----------------------------------------------------------------------------------
-uno::Any SAL_CALL BasicSetAccess::getByName( const rtl::OUString& sName )
- throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException)
-{
- return configapi::implGetByName( getNode(), sName );
-}
-
-//-----------------------------------------------------------------------------------
-uno::Sequence< rtl::OUString > SAL_CALL BasicSetAccess::getElementNames( ) throw( uno::RuntimeException)
-{
- return configapi::implGetElementNames( getNode() );
-}
-
-// XHierarchicalNameAccess
-//-----------------------------------------------------------------------------------
-sal_Bool SAL_CALL BasicSetAccess::hasByHierarchicalName( const rtl::OUString& sName ) throw(uno::RuntimeException)
-{
- return configapi::implHasByHierarchicalName( getNode(), sName);
-}
-
-//-----------------------------------------------------------------------------------
-uno::Any SAL_CALL BasicSetAccess::getByHierarchicalName( const rtl::OUString& sName )
- throw(css::container::NoSuchElementException, uno::RuntimeException)
-{
- return configapi::implGetByHierarchicalName( getNode(), sName );
-}
-
-
-// XContainer
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicSetAccess::addContainerListener( const uno::Reference< css::container::XContainerListener >& xListener )
- throw(uno::RuntimeException)
-{
- configapi::implAddListener( getNode(), xListener );
-}
-
-void SAL_CALL BasicSetAccess::removeContainerListener( const uno::Reference< css::container::XContainerListener >& xListener )
- throw(uno::RuntimeException)
-{
- configapi::implRemoveListener( getNode(), xListener );
-}
-
-//-----------------------------------------------------------------------------------
-// Set-specific interfaces
-//-----------------------------------------------------------------------------------
-
-// XTemplateContainer
-//-----------------------------------------------------------------------------------
-rtl::OUString SAL_CALL BasicSetAccess::getElementTemplateName( )
- throw(uno::RuntimeException)
-{
- return configapi::implGetElementTemplateName( getNode() );
-}
-
-// XStringEscape
-//-----------------------------------------------------------------------------------
-rtl::OUString SAL_CALL BasicSetAccess::escapeString( const rtl::OUString& aString )
- throw(css::lang::IllegalArgumentException, uno::RuntimeException)
-{
- return aString;
-}
-
-rtl::OUString SAL_CALL BasicSetAccess::unescapeString( const rtl::OUString& aEscapedString )
- throw(css::lang::IllegalArgumentException, uno::RuntimeException)
-{
- return aEscapedString;
-}
-
-//-----------------------------------------------------------------------------------
-} // namespace configmgr
-
-
diff --git a/configmgr/source/api2/setaccess.hxx b/configmgr/source/api2/setaccess.hxx
deleted file mode 100644
index d834a22c40..0000000000
--- a/configmgr/source/api2/setaccess.hxx
+++ /dev/null
@@ -1,167 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_SETACCESS_HXX_
-#define CONFIGMGR_API_SETACCESS_HXX_
-
-#include <com/sun/star/container/XHierarchicalName.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
-#include <com/sun/star/container/XContainer.hpp>
-#include <com/sun/star/configuration/XTemplateContainer.hpp>
-#include <com/sun/star/beans/XExactName.hpp>
-#include <com/sun/star/beans/XProperty.hpp>
-#include <com/sun/star/beans/XPropertySetInfo.hpp>
-#include <com/sun/star/util/XStringEscape.hpp>
-#include <cppuhelper/implbase9.hxx>
-
-namespace configmgr
-{
- namespace css = ::com::sun::star;
- namespace uno = ::com::sun::star::uno;
-
- namespace configapi { class NodeSetInfoAccess; }
-
- /** implements the (read-only) interfaces supported by a set node
- within the configuration tree.
- <p> Is an interface adapter around <type scope='configmgr::configapi'>NodeAccess</type>.</p>
- */
- class BasicSetAccess
- : public ::cppu::ImplHelper9
- < css::container::XNameAccess
- , css::container::XHierarchicalName
- , css::container::XHierarchicalNameAccess
- , css::container::XContainer
- , css::beans::XExactName
- , css::beans::XProperty
- , css::beans::XPropertySetInfo
- , css::configuration::XTemplateContainer
- , css::util::XStringEscape
- >
- {
- protected:
- // Destructors
- virtual ~BasicSetAccess() {}
-
- public:
- // Interface methods
- // XHierarchicalName
- virtual rtl::OUString SAL_CALL
- getHierarchicalName( )
- throw(uno::RuntimeException);
-
- virtual rtl::OUString SAL_CALL
- composeHierarchicalName( const rtl::OUString& aRelativeName )
- throw(css::lang::IllegalArgumentException, css::lang::NoSupportException,
- uno::RuntimeException);
-
- // XElementAccess, base class of XNameAccess
- virtual uno::Type SAL_CALL
- getElementType( )
- throw(uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- hasElements( )
- throw(uno::RuntimeException);
-
- // XNameAccess
- virtual uno::Any SAL_CALL
- getByName( const rtl::OUString& aName )
- throw(css::container::NoSuchElementException, css::lang::WrappedTargetException,
- uno::RuntimeException);
-
- virtual uno::Sequence< rtl::OUString > SAL_CALL
- getElementNames( )
- throw( uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- hasByName( const rtl::OUString& aName )
- throw(uno::RuntimeException);
-
- // XHierarchicalNameAccess
- virtual uno::Any SAL_CALL
- getByHierarchicalName( const rtl::OUString& aName )
- throw(css::container::NoSuchElementException, uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- hasByHierarchicalName( const rtl::OUString& aName )
- throw(uno::RuntimeException);
-
- // XContainer
- virtual void SAL_CALL
- addContainerListener( const uno::Reference< css::container::XContainerListener >& xListener )
- throw(uno::RuntimeException);
-
- virtual void SAL_CALL
- removeContainerListener( const uno::Reference< css::container::XContainerListener >& xListener )
- throw(uno::RuntimeException);
-
- // XExactName
- virtual rtl::OUString SAL_CALL
- getExactName( const rtl::OUString& aApproximateName )
- throw(uno::RuntimeException);
-
- // XProperty
- virtual css::beans::Property SAL_CALL
- getAsProperty( )
- throw(uno::RuntimeException);
-
- // XPropertySetInfo
- virtual uno::Sequence< css::beans::Property > SAL_CALL
- getProperties( )
- throw (uno::RuntimeException);
-
- virtual css::beans::Property SAL_CALL
- getPropertyByName( const rtl::OUString& aName )
- throw (css::beans::UnknownPropertyException, uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- hasPropertyByName( const rtl::OUString& name )
- throw (uno::RuntimeException);
-
- // XTemplateContainer
- rtl::OUString SAL_CALL
- getElementTemplateName( )
- throw(uno::RuntimeException);
-
- // XStringEscape
- rtl::OUString SAL_CALL
- escapeString( const rtl::OUString& aString )
- throw(css::lang::IllegalArgumentException, uno::RuntimeException);
-
- rtl::OUString SAL_CALL
- unescapeString( const rtl::OUString& aEscapedString )
- throw(css::lang::IllegalArgumentException, uno::RuntimeException);
-
- protected:
- virtual configapi::NodeSetInfoAccess& getNode() = 0;
- };
-
-}
-#endif // CONFIGMGR_API_SETACCESS_HXX_
-
-
diff --git a/configmgr/source/api2/setobjects.cxx b/configmgr/source/api2/setobjects.cxx
deleted file mode 100644
index 462623727b..0000000000
--- a/configmgr/source/api2/setobjects.cxx
+++ /dev/null
@@ -1,547 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-#include "setobjects.hxx"
-#include "comphelper/sequence.hxx"
-
-//........................................................................
-namespace configmgr
-{
-
-//==========================================================================
-//= OInnerSetInfo
-//==========================================================================
-
-// XInterface refcounting
-void SAL_CALL OInnerSetInfo::acquire( ) throw ()
-{
- BasicInnerElement::acquire();
-}
-
-void SAL_CALL OInnerSetInfo::release( ) throw ()
-{
- BasicInnerElement::release();
-}
-
-// XInterface joining
-uno::Any SAL_CALL OInnerSetInfo::queryInterface( uno::Type const& rType ) throw (uno::RuntimeException )
-{
- uno::Any aRet = BasicInnerElement::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicSetAccess::queryInterface(rType);
-
- return aRet;
-}
-
-// XTypeProvider joining
-uno::Sequence< uno::Type > SAL_CALL OInnerSetInfo::getTypes( ) throw (uno::RuntimeException )
-{
- return comphelper::concatSequences(BasicInnerElement::getTypes(),BasicSetAccess::getTypes() );
-}
-
-uno::Sequence< sal_Int8 > SAL_CALL OInnerSetInfo::getImplementationId( ) throw (uno::RuntimeException )
-{
- return BasicInnerElement::getImplementationId();
-}
-
-
-configapi::NodeAccess& OInnerSetInfo::getNodeAccess()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeSetInfoAccess& OInnerSetInfo::getNode()
-{
- return m_aAccessElement;
-}
-
-configapi::InnerElement& OInnerSetInfo::getElementClass()
-{
- return m_aAccessElement;
-}
-
-//==========================================================================
-//= OInnerTreeSetUpdate
-//==========================================================================
-
-// XInterface refcounting
-void SAL_CALL OInnerTreeSetUpdate::acquire( ) throw ()
-{
- BasicInnerElement::acquire();
-}
-
-void SAL_CALL OInnerTreeSetUpdate::release( ) throw ()
-{
- BasicInnerElement::release();
-}
-
-// XInterface joining
-uno::Any SAL_CALL OInnerTreeSetUpdate::queryInterface( uno::Type const& rType ) throw (uno::RuntimeException )
-{
- uno::Any aRet = BasicInnerElement::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicSet::queryInterface(rType);
-
- return aRet;
-}
-
-// XTypeProvider joining
-uno::Sequence< uno::Type > SAL_CALL OInnerTreeSetUpdate::getTypes( ) throw (uno::RuntimeException )
-{
- return comphelper::concatSequences(BasicInnerElement::getTypes(),BasicSet::getTypes() );
-}
-
-uno::Sequence< sal_Int8 > SAL_CALL OInnerTreeSetUpdate::getImplementationId( ) throw (uno::RuntimeException )
-{
- return BasicInnerElement::getImplementationId();
-}
-
-
-configapi::NodeAccess& OInnerTreeSetUpdate::getNodeAccess()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeSetInfoAccess& OInnerTreeSetUpdate::getNode()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeTreeSetAccess* OInnerTreeSetUpdate::maybeGetUpdateAccess()
-{
- return &m_aAccessElement;
-}
-
-configapi::InnerElement& OInnerTreeSetUpdate::getElementClass()
-{
- return m_aAccessElement;
-}
-
-//==========================================================================
-//= OInnerValueSetUpdate
-//==========================================================================
-
-// XInterface refcounting
-void SAL_CALL OInnerValueSetUpdate::acquire( ) throw ()
-{
- BasicInnerElement::acquire();
-}
-
-void SAL_CALL OInnerValueSetUpdate::release( ) throw ()
-{
- BasicInnerElement::release();
-}
-
-// XInterface joining
-uno::Any SAL_CALL OInnerValueSetUpdate::queryInterface( uno::Type const& rType ) throw (uno::RuntimeException )
-{
- uno::Any aRet = BasicInnerElement::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicValueSet::queryInterface(rType);
-
- return aRet;
-}
-
-// XTypeProvider joining
-uno::Sequence< uno::Type > SAL_CALL OInnerValueSetUpdate::getTypes( ) throw (uno::RuntimeException )
-{
- return comphelper::concatSequences(BasicInnerElement::getTypes(),BasicValueSet::getTypes() );
-}
-
-uno::Sequence< sal_Int8 > SAL_CALL OInnerValueSetUpdate::getImplementationId( ) throw (uno::RuntimeException )
-{
- return BasicInnerElement::getImplementationId();
-}
-
-
-configapi::NodeAccess& OInnerValueSetUpdate::getNodeAccess()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeSetInfoAccess& OInnerValueSetUpdate::getNode()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeValueSetAccess* OInnerValueSetUpdate::maybeGetUpdateAccess()
-{
- return &m_aAccessElement;
-}
-
-configapi::InnerElement& OInnerValueSetUpdate::getElementClass()
-{
- return m_aAccessElement;
-}
-
-//==========================================================================
-//= OSetElementSetInfo
-//==========================================================================
-
-// XInterface refcounting
-void SAL_CALL OSetElementSetInfo::acquire( ) throw ()
-{
- BasicSetElement::acquire();
-}
-
-void SAL_CALL OSetElementSetInfo::release( ) throw ()
-{
- BasicSetElement::release();
-}
-
-// XInterface joining
-uno::Any SAL_CALL OSetElementSetInfo::queryInterface( uno::Type const& rType ) throw (uno::RuntimeException )
-{
- uno::Any aRet = BasicSetElement::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicSetAccess::queryInterface(rType);
-
- return aRet;
-}
-
-// XTypeProvider joining
-uno::Sequence< uno::Type > SAL_CALL OSetElementSetInfo::getTypes( ) throw (uno::RuntimeException )
-{
- return comphelper::concatSequences(BasicSetElement::getTypes(),BasicSetAccess::getTypes() );
-}
-
-uno::Sequence< sal_Int8 > SAL_CALL OSetElementSetInfo::getImplementationId( ) throw (uno::RuntimeException )
-{
- return BasicSetElement::getImplementationId();
-}
-
-
-configapi::NodeAccess& OSetElementSetInfo::getNodeAccess()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeSetInfoAccess& OSetElementSetInfo::getNode()
-{
- return m_aAccessElement;
-}
-
-configapi::SetElement& OSetElementSetInfo::getElementClass()
-{
- return m_aAccessElement;
-}
-
-//==========================================================================
-//= OSetElementTreeSetUpdate
-//==========================================================================
-
-// XInterface refcounting
-void SAL_CALL OSetElementTreeSetUpdate::acquire( ) throw ()
-{
- BasicSetElement::acquire();
-}
-
-void SAL_CALL OSetElementTreeSetUpdate::release( ) throw ()
-{
- BasicSetElement::release();
-}
-
-// XInterface joining
-uno::Any SAL_CALL OSetElementTreeSetUpdate::queryInterface( uno::Type const& rType ) throw (uno::RuntimeException )
-{
- uno::Any aRet = BasicSetElement::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicSet::queryInterface(rType);
-
- return aRet;
-}
-
-// XTypeProvider joining
-uno::Sequence< uno::Type > SAL_CALL OSetElementTreeSetUpdate::getTypes( ) throw (uno::RuntimeException )
-{
- return comphelper::concatSequences(BasicSetElement::getTypes(),BasicSet::getTypes() );
-}
-
-uno::Sequence< sal_Int8 > SAL_CALL OSetElementTreeSetUpdate::getImplementationId( ) throw (uno::RuntimeException )
-{
- return BasicSetElement::getImplementationId();
-}
-
-
-configapi::NodeAccess& OSetElementTreeSetUpdate::getNodeAccess()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeSetInfoAccess& OSetElementTreeSetUpdate::getNode()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeTreeSetAccess* OSetElementTreeSetUpdate::maybeGetUpdateAccess()
-{
- return &m_aAccessElement;
-}
-
-configapi::SetElement& OSetElementTreeSetUpdate::getElementClass()
-{
- return m_aAccessElement;
-}
-
-//==========================================================================
-//= OSetElementValueSetUpdate
-//==========================================================================
-
-// XInterface refcounting
-void SAL_CALL OSetElementValueSetUpdate::acquire( ) throw ()
-{
- BasicSetElement::acquire();
-}
-
-void SAL_CALL OSetElementValueSetUpdate::release( ) throw ()
-{
- BasicSetElement::release();
-}
-
-// XInterface joining
-uno::Any SAL_CALL OSetElementValueSetUpdate::queryInterface( uno::Type const& rType ) throw (uno::RuntimeException )
-{
- uno::Any aRet = BasicSetElement::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicValueSet::queryInterface(rType);
-
- return aRet;
-}
-
-// XTypeProvider joining
-uno::Sequence< uno::Type > SAL_CALL OSetElementValueSetUpdate::getTypes( ) throw (uno::RuntimeException )
-{
- return comphelper::concatSequences(BasicSetElement::getTypes(),BasicValueSet::getTypes() );
-}
-
-uno::Sequence< sal_Int8 > SAL_CALL OSetElementValueSetUpdate::getImplementationId( ) throw (uno::RuntimeException )
-{
- return BasicSetElement::getImplementationId();
-}
-
-
-configapi::NodeAccess& OSetElementValueSetUpdate::getNodeAccess()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeSetInfoAccess& OSetElementValueSetUpdate::getNode()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeValueSetAccess* OSetElementValueSetUpdate::maybeGetUpdateAccess()
-{
- return &m_aAccessElement;
-}
-
-configapi::SetElement& OSetElementValueSetUpdate::getElementClass()
-{
- return m_aAccessElement;
-}
-
-//==========================================================================
-//= ORootElementSetInfo
-//==========================================================================
-
-// XInterface refcounting
-void SAL_CALL ORootElementSetInfo::acquire( ) throw ()
-{
- BasicRootElement::acquire();
-}
-
-void SAL_CALL ORootElementSetInfo::release( ) throw ()
-{
- BasicRootElement::release();
-}
-
-// XInterface joining
-uno::Any SAL_CALL ORootElementSetInfo::queryInterface( uno::Type const& rType ) throw (uno::RuntimeException )
-{
- uno::Any aRet = BasicRootElement::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicSetAccess::queryInterface(rType);
-
- return aRet;
-}
-
-// XTypeProvider joining
-uno::Sequence< uno::Type > SAL_CALL ORootElementSetInfo::getTypes( ) throw (uno::RuntimeException )
-{
- return comphelper::concatSequences(BasicRootElement::getTypes(),BasicSetAccess::getTypes() );
-}
-
-uno::Sequence< sal_Int8 > SAL_CALL ORootElementSetInfo::getImplementationId( ) throw (uno::RuntimeException )
-{
- return BasicRootElement::getImplementationId();
-}
-
-
-configapi::NodeAccess& ORootElementSetInfo::getNodeAccess()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeSetInfoAccess& ORootElementSetInfo::getNode()
-{
- return m_aAccessElement;
-}
-
-configapi::RootElement& ORootElementSetInfo::getElementClass()
-{
- return m_aAccessElement;
-}
-
-//==========================================================================
-//= ORootElementTreeSetUpdate
-//==========================================================================
-
-// XInterface refcounting
-void SAL_CALL ORootElementTreeSetUpdate::acquire( ) throw ()
-{
- BasicUpdateElement::acquire();
-}
-
-void SAL_CALL ORootElementTreeSetUpdate::release( ) throw ()
-{
- BasicUpdateElement::release();
-}
-
-// XInterface joining
-uno::Any SAL_CALL ORootElementTreeSetUpdate::queryInterface( uno::Type const& rType ) throw (uno::RuntimeException )
-{
- uno::Any aRet = BasicUpdateElement::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicSet::queryInterface(rType);
-
- return aRet;
-}
-
-// XTypeProvider joining
-uno::Sequence< uno::Type > SAL_CALL ORootElementTreeSetUpdate::getTypes( ) throw (uno::RuntimeException )
-{
- return comphelper::concatSequences(BasicUpdateElement::getTypes(),BasicSet::getTypes() );
-}
-
-uno::Sequence< sal_Int8 > SAL_CALL ORootElementTreeSetUpdate::getImplementationId( ) throw (uno::RuntimeException )
-{
- return BasicUpdateElement::getImplementationId();
-}
-
-
-configapi::NodeAccess& ORootElementTreeSetUpdate::getNodeAccess()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeSetInfoAccess& ORootElementTreeSetUpdate::getNode()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeTreeSetAccess* ORootElementTreeSetUpdate::maybeGetUpdateAccess()
-{
- return &m_aAccessElement;
-}
-
-configapi::UpdateRootElement& ORootElementTreeSetUpdate::getElementClass()
-{
- return m_aAccessElement;
-}
-
-//==========================================================================
-//= ORootElementValueSetUpdate
-//==========================================================================
-
-// XInterface refcounting
-void SAL_CALL ORootElementValueSetUpdate::acquire( ) throw ()
-{
- BasicUpdateElement::acquire();
-}
-
-void SAL_CALL ORootElementValueSetUpdate::release( ) throw ()
-{
- BasicUpdateElement::release();
-}
-
-// XInterface joining
-uno::Any SAL_CALL ORootElementValueSetUpdate::queryInterface( uno::Type const& rType ) throw (uno::RuntimeException )
-{
- uno::Any aRet = BasicUpdateElement::queryInterface(rType);
-
- if (!aRet.hasValue())
- aRet = BasicValueSet::queryInterface(rType);
-
- return aRet;
-}
-
-// XTypeProvider joining
-uno::Sequence< uno::Type > SAL_CALL ORootElementValueSetUpdate::getTypes( ) throw (uno::RuntimeException )
-{
- return comphelper::concatSequences(BasicUpdateElement::getTypes(),BasicValueSet::getTypes() );
-}
-
-uno::Sequence< sal_Int8 > SAL_CALL ORootElementValueSetUpdate::getImplementationId( ) throw (uno::RuntimeException )
-{
- return BasicUpdateElement::getImplementationId();
-}
-
-
-configapi::NodeAccess& ORootElementValueSetUpdate::getNodeAccess()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeSetInfoAccess& ORootElementValueSetUpdate::getNode()
-{
- return m_aAccessElement;
-}
-
-configapi::NodeValueSetAccess* ORootElementValueSetUpdate::maybeGetUpdateAccess()
-{
- return &m_aAccessElement;
-}
-
-configapi::UpdateRootElement& ORootElementValueSetUpdate::getElementClass()
-{
- return m_aAccessElement;
-}
-//........................................................................
-} // namespace configmgr
-//........................................................................
-
diff --git a/configmgr/source/api2/setobjects.hxx b/configmgr/source/api2/setobjects.hxx
deleted file mode 100644
index 119102eecb..0000000000
--- a/configmgr/source/api2/setobjects.hxx
+++ /dev/null
@@ -1,358 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_SETOBJECTS_HXX_
-#define CONFIGMGR_API_SETOBJECTS_HXX_
-
-#include "setaccess.hxx"
-#include "setupdate.hxx"
-#include "elementaccess.hxx"
-
-#include "apiaccessobj.hxx"
-
-//........................................................................
-namespace configmgr
-{
-//........................................................................
-
-//==========================================================================
-//= Inner Set Instances
-//==========================================================================
-
-/** read-only access class for configuration nodes which are inner nodes and dynamic sets
-*/
- class OInnerSetInfo
- : public BasicInnerElement
- , public BasicSetAccess
- {
- public:
- // Construction/Destruction
- OInnerSetInfo(configapi::ApiTreeImpl& rTree, configuration::NodeRef const& aNode)
- : m_aAccessElement(static_cast<css::container::XChild*>(this),rTree,aNode)
- {
- }
-
- // XInterface refcounting
- void SAL_CALL acquire( ) throw ();
- void SAL_CALL release( ) throw ();
-
- // XInterface joining
- uno::Any SAL_CALL queryInterface( uno::Type const& rType ) throw (uno::RuntimeException );
-
- // XTypeProvider joining
- uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw (uno::RuntimeException );
- uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException );
-
- // Base class implementation
- virtual configapi::NodeAccess& getNodeAccess();
- virtual configapi::NodeSetInfoAccess& getNode();
- virtual configapi::InnerElement& getElementClass();
- private:
- configapi::OInnerElement<configapi::NodeSetInfoAccess> m_aAccessElement;
- };
-
-/** updating access class for configuration nodes which are inner nodes and dynamic sets of complex types (trees)
-*/
- class OInnerTreeSetUpdate
- : public BasicInnerElement
- , public BasicSet
- {
- public:
- // Construction/Destruction
- OInnerTreeSetUpdate(configapi::ApiTreeImpl& rTree, configuration::NodeRef const& aNode)
- : m_aAccessElement(static_cast<css::container::XChild*>(this),rTree,aNode)
- {
- }
-
- // XInterface refcounting
- void SAL_CALL acquire( ) throw ();
- void SAL_CALL release( ) throw ();
-
- // XInterface joining
- uno::Any SAL_CALL queryInterface( uno::Type const& rType ) throw (uno::RuntimeException );
-
- // XTypeProvider joining
- uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw (uno::RuntimeException );
- uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException );
-
- // Base class implementation
- virtual configapi::NodeAccess& getNodeAccess();
- virtual configapi::NodeSetInfoAccess& getNode();
- virtual configapi::NodeTreeSetAccess* maybeGetUpdateAccess();
- virtual configapi::InnerElement& getElementClass();
- private:
- configapi::OInnerElement<configapi::NodeTreeSetAccess> m_aAccessElement;
- };
-
-
-/** update access class for configuration nodes which are inner nodes and dynamic sets of simple types (values)
-*/
- class OInnerValueSetUpdate
- : public BasicInnerElement
- , public BasicValueSet
- {
- public:
- // Construction/Destruction
- OInnerValueSetUpdate(configapi::ApiTreeImpl& rTree, configuration::NodeRef const& aNode)
- : m_aAccessElement(static_cast<css::container::XChild*>(this),rTree,aNode)
- {
- }
-
- // XInterface refcounting
- void SAL_CALL acquire( ) throw ();
- void SAL_CALL release( ) throw ();
-
- // XInterface joining
- uno::Any SAL_CALL queryInterface( uno::Type const& rType ) throw (uno::RuntimeException );
-
- // XTypeProvider joining
- uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw (uno::RuntimeException );
- uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException );
-
- // Base class implementation
- virtual configapi::NodeAccess& getNodeAccess();
- virtual configapi::NodeSetInfoAccess& getNode();
- virtual configapi::NodeValueSetAccess* maybeGetUpdateAccess();
- virtual configapi::InnerElement& getElementClass();
- private:
- configapi::OInnerElement<configapi::NodeValueSetAccess> m_aAccessElement;
- };
-
-//==========================================================================
-//= Set Element Set Instances
-//==========================================================================
-
-/** read-only access class for configuration nodes which are set elements and dynamic sets
-*/
- class OSetElementSetInfo
- : public BasicSetElement
- , public BasicSetAccess
- {
- public:
- // Construction/Destruction
- OSetElementSetInfo(rtl::Reference< configuration::Tree > const& aTree, configapi::ApiProvider& rProvider, configapi::ApiTreeImpl* pParentTree = 0)
- : m_aAccessElement(static_cast<css::container::XChild*>(this),aTree,rProvider,pParentTree)
- {
- }
-
- // XInterface refcounting
- void SAL_CALL acquire( ) throw ();
- void SAL_CALL release( ) throw ();
-
- // XInterface joining
- uno::Any SAL_CALL queryInterface( uno::Type const& rType ) throw (uno::RuntimeException );
-
- // XTypeProvider joining
- uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw (uno::RuntimeException );
- uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException );
-
- // Base class implementation
- virtual configapi::NodeAccess& getNodeAccess();
- virtual configapi::NodeSetInfoAccess& getNode();
- virtual configapi::SetElement& getElementClass();
- private:
- configapi::OSetElement<configapi::NodeSetInfoAccess> m_aAccessElement;
- };
-
-/** updating access class for configuration nodes which are set elements and dynamic sets of complex types (trees)
-*/
- class OSetElementTreeSetUpdate
- : public BasicSetElement
- , public BasicSet
- {
- public:
- // Construction/Destruction
- OSetElementTreeSetUpdate(rtl::Reference< configuration::Tree > const& aTree, configapi::ApiProvider& rProvider, configapi::ApiTreeImpl* pParentTree = 0)
- : m_aAccessElement(static_cast<css::container::XChild*>(this),aTree,rProvider,pParentTree)
- {
- }
-
- // XInterface refcounting
- void SAL_CALL acquire( ) throw ();
- void SAL_CALL release( ) throw ();
-
- // XInterface joining
- uno::Any SAL_CALL queryInterface( uno::Type const& rType ) throw (uno::RuntimeException );
-
- // XTypeProvider joining
- uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw (uno::RuntimeException );
- uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException );
-
- // Base class implementation
- virtual configapi::NodeAccess& getNodeAccess();
- virtual configapi::NodeSetInfoAccess& getNode();
- virtual configapi::NodeTreeSetAccess* maybeGetUpdateAccess();
- virtual configapi::SetElement& getElementClass();
- private:
- configapi::OSetElement<configapi::NodeTreeSetAccess> m_aAccessElement;
- };
-
-
-/** update access class for configuration nodes which are set elements and dynamic sets of simple types (values)
-*/
- class OSetElementValueSetUpdate
- : public BasicSetElement
- , public BasicValueSet
- {
- public:
- // Construction/Destruction
- OSetElementValueSetUpdate(rtl::Reference< configuration::Tree > const& aTree, configapi::ApiProvider& rProvider, configapi::ApiTreeImpl* pParentTree = 0)
- : m_aAccessElement(static_cast<css::container::XChild*>(this),aTree,rProvider,pParentTree)
- {
- }
-
- // XInterface refcounting
- void SAL_CALL acquire( ) throw ();
- void SAL_CALL release( ) throw ();
-
- // XInterface joining
- uno::Any SAL_CALL queryInterface( uno::Type const& rType ) throw (uno::RuntimeException );
-
- // XTypeProvider joining
- uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw (uno::RuntimeException );
- uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException );
-
- // Base class implementation
- virtual configapi::NodeAccess& getNodeAccess();
- virtual configapi::NodeSetInfoAccess& getNode();
- virtual configapi::NodeValueSetAccess* maybeGetUpdateAccess();
- virtual configapi::SetElement& getElementClass();
- private:
- configapi::OSetElement<configapi::NodeValueSetAccess> m_aAccessElement;
- };
-
-//==========================================================================
-//= Root Element Set Instances
-//==========================================================================
-
-/** read-only access class for configuration nodes which are root nodes and dynamic sets
-*/
- class ORootElementSetInfo
- : public BasicRootElement
- , public BasicSetAccess
- {
- public:
- // Construction/Destruction
- ORootElementSetInfo(configapi::ApiProvider& rProvider, rtl::Reference< configuration::Tree > const& aTree, vos::ORef< OOptions >const& _xOptions)
- : m_aAccessElement(static_cast<css::lang::XComponent*>(this),rProvider,aTree,_xOptions)
- {
- }
-
- // XInterface refcounting
- void SAL_CALL acquire( ) throw ();
- void SAL_CALL release( ) throw ();
-
- // XInterface joining
- uno::Any SAL_CALL queryInterface( uno::Type const& rType ) throw (uno::RuntimeException );
-
- // XTypeProvider joining
- uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw (uno::RuntimeException );
- uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException );
-
- // Base class implementation
- virtual configapi::NodeAccess& getNodeAccess();
- virtual configapi::NodeSetInfoAccess& getNode();
- virtual configapi::RootElement& getElementClass();
- private:
- configapi::OReadRootElement<configapi::NodeSetInfoAccess> m_aAccessElement;
- };
-
-/** updating access class for configuration nodes which are root nodes and dynamic sets of complex types (trees)
-*/
- class ORootElementTreeSetUpdate
- : public BasicUpdateElement
- , public BasicSet
- {
- public:
- // Construction/Destruction
- ORootElementTreeSetUpdate(configapi::ApiProvider& rProvider, rtl::Reference< configuration::Tree > const& aTree, vos::ORef< OOptions >const& _xOptions)
- : m_aAccessElement(static_cast<css::lang::XComponent*>(this),rProvider,aTree, _xOptions)
- {
- }
-
- // XInterface refcounting
- void SAL_CALL acquire( ) throw ();
- void SAL_CALL release( ) throw ();
-
- // XInterface joining
- uno::Any SAL_CALL queryInterface( uno::Type const& rType ) throw (uno::RuntimeException );
-
- // XTypeProvider joining
- uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw (uno::RuntimeException );
- uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException );
-
- // Base class implementation
- virtual configapi::NodeAccess& getNodeAccess();
- virtual configapi::NodeSetInfoAccess& getNode();
- virtual configapi::NodeTreeSetAccess* maybeGetUpdateAccess();
- virtual configapi::UpdateRootElement& getElementClass();
- private:
- configapi::OUpdateRootElement<configapi::NodeTreeSetAccess> m_aAccessElement;
- };
-
-
-/** update access class for configuration nodes which are root nodes and dynamic sets of simple types (values)
-*/
- class ORootElementValueSetUpdate
- : public BasicUpdateElement
- , public BasicValueSet
- {
- public:
- // Construction/Destruction
- ORootElementValueSetUpdate(configapi::ApiProvider& rProvider, rtl::Reference< configuration::Tree > const& aTree, vos::ORef< OOptions >const& _xOptions)
- : m_aAccessElement(static_cast<css::lang::XComponent*>(this),rProvider,aTree,_xOptions)
- {
- }
-
- // XInterface refcounting
- void SAL_CALL acquire( ) throw ();
- void SAL_CALL release( ) throw ();
-
- // XInterface joining
- uno::Any SAL_CALL queryInterface( uno::Type const& rType ) throw (uno::RuntimeException );
-
- // XTypeProvider joining
- uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw (uno::RuntimeException );
- uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException );
-
- // Base class implementation
- virtual configapi::NodeAccess& getNodeAccess();
- virtual configapi::NodeSetInfoAccess& getNode();
- virtual configapi::NodeValueSetAccess* maybeGetUpdateAccess();
- virtual configapi::UpdateRootElement& getElementClass();
- private:
- configapi::OUpdateRootElement<configapi::NodeValueSetAccess> m_aAccessElement;
- };
-
-
-//........................................................................
-} // namespace configmgr
-//........................................................................
-
-#endif // CONFIGMGR_API_SETOBJECTS_HXX_
-
-
diff --git a/configmgr/source/api2/setupdate.cxx b/configmgr/source/api2/setupdate.cxx
deleted file mode 100644
index 9523aa9dda..0000000000
--- a/configmgr/source/api2/setupdate.cxx
+++ /dev/null
@@ -1,241 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "setupdate.hxx"
-#include "accessimpl.hxx"
-#include "updateimpl.hxx"
-#include "apinodeupdate.hxx"
-#include "apitypes.hxx"
-#include <cppuhelper/queryinterface.hxx>
-#include <cppuhelper/typeprovider.hxx>
-
-namespace configmgr
-{
-//////////////////////////////////////////////////////////////////////////////////
-// classes BasicSet / BasicValueSet
-//////////////////////////////////////////////////////////////////////////////////
-
-// XInterface joining
-//////////////////////////////////////////////////////////////////////////////////
-uno::Any SAL_CALL BasicSet::queryInterface( uno::Type const& rType ) throw (uno::RuntimeException )
-{
- uno::Any aRet = BasicSetAccess::queryInterface( rType );
- if (!aRet.hasValue())
- {
- aRet = cppu::queryInterface(rType
- , static_cast< css::container::XNameContainer *>(this)
- , static_cast< css::container::XNameReplace *>(this)
- , static_cast< css::beans::XPropertyWithState *>(this)
- , static_cast< css::lang::XSingleServiceFactory *>(this)
- );
- }
- return aRet;
-}
-//..............................................................................
-
-uno::Any SAL_CALL BasicValueSet::queryInterface( uno::Type const& rType ) throw (uno::RuntimeException )
-{
- uno::Any aRet = BasicSetAccess::queryInterface( rType );
- if (!aRet.hasValue())
- {
- aRet = cppu::queryInterface(rType
- , static_cast< css::container::XNameContainer *>(this)
- , static_cast< css::container::XNameReplace *>(this)
- , static_cast< css::beans::XPropertyWithState *>(this)
- );
- }
- return aRet;
-}
-
-// XTypeProvider joining
-//////////////////////////////////////////////////////////////////////////////////
-uno::Sequence< uno::Type > SAL_CALL BasicSet::getTypes( ) throw (uno::RuntimeException )
-{
- /*static ?*/
- cppu::OTypeCollection aTypes(
- configapi::getReferenceType(static_cast< css::container::XNameContainer *>(this)),
- configapi::getReferenceType(static_cast< css::container::XNameReplace *>(this)),
- configapi::getReferenceType(static_cast< css::beans::XPropertyWithState *>(this)),
- configapi::getReferenceType(static_cast< css::lang::XSingleServiceFactory *>(this)),
- BasicSetAccess::getTypes());
-
- return aTypes.getTypes();
-}
-//..............................................................................
-
-uno::Sequence< uno::Type > SAL_CALL BasicValueSet::getTypes( ) throw (uno::RuntimeException )
-{
- /*static ?*/
- cppu::OTypeCollection aTypes(
- configapi::getReferenceType(static_cast< css::container::XNameContainer *>(this)),
- configapi::getReferenceType(static_cast< css::container::XNameReplace *>(this)),
- configapi::getReferenceType(static_cast< css::beans::XPropertyWithState *>(this)),
- BasicSetAccess::getTypes());
-
- return aTypes.getTypes();
-}
-
-//uno::Sequence< sal_Int8 > SAL_CALL BasicSet::getImplementationId( ) throw (uno::RuntimeException ) = 0;
-//uno::Sequence< sal_Int8 > SAL_CALL BasicValueSet::getImplementationId( ) throw (uno::RuntimeException ) = 0;
-
-// safe write access
-//////////////////////////////////////////////////////////////////////////////////
-configapi::NodeTreeSetAccess& BasicSet::getSetNode()
-{
- configapi::NodeTreeSetAccess* pAccess = maybeGetUpdateAccess();
- OSL_ENSURE(pAccess, "Write operation invoked on a read-only node access - failing with RuntimeException");
-
- if (!pAccess)
- {
- throw uno::RuntimeException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: Invalid Object - internal update-interface missing.")),
- static_cast< css::container::XNameReplace * >(this)
- );
- }
- return *pAccess;
-}
-
-configapi::NodeValueSetAccess& BasicValueSet::getSetNode()
-{
- configapi::NodeValueSetAccess* pAccess = maybeGetUpdateAccess();
- OSL_ENSURE(pAccess, "Write operation invoked on a read-only node access - failing with RuntimeException");
-
- if (!pAccess)
- {
- throw uno::RuntimeException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Configuration: Invalid Object - internal update-interface missing.")),
- static_cast< css::container::XNameReplace* >(this)
- );
- }
- return *pAccess;
-}
-
-// New Interface methods
-// XNameReplace
-//////////////////////////////////////////////////////////////////////////////////
-void SAL_CALL BasicSet::replaceByName( const rtl::OUString& rName, const uno::Any& rElement )
- throw(css::lang::IllegalArgumentException, css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException)
-{
- configapi::implReplaceByName( getSetNode(), rName, rElement );
-}
-//..............................................................................
-
-void SAL_CALL BasicValueSet::replaceByName( const rtl::OUString& rName, const uno::Any& rElement )
- throw(css::lang::IllegalArgumentException, css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException)
-{
- configapi::implReplaceByName( getSetNode(), rName, rElement );
-}
-
-// XNameContainer
-//////////////////////////////////////////////////////////////////////////////////
-void SAL_CALL BasicSet::insertByName( const rtl::OUString& rName, const uno::Any& rElement)
- throw(css::lang::IllegalArgumentException, css::container::ElementExistException, css::lang::WrappedTargetException, uno::RuntimeException)
-{
- configapi::implInsertByName( getSetNode(), rName, rElement );
-}
-//..............................................................................
-
-void SAL_CALL BasicValueSet::insertByName( const rtl::OUString& rName, const uno::Any& rElement)
- throw(css::lang::IllegalArgumentException, css::container::ElementExistException, css::lang::WrappedTargetException, uno::RuntimeException)
-{
- configapi::implInsertByName( getSetNode(), rName, rElement );
-}
-
-//----------------------------------------------------------------------------------
-void SAL_CALL BasicSet::removeByName( const rtl::OUString& rName )
- throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException)
-{
- configapi::implRemoveByName( getSetNode(), rName );
-}
-//..............................................................................
-
-void SAL_CALL BasicValueSet::removeByName( const rtl::OUString& rName )
- throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException)
-{
- configapi::implRemoveByName( getSetNode(), rName );
-}
-
-// XPropertyWithState
-//////////////////////////////////////////////////////////////////////////////////
-
-css::beans::PropertyState SAL_CALL BasicSet::getStateAsProperty() throw (uno::RuntimeException)
-{
- return configapi::implGetStateAsProperty( getSetNode() );
-}
-//..............................................................................
-
-css::beans::PropertyState SAL_CALL BasicValueSet::getStateAsProperty() throw (uno::RuntimeException)
-{
- return configapi::implGetStateAsProperty( getSetNode() );
-}
-//-----------------------------------------------------------------------------------
-
-void SAL_CALL BasicSet::setToDefaultAsProperty() throw (css::lang::WrappedTargetException, uno::RuntimeException)
-{
- configapi::implSetToDefaultAsProperty( getSetNode() );
-}
-//..............................................................................
-
-void SAL_CALL BasicValueSet::setToDefaultAsProperty() throw (css::lang::WrappedTargetException, uno::RuntimeException)
-{
- configapi::implSetToDefaultAsProperty( getSetNode() );
-}
-//-----------------------------------------------------------------------------------
-
-uno::Reference< uno::XInterface > SAL_CALL BasicSet::getDefaultAsProperty() throw (css::lang::WrappedTargetException, uno::RuntimeException)
-{
- return configapi::implGetDefaultAsProperty( getSetNode() );
-}
-//..............................................................................
-
-uno::Reference< uno::XInterface > SAL_CALL BasicValueSet::getDefaultAsProperty() throw (css::lang::WrappedTargetException, uno::RuntimeException)
-{
- return configapi::implGetDefaultAsProperty( getSetNode() );
-}
-
-// XSingleServiceFactory (not for ValueSet)
-//////////////////////////////////////////////////////////////////////////////////
-uno::Reference< uno::XInterface > SAL_CALL BasicSet::createInstance( )
- throw(uno::Exception, uno::RuntimeException)
-{
- return configapi::implCreateElement( getSetNode() );
-}
-
-//----------------------------------------------------------------------------------
-uno::Reference< uno::XInterface > SAL_CALL BasicSet::createInstanceWithArguments( const uno::Sequence< uno::Any >& aArguments )
- throw(uno::Exception, uno::RuntimeException)
-{
- return configapi::implCreateElement( getSetNode(), aArguments );
-}
-
-//-----------------------------------------------------------------------------------
-} // namespace configmgr
-
-
diff --git a/configmgr/source/api2/setupdate.hxx b/configmgr/source/api2/setupdate.hxx
deleted file mode 100644
index 471ad5c1c5..0000000000
--- a/configmgr/source/api2/setupdate.hxx
+++ /dev/null
@@ -1,208 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_SETUPDATE_HXX_
-#define CONFIGMGR_API_SETUPDATE_HXX_
-
-#include "setaccess.hxx"
-#include <com/sun/star/container/XNameContainer.hpp>
-#include <com/sun/star/beans/XPropertyWithState.hpp>
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
-
-//........................................................................
-namespace configmgr
-{
-//........................................................................
- namespace configapi { class NodeTreeSetAccess; class NodeValueSetAccess; }
-
-//==========================================================================
-//= BasicSet
-//==========================================================================
-
-/** base class for configuration nodes which are dynamic sets of complex types (trees)
-*/
- class BasicSet
- : public BasicSetAccess
- , public css::container::XNameContainer
- , public css::beans::XPropertyWithState
- , public css::lang::XSingleServiceFactory
- {
- protected:
- // Destructors
- virtual ~BasicSet() {}
-
- public:
- // Base class Interface methods
- // XInterface joining
- uno::Any SAL_CALL queryInterface( uno::Type const& rType ) throw (uno::RuntimeException );
-
- // XTypeProvider joining
- uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw (uno::RuntimeException );
- uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException ) = 0;
-
- // XElementAccess forwarding
- virtual uno::Type SAL_CALL getElementType( ) throw(uno::RuntimeException)
- { return BasicSetAccess::getElementType(); }
-
- virtual sal_Bool SAL_CALL hasElements( ) throw(uno::RuntimeException)
- { return BasicSetAccess::hasElements(); }
-
- // XNameAccess forwarding
- virtual uno::Any SAL_CALL getByName( const rtl::OUString& aName )
- throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException)
- { return BasicSetAccess::getByName(aName); }
-
- virtual uno::Sequence< rtl::OUString > SAL_CALL getElementNames( ) throw( uno::RuntimeException)
- { return BasicSetAccess::getElementNames(); }
-
- virtual sal_Bool SAL_CALL hasByName( const rtl::OUString& aName ) throw(uno::RuntimeException)
- { return BasicSetAccess::hasByName(aName); }
-
- // New Interface methods
- // XNameReplace
- virtual void SAL_CALL
- replaceByName( const rtl::OUString& rName, const uno::Any& rElement )
- throw(css::lang::IllegalArgumentException, css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException);
-
- // XNameContainer
- virtual void SAL_CALL
- insertByName( const rtl::OUString& rName, const uno::Any& rElement)
- throw(css::lang::IllegalArgumentException, css::container::ElementExistException, css::lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- removeByName( const rtl::OUString& rName )
- throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException);
-
- // XPropertyWithState
- virtual css::beans::PropertyState SAL_CALL
- getStateAsProperty( )
- throw (uno::RuntimeException);
-
- virtual void SAL_CALL
- setToDefaultAsProperty( )
- throw (css::lang::WrappedTargetException, uno::RuntimeException);
-
- virtual uno::Reference< uno::XInterface > SAL_CALL
- getDefaultAsProperty( )
- throw (css::lang::WrappedTargetException, uno::RuntimeException);
-
- // XSingleServiceFactory
- virtual uno::Reference< uno::XInterface > SAL_CALL
- createInstance( )
- throw(uno::Exception, uno::RuntimeException);
-
- virtual uno::Reference< uno::XInterface > SAL_CALL
- createInstanceWithArguments( const uno::Sequence< uno::Any >& aArguments )
- throw(uno::Exception, uno::RuntimeException);
-
- protected:
- configapi::NodeTreeSetAccess& getSetNode();
- virtual configapi::NodeTreeSetAccess* maybeGetUpdateAccess() = 0;
- };
-
-//==========================================================================
-//= BasicValueSet
-//==========================================================================
-
-/** class for configuration nodes which are dynamic sets of simple types (values)
-*/
- class BasicValueSet
- : public BasicSetAccess
- , public css::beans::XPropertyWithState
- , public css::container::XNameContainer
- {
- protected:
- // Destructors
- virtual ~BasicValueSet() {}
-
- public:
- // Base class Interface methods
- // XInterface joining
- uno::Any SAL_CALL queryInterface( uno::Type const& rType ) throw (uno::RuntimeException );
-
- // XTypeProvider joining
- uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw (uno::RuntimeException );
- uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (uno::RuntimeException ) = 0;
-
- // XElementAccess forwarding
- virtual uno::Type SAL_CALL getElementType( ) throw(uno::RuntimeException)
- { return BasicSetAccess::getElementType(); }
-
- virtual sal_Bool SAL_CALL hasElements( ) throw(uno::RuntimeException)
- { return BasicSetAccess::hasElements(); }
-
- // XNameAccess forwarding
- virtual uno::Any SAL_CALL getByName( const rtl::OUString& aName )
- throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException)
- { return BasicSetAccess::getByName(aName); }
-
- virtual uno::Sequence< rtl::OUString > SAL_CALL getElementNames( ) throw( uno::RuntimeException)
- { return BasicSetAccess::getElementNames(); }
-
- virtual sal_Bool SAL_CALL hasByName( const rtl::OUString& aName ) throw(uno::RuntimeException)
- { return BasicSetAccess::hasByName(aName); }
-
- // New Interface methods
- // XNameReplace
- virtual void SAL_CALL
- replaceByName( const rtl::OUString& rName, const uno::Any& rElement )
- throw(css::lang::IllegalArgumentException, css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException);
-
- // XNameContainer
- virtual void SAL_CALL
- insertByName( const rtl::OUString& rName, const uno::Any& rElement)
- throw(css::lang::IllegalArgumentException, css::container::ElementExistException, css::lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- removeByName( const rtl::OUString& rName )
- throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException);
-
- // XPropertyWithState
- virtual css::beans::PropertyState SAL_CALL
- getStateAsProperty( )
- throw (uno::RuntimeException);
-
- virtual void SAL_CALL
- setToDefaultAsProperty( )
- throw (css::lang::WrappedTargetException, uno::RuntimeException);
-
- virtual uno::Reference< uno::XInterface > SAL_CALL
- getDefaultAsProperty( )
- throw (css::lang::WrappedTargetException, uno::RuntimeException);
-
- protected:
- configapi::NodeValueSetAccess& getSetNode();
- virtual configapi::NodeValueSetAccess* maybeGetUpdateAccess() = 0;
- };
-
-//........................................................................
-} // namespace configmgr
-//........................................................................
-
-#endif // CONFIGMGR_API_VALUESETACCESS_HXX_
-
-
diff --git a/configmgr/source/api2/translatechanges.cxx b/configmgr/source/api2/translatechanges.cxx
deleted file mode 100644
index ed31bd0464..0000000000
--- a/configmgr/source/api2/translatechanges.cxx
+++ /dev/null
@@ -1,283 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "translatechanges.hxx"
-#include "noderef.hxx"
-#include "nodechange.hxx"
-#include "nodechangeinfo.hxx"
-#include "apifactory.hxx"
-
-namespace configmgr
-{
-// ---------------------------------------------------------------------------------------------------
- namespace css = ::com::sun::star;
- namespace uno = css::uno;
- namespace lang = css::lang;
- namespace util = css::util;
- namespace beans = css::beans;
- namespace container = css::container;
-// ---------------------------------------------------------------------------------------------------
-
- namespace configuration
- {
- class NodeChange;
- class NodeChanges;
- class NodeRef;
- class NodeID;
- }
-// ---------------------------------------------------------------------------------------------------
-
- namespace configapi
- {
-// ---------------------------------------------------------------------------------------------------
- //interpreting NodeChanges
-// resolve the relative path from a given base to the changed node
-bool resolveChangeLocation(configuration::RelativePath& aPath, configuration::NodeChangeLocation const& aChange, rtl::Reference< configuration::Tree > const& aBaseTree, configuration::NodeRef const& aBaseNode)
-{
- OSL_ENSURE(aChange.isValidLocation(), "Trying to resolve against change location that wasn't set up properly");
-
- namespace Path = configuration::Path;
-
- rtl::Reference< configuration::Tree > aChangeBaseTree = aChange.getBaseTree();
-
- configuration::AbsolutePath aOuterBasePath = aBaseTree->getAbsolutePath(aBaseNode);
- configuration::AbsolutePath aChangeBasePath = aChangeBaseTree->getAbsolutePath(aChange.getBaseNode());
-
- std::vector<configuration::Path::Component>::const_reverse_iterator aChangeIt = aChangeBasePath.begin(), aChangeEnd = aChangeBasePath.end();
- std::vector<configuration::Path::Component>::const_reverse_iterator aOuterIt = aOuterBasePath.begin(), aOuterEnd = aOuterBasePath.end();
-
- // First by resolve the base node pathes
- while (aOuterIt != aOuterEnd && aChangeIt != aChangeEnd)
- {
- if ( ! Path::matches(*aOuterIt,*aChangeIt) ) return false; // mismatch
- ++aOuterIt;
- ++aChangeIt;
- }
-
- // Next consider the stored accessor
- if (aChangeIt != aChangeEnd) // stepping outward - prepend
- {
- Path::Rep aRemaining(aChangeIt, aChangeEnd);
-
- aPath = configuration::RelativePath(aRemaining).compose(aChange.getAccessor());
- }
- else if (aOuterIt == aOuterEnd) // exact match outside
- {
- aPath = aChange.getAccessor();
- }
- else //(aChangeIt == aChangeEnd) but outer left
- {
- configuration::RelativePath aAccessor = aChange.getAccessor();
- aChangeIt = aAccessor.begin();
- aChangeEnd = aAccessor.end();
-
- // resolve the outer path against the change accessor
- while (aOuterIt != aOuterEnd && aChangeIt != aChangeEnd)
- {
- if ( ! Path::matches(*aOuterIt,*aChangeIt) ) return false; // mismatch
- ++aOuterIt;
- ++aChangeIt;
- }
-
- if (aOuterIt == aOuterEnd)
- {
- Path::Rep aRemaining(aChangeIt, aChangeEnd);
-
- aPath = configuration::RelativePath( aRemaining );
- }
- }
-
- return (aOuterIt == aOuterEnd); // resolved completely and assigned ??
-
-}
-
-// ---------------------------------------------------------------------------------------------------
-// change path and base settings to start from the given base
-bool rebaseChange(configuration::NodeChangeLocation& aChange, rtl::Reference< configuration::Tree > const& _aBaseTreeRef)
-{
- return rebaseChange(aChange,_aBaseTreeRef,_aBaseTreeRef->getRootNode());
-}
-bool rebaseChange(configuration::NodeChangeLocation& aChange, rtl::Reference< configuration::Tree > const& _aBaseTreeRef, configuration::NodeRef const& aBaseNode)
-{
- OSL_ENSURE(aChange.isValidLocation(), "Trying to rebase change location that wasn't set up properly");
-
- rtl::Reference< configuration::Tree > aBaseTree(_aBaseTreeRef);
-
- configuration::RelativePath aNewPath;
- if (resolveChangeLocation(aNewPath,aChange,aBaseTree,aBaseNode))
- {
- aChange.setBase( aBaseTree, aBaseNode);
- aChange.setAccessor( aNewPath );
- return true;
- }
- else
- return false;
-}
-// ---------------------------------------------------------------------------------------------------
-// resolve non-uno elements to Uno Objects
-bool resolveUnoObjects(UnoChange& aUnoChange, configuration::NodeChangeData const& aChange,
- Factory& rFactory)
-{
- if (aChange.isSetChange())
- {
- //Check we have ElementTree
- if ((aChange.element.newValue == NULL) &&
- (aChange.element.oldValue == NULL))
- {
- if( ( aChange.unoData.newValue.getValue()!=NULL) ||
- ( aChange.unoData.newValue.getValue()!=NULL))
- {
- return true;
- }
- else return false;
- }
-
- //Check if complex or simple type
- rtl::Reference< configuration::Tree > aTree = aChange.isRemoveSetChange()?
- aChange.getOldElementTree():
- aChange.getNewElementTree();
-
- configuration::NodeRef aNodeRef = aTree->getRootNode();
-
- if (configuration::isStructuralNode(aTree, aNodeRef))
- {
- uno::Reference<uno::XInterface> aNewUnoObject = rFactory.findUnoElement(aChange.getNewElementNodeID());
- uno::Reference<uno::XInterface> aOldUnoObject = rFactory.findUnoElement(aChange.getOldElementNodeID());
-
- bool bFound = aNewUnoObject.is() || aOldUnoObject.is();
- aUnoChange.newValue <<= aNewUnoObject;
- aUnoChange.oldValue <<= aOldUnoObject;
- return bFound;
- }
- else
- {
- aUnoChange.newValue = configuration::getSimpleElementValue(aTree, aNodeRef);
-
- if (aChange.isReplaceSetChange() )
- {
- rtl::Reference< configuration::Tree > aOldTree = aChange.getOldElementTree();
-
- aNodeRef = aOldTree->getRootNode();
- OSL_ENSURE(!configuration::isStructuralNode(aOldTree, aNodeRef), "resolveUnoObject types mismatch");
- aUnoChange.oldValue = configuration::getSimpleElementValue(aOldTree, aNodeRef);
- }
- bool bFound = aUnoChange.newValue.hasValue() || aUnoChange.oldValue.hasValue();
- return bFound;
- }
- }
- else if (aChange.isValueChange())
- {
- aUnoChange.newValue = aChange.unoData.newValue;
- aUnoChange.oldValue = aChange.unoData.oldValue;
- return true;
- }
- else
- {
- return false;
- }
-}
-// ---------------------------------------------------------------------------------------------------
-// resolve non-uno elements to Uno Objects inplace
-bool resolveToUno(configuration::NodeChangeData& aChange, Factory& rFactory)
-{
- struct UnoChange aUnoChange;
- if (resolveUnoObjects(aUnoChange,aChange, rFactory))
- {
- aChange.unoData.newValue = aUnoChange.newValue;
- aChange.unoData.oldValue = aUnoChange.oldValue;
- return true;
- }
- else
- return false;
-}
-// ---------------------------------------------------------------------------------------------------
-
-/// fill a change info from a NodeChangeInfo
-void fillChange(util::ElementChange& rChange, configuration::NodeChangeInformation const& aInfo, rtl::Reference< configuration::Tree > const& aBaseTree, Factory& rFactory)
-{
- fillChange(rChange,aInfo,aBaseTree,aBaseTree->getRootNode(),rFactory);
-}
-/// fill a change info from a NodeChangeInfo
-void fillChange(util::ElementChange& rChange, configuration::NodeChangeInformation const& aInfo, rtl::Reference< configuration::Tree > const& aBaseTree, configuration::NodeRef const& aBaseNode, Factory& rFactory)
-{
- configuration::RelativePath aRelativePath;
- if (!resolveChangeLocation(aRelativePath, aInfo.location, aBaseTree, aBaseNode))
- OSL_ENSURE(false, "WARNING: Change is not part of the given Tree");
-
- UnoChange aUnoChange;
-
- if (!resolveUnoObjects(aUnoChange, aInfo.change, rFactory))
- OSL_ENSURE(false, "WARNING: Cannot find out old/new UNO objects involved in change");
-
- rChange.Accessor <<= aRelativePath.toString();
- rChange.Element = aUnoChange.newValue;
- rChange.ReplacedElement = aUnoChange.oldValue;
-}
-// ---------------------------------------------------------------------------------------------------
-/// fill a change info from a NodeChangeInfo (base,path and uno objects are assumed to be resolved already)
-void fillChangeFromResolved(util::ElementChange& rChange, configuration::NodeChangeInformation const& aInfo)
-{
- rChange.Accessor <<= aInfo.location.getAccessor().toString();
- rChange.Element = aInfo.change.unoData.newValue;
- rChange.ReplacedElement = aInfo.change.unoData.oldValue;
-}
-// ---------------------------------------------------------------------------------------------------
-/// fill a event from a NodeChangeInfo (uno objects are assumed to be resolved already)
-bool fillEventDataFromResolved(container::ContainerEvent& rEvent, configuration::NodeChangeInformation const& aInfo)
-{
- rEvent.Accessor <<= aInfo.location.getAccessor().getLocalName().getName();
- rEvent.Element = aInfo.change.unoData.newValue;
- rEvent.ReplacedElement = aInfo.change.unoData.oldValue;
-
- return !aInfo.isEmptyChange();
-}
-// ---------------------------------------------------------------------------------------------------
-/// fill a event from a NodeChangeInfo(uno objects are assumed to be resolved already)
-bool fillEventDataFromResolved(beans::PropertyChangeEvent& rEvent, configuration::NodeChangeInformation const& aInfo, bool bMore)
-{
- if (!aInfo.isValueChange())
- return false;
-
- rEvent.PropertyName = aInfo.location.getAccessor().getLocalName().getName();
-
- rEvent.NewValue = aInfo.change.unoData.newValue;
- rEvent.OldValue = aInfo.change.unoData.oldValue;
-
- rEvent.PropertyHandle = -1;
- rEvent.Further = bMore;
-
- return !aInfo.isEmptyChange();
-}
-// ---------------------------------------------------------------------------------------------------
-// ---------------------------------------------------------------------------------------------------
- }
-// ---------------------------------------------------------------------------------------------------
-}
-
diff --git a/configmgr/source/api2/translatechanges.hxx b/configmgr/source/api2/translatechanges.hxx
deleted file mode 100644
index 523664e1e3..0000000000
--- a/configmgr/source/api2/translatechanges.hxx
+++ /dev/null
@@ -1,117 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_TRANSLATECHANGES_HXX_
-#define CONFIGMGR_API_TRANSLATECHANGES_HXX_
-
-#include <com/sun/star/beans/XPropertyChangeListener.hpp>
-#include <com/sun/star/beans/XVetoableChangeListener.hpp>
-#include <com/sun/star/beans/XPropertiesChangeListener.hpp>
-#include <com/sun/star/container/XContainerListener.hpp>
-#include <com/sun/star/util/XChangesListener.hpp>
-#include "rtl/ref.hxx"
-
-namespace configmgr
-{
-// ---------------------------------------------------------------------------------------------------
- namespace css = ::com::sun::star;
- namespace uno = css::uno;
- namespace lang = css::lang;
- namespace util = css::util;
- namespace beans = css::beans;
- namespace container = css::container;
-// ---------------------------------------------------------------------------------------------------
-
- namespace configuration
- {
- class NodeChangeInformation;
- class NodeChangeData;
- class NodeChangeLocation;
-
- //class NodeChange;
- //class NodeChanges;
- class Tree;
- class NodeRef;
- class NodeID;
- class RelativePath;
- }
-// ---------------------------------------------------------------------------------------------------
-
- namespace configapi
- {
- class NotifierImpl;
- class Factory;
-
- struct UnoChange { uno::Any newValue, oldValue; };
-
- //interpreting NodeChanges
- // resolve the relative path from a given base node to the changed node
- bool resolveChangeLocation( configuration::RelativePath& aPath,
- configuration::NodeChangeLocation const& aChange,
- rtl::Reference< configuration::Tree > const& aBaseTree,
- configuration::NodeRef const& aBaseNode);
-
- // change path and base settings to start from the given base tree (root)
- bool rebaseChange( configuration::NodeChangeLocation& aChange,
- rtl::Reference< configuration::Tree > const& _aBaseTreeRef);
- // change path and base settings to start from the given base node
- bool rebaseChange( configuration::NodeChangeLocation& aChange,
- rtl::Reference< configuration::Tree > const& _aBaseTreeRef,
- configuration::NodeRef const& aBaseNode);
- // resolve non-uno elements to Uno Objects
- bool resolveUnoObjects(UnoChange& aUnoChange,
- configuration::NodeChangeData const& aChange,
- Factory& rFactory);
- // resolve non-uno elements to Uno Objects inplace
- bool resolveToUno(configuration::NodeChangeData& aChange,
- Factory& rFactory);
-
- // building events
-
- /// fill a change info from a NodeChangeInfo
- void fillChange(util::ElementChange& rChange,
- configuration::NodeChangeInformation const& aInfo,
- rtl::Reference< configuration::Tree > const& aBaseTree,
- Factory& rFactory);
- /// fill a change info from a NodeChangeInfo
- void fillChange(util::ElementChange& rChange,
- configuration::NodeChangeInformation const& aInfo,
- rtl::Reference< configuration::Tree > const& aBaseTree,
- configuration::NodeRef const& aBaseNode,
- Factory& rFactory);
- /// fill a change info from a NodeChangeInfo (base,path and uno objects are assumed to be resolved already)
- void fillChangeFromResolved(util::ElementChange& rChange, configuration::NodeChangeInformation const& aInfo);
-
- /// fill a event from a NodeChangeInfo (uno objects are assumed to be resolved already)
- bool fillEventDataFromResolved(container::ContainerEvent& rEvent, configuration::NodeChangeInformation const& aInfo);
- /// fill a event from a NodeChangeInfo(uno objects are assumed to be resolved already) - returns false if this isn't a property change
- bool fillEventDataFromResolved(beans::PropertyChangeEvent& rEvent, configuration::NodeChangeInformation const& aInfo, bool bMore);
- }
-// ---------------------------------------------------------------------------------------------------
-}
-
-#endif // CONFIGMGR_API_TRANSLATECHANGES_HXX_
diff --git a/configmgr/source/api2/treeiterators.cxx b/configmgr/source/api2/treeiterators.cxx
deleted file mode 100644
index 365e7d1918..0000000000
--- a/configmgr/source/api2/treeiterators.cxx
+++ /dev/null
@@ -1,93 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-
-#include "treeiterators.hxx"
-
-#include "apitypes.hxx"
-#include "configpath.hxx"
-#include "attributes.hxx"
-#include "valueref.hxx"
-#include "propertyinfohelper.hxx"
-
-// .......................................................................
-namespace configmgr
-{
-// .......................................................................
- namespace configapi
- {
- // ===================================================================
- // = CollectNodeNames
- // ===================================================================
- // -------------------------------------------------------------------
- CollectPropertyInfo::Result CollectNodeNames::handle(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode)
- {
- m_aList.push_back(aTree->getSimpleNodeName(aNode.getOffset()));
- return CONTINUE;
- }
-
- // -------------------------------------------------------------------
- CollectPropertyInfo::Result CollectNodeNames::handle(rtl::Reference< configuration::Tree > const&, configuration::ValueRef const& aNode)
- {
- m_aList.push_back(aNode.m_sNodeName);
- return CONTINUE;
- }
-
- // ===================================================================
- // = CollectPropertyInfo
- // ===================================================================
- // -------------------------------------------------------------------
- CollectNodeNames::Result CollectPropertyInfo::handle(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode)
- {
- rtl::OUString aName = aTree->getSimpleNodeName(aNode.getOffset());
- node::Attributes aAttributes = aTree->getAttributes(aNode);
- uno::Type aApiType = getUnoInterfaceType();
-
- m_aList.push_back( helperMakeProperty(aName,aAttributes,aApiType,aTree->hasNodeDefault(aNode)) );
- return CONTINUE;
- }
-
- // -------------------------------------------------------------------
- CollectNodeNames::Result CollectPropertyInfo::handle(rtl::Reference< configuration::Tree > const& aTree, configuration::ValueRef const& aNode)
- {
- rtl::OUString aName = aNode.m_sNodeName;
- node::Attributes aAttributes = aTree->getAttributes(aNode);
- uno::Type aApiType = aTree->getUnoType(aNode);
-
- m_aList.push_back( helperMakeProperty(aName,aAttributes,aApiType,aTree->hasNodeDefault(aNode)) );
- return CONTINUE;
- }
-// .......................................................................
- } // namespace configapi
-
-// .......................................................................
-} // namespace configmgr
-// .......................................................................
-
diff --git a/configmgr/source/api2/treeiterators.hxx b/configmgr/source/api2/treeiterators.hxx
deleted file mode 100644
index 76647f0312..0000000000
--- a/configmgr/source/api2/treeiterators.hxx
+++ /dev/null
@@ -1,85 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_TREEITERATORS_HXX_
-#define CONFIGMGR_TREEITERATORS_HXX_
-
-#include "tree.hxx"
-#include <com/sun/star/beans/Property.hpp>
-#include <rtl/ustring.hxx>
-
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif
-
-// .......................................................................
-namespace configmgr
-{
-// .......................................................................
- namespace configapi
- {
- // ===================================================================
- // = CollectNodeNames
- // ===================================================================
- class CollectNodeNames : public configuration::NodeVisitor
- {
- protected:
- std::vector<rtl::OUString> m_aList;
-
- public:
- CollectNodeNames() { }
-
- virtual Result handle(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode); // NodeVisitor
- virtual Result handle(rtl::Reference< configuration::Tree > const& aTree, configuration::ValueRef const& aNode); // NodeVisitor
-
- std::vector<rtl::OUString> const& list() const { return m_aList; }
- };
-
- // ===================================================================
- // = CollectPropertyInfo
- // ===================================================================
- class CollectPropertyInfo : public configuration::NodeVisitor
- {
- protected:
- std::vector<com::sun::star::beans::Property> m_aList;
-
- public:
- CollectPropertyInfo() { }
-
- virtual Result handle(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode); // NodeVisitor
- virtual Result handle(rtl::Reference< configuration::Tree > const& aTree, configuration::ValueRef const& aNode); // NodeVisitor
-
- std::vector<com::sun::star::beans::Property> const& list() const { return m_aList; }
- };
- }
-// .......................................................................
-} // namespace configmgr
-// .......................................................................
-
-#endif // _CONFIGMGR_TREEITERATORS_HXX_
-
diff --git a/configmgr/source/api2/updateimpl.cxx b/configmgr/source/api2/updateimpl.cxx
deleted file mode 100644
index 8676376b9c..0000000000
--- a/configmgr/source/api2/updateimpl.cxx
+++ /dev/null
@@ -1,647 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "updateimpl.hxx"
-#include "accessimpl.hxx"
-#include "apinodeaccess.hxx"
-#include "apinodeupdate.hxx"
-#include "noderef.hxx"
-#include "valueref.hxx"
-#include "nodechange.hxx"
-#include "configset.hxx"
-#include "configgroup.hxx"
-#include "confignotifier.hxx"
-#include "broadcaster.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/beans/PropertyVetoException.hpp>
-#include <osl/diagnose.h>
-
-namespace configmgr
-{
- namespace configapi
- {
-//-----------------------------------------------------------------------------------
- namespace lang = css::lang;
- namespace util = css::util;
- namespace container = css::container;
-
-// Interface methods
-//-----------------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------------
-// Update methods
-//-----------------------------------------------------------------------------------
-
-// XNameReplace
-//-----------------------------------------------------------------------------------
-void implReplaceByName(NodeGroupAccess& rNode, const rtl::OUString& sName, const uno::Any& rElement )
- throw(lang::IllegalArgumentException, container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
-{
- try
- {
- GuardedNodeUpdate<NodeGroupAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- rtl::OUString aChildName = configuration::validateChildName(sName,aTree,aNode);
-
- configuration::ValueRef aChildValue( aTree->getChildValue(aNode, aChildName) );
-
- if (!aChildValue.isValid())
- {
- if (aTree->hasChildNode(aNode, aChildName))
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Value. Node '") );
- sMessage += sName;
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' is not a simple value.") );
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw lang::IllegalArgumentException( sMessage, xContext, 2 );
- }
- else
- {
- OSL_ENSURE(!configuration::hasChildOrElement(aTree,aNode,aChildName),"ERROR: Configuration: Existing child node not found by implementation");
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Value. Value '") );
- sMessage += sName;
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' not found in ") );
- sMessage += aTree->getAbsolutePath(aNode).toString();
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw container::NoSuchElementException( sMessage, xContext );
- }
- }
-
- configuration::NodeChange aChange = lock.getNodeUpdater().validateSetValue(aChildValue, rElement);
-
- if (aChange.test().isChange())
- {
- Broadcaster aSender(rNode.getNotifier().makeBroadcaster(aChange,true));
-// lock.clearForBroadcast();
-
- aSender.queryConstraints(aChange);
-
- aTree->integrate(aChange, aNode, true);
-
- lock.clearForBroadcast();
- aSender.notifyListeners(aChange);
- }
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Value: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw container::NoSuchElementException( e.message(), xContext );
- }
- catch (configuration::TypeMismatch& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.illegalArgument(2);
- }
- catch (configuration::ConstraintViolation& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.illegalArgument(2);
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
- catch (css::beans::PropertyVetoException& ex)
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot set Value. Change was Vetoed: ") );
- throw lang::WrappedTargetException( sMessage += ex.Message, rNode.getUnoInstance(), uno::makeAny(ex) );
- }
-}
-//-----------------------------------------------------------------------------------
-
-void implReplaceByName(NodeTreeSetAccess& rNode, const rtl::OUString& sName, const uno::Any& rElement )
- throw(lang::IllegalArgumentException, container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
-{
- try
- {
- GuardedNodeUpdate<NodeTreeSetAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- rtl::OUString aChildName = configuration::validateElementName(sName,aTree,aNode);
-
- rtl::Reference< configuration::ElementTree > aElement( aTree->getElement(aNode,aChildName) );
-
- if (!aElement.is())
- {
- OSL_ENSURE(!configuration::hasChildOrElement(aTree,aNode,aChildName),"ERROR: Configuration: Existing Set element not found by implementation");
-
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot replace Set Element. Element '") );
- sMessage += sName;
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' not found in Set ") );
- sMessage += aTree->getAbsolutePath(aNode).toString();
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw container::NoSuchElementException( sMessage, xContext );
- }
-
- rtl::Reference< configuration::ElementTree > aElementTree = configapi::extractElementTree(rNode.getFactory(), rElement, rNode.getElementInfo());
- if (!aElementTree.is())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot replace Set Element: ") );
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Replacing object was not created from this set's template") );
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw lang::IllegalArgumentException( sMessage, xContext, 2 );
- }
-
- configuration::NodeChange aChange = lock.getNodeUpdater().validateReplaceElement( aElement, aElementTree );
-
- if (aChange.test().isChange())
- {
- Broadcaster aSender(rNode.getNotifier().makeBroadcaster(aChange,true));
-
- //aSender.queryConstraints(aChange); - N/A: no external constraints on set children possible
-
- aTree->integrate(aChange, aNode, true);
- attachSetElement(rNode, aElementTree);
-
- lock.clearForBroadcast();
- aSender.notifyListeners(aChange);
- }
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot replace Set Element: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw container::NoSuchElementException( e.message(), xContext );
- }
- catch (configuration::TypeMismatch& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.illegalArgument(2);
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-}
-//-----------------------------------------------------------------------------------
-
-void implReplaceByName(NodeValueSetAccess& rNode, const rtl::OUString& sName, const uno::Any& rElement )
- throw(lang::IllegalArgumentException, container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
-{
- try
- {
- GuardedNodeUpdate<NodeValueSetAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- rtl::OUString aChildName = configuration::validateElementName(sName,aTree,aNode);
-
- rtl::Reference< configuration::ElementTree > aElement( aTree->getElement(aNode,aChildName) );
-
- if (!aElement.is())
- {
- OSL_ENSURE(!configuration::hasChildOrElement(aTree,aNode,aChildName),"ERROR: Configuration: Existing Set element not found by implementation");
-
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot replace Set Element. Element '") );
- sMessage += sName;
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' not found in Set ") );
- sMessage += aTree->getAbsolutePath(aNode).toString();
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw container::NoSuchElementException( sMessage, xContext );
- }
-
- configuration::NodeChange aChange = lock.getNodeUpdater().validateReplaceElement( aElement, rElement );
-
- if (aChange.test().isChange())
- {
- Broadcaster aSender(rNode.getNotifier().makeBroadcaster(aChange,true));
-
- //aSender.queryConstraints(aChange); - N/A: no external constraints on set children possible
-
- aTree->integrate(aChange, aNode, true);
-
- lock.clearForBroadcast();
- aSender.notifyListeners(aChange);
- }
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot replace Set Element: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw container::NoSuchElementException( e.message(), xContext );
- }
- catch (configuration::TypeMismatch& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.illegalArgument(2);
- }
- catch (configuration::ConstraintViolation& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.illegalArgument(2);
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-}
-
-// XNameContainer
-//-----------------------------------------------------------------------------------
-void implInsertByName(NodeTreeSetAccess& rNode, const rtl::OUString& sName, const uno::Any& rElement)
- throw(lang::IllegalArgumentException, container::ElementExistException, lang::WrappedTargetException, uno::RuntimeException)
-{
- try
- {
- GuardedNodeUpdate<NodeTreeSetAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- rtl::OUString aChildName = configuration::validateElementName(sName,aTree,aNode);
-
- if( aTree->hasElement(aNode,aChildName) )
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot insert into Set. Element '") );
- sMessage += sName;
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' is already present in Set ") );
- sMessage += aTree->getAbsolutePath(aNode).toString();
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw container::ElementExistException( sMessage, xContext );
- }
- OSL_ENSURE(!configuration::hasChildOrElement(aTree,aNode,aChildName),"ERROR: Configuration: Existing Set element not found by implementation");
-
- rtl::Reference< configuration::ElementTree > aElementTree = configapi::extractElementTree(rNode.getFactory(), rElement, rNode.getElementInfo());
- if (!aElementTree.is())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot insert into Set: ") );
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Inserted object was not created from this set's template") );
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw lang::IllegalArgumentException( sMessage, xContext, 2 );
- }
-
- configuration::NodeChange aChange = lock.getNodeUpdater().validateInsertElement(aChildName, aElementTree);
-
- aChange.test(); // make sure old values are set up correctly
- OSL_ENSURE(aChange.isChange(), "ERROR: Adding a node validated as empty change");
-
- Broadcaster aSender(rNode.getNotifier().makeBroadcaster(aChange,true));
-
- //aSender.queryConstraints(); - N/A: no external constraints on set children possible
-
- aTree->integrate(aChange, aNode, true);
- attachSetElement(rNode, aElementTree);
-
- lock.clearForBroadcast();
- aSender.notifyListeners(aChange);
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.illegalArgument( 1 );
- }
- catch (configuration::TypeMismatch& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.illegalArgument(2);
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
-}
-
-//-----------------------------------------------------------------------------------
-
-void implInsertByName(NodeValueSetAccess& rNode, const rtl::OUString& sName, const uno::Any& rElement)
- throw(lang::IllegalArgumentException, container::ElementExistException, lang::WrappedTargetException, uno::RuntimeException)
-{
- try
- {
- GuardedNodeUpdate<NodeValueSetAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- rtl::OUString aChildName = configuration::validateElementName(sName,aTree,aNode);
-
- if( aTree->hasElement(aNode,aChildName) )
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot insert into Set. Element '") );
- sMessage += sName;
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' is already present in Set ") );
- sMessage += aTree->getAbsolutePath(aNode).toString();
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw container::ElementExistException( sMessage, xContext );
- }
- OSL_ENSURE(!configuration::hasChildOrElement(aTree,aNode,aChildName),"ERROR: Configuration: Existing Set element not found by implementation");
-
- configuration::NodeChange aChange = lock.getNodeUpdater().validateInsertElement(aChildName, rElement);
-
- aChange.test(); // make sure old values are set up correctly
- OSL_ENSURE(aChange.isChange(), "ERROR: Adding a node validated as empty change");
-
- Broadcaster aSender(rNode.getNotifier().makeBroadcaster(aChange,true));
-
- //aSender.queryConstraints(); - N/A: no external constraints on set children possible
-
- aTree->integrate(aChange, aNode, true);
-
- lock.clearForBroadcast();
- aSender.notifyListeners(aChange);
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.illegalArgument( 1 );
- }
- catch (configuration::TypeMismatch& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.illegalArgument(2);
- }
- catch (configuration::ConstraintViolation& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.illegalArgument(2);
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
-}
-
-//-----------------------------------------------------------------------------------
-void implRemoveByName(NodeTreeSetAccess& rNode, const rtl::OUString& sName )
- throw(css::container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
-{
- try
- {
- GuardedNodeUpdate<NodeTreeSetAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- rtl::OUString aChildName = configuration::validateElementName(sName,aTree,aNode);
-
- rtl::Reference< configuration::ElementTree > aElement( aTree->getElement(aNode,aChildName) );
-
- if (!aElement.is())
- {
- OSL_ENSURE(!configuration::hasChildOrElement(aTree,aNode,aChildName),"ERROR: Configuration: Existing Set element not found by implementation");
-
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot remove Set Element. Element '") );
- sMessage += sName;
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' not found in Set ") );
- sMessage += aTree->getAbsolutePath(aNode).toString();
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw container::NoSuchElementException( sMessage, xContext );
- }
-
- configuration::NodeChange aChange = lock.getNodeUpdater().validateRemoveElement(aElement);
-
- aChange.test(); // make sure old values are set up correctly
- OSL_ENSURE(aChange.isChange(), "ERROR: Removing a node validated as empty change");
-
- Broadcaster aSender(rNode.getNotifier().makeBroadcaster(aChange,true));
-
- //aSender.queryConstraints(); - N/A: no external constraints on set children possible
-
- aTree->integrate(aChange, aNode, true);
- detachSetElement(rNode.getFactory(), aElement);
-
- lock.clearForBroadcast();
- aSender.notifyListeners(aChange);
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot remove Set Element: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw container::NoSuchElementException( sMessage += e.message(), xContext );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
-}
-//-----------------------------------------------------------------------------------
-void implRemoveByName(NodeValueSetAccess& rNode, const rtl::OUString& sName )
- throw(css::container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
-{
- try
- {
- GuardedNodeUpdate<NodeValueSetAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- rtl::OUString aChildName = configuration::validateElementName(sName,aTree,aNode);
-
- rtl::Reference< configuration::ElementTree > aElement = aTree->getElement(aNode,aChildName);
- if (!aElement.is())
- {
- OSL_ENSURE(!configuration::hasChildOrElement(aTree,aNode,aChildName),"ERROR: Configuration: Existing Set element not found by implementation");
-
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot remove Set Element. Element '") );
- sMessage += sName;
- sMessage += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("' not found in Set ") );
- sMessage += aTree->getAbsolutePath(aNode).toString();
-
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw container::NoSuchElementException( sMessage, xContext );
- }
-
- configuration::NodeChange aChange = lock.getNodeUpdater().validateRemoveElement(aElement);
-
- aChange.test(); // make sure old values are set up correctly
- OSL_ENSURE(aChange.isChange(), "ERROR: Removing a node validated as empty change");
-
- Broadcaster aSender(rNode.getNotifier().makeBroadcaster(aChange,true));
-
- //aSender.queryConstraints(); - N/A: no external constraints on set children possible
-
- aTree->integrate(aChange, aNode, true);
-
- lock.clearForBroadcast();
- aSender.notifyListeners(aChange);
- }
- catch (configuration::InvalidName& ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot remove Set Element: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
- throw container::NoSuchElementException( sMessage += e.message(), xContext );
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
-}
-//-----------------------------------------------------------------------------------
-
-// XPropertyWithState
-//-----------------------------------------------------------------------------------
-
-void implSetToDefaultAsProperty(NodeSetAccess& rNode)
- throw (css::lang::WrappedTargetException, uno::RuntimeException)
-{
- try
- {
- GuardedNodeUpdate<NodeSetAccess> lock( rNode );
-
- rtl::Reference< configuration::Tree > const aTree( lock.getTree() );
- configuration::NodeRef const aNode( lock.getNode() );
-
- configuration::SetDefaulter aDefaulter = lock.getNodeDefaulter();
-
- configuration::NodeChange aChange = aDefaulter.validateSetToDefaultState();
-
- const bool bLocal = true;
-
- if (aChange.test().isChange() )
- {
- Broadcaster aSender(rNode.getNotifier().makeBroadcaster(aChange,bLocal));
-
- aSender.queryConstraints(aChange);
-
- aTree->integrate(aChange, aNode, bLocal);
-
- lock.clearForBroadcast();
- aSender.notifyListeners(aChange);
- }
- }
- catch (configuration::ConstraintViolation & ex)
- {
- ExceptionMapper e(ex);
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot restore Default: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
-
- throw lang::WrappedTargetException( sMessage += e.message(), xContext, uno::Any());
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
- catch (lang::WrappedTargetException& ) { throw;}
- catch (uno::RuntimeException& ) { throw;}
- catch (uno::Exception& e)
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot restore Default: ") );
- uno::Reference<uno::XInterface> xContext( rNode.getUnoInstance() );
-
- throw lang::WrappedTargetException( sMessage += e.Message, xContext, uno::makeAny(e));
- }
-}
-//-----------------------------------------------------------------------------------
-
-// XSingleServiceFactory
-//-----------------------------------------------------------------------------------
-uno::Reference< uno::XInterface > implCreateElement(NodeTreeSetAccess& rNode )
- throw(uno::Exception, uno::RuntimeException)
-{
- uno::Reference< uno::XInterface > xRet;
- try
- {
- GuardedNodeData<NodeSetAccess> lock( rNode ); // no provider lock needed ? => if template lock is separate - OK
-
- rtl::Reference< configuration::ElementTree > aNewElement( rNode.getElementFactory().instantiateTemplate(rNode.getElementInfo()) );
-
- uno::Any aAny = configapi::makeElement( rNode.getFactory(), aNewElement );
- if (!(aAny >>= xRet)) // no parent available
- {
- OSL_ASSERT(!xRet.is()); // make sure we return NULL
- OSL_ENSURE(!aAny.hasValue(), "configmgr: BasicSetElement::getParent: could not extract parent - node is not an object");
- }
- }
- catch (configuration::Exception& ex)
- {
- ExceptionMapper e(ex);
- e.setContext( rNode.getUnoInstance() );
- e.unhandled();
- }
-
- return xRet;
-}
-//-----------------------------------------------------------------------------------
-
-uno::Reference< uno::XInterface > implCreateElement(NodeTreeSetAccess& rNode, const uno::Sequence< uno::Any >& aArguments )
- throw(uno::Exception, uno::RuntimeException)
-{
- { (void)aArguments; }
- OSL_ENSURE(aArguments.getLength() == 0, "ConfigurationContainer: createInstance: Arguments not supported - ignoring ...");
- return implCreateElement(rNode);
-}
-
-//-----------------------------------------------------------------------------------
- } // namespace configapi
-
-} // namespace configmgr
-
-
diff --git a/configmgr/source/api2/updateimpl.hxx b/configmgr/source/api2/updateimpl.hxx
deleted file mode 100644
index 164331dab5..0000000000
--- a/configmgr/source/api2/updateimpl.hxx
+++ /dev/null
@@ -1,95 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_BASEUPDATEIMPL_HXX_
-#define CONFIGMGR_API_BASEUPDATEIMPL_HXX_
-
-#include <com/sun/star/container/XNameContainer.hpp>
-#include <com/sun/star/beans/XPropertyWithState.hpp>
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
-
-namespace configmgr
-{
- namespace css = ::com::sun::star;
- namespace uno = ::com::sun::star::uno;
-
- /* implementations of the interfaces supported by a (parent) node
- within the configuration tree.
- (updating operation)
- */
- namespace configapi
- {
- class NodeSetAccess;
- class NodeTreeSetAccess;
- class NodeValueSetAccess;
- class NodeGroupAccess;
-
- // XNameReplace
- //---------------------------------------------------------------------
- void implReplaceByName(NodeGroupAccess& rNode, const rtl::OUString& rName, const uno::Any& rElement )
- throw(css::lang::IllegalArgumentException, css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException);
-
- void implReplaceByName(NodeTreeSetAccess& rNode, const rtl::OUString& rName, const uno::Any& rElement )
- throw(css::lang::IllegalArgumentException, css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException);
-
- void implReplaceByName(NodeValueSetAccess& rNode, const rtl::OUString& rName, const uno::Any& rElement )
- throw(css::lang::IllegalArgumentException, css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException);
-
- // XNameContainer
- //---------------------------------------------------------------------
- void implInsertByName(NodeTreeSetAccess& rNode, const rtl::OUString& rName, const uno::Any& rElement)
- throw(css::lang::IllegalArgumentException, css::container::ElementExistException, css::lang::WrappedTargetException, uno::RuntimeException);
-
- void implInsertByName(NodeValueSetAccess& rNode, const rtl::OUString& rName, const uno::Any& rElement)
- throw(css::lang::IllegalArgumentException, css::container::ElementExistException, css::lang::WrappedTargetException, uno::RuntimeException);
-
- void implRemoveByName(NodeTreeSetAccess& rNode, const rtl::OUString& rName )
- throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException);
-
- void implRemoveByName(NodeValueSetAccess& rNode, const rtl::OUString& rName )
- throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException);
-
- // XPropertyWithState - updating operation only
- //---------------------------------------------------------------------
- void implSetToDefaultAsProperty(NodeSetAccess& rNode)
- throw (css::lang::WrappedTargetException, uno::RuntimeException);
-
- // XSingleServiceFactory
- //---------------------------------------------------------------------
- uno::Reference< uno::XInterface > implCreateElement(NodeTreeSetAccess& rNode )
- throw(uno::Exception, uno::RuntimeException);
-
- uno::Reference< uno::XInterface > implCreateElement(NodeTreeSetAccess& rNode, const uno::Sequence< uno::Any >& aArguments )
- throw(uno::Exception, uno::RuntimeException);
-
- //---------------------------------------------------------------------
- }
-
-}
-#endif // CONFIGMGR_API_BASEUPDATEIMPL_HXX_
-
-
diff --git a/configmgr/source/backend/backendaccess.cxx b/configmgr/source/backend/backendaccess.cxx
deleted file mode 100644
index e783b8c3ff..0000000000
--- a/configmgr/source/backend/backendaccess.cxx
+++ /dev/null
@@ -1,827 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include "backendaccess.hxx"
-#include "logger.hxx"
-#include "matchlocale.hxx"
-#include "layermerge.hxx"
-#include "schemabuilder.hxx"
-
-#ifndef CONFIGMGR_BACKEND_UPDATEDISPATCHER_HXX
-#include "updatedispatch.hxx"
-#endif // CONFIGMGR_BACKEND_UPDATEDISPATCHER_HXX
-#include "backendnotifier.hxx"
-#include "emptylayer.hxx"
-#include "filehelper.hxx"
-#include "simpleinteractionrequest.hxx"
-#include "configinteractionhandler.hxx"
-#include <com/sun/star/configuration/backend/XVersionedSchemaSupplier.hpp>
-#include <com/sun/star/configuration/backend/XCompositeLayer.hpp>
-#include <com/sun/star/configuration/backend/XUpdatableLayer.hpp>
-#include <com/sun/star/configuration/backend/XBackendEntities.hpp>
-#include <com/sun/star/configuration/backend/MergeRecoveryRequest.hpp>
-#include <com/sun/star/configuration/backend/MalformedDataException.hpp>
-#include <com/sun/star/container/NoSuchElementException.hpp>
-#include <com/sun/star/lang/NullPointerException.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include "com/sun/star/task/XInteractionHandler.hpp"
-#include <rtl/ustrbuf.hxx>
-#include <rtl/ref.hxx>
-#include <rtl/logfile.hxx>
-
-#include <cppuhelper/exc_hlp.hxx>
-
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif //INCLUDED_VECTOR
-
-#ifndef INCLUDED_ALGORITHM
-#include <algorithm>
-#define INCLUDED_ALGORITHM
-#endif //INCLUDED_ALGORITHM
-
-#define OU2A(rtlOUString) (::rtl::OUStringToOString((rtlOUString), RTL_TEXTENCODING_ASCII_US).getStr())
-#define RTL_LOGFILE_OU2A(rtlOUString) OU2A(rtlOUString)
-
-#define OUSTR(txt) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(txt) )
-
-namespace configmgr { namespace backend {
-//------------------------------------------------------------------------------
- namespace task = com::sun::star::task;
-
-inline
-uno::Reference<lang::XMultiServiceFactory> BackendAccess::getServiceFactory() const
-{
- return uno::Reference<lang::XMultiServiceFactory>(mContext->getServiceManager(),uno::UNO_QUERY_THROW);
-}
-//------------------------------------------------------------------------------
-
-BackendAccess::BackendAccess(
- const uno::Reference<backenduno::XBackend>& xBackend,
- const uno::Reference<uno::XComponentContext>& xContext)
- : mContext(xContext)
- , mBackend(xBackend)
- , mBinaryCache(xContext)
- {
- OSL_ENSURE(mContext.is(), "BackendAccess: Context is missing");
- if (!mContext.is())
- throw lang::NullPointerException(rtl::OUString::createFromAscii("BackendAccess: NULL Context passed"), NULL);
- if (!xBackend.is())
- throw lang::NullPointerException(OUSTR("Configuration: Trying to create backend access without backend"),NULL);
- if (!uno::Reference<backenduno::XSchemaSupplier>::query(xBackend).is())
- throw lang::NullPointerException(OUSTR("Configuration: No backend for schemas available"),NULL);
-
-
- mNotifier = new BackendChangeNotifier(xBackend);
- //Stored as uno::reference to facilitate sharing with MultiStratumBackend
- mXNotifier = mNotifier;
-
- //Create Binary Cache
- uno::Reference<backenduno::XBackendEntities> xBackendEntities = uno::Reference<backenduno::XBackendEntities>( mBackend, uno::UNO_QUERY) ;
- OSL_ENSURE(xBackendEntities.is(),"Backend does not provide entity information");
-
- if ( xBackendEntities.is() ) mBinaryCache.setOwnerEntity(xBackendEntities->getOwnerEntity());
-}
-//------------------------------------------------------------------------------
-
-BackendAccess::~BackendAccess() {}
-//------------------------------------------------------------------------------
-namespace
-{
-//------------------------------------------------------------------------------
-
- static inline
- bool findLocale(std::vector< com::sun::star::lang::Locale > const & seq, com::sun::star::lang::Locale const & loc)
- {
- std::vector< com::sun::star::lang::Locale >::const_iterator first = seq.begin();
- std::vector< com::sun::star::lang::Locale >::const_iterator last = seq.end();
- for ( ; first != last; ++first)
- if (localehelper::equalLocale(*first, loc))
- return true;
- return false;
- }
-//------------------------------------------------------------------------------
-
- static inline
- void addLocale( com::sun::star::lang::Locale const & aLocale, std::vector< com::sun::star::lang::Locale > & inoutLocales)
- {
- if (!findLocale(inoutLocales,aLocale))
- inoutLocales.push_back(aLocale);
- }
-//------------------------------------------------------------------------------
-
- static rtl::OUString toString(uno::Sequence< rtl::OUString > const & seq, sal_Unicode separator = ',')
- {
- rtl::OUStringBuffer buf;
-
- if (sal_Int32 const nCount = seq.getLength())
- {
- buf.append(seq[0]);
- for (sal_Int32 ix=1; ix < nCount; ++ix)
- buf.append(separator).append(seq[ix]);
- }
- else
- buf.appendAscii("<none>");
-
- return buf.makeStringAndClear();
- }
-//------------------------------------------------------------------------------
-
- static
- uno::Sequence< rtl::OUString > intersect(uno::Sequence< rtl::OUString > const & seq1, uno::Sequence< rtl::OUString > const & seq2)
- {
- sal_Int32 const len1 = seq1.getLength();
- uno::Sequence< rtl::OUString > aResult(len1);
-
- rtl::OUString const * const beg2 = seq2.getConstArray();
- rtl::OUString const * const end2 = beg2 + seq2.getLength();
-
- sal_Int32 ix = 0;
- for (sal_Int32 i1 = 0; i1 < len1; ++i1)
- {
- if (std::find(beg2,end2,seq1[i1]) != end2)
- aResult[ix++] = seq1[i1];
- }
- aResult.realloc(ix);
- return aResult;
- }
-//------------------------------------------------------------------------------
-} // anonymous namespace
-//------------------------------------------------------------------------------
-
-// helper used by the binary cache
-uno::Sequence< rtl::OUString >
- getAvailableLocales(const uno::Reference<backenduno::XLayer> * pLayers, sal_Int32 nNumLayers)
-{
- uno::Sequence< rtl::OUString > aResult;
-
- for (sal_Int32 i = 0 ; i < nNumLayers ; ++ i)
- {
- uno::Reference<backenduno::XCompositeLayer> compositeLayer(
- pLayers [i], uno::UNO_QUERY) ;
-
- if (compositeLayer.is())
- {
- uno::Sequence<rtl::OUString> aLocales = compositeLayer->listSubLayerIds();
-
- if (aResult.getLength() == 0)
- {
- aResult = aLocales;
- }
- else
- {
- OSL_TRACE("Warning: multiple composite layers found. Detection of available locales is inaccurate.");
- // be defensive: only locales present in all composite layers are 'available'
- aResult= intersect(aResult,aLocales);
- }
- }
- }
- return aResult;
-}
-//------------------------------------------------------------------------------
-static rtl::OUString getLayerURL(const uno::Reference<backenduno::XLayer> & aLayer);
-
-void BackendAccess::merge(
- MergedComponentData& aData,
- const uno::Reference<backenduno::XLayer> * pLayers,
- sal_Int32 aNumLayers,
- com::sun::star::lang::Locale const & aRequestedLocale,
- std::vector< com::sun::star::lang::Locale > & inoutMergedLocales,
- ITemplateDataProvider *aTemplateProvider,
- sal_Int32 * pLayersMerged)
- SAL_THROW((com::sun::star::uno::Exception))
-{
- LayerMergeHandler * pMerger = new LayerMergeHandler(mContext, aData, aTemplateProvider );
- uno::Reference<backenduno::XLayerHandler> xLayerMerger(pMerger);
-
- Logger logger(mContext);
-
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::backend::BackendAccess", "jb99855", "configmgr: BackendAccess::merge()");
- RTL_LOGFILE_CONTEXT_TRACE1(aLog, "merging %d layers", int(aNumLayers) );
-
- rtl::OUString const & aLanguage = aRequestedLocale.Language;
- bool const needAllLanguages = localehelper::isAnyLanguage(aLanguage);
-
- if (aLanguage.getLength() && !needAllLanguages)
- {
- if (!localehelper::isDefaultLanguage(aLanguage))
- addLocale(aRequestedLocale,inoutMergedLocales);
- }
- bool const needLocalizedData = needAllLanguages || !inoutMergedLocales.empty();
-
- if (logger.isLogging(LogLevel::FINEST))
- {
- if (!needLocalizedData)
- logger.finest("Starting merge with NO locales", "merge()","configmgr::Backend");
-
- else if (needAllLanguages)
- logger.finest("Starting merge for ALL locales", "merge()","configmgr::Backend");
-
- else
- logger.finest(OUSTR("Starting merge for locale(s): ") +
- toString(localehelper::makeIsoSequence(inoutMergedLocales)),
- "merge()","configmgr::Backend");
- }
-
- if (pLayersMerged) *pLayersMerged = 0;
-
- for (sal_Int32 i = 0 ; i < aNumLayers ; ++ i)
- {
- if (logger.isLogging(LogLevel::FINEST))
- logger.finest(OUSTR("+ Merging layer: ") + getLayerURL(pLayers[i]),
- "merge()","configmgr::Backend");
-
- pMerger->prepareLayer() ;
- pLayers [i]->readData(xLayerMerger) ;
-
- if (needLocalizedData)
- {
- uno::Reference<backenduno::XCompositeLayer> compositeLayer(
- pLayers [i], uno::UNO_QUERY) ;
-
- if (compositeLayer.is())
- {
- uno::Sequence<rtl::OUString> aSubLayerIds = compositeLayer->listSubLayerIds();
- logger.finest(OUSTR("++ Found locales: ") + toString(aSubLayerIds),
- "merge()","configmgr::Backend");
-
- for (sal_Int32 j = 0; j < aSubLayerIds.getLength(); ++j)
- {
- rtl::OUString const & aLocaleIso = aSubLayerIds[j];
- com::sun::star::lang::Locale aLocale = localehelper::makeLocale(aLocaleIso);
-
- // requesting de-CH, we accept de-CH and de, but not de-DE
- const localehelper::MatchQuality kMatchAccept = localehelper::MATCH_LANGUAGE_PLAIN;
-
- if (needAllLanguages || localehelper::isMatch(aLocale,inoutMergedLocales,kMatchAccept))
- {
- if(pMerger->prepareSublayer(aLocaleIso))
- {
- logger.finest(OUSTR("++ Merging sublayer for locale: ") + aLocaleIso,
- "merge()","configmgr::Backend");
- compositeLayer->readSubLayerData(xLayerMerger,aLocaleIso) ;
- addLocale(aLocale,inoutMergedLocales);
- }
- // else dropLocale(aLocale,inoutMergedLocales); ?
- }
- }
- }
- }
- if (pLayersMerged) ++*pLayersMerged;
- }
-}
-//------------------------------------------------------------------------------
-
-bool BackendAccess::readDefaultData( MergedComponentData & aComponentData,
- rtl::OUString const & aComponent,
- RequestOptions const & aOptions,
- bool bIncludeTemplates,
- const uno::Reference<backenduno::XLayer> * pLayers,
- sal_Int32 nNumLayers,
- ITemplateDataProvider *aTemplateProvider,
- sal_Int32 * pLayersMerged)
- SAL_THROW((com::sun::star::uno::Exception))
-{
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog1, "configmgr::backend::BackendAccess", "jb99855", "configmgr: BackendAccess::readDefaultData()");
-
- Logger logger(mContext);
- const sal_Int32 detail = LogLevel::FINER;
- bool const bLogDetail = logger.isLogging(detail);
-
- rtl::OUString const aSchemaVersion = this->getSchemaVersion(aComponent);
-
- if (logger.isLogging(LogLevel::FINE))
- {
- rtl::OUStringBuffer aMsg;
- aMsg.appendAscii("Reading data for component \"").append(aComponent).appendAscii("\"");
- aMsg.appendAscii(" [version=").append(aSchemaVersion).appendAscii("]");
-
- logger.fine( aMsg.makeStringAndClear(), "readDefaultData()","configmgr::Backend");
- }
-
- com::sun::star::lang::Locale const aRequestedLocale = localehelper::makeLocale(aOptions.getLocale());
- std::vector< com::sun::star::lang::Locale > aKnownLocales;
-
- if (bLogDetail) logger.log(detail, "... attempt to read from binary cache", "readDefaultData()","configmgr::Backend");
- bool bCacheHit = mBinaryCache.readComponentData(aComponentData, getServiceFactory(),
- aComponent, aSchemaVersion,
- aOptions.getEntity(),
- aRequestedLocale, aKnownLocales,
- pLayers, nNumLayers, bIncludeTemplates);
-
- if (!bCacheHit)
- {
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog2, "configmgr::backend::BackendAccess", "jb99855", "configmgr: BackendAccess::readDefaultData() - not in cache");
-
- if (bLogDetail) logger.log(detail, "... cache miss - need full merge", "readDefaultData()","configmgr::Backend");
- if (bLogDetail) logger.log(detail, "... reading schema", "readDefaultData()","configmgr::Backend");
- {
- SchemaBuilder *schemaBuilder = new SchemaBuilder( mContext, aComponent, aComponentData, aTemplateProvider );
- uno::Reference<backenduno::XSchemaHandler> schemaHandler = schemaBuilder ;
-
- uno::Reference<backenduno::XSchema> schema = this->getSchema(aComponent);
- schema->readSchema(schemaHandler) ;
- }
-
- if (bLogDetail) logger.log(detail, "... merging layers", "readDefaultData()","configmgr::Backend");
- this->merge(aComponentData, pLayers, nNumLayers, aRequestedLocale, aKnownLocales, aTemplateProvider, pLayersMerged );
- promoteToDefault(aComponentData);
-
- if (mBinaryCache.isCacheEnabled(aOptions.getEntity()))
- {
- if (bLogDetail) logger.log(detail, "... creating binary cache", "readDefaultData()","configmgr::Backend");
- bool bWriteSuccess = mBinaryCache.writeComponentData( aComponentData, getServiceFactory(),
- aComponent, aSchemaVersion,
- aOptions.getEntity(), aKnownLocales,
- pLayers, nNumLayers );
-
- if (!bWriteSuccess)
- {
- logger.info("Binary cache write failed - disabling binary cache","readDefaultData()","configmgr::Backend");
- mBinaryCache.disableCache();
- }
- }
- else if (bLogDetail)
- logger.log(detail, "... cache hit", "readDefaultData()","configmgr::Backend");
- }
- else if (pLayersMerged)
- *pLayersMerged = nNumLayers;
-
- return aComponentData.hasSchema();
-}
-//------------------------------------------------------------------------------
-
-static rtl::OUString getLayerURL(const uno::Reference<backenduno::XLayer> & aLayer)
-{
- try
- {
- namespace beans = com::sun::star::beans;
- uno::Reference< beans::XPropertySet > xLayerProps( aLayer, uno::UNO_QUERY );
- if (xLayerProps.is())
- {
- uno::Any aPropVal = xLayerProps->getPropertyValue( OUSTR("URL") );
- rtl::OUString aResult;
- if (aPropVal >>= aResult)
- return aResult;
- }
- OSL_TRACE("Warning - Cannot get location of layer data\n");
- }
- catch (uno::Exception & e)
- {
- OSL_TRACE("Warning - Configuration: Retrieving layer URL failed: [%s]\n", OU2A(e.Message));
- }
- // TODO: use better fallback, e.g. ServiceName
- const char * const aFallback = aLayer.is() ? "<Unknown Layer Type>" : "<NULL Layer>";
- return rtl::OUString::createFromAscii(aFallback);
-}
-//------------------------------------------------------------------------------
-static inline
-rtl::OUString getLayerIdentifier(const uno::Reference<backenduno::XLayer> & aLayer)
-{
- return getLayerURL(aLayer);
-}
-
-//------------------------------------------------------------------------------
-static void removeLayerData(uno::Reference< backenduno::XLayer > const & xLayer)
-{
- OSL_ASSERT(xLayer.is());
-
- uno::Reference< backenduno::XUpdatableLayer > xLayerRemover(xLayer,uno::UNO_QUERY);
- if (xLayerRemover.is())
- try
- {
- xLayerRemover->replaceWith(createEmptyLayer());
- }
- catch (uno::Exception & e)
- {
- OSL_TRACE("Warning - Configuration: Could not clear Layer data. Error: [%s]\n", OU2A(e.Message));
- }
- else
- {
- if (! FileHelper::tryToRemoveFile(getLayerURL(xLayer),true))
- OSL_TRACE("Warning - Configuration: Could not remove broken user Layer data: [-Not Updatable-]\n");
- }
-}
-//------------------------------------------------------------------------------
-
-static void discardLayer(uno::Sequence<uno::Reference<backenduno::XLayer> >& layers, sal_Int32 nLayer)
-{
- OSL_ASSERT(0 <= nLayer && nLayer < layers.getLength());
- sal_Int32 nNewSize = layers.getLength() - 1;
-
- for (sal_Int32 i = nLayer; i<nNewSize; ++i)
- layers[i] = layers[i+1];
-
- layers.realloc(nNewSize);
-}
-//------------------------------------------------------------------------------
-
-namespace {
-
-class RecursiveHandler:
- public cppu::WeakImplHelper1< task::XInteractionHandler >
-{
-public:
- explicit RecursiveHandler(
- uno::Reference< task::XInteractionHandler > const & outer):
- m_outer(outer) {}
-
- virtual void SAL_CALL handle(
- uno::Reference< task::XInteractionRequest > const & request)
- throw (uno::RuntimeException)
- {
- backenduno::MergeRecoveryRequest req;
- if (request->getRequest() >>= req) {
- uno::Sequence< uno::Reference< task::XInteractionContinuation > >
- cs(request->getContinuations());
- for (sal_Int32 i = 0; i < cs.getLength(); ++i) {
- uno::Reference< task::XInteractionDisapprove > dis(
- cs[i], uno::UNO_QUERY);
- if (dis.is()) {
- dis->select();
- break;
- }
- }
- } else if (m_outer.is()) {
- m_outer->handle(request);
- }
- }
-
-private:
- RecursiveHandler(RecursiveHandler &); // not defined
- void operator =(RecursiveHandler &); // not defined
-
- virtual ~RecursiveHandler() {}
-
- uno::Reference< task::XInteractionHandler > m_outer;
-};
-
-}
-
-bool BackendAccess::approveRecovery(const uno::Any & aMergeException,
- const uno::Reference<backenduno::XLayer> & aBrokenLayer,
- bool bUserLayerData)
- SAL_THROW((com::sun::star::uno::Exception))
-{
- sal_uInt32 const k_supported_choices = apihelper::CONTINUATION_APPROVE | apihelper::CONTINUATION_DISAPPROVE;
-
- sal_uInt32 chosen = apihelper::CONTINUATION_UNKNOWN;
-
- apihelper::ConfigurationInteractionHandler handler;
- try {
- uno::Reference< task::XInteractionHandler > h(handler.get());
- if (h.is()) {
- handler.setRecursive(new RecursiveHandler(h));
- rtl::Reference< apihelper::SimpleInteractionRequest > req(
- new apihelper::SimpleInteractionRequest(
- uno::makeAny(
- backenduno::MergeRecoveryRequest(
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "Recover from configuration merge"
- " failure")),
- aBrokenLayer, aMergeException,
- getLayerIdentifier(aBrokenLayer),
- (bUserLayerData
- && (uno::Reference< backenduno::XUpdatableLayer >::query(aBrokenLayer).is()
- || FileHelper::fileExists(
- getLayerURL(aBrokenLayer)))))),
- k_supported_choices));
- h->handle(req.get());
- chosen = req->getResponse();
- }
- } catch (uno::Exception & e) {
- OSL_TRACE("Warning - Configuration: Interaction handler failed: [%s]\n", OU2A(e.Message));
- }
-
- switch (chosen)
- {
- case apihelper::CONTINUATION_APPROVE: return true;
- case apihelper::CONTINUATION_DISAPPROVE: return false;
- case apihelper::CONTINUATION_UNKNOWN: break;
-
- default: OSL_ENSURE(false,"Unsolicited continuation chosen"); break;
- }
- // no choice available - default: approve, if user data
- return bUserLayerData;
-}
-//------------------------------------------------------------------------------
-
-ResultHolder< ComponentInstance > BackendAccess::getNodeData(const ComponentRequest& aRequest,
- ITemplateDataProvider *_aTemplateProvider,
- INodeDataListener *aListener)
- SAL_THROW((com::sun::star::uno::Exception))
-{
- rtl::OUString const component = aRequest.getComponentName();
- ITemplateDataProvider * const aTemplateProvider = _aTemplateProvider ? _aTemplateProvider : this;
-
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::backend::BackendAccess", "jb99855", "configmgr: BackendAccess::getNodeData()");
- RTL_LOGFILE_CONTEXT_TRACE1(aLog, "request path: %s", RTL_LOGFILE_OU2A(component) );
-
- uno::Sequence<uno::Reference<backenduno::XLayer> > layers =
- this->getLayers(component, aRequest.getOptions()) ;
-
- sal_Int32 const k_NumUserLayers = 1;
-
- sal_Int32 nNumDefaultLayers = layers.getLength() - k_NumUserLayers;
- sal_Int32 nCurrentLayer( -1 );
- bool bDefaultRecoveryApproved = false;
-
- Logger logger(mContext);
- do try // loop to allow recovery from merge failures
- {
- MergedComponentData aComponentData;
- nCurrentLayer = -1;
-
- if (!this->readDefaultData(aComponentData, component, aRequest.getOptions(), true,
- layers.getConstArray(),nNumDefaultLayers,
- aTemplateProvider, &nCurrentLayer))
- {
- rtl::OUStringBuffer sMessage;
- sMessage.appendAscii("Configuration: No data for request. Component \"");
- sMessage.append(component);
- sMessage.appendAscii("\" contains no data. ");
-
- throw com::sun::star::container::NoSuchElementException(sMessage.makeStringAndClear(),mBackend);
- }
- OSL_ASSERT(nCurrentLayer == nNumDefaultLayers);
-
- sal_Int32 const nNumUserLayers = layers.getLength() - nNumDefaultLayers;
- if (nNumUserLayers > 0)
- {
- //Merge User layer (with all locales)
- logger.finer("... merging user layer", "getNodeData()","configmgr::Backend");
-
- std::vector< com::sun::star::lang::Locale > aLocales;
- merge(aComponentData,
- layers.getConstArray()+nNumDefaultLayers, nNumUserLayers,
- localehelper::getAnyLocale(), aLocales, aTemplateProvider );
-
- // mark this one as done
- ++nCurrentLayer;
- }
-
- logger.finer("Reading component data finished successfully", "getNodeData()","configmgr::Backend");
-
- ComponentInstance retCode(aComponentData.extractSchemaTree(),
- aComponentData.extractTemplatesTree(),
- aRequest.getComponentName()) ;
-
- //Register listener with notifier
- if(aListener)
- {
- mNotifier->addListener(aListener, aRequest);
- }
- return ResultHolder< ComponentInstance >(retCode) ;
- }
- catch (com::sun::star::container::NoSuchElementException &) { throw; }
- catch (com::sun::star::uno::RuntimeException &) { throw; }
- catch (uno::Exception & )
- {
- // can only recover if layer merging broke
- if (nCurrentLayer < 0 || layers.getLength() <= nCurrentLayer)
- throw;
-
- uno::Reference< backenduno::XLayer > xBrokenLayer = layers[nCurrentLayer];
-
- bool bUserLayerBroken = (nCurrentLayer == nNumDefaultLayers);
-
- if (!bDefaultRecoveryApproved || bUserLayerBroken)
- {
- logger.info("Parsing data layer failed. Requesting approval for automated recovery", "getNodeData()","configmgr::Backend");
- uno::Any theError = cppu::getCaughtException();
- if (!approveRecovery(theError,xBrokenLayer,bUserLayerBroken))
- cppu::throwException( theError );
- }
-
- // now do the recovery
- discardLayer(layers,nCurrentLayer);
- if (bUserLayerBroken)
- {
- logger.info("Recovering from broken user data layer - discarding the data", "getNodeData()","configmgr::Backend");
- removeLayerData(xBrokenLayer);
- }
- else
- {
- logger.info("Recovering from broken default layer - skipping", "getNodeData()","configmgr::Backend");
- bDefaultRecoveryApproved = true;
- --nNumDefaultLayers;
- }
- }
- while (true);
-}
-//------------------------------------------------------------------------------
-
-void BackendAccess::updateNodeData(const UpdateRequest& aUpdate)
- SAL_THROW((com::sun::star::uno::Exception))
-{
- rtl::OUString entity = aUpdate.getOptions().getEntity() ;
- rtl::OUString component =
- aUpdate.getUpdateRoot().getModuleName();
- uno::Reference<backenduno::XUpdateHandler> handler ;
-
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::backend::BackendAccess", "jb99855", "configmgr: BackendAccess::updateNodeData()");
- RTL_LOGFILE_CONTEXT_TRACE1(aLog, "updating component: %s", RTL_LOGFILE_OU2A(component) );
-
- if (entity.getLength() == 0) {
- handler = mBackend->getOwnUpdateHandler(component) ;
- }
- else { handler = mBackend->getUpdateHandler(component, entity) ; }
- UpdateDispatcher dispatcher(handler, aUpdate.getOptions().getLocale()) ;
-
- dispatcher.dispatchUpdate(aUpdate.getUpdateRoot(),
- *aUpdate.getUpdateData()) ;
-}
-//------------------------------------------------------------------------------
-
-ResultHolder< NodeInstance > BackendAccess::getDefaultData(const NodeRequest& aRequest)
- SAL_THROW((com::sun::star::uno::Exception))
-{
- rtl::OUString const component = aRequest.getPath().getModuleName();
-
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::backend::BackendAccess", "jb99855", "configmgr: BackendAccess::getDefaultData()");
- RTL_LOGFILE_CONTEXT_TRACE1(aLog, "request path: %s", RTL_LOGFILE_OU2A(aRequest.getPath().toString()) );
-
- uno::Sequence<uno::Reference<backenduno::XLayer> > const layers =
- this->getLayers(component, aRequest.getOptions()) ;
-
- sal_Int32 const nNumUserLayers = 1;
- sal_Int32 const nNumDefaultLayers = layers.getLength() - nNumUserLayers;
-
- MergedComponentData aComponentData;
-
- if (!this->readDefaultData(aComponentData, component, aRequest.getOptions(), false,
- layers.getConstArray(),nNumDefaultLayers,
- this))
- {
- rtl::OUStringBuffer sMessage;
- sMessage.appendAscii("Configuration: No data for request. Component \"");
- sMessage.append(component);
- sMessage.appendAscii("\" contains no default data. ");
-
- rtl::OUString const sMsg = sMessage.makeStringAndClear();
- Logger(mContext).finer(sMsg,"getDefaultData()","configmgr::BackendAccess");
- throw com::sun::star::container::NoSuchElementException(sMsg,mBackend);
- }
-
- std::auto_ptr<ISubtree> aResultTree = aComponentData.extractSchemaTree();
-
- configuration::AbsolutePath aPath = aRequest.getPath();
- if( aPath.begin() != aPath.end())
- {
- for(std::vector<configuration::Path::Component>::const_reverse_iterator it=aPath.begin()+1,endIt=aPath.end();it!=endIt; ++it)
- {
- std::auto_ptr<INode> aChild=aResultTree->removeChild(it->getName());
- if(aChild.get()== NULL)
- {
- rtl::OUStringBuffer sMessage;
- sMessage.appendAscii("Configuration: No data for request. Element \"");
- sMessage.append(aPath.toString());
- sMessage.appendAscii("\" does not exist in the default data. ");
-
- rtl::OUString const sMsg = sMessage.makeStringAndClear();
- Logger(mContext).finest(sMsg,"getDefaultData()","configmgr::BackendAccess");
- throw com::sun::star::container::NoSuchElementException(sMsg,mBackend);
- }
-
- ISubtree *pChildAsSubtree = aChild->asISubtree();
- if(pChildAsSubtree == NULL)
- {
- rtl::OUString sMsg = rtl::OUString::createFromAscii("BackendAccess::getDefaultData - Node Expected, Found Property: ").concat(it->getName());
- Logger(mContext).finer(sMsg,"getDefaultData()","configmgr::BackendAccess");
- throw backenduno::MalformedDataException(sMsg, mBackend, uno::Any());
- }
- aResultTree.reset(pChildAsSubtree);
- aChild.release();
- }
- }
-
- NodeInstance retCode(aResultTree, aRequest.getPath()) ;
- return ResultHolder< NodeInstance >(retCode) ;
-}
-//------------------------------------------------------------------------------
-
-ResultHolder< TemplateInstance > BackendAccess::getTemplateData(const TemplateRequest& aRequest)
- SAL_THROW((com::sun::star::uno::Exception))
-{
- rtl::OUString component = aRequest.getComponentName();
-
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::backend::BackendAccess", "jb99855", "configmgr: BackendAccess::getTemplateData()");
- RTL_LOGFILE_CONTEXT_TRACE2(aLog, "requested template: %s/%s",
- RTL_LOGFILE_OU2A(aRequest.getComponentName().toString()) ,
- aRequest.isComponentRequest() ? "*" : RTL_LOGFILE_OU2A(aRequest.getComponentName().toString()) );
-
- MergedComponentData aComponentData;
-
- {
- SchemaBuilder *schemaBuilder = new SchemaBuilder( mContext, component, aComponentData ) ;
- uno::Reference<backenduno::XSchemaHandler> handler = schemaBuilder ;
-
- uno::Reference<backenduno::XSchema> schema = this->getSchema(component);
-
- schema->readTemplates(handler) ;
- }
-
- TemplateInstance::Data aResultData;
- if (aRequest.isComponentRequest())
- {
- aResultData.reset( aComponentData.extractTemplatesTree().release() );
- }
- else
- {
- backenduno::TemplateIdentifier templateId ;
- templateId.Name = aRequest.getTemplateName();
- templateId.Component = aRequest.getComponentName();
-
- aResultData = aComponentData.extractTemplateNode(templateId.Name);
- }
-
- TemplateInstance retCode(aResultData,aRequest.getTemplateName(), aRequest.getComponentName()) ;
- return ResultHolder< TemplateInstance >(retCode) ;
-}
-//------------------------------------------------------------------------------
-
-uno::Reference< backenduno::XSchema > BackendAccess::getSchema(const rtl::OUString& aComponent)
-{
- uno::Reference< backenduno::XSchemaSupplier > xSchemaBackend(mBackend, uno::UNO_QUERY_THROW);
- OSL_ASSERT(xSchemaBackend.is());
-
- uno::Reference< backenduno::XSchema > xSchema = xSchemaBackend->getComponentSchema(aComponent) ;
- if (!xSchema.is())
- {
- rtl::OUStringBuffer sMessage;
- sMessage.appendAscii("Configuration: No data for request. Component \"");
- sMessage.append(aComponent);
- sMessage.appendAscii("\" is unknown. [No schema available]");
-
- rtl::OUString const sMsg = sMessage.makeStringAndClear();
- Logger(mContext).warning(sMsg,"getSchema()","configmgr::BackendAccess");
- throw com::sun::star::container::NoSuchElementException(sMsg,xSchemaBackend);
- }
-
- return xSchema;
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString BackendAccess::getSchemaVersion(const rtl::OUString& aComponent)
-{
- uno::Reference< backenduno::XVersionedSchemaSupplier > xSchemaBackend(mBackend, uno::UNO_QUERY);
- if (xSchemaBackend.is())
- return xSchemaBackend->getSchemaVersion(aComponent);
- else
- return rtl::OUString();
-}
-//------------------------------------------------------------------------------
-
-uno::Sequence< uno::Reference<backenduno::XLayer> > BackendAccess::getLayers(const rtl::OUString& aComponent,const RequestOptions& aOptions)
-{
- rtl::OUString aEntity = aOptions.getEntity() ;
-
- if (aEntity.getLength() == 0)
- {
- // Use own entity instead
- return mBackend->listOwnLayers(aComponent) ;
- }
- else
- {
- return mBackend->listLayers(aComponent, aEntity) ;
- }
-}
-//------------------------------------------------------------------------------
-void BackendAccess::removeRequestListener(INodeDataListener *aListener,
- const ComponentRequest& aRequest)
- SAL_THROW(())
-{
-
- OSL_PRECOND(aListener, "ERROR: trying to remove a NULL listener");
- mNotifier->removeListener(aListener, aRequest);
-}
-//------------------------------------------------------------------------------
-} } // configmgr.backend
diff --git a/configmgr/source/backend/backendaccess.hxx b/configmgr/source/backend/backendaccess.hxx
deleted file mode 100644
index 7e2674a2a9..0000000000
--- a/configmgr/source/backend/backendaccess.hxx
+++ /dev/null
@@ -1,157 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_BACKENDACCESS_HXX_
-#define CONFIGMGR_BACKEND_BACKENDACCESS_HXX_
-
-#include "backendnotifier.hxx"
-#include "mergeddataprovider.hxx"
-#include "mergedcomponentdata.hxx"
-#include "matchlocale.hxx"
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-#include <com/sun/star/configuration/backend/XSchema.hpp>
-#include <com/sun/star/configuration/backend/XBackend.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include "binarycache.hxx"
-#include <com/sun/star/configuration/backend/XBackendChangesNotifier.hpp>
-
-
-namespace configmgr { namespace backend {
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backenduno = css::configuration::backend ;
-
-/**
- Implementation of IMergedDataProvider handling the access
- to the configuration data.
- */
-class BackendAccess : public IMergedDataProvider
-{
- public :
- /**
- Constructor using an XBackend implementation and a
- service factory.
-
- @param xBackend backend used for access to data
- @param xContext uno context for instantiation of services
- */
- BackendAccess( const uno::Reference<backenduno::XBackend>& xBackend,
- const uno::Reference<uno::XComponentContext>& xContext) ;
- /** Destructor */
- ~BackendAccess(void) ;
-
- // IMergedDataProvider
- virtual ResultHolder< ComponentInstance > getNodeData(const ComponentRequest& aRequest,
- ITemplateDataProvider* aTemplateProvider,
- INodeDataListener *aListener = NULL)
- SAL_THROW((com::sun::star::uno::Exception)) ;
- virtual void removeRequestListener(INodeDataListener *aListener,
- const ComponentRequest& aRequest)
- SAL_THROW(());
- virtual void updateNodeData(const UpdateRequest& aUpdate)
- SAL_THROW((com::sun::star::uno::Exception)) ;
- virtual ResultHolder< NodeInstance > getDefaultData(const NodeRequest& aRequest)
- SAL_THROW((com::sun::star::uno::Exception)) ;
- virtual ResultHolder< TemplateInstance > getTemplateData(const TemplateRequest& aRequest)
- SAL_THROW((com::sun::star::uno::Exception)) ;
-
- private :
-
- /**
- Retrieves the schema of a component.
- */
- uno::Reference< backenduno::XSchema > getSchema(const rtl::OUString& aComponent) ;
-
- /**
- Retrieves the schema version of a component.
- */
- rtl::OUString getSchemaVersion(const rtl::OUString& aComponent) ;
-
- /**
- Retrieves the layers for a request.
- */
- uno::Sequence< uno::Reference<backenduno::XLayer> > getLayers(const rtl::OUString& aComponent,const RequestOptions& aOptions) ;
-
- /**
- Reads merged default data with a given number of layers.
- */
- bool readDefaultData( MergedComponentData & aComponentData,
- rtl::OUString const & aComponent,
- RequestOptions const & aOptions,
- bool bIncludeTemplates,
- const uno::Reference<backenduno::XLayer> * pLayers,
- sal_Int32 nNumLayers,
- ITemplateDataProvider *aTemplateProvider,
- sal_Int32 * pLayersMerged = 0)
- SAL_THROW((com::sun::star::uno::Exception));
- /**
- Merges layers onto component data.
- */
- void merge(
- MergedComponentData& aData,
- const uno::Reference<backenduno::XLayer> * pLayers,
- sal_Int32 aNumLayers,
- com::sun::star::lang::Locale const & aRequestedLocale,
- std::vector< com::sun::star::lang::Locale > & inoutMergedLocales,
- ITemplateDataProvider *aTemplateProvider,
- sal_Int32 * pLayersMerged = 0)
- SAL_THROW((com::sun::star::uno::Exception));
- private :
- /**
- Decides if merging should be retried after an exception.
-
- @throws com::sun::star::uno::Exception
- if not approved
- */
- bool approveRecovery(
- const uno::Any & aMergeException,
- const uno::Reference<backenduno::XLayer> & aBrokenLayer,
- bool bUserLayerData)
- SAL_THROW((com::sun::star::uno::Exception));
-
- private :
- /** Get the factory used for service invocation */
- uno::Reference<lang::XMultiServiceFactory> getServiceFactory() const;
- /** UNO context to which this backend belongs */
- uno::Reference<uno::XComponentContext> mContext ;
- /** Backend being accessed */
- uno::Reference<backenduno::XBackend> mBackend ;
- /** Binary cache of default data */
- BinaryCache mBinaryCache;
- /** Manages Nofification from the Backends */
- uno::Reference<backenduno::XBackendChangesListener> mXNotifier;
-
- BackendChangeNotifier * mNotifier;
-
-} ;
-
-} } // configmgr.backend
-
-#endif // CONFIGMGR_BACKEND_BACKENDACCESS_HXX_
diff --git a/configmgr/source/backend/backendfactory.cxx b/configmgr/source/backend/backendfactory.cxx
deleted file mode 100644
index 60a6c0cb6f..0000000000
--- a/configmgr/source/backend/backendfactory.cxx
+++ /dev/null
@@ -1,329 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "backendfactory.hxx"
-
-#ifndef CONFIGMGR_API_FACTORY_HXX_
-#include "confapifactory.hxx"
-#endif
-#include "bootstrapcontext.hxx"
-#include "bootstrap.hxx"
-#include "backendaccess.hxx"
-#include "serviceinfohelper.hxx"
-#include "wrapexception.hxx"
-
-
-#include <com/sun/star/configuration/CannotLoadConfigurationException.hpp>
-#include <com/sun/star/configuration/backend/XBackend.hpp>
-#include <com/sun/star/configuration/backend/XMultiLayerStratum.hpp>
-
-namespace configmgr
-{
-// -------------------------------------------------------------------------
- namespace backend
- {
-// -------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace backenduno = ::com::sun::star::configuration::backend;
-// -------------------------------------------------------------------------
-const sal_Char k_DefaultBackendWrapper[] = "com.sun.star.comp.configuration.backend.SingleBackendAdapter";
-const sal_Char k_DefaultBackendService[] = "com.sun.star.comp.configuration.backend.LocalSingleBackend";
-
-// -------------------------------------------------------------------------
-const sal_Char k_DefaultBackendServiceAndImplName[] = K_DefaultBackendServiceAndImplName ;
-
-// -------------------------------------------------------------------------
-const sal_Char k_GenericBackendServiceAndImplName[] = "com.sun.star.configuration.backend.Backend" ;
-
-// -------------------------------------------------------------------------
-static sal_Char const * const k_BackendServiceNames [] =
-{
- k_DefaultBackendServiceAndImplName,
- k_GenericBackendServiceAndImplName,
- 0
-};
-// -------------------------------------------------------------------------
-static const ServiceRegistrationInfo k_DefaultBackendServiceInfo =
-{
- k_DefaultBackendServiceAndImplName,
- k_BackendServiceNames
-};
-// -------------------------------------------------------------------------
-static const ServiceRegistrationInfo k_GenericBackendServiceInfo =
-{
- k_GenericBackendServiceAndImplName,
- k_BackendServiceNames + 1
-};
-// -------------------------------------------------------------------------
-static const SingletonRegistrationInfo k_DefaultBackendSingletonInfo =
-{
- K_DefaultBackendSingletonName,
- k_DefaultBackendServiceAndImplName,
- k_DefaultBackendServiceAndImplName,
- & k_GenericBackendServiceInfo
-};
-// -------------------------------------------------------------------------
-// -------------------------------------------------------------------------
-const SingletonRegistrationInfo * getDefaultBackendSingletonInfo()
-{
- return & k_DefaultBackendSingletonInfo;
-}
-// -------------------------------------------------------------------------
-
-const ServiceRegistrationInfo * getDefaultBackendServiceInfo()
-{
- return & k_DefaultBackendServiceInfo;
-}
-// -------------------------------------------------------------------------
-// -------------------------------------------------------------------------
-
-uno::Reference<uno::XInterface> SAL_CALL
- getDefaultBackendSingleton( com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > const& xContext )
-{
- OSL_ENSURE( xContext.is(), "ERROR: NULL context has no singletons" );
-
- UnoContextTunnel aTunnel;
- aTunnel.passthru( xContext );
-
- uno::Reference<uno::XInterface> xResult;
-
- if (xContext.is())
- try
- {
- xContext->getValueByName(SINGLETON(K_DefaultBackendSingletonName))
- >>= xResult;
- }
- catch (uno::Exception & )
- {
- // to do: really use the tunneled failure when that is set properly
- if ( aTunnel.recoverFailure(true).hasValue() )
- {
- // have a failure, but can't recover it
- // -> try to regenerate
- instantiateDefaultBackend(xContext);
-
- OSL_ENSURE(false, "Cannot recreate configuration backend instantiation failure - using generic error");
- }
- // cannot recover any failure
- throw;
- }
-
- return xResult;
-}
-// -------------------------------------------------------------------------
-
-// -------------------------------------------------------------------------
-// -------------------------------------------------------------------------
-
-static
-uno::Sequence< uno::Any > createInitArgs(ContextReader const & _aContext)
-{
- OSL_ASSERT(_aContext.hasBootstrapContext());
- uno::Sequence< uno::Any > aResult( 1 );
- aResult[0] <<= _aContext.getBootstrapContext();
- return aResult;
-}
-// -------------------------------------------------------------------------
-
-static
-inline
-uno::Reference< uno::XInterface > createService(ContextReader const & _aCtx, uno::Sequence< uno::Any > const & _aInitArgs, rtl::OUString const & _aSvc)
-{
- uno::Reference< lang::XMultiComponentFactory > xFactory = _aCtx.getServiceManager();
- OSL_ENSURE(xFactory.is(),"ERROR: ComponentContext has no service manager\n");
- if (!xFactory.is()) throw uno::RuntimeException( rtl::OUString::createFromAscii("ERROR: ComponentContext has no service manager\n"), NULL );
- return xFactory->createInstanceWithArgumentsAndContext( _aSvc, _aInitArgs, _aCtx.getBaseContext());
-}
-// -------------------------------------------------------------------------
-
-static
-uno::Reference< backenduno::XBackend > wrapSingleBackend(ContextReader const & _aSettings, uno::Sequence< uno::Any > const & _aInitArgs, uno::Reference< backenduno::XMultiLayerStratum > const & _xWrappedBackend)
-{
- OSL_ASSERT(_aSettings.hasUnoBackendWrapper() || _aSettings.hasBootstrapContext());
-
- rtl::OUString aWrapperSvc = _aSettings.hasUnoBackendWrapper() ?
- _aSettings.getUnoBackendWrapper() :
- rtl::OUString::createFromAscii(k_DefaultBackendWrapper);
-
- OSL_ENSURE (aWrapperSvc.getLength(), "ERROR: No wrapper service for wrapped configuration");
- OSL_ENSURE (_xWrappedBackend.is(), "ERROR: No backend to wrap for wrapped configuration");
-
- sal_Int32 const nBaseArgsCount = _aInitArgs.getLength();
- uno::Sequence< uno::Any > aExtendedArgs( _aInitArgs );
- aExtendedArgs.realloc( nBaseArgsCount + 1 );
- aExtendedArgs[nBaseArgsCount] <<= _xWrappedBackend;
-
- return uno::Reference< backenduno::XBackend >::query( createService(_aSettings,aExtendedArgs,aWrapperSvc) );
-}
-// -------------------------------------------------------------------------
-
-static
-uno::Reference< backenduno::XBackend > createOfflineBackend(ContextReader const & _aSettings, uno::Sequence< uno::Any > const & _aInitArgs)
-{
- OSL_ASSERT(_aSettings.hasUnoBackendWrapper() || _aSettings.hasBootstrapContext());
-
- uno::Reference< backenduno::XBackend > xResult;
- if ( _aSettings.hasUnoBackendWrapper() )
- {
- rtl::OUString const aWrapperSvc = _aSettings.getUnoBackendWrapper();
-
- xResult = uno::Reference< backenduno::XBackend >::query( createService(_aSettings,_aInitArgs,aWrapperSvc) );
- }
-
- return xResult;
-}
-// -------------------------------------------------------------------------
-
-static
-uno::Reference< uno::XInterface > createRealBackend(ContextReader const & _aSettings, uno::Sequence< uno::Any > const & _aInitArgs)
-{
- OSL_ASSERT(_aSettings.hasUnoBackendService() || _aSettings.hasBootstrapContext());
-
- rtl::OUString const aBackendServiceName = _aSettings.hasUnoBackendService() ?
- _aSettings.getUnoBackendService() :
- rtl::OUString::createFromAscii(k_DefaultBackendService);
-
- uno::Reference< uno::XInterface > xResult =
- createService(_aSettings,_aInitArgs,aBackendServiceName);
-
- return xResult;
-}
-// -------------------------------------------------------------------------
-
-static
-uno::Reference< backenduno::XBackend > createOnlineBackend(ContextReader const & _aSettings, uno::Sequence< uno::Any > const & _aInitArgs)
-{
- OSL_ENSURE( _aSettings.isUnoBackend(), "ERROR - BackendFactory: For legacy backends use createSessionBackend()");
-
- uno::Reference< backenduno::XBackend > xResult;
-
- uno::Reference< uno::XInterface > xRealBackend = createRealBackend(_aSettings,_aInitArgs);
-
- if (_aSettings.hasUnoBackendWrapper())
- {
- // try wrapping a single backend
- uno::Reference< backenduno::XMultiLayerStratum > xSingleRealBackend( xRealBackend, uno::UNO_QUERY);
- if (xSingleRealBackend.is())
- xResult = wrapSingleBackend(_aSettings,_aInitArgs,xSingleRealBackend);
-
- // if we don't have one, try using it as unwrapped backend
- else
- xResult.set(xRealBackend, uno::UNO_QUERY);
- }
- else
- {
- // look for a direct implementation of XBackend
- xResult.set(xRealBackend, uno::UNO_QUERY);
- if (!xResult.is())
- {
- // try the default wrapper if we only have a single backend
- uno::Reference< backenduno::XMultiLayerStratum > xSingleRealBackend( xRealBackend, uno::UNO_QUERY);
- if (xSingleRealBackend.is())
- xResult = wrapSingleBackend(_aSettings,_aInitArgs,xSingleRealBackend);
-
- else
- OSL_ENSURE( !xRealBackend.is(), "Configuration Backend implements no known backend interface" );
- }
- }
-
- return xResult;
-}
-// -------------------------------------------------------------------------
-
-static uno::Reference< backenduno::XBackend > createUnoBackend(com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > const& _xCtx)
-{
- ContextReader aSettings(_xCtx);
- OSL_ENSURE( aSettings.isUnoBackend(), "ERROR - BackendFactory: Legacy backends are not supported any more");
-
- uno::Sequence< uno::Any > aArguments = createInitArgs(aSettings);
-
- sal_Bool bOffline = aSettings.hasOfflineSetting() ? aSettings.getOfflineSetting() : !aSettings.hasUnoBackendService();
-
- uno::Reference< backenduno::XBackend > xResult;
-
- if (!bOffline)
- xResult = createOnlineBackend (aSettings,aArguments);
-
- if (!xResult.is())
- xResult = createOfflineBackend(aSettings,aArguments);
-
- return xResult;
-}
-// -------------------------------------------------------------------------
-// to do: tunnel and raise fully typed exception information (and use it in the get..Singleton wrappers)
- #define TUNNEL_ALL_EXCEPTIONS() \
- WRAP_CONFIGBACKEND_CREATION_EXCEPTIONS1( UnoContextTunnel::tunnelFailure, true )
-
-// -------------------------------------------------------------------------
-
-uno::Reference<uno::XInterface> SAL_CALL instantiateDefaultBackend( com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > const& xTargetContext )
-{
- com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > xContext = UnoContextTunnel::recoverContext(xTargetContext);
-
- try
- {
- return uno::Reference< uno::XInterface >( createUnoBackend(xContext), uno::UNO_QUERY );
- }
- TUNNEL_ALL_EXCEPTIONS()
-
- OSL_ASSERT(!"unreached");
- return NULL;
-}
-// -------------------------------------------------------------------------
-
-uno::Reference< backenduno::XBackend > BackendFactory::getUnoBackend()
-{
- return uno::Reference< backenduno::XBackend >::query( getDefaultBackendSingleton(m_xCtx) );
-}
-// -------------------------------------------------------------------------
-
-rtl::Reference<IMergedDataProvider> BackendFactory::createBackend()
-{
- rtl::Reference< IMergedDataProvider > xBackend;
-
- uno::Reference< backenduno::XBackend > xBackendService = this->getUnoBackend();
-
- if (xBackendService.is())
- xBackend = new BackendAccess(xBackendService, m_xCtx);
-
- return xBackend;
-}
-// -------------------------------------------------------------------------
-
-BackendFactory BackendFactory::instance(com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > const & _xCtx)
-{
- return BackendFactory(_xCtx);
-}
-
-//-----------------------------------------------------------------------------
- } // namespace
-//-----------------------------------------------------------------------------
-} // namespace
diff --git a/configmgr/source/backend/backendnotifier.cxx b/configmgr/source/backend/backendnotifier.cxx
deleted file mode 100644
index 365bd74af8..0000000000
--- a/configmgr/source/backend/backendnotifier.cxx
+++ /dev/null
@@ -1,195 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "backendnotifier.hxx"
-
-#ifndef INCLUDED_ALGORITHM
-#include <algorithm>
-#define INCLUDED_ALGORITHM
-#endif
-#include "configpath.hxx"
-
-namespace configmgr
-{
-// ---------------------------------------------------------------------------
- namespace backend
- {
-
-
-//----------------------------------------------------------------------------
-BackendChangeNotifier::BackendChangeNotifier(const uno::Reference<backenduno::XBackend>& _xBackend)
-: m_aMutex()
- ,m_aListeners()
- ,m_aBackend(_xBackend, uno::UNO_QUERY)
-{
-
-}
-// ---------------------------------------------------------------------------
-
-BackendChangeNotifier::~BackendChangeNotifier()
-{
- m_aListeners.clear();
-}
-// ---------------------------------------------------------------------------
-void SAL_CALL BackendChangeNotifier::componentDataChanged(const backenduno::ComponentChangeEvent& _aEvent)
- throw (::com::sun::star::uno::RuntimeException)
-{
- rtl::OUString aComponentName = _aEvent.Component;
- std::map<rtl::OUString, ComponentNotifier>::iterator aIter = m_aListeners.find(aComponentName);
- if(aIter != m_aListeners.end())
- {
- aIter->second.notifyListeners(aComponentName);
- }
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL BackendChangeNotifier::disposing( lang::EventObject const & /*rSource*/ )
-throw (uno::RuntimeException)
-{
- osl::MutexGuard aListGuard(m_aMutex);
- if (m_aBackend.is())
- {
- m_aBackend.clear();
- }
- m_aListeners.clear();
-}
-// -----------------------------------------------------------------------------
-void BackendChangeNotifier::addListener(INodeDataListener * _xListener, const ComponentRequest& _aRequest) SAL_THROW(())
-{
- osl::MutexGuard aListGuard(m_aMutex);
-
- OSL_PRECOND(_xListener, "ERROR: trying to register a NULL listener");
- ComponentListener aComponentListener(_xListener, _aRequest.getOptions());
-
- const rtl::OUString aComponentName = _aRequest.getComponentName();
-
- //Check if we have a Listener registered for that Component
- std::map<rtl::OUString, ComponentNotifier>::iterator aIter;
- aIter = m_aListeners.find(aComponentName);
- if (aIter == m_aListeners.end())
- {
- ComponentNotifier aComponentNotifier;
- aComponentNotifier.addListenerToList(aComponentListener);
- m_aListeners[aComponentName] = aComponentNotifier;
-
- //Now need to register Listener with MultiStratumBackend for that Component
- if (m_aBackend.is())
- {
- m_aBackend->addChangesListener(this, aComponentName);
- }
- }
- else
- {
- //Add Listener and Option to ComponentNotifier list
- aIter->second.addListenerToList(aComponentListener);
-
- }
-
-}
-// ---------------------------------------------------------------------------
-
-void BackendChangeNotifier::removeListener(INodeDataListener * _xListener, const ComponentRequest& _aRequest) SAL_THROW(())
-{
- osl::MutexGuard aListGuard(m_aMutex);
- OSL_PRECOND(!m_aListeners.empty(),
- "BackendChangeNotifier:Cannot Remove Listener, no Listeners Registered");
- OSL_PRECOND(_xListener, "ERROR: trying to remove a NULL listener");
-
- std::map<rtl::OUString, ComponentNotifier>::iterator aIter;
- rtl::OUString aComponentName = _aRequest.getComponentName();
-
- aIter = m_aListeners.find(aComponentName);
- if (aIter == m_aListeners.end())
- {
- OSL_TRACE("BackendChangeNotifier: removeListener: no listener registered for component %s",
- aComponentName.getStr());
- }
- else
- {
- ComponentListener aComponentListener(_xListener, _aRequest.getOptions());
- aIter->second.removeListenerFromList(aComponentListener);
- if (aIter->second.isListEmpty())
- {
- m_aListeners.erase(aIter);
- //Need all to de-register listeners from the lower layers
- if (m_aBackend.is())
- {
- m_aBackend->removeChangesListener(this, aComponentName);
- }
- }
- }
-
-}
-// ---------------------------------------------------------------------------
-ComponentNotifier::ComponentNotifier():m_aListenerList()
-{
-}
-// ---------------------------------------------------------------------------
-
-
-void ComponentNotifier::addListenerToList(const ComponentListener& _aListener)
-{
- m_aListenerList.push_back(_aListener);
- //REM TO REMOVE
- ComponentListener aListener = m_aListenerList.front();
-
-}
-// ---------------------------------------------------------------------------
-void ComponentNotifier::removeListenerFromList(const ComponentListener& _aListener)
-{
- OSL_PRECOND(!m_aListenerList.empty(),
- "ComponentNotifier:Cannot Remove Listener, no Listeners Registered");
-
- std::list<ComponentListener>::iterator aIter;
-
- //Remove first instance that matches in the list
- aIter = std::find(m_aListenerList.begin(), m_aListenerList.end(),_aListener);
- if(aIter != m_aListenerList.end())
- {
- m_aListenerList.erase(aIter);
- }
-}
-// ---------------------------------------------------------------------------
-void ComponentNotifier::notifyListeners(const rtl::OUString& _aComponent)
-{
-
- for( std::list<ComponentListener>::iterator aIter = m_aListenerList.begin();
- aIter != m_aListenerList.end(); aIter++)
- {
- ComponentRequest aRequest(_aComponent, (*aIter).m_aOptions);
-
- (*aIter).m_aListener->dataChanged(aRequest);
- }
-
-}
-// ---------------------------------------------------------------------------
- } // namespace backend
-
-// ---------------------------------------------------------------------------
-} // namespace configmgr
diff --git a/configmgr/source/backend/backendnotifier.hxx b/configmgr/source/backend/backendnotifier.hxx
deleted file mode 100644
index 45fc0ddbce..0000000000
--- a/configmgr/source/backend/backendnotifier.hxx
+++ /dev/null
@@ -1,120 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONFIGMGR_BACKEND_BACKENDNOTIFIER_HXX
-#define CONFIGMGR_BACKEND_BACKENDNOTIFIER_HXX
-
-#include "mergeddataprovider.hxx"
-#include <com/sun/star/configuration/backend/XBackend.hpp>
-#include <com/sun/star/configuration/backend/XBackendChangesNotifier.hpp>
-#include <osl/mutex.hxx>
-#include <cppuhelper/implbase1.hxx>
-
-#ifndef INCLUDED_MAP
-#include <map>
-#define INCLUDED_MAP
-#endif
-
-#ifndef INCLUDED_LIST
-#include <list>
-#define INCLUDED_LIST
-#endif
-
-
-namespace configmgr
-{
-// ---------------------------------------------------------------------------
- namespace backend
- {
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace backenduno = ::com::sun::star::configuration::backend;
-// ---------------------------------------------------------------------------
- struct ComponentListener
- {
- explicit
- ComponentListener(INodeDataListener * _xListener, RequestOptions _aOptions):
- m_aListener( _xListener),
- m_aOptions(_aOptions)
- {}
-
- bool operator==(const ComponentListener& _aListener)const
- {
- return ( (&m_aListener == &_aListener.m_aListener)&&
- (compareRequestOptions(m_aOptions, _aListener.m_aOptions)== 0) );
-
- }
- INodeDataListener * m_aListener;
- RequestOptions m_aOptions;
- };
-
- /** Class used to store ComponentListener(listener and options)
- */
- class ComponentNotifier
- {
- public:
- ComponentNotifier();
- void addListenerToList(const ComponentListener& _aListener);
- void removeListenerFromList(const ComponentListener& _aListener);
- bool isListEmpty(){ return m_aListenerList.empty();}
- void notifyListeners(const rtl::OUString& _aComponent);
- private:
- std::list<ComponentListener> m_aListenerList;
- };
- // ---------------------------------------------------------------------------
- /** Interface providing a multicasting service for changes in the backend
- */
- class BackendChangeNotifier :public cppu::WeakImplHelper1<backenduno::XBackendChangesListener>
- {
- public:
- BackendChangeNotifier(const uno::Reference<backenduno::XBackend>& _xBackend);
- ~BackendChangeNotifier();
-
- virtual void SAL_CALL componentDataChanged(const backenduno::ComponentChangeEvent& aEvent)
- throw (::com::sun::star::uno::RuntimeException);
-
- virtual void SAL_CALL disposing( lang::EventObject const & rSource )
- throw (uno::RuntimeException);
- // notification support.
- /// register a listener for observing changes to the cached data
- void addListener(INodeDataListener * _xListener, const ComponentRequest& _aRequest) SAL_THROW(());
- /// unregister a listener previously registered
- void removeListener(INodeDataListener * _xListener, const ComponentRequest& _aRequest) SAL_THROW(());
- private:
- osl::Mutex m_aMutex;
- std::map<rtl::OUString, ComponentNotifier> m_aListeners;
-
- /** Backend being accessed */
- uno::Reference<backenduno::XBackendChangesNotifier> m_aBackend ;
- };
-// ---------------------------------------------------------------------------
- } // namespace backend
-
-// ---------------------------------------------------------------------------
-} // namespace configmgr
-
-#endif
-
diff --git a/configmgr/source/backend/backendstratalistener.cxx b/configmgr/source/backend/backendstratalistener.cxx
deleted file mode 100644
index e81efe69b7..0000000000
--- a/configmgr/source/backend/backendstratalistener.cxx
+++ /dev/null
@@ -1,56 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include "backendstratalistener.hxx"
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
- // -----------------------------------------------------------------------------
- BackendStrataListener::BackendStrataListener(const MultiStratumBackend& aBackend)
- :mBackend(aBackend)
- {}
- BackendStrataListener:: ~BackendStrataListener(){}
-
- void SAL_CALL BackendStrataListener::componentDataChanged(const backenduno::ComponentChangeEvent& aEvent)
- throw (::com::sun::star::uno::RuntimeException)
- {
-
- mBackend.notifyListeners(aEvent);
-
- }
- // -----------------------------------------------------------------------------
- void SAL_CALL BackendStrataListener::disposing( lang::EventObject const & /*rSource*/ )
- throw (uno::RuntimeException)
- {
-
- }
- }
-}
diff --git a/configmgr/source/backend/backendstratalistener.hxx b/configmgr/source/backend/backendstratalistener.hxx
deleted file mode 100644
index 0b7be67c15..0000000000
--- a/configmgr/source/backend/backendstratalistener.hxx
+++ /dev/null
@@ -1,74 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONFIGMGR_BACKEND_BACKENDSTRATALISTENER_HXX
-#define CONFIGMGR_BACKEND_BACKENDSTRATALISTENER_HXX
-
-#include <com/sun/star/configuration/backend/XBackendChangesListener.hpp>
-#include <com/sun/star/configuration/backend/ComponentChangeEvent.hpp>
-#include "backendnotifier.hxx"
-#include <com/sun/star/configuration/backend/XBackend.hpp>
-#include "multistratumbackend.hxx"
-
-
-#include <cppuhelper/implbase1.hxx>
-
-#ifndef INCLUDED_MAP
-#include <map>
-#define INCLUDED_MAP
-#endif
-
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
- namespace backend
- {
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
-
- namespace backenduno = ::com::sun::star::configuration::backend;
- // --------------------------------------------------------------------------
- class BackendStrataListener: public cppu::WeakImplHelper1<backenduno::XBackendChangesListener>
- {
- public:
- BackendStrataListener(const MultiStratumBackend& aBackend);
- ~BackendStrataListener();
- virtual void SAL_CALL componentDataChanged(const backenduno::ComponentChangeEvent& aEvent)
- throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL disposing( lang::EventObject const & rSource )
- throw (uno::RuntimeException);
- private:
- const MultiStratumBackend& mBackend ;
-
- };
-
-
-
- }
- // -----------------------------------------------------------------------------
-}
-// -----------------------------------------------------------------------------
-#endif
diff --git a/configmgr/source/backend/basicimporthandler.cxx b/configmgr/source/backend/basicimporthandler.cxx
deleted file mode 100644
index 9177ef82f5..0000000000
--- a/configmgr/source/backend/basicimporthandler.cxx
+++ /dev/null
@@ -1,114 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "basicimporthandler.hxx"
-#include <com/sun/star/configuration/backend/ComponentChangeEvent.hpp>
-#include <com/sun/star/configuration/backend/XBackendChangesNotifier.hpp>
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
-
-BasicImportHandler::BasicImportHandler(
- uno::Reference< backenduno::XBackend > const & xBackend,rtl::OUString const & aEntity, const sal_Bool& bNotify)
-: m_bSendNotification(bNotify)
-, m_xBackend(xBackend)
-, m_aComponentName()
-, m_aEntity(aEntity)
-{
- OSL_ENSURE( m_xBackend.is(), "Creating an import handler without a target backend" );
-}
-// -----------------------------------------------------------------------------
-
-BasicImportHandler::~BasicImportHandler()
-{
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- BasicImportHandler::startLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- m_aComponentName = rtl::OUString();
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- BasicImportHandler::endLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if ( m_bSendNotification)
- {
- backenduno::ComponentChangeEvent aEvent;
- aEvent.Source=*this;
- aEvent.Component = m_aComponentName;
-
- uno::Reference<backenduno::XBackendChangesListener> xListener(m_xBackend, uno::UNO_QUERY);
- if( xListener.is())
- {
- xListener->componentDataChanged(aEvent);
- }
- else
- {
- OSL_ENSURE(false, "ImportMergeHandler: target backend does not support notifications");
- }
- }
- m_aComponentName = rtl::OUString();
-}
-// -----------------------------------------------------------------------------
-
-bool BasicImportHandler::startComponent( const rtl::OUString& aName )
-{
- if (hasComponent()) return false;
-
- m_aComponentName = aName;
- return true;
-}
-// -----------------------------------------------------------------------------
-
-void BasicImportHandler::raiseMalformedDataException(sal_Char const * pMsg)
-{
- rtl::OUString sMsg = rtl::OUString::createFromAscii(pMsg);
-
- throw backenduno::MalformedDataException(sMsg, *this, uno::Any());
-}
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace
-
-// -----------------------------------------------------------------------------
-} // namespace
-
diff --git a/configmgr/source/backend/basicimporthandler.hxx b/configmgr/source/backend/basicimporthandler.hxx
deleted file mode 100644
index 56796dfdfd..0000000000
--- a/configmgr/source/backend/basicimporthandler.hxx
+++ /dev/null
@@ -1,96 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_BASICIMPORTHANDLER_HXX
-#define CONFIGMGR_BACKEND_BASICIMPORTHANDLER_HXX
-
-#include <cppuhelper/implbase1.hxx>
-#include <com/sun/star/configuration/backend/XLayerHandler.hpp>
-#include <com/sun/star/configuration/backend/XBackend.hpp>
-
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace backenduno = ::com::sun::star::configuration::backend;
-// -----------------------------------------------------------------------------
-
- class BasicImportHandler : public cppu::WeakImplHelper1< backenduno::XLayerHandler >
- {
- public:
- explicit
- BasicImportHandler(){}
-
- BasicImportHandler(uno::Reference< backenduno::XBackend > const & xBackend,rtl::OUString const & aEntity = rtl::OUString(), const sal_Bool& bNofity= sal_False);
- ~BasicImportHandler();
-
- // XLayerHandler subset - call these implementations from your derived class implementations
- protected:
- virtual void SAL_CALL
- startLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- protected:
- bool hasComponent() const { return m_aComponentName.getLength() != 0; }
- bool hasEntity() const { return m_aEntity.getLength() != 0; }
-
- rtl::OUString getComponent() const { return m_aComponentName; }
- rtl::OUString getEntity() const { return m_aEntity; }
- uno::Reference< backenduno::XBackend > getBackend() const { return m_xBackend; }
-
- bool startComponent( const rtl::OUString& aName );
-
- void raiseMalformedDataException(sal_Char const * pMsg);
- /** If True, notification should be send to backend
- */
- sal_Bool m_bSendNotification;
- private:
- uno::Reference< backenduno::XBackend > const m_xBackend;
- rtl::OUString m_aComponentName;
- rtl::OUString const m_aEntity;
-
- };
-// -----------------------------------------------------------------------------
- } // namespace xml
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/backend/basicupdatemerger.cxx b/configmgr/source/backend/basicupdatemerger.cxx
deleted file mode 100644
index f023ed885f..0000000000
--- a/configmgr/source/backend/basicupdatemerger.cxx
+++ /dev/null
@@ -1,338 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "basicupdatemerger.hxx"
-#include "layerdefaultremover.hxx"
-
-#ifndef INCLUDED_ALGORITHM
-#include <algorithm>
-#define INCLUDED_ALGORITHM
-#endif
-#ifndef INCLUDED_ITERATOR
-#include <iterator>
-#define INCLUDED_ITERATOR
-#endif
-
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
-
-BasicUpdateMerger::BasicUpdateMerger( uno::Reference< backenduno::XLayer > const & _xSourceLayer )
-: m_xSourceLayer(_xSourceLayer)
-, m_xResultHandler()
-, m_nNesting(0)
-, m_bSkipping(false)
-{
-}
-// -----------------------------------------------------------------------------
-
-BasicUpdateMerger::~BasicUpdateMerger()
-{
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateMerger::readData( uno::Reference< backenduno::XLayerHandler > const & _xResultHandler )
- throw ( backenduno::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- if (!_xResultHandler.is())
- {
- rtl::OUString sMsg( RTL_CONSTASCII_USTRINGPARAM("UpdateMerger: Error - NULL output handler unexpected") );
- throw lang::NullPointerException(sMsg,*this);
- }
- if (!m_xSourceLayer.is())
- {
- rtl::OUString sMsg( RTL_CONSTASCII_USTRINGPARAM("UpdateMerger: Error - No source layer set") );
- throw lang::NullPointerException(sMsg,*this);
- }
-
- try
- {
- m_xResultHandler = new LayerDefaultRemover(_xResultHandler);
- m_xSourceLayer->readData( this );
- }
- catch (uno::Exception & )
- {
- m_xResultHandler.clear();
- throw;
- }
-
- m_xResultHandler.clear();
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateMerger::startLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (m_nNesting)
- raiseMalformedDataException("UpdateMerger: Cannot start layer - layer already in progress");
-
- m_bSkipping = false;
-
- m_xResultHandler->startLayer();
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateMerger::endLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (m_nNesting > 0)
- raiseMalformedDataException("UpdateMerger: Cannot end layer - data handling still in progress");
-
- this->flushContext();
-
- m_xResultHandler->endLayer();
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateMerger::overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (!isSkipping())
- m_xResultHandler->overrideNode(aName, aAttributes, bClear);
-
- pushLevel(aName);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateMerger::addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (!isSkipping())
- m_xResultHandler->addOrReplaceNode(aName, aAttributes);
-
- pushLevel(aName);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateMerger::addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (!isSkipping())
- m_xResultHandler->addOrReplaceNodeFromTemplate(aName, aTemplate, aAttributes);
-
- pushLevel(aName);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateMerger::endNode( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (!isSkipping())
- m_xResultHandler->endNode();
-
- popLevel();
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateMerger::dropNode( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (!isSkipping())
- m_xResultHandler->dropNode(aName);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateMerger::overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (!isSkipping())
- m_xResultHandler->overrideProperty(aName, aAttributes, aType, bClear);
-
- pushLevel( rtl::OUString() ); // do not match context path to property names
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateMerger::endProperty( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (!isSkipping())
- m_xResultHandler->endProperty();
-
- popLevel();
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateMerger::setPropertyValue( const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (!isSkipping())
- m_xResultHandler->setPropertyValue(aValue);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateMerger::setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString & aLocale )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (!isSkipping())
- m_xResultHandler->setPropertyValueForLocale(aValue,aLocale);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateMerger::addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (!isSkipping())
- m_xResultHandler->addProperty(aName, aAttributes, aType);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL BasicUpdateMerger::addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (!isSkipping())
- m_xResultHandler->addPropertyWithValue(aName, aAttributes, aValue);
-}
-// -----------------------------------------------------------------------------
-
-void BasicUpdateMerger::raiseMalformedDataException(sal_Char const * pMsg)
-{
- rtl::OUString sMsg = rtl::OUString::createFromAscii(pMsg);
-
- throw backenduno::MalformedDataException(sMsg, *this, uno::Any());
-}
-// -----------------------------------------------------------------------------
-
-void BasicUpdateMerger::startSkipping()
-{
- OSL_PRECOND( m_nNesting == 0, "BasicUpdateMerger: starting to skip, while already forwarding data");
- m_nNesting = 1;
- m_bSkipping = true;
- OSL_POSTCOND( isHandling(), "BasicUpdateMerger: isHandling() is broken");
- OSL_POSTCOND( isSkipping(), "BasicUpdateMerger: isSkipping() is broken");
-}
-// -----------------------------------------------------------------------------
-
-
-void BasicUpdateMerger::pushLevel(rtl::OUString const & _aContext)
-{
- if (m_nNesting > 0)
- {
- ++m_nNesting;
- OSL_POSTCOND( isHandling(), "BasicUpdateMerger: level counting is broken" );
- }
- else if (m_nNesting < 0)
- {
- OSL_POSTCOND( isHandling(), "BasicUpdateMerger: level counting is broken" );
- }
- else if (m_aSearchPath.empty())
- {
- ++m_nNesting;
- OSL_POSTCOND( isHandling(), "BasicUpdateMerger: level counting is broken" );
- }
- else if ( m_aSearchPath.back().equals(_aContext) ) // search path is reverse - see findContext()
- {
- OSL_ENSURE( m_nNesting == 0, "BasicUpdateMerger: level count while searching must be zero");
-
- m_aSearchPath.pop_back();
- }
- else // start forwarding
- {
- m_nNesting = 1;
- OSL_POSTCOND( isHandling(), "BasicUpdateMerger: level counting is broken" );
- OSL_POSTCOND(!isSkipping(), "BasicUpdateMerger: skip flag set while searching " );
- }
-}
-// -----------------------------------------------------------------------------
-
-void BasicUpdateMerger::popLevel()
-{
- OSL_PRECOND( isHandling(), "BasicUpdateMerger: ending a node that wasn't handled here");
- if (m_nNesting > 0)
- {
- if (--m_nNesting == 0)
- m_bSkipping = false;
- }
- else if (m_nNesting == 0) // ending a context level, but the context is not yet gone
- {
- OSL_ENSURE( !m_aSearchPath.empty(), "BasicUpdateMerger: flushing a context that was already found");
- flushContext();
- leaveContext();
- }
- else
- {
- OSL_ENSURE( m_aSearchPath.empty(), "BasicUpdateMerger: Left an unfinished context" );
- }
-}
-// -----------------------------------------------------------------------------
-
-void BasicUpdateMerger::findContext(std::vector<rtl::OUString> const & _aContext)
-{
- // make the context a *reverse* copy of the context path
- OSL_PRECOND( ! isHandling(), "BasicUpdateMerger: starting context search while still handling data");
- m_aSearchPath.clear();
- m_aSearchPath.reserve(_aContext.size());
- std::copy( _aContext.rbegin(), _aContext.rend(), std::back_inserter(m_aSearchPath) );
-}
-// -----------------------------------------------------------------------------
-
-void BasicUpdateMerger::leaveContext()
-{
- OSL_PRECOND( !isHandling(), "BasicUpdateMerger: ending the context while still handling data or seaching the context");
-
- // force
- m_nNesting = -1;
-
- OSL_POSTCOND( ! isSkipping(), "BasicUpdateMerger: ending the context node while still skipping data");
- OSL_POSTCOND( isHandling(), "BasicUpdateMerger: cannot mark context as being handled to the end.");
-}
-// -----------------------------------------------------------------------------
-
-void BasicUpdateMerger::flushContext()
-{
- std::vector<rtl::OUString>::size_type nNesting = m_aSearchPath.size();
-
- while (!m_aSearchPath.empty())
- {
- m_xResultHandler->overrideNode(m_aSearchPath.back(), 0, false);
- m_aSearchPath.pop_back();
- }
- this->flushUpdate();
-
- while (nNesting > 0)
- {
- m_xResultHandler->endNode();
- --nNesting;
- }
-}
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace
-
-// -----------------------------------------------------------------------------
-} // namespace
-
diff --git a/configmgr/source/backend/basicupdatemerger.hxx b/configmgr/source/backend/basicupdatemerger.hxx
deleted file mode 100644
index 6a2b4caf82..0000000000
--- a/configmgr/source/backend/basicupdatemerger.hxx
+++ /dev/null
@@ -1,157 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_BASICUPDATEMERGER_HXX
-#define CONFIGMGR_BACKEND_BASICUPDATEMERGER_HXX
-
-#include <cppuhelper/implbase2.hxx>
-#include <com/sun/star/configuration/backend/XLayerHandler.hpp>
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace backenduno = ::com::sun::star::configuration::backend;
-// -----------------------------------------------------------------------------
-
- class BasicUpdateMerger : public cppu::WeakImplHelper2< backenduno::XLayerHandler, backenduno::XLayer >
- {
- public:
- explicit
- BasicUpdateMerger(uno::Reference< backenduno::XLayer > const & _xSourceLayer);
- ~BasicUpdateMerger();
-
- // XLayerHandler
- protected:
- virtual void SAL_CALL
- startLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endNode( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- dropNode( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endProperty( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- setPropertyValue( const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString & aLocale )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- // XLayer
- protected:
- virtual void SAL_CALL
- readData( const uno::Reference< backenduno::XLayerHandler >& aHandler )
- throw (backenduno::MalformedDataException, lang::NullPointerException, lang::WrappedTargetException, uno::RuntimeException);
-
- // new overrideable
- private:
- /// write the whole update to the output
- virtual void flushUpdate() = 0;
-
- protected:
- bool isHandling() const { return m_nNesting != 0 || !m_aSearchPath.empty(); }
- bool isSkipping() const { return m_bSkipping; }
- void startSkipping();
-
- void findContext(std::vector<rtl::OUString> const & _aContext);
- void leaveContext();
-
- uno::Reference< backenduno::XLayerHandler > getResultWriter() const { return m_xResultHandler; };
-
- void raiseMalformedDataException(sal_Char const * pMsg);
- private:
- void pushLevel(rtl::OUString const & _aLevel);
- void popLevel();
-
- void flushContext();
- private:
- uno::Reference< backenduno::XLayer > m_xSourceLayer;
- uno::Reference< backenduno::XLayerHandler > m_xResultHandler;
- std::vector<rtl::OUString> m_aSearchPath;
-
- sal_Int16 m_nNesting;
- bool m_bSkipping;
- };
-// -----------------------------------------------------------------------------
- } // namespace xml
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/backend/binarycache.cxx b/configmgr/source/backend/binarycache.cxx
deleted file mode 100644
index c1518392f7..0000000000
--- a/configmgr/source/backend/binarycache.cxx
+++ /dev/null
@@ -1,248 +0,0 @@
-/*************************************************************************
-*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
-************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "binarycache.hxx"
-
-#include "binaryreadhandler.hxx"
-#include "binarywritehandler.hxx"
-
-#include "mergedcomponentdata.hxx"
-#include "filehelper.hxx"
-#include "typeconverter.hxx"
-
-#ifndef _CONFIGMGR_BOOTSTRAP_HXX
-#include "bootstrap.hxx"
-#endif
-#include <osl/file.hxx>
-#include "tools/getprocessworkingdir.hxx"
-#include <rtl/ustrbuf.hxx>
-#include <rtl/logfile.hxx>
-
-#define RTL_LOGFILE_OU2A(rtlOUString) (::rtl::OUStringToOString((rtlOUString), RTL_TEXTENCODING_ASCII_US).getStr())
-
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
- namespace backend
- {
- const rtl::OUString aSettingName(
- RTL_CONSTASCII_USTRINGPARAM( CONTEXT_ITEM_PREFIX_ "CacheUrl"));
- // ---------------------------------------------------------------------------------------
- static inline bool isValidFileURL (rtl::OUString const& _sFileURL)
- {
- rtl::OUString sSystemPath;
- return _sFileURL.getLength() && (osl::File::E_None == osl::File::getSystemPathFromFileURL(_sFileURL, sSystemPath));
- }
- // -----------------------------------------------------------------------------
- // ---------------------------------------------------------------------------------------
- static
- bool implEnsureAbsoluteURL(rtl::OUString & _rsURL) // also strips embedded dots etc.
- {
- if (!_rsURL.getLength())
- return false;
-
- if (!isValidFileURL(_rsURL))
- {
- OSL_TRACE("Binary cache: File URL %s is invalid.",
- rtl::OUStringToOString(_rsURL,RTL_TEXTENCODING_ASCII_US).getStr());
- return false;
- }
-
- rtl::OUString sBasePath;
- OSL_VERIFY(tools::getProcessWorkingDir(&sBasePath));
-
- rtl::OUString sAbsolute;
- if ( osl::File::E_None == osl::File::getAbsoluteFileURL(sBasePath, _rsURL, sAbsolute))
- {
- _rsURL = sAbsolute;
- return isValidFileURL(_rsURL);
- }
- else
- {
- OSL_ENSURE(!isValidFileURL(_rsURL), "Could not get absolute file URL for valid URL");
- return false;
- }
- }
- // ---------------------------------------------------------------------------------------
- static const sal_Unicode kComponentSeparator = '.' ;
- static const sal_Unicode kPathSeparator = '/' ;
- static const char kBinarySuffix[] = ".dat" ;
-
- rtl::OUString BinaryCache::getCacheFileURL(const rtl::OUString& aComponent) const
- {
- rtl::OUStringBuffer retCode (mBaseURL);
- retCode.append(kPathSeparator) ;
- // retCode.append(aComponent.replace(kComponentSeparator, kPathSeparator)) ;
- retCode.append(aComponent) ;
- retCode.appendAscii(RTL_CONSTASCII_STRINGPARAM(kBinarySuffix));
-
- rtl::OUString aResult = retCode.makeStringAndClear() ;
-
- if (isValidFileURL(aResult))
- {
- return aResult;
- }
- else
- {
- OSL_ENSURE(false, "Component File URL is invalid");
- return rtl::OUString();
- }
- }
- // -----------------------------------------------------------------------------
- BinaryCache::BinaryCache(const uno::Reference<uno::XComponentContext>& xContext )
- : mBaseURL()
- , mOwnerEntity()
- , mbCacheEnabled(false)
- {
-
- //initialise the base URL
- ContextReader aReader(xContext);
-
- rtl::OUString sCacheUrl;
- if (!aReader.isAdminService())
- {
- mbCacheEnabled = (aReader.getBestContext()->getValueByName(aSettingName) >>= sCacheUrl)
- && implEnsureAbsoluteURL(sCacheUrl);
- }
-
- if (mbCacheEnabled)
- {
- mBaseURL = sCacheUrl;
- if (!FileHelper::dirExists(sCacheUrl))
- {
- osl::File::RC errorCode = FileHelper::mkdirs(sCacheUrl);
- if (errorCode)
- {
-#if (OSL_DEBUG_LEVEL > 0)
- rtl::OString sURL = rtl::OUStringToOString(sCacheUrl,RTL_TEXTENCODING_ASCII_US);
- rtl::OString sErr = rtl::OUStringToOString(FileHelper::createOSLErrorString(errorCode),RTL_TEXTENCODING_ASCII_US);
- ::osl_trace("Configuration: Cannot create cache directory \"%s\". "
- "Error is %s [%d]",sURL.getStr(),sErr.getStr(),int(errorCode)) ;
-#endif
- mbCacheEnabled = false;
- }
- }
- }
- }
- // -----------------------------------------------------------------------------
-
- void BinaryCache::setOwnerEntity(const rtl::OUString & aOwnerEntity)
- {
- OSL_PRECOND(mOwnerEntity.getLength() == 0, "Owner entity of cache already set");
- mOwnerEntity = aOwnerEntity;
- }
- // -----------------------------------------------------------------------------
-
- void BinaryCache::disableCache()
- {
- mbCacheEnabled = false;
- }
- // -----------------------------------------------------------------------------
-
- bool BinaryCache::isCacheEnabled(rtl::OUString const & aEntity) const
- {
- if (!mbCacheEnabled) return false;
-
- // default entity is empty
- if (aEntity.getLength() == 0) return true;
-
- return aEntity.equals(mOwnerEntity);
- }
- // -----------------------------------------------------------------------------
- bool BinaryCache::readComponentData(MergedComponentData & aComponentData,
- uno::Reference< lang::XMultiServiceFactory > const & aFactory,
- rtl::OUString const & aComponent,
- rtl::OUString const & aSchemaVersion,
- rtl::OUString const & aEntity,
- com::sun::star::lang::Locale const & aRequestedLocale,
- std::vector< com::sun::star::lang::Locale > & outKnownLocales,
- const uno::Reference<backenduno::XLayer> * pLayers,
- sal_Int32 nNumLayers,
- bool bIncludeTemplates)
- {
- if (isCacheEnabled(aEntity))
- try
- {
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::backend::BinaryCache", "jb99855", "configmgr: BinaryCache::readComponentData() - enabled");
- BinaryReadHandler aCacheReader(getCacheFileURL(aComponent),aComponent,aFactory);
-
- // #i49148# Invalidate cache when schema version changes - using former 'owner' parameter for version
- if(aCacheReader.validateHeader(pLayers, nNumLayers, aSchemaVersion, aRequestedLocale, outKnownLocales))
- {
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog1, "configmgr::backend::BinaryCache", "jb99855", "configmgr: BinaryCache::readComponentData() - cache hit");
- aComponentData.setSchemaRoot( aCacheReader.readComponentTree() );
- if (bIncludeTemplates)
- aComponentData.setTemplatesTree( aCacheReader.readTemplatesTree() );
- return true;
- }
- }
- catch (uno::Exception & e)
- {
- OSL_TRACE("Binary Cache read failed - exception: %s", rtl::OUStringToOString(e.Message,RTL_TEXTENCODING_ASCII_US).getStr());
- }
- return false;
- }
- // -----------------------------------------------------------------------------
-
- bool BinaryCache::writeComponentData(MergedComponentData const & aComponentData,
- uno::Reference< lang::XMultiServiceFactory > const & aFactory,
- rtl::OUString const & aComponent,
- rtl::OUString const & aSchemaVersion,
- rtl::OUString const & aEntity,
- std::vector< com::sun::star::lang::Locale > const & aKnownLocales,
- const uno::Reference<backenduno::XLayer> * pLayers,
- sal_Int32 nNumLayers)
- {
- if (isCacheEnabled(aEntity))
- try
- {
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog3, "configmgr::backend::BinaryCache", "jb99855", "configmgr: BinaryCache::writeComponentData() - enabled");
- BinaryWriteHandler aCacheWriter(getCacheFileURL(aComponent),aComponent, aFactory);
-
- //write data to cache
- // #i49148# Invalidate cache when schema version changes - using former 'owner' parameter for schema
- if (aCacheWriter.generateHeader(pLayers, nNumLayers, aSchemaVersion, aKnownLocales))
- {
- aCacheWriter.writeComponentTree(aComponentData.getSchemaTree());
- aCacheWriter.writeTemplatesTree(aComponentData.getTemplatesTree());
- return true;
- }
- }
- catch (uno::Exception & e)
- {
- OSL_TRACE("Configuration: Cache write failed - exception: %s", rtl::OUStringToOString(e.Message,RTL_TEXTENCODING_ASCII_US).getStr());
- }
- return false;
- }
- // -----------------------------------------------------------------------------
-
- }
-// -----------------------------------------------------------------------------
-}
diff --git a/configmgr/source/backend/binarycache.hxx b/configmgr/source/backend/binarycache.hxx
deleted file mode 100644
index 489fb8b038..0000000000
--- a/configmgr/source/backend/binarycache.hxx
+++ /dev/null
@@ -1,100 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONFIGMGR_BINARYCACHE_HXX
-#define CONFIGMGR_BINARYCACHE_HXX
-
-#include "matchlocale.hxx"
-
-#include <rtl/ustring.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
- namespace backend
- {
- namespace css = com::sun::star ;
- namespace uno = css::uno ;
- namespace lang = css::lang ;
- namespace backenduno = css::configuration::backend ;
-
- // -----------------------------------------------------------------------------
- class MergedComponentData;
-
- // -----------------------------------------------------------------------------
-
- class BinaryCache
- {
- public:
- explicit
- BinaryCache(const uno::Reference<uno::XComponentContext>& xContext);
-
- void setOwnerEntity(rtl::OUString const & aOwnerEntity);
- void disableCache();
-
- bool isCacheEnabled(rtl::OUString const & aEntity) const;
-
- rtl::OUString getCacheFileURL(rtl::OUString const & aComponent) const;
-
- bool readComponentData(MergedComponentData & aComponentData,
- uno::Reference< lang::XMultiServiceFactory > const & aFactory,
- rtl::OUString const & aComponent,
- rtl::OUString const & aSchemaVersion,
- rtl::OUString const & aEntity,
- com::sun::star::lang::Locale const & aRequestedLocale,
- std::vector< com::sun::star::lang::Locale > & outKnownLocales,
- const uno::Reference<backenduno::XLayer> * pLayers,
- sal_Int32 nNumLayers,
- bool bIncludeTemplates = true);
-
- bool writeComponentData(MergedComponentData const & aComponentData,
- uno::Reference< lang::XMultiServiceFactory > const & aFactory,
- rtl::OUString const & aComponent,
- rtl::OUString const & aSchemaVersion,
- rtl::OUString const & aEntity,
- std::vector< com::sun::star::lang::Locale > const & aKnownLocales,
- const uno::Reference<backenduno::XLayer> * pLayers,
- sal_Int32 nNumLayers);
- private:
- rtl::OUString mBaseURL;
- rtl::OUString mOwnerEntity;
- bool mbCacheEnabled;
- };
-
- // -----------------------------------------------------------------------------------
- // helper for cache reader implementations - see backendaccess.cxx for implementation
- uno::Sequence< rtl::OUString >
- getAvailableLocales(const uno::Reference<backenduno::XLayer> * pLayers, sal_Int32 nNumLayers);
- // -----------------------------------------------------------------------------------
- }
-// -----------------------------------------------------------------------------------
-}
-
-#endif //
-
diff --git a/configmgr/source/backend/binaryreader.cxx b/configmgr/source/backend/binaryreader.cxx
deleted file mode 100644
index 49ee735f5e..0000000000
--- a/configmgr/source/backend/binaryreader.cxx
+++ /dev/null
@@ -1,690 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
-************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "binaryreader.hxx"
-#include "binarytype.hxx"
-#include "valuenode.hxx"
-#include "filehelper.hxx"
-#include "oslstream.hxx"
-
-
-#include <com/sun/star/uno/Type.hxx>
-#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/io/IOException.hpp>
-#include <com/sun/star/io/XOutputStream.hpp>
-#include <com/sun/star/io/XActiveDataSource.hpp>
-#include <com/sun/star/io/XDataInputStream.hpp>
-#include <com/sun/star/io/XDataOutputStream.hpp>
-#include <com/sun/star/io/BufferSizeExceededException.hpp>
-#include <com/sun/star/io/UnexpectedEOFException.hpp>
-
-#include <cppuhelper/implbase1.hxx>
-#include <osl/file.hxx>
-
-#ifndef INCLUDED_ALGORITHM
-#include <algorithm>
-#define INCLUDED_ALGORITHM
-#endif
-#include "tracer.hxx"
-
-#define ASCII(x) rtl::OUString::createFromAscii(x)
-
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
- namespace backend
- {
- namespace uno = com::sun::star::uno;
- namespace io = com::sun::star::io;
-
-
- // --------------------------------------------------------------------------
-
- inline rtl::OUString ErrorToMessage_Impl (osl::FileBase::RC eError)
- {
- return FileHelper::createOSLErrorString (eError);
- }
-
- // --------------------------------------------------------------------------
-
- class BinaryReader_Impl :
- public cppu::WeakImplHelper1< com::sun::star::io::XDataInputStream >
- {
- public:
- /** Construction.
- */
- explicit BinaryReader_Impl (rtl::OUString const & rFileUrl)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- /** XInputStream.
- */
- virtual sal_Int32 SAL_CALL readBytes (
- uno::Sequence<sal_Int8> & rData, sal_Int32 nBytesToRead)
- throw (
- io::NotConnectedException,
- io::BufferSizeExceededException,
- io::IOException, uno::RuntimeException);
-
- virtual sal_Int32 SAL_CALL readSomeBytes (
- uno::Sequence<sal_Int8> & rData, sal_Int32 nBytesToRead)
- throw (
- io::NotConnectedException,
- io::BufferSizeExceededException,
- io::IOException, uno::RuntimeException);
-
- virtual void SAL_CALL skipBytes (sal_Int32 nBytesToSkip)
- throw (
- io::NotConnectedException,
- io::BufferSizeExceededException,
- io::IOException, uno::RuntimeException);
-
- virtual sal_Int32 SAL_CALL available()
- throw (
- io::NotConnectedException,
- io::IOException, uno::RuntimeException);
-
- virtual void SAL_CALL closeInput()
- throw (
- io::NotConnectedException,
- io::IOException, uno::RuntimeException);
-
-
- /** XDataInputStream.
- */
- virtual sal_Int8 SAL_CALL readBoolean()
- throw (
- io::IOException, uno::RuntimeException);
-
- virtual sal_Int8 SAL_CALL readByte()
- throw (
- io::IOException, uno::RuntimeException);
-
- virtual sal_Unicode SAL_CALL readChar()
- throw (
- io::IOException, uno::RuntimeException);
-
- virtual sal_Int16 SAL_CALL readShort()
- throw (
- io::IOException, uno::RuntimeException);
-
- virtual sal_Int32 SAL_CALL readLong()
- throw (
- io::IOException, uno::RuntimeException);
-
- virtual sal_Int64 SAL_CALL readHyper()
- throw (
- io::IOException, uno::RuntimeException);
-
- virtual float SAL_CALL readFloat()
- throw (
- io::IOException, uno::RuntimeException);
-
- virtual double SAL_CALL readDouble()
- throw (
- io::IOException, uno::RuntimeException);
-
- virtual rtl::OUString SAL_CALL readUTF()
- throw (
- io::IOException, uno::RuntimeException);
-
- protected:
- /** Destruction.
- */
- virtual ~BinaryReader_Impl();
-
- private:
- sal_uInt32 checkAvail(); // may throw NotConnectedException
- sal_uInt32 getMaxAvail(sal_Int32 nRequest); // may throw NotConnectedException, BufferSizeExceededException
- sal_uInt8 const * readBuffer(sal_uInt32 nRequired); // may throw NotConnectedException, UnexpectedEOFException
- private:
- /** Representation.
- */
- sal_uInt8 * m_pBuffer;
- sal_uInt32 m_nLength;
- sal_uInt32 m_nOffset;
-
- /** Not implemented.
- */
- BinaryReader_Impl (const BinaryReader_Impl&);
- BinaryReader_Impl& operator= (const BinaryReader_Impl&);
- };
-
- // --------------------------------------------------------------------------
- static inline void checkIOError(osl::File::RC errcode)
- {
- if (errcode != osl::FileBase::E_None)
- {
- throw io::IOException (ErrorToMessage_Impl (errcode), NULL);
- }
- }
- static void raiseBufferError()
- {
- rtl::OUString sMsg = rtl::OUString::createFromAscii("Cannot allocate Buffer: Too large");
- throw io:: BufferSizeExceededException(sMsg, NULL);
- }
- // -------------------------------------------------------------------------
- BinaryReader_Impl::BinaryReader_Impl (rtl::OUString const & rFileUrl)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- : m_pBuffer (0)
- , m_nLength (0)
- , m_nOffset (0)
- {
- osl::File aFile (rFileUrl);
-
- checkIOError( aFile.open (OpenFlag_Read) );
- sal_uInt64 nLength = 0;
- checkIOError( aFile.getSize (nLength) );
- if (nLength > 0xffffffff)
- raiseBufferError();
- m_nLength = sal_uInt32(nLength);
-
- sal_uInt8 *pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory (m_nLength));
- if (!pBuffer)
- raiseBufferError();
-
- sal_uInt64 nRead = 0;
- osl::File::RC result = aFile.read (pBuffer, nLength, nRead);
- if (result != osl::FileBase::E_None)
- {
- rtl_freeMemory (pBuffer);
- checkIOError( result );
- }
- if (nRead != nLength)
- {
- rtl_freeMemory (pBuffer);
- rtl::OUString sMsg = rtl::OUString::createFromAscii("BinaryCache - Could not read entire size of file: ");
- throw io::UnexpectedEOFException(sMsg.concat(rFileUrl),NULL);
- }
- m_pBuffer = pBuffer;
- }
-
- // --------------------------------------------------------------------------
-
- BinaryReader_Impl::~BinaryReader_Impl()
- {
- if (m_pBuffer) rtl_freeMemory (m_pBuffer);
- }
-
- // --------------------------------------------------------------------------
- // XInputStream implementation.
- // --------------------------------------------------------------------------
- sal_uInt32 BinaryReader_Impl::checkAvail ()
- {
- if (!m_pBuffer)
- {
- rtl::OUString sMsg = rtl::OUString::createFromAscii("BinaryCache - Stream is not open. No data available for reading.");
- throw io::NotConnectedException(sMsg,*this);
- }
- OSL_ASSERT(m_nLength >= m_nOffset);
- return m_nLength - m_nOffset;
- }
- // --------------------------------------------------------------------------
-
- sal_uInt32 BinaryReader_Impl::getMaxAvail (sal_Int32 nRequest)
- {
- if (nRequest < 0)
- {
- rtl::OUString sMsg = rtl::OUString::createFromAscii("BinaryCache - Invalid read request - negative byte count requested.");
- throw io::BufferSizeExceededException(sMsg,*this);
- }
- sal_uInt32 const uRequest = sal_uInt32(nRequest);
- sal_uInt32 const uAvail = checkAvail ();
- return std::min(uRequest,uAvail);
- }
- // --------------------------------------------------------------------------
-
- sal_uInt8 const * BinaryReader_Impl::readBuffer (sal_uInt32 nRequest)
- {
- sal_uInt32 const nAvail = checkAvail ();
- if (nRequest > nAvail)
- {
- rtl::OUString sMsg = rtl::OUString::createFromAscii("BinaryCache - Invalid file format - read past end-of-file.");
- throw io::UnexpectedEOFException(sMsg,*this);
- }
- sal_uInt8 const * pData = m_pBuffer + m_nOffset;
- m_nOffset += nRequest;
- return pData;
- }
- // --------------------------------------------------------------------------
-
- sal_Int32 SAL_CALL BinaryReader_Impl::readBytes (
- uno::Sequence<sal_Int8> & rData, sal_Int32 nBytesToRead)
- throw (
- io::NotConnectedException,
- io::BufferSizeExceededException,
- io::IOException, uno::RuntimeException)
- {
- sal_uInt32 nRead = getMaxAvail(nBytesToRead);
- if (nRead > 0)
- {
- rData.realloc (nRead);
- memcpy (rData.getArray(), readBuffer(nRead), nRead);
- }
- return sal_Int32(nRead);
- }
-
- // --------------------------------------------------------------------------
-
- sal_Int32 SAL_CALL BinaryReader_Impl::readSomeBytes (
- uno::Sequence<sal_Int8> & rData, sal_Int32 nBytesToRead)
- throw (
- io::NotConnectedException,
- io::BufferSizeExceededException,
- io::IOException, uno::RuntimeException)
- {
- return readBytes(rData,nBytesToRead);
- }
-
- // --------------------------------------------------------------------------
-
- void SAL_CALL BinaryReader_Impl::skipBytes (sal_Int32 nBytesToSkip)
- throw (
- io::NotConnectedException,
- io::BufferSizeExceededException,
- io::IOException, uno::RuntimeException)
- {
- (void) readBuffer(sal_uInt32(nBytesToSkip));
- }
-
- // --------------------------------------------------------------------------
-
- sal_Int32 SAL_CALL BinaryReader_Impl::available()
- throw (
- io::NotConnectedException,
- io::IOException, uno::RuntimeException)
- {
- const sal_uInt32 nMaxAvail = 0x7FFFFFFF;
- const sal_uInt32 nAvail = checkAvail();
- return sal_Int32(std::min(nAvail,nMaxAvail));
- }
-
- // --------------------------------------------------------------------------
-
- void SAL_CALL BinaryReader_Impl::closeInput()
- throw (
- io::NotConnectedException,
- io::IOException, uno::RuntimeException)
- {
- OSL_ENSURE(m_pBuffer,"BinaryCache - Closing stream that is already closed");
- if (m_pBuffer)
- {
- rtl_freeMemory (m_pBuffer);
- m_pBuffer = 0;
- }
- }
-
- // --------------------------------------------------------------------------
- // XDataInputStream implementation.
- // --------------------------------------------------------------------------
-
- sal_Int8 SAL_CALL BinaryReader_Impl::readBoolean()
- throw (io::IOException, uno::RuntimeException)
- {
- return this->readByte();
- }
-
- // --------------------------------------------------------------------------
-
- sal_Int8 SAL_CALL BinaryReader_Impl::readByte()
- throw (io::IOException, uno::RuntimeException)
- {
- sal_Int8 result = sal_Int8(*readBuffer(1));
-
- return result;
- }
-
- // --------------------------------------------------------------------------
-
- sal_Unicode SAL_CALL BinaryReader_Impl::readChar()
- throw (io::IOException, uno::RuntimeException)
- {
- sal_Unicode result;
-
- sal_uInt8 const * pData = readBuffer(sizeof result);
-
- result = sal_Unicode(
- (sal_uInt16(pData[0]) << 8) |
- (sal_uInt16(pData[1]) << 0) );
-
- return result;
- }
-
- // --------------------------------------------------------------------------
-
- sal_Int16 SAL_CALL BinaryReader_Impl::readShort()
- throw (io::IOException, uno::RuntimeException)
- {
- sal_Int16 result;
-
- sal_uInt8 const * pData = readBuffer(sizeof result);
-
- result = sal_Int16(
- (sal_uInt16(pData[0]) << 8) |
- (sal_uInt16(pData[1]) << 0) );
-
- return result;
- }
-
- // --------------------------------------------------------------------------
-
- sal_Int32 SAL_CALL BinaryReader_Impl::readLong()
- throw (io::IOException, uno::RuntimeException)
- {
- sal_Int32 result;
-
- sal_uInt8 const * pData = readBuffer(sizeof result);
-
- result = sal_Int32(
- (sal_uInt32(pData[0]) << 24) |
- (sal_uInt32(pData[1]) << 16) |
- (sal_uInt32(pData[2]) << 8) |
- (sal_uInt32(pData[3]) << 0) );
-
- return result;
- }
-
- // --------------------------------------------------------------------------
-
- sal_Int64 SAL_CALL BinaryReader_Impl::readHyper()
- throw (io::IOException, uno::RuntimeException)
- {
- sal_Int64 result;
-
- sal_uInt8 const * pData = readBuffer(sizeof result);
-
- result = sal_Int64(
- (sal_uInt64(pData[0]) << 56) |
- (sal_uInt64(pData[1]) << 48) |
- (sal_uInt64(pData[2]) << 40) |
- (sal_uInt64(pData[3]) << 32) |
- (sal_uInt64(pData[4]) << 24) |
- (sal_uInt64(pData[5]) << 16) |
- (sal_uInt64(pData[6]) << 8) |
- (sal_uInt64(pData[7]) << 0) );
-
- return result;
- }
-
- // --------------------------------------------------------------------------
-
- float SAL_CALL BinaryReader_Impl::readFloat()
- throw (io::IOException, uno::RuntimeException)
- {
- union { float f; sal_uInt32 n; } result;
-
- sal_uInt8 const * pData = readBuffer(sizeof result.n);
-
- result.n = sal_uInt32(
- (sal_uInt32(pData[0]) << 24) |
- (sal_uInt32(pData[1]) << 16) |
- (sal_uInt32(pData[2]) << 8) |
- (sal_uInt32(pData[3]) << 0) );
-
- return result.f;
- }
-
- // --------------------------------------------------------------------------
-
- double SAL_CALL BinaryReader_Impl::readDouble()
- throw (io::IOException, uno::RuntimeException)
- {
- union { double d; sal_uInt64 n; } result;
-
- sal_uInt8 const * pData = readBuffer(sizeof result.n);
-
- result.n = sal_uInt64(
- (sal_uInt64(pData[0]) << 56) |
- (sal_uInt64(pData[1]) << 48) |
- (sal_uInt64(pData[2]) << 40) |
- (sal_uInt64(pData[3]) << 32) |
- (sal_uInt64(pData[4]) << 24) |
- (sal_uInt64(pData[5]) << 16) |
- (sal_uInt64(pData[6]) << 8) |
- (sal_uInt64(pData[7]) << 0) );
-
- return result.d;
- }
-
- // --------------------------------------------------------------------------
-
- rtl::OUString SAL_CALL BinaryReader_Impl::readUTF()
- throw (io::IOException, uno::RuntimeException)
- {
- sal_uInt32 nLength;
-
- sal_uInt8 const * const pData = readBuffer(sizeof nLength);
-
- nLength = sal_uInt32(
- (sal_uInt32(pData[0]) << 24) |
- (sal_uInt32(pData[1]) << 16) |
- (sal_uInt32(pData[2]) << 8) |
- (sal_uInt32(pData[3]) << 0) );
-
- bool bIsAscii = (nLength & binary::STR_ASCII_MASK) == binary::STR_ASCII_MASK;
- nLength &=~binary::STR_ASCII_MASK;
-
- rtl::OUString result;
- if (nLength != 0)
- {
- sal_Char const * const pUTF = reinterpret_cast<sal_Char const * >(readBuffer(nLength));
-
- sal_Int32 const nStrLength = sal_Int32(nLength);
- OSL_ASSERT(nStrLength >= 0);
-
- rtl_TextEncoding const enc = bIsAscii ? RTL_TEXTENCODING_ASCII_US : RTL_TEXTENCODING_UTF8;
-
- rtl_uString_internConvert(&result.pData, pUTF, nStrLength, enc,
- OSTRING_TO_OUSTRING_CVTFLAGS, NULL);
- }
-
- return result;
- }
-
- // --------------------------------------------------------------------------
- // BinaryReader implementation.
- // --------------------------------------------------------------------------
-
- BinaryReader::BinaryReader(rtl::OUString const & _sFileURL):
- m_sFileURL(_sFileURL) {}
-
- BinaryReader::~BinaryReader() {}
-
- bool BinaryReader::open()
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- OSL_PRECOND(!m_xDataInputStream.is(),"Binary Reader: already open");
- if (m_xDataInputStream.is())
- return false;
-
- if (m_sFileURL.getLength() == 0)
- return false;
-
- if (!FileHelper::fileExists(m_sFileURL))
- return false;
-
- m_xDataInputStream.set(new BinaryReader_Impl (m_sFileURL));
- return true;
- }
-
- // --------------------------------------------------------------------------
-
- inline BinaryReader_Impl * BinaryReader::getDataInputStream()
- {
- OSL_ENSURE(m_xDataInputStream.is(),"Binary Cache: Reader was not opened - no input stream");
- return m_xDataInputStream.get();
- }
-
- // --------------------------------------------------------------------------
-
- void BinaryReader::read(sal_Bool &_bValue)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- _bValue = getDataInputStream()->readBoolean();
- }
-
- // --------------------------------------------------------------------------
-
- void BinaryReader::read(sal_Int8 &_nValue)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- _nValue = getDataInputStream()->readByte();
- }
-
- // --------------------------------------------------------------------------
-
- void BinaryReader::read(sal_Int16 &_nValue)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- _nValue = getDataInputStream()->readShort();
- }
-
- // --------------------------------------------------------------------------
-
- void BinaryReader::read(sal_Int32 &_nValue)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- _nValue = getDataInputStream()->readLong();
- }
-
- // --------------------------------------------------------------------------
-
- void BinaryReader::read(sal_Int64 &_nValue)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- _nValue = getDataInputStream()->readHyper();
- }
-
- // --------------------------------------------------------------------------
-
- void BinaryReader::read(double &_nValue)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- _nValue = getDataInputStream()->readDouble();
- }
-
- // --------------------------------------------------------------------------
-
- void BinaryReader::read(rtl::OUString& _aStr)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- _aStr = getDataInputStream()->readUTF();
- }
-
- // -----------------------------------------------------------------------------
- template <class Element>
- void readSequence(BinaryReader& _rReader, uno::Sequence< Element > & aSequence)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- // PRE: the Sequence must exist
- sal_Int32 nLength;
- _rReader.read(nLength);
-
- aSequence.realloc(nLength);
-
- Element* const pElement = aSequence.getArray(); // fill the hole array
- for(sal_Int32 i=0; i<nLength; ++i)
- {
- _rReader.read(pElement[i]); // read one element
- }
- }
-
- // --------------------------------------------------------------------------
-
- void BinaryReader::read (uno::Sequence< sal_Int8 > &_aValue)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- readSequence(*this, _aValue);
- }
-
- // --------------------------------------------------------------------------
-
- void BinaryReader::read (uno::Sequence< rtl::OUString > &_aValue)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- readSequence(*this, _aValue);
- }
-
- // --------------------------------------------------------------------------
-
- uno::Sequence< sal_Int8 > const * const for_binary = 0;
-
- #define CASE_READ_SEQUENCE(TYPE_CLASS, DATA_TYPE) \
- case TYPE_CLASS: \
- { \
- OSL_ENSURE( ::getCppuType(static_cast<DATA_TYPE const*>(0)).getTypeClass() == (TYPE_CLASS), "Typeclass does not match element type" ); \
- uno::Sequence< DATA_TYPE > aData; \
- readSequence(_rReader, aData); \
- _aValue <<= aData; \
- } break
-
- bool readSequenceValue (
- BinaryReader & _rReader,
- uno::Any & _aValue,
- uno::Type const & _aElementType)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- switch(_aElementType.getTypeClass())
- {
- CASE_READ_SEQUENCE( uno::TypeClass_BOOLEAN, sal_Bool );
-
- CASE_READ_SEQUENCE( uno::TypeClass_SHORT, sal_Int16 );
-
- CASE_READ_SEQUENCE( uno::TypeClass_LONG, sal_Int32 );
-
- CASE_READ_SEQUENCE( uno::TypeClass_HYPER, sal_Int64 );
-
- CASE_READ_SEQUENCE( uno::TypeClass_DOUBLE, double );
-
- CASE_READ_SEQUENCE( uno::TypeClass_STRING, rtl::OUString );
-
- case uno::TypeClass_SEQUENCE:
- if (_aElementType == ::getCppuType(for_binary))
- {
- uno::Sequence< sal_Int8 > aData;
- readSequence(_rReader, aData);
- _aValue <<= aData;
- break;
- }
- // else fall through
-
- default:
- OSL_ENSURE(false, "Unexpected type for sequence elements");
- return false;
- }
- return true;
- }
-
- #undef CASE_READ_SEQUENCE
-
- // --------------------------------------------------------------------------
-
-
- }
-}
diff --git a/configmgr/source/backend/binaryreader.hxx b/configmgr/source/backend/binaryreader.hxx
deleted file mode 100644
index eb672c1a9e..0000000000
--- a/configmgr/source/backend/binaryreader.hxx
+++ /dev/null
@@ -1,85 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONFIGMGR_BINARYREADER_HXX
-#define CONFIGMGR_BINARYREADER_HXX
-
-#include <rtl/ref.hxx>
-#include <rtl/ustring.hxx>
-#include <osl/file.hxx>
-#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/io/IOException.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
- namespace backend
- {
- namespace css = com::sun::star;
-
- namespace io = css::io;
- namespace uno = css::uno;
- namespace lang = css::lang;
- // -----------------------------------------------------------------------------
- class BinaryReader_Impl;
- class BinaryReader
- {
- rtl::OUString m_sFileURL;
-
- rtl::Reference<BinaryReader_Impl> m_xDataInputStream;
- public:
- explicit BinaryReader (rtl::OUString const & _sFileURL);
-
- ~BinaryReader();
-
- public:
- bool open() SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- void read(sal_Bool &_nValue) SAL_THROW( (io::IOException, uno::RuntimeException) );
- void read(sal_Int8 &_nValue) SAL_THROW( (io::IOException, uno::RuntimeException) );
- void read(sal_Int16 &_nValue) SAL_THROW( (io::IOException, uno::RuntimeException) );
- void read(sal_Int32 &_nValue) SAL_THROW( (io::IOException, uno::RuntimeException) );
- void read(sal_Int64 &_nValue) SAL_THROW( (io::IOException, uno::RuntimeException) );
- void read(double &_nValue) SAL_THROW( (io::IOException, uno::RuntimeException) );
- void read(rtl::OUString& _aStr) SAL_THROW( (io::IOException, uno::RuntimeException) );
- void read(uno::Sequence< sal_Int8 > &_aValue) SAL_THROW( (io::IOException, uno::RuntimeException) );
- void read(uno::Sequence< rtl::OUString > &_aValue) SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- private:
- inline BinaryReader_Impl * getDataInputStream();
- };
- // --------------------------------------------------------------------------
-
- bool readSequenceValue (
- BinaryReader & _rReader,
- uno::Any & _aValue,
- uno::Type const & _aElementType) SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- // --------------------------------------------------------------------------
- }
-}
-#endif
diff --git a/configmgr/source/backend/binaryreadhandler.cxx b/configmgr/source/backend/binaryreadhandler.cxx
deleted file mode 100644
index 6983b8671b..0000000000
--- a/configmgr/source/backend/binaryreadhandler.cxx
+++ /dev/null
@@ -1,687 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include "binaryreadhandler.hxx"
-#include "binarycache.hxx"
-#include "binarytype.hxx"
-#include "simpletypehelper.hxx"
-#include "typeconverter.hxx"
-#include "treenodefactory.hxx"
-
-#include "tracer.hxx"
-#include <com/sun/star/io/WrongFormatException.hpp>
-#include <com/sun/star/util/XTimeStamped.hpp>
-
-
-#define ASCII(x) rtl::OUString::createFromAscii(x)
-
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
- namespace backend
- {
-
- namespace css = com::sun::star;
- namespace io = css::io;
- namespace util = css::util;
-
- // -----------------------------------------------------------------------------
- BinaryReadHandler::BinaryReadHandler(rtl::OUString const & _aFileURL,
- rtl::OUString const & _aComponentName,
- uno::Reference<lang::XMultiServiceFactory> const & )
- : m_BinaryReader(_aFileURL)
- , m_aNodeFactory()
- , m_aComponentName(_aComponentName)
- {
- }
- // -----------------------------------------------------------------------------
- BinaryReadHandler::~BinaryReadHandler()
- {
- }
- // -----------------------------------------------------------------------------
-
- static inline
- bool isRequestingNoLocale(com::sun::star::lang::Locale const & aRequestedLocale)
- {
- rtl::OUString const & aLanguage = aRequestedLocale.Language;
- return aLanguage.getLength() == 0 || localehelper::isDefaultLanguage(aLanguage);
- }
- // -----------------------------------------------------------------------------
-
- static
- bool supportsLocale(uno::Sequence< rtl::OUString > const & aStoredLocales, rtl::OUString const & aRequestedLocale)
- {
- for (sal_Int32 ix=0; ix<aStoredLocales.getLength(); ++ix)
- if (aStoredLocales[ix].equalsIgnoreAsciiCase(aRequestedLocale))
- return true;
-
- return false;
- }
- // -----------------------------------------------------------------------------
-
- static
- bool supportsAll(uno::Sequence< rtl::OUString > const & aStoredLocales, uno::Sequence< rtl::OUString > const & aRequestedLocales)
- {
- for (sal_Int32 jx=0; jx<aRequestedLocales.getLength(); ++jx)
- if (!supportsLocale(aStoredLocales,aRequestedLocales[jx]))
- return false;
-
- return true;
- }
- // -----------------------------------------------------------------------------
-
- bool BinaryReadHandler::verifyFileHeader( const uno::Reference<backenduno::XLayer> * pLayers,
- sal_Int32 nNumLayers,
- const rtl::OUString& _aSchemaVersion,
- com::sun::star::lang::Locale const & aRequestedLocale,
- std::vector< com::sun::star::lang::Locale > & outKnownLocales)
- {
- try
- {
- //Open the reader
- sal_Int16 nMagic, nVersion;
- m_BinaryReader.read(nMagic);
- m_BinaryReader.read(nVersion);
- if (nMagic !=binary::CFG_BINARY_MAGIC || nVersion != binary::CFG_BINARY_VERSION )
- return false;
-
- rtl::OUString aSchemaVersion;
- m_BinaryReader.read(aSchemaVersion);
- if (!aSchemaVersion.equals(_aSchemaVersion))
- return false;
-
- uno::Sequence< rtl::OUString > aAvailableLocales;
- uno::Sequence< rtl::OUString > aKnownLocales;
- m_BinaryReader.read(aKnownLocales);
- m_BinaryReader.read(aAvailableLocales);
- outKnownLocales = localehelper::makeLocaleSequence(aKnownLocales);
-
- if (isRequestingNoLocale(aRequestedLocale))
- {
- // any existing combination of locales (including none) is valid
- }
- else if (!localehelper::designatesAllLocales(aRequestedLocale))
- {
- // one particular locale requested
- rtl::OUString const aIsoLocale = localehelper::makeIsoLocale(aRequestedLocale);
- if (!supportsLocale(aKnownLocales,aIsoLocale))
- {
- // a locale we didn't load previously
- return false;
- }
- else if (! supportsLocale(aAvailableLocales,aIsoLocale))
- {
- // a locale we handled by fallback previously
- uno::Sequence< rtl::OUString > aNewlyAvailableLocales =
- getAvailableLocales(pLayers,nNumLayers);
-
- // ... and that has become available now
- if (supportsLocale(aNewlyAvailableLocales,aIsoLocale))
- return false;
-
- // ... or other new locales have been added
- if (!supportsAll(aAvailableLocales,aNewlyAvailableLocales))
- return false;
- }
- }
- else
- {
- uno::Sequence< rtl::OUString > aNewlyAvailableLocales =
- getAvailableLocales(pLayers,nNumLayers);
-
- // not all locales were requested yet
- if (!supportsAll(aKnownLocales,aNewlyAvailableLocales))
- return false;
-
- // new locales have been added
- if (!supportsAll(aAvailableLocales,aNewlyAvailableLocales))
- return false;
- }
-
- rtl::OUString aComponentName;
- m_BinaryReader.read(aComponentName);
- if (!aComponentName.equals(m_aComponentName))
- return false;
-
- return true;
- }
- catch (uno::Exception &)
- {
- CFG_TRACE_INFO("Binary Cache can't be used");
- return false;
- }
- }
- // -----------------------------------------------------------------------------
- bool BinaryReadHandler::isUptodate(const std::vector<rtl::OUString> & _timeStamps)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- sal_Int32 nNumBinaryLayers;
- m_BinaryReader.read(nNumBinaryLayers);
- if (nNumBinaryLayers < 0 || sal_uInt32(nNumBinaryLayers) != _timeStamps.size())
- return false;
-
- for ( std::vector<rtl::OUString>::const_iterator it = _timeStamps.begin();
- it != _timeStamps.end();
- ++it)
- {
- rtl::OUString binaryTimeStamp;
- m_BinaryReader.read(binaryTimeStamp);
- if ( ! it->equals(binaryTimeStamp) )
- {
- return false;
- }
- }
-
- return true;
- }
- // -----------------------------------------------------------------------------
- binary::NodeType::Type BinaryReadHandler::readNodeType()
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- binary::NodeType::Type eType = binary::NodeType::invalid;
-
- sal_Int8 nValue;
- m_BinaryReader.read(nValue);
-
- sal_uInt8 const nRightValue( nValue );
- if ( (nRightValue & binary::NodeType::nodetype_mask) == nRightValue )
- eType = binary::NodeType::Type(nRightValue);
-
- if (eType == binary::NodeType::invalid)
- {
- OSL_ENSURE(false, "unknown or unhandled node type");
- throw io::WrongFormatException();
- }
-
- return eType;
- }
-
- // -----------------------------------------------------------------------------
- binary::ValueFlags::Type BinaryReadHandler::readValueFlags(bool& bSeq, bool& bHasValue, bool& bHasDefault )
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- sal_Int8 nValue;
- m_BinaryReader.read(nValue);
-
- sal_uInt8 const nRightValue( nValue );
- binary::ValueFlags::Type eType = binary::ValueFlags::Type(nRightValue & binary::ValueFlags::basictype_mask);
- if ( eType >= binary::ValueFlags::val_invalid)
- {
- OSL_ENSURE(false, "unknown or unhandled value type");
- throw io::WrongFormatException();
- }
-
-
- if (nRightValue & binary::ValueFlags::seq)
- bSeq = true;
- else
- bSeq = false;
-
- if (nRightValue & binary::ValueFlags::first_value_NULL)
- bHasValue = false;
- else
- bHasValue = true;
-
- if (nRightValue & binary::ValueFlags::second_value_NULL)
- bHasDefault = false;
- else
- bHasDefault = true;
-
- return eType;
- }
-
- // -----------------------------------------------------------------------------
-
- void BinaryReadHandler::readName(rtl::OUString &_aString)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- m_BinaryReader.read (_aString);
- }
-
- // -----------------------------------------------------------------------------
- void BinaryReadHandler::readAttributes(node::Attributes &_aAttributes)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- sal_Int8 nValue;
- m_BinaryReader.read(nValue);
-
- _aAttributes.setState( node::State(nValue & 0x03) );
-
- _aAttributes.setAccess( nValue & 0x04 ? true : false, nValue & 0x08 ? true : false);
-
- _aAttributes.setNullable(nValue & 0x10 ? true : false);
- _aAttributes.setLocalized(nValue & 0x20 ? true : false);
- if(nValue & 0x40 )
- {
- _aAttributes.markMandatory();
- }
- if(nValue & 0x80)
- {
- _aAttributes.markRemovable();
- }
- }
- // -----------------------------------------------------------------------------
-
- void BinaryReadHandler::readGroup(rtl::OUString &_aName, node::Attributes &_aAttributes)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- readAttributes(_aAttributes);
- readName(_aName);
- }
- // -----------------------------------------------------------------------------
- void BinaryReadHandler::readSet(rtl::OUString &_aName, node::Attributes &_aAttributes,
- rtl::OUString &_sInstanceName, rtl::OUString &_sInstanceModule)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- readAttributes(_aAttributes);
- readName(_aName);
- readName(_sInstanceName);
- readName(_sInstanceModule);
- }
-
- // -----------------------------------------------------------------------------
- template <class T>
- inline
- void readAsAny(BinaryReader& rBinaryReader, uno::Any & _aValue, uno::Type& _aType, T& _aVar)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- rBinaryReader.read(_aVar);
- _aValue <<= _aVar;
- _aType = _aValue.getValueType();
- }
-
- // -----------------------------------------------------------------------------
- uno::Type convertValueTypeToType(binary::ValueFlags::Type eBasicValueType, bool bSeq)
- {
- uno::Type aType;
-
- if (!bSeq)
- {
- switch(eBasicValueType)
- {
- // --------------- Simple types ---------------
-
- case binary::ValueFlags::val_boolean:
- aType = SimpleTypeHelper::getBooleanType();
- break;
- case binary::ValueFlags::val_int16:
- aType = SimpleTypeHelper::getShortType();
- break;
- case binary::ValueFlags::val_int32:
- aType = SimpleTypeHelper::getIntType();
- break;
- case binary::ValueFlags::val_int64:
- aType = SimpleTypeHelper::getLongType();
- break;
- case binary::ValueFlags::val_double:
- aType = SimpleTypeHelper::getDoubleType();
- break;
- case binary::ValueFlags::val_string:
- aType = SimpleTypeHelper::getStringType();
- break;
- case binary::ValueFlags::val_binary:
- aType = SimpleTypeHelper::getBinaryType();
- break;
- case binary::ValueFlags::val_any:
- aType = SimpleTypeHelper::getAnyType();
- break;
- default:
- OSL_ENSURE(false,"Invalid value type");
- break;
- }
- }
- else
- {
- // ------------ Sequences ------------
- switch(eBasicValueType)
- {
- case binary::ValueFlags::val_boolean:
- aType = ::getCppuType(static_cast<uno::Sequence<sal_Bool> const*>(0));
- break;
- case binary::ValueFlags::val_int16:
- aType = ::getCppuType(static_cast<uno::Sequence<sal_Int16> const*>(0));
- break;
- case binary::ValueFlags::val_int32:
- aType = ::getCppuType(static_cast<uno::Sequence<sal_Int32> const*>(0));
- break;
- case binary::ValueFlags::val_int64:
- aType = ::getCppuType(static_cast<uno::Sequence<sal_Int64> const*>(0));
- break;
- case binary::ValueFlags::val_double:
- aType = ::getCppuType(static_cast<uno::Sequence<double> const*>(0));
- break;
- case binary::ValueFlags::val_string:
- aType = ::getCppuType(static_cast<uno::Sequence<rtl::OUString> const*>(0));
- break;
- case binary::ValueFlags::val_binary:
- aType = ::getCppuType(static_cast<uno::Sequence< uno::Sequence< sal_Int8 > > const*>(0));
- break;
- default:
- OSL_ENSURE(false,"Invalid sequence value type");
- break;
- }
- }
-
- return aType;
- }
-
- // -----------------------------------------------------------------------------
- void BinaryReadHandler::readValue(rtl::OUString &_aName, node::Attributes &_aAttributes,
- uno::Any& _aValue, uno::Any& _aDefaultValue,uno::Type& _aType)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- bool bSeq = false;
- bool bHasValue = false;
- bool bHasDefault = false;
-
- binary::ValueFlags::Type eBasicType = readValueFlags(bSeq, bHasValue, bHasDefault);
- readAttributes(_aAttributes);
- readName(_aName);
-
- if (!bSeq && (bHasValue || bHasDefault))
- {
- switch(eBasicType)
- {
- case binary::ValueFlags::val_any:
- {
- OSL_ENSURE(false,"Node of type Any cannot have value");
- throw io::WrongFormatException();
- }
- case binary::ValueFlags::val_string:
- {
- rtl::OUString aStr;
- if (bHasValue)
- readAsAny(m_BinaryReader, _aValue, _aType, aStr);
- if (bHasDefault)
- readAsAny(m_BinaryReader, _aDefaultValue, _aType, aStr);
- break;
- }
- case binary::ValueFlags::val_boolean:
- {
- sal_Bool nValue;
- if (bHasValue)
- readAsAny(m_BinaryReader,_aValue, _aType, nValue);
- if (bHasDefault)
- readAsAny(m_BinaryReader,_aDefaultValue, _aType, nValue);
- break;
- }
- case binary::ValueFlags::val_int16:
- {
- sal_Int16 nValue;
- if (bHasValue)
- readAsAny(m_BinaryReader,_aValue, _aType, nValue);
- if (bHasDefault)
- readAsAny(m_BinaryReader,_aDefaultValue, _aType, nValue);
- break;
- }
- case binary::ValueFlags::val_int32:
- {
- sal_Int32 nValue;
- if (bHasValue)
- readAsAny(m_BinaryReader,_aValue, _aType, nValue);
- if (bHasDefault)
- readAsAny(m_BinaryReader,_aDefaultValue, _aType, nValue);
- break;
- }
- case binary::ValueFlags::val_int64:
- {
- sal_Int64 nValue;
- if (bHasValue)
- readAsAny(m_BinaryReader,_aValue, _aType, nValue);
- if (bHasDefault)
- readAsAny(m_BinaryReader,_aDefaultValue, _aType, nValue);
- break;
- }
- case binary::ValueFlags::val_double:
- {
- double nValue;
- if (bHasValue)
- readAsAny(m_BinaryReader,_aValue, _aType, nValue);
- if (bHasDefault)
- readAsAny(m_BinaryReader, _aDefaultValue, _aType, nValue);
- break;
- }
- case binary::ValueFlags::val_binary:
- {
- uno::Sequence< sal_Int8 > aValue;
- if (bHasValue)
- readAsAny(m_BinaryReader,_aValue, _aType, aValue);
- if (bHasDefault)
- readAsAny(m_BinaryReader,_aDefaultValue, _aType, aValue);
- break;
- }
- default:
- OSL_ENSURE(false, "Invalid value type");
- throw io::WrongFormatException();
- }
- }
- else
- {
- _aType = convertValueTypeToType(eBasicType, bSeq);
- if (_aType == uno::Type())
- throw io::WrongFormatException();
- }
-
- if(bSeq)
- {
- OSL_ASSERT(_aType.getTypeClass() == uno::TypeClass_SEQUENCE);
- uno::Type const aElementType = getSequenceElementType(_aType);
- if (bHasValue)
- readSequenceValue(m_BinaryReader, _aValue, aElementType );
-
- if(bHasDefault)
- readSequenceValue(m_BinaryReader, _aDefaultValue, aElementType );
- }
-
- }
- // -----------------------------------------------------------------------------
- std::auto_ptr<ISubtree> BinaryReadHandler::readComponentTree()
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- binary::NodeType::Type eType = this->readNodeType();
-
- if (eType != binary::NodeType::component)
- {
- // TODO: search for component tree
- OSL_ENSURE(false, "binary Cache: unexpected tree type for component data");
- throw io::WrongFormatException();
- }
-
- return readToplevelTree();
- }
- // -----------------------------------------------------------------------------
- std::auto_ptr<ISubtree> BinaryReadHandler::readTemplatesTree()
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- binary::NodeType::Type eType = this->readNodeType();
-
- if (eType != binary::NodeType::templates)
- {
- // TODO: search for templates tree
- OSL_ENSURE(false, "binary Cache: unexpected tree type for template data");
- throw io::WrongFormatException();
- }
-
- return readToplevelTree();
- }
- // -----------------------------------------------------------------------------
-
- std::auto_ptr<ISubtree> BinaryReadHandler::readToplevelTree()
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- std::auto_ptr<ISubtree> pTree;
-
- rtl::OUString aName;
- node::Attributes aAttributes;
- const bool not_extensible = false;
-
- binary::NodeType::Type eType = this->readNodeType();
- switch (eType)
- {
- case binary::NodeType::groupnode:
- {
- this->readGroup(aName, aAttributes);
- pTree = m_aNodeFactory.createGroup(aName,not_extensible,aAttributes);
- break;
- }
- case binary::NodeType::setnode:
- {
- backenduno::TemplateIdentifier aTemplate;
- this->readSet(aName, aAttributes,aTemplate.Name, aTemplate.Component);
- pTree = m_aNodeFactory.createSet(aName,aTemplate,not_extensible,aAttributes);
- break;
- }
- case binary::NodeType::nodata:
- break;
-
- default:
- OSL_ENSURE(false, "binary Cache - cannot read data: unexpected node type for tree");
- throw io::WrongFormatException();
-
- }
-
- if (pTree.get() != NULL)
- {
- readChildren(*pTree);
-
- //read terminating stop node
- eType = this->readNodeType();
- OSL_ENSURE(binary::NodeType::stop == eType, "Missing stop node to mark end of tree");
- }
- return pTree;
- }
-
-
- // -----------------------------------------------------------------------------
- bool BinaryReadHandler::validateHeader( const uno::Reference<backenduno::XLayer> * pLayers,
- sal_Int32 nNumLayers,
- const rtl::OUString& _aSchemaVersion,
- com::sun::star::lang::Locale const & aRequestedLocale,
- std::vector< com::sun::star::lang::Locale > & outKnownLocales)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
-
- //Check here if the file exists
- if (!m_BinaryReader.open())
- return false;
-
- if(!this->verifyFileHeader(pLayers, nNumLayers, _aSchemaVersion, aRequestedLocale, outKnownLocales))
- return false;
-
- //Check if layers are uptodate
- std::vector <rtl::OUString> timeStamps(nNumLayers);
- for (sal_Int32 i = 0 ; i < nNumLayers ; ++ i)
- {
- uno::Reference<util::XTimeStamped> xTimeStamp = uno::Reference<util::XTimeStamped>(pLayers[i], uno::UNO_QUERY);
- if (xTimeStamp.is())
- {
- rtl::OUString aTimeStamp = xTimeStamp->getTimestamp();
- timeStamps[i] = aTimeStamp;
- }
- }
-
- return this->isUptodate(timeStamps);
- }
- // -----------------------------------------------------------------------------
- void BinaryReadHandler::readChildren(ISubtree & rTree )
- {
- OSL_ASSERT(!binary::NodeType::stop); // loop stops at stop node
- while (binary::NodeType::Type eType = this->readNodeType())
- {
- rtl::OUString aName;
- node::Attributes aAttributes;
- const bool not_extensible = false;
- switch (eType)
- {
- case binary::NodeType::groupnode:
- {
- this->readGroup(aName, aAttributes);
-
- std::auto_ptr<ISubtree> pNewNode = m_aNodeFactory.createGroup(aName, not_extensible, aAttributes);
- if (pNewNode.get() == NULL)
- {
- OSL_ENSURE(false, "Error: factory returned NULL group node - skipping");
- continue;
- }
-
- readChildren( *pNewNode );
- rTree.addChild(base_ptr(pNewNode));
- break;
- }
- case binary::NodeType::setnode:
- {
- backenduno::TemplateIdentifier aTemplate;
- this->readSet(aName, aAttributes,aTemplate.Name, aTemplate.Component);
-
- std::auto_ptr<ISubtree> pNewSetNode = m_aNodeFactory.createSet(aName,aTemplate,not_extensible,aAttributes);
- if (pNewSetNode.get() == NULL)
- {
- OSL_ENSURE(false, "Error: factory returned NULL set node - skipping");
- continue;
- }
-
- readChildren( *pNewSetNode );
- rTree.addChild(base_ptr(pNewSetNode));
- break;
- }
- case binary::NodeType::valuenode:
- {
- uno::Any aValue;
- uno::Any aDefaultValue;
- uno::Type aType;
-
- this->readValue(aName, aAttributes, aValue, aDefaultValue, aType);
-
- OTreeNodeFactory & rValueFactory = m_aNodeFactory.getNodeFactory();
-
- std::auto_ptr<ValueNode> pValueNode;
- if (aValue.hasValue() || aDefaultValue.hasValue())
- {
- pValueNode = rValueFactory.createValueNode(aName,aValue, aDefaultValue, aAttributes);
- }
- else
- {
- pValueNode = rValueFactory.createNullValueNode(aName,aType, aAttributes);
- }
-
- rTree.addChild(base_ptr(pValueNode));
- break;
- }
- default:
- OSL_ENSURE(false, "Binary cache: Invalid node type");
- throw io::WrongFormatException();
- }
- }
- }
- // -----------------------------------------------------------------------------
-
- // -----------------------------------------------------------------------------
- }
- // -----------------------------------------------------------------------------
-}
diff --git a/configmgr/source/backend/binaryreadhandler.hxx b/configmgr/source/backend/binaryreadhandler.hxx
deleted file mode 100644
index 19c7b51418..0000000000
--- a/configmgr/source/backend/binaryreadhandler.hxx
+++ /dev/null
@@ -1,133 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONFIGMGR_BINARYREADHANDLER_HXX
-#define CONFIGMGR_BINARYREADHANDLER_HXX
-
-#include "binaryreader.hxx"
-#include "componentdatahelper.hxx"
-#include "valuenode.hxx"
-#include "binarytype.hxx"
-#include "attributes.hxx"
-#include "matchlocale.hxx"
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-#include <com/sun/star/io/IOException.hpp>
-
-#ifndef INCLUDED_MEMORY
-#include <memory>
-#define INCLUDED_MEMORY
-#endif // INCLUDED_MEMORY
-
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif // INCLUDED_VECTOR
-
-
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
- namespace backend
- {
- namespace css = com::sun::star;
-
- namespace io = css::io;
- namespace uno = css::uno;
- namespace backenduno = css::configuration::backend ;
-
- // -----------------------------------------------------------------------------
-
- class BinaryReadHandler
- {
- BinaryReader m_BinaryReader;
- ComponentDataFactory m_aNodeFactory;
- rtl::OUString m_aComponentName;
-
- public:
- BinaryReadHandler(rtl::OUString const & _aFileURL, rtl::OUString const & _aComponentName, uno::Reference<lang::XMultiServiceFactory> const & _aFactory);
- ~BinaryReadHandler();
-
- bool validateHeader( const uno::Reference<backenduno::XLayer> * pLayers,
- sal_Int32 nNumLayers,
- const rtl::OUString& _aSchemaVersion,
- com::sun::star::lang::Locale const & aRequestedLocale,
- std::vector< com::sun::star::lang::Locale > & outKnownLocales)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- std::auto_ptr<ISubtree> readComponentTree()
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- std::auto_ptr<ISubtree> readTemplatesTree()
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- private:
- std::auto_ptr<ISubtree> readToplevelTree()
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- void readChildren(ISubtree & rTree)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- private:
- bool verifyFileHeader( const uno::Reference<backenduno::XLayer> * pLayers,
- sal_Int32 nNumLayers,
- const rtl::OUString& _aSchemaVersion,
- com::sun::star::lang::Locale const & aRequestedLocale,
- std::vector< com::sun::star::lang::Locale > & outKnownLocales);
-
- bool isUptodate(const std::vector<rtl::OUString> & _timeStamps)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- void readChildNodes(ISubtree & rSubTree)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- binary::NodeType::Type readNodeType()
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- binary::ValueFlags::Type readValueFlags(bool& bSeq, bool& hasValue, bool& hasDefault )
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- void readAttributes(node::Attributes &_aAttributes)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- void readGroup(rtl::OUString &_aName, node::Attributes &_aAttributes)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- void readSet(rtl::OUString &_aName, node::Attributes &_aAttributes,
- rtl::OUString &_sInstanceName, rtl::OUString &_sInstanceModule)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- void readValue(rtl::OUString &_aName, node::Attributes &_aAttributes,
- uno::Any& _aValue, uno::Any& _aDefaultValue,uno::Type& _aType)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- void readName(rtl::OUString &_aString)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
- };
- // ---------------------------------------------------------------------------
- }
- // -----------------------------------------------------------------------------
-}// namespace configmgr
-#endif
diff --git a/configmgr/source/backend/binarytype.hxx b/configmgr/source/backend/binarytype.hxx
deleted file mode 100644
index 11e187a719..0000000000
--- a/configmgr/source/backend/binarytype.hxx
+++ /dev/null
@@ -1,61 +0,0 @@
-#ifndef CONFIGMGR_BINARYTYPE_HXX
-#define CONFIGMGR_BINARYTYPE_HXX
-
-#include <sal/types.h>
-
-namespace configmgr
-{
- namespace binary
- {
- const sal_uInt32 STR_ASCII_MASK = 0x80000000;
- const sal_Int16 CFG_BINARY_MAGIC = 10001;
- const sal_Int16 CFG_BINARY_VERSION = 3;
-
- namespace ValueFlags
- {
- enum Type
- {
- val_any, // = 0
- val_string, // = 1
- val_boolean, // = 2
- val_int16, // = 3
- val_int32, // = 4
- val_int64, // = 5
- val_double, // = 6
- val_binary, // = 7
- val_invalid, // = 8
-
- //Sequence Flag
- seq = 0x10,
-
- //Pairstate Flags
- first_value_NULL = 0x20,
- second_value_NULL = 0x40,
-
- //Masks
- basictype_mask = 0x0F,
- valuetype_mask = 0x1F,
- pairstate_mask = first_value_NULL | second_value_NULL
- };
- }
-
- namespace NodeType
- {
- enum Type
- {
- //Node Type Identifiers
- stop = 0,
- valuenode = 0x20,
- groupnode = 0x40,
- setnode = 0x80,
- component = 0x60,
- templates = 0xA0,
- nodata = 0xC0,
- invalid = 0xE0,
-
- nodetype_mask = 0xE0
- };
- }
- }
-}
-#endif
diff --git a/configmgr/source/backend/binarywritehandler.cxx b/configmgr/source/backend/binarywritehandler.cxx
deleted file mode 100644
index 84d26da919..0000000000
--- a/configmgr/source/backend/binarywritehandler.cxx
+++ /dev/null
@@ -1,489 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include "binarywritehandler.hxx"
-#include "binarycache.hxx"
-#include <com/sun/star/util/XTimeStamped.hpp>
-#include "typeconverter.hxx"
-#include "simpletypehelper.hxx"
-
-#define ASCII(x) rtl::OUString::createFromAscii(x)
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
- namespace backend
- {
-
- namespace css = com::sun::star;
- namespace util = css::util ;
-
- // -----------------------------------------------------------------------------
-
- BinaryWriteHandler::BinaryWriteHandler( rtl::OUString const & _aFileURL,
- rtl::OUString const & _aComponentName,
- uno::Reference<lang::XMultiServiceFactory> const & _aFactory)
- : m_BinaryWriter(_aFileURL,_aFactory)
- , m_aComponentName(_aComponentName)
- {
-
- }
- // -----------------------------------------------------------------------------
- static
- binary::ValueFlags::Type convertTypeToValueType(uno::Type const& _aType)
- {
- binary::ValueFlags::Type eType = binary::ValueFlags::val_invalid;
- uno::TypeClass const aClass = _aType.getTypeClass();
- switch(aClass)
- {
- case uno::TypeClass_ANY:
- eType = binary::ValueFlags::val_any;
- break;
- case uno::TypeClass_BOOLEAN:
- eType = binary::ValueFlags::val_boolean;
- break;
- case uno::TypeClass_SHORT:
- eType = binary::ValueFlags::val_int16;
- break;
- case uno::TypeClass_LONG:
- eType = binary::ValueFlags::val_int32;
- break;
- case uno::TypeClass_HYPER:
- eType = binary::ValueFlags::val_int64;
- break;
- case uno::TypeClass_DOUBLE:
- eType = binary::ValueFlags::val_double;
- break;
- case uno::TypeClass_STRING:
- eType = binary::ValueFlags::val_string;
- break;
- case uno::TypeClass_SEQUENCE:
- if (_aType == SimpleTypeHelper::getBinaryType())
- {
- eType = binary::ValueFlags::val_binary;
- }
- else
- {
- uno::Type aType = configmgr::getSequenceElementType(_aType);
- eType = convertTypeToValueType(aType);
-
- OSL_ENSURE(!(eType & binary::ValueFlags::seq), "Binary Writer - Invalid value type: Multiple nesting of sequences");
- eType = binary::ValueFlags::Type( eType | binary::ValueFlags::seq );
- }
- break;
- default:
- OSL_ENSURE(false, "Binary Writer - Invalid value type: not supported");
- break;
- }
- return eType;
- }
-
- // -----------------------------------------------------------------------------
- template <class T>
- inline /* make performance crew happy ;-) */
- void writeDirectly(BinaryWriter& _rWriter, T const& _aVal)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- _rWriter.write(_aVal);
- }
- // -----------------------------------------------------------------------------
- static
- inline
- void writeDirectly(BinaryWriter& _rWriter, uno::Sequence<sal_Int8> const& _aBinary);
- // -----------------------------------------------------------------------------
- template <class T>
- inline /* make performance crew happy ;-) */
- void writeFromAny(BinaryWriter& _rWriter,uno::Any const& _aValue, T& _aVar)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- OSL_VERIFY(_aValue >>= _aVar ); // "Invalid Any for value"
- writeDirectly(_rWriter,_aVar);
- }
- // -----------------------------------------------------------------------------
-
- template <class Element>
- void writeSequence(BinaryWriter& _rWriter, uno::Sequence< Element > const& aSequence)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- sal_Int32 const nLength = aSequence.getLength();
- _rWriter.write(nLength);
-
- for(sal_Int32 i=0; i<nLength; ++i)
- {
- writeDirectly(_rWriter, aSequence[i]);
- }
- }
- // -----------------------------------------------------------------------------
- static
- inline
- void writeDirectly(BinaryWriter& _rWriter, uno::Sequence<sal_Int8> const& _aBinary)
- {
- writeSequence(_rWriter,_aBinary);
- }
- // -----------------------------------------------------------------------------
- #define CASE_WRITE_SEQUENCE(TYPE_CLASS, DATA_TYPE) \
- case TYPE_CLASS: \
- { \
- uno::Sequence< DATA_TYPE > aData; \
- OSL_ASSERT( ::getCppuType(aData.getConstArray()).getTypeClass() == (TYPE_CLASS) ); \
- OSL_VERIFY( _aValue >>= aData ); \
- writeSequence(_rWriter,aData); \
- } break
-
- // -----------------------------------------------------------------------------
- static
- void writeSequenceValue(BinaryWriter& _rWriter, uno::Any const& _aValue, uno::Type const& aElementType)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- switch(aElementType.getTypeClass())
- {
- CASE_WRITE_SEQUENCE( uno::TypeClass_BOOLEAN, sal_Bool );
-
- CASE_WRITE_SEQUENCE( uno::TypeClass_SHORT, sal_Int16 );
-
- CASE_WRITE_SEQUENCE( uno::TypeClass_LONG, sal_Int32 );
-
- CASE_WRITE_SEQUENCE( uno::TypeClass_HYPER, sal_Int64 );
-
- CASE_WRITE_SEQUENCE( uno::TypeClass_DOUBLE, double );
-
- CASE_WRITE_SEQUENCE( uno::TypeClass_STRING, rtl::OUString );
-
- CASE_WRITE_SEQUENCE( uno::TypeClass_SEQUENCE, uno::Sequence<sal_Int8> );
-
- default:
- OSL_ENSURE(false, "Unexpected typeclass for sequence elements");
- break;
- }
- }
- #undef CASE_WRITE_SEQUENCE
-
- // -----------------------------------------------------------------------------
- static
- void writeSimpleValue(BinaryWriter& _rWriter, uno::Any const& _aValue, uno::Type const& _aType)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- // PRE: Header must be written
- uno::TypeClass aDestinationClass = _aType.getTypeClass();
- switch (aDestinationClass)
- {
- case uno::TypeClass_BOOLEAN:
- {
- sal_Bool bValue = sal_False;
- writeFromAny(_rWriter, _aValue, bValue);
- break;
- }
- case uno::TypeClass_BYTE:
- {
- sal_Int8 nValue = 0;
- writeFromAny(_rWriter, _aValue, nValue);
- break;
- }
- case uno::TypeClass_SHORT:
- {
- sal_Int16 nValue = 0;
- writeFromAny(_rWriter, _aValue, nValue);
- break;
- }
- case uno::TypeClass_LONG:
- {
- sal_Int32 nValue = 0;
- writeFromAny(_rWriter, _aValue, nValue);
- break;
- }
- case uno::TypeClass_HYPER:
- {
- sal_Int64 nValue = 0;
- writeFromAny(_rWriter, _aValue, nValue);
- break;
- }
- case uno::TypeClass_DOUBLE:
- {
- double nValue = 0;
- writeFromAny(_rWriter, _aValue, nValue);
- break;
- }
- case uno::TypeClass_STRING:
- {
- rtl::OUString aStr;
- writeFromAny(_rWriter, _aValue, aStr);
- break;
- }
- case uno::TypeClass_SEQUENCE:
- {
- OSL_ENSURE (_aType == SimpleTypeHelper::getBinaryType(),"Unexpected sequence as simple type");
- uno::Sequence<sal_Int8> aBinary;
- writeFromAny(_rWriter, _aValue, aBinary);
- break;
- }
- default:
- OSL_ENSURE(false, "Unexpected typeclass for simple value");
- break;
- }
- }
-
- // -----------------------------------------------------------------------------
-
- void BinaryWriteHandler::writeValue(uno::Any const& _aValue)
- {
- bool bSeq;
- uno::Type aTargetType = getBasicType(_aValue.getValueType(), bSeq);
-
- if (!bSeq)
- {
- writeSimpleValue(m_BinaryWriter,_aValue, aTargetType);
- }
- else
- {
- writeSequenceValue(m_BinaryWriter,_aValue, aTargetType);
- }
- }
- // -----------------------------------------------------------------------------
-
- void BinaryWriteHandler::writeFileHeader( rtl::OUString const & _aSchemaVersion,
- const uno::Sequence<rtl::OUString> & aKnownLocales,
- const uno::Sequence<rtl::OUString> & aDataLocales )
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- m_BinaryWriter.write(binary::CFG_BINARY_MAGIC);
- m_BinaryWriter.write(binary::CFG_BINARY_VERSION);
- m_BinaryWriter.write(_aSchemaVersion);
- writeSequence(m_BinaryWriter,aKnownLocales);
- writeSequence(m_BinaryWriter,aDataLocales);
- m_BinaryWriter.write(m_aComponentName);
- }
- // -----------------------------------------------------------------------------
-
- void BinaryWriteHandler::writeGroupNode(rtl::OUString const& _aName,node::Attributes const& _aAttributes )
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- writeAttributes(_aAttributes );
- m_BinaryWriter.write(_aName);
- }
-
- // -----------------------------------------------------------------------------
-
- void BinaryWriteHandler::writeSetNode(rtl::OUString const& _aName,
- rtl::OUString const& _aTemplateName,
- rtl::OUString const& _aTemplateModule,
- node::Attributes const& _aAttributes)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- writeAttributes(_aAttributes );
- m_BinaryWriter.write(_aName);
- m_BinaryWriter.write(_aTemplateName);
- m_BinaryWriter.write(_aTemplateModule);
- }
- // -----------------------------------------------------------------------------
-
- void BinaryWriteHandler::writeLayerInfoList(uno::Reference<backenduno::XLayer> const * pLayers, sal_Int32 nNumLayers)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
-
- m_BinaryWriter.write(nNumLayers);
- for (sal_Int32 i = 0 ; i < nNumLayers ; ++ i)
- {
- uno::Reference<util::XTimeStamped> xTimeStamp = uno::Reference<util::XTimeStamped>(pLayers[i], uno::UNO_QUERY);
-
- rtl::OUString aTimeStamp = xTimeStamp.is() ? xTimeStamp->getTimestamp() : rtl::OUString();
- m_BinaryWriter.write(aTimeStamp);
- }
-
- }
- // -----------------------------------------------------------------------------
-
- void BinaryWriteHandler::writeNodeType(binary::NodeType::Type _eType)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- sal_Int8 nValue = static_cast< sal_Int8 >( _eType );
- m_BinaryWriter.write(nValue);
-
- }
- // -----------------------------------------------------------------------------
-
- void BinaryWriteHandler::writeAttributes(node::Attributes const& _aAttributes)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- sal_Int8 nValue = static_cast< sal_Int8 >( _aAttributes.state() );
-
- OSL_ASSERT(0 <= nValue && nValue <= 3);
-
- OSL_ENSURE(!_aAttributes.isReadonly() || !_aAttributes.isFinalized(),"Unexpected attribute mix: node is both read-only and finalized");
-
- nValue |= (_aAttributes.isReadonly() ? 1 : 0) << 2;
- nValue |= (_aAttributes.isFinalized() ? 1 : 0) << 3;
-
- nValue |= (_aAttributes.isNullable() ? 1 : 0) << 4;
- nValue |= (_aAttributes.isLocalized() ? 1 : 0) << 5;
-
- nValue |= (_aAttributes.isMandatory() ? 1 : 0) << 6;
- nValue |= (_aAttributes.isRemovable() ? 1 : 0) << 7;
-
- m_BinaryWriter.write(nValue);
-
- }
- // -----------------------------------------------------------------------------
-
- void BinaryWriteHandler::writeValueNode(rtl::OUString const& _aName,
- node::Attributes const& _aAttributes,
- uno::Type const& _aType,
- uno::Any const& _aUserValue,
- uno::Any const& _aDefaultValue)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- //write value flags
- binary::ValueFlags::Type eType = convertTypeToValueType(_aType);
- sal_Int8 nValueType = sal_Int8(eType);
-
- bool hasUserValue = _aUserValue.hasValue();
- bool hasDefault = _aDefaultValue.hasValue();
-
- if (!hasUserValue) nValueType |= binary::ValueFlags::first_value_NULL;
- if (!hasDefault) nValueType |= binary::ValueFlags::second_value_NULL;
-
- m_BinaryWriter.write(nValueType);
- writeAttributes(_aAttributes );
- m_BinaryWriter.write(_aName);
-
- if(hasUserValue)
- {
- OSL_ENSURE(_aUserValue.getValueType() == _aType, "Type mismatch in value node");
- writeValue(_aUserValue);
- }
- if(hasDefault)
- {
- OSL_ENSURE(_aDefaultValue.getValueType() == _aType, "Type mismatch in value node");
- writeValue(_aDefaultValue);
- }
- }
- // -----------------------------------------------------------------------------
-
- void BinaryWriteHandler::writeStop()
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- sal_Int8 nStopValue = 0;
- m_BinaryWriter.write(nStopValue);
- }
- // -----------------------------------------------------------------------------
-
- void BinaryWriteHandler::writeComponentTree(const ISubtree * _pComponentTree)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- this->writeNodeType(binary::NodeType::component);
- if (_pComponentTree)
- {
- this->writeTree(*_pComponentTree);
- this->writeStop();
- }
- else
- {
- this->writeNodeType(binary::NodeType::nodata);
- }
- }
- // -----------------------------------------------------------------------------
-
- void BinaryWriteHandler::writeTemplatesTree(const ISubtree * _pTemplatesTree)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- this->writeNodeType(binary::NodeType::templates);
- if (_pTemplatesTree)
- {
- this->writeTree(*_pTemplatesTree);
- this->writeStop();
- }
- else
- {
- this->writeNodeType(binary::NodeType::nodata);
- }
- }
- // -----------------------------------------------------------------------------
-
- void BinaryWriteHandler::writeTree(const ISubtree & rTree)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- if ( rTree.isSetNode() )
- {
- this->writeNodeType(binary::NodeType::setnode);
- this->writeSetNode( rTree.getName(),
- rTree.getElementTemplateName(),
- rTree.getElementTemplateModule(),
- rTree.getAttributes());
- }
- else
- {
- this->writeNodeType(binary::NodeType::groupnode);
- this->writeGroupNode( rTree.getName(), rTree.getAttributes() );
- }
-
- // process children
- this->applyToChildren(rTree);
-
- this->writeStop();
- }
- // -----------------------------------------------------------------------------
-
- void BinaryWriteHandler::handle(const ISubtree & rTree)
- {
- writeTree(rTree);
- }
- // -----------------------------------------------------------------------------
-
- void BinaryWriteHandler::handle(const ValueNode & rValue)
- {
- this->writeNodeType(binary::NodeType::valuenode);
-
- this->writeValueNode( rValue.getName(),
- rValue.getAttributes(),
- rValue.getValueType(),
- rValue.getUserValue(),
- rValue.getDefault() );
- }
- // -----------------------------------------------------------------------------
-
- bool BinaryWriteHandler::generateHeader(const uno::Reference<backenduno::XLayer> * pLayers,
- sal_Int32 nNumLayers,
- const rtl::OUString& aEntity,
- const std::vector< com::sun::star::lang::Locale > & aKnownLocales )
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- //Open the writer
- if (!m_BinaryWriter.open())
- return false;
-
- this->writeFileHeader( aEntity,
- localehelper::makeIsoSequence(aKnownLocales),
- getAvailableLocales(pLayers,nNumLayers) );
-
- this->writeLayerInfoList(pLayers, nNumLayers);
- return true;
- }
- // -----------------------------------------------------------------------------
-
- }
- // -----------------------------------------------------------------------------
-}
diff --git a/configmgr/source/backend/binarywritehandler.hxx b/configmgr/source/backend/binarywritehandler.hxx
deleted file mode 100644
index 25cc0e1d97..0000000000
--- a/configmgr/source/backend/binarywritehandler.hxx
+++ /dev/null
@@ -1,117 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONFIGMGR_BINARYWRITEHANDLER_HXX
-#define CONFIGMGR_BINARYWRITEHANDLER_HXX
-
-#include "valuenode.hxx"
-#include "binarywriter.hxx"
-#include "binarytype.hxx"
-#include "attributes.hxx"
-#include "matchlocale.hxx"
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-#include <com/sun/star/io/IOException.hpp>
-
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
- namespace backend
- {
- namespace css = com::sun::star;
-
- namespace io = css::io;
- namespace uno = css::uno;
- namespace backenduno = css::configuration::backend ;
-
- // -----------------------------------------------------------------------------
- class BinaryWriteHandler : private NodeAction
- {
- BinaryWriter m_BinaryWriter;
- rtl::OUString m_aComponentName;
-
- public:
- BinaryWriteHandler(rtl::OUString const & _aFileURL, rtl::OUString const & _aComponentName, uno::Reference<lang::XMultiServiceFactory> const & _aFactory);
-
- bool generateHeader( const uno::Reference<backenduno::XLayer> * pLayers,
- sal_Int32 nNumLayers,
- const rtl::OUString& aEntity,
- const std::vector< com::sun::star::lang::Locale > & aKnownLocales )
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- void writeComponentTree(const ISubtree * _pComponentTree)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
- void writeTemplatesTree(const ISubtree * _pTemplatesTree)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
- private:
- void writeTree(ISubtree const & rTree)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- // Node Action
- virtual void handle(ISubtree const & aSubtree);
- virtual void handle(ValueNode const & aValue);
- private:
- void writeFileHeader( rtl::OUString const & _aSchemaVersion,
- const uno::Sequence<rtl::OUString> & aKnownLocales,
- const uno::Sequence<rtl::OUString> & aDataLocales )
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- void writeLayerInfoList(uno::Reference<backenduno::XLayer> const * pLayers, sal_Int32 nNumlayers)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- void writeGroupNode(rtl::OUString const& _aName,node::Attributes const& _aAttributes)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- void writeValueNode(rtl::OUString const& _aName,
- node::Attributes const& _aAttributes,
- uno::Type const& _aType,
- uno::Any const& _aUserValue,
- uno::Any const& _aDefaultValue)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- void writeSetNode(rtl::OUString const& _aName,
- rtl::OUString const& _aTemplateName,
- rtl::OUString const& _aTemplateModule,
- node::Attributes const& _aAttributes)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- void writeAttributes(node::Attributes const& _aAttributes)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- void writeNodeType(binary::NodeType::Type _eType)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- void writeStop()
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- void writeValue( uno::Any const& _aValue)
- SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- };
- // ---------------------------------------------------------------------------
- }
- // -----------------------------------------------------------------------------
-}// namespace configmgr
-#endif
diff --git a/configmgr/source/backend/binarywriter.cxx b/configmgr/source/backend/binarywriter.cxx
deleted file mode 100644
index 80ca8ed7c5..0000000000
--- a/configmgr/source/backend/binarywriter.cxx
+++ /dev/null
@@ -1,215 +0,0 @@
-/*************************************************************************
-*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
-************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "binarywriter.hxx"
-#include "valuenode.hxx"
-#include "filehelper.hxx"
-#include <com/sun/star/uno/Type.hxx>
-#include <com/sun/star/uno/Any.hxx>
-#include "oslstream.hxx"
-#include <com/sun/star/io/IOException.hpp>
-#include <com/sun/star/io/XOutputStream.hpp>
-#include <com/sun/star/io/XActiveDataSource.hpp>
-#include <com/sun/star/io/XDataOutputStream.hpp>
-#include "typeconverter.hxx"
-#include "binarytype.hxx"
-#include "simpletypehelper.hxx"
-
-#define ASCII(x) rtl::OUString::createFromAscii(x)
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
- namespace backend
- {
- namespace uno = com::sun::star::uno;
- namespace io = com::sun::star::io;
-
- BinaryWriter::BinaryWriter(rtl::OUString const &_aFileURL, uno::Reference<lang::XMultiServiceFactory> const& _xServiceProvider)
- : m_aFileURL(_aFileURL)
- , m_xServiceProvider(_xServiceProvider)
- , m_xDataOutputStream()
- {}
-
- bool BinaryWriter::open() SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- if (m_aFileURL.getLength() == 0)
- return false;
-
- OSL_ENSURE(!m_xDataOutputStream.is(), "Binary Writer: already open");
- if ( m_xDataOutputStream.is())
- return false;
-
- if (FileHelper::fileExists(m_aFileURL))
- {
- if (osl::File::RC errorCode = osl::File::remove(m_aFileURL))
- {
- // creating the file will fail later
- OSL_TRACE("Binary Cache: Cannot remove existing file [%d]",int(errorCode));
- }
- }
- else
- {
- //create missing directories
- rtl::OUString parentDirectory = FileHelper::getParentDir(m_aFileURL) ;
-
- if (osl::File::RC errorCode = FileHelper::mkdirs(parentDirectory))
- {
- // creating the file will fail later
- OSL_TRACE("Binary Cache: Cannot create package cache directory [%d]",int(errorCode));
- }
- }
-
- uno::Reference<io::XOutputStream> xOutput = new BufferedFileOutputStream(m_aFileURL, true, 1024);
-
- uno::Reference< io::XActiveDataSource > xFormattingStream(
- m_xServiceProvider->createInstance(ASCII("com.sun.star.io.DataOutputStream")),
- uno::UNO_QUERY_THROW);
-
- xFormattingStream->setOutputStream(xOutput);
-
- m_xDataOutputStream.set(xFormattingStream, uno::UNO_QUERY_THROW);
-
- OSL_ASSERT(m_xDataOutputStream.is());
- return m_xDataOutputStream.is();
- }
-
- void BinaryWriter::close() SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- if (m_xDataOutputStream.is())
- m_xDataOutputStream->closeOutput();
-
- m_xDataOutputStream.clear();
- }
-
- BinaryWriter::~BinaryWriter()
- {
- try
- {
- close();
- }
- catch (uno::Exception& e)
- {
- (void)e;
- OSL_ENSURE(false, rtl::OUStringToOString(e.Message,RTL_TEXTENCODING_ASCII_US).getStr());
- }
- }
-
- // -----------------------------------------------------------------------------
- // -----------------------------------------------------------------------------
- void BinaryWriter::write(sal_Bool _aValue)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- // write one byte
- m_xDataOutputStream->writeBoolean(_aValue);
- }
- void BinaryWriter::write(sal_Int8 _aValue)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- // write one byte
- m_xDataOutputStream->writeByte(_aValue);
- }
- void BinaryWriter::write(sal_Int16 _aValue)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- // write two bytes
- m_xDataOutputStream->writeShort(_aValue);
- }
- void BinaryWriter::write(sal_Int32 _aValue)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- // write four byte
- m_xDataOutputStream->writeLong(_aValue);
- }
- void BinaryWriter::write(sal_Int64 _aValue)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- // write eight byte
- m_xDataOutputStream->writeHyper(_aValue);
- }
- void BinaryWriter::write(double _aValue)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- // write eight byte
- m_xDataOutputStream->writeDouble(_aValue);
- }
-
- // -----------------------------------------------------------------------------
- bool isAsciiEncoding(rtl::OUString const& _aStr)
- {
- const sal_Unicode *pStr = _aStr.getStr();
- sal_Int32 nLen = _aStr.getLength();
- while (nLen--)
- {
- if (*pStr++ > 127)
- return false;
- }
- return true;
- }
-
- // -----------------------------------------------------------------------------
- void BinaryWriter::write(rtl::OUString const& _aStr)
- SAL_THROW( (io::IOException, uno::RuntimeException) )
- {
- // @@@ OBinaryBaseReader_Impl::readUTF() @@@
-
- rtl::OString aUTF;
- // to fasten the conversion for ascii data, we mask the length
- bool bIsAscii = isAsciiEncoding(_aStr);
- if (bIsAscii)
- rtl_uString2String (
- &(aUTF.pData), _aStr.getStr(), _aStr.getLength(),
- RTL_TEXTENCODING_ASCII_US, OUSTRING_TO_OSTRING_CVTFLAGS);
- else
- rtl_uString2String (
- &(aUTF.pData), _aStr.getStr(), _aStr.getLength(),
- RTL_TEXTENCODING_UTF8, OUSTRING_TO_OSTRING_CVTFLAGS);
-
- sal_Int32 nLength = aUTF.getLength();
- uno::Sequence<sal_Int8> aData (nLength);
- memcpy (aData.getArray(), aUTF.getStr(), nLength);
-
- OSL_ENSURE((nLength & binary::STR_ASCII_MASK) == 0,"String too long");
- if (bIsAscii)
- {
- nLength |= binary::STR_ASCII_MASK;
- OSL_ASSERT((nLength & binary::STR_ASCII_MASK) == binary::STR_ASCII_MASK);
- OSL_ASSERT(sal_Int32(nLength & ~binary::STR_ASCII_MASK) == aData.getLength());
- }
- m_xDataOutputStream->writeLong (nLength);
-
- m_xDataOutputStream->writeBytes (aData);
- }
-
- // -----------------------------------------------------------------------------
-
- // -----------------------------------------------------------------------------
- }
-// -----------------------------------------------------------------------------
-}
diff --git a/configmgr/source/backend/binarywriter.hxx b/configmgr/source/backend/binarywriter.hxx
deleted file mode 100644
index cb4b35b1dd..0000000000
--- a/configmgr/source/backend/binarywriter.hxx
+++ /dev/null
@@ -1,76 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONFIGMGR_BINARYWRITER_HXX
-#define CONFIGMGR_BINARYWRITER_HXX
-
-#include <rtl/ustring.hxx>
-#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/io/IOException.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/io/XDataOutputStream.hpp>
-
-
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
- namespace backend
- {
- namespace css = com::sun::star;
-
- namespace io = css::io;
- namespace uno = css::uno;
- namespace lang = css::lang;
- // -----------------------------------------------------------------------------
-
- class BinaryWriter
- {
- rtl::OUString m_aFileURL;
-
- uno::Reference<lang::XMultiServiceFactory> m_xServiceProvider;
- uno::Reference< io::XDataOutputStream > m_xDataOutputStream;
-
- public:
- BinaryWriter(rtl::OUString const& m_aFilename, uno::Reference<lang::XMultiServiceFactory> const& _rxServiceProvider);
-
- ~BinaryWriter();
- bool open() SAL_THROW( (io::IOException, uno::RuntimeException) );
- void close() SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- // Type writer
- void write(sal_Bool _bValue) SAL_THROW( (io::IOException, uno::RuntimeException) );
- void write(sal_Int8 _nValue) SAL_THROW( (io::IOException, uno::RuntimeException) );
- void write(sal_Int16 _nValue) SAL_THROW( (io::IOException, uno::RuntimeException) );
- void write(sal_Int32 _nValue) SAL_THROW( (io::IOException, uno::RuntimeException) );
- void write(sal_Int64 _nValue) SAL_THROW( (io::IOException, uno::RuntimeException) );
- void write(double _nValue) SAL_THROW( (io::IOException, uno::RuntimeException) );
- void write(rtl::OUString const& _aStr) SAL_THROW( (io::IOException, uno::RuntimeException) );
-
- };
- } //namespace backend
-} // namespace configmgr
-
-#endif
diff --git a/configmgr/source/backend/componentdatahelper.cxx b/configmgr/source/backend/componentdatahelper.cxx
deleted file mode 100644
index beaa540562..0000000000
--- a/configmgr/source/backend/componentdatahelper.cxx
+++ /dev/null
@@ -1,614 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "componentdatahelper.hxx"
-#include "treenodefactory.hxx"
-#include "typeconverter.hxx"
-#include "strdecl.hxx"
-#include <rtl/ustrbuf.hxx>
-#include <com/sun/star/lang/NoSupportException.hpp>
-#include <com/sun/star/lang/IllegalAccessException.hpp>
-#include <com/sun/star/lang/IllegalArgumentException.hpp>
-#include <com/sun/star/container/NoSuchElementException.hpp>
-#include <com/sun/star/container/ElementExistException.hpp>
-#include <com/sun/star/beans/IllegalTypeException.hpp>
-#include <com/sun/star/beans/PropertyExistException.hpp>
-#include <com/sun/star/beans/UnknownPropertyException.hpp>
-
-// -----------------------------------------------------------------------------
-#define OUSTR( str ) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(str) )
-// -----------------------------------------------------------------------------
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace beans = ::com::sun::star::beans;
- namespace container = ::com::sun::star::container;
-// -----------------------------------------------------------------------------
-
-DataBuilderContext::DataBuilderContext( uno::Reference< uno::XComponentContext > const & xContext )
-: m_aLogger(xContext)
-, m_aParentStack()
-, m_aActiveComponent()
-, m_pContext()
-, m_aExpectedComponentName(rtl::OUString())
-{
-
-}
-// -----------------------------------------------------------------------------
-
-DataBuilderContext::DataBuilderContext( uno::Reference< uno::XComponentContext > const & xContext, uno::XInterface * _pContext, ITemplateDataProvider* aTemplateProvider )
-: m_aLogger(xContext)
-, m_aParentStack()
-, m_aActiveComponent()
-, m_pContext(_pContext)
-, m_aExpectedComponentName()
-, m_aTemplateProvider( aTemplateProvider )
-{
-
-}
-// -----------------------------------------------------------------------------
-
-DataBuilderContext::DataBuilderContext( uno::Reference< uno::XComponentContext > const & xContext, uno::XInterface * _pContext, const rtl::OUString& aExpectedComponentName, ITemplateDataProvider* aTemplateProvider )
-: m_aLogger(xContext)
-, m_aParentStack()
-, m_aActiveComponent()
-, m_pContext(_pContext)
-, m_aExpectedComponentName( aExpectedComponentName )
-, m_aTemplateProvider( aTemplateProvider )
-{
-
-}
-// -----------------------------------------------------------------------------
-
-DataBuilderContext::DataBuilderContext(DataBuilderContext const & aBaseContext, uno::XInterface * _pContext)
-: m_aLogger(aBaseContext.m_aLogger)
-, m_aParentStack()
-, m_aActiveComponent()
-, m_pContext(_pContext)
-, m_aExpectedComponentName()
-, m_aTemplateProvider( aBaseContext.m_aTemplateProvider )
-{
-
-}
-// -----------------------------------------------------------------------------
-
-DataBuilderContext::~DataBuilderContext( )
-{
-
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-void DataBuilderContext::raiseMalformedDataException(sal_Char const * _pText) const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException, com::sun::star::uno::RuntimeException))
-{
- rtl::OUString const sMessage = makeMessageWithPath(_pText);
- m_aLogger.error(sMessage,"parse","configmgr::backend::DataBuilder");
- throw backenduno::MalformedDataException(sMessage, m_pContext, uno::Any());
-}
-// -----------------------------------------------------------------------------
-
-void DataBuilderContext::raiseIllegalTypeException(sal_Char const * _pText) const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException, com::sun::star::uno::RuntimeException))
-{
- rtl::OUString const sMessage = makeMessageWithPath(_pText);
- beans::IllegalTypeException e(sMessage, m_pContext);
-
- rtl::OUString const sFullMessage = OUSTR("Illegal Type: ").concat(sMessage);
- m_aLogger.error(sFullMessage,"parse","configmgr::backend::DataBuilder");
- throw backenduno::MalformedDataException(sFullMessage, m_pContext, uno::makeAny(e));
-}
-// -----------------------------------------------------------------------------
-
-void DataBuilderContext::raiseIllegalArgumentException(sal_Char const * _pText, sal_Int16 _nPos) const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- rtl::OUString const sMessage = makeMessageWithPath(_pText);
- lang::IllegalArgumentException e(sMessage, m_pContext, _nPos);
-
- rtl::OUString const sFullMessage = OUSTR("Illegal Argument: ").concat(sMessage);
- m_aLogger.error(sFullMessage,"parse","configmgr::backend::DataBuilder");
- throw backenduno::MalformedDataException(sFullMessage, m_pContext, uno::makeAny(e));
-}
-// -----------------------------------------------------------------------------
-
-void DataBuilderContext::raiseNoSuchElementException(sal_Char const * _pText, rtl::OUString const & _sElement) const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- rtl::OUString const sMessage = makeMessageWithName(_pText,_sElement);
- container::NoSuchElementException e(sMessage, m_pContext);
-
- rtl::OUString const sFullMessage = OUSTR("No Such Node: ").concat(sMessage);
- m_aLogger.error(sFullMessage,"parse","configmgr::backend::DataBuilder");
- throw backenduno::MalformedDataException(sFullMessage, m_pContext, uno::makeAny(e));
-}
-// -----------------------------------------------------------------------------
-
-void DataBuilderContext::raiseElementExistException(sal_Char const * _pText, rtl::OUString const & _sElement) const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- rtl::OUString const sMessage = makeMessageWithName(_pText,_sElement);
- container::ElementExistException e(sMessage, m_pContext);
-
- rtl::OUString const sFullMessage = OUSTR("Node Already Exists: ").concat(sMessage);
- m_aLogger.error(sFullMessage,"parse","configmgr::backend::DataBuilder");
- throw backenduno::MalformedDataException(sFullMessage, m_pContext, uno::makeAny(e));
-}
-// -----------------------------------------------------------------------------
-
-void DataBuilderContext::raisePropertyExistException(sal_Char const * _pText, rtl::OUString const & _sElement) const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- rtl::OUString const sMessage = makeMessageWithName(_pText,_sElement);
- beans::PropertyExistException e(sMessage, m_pContext);
-
- rtl::OUString const sFullMessage = OUSTR("No Such Property: ").concat(sMessage);
- m_aLogger.error(sFullMessage,"parse","configmgr::backend::DataBuilder");
- throw backenduno::MalformedDataException(sFullMessage, m_pContext, uno::makeAny(e));
-}
-// -----------------------------------------------------------------------------
-
-rtl::OUString DataBuilderContext::makeMessageWithPath(sal_Char const * _pText) const
- SAL_THROW((com::sun::star::uno::RuntimeException))
-{
- rtl::OUStringBuffer sMessage;
- sMessage.appendAscii(_pText);
-
- sMessage.appendAscii(" [@").append(getNodeParentagePath()).appendAscii("] ");
-
- return sMessage.makeStringAndClear();
-}
-// -----------------------------------------------------------------------------
-
-rtl::OUString DataBuilderContext::makeMessageWithName(sal_Char const * _pText, rtl::OUString const & _aName) const
- SAL_THROW((com::sun::star::uno::RuntimeException))
-{
- rtl::OUStringBuffer sMessage;
- sMessage.appendAscii(_pText);
-
- if (_aName.getLength() != 0)
- sMessage.appendAscii(" [").append(getNodePath(_aName)).appendAscii("] ");
- else
- sMessage.appendAscii(" [@").append(getNodeParentagePath()).appendAscii("] ");
-
- return sMessage.makeStringAndClear();
-}
-// -----------------------------------------------------------------------------
-const sal_Unicode k_pathsep = '/';
-
-rtl::OUString DataBuilderContext::getNodeParentagePath() const
-{
- rtl::OUStringBuffer path;
-
- for (Stack< ISubtree * >::bottomup_iterator it = m_aParentStack.begin_up();
- it != m_aParentStack.end_up(); ++it)
- {
- OSL_ASSERT(*it);
- path.append(k_pathsep).append((**it).getName());
- }
-
- return path.makeStringAndClear();
-}
-// -----------------------------------------------------------------------------
-
-rtl::OUString DataBuilderContext::getNodePath(rtl::OUString const & aNodeName) const
-{
- rtl::OUStringBuffer path( getNodeParentagePath() );
-
- path.append(k_pathsep).append(aNodeName);
-
- return path.makeStringAndClear();
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-bool DataBuilderContext::isDone() const
-{
- OSL_ENSURE(m_aParentStack.empty() || hasActiveComponent(),"DataBuilderContext:Inconsistent Activity state");
-
- return m_aParentStack.empty();
-}
-// -----------------------------------------------------------------------------
-
-ISubtree & DataBuilderContext::implGetCurrentParent() const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- if (m_aParentStack.empty())
- raiseMalformedDataException("Invalid Component Data: Operation requires open parent node.");
-
- OSL_ENSURE( m_aParentStack.top(), "NULL tree on node-stack" );
-
- return *m_aParentStack.top();
-}
-// -----------------------------------------------------------------------------
-
-bool DataBuilderContext::isWritable(INode const * pNode) const
- SAL_THROW(())
-{
- OSL_PRECOND(pNode,"Unexpected NULL node pointer");
- return pNode->getAttributes().isWritable();
-
-}
-// -----------------------------------------------------------------------------
-
-bool DataBuilderContext::isRemovable(ISubtree const * pItem) const
- SAL_THROW(())
-{
- OSL_PRECOND(pItem,"Unexpected NULL item pointer");
- return pItem->getAttributes().isRemovable();
-}
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-rtl::OUString DataBuilderContext::getTemplateComponent( const backenduno::TemplateIdentifier& aItemType ) const
-{
- if (aItemType.Component.getLength() != 0)
- return aItemType.Component;
-
- else
- return getActiveComponent();
-}
-// -----------------------------------------------------------------------------
-
-backenduno::TemplateIdentifier DataBuilderContext::completeComponent( const backenduno::TemplateIdentifier& aItemType ) const
-{
- backenduno::TemplateIdentifier aComplete(aItemType);
- if (aComplete.Component.getLength() == 0)
- aComplete.Component = getActiveComponent();
-
- return aComplete;
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-backenduno::TemplateIdentifier DataBuilderContext::getCurrentItemType() const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- ISubtree const * pCurrentSet = getCurrentParent().asISubtree();
- if (!pCurrentSet || !pCurrentSet->isSetNode())
- raiseMalformedDataException("Component Builder Context: Cannot add/replace node - context is not a set");
-
- backenduno::TemplateIdentifier aCompleteType;
-
- aCompleteType.Name = pCurrentSet->getElementTemplateName();
- aCompleteType.Component = pCurrentSet->getElementTemplateModule();
-
- return aCompleteType;
-}
-// -----------------------------------------------------------------------------
-
-backenduno::TemplateIdentifier DataBuilderContext::getValidItemType(backenduno::TemplateIdentifier const & aItemType) const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- ISubtree const * pCurrentSet = getCurrentParent().asISubtree();
- if (!pCurrentSet || !pCurrentSet->isSetNode())
- raiseMalformedDataException("Component Builder Context: Cannot add/replace node - context is not a set");
-
- backenduno::TemplateIdentifier aCompleteType = completeComponent( aItemType );
-
- // for now only a single item-type is supported
- if (aCompleteType.Name != pCurrentSet->getElementTemplateName())
- raiseIllegalTypeException("Component Builder Context: Cannot add/replace node - template is not permitted in containing set");
-
- if (aCompleteType.Component != pCurrentSet->getElementTemplateModule())
- raiseIllegalTypeException("Component Builder Context: Cannot add/replace node - template is not permitted in containing set (component mismatch)");
-
- return aCompleteType;
-}
-// -----------------------------------------------------------------------------
-
-ISubtree * DataBuilderContext::addNodeToCurrent(std::auto_ptr<ISubtree> _aNode)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- OSL_PRECOND(_aNode.get(), "ERROR: Adding a NULL node");
-
- if (this->findChild(_aNode->getName()))
- raiseElementExistException("Component Builder Context: The node to be added does already exist", _aNode->getName());
-
- return getCurrentParent().addChild( base_ptr(_aNode) )->asISubtree();
-}
-// -----------------------------------------------------------------------------
-
-ISubtree * DataBuilderContext::addLocalizedToCurrent(std::auto_ptr<ISubtree> _aNode)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- OSL_PRECOND(_aNode.get(), "ERROR: Adding a NULL node");
-
- if (this->findChild(_aNode->getName()))
- raisePropertyExistException("Component Builder Context: The property to be added does already exist", _aNode->getName());
-
- return getCurrentParent().addChild( base_ptr(_aNode) )->asISubtree();
-}
-// -----------------------------------------------------------------------------
-
-ValueNode * DataBuilderContext::addPropertyToCurrent(std::auto_ptr<ValueNode> _aNode, bool _bMayReplace)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- OSL_PRECOND(_aNode.get(), "ERROR: Adding a NULL node");
- OSL_PRECOND(!_bMayReplace || _aNode->getAttributes().isReplacedForUser(), "Wrong status for added property");
-
- if (this->findChild(_aNode->getName()))
- {
- // We currently may get a 'replace', when overriding an added property
- if (_bMayReplace && getCurrentParent().isSetNode())
- {
- getCurrentParent().removeChild(_aNode->getName());
- _aNode->modifyState(node::isReplaced);
- }
- else
-
- raisePropertyExistException("Component Builder Context: The property to be added does already exist", _aNode->getName());
- }
- return getCurrentParent().addChild( base_ptr(_aNode) )->asValueNode();
-}
-// -----------------------------------------------------------------------------
-
-void DataBuilderContext::markCurrentMerged()
-{
- Stack< ISubtree * >::topdown_iterator it = m_aParentStack.begin_down(), end = m_aParentStack.end_down();
- for ( ;it != end && (*it)->isDefault(); ++it)
- (*it)->modifyState( node::isMerged );
-
-#if OSL_DEBUG_LEVEL > 0
- for ( ;it != end; ++it)
- OSL_ENSURE(!(*it)->isDefault(),"Found a default node in ancestry of a merged change");
-#endif
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-bool DataBuilderContext::isProperty(INode * pProp) const
- SAL_THROW((com::sun::star::uno::RuntimeException))
-{
- OSL_PRECOND(pProp, "ERROR: Unexpected NULL node");
-
- if (pProp == NULL)
- {
- rtl::OUString sMsg = makeMessageWithName("INTERNAL ERROR (DataBuilderContext): Trying to inspect NULL node",rtl::OUString() );
- throw uno::RuntimeException( sMsg, m_pContext );
- }
-
- if ( ISubtree * pTree = pProp->asISubtree() )
- return isLocalizedValueSet( *pTree );
-
- OSL_ASSERT(dynamic_cast< ValueNode * >(pProp) != 0);
- return true;
-}
-// -----------------------------------------------------------------------------
-
-INode * DataBuilderContext::findChild(rtl::OUString const & _aName)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- return getCurrentParent().getChild(_aName);
-}
-// -----------------------------------------------------------------------------
-
-INode * DataBuilderContext::findProperty(rtl::OUString const & _aName)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- INode * pResult = findChild(_aName);
- if (pResult && !isProperty(pResult))
- {
- raiseMalformedDataException("Component Builder Context: Found an existing inner node, where a property was expected");
- }
- return pResult;
-}
-// -----------------------------------------------------------------------------
-
-ISubtree * DataBuilderContext::findNode(rtl::OUString const & _aName)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- INode * pResult = findChild(_aName);
-
- if (!pResult)
- return NULL;
-
- if (!isNode(pResult))
- raiseMalformedDataException("Component Builder Context: Found an existing property, where an inner node was expected");
-
- OSL_ASSERT(dynamic_cast< ISubtree * >(pResult) != 0);
- return pResult->asISubtree();
-}
-// -----------------------------------------------------------------------------
-
-void DataBuilderContext::pushNode(ISubtree * pTree)
- SAL_THROW((com::sun::star::uno::RuntimeException))
-{
- OSL_PRECOND(hasActiveComponent(), "Component Builder Context: Entering a node without having an active component");
- OSL_PRECOND(pTree, "ERROR: Pushing a NULL tree");
-
- if (pTree == NULL)
- {
- rtl::OUString sMsg = makeMessageWithName("INTERNAL ERROR (DataBuilderContext): Trying to push NULL tree",rtl::OUString() );
- throw uno::RuntimeException( sMsg, m_pContext );
- }
- m_aParentStack.push(pTree);
-}
-// -----------------------------------------------------------------------------
-
-void DataBuilderContext::popNode()
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- OSL_PRECOND(hasActiveComponent(), "Component Builder Context: Leaving a node without having an active component");
- if (m_aParentStack.empty())
- raiseMalformedDataException("Invalid Component Data: Unmatched end of node");
-
- OSL_ENSURE( m_aParentStack.top(), "NULL tree on node-stack" );
-
- m_aParentStack.pop();
-}
-// -----------------------------------------------------------------------------
-
-void DataBuilderContext::startActiveComponent(rtl::OUString const & _aComponent)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- OSL_PRECOND(!hasActiveComponent(), "Component Builder Context: Component is already active");
- OSL_PRECOND(m_aParentStack.empty(), "Component Builder Context: Starting Component/Template while inside a node");
-
- if (!m_aParentStack.empty())
- raiseMalformedDataException("Invalid Component Data: Starting component while node is still open");
-
- if (m_aExpectedComponentName.getLength()!=0)
- {
- if (m_aExpectedComponentName.compareTo ( _aComponent)!= 0 )
- raiseMalformedDataException("Invalid Component Data: Component name does not match request");
- }
- m_aActiveComponent = _aComponent;
-
- OSL_POSTCOND(hasActiveComponent(), "Component Builder Context: Could not start Component/Template");
-}
-// -----------------------------------------------------------------------------
-
-void DataBuilderContext::endActiveComponent()
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- OSL_PRECOND( hasActiveComponent(), "Component Builder Context: No Component active");
- OSL_PRECOND(m_aParentStack.empty(), "Component Builder Context: Ending Component/Template while inside a node");
-
- if (!m_aParentStack.empty())
- raiseMalformedDataException("Invalid Component Data: Ending component while node is still open");
-
- m_aActiveComponent = rtl::OUString();
-
- OSL_POSTCOND(!hasActiveComponent(), "Component Builder Context: Could not end Component/Template");
-}
-// -----------------------------------------------------------------------------
-ResultHolder< TemplateInstance > DataBuilderContext::getTemplateData (TemplateRequest const & _aRequest )
-{
- return(m_aTemplateProvider->getTemplateData (_aRequest));
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-ComponentDataFactory::ComponentDataFactory()
-: m_rNodeFactory( getDefaultTreeNodeFactory() )
-{
-}
-// -----------------------------------------------------------------------------
-
-std::auto_ptr<ISubtree> ComponentDataFactory::createGroup( rtl::OUString const & _aName,
- bool _bExtensible,
- node::Attributes const & _aAttributes) const
-{
- if (_bExtensible)
- {
- return getNodeFactory().createSetNode( _aName,
- toTemplateName(TYPE_ANY,false),
- TEMPLATE_MODULE_NATIVE_VALUE,
- _aAttributes );
- }
- else
- {
- return getNodeFactory().createGroupNode( _aName,
- _aAttributes );
- }
-}
-// -----------------------------------------------------------------------------
-
-std::auto_ptr<ISubtree> ComponentDataFactory::createSet(rtl::OUString const & _aName,
- backenduno::TemplateIdentifier const & _aItemType,
- bool _bExtensible,
- node::Attributes const & _aAttributes) const
-{
- OSL_ENSURE(!_bExtensible, "DataBuilderContext: Unimplemented feature: Extensible Set node");
- if (_bExtensible)
- return std::auto_ptr<ISubtree>();
-
- return getNodeFactory().createSetNode( _aName,
- _aItemType.Name,
- _aItemType.Component,
- _aAttributes );
-}
-// -----------------------------------------------------------------------------
-
-std::auto_ptr<ISubtree> ComponentDataFactory::createLocalizedContainer( rtl::OUString const & _aName,
- uno::Type const & _aValueType,
- node::Attributes const & _aAttributes) const
-{
- node::Attributes aLocalizedAttributes(_aAttributes);
- aLocalizedAttributes.setLocalized (true);
-
- return getNodeFactory().createSetNode( _aName,
- toTemplateName(_aValueType),
- TEMPLATE_MODULE_LOCALIZED_VALUE,
- aLocalizedAttributes );
-
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-namespace
-{
- DECLARE_CONSTASCII_USTRING(INSTANCE_MARKER);
- IMPLEMENT_CONSTASCII_USTRING(INSTANCE_MARKER, "instantiate@");
-}
-// -----------------------------------------------------------------------------
-
-std::auto_ptr<ISubtree> ComponentDataFactory::createPlaceHolder(rtl::OUString const & _aName,
- backenduno::TemplateIdentifier const & _aInstanceType) const
-{
- return getNodeFactory().createSetNode( _aName,
- INSTANCE_MARKER + _aInstanceType.Name,
- _aInstanceType.Component,
- node::Attributes());
-}
-// -----------------------------------------------------------------------------
-
-bool ComponentDataFactory::isInstancePlaceHolder(ISubtree const & _aInstanceTree)
-{
- return !! _aInstanceTree.getElementTemplateName().match(INSTANCE_MARKER);
-}
-// -----------------------------------------------------------------------------
-
-backenduno::TemplateIdentifier ComponentDataFactory::getInstanceType(ISubtree const & _aInstanceTree)
-{
- OSL_ENSURE( isInstancePlaceHolder(_aInstanceTree), "Instance placeholder tree expected" );
-
- backenduno::TemplateIdentifier aResult;
-
- if (isInstancePlaceHolder(_aInstanceTree))
- {
- aResult.Name = _aInstanceTree.getElementTemplateName().copy( INSTANCE_MARKER.getLength() );
- aResult.Component = _aInstanceTree.getElementTemplateModule();
- }
-
- return aResult;
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace backend
-
-// -------------------------------------------------------------------------
-} // namespace configmgr
diff --git a/configmgr/source/backend/componentdatahelper.hxx b/configmgr/source/backend/componentdatahelper.hxx
deleted file mode 100644
index 242be523b7..0000000000
--- a/configmgr/source/backend/componentdatahelper.hxx
+++ /dev/null
@@ -1,219 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-/* PLEASE DON'T DELETE ANY COMMENT LINES, ALSO IT'S UNNECESSARY. */
-
-#ifndef CONFIGMGR_BACKEND_COMPONENTDATAHELPER_HXX
-#define CONFIGMGR_BACKEND_COMPONENTDATAHELPER_HXX
-
-#include "valuenode.hxx"
-#include "utility.hxx"
-#include "stack.hxx"
-#include <com/sun/star/configuration/backend/TemplateIdentifier.hpp>
-#include <com/sun/star/configuration/backend/MalformedDataException.hpp>
-#include <com/sun/star/uno/RuntimeException.hpp>
-
-#ifndef INCLUDED_MEMORY
-#include <memory>
-#define INCLUDED_MEMORY
-#endif
-#include "mergeddataprovider.hxx"
-#ifndef CONFIGMGR_LOGGER_HXX_
-#include "logger.hxx"
-#endif
-#include "request.hxx"
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- class OTreeNodeFactory;
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace backenduno = ::com::sun::star::configuration::backend;
-
-// -----------------------------------------------------------------------------
-
- class DataBuilderContext
- {
- Logger m_aLogger;
- Stack< ISubtree * > m_aParentStack;
- rtl::OUString m_aActiveComponent;
- uno::XInterface * m_pContext;
- rtl::OUString m_aExpectedComponentName;
- ITemplateDataProvider * m_aTemplateProvider;
- public:
- explicit DataBuilderContext(uno::Reference< uno::XComponentContext > const & xContext);
- DataBuilderContext(uno::Reference< uno::XComponentContext > const & xContext, uno::XInterface * _pContext , ITemplateDataProvider* aTemplateProvider = NULL);
- DataBuilderContext(uno::Reference< uno::XComponentContext > const & xContext, uno::XInterface * _pContext, const rtl::OUString& aExpectedComponentName,ITemplateDataProvider* aTemplateProvider = NULL );
- DataBuilderContext(DataBuilderContext const & aBaseContext, uno::XInterface * _pContext);
- ~DataBuilderContext();
-
- bool isDone() const;
-
- bool hasActiveComponent() const { return m_aActiveComponent.getLength() != 0; }
- rtl::OUString getActiveComponent() const { return m_aActiveComponent; }
-
- ISubtree & getCurrentParent()
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
- { return implGetCurrentParent(); }
-
- ISubtree const & getCurrentParent() const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
- { return implGetCurrentParent(); }
-
- node::Attributes getCurrentAttributes() const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
- { return implGetCurrentParent().getAttributes(); }
-
- ITemplateDataProvider * getTemplateProvider() const
- { return m_aTemplateProvider; }
-
- rtl::OUString getTemplateComponent(backenduno::TemplateIdentifier const & aItemType ) const;
-
- backenduno::TemplateIdentifier completeComponent(backenduno::TemplateIdentifier const & aItemType ) const;
-
- backenduno::TemplateIdentifier getCurrentItemType() const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
- backenduno::TemplateIdentifier getValidItemType(backenduno::TemplateIdentifier const & aItemType) const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
-
- void startActiveComponent(rtl::OUString const & _aComponent)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
- void endActiveComponent()
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
-
- bool isProperty(INode * pProp) const
- SAL_THROW((com::sun::star::uno::RuntimeException));
-
- bool isNode(INode * pNode) const SAL_THROW((com::sun::star::uno::RuntimeException))
- { return !isProperty(pNode); }
-
- void pushNode(ISubtree * pTree)
- SAL_THROW((com::sun::star::uno::RuntimeException));
- void popNode()
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
-
- INode * findProperty(rtl::OUString const & _aName)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
- ISubtree * findNode(rtl::OUString const & _aName)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
-
- bool isWritable(INode const * pNode) const
- SAL_THROW(());
- bool isRemovable(ISubtree const * pItem) const
- SAL_THROW(());
-
- ISubtree * addNodeToCurrent(std::auto_ptr<ISubtree> _aNode)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
- ISubtree * addLocalizedToCurrent(std::auto_ptr<ISubtree> _aNode)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
- ValueNode * addPropertyToCurrent(std::auto_ptr<ValueNode> _aNode, bool _bMayReplace = false)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
-
- void markCurrentMerged();
-
- // Logging support
- Logger const & getLogger() const { return m_aLogger; }
-
- rtl::OUString getNodeParentagePath() const;
- rtl::OUString getNodePath(rtl::OUString const & aNodeName) const;
-
- // Exception support
- void raiseMalformedDataException (sal_Char const * _pText) const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
- void raiseIllegalArgumentException (sal_Char const * _pText, sal_Int16 _nPos = 0) const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
- void raiseElementExistException (sal_Char const * _pText, rtl::OUString const & _sElement) const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
- void raiseNoSuchElementException (sal_Char const * _pText, rtl::OUString const & _sElement) const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
- void raisePropertyExistException (sal_Char const * _pText, rtl::OUString const & _sElement) const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
- void raiseIllegalTypeException (sal_Char const * _pText) const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
- ResultHolder< TemplateInstance > getTemplateData (TemplateRequest const & _aRequest );
- private:
- INode * findChild(rtl::OUString const & _aName)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
-
- rtl::OUString makeMessageWithPath(sal_Char const * _pText) const
- SAL_THROW((com::sun::star::uno::RuntimeException));
-
- rtl::OUString makeMessageWithName(sal_Char const * _pText, rtl::OUString const & _aName) const
- SAL_THROW((com::sun::star::uno::RuntimeException));
-
- ISubtree & implGetCurrentParent() const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
-
- };
-// -----------------------------------------------------------------------------
-
- class ComponentDataFactory
- {
- OTreeNodeFactory & m_rNodeFactory;
- public:
- ComponentDataFactory();
-
- ComponentDataFactory(OTreeNodeFactory & _rNodeFactory)
- : m_rNodeFactory(_rNodeFactory)
- {}
-
- public:
- OTreeNodeFactory& getNodeFactory() const { return m_rNodeFactory; }
-
- std::auto_ptr<ISubtree> createGroup(rtl::OUString const & _aName,
- bool _bExtensible,
- node::Attributes const & _aAttributes) const;
-
- std::auto_ptr<ISubtree> createSet( rtl::OUString const & _aName,
- backenduno::TemplateIdentifier const & aItemType,
- bool _bExtensible,
- node::Attributes const & _aAttributes) const;
-
- std::auto_ptr<ISubtree> createLocalizedContainer(rtl::OUString const & _aName,
- uno::Type const & _aValueType,
- node::Attributes const & _aAttributes) const;
-
- std::auto_ptr<ISubtree> createPlaceHolder(rtl::OUString const & _aName,
- backenduno::TemplateIdentifier const & _aInstanceType) const;
-
- static bool isInstancePlaceHolder(ISubtree const & _aInstanceTree);
- static backenduno::TemplateIdentifier getInstanceType(ISubtree const & _aInstanceTree);
- };
-// -----------------------------------------------------------------------------
- } // namespace backend
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/backend/emptylayer.cxx b/configmgr/source/backend/emptylayer.cxx
deleted file mode 100644
index 5c4887de24..0000000000
--- a/configmgr/source/backend/emptylayer.cxx
+++ /dev/null
@@ -1,225 +0,0 @@
-/*************************************************************************
-*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
-************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "emptylayerimpl.hxx"
-#include "emptylayer.hxx"
-
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
- namespace backend
- {
- // -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- // -----------------------------------------------------------------------------
- // -----------------------------------------------------------------------------
-
- uno::Reference< backenduno::XLayer > createEmptyLayer()
- {
- return new EmptyLayer();
- }
- // -----------------------------------------------------------------------------
-
- bool checkEmptyLayer(uno::Reference< backenduno::XLayer > const & xLayer )
- {
- OSL_ENSURE(xLayer.is(),"Unexpected NULL Layer");
- if (!xLayer.is()) return false;
-
- RequireEmptyLayer * const pChecker = new RequireEmptyLayer;
- uno::Reference< backenduno::XLayerHandler > xChecker(pChecker);
-
- try
- {
- xLayer->readData(xChecker);
- }
- catch (uno::Exception &)
- {
- OSL_ENSURE(!pChecker->wasEmpty(), "Checking for empty layer: exception occurred after empty layer was ended");
- }
-
- return pChecker->wasEmpty();
- }
-
- // -----------------------------------------------------------------------------
- // -----------------------------------------------------------------------------
-
- EmptyLayer::~EmptyLayer( )
- {
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL
- EmptyLayer::readData( const uno::Reference< backenduno::XLayerHandler >& aHandler )
- throw (backenduno::MalformedDataException, lang::NullPointerException, lang::WrappedTargetException, uno::RuntimeException)
- {
- if (aHandler.is())
- {
- aHandler->startLayer();
- aHandler->endLayer();
- }
- else
- throw lang::NullPointerException(rtl::OUString::createFromAscii("EmptyLayer: Null Handler"),*this);
- }
- // -----------------------------------------------------------------------------
- // -----------------------------------------------------------------------------
-
- RequireEmptyLayer::RequireEmptyLayer()
- : m_bStarted(false)
- , m_bInvalid(false)
- , m_bEmpty(false)
- {
- }
- // -----------------------------------------------------------------------------
-
- RequireEmptyLayer::~RequireEmptyLayer( )
- {
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL RequireEmptyLayer::startLayer( )
- throw (backenduno::MalformedDataException, uno::RuntimeException)
- {
- m_bInvalid = false;
- m_bEmpty = false;
-
- if (m_bStarted) fail("Layer started twice");
- m_bStarted = true;
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL RequireEmptyLayer::endLayer( )
- throw (backenduno::MalformedDataException, uno::RuntimeException)
- {
- if (!m_bStarted) fail("Layer was not started");
- m_bEmpty = !m_bInvalid;
- m_bStarted = false;
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL RequireEmptyLayer::overrideNode( const rtl::OUString& /*aName*/, sal_Int16 /*aAttributes*/, sal_Bool /*bClear*/ )
- throw (backenduno::MalformedDataException, uno::RuntimeException)
- {
- failNotEmpty();
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL RequireEmptyLayer::addOrReplaceNode( const rtl::OUString& /*aName*/, sal_Int16 /*aAttributes*/ )
- throw (backenduno::MalformedDataException, uno::RuntimeException)
- {
- failNotEmpty();
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL RequireEmptyLayer::addOrReplaceNodeFromTemplate( const rtl::OUString& /*aName*/, const backenduno::TemplateIdentifier& /*aTemplate*/, sal_Int16 /*aAttributes*/)
- throw (backenduno::MalformedDataException, uno::RuntimeException)
- {
- failNotEmpty();
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL RequireEmptyLayer::endNode( )
- throw (backenduno::MalformedDataException, uno::RuntimeException)
- {
- failNotEmpty();
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL RequireEmptyLayer::dropNode( const rtl::OUString& /*aName*/ )
- throw (backenduno::MalformedDataException, uno::RuntimeException)
- {
- failNotEmpty();
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL RequireEmptyLayer::addProperty( const rtl::OUString& /*aName*/, sal_Int16 /*aAttributes*/, const uno::Type& /*aType*/ )
- throw (backenduno::MalformedDataException, uno::RuntimeException)
- {
- failNotEmpty();
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL RequireEmptyLayer::addPropertyWithValue( const rtl::OUString& /*aName*/, sal_Int16 /*aAttributes*/, const uno::Any& /*aValue*/ )
- throw (backenduno::MalformedDataException, uno::RuntimeException)
- {
- failNotEmpty();
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL RequireEmptyLayer::overrideProperty( const rtl::OUString& /*aName*/, sal_Int16 /*aAttributes*/, const uno::Type& /*aType*/, sal_Bool /*bClear*/ )
- throw (backenduno::MalformedDataException, uno::RuntimeException)
- {
- failNotEmpty();
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL RequireEmptyLayer::endProperty( )
- throw (backenduno::MalformedDataException, uno::RuntimeException)
- {
- failNotEmpty();
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL RequireEmptyLayer::setPropertyValue( const uno::Any& /*aValue*/ )
- throw (backenduno::MalformedDataException, uno::RuntimeException)
- {
- failNotEmpty();
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL RequireEmptyLayer::setPropertyValueForLocale( const uno::Any& /*aValue*/, const rtl::OUString& /*aLocale*/ )
- throw (backenduno::MalformedDataException, uno::RuntimeException)
- {
- failNotEmpty();
- }
- // -----------------------------------------------------------------------------
-
- void RequireEmptyLayer::fail(sal_Char const * pMsg)
- {
- if (!m_bStarted & !m_bInvalid) pMsg = "Layer was not started";
- m_bInvalid = true;
- m_bStarted = false;
-
- OSL_ASSERT(pMsg);
- rtl::OUString sMsg = rtl::OUString::createFromAscii(pMsg);
-
- throw backenduno::MalformedDataException( sMsg, *this, uno::Any() );
- }
-
- // -----------------------------------------------------------------------------
- // -----------------------------------------------------------------------------
-
- // -----------------------------------------------------------------------------
- } // namespace
-
- // -----------------------------------------------------------------------------
-} // namespace
-
diff --git a/configmgr/source/backend/emptylayerimpl.hxx b/configmgr/source/backend/emptylayerimpl.hxx
deleted file mode 100644
index e78defd2b3..0000000000
--- a/configmgr/source/backend/emptylayerimpl.hxx
+++ /dev/null
@@ -1,136 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_EMPTYLAYERIMPL_HXX
-#define CONFIGMGR_BACKEND_EMPTYLAYERIMPL_HXX
-
-#include <cppuhelper/implbase1.hxx>
-#include <com/sun/star/configuration/backend/XLayerHandler.hpp>
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-
-// -----------------------------------------------------------------------------
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
- namespace backend
- {
- // -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace backenduno = ::com::sun::star::configuration::backend;
- // -----------------------------------------------------------------------------
-
- class EmptyLayer : public cppu::WeakImplHelper1<backenduno::XLayer>
- {
- public:
- virtual ~EmptyLayer();
-
- // XLayer
- public:
- virtual void SAL_CALL
- readData( const uno::Reference< backenduno::XLayerHandler >& aHandler )
- throw (backenduno::MalformedDataException, lang::NullPointerException, lang::WrappedTargetException, uno::RuntimeException);
- };
- // -----------------------------------------------------------------------------
-
- class RequireEmptyLayer : public cppu::WeakImplHelper1<backenduno::XLayerHandler>
- {
- public:
- RequireEmptyLayer();
- virtual ~RequireEmptyLayer();
-
- bool wasEmpty() const { return m_bEmpty; }
- bool wasInvalid() const { return m_bInvalid; }
- // XLayerHandler
- public:
- virtual void SAL_CALL
- startLayer( )
- throw (backenduno::MalformedDataException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endLayer( )
- throw (backenduno::MalformedDataException, uno::RuntimeException);
-
- virtual void SAL_CALL
- overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear )
- throw (backenduno::MalformedDataException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endNode( )
- throw (backenduno::MalformedDataException, uno::RuntimeException);
-
- virtual void SAL_CALL
- dropNode( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, uno::RuntimeException);
-
- virtual void SAL_CALL
- overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear )
- throw (backenduno::MalformedDataException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType )
- throw (backenduno::MalformedDataException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue )
- throw (backenduno::MalformedDataException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endProperty( )
- throw (backenduno::MalformedDataException, uno::RuntimeException);
-
- virtual void SAL_CALL
- setPropertyValue( const uno::Any& aValue )
- throw (backenduno::MalformedDataException, uno::RuntimeException);
-
- virtual void SAL_CALL
- setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString& aLocale )
- throw (backenduno::MalformedDataException, uno::RuntimeException);
-
- private:
- void failNotEmpty() { fail("layer is not empty"); }
- void fail(sal_Char const * pMsg);
-
- private:
- bool m_bStarted;
- bool m_bInvalid;
- bool m_bEmpty;
- };
- // -----------------------------------------------------------------------------
- } // namespace xml
- // -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
diff --git a/configmgr/source/backend/importmergehandler.cxx b/configmgr/source/backend/importmergehandler.cxx
deleted file mode 100644
index a69815dfd8..0000000000
--- a/configmgr/source/backend/importmergehandler.cxx
+++ /dev/null
@@ -1,296 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "importmergehandler.hxx"
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/beans/NamedValue.hpp>
-#include <rtl/ustrbuf.hxx>
-
-
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- namespace beans = ::com::sun::star::beans;
-
-// -----------------------------------------------------------------------------
-
-ImportMergeHandler::ImportMergeHandler(
- uno::Reference< backenduno::XBackend > const & xTargetBackend, Mode mode, rtl::OUString const & aEntity, sal_Bool const & bNotify )
-: BasicImportHandler(xTargetBackend,aEntity, bNotify)
-, m_xOutputHandler()
-, m_mode(mode)
-{
-}
-// -----------------------------------------------------------------------------
-
-void ImportMergeHandler::failNotStarted()
-{
- OSL_ENSURE(!hasComponent(), "Import handler after failure to create output handler or after closing");
- raiseMalformedDataException("configmgr::backend::ImportHandler: Trying to generate output before identifying the target component");
-}
-// -----------------------------------------------------------------------------
-
-inline bool ImportMergeHandler::isStarted() const
-{
- return !! m_xOutputHandler.is();
-}
-// -----------------------------------------------------------------------------
-
-inline void ImportMergeHandler::checkStarted()
-{
- if (!isStarted()) failNotStarted();
-}
-// -----------------------------------------------------------------------------
-
-inline uno::Reference< backenduno::XUpdateHandler > ImportMergeHandler::getOutputHandler()
-{
- checkStarted();
- return m_xOutputHandler;
-}
-// -----------------------------------------------------------------------------
-
-static
-bool setHandlerProperty(uno::Reference< uno::XInterface > const & xHandler, char const * property, sal_Bool value)
-{
- OSL_ASSERT(property);
- uno::Reference< lang::XInitialization > xInitHandler( xHandler, uno::UNO_QUERY );
- if (xHandler.is())
- try
- {
- uno::Sequence< uno::Any > aArgs(1);
- aArgs[0] <<= beans::NamedValue( rtl::OUString::createFromAscii(property), uno::makeAny(value) );
- xInitHandler->initialize(aArgs);
- return true;
- }
- catch (uno::Exception & e)
- {
- OSL_TRACE("Configuration Import Handler - Could not set output handler property '%s': %s\n",
- property,rtl::OUStringToOString(e.Message,RTL_TEXTENCODING_ASCII_US).getStr());
-
- OSL_ENSURE(false, "Output Handler does not support expected property" );
- }
- else
- {
- OSL_TRACE("Configuration Import Handler - Could not set output handler property '%s': %s\n",
- property,"Object does not support expected interface");
-
- OSL_ENSURE(false, "Output Handler does not support expected interface" );
- }
- return false;
-}
-// -----------------------------------------------------------------------------
-uno::Reference< backenduno::XUpdateHandler > ImportMergeHandler::createOutputHandler()
-{
- OSL_PRECOND( hasComponent(), "Trying to create output-handler for Import Merger without setting a component first") ;
- rtl::OUString const aComponentName = this->getComponent();
-
- uno::Reference< backenduno::XUpdateHandler > xOutputHandler;
- try
- {
- xOutputHandler = hasEntity() ? getBackend()->getUpdateHandler(aComponentName,getEntity())
- : getBackend()->getOwnUpdateHandler(aComponentName);
- }
- catch (lang::NoSupportException & e)
- {
- rtl::OUStringBuffer sMessage;
- sMessage.appendAscii("configmgr::backend::ImportHandler: ");
- sMessage.appendAscii("Could not get output handler for component ").append(aComponentName);
- sMessage.appendAscii(": Backend does not support updates - ").append( e.Message );
-
- throw lang::WrappedTargetException(sMessage.makeStringAndClear(), *this, uno::makeAny(e));
- }
- catch (lang::IllegalArgumentException & e)
- {
- rtl::OUStringBuffer sMessage;
- sMessage.appendAscii("configmgr::backend::ImportHandler: ");
- sMessage.appendAscii("Could not get output handler for component ").append(aComponentName);
- sMessage.appendAscii(" due to a backend exception: ").append( e.Message );
-
- throw lang::WrappedTargetException(sMessage.makeStringAndClear(), *this, uno::makeAny(e));
- }
-
- if (!xOutputHandler.is())
- {
- rtl::OUStringBuffer sMessage;
- sMessage.appendAscii("configmgr::backend::ImportHandler: ");
- sMessage.appendAscii("Cannot import. ERROR - The backend returns a NULL handler for component ")
- .append(aComponentName).append( sal_Unicode('.') );
-
- throw uno::RuntimeException(sMessage.makeStringAndClear(), *this);
- }
-
- switch (m_mode)
- {
- case merge: break;
- case copy: setHandlerProperty(xOutputHandler,"Truncate", sal_True); break;
- case no_overwrite: setHandlerProperty(xOutputHandler,"Overwrite",sal_False); break;
-
- default: OSL_ASSERT(false); break;
- }
-
- return xOutputHandler;
-}
-// -----------------------------------------------------------------------------
-
-// XLayerHandler
-
-void SAL_CALL ImportMergeHandler::startLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- m_xOutputHandler.clear();
-
- BasicImportHandler::startLayer();
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL ImportMergeHandler::endLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (isStarted())
- try
- {
- getOutputHandler()->endUpdate();
- }
- catch (lang::IllegalAccessException & iae)
- {
- rtl::OUString const sMsg(RTL_CONSTASCII_USTRINGPARAM("ImportHandler - no write access to layer: "));
- throw lang::WrappedTargetException(sMsg.concat(iae.Message),*this,uno::makeAny(iae));
- }
-
- BasicImportHandler::endLayer();
- m_xOutputHandler.clear();
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL ImportMergeHandler::overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (!isStarted() && startComponent(aName))
- try
- {
- (m_xOutputHandler = createOutputHandler())->startUpdate( );
- }
- catch (lang::IllegalAccessException & iae)
- {
- rtl::OUString const sMsg(RTL_CONSTASCII_USTRINGPARAM("ImportHandler - no write access to layer: "));
- throw lang::WrappedTargetException(sMsg.concat(iae.Message),*this,uno::makeAny(iae));
- }
-
- OSL_ENSURE(!bClear,"'clear' operation not supported properly on import");
-
- bool bReset = (m_mode != merge) || bClear; // is not relevant for no_overwrite,but might be cheaper there
- getOutputHandler()->modifyNode(aName,aAttributes,aAttributes,bReset);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL ImportMergeHandler::addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- getOutputHandler()->addOrReplaceNode(aName,aAttributes);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL ImportMergeHandler::addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- getOutputHandler()->addOrReplaceNodeFromTemplate(aName,aAttributes,aTemplate);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL ImportMergeHandler::endNode( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- getOutputHandler()->endNode();
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL ImportMergeHandler::dropNode( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- getOutputHandler()->removeNode(aName);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL ImportMergeHandler::overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- (void) bClear; // avoid warning about unused parameter
- OSL_ENSURE(!bClear,"'clear' operation not supported on import");
- getOutputHandler()->modifyProperty(aName,aAttributes,aAttributes,aType);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL ImportMergeHandler::endProperty( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- getOutputHandler()->endProperty();
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL ImportMergeHandler::setPropertyValue( const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- getOutputHandler()->setPropertyValue(aValue);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL ImportMergeHandler::setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString & aLocale )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- getOutputHandler()->setPropertyValueForLocale(aValue,aLocale);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL ImportMergeHandler::addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- getOutputHandler()->addOrReplaceProperty(aName, aAttributes, aType);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL ImportMergeHandler::addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- getOutputHandler()->addOrReplacePropertyWithValue(aName, aAttributes, aValue);
-}
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace
-
-// -----------------------------------------------------------------------------
-} // namespace
-
diff --git a/configmgr/source/backend/importmergehandler.hxx b/configmgr/source/backend/importmergehandler.hxx
deleted file mode 100644
index 55032fca46..0000000000
--- a/configmgr/source/backend/importmergehandler.hxx
+++ /dev/null
@@ -1,134 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_IMPORTMERGEHANDLER_HXX
-#define CONFIGMGR_BACKEND_IMPORTMERGEHANDLER_HXX
-
-#include "basicimporthandler.hxx"
-
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace backenduno = ::com::sun::star::configuration::backend;
-// -----------------------------------------------------------------------------
-
- class ImportMergeHandler : public BasicImportHandler
- {
- public:
- enum Mode
- {
- merge, // merge as update into existing data
- copy, // reset existing data first -> copy imported data
- no_overwrite // copy/merge only if no data is in the layer
- };
-
- explicit
- ImportMergeHandler(uno::Reference< backenduno::XBackend > const & xTargetBackend, Mode mode,
- rtl::OUString const & aEntity = rtl::OUString(), sal_Bool const & bNotify = sal_False);
-
- // XLayerHandler
- protected:
- virtual void SAL_CALL
- startLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endNode( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- dropNode( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endProperty( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- setPropertyValue( const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString & aLocale )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
- private:
- bool isStarted() const;
- void checkStarted();
- void failNotStarted();
-
- uno::Reference< backenduno::XUpdateHandler > getOutputHandler();
-
- uno::Reference< backenduno::XUpdateHandler > createOutputHandler();
- private:
- uno::Reference< backenduno::XUpdateHandler > m_xOutputHandler;
- Mode m_mode;
- };
-// -----------------------------------------------------------------------------
- } // namespace xml
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/backend/importsvc.cxx b/configmgr/source/backend/importsvc.cxx
deleted file mode 100644
index 7e03ffa49e..0000000000
--- a/configmgr/source/backend/importsvc.cxx
+++ /dev/null
@@ -1,335 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "importsvc.hxx"
-#include "importmergehandler.hxx"
-#include "backendfactory.hxx"
-
-#ifndef CONFIGMGR_API_FACTORY_HXX_
-#include "confapifactory.hxx"
-#endif
-#include <com/sun/star/beans/NamedValue.hpp>
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace beans = ::com::sun::star::beans;
- namespace backenduno = ::com::sun::star::configuration::backend;
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-sal_Char const * const aMergeImporterServices[] =
-{
- "com.sun.star.configuration.backend.MergeImporter",
- 0,
- "com.sun.star.configuration.backend.Importer",
- 0
-};
-const ServiceImplementationInfo aMergeImporterSI =
-{
- "com.sun.star.comp.configuration.backend.MergeImporter",
- aMergeImporterServices, aMergeImporterServices + 2
-};
-// -----------------------------------------------------------------------------
-
-const ServiceRegistrationInfo* getMergeImportServiceInfo()
-{ return getRegistrationInfo(& aMergeImporterSI); }
-// -----------------------------------------------------------------------------
-
-MergeImportService::MergeImportService(uno::Reference< uno::XComponentContext > const & _xContext)
-: ImportService(_xContext, &aMergeImporterSI)
-{
-}
-// -----------------------------------------------------------------------------
-
-uno::Reference< uno::XInterface > SAL_CALL instantiateMergeImporter
-( uno::Reference< uno::XComponentContext > const& xContext )
-{
- return * new MergeImportService( xContext );
-}
-// -----------------------------------------------------------------------------
-
-uno::Reference< backenduno::XLayerHandler > MergeImportService::createImportHandler(uno::Reference< backenduno::XBackend > const & xBackend, rtl::OUString const & aEntity)
-{
- if (!xBackend.is())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("configmgr::backend::ImportService: Trying to import without a backend. No default backend could be created") );
- throw lang::NullPointerException(sMessage,*this);
- }
-
- uno::Reference< backenduno::XLayerHandler > aHandler( new ImportMergeHandler(xBackend, ImportMergeHandler::merge, aEntity, m_bSendNotification) );
-
- return aHandler;
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-sal_Char const * const aCopyImporterServices[] =
-{
- "com.sun.star.configuration.backend.CopyImporter",
- 0,
- "com.sun.star.configuration.backend.Importer",
- 0
-};
-const ServiceImplementationInfo aCopyImporterSI =
-{
- "com.sun.star.comp.configuration.backend.CopyImporter",
- aCopyImporterServices, aCopyImporterServices + 2
-};
-// -----------------------------------------------------------------------------
-
-const ServiceRegistrationInfo* getCopyImportServiceInfo()
-{ return getRegistrationInfo(& aCopyImporterSI); }
-// -----------------------------------------------------------------------------
-
-CopyImportService::CopyImportService(uno::Reference< uno::XComponentContext > const & _xContext)
-: ImportService(_xContext, &aCopyImporterSI)
-{
-}
-// -----------------------------------------------------------------------------
-
-uno::Reference< uno::XInterface > SAL_CALL instantiateCopyImporter
-( uno::Reference< uno::XComponentContext > const& xContext )
-{
- return * new CopyImportService( xContext );
-}
-// -----------------------------------------------------------------------------
-
-uno::Reference< backenduno::XLayerHandler > CopyImportService::createImportHandler(uno::Reference< backenduno::XBackend > const & xBackend, rtl::OUString const & aEntity)
-{
- if (!xBackend.is())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("configmgr::backend::ImportService: Trying to import without a backend. No default backend could be created") );
- throw lang::NullPointerException(sMessage,*this);
- }
-
- ImportMergeHandler::Mode aMode = m_bOverwrite ? ImportMergeHandler::copy : ImportMergeHandler::no_overwrite;
- uno::Reference< backenduno::XLayerHandler > aHandler( new ImportMergeHandler(xBackend,aMode,aEntity) );
-
- return aHandler;
-}
-// -----------------------------------------------------------------------------
-
-sal_Bool CopyImportService::setImplementationProperty(rtl::OUString const & aName, uno::Any const & aValue)
-{
- if (aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Overwrite")))
- {
- return (aValue >>= m_bOverwrite);
- }
-
- return ImportService::setImplementationProperty(aName,aValue);
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-ImportService::ImportService(uno::Reference< uno::XComponentContext > const & _xContext, ServiceInfoHelper const & aSvcInfo )
-: m_bSendNotification(false)
-, m_aMutex()
-, m_xContext(_xContext)
-, m_xDestinationBackend()
-, m_aServiceInfo(aSvcInfo)
-{
- if (!m_xContext.is())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration Importer: Unexpected NULL context"));
- throw lang::NullPointerException(sMessage,NULL);
- }
-}
-// -----------------------------------------------------------------------------
-
-ImportService::~ImportService()
-{}
-// -----------------------------------------------------------------------------
-
-uno::Reference< backenduno::XBackend > ImportService::createDefaultBackend() const
-{
- return BackendFactory::instance( m_xContext ).getUnoBackend();
-}
-// -----------------------------------------------------------------------------
-
-sal_Bool ImportService::setImplementationProperty(rtl::OUString const & aName, uno::Any const & aValue)
-{
- if (aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Notify")))
- {
- return (aValue >>= m_bSendNotification);
- }
-
- return false;
-}
-// -----------------------------------------------------------------------------
-
-// XInitialize
-
-void SAL_CALL
- ImportService::initialize( const uno::Sequence< uno::Any >& aArguments )
- throw (uno::Exception, uno::RuntimeException)
-{
- sal_Int16 const nCount = static_cast<sal_Int16>(aArguments.getLength());
-
- if (sal_Int32(nCount) != aArguments.getLength())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Too many arguments to initialize a Configuration Importer"));
- throw lang::IllegalArgumentException(sMessage,*this,0);
- }
-
- for (sal_Int16 i = 0; i < nCount; ++i)
- {
- beans::NamedValue aExtraArg;
- if (aArguments[i] >>= aExtraArg)
- {
- OSL_VERIFY( setImplementationProperty(aExtraArg.Name, aExtraArg.Value) );
-
- continue;
- }
-
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Cannot use argument to initialize a Configuration Importer"
- "- NamedValue expected"));
- throw lang::IllegalArgumentException(sMessage,*this,i+1);
- }
-}
-
-// -----------------------------------------------------------------------------
-
-// XLayerImporter
-
-uno::Reference< backenduno::XBackend > SAL_CALL
- ImportService::getTargetBackend( )
- throw (uno::RuntimeException)
-{
- uno::Reference< backenduno::XBackend > xRet;
- {
- osl::MutexGuard aGuard(m_aMutex);
- xRet = m_xDestinationBackend;
- }
-
- if (!xRet.is())
- {
- xRet = createDefaultBackend();
-
- osl::MutexGuard aGuard(m_aMutex);
- if (!m_xDestinationBackend.is())
- m_xDestinationBackend = xRet;
- }
- return xRet;
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- ImportService::setTargetBackend( const uno::Reference< backenduno::XBackend >& aBackend )
- throw (lang::NullPointerException, uno::RuntimeException)
-{
- if (!aBackend.is())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("configmgr::backend::ImportService: Trying to set a NULL backend") );
- throw lang::NullPointerException(sMessage,*this);
- }
-
- osl::MutexGuard aGuard(m_aMutex);
- m_xDestinationBackend = aBackend;
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- ImportService::importLayer( const uno::Reference< backenduno::XLayer >& aLayer )
- throw ( backenduno::MalformedDataException,
- lang::WrappedTargetException, lang::IllegalArgumentException,
- lang::NullPointerException, uno::RuntimeException)
-{
- if (!aLayer.is())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("configmgr::backend::ImportService: Trying to import a NULL layer") );
- throw lang::NullPointerException(sMessage,*this);
- }
-
- uno::Reference< backenduno::XLayerHandler > aInputHandler = createImportHandler( getTargetBackend() );
- aLayer->readData( aInputHandler );
-
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- ImportService::importLayerForEntity( const uno::Reference< backenduno::XLayer >& aLayer, const rtl::OUString& aEntity )
- throw ( backenduno::MalformedDataException,
- lang::WrappedTargetException, lang::IllegalArgumentException,
- lang::NullPointerException, uno::RuntimeException)
-{
- if (!aLayer.is())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("configmgr::backend::ImportService: Trying to import a NULL layer") );
- throw lang::NullPointerException(sMessage,*this);
- }
-
- uno::Reference< backenduno::XLayerHandler > aInputHandler = createImportHandler( getTargetBackend(), aEntity );
- aLayer->readData( aInputHandler );
-}
-// -----------------------------------------------------------------------------
-
-// XServiceInfo
-
-rtl::OUString SAL_CALL
- ImportService::getImplementationName( )
- throw (uno::RuntimeException)
-{
- return getServiceInfo().getImplementationName( );
-}
-// -----------------------------------------------------------------------------
-
-
-sal_Bool SAL_CALL
- ImportService::supportsService( const rtl::OUString& ServiceName )
- throw (uno::RuntimeException)
-{
- return getServiceInfo().supportsService( ServiceName );
-}
-// -----------------------------------------------------------------------------
-
-
-uno::Sequence< ::rtl::OUString > SAL_CALL
- ImportService::getSupportedServiceNames( )
- throw (uno::RuntimeException)
-{
- return getServiceInfo().getSupportedServiceNames( );
-}
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace
-
-// -----------------------------------------------------------------------------
-} // namespace
-
diff --git a/configmgr/source/backend/importsvc.hxx b/configmgr/source/backend/importsvc.hxx
deleted file mode 100644
index d57786fb79..0000000000
--- a/configmgr/source/backend/importsvc.hxx
+++ /dev/null
@@ -1,154 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_IMPORTSVC_HXX
-#define CONFIGMGR_BACKEND_IMPORTSVC_HXX
-
-#include "serviceinfohelper.hxx"
-#include <cppuhelper/implbase3.hxx>
-#include <osl/mutex.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/configuration/backend/XLayerImporter.hpp>
-#include <com/sun/star/configuration/backend/XLayerHandler.hpp>
-
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace backenduno = ::com::sun::star::configuration::backend;
-// -----------------------------------------------------------------------------
-
- class ImportService : public ::cppu::WeakImplHelper3<
- backenduno::XLayerImporter,
- lang::XInitialization,
- lang::XServiceInfo
- >
- {
- public:
- explicit
- ImportService(uno::Reference< uno::XComponentContext > const & _xContext, ServiceInfoHelper const & aSvcInfo);
- ~ImportService();
-
- // XInitialization
- virtual void SAL_CALL
- initialize( const uno::Sequence< uno::Any >& aArguments )
- throw (uno::Exception, uno::RuntimeException);
-
- // XServiceInfo
- virtual rtl::OUString SAL_CALL
- getImplementationName( )
- throw (uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- supportsService( const rtl::OUString& ServiceName )
- throw (uno::RuntimeException);
-
- virtual uno::Sequence< rtl::OUString > SAL_CALL
- getSupportedServiceNames( )
- throw (uno::RuntimeException);
-
- // XLayerImporter
- virtual uno::Reference< backenduno::XBackend > SAL_CALL
- getTargetBackend( )
- throw (uno::RuntimeException);
-
- virtual void SAL_CALL
- setTargetBackend( const uno::Reference< backenduno::XBackend >& aBackend )
- throw (lang::NullPointerException, uno::RuntimeException);
-
- virtual void SAL_CALL
- importLayer( const uno::Reference< backenduno::XLayer >& aLayer )
- throw ( backenduno::MalformedDataException,
- lang::WrappedTargetException, lang::IllegalArgumentException,
- lang::NullPointerException, uno::RuntimeException);
-
- virtual void SAL_CALL
- importLayerForEntity( const uno::Reference< backenduno::XLayer >& aLayer, const rtl::OUString& aEntity )
- throw ( backenduno::MalformedDataException,
- lang::WrappedTargetException, lang::IllegalArgumentException,
- lang::NullPointerException, uno::RuntimeException);
- protected:
- uno::Reference< backenduno::XBackend > createDefaultBackend() const;
-
- //uno::Reference< lang::XMultiServiceFactory > getServiceFactory() const
-
- virtual sal_Bool setImplementationProperty( rtl::OUString const & aName, uno::Any const & aValue);
- /** Notify backend of import */
- sal_Bool m_bSendNotification;
- private:
- // is pure virtual to allow different import services
- virtual uno::Reference< backenduno::XLayerHandler > createImportHandler(uno::Reference< backenduno::XBackend > const & xBackend, rtl::OUString const & aEntity = rtl::OUString()) = 0;
-
- private:
- osl::Mutex m_aMutex;
- uno::Reference< uno::XComponentContext > m_xContext;
- uno::Reference< backenduno::XBackend > m_xDestinationBackend;
-
-
- ServiceInfoHelper m_aServiceInfo;
-
- ServiceInfoHelper const & getServiceInfo() const { return m_aServiceInfo; }
- };
-// -----------------------------------------------------------------------------
-
- class MergeImportService : public ImportService
- {
- public:
- explicit MergeImportService(uno::Reference< uno::XComponentContext > const & _xContext);
- private:
- uno::Reference< backenduno::XLayerHandler > createImportHandler(uno::Reference< backenduno::XBackend > const & xBackend, rtl::OUString const & aEntity);
- };
-// -----------------------------------------------------------------------------
-
- class CopyImportService : public ImportService
- {
- public:
- explicit CopyImportService(uno::Reference< uno::XComponentContext > const & _xContext);
- private:
- uno::Reference< backenduno::XLayerHandler > createImportHandler(uno::Reference< backenduno::XBackend > const & xBackend, rtl::OUString const & aEntity);
- sal_Bool setImplementationProperty( rtl::OUString const & aName, uno::Any const & aValue);
- private:
- sal_Bool m_bOverwrite;
- };
-// -----------------------------------------------------------------------------
- } // namespace xml
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/backend/layerdefaultremover.cxx b/configmgr/source/backend/layerdefaultremover.cxx
deleted file mode 100644
index 616fced951..0000000000
--- a/configmgr/source/backend/layerdefaultremover.cxx
+++ /dev/null
@@ -1,275 +0,0 @@
-/*************************************************************************
-*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
-************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "layerdefaultremover.hxx"
-
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
- namespace backend
- {
- // -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- // -----------------------------------------------------------------------------
-
- LayerDefaultRemover::LayerDefaultRemover(uno::Reference< backenduno::XLayerHandler > const & _xResultHandler)
- :m_xResultHandler(_xResultHandler)
- {
- }
- // -----------------------------------------------------------------------------
-
- LayerDefaultRemover::~LayerDefaultRemover( )
- {
- }
- // -----------------------------------------------------------------------------
-
- bool LayerDefaultRemover::hasPendingProperty()
- {
- return m_aPropName.Name.getLength()!=0;
- }
- // -----------------------------------------------------------------------------
-
- void LayerDefaultRemover::clearPendingProperty()
- {
- m_aPropName = PropertyStruct();
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerDefaultRemover::startLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
- {
- clearPendingProperty();
- m_xResultHandler->startLayer();
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerDefaultRemover::endLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
- {
- if (hasPendingProperty())
- {
- sal_Char const * pMsg =
- "LayerDefaultRemover: Illegal property started operation";
- raiseMalformedDataException(pMsg);
- }
- if (!m_aNodeStack.empty())
- {
- sal_Char const * pMsg =
- "LayerDefaultRemover: Illegal node started operation";
- raiseMalformedDataException(pMsg);
- }
- m_xResultHandler->endLayer();
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerDefaultRemover::overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
- {
- if (hasPendingProperty())
- {
- sal_Char const * pMsg =
- "LayerDefaultRemover: Illegal property started operation";
- raiseMalformedDataException(pMsg);
- }
- if (aAttributes == 0 && !bClear)
- {
- m_aNodeStack.push_back(aName);
- }
- else
- {
- playBackNodeStack();
- m_xResultHandler->overrideNode(aName,aAttributes,bClear);
- }
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerDefaultRemover::addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
- {
- playBackNodeStack();
- m_xResultHandler->addOrReplaceNode(aName, aAttributes);
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerDefaultRemover::addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
- {
- playBackNodeStack();
- m_xResultHandler->addOrReplaceNodeFromTemplate(aName,aTemplate,aAttributes);
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerDefaultRemover::endNode( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
- {
- if (hasPendingProperty())
- {
- sal_Char const * pMsg =
- "LayerDefaultRemover: Illegal property started operation";
- raiseMalformedDataException(pMsg);
- }
- if (m_aNodeStack.empty())
- {
- m_xResultHandler->endNode();
- }
- else
- {
- m_aNodeStack.pop_back();
- }
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerDefaultRemover::dropNode( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
- {
- playBackNodeStack();
- m_xResultHandler->dropNode(aName);
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerDefaultRemover::addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
- {
- playBackNodeStack();
- m_xResultHandler->addProperty (aName,aAttributes,aType);
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerDefaultRemover::addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
- {
- playBackNodeStack();
- m_xResultHandler->addPropertyWithValue(aName,aAttributes,aValue);
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerDefaultRemover::overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
- {
- if (hasPendingProperty())
- {
- sal_Char const * pMsg =
- "LayerDefaultRemover: Illegal property started operation";
- raiseMalformedDataException(pMsg);
- }
- if (aAttributes != 0 || bClear)
- {
- m_aPropName.Name=rtl::OUString();
- playBackNodeStack();
- m_xResultHandler->overrideProperty(aName,aAttributes,aType,bClear);
- }
- else
- {
- m_aPropName.Name = aName;
- m_aPropName.Type = aType;
- }
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerDefaultRemover::endProperty( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
- {
- if (hasPendingProperty())
- {
- clearPendingProperty();
- }
- else
- m_xResultHandler->endProperty();
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerDefaultRemover::setPropertyValue( const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
- {
- playBackNodeStack(true);
- m_xResultHandler->setPropertyValue(aValue);
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerDefaultRemover::setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString& aLocale )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
- {
- playBackNodeStack(true);
- m_xResultHandler->setPropertyValueForLocale(aValue,aLocale);
- }
- // -----------------------------------------------------------------------------
-
- void LayerDefaultRemover::playBackNodeStack(bool bPlayProperty)
- {
- if (!bPlayProperty && hasPendingProperty())
- {
- sal_Char const * pMsg =
- "LayerDefaultRemover: Illegal property started operation";
- raiseMalformedDataException(pMsg);
- }
- if ( !hasPendingProperty() && bPlayProperty && !m_aNodeStack.empty() )
- {
- sal_Char const * pMsg =
- "LayerDefaultRemover: Illegal Operation: Operation requires a started property";
- raiseMalformedDataException(pMsg);
- }
- if (!m_aNodeStack.empty())
- {
- for (std::vector<rtl::OUString>::iterator aIter = m_aNodeStack.begin();
- aIter != m_aNodeStack.end(); aIter++)
- {
- m_xResultHandler->overrideNode(*aIter, 0,false);
- }
- m_aNodeStack.clear();
- }
- if (bPlayProperty)
- {
- if (hasPendingProperty())
- {
- m_xResultHandler->overrideProperty(m_aPropName.Name,0,m_aPropName.Type,false);
- clearPendingProperty();
- }
- }
- }
- // -----------------------------------------------------------------------------
-
- void LayerDefaultRemover::raiseMalformedDataException(sal_Char const * pMsg)
- {
- OSL_ASSERT(pMsg);
- rtl::OUString sMsg = rtl::OUString::createFromAscii(pMsg);
-
- throw backenduno::MalformedDataException( sMsg, *this, uno::Any() );
- }
-
- // -----------------------------------------------------------------------------
- // -----------------------------------------------------------------------------
- // -----------------------------------------------------------------------------
- } // namespace
-
- // -----------------------------------------------------------------------------
-} // namespace
-
diff --git a/configmgr/source/backend/layerdefaultremover.hxx b/configmgr/source/backend/layerdefaultremover.hxx
deleted file mode 100644
index 8d0132538c..0000000000
--- a/configmgr/source/backend/layerdefaultremover.hxx
+++ /dev/null
@@ -1,132 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_XML_LAYERDECORATOR_HXX
-#define CONFIGMGR_XML_LAYERDECORATOR_HXX
-
-#include <cppuhelper/implbase1.hxx>
-
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif
-
-#include <com/sun/star/configuration/backend/XLayerHandler.hpp>
-
-// -----------------------------------------------------------------------------
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
- namespace backend
- {
- // -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace backenduno = ::com::sun::star::configuration::backend;
- // -----------------------------------------------------------------------------
-
- class LayerDefaultRemover : public cppu::WeakImplHelper1<backenduno::XLayerHandler>
- {
- public:
- explicit
- LayerDefaultRemover(uno::Reference< backenduno::XLayerHandler > const & _xResultHandler);
- virtual ~LayerDefaultRemover();
-
- // XLayerHandler
- public:
- virtual void SAL_CALL
- startLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endNode( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- dropNode( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endProperty( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- setPropertyValue( const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString& aLocale )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- private:
- void playBackNodeStack( bool bPlayProperty=false);
- void raiseMalformedDataException(sal_Char const * pMsg);
- inline bool hasPendingProperty();
- inline void clearPendingProperty();
- private:
- uno::Reference< backenduno::XLayerHandler > m_xResultHandler;
- std::vector<rtl::OUString> m_aNodeStack;
- struct PropertyStruct
- {
- rtl::OUString Name;
- uno::Type Type;
- }m_aPropName;
- };
- // -----------------------------------------------------------------------------
- } // namespace xml
- // -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
diff --git a/configmgr/source/backend/layermerge.cxx b/configmgr/source/backend/layermerge.cxx
deleted file mode 100644
index 5e8039726b..0000000000
--- a/configmgr/source/backend/layermerge.cxx
+++ /dev/null
@@ -1,1036 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "layermerge.hxx"
-#include "treenodefactory.hxx"
-#include "matchlocale.hxx"
-#include "valuetypeconverter.hxx"
-#include "typeconverter.hxx"
-#include <com/sun/star/configuration/backend/SchemaAttribute.hpp>
-#include <com/sun/star/configuration/backend/NodeAttribute.hpp>
-
-#include <rtl/ustrbuf.hxx>
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
-
- namespace SchemaAttribute = backenduno::SchemaAttribute;
- namespace NodeAttribute = backenduno::NodeAttribute;
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-//#if OSL_DEBUG_LEVEL > 0
-// currently not used in debug builds
-#if 0
- static void check_if_complete(uno::Reference< uno::XComponentContext > const & _xContext)
- {
- MergedComponentData aData;
-
- uno::Reference< backenduno::XLayerHandler >
- test(new LayerMergeHandler(_xContext, aData));
- }
-#endif
-
-// -----------------------------------------------------------------------------
-
-struct LayerMergeHandler::Converter
-{
- explicit
- Converter(uno::Reference< uno::XComponentContext > const & xContext);
-
- uno::Any convertValue(uno::Type const & _aTargetType, uno::Any const & _aValue);
-
- static uno::Reference< com::sun::star::script::XTypeConverter > createTCV(uno::Reference< uno::XComponentContext > const & xContext);
-
- ValueConverter m_aConverter;
- bool m_bConvertData;
-};
-// -----------------------------------------------------------------------------
-LayerMergeHandler::LayerMergeHandler(uno::Reference< uno::XComponentContext > const & xContext, MergedComponentData & _rData, ITemplateDataProvider* aTemplateProvider )
-: m_rData(_rData)
-//, m_aContext(xContext,static_cast<backenduno::XLayerHandler*>(this),aTemplateProvider )
-, m_aContext(xContext)
-, m_aFactory()
-, m_aLocale()
-, m_pProperty(NULL)
-, m_pConverter( new Converter(xContext) )
-, m_nSkipping(0)
-, m_bSublayer(false)
-{
- m_aContext = DataBuilderContext(xContext,static_cast<backenduno::XLayerHandler*>(this),aTemplateProvider );
- OSL_ENSURE( m_rData.hasSchema(), "Creating layer merger without default data" );
-}
-// -----------------------------------------------------------------------------
-
-LayerMergeHandler::~LayerMergeHandler( )
-{
- delete m_pConverter;
-}
-// -----------------------------------------------------------------------------
-
-void LayerMergeHandler::prepareLayer()
-{
- OSL_ENSURE(isDone(), "LayerMergeHandler: Warning: Previous layer or schema not terminated properly");
- if (!isDone())
- m_aContext.getLogger().error("Previous layer or schema not terminated properly", "prepareLayer()", "configmgr::LayerMergeHandler");
-
- m_aLocale = localehelper:: getDefaultLanguage();
- m_bSublayer = false;
-
- promoteToDefault(m_rData);
-}
-// -----------------------------------------------------------------------------
-
-bool LayerMergeHandler::prepareSublayer(rtl::OUString const & aLocale)
-{
- OSL_ENSURE(isDone(), "LayerMergeHandler: Warning: Previous layer not terminated properly");
- if (!isDone())
- m_aContext.getLogger().error("Previous layer not terminated properly", "prepareSublayer()", "configmgr::LayerMergeHandler");
-
- m_aLocale = aLocale;
- m_bSublayer = (aLocale.getLength() != 0);
-
- return m_bSublayer;
-}
-// -----------------------------------------------------------------------------
-
-namespace
-{
- struct CheckRestrictedAccessVisitor : NodeAction
- {
- node::Access m_access;
-
- CheckRestrictedAccessVisitor(node::Access _access) : m_access(_access) {}
-
- void handle(ValueNode const & _aNode) { check(_aNode); }
-
- void handle(ISubtree const & _aNode)
- {
- node::Access aNext = check(_aNode);
- CheckRestrictedAccessVisitor(aNext).applyToChildren(_aNode);
- }
-
- node::Access check(INode const & _aNode)
- {
- node::Attributes const aFoundAttr = _aNode.getAttributes();
- node::Access const aFoundAccess = aFoundAttr.getAccess();
- OSL_ENSURE(m_access <= aFoundAccess, "Subnode has more access than its parent");
-
- return aFoundAccess;
- }
- };
-// --------------------
- struct RestrictAccessVisitor : NodeModification
- {
- node::Access m_access;
-
- RestrictAccessVisitor(bool _bFinalize)
- : m_access(_bFinalize ? node::accessFinal : node::accessReadonly)
- {}
-
- void handle(ValueNode & _aNode) { restrict(_aNode); }
-
- void handle(ISubtree & _aNode)
- {
- if (restrict(_aNode))
- this->applyToChildren(_aNode);
- else
- OSL_DEBUG_ONLY(CheckRestrictedAccessVisitor(m_access).applyToNode(_aNode));
- }
-
- bool restrict(INode & _aNode)
- {
- node::Attributes const aFoundAttr = _aNode.getAttributes();
-
- if (aFoundAttr.getAccess() >= m_access) return false; // already restricted enough
-
- _aNode.modifyAccess(m_access);
- return true;
- }
- };
-}
-// -----------------------------------------------------------------------------
-void LayerMergeHandler::propagateAttributes(ISubtree & _rParent)
-{
- node::Attributes aAttributes = _rParent.getAttributes();
-
- if (aAttributes.isReadonly() || aAttributes.isFinalized())
- RestrictAccessVisitor(aAttributes.isWritable()).applyToChildren(_rParent);
-}
-// -----------------------------------------------------------------------------
-
-node::Attributes LayerMergeHandler::makePropertyAttributes(sal_Int16 aSchemaAttributes)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- const sal_uInt16 k_allPropertySchemaAttributes =
- SchemaAttribute::REQUIRED;
-
- if ((aSchemaAttributes & k_allPropertySchemaAttributes) !=
- (aSchemaAttributes & SchemaAttribute::MASK))
- {
- sal_Char const * pMsg = (aSchemaAttributes & SchemaAttribute::LOCALIZED) ?
- "Layer merging: Cannot add localized property to extensible node" :
- "Layer merging: Unreckognized Schema Attribute for new Property" ;
-
- m_aContext.raiseIllegalArgumentException(pMsg,2);
- }
- OSL_ASSERT( !(aSchemaAttributes & SchemaAttribute::LOCALIZED) ); // check the check
-
- node::Attributes aAttributes = m_aContext.getCurrentAttributes();
-
- if (aSchemaAttributes & SchemaAttribute::REQUIRED)
- aAttributes.setNullable (false);
-
- //Set state, removable and mandatory attribute flags
- aAttributes.setState(node::isAdded);
- aAttributes.setRemovability(true,true);
-
-
- return aAttributes;
-
-}
-// -----------------------------------------------------------------------------
-
-void LayerMergeHandler::checkPropertyType(uno::Type const & _aType)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- OSL_ASSERT(m_pProperty);
-
- if (ValueNode * pValue = m_pProperty->asValueNode())
- {
- if (pValue->getValueType() != _aType)
- {
- if (pValue->getValueType().getTypeClass() == uno::TypeClass_ANY)
- {
- OSL_ENSURE( pValue->isNull(), "Layer merging: Non-null 'any' value" );
-
- if (_aType != uno::Type())
- OSL_VERIFY( pValue->setValueType(_aType) );
-
- else
- {
- OSL_TRACE("Layer merging: Illegal property type: VOID overriding ANY");
- m_aContext.getLogger().warning("Illegal property type: VOID overriding ANY - ignoring",
- "checkPropertyType()", "configmgr::LayerMergeHandler");
- // m_aContext.raiseIllegalTypeException("Layer merging: Illegal property type: VOID overriding ANY");
- }
- }
- else if (_aType == uno::Type() && m_pConverter)
- m_pConverter->m_bConvertData = true;
-
- else
- m_aContext.raiseIllegalTypeException("Layer merging: Cannot merge property value: types does not match");
- }
- }
- else if (ISubtree *localisedSet = m_pProperty->asISubtree()) {
- // We're dealing with localised data.
- uno::Type valueType = parseTemplateName(
- localisedSet->getElementTemplateName()) ;
-
- if (valueType != _aType) {
- if (valueType.getTypeClass() == uno::TypeClass_ANY) {
- if (_aType == uno::Type()) {
- // VOID value
- m_aContext.raiseIllegalTypeException(
- "Layer merging: VOID value for localised ANY type") ;
- }
- // TODO Could we have to set the localised data type?
- }
- else if (_aType == uno::Type() && m_pConverter) {
- m_pConverter->m_bConvertData = sal_True ;
- }
- else {
- m_aContext.raiseIllegalTypeException("Layer merging: property value does not match localised type") ;
- }
- }
- }
-
-}
-// -----------------------------------------------------------------------------
-
-void LayerMergeHandler::setValueAndCheck(ValueNode& _rValueNode, uno::Any const & _aValue)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- if (_aValue.hasValue() && m_pConverter && m_pConverter->m_bConvertData)
- {
- uno::Any aConvertedValue = m_pConverter->convertValue(_rValueNode.getValueType(),_aValue);
- if (!aConvertedValue.hasValue())
- m_aContext.raiseIllegalTypeException("Layer merging: Cannot merge property value: cannot convert data to type of property");
-
- if (! _rValueNode.setValue(aConvertedValue) )
- m_aContext.raiseIllegalTypeException("Layer merging: Cannot merge property value: converted type does not match");
- }
- else if (! _rValueNode.setValue(_aValue) )
- {
- m_aContext.raiseIllegalTypeException("Layer merging: Cannot merge property value: type does not match");
- }
-
-}
-// -----------------------------------------------------------------------------
-
-void LayerMergeHandler::setLocalizedValue(ISubtree * pProperty, uno::Any const & _aValue, rtl::OUString const & _aLocale)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- if (ISubtree * pLocalizedCont = pProperty->asISubtree())
- {
- OSL_ENSURE(isLocalizedValueSet(*pLocalizedCont),"Layer merging: property node is not a value");
-
- if (INode * pLocale = pLocalizedCont->getChild(_aLocale))
- {
- if (ValueNode * pLocValue = pLocale->asValueNode())
- {
- setValueAndCheck(*pLocValue,_aValue);
- }
- else
- {
- OSL_ENSURE(false,"Layer merging: Localized subnode is not a value");
- m_aContext.getLogger().error("Localized subnode is not a value - ignoring data",
- "setLocalizedValue()", "configmgr::LayerMergeHandler");
- }
- }
- else {
- node::Attributes attributes = pLocalizedCont->getAttributes() ;
- uno::Type valueType = parseTemplateName(
- pLocalizedCont->getElementTemplateName()) ;
-
- attributes.setLocalized(false) ;
- OSL_ENSURE(valueType != uno::Type(),
- "Cannot determine type for localised value") ;
- std::auto_ptr<ValueNode> localisedValue =
- m_aFactory.getNodeFactory().createNullValueNode(_aLocale,
- valueType,
- attributes) ;
-
- if (_aValue.hasValue()) {
- setValueAndCheck(*localisedValue, _aValue) ;
- }
- pLocalizedCont->addChild(base_ptr(localisedValue)) ;
- }
- }
-
- else if (ValueNode * pValue = pProperty->asValueNode())
- {
- OSL_ENSURE(false, "Layer merging: Got locale-dependent value for non-localized node");
- m_aContext.getLogger().error("Got locale-dependent value for non-localized node",
- "setLocalizedValue()", "configmgr::LayerMergeHandler");
- setValueAndCheck(*pValue,_aValue);
- }
-
- else
- {
- OSL_ENSURE(false, "Layer merging: Unknown node type for localized node");
- m_aContext.getLogger().error("Unknown node type for localized node",
- "setLocalizedValue()", "configmgr::LayerMergeHandler");
- }
-}
-// -----------------------------------------------------------------------------
-
-void LayerMergeHandler::applyPropertyValue(uno::Any const & _aValue)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- OSL_ASSERT(m_pProperty);
-
- if (ValueNode * pValue = m_pProperty->asValueNode())
- {
- setValueAndCheck(*pValue,_aValue);
- }
-
- else if (ISubtree * pLocalizedCont = m_pProperty->asISubtree())
- {
- setLocalizedValue(pLocalizedCont,_aValue,m_aLocale);
- }
-
- else
- {
- OSL_ENSURE(false, "Layer merging: Unknown node type for property");
- m_aContext.getLogger().error("Unknown node type for property",
- "applyPropertyValue()", "configmgr::LayerMergeHandler");
- }
-}
-// -----------------------------------------------------------------------------
-
-void LayerMergeHandler::applyPropertyValue(uno::Any const & _aValue, rtl::OUString const & _aLocale)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- OSL_ASSERT(m_pProperty);
-
- if (_aLocale.getLength() == 0)
- m_aContext.raiseIllegalArgumentException("Locale string is empty");
-
- if (ISubtree * pLocalizedCont = m_pProperty->asISubtree())
- {
- setLocalizedValue(pLocalizedCont,_aValue, _aLocale);
- }
-
- else if (ValueNode * pValue = m_pProperty->asValueNode())
- {
- //OSL_ENSURE(false, "Layer merging: Got locale-dependent value for non localized node");
- setValueAndCheck(*pValue,_aValue);
- }
-
- else
- {
- OSL_ENSURE(false, "Layer merging: Unknown node type for localized property");
- m_aContext.getLogger().error("Unknown node type for localized property",
- "applyPropertyValue()", "configmgr::LayerMergeHandler");
- }
-}
-// -----------------------------------------------------------------------------
-
-void LayerMergeHandler::applyAttributes(INode * pNode, sal_Int16 aNodeAttributes)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- sal_Int16 const k_allNodeAttributes =
- NodeAttribute::MANDATORY |
- NodeAttribute::FINALIZED |
- NodeAttribute::READONLY;
-
- if ((aNodeAttributes & k_allNodeAttributes) !=
- (aNodeAttributes & NodeAttribute::MASK))
- {
- sal_Char const * pMsg =
- "Layer merging: Unreckognized Node Attribute" ;
-
- m_aContext.raiseIllegalArgumentException(pMsg,2);
- }
-
- if (aNodeAttributes & NodeAttribute::READONLY)
- {
- OSL_ENSURE(!(aNodeAttributes & NodeAttribute::FINALIZED),
- "Layer merging: Warning: Node is both read-only and finalized");
- if (aNodeAttributes & NodeAttribute::FINALIZED)
- m_aContext.getLogger().warning("Node is both read-only and finalized - treating as readonly",
- "applyAttributes()", "configmgr::LayerMergeHandler");
-
- pNode->modifyAccess(node::accessReadonly);
- }
- else if (aNodeAttributes & NodeAttribute::FINALIZED)
- {
- pNode->modifyAccess(node::accessFinal);
- }
-
- if ( m_aContext.isNode(pNode) )
- {
- if (aNodeAttributes & NodeAttribute::MANDATORY)
- {
- pNode->markMandatory();
- }
- }
- else if (aNodeAttributes) // do this only if there actually was something to do
- {
- if (ISubtree * pLocCont = pNode->asISubtree())
- {
- OSL_ENSURE(isLocalizedValueSet(*pLocCont),"Layer merging: Property subtree must be a localized value set");
- propagateAttributes(*pLocCont);
- }
- }
-
-
-}
-// -----------------------------------------------------------------------------
-
-static
-void doLogRejection(sal_Int16 loglevel, DataBuilderContext const & aContext,
- INode * pNode, bool bMandatory)
-{
- rtl::OUStringBuffer aMessage;
- aMessage.appendAscii("Rejecting override: Node/Property ")
- .append(aContext.getNodePath(pNode->getName()))
- .appendAscii(" is ").appendAscii(bMandatory ? "mandatory" : "finalized")
- .appendAscii(" in a prior layer.");
-
- aContext.getLogger().log(loglevel,aMessage.makeStringAndClear(),
- bMandatory ? "addOrReplace/dropNode()" : "startOverride()",
- "configmgr::LayerMergeHandler");
-}
-
-static inline
-void logRejection(DataBuilderContext const & aContext, INode * pNode, bool bMandatory=false)
-{
- const sal_Int16 loglevel = LogLevel::INFO;
- if (aContext.getLogger().isLogging(loglevel))
- {
- doLogRejection(loglevel, aContext, pNode, bMandatory);
- }
-}
-// -----------------------------------------------------------------------------
-
-bool LayerMergeHandler::startOverride(INode * pNode, sal_Bool bClear) /* ensure writable, mark merged */
- SAL_THROW(())
-{
- OSL_PRECOND(pNode,"startOverride: non-NULL base node required");
- if (!m_aContext.isWritable(pNode))
- {
- // #i41700# write-protection is enforced, unless merging localizations
- if (!m_bSublayer)
- {
- logRejection(m_aContext,pNode);
- return false;
- }
- else
- OSL_ASSERT(m_aLocale.getLength() != 0);
- }
-
- OSL_ENSURE(!bClear,"'clear' operation is not yet supported");
- if (bClear)
- m_aContext.getLogger().warning("'clear' operation is not yet supported",
- "startOverride()", "configmgr::LayerMergeHandler");
-
- return true;
-}
-// -----------------------------------------------------------------------------
-
-void LayerMergeHandler::ensureUnchanged(INode const * pNode) const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- // to do: change state handling to detect this within sets
- OSL_PRECOND(pNode,"INTERNAL ERROR: Unexpected NULL node pointer");
-
- if (!this->isInSublayer())
- if (pNode->getAttributes().state() == node::isMerged)
- m_aContext.raiseMalformedDataException("Layer merging: Duplicate node or property in this layer");
-}
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-// XLayerHandler
-
-void SAL_CALL LayerMergeHandler::startLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- ISubtree * pSchema = m_rData.getSchemaTree();
- OSL_ENSURE(pSchema,"No base data to merge layer into");
-
- if (!pSchema)
- {
- m_aContext.getLogger().error("No schema data for merging layer", "startLayer", "configmgr::LayerMergeHandler");
- throw uno::RuntimeException(rtl::OUString::createFromAscii("Layer merging: No data to merge with"),*this);
- }
-
- m_aContext.startActiveComponent(pSchema->getName());
-
- m_pProperty = NULL;
- m_nSkipping = 0;
-
- OSL_POSTCOND( m_aContext.hasActiveComponent(), "Layer merging: could not set active component");
- OSL_POSTCOND( m_aContext.isDone(), "Layer merging: newly started component is not empty");
- OSL_POSTCOND( !this->isSkipping(), "Layer merging: newly started component is in skipping state");
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerMergeHandler::endLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (this->isSkipping())
- m_aContext.raiseMalformedDataException("Layer merging: Unmatched data being skipped was not terminated properly.");
-
- m_aContext.endActiveComponent();
-
- m_bSublayer = false;
-
- OSL_POSTCOND( !m_aContext.hasActiveComponent(), "Layer merging: could not clear active component");
- OSL_POSTCOND( m_aContext.isDone(), "Layer merging: could not finish processing");
-}
-// -----------------------------------------------------------------------------
-
-void LayerMergeHandler::overrideLayerRoot( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear )
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- OSL_PRECOND( m_aContext.hasActiveComponent(), "Layer merging: active component is not set");
- OSL_PRECOND( m_aContext.isDone(), "Layer merging: node is not root");
-
- if (m_aContext.getActiveComponent() != aName)
- m_aContext.raiseIllegalArgumentException("Layer merging: Name of layer being merged does not match component name",1);
-
- // check the argument
- if (ISubtree * pSchema = m_rData.getSchemaTree())
- {
- OSL_ENSURE(pSchema->getName() == aName,"Schema name does not match active component");
-
- ensureUnchanged(pSchema);
-
- if (startOverride(pSchema,bClear))
- {
- applyAttributes(pSchema,aAttributes);
-
- m_aContext.pushNode(pSchema);
-
- OSL_POSTCOND( m_aContext.hasActiveComponent(), "Layer merging: could not set active component");
- OSL_POSTCOND( !m_aContext.isDone(), "Layer merging: could not start component");
- }
- else
- this->skipNode();
- }
- else
- {
- OSL_ENSURE(false,"No base data to merge layer into");
- m_aContext.getLogger().warning("No component data in schema for merging layer",
- "overrideNode() [for layer root]", "configmgr::LayerMergeHandler");
- this->skipNode();
- }
-}
-// -----------------------------------------------------------------------------
-
-static inline
-sal_Int16 getOverrideViolationLogLevel(bool bIsSublayer)
-{ return bIsSublayer ? LogLevel::FINER : LogLevel::INFO; }
-// -----------------------------------------------------------------------------
-
-void LayerMergeHandler::implOverrideNode(
- ISubtree * node, sal_Int16 attributes, bool clear)
-{
- ensureUnchanged(node);
- if (startOverride(node, clear)) {
- applyAttributes(node, attributes);
- m_aContext.pushNode(node);
- } else {
- skipNode();
- }
-}
-
-void SAL_CALL LayerMergeHandler::overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (this->isSkipping())
- {
- this->skipNode();
- }
- else if (m_aContext.isDone())
- {
- this->overrideLayerRoot(aName,aAttributes,bClear);
- }
- else if (ISubtree * pNode = m_aContext.findNode(aName))
- {
- implOverrideNode(pNode, aAttributes, bClear);
- }
- else // ignore non-matched data
- {
- const sal_Int16 loglevel = getOverrideViolationLogLevel(m_bSublayer);
- if (m_aContext.getLogger().isLogging(loglevel))
- {
- rtl::OUStringBuffer aMessage;
- aMessage.appendAscii("Node ").append(m_aContext.getNodePath(aName))
- .appendAscii(" to be overridden does not exist - skipping");
-
- m_aContext.getLogger().log(loglevel,aMessage.makeStringAndClear(), "overrideNode()", "configmgr::LayerMergeHandler");
- }
- // m_aContext.raiseNoSuchElementException("Layer merging: The node to be overridden does not exist.",aName);
- this->skipNode();
- }
-}
-// -----------------------------------------------------------------------------
-
-void LayerMergeHandler::implAddOrReplaceNode( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes )
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException))
-{
- ISubtree * pReplacedNode = m_aContext.findNode(aName);
- if (pReplacedNode)
- {
- if ((aAttributes & NodeAttribute::FUSE) == 0) {
- this->ensureUnchanged(pReplacedNode);
-
- if (!m_aContext.isRemovable(pReplacedNode))
- {
- logRejection(m_aContext,pReplacedNode,true);
- this->skipNode();
- return;
- }
- } else {
- implOverrideNode(
- pReplacedNode, aAttributes & ~NodeAttribute::FUSE, false);
- return;
- }
- }
-
- std::auto_ptr<INode> apNewInstance;
- if (aTemplate.Component == m_aContext.getActiveComponent())
- {
- apNewInstance = m_rData.instantiateTemplate(aName, aTemplate.Name);
- }
- else
- {
- TemplateRequest aTemplateRequest(aTemplate.Name, aTemplate.Component);
- apNewInstance = m_aContext.getTemplateData( aTemplateRequest ).extractDataAndClear();
- if (apNewInstance.get())
- apNewInstance->setName( aName );
- }
-
- if (NULL == apNewInstance.get())
- m_aContext.raiseNoSuchElementException("Layer merging: Cannot instantiate template.", aTemplate.Name);
-
- applyAttributes(apNewInstance.get(), aAttributes & ~NodeAttribute::FUSE);
- //Set removable flag
- apNewInstance->markRemovable();
-
- m_aContext.markCurrentMerged();
-
- if (pReplacedNode) m_aContext.getCurrentParent().removeChild( aName );
-
- INode * pAddedInstance = m_aContext.getCurrentParent().addChild( apNewInstance );
-
- m_aContext.pushNode(pAddedInstance->asISubtree());
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerMergeHandler::addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (this->isSkipping())
- {
- this->skipNode();
- return;
- }
-
- implAddOrReplaceNode( aName, m_aContext.getCurrentItemType(), aAttributes);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerMergeHandler::addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (this->isSkipping())
- {
- this->skipNode();
- return;
- }
-
- // TODO: correct argument position (from 2 to 3) for an illegal argument exception wrt attributes
- implAddOrReplaceNode( aName, m_aContext.getValidItemType(aTemplate), aAttributes);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerMergeHandler::endNode( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (this->leaveSkippedNode())
- return;
-
- this->propagateAttributes(m_aContext.getCurrentParent());
-
- m_aContext.popNode();
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerMergeHandler::dropNode( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (this->isSkipping())
- return;
-
- if (!m_aContext.getCurrentParent().isSetNode())
- m_aContext.raiseMalformedDataException("Layer merging: Removing child nodes is only possible in set nodes.");
-
- if (ISubtree * pDropped = m_aContext.findNode(aName))
- {
- this->ensureUnchanged(pDropped);
- if (!m_aContext.isRemovable(pDropped))
- {
- logRejection(m_aContext,pDropped,true);
- return;
- }
- }
- else
- {
- const sal_Int16 loglevel = getOverrideViolationLogLevel(m_bSublayer);
- if (m_aContext.getLogger().isLogging(loglevel))
- {
- rtl::OUStringBuffer aMessage;
- aMessage.appendAscii("Node ").append(m_aContext.getNodePath(aName))
- .appendAscii(" to be removed does not exist - ignoring");
-
- m_aContext.getLogger().log(loglevel,aMessage.makeStringAndClear(), "dropNode()", "configmgr::LayerMergeHandler");
- }
- // m_aContext.raiseNoSuchElementException("Layer merging: The node to be removed does not exist.",aName);
- }
- m_aContext.markCurrentMerged();
- m_aContext.getCurrentParent().removeChild(aName);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerMergeHandler::overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (this->isSkipping())
- {
- this->skipNode();
- }
- else if (INode * pProp = m_aContext.findProperty(aName))
- {
- ensureUnchanged(pProp);
-
- if (startOverride(pProp,bClear))
- {
- applyAttributes(pProp,aAttributes);
-
- m_pProperty = pProp;
-
- checkPropertyType(aType);
- }
- else
- this->skipNode();
- }
- else // ignore non-matched data
- {
- const sal_Int16 loglevel = getOverrideViolationLogLevel(m_bSublayer);
- if (m_aContext.getLogger().isLogging(loglevel))
- {
- rtl::OUStringBuffer aMessage;
- aMessage.appendAscii("Property ").append(m_aContext.getNodePath(aName))
- .appendAscii(" to be overridden does not exist - skipping");
-
- m_aContext.getLogger().log(loglevel,aMessage.makeStringAndClear(), "overrideNode()", "configmgr::LayerMergeHandler");
- }
- // m_aContext.raiseUnknownPropertyException("Layer merging: The property to be overridden does not exist.",aName);
- this->skipNode();
- }
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerMergeHandler::endProperty( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (this->leaveSkippedNode())
- return;
-
- if (!m_pProperty)
- m_aContext.raiseMalformedDataException("Layer merging: Invalid data: Ending a property that wasn't started.");
-
- if (ISubtree * pLocalizedSet = m_pProperty->asISubtree())
- this->propagateAttributes(*pLocalizedSet);
-
- m_pProperty = NULL;
- if (m_pConverter) m_pConverter->m_bConvertData = false;
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerMergeHandler::addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (this->isSkipping())
- return;
-
- // TODO: add type validation
- node::Attributes aValueAttributes = makePropertyAttributes(aAttributes & SchemaAttribute::MASK);
-
- std::auto_ptr<ValueNode> aPropertyValue =
- m_aFactory.getNodeFactory().createNullValueNode(aName,aType,aValueAttributes);
-
- applyAttributes(aPropertyValue.get(),aAttributes & NodeAttribute::MASK);
-
- // can be a replace for dynamic properties (current update limitation)
- m_aContext.markCurrentMerged();
- m_aContext.addPropertyToCurrent(aPropertyValue, true);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerMergeHandler::addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (this->isSkipping())
- return;
-
- node::Attributes aValueAttributes = makePropertyAttributes(aAttributes & SchemaAttribute::MASK);
-
- std::auto_ptr<ValueNode> aPropertyValue =
- m_aFactory.getNodeFactory().createValueNode(aName,aValue,aValueAttributes);
-
- applyAttributes(aPropertyValue.get(),aAttributes & NodeAttribute::MASK);
-
- // can be a replace for dynamic properties (current update limitation)
- m_aContext.markCurrentMerged();
- m_aContext.addPropertyToCurrent(aPropertyValue, true);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerMergeHandler::setPropertyValue( const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (this->isSkipping())
- return;
-
- if (!m_pProperty)
- m_aContext.raiseMalformedDataException("Layer merging: Invalid data: Overriding a value without a property.");
-
- OSL_ASSERT( !m_pProperty->getAttributes().isReplacedForUser() );
- m_pProperty->modifyState( node::isMerged );
- m_aContext.markCurrentMerged();
-
- applyPropertyValue(aValue);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerMergeHandler::setPropertyValueForLocale( const uno::Any& aValue, rtl::OUString const & aLocale )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (this->isSkipping())
- return;
-
- if (!m_pProperty)
- m_aContext.raiseMalformedDataException("Layer merging: Invalid data: Overriding a (localized) value without a property.");
-
- OSL_ASSERT( !m_pProperty->getAttributes().isReplacedForUser() );
- m_pProperty->modifyState( node::isMerged );
- m_aContext.markCurrentMerged();
-
- applyPropertyValue(aValue,aLocale);
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-uno::Reference< com::sun::star::script::XTypeConverter >
- LayerMergeHandler::Converter::createTCV(uno::Reference< uno::XComponentContext > const & xContext)
-{
- OSL_ENSURE(xContext.is(),"Cannot create TypeConverter for LayerMergeHandler without a Context");
-
- uno::Reference< lang::XMultiComponentFactory > xFactory = xContext->getServiceManager();
- OSL_ENSURE(xFactory.is(),"Cannot create TypeConverter for LayerMergeHandler without a ServiceManager");
-
- uno::Reference< com::sun::star::script::XTypeConverter > xTCV;
- if (xFactory.is())
- {
- static const rtl::OUString k_sTCVService(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.Converter"));
-
- xTCV = uno::Reference< com::sun::star::script::XTypeConverter >::query(xFactory->createInstanceWithContext(k_sTCVService,xContext));
- }
- return xTCV;
-}
-// -----------------------------------------------------------------------------
-
-LayerMergeHandler::Converter::Converter(uno::Reference< uno::XComponentContext > const & xContext)
-: m_aConverter( createTCV(xContext) )
-, m_bConvertData(false)
-{
-}
-// -----------------------------------------------------------------------------
-static
-inline
-uno::Type getBinaryDataType()
-{
- uno::Sequence< sal_Int8 > const * const forBinary = 0;
- return ::getCppuType(forBinary);
-}
-// -----------------------------------------------------------------------------
-
-uno::Any LayerMergeHandler::Converter::convertValue(uno::Type const & _aTargetType, uno::Any const & _aValue)
-{
- OSL_ENSURE( m_bConvertData, "Unexpected: Calling convert data, when data conversion is not active");
- OSL_ENSURE( _aValue.hasValue(), "Unexpected: Calling convert data, when data to convert is VOID");
-
- if (_aTargetType == _aValue.getValueType()) return _aValue;
-
- m_aConverter.reset(_aTargetType);
-
- if (m_aConverter.isList())
- {
- uno::Sequence< rtl::OUString > aStringList;
- if (_aValue >>= aStringList)
- return m_aConverter.convertListToAny(aStringList);
- }
-
- rtl::OUString aContent;
- if (_aValue >>= aContent)
- return m_aConverter.convertToAny(aContent);
-
-
- OSL_ENSURE(false, "Cannot convert typed value (not a string)");
-
- return uno::Any();
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-namespace
-{
-// -----------------------------------------------------------------------------
- static inline bool isFinal(node::Attributes const& _aAttributes)
- {
- return _aAttributes.isFinalized() || _aAttributes.isReadonly();
- }
- // --------------------------------- AttributeSetter ---------------------------------
-
- class DefaultPromoter : NodeModification
- {
- public:
- explicit
- DefaultPromoter()
- {}
-
- void adjustAccess(INode& _rNode);
-
- using NodeModification::applyToNode;
- private:
- void handle(ValueNode& _rValueNode);
- void handle(ISubtree& _rSubtree);
- };
-// -----------------------------------------------------------------------------
-
- void DefaultPromoter::adjustAccess(INode& _rNode)
- {
- _rNode.promoteAccessToDefault();
- }
-// -----------------------------------------------------------------------------
-
- void DefaultPromoter::handle(ValueNode& _rValueNode)
- {
- _rValueNode.promoteToDefault();
- adjustAccess(_rValueNode);
- }
-// -----------------------------------------------------------------------------
-
- void DefaultPromoter::handle(ISubtree& _rSubtree)
- {
- _rSubtree.markAsDefault();
- this->applyToChildren(_rSubtree);
- adjustAccess(_rSubtree);
- }
-//--------------------------------------------------------------------------
-
-}
-// -----------------------------------------------------------------------------
-void promoteToDefault(MergedComponentData & _rTree)
-{
- if (ISubtree * pTreeData = _rTree.getSchemaTree())
- DefaultPromoter().applyToNode(*pTreeData);
-
- else
- OSL_ENSURE(false,"No Data to promote to default");
-
-}
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace backend
-
-// -------------------------------------------------------------------------
-} // namespace configmgr
diff --git a/configmgr/source/backend/layermerge.hxx b/configmgr/source/backend/layermerge.hxx
deleted file mode 100644
index ea338d230f..0000000000
--- a/configmgr/source/backend/layermerge.hxx
+++ /dev/null
@@ -1,188 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_LAYERMERGE_HXX
-#define CONFIGMGR_BACKEND_LAYERMERGE_HXX
-
-#include "mergedcomponentdata.hxx"
-#include "componentdatahelper.hxx"
-#include <com/sun/star/configuration/backend/XLayerHandler.hpp>
-#include <cppuhelper/implbase1.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- class OTreeNodeFactory;
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
-
- namespace backenduno = ::com::sun::star::configuration::backend;
-// -----------------------------------------------------------------------------
-
- class LayerMergeHandler
- : public cppu::WeakImplHelper1<backenduno::XLayerHandler>
- {
- public:
- explicit
- LayerMergeHandler(uno::Reference< uno::XComponentContext > const & _xContext, MergedComponentData & _rData, ITemplateDataProvider* aTemplateProvider = NULL);
- virtual ~LayerMergeHandler();
-
- // prepare merging
- void prepareLayer();
- bool prepareSublayer(rtl::OUString const & aLocale);
-
- // checking the result
- bool isDone() const { return m_aContext.isDone(); }
- bool isInSublayer() const { return m_bSublayer; }
-
- // XLayerHandler
- public:
- virtual void SAL_CALL
- startLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endNode( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- dropNode( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endProperty( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- setPropertyValue( const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString & aLocale )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- private:
- void propagateAttributes(ISubtree & _rParent);
-
- node::Attributes makePropertyAttributes(sal_Int16 aSchemaAttributes)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
-
- void checkPropertyType(uno::Type const & _aType)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
-
- void applyPropertyValue(uno::Any const & _aValue)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
-
- void applyPropertyValue(uno::Any const & _aValue, rtl::OUString const & _aLocale)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
-
- void applyAttributes(INode * pNode, sal_Int16 aNodeAttributes)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
-
- void overrideLayerRoot( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear )
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
-
- bool startOverride(INode * pNode, sal_Bool bClear) /* check if writable, mark merged */
- SAL_THROW(());
-
- void implOverrideNode(
- ISubtree * node, sal_Int16 attributes, bool clear);
-
- void implAddOrReplaceNode(const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
-
- void ensureUnchanged(INode const * pNode) const
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
-
- void setLocalizedValue(ISubtree * pProperty, uno::Any const & _aValue, rtl::OUString const & _aLocale)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
-
- void setValueAndCheck(ValueNode & _rValueNode, uno::Any const & _aValue)
- SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException));
- private:
- void skipNode() { ++m_nSkipping; }
- bool isSkipping() const { return m_nSkipping != 0; }
- bool leaveSkippedNode() { return m_nSkipping && m_nSkipping--; }
- private:
- struct Converter;
- MergedComponentData & m_rData;
- DataBuilderContext m_aContext;
- ComponentDataFactory m_aFactory;
- rtl::OUString m_aLocale;
- INode * m_pProperty;
- Converter * m_pConverter;
-
- sal_uInt32 m_nSkipping;
- bool m_bSublayer;
- };
-// -----------------------------------------------------------------------------
-
- /// change attributes and states of the tree to make it a proper default layer
- void promoteToDefault(MergedComponentData & _rTree);
-// -----------------------------------------------------------------------------
- } // namespace backend
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/backend/layerupdate.cxx b/configmgr/source/backend/layerupdate.cxx
deleted file mode 100644
index e933cd8c84..0000000000
--- a/configmgr/source/backend/layerupdate.cxx
+++ /dev/null
@@ -1,110 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "layerupdate.hxx"
-#include "updatedata.hxx"
-#include "configpath.hxx"
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
-
-LayerUpdate::LayerUpdate()
-: m_xContextNode()
-{
-}
-// -----------------------------------------------------------------------------
-
-LayerUpdate::LayerUpdate(LayerUpdate const & _aOther)
-: m_xContextNode(_aOther.m_xContextNode)
-, m_aContextPath(_aOther.m_aContextPath)
-{
-}
-// -----------------------------------------------------------------------------
-
-LayerUpdate::~LayerUpdate()
-{
-}
-// -----------------------------------------------------------------------------
-
-LayerUpdate & LayerUpdate::operator =(LayerUpdate const & _aOther)
-{
- m_xContextNode = _aOther.m_xContextNode;
- return *this;
-}
-// -----------------------------------------------------------------------------
-
-void LayerUpdate::setContextNode(rtl::Reference<NodeUpdate> const & _xContextNode)
-{
- m_xContextNode = _xContextNode;
- if (_xContextNode.is())
- makeContextPath(_xContextNode->getName());
-
- else
- m_aContextPath.clear();
-}
-// -----------------------------------------------------------------------------
-
-void LayerUpdate::makeContextPath(rtl::OUString const & _aPath)
-{
- configuration::AbsolutePath const aParsedPath = configuration::AbsolutePath::parse(_aPath);
-
- m_aContextPath.clear();
- m_aContextPath.reserve( aParsedPath.getDepth() );
- for (std::vector<configuration::Path::Component>::const_reverse_iterator it = aParsedPath.begin(); it != aParsedPath.end(); ++it)
- {
- m_aContextPath.push_back( it->getName() );
- }
-}
-// -----------------------------------------------------------------------------
-
-rtl::Reference<NodeUpdate> LayerUpdate::getContextNode() const
-{
- return m_xContextNode;
-}
-// -----------------------------------------------------------------------------
-
-std::vector<rtl::OUString> const & LayerUpdate::getContextPath() const
-{
- OSL_PRECOND( m_xContextNode.is(), "Cannot get context path without context node" );
-
- return m_aContextPath;
-}
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace backend
-
-// -------------------------------------------------------------------------
-} // namespace configmgr
diff --git a/configmgr/source/backend/layerupdate.hxx b/configmgr/source/backend/layerupdate.hxx
deleted file mode 100644
index 9530ebc0de..0000000000
--- a/configmgr/source/backend/layerupdate.hxx
+++ /dev/null
@@ -1,87 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_LAYERUPDATE_HXX
-#define CONFIGMGR_BACKEND_LAYERUPDATE_HXX
-
-#include <com/sun/star/uno/Reference.hxx>
-#include <rtl/ref.hxx>
-#include <rtl/ustring.hxx>
-
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif
-
-namespace com { namespace sun { namespace star { namespace configuration { namespace backend {
- class XLayerHandler;
-} } } } }
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace backenduno = ::com::sun::star::configuration::backend;
-// -----------------------------------------------------------------------------
- class NodeUpdate;
-
- class LayerUpdate
- {
- public:
- LayerUpdate();
- LayerUpdate(LayerUpdate const & _aOther);
- ~LayerUpdate();
- LayerUpdate & operator =(LayerUpdate const & _aOther);
- public:
- bool isEmpty() const { return ! m_xContextNode.is(); }
-
- rtl::Reference<NodeUpdate> getContextNode() const;
- std::vector<rtl::OUString> const & getContextPath() const;
-
- void setContextNode(rtl::Reference<NodeUpdate> const & _xContextNode);
-
- private:
- void makeContextPath(rtl::OUString const & _aContextPath);
-
- private:
- rtl::Reference<NodeUpdate> m_xContextNode;
- std::vector<rtl::OUString> m_aContextPath;
- };
-// -----------------------------------------------------------------------------
-
- } // namespace backend
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/backend/layerupdatebuilder.cxx b/configmgr/source/backend/layerupdatebuilder.cxx
deleted file mode 100644
index 699c5c415c..0000000000
--- a/configmgr/source/backend/layerupdatebuilder.cxx
+++ /dev/null
@@ -1,299 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "layerupdatebuilder.hxx"
-#include "updatedata.hxx"
-#include "layerupdate.hxx"
-#include <com/sun/star/configuration/backend/TemplateIdentifier.hpp>
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
-
-LayerUpdateBuilder::LayerUpdateBuilder()
-: m_aUpdate()
-, m_pCurrentNode(NULL)
-, m_pCurrentProp(NULL)
-{
-}
-// -----------------------------------------------------------------------------
-
-void LayerUpdateBuilder::clear()
-{
- m_pCurrentProp = NULL;
- m_pCurrentNode = NULL;
- m_aUpdate = LayerUpdate();
-
- OSL_POSTCOND( this->isEmpty(), "LayerUpdateBuilder: Could not reset the stored update.");
-}
-// -----------------------------------------------------------------------------
-
-LayerUpdate const & LayerUpdateBuilder::result() const
-{
- OSL_ENSURE(this->isComplete(),
- "LayerUpdateBuilder: There is no result to retrieve"
- " - building the data is still in progress.");
-
- return m_aUpdate;
-}
-// -----------------------------------------------------------------------------
-
-inline
-LayerUpdate & LayerUpdateBuilder::data()
-{
- return m_aUpdate;
-}
-// -----------------------------------------------------------------------------
-
-bool LayerUpdateBuilder::init()
-{
- if (m_pCurrentNode) return false;
-
- LayerUpdate & update = data();
- m_pCurrentNode = new NodeModification(NULL, rtl::OUString(), 0, 0, false);
- update.setContextNode(m_pCurrentNode);
-
- OSL_ENSURE(m_pCurrentProp == NULL, "LayerUpdateBuilder: Internal error: got a current property for a new context");
-
- return true;
-}
-// -----------------------------------------------------------------------------
-
-bool LayerUpdateBuilder::modifyNode(rtl::OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, sal_Bool _bReset)
-{
- OSL_PRECOND(m_pCurrentNode && !m_pCurrentProp, "LayerUpdateBuilder: Illegal state for this operation");
-
- NodeUpdate * pNewNode = new NodeModification(m_pCurrentNode,_aName,_nFlags,_nFlagsMask,_bReset);
- rtl::Reference<ElementUpdate> xNewNode(pNewNode);
-
- if (!m_pCurrentNode->addNodeUpdate(xNewNode))
- return false;
-
- m_pCurrentNode = pNewNode;
- return true;
-}
-// -----------------------------------------------------------------------------
-
-bool LayerUpdateBuilder::replaceNode(rtl::OUString const & _aName, sal_Int16 _nFlags, backenduno::TemplateIdentifier const * _pTemplate)
-{
- OSL_PRECOND(m_pCurrentNode && !m_pCurrentProp, "LayerUpdateBuilder: Illegal state for this operation");
-
- NodeUpdate * pNewNode = _pTemplate ?
- new NodeReplace(m_pCurrentNode,_aName,_nFlags,_pTemplate->Name,_pTemplate->Component) :
- new NodeReplace(m_pCurrentNode,_aName,_nFlags);
-
- rtl::Reference<ElementUpdate> xNewNode(pNewNode);
-
- if (!m_pCurrentNode->addNodeUpdate(xNewNode))
- return false;
-
- m_pCurrentNode = pNewNode;
- return true;
-}
-// -----------------------------------------------------------------------------
-
-bool LayerUpdateBuilder::finishNode()
-{
- OSL_PRECOND(m_pCurrentNode && !m_pCurrentProp, "LayerUpdateBuilder: Illegal state for this operation");
-
- if (m_pCurrentProp || !m_pCurrentNode) return false;
-
- m_pCurrentNode = m_pCurrentNode->getParent();
- return true;
-}
-// -----------------------------------------------------------------------------
-
-bool LayerUpdateBuilder::removeNode(rtl::OUString const & _aName)
-{
- OSL_PRECOND(m_pCurrentNode && !m_pCurrentProp, "LayerUpdateBuilder: Illegal state for this operation");
-
- NodeDrop * pNewNode = new NodeDrop(m_pCurrentNode,_aName);
-
- rtl::Reference<ElementUpdate> xNewNode(pNewNode);
-
- if (!m_pCurrentNode->addNodeUpdate(xNewNode))
- return false;
-
- return true;
-}
-// -----------------------------------------------------------------------------
-
-bool LayerUpdateBuilder::modifyProperty(rtl::OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, uno::Type const & _aType)
-{
- OSL_PRECOND(m_pCurrentNode && !m_pCurrentProp, "LayerUpdateBuilder: Illegal state for this operation");
-
- PropertyUpdate * pNewProp = new PropertyUpdate(m_pCurrentNode,_aName,_nFlags,_nFlagsMask,_aType);
- rtl::Reference<ElementUpdate> xNewProp(pNewProp);
-
- if (!m_pCurrentNode->addPropertyUpdate(xNewProp))
- return false;
-
- m_pCurrentProp = pNewProp;
- return true;
-}
-// -----------------------------------------------------------------------------
-
-bool LayerUpdateBuilder::setPropertyValue(uno::Any const & _aValue)
-{
- OSL_PRECOND(m_pCurrentProp, "LayerUpdateBuilder: Illegal state for property operation");
-
- return m_pCurrentProp->setValue(_aValue);
-}
-// -----------------------------------------------------------------------------
-
-bool LayerUpdateBuilder::setPropertyValueForLocale(uno::Any const & _aValue, rtl::OUString const & _aLocale)
-{
- OSL_PRECOND(m_pCurrentProp, "LayerUpdateBuilder: Illegal state for property operation");
-
- return m_pCurrentProp->setValueFor(_aLocale, _aValue);
-}
-// -----------------------------------------------------------------------------
-
-bool LayerUpdateBuilder::resetPropertyValue()
-{
- OSL_PRECOND(m_pCurrentProp, "LayerUpdateBuilder: Illegal state for property operation");
-
- return m_pCurrentProp->resetValue();
-}
-// -----------------------------------------------------------------------------
-
-bool LayerUpdateBuilder::resetPropertyValueForLocale(rtl::OUString const & _aLocale)
-{
- OSL_PRECOND(m_pCurrentProp, "LayerUpdateBuilder: Illegal state for property operation");
-
- return m_pCurrentProp->resetValueFor(_aLocale);
-}
-// -----------------------------------------------------------------------------
-
-bool LayerUpdateBuilder::finishProperty()
-{
- OSL_PRECOND(m_pCurrentProp, "LayerUpdateBuilder: Illegal state for property operation");
- if (!m_pCurrentProp) return false;
- m_pCurrentProp->finishValue();
-
- OSL_ASSERT(m_pCurrentNode == m_pCurrentProp->getParent());
-
- m_pCurrentProp = NULL;
- return true;
-}
-// -----------------------------------------------------------------------------
-
-bool LayerUpdateBuilder::addNullProperty(rtl::OUString const & _aName, sal_Int16 _nFlags, uno::Type const & _aType)
-{
- OSL_PRECOND(m_pCurrentNode && !m_pCurrentProp, "LayerUpdateBuilder: Illegal state for this operation");
-
- PropertyAdd * pNewProp = new PropertyAdd(m_pCurrentNode,_aName,_nFlags,_aType);
-
- rtl::Reference<ElementUpdate> xNewProp(pNewProp);
-
- if (!m_pCurrentNode->addPropertyUpdate(xNewProp))
- return false;
-
- return true;
-}
-// -----------------------------------------------------------------------------
-
-bool LayerUpdateBuilder::addProperty(rtl::OUString const & _aName, sal_Int16 _nFlags, uno::Any const & _aValue)
-{
- OSL_PRECOND(m_pCurrentNode && !m_pCurrentProp, "LayerUpdateBuilder: Illegal state for this operation");
-
- PropertyAdd * pNewProp = new PropertyAdd(m_pCurrentNode,_aName,_nFlags,_aValue);
-
- rtl::Reference<ElementUpdate> xNewProp(pNewProp);
-
- if (!m_pCurrentNode->addPropertyUpdate(xNewProp))
- return false;
-
- return true;
-}
-// -----------------------------------------------------------------------------
-
-bool LayerUpdateBuilder::resetProperty(rtl::OUString const & _aName)
-{
- OSL_PRECOND(m_pCurrentNode && !m_pCurrentProp, "LayerUpdateBuilder: Illegal state for this operation");
-
- PropertyReset * pNewProp = new PropertyReset(m_pCurrentNode,_aName);
-
- rtl::Reference<ElementUpdate> xNewProp(pNewProp);
-
- if (!m_pCurrentNode->addPropertyUpdate(xNewProp))
- return false;
-
- return true;
-}
-// -----------------------------------------------------------------------------
-
-bool LayerUpdateBuilder::finish()
-{
- if (!this->finishNode()) return false;
-
- return m_pCurrentNode == NULL;
-}
-// -----------------------------------------------------------------------------
-
-bool LayerUpdateBuilder::isEmpty() const
-{
- OSL_ENSURE( !m_pCurrentNode || !m_aUpdate.isEmpty(), "LayerUpdateBuilder: Invariant violation: got a current node without a layer");
- return m_aUpdate.isEmpty();
-}
-// -----------------------------------------------------------------------------
-
-bool LayerUpdateBuilder::isActive() const
-{
- OSL_ENSURE( !m_pCurrentNode || !m_aUpdate.isEmpty(), "LayerUpdateBuilder: Invariant violation: got a current node without a layer");
- return m_pCurrentNode != 0;
-}
-// -----------------------------------------------------------------------------
-#if OSL_DEBUG_LEVEL > 0
-bool LayerUpdateBuilder::isComplete() const
-{
- OSL_ENSURE( !m_pCurrentNode || !m_aUpdate.isEmpty(), "LayerUpdateBuilder: Invariant violation: got a current node without a layer");
- return !m_aUpdate.isEmpty() && m_pCurrentNode == NULL;
-}
-#endif
-// -----------------------------------------------------------------------------
-
-bool LayerUpdateBuilder::isPropertyActive() const
-{
- OSL_ENSURE( !m_pCurrentNode || !m_aUpdate.isEmpty(), "LayerUpdateBuilder: Invariant violation: got a current node without a layer");
- OSL_ENSURE(m_pCurrentNode || !m_pCurrentProp, "LayerUpdateBuilder: Invariant violation: got a current property without a node");
- return m_pCurrentProp != 0;
-}
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace backend
-
-// -------------------------------------------------------------------------
-} // namespace configmgr
diff --git a/configmgr/source/backend/layerupdatebuilder.hxx b/configmgr/source/backend/layerupdatebuilder.hxx
deleted file mode 100644
index 5687204462..0000000000
--- a/configmgr/source/backend/layerupdatebuilder.hxx
+++ /dev/null
@@ -1,105 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_LAYERUPDATEBUILDER_HXX
-#define CONFIGMGR_BACKEND_LAYERUPDATEBUILDER_HXX
-
-#include "layerupdate.hxx"
-#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/uno/Type.hxx>
-#include <rtl/ustring.hxx>
-
-namespace com { namespace sun { namespace star { namespace configuration { namespace backend {
- struct TemplateIdentifier;
-} } } } }
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace backenduno = ::com::sun::star::configuration::backend;
-// -----------------------------------------------------------------------------
- class NodeUpdate;
- class PropertyUpdate;
-
- class LayerUpdateBuilder
- {
- LayerUpdate m_aUpdate;
- NodeUpdate * m_pCurrentNode;
- PropertyUpdate * m_pCurrentProp;
- public:
- LayerUpdateBuilder();
-
- public:
- /// initialize the update
- bool init();
-
- bool modifyNode(rtl::OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, sal_Bool _bReset);
- bool replaceNode(rtl::OUString const & _aName, sal_Int16 _nFlags, backenduno::TemplateIdentifier const * _pTemplate = NULL);
- bool finishNode();
-
- bool removeNode(rtl::OUString const & _aName);
-
- bool modifyProperty(rtl::OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, uno::Type const & _aType);
- bool setPropertyValue(uno::Any const & _aValue);
- bool setPropertyValueForLocale(uno::Any const & _aValue, rtl::OUString const & _aLocale);
- bool resetPropertyValue();
- bool resetPropertyValueForLocale(rtl::OUString const & _aLocale);
- bool finishProperty();
-
- bool addNullProperty(rtl::OUString const & _aName, sal_Int16 _nFlags, uno::Type const & _aType);
- bool addProperty(rtl::OUString const & _aName, sal_Int16 _nFlags, uno::Any const & _aValue);
- bool resetProperty(rtl::OUString const & _aName);
-
- bool finish();
- void clear();
-
- bool isEmpty() const;
- bool isActive() const;
-#if OSL_DEBUG_LEVEL > 0
- bool isComplete() const;
-#endif
- bool isPropertyActive() const;
-
- LayerUpdate const & result() const;
- private:
- LayerUpdate & data();
- };
-// -----------------------------------------------------------------------------
-
- } // namespace backend
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/backend/layerupdatehandler.cxx b/configmgr/source/backend/layerupdatehandler.cxx
deleted file mode 100644
index 9a8090a8ad..0000000000
--- a/configmgr/source/backend/layerupdatehandler.cxx
+++ /dev/null
@@ -1,313 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "layerupdatehandler.hxx"
-#include "layerupdatemerger.hxx"
-
-#ifndef CONFIGMGR_API_FACTORY_HXX_
-#include "confapifactory.hxx"
-#endif
-#include <com/sun/star/configuration/backend/XLayerHandler.hpp>
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-#include <com/sun/star/beans/PropertyExistException.hpp>
-
-// -----------------------------------------------------------------------------
-#define OUSTR( str ) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( str ) )
-// -----------------------------------------------------------------------------
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace backenduno = ::com::sun::star::configuration::backend;
-// -----------------------------------------------------------------------------
-
-uno::Reference< uno::XInterface > SAL_CALL instantiateUpdateMerger
-( uno::Reference< uno::XComponentContext > const& xContext )
-{
- return * new LayerUpdateHandler( xContext );
-}
-
-// -----------------------------------------------------------------------------
-
-LayerUpdateHandler::LayerUpdateHandler(uno::Reference< uno::XComponentContext > const & _xContext)
-: UpdateService(_xContext)
-, m_aBuilder()
-{
-}
-// -----------------------------------------------------------------------------
-
-LayerUpdateHandler::~LayerUpdateHandler()
-{
-}
-// -----------------------------------------------------------------------------
-inline
-void LayerUpdateHandler::checkBuilder(bool _bForProperty)
-{
- if ( m_aBuilder.isEmpty() )
- raiseMalformedDataException("LayerUpdateHandler: Illegal operation - no update is in progress");
-
- if ( !m_aBuilder.isActive() )
- raiseMalformedDataException("LayerUpdateHandler: Illegal operation - no context for update available");
-
- if ( m_aBuilder.isPropertyActive() != _bForProperty )
- raiseMalformedDataException("LayerUpdateHandler: Illegal operation - a property is in progress");
-}
-// -----------------------------------------------------------------------------
-
-void LayerUpdateHandler::raiseMalformedDataException(sal_Char const * pMsg)
-{
- rtl::OUString sMsg = rtl::OUString::createFromAscii(pMsg);
- throw backenduno::MalformedDataException(sMsg,*this,uno::Any());
-}
-// -----------------------------------------------------------------------------
-
-void LayerUpdateHandler::raiseNodeChangedBeforeException(sal_Char const * pMsg)
-{
- rtl::OUString sMsg = rtl::OUString::createFromAscii(pMsg);
- throw backenduno::MalformedDataException(sMsg,*this,uno::Any());
-}
-// -----------------------------------------------------------------------------
-
-void LayerUpdateHandler::raisePropChangedBeforeException(sal_Char const * pMsg)
-{
- rtl::OUString sMsg = rtl::OUString::createFromAscii(pMsg);
- throw backenduno::MalformedDataException(sMsg,*this,uno::Any());
-}
-// -----------------------------------------------------------------------------
-
-void LayerUpdateHandler::raisePropExistsException(sal_Char const * pMsg)
-{
- rtl::OUString sMsg = rtl::OUString::createFromAscii(pMsg);
- com::sun::star::beans::PropertyExistException e(sMsg,*this);
-
- throw backenduno::MalformedDataException(sMsg,*this, uno::makeAny(e));
-}
-// -----------------------------------------------------------------------------
-
-// XUpdateHandler
-void SAL_CALL
- LayerUpdateHandler::startUpdate( )
- throw ( backenduno::MalformedDataException, lang::IllegalAccessException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- this->checkSourceLayer();
- if (!m_aBuilder.init())
- raiseMalformedDataException("LayerUpdateHandler: Cannot start update - update is already in progress");
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- LayerUpdateHandler::endUpdate( )
- throw ( backenduno::MalformedDataException, lang::IllegalAccessException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- checkBuilder();
-
- if (!m_aBuilder.finish())
- raiseMalformedDataException("LayerUpdateHandler: Cannot finish update - a node is still open.");
-
- uno::Reference< backenduno::XLayer > xMergedLayer( LayerUpdateMerger::getMergedLayer(this->getSourceLayer(), m_aBuilder.result()) );
-
- m_aBuilder.clear();
-
- this->writeUpdatedLayer(xMergedLayer);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- LayerUpdateHandler::modifyNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Int16 aAttributeMask, sal_Bool bReset )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- checkBuilder();
-
- if (!m_aBuilder.modifyNode(aName,aAttributes,aAttributeMask,bReset))
- raiseNodeChangedBeforeException("LayerUpdateHandler: Cannot start node modification - node has already been changed.");
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- LayerUpdateHandler::addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- checkBuilder();
-
- if (!m_aBuilder.replaceNode(aName,aAttributes,NULL))
- raiseNodeChangedBeforeException("LayerUpdateHandler: Cannot start added/replaced node - node has already been changed.");
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- LayerUpdateHandler::addOrReplaceNodeFromTemplate( const rtl::OUString& aName, sal_Int16 aAttributes, const backenduno::TemplateIdentifier& aTemplate )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- checkBuilder();
-
- if (!m_aBuilder.replaceNode(aName,aAttributes,&aTemplate))
- raiseNodeChangedBeforeException("LayerUpdateHandler: Cannot start added/replaced node - node has already been changed.");
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- LayerUpdateHandler::endNode( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- checkBuilder();
-
- if (!m_aBuilder.finishNode())
- {
- OSL_ENSURE(m_aBuilder.isPropertyActive() || !m_aBuilder.isActive(), "LayerUpdateHandler: Unexpected failure mode for finishNode");
- if (m_aBuilder.isPropertyActive())
- raiseMalformedDataException("LayerUpdateHandler: Cannot finish node update - open property has not been ended.");
- else
- raiseMalformedDataException("LayerUpdateHandler: Cannot finish node update - no node has been started.");
- }
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- LayerUpdateHandler::removeNode( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- checkBuilder();
-
- if (!m_aBuilder.removeNode(aName))
- raiseNodeChangedBeforeException("LayerUpdateHandler: Cannot remove node - node has already been changed.");
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- LayerUpdateHandler:: modifyProperty( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Int16 aAttributeMask, const uno::Type & aType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- checkBuilder(false);
-
- if (!m_aBuilder.modifyProperty(aName,aAttributes,aAttributeMask, aType))
- raisePropChangedBeforeException("LayerUpdateHandler: Cannot start property modification - property has already been changed.");
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- LayerUpdateHandler:: setPropertyValue( const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- checkBuilder(true); // already checks for open property
-
- OSL_VERIFY( m_aBuilder.setPropertyValue(aValue) );
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- LayerUpdateHandler:: setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString& aLocale )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- checkBuilder(true); // already checks for open property
-
- OSL_VERIFY( m_aBuilder.setPropertyValueForLocale(aValue,aLocale) );
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- LayerUpdateHandler::resetPropertyValue( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- checkBuilder(true); // already checks for open property
-
- OSL_VERIFY( m_aBuilder.resetPropertyValue() );
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- LayerUpdateHandler::resetPropertyValueForLocale( const rtl::OUString& aLocale )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- checkBuilder(true); // already checks for open property
-
- OSL_VERIFY( m_aBuilder.resetPropertyValueForLocale(aLocale) );
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- LayerUpdateHandler::endProperty( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- checkBuilder(true); // already checks for open property
-
- OSL_VERIFY ( m_aBuilder.finishProperty() );
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- LayerUpdateHandler::resetProperty( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (!m_aBuilder.resetProperty(aName))
- raisePropChangedBeforeException("LayerUpdateHandler: Cannot reset property - property has already been changed.");
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- LayerUpdateHandler::addOrReplaceProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (!m_aBuilder.addNullProperty(aName,aAttributes,aType))
- raisePropExistsException("LayerUpdateHandler: Cannot add property - property exists (and has already been changed).");
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- LayerUpdateHandler::addOrReplacePropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (!m_aBuilder.addProperty(aName,aAttributes,aValue))
- raisePropExistsException("LayerUpdateHandler: Cannot add property - property exists (and has already been changed).");
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL
- LayerUpdateHandler::removeProperty( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- // treat 'remove' as 'reset'. (Note: does not verify that this actually amounts to dropping the property)
- if (!m_aBuilder.resetProperty(aName))
- raisePropChangedBeforeException("LayerUpdateHandler: Cannot remove property - property has already been changed.");
-}
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace
-
-// -----------------------------------------------------------------------------
-} // namespace
-
diff --git a/configmgr/source/backend/layerupdatehandler.hxx b/configmgr/source/backend/layerupdatehandler.hxx
deleted file mode 100644
index e187e9ca89..0000000000
--- a/configmgr/source/backend/layerupdatehandler.hxx
+++ /dev/null
@@ -1,154 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_LAYERUPDATEHANDLER_HXX
-#define CONFIGMGR_BACKEND_LAYERUPDATEHANDLER_HXX
-
-#include "sal/config.h"
-
-#include "boost/utility.hpp"
-
-#include "updatesvc.hxx"
-#include "layerupdatebuilder.hxx"
-#include "utility.hxx"
-
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace backenduno = ::com::sun::star::configuration::backend;
-// -----------------------------------------------------------------------------
- class LayerUpdateBuilder;
-
- class LayerUpdateHandler: private boost::noncopyable, public UpdateService
- {
- public:
- explicit
- LayerUpdateHandler(uno::Reference< uno::XComponentContext > const & _xContext);
-
- ~LayerUpdateHandler();
-
- // XUpdateHandler
- virtual void SAL_CALL
- startUpdate( )
- throw ( backenduno::MalformedDataException, lang::IllegalAccessException,
- lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endUpdate( )
- throw ( backenduno::MalformedDataException, lang::IllegalAccessException,
- lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- modifyNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Int16 aAttributeMask, sal_Bool bReset )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addOrReplaceNodeFromTemplate( const rtl::OUString& aName, sal_Int16 aAttributes, const backenduno::TemplateIdentifier& aTemplate )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endNode( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- removeNode( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- modifyProperty( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Int16 aAttributeMask, const uno::Type& aType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- setPropertyValue( const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString& aLocale )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- resetPropertyValue( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- resetPropertyValueForLocale( const rtl::OUString& aLocale )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endProperty( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- resetProperty( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addOrReplaceProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addOrReplacePropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- removeProperty( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- private:
- LayerUpdateBuilder & getUpdateBuilder();
-
- void checkBuilder(bool _bForProperty = false);
-
- void raiseMalformedDataException(sal_Char const * pMsg);
- void raiseNodeChangedBeforeException(sal_Char const * pMsg);
- void raisePropChangedBeforeException(sal_Char const * pMsg);
- void raisePropExistsException(sal_Char const * pMsg);
-
- private:
- LayerUpdateBuilder m_aBuilder;
- };
-// -----------------------------------------------------------------------------
- } // namespace xml
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/backend/layerupdatemerger.cxx b/configmgr/source/backend/layerupdatemerger.cxx
deleted file mode 100644
index c6e023f1bf..0000000000
--- a/configmgr/source/backend/layerupdatemerger.cxx
+++ /dev/null
@@ -1,512 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "layerupdatemerger.hxx"
-#include "layerupdatebuilder.hxx"
-#include "updatedata.hxx"
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
-
-LayerUpdateMerger::LayerUpdateMerger(uno::Reference< backenduno::XLayer > const & _xSourceLayer, LayerUpdate const & _aLayerUpdate)
-: BasicUpdateMerger(_xSourceLayer)
-, m_aLayerUpdate(_aLayerUpdate)
-, m_xCurrentNode()
-{
-}
-// -----------------------------------------------------------------------------
-
-LayerUpdateMerger::~LayerUpdateMerger()
-{
-}
-// -----------------------------------------------------------------------------
-
-void LayerUpdateMerger::flushUpdate()
-{
- OSL_ENSURE(!BasicUpdateMerger::isHandling(), "LayerUpdateMerger: Unexpected: flushing data, while base implementation is active");
- OSL_ENSURE(m_xCurrentNode.is(),"LayerUpdateMerger: No data for flushing.");
-
- if (m_xCurrentNode.is())
- {
- m_xCurrentNode->writeChildrenToLayer(getResultWriter().get());
- m_xCurrentNode.clear();
- }
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerUpdateMerger::startLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- BasicUpdateMerger::startLayer();
-
- m_xCurrentNode = m_aLayerUpdate.getContextNode();
-
- BasicUpdateMerger::findContext(m_aLayerUpdate.getContextPath());
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerUpdateMerger::endLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- BasicUpdateMerger::endLayer();
-
- OSL_ENSURE(!m_xCurrentNode.is(), "Path being updated not found in data - update not written");
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerUpdateMerger::overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (BasicUpdateMerger::isHandling())
- {
- BasicUpdateMerger::overrideNode(aName, aAttributes, bClear);
- return;
- }
-
- OSL_ASSERT(m_xCurrentNode.is());
-
- rtl::Reference<ElementUpdate> xUpdate = m_xCurrentNode->getNodeByName(aName);
- if (!xUpdate.is())
- {
- BasicUpdateMerger::overrideNode(aName, aAttributes, bClear);
- OSL_ASSERT(BasicUpdateMerger::isHandling());
- return;
- }
- m_xCurrentNode->removeNodeByName(aName);
-
- if (NodeUpdate * pNodeUpdate = xUpdate->asNodeUpdate(true))
- {
- getResultWriter()->overrideNode(aName, pNodeUpdate->updateFlags(aAttributes), bClear);
- m_xCurrentNode.set(pNodeUpdate);
- }
- else
- {
- xUpdate->writeToLayer(getResultWriter().get());
- BasicUpdateMerger::startSkipping();
- }
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerUpdateMerger::addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (BasicUpdateMerger::isHandling())
- {
- BasicUpdateMerger::addOrReplaceNode(aName, aAttributes);
- return;
- }
-
- OSL_ASSERT(m_xCurrentNode.is());
-
- rtl::Reference<ElementUpdate> xUpdate = m_xCurrentNode->getNodeByName(aName);
- if (!xUpdate.is())
- {
- BasicUpdateMerger::addOrReplaceNode(aName, aAttributes);
- OSL_ASSERT(BasicUpdateMerger::isHandling());
- return;
- }
- m_xCurrentNode->removeNodeByName(aName);
-
- if (NodeUpdate * pNodeUpdate = xUpdate->asNodeUpdate(true))
- {
- getResultWriter()->addOrReplaceNode(aName, pNodeUpdate->updateFlags(aAttributes));
- m_xCurrentNode.set(pNodeUpdate);
- }
- else
- {
- xUpdate->writeToLayer(getResultWriter().get());
- BasicUpdateMerger::startSkipping();
- }
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerUpdateMerger::addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (BasicUpdateMerger::isHandling())
- {
- BasicUpdateMerger::addOrReplaceNodeFromTemplate(aName, aTemplate, aAttributes);
- return;
- }
-
- OSL_ASSERT(m_xCurrentNode.is());
-
- rtl::Reference<ElementUpdate> xUpdate = m_xCurrentNode->getNodeByName(aName);
- if (!xUpdate.is())
- {
- BasicUpdateMerger::addOrReplaceNodeFromTemplate(aName, aTemplate, aAttributes);
- OSL_ASSERT(BasicUpdateMerger::isHandling());
- return;
- }
- m_xCurrentNode->removeNodeByName(aName);
-
- if (NodeUpdate * pNodeUpdate = xUpdate->asNodeUpdate(true))
- {
- getResultWriter()->addOrReplaceNodeFromTemplate(aName, aTemplate, pNodeUpdate->updateFlags(aAttributes));
- m_xCurrentNode.set(pNodeUpdate);
- }
- else
- {
- xUpdate->writeToLayer(getResultWriter().get());
- BasicUpdateMerger::startSkipping();
- }
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerUpdateMerger::endNode( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (BasicUpdateMerger::isHandling())
- {
- BasicUpdateMerger::endNode();
- return;
- }
-
- OSL_ASSERT(m_xCurrentNode.is());
-
- // write unhandled so far changes
- m_xCurrentNode->writeChildrenToLayer( getResultWriter().get() );
-
- rtl::Reference<NodeUpdate> xParent( m_xCurrentNode->getParent() );
-
- if (xParent.is())
- getResultWriter()->endNode();
-
- else
- BasicUpdateMerger::leaveContext();
-
- m_xCurrentNode = xParent;
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerUpdateMerger::dropNode( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (BasicUpdateMerger::isHandling())
- {
- BasicUpdateMerger::dropNode(aName);
- return;
- }
-
- OSL_ASSERT(m_xCurrentNode.is());
-
- rtl::Reference<ElementUpdate> xUpdate = m_xCurrentNode->getNodeByName(aName);
- if (xUpdate.is())
- {
- m_xCurrentNode->removeNodeByName(aName);
-
- if (NodeUpdate * pNodeUpdate = xUpdate->asNodeUpdate())
- {
- if (pNodeUpdate-> getOperation() == NodeUpdate::replace)
- {
- xUpdate->writeToLayer( getResultWriter().get() );
- return;
- }
- else
- {
- malformedUpdate("LayerUpdateMerger: Applying modification to dropped node");
- }
- }
- }
-
- getResultWriter()->dropNode(aName);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerUpdateMerger::overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (BasicUpdateMerger::isHandling())
- {
- BasicUpdateMerger::overrideProperty(aName, aAttributes, aType, bClear);
- return;
- }
-
- OSL_ASSERT( m_xCurrentNode.is());
-
- rtl::Reference<ElementUpdate> xUpdate = m_xCurrentNode->getPropertyByName(aName);
- if (!xUpdate.is())
- {
- BasicUpdateMerger::overrideProperty(aName, aAttributes, aType, bClear);
- OSL_ASSERT(BasicUpdateMerger::isHandling());
- return;
- }
-
- m_xCurrentNode->removePropertyByName(aName);
-
- if (PropertyUpdate * pPropUpdate = xUpdate->asPropertyUpdate())
- {
- OSL_ENSURE( aType == pPropUpdate->getValueType() ||
- aType == uno::Type() ||
- pPropUpdate->getValueType() == uno::Type(),
- "Error in update merger: type mismatch overriding property ...");
-
- getResultWriter()->overrideProperty(aName, pPropUpdate->updateFlags(aAttributes), aType, bClear);
- m_xCurrentProp.set(pPropUpdate);
- }
- else
- {
- xUpdate->writeToLayer(getResultWriter().get());
- BasicUpdateMerger::startSkipping();
- }
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerUpdateMerger::endProperty( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (BasicUpdateMerger::isHandling())
- {
- BasicUpdateMerger::endProperty();
- return;
- }
-
- OSL_ASSERT(m_xCurrentNode.is());
-
- if (!m_xCurrentProp.is())
- {
- rtl::OUString sMsg( RTL_CONSTASCII_USTRINGPARAM("LayerUpdateMerger: Invalid data: Ending property that wasn't started.") );
- throw backenduno::MalformedDataException( sMsg, *this, uno::Any() );
- }
-
- // write unhandled so far values
- m_xCurrentProp->writeValuesToLayer( getResultWriter().get() );
-
- getResultWriter()->endProperty();
-
- m_xCurrentProp.clear();
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerUpdateMerger::setPropertyValue( const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (BasicUpdateMerger::isHandling())
- {
- BasicUpdateMerger::setPropertyValue(aValue);
- return;
- }
-
- OSL_ASSERT(m_xCurrentNode.is());
-
- if (!m_xCurrentProp.is())
- {
- rtl::OUString sMsg( RTL_CONSTASCII_USTRINGPARAM("LayerUpdateMerger: Invalid data: setting value, but no property is started.") );
- throw backenduno::MalformedDataException( sMsg, *this, uno::Any() );
- }
-
- if (!m_xCurrentProp->hasChange())
- {
- BasicUpdateMerger::setPropertyValue(aValue);
- return;
- }
-
-#ifndef CFG_UPDATEMERGER_BATCHWRITE_PROPERTIES
- if (m_xCurrentProp->hasValue())
- {
- getResultWriter()->setPropertyValue(m_xCurrentProp->getValue());
- }
- else
- {
- OSL_ENSURE(m_xCurrentProp->hasReset(),"LayerUpdateMerger: ERROR: Unknown change type in PropertyUpdate");
- // write nothing to result
- }
-
- // mark handled
- m_xCurrentProp->removeValue();
-#endif
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerUpdateMerger::setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString & aLocale )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (BasicUpdateMerger::isHandling())
- {
- BasicUpdateMerger::setPropertyValueForLocale(aValue, aLocale);
- return;
- }
-
- OSL_ASSERT(m_xCurrentNode.is());
-
- if (!m_xCurrentProp.is())
- {
- rtl::OUString sMsg( RTL_CONSTASCII_USTRINGPARAM("LayerUpdateMerger: Invalid data: setting value, but no property is started.") );
- throw backenduno::MalformedDataException( sMsg, *this, uno::Any() );
- }
-
- if (!m_xCurrentProp->hasChangeFor(aLocale))
- {
- BasicUpdateMerger::setPropertyValueForLocale(aValue, aLocale);
- return;
- }
-
-#ifndef CFG_UPDATEMERGER_BATCHWRITE_PROPERTIES
- if (m_xCurrentProp->hasValueFor(aLocale))
- {
- getResultWriter()->setPropertyValueForLocale(m_xCurrentProp->getValueFor(aLocale),aLocale);
- }
- else
- {
- OSL_ENSURE(m_xCurrentProp->hasResetFor(aLocale),"LayerUpdateMerger: ERROR: Unknown change type in PropertyUpdate");
- // write nothing to result
- }
-
- // mark handled
- m_xCurrentProp->removeValueFor(aLocale);
-#endif
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerUpdateMerger::addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (BasicUpdateMerger::isHandling())
- {
- BasicUpdateMerger::addProperty(aName, aAttributes, aType);
- return;
- }
- OSL_ASSERT( m_xCurrentNode.is());
-
- rtl::Reference<ElementUpdate> xUpdate = m_xCurrentNode->getPropertyByName(aName);
- if (!xUpdate.is())
- {
- BasicUpdateMerger::addProperty(aName, aAttributes, aType);
- return;
- }
-
- m_xCurrentNode->removePropertyByName(aName);
-
- if (PropertyUpdate * pPropUpdate = xUpdate->asPropertyUpdate())
- {
- if (pPropUpdate->hasValue() && pPropUpdate->getValue().hasValue())
- {
- // TODO: validate value-type
- uno::Any aNewValue = pPropUpdate->getValue();
- OSL_ASSERT( aNewValue.hasValue() );
-
- if (aNewValue.getValueType() != aType)
- malformedUpdate("LayerUpdateMerger: cannot do type conversion while writing updates");
-
- getResultWriter()->addPropertyWithValue(aName, pPropUpdate->updateFlags(aAttributes), aNewValue);
- }
- else
- {
- // TODO: validate type
- if (pPropUpdate->getValueType() != aType && pPropUpdate->getValueType() != uno::Type())
- malformedUpdate("LayerUpdateMerger: types for property update do not match");
-
- OSL_ENSURE(!pPropUpdate->hasReset(),"Warning: resetting the value of an added property is undefined - reverting to NULL");
- getResultWriter()->addProperty(aName, pPropUpdate->updateFlags(aAttributes), aType);
- }
- }
- else
- {
- xUpdate->writeToLayer(getResultWriter().get());
- }
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerUpdateMerger::addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (BasicUpdateMerger::isHandling())
- {
- BasicUpdateMerger::addPropertyWithValue(aName, aAttributes, aValue);
- return;
- }
- OSL_ASSERT( m_xCurrentNode.is());
-
- rtl::Reference<ElementUpdate> xUpdate = m_xCurrentNode->getPropertyByName(aName);
- if (!xUpdate.is())
- {
- BasicUpdateMerger::addPropertyWithValue(aName, aAttributes, aValue);
- return;
- }
-
- m_xCurrentNode->removePropertyByName(aName);
-
- if (PropertyUpdate * pPropUpdate = xUpdate->asPropertyUpdate())
- {
- if (!pPropUpdate->hasChange()) // attribute change only
- {
- getResultWriter()->addPropertyWithValue(aName, pPropUpdate->updateFlags(aAttributes), aValue);
- }
- else if (pPropUpdate->hasReset())
- {
- // write nothing
- }
- else if (pPropUpdate->getValue().hasValue()) // setting to non-NULL value
- {
- OSL_ASSERT(pPropUpdate->hasValue());
-
- // TODO: validate value-type
- uno::Any aNewValue = pPropUpdate->getValue();
-
- if (aNewValue.getValueType() != aValue.getValueType())
- malformedUpdate("LayerUpdateMerger: cannot do type conversion while writing updates");
-
- getResultWriter()->addPropertyWithValue(aName, pPropUpdate->updateFlags(aAttributes), aNewValue);
- }
- else // setting to null value
- {
- OSL_ASSERT(pPropUpdate->hasValue());
-
- // TODO: validate type
- if (pPropUpdate->getValueType() != aValue.getValueType() && pPropUpdate->getValueType() != uno::Type())
- malformedUpdate("LayerUpdateMerger: types for property update do not match");
-
- getResultWriter()->addProperty(aName, pPropUpdate->updateFlags(aAttributes), aValue.getValueType());
- }
- }
- else
- {
- xUpdate->writeToLayer(getResultWriter().get());
- }
-}
-// -----------------------------------------------------------------------------
-
-void LayerUpdateMerger::malformedUpdate(sal_Char const * pMsg)
-{
- { (void)pMsg; }
- OSL_ENSURE(false,pMsg);
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace
-
-// -----------------------------------------------------------------------------
-} // namespace
-
diff --git a/configmgr/source/backend/layerupdatemerger.hxx b/configmgr/source/backend/layerupdatemerger.hxx
deleted file mode 100644
index 7055e84b66..0000000000
--- a/configmgr/source/backend/layerupdatemerger.hxx
+++ /dev/null
@@ -1,130 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_LAYERUPDATEMERGER_HXX
-#define CONFIGMGR_BACKEND_LAYERUPDATEMERGER_HXX
-
-#include "basicupdatemerger.hxx"
-#include "layerupdate.hxx"
-#include <rtl/ref.hxx>
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- class NodeUpdate;
- class PropertyUpdate;
-
- class LayerUpdateMerger : protected BasicUpdateMerger
- {
- public:
- static uno::Reference< backenduno::XLayer > getMergedLayer(uno::Reference< backenduno::XLayer > const & _xSourceLayer, LayerUpdate const & _aLayerUpdate)
- { return new LayerUpdateMerger(_xSourceLayer, _aLayerUpdate); }
-
- public:
- explicit
- LayerUpdateMerger( uno::Reference< backenduno::XLayer > const & _xSourceLayer, LayerUpdate const & _aLayerUpdate);
-
- ~LayerUpdateMerger();
-
-
- // XLayerHandler overrides
- protected:
- virtual void SAL_CALL
- startLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endNode( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- dropNode( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endProperty( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- setPropertyValue( const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString & aLocale )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- // BasicUpdateMerger
- virtual void flushUpdate();
- private:
- void malformedUpdate(sal_Char const * pMsg);
- private:
- LayerUpdate m_aLayerUpdate;
- rtl::Reference<NodeUpdate> m_xCurrentNode;
- rtl::Reference<PropertyUpdate> m_xCurrentProp;
- };
-// -----------------------------------------------------------------------------
- } // namespace xml
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/backend/makefile.mk b/configmgr/source/backend/makefile.mk
deleted file mode 100644
index 2b0f223701..0000000000
--- a/configmgr/source/backend/makefile.mk
+++ /dev/null
@@ -1,77 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJINC=$(PRJ)$/source
-PRJNAME=configmgr
-TARGET=backend
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings ---
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/makefile.pmk
-
-# --- Files ---
-
-
-SLOFILES=\
- $(SLO)$/mergedcomponentdata.obj \
- $(SLO)$/componentdatahelper.obj \
- $(SLO)$/schemabuilder.obj \
- $(SLO)$/layermerge.obj \
- $(SLO)$/updatesvc.obj \
- $(SLO)$/layerupdatehandler.obj \
- $(SLO)$/basicupdatemerger.obj \
- $(SLO)$/layerupdatemerger.obj \
- $(SLO)$/layerupdatebuilder.obj \
- $(SLO)$/layerupdate.obj \
- $(SLO)$/updatedata.obj \
- $(SLO)$/updatedispatch.obj \
- $(SLO)$/singlebackendadapter.obj \
- $(SLO)$/backendaccess.obj \
- $(SLO)$/backendfactory.obj \
- $(SLO)$/importsvc.obj \
- $(SLO)$/basicimporthandler.obj \
- $(SLO)$/importmergehandler.obj \
- $(SLO)$/layerdefaultremover.obj \
- $(SLO)$/emptylayer.obj \
- $(SLO)$/binarywriter.obj \
- $(SLO)$/binaryreader.obj \
- $(SLO)$/binarywritehandler.obj \
- $(SLO)$/binaryreadhandler.obj \
- $(SLO)$/binarycache.obj \
- $(SLO)$/backendnotifier.obj \
- $(SLO)$/backendstratalistener.obj \
- $(SLO)$/multistratumbackend.obj \
-
-
-# --- Targets ---
-
-.INCLUDE : target.mk
-
diff --git a/configmgr/source/backend/mergedcomponentdata.cxx b/configmgr/source/backend/mergedcomponentdata.cxx
deleted file mode 100644
index a737abc7a5..0000000000
--- a/configmgr/source/backend/mergedcomponentdata.cxx
+++ /dev/null
@@ -1,173 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "mergedcomponentdata.hxx"
-#include "treenodefactory.hxx"
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
-
-MergedComponentData::MergedComponentData( )
-: m_pSchemaTree()
-, m_pTemplatesTree()
-{
-
-}
-// -----------------------------------------------------------------------------
-
-MergedComponentData::~MergedComponentData( )
-{
-
-}
-// -----------------------------------------------------------------------------
-
-void MergedComponentData::clear( )
-{
- m_pTemplatesTree.reset();
- m_pSchemaTree.reset();
-}
-// -----------------------------------------------------------------------------
-
-bool MergedComponentData::hasSchema()const
-{
- return m_pSchemaTree.get() != NULL;
-}
-// -----------------------------------------------------------------------------
-
-
-bool MergedComponentData::hasTemplates() const
-{
- return m_pTemplatesTree.get() != NULL;
-}
-// -----------------------------------------------------------------------------
-
-rtl::OUString MergedComponentData::getTemplateAccessor (backenduno::TemplateIdentifier const & _aTemplateName) const
-{
- return _aTemplateName.Name;
-}
-// -----------------------------------------------------------------------------
-
-bool MergedComponentData::hasTemplate(rtl::OUString const & _aTemplateName) const
-{
- return m_pTemplatesTree.get() != NULL &&
- m_pTemplatesTree->getChild( _aTemplateName ) != NULL;
-}
-// -----------------------------------------------------------------------------
-
-std::auto_ptr<ISubtree> MergedComponentData::extractSchemaTree()
-{
- return m_pSchemaTree;
-}
-// -----------------------------------------------------------------------------
-
-std::auto_ptr<ISubtree> MergedComponentData::extractTemplatesTree()
-{
- return m_pTemplatesTree;
-}
-// -----------------------------------------------------------------------------
-
-std::auto_ptr<INode> MergedComponentData::extractTemplateNode(rtl::OUString const & _aTemplateName)
-{
- if (m_pTemplatesTree.get() == NULL)
- return std::auto_ptr<INode>();
-
- return m_pTemplatesTree->removeChild(_aTemplateName);
-}
-// -----------------------------------------------------------------------------
-
-ISubtree const * MergedComponentData::findTemplate(rtl::OUString const & _aTemplateName) const
-{
- INode const * pTemplateNode = m_pTemplatesTree->getChild(_aTemplateName);
-
- ISubtree const * pTemplateTree = pTemplateNode ? pTemplateNode->asISubtree() : NULL;
-
- OSL_ENSURE(pTemplateTree || !pTemplateNode, "ERROR: Template is not a subtree");
-
- return pTemplateTree;
-}
-// -----------------------------------------------------------------------------
-
-std::auto_ptr<INode> MergedComponentData::instantiateTemplate(rtl::OUString const & _aName, rtl::OUString const & _aTemplateName) const
-{
- if (INode const * pTemplateNode = m_pTemplatesTree->getChild(_aTemplateName))
- {
- std::auto_ptr<INode> aResult = pTemplateNode->clone();
- aResult->setName(_aName);
- return aResult;
- }
- else
- {
- return std::auto_ptr<INode>();
- }
-}
-// -----------------------------------------------------------------------------
-
-ISubtree * MergedComponentData::setSchemaRoot(std::auto_ptr<ISubtree> _aSchemaRoot)
-{
- OSL_PRECOND(_aSchemaRoot.get(),"ERROR: Setting a NULL schema root.");
- OSL_PRECOND(!hasSchema(),"ERROR: Schema root already set");
-
- m_pSchemaTree = _aSchemaRoot;
-
- return m_pSchemaTree.get();
-}
-// -----------------------------------------------------------------------------
-void MergedComponentData::setTemplatesTree(std::auto_ptr<ISubtree> _aTemplateTree)
-{
- OSL_PRECOND(!hasTemplates(),"ERROR: Template Tree already set");
- m_pTemplatesTree = _aTemplateTree;
-}
-// -----------------------------------------------------------------------------
-ISubtree * MergedComponentData::addTemplate(std::auto_ptr<ISubtree> _aNode, backenduno::TemplateIdentifier const & aTemplate)
-{
- OSL_PRECOND(_aNode.get(), "ERROR: Adding a NULL template");
-
- if (!m_pTemplatesTree.get())
- {
- m_pTemplatesTree = getDefaultTreeNodeFactory().createGroupNode( aTemplate.Component, node::Attributes() );
- }
- else
- {
- OSL_ENSURE(m_pTemplatesTree->getName().equals(aTemplate.Component),
- "Template Component names do not match");
- }
-
- return m_pTemplatesTree->addChild( base_ptr(_aNode) )->asISubtree();
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace backend
-
-// -------------------------------------------------------------------------
-} // namespace configmgr
diff --git a/configmgr/source/backend/mergedcomponentdata.hxx b/configmgr/source/backend/mergedcomponentdata.hxx
deleted file mode 100644
index 99b3cb5597..0000000000
--- a/configmgr/source/backend/mergedcomponentdata.hxx
+++ /dev/null
@@ -1,99 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-/* PLEASE DON'T DELETE ANY COMMENT LINES, ALSO IT'S UNNECESSARY. */
-
-#ifndef CONFIGMGR_BACKEND_MERGEDCOMPONENTDATA_HXX
-#define CONFIGMGR_BACKEND_MERGEDCOMPONENTDATA_HXX
-
-#include "valuenode.hxx"
-
-#include <com/sun/star/configuration/backend/TemplateIdentifier.hpp>
-
-#ifndef INCLUDED_MEMORY
-#include <memory>
-#define INCLUDED_MEMORY
-#endif
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- class OTreeNodeFactory;
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- namespace backenduno = ::com::sun::star::configuration::backend;
-
-// -----------------------------------------------------------------------------
-
- class MergedComponentData
- {
- public:
- MergedComponentData();
- ~MergedComponentData();
-
- bool hasSchema() const;
- bool hasTemplates() const;
- bool hasTemplate(rtl::OUString const & _aTemplateName) const;
-
- rtl::OUString getTemplateAccessor (backenduno::TemplateIdentifier const & _aTemplateName) const;
-
- ISubtree const * getSchemaTree() const { return m_pSchemaTree.get(); }
- ISubtree const * getTemplatesTree() const { return m_pTemplatesTree.get(); }
- ISubtree const * findTemplate(rtl::OUString const & _aTemplateName) const;
-
- ISubtree * getSchemaTree() { return m_pSchemaTree.get(); }
- ISubtree * getTemplatesTree() { return m_pTemplatesTree.get(); }
-
- std::auto_ptr<INode> instantiateTemplate(rtl::OUString const & _aName, rtl::OUString const & _aTemplateName) const;
-
- void clear();
-
- ISubtree * setSchemaRoot(std::auto_ptr<ISubtree> _aSchemaRoot);
- ISubtree * addTemplate(std::auto_ptr<ISubtree> _aNode, backenduno::TemplateIdentifier const & aTemplate);
- void setTemplatesTree(std::auto_ptr<ISubtree> _aTemplateTree);
-
- std::auto_ptr<ISubtree> extractSchemaTree();
- std::auto_ptr<ISubtree> extractTemplatesTree();
- std::auto_ptr<INode> extractTemplateNode(rtl::OUString const & _aTemplateName);
- private:
- std::auto_ptr<ISubtree> m_pSchemaTree;
- std::auto_ptr<ISubtree> m_pTemplatesTree;
-
- };
-// -----------------------------------------------------------------------------
-
- } // namespace backend
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/backend/multistratumbackend.cxx b/configmgr/source/backend/multistratumbackend.cxx
deleted file mode 100644
index 9e4fb58d20..0000000000
--- a/configmgr/source/backend/multistratumbackend.cxx
+++ /dev/null
@@ -1,931 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "multistratumbackend.hxx"
-
-#ifndef CONFIGMGR_API_FACTORY_HXX_
-#include "confapifactory.hxx"
-#endif // CONFIGMGR_API_FACTORY_HXX_
-#include "serviceinfohelper.hxx"
-#include "backendstratalistener.hxx"
-
-#ifndef _CONFIGMGR_BOOTSTRAP_HXX
-#include "bootstrap.hxx"
-#endif
-#include "simpleinteractionrequest.hxx"
-#include "configinteractionhandler.hxx"
-#include <com/sun/star/configuration/backend/XMultiLayerStratum.hpp>
-#include <com/sun/star/configuration/backend/XSingleLayerStratum.hpp>
-#include <com/sun/star/configuration/backend/StratumCreationException.hpp>
-#include <com/sun/star/task/XInteractionHandler.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
-#include <rtl/ustrbuf.hxx>
-
-#include <cppuhelper/exc_hlp.hxx>
-
-#include <stdio.h>
-
-//==============================================================================
-#define OU2A(rtlOUString) (::rtl::OUStringToOString((rtlOUString), RTL_TEXTENCODING_ASCII_US).getStr())
-//==============================================================================
-
-namespace {
-
-namespace css = com::sun::star;
-
-}
-
-namespace configmgr { namespace backend {
-
-//==============================================================================
-static const rtl::OUString kSchemaServiceParam(
- RTL_CONSTASCII_USTRINGPARAM( CONTEXT_ITEM_PREFIX_ "SchemaSupplier"));
-
-static const rtl::OUString kStrataServiceParam(
- RTL_CONSTASCII_USTRINGPARAM( CONTEXT_ITEM_PREFIX_ "Strata"));
-
-static const rtl::OUString kEntity(
- RTL_CONSTASCII_USTRINGPARAM(CONTEXT_ITEM_PREFIX_"EntityLayer")) ;
-
-static const rtl::OUString kAdminModeFlag(
- RTL_CONSTASCII_USTRINGPARAM(CONTEXT_ITEM_ADMINFLAG)) ;
-
-static const rtl::OUString kThisOwnerEntity(
- RTL_CONSTASCII_USTRINGPARAM("<ThisOwnerEntity>")) ;
-
-//------------------------------------------------------------------------------
-bool checkOptionalArg(rtl::OUString& aArg)
- {
- if (aArg.getLength() && aArg[0] == sal_Unicode('?'))
- {
- aArg = aArg.copy(1);
- return true;
- }
- else
- {
- return false;
- }
- }
-//------------------------------------------------------------------------------
-void parseStrataInfo(const rtl::OUString aServiceList,
- std::vector< std::pair<rtl::OUString, rtl::OUString> >& aServiceInfoList,
- const uno::Reference<uno::XInterface>& pContext)
-{
- sal_Int32 nNextToken =0;
- sal_Int32 nLength = aServiceList.getLength();
-
- do
- {
- rtl::OUString aServiceName =aServiceList.getToken(0, ':',nNextToken);
- if((nNextToken ==-1)||(aServiceName.getLength()==0))
- {
- throw backenduno::BackendSetupException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "Malformed Strata Service specified")),
- pContext, uno::Any()) ;
- }
- rtl::OUString aServiceData = aServiceList.getToken(0, ';',nNextToken);
-
- std::pair<rtl::OUString, rtl::OUString> aServiceInfo(aServiceName,aServiceData);
- aServiceInfoList.push_back(aServiceInfo);
- }
- while (nNextToken >= 0 && nNextToken < nLength ) ;
-}
-//------------------------------------------------------------------------------
-MultiStratumBackend::MultiStratumBackend(
- const uno::Reference<uno::XComponentContext>& xContext)
- : cppu::WeakComponentImplHelper7< backenduno::XBackend, backenduno::XBackendEntities, backenduno::XVersionedSchemaSupplier, backenduno::XBackendChangesNotifier, backenduno::XBackendChangesListener, lang::XInitialization, lang::XServiceInfo >(mMutex), mFactory(xContext->getServiceManager(),uno::UNO_QUERY_THROW)
- ,mListenerList()
-{
-
-}
-//------------------------------------------------------------------------------
-
-MultiStratumBackend::~MultiStratumBackend()
-{
-}
-//------------------------------------------------------------------------------
-bool MultiStratumBackend::checkOkState()
-{
- if (!mSchemaSupplier.is())
- {
- if(rBHelper.bDisposed)
- {
- throw lang::DisposedException(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "MultiStratumBackend: Backends already disposed")),*this);
- }
- else
- {
- throw uno::RuntimeException(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "MultiStratumBackend: Object was never Initialised")),*this);
- }
- }
- return true;
-}
-//------------------------------------------------------------------------------
-
-void SAL_CALL MultiStratumBackend::initialize(
- const uno::Sequence<uno::Any>& aParameters)
- throw (uno::RuntimeException, uno::Exception,
- css::configuration::InvalidBootstrapFileException,
- backenduno::BackendSetupException) {
-
- if (aParameters.getLength() == 0) {
- throw lang::IllegalArgumentException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "No parameters provided to MultiStratumBackend")),
- *this, 0) ;
- }
-
- uno::Reference<uno::XComponentContext> context ;
-
- for (sal_Int32 i = 0 ; i < aParameters.getLength() ; ++ i) {
- if (aParameters [i] >>= context) { break ; }
- }
-
-
- try
- {
- //Initialize Backends
- initializeSchemaSupplier (context);
- initializeBackendStrata(context);
-
- sal_Bool bAdminMode = false;
- context->getValueByName(kAdminModeFlag) >>= bAdminMode;
-
- if (bAdminMode)
- {
- // find given entity
- rtl::OUString sDefaultEntity;
- if ( (context->getValueByName(kEntity) >>= sDefaultEntity) && sDefaultEntity.getLength() )
- {
- for (sal_uInt32 i = 0; i < mBackendStrata.size(); i++)
- {
- uno::Reference< backenduno::XBackendEntities > xEntities( mBackendStrata[i], uno::UNO_QUERY );
- if (xEntities.is()&& xEntities->supportsEntity(sDefaultEntity))
- {
- mBackendStrata.resize(i+1);
- mOwnerEntity = sDefaultEntity;
- break;
- }
- }
- }
- else
- {
- mBackendStrata.resize(1);
- }
- }
-
- if(mOwnerEntity.getLength()==0)
- {
- uno::Reference< backenduno::XBackendEntities > xEntities(
- mBackendStrata[mBackendStrata.size()-1], uno::UNO_QUERY );
- if (xEntities.is())
- {
- mOwnerEntity = xEntities->getOwnerEntity();
- }
- else
- {
- mOwnerEntity = kThisOwnerEntity;
- }
- }
- mStrataListener = new BackendStrataListener(*this);
-
- }
- catch(uno::Exception& )
- {
- mSchemaSupplier.clear();
- mBackendStrata.clear() ;
-
- throw;
- }
-
-}
-//------------------------------------------------------------------------------
-void MultiStratumBackend::initializeSchemaSupplier(const uno::Reference<uno::XComponentContext>& aContext)
-{
-
- rtl::OUString aServiceName;
-
- aContext->getValueByName(kSchemaServiceParam) >>= aServiceName;
- uno::Sequence< uno::Any > aInitArgs( 1 );
- aInitArgs[0] <<= aContext;
- mSchemaSupplier = uno::Reference<backenduno::XSchemaSupplier>::query(mFactory->createInstanceWithArguments(aServiceName,aInitArgs)) ;
- if (!mSchemaSupplier.is())
- {
- throw backenduno::BackendSetupException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "MultiStratumBackend: Could not create Schema Supplier service")),
- *this, uno::Any()) ;
-
- }
-}
-//------------------------------------------------------------------------------
-static
-bool approveRecovery(const backenduno::StratumCreationException & aError)
-{
- sal_uInt32 const k_supported_choices = apihelper::CONTINUATION_APPROVE ; //| apihelper::CONTINUATION_DISAPPROVE;
-
- sal_uInt32 chosen = apihelper::CONTINUATION_UNKNOWN;
-
- apihelper::ConfigurationInteractionHandler handler;
- try {
- uno::Reference< css::task::XInteractionHandler > h(handler.get());
- if (h.is()) {
- rtl::Reference< apihelper::SimpleInteractionRequest > req(
- new apihelper::SimpleInteractionRequest(
- uno::makeAny(aError), k_supported_choices));
- h->handle(req.get());
- chosen = req->getResponse();
- }
- } catch (uno::Exception & e) {
- OSL_TRACE("Warning - Configuration: Interaction handler failed: [%s]\n", OU2A(e.Message));
- }
-
- switch (chosen)
- {
- case apihelper::CONTINUATION_APPROVE: return true;
- case apihelper::CONTINUATION_DISAPPROVE: return false;
- case apihelper::CONTINUATION_UNKNOWN: break;
-
- default: OSL_ENSURE(false,"Unsolicited continuation chosen"); break;
- }
- // no choice available - default: disapprove
- return false;
-}
-//------------------------------------------------------------------------------
-void MultiStratumBackend::initializeBackendStrata(const uno::Reference<uno::XComponentContext>& aContext)
-{
-
- rtl::OUString sStrata;
- //Get Strata
- aContext->getValueByName(kStrataServiceParam) >>= sStrata;
- if(sStrata.getLength()==0)
- {
- throw backenduno::BackendSetupException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "MultiStratumBackend: No Strata Services Specified")),
- *this, uno::Any()) ;
-
- }
-
- //need to parse the Strata to extract service names and data location
- std::vector< std::pair<rtl::OUString, rtl::OUString> > aServiceInfoList;
- parseStrataInfo(sStrata,aServiceInfoList,*this);
-
- for (std::vector< std::pair<rtl::OUString, rtl::OUString> >::const_iterator it = aServiceInfoList.begin(); it != aServiceInfoList.end(); ++it)
- {
- uno::Sequence< uno::Any > aInitArgs( 1 );
- rtl::OUString sServiceName = it->first;
- const rtl::OUString& sServiceData = it->second;
- aInitArgs[0] <<= sServiceData;
- uno::Reference <uno::XInterface> xBackend;
- bool bOptional = checkOptionalArg(sServiceName);
-
- try
- {
- xBackend= mFactory->createInstanceWithArguments(sServiceName,aInitArgs);
- }
- catch (uno::Exception& exception)
- {
- if(!bOptional)
- {
- static const sal_Char sErrContext[] = "MultiStratumBackend: Could not create Backend Stratum Service: ";
- rtl::OUString const sContext(RTL_CONSTASCII_USTRINGPARAM(sErrContext));
- rtl::OUString const sMessage = sContext.concat(exception.Message);
-
- backenduno::StratumCreationException error(sMessage,*this,
- ::cppu::getCaughtException(),
- sServiceName,sServiceData);
- if (!approveRecovery(error))
- throw error;
- }
-
- }
- if (xBackend.is())
- {
- mBackendStrata.push_back(xBackend) ;
- }
- }
-}
-//---------------------------------------------------------------------------------------------
-// XBackendEntities
-rtl::OUString SAL_CALL
- MultiStratumBackend::getOwnerEntity( )
- throw (uno::RuntimeException)
-{
-
- if (checkOkState())
- {
- return mOwnerEntity;
- }
- return rtl::OUString();
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL
- MultiStratumBackend::getAdminEntity()
- throw (uno::RuntimeException)
-{
- osl::MutexGuard aGuard(mMutex);
- if (checkOkState())
- {
- uno::Reference< backenduno::XBackendEntities > xEntities( mBackendStrata[0], uno::UNO_QUERY );
- if(xEntities.is())
- {
- return xEntities->getAdminEntity();
- }
- else
- {
- return rtl::OUString();
- }
- }
- return rtl::OUString();
-}
-//------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL
- MultiStratumBackend::supportsEntity( const rtl::OUString& aEntity )
- throw (backenduno::BackendAccessException, uno::RuntimeException)
-{
-
- osl::MutexGuard aGuard(mMutex);
- if (checkOkState())
- {
- for (std::vector< uno::Reference <uno::XInterface> >::const_iterator it = mBackendStrata.begin(); it != mBackendStrata.end(); ++it)
- {
- uno::Reference< backenduno::XBackendEntities > xEntities( *it, uno::UNO_QUERY );
- if (xEntities.is())
- {
- if( xEntities->supportsEntity(aEntity))
- return true;
- }
- }
- return false;
- }
- return false;
-}
-//------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL
- MultiStratumBackend::isEqualEntity( const rtl::OUString& aEntity, const rtl::OUString& aOtherEntity )
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- osl::MutexGuard aGuard(mMutex);
- if (aEntity.getLength() == 0)
- {
- rtl::OUString const sMsg(RTL_CONSTASCII_USTRINGPARAM(
- "LocalSingleBackend - Invalid empty entity."));
-
- throw lang::IllegalArgumentException(sMsg, *this, 1);
- }
- if (aOtherEntity.getLength() == 0)
- {
- rtl::OUString const sMsg(RTL_CONSTASCII_USTRINGPARAM(
- "LocalSingleBackend - Invalid empty entity."));
-
- throw lang::IllegalArgumentException(sMsg, *this, 2);
- }
-
-
- if (aEntity.equals(aOtherEntity))
- {
- return true;
- }
-
- if (checkOkState())
- {
- for (std::vector< uno::Reference <uno::XInterface> >::const_iterator it = mBackendStrata.begin(); it != mBackendStrata.end(); ++it)
- {
- uno::Reference< backenduno::XBackendEntities > xEntities( *it, uno::UNO_QUERY );
- if (xEntities.is())
- {
- if( xEntities->supportsEntity(aEntity))
- return xEntities->isEqualEntity(aEntity,aOtherEntity);
- }
- }
- return false;
- }
- return false;
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL
- MultiStratumBackend::getSchemaVersion(const rtl::OUString& aComponent)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- osl::MutexGuard aGuard(mMutex);
-
- if (checkOkState())
- {
- uno::Reference<backenduno::XVersionedSchemaSupplier> xVersionSupplier(mSchemaSupplier,uno::UNO_QUERY);
- if (xVersionSupplier.is())
- return xVersionSupplier->getSchemaVersion(aComponent) ;
- }
- return rtl::OUString();
-}
-//------------------------------------------------------------------------------
-
-uno::Reference<backenduno::XSchema> SAL_CALL
- MultiStratumBackend::getComponentSchema(const rtl::OUString& aComponent)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- osl::MutexGuard aGuard(mMutex);
-
- if (checkOkState())
- {
- return mSchemaSupplier->getComponentSchema(aComponent) ;
- }
- return NULL;
-}
-//------------------------------------------------------------------------------
-
-uno::Sequence<uno::Reference<backenduno::XLayer> > SAL_CALL
- MultiStratumBackend::listOwnLayers(const rtl::OUString& aComponent)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- if (checkOkState())
- {
- return listLayers(aComponent, mOwnerEntity ) ;
- }
- return uno::Sequence<uno::Reference<backenduno::XLayer> >() ;
-}
-//------------------------------------------------------------------------------
-
-uno::Reference<backenduno::XUpdateHandler> SAL_CALL
- MultiStratumBackend::getOwnUpdateHandler(const rtl::OUString& aComponent)
- throw (backenduno::BackendAccessException,
- lang::NoSupportException,
- lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- if (checkOkState())
- {
- return getUpdateHandler(aComponent, mOwnerEntity) ;
- }
- return NULL;
-}
-//------------------------------------------------------------------------------
-
-uno::Sequence<uno::Reference<backenduno::XLayer> > SAL_CALL
- MultiStratumBackend::listLayers(const rtl::OUString& aComponent,
- const rtl::OUString& aEntity)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException)
-{
-
- osl::MutexGuard aGuard(mMutex);
- if (checkOkState())
- {
- sal_Int32 nNumSupportedLayers = mBackendStrata.size();
- if(aEntity != mOwnerEntity)
- {
- nNumSupportedLayers = findSupportingStratum(aEntity);
- }
- return searchSupportingStrata(nNumSupportedLayers,aEntity,aComponent);
- }
- return uno::Sequence<uno::Reference<backenduno::XLayer> >();
-}
-//------------------------------------------------------------------------------
-sal_Int32 MultiStratumBackend::findSupportingStratum(const rtl::OUString& aEntity)
-{
- sal_Int32 nNumLayers = mBackendStrata.size();
- for (std::vector< uno::Reference <uno::XInterface> >::reverse_iterator it = mBackendStrata.rbegin(); it != mBackendStrata.rend(); ++it)
- {
- uno::Reference< backenduno::XBackendEntities > xEntities( *it, uno::UNO_QUERY );
- if (xEntities.is())
- {
- if( xEntities->supportsEntity(aEntity))
- {
- return nNumLayers;
- }
- }
- nNumLayers--;
- }
- rtl::OUStringBuffer sMsg;
- sMsg.appendAscii("\n MultiStratumBackend: No Backend supports Entity: \"");
- sMsg.append(aEntity);
- throw lang::IllegalArgumentException(sMsg.makeStringAndClear(),
- *this, 0) ;
-}
-//------------------------------------------------------------------------------
-uno::Sequence<uno::Reference<backenduno::XLayer> >
- MultiStratumBackend::searchSupportingStrata(sal_Int32 nNumLayers,
- rtl::OUString aEntity,
- const rtl::OUString& aComponent)
-{
- uno::Sequence<uno::Reference<backenduno::XLayer> > aLayers;
- std::vector<uno::Reference<backenduno::XLayer> > aBackendLayers;
- for (sal_Int32 i = 0 ; i < nNumLayers ; ++ i)
- {
- uno::Sequence<uno::Reference<backenduno::XLayer> > aMultiLayers;
- uno::Reference< backenduno::XBackendEntities > xEntities(mBackendStrata[i], uno::UNO_QUERY );
-
- uno::Reference<backenduno::XBackend> xBackend(mBackendStrata[i], uno::UNO_QUERY) ;
- if (xBackend.is())
- {
- if (xEntities.is())
- {
- if( !xEntities->supportsEntity(aEntity))
- {
- aEntity = xEntities->getOwnerEntity();
- }
- aMultiLayers = xBackend->listLayers(aComponent, aEntity) ;
- }
- else
- {
- aMultiLayers = xBackend->listOwnLayers(aComponent);
- }
- }
- else
- {
- uno::Reference<backenduno::XMultiLayerStratum> xMultiLayerStratum(
- mBackendStrata[i], uno::UNO_QUERY) ;
-
- if (xMultiLayerStratum.is())
- {
- if (xEntities.is())
- {
- if( !xEntities->supportsEntity(aEntity))
- {
- aEntity = xEntities->getOwnerEntity();
- }
- aMultiLayers = xMultiLayerStratum->getLayers(
- xMultiLayerStratum->listLayerIds(aComponent, aEntity),
- rtl::OUString()) ;
-
- }
- else
- {
- throw backenduno::BackendSetupException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "MultiStratumBackend: XMultiLayerStratum must support XBackendEntities")),
- *this, uno::Any()) ;
- }
-
- }
- else
- {
- uno::Reference<backenduno::XSingleLayerStratum> xSingleLayerStratum(
- mBackendStrata[i], uno::UNO_REF_QUERY_THROW) ;
- if (xSingleLayerStratum.is())
- {
- uno::Reference<backenduno::XLayer> xLayer = xSingleLayerStratum->getLayer( aComponent, rtl::OUString());
- //Could be an empty layer
- if (xLayer.is())
- {
- aBackendLayers.push_back(xLayer);
- }
- }
- }
- }
- // There might be non-existent layers in the list if there's no
- // actual data associated to a given layer id. Hence we have to
- // compress the list.
- for (sal_Int32 j = 0 ; j < aMultiLayers.getLength() ; ++j)
- {
- if (aMultiLayers [j].is())
- {
- aBackendLayers.push_back( aMultiLayers[j]);
- }
- }
- }
- aLayers.realloc(aBackendLayers.size());
- for (sal_uInt32 k =0; k < aBackendLayers.size();k++)
- {
- aLayers[k] = aBackendLayers[k];
- }
- return aLayers;
-}
-//------------------------------------------------------------------------------
-uno::Reference<backenduno::XUpdateHandler> SAL_CALL
- MultiStratumBackend::getUpdateHandler(const rtl::OUString& aComponent,
- const rtl::OUString& aEntity)
- throw (backenduno::BackendAccessException,
- lang::NoSupportException,
- lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- osl::MutexGuard aGuard(mMutex);
-
- if (checkOkState())
- {
-
- sal_Int32 nNumSupportedLayers = mBackendStrata.size();
- rtl::OUString aUsedEntity;
-
- if(aEntity != mOwnerEntity)
- {
- nNumSupportedLayers = findSupportingStratum(aEntity);
- aUsedEntity = aEntity;
- }
- else
- {
- uno::Reference< backenduno::XBackendEntities > xEntities( mBackendStrata[mBackendStrata.size()-1], uno::UNO_QUERY );
- if (xEntities.is())
- {
- aUsedEntity = xEntities->getOwnerEntity();
- }
- }
- sal_Int32 nStrataIndex = nNumSupportedLayers -1;
-
- uno::Reference<backenduno::XBackend> xBackend(
- mBackendStrata[nStrataIndex], uno::UNO_QUERY) ;
- uno::Reference< uno::XInterface > xHandler;
- if(xBackend.is())
- {
- if (aUsedEntity.getLength()==0)
- {
- xHandler = xBackend->getOwnUpdateHandler(aComponent) ;
- return uno::Reference<backenduno::XUpdateHandler>(xHandler,uno::UNO_REF_QUERY_THROW);
- }
- else
- {
- xHandler = xBackend->getUpdateHandler(aComponent, aUsedEntity) ;
- return uno::Reference<backenduno::XUpdateHandler>(xHandler,uno::UNO_REF_QUERY_THROW);
- }
- }
- else
- {
-
- uno::Sequence<uno::Any> arguments(1) ;
-
- uno::Reference< backenduno::XMultiLayerStratum > xMultiLayerStratum
- (mBackendStrata[nStrataIndex], uno::UNO_QUERY );
- if(xMultiLayerStratum.is())
- {
- arguments [0] <<= xMultiLayerStratum->getUpdatableLayer(
- xMultiLayerStratum->getUpdateLayerId(aComponent,aUsedEntity));
- }
- else
- {
- uno::Reference< backenduno::XSingleLayerStratum > xSingleLayerStratum(
- mBackendStrata[nStrataIndex], uno::UNO_REF_QUERY_THROW );
-
- arguments [0] <<= xSingleLayerStratum->getUpdatableLayer(aComponent);
-
- }
-
- if(!xHandler.is())
- {
- try
- {
- const rtl::OUString kUpdateMerger(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.backend.LayerUpdateMerger")) ;
-
-
- if(!mFactory.is())
- {
- throw lang::DisposedException(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "MultiStratumBackend: Service Factory already dispoed")),*this);
- }
-
- xHandler = mFactory->createInstanceWithArguments(kUpdateMerger, arguments);
- }
- catch (uno::RuntimeException & )
- {throw;}
- catch (uno::Exception & e)
- {
- const rtl::OUString sMessage(RTL_CONSTASCII_USTRINGPARAM(
- "Configuration MultiStratumBackend: Cannot create UpdateMerger - error message: ")) ;
- throw uno::RuntimeException(sMessage.concat(e.Message),*this);
- }
- }
- return uno::Reference<backenduno::XUpdateHandler>(xHandler, uno::UNO_REF_QUERY_THROW) ;
- }
- }
- return NULL;
-}
-// ---------------------------------------------------------------------------
-// ComponentHelper
-void SAL_CALL MultiStratumBackend::disposing()
-{
- osl::MutexGuard aGuard(mMutex);
- if (mFactory.is())
- {
- mFactory.clear();
- }
- if (mSchemaSupplier.is())
- {
- uno::Reference< lang::XComponent> xComp( mSchemaSupplier, uno::UNO_QUERY);
- if (xComp.is())
- {
- xComp->dispose();
- }
- if (mSchemaSupplier.is())
- {
- mSchemaSupplier.clear();
- }
- }
- if (!mBackendStrata.empty())
- {
- for (std::vector< uno::Reference <uno::XInterface> >::const_iterator it = mBackendStrata.begin(); it != mBackendStrata.end(); ++it)
- {
- uno::Reference< lang::XComponent> xComp( *it, uno::UNO_QUERY );
- if (xComp.is())
- {
- try
- {
- xComp->dispose();
- }
- catch(uno::Exception &){}
- }
- }
- mBackendStrata.clear();
-
- }
-
- }
-//------------------------------------------------------------------------------
-
-static const sal_Char * const kBackendService = "com.sun.star.configuration.backend.Backend" ;
-
-static const sal_Char * const kImplementation =
- "com.sun.star.comp.configuration.backend.MultiStratumBackend" ;
-
-static sal_Char const * const kServiceNames [] =
-{
- kBackendService,
- 0
-} ;
-static const ServiceImplementationInfo kServiceInfo =
-{
- kImplementation,
- kServiceNames,
- 0
-} ;
-
-const ServiceRegistrationInfo *getMultiStratumBackendServiceInfo()
-{
- return getRegistrationInfo(&kServiceInfo) ;
-}
-
-uno::Reference<uno::XInterface> SAL_CALL
- instantiateMultiStratumBackend(const uno::Reference< uno::XComponentContext >& xContext)
-{
- return *new MultiStratumBackend(xContext) ;
-}
-//------------------------------------------------------------------------------
-
-static const rtl::OUString kImplementationName(
- RTL_CONSTASCII_USTRINGPARAM(kImplementation)) ;
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL
- MultiStratumBackend::getImplementationName(void)
- throw (uno::RuntimeException)
-{
- return ServiceInfoHelper(&kServiceInfo).getImplementationName() ;
-}
-//------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL
- MultiStratumBackend::supportsService(const rtl::OUString& aServiceName)
- throw (uno::RuntimeException)
-{
- return ServiceInfoHelper(&kServiceInfo).supportsService(aServiceName) ;
-}
-//------------------------------------------------------------------------------
-uno::Sequence<rtl::OUString> SAL_CALL
- MultiStratumBackend::getSupportedServiceNames(void)
- throw (uno::RuntimeException)
-{
- return ServiceInfoHelper(&kServiceInfo).getSupportedServiceNames() ;
-}
-//------------------------------------------------------------------------------
-void SAL_CALL MultiStratumBackend::addChangesListener( const uno::Reference<backenduno::XBackendChangesListener>& xListener,
- const rtl::OUString& aComponent)
- throw (::com::sun::star::uno::RuntimeException)
-{
- osl::MutexGuard aGuard(mMutex);
- if(checkOkState())
- {
-
- mListenerList.insert( ListenerList::value_type(aComponent, xListener));
- //Now register with lower layers
- for (sal_uInt32 i = 0 ; i < mBackendStrata.size() ; ++ i)
- {
- uno::Reference<backenduno::XBackendChangesNotifier> xBackend(mBackendStrata[i], uno::UNO_QUERY) ;
- if (xBackend.is())
- {
- xBackend->addChangesListener(mStrataListener, aComponent);
- }
- }
- }
-}
-//------------------------------------------------------------------------------
-void SAL_CALL MultiStratumBackend::removeChangesListener( const uno::Reference<backenduno::XBackendChangesListener>& /*xListner*/,
- const rtl::OUString& aComponent)
- throw (::com::sun::star::uno::RuntimeException)
-{
- osl::MutexGuard aGuard(mMutex);
- if(checkOkState())
- {
- sal_Int32 nCount = mListenerList.count(aComponent);
- if (nCount == 0)
- {
- OSL_TRACE("MultiStratumBackend: removeListener: no listener registered for component %s"
- , aComponent.getStr());
- }
- else
- {
- ListenerList::iterator aIter;
- aIter = mListenerList.find(aComponent);
- mListenerList.erase(aIter);
- if (nCount == 1)
- {
- //Deregister Listener from strata backend if they support notification
- for (sal_uInt32 i = 0 ; i < mBackendStrata.size(); ++ i)
- {
- uno::Reference<backenduno::XBackendChangesNotifier> xBackend(mBackendStrata[i], uno::UNO_QUERY) ;
- if (xBackend.is())
- {
- xBackend->removeChangesListener(mStrataListener, aComponent);
- }
- }
- }
- }
- }
-}
-//------------------------------------------------------------------------------
-void MultiStratumBackend::componentDataChanged(const backenduno::ComponentChangeEvent& aEvent)
- throw (::com::sun::star::uno::RuntimeException)
-{
- try
- {
- notifyListeners( aEvent);
-
- }
- catch (uno::RuntimeException& ) { throw; }
- catch (uno::Exception& e)
- {
- throw lang::WrappedTargetRuntimeException(e.Message, *this, uno::makeAny(e));
- }
-}
-//------------------------------------------------------------------------------
-void MultiStratumBackend::disposing( lang::EventObject const & /*rSource*/ )
- throw (::com::sun::star::uno::RuntimeException)
-{}
-//------------------------------------------------------------------------------
-void MultiStratumBackend::notifyListeners(const backenduno::ComponentChangeEvent& aEvent)const
-{
- //fire off notification to all registered listeners for specific Component
- ListenerList::const_iterator aIter;
- rtl::OUString aComponentName = aEvent.Component;
- if (mListenerList.empty())
- {
- OSL_TRACE("MultiStratumBackend: notifyListeners: no listeners registered for component %s",
- aComponentName.getStr());
- }
- else
- {
- aIter = mListenerList.begin();
- do{
- if (aIter->first == aComponentName)
- {
- aIter->second->componentDataChanged(aEvent);
- }
- aIter++;
- }while (aIter != mListenerList.end());
- }
- }
-//------------------------------------------------------------------------------
-} } // configmgr.backend
-
diff --git a/configmgr/source/backend/multistratumbackend.hxx b/configmgr/source/backend/multistratumbackend.hxx
deleted file mode 100644
index a839cc06e8..0000000000
--- a/configmgr/source/backend/multistratumbackend.hxx
+++ /dev/null
@@ -1,219 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_MULTISTRATUMBACKEND_HXX_
-#define CONFIGMGR_BACKEND_MULTISTRATUMBACKEND_HXX_
-
-#include <com/sun/star/configuration/backend/XBackend.hpp>
-#include <com/sun/star/configuration/backend/XBackendEntities.hpp>
-#include <com/sun/star/configuration/backend/XVersionedSchemaSupplier.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/uno/XInterface.hpp>
-#include <com/sun/star/configuration/InvalidBootstrapFileException.hpp>
-#include <com/sun/star/configuration/backend/BackendSetupException.hpp>
-#include <com/sun/star/configuration/backend/XBackendChangesNotifier.hpp>
-#include <com/sun/star/configuration/backend/XBackendChangesListener.hpp>
-#include <cppuhelper/compbase7.hxx>
-
-#ifndef INCLUDED_MAP
-#include <map>
-#define INCLUDED_MAP
-#endif
-
-namespace configmgr { namespace backend {
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backenduno = css::configuration::backend ;
-
-/**
- Class implementing the Backend service for multibackend access.
- It creates the required backends and coordinates access to them.
- */
-class MultiStratumBackend : public cppu::WeakComponentImplHelper7< backenduno::XBackend, backenduno::XBackendEntities, backenduno::XVersionedSchemaSupplier, backenduno::XBackendChangesNotifier, backenduno::XBackendChangesListener, lang::XInitialization, lang::XServiceInfo > {
- public :
- /**
- Service constructor from a service factory.
-
- @param xContext component context
- */
- explicit
- MultiStratumBackend(
- const uno::Reference<uno::XComponentContext>& xContext) ;
- /** Destructor */
- ~MultiStratumBackend() ;
-
- // XInitialize
- virtual void SAL_CALL initialize(
- const uno::Sequence<uno::Any>& aParameters)
- throw (uno::RuntimeException, uno::Exception,
- css::configuration::InvalidBootstrapFileException,
- backenduno::BackendSetupException) ;
-
- // XVersionedSchemaSupplier
- virtual rtl::OUString
- SAL_CALL getSchemaVersion(const rtl::OUString& aComponent)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
-
- // XSchemaSupplier
- virtual uno::Reference<backenduno::XSchema>
- SAL_CALL getComponentSchema(const rtl::OUString& aComponent)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
-
- // XBackend
- virtual uno::Sequence<uno::Reference<backenduno::XLayer> >
- SAL_CALL listOwnLayers(const rtl::OUString& aComponent)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
-
- virtual uno::Reference<backenduno::XUpdateHandler>
- SAL_CALL getOwnUpdateHandler(const rtl::OUString& aComponent)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- lang::NoSupportException,
- uno::RuntimeException) ;
- virtual uno::Sequence<uno::Reference<backenduno::XLayer> > SAL_CALL
- listLayers(const rtl::OUString& aComponent,
- const rtl::OUString& aEntity)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
- virtual uno::Reference<backenduno::XUpdateHandler> SAL_CALL
- getUpdateHandler(const rtl::OUString& aComponent,
- const rtl::OUString& aEntity)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- lang::NoSupportException,
- uno::RuntimeException) ;
-
- // XBackendEntities
- virtual rtl::OUString SAL_CALL
- getOwnerEntity( )
- throw (uno::RuntimeException);
-
- virtual rtl::OUString SAL_CALL
- getAdminEntity( )
- throw (uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- supportsEntity( const rtl::OUString& aEntity )
- throw (backenduno::BackendAccessException, uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- isEqualEntity( const rtl::OUString& aEntity, const rtl::OUString& aOtherEntity )
- throw ( backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException);
-
- // XServiceInfo
- virtual rtl::OUString SAL_CALL getImplementationName()
- throw (uno::RuntimeException) ;
- virtual sal_Bool SAL_CALL supportsService(
- const rtl::OUString& aServiceName)
- throw (uno::RuntimeException) ;
- virtual uno::Sequence<rtl::OUString> SAL_CALL
- getSupportedServiceNames(void) throw (uno::RuntimeException) ;
-
- // XBackendChangesNotifier
- virtual void SAL_CALL addChangesListener( const uno::Reference<backenduno::XBackendChangesListener>& xListner,
- const rtl::OUString& aComponent)
- throw (::com::sun::star::uno::RuntimeException);
-
-
- virtual void SAL_CALL removeChangesListener( const uno::Reference<backenduno::XBackendChangesListener>& xListner,
- const rtl::OUString& aComponent)
- throw (::com::sun::star::uno::RuntimeException);
-
- // XBackendChangesListener
- virtual void SAL_CALL componentDataChanged(const backenduno::ComponentChangeEvent& aEvent)
- throw (::com::sun::star::uno::RuntimeException);
-
- virtual void SAL_CALL disposing( lang::EventObject const & rSource )
- throw (uno::RuntimeException);
-
- void notifyListeners(const backenduno::ComponentChangeEvent& aEvent) const;
- protected:
- // ComponentHelper
- virtual void SAL_CALL disposing();
- private :
- /** Initialize the schema supplier backend
-
- */
- void initializeSchemaSupplier(const uno::Reference<uno::XComponentContext>& aContext);
-
- /** Initialize strata(SingleLayer or MultiLayer) backend
- */
- void initializeBackendStrata(const uno::Reference<uno::XComponentContext>& aContext);
-
- /** Get Layers from Backend Strata
- */
- uno::Sequence<uno::Reference<backenduno::XLayer> >
- searchSupportingStrata(sal_Int32 nNumLayer,
- rtl::OUString aEntity,
- const rtl::OUString& aComponent) ;
-
-
- /** Find the Stratum that supports the specified Entity
- * @return Number of Supported Strata
- */
- sal_Int32 findSupportingStratum(const rtl::OUString& aEntity) ;
-
-
- /**
- Check state of MultiStratumBackend -
- @return true if not disposed/uninitialized
- */
- bool checkOkState();
- /** Service factory */
- uno::Reference<lang::XMultiServiceFactory> mFactory ;
- /** Mutex for resource protection */
- osl::Mutex mMutex ;
-
- uno::Reference<backenduno::XSchemaSupplier> mSchemaSupplier ;
- /** list of all backends */
- std::vector< uno::Reference <uno::XInterface> > mBackendStrata;
-
- rtl::OUString mOwnerEntity;
-
- /** Helper object that listens to the Strata Backends */
- uno::Reference<backenduno::XBackendChangesListener> mStrataListener;
- /** List of higher level listeners */
- typedef std::multimap< rtl::OUString, uno::Reference<backenduno::XBackendChangesListener> > ListenerList;
- ListenerList mListenerList;
-} ;
-
-} } // configmgr.backend
-
-#endif // CONFIGMGR_BACKEND_MULTISTRATUMBACKEND_HXX_
diff --git a/configmgr/source/backend/schemabuilder.cxx b/configmgr/source/backend/schemabuilder.cxx
deleted file mode 100644
index 9cb8ab6240..0000000000
--- a/configmgr/source/backend/schemabuilder.cxx
+++ /dev/null
@@ -1,536 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "schemabuilder.hxx"
-#include "treenodefactory.hxx"
-#include "matchlocale.hxx"
-#include <com/sun/star/configuration/backend/SchemaAttribute.hpp>
-#include <rtl/ustrbuf.hxx>
-
-#ifndef INCLUDED_ALGORITHM
-#include <algorithm>
-#define INCLUDED_ALGORITHM
-#endif
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
-
- namespace SchemaAttribute = backenduno::SchemaAttribute;
-// -----------------------------------------------------------------------------
-//#if OSL_DEBUG_LEVEL > 0
-// currently not used in debug builds
-#if 0
- static void check_if_complete(MergedComponentData & md, uno::Reference< uno::XComponentContext > const & xContext)
- {
- uno::Reference< backenduno::XSchemaHandler >
- test(new SchemaBuilder(xContext, rtl::OUString(),md,NULL));
- }
-#endif
-// -----------------------------------------------------------------------------
-
-SchemaBuilder::SchemaBuilder(uno::Reference< uno::XComponentContext > const & xContext, const rtl::OUString& aExpectedComponentName, MergedComponentData & rData, ITemplateDataProvider* aTemplateProvider )
-: m_aData(rData)
-, m_aContext(xContext)
-//, m_aContext(xContext,static_cast<backenduno::XSchemaHandler*>(this), aExpectedComponentName, aTemplateProvider )
-, m_aFactory()
-{
- m_aContext = DataBuilderContext(xContext,static_cast<backenduno::XSchemaHandler*>(this), aExpectedComponentName, aTemplateProvider );
-}
-// -----------------------------------------------------------------------------
-
-SchemaBuilder::~SchemaBuilder( )
-{
-
-}
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-// XSchemaHandler
-
-void SAL_CALL SchemaBuilder::startSchema( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (!this->isDone())
- m_aContext.raiseMalformedDataException("Schema builder: Unexpected Restart of Schema");
-
- m_aData.clear();
-
- OSL_ASSERT(!m_aContext.hasActiveComponent());
- OSL_ASSERT( m_aContext.isDone());
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL SchemaBuilder::endSchema( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (!this->isDone())
- m_aContext.raiseMalformedDataException("Schema builder: Unexpected End of Schema");
-
- substituteInstances();
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL SchemaBuilder::importComponent( const rtl::OUString& /*aName*/ )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- //OSL_TRACE("WARNING: Configuration schema parser: Cross-component references are not yet supported\n");
-}
-// -----------------------------------------------------------------------------
-
-
-void SAL_CALL SchemaBuilder::startComponent( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (m_aData.hasSchema())
- m_aContext.raiseElementExistException("Schema builder: The component schema is already loaded", rtl::OUString());
-
- m_aContext.startActiveComponent(aName);
-
- std::auto_ptr<ISubtree> apSchema =
- m_aFactory.createGroup(aName,0,getComponentRootAttributes());
-
- ISubtree * pSchema = m_aData.setSchemaRoot(apSchema);
-
- m_aContext.pushNode(pSchema);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL SchemaBuilder::endComponent( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- m_aContext.popNode();
-
- m_aContext.endActiveComponent();
-}
-// -----------------------------------------------------------------------------
-
-bool SchemaBuilder::isExtensible(sal_Int16 aSchemaAttributes)
-{
- sal_Int16 const aValidAttributes = aSchemaAttributes & SchemaAttribute::EXTENSIBLE;
-
- if (aValidAttributes != aSchemaAttributes)
- m_aContext.raiseIllegalArgumentException("Schema builder: Illegal attribute specified for node.",2);
-
- return (aValidAttributes != 0);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL SchemaBuilder::startGroupTemplate( const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (aTemplate.Component.getLength() == 0)
- m_aContext.raiseIllegalArgumentException("Schema builder: Starting template without owning component",1);
-
- m_aContext.startActiveComponent(aTemplate.Component);
-
- if (m_aData.hasTemplate(aTemplate.Name))
- m_aContext.raiseElementExistException("Schema builder: Template already exists",aTemplate.Name);
-
- rtl::OUString aName = m_aData.getTemplateAccessor(aTemplate);
- bool bExtensible = isExtensible(aAttributes);
-
- std::auto_ptr<ISubtree> aTemplateTree =
- m_aFactory.createGroup(aName,bExtensible,getTemplateBaseAttributes());
-
- ISubtree * pTree = m_aData.addTemplate(aTemplateTree,aTemplate);
-
- m_aContext.pushNode(pTree);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL SchemaBuilder::startSetTemplate( const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes, const backenduno::TemplateIdentifier& aItemType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if (aTemplate.Component.getLength() == 0)
- m_aContext.raiseIllegalArgumentException("Schema builder: Starting template without owning component",1);
-
- m_aContext.startActiveComponent(aTemplate.Component);
-
- if (m_aData.hasTemplate(aTemplate.Name))
- m_aContext.raiseElementExistException("Schema builder: Template already exists",aTemplate.Name);
-
- rtl::OUString aName = m_aData.getTemplateAccessor(aTemplate);
- backenduno::TemplateIdentifier aFullType = m_aContext.completeComponent(aItemType);
- bool bExtensible = isExtensible(aAttributes);
-
- std::auto_ptr<ISubtree> aTemplateTree =
- m_aFactory.createSet( aName,aFullType,bExtensible,getTemplateBaseAttributes());
-
- ISubtree * pTree = m_aData.addTemplate(aTemplateTree,aTemplate);
-
- m_aContext.pushNode(pTree);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL SchemaBuilder::endTemplate( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- m_aContext.popNode();
-
- m_aContext.endActiveComponent();
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL SchemaBuilder::startGroup( const rtl::OUString& aName, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- bool bExtensible = isExtensible(aAttributes);
-
- std::auto_ptr<ISubtree> aTree = m_aFactory.createGroup(aName,bExtensible,getNodeAttributes());
-
- ISubtree * pTree = m_aContext.addNodeToCurrent(aTree);
-
- m_aContext.pushNode(pTree);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL SchemaBuilder::startSet( const rtl::OUString& aName, sal_Int16 aAttributes, const backenduno::TemplateIdentifier& aItemType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- backenduno::TemplateIdentifier aFullType = m_aContext.completeComponent(aItemType);
- bool bExtensible = isExtensible(aAttributes);
-
- std::auto_ptr<ISubtree> aTree = m_aFactory.createSet(aName,aFullType,bExtensible,getNodeAttributes());
-
- ISubtree * pTree = m_aContext.addNodeToCurrent(aTree);
-
- m_aContext.pushNode(pTree);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL SchemaBuilder::endNode( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- m_aContext.popNode();
-
- if (m_aContext.isDone())
- m_aContext.raiseMalformedDataException("Schema builder: Incorrect Termination");
-}
-// -----------------------------------------------------------------------------
-
-node::Attributes SchemaBuilder::makePropertyAttributes(sal_Int16 aSchemaAttributes) const
-{
- const sal_uInt16 c_AllPropertyAttributes =
- SchemaAttribute::REQUIRED | SchemaAttribute::LOCALIZED;
-
- if ((aSchemaAttributes & c_AllPropertyAttributes) != aSchemaAttributes)
- m_aContext.raiseIllegalArgumentException("SchemaBuilder: Unreckognized Attribute for Property",2);
-
- node::Attributes aAttributes = getNodeAttributes();
-
- if (aSchemaAttributes & SchemaAttribute::REQUIRED)
- aAttributes.setNullable (false);
-
- return aAttributes;
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL SchemaBuilder::addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- // TODO: add type validation
- node::Attributes aValueAttributes = makePropertyAttributes(aAttributes);
-
- if (aAttributes & SchemaAttribute::LOCALIZED)
- {
- std::auto_ptr<ISubtree> aLocalizedProp =
- m_aFactory.createLocalizedContainer(aName,aType,aValueAttributes);
-
- m_aContext.addLocalizedToCurrent(aLocalizedProp);
- }
- else
- {
- std::auto_ptr<ValueNode> aPropertyValue =
- m_aFactory.getNodeFactory().createNullValueNode(aName,aType,aValueAttributes);
-
- m_aContext.addPropertyToCurrent(aPropertyValue);
- }
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL SchemaBuilder::addPropertyWithDefault( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aDefaultValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- // TODO: add parameter validation
- node::Attributes aValueAttributes = makePropertyAttributes(aAttributes);
-
- if (aAttributes & SchemaAttribute::LOCALIZED)
- {
- std::auto_ptr<ISubtree> aLocalizedProp =
- m_aFactory.createLocalizedContainer(aName,aDefaultValue.getValueType(),aValueAttributes);
-
- std::auto_ptr<ValueNode> aPropertyValue =
- m_aFactory.getNodeFactory().createValueNode(localehelper::getDefaultLanguage(),aDefaultValue,aValueAttributes);
-
- aLocalizedProp->addChild( base_ptr(aPropertyValue) );
-
- m_aContext.addLocalizedToCurrent(aLocalizedProp);
- }
- else
- {
- std::auto_ptr<ValueNode> aPropertyValue =
- m_aFactory.getNodeFactory().createValueNode(aName,aDefaultValue,aValueAttributes);
-
-
- m_aContext.addPropertyToCurrent( aPropertyValue);
- }
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL SchemaBuilder::addInstance( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- backenduno::TemplateIdentifier aFullType = m_aContext.completeComponent(aTemplate);
-
- std::auto_ptr<ISubtree> aPlaceHolder =
- m_aFactory.createPlaceHolder(aName,aFullType);
-
- m_aContext.addNodeToCurrent(aPlaceHolder);
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL SchemaBuilder::addItemType( const backenduno::TemplateIdentifier& aItemType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- if ( m_aContext.getCurrentParent().getElementTemplateName() != aItemType.Name ||
- m_aContext.getCurrentParent().getElementTemplateModule() != m_aContext.getTemplateComponent(aItemType) )
- {
- OSL_ENSURE(false, "SchemaBuilder: Multiple ItemTypes for Sets are currently not supported");
- m_aContext.raiseMalformedDataException("SchemaBuilder: Unsupported Feature: Multiple ItemTypes for Sets");
- }
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-node::Attributes SchemaBuilder::getNodeAttributes() const
-{
- node::Attributes aResult = m_aContext.getCurrentAttributes();
- aResult.setState( node::isDefault );
- return aResult;
-}
-// -----------------------------------------------------------------------------
-
-node::Attributes SchemaBuilder::getComponentRootAttributes()
-{
- node::Attributes aResult;
- aResult.setState( node::isDefault );
- return aResult;
-}
-// -----------------------------------------------------------------------------
-
-node::Attributes SchemaBuilder::getTemplateBaseAttributes()
-{
- node::Attributes aResult;
- aResult.setState( node::isReplaced );
- return aResult;
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-namespace
-{
- class SubstitutionHelper : NodeModification
- {
- MergedComponentData & m_rData;
- DataBuilderContext m_aContext;
- ComponentDataFactory m_aFactory;
-
- std::vector< rtl::OUString > m_aReplacementList;
- std::vector< ISubtree const * > m_aTemplateStack;
- public:
- SubstitutionHelper(DataBuilderContext const & aBaseContext, MergedComponentData & _rData, uno::XInterface * _pContext)
- : m_rData(_rData)
- , m_aContext(aBaseContext,_pContext)
- , m_aReplacementList()
- , m_aTemplateStack()
- {}
-
- void substituteInData();
- private:
- void substituteInComponent(ISubtree * _pComponent);
- void substituteInNode(ISubtree & _rNode);
- void substituteInList();
-
- void substitute(rtl::OUString const & _aName);
-
- virtual void handle(ValueNode&);
- virtual void handle(ISubtree&);
- };
-}
-// -----------------------------------------------------------------------------
-
-void SchemaBuilder::substituteInstances()
-{
- SubstitutionHelper helper(m_aContext, m_aData, static_cast<backenduno::XSchemaHandler*>(this));
-
- helper.substituteInData();
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-namespace
-{
-// -----------------------------------------------------------------------------
- void SubstitutionHelper::substituteInData()
- {
- if (m_rData.hasTemplates())
- substituteInComponent(m_rData.getTemplatesTree());
-
- if (m_rData.hasSchema())
- substituteInComponent(m_rData.getSchemaTree());
- }
- // -----------------------------------------------------------------------------
-
- void SubstitutionHelper::substituteInComponent(ISubtree * _pComponent)
- {
- OSL_ENSURE(_pComponent,"ERROR: Trying to substitute in NULL component");
-
- if (_pComponent)
- {
- m_aContext.startActiveComponent(_pComponent->getName());
- this->substituteInNode(*_pComponent);
- m_aContext.endActiveComponent();
- }
- }
- // -----------------------------------------------------------------------------
-
- void SubstitutionHelper::substituteInNode(ISubtree & _rNode)
- {
- std::vector< rtl::OUString > aSaveInstances;
- aSaveInstances.swap(m_aReplacementList);
-
- // todo: own stack to check against infinite recursion
- m_aContext.pushNode(&_rNode);
-
- this->applyToChildren(_rNode); // fill the list
-
- this->substituteInList();
-
- m_aContext.popNode();
-
- aSaveInstances.swap(m_aReplacementList);
- }
- // -----------------------------------------------------------------------------
-
- void SubstitutionHelper::substituteInList()
- {
- for(std::vector< rtl::OUString >::iterator it = m_aReplacementList.begin();
- it != m_aReplacementList.end(); ++it)
- {
- this->substitute(*it);
- }
- }
- // -----------------------------------------------------------------------------
-
- void SubstitutionHelper::substitute(rtl::OUString const & _aName)
- {
-
- ISubtree & rParent = m_aContext.getCurrentParent();
-
- std::auto_ptr<INode> pReplacedNode = rParent.removeChild(_aName);
- OSL_ASSERT( pReplacedNode.get() != NULL );
-
- ISubtree * pReplacedInstance = pReplacedNode->asISubtree();
- OSL_ASSERT( pReplacedInstance != NULL );
-
- backenduno::TemplateIdentifier aTemplateName = m_aFactory.getInstanceType(*pReplacedInstance);
- if (aTemplateName.Component == m_aContext.getActiveComponent())
- {
- if (ISubtree const * pTemplate = m_rData.findTemplate(aTemplateName.Name))
- {
- std::vector< ISubtree const * >::iterator beg = m_aTemplateStack.begin(), end = m_aTemplateStack.end();
- if (std::find(beg,end,pTemplate) != end)
- m_aContext.raiseMalformedDataException("SchemaBuilder: Could not expand instances: Template is recursive");
-
- m_aTemplateStack.push_back(pTemplate);
-
- std::auto_ptr< INode > pTemplateInstance = pTemplate->clone();
-
- pTemplateInstance->setName(_aName);
- // TODO: adjust state/attributes here (?)
-
- ISubtree * pAddedTree = rParent.addChild(pTemplateInstance)->asISubtree();
-
- OSL_ENSURE(pAddedTree, "Could not obtain added template instance");
-
- this->substituteInNode(*pAddedTree);
-
- m_aTemplateStack.pop_back();
- }
- else
- {
- m_aContext.raiseMalformedDataException("SchemaBuilder: Could not expand instances: Template not found");
- }
- }
- //Import Template from different component
- else
- {
- TemplateRequest aTemplateRequest(aTemplateName.Name,
- aTemplateName.Component );
- ResultHolder< TemplateInstance > aResult = m_aContext.getTemplateData( aTemplateRequest );
-
- std::auto_ptr<INode> pTemplateInstance = aResult.extractDataAndClear();
- pTemplateInstance->setName(_aName);
-
- // Add template instance - must be a tree as any template
- OSL_VERIFY(
- rParent.addChild(pTemplateInstance)->asISubtree() );
- }
- }
- // -----------------------------------------------------------------------------
-
- void SubstitutionHelper::handle(ValueNode&)
- {
- }
- // -----------------------------------------------------------------------------
-
- void SubstitutionHelper::handle(ISubtree& _rTree)
- {
- if (m_aFactory.isInstancePlaceHolder(_rTree))
- m_aReplacementList.push_back(_rTree.getName());
-
- else
- substituteInNode(_rTree);
- }
-// -----------------------------------------------------------------------------
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace backend
-
-// -------------------------------------------------------------------------
-} // namespace configmgr
diff --git a/configmgr/source/backend/schemabuilder.hxx b/configmgr/source/backend/schemabuilder.hxx
deleted file mode 100644
index 72c4d4add1..0000000000
--- a/configmgr/source/backend/schemabuilder.hxx
+++ /dev/null
@@ -1,151 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_SCHEMABUILDER_HXX
-#define CONFIGMGR_BACKEND_SCHEMABUILDER_HXX
-
-#include "mergedcomponentdata.hxx"
-#include "componentdatahelper.hxx"
-#include "mergeddataprovider.hxx"
-#include <com/sun/star/configuration/backend/XSchemaHandler.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <cppuhelper/implbase1.hxx>
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- class OTreeNodeFactory;
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
-
- namespace backenduno = ::com::sun::star::configuration::backend;
-// -----------------------------------------------------------------------------
-
- class SchemaBuilder
- : public cppu::WeakImplHelper1<backenduno::XSchemaHandler>
- {
- public:
- SchemaBuilder(uno::Reference< uno::XComponentContext > const & xContext, const rtl::OUString& aExpectedComponentName, MergedComponentData & rData, ITemplateDataProvider* aTemplateProvider = NULL );
- virtual ~SchemaBuilder();
-
- // checking the result
- bool isDone() const { return m_aContext.isDone(); }
-
- MergedComponentData & result();
- MergedComponentData const & result() const;
-
- // XSchemaHandler
- public:
- virtual void SAL_CALL
- startSchema( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endSchema( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- importComponent( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- startComponent( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endComponent( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- startGroupTemplate( const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- startSetTemplate( const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes, const backenduno::TemplateIdentifier& aItemType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endTemplate( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- startGroup( const rtl::OUString& aName, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- startSet( const rtl::OUString& aName, sal_Int16 aAttributes, const backenduno::TemplateIdentifier& aItemType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endNode( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addPropertyWithDefault( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aDefaultValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addInstance( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- virtual void SAL_CALL
- addItemType( const backenduno::TemplateIdentifier& aItemType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- private:
- static node::Attributes getComponentRootAttributes();
- static node::Attributes getTemplateBaseAttributes();
- node::Attributes getNodeAttributes() const;
- node::Attributes makePropertyAttributes(sal_Int16 aSchemaAttributes) const;
-
- bool isExtensible(sal_Int16 aSchemaAttributes);
-
- void substituteInstances();
- private:
- MergedComponentData & m_aData;
- DataBuilderContext m_aContext;
- ComponentDataFactory m_aFactory;
- };
-// -----------------------------------------------------------------------------
-
- } // namespace backend
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/backend/singlebackendadapter.cxx b/configmgr/source/backend/singlebackendadapter.cxx
deleted file mode 100644
index 4c06190a03..0000000000
--- a/configmgr/source/backend/singlebackendadapter.cxx
+++ /dev/null
@@ -1,336 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include "singlebackendadapter.hxx"
-
-#ifndef CONFIGMGR_API_FACTORY_HXX_
-#include "confapifactory.hxx"
-#endif // CONFIGMGR_API_FACTORY_HXX_
-#include "serviceinfohelper.hxx"
-#include <com/sun/star/configuration/backend/XMultiLayerStratum.hpp>
-#include <com/sun/star/configuration/CannotLoadConfigurationException.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
-namespace configmgr { namespace backend {
-
-//==============================================================================
-
-SingleBackendAdapter::SingleBackendAdapter(
- const uno::Reference<uno::XComponentContext>& xContext)
- : cppu::WeakComponentImplHelper5< backenduno::XBackend, backenduno::XBackendEntities, backenduno::XSchemaSupplier, lang::XInitialization, lang::XServiceInfo >(mMutex), mFactory(xContext->getServiceManager(),uno::UNO_QUERY) {
-}
-//------------------------------------------------------------------------------
-
-SingleBackendAdapter::~SingleBackendAdapter(void) {}
-//------------------------------------------------------------------------------
-
-void SAL_CALL SingleBackendAdapter::initialize(
- const uno::Sequence<uno::Any>& aParameters)
- throw (uno::RuntimeException, uno::Exception) {
-
- uno::Any const * const pParams = aParameters.getConstArray();
- sal_Int32 nCount = aParameters.getLength();
-
- for (sal_Int32 ix = 0; ix < nCount; ++ix)
- {
- if (pParams[ix] >>= mBackend) break;
- }
-
- if (!mBackend.is())
- {
- throw com::sun::star::configuration::CannotLoadConfigurationException(
- rtl::OUString::createFromAscii("Online SingleBackend Adapter: Cannot operate without real (Single)Backend"),
- *this);
- }
-}
-//------------------------------------------------------------------------------
-static inline rtl::OUString getSingleLayerDummyEntity()
-{ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*")); }
-//------------------------------------------------------------------------------
-bool SingleBackendAdapter::checkOkState()
-{
- if (!mBackend.is())
- {
- if(rBHelper.bDisposed)
- {
- throw lang::DisposedException(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "SingleBackendAdapter: Backend already disposed")),*this);
- }
- else
- {
- throw backenduno::BackendAccessException(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "SingleBackendAdapter: Object was never Initialised")),*this,uno::Any() );
- }
- }
- return true;
-}
-
-//------------------------------------------------------------------------------
-
-// XBackendEntities
-rtl::OUString SAL_CALL
- SingleBackendAdapter::getOwnerEntity( )
- throw (uno::RuntimeException)
-{
- if (mBackend.is())
- {
- uno::Reference< backenduno::XBackendEntities > xEntities( mBackend, uno::UNO_REF_QUERY_THROW );
-
- return xEntities->getOwnerEntity();
- }
- else
- {
- throw uno::RuntimeException(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "SingleBackendAdapter: Object was never Initialised")),*this);
- }
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL
- SingleBackendAdapter::getAdminEntity( )
- throw (uno::RuntimeException)
-{
- if (mBackend.is())
- {
- uno::Reference< backenduno::XBackendEntities > xEntities( mBackend, uno::UNO_REF_QUERY_THROW );
- return xEntities->getAdminEntity();
- }
- else
- {
- throw uno::RuntimeException(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "SingleBackendAdapter: Object was never Initialised")),*this);
- }
-}
-//------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL
- SingleBackendAdapter::supportsEntity( const rtl::OUString& aEntity )
- throw (backenduno::BackendAccessException, uno::RuntimeException)
-{
- if (checkOkState())
- {
- uno::Reference< backenduno::XBackendEntities > xEntities( mBackend, uno::UNO_REF_QUERY_THROW );
- return xEntities->supportsEntity(aEntity);
- }
- return false;
-}
-//------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL
- SingleBackendAdapter::isEqualEntity( const rtl::OUString& aEntity, const rtl::OUString& aOtherEntity )
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- if (checkOkState())
- {
- uno::Reference< backenduno::XBackendEntities > xEntities( mBackend, uno::UNO_REF_QUERY_THROW );
- return xEntities->isEqualEntity(aEntity,aOtherEntity);
- }
- return false;
-}
-//------------------------------------------------------------------------------
-
-uno::Reference<backenduno::XSchema> SAL_CALL
- SingleBackendAdapter::getComponentSchema(const rtl::OUString& aComponent)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- if (checkOkState())
- {
- return mBackend->getComponentSchema(aComponent) ;
- }
- return false;
-}
-//------------------------------------------------------------------------------
-
-uno::Sequence<uno::Reference<backenduno::XLayer> > SAL_CALL
- SingleBackendAdapter::listOwnLayers(const rtl::OUString& aComponent)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- if (checkOkState())
- {
- return listLayers(aComponent, this->getOwnerEntity()) ;
- }
- return false;
-}
-//------------------------------------------------------------------------------
-
-uno::Reference<backenduno::XUpdateHandler> SAL_CALL
- SingleBackendAdapter::getOwnUpdateHandler(const rtl::OUString& aComponent)
- throw (backenduno::BackendAccessException,
- lang::NoSupportException,
- lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- if (checkOkState())
- {
- return getUpdateHandler(aComponent, this->getOwnerEntity()) ;
- }
- return false;
-}
-//------------------------------------------------------------------------------
-
-uno::Sequence<uno::Reference<backenduno::XLayer> > SAL_CALL
- SingleBackendAdapter::listLayers(const rtl::OUString& aComponent,
- const rtl::OUString& aEntity)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- if (checkOkState())
- {
- uno::Reference< backenduno::XMultiLayerStratum > xBackend( mBackend, uno::UNO_REF_QUERY_THROW );
-
- uno::Sequence<uno::Reference<backenduno::XLayer> > retCode =
- xBackend->getLayers(xBackend->listLayerIds(aComponent, aEntity),
- rtl::OUString()) ;
-
- // There might be non-existent layers in the list if there's no
- // actual data associated to a given layer id. Hence we have to
- // compress the list.
- sal_Int32 maxLayer = 0 ;
-
- for (sal_Int32 i = 0 ; i < retCode.getLength() ; ++ i)
- {
- if (retCode [i].is())
- {
- if (i != maxLayer) { retCode [maxLayer] = retCode [i] ; }
- ++ maxLayer ;
- }
- }
- retCode.realloc(maxLayer) ;
- return retCode ;
- }
- return false;
-}
-//------------------------------------------------------------------------------
-
-uno::Reference<backenduno::XUpdateHandler> SAL_CALL
- SingleBackendAdapter::getUpdateHandler(const rtl::OUString& aComponent,
- const rtl::OUString& aEntity)
- throw (backenduno::BackendAccessException,
- lang::NoSupportException,
- lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- if (checkOkState())
- {
- uno::Reference< backenduno::XMultiLayerStratum > xBackend( mBackend, uno::UNO_REF_QUERY_THROW );
-
- uno::Sequence<uno::Any> arguments(1) ;
-
- arguments [0] <<= xBackend->getUpdatableLayer(
- xBackend->getUpdateLayerId(aComponent,
- aEntity)) ;
- uno::Reference< uno::XInterface > xHandler;
- try
- {
- const rtl::OUString kUpdateMerger(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.backend.LayerUpdateMerger")) ;
-
- xHandler = mFactory->createInstanceWithArguments(kUpdateMerger, arguments);
- }
- catch (uno::RuntimeException & )
- {throw;}
- catch (uno::Exception & e)
- {
- const rtl::OUString sMessage(RTL_CONSTASCII_USTRINGPARAM(
- "Configuration SingleBackendAdapter: Cannot create UpdateMerger - error message: ")) ;
- throw uno::RuntimeException(sMessage.concat(e.Message),*this);
- }
-
- return uno::Reference<backenduno::XUpdateHandler>(xHandler, uno::UNO_REF_QUERY_THROW) ;
- }
- return false;
-}
-//------------------------------------------------------------------------------
-
-static const sal_Char * const kBackendService = "com.sun.star.configuration.backend.Backend" ;
-static const sal_Char * const kAdapterService = "com.sun.star.configuration.backend.BackendAdapter" ;
-static const sal_Char * const kOnlineService = "com.sun.star.configuration.backend.OnlineBackend" ;
-
-static const sal_Char * const kImplementation =
- "com.sun.star.comp.configuration.backend.SingleBackendAdapter" ;
-
-static sal_Char const * const kServiceNames [] =
-{
- kOnlineService,
- kAdapterService,
- 0,
- kBackendService,
- 0
-} ;
-static const ServiceImplementationInfo kServiceInfo =
-{
- kImplementation,
- kServiceNames,
- kServiceNames + 3
-} ;
-
-const ServiceRegistrationInfo *getSingleBackendAdapterServiceInfo()
-{
- return getRegistrationInfo(&kServiceInfo) ;
-}
-
-uno::Reference<uno::XInterface> SAL_CALL
- instantiateSingleBackendAdapter(const uno::Reference< uno::XComponentContext >& xContext)
-{
- return *new SingleBackendAdapter(xContext) ;
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL
- SingleBackendAdapter::getImplementationName(void)
- throw (uno::RuntimeException)
-{
- return ServiceInfoHelper(&kServiceInfo).getImplementationName() ;
-}
-//------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL
- SingleBackendAdapter::supportsService(const rtl::OUString& aServiceName)
- throw (uno::RuntimeException)
-{
- return ServiceInfoHelper(&kServiceInfo).supportsService(aServiceName) ;
-}
-//------------------------------------------------------------------------------
-
-uno::Sequence<rtl::OUString> SAL_CALL
- SingleBackendAdapter::getSupportedServiceNames(void)
- throw (uno::RuntimeException)
-{
- return ServiceInfoHelper(&kServiceInfo).getSupportedServiceNames() ;
-}
-//------------------------------------------------------------------------------
-
-} } // configmgr.backend
-
diff --git a/configmgr/source/backend/singlebackendadapter.hxx b/configmgr/source/backend/singlebackendadapter.hxx
deleted file mode 100644
index f28845e010..0000000000
--- a/configmgr/source/backend/singlebackendadapter.hxx
+++ /dev/null
@@ -1,142 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_SINGLEBACKENDADAPTER_HXX_
-#define CONFIGMGR_BACKEND_SINGLEBACKENDADAPTER_HXX_
-
-#include <com/sun/star/configuration/backend/XBackend.hpp>
-#include <com/sun/star/configuration/backend/XBackendEntities.hpp>
-#include <com/sun/star/configuration/backend/XSchemaSupplier.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <cppuhelper/compbase5.hxx>
-
-namespace configmgr { namespace backend {
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backenduno = css::configuration::backend ;
-
-/**
- Class implementing the Backend service for remote access.
- It just transfers calls to a SingleBackend implementation.
- */
-class SingleBackendAdapter : public cppu::WeakComponentImplHelper5< backenduno::XBackend, backenduno::XBackendEntities, backenduno::XSchemaSupplier, lang::XInitialization, lang::XServiceInfo > {
- public :
- /**
- Service constructor from a service factory.
-
- @param aFactory service factory
- */
- SingleBackendAdapter(
- const uno::Reference<uno::XComponentContext>& xContext) ;
- /** Destructor */
- ~SingleBackendAdapter(void) ;
-
- // XInitialize
- virtual void SAL_CALL initialize(
- const uno::Sequence<uno::Any>& aParameters)
- throw (uno::RuntimeException, uno::Exception) ;
-
- // XSchemaSupplier
- virtual uno::Reference<backenduno::XSchema>
- SAL_CALL getComponentSchema(const rtl::OUString& aComponent)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
-
- // XBackend
- virtual uno::Sequence<uno::Reference<backenduno::XLayer> >
- SAL_CALL listOwnLayers(const rtl::OUString& aComponent)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
-
- virtual uno::Reference<backenduno::XUpdateHandler>
- SAL_CALL getOwnUpdateHandler(const rtl::OUString& aComponent)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- lang::NoSupportException,
- uno::RuntimeException) ;
- virtual uno::Sequence<uno::Reference<backenduno::XLayer> > SAL_CALL
- listLayers(const rtl::OUString& aComponent,
- const rtl::OUString& aEntity)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
- virtual uno::Reference<backenduno::XUpdateHandler> SAL_CALL
- getUpdateHandler(const rtl::OUString& aComponent,
- const rtl::OUString& aEntity)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- lang::NoSupportException,
- uno::RuntimeException) ;
-
- // XBackendEntities
- virtual rtl::OUString SAL_CALL
- getOwnerEntity( )
- throw (uno::RuntimeException);
-
- virtual rtl::OUString SAL_CALL
- getAdminEntity( )
- throw (uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- supportsEntity( const rtl::OUString& aEntity )
- throw (backenduno::BackendAccessException, uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- isEqualEntity( const rtl::OUString& aEntity, const rtl::OUString& aOtherEntity )
- throw ( backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException);
-
- // XServiceInfo
- virtual rtl::OUString SAL_CALL getImplementationName(void)
- throw (uno::RuntimeException) ;
- virtual sal_Bool SAL_CALL supportsService(
- const rtl::OUString& aServiceName)
- throw (uno::RuntimeException) ;
- virtual uno::Sequence<rtl::OUString> SAL_CALL
- getSupportedServiceNames(void) throw (uno::RuntimeException) ;
- protected :
- private :
- /** Service factory */
- uno::Reference<lang::XMultiServiceFactory> mFactory ;
- /** Mutex for resource protection */
- osl::Mutex mMutex ;
- /** Remote backend that the offline cache is handling */
- uno::Reference<backenduno::XSchemaSupplier> mBackend ;
- /* checks if object is in initialized and undisposed state */
- bool checkOkState();
-} ;
-
-} } // configmgr.backend
-
-#endif // CONFIGMGR_BACKEND_SINGLEBACKENDADAPTER_HXX_
diff --git a/configmgr/source/backend/updatedata.cxx b/configmgr/source/backend/updatedata.cxx
deleted file mode 100644
index bff03ef822..0000000000
--- a/configmgr/source/backend/updatedata.cxx
+++ /dev/null
@@ -1,455 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "updatedata.hxx"
-
-#include <com/sun/star/configuration/backend/NodeAttribute.hpp>
-#include <com/sun/star/configuration/backend/XLayerHandler.hpp>
-
-#include <iterator>
-#include <algorithm>
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
-
-ElementUpdate::ElementUpdate(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask)
-: NamedUpdate(_aName)
-, m_pParent(_pParent)
-, m_nFlags(_nFlags)
-, m_nFlagsMask(_nFlagsMask)
-{
-}
-// -----------------------------------------------------------------------------
-
-sal_Int16 ElementUpdate::updateFlags(sal_Int16 _nFlags) const
-{
- return (_nFlags & ~m_nFlagsMask) | (m_nFlags & m_nFlagsMask);
-}
-// -----------------------------------------------------------------------------
-
-NodeUpdate * ElementUpdate::asNodeUpdate(bool )
-{
- return NULL;
-}
-// -----------------------------------------------------------------------------
-
-PropertyUpdate * ElementUpdate::asPropertyUpdate()
-{
- return NULL;
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-NodeUpdate::NodeUpdate(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, Op _op)
-: ElementUpdate(_pParent,_aName,_nFlags, _nFlagsMask)
-, m_aNodes()
-, m_aProperties()
-, m_aRemovedElements()
-, m_op(_op)
-{
-}
-// -----------------------------------------------------------------------------
-
-NodeUpdate * NodeUpdate::asNodeUpdate(bool _bMerged)
-{
- return (!_bMerged || m_op == modify
- || (updateFlags() & backenduno::NodeAttribute::FUSE) != 0)
- ? this : NULL;
-}
-// -----------------------------------------------------------------------------
-
-bool NodeUpdate::addNodeUpdate(rtl::Reference<ElementUpdate> const & _aNode)
-{
- OSL_PRECOND( _aNode.is(), "ERROR: NodeUpdate: Trying to add NULL node.");
- OSL_PRECOND( _aNode->getParent() == this, "ERROR: NodeUpdate: Node being added has wrong parent.");
- OSL_ENSURE(m_aNodes.find(_aNode->getName()) == m_aNodes.end(),
- "NodeUpdate: Child node being added already exists in this node.");
-
- return m_aNodes.insert( ElementList::value_type(_aNode->getName(),_aNode) ).second;
-}
-// -----------------------------------------------------------------------------
-
-bool NodeUpdate::addPropertyUpdate(rtl::Reference<ElementUpdate> const & _aProp)
-{
- OSL_PRECOND( _aProp.is(), "ERROR: NodeUpdate: Trying to add NULL property.");
- OSL_PRECOND( _aProp->getParent() == this, "ERROR: NodeUpdate: Property being added has wrong parent.");
- OSL_ENSURE(m_aProperties.find(_aProp->getName()) == m_aProperties.end(),
- "NodeUpdate: Property being added already exists in this node.");
-
- return m_aProperties.insert( ElementList::value_type(_aProp->getName(),_aProp) ).second;
-}
-// -----------------------------------------------------------------------------
-
-void NodeUpdate::removeNodeByName(rtl::OUString const & _aName)
-{
- ElementList::iterator it = m_aNodes.find(_aName);
- OSL_ENSURE(it != m_aNodes.end(),
- "NodeUpdate: Child node being removed is not in this node.");
-
- if (it != m_aNodes.end())
- {
- m_aRemovedElements.insert(*it);
- m_aNodes.erase(it);
- }
-}
-// -----------------------------------------------------------------------------
-
-void NodeUpdate::removePropertyByName (rtl::OUString const & _aName)
-{
- ElementList::iterator it = m_aProperties.find(_aName);
- OSL_ENSURE(it != m_aProperties.end(),
- "NodeUpdate: Property being removed is not in this node.");
-
- if (it != m_aProperties.end())
- {
- m_aRemovedElements.insert(*it);
- m_aProperties.erase(it);
- }
-}
-// -----------------------------------------------------------------------------
-
-rtl::Reference<ElementUpdate> NodeUpdate::getNodeByName(rtl::OUString const & _aName) const
-{
- ElementList::const_iterator it = m_aNodes.find(_aName);
-
- return it != m_aNodes.end() ? it->second : rtl::Reference<ElementUpdate>();
-}
-// -----------------------------------------------------------------------------
-
-rtl::Reference<ElementUpdate> NodeUpdate::getPropertyByName (rtl::OUString const & _aName) const
-{
- ElementList::const_iterator it = m_aProperties.find(_aName);
-
- return it != m_aProperties.end() ? it->second : rtl::Reference<ElementUpdate>();
-}
-// -----------------------------------------------------------------------------
-
-void NodeUpdate::writeChildrenToLayer(backenduno::XLayerHandler * _pLayer)
-{
- OSL_ASSERT(_pLayer);
- for (ElementList::const_iterator itP = beginProperties(); itP != endProperties(); ++itP)
- itP->second->writeToLayer(_pLayer);
-
- for (ElementList::const_iterator itN = beginNodes(); itN != endNodes(); ++itN)
- itN->second->writeToLayer(_pLayer);
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-NodeModification::NodeModification(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, sal_Bool _bReset)
-: NodeUpdate(_pParent,_aName,_nFlags, _nFlagsMask, _bReset ? reset : modify)
-{
-}
-// -----------------------------------------------------------------------------
-
-void NodeModification::writeToLayer(backenduno::XLayerHandler * _pLayer)
-{
- OSL_ASSERT(_pLayer);
-
- if ( this->getOperation() == reset && // if we have an empty
- !this->changedFlags() && // 'reset' node, that means
- !this->hasChildren() ) // we need to write
- return; // nothing
-
- _pLayer->overrideNode( this->getName(), this->updateFlags(), false );
- this->writeChildrenToLayer(_pLayer);
- _pLayer->endNode();
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-NodeReplace::NodeReplace(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags)
-: NodeUpdate(_pParent,_aName,_nFlags, _nFlags, replace)
-, m_aTemplateName()
-, m_aTemplateComponent()
-{
-}
-// -----------------------------------------------------------------------------
-
-NodeReplace::NodeReplace(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, rtl::OUString const & _aTemplateName, rtl::OUString const & _aTemplateComponent)
-: NodeUpdate(_pParent,_aName,_nFlags, _nFlags, replace)
-, m_aTemplateName(_aTemplateName)
-, m_aTemplateComponent(_aTemplateComponent)
-{
-}
-// -----------------------------------------------------------------------------
-
-bool NodeReplace::hasTemplate() const
-{
- return m_aTemplateName.getLength() != 0;
-}
-// -----------------------------------------------------------------------------
-
-void NodeReplace::writeToLayer(backenduno::XLayerHandler * _pLayer)
-{
- OSL_ASSERT(_pLayer);
-
- if (this->hasTemplate())
- {
- backenduno::TemplateIdentifier aTemplate( m_aTemplateName, m_aTemplateComponent );
- _pLayer->addOrReplaceNodeFromTemplate( this->getName(), aTemplate, this->updateFlags() );
- }
- else
- _pLayer->addOrReplaceNode( this->getName(), this->updateFlags() );
-
- this->writeChildrenToLayer(_pLayer);
- _pLayer->endNode();
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-NodeDrop::NodeDrop(NodeUpdate * _pParent, rtl::OUString const & _aName)
-: ElementUpdate(_pParent,_aName,0,0)
-{
-}
-// -----------------------------------------------------------------------------
-
-void NodeDrop::writeToLayer(backenduno::XLayerHandler * _pLayer)
-{
- OSL_ASSERT(_pLayer);
- _pLayer->dropNode(this->getName());
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-PropertyUpdate::PropertyUpdate(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, uno::Type const & _aType)
-: ElementUpdate(_pParent,_aName,_nFlags,_nFlagsMask)
-, m_aValues()
-, m_aType(_aType)
-{}
-// -----------------------------------------------------------------------------
-
-PropertyUpdate * PropertyUpdate::asPropertyUpdate()
-{
- return this;
-}
-// -----------------------------------------------------------------------------
-
-static uno::Any makeResetMarker()
-{
- uno::Reference< backenduno::XLayerHandler > xNull;
- return uno::makeAny(xNull);
-}
-// -----------------------------------------------------------------------------
-
-inline bool PropertyUpdate::isResetMarker(uno::Any const & _aValue)
-{
- OSL_ENSURE( _aValue.getValueTypeClass() != uno::TypeClass_INTERFACE ||
- _aValue == makeResetMarker() && _aValue.getValueType() == makeResetMarker().getValueType(),
- "Unexpected any: Interface reference will be taken as reset marker");
-
- return _aValue.getValueTypeClass() == uno::TypeClass_INTERFACE;
-}
-// -----------------------------------------------------------------------------
-
-uno::Any const & PropertyUpdate::getResetMarker()
-{
- static uno::Any const aMarker = makeResetMarker();
-
- OSL_ASSERT( isResetMarker(aMarker) );
-
- return aMarker;
-}
-// -----------------------------------------------------------------------------
-
-bool PropertyUpdate::setValueFor(rtl::OUString const & _aLocale, uno::Any const & _aValueUpdate)
-{
- OSL_PRECOND( !isResetMarker(_aValueUpdate), "PropertyUpdate: ERROR: Trying to set a reset marker as regular value" );
-
- OSL_ENSURE(m_aValues.find(_aLocale) == m_aValues.end(),
- "PropertyUpdate: Locale being added already has a value in this property.");
-
- if (_aValueUpdate.hasValue())
- {
- if (m_aType.getTypeClass() == uno::TypeClass_ANY)
- m_aType = _aValueUpdate.getValueType();
-
- else
- OSL_ENSURE( m_aType == _aValueUpdate.getValueType() ||
- m_aType == uno::Type(),
- "ValueType mismatch in PropertyUpdate");
- }
- return m_aValues.insert( ValueList::value_type(_aLocale,_aValueUpdate) ).second;
-}
-// -----------------------------------------------------------------------------
-
-bool PropertyUpdate::resetValueFor(rtl::OUString const & _aLocale)
-{
- OSL_ENSURE(m_aValues.find(_aLocale) == m_aValues.end(),
- "PropertyUpdate: Locale being reset already has a value in this property.");
-
- return m_aValues.insert( ValueList::value_type(_aLocale,getResetMarker()) ).second;
-}
-// -----------------------------------------------------------------------------
-
-void PropertyUpdate::removeValueFor(rtl::OUString const & _aLocale)
-{
- OSL_ENSURE(m_aValues.find(_aLocale) != m_aValues.end(),
- "PropertyUpdate: Locale being removed is not in this node.");
-
- m_aValues.erase(_aLocale);
-}
-// -----------------------------------------------------------------------------
-
-void PropertyUpdate::finishValue()
-{
- if (m_aType.getTypeClass() == uno::TypeClass_ANY)
- m_aType = uno::Type();
-}
-// -----------------------------------------------------------------------------
-
-bool PropertyUpdate::hasValueFor(rtl::OUString const & _aLocale) const
-{
- ValueList::const_iterator it = m_aValues.find(_aLocale);
-
- return it != m_aValues.end() && ! isResetMarker(it->second);
-}
-// -----------------------------------------------------------------------------
-
-bool PropertyUpdate::hasResetFor(rtl::OUString const & _aLocale) const
-{
- ValueList::const_iterator it = m_aValues.find(_aLocale);
-
- return it != m_aValues.end() && isResetMarker(it->second);
-}
-// -----------------------------------------------------------------------------
-
-bool PropertyUpdate::hasChangeFor(rtl::OUString const & _aLocale) const
-{
- ValueList::const_iterator it = m_aValues.find(_aLocale);
-
- return it != m_aValues.end();
-}
-// -----------------------------------------------------------------------------
-
-uno::Any PropertyUpdate::getValueFor(rtl::OUString const & _aLocale) const
-{
- ValueList::const_iterator it = m_aValues.find(_aLocale);
-
- OSL_ENSURE(it != m_aValues.end() && !isResetMarker(it->second),
- "PropertyUpdate: Should not call getValue() unless hasValue() returns true" );
-
- return it != m_aValues.end() && !isResetMarker(it->second) ? it->second : uno::Any();
-}
-// -----------------------------------------------------------------------------
-
-void PropertyUpdate::writeValueToLayer(backenduno::XLayerHandler * _pLayer, uno::Any const & _aValue)
-{
- OSL_ASSERT(_pLayer);
- if ( !isResetMarker(_aValue) )
- _pLayer->setPropertyValue(_aValue);
-
- // else - to reset - do nothing
-}
-// -----------------------------------------------------------------------------
-
-void PropertyUpdate::writeValueToLayerFor(backenduno::XLayerHandler * _pLayer, uno::Any const & _aValue, rtl::OUString const & _aLocale)
-{
- OSL_ASSERT(_pLayer);
- if (_aLocale == this->primarySlot())
- this->writeValueToLayer(_pLayer,_aValue);
-
- else if ( !isResetMarker(_aValue) )
- _pLayer->setPropertyValueForLocale(_aValue,_aLocale);
-
- // else - to reset - do nothing
-}
-// -----------------------------------------------------------------------------
-
-void PropertyUpdate::writeValuesToLayer(backenduno::XLayerHandler * _pLayer)
-{
- OSL_ASSERT(_pLayer);
- for (ValueList::const_iterator itV = beginValues(); itV != endValues(); ++itV)
- this->writeValueToLayerFor(_pLayer, itV->second, itV->first);
-}
-// -----------------------------------------------------------------------------
-
-void PropertyUpdate::writeToLayer(backenduno::XLayerHandler * _pLayer)
-{
- OSL_ASSERT(_pLayer);
-
- _pLayer->overrideProperty( this->getName(), this->updateFlags(), this->m_aType, false );
- this->writeValuesToLayer(_pLayer);
- _pLayer->endProperty();
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-
-PropertyAdd::PropertyAdd(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, uno::Type const & _aType)
-: ElementUpdate(_pParent,_aName,_nFlags,_nFlags)
-, m_aValueType(_aType)
-, m_aValue()
-{
-
-}
-// -----------------------------------------------------------------------------
-
-PropertyAdd::PropertyAdd(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, uno::Any const & _aValue)
-: ElementUpdate(_pParent,_aName,_nFlags,_nFlags)
-, m_aValueType(_aValue.getValueType())
-, m_aValue(_aValue)
-{
-}
-// -----------------------------------------------------------------------------
-
-void PropertyAdd::writeToLayer(backenduno::XLayerHandler * _pLayer)
-{
- OSL_ASSERT(_pLayer);
- if (this->hasValue())
- _pLayer->addPropertyWithValue(this->getName(),this->updateFlags(),this->getValue());
- else
- _pLayer->addProperty(this->getName(),this->updateFlags(),this->getValueType());
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-PropertyReset::PropertyReset(NodeUpdate * _pParent, rtl::OUString const & _aName)
-: ElementUpdate(_pParent,_aName,0,0)
-{
-}
-// -----------------------------------------------------------------------------
-
-void PropertyReset::writeToLayer(backenduno::XLayerHandler * _pLayer)
-{
- (void) _pLayer; // avoid warning about unused parameter
- OSL_ASSERT(_pLayer);
- // skip - nothing to write
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace backend
-
-// -------------------------------------------------------------------------
-} // namespace configmgr
diff --git a/configmgr/source/backend/updatedata.hxx b/configmgr/source/backend/updatedata.hxx
deleted file mode 100644
index d24f88f72e..0000000000
--- a/configmgr/source/backend/updatedata.hxx
+++ /dev/null
@@ -1,266 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_UPDATEDATA_HXX
-#define CONFIGMGR_BACKEND_UPDATEDATA_HXX
-
-#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/uno/Type.hxx>
-#include <rtl/ref.hxx>
-#include <rtl/ustring.hxx>
-#include <salhelper/simplereferenceobject.hxx>
-#include "utility.hxx"
-
-#ifndef INCLUDED_SET
-#include <set>
-#define INCLUDED_SET
-#endif
-#ifndef INCLUDED_MAP
-#include <map>
-#define INCLUDED_MAP
-#endif
-
-namespace com { namespace sun { namespace star { namespace configuration { namespace backend {
- class XLayerHandler;
-} } } } }
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace backenduno = ::com::sun::star::configuration::backend;
-// -----------------------------------------------------------------------------
- class ElementUpdate;
- class NodeUpdate;
- class NodeModification;
- class NodeReplace;
- class NodeDrop;
- class PropertyUpdate;
- class PropertyAdd;
- class PropertyReset;
-
-// -----------------------------------------------------------------------------
-
- class NamedUpdate : public salhelper::SimpleReferenceObject
- {
- rtl::OUString const m_aName;
-
- protected:
- explicit
- NamedUpdate(rtl::OUString const & _aName)
- : m_aName(_aName)
- {}
-
- ~NamedUpdate() {};
-
- public:
- rtl::OUString const & getName() const { return m_aName; }
- };
-// -----------------------------------------------------------------------------
- class ElementUpdate : public NamedUpdate
- {
- NodeUpdate * m_pParent;
- sal_Int16 m_nFlags;
- sal_Int16 m_nFlagsMask;
- protected:
- ElementUpdate(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask);
-
- public:
- virtual NodeUpdate * asNodeUpdate(bool _bMerged = false);
- virtual PropertyUpdate * asPropertyUpdate();
-
- virtual void writeToLayer(backenduno::XLayerHandler * _pLayer) = 0;
-
- public:
- NodeUpdate * getParent() const { return m_pParent; }
-
- sal_Int16 changedFlags() const { return m_nFlagsMask; }
- sal_Int16 updateFlags(sal_Int16 _nFlags = 0) const;
-
- };
-// -----------------------------------------------------------------------------
-
- class NodeUpdate : public ElementUpdate
- {
- typedef std::map< rtl::OUString, rtl::Reference<ElementUpdate> > ElementList;
- public:
- enum Op { modify, reset, replace };
-
- protected:
- NodeUpdate(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, Op _op);
-
- virtual NodeUpdate * asNodeUpdate(bool _bMerged);
-
- public:
- bool addNodeUpdate (rtl::Reference<ElementUpdate> const & _aNode);
- bool addPropertyUpdate (rtl::Reference<ElementUpdate> const & _aProp);
- void removeNodeByName (rtl::OUString const & _aName);
- void removePropertyByName (rtl::OUString const & _aName);
-
- Op getOperation() const { return m_op; }
-
- rtl::Reference<ElementUpdate> getNodeByName (rtl::OUString const & _aName) const;
- rtl::Reference<ElementUpdate> getPropertyByName (rtl::OUString const & _aName) const;
-
- ElementList::const_iterator beginNodes() const { return m_aNodes.begin(); }
- ElementList::const_iterator endNodes() const { return m_aNodes.end(); };
- ElementList::const_iterator beginProperties() const { return m_aProperties.begin(); };
- ElementList::const_iterator endProperties() const { return m_aProperties.end(); };
-
- bool hasChildren() const { return !m_aNodes.empty() || !m_aProperties.empty(); }
-
- void writeChildrenToLayer(backenduno::XLayerHandler * _pLayer);
- private:
- ElementList m_aNodes;
- ElementList m_aProperties;
- ElementList m_aRemovedElements;
- Op m_op;
- };
-// -----------------------------------------------------------------------------
-
- class NodeModification : public NodeUpdate
- {
- public:
- NodeModification(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, sal_Bool _bReset);
- virtual void writeToLayer(backenduno::XLayerHandler * _pLayer);
- };
-// -----------------------------------------------------------------------------
-
- class NodeReplace : public NodeUpdate
- {
- public:
- NodeReplace(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags);
- NodeReplace(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, rtl::OUString const & _aTemplateName, rtl::OUString const & _aTemplateComponent);
-
- bool hasTemplate() const;
- rtl::OUString getTemplateName() const { return m_aTemplateName; }
- rtl::OUString getTemplateComponent() const { return m_aTemplateComponent; }
-
- virtual void writeToLayer(backenduno::XLayerHandler * _pLayer);
- private:
- rtl::OUString m_aTemplateName;
- rtl::OUString m_aTemplateComponent;
- };
-// -----------------------------------------------------------------------------
-
- class NodeDrop : public ElementUpdate
- {
- public:
- NodeDrop(NodeUpdate * _pParent, rtl::OUString const & _aName);
-
- virtual void writeToLayer(backenduno::XLayerHandler * _pLayer);
- };
-// -----------------------------------------------------------------------------
-
- class PropertyUpdate : public ElementUpdate
- {
- typedef std::map< rtl::OUString, uno::Any > ValueList;
-
- ValueList m_aValues;
- uno::Type m_aType;
- public:
- PropertyUpdate(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, uno::Type const & _aType);
-
- bool setValueFor(rtl::OUString const & _aLocale, uno::Any const & _aValueUpdate);
- bool resetValueFor(rtl::OUString const & _aLocale);
- void removeValueFor(rtl::OUString const & _aLocale);
-
- bool setValue(uno::Any const & _aValueUpdate) { return setValueFor(primarySlot(), _aValueUpdate); }
- bool resetValue() { return resetValueFor(primarySlot()); }
- void removeValue() { removeValueFor(primarySlot()); }
-
- void finishValue();
-
- uno::Type const & getValueType() const { return m_aType; }
-
- bool hasValueFor(rtl::OUString const & _aLocale) const;
- bool hasValue() const { return hasValueFor(primarySlot()); }
-
- bool hasResetFor(rtl::OUString const & _aLocale) const;
- bool hasReset() const { return hasResetFor(primarySlot()); }
-
- bool hasChangeFor(rtl::OUString const & _aLocale) const;
- bool hasChange() const { return hasChangeFor(primarySlot()); }
-
- uno::Any getValueFor(rtl::OUString const & _aLocale) const;
- uno::Any getValue() const { return getValueFor(primarySlot()); }
-
- ValueList::const_iterator beginValues() const { return m_aValues.begin(); }
- ValueList::const_iterator endValues() const { return m_aValues.end(); }
-
- void writeValueToLayerFor(backenduno::XLayerHandler * _pLayer, uno::Any const & _aValue, rtl::OUString const & _aLocale);
- void writeValueToLayer(backenduno::XLayerHandler * _pLayer, uno::Any const & _aValue);
- void writeValuesToLayer(backenduno::XLayerHandler * _pLayer);
- virtual void writeToLayer(backenduno::XLayerHandler * _pLayer);
- private:
- rtl::OUString primarySlot() const { return rtl::OUString(); }
-
- static uno::Any const & getResetMarker();
- static inline bool isResetMarker(uno::Any const & _aValue);
-
- virtual PropertyUpdate * asPropertyUpdate();
- };
-// -----------------------------------------------------------------------------
-
- class PropertyAdd : public ElementUpdate
- {
- uno::Type m_aValueType;
- uno::Any m_aValue;
- public:
- PropertyAdd(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, uno::Type const & _aType);
- PropertyAdd(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, uno::Any const & _aValue);
-
- bool hasValue() const { return !! m_aValue.hasValue(); }
- uno::Any const & getValue() const { return m_aValue; }
- uno::Type const & getValueType() const { return m_aValueType; }
-
- virtual void writeToLayer(backenduno::XLayerHandler * _pLayer);
- };
-// -----------------------------------------------------------------------------
-
- class PropertyReset : public ElementUpdate
- {
- public:
- PropertyReset(NodeUpdate * _pParent, rtl::OUString const & _aName);
-
- virtual void writeToLayer(backenduno::XLayerHandler * _pLayer);
- };
-// -----------------------------------------------------------------------------
-
- } // namespace backend
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/backend/updatedispatch.cxx b/configmgr/source/backend/updatedispatch.cxx
deleted file mode 100644
index ba853bf5cc..0000000000
--- a/configmgr/source/backend/updatedispatch.cxx
+++ /dev/null
@@ -1,496 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "treefragment.hxx"
-#include "updatedispatch.hxx"
-#include "configpath.hxx"
-#include "node.hxx"
-#include "matchlocale.hxx"
-
-#include <com/sun/star/configuration/backend/XUpdateHandler.hpp>
-#include <com/sun/star/configuration/backend/NodeAttribute.hpp>
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
-
-UpdateDispatcher::UpdateDispatcher(uno::Reference< backenduno::XUpdateHandler > const & _xUpdateHandler, rtl::OUString const & _aLocale)
-: m_pContextPath(NULL)
-, m_xUpdateHandler(_xUpdateHandler)
-, m_aLocale(_aLocale)
-, m_aElementName()
-, m_bInValueSet(false)
-, m_bInLocalizedValues(false)
-{
-}
-// -----------------------------------------------------------------------------
-
-UpdateDispatcher::~UpdateDispatcher()
-{
-}
-// -----------------------------------------------------------------------------
-
-void UpdateDispatcher::dispatchUpdate(configuration::AbsolutePath const & _aRootPath, SubtreeChange const& _anUpdate)
-{
- if (!m_xUpdateHandler.is())
- {
- rtl::OUString sMsg( RTL_CONSTASCII_USTRINGPARAM("ERROR: Cannot dispatch update - no handler found") );
- throw uno::RuntimeException(sMsg,NULL);
- }
-
- OSL_PRECOND( !_aRootPath.isRoot(), "Cannot apply update, where root is outside a component" );
-
- OSL_PRECOND( m_pContextPath == NULL, "Update Dispatcher already has a context path" );
- if (!_aRootPath.getParentPath().isRoot())
- {
- OSL_ENSURE(false,"Obsolete functionality used: starting update with non-empty context");
- m_pContextPath = &_aRootPath;
- }
-
- this->startUpdate();
- this->applyToChange(_anUpdate);
- this->endUpdate();
-
- m_pContextPath = NULL;
-}
-// -----------------------------------------------------------------------------
-
-void UpdateDispatcher::startUpdate()
-{
- m_xUpdateHandler->startUpdate();
- m_bInValueSet = false;
- m_bInLocalizedValues = false;
- m_aElementName = rtl::OUString();
-
- if (m_pContextPath)
- {
- std::vector<configuration::Path::Component>::const_reverse_iterator it = m_pContextPath->begin();
- std::vector<configuration::Path::Component>::const_reverse_iterator stop = m_pContextPath->end();
-
- OSL_ASSERT(it != stop);
- --stop;
-
- for ( ; it != stop; ++it)
- {
- m_xUpdateHandler->modifyNode(it->getName(),0,0,false);
- }
- }
-}
-// -----------------------------------------------------------------------------
-
-void UpdateDispatcher::endUpdate()
-{
- if (m_pContextPath)
- {
- std::vector<configuration::Path::Component>::const_reverse_iterator it = m_pContextPath->begin();
- std::vector<configuration::Path::Component>::const_reverse_iterator stop = m_pContextPath->end();
-
- OSL_ASSERT(it != stop);
- --stop;
-
- for ( ; it != stop; ++it)
- {
- m_xUpdateHandler->endNode();
- }
- }
- m_xUpdateHandler->endUpdate();
-}
-// -----------------------------------------------------------------------------
-
-void UpdateDispatcher::handle(ValueChange const& aValueNode)
-{
- // special case: doing members of a localized property (as set)
- if (m_bInLocalizedValues)
- {
- rtl::OUString aLocale = aValueNode.getNodeName();
-
- if (aLocale.getLength())
- {
- if ( aValueNode.isToDefault() )
- m_xUpdateHandler->resetPropertyValueForLocale( aLocale );
- else
- m_xUpdateHandler->setPropertyValueForLocale( aValueNode.getNewValue(), aLocale );
- }
- else
- {
- if ( aValueNode.isToDefault() )
- m_xUpdateHandler->resetPropertyValue( );
- else
- m_xUpdateHandler->setPropertyValue( aValueNode.getNewValue() );
- }
- return;
- }
-
- // normal case: updating a single property
- switch (aValueNode.getMode())
- {
- case ValueChange::wasDefault:
- if (aValueNode.isReplacedValue())
- {
-
- OSL_ENSURE(m_bInValueSet, "UpdateDispatcher: Cannot add/replace a value in a nonextensible node");
- OSL_ENSURE(!aValueNode.isLocalizedValue(), "UpdateDispatcher: Cannot add a localized value in a layer");
-
- sal_Int16 nAttr = getUpdateAttributes(aValueNode.getAttributes(),true);
-
- if (aValueNode.getNewValue().hasValue())
- {
- m_xUpdateHandler->addOrReplacePropertyWithValue( aValueNode.getNodeName(),
- nAttr,
- aValueNode.getNewValue());
- }
- else
- {
- m_xUpdateHandler->addOrReplaceProperty( aValueNode.getNodeName(),
- nAttr,
- aValueNode.getValueType());
- }
-
- break;
- }
- // else fall thru to changeValue case
-
- case ValueChange::changeValue:
- {
- sal_Int16 nAttr = getUpdateAttributes(aValueNode.getAttributes(),false);
- sal_Int16 nAttrMask = getUpdateAttributeMask(aValueNode.getAttributes());
-
- m_xUpdateHandler->modifyProperty( aValueNode.getNodeName(),
- nAttr, nAttrMask,
- aValueNode.getValueType() );
-
- if (aValueNode.isLocalizedValue() && m_aLocale.getLength())
- {
- m_xUpdateHandler->setPropertyValueForLocale( aValueNode.getNewValue(), m_aLocale );
- }
- else
- {
- m_xUpdateHandler->setPropertyValue( aValueNode.getNewValue() );
- }
-
- m_xUpdateHandler->endProperty();
- }
- break;
-
- case ValueChange::setToDefault:
- m_xUpdateHandler->resetProperty( aValueNode.getNodeName() );
- break;
-
- case ValueChange::changeDefault:
- OSL_ENSURE(false, "Illegal mode in ValueChange");
- break;
-
- default:
- OSL_ENSURE(false, "Illegal mode in ValueChange");
- break;
- };
-}
-// -----------------------------------------------------------------------------
-
-void UpdateDispatcher::handle(AddNode const& aAddNode)
-{
- rtl::Reference< data::TreeSegment > aAddedTree = aAddNode.getNewTree();
-
- OSL_ENSURE(aAddedTree.is(), "AddNode has no new data -> cannot add anything");
-
- OSL_ENSURE( ((m_bInValueSet||m_bInLocalizedValues) == aAddedTree->fragment->nodes[0].isValue()),
- "Found added subtree in value set (extensible group)\n" );
-
- this->visitTree(aAddedTree->fragment);
-}
-// -----------------------------------------------------------------------------
-
-void UpdateDispatcher::handle(RemoveNode const& aRemoveNode)
-{
- OSL_ENSURE( !m_bInLocalizedValues, "UpdateDispatcher: Removing values for a specific locale is currently not supported");
-
- rtl::Reference< data::TreeSegment > aRemovedTree = aRemoveNode.getRemovedTree();
-
- OSL_ENSURE( !aRemovedTree.is() ||
- ((m_bInValueSet||m_bInLocalizedValues) == aRemovedTree->fragment->nodes[0].isValue()),
- "Found removed subtree in value set (extensible group)\n" );
-
- if (m_bInLocalizedValues)
- OSL_TRACE("configmgr: UpdateDispatcher - Removing value for locale ignored");
-
- else if (m_bInValueSet)
- m_xUpdateHandler->removeProperty( aRemoveNode.getNodeName() );
-
- else
- m_xUpdateHandler->removeNode( aRemoveNode.getNodeName() );
-}
-// -----------------------------------------------------------------------------
-
-void UpdateDispatcher::handle(SubtreeChange const& aSubtree)
-{
- OSL_ENSURE( !m_bInLocalizedValues, "UpdateDispatcher: A localized value cannot be a complete subtree");
- OSL_ENSURE( !m_bInValueSet, "UpdateDispatcher: A dynamic property cannot be a complete subtree");
-
- sal_Int16 nAttr = getUpdateAttributes(aSubtree.getAttributes(),false);
- sal_Int16 nAttrMask = getUpdateAttributeMask(aSubtree.getAttributes());
-
- if (isLocalizedValueSet(aSubtree))
- {
- m_xUpdateHandler->modifyProperty( aSubtree.getNodeName(),
- nAttr, nAttrMask,
- uno::Type() );
-
- m_bInLocalizedValues = true;
- this->applyToChildren(aSubtree);
- m_bInLocalizedValues = false;
-
- m_xUpdateHandler->endProperty();
- }
-
- else
- {
- m_xUpdateHandler->modifyNode( aSubtree.getNodeName(),
- nAttr, nAttrMask,
- aSubtree.isToDefault() );
-
- m_bInValueSet = isValueSet(aSubtree);
- this->applyToChildren(aSubtree);
- m_bInValueSet = false;
-
- m_xUpdateHandler->endNode();
- }
-}
-// -----------------------------------------------------------------------------
-
-bool UpdateDispatcher::handle(sharable::ValueNode * node)
-{
- rtl::OUString aName;
-
- // special case: doing members of a localized property (as set)
- if (m_bInLocalizedValues)
- {
- // the node name is the locale
- rtl::OUString aLocale;
- OSL_VERIFY(testReplacedAndGetName(sharable::node(node), aLocale)); // "Adding a localized subvalue but not as root of element tree"
-
- if (aLocale.getLength() && ! localehelper::isDefaultLanguage(aLocale))
- {
- m_xUpdateHandler->setPropertyValueForLocale(node->getValue(), aLocale);
- }
- else
- {
- m_xUpdateHandler->setPropertyValue(node->getValue());
- }
- }
- else if (testReplacedAndGetName(sharable::node(node), aName) && sharable::node(node)->getAttributes().isRemovable()) // we must be inside a set of values
- {
-
- OSL_ENSURE(!node->info.isLocalized(), "UpdateDispatcher: Cannot add a localized value in a layer .");
-
- sal_Int16 nAttr = getUpdateAttributes(sharable::node(node)->getAttributes(),true);
-
- if (!node->isNull())
- {
- m_xUpdateHandler->addOrReplacePropertyWithValue( aName,
- nAttr,
- node->getValue());
- }
- else
- {
- m_xUpdateHandler->addOrReplaceProperty( aName,
- nAttr,
- node->getValueType());
- }
- }
- else // normal case: updating a single property //Inserting set
- {
- sal_Int16 nAttr = getUpdateAttributes(sharable::node(node)->getAttributes(),false);
- sal_Int16 nAttrMask = getUpdateAttributeMask(sharable::node(node)->getAttributes());
-
- m_xUpdateHandler->modifyProperty( aName, nAttr, nAttrMask, node->getValueType() );
-
- if (node->info.isLocalized() && m_aLocale.getLength())
- {
- m_xUpdateHandler->setPropertyValueForLocale(node->getValue(), m_aLocale);
- }
- else
- {
- m_xUpdateHandler->setPropertyValue(node->getValue());
- }
-
- m_xUpdateHandler->endProperty();
- }
- return false;
-}
-// -----------------------------------------------------------------------------
-
-bool UpdateDispatcher::handle(sharable::GroupNode * node)
-{
- OSL_ENSURE( !m_bInLocalizedValues, "UpdateDispatcher: A localized value cannot be a complete group");
-
- rtl::OUString aName;
-
- if ( testReplacedAndGetName(sharable::node(node), aName) )
- {
- sal_Int16 nAttr = getUpdateAttributes(sharable::node(node)->getAttributes(),true);
-
- m_xUpdateHandler->addOrReplaceNode( aName, nAttr );
-
- this->visitChildren(node);
-
- m_xUpdateHandler->endNode();
- }
- else
- {
- sal_Int16 nAttr = getUpdateAttributes(sharable::node(node)->getAttributes(),false);
- sal_Int16 nAttrMask = getUpdateAttributeMask(sharable::node(node)->getAttributes());
-
- m_xUpdateHandler->modifyNode( aName, nAttr, nAttrMask, false );
-
- this->visitChildren(node);
-
- m_xUpdateHandler->endNode();
- }
- return false;
-}
-// -----------------------------------------------------------------------------
-
-bool UpdateDispatcher::handle(sharable::SetNode * node)
-{
- OSL_ENSURE( !m_bInLocalizedValues, "UpdateDispatcher: A localized value cannot be a complete set");
-
- rtl::OUString aName;
-
- if ( testReplacedAndGetName(sharable::node(node), aName) )
- {
- OSL_ENSURE( !node->info.isLocalized(), "UpdateDispatcher: Cannot add a localized value in a layer." );
-
- sal_Int16 nAttr = getUpdateAttributes(sharable::node(node)->getAttributes(),true);
-
- m_xUpdateHandler->addOrReplaceNode( aName, nAttr );
-
- this->visitElements(node);
-
- m_xUpdateHandler->endNode();
- }
- else
- {
- sal_Int16 nAttr = getUpdateAttributes(sharable::node(node)->getAttributes(),false);
- sal_Int16 nAttrMask = getUpdateAttributeMask(sharable::node(node)->getAttributes());
-
- if (node->info.isLocalized())
- {
- m_xUpdateHandler->modifyProperty( aName, nAttr, nAttrMask, uno::Type() );
-
- m_bInLocalizedValues = true;
- this->visitElements(node);
- m_bInLocalizedValues = false;
-
- m_xUpdateHandler->endProperty();
- }
-
- else
- {
- m_xUpdateHandler->modifyNode( aName, nAttr, nAttrMask, false );
-
- this->visitElements(node);
-
- m_xUpdateHandler->endNode();
- }
- }
- return false;
-}
-// -----------------------------------------------------------------------------
-
-bool UpdateDispatcher::testReplacedAndGetName(sharable::Node * node, rtl::OUString & _aName)
-{
- if (m_aElementName.getLength())
- {
- OSL_ENSURE( node->isFragmentRoot(), "ERROR - UpdateDispatcher: Found orphaned 'element' name for inner node");
- _aName = m_aElementName;
- m_aElementName = rtl::OUString();
- return true;
- }
- else
- {
- OSL_ENSURE(!node->isFragmentRoot(), "ERROR - UpdateDispatcher: Found no 'element' name for fragment root node");
- _aName = node->getName();
- return false;
- }
-}
-// -----------------------------------------------------------------------------
-
-bool UpdateDispatcher::handle(sharable::TreeFragment * tree)
-{
- m_aElementName = tree->getName();
- bool done = SetVisitor::handle(tree); // dispatch to root node
- m_aElementName = rtl::OUString(); // clear - just to be safe
- return done;
-}
-// -----------------------------------------------------------------------------
-
-sal_Int16 UpdateDispatcher::getUpdateAttributes(node::Attributes const & _aAttributes, bool bAdded)
-{
- namespace NodeAttribute = backenduno::NodeAttribute;
-
- // no support for post-creation attribute changes yet
- if (!bAdded)
- {
- OSL_ENSURE( getUpdateAttributeMask(_aAttributes) == 0,
- "Incomplete support for attribute changes" );
- return 0;
- }
-
- sal_Int16 nResult = 0;
-
- if (_aAttributes.isReadonly())
- nResult = NodeAttribute::READONLY;
-
- if (_aAttributes.isFinalized())
- nResult |= NodeAttribute::FINALIZED;
-
- if (!_aAttributes.isNullable())
- nResult |= NodeAttribute::MANDATORY;
-
- return nResult;
-}
-// -----------------------------------------------------------------------------
-
-sal_Int16 UpdateDispatcher::getUpdateAttributeMask(node::Attributes const & /*_aAttributes*/)
-{
- // no support for post-creation attribute changes yet
- return 0;
-}
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace backend
-
-// -------------------------------------------------------------------------
-} // namespace configmgr
diff --git a/configmgr/source/backend/updatedispatch.hxx b/configmgr/source/backend/updatedispatch.hxx
deleted file mode 100644
index fa5d154745..0000000000
--- a/configmgr/source/backend/updatedispatch.hxx
+++ /dev/null
@@ -1,103 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_UPDATEDISPATCH_HXX
-#define CONFIGMGR_BACKEND_UPDATEDISPATCH_HXX
-
-#include "change.hxx"
-#include "nodevisitor.hxx"
-#include "utility.hxx"
-#include <boost/utility.hpp>
-#include <com/sun/star/uno/Reference.hxx>
-
-namespace com { namespace sun { namespace star { namespace configuration { namespace backend {
- class XUpdateHandler;
-} } } } }
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace configuration
- {
- class AbsolutePath;
- }
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace backenduno = ::com::sun::star::configuration::backend;
-
-// -----------------------------------------------------------------------------
-
- class UpdateDispatcher: private boost::noncopyable, private ChangeTreeAction, private data::SetVisitor
- {
- public:
- UpdateDispatcher(uno::Reference< backenduno::XUpdateHandler > const & _xUpdateHandler, rtl::OUString const & _aLocale);
- ~UpdateDispatcher();
-
- void dispatchUpdate(configuration::AbsolutePath const & _aRootPath, SubtreeChange const& _anUpdate);
-
- protected:
- using data::NodeVisitor::handle;
-
- private:
- void startUpdate();
- void endUpdate();
-
- virtual void handle(ValueChange const& aValueNode);
- virtual void handle(AddNode const& aAddNode);
- virtual void handle(RemoveNode const& aRemoveNode);
- virtual void handle(SubtreeChange const& aSubtree) ;
-
- virtual bool handle(sharable::ValueNode * node);
- virtual bool handle(sharable::GroupNode * node);
- virtual bool handle(sharable::SetNode * node);
- virtual bool handle(sharable::TreeFragment * tree);
- private:
- sal_Int16 getUpdateAttributes(node::Attributes const & _aAttributes, bool bAdded);
- sal_Int16 getUpdateAttributeMask(node::Attributes const & _aAttributes);
-
- bool testReplacedAndGetName(sharable::Node * node, rtl::OUString & _aName);
- private:
- configuration::AbsolutePath const * m_pContextPath;
- uno::Reference< backenduno::XUpdateHandler > m_xUpdateHandler;
- rtl::OUString m_aLocale;
- rtl::OUString m_aElementName;
- bool m_bInValueSet;
- bool m_bInLocalizedValues;
- };
-// -----------------------------------------------------------------------------
- } // namespace backend
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/backend/updatesvc.cxx b/configmgr/source/backend/updatesvc.cxx
deleted file mode 100644
index a4ae22acb8..0000000000
--- a/configmgr/source/backend/updatesvc.cxx
+++ /dev/null
@@ -1,278 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "updatesvc.hxx"
-
-#ifndef CONFIGMGR_API_FACTORY_HXX_
-#include "confapifactory.hxx"
-#endif
-#include "emptylayer.hxx"
-#include <com/sun/star/configuration/backend/XUpdatableLayer.hpp>
-#include <com/sun/star/configuration/backend/XLayerHandler.hpp>
-#include <com/sun/star/beans/NamedValue.hpp>
-#include <com/sun/star/lang/IllegalArgumentException.hpp>
-
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace beans = ::com::sun::star::beans;
- namespace backenduno = ::com::sun::star::configuration::backend;
-// -----------------------------------------------------------------------------
-
-sal_Char const * const aUpdateMergerServices[] =
-{
- "com.sun.star.configuration.backend.LayerUpdateMerger",
- 0
-};
-const ServiceImplementationInfo aUpdateMergerSI =
-{
- "com.sun.star.comp.configuration.backend.LayerUpdateMerger",
- aUpdateMergerServices,
- 0
-};
-// -----------------------------------------------------------------------------
-
-const ServiceRegistrationInfo* getUpdateMergerServiceInfo()
-{ return getRegistrationInfo(& aUpdateMergerSI); }
-// -----------------------------------------------------------------------------
-
-inline
-ServiceInfoHelper UpdateService::getServiceInfo()
-{
- return & aUpdateMergerSI;
-}
-// -----------------------------------------------------------------------------
-
-
-UpdateService::UpdateService(uno::Reference< uno::XComponentContext > const & _xContext)
-: m_xServiceFactory(_xContext->getServiceManager(),uno::UNO_QUERY)
-, m_aSourceMode(merge)
-{
- if (!m_xServiceFactory.is())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration Update Merger: Context has no service manager (or missing interface)"));
- throw uno::RuntimeException(sMessage,NULL);
- }
-}
-// -----------------------------------------------------------------------------
-
-// XInitialization
-
-void SAL_CALL
- UpdateService::initialize( const uno::Sequence< uno::Any >& aArguments )
- throw (uno::Exception, uno::RuntimeException)
-{
- sal_Int16 const nCount = static_cast<sal_Int16>(aArguments.getLength());
-
- if (sal_Int32(nCount) != aArguments.getLength())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Too many arguments to initialize a Configuration Update Merger"));
- throw lang::IllegalArgumentException(sMessage,*this,0);
- }
-
- for (sal_Int16 i = 0; i < nCount; ++i)
- {
- uno::Reference< backenduno::XUpdatableLayer > xUpdLayer;
- if (aArguments[i] >>= xUpdLayer)
- {
- m_xSourceLayer = xUpdLayer.get();
- m_xLayerWriter.clear();
-
- OSL_ASSERT( uno::Reference< backenduno::XUpdatableLayer >::query(m_xSourceLayer).is() || !xUpdLayer.is() );
-
- continue;
- }
-
- if (aArguments[i] >>= m_xSourceLayer)
- continue;
-
- if (aArguments[i] >>= m_xLayerWriter)
- continue;
-
- beans::NamedValue aExtraArg;
- if (aArguments[i] >>= aExtraArg)
- {
- OSL_VERIFY( setImplementationProperty(aExtraArg.Name, aExtraArg.Value) );
-
- continue;
- }
-
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Cannot use argument to initialize a Configuration Update Merger"
- "- XLayer, XLayerHandler or XUpdatableLayer expected"));
- throw lang::IllegalArgumentException(sMessage,*this,i);
- }
-}
-
-// -----------------------------------------------------------------------------
-
-sal_Bool UpdateService::setImplementationProperty(rtl::OUString const & aName, uno::Any const & aValue)
-{
- if (aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Overwrite")))
- {
- sal_Bool bOverwrite = sal_False;
- if (aValue >>= bOverwrite)
- {
- if (!bOverwrite)
- m_aSourceMode = protect;
-
- else if (protect == m_aSourceMode)
- m_aSourceMode = merge;
-
- return true;
- }
- }
-
- else if (aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Truncate")))
- {
- sal_Bool bTruncate = sal_False;
- if (aValue >>= bTruncate)
- {
- if (!bTruncate)
- m_aSourceMode = merge;
-
- else if (merge == m_aSourceMode)
- m_aSourceMode = truncate;
-
- return true;
- }
- }
-
- return false;
-}
-// -----------------------------------------------------------------------------
-
-bool UpdateService::validateSourceLayerAndCheckNotEmpty() SAL_THROW( (lang::IllegalAccessException) )
-{
- switch (m_aSourceMode)
- {
- case merge: // TODO: check for readonly layer
- return true;
-
- case protect: if (!checkEmptyLayer(m_xSourceLayer))
- raiseIllegalAccessException("UpdateService: Layer already exists");
- // else fall through
-
- case truncate: return false;
-
- default: OSL_ASSERT(!"not reached");
- return true;
- }
-}
-// -----------------------------------------------------------------------------
-
-uno::Reference< backenduno::XLayer > UpdateService::getSourceLayer() SAL_THROW( (lang::IllegalAccessException) )
-{
- if ( validateSourceLayerAndCheckNotEmpty() )
- return m_xSourceLayer;
- else
- return createEmptyLayer();
-}
-// -----------------------------------------------------------------------------
-
-void UpdateService::raiseIllegalAccessException(sal_Char const * pMsg)
- SAL_THROW( (lang::IllegalAccessException) )
-{
- rtl::OUString sMsg = rtl::OUString::createFromAscii(pMsg);
- throw lang::IllegalAccessException(sMsg,*this);
-}
-// -----------------------------------------------------------------------------
-
-void UpdateService::writeUpdatedLayer(uno::Reference< backenduno::XLayer > const & _xLayer)
-{
- OSL_ENSURE( _xLayer.is(), "UpdateService: Trying to write NULL XLayer");
-
- if (!_xLayer.is())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Update Merger - Internal error: trying to write a NULL Layer"));
- throw uno::RuntimeException(sMessage,*this);
- }
-
- // use our layer writer, if we have one
- if ( m_xLayerWriter.is() )
- {
- _xLayer->readData( m_xLayerWriter );
- return;
- }
-
- // look for an updatable layer otherwise
- uno::Reference< backenduno::XUpdatableLayer > xUpdLayer(m_xSourceLayer, uno::UNO_QUERY);
- if (xUpdLayer.is())
- {
- xUpdLayer->replaceWith( _xLayer );
- return;
- }
-
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Update Merger: Cannot write merge results - no recipient available."));
- throw uno::RuntimeException(sMessage,*this);
-}
-// -----------------------------------------------------------------------------
-
-// XServiceInfo
-
-::rtl::OUString SAL_CALL
- UpdateService::getImplementationName( )
- throw (uno::RuntimeException)
-{
- return getServiceInfo().getImplementationName( );
-}
-// -----------------------------------------------------------------------------
-
-
-sal_Bool SAL_CALL
- UpdateService::supportsService( const ::rtl::OUString& ServiceName )
- throw (uno::RuntimeException)
-{
- return getServiceInfo().supportsService( ServiceName );
-}
-// -----------------------------------------------------------------------------
-
-
-uno::Sequence< ::rtl::OUString > SAL_CALL
- UpdateService::getSupportedServiceNames( )
- throw (uno::RuntimeException)
-{
- return getServiceInfo().getSupportedServiceNames( );
-}
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace
-
-// -----------------------------------------------------------------------------
-} // namespace
-
diff --git a/configmgr/source/backend/updatesvc.hxx b/configmgr/source/backend/updatesvc.hxx
deleted file mode 100644
index 9094fb9fbb..0000000000
--- a/configmgr/source/backend/updatesvc.hxx
+++ /dev/null
@@ -1,122 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_UPDATESVC_HXX
-#define CONFIGMGR_BACKEND_UPDATESVC_HXX
-
-#include "serviceinfohelper.hxx"
-#include <cppuhelper/implbase3.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/configuration/backend/XUpdateHandler.hpp>
-
-// -----------------------------------------------------------------------------
-
-namespace com { namespace sun { namespace star { namespace configuration { namespace backend {
- class XLayerHandler;
- class XLayer;
-} } } } }
-
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace backend
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace backenduno = ::com::sun::star::configuration::backend;
-// -----------------------------------------------------------------------------
-
- class UpdateService : public ::cppu::WeakImplHelper3<
- lang::XInitialization,
- lang::XServiceInfo,
- backenduno::XUpdateHandler
- >
- {
- public:
- explicit
- UpdateService(uno::Reference< uno::XComponentContext > const & _xContext);
-
- // XInitialization
- virtual void SAL_CALL
- initialize( const uno::Sequence< uno::Any >& aArguments )
- throw (uno::Exception, uno::RuntimeException);
-
- // XServiceInfo
- virtual ::rtl::OUString SAL_CALL
- getImplementationName( )
- throw (uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- supportsService( const ::rtl::OUString& ServiceName )
- throw (uno::RuntimeException);
-
- virtual uno::Sequence< ::rtl::OUString > SAL_CALL
- getSupportedServiceNames( )
- throw (uno::RuntimeException);
-
- protected:
- uno::Reference< lang::XMultiServiceFactory > getServiceFactory() const
- { return m_xServiceFactory; }
-
- void checkSourceLayer() SAL_THROW( (lang::IllegalAccessException) )
- { validateSourceLayerAndCheckNotEmpty(); }
-
- uno::Reference< backenduno::XLayer > getSourceLayer() SAL_THROW( (lang::IllegalAccessException) );
-
- void writeUpdatedLayer(uno::Reference< backenduno::XLayer > const & _xLayer);
-
- virtual sal_Bool setImplementationProperty(rtl::OUString const & aName, uno::Any const & aValue);
-
- void raiseIllegalAccessException(sal_Char const * pMsg)
- SAL_THROW( (lang::IllegalAccessException) );
-
- private:
- bool validateSourceLayerAndCheckNotEmpty() SAL_THROW( (lang::IllegalAccessException) );
-
- private:
- uno::Reference< lang::XMultiServiceFactory > m_xServiceFactory;
- uno::Reference< backenduno::XLayer > m_xSourceLayer;
- uno::Reference< backenduno::XLayerHandler > m_xLayerWriter;
- enum { merge, truncate, protect } m_aSourceMode;
-
- static ServiceInfoHelper getServiceInfo();
- };
-// -----------------------------------------------------------------------------
- } // namespace xml
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/backendhelper/backendlayerhelper.cxx b/configmgr/source/backendhelper/backendlayerhelper.cxx
deleted file mode 100644
index f4ad93d47e..0000000000
--- a/configmgr/source/backendhelper/backendlayerhelper.cxx
+++ /dev/null
@@ -1,361 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-
-#include "backendlayerhelper.hxx"
-#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
-
-namespace configmgr { namespace backendhelper {
-
-//==============================================================================
-
-//------------------------------------------------------------------------------
-uno::Type toType(const ::rtl::OUString& _rType)
- {
- uno::Type aRet;
-
- if (_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("boolean")))
- aRet = ::getBooleanCppuType();
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("short")))
- aRet = ::getCppuType(static_cast<sal_Int16 const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("int")))
- aRet = ::getCppuType(static_cast<sal_Int32 const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("integer")))
- aRet = ::getCppuType(static_cast<sal_Int32 const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("long")))
- aRet = ::getCppuType(static_cast<sal_Int64 const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("double")))
- aRet = ::getCppuType(static_cast<double const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("string")))
- aRet = ::getCppuType(static_cast<rtl::OUString const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("binary")))
- aRet = ::getCppuType(static_cast<uno::Sequence<sal_Int8> const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("any")))
- aRet = ::getCppuType(static_cast<uno::Any const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("boolean-list")))
- aRet = ::getCppuType(static_cast<uno::Sequence<sal_Bool> const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("short-list")))
- aRet = ::getCppuType(static_cast<uno::Sequence<sal_Int16> const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("int-list")))
- aRet = ::getCppuType(static_cast<uno::Sequence<sal_Int32> const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("integer-list")))
- aRet = ::getCppuType(static_cast<uno::Sequence<sal_Int32> const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("long-list")))
- aRet = ::getCppuType(static_cast<uno::Sequence<sal_Int64> const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("double-list")))
- aRet = ::getCppuType(static_cast<uno::Sequence<double> const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("string-list")))
- aRet = ::getCppuType(static_cast<uno::Sequence<rtl::OUString> const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("binary-list")))
- aRet = ::getCppuType(static_cast<uno::Sequence<uno::Sequence<sal_Int8> > const*>(0));
-
- else
- {
- ::rtl::OString aStr("Unknown type! ");
- aStr += rtl::OUStringToOString(_rType,RTL_TEXTENCODING_ASCII_US);
- OSL_ENSURE(0,aStr.getStr());
- }
-
- return aRet;
- }
-
-//------------------------------------------------------------------------------
-
-IOONode::IOONode(const rtl::OUString& sName):
- mName(sName)
-{
-}
-
-//------------------------------------------------------------------------------
-OOProperty::OOProperty(
- const rtl::OUString& sName,const rtl::OUString& sPropType,
- const uno::Any& aPropValue,sal_Bool bProtected)
- :IOONode(sName), mPropType(sPropType), mPropValue(aPropValue),
- mbProtected(bProtected)
-{
-}
-//------------------------------------------------------------------------------
-OONode::OONode(const rtl::OUString& sName)
- :IOONode(sName)
-{
-}
-
-OONode::OONode()
- :IOONode(rtl::OUString())
-{
-}
-IOONode* OONode::addChild(IOONode* aChild)
-{
- mChildList.push_back(aChild);
- return aChild;
-}
-const std::vector<IOONode*>& OONode::getChildren()
-{
- return mChildList;
-}
-
-IOONode* OONode::getChild(const rtl::OUString& aChildName)
-{
- for (sal_uInt32 i=0; i< mChildList.size();++i)
- {
- if (mChildList[i]->getName() == aChildName)
- return mChildList[i];
- }
- return NULL;
-}
-OONode::~OONode()
-{
- for (sal_uInt32 i=0; i< mChildList.size();++i)
- {
- delete mChildList[i];
- }
- mChildList.clear();
-}
-//------------------------------------------------------------------------------
- sal_Bool addChildrenToNodeTree(
- OONode * aNode,
- sal_Int32 nNextToken,
- const backend::PropertyInfo& aPropInfo,
- const uno::Reference<uno::XInterface>& xContext)
-{
- do
- {
- rtl::OUString aName = aPropInfo.Name.getToken(0, '/',nNextToken);
- if (aName.getLength() == 0)
- {
- throw backend::MalformedDataException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "Malformed OpenOffice Key specified")),
- xContext, uno::Any()) ;
- }
- //Check if Property -> nNextToken == -1
- if(nNextToken != -1)
- {
- //check if child already exists
- IOONode* aChildNode= aNode->getChild(aName);
- if (aChildNode == NULL)
- {
- aChildNode = new OONode(aName);
- if (aChildNode != 0)
- {
- aNode->addChild( aChildNode);
- }
- }
-
- sal_Bool bFinished =addChildrenToNodeTree(
- aChildNode->getComposite(),
- nNextToken,
- aPropInfo,
- xContext);
- //Check that if you have finished parsing string therefore no
- //more children
- if (bFinished)
- break;
- }
- else
- {
- //Add Property
- IOONode* aProperty = new OOProperty(aName,
- aPropInfo.Type,
- aPropInfo.Value,
- aPropInfo.Protected);
- if (aProperty != 0)
- {
- aNode->addChild( aProperty);
- }
- //Return finished is true when you are finished parsing the string
- if( nNextToken == -1)
- {
- return sal_True;
- }
- }
- }
- while (nNextToken >= 0 ) ;
- return sal_True;
-}
-//------------------------------------------------------------------------------
-void processChildren(
- std::vector<IOONode*> aChildList,
- const uno::Reference<backend::XLayerHandler>& xHandler)
-{
- for(sal_uInt32 i=0; i <aChildList.size(); ++i)
- {
- OONode * aTestOONode = aChildList[i]->getComposite();
- if (aTestOONode)
- {
- xHandler->overrideNode(aTestOONode->getName(),0,false);
- processChildren(aTestOONode->getChildren(),xHandler);
- xHandler->endNode();
- }
- else
- {
- OOProperty* aProperty = aChildList[i]->asOOProperty();
- sal_Int16 aAttributes = aProperty->isProtected() ? 256:0;
- //Convert Type either simple or list
- uno::Type aType = toType( aProperty->getType());
-
- xHandler->overrideProperty(aProperty->getName(),
- aAttributes,
- aType,
- false);
-
- xHandler->setPropertyValue(aProperty->getValue());
- xHandler->endProperty();
- }
-
- }
-}
-//------------------------------------------------------------------------------
-void buildNodeTree(
- const uno::Sequence< backend::PropertyInfo >& aPropertyInfos,
- const uno::Reference<uno::XInterface>& xContext,
- OONode& aNodeTree)
-{
- sal_Int32 nNextToken =0;
- rtl::OUString aName = aPropertyInfos[0].Name.getToken(0, '/',nNextToken);
- if((nNextToken ==-1)||(aName.getLength()==0))
- {
- throw backend::MalformedDataException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "Malformed OpenOffice Key specified")),
- xContext, uno::Any()) ;
-
- }
- aNodeTree.setName(aName);
- sal_Int32 size = aPropertyInfos.getLength();
- for (sal_Int32 i =0; i < size; ++i)
- {
- addChildrenToNodeTree(&aNodeTree, nNextToken,aPropertyInfos[i],xContext);
- }
-
-}
-//------------------------------------------------------------------------------
-BackendLayerHelper::BackendLayerHelper(
- const uno::Reference<uno::XComponentContext>& /*xContext*/)
- :cppu::WeakComponentImplHelper2<backend::XLayerContentDescriber, lang::XServiceInfo>(mMutex)
-{
-}
-//------------------------------------------------------------------------------
-
-BackendLayerHelper::~BackendLayerHelper(void) {}
-
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL BackendLayerHelper::
- getBackendLayerHelperName(void)
-{
- static const rtl::OUString kImplementationName(
- RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.configuration.backend.LayerDescriber")) ;
-
- return kImplementationName ;
-}
-//------------------------------------------------------------------------------
-void SAL_CALL BackendLayerHelper::describeLayer(
- const uno::Reference< backend::XLayerHandler >& xHandler,
- const uno::Sequence< backend::PropertyInfo >& aPropertyInfos )
- throw (lang::NullPointerException,
- backend::MalformedDataException,
- uno::RuntimeException)
-
-
-
-{
- OONode aNodeTree;
- buildNodeTree(aPropertyInfos, *this, aNodeTree);
-
- //Descirbe the Layer to the XHandler Object
- xHandler->startLayer();
- xHandler->overrideNode(aNodeTree.getName(),0,false);
- std::vector<IOONode*> aChildList = aNodeTree.getChildren();
- processChildren(aChildList,xHandler);
- xHandler->endNode();
- xHandler->endLayer();
-
-
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL BackendLayerHelper::getImplementationName(void)
- throw (uno::RuntimeException)
-{
- return getBackendLayerHelperName() ;
-}
-//------------------------------------------------------------------------------
-
-uno::Sequence<rtl::OUString> SAL_CALL BackendLayerHelper::
- getBackendLayerHelperServiceNames(void)
-{
- uno::Sequence<rtl::OUString> aServices(1) ;
- aServices[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.LayerDescriber")) ;
- return aServices ;
-}
-//------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL BackendLayerHelper::supportsService(
- const rtl::OUString& aServiceName)
- throw (uno::RuntimeException)
-{
- uno::Sequence< rtl::OUString > const svc = getBackendLayerHelperServiceNames();
-
- for(sal_Int32 i = 0; i < svc.getLength(); ++i )
- if(svc[i] == aServiceName)
- return true;
- return false;
-}
-//------------------------------------------------------------------------------
-
-uno::Sequence<rtl::OUString>
-SAL_CALL BackendLayerHelper::getSupportedServiceNames(void)
- throw (uno::RuntimeException)
-{
- return getBackendLayerHelperServiceNames() ;
-}
-//------------------------------------------------------------------------------
-
-} // backendhelper
-} // configmgr
diff --git a/configmgr/source/backendhelper/backendlayerhelper.hxx b/configmgr/source/backendhelper/backendlayerhelper.hxx
deleted file mode 100644
index 0839c12b28..0000000000
--- a/configmgr/source/backendhelper/backendlayerhelper.hxx
+++ /dev/null
@@ -1,165 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKENDHELPER_BACKENDLAYERHELPER_HXX_
-#define CONFIGMGR_BACKENDHELPER_BACKENDLAYERHELPER_HXX_
-
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-
-
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <cppuhelper/compbase2.hxx>
-
-namespace configmgr { namespace backendhelper {
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-//------------------------------------------------------------------------------
-
-/**
- * Implements the LayerContentDescriber service.
- * Describes a set of configuration data to an XLayerHandler
- * Object
- */
-class BackendLayerHelper : public cppu::WeakComponentImplHelper2<backend::XLayerContentDescriber, lang::XServiceInfo> {
-public :
- /**
- Service constructor from a service factory.
- @param xContext component context
- */
- BackendLayerHelper(const uno::Reference<uno::XComponentContext>& xContext) ;
-
- /** Destructor */
- ~BackendLayerHelper(void) ;
-
-
- // XServiceInfo
- virtual rtl::OUString SAL_CALL
- getImplementationName( )
- throw (uno::RuntimeException) ;
-
- virtual sal_Bool SAL_CALL
- supportsService( const rtl::OUString& aServiceName )
- throw (uno::RuntimeException) ;
-
- virtual uno::Sequence<rtl::OUString> SAL_CALL
- getSupportedServiceNames( )
- throw (uno::RuntimeException) ;
-
-
- //XLayerContentDescriber
- virtual void SAL_CALL
- describeLayer( const uno::Reference< backend::XLayerHandler >& xHandler,
- const uno::Sequence< backend::PropertyInfo >& aPropertyInfos )
- throw (lang::NullPointerException,
- backend::MalformedDataException,
- uno::RuntimeException);
-
- /**
- Provides the implementation name.
-
- @return implementation name
- */
- static rtl::OUString SAL_CALL getBackendLayerHelperName(void) ;
- /**
- Provides the supported services names
-
- @return service names
- */
- static uno::Sequence<rtl::OUString> SAL_CALL getBackendLayerHelperServiceNames(void) ;
-private:
- osl::Mutex mMutex;
-
-} ;
-//------------------------------------------------------------------------------
-class OONode;
-class OOProperty;
-
-/**
- Base class for representing OO properties and nodes
-*/
-class IOONode
-{
-public:
- virtual OONode* getComposite(){return NULL;}
- virtual ~IOONode(){};
- virtual OOProperty* asOOProperty(){return NULL;}
- rtl::OUString getName(){return mName;}
- void setName(const rtl::OUString& sName){mName = sName;}
-protected:
- IOONode(const rtl::OUString& sName);
-private:
- rtl::OUString mName;
-};
-//------------------------------------------------------------------------------
-class OONode :public IOONode
-{
-public:
-
- OONode(const rtl::OUString& sName);
- OONode();
- ~OONode();
-
- IOONode* addChild(IOONode* aChild);
- OONode* getComposite(){return this;}
- const std::vector<IOONode*>& getChildren();
- IOONode* getChild(const rtl::OUString& aChildName);
-
-private:
- std::vector<IOONode*> mChildList;
-};
-//------------------------------------------------------------------------------
-class OOProperty :public IOONode
-{
-public:
- OOProperty(const rtl::OUString& sName,
- const rtl::OUString& sPropType,
- const uno::Any& aPropValue,
- sal_Bool bProtected);
- ~OOProperty(){};
-
- const rtl::OUString& getType(){return mPropType;}
- uno::Any getValue(){return mPropValue;}
- sal_Bool isProtected(){return mbProtected;}
- OOProperty* asOOProperty(){return this;}
-
-private:
- rtl::OUString mPropType;
- uno::Any mPropValue;
- sal_Bool mbProtected;
-};
-//------------------------------------------------------------------------------
-
-
-} } // configmgr.backendhelper
-
-#endif // CONFIGMGR_BACKENDHELPER_BACKENDLAYERHELPER_HXX_
-
-
diff --git a/configmgr/source/backendhelper/behelper.uno.xml b/configmgr/source/backendhelper/behelper.uno.xml
deleted file mode 100644
index 18bf50766b..0000000000
--- a/configmgr/source/backendhelper/behelper.uno.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module-description PUBLIC "-//StarOffice/DTD ComponentDescription 1.0//EN" "module-description.dtd">
-<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
- <module-name>behelper.uno</module-name>
- <component-description>
- <author>Sarah Smith</author>
- <name>com.sun.star.comp.configuration.backend.LayerDescriber</name>
- <description>Describes the contents of a Layer to an XLayerHandler object. The contents of the layer
-is contained in a sequence of PropertyInfo structs</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language>C++</language>
- <status value="final"/>
- <supported-services>com.sun.star.configuration.backend.LayerDescriber</supported-services>
- <type>com.sun.star.configuration.backend.XLayerContentDescriber</type>
- <type>com.sun.star.lang.XServiceInfo</type>
- <type>com.sun.star.lang.XSingleServiceFactory</type>
- <type>com.sun.star.lang.XSingleComponentFactory</type>
- <type>com.sun.star.lang.XTypeProvider</type>
- <type>com.sun.star.registry.XRegistryKey</type>
- <type>com.sun.star.uno.Any</type>
- <type>com.sun.star.uno.Sequence</type>
- </component-description>
- <project-build-dependency> comphelper </project-build-dependency>
- <project-build-dependency> vos </project-build-dependency>
- <project-build-dependency> cppuhelper </project-build-dependency>
- <project-build-dependency> salhelper </project-build-dependency>
- <project-build-dependency> cppu </project-build-dependency>
- <project-build-dependency> sal </project-build-dependency>
- <runtime-module-dependency> comphelp2$(COM) </runtime-module-dependency>
- <runtime-module-dependency> vos2$(COM) </runtime-module-dependency>
- <runtime-module-dependency> cppuhelper3$(COM) </runtime-module-dependency>
- <runtime-module-dependency> salhelper3$(COM) </runtime-module-dependency>
- <runtime-module-dependency> cppu3 </runtime-module-dependency>
- <runtime-module-dependency> sal3 </runtime-module-dependency>
-</module-description>
diff --git a/configmgr/source/backendhelper/componentdf.cxx b/configmgr/source/backendhelper/componentdf.cxx
deleted file mode 100644
index e671929a6d..0000000000
--- a/configmgr/source/backendhelper/componentdf.cxx
+++ /dev/null
@@ -1,88 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include "backendlayerhelper.hxx"
-#include <com/sun/star/registry/XRegistryKey.hpp>
-#ifndef _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_
-#include <cppuhelper/implementationentry.hxx>
-#endif // _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_
-
-//==============================================================================
-
-static com::sun::star::uno::Reference<com::sun::star::uno::XInterface> SAL_CALL createBackendLayerHelper(
- const com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext>& aContext) {
- return * new configmgr::backendhelper::BackendLayerHelper(aContext) ;
-}
-//==============================================================================
-
-//------------------------------------------------------------------------------
-
-static const cppu::ImplementationEntry kImplementations_entries[] =
-{
- {
- createBackendLayerHelper,
- configmgr::backendhelper::BackendLayerHelper::getBackendLayerHelperName,
- configmgr::backendhelper::BackendLayerHelper::getBackendLayerHelperServiceNames,
- cppu::createSingleComponentFactory,
- NULL,
- 0
- },
- { NULL, NULL, NULL, NULL, NULL, 0 }
-} ;
-//------------------------------------------------------------------------------
-
-extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL
-component_getImplementationEnvironment(
- const sal_Char **ppEnvTypeName,
- uno_Environment ** /* ppEnv */
- )
-{
- *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ;
-}
-//------------------------------------------------------------------------------
-
-extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- void *aServiceManager, void *aRegistryKey)
-{
- return cppu::component_writeInfoHelper(aServiceManager,
- aRegistryKey,
- kImplementations_entries) ;
-}
-//------------------------------------------------------------------------------
-
-extern "C" SAL_DLLPUBLIC_EXPORT void *component_getFactory(
- const sal_Char *aImplementationName, void *aServiceManager,
- void *aRegistryKey)
-{
- return cppu::component_getFactoryHelper(aImplementationName,
- aServiceManager,
- aRegistryKey,
- kImplementations_entries) ;
-}
-//------------------------------------------------------------------------------
diff --git a/configmgr/source/backendhelper/exports.dxp b/configmgr/source/backendhelper/exports.dxp
deleted file mode 100644
index 9630d7e067..0000000000
--- a/configmgr/source/backendhelper/exports.dxp
+++ /dev/null
@@ -1,3 +0,0 @@
-component_getImplementationEnvironment
-component_writeInfo
-component_getFactory
diff --git a/configmgr/source/backendhelper/makefile.mk b/configmgr/source/backendhelper/makefile.mk
deleted file mode 100644
index 5559d0ef01..0000000000
--- a/configmgr/source/backendhelper/makefile.mk
+++ /dev/null
@@ -1,69 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJINC=$(PRJ)$/source
-PRJNAME=configmgr
-TARGET=behelper
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings ---
-
-.INCLUDE : settings.mk
-.IF "$(L10N_framework)"==""
-.INCLUDE : $(PRJ)$/makefile.pmk
-DLLPRE =
-
-# --- Files ---
-
-
-SLOFILES=\
- $(SLO)$/backendlayerhelper.obj \
- $(SLO)$/componentdf.obj
-
-LIB1TARGET=$(SLB)$/_$(TARGET).lib
-LIB1OBJFILES=$(SLOFILES)
-
-SHL1TARGET=$(TARGET).uno
-SHL1DEF=$(MISC)$/$(SHL1TARGET).def
-SHL1LIBS=$(LIB1TARGET)
-SHL1IMPLIB=i$(SHL1TARGET)
-SHL1STDLIBS= \
- $(CPPUHELPERLIB) \
- $(CPPULIB) \
- $(SALLIB)
-
-DEF1NAME=$(SHL1TARGET)
-DEF1EXPORTFILE=exports.dxp
-DEF1DES=Configuration: Backend Helper
-
-# --- Targets ---
-.ENDIF # L10N_framework
-
-.INCLUDE : target.mk
-
diff --git a/configmgr/source/broadcaster.cxx b/configmgr/source/broadcaster.cxx
new file mode 100644
index 0000000000..bb77039dcc
--- /dev/null
+++ b/configmgr/source/broadcaster.cxx
@@ -0,0 +1,237 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include "com/sun/star/beans/XPropertiesChangeListener.hpp"
+#include "com/sun/star/beans/XPropertyChangeListener.hpp"
+#include "com/sun/star/container/XContainerListener.hpp"
+#include "com/sun/star/lang/DisposedException.hpp"
+#include "com/sun/star/lang/XEventListener.hpp"
+#include "com/sun/star/uno/Exception.hpp"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "com/sun/star/util/XChangesListener.hpp"
+#include "osl/diagnose.hxx"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+
+#include "broadcaster.hxx"
+
+namespace configmgr {
+
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
+void Broadcaster::addDisposeNotification(
+ css::uno::Reference< css::lang::XEventListener > const & listener,
+ css::lang::EventObject const & event)
+{
+ disposeNotifications_.push_back(DisposeNotification(listener, event));
+}
+
+void Broadcaster::addContainerElementReplacedNotification(
+ css::uno::Reference< css::container::XContainerListener > const & listener,
+ css::container::ContainerEvent const & event)
+{
+ containerElementReplacedNotifications_.push_back(
+ ContainerNotification(listener, event));
+}
+
+void Broadcaster::addContainerElementInsertedNotification(
+ css::uno::Reference< css::container::XContainerListener > const & listener,
+ css::container::ContainerEvent const & event)
+{
+ containerElementInsertedNotifications_.push_back(
+ ContainerNotification(listener, event));
+}
+
+void Broadcaster::addContainerElementRemovedNotification(
+ css::uno::Reference< css::container::XContainerListener > const & listener,
+ css::container::ContainerEvent const & event)
+{
+ containerElementRemovedNotifications_.push_back(
+ ContainerNotification(listener, event));
+}
+
+void Broadcaster::addPropertyChangeNotification(
+ css::uno::Reference< css::beans::XPropertyChangeListener > const & listener,
+ css::beans::PropertyChangeEvent const & event)
+{
+ propertyChangeNotifications_.push_back(
+ PropertyChangeNotification(listener, event));
+}
+
+void Broadcaster::addPropertiesChangeNotification(
+ css::uno::Reference< css::beans::XPropertiesChangeListener > const &
+ listener,
+ css::uno::Sequence< css::beans::PropertyChangeEvent > const & event)
+{
+ propertiesChangeNotifications_.push_back(
+ PropertiesChangeNotification(listener, event));
+}
+
+void Broadcaster::addChangesNotification(
+ css::uno::Reference< css::util::XChangesListener > const & listener,
+ css::util::ChangesEvent const & event)
+{
+ changesNotifications_.push_back(ChangesNotification(listener, event));
+}
+
+void Broadcaster::send() {
+ bool exception = false;
+ for (DisposeNotifications::iterator i(disposeNotifications_.begin());
+ i != disposeNotifications_.end(); ++i) {
+ try {
+ i->listener->disposing(i->event);
+ } catch (css::lang::DisposedException &) {
+ } catch (css::uno::Exception &) {
+ exception = true;
+ }
+ }
+ for (ContainerNotifications::iterator i(
+ containerElementInsertedNotifications_.begin());
+ i != containerElementInsertedNotifications_.end(); ++i)
+ {
+ try {
+ i->listener->elementInserted(i->event);
+ } catch (css::lang::DisposedException &) {
+ } catch (css::uno::Exception &) {
+ exception = true;
+ }
+ }
+ for (ContainerNotifications::iterator i(
+ containerElementRemovedNotifications_.begin());
+ i != containerElementRemovedNotifications_.end(); ++i)
+ {
+ try {
+ i->listener->elementRemoved(i->event);
+ } catch (css::lang::DisposedException &) {
+ } catch (css::uno::Exception &) {
+ exception = true;
+ }
+ }
+ for (ContainerNotifications::iterator i(
+ containerElementReplacedNotifications_.begin());
+ i != containerElementReplacedNotifications_.end(); ++i)
+ {
+ try {
+ i->listener->elementReplaced(i->event);
+ } catch (css::lang::DisposedException &) {
+ } catch (css::uno::Exception &) {
+ exception = true;
+ }
+ }
+ for (PropertyChangeNotifications::iterator i(
+ propertyChangeNotifications_.begin());
+ i != propertyChangeNotifications_.end(); ++i)
+ {
+ try {
+ i->listener->propertyChange(i->event);
+ } catch (css::lang::DisposedException &) {
+ } catch (css::uno::Exception &) {
+ exception = true;
+ }
+ }
+ for (PropertiesChangeNotifications::iterator i(
+ propertiesChangeNotifications_.begin());
+ i != propertiesChangeNotifications_.end(); ++i)
+ {
+ try {
+ i->listener->propertiesChange(i->event);
+ } catch (css::lang::DisposedException &) {
+ } catch (css::uno::Exception &) {
+ exception = true;
+ }
+ }
+ for (ChangesNotifications::iterator i(changesNotifications_.begin());
+ i != changesNotifications_.end(); ++i) {
+ try {
+ i->listener->changesOccurred(i->event);
+ } catch (css::lang::DisposedException &) {
+ } catch (css::uno::Exception &) {
+ exception = true;
+ }
+ }
+ if (exception) { //TODO
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr exceptions during listener notification")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+}
+
+Broadcaster::DisposeNotification::DisposeNotification(
+ css::uno::Reference< css::lang::XEventListener > const & theListener,
+ css::lang::EventObject const & theEvent):
+ listener(theListener), event(theEvent)
+{
+ OSL_ASSERT(theListener.is());
+}
+
+Broadcaster::ContainerNotification::ContainerNotification(
+ css::uno::Reference< css::container::XContainerListener > const &
+ theListener,
+ css::container::ContainerEvent const & theEvent):
+ listener(theListener), event(theEvent)
+{
+ OSL_ASSERT(theListener.is());
+}
+
+Broadcaster::PropertyChangeNotification::PropertyChangeNotification(
+ css::uno::Reference< css::beans::XPropertyChangeListener > const &
+ theListener,
+ css::beans::PropertyChangeEvent const & theEvent):
+ listener(theListener), event(theEvent)
+{
+ OSL_ASSERT(theListener.is());
+}
+
+Broadcaster::PropertiesChangeNotification::PropertiesChangeNotification(
+ css::uno::Reference< css::beans::XPropertiesChangeListener > const &
+ theListener,
+ css::uno::Sequence< css::beans::PropertyChangeEvent > const & theEvent):
+ listener(theListener), event(theEvent)
+{
+ OSL_ASSERT(theListener.is());
+}
+
+Broadcaster::ChangesNotification::ChangesNotification(
+ css::uno::Reference< css::util::XChangesListener > const & theListener,
+ css::util::ChangesEvent const & theEvent):
+ listener(theListener), event(theEvent)
+{
+ OSL_ASSERT(theListener.is());
+}
+
+}
diff --git a/configmgr/source/broadcaster.hxx b/configmgr/source/broadcaster.hxx
new file mode 100644
index 0000000000..95c4b1fac4
--- /dev/null
+++ b/configmgr/source/broadcaster.hxx
@@ -0,0 +1,181 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_BROADCASTER_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_BROADCASTER_HXX
+
+#include "sal/config.h"
+
+#include <vector>
+
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/beans/PropertyChangeEvent.hpp"
+#include "com/sun/star/container/ContainerEvent.hpp"
+#include "com/sun/star/lang/EventObject.hpp"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "com/sun/star/util/ChangesEvent.hpp"
+
+namespace com { namespace sun { namespace star {
+ namespace beans {
+ class XPropertiesChangeListener;
+ class XPropertyChangeListener;
+ }
+ namespace container { class XContainerListener; }
+ namespace lang { class XEventListener; }
+ namespace util { class XChangesListener; }
+} } }
+
+namespace configmgr {
+
+class Access;
+
+class Broadcaster: private boost::noncopyable {
+public:
+ void addDisposeNotification(
+ com::sun::star::uno::Reference< com::sun::star::lang::XEventListener >
+ const & listener,
+ com::sun::star::lang::EventObject const & event);
+
+ void addContainerElementInsertedNotification(
+ com::sun::star::uno::Reference<
+ com::sun::star::container::XContainerListener > const & listener,
+ com::sun::star::container::ContainerEvent const & event);
+
+ void addContainerElementRemovedNotification(
+ com::sun::star::uno::Reference<
+ com::sun::star::container::XContainerListener > const & listener,
+ com::sun::star::container::ContainerEvent const & event);
+
+ void addContainerElementReplacedNotification(
+ com::sun::star::uno::Reference<
+ com::sun::star::container::XContainerListener > const & listener,
+ com::sun::star::container::ContainerEvent const & event);
+
+ void addPropertyChangeNotification(
+ com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertyChangeListener > const & listener,
+ com::sun::star::beans::PropertyChangeEvent const & event);
+
+ void addPropertiesChangeNotification(
+ com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertiesChangeListener > const & listener,
+ com::sun::star::uno::Sequence<
+ com::sun::star::beans::PropertyChangeEvent > const & event);
+
+ void addChangesNotification(
+ com::sun::star::uno::Reference< com::sun::star::util::XChangesListener >
+ const & listener,
+ com::sun::star::util::ChangesEvent const & event);
+
+ void send();
+
+private:
+ struct DisposeNotification {
+ com::sun::star::uno::Reference< com::sun::star::lang::XEventListener >
+ listener;
+ com::sun::star::lang::EventObject event;
+
+ DisposeNotification(
+ com::sun::star::uno::Reference<
+ com::sun::star::lang::XEventListener > const & theListener,
+ com::sun::star::lang::EventObject const & theEvent);
+ };
+
+ struct ContainerNotification {
+ com::sun::star::uno::Reference<
+ com::sun::star::container::XContainerListener > listener;
+ com::sun::star::container::ContainerEvent event;
+
+ ContainerNotification(
+ com::sun::star::uno::Reference<
+ com::sun::star::container::XContainerListener > const &
+ theListener,
+ com::sun::star::container::ContainerEvent const & theEvent);
+ };
+
+ struct PropertyChangeNotification {
+ com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertyChangeListener > listener;
+ com::sun::star::beans::PropertyChangeEvent event;
+
+ PropertyChangeNotification(
+ com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertyChangeListener > const &
+ theListener,
+ com::sun::star::beans::PropertyChangeEvent const & theEvent);
+ };
+
+ struct PropertiesChangeNotification {
+ com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertiesChangeListener > listener;
+ com::sun::star::uno::Sequence<
+ com::sun::star::beans::PropertyChangeEvent > event;
+
+ PropertiesChangeNotification(
+ com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertiesChangeListener > const &
+ theListener,
+ com::sun::star::uno::Sequence<
+ com::sun::star::beans::PropertyChangeEvent > const & theEvent);
+ };
+
+ struct ChangesNotification {
+ com::sun::star::uno::Reference< com::sun::star::util::XChangesListener >
+ listener;
+ com::sun::star::util::ChangesEvent event;
+
+ ChangesNotification(
+ com::sun::star::uno::Reference<
+ com::sun::star::util::XChangesListener > const & theListener,
+ com::sun::star::util::ChangesEvent const & theEvent);
+ };
+
+ typedef std::vector< DisposeNotification > DisposeNotifications;
+
+ typedef std::vector< ContainerNotification > ContainerNotifications;
+
+ typedef std::vector< PropertyChangeNotification >
+ PropertyChangeNotifications;
+
+ typedef std::vector< PropertiesChangeNotification >
+ PropertiesChangeNotifications;
+
+ typedef std::vector< ChangesNotification > ChangesNotifications;
+
+ DisposeNotifications disposeNotifications_;
+ ContainerNotifications containerElementInsertedNotifications_;
+ ContainerNotifications containerElementRemovedNotifications_;
+ ContainerNotifications containerElementReplacedNotifications_;
+ PropertyChangeNotifications propertyChangeNotifications_;
+ PropertiesChangeNotifications propertiesChangeNotifications_;
+ ChangesNotifications changesNotifications_;
+};
+
+}
+
+#endif
diff --git a/configmgr/source/childaccess.cxx b/configmgr/source/childaccess.cxx
new file mode 100644
index 0000000000..ef2b213d4e
--- /dev/null
+++ b/configmgr/source/childaccess.cxx
@@ -0,0 +1,391 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include <vector>
+
+#include "com/sun/star/container/XChild.hpp"
+#include "com/sun/star/lang/NoSupportException.hpp"
+#include "com/sun/star/lang/XUnoTunnel.hpp"
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "com/sun/star/uno/Type.hxx"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "cppu/unotype.hxx"
+#include "cppuhelper/queryinterface.hxx"
+#include "cppuhelper/weak.hxx"
+#include "osl/diagnose.h"
+#include "osl/mutex.hxx"
+#include "rtl/ref.hxx"
+#include "rtl/string.h"
+#include "rtl/ustrbuf.hxx"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "rtl/uuid.h"
+#include "sal/types.h"
+
+#include "access.hxx"
+#include "childaccess.hxx"
+#include "components.hxx"
+#include "data.hxx"
+#include "groupnode.hxx"
+#include "localizedpropertynode.hxx"
+#include "localizedvaluenode.hxx"
+#include "lock.hxx"
+#include "modifications.hxx"
+#include "node.hxx"
+#include "path.hxx"
+#include "propertynode.hxx"
+#include "rootaccess.hxx"
+#include "setnode.hxx"
+#include "type.hxx"
+
+namespace configmgr {
+
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
+css::uno::Sequence< sal_Int8 > ChildAccess::getTunnelId() {
+ static css::uno::Sequence< sal_Int8 > id;
+ if (id.getLength() == 0) {
+ css::uno::Sequence< sal_Int8 > uuid(16);
+ rtl_createUuid(
+ reinterpret_cast< sal_uInt8 * >(uuid.getArray()), 0, false);
+ id = uuid;
+ }
+ return id;
+}
+
+ChildAccess::ChildAccess(
+ Components & components, rtl::Reference< RootAccess > const & root,
+ rtl::Reference< Access > const & parent, rtl::OUString const & name,
+ rtl::Reference< Node > const & node):
+ Access(components), root_(root), parent_(parent), name_(name), node_(node),
+ inTransaction_(false)
+{
+ OSL_ASSERT(root.is() && parent.is() && node.is());
+}
+
+ChildAccess::ChildAccess(
+ Components & components, rtl::Reference< RootAccess > const & root,
+ rtl::Reference< Node > const & node):
+ Access(components), root_(root), node_(node), inTransaction_(false)
+{
+ OSL_ASSERT(root.is() && node.is());
+}
+
+Path ChildAccess::getAbsolutePath() {
+ OSL_ASSERT(getParentAccess().is());
+ Path path(getParentAccess()->getAbsolutePath());
+ path.push_back(name_);
+ return path;
+}
+
+Path ChildAccess::getRelativePath() {
+ Path path;
+ rtl::Reference< Access > parent(getParentAccess());
+ if (parent.is()) {
+ path = parent->getRelativePath();
+ }
+ path.push_back(name_);
+ return path;
+}
+
+rtl::OUString ChildAccess::getRelativePathRepresentation() {
+ rtl::OUStringBuffer path;
+ rtl::Reference< Access > parent(getParentAccess());
+ if (parent.is()) {
+ path.append(parent->getRelativePathRepresentation());
+ if (path.getLength() != 0) {
+ path.append(sal_Unicode('/'));
+ }
+ }
+ path.append(Data::createSegment(node_->getTemplateName(), name_));
+ return path.makeStringAndClear();
+}
+
+rtl::Reference< Node > ChildAccess::getNode() {
+ return node_;
+}
+
+bool ChildAccess::isFinalized() {
+ return node_->getFinalized() != Data::NO_LAYER ||
+ (parent_.is() && parent_->isFinalized());
+}
+
+rtl::OUString ChildAccess::getNameInternal() {
+ return name_;
+}
+
+rtl::Reference< RootAccess > ChildAccess::getRootAccess() {
+ return root_;
+}
+
+rtl::Reference< Access > ChildAccess::getParentAccess() {
+ return parent_;
+}
+
+void ChildAccess::acquire() throw () {
+ Access::acquire();
+}
+
+void ChildAccess::release() throw () {
+ Access::release();
+}
+
+css::uno::Reference< css::uno::XInterface > ChildAccess::getParent()
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ return static_cast< cppu::OWeakObject * >(parent_.get());
+}
+
+void ChildAccess::setParent(css::uno::Reference< css::uno::XInterface > const &)
+ throw (css::lang::NoSupportException, css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ throw css::lang::NoSupportException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("setParent")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+sal_Int64 ChildAccess::getSomething(
+ css::uno::Sequence< sal_Int8 > const & aIdentifier)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ return aIdentifier == getTunnelId()
+ ? reinterpret_cast< sal_Int64 >(this) : 0;
+}
+
+void ChildAccess::bind(
+ rtl::Reference< RootAccess > const & root,
+ rtl::Reference< Access > const & parent, rtl::OUString const & name)
+ throw ()
+{
+ OSL_ASSERT(
+ !parent_.is() && root.is() && parent.is() && name.getLength() != 0);
+ root_ = root;
+ parent_ = parent;
+ name_ = name;
+}
+
+void ChildAccess::unbind() throw () {
+ OSL_ASSERT(parent_.is());
+ parent_->releaseChild(name_);
+ parent_.clear();
+ inTransaction_ = true;
+}
+
+void ChildAccess::committed() {
+ inTransaction_ = false;
+}
+
+void ChildAccess::setNode(rtl::Reference< Node > const & node) {
+ node_ = node;
+}
+
+void ChildAccess::setProperty(
+ css::uno::Any const & value, Modifications * localModifications)
+{
+ OSL_ASSERT(localModifications != 0);
+ Type type = TYPE_ERROR;
+ bool nillable = false;
+ switch (node_->kind()) {
+ case Node::KIND_PROPERTY:
+ {
+ PropertyNode * prop = dynamic_cast< PropertyNode * >(node_.get());
+ type = prop->getStaticType();
+ nillable = prop->isNillable();
+ }
+ break;
+ case Node::KIND_LOCALIZED_PROPERTY:
+ {
+ rtl::OUString locale(getRootAccess()->getLocale());
+ if (!Components::allLocales(locale)) {
+ rtl::Reference< ChildAccess > child(getChild(locale));
+ if (child.is()) {
+ child->setProperty(value, localModifications);
+ } else {
+ insertLocalizedValueChild(
+ locale, value, localModifications);
+ }
+ return;
+ }
+ }
+ break;
+ case Node::KIND_LOCALIZED_VALUE:
+ {
+ LocalizedPropertyNode * locprop =
+ dynamic_cast< LocalizedPropertyNode * >(getParentNode().get());
+ type = locprop->getStaticType();
+ nillable = locprop->isNillable();
+ }
+ break;
+ default:
+ break;
+ }
+ checkValue(value, type, nillable);
+ getParentAccess()->markChildAsModified(this);
+ changedValue_.reset(new css::uno::Any(value));
+ localModifications->add(getRelativePath());
+}
+
+css::uno::Any ChildAccess::asValue() {
+ if (changedValue_.get() != 0) {
+ return *changedValue_;
+ }
+ switch (node_->kind()) {
+ case Node::KIND_PROPERTY:
+ return dynamic_cast< PropertyNode * >(node_.get())->getValue(
+ getComponents());
+ case Node::KIND_LOCALIZED_PROPERTY:
+ {
+ rtl::OUString locale(getRootAccess()->getLocale());
+ if (!Components::allLocales(locale)) {
+ // Find best match using an adaption of RFC 4647 lookup matching
+ // rules, removing "-" or "_" delimited segments from the end;
+ // defaults are the empty string locale, the "en-US" locale, the
+ // first child (if any), or a nil value (even though it may be
+ // illegal for the given property), in that order:
+ rtl::Reference< ChildAccess > child;
+ for (;;) {
+ child = getChild(locale);
+ if (child.is() || locale.getLength() == 0) {
+ break;
+ }
+ sal_Int32 i = locale.getLength() - 1;
+ while (i > 0 && locale[i] != '-' && locale[i] != '_') {
+ --i;
+ }
+ locale = locale.copy(0, i);
+ }
+ if (!child.is()) {
+ child = getChild(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("en-US")));
+ if (!child.is()) {
+ std::vector< rtl::Reference< ChildAccess > > all(
+ getAllChildren());
+ if (!all.empty()) {
+ child = all.front();
+ }
+ }
+ }
+ return child.is() ? child->asValue() : css::uno::Any();
+ }
+ }
+ break;
+ case Node::KIND_LOCALIZED_VALUE:
+ return dynamic_cast< LocalizedValueNode * >(node_.get())->getValue();
+ default:
+ break;
+ }
+ return css::uno::makeAny(
+ css::uno::Reference< css::uno::XInterface >(
+ static_cast< cppu::OWeakObject * >(this)));
+}
+
+void ChildAccess::commitChanges(bool valid, Modifications * globalModifications)
+{
+ OSL_ASSERT(globalModifications != 0);
+ commitChildChanges(valid, globalModifications);
+ if (valid && changedValue_.get() != 0) {
+ Path path(getAbsolutePath());
+ getComponents().addModification(path);
+ globalModifications->add(path);
+ switch (node_->kind()) {
+ case Node::KIND_PROPERTY:
+ dynamic_cast< PropertyNode * >(node_.get())->setValue(
+ Data::NO_LAYER, *changedValue_);
+ break;
+ case Node::KIND_LOCALIZED_VALUE:
+ dynamic_cast< LocalizedValueNode * >(node_.get())->setValue(
+ Data::NO_LAYER, *changedValue_);
+ break;
+ default:
+ OSL_ASSERT(false); // this cannot happen
+ break;
+ }
+ }
+ changedValue_.reset();
+}
+
+ChildAccess::~ChildAccess() {
+ osl::MutexGuard g(lock);
+ if (parent_.is()) {
+ parent_->releaseChild(name_);
+ }
+}
+
+void ChildAccess::addTypes(std::vector< css::uno::Type > * types) const {
+ OSL_ASSERT(types != 0);
+ types->push_back(cppu::UnoType< css::container::XChild >::get());
+ types->push_back(cppu::UnoType< css::lang::XUnoTunnel >::get());
+}
+
+void ChildAccess::addSupportedServiceNames(
+ std::vector< rtl::OUString > * services)
+{
+ OSL_ASSERT(services != 0);
+ services->push_back(
+ getParentNode()->kind() == Node::KIND_GROUP
+ ? rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.GroupElement"))
+ : rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.SetElement")));
+}
+
+css::uno::Any ChildAccess::queryInterface(css::uno::Type const & aType)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ css::uno::Any res(Access::queryInterface(aType));
+ return res.hasValue()
+ ? res
+ : cppu::queryInterface(
+ aType, static_cast< css::container::XChild * >(this),
+ static_cast< css::lang::XUnoTunnel * >(this));
+}
+
+}
diff --git a/configmgr/source/childaccess.hxx b/configmgr/source/childaccess.hxx
new file mode 100644
index 0000000000..c1cb148969
--- /dev/null
+++ b/configmgr/source/childaccess.hxx
@@ -0,0 +1,157 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_CHILDACCESS_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_CHILDACCESS_HXX
+
+#include "sal/config.h"
+
+#include <memory>
+#include <vector>
+
+#include "com/sun/star/container/XChild.hpp"
+#include "com/sun/star/lang/NoSupportException.hpp"
+#include "com/sun/star/lang/XUnoTunnel.hpp"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "rtl/ref.hxx"
+#include "sal/types.h"
+
+#include "access.hxx"
+#include "path.hxx"
+
+namespace com { namespace sun { namespace star { namespace uno {
+ class Any;
+ class Type;
+ class XInterface;
+} } } }
+
+namespace configmgr {
+
+class Components;
+class Modifications;
+class Node;
+class RootAccess;
+
+class ChildAccess:
+ public Access, public com::sun::star::container::XChild,
+ public com::sun::star::lang::XUnoTunnel
+{
+public:
+ static com::sun::star::uno::Sequence< sal_Int8 > getTunnelId();
+
+ ChildAccess(
+ Components & components, rtl::Reference< RootAccess > const & root,
+ rtl::Reference< Access > const & parent, rtl::OUString const & name,
+ rtl::Reference< Node > const & node);
+
+ ChildAccess(
+ Components & components, rtl::Reference< RootAccess > const & root,
+ rtl::Reference< Node > const & node);
+
+ virtual Path getAbsolutePath();
+
+ virtual Path getRelativePath();
+
+ virtual rtl::OUString getRelativePathRepresentation();
+
+ virtual rtl::Reference< Node > getNode();
+
+ virtual bool isFinalized();
+
+ virtual rtl::OUString getNameInternal();
+
+ virtual rtl::Reference< RootAccess > getRootAccess();
+
+ virtual rtl::Reference< Access > getParentAccess();
+
+ virtual void SAL_CALL acquire() throw ();
+
+ virtual void SAL_CALL release() throw ();
+
+ virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
+ SAL_CALL getParent()
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL setParent(
+ com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
+ const &)
+ throw (
+ com::sun::star::lang::NoSupportException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual sal_Int64 SAL_CALL getSomething(
+ com::sun::star::uno::Sequence< sal_Int8 > const & aIdentifier)
+ throw (com::sun::star::uno::RuntimeException);
+
+ void bind(
+ rtl::Reference< RootAccess > const & root,
+ rtl::Reference< Access > const & parent, rtl::OUString const & name)
+ throw ();
+
+ void unbind() throw ();
+
+ bool isInTransaction() const { return inTransaction_; }
+
+ void committed();
+
+ void setNode(rtl::Reference< Node > const & node);
+
+ void setProperty(
+ com::sun::star::uno::Any const & value,
+ Modifications * localModifications);
+
+ com::sun::star::uno::Any asValue();
+
+ void commitChanges(bool valid, Modifications * globalModifications);
+
+private:
+ virtual ~ChildAccess();
+
+ virtual void addTypes(
+ std::vector< com::sun::star::uno::Type > * types) const;
+
+ virtual void addSupportedServiceNames(
+ std::vector< rtl::OUString > * services);
+
+ virtual com::sun::star::uno::Any SAL_CALL queryInterface(
+ com::sun::star::uno::Type const & aType)
+ throw (com::sun::star::uno::RuntimeException);
+
+ rtl::Reference< RootAccess > root_;
+ rtl::Reference< Access > parent_; // null iff free node
+ rtl::OUString name_;
+ rtl::Reference< Node > node_;
+ std::auto_ptr< com::sun::star::uno::Any > changedValue_;
+ bool inTransaction_;
+ // to determine if a free node can be inserted underneath some root
+};
+
+}
+
+#endif
diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx
new file mode 100644
index 0000000000..51a1a6547d
--- /dev/null
+++ b/configmgr/source/components.cxx
@@ -0,0 +1,652 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include <algorithm>
+#include <list>
+
+#include "com/sun/star/beans/Optional.hpp"
+#include "com/sun/star/beans/UnknownPropertyException.hpp"
+#include "com/sun/star/beans/XPropertySet.hpp"
+#include "com/sun/star/container/NoSuchElementException.hpp"
+#include "com/sun/star/lang/WrappedTargetException.hpp"
+#include "com/sun/star/lang/XMultiComponentFactory.hpp"
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/Exception.hpp"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "osl/diagnose.h"
+#include "osl/file.hxx"
+#include "rtl/bootstrap.hxx"
+#include "rtl/ref.hxx"
+#include "rtl/string.h"
+#include "rtl/textenc.h"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+
+#include "components.hxx"
+#include "data.hxx"
+#include "modifications.hxx"
+#include "node.hxx"
+#include "parsemanager.hxx"
+#include "rootaccess.hxx"
+#include "writemodfile.hxx"
+#include "xcdparser.hxx"
+#include "xcuparser.hxx"
+#include "xcsparser.hxx"
+
+namespace configmgr {
+
+namespace {
+
+namespace css = com::sun::star;
+
+struct UnresolvedListItem {
+ rtl::OUString name;
+ rtl::Reference< ParseManager > manager;
+
+ UnresolvedListItem(
+ rtl::OUString const & theName,
+ rtl::Reference< ParseManager > theManager):
+ name(theName), manager(theManager) {}
+};
+
+typedef std::list< UnresolvedListItem > UnresolvedList;
+
+void parseXcsFile(rtl::OUString const & url, int layer, Data * data,
+ Modifications * modifications)
+ SAL_THROW((
+ css::container::NoSuchElementException, css::uno::RuntimeException))
+{
+ OSL_ASSERT(modifications == 0); (void) modifications;
+ OSL_VERIFY(
+ rtl::Reference< ParseManager >(
+ new ParseManager(url, new XcsParser(layer, data)))->parse());
+}
+
+void parseXcuFile(
+ rtl::OUString const & url, int layer, Data * data,
+ Modifications * modifications)
+ SAL_THROW((
+ css::container::NoSuchElementException, css::uno::RuntimeException))
+{
+ OSL_VERIFY(
+ rtl::Reference< ParseManager >(
+ new ParseManager(url, new XcuParser(layer, data, modifications)))->
+ parse());
+}
+
+rtl::OUString expand(rtl::OUString const & str) {
+ rtl::OUString s(str);
+ rtl::Bootstrap::expandMacros(s); //TODO: detect failure
+ return s;
+}
+
+static bool singletonCreated = false;
+static Components * singleton; // leaks
+
+}
+
+void Components::initSingleton(
+ css::uno::Reference< css::uno::XComponentContext > const & context)
+{
+ OSL_ASSERT(context.is());
+ if (!singletonCreated) {
+ singletonCreated = true;
+ singleton = new Components(context);
+ }
+}
+
+Components & Components::getSingleton() {
+ OSL_ASSERT(singletonCreated);
+ if (singleton == 0) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "configmgr no Components singleton")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ return *singleton;
+}
+
+bool Components::allLocales(rtl::OUString const & locale) {
+ return locale.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("*"));
+}
+
+rtl::Reference< Node > Components::resolvePathRepresentation(
+ rtl::OUString const & pathRepresentation, Path * path,
+ int * finalizedLayer) const
+{
+ return data_.resolvePathRepresentation(
+ pathRepresentation, path, finalizedLayer);
+}
+
+rtl::Reference< Node > Components::getTemplate(
+ int layer, rtl::OUString const & fullName) const
+{
+ return data_.getTemplate(layer, fullName);
+}
+
+void Components::addRootAccess(rtl::Reference< RootAccess > const & access) {
+ roots_.insert(access.get());
+}
+
+void Components::removeRootAccess(RootAccess * access) {
+ roots_.erase(access);
+}
+
+void Components::initGlobalBroadcaster(
+ Modifications const & modifications,
+ rtl::Reference< RootAccess > const & exclude, Broadcaster * broadcaster)
+{
+ //TODO: Iterate only over roots w/ listeners:
+ for (WeakRootSet::iterator i(roots_.begin()); i != roots_.end(); ++i) {
+ rtl::Reference< RootAccess > root;
+ if ((*i)->acquireCounting() > 1) {
+ root.set(*i); // must not throw
+ }
+ (*i)->releaseNondeleting();
+ if (root.is()) {
+ if (root != exclude) {
+ Path path(root->getAbsolutePath());
+ Modifications::Node const * mods = &modifications.getRoot();
+ for (Path::iterator j(path.begin()); j != path.end(); ++j) {
+ Modifications::Node::Children::const_iterator k(
+ mods->children.find(*j));
+ if (k == mods->children.end()) {
+ mods = 0;
+ break;
+ }
+ mods = &k->second;
+ }
+ //TODO: If the complete tree of which root is a part is deleted,
+ // or replaced, mods will be null, but some of the listeners
+ // from within root should probably fire nonetheless:
+ if (mods != 0) {
+ root->initBroadcaster(*mods, broadcaster);
+ }
+ }
+ }
+ }
+}
+
+void Components::addModification(Path const & path) {
+ data_.modifications.add(path);
+}
+
+void Components::writeModifications() {
+ writeModFile(*this, getModificationFileUrl(), data_);
+}
+
+void Components::insertExtensionXcsFile(
+ bool shared, rtl::OUString const & fileUri)
+{
+ try {
+ parseXcsFile(fileUri, shared ? 9 : 13, &data_, 0);
+ } catch (css::container::NoSuchElementException & e) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "insertExtensionXcsFile does not exist: ")) +
+ e.Message),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+}
+
+void Components::insertExtensionXcuFile(
+ bool shared, rtl::OUString const & fileUri, Modifications * modifications)
+{
+ OSL_ASSERT(modifications != 0);
+ try {
+ parseXcuFile(fileUri, shared ? 10 : 14, &data_, modifications);
+ } catch (css::container::NoSuchElementException & e) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "insertExtensionXcuFile does not exist: ")) +
+ e.Message),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+}
+
+css::beans::Optional< css::uno::Any > Components::getExternalValue(
+ rtl::OUString const & descriptor)
+{
+ sal_Int32 i = descriptor.indexOf(' ');
+ if (i <= 0) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("bad external value descriptor ")) +
+ descriptor),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ //TODO: Do not make calls with mutex locked:
+ rtl::OUString name(descriptor.copy(0, i));
+ ExternalServices::iterator j(externalServices_.find(name));
+ if (j == externalServices_.end()) {
+ css::uno::Reference< css::uno::XInterface > service;
+ try {
+ service = css::uno::Reference< css::lang::XMultiComponentFactory >(
+ context_->getServiceManager(), css::uno::UNO_SET_THROW)->
+ createInstanceWithContext(name, context_);
+ } catch (css::uno::RuntimeException &) {
+ // Assuming these exceptions are real errors:
+ throw;
+ } catch (css::uno::Exception & e) {
+ // Assuming these exceptions indicate that the service is not
+ // installed:
+ OSL_TRACE(
+ "createInstance(%s) failed with %s",
+ rtl::OUStringToOString(name, RTL_TEXTENCODING_UTF8).getStr(),
+ rtl::OUStringToOString(
+ e.Message, RTL_TEXTENCODING_UTF8).getStr());
+ }
+ css::uno::Reference< css::beans::XPropertySet > propset;
+ if (service.is()) {
+ propset = css::uno::Reference< css::beans::XPropertySet >(
+ service, css::uno::UNO_QUERY_THROW);
+ }
+ j = externalServices_.insert(
+ ExternalServices::value_type(name, propset)).first;
+ }
+ css::beans::Optional< css::uno::Any > value;
+ if (j->second.is()) {
+ try {
+ if (!(j->second->getPropertyValue(descriptor.copy(i + 1)) >>=
+ value))
+ {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "cannot obtain external value through ")) +
+ descriptor),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ } catch (css::beans::UnknownPropertyException & e) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "unknwon external value descriptor ID: ")) +
+ e.Message),
+ css::uno::Reference< css::uno::XInterface >());
+ } catch (css::lang::WrappedTargetException & e) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "cannot obtain external value: ")) +
+ e.Message),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ }
+ return value;
+}
+
+Components::Components(
+ css::uno::Reference< css::uno::XComponentContext > const & context):
+ context_(context)
+{
+ OSL_ASSERT(context.is());
+/*SB*/try{
+ parseXcsXcuLayer(
+ 0,
+ expand(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("$OOO_BASE_DIR/share/registry"))));
+ parseModuleLayer(
+ 2,
+ expand(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "$OOO_BASE_DIR/share/registry/modules"))));
+ parseResLayer(
+ 3,
+ expand(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("$OOO_BASE_DIR/share/registry"))));
+ parseXcsXcuLayer(
+ 4,
+ expand(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "$BRAND_BASE_DIR/share/registry"))));
+ parseModuleLayer(
+ 6,
+ expand(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "$BRAND_BASE_DIR/share/registry/modules"))));
+ parseXcsXcuLayer( //TODO: migrate
+ 7,
+ expand(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "${$OOO_BASE_DIR/program/" SAL_CONFIGFILE("uno")
+ ":UNO_SHARED_PACKAGES_CACHE}/registry/"
+ "com.sun.star.comp.deployment.configuration."
+ "PackageRegistryBackend/registry"))));
+ parseXcsXcuIniLayer(
+ 9,
+ expand(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "${$OOO_BASE_DIR/program/" SAL_CONFIGFILE("uno")
+ ":UNO_SHARED_PACKAGES_CACHE}/registry/"
+ "com.sun.star.comp.deployment.configuration."
+ "PackageRegistryBackend/configmgr.ini"))));
+ parseXcsXcuLayer( //TODO: migrate
+ 11,
+ expand(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "${$OOO_BASE_DIR/program/" SAL_CONFIGFILE("uno")
+ ":UNO_USER_PACKAGES_CACHE}/registry/"
+ "com.sun.star.comp.deployment.configuration."
+ "PackageRegistryBackend/registry"))));
+ parseXcsXcuIniLayer(
+ 13,
+ expand(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "${$OOO_BASE_DIR/program/" SAL_CONFIGFILE("uno")
+ ":UNO_USER_PACKAGES_CACHE}/registry/"
+ "com.sun.star.comp.deployment.configuration."
+ "PackageRegistryBackend/configmgr.ini"))));
+/*SB*/}catch(css::uno::Exception&e){fprintf(stderr,"caught <%s>\n",rtl::OUStringToOString(e.Message,RTL_TEXTENCODING_UTF8).getStr());throw;}
+ try {
+ parseModificationLayer();
+ } catch (css::uno::Exception & e) { //TODO: more specific exception catching
+ // Silently ignore unreadable parts of a corrupted
+ // registrymodifications.xcu file, instead of completely preventing OOo
+ // from starting:
+ OSL_TRACE(
+ "configmgr error reading user modification layer: %s",
+ rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr());
+ }
+}
+
+Components::~Components() {}
+
+void Components::parseFiles(
+ int layer, rtl::OUString const & extension,
+ void (* parseFile)(rtl::OUString const &, int, Data *, Modifications *),
+ rtl::OUString const & url, bool recursive)
+{
+ osl::Directory dir(url);
+ switch (dir.open()) {
+ case osl::FileBase::E_None:
+ break;
+ case osl::FileBase::E_NOENT:
+ if (!recursive) {
+ return;
+ }
+ // fall through
+ default:
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("cannot open directory ")) +
+ url),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ for (;;) {
+ osl::DirectoryItem i;
+ osl::FileBase::RC rc = dir.getNextItem(i, SAL_MAX_UINT32);
+ if (rc == osl::FileBase::E_NOENT) {
+ break;
+ }
+ if (rc != osl::FileBase::E_None) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("cannot iterate directory ")) +
+ url),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ osl::FileStatus stat(
+ FileStatusMask_Type | FileStatusMask_FileName |
+ FileStatusMask_FileURL);
+ if (i.getFileStatus(stat) != osl::FileBase::E_None) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("cannot stat in directory ")) +
+ url),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ if (stat.getFileType() == osl::FileStatus::Directory) { //TODO: symlinks
+ parseFiles(layer, extension, parseFile, stat.getFileURL(), true);
+ } else {
+ rtl::OUString file(stat.getFileName());
+ if (file.getLength() >= extension.getLength() &&
+ file.match(extension, file.getLength() - extension.getLength()))
+ {
+ try {
+ (*parseFile)(stat.getFileURL(), layer, &data_, 0);
+ } catch (css::container::NoSuchElementException & e) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "stat'ed file does not exist: ")) +
+ e.Message),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ }
+ }
+ }
+}
+
+void Components::parseFileList(
+ int layer,
+ void (* parseFile)(rtl::OUString const &, int, Data *, Modifications *),
+ rtl::OUString const & urls, rtl::Bootstrap const & ini)
+{
+ for (sal_Int32 i = 0;;) {
+ rtl::OUString url(urls.getToken(0, ' ', i));
+ if (url.getLength() != 0) {
+ ini.expandMacrosFrom(url); //TODO: detect failure
+ try {
+ (*parseFile)(url, layer, &data_, 0);
+ } catch (css::container::NoSuchElementException & e) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "stat'ed file does not exist: ")) +
+ e.Message),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ }
+ if (i == -1) {
+ break;
+ }
+ }
+}
+
+void Components::parseXcdFiles(int layer, rtl::OUString const & url) {
+ osl::Directory dir(url);
+ switch (dir.open()) {
+ case osl::FileBase::E_None:
+ break;
+ case osl::FileBase::E_NOENT:
+ return;
+ default:
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("cannot open directory ")) +
+ url),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ UnresolvedList unres;
+ XcdParser::Dependencies deps;
+ for (;;) {
+ osl::DirectoryItem i;
+ osl::FileBase::RC rc = dir.getNextItem(i, SAL_MAX_UINT32);
+ if (rc == osl::FileBase::E_NOENT) {
+ break;
+ }
+ if (rc != osl::FileBase::E_None) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("cannot iterate directory ")) +
+ url),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ osl::FileStatus stat(
+ FileStatusMask_Type | FileStatusMask_FileName |
+ FileStatusMask_FileURL);
+ if (i.getFileStatus(stat) != osl::FileBase::E_None) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("cannot stat in directory ")) +
+ url),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ if (stat.getFileType() != osl::FileStatus::Directory) { //TODO: symlinks
+ rtl::OUString file(stat.getFileName());
+ if (file.getLength() >= RTL_CONSTASCII_LENGTH(".xcd") &&
+ file.matchAsciiL(
+ RTL_CONSTASCII_STRINGPARAM(".xcd"),
+ file.getLength() - RTL_CONSTASCII_LENGTH(".xcd")))
+ {
+ rtl::OUString name(
+ file.copy(
+ 0, file.getLength() - RTL_CONSTASCII_LENGTH(".xcd")));
+ rtl::Reference< ParseManager > manager;
+ try {
+ manager = new ParseManager(
+ stat.getFileURL(), new XcdParser(layer, deps, &data_));
+ } catch (css::container::NoSuchElementException & e) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "stat'ed file does not exist: ")) +
+ e.Message),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ if (manager->parse()) {
+ deps.insert(name);
+ } else {
+ unres.push_back(UnresolvedListItem(name, manager));
+ }
+ }
+ }
+ }
+ while (!unres.empty()) {
+ bool resolved = false;
+ for (UnresolvedList::iterator i(unres.begin()); i != unres.end();) {
+ if (i->manager->parse()) {
+ deps.insert(i->name);
+ unres.erase(i++);
+ resolved = true;
+ } else {
+ ++i;
+ }
+ }
+ if (!resolved) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "xcd: unresolved dependencies in ")) +
+ url),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ }
+}
+
+void Components::parseXcsXcuLayer(int layer, rtl::OUString const & url) {
+ parseXcdFiles(layer, url);
+ parseFiles(
+ layer, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".xcs")),
+ &parseXcsFile,
+ url + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/schema")), false);
+ parseFiles(
+ layer + 1, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".xcu")),
+ &parseXcuFile,
+ url + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/data")), false);
+}
+
+void Components::parseXcsXcuIniLayer(int layer, rtl::OUString const & url) {
+ //TODO: rtl::Bootstrap::getFrom "first trie[s] to retrieve the value via the
+ // global function"
+ rtl::Bootstrap ini(url);
+ rtl::OUString urls;
+ if (ini.getFrom(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SCHEMA")), urls))
+ {
+ parseFileList(layer, &parseXcsFile, urls, ini);
+ }
+ if (ini.getFrom(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DATA")), urls))
+ {
+ parseFileList(layer + 1, &parseXcuFile, urls, ini);
+ }
+}
+
+void Components::parseModuleLayer(int layer, rtl::OUString const & url) {
+ parseFiles(
+ layer, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".xcu")),
+ &parseXcuFile, url, false);
+}
+
+void Components::parseResLayer(int layer, rtl::OUString const & url) {
+ rtl::OUString resUrl(
+ url + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/res")));
+ parseXcdFiles(layer, resUrl);
+ parseFiles(
+ layer, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".xcu")),
+ &parseXcuFile, resUrl, false);
+}
+
+rtl::OUString Components::getModificationFileUrl() const {
+ return expand(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("bootstrap")
+ ":UserInstallation}/user/registrymodifications.xcu")));
+}
+
+void Components::parseModificationLayer() {
+ try {
+ parseXcuFile(getModificationFileUrl(), Data::NO_LAYER, &data_, 0);
+ } catch (css::container::NoSuchElementException &) {
+ OSL_TRACE(
+ "configmgr user registrymodifications.xcu does not (yet) exist");
+ // Migrate old user layer data (can be removed once migration is no
+ // longer relevant; also see hack for xsi namespace in XmlReader
+ // constructor):
+ parseFiles(
+ Data::NO_LAYER, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".xcu")),
+ &parseXcuFile,
+ expand(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("bootstrap")
+ ":UserInstallation}/user/registry/data"))),
+ false);
+ }
+}
+
+}
diff --git a/configmgr/source/components.hxx b/configmgr/source/components.hxx
new file mode 100644
index 0000000000..8523b02cbb
--- /dev/null
+++ b/configmgr/source/components.hxx
@@ -0,0 +1,151 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_COMPONENTS_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_COMPONENTS_HXX
+
+#include "sal/config.h"
+
+#include <map>
+#include <set>
+
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/beans/Optional.hpp"
+#include "com/sun/star/uno/Reference.hxx"
+#include "rtl/ref.hxx"
+
+#include "data.hxx"
+#include "path.hxx"
+
+namespace com { namespace sun { namespace star {
+ namespace beans { class XPropertySet; }
+ namespace uno {
+ class Any;
+ class XComponentContext;
+ }
+} } }
+namespace rtl {
+ class Bootstrap;
+ class OUString;
+}
+
+namespace configmgr {
+
+class Broadcaster;
+class Modifications;
+class Node;
+class RootAccess;
+
+class Components: private boost::noncopyable {
+public:
+ static void initSingleton(
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+ const & context);
+
+ static Components & getSingleton();
+
+ static bool allLocales(rtl::OUString const & locale);
+
+ rtl::Reference< Node > resolvePathRepresentation(
+ rtl::OUString const & pathRepresentation, Path * path,
+ int * finalizedLayer) const;
+
+ rtl::Reference< Node > getTemplate(
+ int layer, rtl::OUString const & fullName) const;
+
+ void addRootAccess(rtl::Reference< RootAccess > const & access);
+
+ void removeRootAccess(RootAccess * access);
+
+ void initGlobalBroadcaster(
+ Modifications const & modifications,
+ rtl::Reference< RootAccess > const & exclude,
+ Broadcaster * broadcaster);
+
+ void addModification(Path const & path);
+
+ void writeModifications();
+
+ void insertExtensionXcsFile(bool shared, rtl::OUString const & fileUri);
+
+ void insertExtensionXcuFile(
+ bool shared, rtl::OUString const & fileUri,
+ Modifications * modifications);
+
+ com::sun::star::beans::Optional< com::sun::star::uno::Any >
+ getExternalValue(rtl::OUString const & descriptor);
+
+private:
+ Components(
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+ const & context);
+
+ ~Components();
+
+ void parseFiles(
+ int layer, rtl::OUString const & extension,
+ void (* parseFile)(rtl::OUString const &, int, Data *, Modifications *),
+ rtl::OUString const & url, bool recursive);
+
+ void parseFileList(
+ int layer,
+ void (* parseFile)(rtl::OUString const &, int, Data *, Modifications *),
+ rtl::OUString const & urls, rtl::Bootstrap const & ini);
+
+ void parseXcdFiles(int layer, rtl::OUString const & url);
+
+ void parseXcsXcuLayer(int layer, rtl::OUString const & url);
+
+ void parseXcsXcuIniLayer(int layer, rtl::OUString const & url);
+
+ void parseModuleLayer(int layer, rtl::OUString const & url);
+
+ void parseResLayer(int layer, rtl::OUString const & url);
+
+ rtl::OUString getModificationFileUrl() const;
+
+ void parseModificationLayer();
+
+ typedef std::set< RootAccess * > WeakRootSet;
+
+ typedef
+ std::map<
+ rtl::OUString,
+ com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySet > >
+ ExternalServices;
+
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+ context_;
+ Data data_;
+ WeakRootSet roots_;
+ ExternalServices externalServices_;
+};
+
+}
+
+#endif
diff --git a/configmgr/source/configurationprovider.cxx b/configmgr/source/configurationprovider.cxx
new file mode 100644
index 0000000000..a89540a881
--- /dev/null
+++ b/configmgr/source/configurationprovider.cxx
@@ -0,0 +1,519 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include <vector>
+
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/beans/NamedValue.hpp"
+#include "com/sun/star/beans/PropertyValue.hpp"
+#include "com/sun/star/lang/EventObject.hpp"
+#include "com/sun/star/lang/Locale.hpp"
+#include "com/sun/star/lang/XLocalizable.hpp"
+#include "com/sun/star/lang/XMultiServiceFactory.hpp"
+#include "com/sun/star/lang/XServiceInfo.hpp"
+#include "com/sun/star/lang/XSingleComponentFactory.hpp"
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/DeploymentException.hpp"
+#include "com/sun/star/uno/Exception.hpp"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "com/sun/star/util/XFlushListener.hpp"
+#include "com/sun/star/util/XFlushable.hpp"
+#include "com/sun/star/util/XRefreshListener.hpp"
+#include "com/sun/star/util/XRefreshable.hpp"
+#include "comphelper/locale.hxx"
+#include "cppu/unotype.hxx"
+#include "cppuhelper/compbase5.hxx"
+#include "cppuhelper/factory.hxx"
+#include "cppuhelper/implbase1.hxx"
+#include "cppuhelper/interfacecontainer.hxx"
+#include "cppuhelper/weak.hxx"
+#include "osl/diagnose.h"
+#include "osl/mutex.hxx"
+#include "sal/types.h"
+#include "rtl/ref.hxx"
+#include "rtl/unload.h"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+
+#include "components.hxx"
+#include "configurationprovider.hxx"
+#include "lock.hxx"
+#include "rootaccess.hxx"
+
+namespace configmgr { namespace configuration_provider {
+
+namespace {
+
+namespace css = com::sun::star;
+
+char const accessServiceName[] =
+ "com.sun.star.configuration.ConfigurationAccess";
+char const updateAccessServiceName[] =
+ "com.sun.star.configuration.ConfigurationUpdateAccess";
+
+void badNodePath() {
+ throw css::uno::Exception(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationProvider expects a"
+ " single, non-empty, string nodepath argument")),
+ 0);
+}
+
+typedef
+ cppu::WeakComponentImplHelper5<
+ css::lang::XServiceInfo, css::lang::XMultiServiceFactory,
+ css::util::XRefreshable, css::util::XFlushable,
+ css::lang::XLocalizable >
+ ServiceBase;
+
+class Service:
+ private osl::Mutex, public ServiceBase, private boost::noncopyable
+{
+public:
+ Service(
+ css::uno::Reference< css::uno::XComponentContext > const context,
+ rtl::OUString const & locale):
+ ServiceBase(*static_cast< osl::Mutex * >(this)), context_(context),
+ locale_(locale)
+ {
+ OSL_ASSERT(context.is());
+ }
+
+private:
+ virtual ~Service() {}
+
+ virtual rtl::OUString SAL_CALL getImplementationName()
+ throw (css::uno::RuntimeException)
+ { return configuration_provider::getImplementationName(); }
+
+ virtual sal_Bool SAL_CALL supportsService(rtl::OUString const & ServiceName)
+ throw (css::uno::RuntimeException)
+ { return ServiceName == getSupportedServiceNames()[0]; } //TODO
+
+ virtual css::uno::Sequence< rtl::OUString > SAL_CALL
+ getSupportedServiceNames() throw (css::uno::RuntimeException)
+ { return configuration_provider::getSupportedServiceNames(); }
+ //TODO: DefaultProvider?
+
+ virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance(
+ rtl::OUString const & aServiceSpecifier)
+ throw (css::uno::Exception, css::uno::RuntimeException);
+
+ virtual css::uno::Reference< css::uno::XInterface > SAL_CALL
+ createInstanceWithArguments(
+ rtl::OUString const & ServiceSpecifier,
+ css::uno::Sequence< css::uno::Any > const & Arguments)
+ throw (css::uno::Exception, css::uno::RuntimeException);
+
+ virtual css::uno::Sequence< rtl::OUString > SAL_CALL
+ getAvailableServiceNames() throw (css::uno::RuntimeException);
+
+ virtual void SAL_CALL refresh() throw (css::uno::RuntimeException);
+
+ virtual void SAL_CALL addRefreshListener(
+ css::uno::Reference< css::util::XRefreshListener > const & l)
+ throw (css::uno::RuntimeException);
+
+ virtual void SAL_CALL removeRefreshListener(
+ css::uno::Reference< css::util::XRefreshListener > const & l)
+ throw (css::uno::RuntimeException);
+
+ virtual void SAL_CALL flush() throw (css::uno::RuntimeException);
+
+ virtual void SAL_CALL addFlushListener(
+ css::uno::Reference< css::util::XFlushListener > const & l)
+ throw (css::uno::RuntimeException);
+
+ virtual void SAL_CALL removeFlushListener(
+ css::uno::Reference< css::util::XFlushListener > const & l)
+ throw (css::uno::RuntimeException);
+
+ virtual void SAL_CALL setLocale(css::lang::Locale const & eLocale)
+ throw (css::uno::RuntimeException);
+
+ virtual css::lang::Locale SAL_CALL getLocale()
+ throw (css::uno::RuntimeException);
+
+ css::uno::Reference< css::uno::XComponentContext > context_;
+ rtl::OUString locale_;
+};
+
+css::uno::Reference< css::uno::XInterface > Service::createInstance(
+ rtl::OUString const & aServiceSpecifier)
+ throw (css::uno::Exception, css::uno::RuntimeException)
+{
+ return createInstanceWithArguments(
+ aServiceSpecifier, css::uno::Sequence< css::uno::Any >());
+}
+
+css::uno::Reference< css::uno::XInterface >
+Service::createInstanceWithArguments(
+ rtl::OUString const & ServiceSpecifier,
+ css::uno::Sequence< css::uno::Any > const & Arguments)
+ throw (css::uno::Exception, css::uno::RuntimeException)
+{
+ rtl::OUString nodepath;
+ rtl::OUString locale;
+ for (sal_Int32 i = 0; i < Arguments.getLength(); ++i) {
+ css::beans::NamedValue v1;
+ css::beans::PropertyValue v2;
+ rtl::OUString name;
+ css::uno::Any value;
+ if (Arguments[i] >>= v1) {
+ name = v1.Name;
+ value = v1.Value;
+ } else if (Arguments[i] >>= v2) {
+ name = v2.Name;
+ value = v2.Value;
+ } else if (Arguments.getLength() == 1 && (Arguments[i] >>= nodepath)) {
+ // For backwards compatibility, allow a single string argument that
+ // denotes nodepath.
+ if (nodepath.getLength() == 0) {
+ badNodePath();
+ }
+ break;
+ } else {
+ throw css::uno::Exception(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationProvider"
+ " expects NamedValue or PropertyValue arguments")),
+ 0);
+ }
+ // For backwards compatibility, allow "nodepath" and "Locale" in any
+ // case:
+ if (name.equalsIgnoreAsciiCaseAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("nodepath")))
+ {
+ if (nodepath.getLength() != 0 || !(value >>= nodepath) ||
+ nodepath.getLength() == 0)
+ {
+ badNodePath();
+ }
+ } else if (name.equalsIgnoreAsciiCaseAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("locale")))
+ {
+ if (locale.getLength() != 0 || !(value >>= locale) ||
+ locale.getLength() == 0)
+ {
+ throw css::uno::Exception(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationProvider"
+ " expects at most one, non-empty, string Locale"
+ " argument")),
+ 0);
+ }
+ }
+ }
+ if (nodepath.getLength() == 0) {
+ badNodePath();
+ }
+ // For backwards compatibility, allow a notepath that misses the leading
+ // slash:
+ if (nodepath[0] != '/') {
+ nodepath = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) + nodepath;
+ }
+ if (locale.getLength() == 0) {
+ //TODO: should the Access use the dynamically changing locale_ instead?
+ locale = locale_;
+ if (locale.getLength() == 0) {
+ locale = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("en-US"));
+ }
+ }
+ bool update;
+ if (ServiceSpecifier.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM(accessServiceName)))
+ {
+ update = false;
+ } else if (ServiceSpecifier.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM(updateAccessServiceName)))
+ {
+ update = true;
+ } else {
+ throw css::uno::Exception(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationProvider does not"
+ " support service ")) +
+ ServiceSpecifier),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ osl::MutexGuard guard(lock);
+ Components::initSingleton(context_);
+ Components & components = Components::getSingleton();
+ rtl::Reference< RootAccess > root(
+ new RootAccess(components, nodepath, locale, update));
+ if (root->isValue()) {
+ throw css::uno::Exception(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationProvider: there is"
+ " a leaf value at nodepath ")) +
+ nodepath),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ components.addRootAccess(root);
+ return static_cast< cppu::OWeakObject * >(root.get());
+}
+
+css::uno::Sequence< rtl::OUString > Service::getAvailableServiceNames()
+ throw (css::uno::RuntimeException)
+{
+ css::uno::Sequence< rtl::OUString > names(2);
+ names[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(accessServiceName));
+ names[1] = rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(updateAccessServiceName));
+ return names;
+}
+
+void Service::refresh() throw (css::uno::RuntimeException) {
+ //TODO
+ cppu::OInterfaceContainerHelper * cont = rBHelper.getContainer(
+ cppu::UnoType< css::util::XRefreshListener >::get());
+ if (cont != 0) {
+ css::lang::EventObject ev(static_cast< cppu::OWeakObject * >(this));
+ cont->notifyEach(&css::util::XRefreshListener::refreshed, ev);
+ }
+}
+
+void Service::addRefreshListener(
+ css::uno::Reference< css::util::XRefreshListener > const & l)
+ throw (css::uno::RuntimeException)
+{
+ rBHelper.addListener(
+ cppu::UnoType< css::util::XRefreshListener >::get(), l);
+}
+
+void Service::removeRefreshListener(
+ css::uno::Reference< css::util::XRefreshListener > const & l)
+ throw (css::uno::RuntimeException)
+{
+ rBHelper.removeListener(
+ cppu::UnoType< css::util::XRefreshListener >::get(), l);
+}
+
+void Service::flush() throw (css::uno::RuntimeException) {
+ //TODO
+ cppu::OInterfaceContainerHelper * cont = rBHelper.getContainer(
+ cppu::UnoType< css::util::XFlushListener >::get());
+ if (cont != 0) {
+ css::lang::EventObject ev(static_cast< cppu::OWeakObject * >(this));
+ cont->notifyEach(&css::util::XFlushListener::flushed, ev);
+ }
+}
+
+void Service::addFlushListener(
+ css::uno::Reference< css::util::XFlushListener > const & l)
+ throw (css::uno::RuntimeException)
+{
+ rBHelper.addListener(cppu::UnoType< css::util::XFlushListener >::get(), l);
+}
+
+void Service::removeFlushListener(
+ css::uno::Reference< css::util::XFlushListener > const & l)
+ throw (css::uno::RuntimeException)
+{
+ rBHelper.removeListener(
+ cppu::UnoType< css::util::XFlushListener >::get(), l);
+}
+
+void Service::setLocale(css::lang::Locale const & eLocale)
+ throw (css::uno::RuntimeException)
+{
+ osl::MutexGuard guard(lock);
+ locale_ = comphelper::Locale(
+ eLocale.Language, eLocale.Country, eLocale.Variant).toISO();
+}
+
+css::lang::Locale Service::getLocale() throw (css::uno::RuntimeException) {
+ osl::MutexGuard guard(lock);
+ css::lang::Locale loc;
+ if (locale_.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("*"))) {
+ loc.Language = locale_;
+ } else if (locale_.getLength() != 0) {
+ try {
+ comphelper::Locale l(locale_);
+ loc.Language = l.getLanguage();
+ loc.Country = l.getCountry();
+ loc.Variant = l.getVariant();
+ } catch (comphelper::Locale::MalFormedLocaleException & e) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("MalformedLocaleException: ")) +
+ e.Message),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ }
+ return loc;
+}
+
+class Factory:
+ public cppu::WeakImplHelper1< css::lang::XSingleComponentFactory >,
+ private boost::noncopyable
+{
+public:
+ Factory() {}
+
+private:
+ virtual ~Factory() {}
+
+ virtual css::uno::Reference< css::uno::XInterface > SAL_CALL
+ createInstanceWithContext(
+ css::uno::Reference< css::uno::XComponentContext > const & Context)
+ throw (css::uno::Exception, css::uno::RuntimeException);
+
+ virtual css::uno::Reference< css::uno::XInterface > SAL_CALL
+ createInstanceWithArgumentsAndContext(
+ css::uno::Sequence< css::uno::Any > const & Arguments,
+ css::uno::Reference< css::uno::XComponentContext > const & Context)
+ throw (css::uno::Exception, css::uno::RuntimeException);
+};
+
+css::uno::Reference< css::uno::XInterface > Factory::createInstanceWithContext(
+ css::uno::Reference< css::uno::XComponentContext > const & Context)
+ throw (css::uno::Exception, css::uno::RuntimeException)
+{
+ return createInstanceWithArgumentsAndContext(
+ css::uno::Sequence< css::uno::Any >(), Context);
+}
+
+css::uno::Reference< css::uno::XInterface >
+Factory::createInstanceWithArgumentsAndContext(
+ css::uno::Sequence< css::uno::Any > const & Arguments,
+ css::uno::Reference< css::uno::XComponentContext > const & Context)
+ throw (css::uno::Exception, css::uno::RuntimeException)
+{
+ if (Arguments.getLength() == 0) {
+ css::uno::Reference< css::uno::XInterface > instance;
+ if (!(Context->getValueByName(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "/singletons/"
+ "com.sun.star.configuration.theDefaultProvider")))
+ >>= instance) ||
+ !instance.is())
+ {
+ throw css::uno::DeploymentException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "component context fails to supply singleton"
+ " com.sun.star.configuration.theDefaultProvider")),
+ Context);
+ }
+ return instance;
+ } else {
+ rtl::OUString locale;
+ for (sal_Int32 i = 0; i < Arguments.getLength(); ++i) {
+ css::beans::NamedValue v1;
+ css::beans::PropertyValue v2;
+ rtl::OUString name;
+ css::uno::Any value;
+ if (Arguments[i] >>= v1) {
+ name = v1.Name;
+ value = v1.Value;
+ } else if (Arguments[i] >>= v2) {
+ name = v2.Name;
+ value = v2.Value;
+ } else {
+ throw css::uno::Exception(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationProvider"
+ " factory expects NamedValue or PropertyValue"
+ " arguments")),
+ 0);
+ }
+ // For backwards compatibility, allow "Locale" in any case:
+ if (name.equalsIgnoreAsciiCaseAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("locale")))
+ {
+ if (locale.getLength() != 0 || !(value >>= locale) ||
+ locale.getLength() == 0)
+ {
+ throw css::uno::Exception(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration."
+ "ConfigurationProvider factory expects at most"
+ " one, non-empty, string Locale argument")),
+ 0);
+ }
+ } else {
+ //TODO
+ throw css::uno::Exception(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationProvider"
+ " factory: unknown argument ")) + name,
+ 0);
+ }
+ }
+ return static_cast< cppu::OWeakObject * >(new Service(Context, locale));
+ }
+}
+
+}
+
+css::uno::Reference< css::uno::XInterface > createDefault(
+ css::uno::Reference< css::uno::XComponentContext > const & context)
+{
+ return static_cast< cppu::OWeakObject * >(
+ new Service(context, rtl::OUString()));
+}
+
+rtl::OUString getImplementationName() {
+ return rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.comp.configuration.ConfigurationProvider"));
+}
+
+css::uno::Sequence< rtl::OUString > getSupportedServiceNames() {
+ rtl::OUString name(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationProvider"));
+ return css::uno::Sequence< rtl::OUString >(&name, 1);
+}
+
+css::uno::Reference< css::lang::XSingleComponentFactory >
+createFactory(
+ cppu::ComponentFactoryFunc, rtl::OUString const &,
+ css::uno::Sequence< rtl::OUString > const &, rtl_ModuleCount *)
+ SAL_THROW(())
+{
+ return new Factory;
+}
+
+} }
diff --git a/configmgr/source/configurationprovider.hxx b/configmgr/source/configurationprovider.hxx
new file mode 100644
index 0000000000..4a8c383837
--- /dev/null
+++ b/configmgr/source/configurationprovider.hxx
@@ -0,0 +1,67 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_CONFIGURATIONPROVIDER_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_CONFIGURATIONPROVIDER_HXX
+
+#include "sal/config.h"
+
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "cppuhelper/factory.hxx"
+#include "rtl/unload.h"
+#include "sal/types.h"
+
+namespace com { namespace sun { namespace star {
+ namespace lang { class XSingleComponentFactory; }
+ namespace uno {
+ class XComponentContext;
+ class XInterface;
+ }
+} } }
+namespace rtl { class OUString; }
+
+namespace configmgr { namespace configuration_provider {
+
+com::sun::star::uno::Reference< com::sun::star::uno::XInterface > createDefault(
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+ const & context);
+
+rtl::OUString SAL_CALL getImplementationName();
+
+com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL
+getSupportedServiceNames();
+
+com::sun::star::uno::Reference< com::sun::star::lang::XSingleComponentFactory >
+SAL_CALL createFactory(
+ cppu::ComponentFactoryFunc, rtl::OUString const &,
+ com::sun::star::uno::Sequence< rtl::OUString > const &, rtl_ModuleCount *)
+ SAL_THROW(());
+
+} }
+
+#endif
diff --git a/configmgr/source/configurationregistry.cxx b/configmgr/source/configurationregistry.cxx
new file mode 100644
index 0000000000..ffd7174c0a
--- /dev/null
+++ b/configmgr/source/configurationregistry.cxx
@@ -0,0 +1,950 @@
+/*************************************************************************
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/beans/NamedValue.hpp"
+#include "com/sun/star/beans/Property.hpp"
+#include "com/sun/star/beans/XProperty.hpp"
+#include "com/sun/star/container/NoSuchElementException.hpp"
+#include "com/sun/star/container/XHierarchicalNameAccess.hpp"
+#include "com/sun/star/container/XNamed.hpp"
+#include "com/sun/star/lang/XMultiComponentFactory.hpp"
+#include "com/sun/star/lang/XMultiServiceFactory.hpp"
+#include "com/sun/star/lang/XServiceInfo.hpp"
+#include "com/sun/star/lang/XSingleComponentFactory.hpp"
+#include "com/sun/star/registry/InvalidRegistryException.hpp"
+#include "com/sun/star/registry/InvalidValueException.hpp"
+#include "com/sun/star/registry/MergeConflictException.hpp"
+#include "com/sun/star/registry/RegistryKeyType.hpp"
+#include "com/sun/star/registry/RegistryValueType.hpp"
+#include "com/sun/star/registry/XRegistryKey.hpp"
+#include "com/sun/star/registry/XSimpleRegistry.hpp"
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/DeploymentException.hpp"
+#include "com/sun/star/uno/Exception.hpp"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "com/sun/star/uno/Type.hxx"
+#include "com/sun/star/uno/TypeClass.hpp"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "com/sun/star/util/XFlushable.hpp"
+#include "cppu/unotype.hxx"
+#include "cppuhelper/factory.hxx"
+#include "cppuhelper/implbase1.hxx"
+#include "cppuhelper/implbase3.hxx"
+#include "cppuhelper/weak.hxx"
+#include "osl/diagnose.h"
+#include "osl/mutex.hxx"
+#include "rtl/unload.h"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+
+#include "configurationregistry.hxx"
+
+namespace com { namespace sun { namespace star { namespace util {
+ class XFlushListener;
+} } } }
+
+namespace configmgr { namespace configuration_registry {
+
+namespace {
+
+namespace css = com::sun::star;
+
+class Service:
+ public cppu::WeakImplHelper3<
+ css::lang::XServiceInfo, css::registry::XSimpleRegistry,
+ css::util::XFlushable >,
+ private boost::noncopyable
+{
+public:
+ Service(css::uno::Reference< css::uno::XComponentContext > const & context);
+
+private:
+ virtual ~Service() {}
+
+ virtual rtl::OUString SAL_CALL getImplementationName()
+ throw (css::uno::RuntimeException)
+ { return configuration_registry::getImplementationName(); }
+
+ virtual sal_Bool SAL_CALL supportsService(rtl::OUString const & ServiceName)
+ throw (css::uno::RuntimeException)
+ { return ServiceName == getSupportedServiceNames()[0]; } //TODO
+
+ virtual css::uno::Sequence< rtl::OUString > SAL_CALL
+ getSupportedServiceNames() throw (css::uno::RuntimeException)
+ { return configuration_registry::getSupportedServiceNames(); }
+
+ virtual rtl::OUString SAL_CALL getURL() throw (css::uno::RuntimeException);
+
+ virtual void SAL_CALL open(
+ rtl::OUString const & rURL, sal_Bool bReadOnly, sal_Bool)
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL isValid() throw (css::uno::RuntimeException);
+
+ virtual void SAL_CALL close()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual void SAL_CALL destroy()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual css::uno::Reference< css::registry::XRegistryKey > SAL_CALL
+ getRootKey()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL isReadOnly() throw (css::uno::RuntimeException);
+
+ virtual void SAL_CALL mergeKey(rtl::OUString const &, rtl::OUString const &)
+ throw (
+ css::registry::InvalidRegistryException,
+ css::registry::MergeConflictException, css::uno::RuntimeException);
+
+ virtual void SAL_CALL flush() throw (css::uno::RuntimeException);
+
+ virtual void SAL_CALL addFlushListener(
+ css::uno::Reference< css::util::XFlushListener > const &)
+ throw (css::uno::RuntimeException);
+
+ virtual void SAL_CALL removeFlushListener(
+ css::uno::Reference< css::util::XFlushListener > const &)
+ throw (css::uno::RuntimeException);
+
+ void checkValid();
+
+ void checkValid_RuntimeException();
+
+ void doClose();
+
+ css::uno::Reference< css::lang::XMultiServiceFactory > provider_;
+ osl::Mutex mutex_;
+ css::uno::Reference< css::uno::XInterface > access_;
+ rtl::OUString url_;
+ bool readOnly_;
+
+ friend class RegistryKey;
+};
+
+class RegistryKey:
+ public cppu::WeakImplHelper1< css::registry::XRegistryKey >,
+ private boost::noncopyable
+{
+public:
+ RegistryKey(Service & service, css::uno::Any const & value):
+ service_(service), value_(value) {}
+
+private:
+ virtual ~RegistryKey() {}
+
+ virtual rtl::OUString SAL_CALL getKeyName()
+ throw (css::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL isReadOnly()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL isValid() throw (css::uno::RuntimeException);
+
+ virtual css::registry::RegistryKeyType SAL_CALL getKeyType(
+ rtl::OUString const &)
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual css::registry::RegistryValueType SAL_CALL getValueType()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual sal_Int32 SAL_CALL getLongValue()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::registry::InvalidValueException, css::uno::RuntimeException);
+
+ virtual void SAL_CALL setLongValue(sal_Int32)
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual css::uno::Sequence< sal_Int32 > SAL_CALL getLongListValue()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::registry::InvalidValueException, css::uno::RuntimeException);
+
+ virtual void SAL_CALL setLongListValue(
+ css::uno::Sequence< sal_Int32 > const &)
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual rtl::OUString SAL_CALL getAsciiValue()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::registry::InvalidValueException, css::uno::RuntimeException);
+
+ virtual void SAL_CALL setAsciiValue(rtl::OUString const &)
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual css::uno::Sequence< rtl::OUString > SAL_CALL getAsciiListValue()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::registry::InvalidValueException, css::uno::RuntimeException);
+
+ virtual void SAL_CALL setAsciiListValue(
+ css::uno::Sequence< rtl::OUString > const &)
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual rtl::OUString SAL_CALL getStringValue()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::registry::InvalidValueException, css::uno::RuntimeException);
+
+ virtual void SAL_CALL setStringValue(rtl::OUString const &)
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual css::uno::Sequence< rtl::OUString > SAL_CALL getStringListValue()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::registry::InvalidValueException, css::uno::RuntimeException);
+
+ virtual void SAL_CALL setStringListValue(
+ css::uno::Sequence< rtl::OUString > const &)
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual css::uno::Sequence< sal_Int8 > SAL_CALL getBinaryValue()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::registry::InvalidValueException, css::uno::RuntimeException);
+
+ virtual void SAL_CALL setBinaryValue(css::uno::Sequence< sal_Int8 > const &)
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual css::uno::Reference< css::registry::XRegistryKey > SAL_CALL openKey(
+ rtl::OUString const & aKeyName)
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual css::uno::Reference< css::registry::XRegistryKey > SAL_CALL
+ createKey(rtl::OUString const &)
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual void SAL_CALL closeKey()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual void SAL_CALL deleteKey(rtl::OUString const &)
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual
+ css::uno::Sequence< css::uno::Reference< css::registry::XRegistryKey > >
+ SAL_CALL openKeys()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual css::uno::Sequence< rtl::OUString > SAL_CALL getKeyNames()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL createLink(
+ rtl::OUString const &, rtl::OUString const &)
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual void SAL_CALL deleteLink(rtl::OUString const &)
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual rtl::OUString SAL_CALL getLinkTarget(rtl::OUString const &)
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ virtual rtl::OUString SAL_CALL getResolvedName(
+ rtl::OUString const & aKeyName)
+ throw (
+ css::registry::InvalidRegistryException,
+ css::uno::RuntimeException);
+
+ Service & service_;
+ css::uno::Any value_;
+};
+
+Service::Service(
+ css::uno::Reference< css::uno::XComponentContext > const & context)
+{
+ OSL_ASSERT(context.is());
+ try {
+ provider_ = css::uno::Reference< css::lang::XMultiServiceFactory >(
+ (css::uno::Reference< css::lang::XMultiComponentFactory >(
+ context->getServiceManager(), css::uno::UNO_SET_THROW)->
+ createInstanceWithContext(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.DefaultProvider")),
+ context)),
+ css::uno::UNO_QUERY_THROW);
+ } catch (css::uno::RuntimeException &) {
+ throw;
+ } catch (css::uno::Exception & e) {
+ throw css::uno::DeploymentException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "component context fails to supply service"
+ " com.sun.star.configuration.DefaultProvider of type"
+ " com.sun.star.lang.XMultiServiceFactory: ")) +
+ e.Message),
+ context);
+ }
+}
+
+rtl::OUString Service::getURL() throw (css::uno::RuntimeException) {
+ osl::MutexGuard g(mutex_);
+ checkValid_RuntimeException();
+ return url_;
+}
+
+void Service::open(rtl::OUString const & rURL, sal_Bool bReadOnly, sal_Bool)
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ //TODO: bCreate
+ osl::MutexGuard g(mutex_);
+ if (access_.is()) {
+ doClose();
+ }
+ css::uno::Sequence< css::uno::Any > args(1);
+ args[0] <<= css::beans::NamedValue(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath")),
+ css::uno::makeAny(rURL));
+ try {
+ access_ = provider_->createInstanceWithArguments(
+ (bReadOnly
+ ? rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationAccess"))
+ : rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationUpdateAccess"))),
+ args);
+ } catch (css::uno::RuntimeException &) {
+ throw;
+ } catch (css::uno::Exception & e) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: open"
+ " failed: ")) +
+ e.Message),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ url_ = rURL;
+ readOnly_ = bReadOnly;
+}
+
+sal_Bool Service::isValid() throw (css::uno::RuntimeException) {
+ osl::MutexGuard g(mutex_);
+ return access_.is();
+}
+
+void Service::close()
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ osl::MutexGuard g(mutex_);
+ checkValid();
+ doClose();
+}
+
+void Service::destroy()
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: not"
+ " implemented")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+css::uno::Reference< css::registry::XRegistryKey > Service::getRootKey()
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ osl::MutexGuard g(mutex_);
+ checkValid();
+ return new RegistryKey(*this, css::uno::makeAny(access_));
+}
+
+sal_Bool Service::isReadOnly() throw (css::uno::RuntimeException) {
+ osl::MutexGuard g(mutex_);
+ checkValid_RuntimeException();
+ return readOnly_;
+}
+
+void Service::mergeKey(rtl::OUString const &, rtl::OUString const &)
+ throw (
+ css::registry::InvalidRegistryException,
+ css::registry::MergeConflictException, css::uno::RuntimeException)
+{
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: not"
+ " implemented")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+void Service::flush() throw (css::uno::RuntimeException)
+{
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: not"
+ " implemented")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+void Service::addFlushListener(
+ css::uno::Reference< css::util::XFlushListener > const &)
+ throw (css::uno::RuntimeException)
+{
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: not"
+ " implemented")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+void Service::removeFlushListener(
+ css::uno::Reference< css::util::XFlushListener > const &)
+ throw (css::uno::RuntimeException)
+{
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: not"
+ " implemented")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+void Service::checkValid() {
+ if (!access_.is()) {
+ throw css::registry::InvalidRegistryException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: not"
+ " valid")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+}
+
+void Service::checkValid_RuntimeException() {
+ if (!access_.is()) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: not"
+ " valid")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+}
+
+void Service::doClose() {
+ access_.clear();
+}
+
+rtl::OUString RegistryKey::getKeyName() throw (css::uno::RuntimeException) {
+ osl::MutexGuard g(service_.mutex_);
+ service_.checkValid_RuntimeException();
+ css::uno::Reference< css::container::XNamed > named;
+ if (value_ >>= named) {
+ return named->getName();
+ }
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: not"
+ " implemented")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+sal_Bool RegistryKey::isReadOnly()
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ osl::MutexGuard g(service_.mutex_);
+ service_.checkValid_RuntimeException();
+ return service_.readOnly_; //TODO: read-only sub-nodes in update access?
+}
+
+sal_Bool RegistryKey::isValid() throw (css::uno::RuntimeException) {
+ return service_.isValid();
+}
+
+css::registry::RegistryKeyType RegistryKey::getKeyType(rtl::OUString const &)
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ osl::MutexGuard g(service_.mutex_);
+ service_.checkValid();
+ return css::registry::RegistryKeyType_KEY;
+}
+
+css::registry::RegistryValueType RegistryKey::getValueType()
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ osl::MutexGuard g(service_.mutex_);
+ service_.checkValid();
+ css::uno::Type t(value_.getValueType());
+ switch (t.getTypeClass()) {
+ case css::uno::TypeClass_LONG:
+ return css::registry::RegistryValueType_LONG;
+ case css::uno::TypeClass_STRING:
+ return css::registry::RegistryValueType_STRING;
+ case css::uno::TypeClass_SEQUENCE:
+ if (t == cppu::UnoType< css::uno::Sequence< sal_Int8 > >::get()) {
+ return css::registry::RegistryValueType_BINARY;
+ } else if (t == cppu::UnoType< css::uno::Sequence< sal_Int32 > >::get())
+ {
+ return css::registry::RegistryValueType_LONGLIST;
+ } else if (t ==
+ cppu::UnoType< css::uno::Sequence< rtl::OUString > >::get())
+ {
+ return css::registry::RegistryValueType_STRINGLIST;
+ }
+ // fall through
+ default:
+ return css::registry::RegistryValueType_NOT_DEFINED;
+ }
+}
+
+sal_Int32 RegistryKey::getLongValue()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::registry::InvalidValueException, css::uno::RuntimeException)
+{
+ osl::MutexGuard g(service_.mutex_);
+ service_.checkValid();
+ sal_Int32 v = 0;
+ if (value_ >>= v) {
+ return v;
+ }
+ throw css::registry::InvalidValueException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+void RegistryKey::setLongValue(sal_Int32)
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: not"
+ " implemented")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+css::uno::Sequence< sal_Int32 > RegistryKey::getLongListValue()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::registry::InvalidValueException, css::uno::RuntimeException)
+{
+ osl::MutexGuard g(service_.mutex_);
+ service_.checkValid();
+ css::uno::Sequence< sal_Int32 > v;
+ if (value_ >>= v) {
+ return v;
+ }
+ throw css::registry::InvalidValueException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+void RegistryKey::setLongListValue(css::uno::Sequence< sal_Int32 > const &)
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: not"
+ " implemented")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+rtl::OUString RegistryKey::getAsciiValue()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::registry::InvalidValueException, css::uno::RuntimeException)
+{
+ osl::MutexGuard g(service_.mutex_);
+ service_.checkValid();
+ rtl::OUString v;
+ if (value_ >>= v) {
+ return v;
+ }
+ throw css::registry::InvalidValueException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+void RegistryKey::setAsciiValue(rtl::OUString const &)
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: not"
+ " implemented")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+css::uno::Sequence< rtl::OUString > RegistryKey::getAsciiListValue()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::registry::InvalidValueException, css::uno::RuntimeException)
+{
+ osl::MutexGuard g(service_.mutex_);
+ service_.checkValid();
+ css::uno::Sequence< rtl::OUString > v;
+ if (value_ >>= v) {
+ return v;
+ }
+ throw css::registry::InvalidValueException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+void RegistryKey::setAsciiListValue(css::uno::Sequence< rtl::OUString > const &)
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: not"
+ " implemented")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+rtl::OUString RegistryKey::getStringValue()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::registry::InvalidValueException, css::uno::RuntimeException)
+{
+ osl::MutexGuard g(service_.mutex_);
+ service_.checkValid();
+ rtl::OUString v;
+ if (value_ >>= v) {
+ return v;
+ }
+ throw css::registry::InvalidValueException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+void RegistryKey::setStringValue(rtl::OUString const &)
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: not"
+ " implemented")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+css::uno::Sequence< rtl::OUString > RegistryKey::getStringListValue()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::registry::InvalidValueException, css::uno::RuntimeException)
+{
+ osl::MutexGuard g(service_.mutex_);
+ service_.checkValid();
+ css::uno::Sequence< rtl::OUString > v;
+ if (value_ >>= v) {
+ return v;
+ }
+ throw css::registry::InvalidValueException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+void RegistryKey::setStringListValue(
+ css::uno::Sequence< rtl::OUString > const &)
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: not"
+ " implemented")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+css::uno::Sequence< sal_Int8 > RegistryKey::getBinaryValue()
+ throw (
+ css::registry::InvalidRegistryException,
+ css::registry::InvalidValueException, css::uno::RuntimeException)
+{
+ osl::MutexGuard g(service_.mutex_);
+ service_.checkValid();
+ css::uno::Sequence< sal_Int8 > v;
+ if (value_ >>= v) {
+ return v;
+ }
+ throw css::registry::InvalidValueException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+void RegistryKey::setBinaryValue(css::uno::Sequence< sal_Int8 > const &)
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: not"
+ " implemented")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+css::uno::Reference< css::registry::XRegistryKey > RegistryKey::openKey(
+ rtl::OUString const & aKeyName)
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ osl::MutexGuard g(service_.mutex_);
+ service_.checkValid_RuntimeException();
+ css::uno::Reference< css::container::XHierarchicalNameAccess > access;
+ if (value_ >>= access) {
+ try {
+ return new RegistryKey(
+ service_, access->getByHierarchicalName(aKeyName));
+ } catch (css::container::NoSuchElementException &) {}
+ }
+ return css::uno::Reference< css::registry::XRegistryKey >();
+}
+
+css::uno::Reference< css::registry::XRegistryKey > RegistryKey::createKey(
+ rtl::OUString const &)
+ throw (
+ css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: not"
+ " implemented")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+void RegistryKey::closeKey()
+ throw (
+ css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ osl::MutexGuard g(service_.mutex_);
+ service_.checkValid_RuntimeException();
+}
+
+void RegistryKey::deleteKey(rtl::OUString const &)
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: not"
+ " implemented")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+css::uno::Sequence< css::uno::Reference< css::registry::XRegistryKey > >
+RegistryKey::openKeys()
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: not"
+ " implemented")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+css::uno::Sequence< rtl::OUString > RegistryKey::getKeyNames()
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry: not"
+ " implemented")),
+ static_cast< cppu::OWeakObject * >(this));
+}
+
+sal_Bool RegistryKey::createLink(rtl::OUString const &, rtl::OUString const &)
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ osl::MutexGuard g(service_.mutex_);
+ service_.checkValid_RuntimeException();
+ return false;
+}
+
+void RegistryKey::deleteLink(rtl::OUString const &)
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ osl::MutexGuard g(service_.mutex_);
+ service_.checkValid_RuntimeException();
+}
+
+rtl::OUString RegistryKey::getLinkTarget(rtl::OUString const &)
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ osl::MutexGuard g(service_.mutex_);
+ service_.checkValid_RuntimeException();
+ return rtl::OUString();
+}
+
+rtl::OUString RegistryKey::getResolvedName(rtl::OUString const & aKeyName)
+ throw (css::registry::InvalidRegistryException, css::uno::RuntimeException)
+{
+ osl::MutexGuard g(service_.mutex_);
+ service_.checkValid_RuntimeException();
+ return aKeyName;
+}
+
+class Factory:
+ public cppu::WeakImplHelper1< css::lang::XSingleComponentFactory >,
+ private boost::noncopyable
+{
+public:
+ Factory() {}
+
+private:
+ virtual ~Factory() {}
+
+ virtual css::uno::Reference< css::uno::XInterface > SAL_CALL
+ createInstanceWithContext(
+ css::uno::Reference< css::uno::XComponentContext > const & Context)
+ throw (css::uno::Exception, css::uno::RuntimeException);
+
+ virtual css::uno::Reference< css::uno::XInterface > SAL_CALL
+ createInstanceWithArgumentsAndContext(
+ css::uno::Sequence< css::uno::Any > const & Arguments,
+ css::uno::Reference< css::uno::XComponentContext > const & Context)
+ throw (css::uno::Exception, css::uno::RuntimeException);
+};
+
+css::uno::Reference< css::uno::XInterface > Factory::createInstanceWithContext(
+ css::uno::Reference< css::uno::XComponentContext > const & Context)
+ throw (css::uno::Exception, css::uno::RuntimeException)
+{
+ return createInstanceWithArgumentsAndContext(
+ css::uno::Sequence< css::uno::Any >(), Context);
+}
+
+css::uno::Reference< css::uno::XInterface >
+Factory::createInstanceWithArgumentsAndContext(
+ css::uno::Sequence< css::uno::Any > const & Arguments,
+ css::uno::Reference< css::uno::XComponentContext > const & Context)
+ throw (css::uno::Exception, css::uno::RuntimeException)
+{
+ if (Arguments.getLength() != 0) {
+ throw css::uno::Exception(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry must be"
+ " instantiated without arguments")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ return static_cast< cppu::OWeakObject * >(new Service(Context));
+}
+
+}
+
+rtl::OUString getImplementationName() {
+ return rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.comp.configuration.ConfigurationRegistry"));
+}
+
+css::uno::Sequence< rtl::OUString > getSupportedServiceNames() {
+ rtl::OUString name(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationRegistry"));
+ return css::uno::Sequence< rtl::OUString >(&name, 1);
+}
+
+css::uno::Reference< css::lang::XSingleComponentFactory > createFactory(
+ cppu::ComponentFactoryFunc, rtl::OUString const &,
+ css::uno::Sequence< rtl::OUString > const &, rtl_ModuleCount *)
+ SAL_THROW(())
+{
+ return new Factory;
+}
+
+} }
diff --git a/configmgr/source/configurationregistry.hxx b/configmgr/source/configurationregistry.hxx
new file mode 100644
index 0000000000..6cba122188
--- /dev/null
+++ b/configmgr/source/configurationregistry.hxx
@@ -0,0 +1,57 @@
+/*************************************************************************
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_CONFIGURATIONREGISTRY_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_CONFIGURATIONREGISTRY_HXX
+
+#include "sal/config.h"
+
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "cppuhelper/factory.hxx"
+#include "rtl/unload.h"
+#include "sal/types.h"
+
+namespace com { namespace sun { namespace star { namespace lang {
+ class XSingleComponentFactory;
+} } } }
+namespace rtl { class OUString; }
+
+namespace configmgr { namespace configuration_registry {
+
+rtl::OUString SAL_CALL getImplementationName();
+
+com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL
+getSupportedServiceNames();
+
+com::sun::star::uno::Reference< com::sun::star::lang::XSingleComponentFactory >
+SAL_CALL createFactory(
+ cppu::ComponentFactoryFunc, rtl::OUString const &,
+ com::sun::star::uno::Sequence< rtl::OUString > const &, rtl_ModuleCount *)
+ SAL_THROW(());
+
+} }
+
+#endif
diff --git a/configmgr/source/data.cxx b/configmgr/source/data.cxx
new file mode 100644
index 0000000000..5540a40fd5
--- /dev/null
+++ b/configmgr/source/data.cxx
@@ -0,0 +1,318 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include <algorithm>
+
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "osl/diagnose.h"
+#include "rtl/ref.hxx"
+#include "rtl/string.h"
+#include "rtl/ustrbuf.hxx"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+
+#include "data.hxx"
+#include "groupnode.hxx"
+#include "node.hxx"
+#include "nodemap.hxx"
+#include "setnode.hxx"
+
+namespace configmgr {
+
+namespace {
+
+namespace css = com::sun::star;
+
+bool decode(
+ rtl::OUString const & encoded, sal_Int32 begin, sal_Int32 end,
+ rtl::OUString * decoded)
+{
+ OSL_ASSERT(
+ begin >= 0 && begin <= end && end <= encoded.getLength() &&
+ decoded != 0);
+ rtl::OUStringBuffer buf;
+ while (begin != end) {
+ sal_Unicode c = encoded[begin++];
+ if (c == '&') {
+ if (encoded.matchAsciiL(RTL_CONSTASCII_STRINGPARAM("amp;"), begin))
+ {
+ buf.append(sal_Unicode('&'));
+ begin += RTL_CONSTASCII_LENGTH("amp;");
+ } else if (encoded.matchAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("quot;"), begin))
+ {
+ buf.append(sal_Unicode('"'));
+ begin += RTL_CONSTASCII_LENGTH("quot;");
+ } else if (encoded.matchAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("apos;"), begin))
+ {
+ buf.append(sal_Unicode('\''));
+ begin += RTL_CONSTASCII_LENGTH("apos;");
+ } else {
+ return false;
+ }
+ OSL_ASSERT(begin <= end);
+ } else {
+ buf.append(c);
+ }
+ }
+ *decoded = buf.makeStringAndClear();
+ return true;
+}
+
+}
+
+rtl::OUString Data::createSegment(
+ rtl::OUString const & templateName, rtl::OUString const & name)
+{
+ if (templateName.getLength() == 0) {
+ return name;
+ }
+ rtl::OUStringBuffer buf(templateName);
+ //TODO: verify template name contains no bad chars?
+ buf.appendAscii(RTL_CONSTASCII_STRINGPARAM("['"));
+ for (sal_Int32 i = 0; i < name.getLength(); ++i) {
+ sal_Unicode c = name[i];
+ switch (c) {
+ case '&':
+ buf.appendAscii(RTL_CONSTASCII_STRINGPARAM("&amp;"));
+ break;
+ case '"':
+ buf.appendAscii(RTL_CONSTASCII_STRINGPARAM("&quot;"));
+ break;
+ case '\'':
+ buf.appendAscii(RTL_CONSTASCII_STRINGPARAM("&apos;"));
+ break;
+ default:
+ buf.append(c);
+ break;
+ }
+ }
+ buf.appendAscii(RTL_CONSTASCII_STRINGPARAM("']"));
+ return buf.makeStringAndClear();
+}
+
+sal_Int32 Data::parseSegment(
+ rtl::OUString const & path, sal_Int32 index, rtl::OUString * name,
+ bool * setElement, rtl::OUString * templateName)
+{
+ OSL_ASSERT(
+ index >= 0 && index <= path.getLength() && name != 0 &&
+ setElement != 0);
+ sal_Int32 i = index;
+ while (i < path.getLength() && path[i] != '/' && path[i] != '[') {
+ ++i;
+ }
+ if (i == path.getLength() || path[i] == '/') {
+ *name = path.copy(index, i - index);
+ *setElement = false;
+ return i;
+ }
+ if (templateName != 0) {
+ if (i - index == 1 && path[index] == '*') {
+ *templateName = rtl::OUString();
+ } else {
+ *templateName = path.copy(index, i - index);
+ }
+ }
+ if (++i == path.getLength()) {
+ return -1;
+ }
+ sal_Unicode del = path[i++];
+ if (del != '\'' && del != '"') {
+ return -1;
+ }
+ sal_Int32 j = path.indexOf(del, i);
+ if (j == -1 || j + 1 == path.getLength() || path[j + 1] != ']' ||
+ !decode(path, i, j, name))
+ {
+ return -1;
+ }
+ *setElement = true;
+ return j + 2;
+}
+
+rtl::OUString Data::fullTemplateName(
+ rtl::OUString const & component, rtl::OUString const & name)
+{
+ if (component.indexOf(':') != -1 || name.indexOf(':') != -1) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "bad component/name pair containing colon ")) +
+ component + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) +
+ name),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ rtl::OUStringBuffer buf(component);
+ buf.append(sal_Unicode(':'));
+ buf.append(name);
+ return buf.makeStringAndClear();
+}
+
+bool Data::equalTemplateNames(
+ rtl::OUString const & shortName, rtl::OUString const & longName)
+{
+ if (shortName.indexOf(':') == -1) {
+ sal_Int32 i = longName.indexOf(':') + 1;
+ OSL_ASSERT(i > 0);
+ return
+ rtl_ustr_compare_WithLength(
+ shortName.getStr(), shortName.getLength(),
+ longName.getStr() + i, longName.getLength() - i) ==
+ 0;
+ } else {
+ return shortName == longName;
+ }
+}
+
+rtl::Reference< Node > Data::findNode(
+ int layer, NodeMap const & map, rtl::OUString const & name)
+{
+ NodeMap::const_iterator i(map.find(name));
+ return i == map.end() || i->second->getLayer() > layer
+ ? rtl::Reference< Node >() : i->second;
+}
+
+rtl::Reference< Node > Data::resolvePathRepresentation(
+ rtl::OUString const & pathRepresentation, Path * path, int * finalizedLayer)
+ const
+{
+ if (pathRepresentation.getLength() == 0 || pathRepresentation[0] != '/') {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad path ")) +
+ pathRepresentation),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ rtl::OUString seg;
+ bool setElement;
+ sal_Int32 n = parseSegment(pathRepresentation, 1, &seg, &setElement, 0);
+ if (n == -1 || setElement)
+ {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad path ")) +
+ pathRepresentation),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ NodeMap::const_iterator i(components.find(seg));
+ if (path != 0) {
+ path->clear();
+ }
+ rtl::Reference< Node > parent;
+ int finalized = NO_LAYER;
+ for (rtl::Reference< Node > p(i == components.end() ? 0 : i->second);;) {
+ if (!p.is()) {
+ return p;
+ }
+ if (path != 0) {
+ path->push_back(seg);
+ }
+ finalized = std::min(finalized, p->getFinalized());
+ if (n != pathRepresentation.getLength() &&
+ pathRepresentation[n++] != '/')
+ {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad path ")) +
+ pathRepresentation),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ // for backwards compatibility, ignore a final slash
+ if (n == pathRepresentation.getLength()) {
+ if (finalizedLayer != 0) {
+ *finalizedLayer = finalized;
+ }
+ return p;
+ }
+ parent = p;
+ rtl::OUString templateName;
+ n = parseSegment(
+ pathRepresentation, n, &seg, &setElement, &templateName);
+ if (n == -1) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad path ")) +
+ pathRepresentation),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ // For backwards compatibility, allow set members to be accessed with
+ // simple path segments, like group members:
+ p = p->getMember(seg);
+ if (setElement) {
+ switch (parent->kind()) {
+ case Node::KIND_LOCALIZED_PROPERTY:
+ if (templateName.getLength() != 0) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("bad path ")) +
+ pathRepresentation),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ break;
+ case Node::KIND_SET:
+ if (templateName.getLength() != 0 &&
+ !dynamic_cast< SetNode * >(parent.get())->isValidTemplate(
+ templateName))
+ {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("bad path ")) +
+ pathRepresentation),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ break;
+ default:
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad path ")) +
+ pathRepresentation),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ if (templateName.getLength() != 0 && p != 0) {
+ OSL_ASSERT(p->getTemplateName().getLength() != 0);
+ if (!equalTemplateNames(templateName, p->getTemplateName())) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("bad path ")) +
+ pathRepresentation),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ }
+ }
+ }
+}
+
+rtl::Reference< Node > Data::getTemplate(
+ int layer, rtl::OUString const & fullName) const
+{
+ return findNode(layer, templates, fullName);
+}
+
+}
diff --git a/configmgr/source/data.hxx b/configmgr/source/data.hxx
new file mode 100644
index 0000000000..495ca12338
--- /dev/null
+++ b/configmgr/source/data.hxx
@@ -0,0 +1,86 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_DATA_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_DATA_HXX
+
+#include "sal/config.h"
+
+#include <climits>
+#include <vector>
+
+#include "boost/noncopyable.hpp"
+#include "rtl/ref.hxx"
+#include "sal/types.h"
+
+#include "modifications.hxx"
+#include "nodemap.hxx"
+#include "path.hxx"
+
+namespace rtl { class OUString; }
+
+namespace configmgr {
+
+class Node;
+
+struct Data: private boost::noncopyable {
+ enum { NO_LAYER = INT_MAX };
+
+ NodeMap templates;
+
+ NodeMap components;
+
+ Modifications modifications;
+
+ static rtl::OUString createSegment(
+ rtl::OUString const & templateName, rtl::OUString const & name);
+
+ static sal_Int32 parseSegment(
+ rtl::OUString const & path, sal_Int32 index, rtl::OUString * name,
+ bool * setElement, rtl::OUString * templateName);
+
+ static rtl::OUString fullTemplateName(
+ rtl::OUString const & component, rtl::OUString const & name);
+
+ //TODO: better rules under which circumstances a short template name matches
+ static bool equalTemplateNames(
+ rtl::OUString const & shortName, rtl::OUString const & longName);
+
+ static rtl::Reference< Node > findNode(
+ int layer, NodeMap const & map, rtl::OUString const & name);
+
+ rtl::Reference< Node > resolvePathRepresentation(
+ rtl::OUString const & pathRepresentation, Path * path,
+ int * finalizedLayer) const;
+
+ rtl::Reference< Node > getTemplate(
+ int layer, rtl::OUString const & fullName) const;
+};
+
+}
+
+#endif
diff --git a/configmgr/source/data/anydata.cxx b/configmgr/source/data/anydata.cxx
deleted file mode 100644
index d9db337edf..0000000000
--- a/configmgr/source/data/anydata.cxx
+++ /dev/null
@@ -1,468 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "anydata.hxx"
-#include "sequence.hxx"
-#include "flags.hxx"
-#include "typeconverter.hxx"
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace sharable
- {
-//-----------------------------------------------------------------------------
- namespace Type = data::Type;
- namespace uno = ::com::sun::star::uno;
-//-----------------------------------------------------------------------------
-
-sal_uInt8 getTypeCode(uno::Type const & _aType)
-{
- switch (_aType.getTypeClass())
- {
- case uno::TypeClass_ANY:
- case uno::TypeClass_VOID:
- return Type::value_any;
-
- case uno::TypeClass_STRING:
- return Type::value_string;
-
- case uno::TypeClass_BOOLEAN:
- return Type::value_boolean;
-
- case uno::TypeClass_SHORT:
- return Type::value_short;
-
- case uno::TypeClass_LONG:
- return Type::value_int;
-
- case uno::TypeClass_HYPER:
- return Type::value_long;
-
- case uno::TypeClass_FLOAT:
- case uno::TypeClass_DOUBLE:
- return Type::value_double;
-
- case uno::TypeClass_SEQUENCE:
- {
- uno::Type aElementType = getSequenceElementType(_aType);
-
- if (aElementType.getTypeClass() == uno::TypeClass_BYTE)
- return Type::value_binary;
-
- OSL_ASSERT(aElementType != _aType); // would cause infinite recursion
- sal_uInt8 aElementTC = getTypeCode(aElementType);
-
- OSL_ASSERT(Type::value_invalid & Type::flag_sequence); // ensure check works for invalid types
-
- if (aElementTC & Type::flag_sequence) // no sequence of sequence
- return Type::value_invalid;
-
- return sal_uInt8( aElementTC | Type::flag_sequence );
- }
- default:
- return Type::value_invalid;
- }
-}
-//-----------------------------------------------------------------------------
-
-static uno::Type getUnoSimpleType( sal_uInt8 _aSimpleType)
-{
- OSL_ENSURE( _aSimpleType == (_aSimpleType & Type::mask_basetype), "Invalid type code" );
-
- switch (_aSimpleType)
- {
- case Type::value_string:
- return ::getCppuType(static_cast<rtl::OUString const *>(0));
-
- case Type::value_boolean:
- return ::getBooleanCppuType();
-
- case Type::value_short:
- return ::getCppuType(static_cast<sal_Int16 const *>(0));
-
- case Type::value_int:
- return ::getCppuType(static_cast<sal_Int32 const *>(0));
-
- case Type::value_long:
- return ::getCppuType(static_cast<sal_Int64 const *>(0));
-
- case Type::value_double:
- return ::getCppuType(static_cast<double const *>(0));
-
- case Type::value_binary:
- return ::getCppuType(static_cast<uno::Sequence<sal_Int8> const *>(0));
-
- case Type::value_any:
- //return ::getVoidCppuType();
- return ::getCppuType(static_cast<uno::Any const *>(0));
-
- default:
- OSL_ENSURE( false, "Invalid type code" );
- return ::getVoidCppuType();
- }
-}
-//-----------------------------------------------------------------------------
-
-static uno::Type getUnoSequenceType( sal_uInt8 _aSimpleType)
-{
- OSL_ENSURE( _aSimpleType == (_aSimpleType & Type::mask_basetype), "Invalid type code" );
-
- switch (_aSimpleType)
- {
- case Type::value_string:
- return ::getCppuType(static_cast<uno::Sequence<rtl::OUString> const *>(0));
-
- case Type::value_boolean:
- return ::getCppuType(static_cast<uno::Sequence<sal_Bool> const *>(0));
-
- case Type::value_short:
- return ::getCppuType(static_cast<uno::Sequence<sal_Int16> const *>(0));
-
- case Type::value_int:
- return ::getCppuType(static_cast<uno::Sequence<sal_Int32> const *>(0));
-
- case Type::value_long:
- return ::getCppuType(static_cast<uno::Sequence<sal_Int64> const *>(0));
-
- case Type::value_double:
- return ::getCppuType(static_cast<uno::Sequence<double> const *>(0));
-
- case Type::value_binary:
- return ::getCppuType(static_cast<uno::Sequence<uno::Sequence<sal_Int8> > const *>(0));
-
- case Type::value_any: // results from value_invalid
- default:
- OSL_ENSURE( false, "Invalid type code" );
- return ::getVoidCppuType();
- }
-}
-//-----------------------------------------------------------------------------
-
-uno::Type getUnoType( sal_uInt8 _aType)
-{
- OSL_ENSURE( _aType == (_aType & Type::mask_valuetype), "Invalid type code" );
-
- if (_aType & Type::flag_sequence)
- return getUnoSequenceType( sal_uInt8(_aType & Type::mask_basetype));
-
- else
- return getUnoSimpleType(_aType);
-}
-//-----------------------------------------------------------------------------
-
-static
-AnyData allocSimpleData(sal_uInt8 _aSimpleType, uno::Any const & _aAny)
-{
- OSL_ENSURE( _aSimpleType == (_aSimpleType & Type::mask_basetype), "Invalid type code" );
-
- AnyData aResult;
- aResult.data = 0;
-
- switch (_aSimpleType)
- {
- case Type::value_string:
- {
- rtl::OUString sValue;
- OSL_VERIFY(_aAny >>= sValue );
- aResult.stringValue = acquireString(sValue);
- }
- break;
-
- case Type::value_boolean:
- OSL_VERIFY(_aAny >>= aResult.boolValue );
- break;
-
- case Type::value_short:
- OSL_VERIFY(_aAny >>= aResult.shortValue);
- break;
-
- case Type::value_int:
- OSL_VERIFY(_aAny >>= aResult.intValue);
- break;
-
- case Type::value_long:
- {
- sal_Int64 nValue = 0;
- OSL_VERIFY(_aAny >>= nValue);
-
- aResult.longValue = new sal_Int64( nValue );
- }
- break;
-
- case Type::value_double:
- {
- double dValue = 0;
- OSL_VERIFY(_aAny >>= dValue);
-
- aResult.doubleValue = new double( dValue );
- }
- break;
-
- case Type::value_binary:
- {
- uno::Sequence<sal_Int8> aValue;
- OSL_VERIFY(_aAny >>= aValue);
- aResult.binaryValue = allocBinary(aValue);
- }
- break;
-
- case Type::value_any:
- OSL_ENSURE( false, "Trying to allocate void value" );
- break;
-
- default:
- OSL_ENSURE( false, "Invalid type code" );
- break;
- }
-
- return aResult;
-}
-//-----------------------------------------------------------------------------
-
-template <class E>
-inline
-sal_Sequence const * extractSequenceData(uno::Sequence< E > & _rSeq, uno::Any const & _aAny)
-{
- if (_aAny >>= _rSeq)
- {
- return _rSeq.get();
- }
-
- else
- {
- OSL_ENSURE(false, "Could not extract sequence from Any");
- return NULL;
- }
-}
-//-----------------------------------------------------------------------------
-
-static
-AnyData allocSequenceData(sal_uInt8 _aSimpleType, uno::Any const & _aAny)
-{
- OSL_ENSURE( _aSimpleType == (_aSimpleType & Type::mask_basetype), "Invalid type code" );
-
- sal_uInt8 * aSequence = 0;
-
- switch (_aSimpleType)
- {
- case Type::value_string:
- {
- uno::Sequence<rtl::OUString> aSeqValue;
- if (sal_Sequence const * pData = extractSequenceData(aSeqValue,_aAny))
- aSequence = allocSequence(_aSimpleType,pData);
- }
- break;
-
- case Type::value_boolean:
- {
- uno::Sequence<sal_Bool> aSeqValue;
- if (sal_Sequence const * pData = extractSequenceData(aSeqValue,_aAny))
- aSequence = allocSequence(_aSimpleType,pData);
- }
- break;
-
- case Type::value_short:
- {
- uno::Sequence<sal_Int16> aSeqValue;
- if (sal_Sequence const * pData = extractSequenceData(aSeqValue,_aAny))
- aSequence = allocSequence(_aSimpleType,pData);
- }
- break;
-
- case Type::value_int:
- {
- uno::Sequence<sal_Int32> aSeqValue;
- if (sal_Sequence const * pData = extractSequenceData(aSeqValue,_aAny))
- aSequence = allocSequence(_aSimpleType,pData);
- }
- break;
-
- case Type::value_long:
- {
- uno::Sequence<sal_Int64> aSeqValue;
- if (sal_Sequence const * pData = extractSequenceData(aSeqValue,_aAny))
- aSequence = allocSequence(_aSimpleType,pData);
- }
- break;
-
- case Type::value_double:
- {
- uno::Sequence<double> aSeqValue;
- if (sal_Sequence const * pData = extractSequenceData(aSeqValue,_aAny))
- aSequence = allocSequence(_aSimpleType,pData);
- }
- break;
-
- case Type::value_binary:
- {
- uno::Sequence<uno::Sequence<sal_Int8> > aSeqValue;
- if (sal_Sequence const * pData = extractSequenceData(aSeqValue,_aAny))
- aSequence = allocSequence(_aSimpleType,pData);
- }
- break;
-
- case Type::value_any: // results from value_invalid
- default:
- OSL_ENSURE( false, "Invalid type code" );
- break;
- }
-
- AnyData aResult;
- aResult.sequenceValue = aSequence;
- return aResult;
-}
-//-----------------------------------------------------------------------------
-
-AnyData allocData(sal_uInt8 _aType, uno::Any const & _aAny)
-{
- OSL_ENSURE( _aType == (_aType & Type::mask_valuetype), "Invalid type code" );
- OSL_ENSURE( _aType == getTypeCode(_aAny.getValueType()), "Type code does not match value" );
-
- if (_aType & Type::flag_sequence)
- return allocSequenceData(sal_uInt8( _aType & Type::mask_basetype),_aAny);
- else
- return allocSimpleData(_aType,_aAny);
-}
-//-----------------------------------------------------------------------------
-
-static
-void freeSimpleData(sal_uInt8 _aSimpleType, AnyData const & _aData)
-{
- OSL_ENSURE( _aSimpleType == (_aSimpleType & Type::mask_basetype), "Invalid type code" );
-
- switch (_aSimpleType)
- {
- case Type::value_string:
- rtl_uString_release(_aData.stringValue);
- break;
-
- case Type::value_boolean:
- case Type::value_short:
- case Type::value_int:
- // nothing to do
- break;
-
- // free memory for oversized values
- case Type::value_long:
- delete _aData.longValue;
- break;
-
- case Type::value_double:
- delete _aData.doubleValue;
- break;
-
- case Type::value_binary:
- freeBinary(_aData.binaryValue);
- break;
-
- case Type::value_any:
- // nothing to do for void value
- break;
-
- default:
- OSL_ENSURE( false, "Invalid type code" );
- break;
- }
-}
-//-----------------------------------------------------------------------------
-
-void freeData(sal_uInt8 _aType, AnyData _aData)
-{
- OSL_ENSURE( _aType == (_aType & Type::mask_valuetype), "Invalid type code" );
-
- if (_aType & Type::flag_sequence)
- freeSequence(sal_uInt8(_aType & Type::mask_basetype),_aData.sequenceValue);
-
- else
- freeSimpleData(_aType,_aData);
-}
-//-----------------------------------------------------------------------------
-
-static
-uno::Any readSimpleData(sal_uInt8 _aSimpleType, AnyData const & _aData)
-{
- OSL_ENSURE( _aSimpleType == (_aSimpleType & Type::mask_basetype), "Invalid type code" );
-
- switch (_aSimpleType)
- {
- case Type::value_string:
- {
- rtl::OUString sValue = rtl::OUString(_aData.stringValue);
- return uno::makeAny(sValue);
- }
-
- case Type::value_boolean:
- return uno::makeAny( _aData.boolValue );
-
- case Type::value_short:
- return uno::makeAny( _aData.shortValue );
-
- case Type::value_int:
- return uno::makeAny( _aData.intValue );
-
- case Type::value_long:
- return uno::makeAny( *_aData.longValue );
-
- case Type::value_double:
- return uno::makeAny( *_aData.doubleValue );
-
- case Type::value_binary:
- {
- uno::Sequence<sal_Int8> aValue = readBinary( _aData.binaryValue );
- return uno::makeAny( aValue );
- }
-
- case Type::value_any: // void value
- return uno::Any();
-
- default:
- OSL_ENSURE( false, "Invalid type code" );
- return uno::Any();
- }
-}
-//-----------------------------------------------------------------------------
-
-uno::Any readData(sal_uInt8 _aType, AnyData _aData)
-{
- OSL_ENSURE( _aType == (_aType & Type::mask_valuetype), "Invalid type code" );
-
- if (_aType & Type::flag_sequence)
- return readAnySequence(sal_uInt8(_aType & Type::mask_basetype),_aData.sequenceValue);
-
- else
- return readSimpleData(_aType,_aData);
-}
-
-//-----------------------------------------------------------------------------
- }
-//-----------------------------------------------------------------------------
-} // namespace
-
diff --git a/configmgr/source/data/makefile.mk b/configmgr/source/data/makefile.mk
deleted file mode 100644
index fd6dc059b5..0000000000
--- a/configmgr/source/data/makefile.mk
+++ /dev/null
@@ -1,50 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJINC=$(PRJ)$/source$/inc
-PRJNAME=configmgr
-TARGET=data
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings ----------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/makefile.pmk
-.INCLUDE : $(PRJ)$/version.mk
-
-# --- Files -------------------------------------
-
-SLOFILES= \
- $(SLO)$/anydata.obj \
- $(SLO)$/sequence.obj
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/configmgr/source/data/sequence.cxx b/configmgr/source/data/sequence.cxx
deleted file mode 100644
index 4c286be24e..0000000000
--- a/configmgr/source/data/sequence.cxx
+++ /dev/null
@@ -1,490 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "datalock.hxx"
-#include "sequence.hxx"
-#include "flags.hxx"
-
-#ifndef INCLUDED_ALGORITHM
-#include <algorithm>
-#define INCLUDED_ALGORITHM
-#endif
-
-#ifndef INCLUDED_STRING_H
-#include <string.h>
-#define INCLUDED_STRING_H
-#endif
-
-#include "utility.hxx"
-
-#ifndef SIMPLE_REFERENCE_FAST
-# include <stdio.h>
-#endif
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace sharable
- {
-//-----------------------------------------------------------------------------
- namespace Type = data::Type;
- namespace uno = ::com::sun::star::uno;
-//-----------------------------------------------------------------------------
-static
-sal_uInt32 implGetElementSize(sal_uInt8 _aElementType)
-{
- OSL_ASSERT(_aElementType == (_aElementType & Type::mask_basetype));
- switch (_aElementType)
- {
-
- case Type::value_boolean: return sizeof(sal_Bool);
-
- case Type::value_short: return sizeof(sal_Int16);
-
- case Type::value_int: return sizeof(sal_Int32);
-
- case Type::value_long: return sizeof(sal_Int64);
-
- case Type::value_double: return sizeof(double);
-
- case Type::value_string: return sizeof(rtl_uString *);
-
- case Type::value_binary: return sizeof(sal_uInt8 *);
-
- case Type::value_any: // results from value_invalid
- default:
- OSL_ENSURE( false, "Invalid type code" );
- return 0;
- }
-}
-
-//-----------------------------------------------------------------------------
-static inline
-sal_uInt32 implGetHeaderSize(sal_uInt32 _nElemSize)
-{
- // pad header to elem size, if larger (for safe alignment)
- OSL_ASSERT(_nElemSize > sizeof(sal_Int32) || sizeof(sal_Int32) % _nElemSize== 0);
- return _nElemSize > sizeof(sal_Int32) ? _nElemSize : sizeof(sal_Int32);
-}
-
-//-----------------------------------------------------------------------------
-static
-inline
-sal_Int32& implGetSize(sal_uInt8 * _aSeq)
-{
- return * (sal_Int32 *) _aSeq;
-}
-
-//-----------------------------------------------------------------------------
-static
-sal_uInt8 * implSeqAlloc(sal_Int32 _nElements, sal_uInt32 _nElemSize)
-{
- sal_uInt32 nTotalSize = implGetHeaderSize(_nElemSize) + _nElements * _nElemSize;
-
- sal_uInt8 * aResult = (sal_uInt8 *) (new sal_uInt8[nTotalSize]);
-
- implGetSize(aResult) = _nElements;
-
- return aResult;
-}
-
-//-----------------------------------------------------------------------------
-
-static
-void allocSeqData(sal_uInt8 *_pDestAddr,
- sal_uInt8 _aElementType,
- sal_Int32 _nElements, sal_uInt32 _nElementSize,
- void const * _pSourceData)
-{
- OSL_ASSERT(_aElementType == (_aElementType & Type::mask_basetype));
- OSL_ASSERT(_nElementSize == implGetElementSize(_aElementType));
- switch (_aElementType)
- {
- case Type::value_boolean:
- case Type::value_short:
- case Type::value_int:
- case Type::value_long:
- case Type::value_double:
- ::memcpy(_pDestAddr,_pSourceData,_nElements * _nElementSize);
- break;
-
- case Type::value_string:
- {
- OSL_ASSERT(_nElementSize == sizeof(rtl_uString *));
-
- rtl::OUString const * pSource = static_cast<rtl::OUString const *>(_pSourceData);
-
- while (--_nElements >= 0)
- {
- rtl_uString * aElement = acquireString(*pSource);
-
- rtl_uString * * pDest = reinterpret_cast<rtl_uString **>(_pDestAddr);
- *pDest = aElement;
-
- ++pSource;
- _pDestAddr += sizeof *pDest;
- }
- }
- break;
-
- case Type::value_binary:
- {
- OSL_ASSERT(_nElementSize == sizeof(sal_uInt8 *));
-
- uno::Sequence< sal_Int8 > const * pSource = static_cast<uno::Sequence< sal_Int8 > const *>(_pSourceData);
-
- while (--_nElements >= 0)
- {
- sal_uInt8 * aElement = allocBinary(*pSource);
-
- sal_uInt8 * * pDest = (sal_uInt8 * *) _pDestAddr;
- *pDest = aElement;
-
- ++pSource;
- _pDestAddr += sizeof *pDest;
- }
- }
- break;
-
- case Type::value_any:
- default:
- OSL_ENSURE(false, "Invalid element type");
- break;
- }
-}
-
-//-----------------------------------------------------------------------------
-sal_uInt8 * allocSequence(sal_uInt8 _aElementType, ::sal_Sequence const * _pSeqData)
-{
- OSL_ENSURE(_aElementType == (_aElementType & Type::mask_valuetype), "Invalid type code");
-
- OSL_ENSURE(_pSeqData, "ERROR: Trying to allocate from a NULL sequence");
- if (_pSeqData == NULL) return 0;
-
- // OSL_ASSERT(_aElementType == (_aElementType & Type::mask_basetype));
- _aElementType &= Type::mask_basetype;
-
- sal_uInt32 const nElementSize = implGetElementSize(_aElementType);
- sal_Int32 const nElements = _pSeqData->nElements;
-
- sal_uInt8 * aResult = implSeqAlloc(nElements,nElementSize);
-
- if (aResult)
- allocSeqData( aResult + implGetHeaderSize(nElementSize),
- _aElementType, nElements, nElementSize,
- _pSeqData->elements);
-
- return aResult;
-}
-
-//-----------------------------------------------------------------------------
-sal_uInt8 * allocBinary(uno::Sequence<sal_Int8> const & _aBinaryValue)
-{
- sal_uInt32 const nElementSize = 1;
- sal_Int32 const nLength = _aBinaryValue.getLength();
-
- sal_uInt8 * aResult = implSeqAlloc(nLength,nElementSize);
-
- if (aResult)
- {
- sal_uInt8 *pElementBaseAddr = aResult + implGetHeaderSize(nElementSize);
- ::memcpy(pElementBaseAddr, _aBinaryValue.getConstArray(), nLength);
- }
-
- return aResult;
-}
-
-//-----------------------------------------------------------------------------
-static
-void freeSeqData(sal_uInt8 *_pDataAddr,
- sal_uInt8 _aElementType, sal_Int32 _nElements)
-{
- OSL_ASSERT(_aElementType == (_aElementType & Type::mask_basetype));
-
- switch (_aElementType)
- {
- case Type::value_boolean:
- case Type::value_short:
- case Type::value_int:
- case Type::value_long:
- case Type::value_double:
- // nothing to do
- break;
-
- case Type::value_string:
- {
- rtl_uString * * pElements = reinterpret_cast<rtl_uString **>( _pDataAddr );
-
- for (sal_Int32 i = 0; i < _nElements; ++i)
- {
- rtl_uString_release(pElements[i]);
- }
- }
- break;
-
- case Type::value_binary:
- {
- sal_uInt8 * * pElements = reinterpret_cast<sal_uInt8 **>( _pDataAddr );
-
- for (sal_Int32 i = 0; i < _nElements; ++i)
- {
- freeBinary(pElements[i]);
- }
- }
- break;
-
- case Type::value_any:
- default:
- OSL_ENSURE(false, "Invalid element type");
- break;
- }
-}
-
-//-----------------------------------------------------------------------------
-void freeSequence(sal_uInt8 _aElementType, sal_uInt8 * _aSeq)
-{
- OSL_ENSURE(_aElementType == (_aElementType & Type::mask_valuetype), "Invalid type code");
-
- OSL_ENSURE(_aSeq, "ERROR: Trying to free a NULL sequence");
- if (_aSeq == 0) return;
-
- // OSL_ASSERT(_aElementType == (_aElementType & Type::mask_basetype));
- _aElementType &= Type::mask_basetype;
-
- sal_uInt32 nHeaderSize = implGetHeaderSize( implGetElementSize( _aElementType ) );
-
- freeSeqData(_aSeq + nHeaderSize, _aElementType, implGetSize(_aSeq));
-
- delete[] (sal_uInt8 *)_aSeq;
-}
-
-//-----------------------------------------------------------------------------
-void freeBinary(sal_uInt8 * _aSeq)
-{
- OSL_ENSURE(_aSeq, "ERROR: Trying to free a NULL sequence");
- if (_aSeq == 0) return;
-
- delete[] (sal_uInt8 *)_aSeq;
-}
-
-//-----------------------------------------------------------------------------
-
-static inline
-sal_Sequence * implCreateSequence(void const * _pElements, sal_uInt8 _aElementType, sal_Int32 _nElements)
-{
- uno::Type aUnoType = getUnoType( sal_uInt8( _aElementType | Type::flag_sequence ));
-
- sal_Sequence * pResult = NULL;
- ::uno_type_sequence_construct( &pResult, aUnoType.getTypeLibType(),
- const_cast< void * >( _pElements ),
- _nElements, NULL );
-
- OSL_ASSERT(pResult->nRefCount == 1);
- return pResult;
-}
-
-//-----------------------------------------------------------------------------
-static
-sal_Sequence * readSeqData(sal_uInt8 *_pDataAddr, sal_uInt8 _aElementType, sal_Int32 _nElements)
-{
- OSL_ASSERT(_aElementType == (_aElementType & Type::mask_basetype));
-
- void const * pElementData = (void const *)_pDataAddr;
- switch (_aElementType)
- {
- case Type::value_boolean:
- case Type::value_short:
- case Type::value_int:
- case Type::value_long:
- case Type::value_double:
- return implCreateSequence(pElementData,_aElementType,_nElements);
-
- case Type::value_string:
- {
- uno::Sequence<rtl::OUString> aResult(_nElements);
- rtl::OUString * pResult = aResult.getArray();
-
- rtl_uString * const * pElements = static_cast<rtl_uString * const *>( pElementData );
-
- for (sal_Int32 i = 0; i < _nElements; ++i)
- {
- pResult[i] = rtl::OUString(pElements[i]);
- }
-
- sal_Sequence * pRet = aResult.get();
- ++pRet->nRefCount;
- return pRet;
- }
-
- case Type::value_binary:
- {
- uno::Sequence< uno::Sequence< sal_Int8 > > aResult(_nElements);
- uno::Sequence< sal_Int8 > * pResult = aResult.getArray();
-
- sal_uInt8 * const * pElements = static_cast<sal_uInt8 * const *>( pElementData );
-
- for (sal_Int32 i = 0; i < _nElements; ++i)
- {
- pResult[i] = readBinary(pElements[i]);
- }
-
- sal_Sequence * pRet = aResult.get();
- ++pRet->nRefCount;
- return pRet;
- }
-
- case Type::value_any:
- default:
- OSL_ENSURE(false, "Invalid element type");
- return NULL;
- }
-}
-
-//-----------------------------------------------------------------------------
-
-::sal_Sequence * readSequence(sal_uInt8 _aElementType, sal_uInt8 * _aSeq)
-{
- OSL_ENSURE(_aElementType == (_aElementType & Type::mask_valuetype), "Invalid type code");
-
- OSL_ENSURE(_aSeq, "ERROR: Trying to read from a NULL sequence");
- if (_aSeq == 0) return NULL;
-
- // OSL_ASSERT(_aElementType == (_aElementType & Type::mask_basetype));
- _aElementType &= Type::mask_basetype;
-
- sal_uInt32 nHeaderSize = implGetHeaderSize( implGetElementSize( _aElementType ) );
-
- return readSeqData(_aSeq + nHeaderSize, _aElementType, implGetSize(_aSeq));
-}
-
-//-----------------------------------------------------------------------------
-uno::Any readAnySequence(sal_uInt8 _aElementType, sal_uInt8 * _aSeq)
-{
- sal_Sequence * pRawSequence = readSequence(_aElementType, _aSeq);
-
- uno::Any aResult;
-
- if (pRawSequence != NULL)
- switch (_aElementType & Type::mask_basetype)
- {
- case Type::value_string:
- {
- uno::Sequence< rtl::OUString > aSequence(pRawSequence,SAL_NO_ACQUIRE);
- aResult <<=aSequence ;
- }
- break;
-
- case Type::value_boolean:
- {
- uno::Sequence< sal_Bool > aSequence(pRawSequence,SAL_NO_ACQUIRE);
- aResult <<=aSequence ;
- }
- break;
-
- case Type::value_short:
- {
- uno::Sequence< sal_Int16 > aSequence(pRawSequence,SAL_NO_ACQUIRE);
- aResult <<=aSequence ;
- }
- break;
-
- case Type::value_int:
- {
- uno::Sequence< sal_Int32 > aSequence(pRawSequence,SAL_NO_ACQUIRE);
- aResult <<=aSequence ;
- }
- break;
-
- case Type::value_long:
- {
- uno::Sequence< sal_Int64 > aSequence(pRawSequence,SAL_NO_ACQUIRE);
- aResult <<=aSequence ;
- }
- break;
-
- case Type::value_double:
- {
- uno::Sequence< double > aSequence(pRawSequence,SAL_NO_ACQUIRE);
- aResult <<=aSequence ;
- }
- break;
-
- case Type::value_binary:
- {
- uno::Sequence< uno::Sequence< sal_Int8 > > aSequence(pRawSequence,SAL_NO_ACQUIRE);
- aResult <<=aSequence ;
- }
- break;
-
- case Type::value_any: // from value_invalid ??
- default:
- OSL_ENSURE( false, "Invalid type code" );
- break;
- }
-
- OSL_ASSERT(!aResult.hasValue() || aResult.getValueType() == getUnoType(sal_uInt8(_aElementType | Type::flag_sequence)));
-
- return aResult;
-}
-
-//-----------------------------------------------------------------------------
-uno::Sequence<sal_Int8> readBinary(sal_uInt8 * _aSeq)
-{
- OSL_ENSURE(_aSeq, "ERROR: Trying to read from a NULL sequence");
- if (_aSeq == 0) return uno::Sequence<sal_Int8>();
-
- return uno::Sequence< sal_Int8 >((const sal_Int8 *)(_aSeq + implGetHeaderSize(1)),
- implGetSize(_aSeq));
-}
-
-//-----------------------------------------------------------------------------
- }
-//-----------------------------------------------------------------------------
-} // namespace
-
-// Remaining 'global' mutex bits - should move to api2 ...
-namespace configmgr
-{
- osl::Mutex UnoApiLock::aCoreLock;
- volatile oslInterlockedCount UnoApiLock::nHeld = 0;
-
- UnoApiLockReleaser::UnoApiLockReleaser()
- {
- mnCount = UnoApiLock::nHeld;
- for (oslInterlockedCount i = 0; i < mnCount; i++)
- UnoApiLock::release();
- }
-
- UnoApiLockReleaser::~UnoApiLockReleaser()
- {
- for (oslInterlockedCount i = 0; i < mnCount; i++)
- UnoApiLock::acquire();
- }
-} // namespace configmgr
diff --git a/configmgr/source/defaultprovider.cxx b/configmgr/source/defaultprovider.cxx
new file mode 100644
index 0000000000..d069663290
--- /dev/null
+++ b/configmgr/source/defaultprovider.cxx
@@ -0,0 +1,131 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/lang/XSingleComponentFactory.hpp"
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/Exception.hpp"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "cppuhelper/factory.hxx"
+#include "cppuhelper/implbase1.hxx"
+#include "cppuhelper/weak.hxx"
+#include "sal/types.h"
+#include "rtl/unload.h"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+
+#include "configurationprovider.hxx"
+#include "lock.hxx"
+
+namespace configmgr { namespace default_provider {
+
+namespace {
+
+namespace css = com::sun::star;
+
+class Factory:
+ public cppu::WeakImplHelper1< css::lang::XSingleComponentFactory >,
+ private boost::noncopyable
+{
+public:
+ Factory() {}
+
+private:
+ virtual ~Factory() {}
+
+ virtual css::uno::Reference< css::uno::XInterface > SAL_CALL
+ createInstanceWithContext(
+ css::uno::Reference< css::uno::XComponentContext > const & Context)
+ throw (css::uno::Exception, css::uno::RuntimeException);
+
+ virtual css::uno::Reference< css::uno::XInterface > SAL_CALL
+ createInstanceWithArgumentsAndContext(
+ css::uno::Sequence< css::uno::Any > const & Arguments,
+ css::uno::Reference< css::uno::XComponentContext > const & Context)
+ throw (css::uno::Exception, css::uno::RuntimeException);
+};
+
+css::uno::Reference< css::uno::XInterface > Factory::createInstanceWithContext(
+ css::uno::Reference< css::uno::XComponentContext > const & Context)
+ throw (css::uno::Exception, css::uno::RuntimeException)
+{
+ return createInstanceWithArgumentsAndContext(
+ css::uno::Sequence< css::uno::Any >(), Context);
+}
+
+css::uno::Reference< css::uno::XInterface >
+Factory::createInstanceWithArgumentsAndContext(
+ css::uno::Sequence< css::uno::Any > const & Arguments,
+ css::uno::Reference< css::uno::XComponentContext > const & Context)
+ throw (css::uno::Exception, css::uno::RuntimeException)
+{
+ if (Arguments.getLength() != 0) {
+ throw css::uno::Exception(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.DefaultProvider must be"
+ " instantiated without arguments")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ osl::MutexGuard guard(lock);
+ static css::uno::Reference< css::uno::XInterface > singleton(
+ configuration_provider::createDefault(Context));
+ return singleton;
+}
+
+}
+
+rtl::OUString getImplementationName() {
+ return rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.comp.configuration.DefaultProvider"));
+}
+
+css::uno::Sequence< rtl::OUString > getSupportedServiceNames() {
+ rtl::OUString name(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.DefaultProvider"));
+ return css::uno::Sequence< rtl::OUString >(&name, 1);
+}
+
+css::uno::Reference< css::lang::XSingleComponentFactory >
+SAL_CALL createFactory(
+ cppu::ComponentFactoryFunc, rtl::OUString const &,
+ css::uno::Sequence< rtl::OUString > const &, rtl_ModuleCount *)
+ SAL_THROW(())
+{
+ return new Factory;
+}
+
+} }
diff --git a/configmgr/source/defaultprovider.hxx b/configmgr/source/defaultprovider.hxx
new file mode 100644
index 0000000000..7b267a80b4
--- /dev/null
+++ b/configmgr/source/defaultprovider.hxx
@@ -0,0 +1,59 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_DEFAULTPROVIDER_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_DEFAULTPROVIDER_HXX
+
+#include "sal/config.h"
+
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "cppuhelper/factory.hxx"
+#include "rtl/unload.h"
+#include "sal/types.h"
+
+namespace com { namespace sun { namespace star { namespace lang {
+ class XSingleComponentFactory;
+} } } }
+namespace rtl { class OUString; }
+
+namespace configmgr { namespace default_provider {
+
+rtl::OUString SAL_CALL getImplementationName();
+
+com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL
+getSupportedServiceNames();
+
+com::sun::star::uno::Reference< com::sun::star::lang::XSingleComponentFactory >
+SAL_CALL createFactory(
+ cppu::ComponentFactoryFunc, rtl::OUString const &,
+ com::sun::star::uno::Sequence< rtl::OUString > const &, rtl_ModuleCount *)
+ SAL_THROW(());
+
+} }
+
+#endif
diff --git a/configmgr/source/groupnode.cxx b/configmgr/source/groupnode.cxx
new file mode 100644
index 0000000000..60d825451d
--- /dev/null
+++ b/configmgr/source/groupnode.cxx
@@ -0,0 +1,88 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include "rtl/ref.hxx"
+#include "rtl/ustring.hxx"
+
+#include "data.hxx"
+#include "groupnode.hxx"
+#include "node.hxx"
+#include "nodemap.hxx"
+
+namespace configmgr {
+
+GroupNode::GroupNode(
+ int layer, bool extensible, rtl::OUString const & templateName):
+ Node(layer), extensible_(extensible), templateName_(templateName),
+ mandatory_(Data::NO_LAYER)
+{}
+
+rtl::Reference< Node > GroupNode::clone() const {
+ return new GroupNode(*this);
+}
+
+NodeMap & GroupNode::getMembers() {
+ return members_;
+}
+
+rtl::OUString GroupNode::getTemplateName() const {
+ return templateName_;
+}
+
+void GroupNode::setMandatory(int layer) {
+ mandatory_ = layer;
+}
+
+int GroupNode::getMandatory() const {
+ return mandatory_;
+}
+
+bool GroupNode::isExtensible() const {
+ return extensible_;
+}
+
+GroupNode::GroupNode(GroupNode const & other):
+ Node(other), extensible_(other.extensible_),
+ templateName_(other.templateName_), mandatory_(other.mandatory_)
+{
+ cloneNodeMap(other.members_, &members_);
+}
+
+GroupNode::~GroupNode() {}
+
+Node::Kind GroupNode::kind() const {
+ return KIND_GROUP;
+}
+
+void GroupNode::clear() {
+ members_.clear();
+}
+
+}
diff --git a/configmgr/source/groupnode.hxx b/configmgr/source/groupnode.hxx
new file mode 100644
index 0000000000..be4907b86c
--- /dev/null
+++ b/configmgr/source/groupnode.hxx
@@ -0,0 +1,75 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_GROUPNODE_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_GROUPNODE_HXX
+
+#include "sal/config.h"
+
+#include "rtl/ref.hxx"
+#include "rtl/ustring.hxx"
+
+#include "node.hxx"
+#include "nodemap.hxx"
+
+namespace configmgr {
+
+class GroupNode: public Node {
+public:
+ GroupNode(int layer, bool extensible, rtl::OUString const & templateName);
+
+ virtual rtl::Reference< Node > clone() const;
+
+ virtual NodeMap & getMembers();
+
+ virtual rtl::OUString getTemplateName() const;
+
+ virtual void setMandatory(int layer);
+
+ virtual int getMandatory() const;
+
+ bool isExtensible() const;
+
+private:
+ GroupNode(GroupNode const & other);
+
+ virtual ~GroupNode();
+
+ virtual Kind kind() const;
+
+ virtual void clear();
+
+ bool extensible_;
+ NodeMap members_;
+ rtl::OUString templateName_;
+ // non-empty iff this node is a template, free node, or set member
+ int mandatory_;
+};
+
+}
+
+#endif
diff --git a/configmgr/source/inc/anydata.hxx b/configmgr/source/inc/anydata.hxx
deleted file mode 100644
index f7e676e9c3..0000000000
--- a/configmgr/source/inc/anydata.hxx
+++ /dev/null
@@ -1,78 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef INCLUDED_SHARABLE_ANYDATA_HXX
-#define INCLUDED_SHARABLE_ANYDATA_HXX
-
-#include "rtl/ustring.h"
-#include "sal/types.h"
-
-//-----------------------------------------------------------------------------
-namespace com { namespace sun { namespace star { namespace uno {
- class Any;
- class Type;
-} } } }
-//-----------------------------------------------------------------------------
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
-
- namespace sharable
- {
- //-----------------------------------------------------------------------------
-
- union AnyData
- {
- sal_Bool boolValue;
- sal_Int16 shortValue;
- sal_Int32 intValue;
- sal_Int64 *longValue;
- double *doubleValue;
- sal_uInt8 * binaryValue; // points to counted sal_(u)Int8 []
- rtl_uString * stringValue; // points to counted sal_Unicode []
- sal_uInt8 * sequenceValue; // points to counted AnyData [] (or SomeType [] ?)
- void *data; // used to initialize to 0
- };
-
- //-----------------------------------------------------------------------------
-
- sal_uInt8 getTypeCode(::com::sun::star::uno::Type const & _aType);
- ::com::sun::star::uno::Type getUnoType( sal_uInt8 _aType);
-
- AnyData allocData(sal_uInt8 _aType, ::com::sun::star::uno::Any const & _aAny);
- void freeData(sal_uInt8 _aType, AnyData _aData);
- ::com::sun::star::uno::Any readData(sal_uInt8 _aType, AnyData _aData);
-
- //-----------------------------------------------------------------------------
- }
-//-----------------------------------------------------------------------------
-}
-
-
-#endif // INCLUDED_SHARABLE_ANYDATA_HXX
-
diff --git a/configmgr/source/inc/anynoderef.hxx b/configmgr/source/inc/anynoderef.hxx
deleted file mode 100644
index 44bb812e4a..0000000000
--- a/configmgr/source/inc/anynoderef.hxx
+++ /dev/null
@@ -1,157 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CONFIGANYNODE_HXX_
-#define CONFIGMGR_CONFIGANYNODE_HXX_
-
-#include "noderef.hxx"
-
-namespace configmgr
-{
- namespace configapi { class Factory; }
- namespace node { struct Attributes; }
-
- namespace configuration
- {
- //-------------------------------------------------------------------------
- class NodeRef;
- class ValueRef;
- class AnyNodeRef;
- class NodeID;
- class Tree;
- //-------------------------------------------------------------------------
-
- /// represents any node in some tree
- class AnyNodeRef
- {
- public:
- /// constructs an empty (invalid) node
- AnyNodeRef();
-
- AnyNodeRef(unsigned int nParentPos, unsigned int m_nDepth);
- AnyNodeRef(rtl::OUString const& aName, unsigned int nParentPos);
-
- /// converts an inner node
- explicit AnyNodeRef(NodeRef const& aInnerNode);
- /// converts a value node
- explicit AnyNodeRef(ValueRef const& aValueNode);
-
- /// copy a node (with reference semantics)
- AnyNodeRef(AnyNodeRef const& rOther);
- /// copy a node (with reference semantics)
- AnyNodeRef& operator=(AnyNodeRef const& rOther);
-
- void swap(AnyNodeRef& rOther);
-
- ~AnyNodeRef();
-
- /// checks, if this represents an existing node
- inline bool isValid() const;
-
- /// checks if this a node (rather than a value only)
- bool isNode() const;
-
- /// converts this, if it is a value
- ValueRef toValue() const;
-
- /// converts this, if it is a inner node
- NodeRef toNode() const;
-
-#if OSL_DEBUG_LEVEL > 0
- bool checkValidState() const;
-#endif
-
- rtl::OUString m_sNodeName;
- unsigned int m_nUsedPos;
- unsigned int m_nDepth;
- };
- //-------------------------------------------------------------------------
-
- /** checks whether there is an immediate child of <var>aNode</var> (which is in <var>aTree</var>)
- specified by <var>aName</var>
-
- @return
- <TRUE/> if the child node exists
- <FALSE/> otherwise
- */
- inline
- bool hasChildOrElement(rtl::Reference< Tree > const& aTree, AnyNodeRef const& aNode, rtl::OUString const& aName)
- { return aNode.isNode() && hasChildOrElement(aTree,aNode.toNode(),aName); }
-
- /** tries to find the immediate child of <var>aNode</var> (which is in <var>aTree</var>)
- specified by <var>aName</var>
- <p> On return <var>aNode</var> is modified to refer to the node found and
- <var>aTree</var> will then refer to the tree that node is in.
- <p/>
-
- @return The requested child node, if it exists
- (then <var>aTree</var> refers to the tree containing the desired node),
- */
- AnyNodeRef getChildOrElement(rtl::Reference< Tree > & aTree, NodeRef const& aParentNode, rtl::OUString const& aName);
-
- /** tries to find the descendant of <var>aNode</var> specified by <var>aPath</var> within <var>aTree</var>
- <p> This function follows the given path stepwise, until a requested node is missing in the tree.</p>
- <p> On return <var>aNode</var> is modified to refer to the last inner node found
- and <var>aTree</var> will be unchanged (except for deprecated usage).
- <p/>
- <p> Also, <var>aPath</var> is modified to contain the unresolved part of the original path.
- </p>
-
- @return the requested node, if the path could be resolved completely
- (so <var>aNode</var> refers to the desired node or its parent,
- and <var>aPath</var> is empty)<BR/>
- an invalid node otherwise
- */
- AnyNodeRef getLocalDescendant(rtl::Reference< Tree > const& aTree, NodeRef const& aNode, RelativePath const& aPath);
-
- /** tries to find the descendant of <var>aNode</var> (which is in <var>aTree</var>) specified by <var>aPath</var>
- <p> This function follows the given path stepwise, until a requested node is missing in the tree.</p>
- <p> On return <var>aNode</var> is modified to refer to the last inner node found and
- <var>aTree</var> will then refer to the tree that node is in.
- <p/>
- <p> Also, <var>aPath</var> is modified to contain the unresolved part of the original path.
- </p>
-
- @return the requested node, if the path could be resolved completely
- (so <var>aNode</var> and <var>aTree</var> refer to the desired node or its parent,
- and <var>aPath</var> is empty)<BR/>
- an invalid node otherwise
- */
- AnyNodeRef getDeepDescendant(rtl::Reference< Tree > & aTree, NodeRef& aNode, RelativePath& aPath);
-
- //-------------------------------------------------------------------------
- inline bool AnyNodeRef::isValid() const
- {
- OSL_ASSERT( m_nUsedPos == 0 || checkValidState() );
- return m_nUsedPos != 0;
- }
-
- //-------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_CONFIGANYNODE_HXX_
diff --git a/configmgr/source/inc/anypair.hxx b/configmgr/source/inc/anypair.hxx
deleted file mode 100644
index 3694076385..0000000000
--- a/configmgr/source/inc/anypair.hxx
+++ /dev/null
@@ -1,118 +0,0 @@
-#ifndef CFGMGR_ANYPAIR_HXX
-#define CFGMGR_ANYPAIR_HXX
-
-#include <uno/any2.h>
-#include <com/sun/star/uno/Any.h>
-#include <com/sun/star/lang/IllegalArgumentException.hpp>
-
-namespace configmgr
-{
- namespace css = com::sun::star;
- namespace uno = css::uno;
- namespace lang = css::lang;
-
- //==========================================================================
- //= flags for handling the state of an Anypair
- //==========================================================================
- enum {
- cfgmgr_SELECT_FIRST = 0x01,
- cfgmgr_SELECT_SECOND = 0x02,
- cfgmgr_SELECT_BOTH = cfgmgr_SELECT_FIRST | cfgmgr_SELECT_SECOND
- };
-
- //==========================================================================
- //= data structure for descriptive data for an AnyPair
- //==========================================================================
- struct cfgmgr_AnyPair_Desc
- {
- typelib_TypeDescriptionReference * pType;
- sal_uInt8 nState;
- };
-
- inline bool cfgmgr_AnyPair_isNull(cfgmgr_AnyPair_Desc const* _pDesc, sal_uInt8 nSelect)
- { return (_pDesc->nState & nSelect) == 0; }
-
- inline bool cfgmgr_AnyPair_isEmpty(cfgmgr_AnyPair_Desc const* _pDesc)
- { return (typelib_TypeClass_VOID == _pDesc->pType->eTypeClass); }
-
- //==========================================================================
- //= cfgmgr_AnyPair Basic (POD) data structure for a nullable pair of Anys
- //==========================================================================
-
- struct cfgmgr_AnyPair
- {
- cfgmgr_AnyPair_Desc desc;
- const void * first;
- const void * second;
- };
-
-// -----------------------------------------------------------------------------
- //==========================================================================
- //= AnyPair
- //==========================================================================
- // this AnyPair holds 2 nullable Any's which have to have the same type.
-
- class AnyPair
- {
- cfgmgr_AnyPair m_aAnyPair;
-
- public:
- enum SelectMember
- {
- SELECT_FIRST = cfgmgr_SELECT_FIRST,
- SELECT_SECOND = cfgmgr_SELECT_SECOND,
- SELECT_BOTH = cfgmgr_SELECT_BOTH
- };
- public:
- explicit AnyPair(uno::Type const& _aType); // one Type, any's are null
- explicit AnyPair(uno::Any const& _aAny, SelectMember _select); // one selected any
-
- explicit AnyPair(uno::Any const& _aAny, uno::Any const& _aAny2) SAL_THROW((lang::IllegalArgumentException));
-
- // copy
- AnyPair(AnyPair const& _aAny);
- AnyPair& operator=(AnyPair const& _aAny);
-
- // d-tor
- ~AnyPair();
-
- // elementwise setters
- sal_Bool setFirst(uno::Any const& _aAny);
- sal_Bool setSecond(uno::Any const& _aAny);
-
- // clear data (but not type)
- void clear(SelectMember _select = SELECT_BOTH);
-
-
- // checking state and availablity of values
- bool isEmpty() const { return cfgmgr_AnyPair_isEmpty(&m_aAnyPair.desc); }
-
- bool isNull () const { return ! hasValue(); }
-
- bool hasValue(SelectMember _select = SELECT_BOTH) const
- {
- return !cfgmgr_AnyPair_isNull(&m_aAnyPair.desc, (sal_uInt8)_select);
- }
- bool hasFirst() const
- {
- return hasValue(SELECT_FIRST);
- }
- bool hasSecond() const
- {
- return hasValue(SELECT_SECOND);
- }
-
- // elementwise getters
- uno::Type getValueType() const;
- uno::Any getFirst() const;
- uno::Any getSecond() const;
- uno::Any getValue(SelectMember _select) const;
-
- };
-
-
-
-
-} // namespace
-
-#endif
diff --git a/configmgr/source/inc/apitypes.hxx b/configmgr/source/inc/apitypes.hxx
deleted file mode 100644
index 5c0adb6391..0000000000
--- a/configmgr/source/inc/apitypes.hxx
+++ /dev/null
@@ -1,89 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_APITYPES_HXX_
-#define CONFIGMGR_API_APITYPES_HXX_
-
-#include <com/sun/star/uno/Type.hxx>
-#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/uno/XInterface.hpp>
-#include <rtl/ustring.hxx>
-
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif // INCLUDED_VECTOR
-
-namespace configmgr
-{
- namespace configapi
- {
- namespace uno = ::com::sun::star::uno;
-
- inline
- uno::Type getAnyType( )
- {
- return ::getCppuType( static_cast< uno::Any const * >(0) );
- }
-
- inline
- uno::Type getUnoInterfaceType( )
- {
- return ::getCppuType( static_cast< uno::Reference< uno::XInterface > const * >(0) );
- }
-
- template <typename Interface>
- inline
- uno::Type getReferenceType( Interface const* )
- {
- return ::getCppuType( static_cast< uno::Reference<Interface> const * >(0) );
- }
-
- template <typename Type>
- inline
- uno::Type getSequenceType( Type const* )
- {
- return ::getCppuType( static_cast< uno::Sequence<Type> const * >(0) );
- }
-
- template <typename T>
- inline
- uno::Sequence<T> makeSequence(::std::vector<T> const& aVector)
- {
- if (aVector.empty())
- return uno::Sequence<T>();
- return uno::Sequence<T>(&aVector[0],aVector.size());
- }
- }
-
-}
-
-#endif // CONFIGMGR_API_APITYPES_HXX_
-
-
diff --git a/configmgr/source/inc/attributes.hxx b/configmgr/source/inc/attributes.hxx
deleted file mode 100644
index 0dcc19b8f6..0000000000
--- a/configmgr/source/inc/attributes.hxx
+++ /dev/null
@@ -1,133 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CONFIGURATION_ATTRIBUTES_HXX_
-#define CONFIGMGR_CONFIGURATION_ATTRIBUTES_HXX_
-namespace configmgr
-{
- namespace node
- {
- enum State
- {
- isDefault, isToDefault = isDefault,
- isMerged, isModification = isMerged,
- isReplaced, isReplacement = isReplaced,
- isAdded, isAddition = isAdded
- };
- enum Access
- {
- accessNull = 0,
- accessWritable = 0,
- accessFinal = 1,
- accessReadonly = 2,
- accessReadonlyAndFinal = 3
- };
- inline Access makeAccess(bool readonly, bool final)
- { return Access( (readonly ? accessReadonly : accessNull) | (final ? accessFinal : accessNull) ); }
- inline bool isAccessReadonly(Access access)
- { return (access & accessReadonly) != 0; }
- inline bool isAccessFinal(Access access)
- { return (access & accessFinal) != 0; }
-
- inline bool existsInDefault(State eState) { return eState <= isReplaced;}
- inline bool isReplacedForUser(State eState) { return eState >= isReplaced;}
-
- /// holds attributes a node in the schema
- struct Attributes
- {
- Attributes()
- : state_(node::isMerged)
- , bReadonly(false)
- , bFinalized(false)
- , bNullable(true)
- , bLocalized(false)
- , bMandatory(false)
- , bRemovable(false)
- {}
-
- State state() const { return State(0x03 & state_); }
- void setState(State _state) { this->state_ = _state; }
-
- bool isWritable() const { return!bReadonly; }
- bool isReadonly() const { return bReadonly; }
- bool isFinalized() const { return bFinalized; }
-
- void markReadonly() { bReadonly = true; }
-
- Access getAccess() const
- { return makeAccess(bReadonly,bFinalized); }
-
- void setAccess(bool _bReadonly, bool _bFinalized)
- { bReadonly = _bReadonly; bFinalized = _bFinalized; }
-
- void setAccess(Access _aAccessLevel)
- { setAccess( isAccessReadonly(_aAccessLevel), isAccessFinal(_aAccessLevel) ); }
-
- bool isNullable() const { return bNullable; }
- void setNullable (bool _bNullable) {bNullable = _bNullable; }
-
- bool isLocalized() const { return bLocalized; }
- void setLocalized (bool _bLocalized) {bLocalized = _bLocalized; }
-
- bool isMandatory() const { return bMandatory; }
- bool isRemovable() const { return bRemovable; }
-
- void markMandatory() { bMandatory = true; }
- void markRemovable() { bRemovable = true; }
-
- void setRemovability(bool _bRemovable, bool _bMandatory)
- { bRemovable = _bRemovable; bMandatory = _bMandatory; }
-
- bool isDefault() const { return this->state() == node::isDefault;}
- bool existsInDefault() const { return node::existsInDefault(this->state());}
- bool isReplacedForUser() const { return node::isReplacedForUser(this->state());}
-
- void markAsDefault(bool _bDefault = true)
- {
- if (_bDefault)
- this->state_ = node::isDefault;
- else if (this->isDefault())
- this->state_ = node::isMerged;
- }
-
- private:
- State state_ : 2; // merged/replaced/default state
-
- bool bReadonly : 1; // write-protected, if true
- bool bFinalized : 1; // can not be overridden - write protected when merged upwards
-
- bool bNullable : 1; // values only: can be NULL
- bool bLocalized : 1; // values only: value may depend on locale
-
- bool bMandatory : 1; // cannot be removed/replaced in subsequent layers
- bool bRemovable : 1; // can be removed
- };
-
- }
-}
-
-#endif
diff --git a/configmgr/source/inc/autoobject.hxx b/configmgr/source/inc/autoobject.hxx
deleted file mode 100644
index 78d4c17c3e..0000000000
--- a/configmgr/source/inc/autoobject.hxx
+++ /dev/null
@@ -1,97 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_AUTOOBJECT_HXX
-#define CONFIGMGR_AUTOOBJECT_HXX
-
-#include "sal/config.h"
-
-#include "boost/utility.hpp"
-
-#include "utility.hxx"
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- template < class Object >
- class AutoObject: private boost::noncopyable
- {
- public:
- AutoObject() : m_pObject(NULL) {}
- AutoObject(Object * _obj) : m_pObject(_obj) {}
- ~AutoObject() { delete m_pObject; }
-
- bool is() const;
- Object * get() const;
- Object * getOrCreate();
- private:
- Object * internalCreate();
- private:
- Object * m_pObject;
- };
-//-----------------------------------------------------------------------------
-
- template < class Object >
- inline
- Object * AutoObject<Object>::get() const
- {
- return m_pObject;
- }
-//-----------------------------------------------------------------------------
-
- template < class Object >
- inline
- bool AutoObject<Object>::is() const
- {
- return get() != NULL;
- }
-//-----------------------------------------------------------------------------
-
- template < class Object >
- Object * AutoObject<Object>::getOrCreate()
- {
- Object * p = get();
- return p ? p : internalCreate();
- }
-//-----------------------------------------------------------------------------
-
- template < class Object >
- Object * AutoObject<Object>::internalCreate()
- {
- if (m_pObject == NULL)
- m_pObject = new Object();
- return m_pObject;
-
- }
-//-----------------------------------------------------------------------------
-
-////////////////////////////////////////////////////////////////////////////////
-
-} // namespace configmgr
-
-#endif
-
diff --git a/configmgr/source/inc/autoreferencemap.hxx b/configmgr/source/inc/autoreferencemap.hxx
deleted file mode 100644
index 41b877b060..0000000000
--- a/configmgr/source/inc/autoreferencemap.hxx
+++ /dev/null
@@ -1,129 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_AUTOREFERENCEMAP_HXX
-#define CONFIGMGR_AUTOREFERENCEMAP_HXX
-
-#include <rtl/ref.hxx>
-#ifndef INCLUDED_MAP
-#include <map>
-#define INCLUDED_MAP
-#endif
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
-
- template < class Key, class Object, class KeyCompare = std::less<Key> >
- class AutoReferenceMap
- {
- public:
- typedef std::map<Key,rtl::Reference<Object>,KeyCompare> Map;
- public:
- AutoReferenceMap() {}
- ~AutoReferenceMap() {}
-
- Map copy() const
- {
- return m_aMap;
- }
- void swap(Map & _rOtherData)
- {
- m_aMap.swap( _rOtherData );
- }
- void swap(AutoReferenceMap & _rOther)
- {
- this->swap( _rOther.m_aMap );
- }
-
-
- bool has(Key const & _aKey) const;
- rtl::Reference<Object> get(Key const & _aKey) const;
-
- rtl::Reference<Object> insert(Key const & _aKey, rtl::Reference<Object> const & _anEntry);
- rtl::Reference<Object> remove(Key const & _aKey);
-
- private:
- rtl::Reference<Object> internalGet(Key const & _aKey) const
- {
- typename Map::const_iterator it = m_aMap.find(_aKey);
-
- return it != m_aMap.end() ? it->second : rtl::Reference<Object>();
- }
-
- rtl::Reference<Object> internalAdd(Key const & _aKey, rtl::Reference<Object> const & _aNewRef)
- {
- return m_aMap[_aKey] = _aNewRef;
- }
-
- void internalDrop(Key const & _aKey)
- {
- m_aMap.erase(_aKey);
- }
- private:
- Map m_aMap;
- };
-//-----------------------------------------------------------------------------
-
- template < class Key, class Object, class KeyCompare >
- bool AutoReferenceMap<Key,Object,KeyCompare>::has(Key const & _aKey) const
- {
- return internalGet(_aKey).is();
- }
-//-----------------------------------------------------------------------------
-
- template < class Key, class Object, class KeyCompare >
- rtl::Reference<Object> AutoReferenceMap<Key,Object,KeyCompare>::get(Key const & _aKey) const
- {
- return internalGet(_aKey);
- }
-//-----------------------------------------------------------------------------
-
- template < class Key, class Object, class KeyCompare >
- rtl::Reference<Object> AutoReferenceMap<Key,Object,KeyCompare>::insert(Key const & _aKey, rtl::Reference<Object> const & _anEntry)
- {
- rtl::Reference<Object> aRef = internalAdd(_aKey,_anEntry);
- return aRef;
-
- }
-//-----------------------------------------------------------------------------
-
- template < class Key, class Object, class KeyCompare >
- rtl::Reference<Object> AutoReferenceMap<Key,Object,KeyCompare>::remove(Key const & _aKey)
- {
- rtl::Reference<Object> aRef = internalGet(_aKey);
- internalDrop(_aKey);
- return aRef;
- }
-//-----------------------------------------------------------------------------
-
-////////////////////////////////////////////////////////////////////////////////
-
-} // namespace configmgr
-
-#endif
-
diff --git a/configmgr/source/inc/backendfactory.hxx b/configmgr/source/inc/backendfactory.hxx
deleted file mode 100644
index 34e7f1dc14..0000000000
--- a/configmgr/source/inc/backendfactory.hxx
+++ /dev/null
@@ -1,68 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKENDFACTORY_HXX_
-#define CONFIGMGR_BACKENDFACTORY_HXX_
-
-#include <rtl/ref.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/configuration/backend/XBackend.hpp>
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace backend
- {
-//-----------------------------------------------------------------------------
-
- struct IMergedDataProvider;
-//-----------------------------------------------------------------------------
- class BackendFactory
- {
- public:
- rtl::Reference<IMergedDataProvider> createBackend();
-
- com::sun::star::uno::Reference< com::sun::star::configuration::backend::XBackend > getUnoBackend();
-
- static BackendFactory instance(com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > const & _xCtx);
-
- private:
- explicit
- BackendFactory(com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > const & _xCtx)
- : m_xCtx(_xCtx)
- {}
-
- com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > m_xCtx;
- };
-//-----------------------------------------------------------------------------
- }
-//-----------------------------------------------------------------------------
-}
-
-
-#endif
-
diff --git a/configmgr/source/inc/bootstrap.hxx b/configmgr/source/inc/bootstrap.hxx
deleted file mode 100644
index 9b1c95de30..0000000000
--- a/configmgr/source/inc/bootstrap.hxx
+++ /dev/null
@@ -1,240 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BOOTSTRAP_HXX_
-#define CONFIGMGR_BOOTSTRAP_HXX_
-
-#include "bootstrapcontext.hxx"
-
-// ---------------------------------------------------------------------------------------
-#define BOOTSTRAP_ITEM_INIFILE "CFG_INIFILE"
-// ---------------------------------------------------------------------------------------
-// standard settings
-#define SETTING_UNOSERVICE "BackendService"
-#define SETTING_UNOWRAPPER "BackendWrapper"
-#define SETTING_OFFLINE "Offline"
-#define SETTING_LOCALE_NEW "Locale"
-#define SETTING_ASYNC_NEW "EnableAsync"
-#define SETTING_INIFILE "Inifile"
-
-// Prefixes
-#define CONTEXT_MODULE_PREFIX_ "/modules/com.sun.star.configuration/"
-#define CONTEXT_SECTION_BOOTSTRAP_ "bootstrap/"
-#define CONTEXT_ITEM_PREFIX_ CONTEXT_MODULE_PREFIX_ CONTEXT_SECTION_BOOTSTRAP_
-#define BOOTSTRAP_ITEM_PREFIX_ "CFG_"
-
-// special internal context values
-#define CONTEXT_SECTION_INTERNAL_ "factory/"
-#define CONTEXT_INTERNAL_PREFIX_ CONTEXT_MODULE_PREFIX_ CONTEXT_SECTION_INTERNAL_
-#define CONTEXT_ITEM_ADMINFLAG CONTEXT_INTERNAL_PREFIX_"isAdminConfiguration"
-#define CONTEXT_ITEM_BOOTSTRAP_ERROR CONTEXT_INTERNAL_PREFIX_"theBootstrapError"
-
-#define CONTEXT_ITEM_IS_WRAPPER_CONTEXT CONTEXT_INTERNAL_PREFIX_"isWrapperContext"
-#define CONTEXT_ITEM_IS_BOOTSTRAP_CONTEXT CONTEXT_INTERNAL_PREFIX_"isBootstrapContext"
-
-// ---------------------------------------------------------------------------------------
-#define A_DefaultProviderSingletonName "com.sun.star.configuration.theDefaultProvider"
-#define K_DefaultBackendSingletonName "com.sun.star.configuration.backend.theDefaultBackend"
-#define A_BootstrapContextSingletonName "com.sun.star.configuration.bootstrap.theBootstrapContext"
-// -------------------------------------------------------------------------
-#define A_DefaultProviderServiceAndImplName "com.sun.star.configuration.DefaultProvider"
-#define K_DefaultBackendServiceAndImplName "com.sun.star.configuration.backend.DefaultBackend"
-// ---------------------------------------------------------------------------------------
-namespace configmgr
-{
- // -----------------------------------------------------------------------------------
-
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace beans = ::com::sun::star::beans;
- // -----------------------------------------------------------------------------------
-
- /** Customized ComponentContext for configuration bootstrap data and runtime arguments
- */
- class BootstrapContext : public ComponentContext
- {
- // creation and destruction
- private:
- friend uno::Reference<uno::XInterface> SAL_CALL
- instantiateBootstrapContext( uno::Reference< uno::XComponentContext > const& xContext );
-
- // constructor
- BootstrapContext(uno::Reference< uno::XComponentContext > const & _xContext);
-
- // two-phase construct
- void initialize();
-
- protected:
- using ComponentContext::initialize;
-
- public:
- // XServiceInfo
- virtual rtl::OUString SAL_CALL getImplementationName()
- throw (uno::RuntimeException) ;
- virtual sal_Bool SAL_CALL supportsService(
- const rtl::OUString& aServiceName)
- throw (uno::RuntimeException) ;
- virtual uno::Sequence<rtl::OUString> SAL_CALL
- getSupportedServiceNames(void) throw (uno::RuntimeException) ;
-
-
- /** Constructs a Context based on the given arguments and context.
- @param _xContext
- The base context of this component context.
-
- @param _aArguments
- The arguments used to create this component context.
- */
- static uno::Reference< uno::XComponentContext > createWrapper(uno::Reference< uno::XComponentContext > const & _xContext, uno::Sequence < beans::NamedValue > const & _aOverrides);
-
- /** Checks, if the given context is a wrapper.
- @param _xContext
- The context that is checked.
- */
- static sal_Bool isWrapper(uno::Reference< uno::XComponentContext > const & _xContext);
-
- /** Retrieves the BootstrapContext for the given non-bootstrap context.
- @param _xContext
- The context from which the bootstrap context should be retrieved.
-
- */
- static uno::Reference< uno::XComponentContext > get(uno::Reference< uno::XComponentContext > const & _xContext);
-
- /// Destroys this BootstrapContext
- ~BootstrapContext();
-
- // gets the INI that should be used for bootstrap data by default
- static rtl::OUString getDefaultConfigurationBootstrapURL();
-
- // interface implementations
- public:
- // XComponentContext
- /** Retrieves a value from this context.
-
- @param name
- The name of the value to retrieve.
- A prefix of "com.sun.star.configuration.bootstrap." is stripped/ignored
-
- @returns
- The requested value, or <VOID/> if the value is not found.
- */
- virtual uno::Any SAL_CALL
- getValueByName( const rtl::OUString& name )
- throw (uno::RuntimeException);
-
- public: // used by ArgumentHelper
- static rtl::OUString makeContextName (rtl::OUString const & _aShortName);
-
- private:
- static rtl::OUString makeBootstrapName(rtl::OUString const & _aLongName);
- uno::Any makeBootstrapException();
- };
-// -----------------------------------------------------------------------------
- class ContextReader
- {
- public:
- explicit
- ContextReader(uno::Reference< uno::XComponentContext > const & context);
-
- // the underlying contexts
- sal_Bool hasBootstrapContext() const { return m_fullcontext.is(); }
- uno::Reference< uno::XComponentContext > const & getBootstrapContext() const { return m_fullcontext; }
- uno::Reference< uno::XComponentContext > const & getBaseContext() const { return m_basecontext; }
- uno::Reference< uno::XComponentContext > const & getBestContext() const { return m_fullcontext.is() ? m_fullcontext : m_basecontext; }
-
- uno::Reference< lang::XMultiComponentFactory > getServiceManager() const;
-
- /** Checks, if the given context has the given 'admin' flag setting..
- @param _xContext
- The context that is checked.
- */
- static bool testAdminService(uno::Reference< uno::XComponentContext > const & context, bool bAdmin);
-
- // general settings
- sal_Bool isUnoBackend() const;
-
- sal_Bool hasUnoBackendService() const;
- sal_Bool hasUnoBackendWrapper() const;
-
- sal_Bool hasLocale() const;
- sal_Bool hasAsyncSetting() const;
- sal_Bool hasOfflineSetting() const;
-
- rtl::OUString getUnoBackendService() const;
- rtl::OUString getUnoBackendWrapper() const;
-
- rtl::OUString getLocale() const;
- sal_Bool getAsyncSetting() const;
- sal_Bool getOfflineSetting() const;
-
- // internal settings - should only ever be in configmgr::BootstrapContext instances
- // get a special setting
- sal_Bool isAdminService() const;
-
- // access to error diagnostics
- sal_Bool isBootstrapValid() const;
- uno::Any getBootstrapError() const;
- private:
- sal_Bool hasSetting(rtl::OUString const & _aSetting) const;
- sal_Bool getBoolSetting(rtl::OUString const & _aSetting, sal_Bool bValue) const;
- rtl::OUString getStringSetting(rtl::OUString const & _aSetting, rtl::OUString aValue) const;
- uno::Any getSetting(rtl::OUString const & _aSetting) const;
- private:
- uno::Reference< uno::XComponentContext > m_basecontext;
- uno::Reference< uno::XComponentContext > m_fullcontext;
- };
- //------------------------------------------------------------------------
-
- class ArgumentHelper
- {
- public:
- explicit
- ArgumentHelper(uno::Reference< uno::XComponentContext > const & context)
- : m_context(context)
- , m_bHasBackendArguments(false)
- {}
-
- bool hasBackendArguments() const { return m_bHasBackendArguments; }
- bool checkBackendArgument(beans::NamedValue const & aAdjustedValue);
-
- bool filterAndAdjustArgument(beans::NamedValue & rValue);
-
- static
- bool extractArgument(beans::NamedValue & rValue, uno::Any const & aArgument);
-
- static beans::NamedValue makeAdminServiceOverride(sal_Bool bAdmin);
- private:
- uno::Reference< uno::XComponentContext > m_context; // context used to strip identical arguments
- bool m_bHasBackendArguments;
- };
-// -----------------------------------------------------------------------------------
-
-}
-
-#endif // CONFIGMGR_BOOTSTRAP_HXX_
-
-
diff --git a/configmgr/source/inc/bootstrapcontext.hxx b/configmgr/source/inc/bootstrapcontext.hxx
deleted file mode 100644
index d7bd90f476..0000000000
--- a/configmgr/source/inc/bootstrapcontext.hxx
+++ /dev/null
@@ -1,168 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BOOTSTRAPCONTEXT_HXX_
-#define CONFIGMGR_BOOTSTRAPCONTEXT_HXX_
-
-#include <cppuhelper/compbase3.hxx>
-#include <cppuhelper/implbase1.hxx>
-#include <rtl/bootstrap.h>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/uno/XCurrentContext.hpp>
-#include <com/sun/star/lang/XEventListener.hpp>
-#include <com/sun/star/lang/XUnoTunnel.hpp>
-#include <com/sun/star/beans/NamedValue.hpp>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-
-namespace com { namespace sun { namespace star { namespace uno {
- class XComponentContext;
-} } } }
-
-// -----------------------------------------------------------------------------
-#define SINGLETON_ "/singletons/"
-#define SINGLETON( NAME ) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SINGLETON_ NAME ) )
-// -----------------------------------------------------------------------------
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace beans = ::com::sun::star::beans;
-// -----------------------------------------------------------------------------
- /** Base class for customized ComponentContext using bootstrap data and overrides
- */
- class ComponentContext : public cppu::WeakComponentImplHelper3 < uno::XComponentContext, uno::XCurrentContext, lang::XServiceInfo >
- {
- // creation and destruction
- public:
- /** Constructs a ComponentContext based on the given overrides and context.
- Initially no bootstrap data will be used.
-
- @param _xContext
- The base context of this component context.
- Values from here take precedence over values from bootstrap data.
-
- @param _aOverrides
- The overrides used to create this component context.
- These values take precedence over values from the base context or bootstrap data.
- */
- explicit
- ComponentContext(uno::Reference< uno::XComponentContext > const & _xContext);
-
- /// Destroys this BootstrapContext
- ~ComponentContext();
-
- // gets the INI in use for getting bootstrap data
- rtl::OUString getBootstrapURL() const;
-
- static sal_Bool isPassthrough(uno::Reference< uno::XComponentContext > const & _xContext);
-
- static beans::NamedValue makePassthroughMarker(sal_Bool bPassthrough = true);
- // interface implementations
- public:
-
- // XComponentContext only
- virtual uno::Reference< lang::XMultiComponentFactory > SAL_CALL
- getServiceManager( )
- throw (uno::RuntimeException);
-
- protected:
- // ComponentHelper
- virtual void SAL_CALL disposing();
-
- protected:
- // two phase construct - also initialized the bootstrap data
- void initialize(const rtl::OUString& _aBootstrapURL);
-
- bool lookupInContext ( uno::Any & _rValue, const rtl::OUString& _aName ) const;
- bool lookupInBootstrap( uno::Any & _rValue, const rtl::OUString& _aName ) const;
-
- uno::Reference< uno::XComponentContext > const & basecontext() const { return m_xContext; }
-
- private:
- /// The context that most requests are delegated to
- uno::Reference< uno::XComponentContext > m_xContext;
- /// The bootstrap data consulted as fallback
- rtlBootstrapHandle m_hBootstrapData;
- /// The service manager associated with this context
- uno::Reference< lang::XMultiComponentFactory > m_xServiceManager;
- };
-// -----------------------------------------------------------------------------
-
- class UnoContextTunnel
- {
- public:
- UnoContextTunnel();
- ~UnoContextTunnel();
- void tunnel(uno::Reference< uno::XComponentContext > const & xContext);
- void passthru(uno::Reference< uno::XComponentContext > const & xContext);
- uno::Any recoverFailure(bool bRaise); // true, if there is a failure
-
- static uno::Reference< uno::XComponentContext > recoverContext(uno::Reference< uno::XComponentContext > const & xFallback = uno::Reference< uno::XComponentContext >());
- static bool tunnelFailure(uno::Any const & aException, bool bRaise = false);
- private:
- uno::Reference< uno::XCurrentContext > m_xOldContext;
- uno::Reference< lang::XUnoTunnel > m_xActiveTunnel;
- class Tunnel;
- };
-// -----------------------------------------------------------------------------
-
- class DisposingForwarder : public cppu::WeakImplHelper1< lang::XEventListener >
- {
- uno::Reference< lang::XComponent > m_xTarget;
-
- DisposingForwarder( uno::Reference< lang::XComponent > const & xTarget ) SAL_THROW( () )
- : m_xTarget( xTarget )
- { OSL_ASSERT( m_xTarget.is() ); }
-
- virtual void SAL_CALL disposing( lang::EventObject const & rSource )
- throw (uno::RuntimeException);
- public:
- // listens at source for disposing, then disposes target
- static inline void forward(
- uno::Reference< lang::XComponent > const & xSource,
- uno::Reference< lang::XComponent > const & xTarget )
- SAL_THROW( (uno::RuntimeException) );
- };
-//__________________________________________________________________________________________________
- inline void DisposingForwarder::forward(
- uno::Reference< lang::XComponent > const & xSource,
- uno::Reference< lang::XComponent > const & xTarget )
- SAL_THROW( (uno::RuntimeException) )
- {
- if (xSource.is())
- {
- xSource->addEventListener( new DisposingForwarder( xTarget ) );
- }
- }
-// -----------------------------------------------------------------------------
-} // namespace configmgr
-
-#endif
-
-
diff --git a/configmgr/source/inc/builddata.hxx b/configmgr/source/inc/builddata.hxx
deleted file mode 100644
index 59196bb7f8..0000000000
--- a/configmgr/source/inc/builddata.hxx
+++ /dev/null
@@ -1,69 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BUILDDATA_HXX
-#define CONFIGMGR_BUILDDATA_HXX
-
-#include "treefragment.hxx"
-#ifndef INCLUDED_MEMORY
-#define INCLUDED_MEMORY
-#include <memory>
-#endif
-//-----------------------------------------------------------------------------
-namespace rtl { class OUString; }
-//-----------------------------------------------------------------------------
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- class INode;
- class ISubtree;
- class ValueNode;
-//-----------------------------------------------------------------------------
- namespace sharable { struct TreeFragment; }
- namespace data
- {
-//-----------------------------------------------------------------------------
- sharable::TreeFragment * buildTree(sharable::TreeFragment * tree);
-//-----------------------------------------------------------------------------
- sharable::TreeFragment * buildTree(rtl::OUString const & _aTreeName, INode const& _aNode, bool _bWithDefaults);
-//-----------------------------------------------------------------------------
- sharable::TreeFragment * buildElementTree(INode const& _aNode, rtl::OUString const & _aTypeName, bool _bWithDefaults);
-//-----------------------------------------------------------------------------
- void mergeDefaults(sharable::TreeFragment * _aBaseAddress, INode const& _aDefaultNode);
-//-----------------------------------------------------------------------------
- void destroyTree(sharable::TreeFragment * _aBaseAddress);
-//-----------------------------------------------------------------------------
- std::auto_ptr<INode> convertTree(sharable::TreeFragment * tree, bool _bUseTreeName);
-//-----------------------------------------------------------------------------
- }
-//-----------------------------------------------------------------------------
-} // namespace configmgr
-//-----------------------------------------------------------------------------
-
-#endif // CONFIGMGR_BUILDDATA_HXX
-
-
diff --git a/configmgr/source/inc/cachefactory.hxx b/configmgr/source/inc/cachefactory.hxx
deleted file mode 100644
index f5edd8dd63..0000000000
--- a/configmgr/source/inc/cachefactory.hxx
+++ /dev/null
@@ -1,51 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public 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_CACHEFACTORY_HXX_
-#define CONFIGMGR_CACHEFACTORY_HXX_
-
-#include <rtl/ref.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- class TreeManager;
-//-----------------------------------------------------------------------------
- struct CacheFactory
- {
- rtl::Reference<TreeManager>
- createCacheManager(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & _xContext);
-
- static CacheFactory & instance();
- };
-//-----------------------------------------------------------------------------
-}
-
-
-#endif // CONFIGMGR_CACHEFACTORY_HXX_
-
diff --git a/configmgr/source/inc/change.hxx b/configmgr/source/inc/change.hxx
deleted file mode 100644
index 323325ed54..0000000000
--- a/configmgr/source/inc/change.hxx
+++ /dev/null
@@ -1,504 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CHANGE_HXX
-#define CONFIGMGR_CHANGE_HXX
-#if defined(_MSC_VER) && (_MSC_VER >= 1400)
-#pragma warning(disable : 4350) // behavior change: 'member1' called instead of 'member2'
-#endif
-
-#include "valuenode.hxx"
-#include "treesegment.hxx"
-#include <sal/types.h>
-#include <rtl/ustring.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-
-#ifndef INCLUDED_MAP
-#include <map>
-#define INCLUDED_MAP
-#endif
-#ifndef INCLUDED_MEMORY
-#include <memory>
-#define INCLUDED_MEMORY
-#endif
-
-namespace configmgr
-{
-
- namespace uno = com::sun::star::uno;
-
- class Change;
- class SubtreeChange;
- class ValueChange;
- class AddNode;
- class RemoveNode;
-
-
- //==========================================================================
- //= ChangeTreeAction
- //==========================================================================
- struct ChangeTreeAction
- {
- virtual void handle(ValueChange const& aValueNode) = 0;
- virtual void handle(AddNode const& aAddNode) = 0;
- virtual void handle(RemoveNode const& aRemoveNode) = 0;
- virtual void handle(SubtreeChange const& aSubtree) = 0;
-
- void applyToChange(Change const& aChange);
- void applyToChildren(SubtreeChange const& aSubtree);
- protected:
- virtual ~ChangeTreeAction() {}
- };
-
- struct ChangeTreeModification
- {
- virtual void handle(ValueChange& aValueNode) = 0;
- virtual void handle(AddNode& aAddNode) = 0;
- virtual void handle(RemoveNode& aRemoveNode) = 0;
- virtual void handle(SubtreeChange& aSubtree) = 0;
-
- void applyToChange(Change& aChange);
- void applyToChildren(SubtreeChange& aSubtree);
- protected:
- virtual ~ChangeTreeModification() {}
- };
-
- //==========================================================================
- //= Change
- //==========================================================================
- class Change
- {
- protected:
- rtl::OUString m_aName;
- bool m_bIsToDefault;
-
- void swap(Change& aOther);
-
- public:
- explicit
- Change(rtl::OUString const& _rName, bool _bToDefault)
- : m_aName(_rName)
- , m_bIsToDefault(_bToDefault)
- {}
-
- virtual ~Change() {}
-
- rtl::OUString getNodeName() const { return m_aName; }
- void setNodeName(const rtl::OUString &aName) {m_aName = aName;}
-
- bool isToDefault() const { return m_bIsToDefault; }
-
- Change* getSubChange(rtl::OUString const& _rName) { return doGetChild(_rName); }
- Change const* getSubChange(rtl::OUString const& _rName) const { return doGetChild(_rName); }
-
- virtual void dispatch(ChangeTreeAction& anAction) const = 0;
- virtual void dispatch(ChangeTreeModification& anAction) = 0;
-
- virtual std::auto_ptr<Change> clone() const = 0;
-
- private:
- virtual Change* doGetChild(rtl::OUString const& ) const { return 0; }
- };
-
- //==========================================================================
- //= ValueChange
- //==========================================================================
- class ValueChange : public Change
- {
- public:
- struct SetToDefault {};
- enum Mode { wasDefault, changeValue, setToDefault, changeDefault };
-
- private:
- uno::Type m_aValueType;
- uno::Any m_aValue;
- uno::Any m_aOldValue;
- node::Attributes m_aAttributes;
- Mode m_eMode;
- public:
- ValueChange(
- rtl::OUString const& _rName,
- const node::Attributes& _rAttributes,
- Mode aMode,
- uno::Any const & aNewValue,
- uno::Any const & aOldValue = uno::Any());
-
- virtual std::auto_ptr<Change> clone() const;
-
- bool isChange() const;
-
- uno::Type getValueType() const { return m_aValueType; }
-
- uno::Any getNewValue() const { return m_aValue; }
- uno::Any getOldValue() const { return m_aOldValue; }
-
- void setNewValue(const uno::Any& _rNewVal);
- void setNewValue(const uno::Any& _rNewVal, Mode aMode)
- { setNewValue(_rNewVal); m_eMode = aMode;}
-
- bool isReplacedValue() const {return m_aAttributes.isReplacedForUser();}
- bool isLocalizedValue() const {return m_aAttributes.isLocalized();}
-
- Mode getMode() const { return m_eMode; }
-
- const node::Attributes& getAttributes() const {return m_aAttributes;}
-
- void applyChangeNoRecover(ValueNode& aNode) const;
-
- virtual void dispatch(ChangeTreeAction& anAction) const { anAction.handle(*this); }
- virtual void dispatch(ChangeTreeModification& anAction) { anAction.handle(*this); }
-
- friend class ApplyValueChange;
- };
-
- //==========================================================================
- //= AddNode
- //==========================================================================
- class AddNode : public Change
- {
- rtl::Reference< data::TreeSegment > m_aOwnNewNode;
- rtl::Reference< data::TreeSegment > m_aOwnOldNode;
- sharable::TreeFragment * m_aInsertedTree;
- bool m_bReplacing;
-
- private:
- void operator=(AddNode const&); // not implemented
-
- // needed for clone()
- AddNode(AddNode const&);
- public:
- AddNode(rtl::Reference< data::TreeSegment > const & _aAddedTree, rtl::OUString const& _rName, bool _bToDefault);
- ~AddNode();
-
- virtual std::auto_ptr<Change> clone() const;
-
- /// marks this as not merely adding a node but replacing another
- void setReplacing() { m_bReplacing = true; }
- /// is this not merely adding a node but replacing another ?
- bool isReplacing() const { return m_bReplacing; }
-
- /// has this been applied and inserted
- bool wasInserted() const { return m_aInsertedTree != NULL; }
-
- /** returns the node this change represents, even if this node does not own the new Node object any more.
- This is somewhat dangerous if the node referenced by this object dies before the object itself does.<BR>
- In this case all calls to this method will return nonsense. This case can be detected by testing
- whether <method>getAddedNode</method> returns NULL.
- */
- sharable::TreeFragment * getInsertedTree() const { return m_aInsertedTree; }
-
- /** returns the node this change represents; The Node object is owned by this change until
- <method>releaseAddedNode</method> is called.<BR>
- After ownership is lost this method returns NULL.
- */
- sharable::TreeFragment const * getNewTreeData() const { return m_aOwnNewNode.is() ? m_aOwnNewNode->fragment : 0; }
-
- /** returns the node the change represents. .
- */
- rtl::Reference< data::TreeSegment > getNewTree() const { return m_aOwnNewNode; }
-
- /** returns the node the change represents, and releases ownership of it. This means that
- afterwards <method>getAddedNode</method> will return NULL. This change object keeps a reference
- to the node though which can be retrieved using <method>getAddedNode_unsafe</method>.
- */
- void clearNewTree() { m_aOwnNewNode.clear(); }
-
- /** .
- */
- void setInsertedAddress(sharable::TreeFragment * const & _aInsertedAddress);
-
-
- /** returns the node this change replaces, ihe Node object is owned by this change.
- After ownership is lost this method returns NULL.
- */
- sharable::TreeFragment const * getReplacedTreeData() const { return m_aOwnOldNode.is() ? m_aOwnOldNode->fragment : 0; }
-
- /** returns the node the change replaces.
- */
- rtl::Reference< data::TreeSegment > getReplacedTree() const { return m_aOwnOldNode; }
-
- /** forgets about the node the change replaces
- */
- void clearReplacedTree() { m_aOwnOldNode.clear(); }
-
- void takeReplacedTree(rtl::Reference< data::TreeSegment > const& _aTree);
-
- virtual void dispatch(ChangeTreeAction& anAction) const { anAction.handle(*this); }
- virtual void dispatch(ChangeTreeModification& anAction) { anAction.handle(*this); }
- };
-
- //==========================================================================
- //= RemoveNode
- //==========================================================================
- class RemoveNode : public Change
- {
- protected:
- rtl::Reference< data::TreeSegment > m_aOwnOldNode;
- bool m_bIsToDefault;
-
- private:
- RemoveNode& operator=(const RemoveNode&); // not implemented
- // needed for clone()
- RemoveNode(const RemoveNode&);
- public:
- explicit
- RemoveNode(rtl::OUString const& _rName, bool _bToDefault);
- ~RemoveNode();
-
- virtual std::auto_ptr<Change> clone() const;
-
- virtual void dispatch(ChangeTreeAction& anAction) const { anAction.handle(*this); }
- virtual void dispatch(ChangeTreeModification& anAction) { anAction.handle(*this); }
-
- /** returns the node this change removes, ihe Node object is owned by this change.
- After ownership is lost this method returns NULL.
- */
- sharable::TreeFragment const * getRemovedTreeData() const { return m_aOwnOldNode.is() ? m_aOwnOldNode->fragment : 0; }
- /** returns the node the change removes.
- */
- rtl::Reference< data::TreeSegment > getRemovedTree() const { return m_aOwnOldNode; }
-
- /** forgets about the node the change removes, returning the previous setting with ownership
- */
- void clearRemovedTree() { m_aOwnOldNode.clear(); }
-
- void takeRemovedTree(rtl::Reference< data::TreeSegment > const & _aTree);
- };
-
- //==========================================================================
- //= SubtreeChange
- //==========================================================================
- class SubtreeChange : public Change
- {
- protected:
- typedef ::std::map< ::rtl::OUString,Change* > Children;
- Children m_aChanges;
- ::rtl::OUString m_sTemplateName; /// path of the template for child instantiation
- ::rtl::OUString m_sTemplateModule; /// module of the template for child instantiation
- node::Attributes m_aAttributes;
-
- // don't create copy ops automatically
- SubtreeChange(const SubtreeChange&);
- void operator=(SubtreeChange&);
-
- using Change::swap;
-
- public:
- class ChildIterator;
- ChildIterator begin() const throw();
- ChildIterator end() const throw();
-
- class MutatingChildIterator;
- MutatingChildIterator begin_changes() throw();
- MutatingChildIterator end_changes() throw();
-
- friend class MutatingChildIterator;
- public:
- SubtreeChange(const rtl::OUString& _rName,
- const node::Attributes& _rAttr,
- bool _bToDefault = false)
- : Change(_rName,_bToDefault)
- , m_aAttributes(_rAttr)
- {
- m_aAttributes.markAsDefault(_bToDefault);
- }
-
- SubtreeChange(const rtl::OUString& _rName,
- const rtl::OUString& _rTemplateName,
- const rtl::OUString& _rTemplateModule,
- const node::Attributes& _rAttr,
- bool _bToDefault = false)
- : Change(_rName,_bToDefault)
- , m_sTemplateName(_rTemplateName)
- , m_sTemplateModule(_rTemplateModule)
- , m_aAttributes(_rAttr)
- {
- m_aAttributes.markAsDefault(_bToDefault);
- }
-
- SubtreeChange(const ISubtree& _rTree, bool _bToDefault = false)
- : Change(_rTree.getName(),_bToDefault)
- , m_sTemplateName(_rTree.getElementTemplateName())
- , m_sTemplateModule(_rTree.getElementTemplateModule())
- , m_aAttributes(_rTree.getAttributes())
- {
- m_aAttributes.markAsDefault(_bToDefault);
- }
-
- SubtreeChange(const SubtreeChange& _rChange, treeop::NoChildCopy)
- : Change(_rChange)
- , m_sTemplateName(_rChange.getElementTemplateName())
- , m_sTemplateModule(_rChange.getElementTemplateModule())
- , m_aAttributes(_rChange.getAttributes())
- {}
-
- ~SubtreeChange();
-
- SubtreeChange(const SubtreeChange&, treeop::DeepChildCopy);
-
- virtual std::auto_ptr<Change> clone() const;
-
- void swap(SubtreeChange& aOther);
-
- bool isReplacedNode() const { return m_aAttributes.isReplacedForUser(); }
- bool isLocalizedContainer() const { return m_aAttributes.isLocalized(); }
-
- const node::Attributes& getAttributes() const {return m_aAttributes;}
-
- bool isSetNodeChange() const { return m_sTemplateName.getLength() != 0; }
-
- rtl::OUString getElementTemplateName() const { return m_sTemplateName; }
- rtl::OUString getElementTemplateModule() const { return m_sTemplateModule; }
-
- void setElementTemplate(const rtl::OUString& _rName, const rtl::OUString& _rModule)
- { m_sTemplateName = _rName; m_sTemplateModule = _rModule; }
-
- sal_Int32 size() const { return m_aChanges.size(); }
- uno::Sequence< rtl::OUString > elementNames() const;
-
- void addChange(std::auto_ptr<Change> aChange);
- ::std::auto_ptr<Change> removeChange(rtl::OUString const& _rName);
-
- Change* getChange(rtl::OUString const& _rName);
- Change const* getChange(rtl::OUString const& _rName) const;
-
- virtual void dispatch(ChangeTreeAction& _anAction) const;
- virtual void dispatch(ChangeTreeModification& _anAction);
-
- void forEachChange(ChangeTreeAction& _anAction) const;
- void forEachChange(ChangeTreeModification& _anAction);
-
- private:
- virtual Change* doGetChild(rtl::OUString const& _rName) const;
- };
-
- /** iterates through all children of a <type>SubtreeChange</type>. Every non-const action on the object
- which is beeing iterated invalidates the iterator.
- <BR>
- beware of the lifetime of the tree change object : it has to live as long as the iterator does (at least) !!
- */
- class SubtreeChange::ChildIterator
- {
- protected:
- uno::Sequence< rtl::OUString > m_aNames;
- const SubtreeChange* m_pTree;
- sal_Int32 m_nPos;
-
- friend class SubtreeChange;
- struct EndPos { };
- ChildIterator(const SubtreeChange* _pTree, struct EndPos);
-
- inline sal_Bool isValid() const { return m_nPos >= 0 && m_nPos < m_aNames.getLength(); }
-
- public:
- ChildIterator(const SubtreeChange* _pTree);
-
- const Change& operator*() const;
- const Change* operator->() const;
-
- ChildIterator& operator++();
- ChildIterator operator++(int) { ChildIterator ret(*this); ++*this; return ret; }
-
- ChildIterator& operator--();
- ChildIterator operator--(int) { ChildIterator ret(*this); --*this; return ret; }
-
- friend bool operator==(ChildIterator const& lhs, ChildIterator const& rhs);
- friend bool operator!=(ChildIterator const& lhs, ChildIterator const& rhs) { return !(lhs == rhs); }
- };
-
- /** iterates through all children of a <type>SubtreeChange</type>. Every non-const action on the object
- which is beeing iterated invalidates the iterator.
- <BR>
- beware of the lifetime of the tree change object : it has to live as long as the iterator does (at least) !!
- */
- class SubtreeChange::MutatingChildIterator
- {
- protected:
- SubtreeChange::Children::iterator m_aBaseIter;
-
- friend class SubtreeChange;
- MutatingChildIterator(SubtreeChange::Children::iterator aBase) : m_aBaseIter(aBase) {};
-
- public:
- Change& current() const { return *m_aBaseIter->second; }
-
- Change& operator*() const { return current(); }
- Change* operator->() const { return &current(); }
-
- MutatingChildIterator& operator++() { ++m_aBaseIter; return *this; }
- MutatingChildIterator operator++(int) { return MutatingChildIterator(m_aBaseIter++); }
-
- MutatingChildIterator& operator--() { ++m_aBaseIter; return *this; }
- MutatingChildIterator operator--(int) { return MutatingChildIterator(m_aBaseIter++); }
-
- friend bool operator==(MutatingChildIterator const& lhs, MutatingChildIterator const& rhs)
- { return lhs.m_aBaseIter == rhs.m_aBaseIter; }
- friend bool operator!=(MutatingChildIterator const& lhs, MutatingChildIterator const& rhs) { return !(lhs == rhs); }
- };
- //==========================================================================
- //= SubtreeChangeReferrer
- //==========================================================================
- /** a specialized SubtreeChange, which, upon desctruction, does not delete the changes
- it holds
-
- <BR>
- This implies that when using this class, you have to beware of the lifetime of the involved objects
- */
- class SubtreeChangeReferrer : public SubtreeChange
- {
- // no explicit construction
- SubtreeChangeReferrer() : SubtreeChange(::rtl::OUString(), node::Attributes()) { }
-
- public:
- SubtreeChangeReferrer(const SubtreeChange& _rSource);
- ~SubtreeChangeReferrer();
- };
-
-////////////////////////////////////////////////////////////////////////////////
- //==========================================================================
- extern bool isLocalizedValueSet(SubtreeChange const& _aSubtree);
- extern bool isValueSet(SubtreeChange const& _aSubtree);
-
- //==========================================================================
- //= inlines
- //==========================================================================
- inline void ChangeTreeAction::applyToChange(Change const& aChange)
- { aChange.dispatch(*this); }
- inline void ChangeTreeAction::applyToChildren(SubtreeChange const& aSubtree)
- { aSubtree.forEachChange(*this); }
-
- inline void ChangeTreeModification::applyToChange(Change& aChange)
- { aChange.dispatch(*this); }
- inline void ChangeTreeModification::applyToChildren(SubtreeChange& aSubtree)
- { aSubtree.forEachChange(*this); }
-
-////////////////////////////////////////////////////////////////////////////////
-
-} // namespace configmgr
-
-#endif
-
diff --git a/configmgr/source/inc/confapifactory.hxx b/configmgr/source/inc/confapifactory.hxx
deleted file mode 100644
index c509da78f5..0000000000
--- a/configmgr/source/inc/confapifactory.hxx
+++ /dev/null
@@ -1,178 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_FACTORY_HXX_
-#define CONFIGMGR_API_FACTORY_HXX_
-
-#include <sal/types.h>
-
-namespace com { namespace sun { namespace star {
- namespace uno
- {
- class XInterface;
- template <class> class Reference;
- class XComponentContext;
- }
- namespace lang
- {
- class XSingleComponentFactory;
- }
-} } }
-namespace rtl { class OUString; }
-
-namespace configmgr
-{
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
-
- extern
- uno::Reference< lang::XSingleComponentFactory > SAL_CALL
- createProviderFactory(
- ::rtl::OUString const & aImplementationName,
- bool bAdmin
- )
- SAL_THROW( () );
-
- struct ServiceRegistrationInfo;
- struct SingletonRegistrationInfo;
-
-// provider instantiation
- uno::Reference<uno::XInterface> SAL_CALL
- getDefaultConfigProviderSingleton( uno::Reference< uno::XComponentContext > const& xContext );
-
- uno::Reference<uno::XInterface> SAL_CALL
- instantiateDefaultProvider( uno::Reference< uno::XComponentContext > const& xContext );
-
-// provider service info
- const SingletonRegistrationInfo * getDefaultProviderSingletonInfo();
- const ServiceRegistrationInfo * getConfigurationProviderServiceInfo();
- const ServiceRegistrationInfo * getDefaultProviderServiceInfo();
- const ServiceRegistrationInfo * getAdminProviderServiceInfo();
-
-// other services - instantiation and info
- uno::Reference< uno::XInterface > SAL_CALL
- instantiateConfigRegistry( uno::Reference< uno::XComponentContext > const& xContext );
-
- const ServiceRegistrationInfo* getConfigurationRegistryServiceInfo();
-
-// bootstrap context support
- uno::Reference<uno::XInterface> SAL_CALL
- instantiateBootstrapContext( uno::Reference< uno::XComponentContext > const& xContext );
-
- const SingletonRegistrationInfo * getBootstrapContextSingletonInfo();
- const ServiceRegistrationInfo * getBootstrapContextServiceInfo();
-
- namespace xml
- {
- uno::Reference< uno::XInterface > SAL_CALL instantiateSchemaParser
- ( uno::Reference< uno::XComponentContext > const& xContext );
- uno::Reference< uno::XInterface > SAL_CALL instantiateLayerParser
- ( uno::Reference< uno::XComponentContext > const& xContext );
- uno::Reference< uno::XInterface > SAL_CALL instantiateLayerWriter
- ( uno::Reference< uno::XComponentContext > const& xContext );
-
- const ServiceRegistrationInfo* getSchemaParserServiceInfo();
- const ServiceRegistrationInfo* getLayerParserServiceInfo();
- const ServiceRegistrationInfo* getLayerWriterServiceInfo();
- }
- namespace backend
- {
- uno::Reference<uno::XInterface> SAL_CALL
- getDefaultBackendSingleton( uno::Reference< uno::XComponentContext > const& xContext );
-
- uno::Reference<uno::XInterface> SAL_CALL
- instantiateDefaultBackend( uno::Reference< uno::XComponentContext > const& xContext );
-
- uno::Reference< uno::XInterface > SAL_CALL
- instantiateUpdateMerger( uno::Reference< uno::XComponentContext > const& xContext );
-
- uno::Reference<uno::XInterface> SAL_CALL
- instantiateSingleBackendAdapter( uno::Reference< uno::XComponentContext > const& xContext );
-
- uno::Reference< uno::XInterface > SAL_CALL
- instantiateMergeImporter( uno::Reference< uno::XComponentContext > const& xContext );
-
- uno::Reference< uno::XInterface > SAL_CALL
- instantiateCopyImporter( uno::Reference< uno::XComponentContext > const& xContext );
-
- uno::Reference<uno::XInterface> SAL_CALL
- instantiateMultiStratumBackend( uno::Reference< uno::XComponentContext > const& xContext );
-
- const SingletonRegistrationInfo * getDefaultBackendSingletonInfo();
- const ServiceRegistrationInfo * getDefaultBackendServiceInfo();
-
- const ServiceRegistrationInfo * getUpdateMergerServiceInfo();
- const ServiceRegistrationInfo * getSingleBackendAdapterServiceInfo();
- const ServiceRegistrationInfo * getMergeImportServiceInfo();
- const ServiceRegistrationInfo * getCopyImportServiceInfo();
- const ServiceRegistrationInfo * getMultiStratumBackendServiceInfo();
- }
- namespace localbe
- {
- uno::Reference<uno::XInterface> SAL_CALL
- instantiateLocalBackend( uno::Reference< uno::XComponentContext > const& xContext );
-
- uno::Reference<uno::XInterface> SAL_CALL
- instantiateLocalDataImporter( uno::Reference< uno::XComponentContext > const& xContext );
-
- uno::Reference<uno::XInterface> SAL_CALL
- instantiateLocalHierarchyBrowser( uno::Reference< uno::XComponentContext > const& xContext );
-
- uno::Reference<uno::XInterface> SAL_CALL
- instantiateLocalSchemaSupplier( uno::Reference< uno::XComponentContext > const& xContext );
-
- uno::Reference<uno::XInterface> SAL_CALL
- instantiateLocalLegacyStratum( uno::Reference< uno::XComponentContext > const& xContext );
-
- uno::Reference<uno::XInterface> SAL_CALL
- instantiateLocalDataStratum( uno::Reference< uno::XComponentContext > const& xContext );
-
- uno::Reference<uno::XInterface> SAL_CALL
- instantiateLocalReadonlyStratum( uno::Reference< uno::XComponentContext > const& xContext );
-
- uno::Reference<uno::XInterface> SAL_CALL
- instantiateLocalResourceStratum( uno::Reference< uno::XComponentContext > const& xContext );
-
- uno::Reference<uno::XInterface> SAL_CALL
- instantiateLocalMultiStratum( uno::Reference< uno::XComponentContext > const& xContext );
-
- const ServiceRegistrationInfo * getLocalBackendServiceInfo();
- const ServiceRegistrationInfo * getLocalDataImportServiceInfo();
- const ServiceRegistrationInfo * getLocalHierarchyBrowserServiceInfo();
- const ServiceRegistrationInfo * getLocalSchemaSupplierServiceInfo();
- const ServiceRegistrationInfo * getLocalLegacyStratumServiceInfo();
- const ServiceRegistrationInfo * getLocalDataStratumServiceInfo();
- const ServiceRegistrationInfo * getLocalReadonlyStratumServiceInfo();
- const ServiceRegistrationInfo * getLocalResourceStratumServiceInfo();
- const ServiceRegistrationInfo * getLocalMultiStratumServiceInfo();
- } // localbe
-
-} // namespace configmgr
-
-#endif // CONFIGMGR_API_FACTORY_HXX_
-
-
diff --git a/configmgr/source/inc/confevents.hxx b/configmgr/source/inc/confevents.hxx
deleted file mode 100644
index a04cb224e2..0000000000
--- a/configmgr/source/inc/confevents.hxx
+++ /dev/null
@@ -1,213 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_EVENTS_HXX_
-#define CONFIGMGR_API_EVENTS_HXX_
-
-#include <hash_set>
-#include <map>
-#include <set>
-
-#include "osl/mutex.hxx"
-#include "rtl/ref.hxx"
-#include "salhelper/simplereferenceobject.hxx"
-
-#include "configpath.hxx"
-#include "utility.hxx"
-
-namespace rtl { class OUString; }
-
-namespace configmgr
-{
- class Change;
- struct TreeChangeList;
- class TreeManager;
-
- namespace configuration { class AbsolutePath; }
-
- struct IConfigListener : public salhelper::SimpleReferenceObject
- {
- virtual void disposing(TreeManager * pSource) = 0;
- };
- struct INodeListener : IConfigListener
- {
- virtual void nodeChanged(Change const& aChange, configuration::AbsolutePath const& aPath, TreeManager * pSource) = 0;
- virtual void nodeDeleted(configuration::AbsolutePath const& aPath, TreeManager * pSource) = 0;
- };
-
- namespace internal
- {
-
- ////////////////////////////////////////////////////////////////////////
- template <class ListenerRef>
- class BroadcastImplHelper
- {
- public:
- osl::Mutex mutex;
-
- public:
- BroadcastImplHelper()
- {}
-
- ~BroadcastImplHelper()
- {
- OSL_ENSURE(m_aInterfaces.empty(), "Configuration Broadcaster was not disposed properly");
- }
-
- public:
- typedef std::set<ListenerRef> Interfaces;
-
- public:
- typename Interfaces::iterator addListener(ListenerRef aListener)
- {
- return m_aInterfaces.insert(aListener).first;
- }
- void removeListener(ListenerRef aListener)
- {
- m_aInterfaces.erase(aListener);
- }
-
- void disposing(TreeManager * pSource);
-
- public:
- typename Interfaces::const_iterator begin() const { return m_aInterfaces.begin(); }
- typename Interfaces::const_iterator end() const { return m_aInterfaces.end(); }
-
- typename Interfaces::const_iterator find(ListenerRef aListener) const { return m_aInterfaces.find(aListener); }
- typename Interfaces::iterator findFull(ListenerRef aListener) { return m_aInterfaces.find(aListener); }
- private:
- Interfaces m_aInterfaces;
-
- // no implementation - not copyable
- BroadcastImplHelper(BroadcastImplHelper&);
- void operator=(BroadcastImplHelper&);
- };
-
- ////////////////////////////////////////////////////////////////////////
- template <class Listener>
- void BroadcastImplHelper<Listener>::disposing(TreeManager * pSource)
- {
- osl::ClearableMutexGuard aGuard(this->mutex); // ensure that no notifications are running
-
- Interfaces aTargets;
- aTargets.swap(m_aInterfaces);
-
- aGuard.clear();
- for(typename Interfaces::iterator it = aTargets.begin(); it != aTargets.end(); )
- {
- typename Interfaces::iterator cur = it++;
- if (*cur)
- (*cur)->disposing(pSource);
- }
- }
-
-
- /////////////////////////////////////////////////////////////////////////
-
- class NodeListenerInfo
- {
- public:
- typedef std::hash_set<configuration::AbsolutePath, configuration::Path::Hash, configuration::Path::Equiv> Pathes;
-
- public:
- NodeListenerInfo(rtl::Reference<INodeListener> const& pListener)
- : m_pListener(pListener)
- {
- }
-
- // path handling
- Pathes const& pathList() const { return m_aPathes; }
-
- void addPath(configuration::AbsolutePath const& sPath) const { m_aPathes.insert(sPath); }
- void removePath(configuration::AbsolutePath const& sPath) const { m_aPathes.erase(sPath); }
- //void removeChildPathes(OUString const& sPath);
-
- // behave as pointer for use as a 'reference' class
- rtl::Reference<INodeListener> get() const { return m_pListener; }
- rtl::Reference<INodeListener> operator->() const { return get(); }
- INodeListener& operator*() const { return *m_pListener; }
- // needed to allow if (info) ...
- struct HasListener;
- operator HasListener const*() const { return reinterpret_cast<HasListener*>(m_pListener.get()); }
-
- bool operator < (NodeListenerInfo const& aInfo) const
- { return std::less<INodeListener*>()(m_pListener.get(), aInfo.m_pListener.get()); }
-
- bool operator == (NodeListenerInfo const& aInfo) const
- { return !!( m_pListener == aInfo.m_pListener); }
-
- bool operator > (NodeListenerInfo const& aInfo) const
- { return aInfo.operator < (*this); }
- bool operator >= (NodeListenerInfo const& aInfo) const
- { return !operator<(aInfo); }
- bool operator <= (NodeListenerInfo const& aInfo) const
- { return !operator>(aInfo); }
-
- bool operator != (NodeListenerInfo const& aInfo) const
- { return !operator==(aInfo); }
-
- private:
- rtl::Reference<INodeListener> m_pListener;
- mutable Pathes m_aPathes; // hack to be mutable even as set element
- };
- } // namespace
-
- /////////////////////////////////////////////////////////////////////////
- class ConfigChangeBroadcastHelper // broadcasts changes for a given set of options
- {
- public:
- ConfigChangeBroadcastHelper();
- ~ConfigChangeBroadcastHelper();
-
- void broadcast(TreeChangeList const& anUpdate, sal_Bool bError, TreeManager * pSource);
-
- void addListener(configuration::AbsolutePath const& aName, rtl::Reference<INodeListener> const& );
- void removeListener(rtl::Reference<INodeListener> const&);
-
- void dispose(TreeManager * pSource);
-
- private:
- void add(configuration::AbsolutePath const& aPath, rtl::Reference<INodeListener> const& pListener);
- void remove(rtl::Reference<INodeListener> const& pListener);
-
- void dispatch(Change const& rBaseChange, configuration::AbsolutePath const& sChangeLocation, sal_Bool _bError, TreeManager * pSource);
- void dispatch(TreeChangeList const& rList_, sal_Bool _bError, TreeManager * pSource);
- void disposing(TreeManager * pSource);
-
- void dispatchInner(rtl::Reference<INodeListener> const& pTarget, configuration::AbsolutePath const& sTargetPath, Change const& rBaseChange, configuration::AbsolutePath const& sChangeLocation, sal_Bool _bError, TreeManager * pSource);
- void dispatchOuter(rtl::Reference<INodeListener> const& pTarget, configuration::AbsolutePath const& sTargetPath, Change const& rBaseChange, configuration::AbsolutePath const& sChangeLocation, sal_Bool _bError, TreeManager * pSource);
-
- typedef std::multimap<configuration::AbsolutePath, internal::BroadcastImplHelper<internal::NodeListenerInfo>::Interfaces::iterator, configuration::Path::Before> PathMap;
- internal::BroadcastImplHelper<internal::NodeListenerInfo> m_aListeners;
- PathMap m_aPathMap;
- };
-} // namespace
-
-#endif // CONFIGMGR_API_EVENTS_HXX_
-
-
-
diff --git a/configmgr/source/inc/configdefaultprovider.hxx b/configmgr/source/inc/configdefaultprovider.hxx
deleted file mode 100644
index 873df1dd4f..0000000000
--- a/configmgr/source/inc/configdefaultprovider.hxx
+++ /dev/null
@@ -1,95 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CONFIG_DEFAULTPROVIDER_HXX_
-#define CONFIGMGR_CONFIG_DEFAULTPROVIDER_HXX_
-
-#include "utility.hxx"
-#include <com/sun/star/uno/Exception.hpp>
-#include <rtl/ref.hxx>
-
-#ifndef INCLUDED_MEMORY
-#include <memory>
-#define INCLUDED_MEMORY
-#endif
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- class ISubtree;
- class IDefaultableTreeManager;
- class RequestOptions;
- class TreeManager;
-
- namespace uno = com::sun::star::uno;
-//-----------------------------------------------------------------------------
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-
- class Tree;
- class NodeRef;
-//-----------------------------------------------------------------------------
-
- /// provides access to the default for a given request
- class DefaultProviderProxy;
-
- class DefaultProvider
- {
- rtl::Reference< DefaultProviderProxy > m_aProxy;
- public:
- // factory methods
- static DefaultProvider createEmpty();
- static DefaultProvider create(rtl::Reference< Tree > const& _aRootTree,
- RequestOptions const& _xOptions,
- rtl::Reference< TreeManager > const & _xDefaultProvider,
- IDefaultableTreeManager* _pDefaultableTree);
-
- // actual c'tor
- explicit
- DefaultProvider(rtl::Reference< DefaultProviderProxy > const& _xProviderProxy);
-
- // standard c/d-tors to make compiler barrier
- DefaultProvider(DefaultProvider const& _aOther);
- DefaultProvider& operator=(DefaultProvider const& _aOther);
- ~DefaultProvider();
-
- bool isValid() const { return !! m_aProxy.is(); }
-
- /// tries to load a default instance of the specified node
- std::auto_ptr<ISubtree> getDefaultTree(rtl::Reference< Tree > const& _aTree, NodeRef const& _aNode) const SAL_THROW((com::sun::star::uno::Exception));
-
- /// tries to load default data into the specified tree
- bool fetchDefaultData(rtl::Reference< Tree > const& _aTreeRef) const SAL_THROW((com::sun::star::uno::Exception));
- };
-
-//-----------------------------------------------------------------------------
-
- }
-}
-
-#endif // CONFIGMGR_CONFIG_DEFAULTPROVIDER_HXX_
diff --git a/configmgr/source/inc/configexcept.hxx b/configmgr/source/inc/configexcept.hxx
deleted file mode 100644
index 63e235980e..0000000000
--- a/configmgr/source/inc/configexcept.hxx
+++ /dev/null
@@ -1,117 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CONFIGEXCEPT_HXX_
-#define CONFIGMGR_CONFIGEXCEPT_HXX_
-
-#include <rtl/ustring.hxx>
-#include <rtl/string.hxx>
-#include <com/sun/star/uno/Exception.hpp>
-#include <com/sun/star/lang/IllegalArgumentException.hpp>
-
-namespace configmgr
-{
-//-------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
-//-----------------------------------------------------------------------------
- namespace configuration
- {
- //-------------------------------------------------------------------------
-
- class Exception
- {
- rtl::OString m_sAsciiMessage;
- public:
- Exception(char const* sAsciiMessage);
- Exception(rtl::OString const& sAsciiMessage);
- virtual ~Exception() {}
-
- virtual rtl::OUString message() const;
- virtual char const* what() const;
- };
- //-------------------------------------------------------------------------
-
- class InvalidName : public Exception
- {
- rtl::OUString m_sName;
- public:
- InvalidName(rtl::OUString const& sName, char const* sAsciiDescription);
-
- virtual rtl::OUString message() const;
- };
- //-------------------------------------------------------------------------
-
- class ConstraintViolation
- : public Exception
- {
- public:
- ConstraintViolation(char const* sConstraint);
- };
- //-------------------------------------------------------------------------
-
- class TypeMismatch : public Exception
- {
- rtl::OUString m_sTypes;
- static rtl::OUString describe(rtl::OUString const& sFoundType, rtl::OUString const& sExpectedType);
- public:
- TypeMismatch(rtl::OUString const& sFoundType, rtl::OUString const& sExpectedType);
- TypeMismatch(rtl::OUString const& sFoundType, rtl::OUString const& sExpectedType, char const* sAsciiDescription);
-
- virtual rtl::OUString message() const;
- };
- //-------------------------------------------------------------------------
- }
-
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
- namespace configapi
- {
- //-------------------------------------------------------------------------
- class ExceptionMapper
- {
- configuration::Exception& m_eOriginal;
- uno::Reference<uno::XInterface> m_xContext;
- rtl::OUString m_sMessage;
- public:
- ExceptionMapper(configuration::Exception& e);
- ~ExceptionMapper();
-
- void setContext(uno::XInterface* pContext);
-
- rtl::OUString message() const;
- uno::Reference<uno::XInterface> context() const;
-
- void illegalArgument(sal_Int16 nArgument = -1) throw(lang::IllegalArgumentException);
- void unhandled() throw(uno::RuntimeException);
- };
- //-------------------------------------------------------------------------
- }
-//-----------------------------------------------------------------------------
-}
-
-#endif // CONFIGMGR_CONFIGEXCEPT_HXX_
diff --git a/configmgr/source/inc/configgroup.hxx b/configmgr/source/inc/configgroup.hxx
deleted file mode 100644
index e9d58c7852..0000000000
--- a/configmgr/source/inc/configgroup.hxx
+++ /dev/null
@@ -1,114 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CONFIGGROUP_HXX_
-#define CONFIGMGR_CONFIGGROUP_HXX_
-
-#include "configexcept.hxx"
-#include "noderef.hxx"
-#include "configdefaultprovider.hxx"
-
-namespace com { namespace sun { namespace star {
- namespace script { class XTypeConverter; }
-} } }
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-
- class NodeChange;
- class RelativePath;
-//-----------------------------------------------------------------------------
-
- /// helper for updating a <type>NodeRef</type> that refers to a Group
- class GroupUpdateHelper
- {
- rtl::Reference< Tree > m_aTree;
- NodeRef m_aNode;
- public:
- GroupUpdateHelper(rtl::Reference< Tree > const& aParentTree, NodeRef const& aGroupNode);
- ~GroupUpdateHelper() {}
-
- void validateNode(ValueRef const& aNode) const;
- void validateNode(NodeRef const& aNode) const;
-
- rtl::Reference< Tree > const& tree() const { return m_aTree; }
- NodeRef const& node() const { return m_aNode; }
- private:
- void implValidateTree(rtl::Reference< Tree > const& aTree) const;
- void implValidateNode(rtl::Reference< Tree > const& aTree, NodeRef const& aNode) const;
- void implValidateNode(rtl::Reference< Tree > const& aTree, ValueRef const& aNode) const;
- };
-//-----------------------------------------------------------------------------
- /// allows to update values of a simple type within a <type>NodeRef</type> that refers to a Group
- class GroupUpdater
- {
- GroupUpdateHelper m_aHelper;
- com::sun::star::uno::Reference<com::sun::star::script::XTypeConverter> m_xTypeConverter;
- public:
- GroupUpdater(rtl::Reference< Tree > const& aParentTree, NodeRef const& aGroupNode, com::sun::star::uno::Reference<com::sun::star::script::XTypeConverter> const& xConverter);
-
- NodeChange validateSetValue(ValueRef const& aValueNode, com::sun::star::uno::Any const& newValue );
-
- private:
- com::sun::star::uno::Any implValidateValue(rtl::Reference< Tree > const& aTree, ValueRef const& aNode, com::sun::star::uno::Any const& aValue) const;
- };
-//-----------------------------------------------------------------------------
-
- /// allows to reset to default value or state members of a <type>NodeRef</type> that refers to a Group
- class GroupDefaulter
- {
- GroupUpdateHelper m_aHelper;
- DefaultProvider m_aDefaultProvider;
- bool m_bHasDoneSet;
- public:
- GroupDefaulter(rtl::Reference< Tree > const& _aParentTree, NodeRef const& _aGroupNode, DefaultProvider const& _aProvider);
-
- bool hasDoneSet() const { return m_bHasDoneSet; }
-
- NodeChange validateSetToDefaultValue(ValueRef const& aValueNode);
-
- NodeChange validateSetToDefaultState(NodeRef const& aNode);
-
- NodeChanges validateSetAllToDefault();
-
- static bool isDataAvailable(rtl::Reference< Tree > const& _aParentTree, NodeRef const& _aGroupNode);
- static bool ensureDataAvailable(rtl::Reference< Tree > const& _aParentTree, NodeRef const& _aGroupNode, DefaultProvider const& _aSource);
- };
-//-----------------------------------------------------------------------------
- bool isPossibleValueType(com::sun::star::uno::Type const& aValueType);
-//-----------------------------------------------------------------------------
- bool convertCompatibleValue(com::sun::star::uno::Reference<com::sun::star::script::XTypeConverter> const& xConverter, uno::Any& rConverted,
- com::sun::star::uno::Any const& rNewValue, com::sun::star::uno::Type const& rTargetType);
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_CONFIGGROUP_HXX_
diff --git a/configmgr/source/inc/configinteractionhandler.hxx b/configmgr/source/inc/configinteractionhandler.hxx
deleted file mode 100644
index 699aa41e16..0000000000
--- a/configmgr/source/inc/configinteractionhandler.hxx
+++ /dev/null
@@ -1,81 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CONFIGINTERACTIONHANDLER_HXX
-#define CONFIGMGR_CONFIGINTERACTIONHANDLER_HXX
-
-#include "sal/config.h"
-#include "com/sun/star/uno/Reference.hxx"
-#include "rtl/ref.hxx"
-#include "uno/current_context.hxx"
-
-namespace com { namespace sun { namespace star {
- namespace task { class XInteractionHandler; }
- namespace uno { class Any; }
-} } }
-namespace rtl { class OUString; }
-
-namespace configmgr { namespace apihelper {
-
-/**
- represents the InteractionHandler for configuration errors from the current
- context.
-
- <p>Should only be kept in scope while the error is being handled.</p>
-*/
-class ConfigurationInteractionHandler {
-public:
- ConfigurationInteractionHandler();
-
- ~ConfigurationInteractionHandler();
-
- com::sun::star::uno::Reference< com::sun::star::task::XInteractionHandler >
- get() const; // throw (com::sun::star::uno::RuntimeException)
-
- void setRecursive(
- com::sun::star::uno::Reference<
- com::sun::star::task::XInteractionHandler > const & handler);
-
-private:
- ConfigurationInteractionHandler(ConfigurationInteractionHandler &);
- // not defined
- void operator =(ConfigurationInteractionHandler &); // not defined
-
- com::sun::star::uno::Any getPreviousContextValue(
- rtl::OUString const & name) const;
- // throw (com::sun::star::uno::RuntimeException)
-
- class Context;
- friend class Context;
-
- rtl::Reference< Context > m_context;
- com::sun::star::uno::ContextLayer m_layer;
-};
-
-} }
-
-#endif
diff --git a/configmgr/source/inc/configpath.hxx b/configmgr/source/inc/configpath.hxx
deleted file mode 100644
index 2e9a96d185..0000000000
--- a/configmgr/source/inc/configpath.hxx
+++ /dev/null
@@ -1,446 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CONFIGPATH_HXX_
-#define CONFIGMGR_CONFIGPATH_HXX_
-
-#include <rtl/ustring.hxx>
-
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif // INCLUDED_VECTOR
-
-namespace configmgr
-{
- namespace configuration
- {
- //--------------------------------------------------------------------
-
- /** check if this is a well-formed name for a
- config Node (excluding set elements)
- */
- bool isSimpleName(rtl::OUString const& sName) SAL_THROW(());
-
- /** make a name out of <var>sName</var>,
- validating that it can be used for a config Node (excluding set elements)
- or template name.
- @throws InvalidName
- if the name is not valid for that purpose
- */
- rtl::OUString validateNodeName(rtl::OUString const& sName);
-
- /** make a name out of <var>sName</var>
- validating that it can be used for a config set element
- @throws InvalidName
- if the name is not valid for that purpose
- */
- rtl::OUString validateElementName(rtl::OUString const& sName);
- //------------------------------------------------------------------------
-
- //------------------------------------------------------------------------
- namespace Path
- {
- //------------------------------------------------------------------------
-
- class Component
- {
- /// holds the contents of this path component
- rtl::OUString m_aName;
- public:
- /// construct a path component from a string, without any validation
- Component(rtl::OUString const& _sName) SAL_THROW(());
-
- /// is this component an empty name ?
- bool isEmpty() const SAL_THROW(()) { return m_aName.getLength() == 0; }
- /// is this component a simple name ?
- bool isSimpleName() const SAL_THROW(());
- /// get the inner name for this component
- rtl::OUString getName() const SAL_THROW(());
- /// get the embedded type name for this component (if any)
- rtl::OUString getTypeName() const SAL_THROW(());
-
- /// get the contents of this as string (unparsed).
- rtl::OUString toPathString() const SAL_THROW(()) { return m_aName; }
-
- // hashing - for hash maps. compatible to equiv or matches
- size_t hashCode() const SAL_THROW(())
- { return this->getName().hashCode(); }
-
- /// get the contents of this as a name (unparsed). Use with care !
- rtl::OUString const& getInternalName() const SAL_THROW(()) { return m_aName; }
-
- };
-
- //-------------------------------------------------------------------------
-
- /// compare taking type wildcards into account
- bool matches(Component const& lhs,Component const& rhs) SAL_THROW(());
-
- /// compare by inner names only
- bool before(Component const& lhs,Component const& rhs) SAL_THROW(());
-
- /// compare by inner names only
- bool equiv(Component const& lhs,Component const& rhs) SAL_THROW(());
- //-------------------------------------------------------------------------
-
- /// construct a empty path component
- Component makeEmptyComponent() SAL_THROW(());
-
- //-------------------------------------------------------------------------
- /// construct a path component from a name, validating it as simple name
- Component wrapSimpleName(rtl::OUString const& _aName);
-
- /// construct a path component from a type and element name, using a wildcard if no type is available
- Component makeCompositeName(rtl::OUString const& _aElementName, rtl::OUString const& _aTypeName);
-
- //-----------------------------------------------------------------------------
- /// construct a composite path component from a element name or string, using a wildcard type
- template <class NameRep>
- Component wrapElementName(NameRep const& _aElementName) SAL_THROW(())
- {
- return makeCompositeName(_aElementName, NameRep());
- }
-
- //-------------------------------------------------------------------------
- /// construct a path component from an arbitrary na,e or string
- template <class NameRep>
- Component wrapSafeName(NameRep const& _aName) SAL_THROW(())
- {
- return isSimpleName(_aName) ? wrapSimpleName(_aName) : wrapElementName(_aName);
- }
-
- //-----------------------------------------------------------------------------
- /** lower-level representation of a path within the configuration
- <p>Keeps the data in a vector of names in reverse order! </P>
- */
- class Rep
- {
- public:
- /// construct an empty path
- Rep() SAL_THROW(()) : m_aComponents() {}
-
- /// construct a path consisting of a single component <var>_aName</var>
- explicit Rep(Component const& _aName) SAL_THROW(()) : m_aComponents(1,_aName) {}
-
- /// construct a path consisting of a path subrange
- explicit Rep(std::vector<Component>::const_reverse_iterator const& _first, std::vector<Component>::const_reverse_iterator const& _last)
- : m_aComponents(_last.base(), _first.base()) {}
-
- /// swap contents with another instance
- void swap(Rep& _aOther) SAL_THROW(()) { m_aComponents.swap(_aOther.m_aComponents); }
-
- /// modify a path by prepending <var>aName</var>
- void prepend(Component const& _aName) SAL_THROW(()) { m_aComponents.push_back(_aName); }
-
- /// modify a path by prepending <var>aName</var>
- void prepend(Rep const& _aOther) SAL_THROW(());
-
- /// get the local name (the last component of this path)
- Component const& getLocalName() const { check_not_empty(); return m_aComponents.front(); }
-
- /// get the next name (the first component of this path)
- Component const& getFirstName() const { check_not_empty(); return m_aComponents.back(); }
-
- /// set this to the remainder after the first name (drop the first component of this path)
- void dropFirstName() { check_not_empty(); m_aComponents.pop_back(); }
-
- /// get a /-separated string representation of this
- rtl::OUString toString(bool _bAbsolute) const SAL_THROW(());
-
- public:
- /// check if this is an empty path
- bool isEmpty() const SAL_THROW(()) { return m_aComponents.empty(); }
-
- /// Count the components of this
- std::vector<Component>::size_type countComponents() const SAL_THROW(()) { return m_aComponents.size(); }
-
- /// Insert a component into this path
- void insertComponent(std::vector<Component>::reverse_iterator _it, Component _aName)
- { m_aComponents.insert(_it.base(),_aName); }
-
- /// Remove a component from this path
- void removeComponent(std::vector<Component>::reverse_iterator _it) { m_aComponents.erase(_it.base()); }
-
- /// Remove all components from this path
- void clearComponents() SAL_THROW(()) { m_aComponents.clear(); }
-
- /// get a STL style iterator to the first component
- std::vector<Component>::const_reverse_iterator begin() const SAL_THROW(()) { return m_aComponents.rbegin(); }
- /// get a STL style iterator to after the last component
- std::vector<Component>::const_reverse_iterator end() const SAL_THROW(()) { return m_aComponents.rend(); }
-
- /// get a STL style iterator to the first component
- std::vector<Component>::reverse_iterator begin_mutate() SAL_THROW(()) { return m_aComponents.rbegin(); }
- /// get a STL style iterator to after the last component
- std::vector<Component>::reverse_iterator end_mutate() SAL_THROW(()) { return m_aComponents.rend(); }
-
- // hashing - for hash maps
- size_t hashCode() const SAL_THROW(());
-
- /// preflight check for operations that require a non-empty path
- void check_not_empty() const;
-
- private:
- std::vector<Component> m_aComponents;
- };
- //------------------------------------------------------------------------
-
- /// compare taking type wildcards into account
- bool matches(Rep const& lhs,Rep const& rhs) SAL_THROW(());
-
- /// compare by inner names only
- bool before(Rep const& lhs,Rep const& rhs) SAL_THROW(());
-
- /// compare by inner names only
- bool equiv(Rep const& lhs,Rep const& rhs) SAL_THROW(());
- //------------------------------------------------------------------------
-
- /// check a path for a prefix
- bool hasMatchingPrefix(Rep const& _aPath,Rep const& _aPrefix) SAL_THROW(());
-
- /// remove a prefix from a path. Throws InvalidName if it isn't a prefix
- Rep stripMatchingPrefix(Rep const& _aPath,Rep const& _aPrefix);
- //------------------------------------------------------------------------
-
- /// distinguishes which kind of path is present in a string
- bool isAbsolutePath(rtl::OUString const& _sPath);
- //------------------------------------------------------------------------
- }
- //------------------------------------------------------------------------
-
- class RelativePath
- {
- Path::Rep m_aRep;
- public:
- // Construction
- /// construct a relative path from <var>aString</var> throwing InvalidName for parse errors
- static RelativePath parse(rtl::OUString const& _aString);
-
- /// construct an empty relative path
- RelativePath() SAL_THROW(()) : m_aRep() { init(); }
-
- /// construct a relative path having <var>aRep</var> as representation
- explicit RelativePath(Path::Rep const& _aRep)
- : m_aRep(_aRep) { init(); }
-
- /// CONVERSION: construct a relative path having <var>aName</var> as single component
- RelativePath(Path::Component const& _aName) SAL_THROW(());
-
- /// build the Path that results from appending <var>aPath</var> to this
- RelativePath compose(RelativePath const& _aPath) const SAL_THROW(());
-
- /// check if this is an empty path
- bool isEmpty() const SAL_THROW(()) { return m_aRep.isEmpty(); }
-
- /// Count the components of this
- std::vector<Path::Component>::size_type getDepth() const SAL_THROW(()) { return m_aRep.countComponents(); }
-
- /// get the local name (the last component of this path)
- Path::Component const& getLocalName() const { return m_aRep.getLocalName(); }
-
- /// get the local name (the first component of this path)
- Path::Component const& getFirstName() const { return m_aRep.getFirstName(); }
-
- /// set this to the remainder of this path after the first name (drop the first component of this path)
- void dropFirstName() { m_aRep.dropFirstName(); }
-
- /// get a /-separated string representation of this
- rtl::OUString toString() const SAL_THROW(());
- public:
- // Iteration support
- /// get a STL style iterator to the first component
- std::vector<Path::Component>::const_reverse_iterator begin() const SAL_THROW(()) { return m_aRep.begin(); }
- /// get a STL style iterator to after the last component
- std::vector<Path::Component>::const_reverse_iterator end() const SAL_THROW(()) { return m_aRep.end(); }
-
- /// get a STL style iterator to the first component
- std::vector<Path::Component>::reverse_iterator begin_mutate() SAL_THROW(()) { return m_aRep.begin_mutate(); }
- /// get a STL style iterator to after the last component
- std::vector<Path::Component>::reverse_iterator end_mutate() SAL_THROW(()) { return m_aRep.end_mutate(); }
-
- // Direct access - 'package' visible
- /// Get a reference to (or copy of) the internal PathRep of this
- Path::Rep const& rep() const SAL_THROW(()) { return m_aRep; }
-
- private:
- void init();
- };
-
- /// compare taking type wildcards into account
- inline bool matches(RelativePath const& lhs,RelativePath const& rhs) SAL_THROW(())
- { return Path::matches(lhs.rep(),rhs.rep()); }
-
- //------------------------------------------------------------------------
-
- class AbsolutePath
- {
- Path::Rep m_aRep;
- public:
- // Construction
- /// construct a absolute path from <var>aString</var> throwing InvalidName for parse errors
- static AbsolutePath parse(rtl::OUString const& _aString);
-
- /// construct a absolute path to a whole module (toplevel) without error checking
- static AbsolutePath makeModulePath(rtl::OUString const& _aString) SAL_THROW(());
-
- /// construct an absolute path to the (virtual) hierarchy root
- static AbsolutePath root() SAL_THROW(());
-
- /// construct an (otherwise invalid) substitute path for the root of a free-floating node
- static AbsolutePath detachedRoot() SAL_THROW(());
-
- /// construct a absolute path having <var>aRep</var> as representation
- explicit AbsolutePath(Path::Rep const& _aRep) SAL_THROW(())
- : m_aRep(_aRep) { init(); }
-
- /// build the absolute path that results from appending <var>aPath</var> to this
- AbsolutePath compose(RelativePath const& _aPath) const SAL_THROW(());
-
- /// build the absolute path that results from removing the last component of this
- AbsolutePath getParentPath() const;
-
- /// check if this is the path to the (imaginary) root node
- bool isRoot() const SAL_THROW(()) { return m_aRep.isEmpty(); }
-#if OSL_DEBUG_LEVEL > 0
- /// check if this is a path to a detached node
- bool isDetached() const SAL_THROW(());
-#endif
- /// get the local name (the last component of this path)
- Path::Component const& getLocalName() const { return m_aRep.getLocalName(); }
-
- rtl::OUString const & getModuleName() const { return m_aRep.getFirstName().getInternalName(); }
-
- /// get a /-separated string representation of this
- rtl::OUString toString() const SAL_THROW(());
-
- /// Count the components of this
- std::vector<Path::Component>::size_type getDepth() const SAL_THROW(()) { return m_aRep.countComponents(); }
- public:
- // Iteration support
- /// get a STL style iterator to the first component
- std::vector<Path::Component>::const_reverse_iterator begin() const SAL_THROW(()) { return m_aRep.begin(); }
- /// get a STL style iterator to after the last component
- std::vector<Path::Component>::const_reverse_iterator end() const SAL_THROW(()) { return m_aRep.end(); }
-
- /// get a STL style iterator to the first component
- std::vector<Path::Component>::reverse_iterator begin_mutate() SAL_THROW(()) { return m_aRep.begin_mutate(); }
- /// get a STL style iterator to after the last component
- std::vector<Path::Component>::reverse_iterator end_mutate() SAL_THROW(()) { return m_aRep.end_mutate(); }
-
- // Direct access - 'package' visible
- /// Get a reference to (or copy of) the internal PathRep of this
- Path::Rep const& rep() const SAL_THROW(()) { return m_aRep; }
- private:
- void init() SAL_THROW(());
- };
-
- /// compare taking type wildcards into account
- inline bool matches(AbsolutePath const& lhs,AbsolutePath const& rhs) SAL_THROW(())
- { return Path::matches(lhs.rep(),rhs.rep()); }
-
- namespace Path
- {
- //------------------------------------------------------------------------
- template <class PathClass>
- bool hasPrefix(PathClass const& _aPath, PathClass const& _aPrefix) SAL_THROW(())
- {
- return hasMatchingPrefix(_aPath.rep(),_aPrefix.rep() );
- }
- //------------------------------------------------------------------------
-
- template <class PathClass>
- RelativePath stripPrefix(PathClass const& _aPath, PathClass const& _aPrefix)
- {
- return RelativePath( stripMatchingPrefix(_aPath.rep(),_aPrefix.rep()) );
- }
- //------------------------------------------------------------------------
-
- // STL Helpers
- //------------------------------------------------------------------------
-
- /// a weak strict ordering considering only the name part
- struct Before
- {
- bool operator()(Component const& lhs, Component const& rhs) const SAL_THROW(())
- { return before(lhs,rhs); }
- bool operator()(Rep const& lhs, Rep const& rhs) const SAL_THROW(())
- { return before(lhs,rhs); }
- bool operator()(AbsolutePath const& lhs, AbsolutePath const& rhs) const SAL_THROW(())
- { return before(lhs.rep(),rhs.rep()); }
- bool operator()(RelativePath const& lhs, RelativePath const& rhs) const SAL_THROW(())
- { return before(lhs.rep(),rhs.rep()); }
- };
- //------------------------------------------------------------------------
-
- /// an equality relation considering only the name part (compatible to Before)
- struct Equiv
- {
- bool operator()(Component const& lhs, Component const& rhs) const SAL_THROW(())
- { return equiv(lhs,rhs); }
- bool operator()(Rep const& lhs, Rep const& rhs) const SAL_THROW(())
- { return equiv(lhs,rhs); }
- bool operator()(AbsolutePath const& lhs, AbsolutePath const& rhs) const SAL_THROW(())
- { return equiv(lhs.rep(),rhs.rep()); }
- bool operator()(RelativePath const& lhs, RelativePath const& rhs) const SAL_THROW(())
- { return equiv(lhs.rep(),rhs.rep()); }
- };
- //------------------------------------------------------------------------
-
- /// a hash generator (compatible to Equiv and Before)
- struct Hash
- {
- size_t operator()(Component const& _aObject) const SAL_THROW(())
- { return _aObject.hashCode(); }
- size_t operator()(Rep const& _aObject) const SAL_THROW(())
- { return _aObject.hashCode(); }
- size_t operator()(AbsolutePath const& _aObject) const SAL_THROW(())
- { return _aObject.rep().hashCode(); }
- size_t operator()(RelativePath const& _aObject) const SAL_THROW(())
- { return _aObject.rep().hashCode(); }
- };
- //------------------------------------------------------------------------
- /// a binary predicate that is not (!) an equivalence relation
-
- struct Matches
- {
- bool operator()(Component const& lhs, Component const& rhs) const SAL_THROW(())
- { return matches(lhs,rhs); }
- bool operator()(Rep const& lhs, Rep const& rhs) const SAL_THROW(())
- { return matches(lhs,rhs); }
- bool operator()(AbsolutePath const& lhs, AbsolutePath const& rhs) const SAL_THROW(())
- { return matches(lhs.rep(),rhs.rep()); }
- bool operator()(RelativePath const& lhs, RelativePath const& rhs) const SAL_THROW(())
- { return matches(lhs.rep(),rhs.rep()); }
- };
- //------------------------------------------------------------------------
- }
- //------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_CONFIGNAME_HXX_
diff --git a/configmgr/source/inc/configset.hxx b/configmgr/source/inc/configset.hxx
deleted file mode 100644
index 2327d89d85..0000000000
--- a/configmgr/source/inc/configset.hxx
+++ /dev/null
@@ -1,143 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CONFIGSET_HXX_
-#define CONFIGMGR_CONFIGSET_HXX_
-
-#include "configexcept.hxx"
-#include "configdefaultprovider.hxx"
-#include "template.hxx"
-#include "noderef.hxx"
-#include <rtl/ref.hxx>
-
-#ifndef INCLUDED_MEMORY
-#include <memory>
-#define INCLUDED_MEMORY
-#endif
-
-namespace com { namespace sun { namespace star {
- namespace script { class XTypeConverter; }
-} } }
-
-namespace configmgr
-{
- namespace data { class TreeSegment; }
-
- namespace configuration
- {
- namespace Path { class Component; }
- //---------------------------------------------------------------------
-
- class ElementTree;
-
- class NodeChange;
- class Template;
-
- class SetElementFactory
- {
- TemplateProvider m_aProvider;
- public:
- SetElementFactory(TemplateProvider const& aProvider);
- SetElementFactory(SetElementFactory const& aOther);
- SetElementFactory& operator=(SetElementFactory const& aOther);
- ~SetElementFactory();
-
- rtl::Reference< ElementTree > instantiateTemplate(rtl::Reference<Template> const& aTemplate);
- rtl::Reference< ElementTree > instantiateOnDefault(rtl::Reference< data::TreeSegment > const& _aTree, rtl::Reference<Template> const& aDummyTemplate);
-
- static TemplateProvider findTemplateProvider(rtl::Reference< Tree > const& aTree, NodeRef const& aNode);
- };
-
-//-----------------------------------------------------------------------------
-
- /// allows to insert,remove and replace an element of a <type>Node</type> that is a Container ("set") of full-fledged trees.
- class TreeSetUpdater
- {
- rtl::Reference< Tree > m_aParentTree;
- NodeRef m_aSetNode;
- rtl::Reference<Template> m_aTemplate;
- public:
- TreeSetUpdater(rtl::Reference< Tree > const& aParentTree, NodeRef const& aSetNode, rtl::Reference< Template > const& aTemplate);
-
- NodeChange validateInsertElement (rtl::OUString const& aName, rtl::Reference< ElementTree > const& aNewElement);
-
- NodeChange validateReplaceElement(rtl::Reference< ElementTree > const& aElement, rtl::Reference< ElementTree > const& aNewElement);
-
- NodeChange validateRemoveElement (rtl::Reference< ElementTree > const& aElement);
- private:
- void implValidateSet();
- Path::Component implValidateElement(rtl::Reference< ElementTree > const& aElement, bool bReqRemovable);
- void implValidateTree(rtl::Reference< ElementTree > const& aElementTree);
- };
-//-----------------------------------------------------------------------------
- /// allows to insert,remove and replace an element of a <type>Node</type> that is a Container ("set") of simple values.
- class ValueSetUpdater
- {
- rtl::Reference< Tree > m_aParentTree;
- NodeRef m_aSetNode;
- rtl::Reference<Template> m_aTemplate;
- com::sun::star::uno::Reference<com::sun::star::script::XTypeConverter> m_xTypeConverter;
- public:
- ValueSetUpdater(rtl::Reference< Tree > const& aParentTree, NodeRef const& aSetNode,
- rtl::Reference< Template > const& aTemplate, com::sun::star::uno::Reference<com::sun::star::script::XTypeConverter> const& xConverter);
-
- NodeChange validateInsertElement (rtl::OUString const& aName, com::sun::star::uno::Any const& aNewValue);
-
- NodeChange validateReplaceElement(rtl::Reference< ElementTree > const& aElement, com::sun::star::uno::Any const& aNewValue);
-
- NodeChange validateRemoveElement (rtl::Reference< ElementTree > const& aElement);
- private:
- void implValidateSet();
- Path::Component implValidateElement(rtl::Reference< ElementTree > const& aElement, bool bReqRemovable);
- com::sun::star::uno::Any implValidateValue(rtl::Reference< Tree > const& aElementTree, com::sun::star::uno::Any const& aValue);
- com::sun::star::uno::Any implValidateValue(com::sun::star::uno::Any const& aValue);
-
- rtl::Reference<ElementTree> makeValueElement(rtl::OUString const& aName, rtl::Reference< Tree > const& aElementTree, com::sun::star::uno::Any const& aValue, bool bInserting);
- rtl::Reference<ElementTree> makeValueElement(rtl::OUString const& aName, com::sun::star::uno::Any const& aValue, bool bInserting);
- rtl::Reference< Tree > extractElementNode(rtl::Reference< ElementTree > const& aElement);
- };
-//-----------------------------------------------------------------------------
-
- /// allows to restore to its default state a <type>Node</type> that is a Container ("set") of full-fledged trees.
- class SetDefaulter
- {
- rtl::Reference< Tree > m_aParentTree;
- NodeRef m_aSetNode;
- DefaultProvider m_aDefaultProvider;
- public:
- SetDefaulter(rtl::Reference< Tree > const& aParentTree, NodeRef const& aSetNode, DefaultProvider const& aDefaultProvider);
-
- NodeChange validateSetToDefaultState();
-
- private:
- void implValidateSet();
- };
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_CONFIGSET_HXX_
diff --git a/configmgr/source/inc/confsvccomponent.hxx b/configmgr/source/inc/confsvccomponent.hxx
deleted file mode 100644
index 02fb32972d..0000000000
--- a/configmgr/source/inc/confsvccomponent.hxx
+++ /dev/null
@@ -1,88 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_API_SVCCOMPONENT_HXX_
-#define CONFIGMGR_API_SVCCOMPONENT_HXX_
-
-#include "serviceinfohelper.hxx"
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <cppuhelper/compbase1.hxx>
-#include <cppuhelper/typeprovider.hxx>
-
-#ifndef _OSL_MUTEX_HXX_
-#include <osl/Mutex.hxx>
-#endif
-#include <rtl/ustring.hxx>
-
-namespace configmgr
-{
-
-//----------------------------------------------------------------------------
- namespace css = ::com::sun::star;
- namespace uno = css::uno;
- namespace lang = css::lang;
-
-//----------------------------------------------------------------------------
- class ServiceComponentImpl
- : public ::cppu::WeakComponentImplHelper1< lang::XServiceInfo >
- {
- protected:
- ServiceImplementationInfo const*const m_info;
- public:
- ServiceComponentImpl(ServiceImplementationInfo const* aInfo);
-
- // XTypeProvider
- virtual uno::Sequence<sal_Int8> SAL_CALL getImplementationId( ) throw(uno::RuntimeException);
- //virtual uno::Sequence<uno::Type> SAL_CALL getTypes( ) throw(uno::RuntimeException) = 0;
-
- // XServiceInfo
- virtual rtl::OUString SAL_CALL getImplementationName( ) throw(uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(uno::RuntimeException);
- virtual uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(uno::RuntimeException);
-
- // Component Helper - force override
- virtual void SAL_CALL disposing() = 0;
- // Component Helper - check object state
- virtual void checkAlive() throw (uno::RuntimeException);
- void checkAlive(char const* message) throw (uno::RuntimeException)
- { checkAlive( rtl::OUString::createFromAscii(message) ); }
- void checkAlive(rtl::OUString const& message) throw (uno::RuntimeException);
-
- // Extra helpers
- static uno::Sequence<sal_Int8> getStaticImplementationId(ServiceImplementationInfo const* pServiceInfo) throw(uno::RuntimeException);
-
- private: // no implementation
- ServiceComponentImpl(ServiceComponentImpl&);
- void operator=(ServiceComponentImpl&);
- };
-//----------------------------------------------------------------------------
-
-} // namespace configmgr
-
-#endif // CONFIGMGR_API_SVCCOMPONENT_HXX_
-
-
diff --git a/configmgr/source/inc/datalock.hxx b/configmgr/source/inc/datalock.hxx
deleted file mode 100644
index ccd4db9fb2..0000000000
--- a/configmgr/source/inc/datalock.hxx
+++ /dev/null
@@ -1,68 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_DATALOCK_HXX_
-#define CONFIGMGR_DATALOCK_HXX_
-
-#include "sal/config.h"
-
-#include "osl/interlck.h"
-#include "osl/mutex.hxx"
-
-namespace configmgr {
-
- class UnoApiLock
- {
- static osl::Mutex aCoreLock;
- public:
- static volatile oslInterlockedCount nHeld;
- UnoApiLock() { acquire(); }
- ~UnoApiLock() { release(); }
-
- static osl::Mutex &getLock() { return aCoreLock; }
- static void acquire() { aCoreLock.acquire(); nHeld++; }
- static void release() { nHeld--; aCoreLock.release(); }
- static bool isHeld() { return nHeld != 0; }
- };
- class UnoApiLockReleaser
- {
- oslInterlockedCount mnCount;
- public:
- UnoApiLockReleaser();
- ~UnoApiLockReleaser();
- };
- class UnoApiLockClearable : public UnoApiLock
- {
- bool mbSet;
- public:
- UnoApiLockClearable() : mbSet(true) { acquire(); }
- ~UnoApiLockClearable() { clear(); }
- void clear() { if (mbSet) { mbSet = false; release(); } }
- };
-}
-
-#endif // CONFIGMGR_DATALOCK_HXX_
diff --git a/configmgr/source/inc/defaultprovider.hxx b/configmgr/source/inc/defaultprovider.hxx
deleted file mode 100644
index f6600a9de6..0000000000
--- a/configmgr/source/inc/defaultprovider.hxx
+++ /dev/null
@@ -1,73 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_DEFAULTPROVIDER_HXX
-#define CONFIGMGR_DEFAULTPROVIDER_HXX
-
-#include "sal/config.h"
-
-#include "com/sun/star/uno/Exception.hpp"
-#include "sal/types.h"
-
-#include "utility.hxx"
-
-namespace configmgr
-{
- namespace configuration
- {
- class AbsolutePath;
- }
- //-------------------------
- class RequestOptions;
- //==========================================================================
- //= IDefaultableTreeManager
- //==========================================================================
- /* is a supplementary interface for an <type>OProviderImpl</type>.
- <p>Supports functionality to load default data into the managed tree</p>
- */
- class SAL_NO_VTABLE IDefaultableTreeManager
- {
- public:
- /** attempt to load default data into the tree named by a path using certain options
- and requiring a specific loading depth.
-
- @returns
- <TRUE/>, if some default data is available within the tree
- <FALSE/>, if no default data is available for the tree
- */
- virtual sal_Bool fetchDefaultData(configuration::AbsolutePath const& aSubtreePath,
- const RequestOptions& _xOptions
- ) SAL_THROW((com::sun::star::uno::Exception)) = 0;
-
- };
-
-////////////////////////////////////////////////////////////////////////////////
-
-} // namespace configmgr
-
-#endif
-
diff --git a/configmgr/source/inc/emptylayer.hxx b/configmgr/source/inc/emptylayer.hxx
deleted file mode 100644
index b737cef382..0000000000
--- a/configmgr/source/inc/emptylayer.hxx
+++ /dev/null
@@ -1,53 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_EMPTYLAYER_HXX
-#define CONFIGMGR_BACKEND_EMPTYLAYER_HXX
-
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-
-// -----------------------------------------------------------------------------
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
- namespace backend
- {
- // -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace backenduno = ::com::sun::star::configuration::backend;
-
- // -----------------------------------------------------------------------------
- uno::Reference< backenduno::XLayer > createEmptyLayer();
-
- bool checkEmptyLayer(uno::Reference< backenduno::XLayer > const & xLayer );
- // -----------------------------------------------------------------------------
- } // namespace xml
- // -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
diff --git a/configmgr/source/inc/filehelper.hxx b/configmgr/source/inc/filehelper.hxx
deleted file mode 100644
index 9b7c295a6e..0000000000
--- a/configmgr/source/inc/filehelper.hxx
+++ /dev/null
@@ -1,114 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONFIGMGR_FILEHELPER_HXX_
-#define _CONFIGMGR_FILEHELPER_HXX_
-
-#include "utility.hxx"
-#include <osl/file.hxx>
-#include <com/sun/star/io/IOException.hpp>
-
-namespace io = com::sun::star::io;
-
-namespace configmgr
-{
- //==========================================================================
- //= FileHelper
- //==========================================================================
- /** Within the FileHelper namespace there is a list of methods declared, which ease
- specific file operations.
- */
- namespace FileHelper
- {
- /// delimiter used in URLs and ConfPath
- static const ::sal_Unicode delimiter = sal_Unicode('/');
-
- /// Tests if the file exists.
- bool fileExists(rtl::OUString const& _sFileURL);
-
- /// Tests if the directory exists.
- bool dirExists(rtl::OUString const& _sDirURL);
-
- /** Returns the parent part of the pathname of this File URL,
- or an empty string if the name has no parent part.
- The parent part is generally everything leading up to the last occurrence
- of the separator character.
- */
- rtl::OUString getParentDir(rtl::OUString const& _aFileURL);
-
- /**
- Returns the file name part of a file URL.
-
- @param aFileUrl file URL
- @return everything in the URL from the last delimiter on
- */
- rtl::OUString getFileName(const rtl::OUString& aFileUrl) ;
-
- /**
- Splits a file URL between its parent directory/file name
- parts.
-
- @param aFileUrl file URL
- @param aParentDirectory parent directory filled on return
- @param aFileName file name filled on return
- */
- void splitFileUrl(const rtl::OUString& aFileUrl,
- rtl::OUString& aParentDirectory,
- rtl::OUString& aFileName) ;
-
- /** creates a directory whose pathname is specified by a FileURL.
- @return true if directory could be created or does exist, otherwise false.
- */
- osl::FileBase::RC mkdir(rtl::OUString const& _sDirURL);
-
- /** creates a directory whose pathname is specified by a FileURL,
- including any necessary parent directories.
- @return true if directory (or directories) could be created or do(es) exist, otherwise false.
- */
- osl::FileBase::RC mkdirs(rtl::OUString const& _aDirectory);
-
- /** replaces a file specified by _aToURL with a file specified by _aFromURL.
- */
- void replaceFile(const rtl::OUString& _aToURL, const rtl::OUString &_aFromURL) SAL_THROW((io::IOException));
-
- /** removes a file specified by _aURL. Ignores the case of a non-existing file.
- */
- bool tryToRemoveFile(const rtl::OUString& _aURL, bool tryBackupFirst);
-
- /** creates an error msg string for a given file error return code.
- */
- rtl::OUString createOSLErrorString(osl::FileBase::RC eError);
-
- /** determines the status of a directory entry specified by a URL.
- @return the Size of the file in bytes and the TimeValue of the last modification, if the file exists,
- otherwise 0 and a TimeValue(0,0).
- */
- sal_uInt64 getModifyStatus(rtl::OUString const& _aNormalizedFilename, TimeValue & rModifyTime);
- }
-} // namespace configmgr
-
-#endif
diff --git a/configmgr/source/inc/flags.hxx b/configmgr/source/inc/flags.hxx
deleted file mode 100644
index 472b8d5e82..0000000000
--- a/configmgr/source/inc/flags.hxx
+++ /dev/null
@@ -1,133 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef INCLUDED_DATA_FLAGS_HXX
-#define INCLUDED_DATA_FLAGS_HXX
-
-#include <sal/types.h>
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace data
- {
- //-----------------------------------------------------------------------------
- // node type + value type selector - fits into a byte (bit 5 currently unassigned)
- namespace Type
- {
- enum Type
- {
- // Primitive Data Type is stored in bits 0-4 (bit 3 currently unused)
- // base data types
- value_any, // = 0
- value_string, // = 1
- value_boolean, // = 2
- value_short, // = 3
- value_int, // = 4
- value_long, // = 5
- value_double, // = 6
- value_binary, // = 7
-
- mask_basetype = 0x0F,
-
- // sequence data types
- flag_sequence = 0x10,
-
- value_invalid = value_any | flag_sequence,
-
- value_string_list = value_string | flag_sequence,
- value_boolean_list = value_boolean | flag_sequence,
- value_short_list = value_short | flag_sequence,
- value_int_list = value_int | flag_sequence,
- value_long_list = value_long | flag_sequence,
- value_double_list = value_double | flag_sequence,
- value_binary_list = value_binary | flag_sequence,
-
- mask_valuetype = mask_basetype | flag_sequence, // 0x1F
-
- // Node Type is stored in bits 6+7
- nodetype_shift_ = 6,
- mask_nodetype = 0x03 << nodetype_shift_, // 0xC0
-
- // maybe we should use 0 for node type 'value'
- // to make the complete type be the valuetype ?
- nodetype_invalid= 0x00,
-
- nodetype_value = 0x01 << nodetype_shift_, // 0x40
- nodetype_group = 0x02 << nodetype_shift_, // 0x80
- nodetype_set = 0x03 << nodetype_shift_, // 0xC0
-
- flag_innernode = 0x02 << nodetype_shift_, // 0x80
- flag_setnode = 0x01 << nodetype_shift_ // 0x40
- };
- }
-
- //-----------------------------------------------------------------------------
- // node attributes
- namespace Flags
- {
- enum Type
- {
- readonly = 0x01,
- finalized = 0x02,
-
- nullable = 0x04,
- localized = 0x08,
-
- valueAvailable = 0x10, // only used for value nodes
- defaultAvailable = 0x20, // only used for value nodes
-
- defaulted = 0x40, // somewhat redundant with State
- defaultable = 0x80 // redundant with State (merged || defaulted)
- };
- }
- //-----------------------------------------------------------------------------
- // set element or tree state
- namespace State
- {
- enum Type
- {
- merged, // = 0, - result of merging defaults + changes
- defaulted, // = 1, - result of copying defaults unchanged
- replaced, // = 2, - result of copying new layer unchanged
- added, // = 3, - same as 'replaced', but it is known,
- // that there is no corresponding default
-
- mask_state = 0x0F, // leaves bits 3+4 reserved for states
-
- flag_mandatory = 0x10, // marks this element as non-removable/replacable
- flag_readonly = 0x20, // marks this element as read-only
- flag_default_avail = 0x40, // marks this element as containing default values
- flag_removable = 0x80 // marks this element as removable
- };
- }
- //-----------------------------------------------------------------------------
- }
-//-----------------------------------------------------------------------------
-}
-
-#endif // INCLUDED_DATA_FLAGS_HXX
diff --git a/configmgr/source/inc/interactionrequest.hxx b/configmgr/source/inc/interactionrequest.hxx
deleted file mode 100644
index d925b47d5e..0000000000
--- a/configmgr/source/inc/interactionrequest.hxx
+++ /dev/null
@@ -1,163 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_INTERACTIONREQUEST_HXX
-#define CONFIGMGR_INTERACTIONREQUEST_HXX
-
-#include <com/sun/star/task/XInteractionRequest.hpp>
-#include <com/sun/star/task/XInteractionAbort.hpp>
-#include <com/sun/star/task/XInteractionRetry.hpp>
-#include <com/sun/star/task/XInteractionApprove.hpp>
-#include <com/sun/star/task/XInteractionDisapprove.hpp>
-#include <cppuhelper/implbase1.hxx>
-
-namespace configmgr {
-namespace apihelper {
- namespace uno = com::sun::star::uno;
- namespace task = com::sun::star::task;
-//============================================================================
-
-/**
- * This class implements the interface XInteractionRequest. Instances can
- * be passed directly to XInteractionHandler::handle(...). Each interaction
- * request contains an exception describing the error and a number of
- * interaction continuations describing the possible "answers" for the request.
- * After the request was passed to XInteractionHandler::handle(...) the method
- * getSelection() returns the continuation choosen by the interaction handler.
- *
- * The typical usage of this class would be:
- *
- * 1) Create exception object that shall be handled by the interaction handler.
- * 2) Create InteractionRequest, supply exception as ctor parameter
- * 3) Create continuations needed and add them to a sequence
- * 4) Supply the continuations to the InteractionRequest by calling
- * setContinuations(...)
- *
- * This class can also be used as base class for more specialized requests,
- * like authentication requests.
- */
-class InteractionRequest : public cppu::WeakImplHelper1<com::sun::star::task::XInteractionRequest>
-{
- struct Impl;
- Impl * m_pImpl;
-
-protected:
- virtual ~InteractionRequest();
-public:
- /**
- * Constructor.
- *
- * @param rRequest is the exception describing the error.
- */
- InteractionRequest( const com::sun::star::uno::Any & rRequest );
-
- /**
- * This method sets the continuations for the request.
- *
- * @param rContinuations contains the possible continuations.
- */
- void setContinuations(
- const uno::Sequence< uno::Reference< task::XInteractionContinuation > > &
- rContinuations );
-
- // XInteractionRequest
- virtual uno::Any SAL_CALL
- getRequest()
- throw( uno::RuntimeException );
-
- virtual uno::Sequence< uno::Reference< task::XInteractionContinuation > > SAL_CALL
- getContinuations()
- throw( com::sun::star::uno::RuntimeException );
-
- // Non-interface methods.
-
- /**
- * After passing this request to XInteractionHandler::handle, this method
- * returns the continuation that was choosen by the interaction handler.
- *
- * @return the continuation choosen by an interaction handler or an empty
- * reference, if the request was not (yet) handled.
- */
- uno::Reference< task::XInteractionContinuation > getSelection() const;
-
- /**
- * This method sets a continuation for the request. It also can be used
- * to reset the continuation set by a previous XInteractionHandler::handle
- * call in order to use this request object more then once.
- *
- * @param rxSelection is the interaction continuation to activate for
- * the request or an empty reference in order to reset the
- * current selection.
- */
- void setSelection(
- const uno::Reference< task::XInteractionContinuation > & rxSelection );
-};
-
-//============================================================================
-
-/**
- * This template class implements a simple standard interaction continuation
- * interface provided as template parameter. Classes instantiated from this
- * template work together with class InteractionRequest.
- * Instances of such a class can be passed along with an interaction request
- * to indicate the possiblity to continue the operation that caused the request
- * as indicated by the interface.
- */
-template <class XThisContinuation >
-class InteractionContinuation : public cppu::WeakImplHelper1< XThisContinuation >
-{
- InteractionRequest * m_pRequest;
-public:
- InteractionContinuation( InteractionRequest * pRequest )
- : m_pRequest( pRequest ) {}
-
- // XInteractionContinuation
- /**
- * This method marks this continuation as "selected" at the request it
- * belongs to.
- *
- * Derived classes must implement their XInteractionContinuation::select()
- * method the way that they call this method.
- */
- virtual void SAL_CALL select()
- throw( com::sun::star::uno::RuntimeException );
-};
-//============================================================================
-
-template <class XThisContinuation >
-void SAL_CALL InteractionContinuation< XThisContinuation >::select()
- throw( com::sun::star::uno::RuntimeException )
-{
- m_pRequest->setSelection(this);
-}
-//============================================================================
-
-
-} // namespace apihelper
-} // namespace configmgr
-
-#endif /* !CONFIGMGR_INTERACTIONREQUEST_HXX */
diff --git a/configmgr/source/inc/localizedtreeactions.hxx b/configmgr/source/inc/localizedtreeactions.hxx
deleted file mode 100644
index 96a7fbeef1..0000000000
--- a/configmgr/source/inc/localizedtreeactions.hxx
+++ /dev/null
@@ -1,52 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public 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_LOCALIZEDTREEACTIONS_HXX
-#define CONFIGMGR_LOCALIZEDTREEACTIONS_HXX
-
-#include "valuenode.hxx"
-#include "treesegment.hxx"
-//..........................................................................
-namespace configmgr
-{
-class SubtreeChange;
-
-//==========================================================================
-// Helper function to invoke the previous ones properly
-
-// convert to the given locale format, assuming the original representation was expanded
-rtl::Reference< data::TreeSegment > cloneExpandedForLocale(sharable::TreeFragment * tree, rtl::OUString const& _sLocale);
-// convert to the given locale format, assuming the original representation was expanded
-std::auto_ptr<INode> reduceExpandedForLocale(std::auto_ptr<ISubtree> _pNode, rtl::OUString const& _sLocale);
-
-//..........................................................................
-} // namespace configmgr
-//..........................................................................
-
-#endif // CONFIGMGR_LOCALIZEDTREEACTIONS_HXX
-
-
diff --git a/configmgr/source/inc/logger.hxx b/configmgr/source/inc/logger.hxx
deleted file mode 100644
index 88a328f294..0000000000
--- a/configmgr/source/inc/logger.hxx
+++ /dev/null
@@ -1,113 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_LOGGER_HXX
-#define CONFIGMGR_LOGGER_HXX
-
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/util/logging/XLogger.hpp>
-#include <com/sun/star/util/logging/LogLevel.hpp>
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace uno = com::sun::star::uno;
- namespace logging = com::sun::star::util::logging;
- namespace LogLevel = logging::LogLevel;
-
- /// class providing access to a log output sink in the context
- class Logger
- {
- uno::Reference< logging::XLogger > m_xLogger;
- public:
- Logger() : m_xLogger() {}
-
- Logger(uno::Reference< logging::XLogger > const & xLogger)
- : m_xLogger(xLogger)
- {}
-
- explicit
- Logger(uno::Reference< uno::XComponentContext > const & xContext)
- : m_xLogger( getUnoLoggerFromContext(xContext) )
- {}
-
- sal_Int32 level() const
- { return m_xLogger.is() ? m_xLogger->getLevel() : LogLevel::OFF; }
-
- bool isLogging(sal_Int32 nLogLevel) const
- { return m_xLogger.is() && m_xLogger->isLoggable(nLogLevel); }
-
- /// log output to the logger
- void log(sal_Int32 nLevel, const rtl::OUString & msg, const char * sourceMethod = 0, const char * sourceClass = 0) const;
- void log(sal_Int32 nLevel, const char * msg, const char * sourceMethod = 0, const char * sourceClass = 0) const;
-
- void error(const rtl::OUString & msg, const char * sourceMethod = 0, const char * sourceClass = 0) const
- { log( LogLevel::SEVERE, msg, sourceMethod, sourceClass); }
- void error(const char * msg, const char * sourceMethod = 0, const char * sourceClass = 0) const
- { log( LogLevel::SEVERE, msg, sourceMethod, sourceClass); }
-
- void warning(const rtl::OUString & msg, const char * sourceMethod = 0, const char * sourceClass = 0) const
- { log( LogLevel::WARNING, msg, sourceMethod, sourceClass); }
- void warning(const char * msg, const char * sourceMethod = 0, const char * sourceClass = 0) const
- { log( LogLevel::WARNING, msg, sourceMethod, sourceClass); }
-
- void info(const rtl::OUString & msg, const char * sourceMethod = 0, const char * sourceClass = 0) const
- { log( LogLevel::INFO, msg, sourceMethod, sourceClass); }
- void info(const char * msg, const char * sourceMethod = 0, const char * sourceClass = 0) const
- { log( LogLevel::INFO, msg, sourceMethod, sourceClass); }
-
- void config(const rtl::OUString & msg, const char * sourceMethod = 0, const char * sourceClass = 0) const
- { log( LogLevel::CONFIG, msg, sourceMethod, sourceClass); }
- void config(const char * msg, const char * sourceMethod = 0, const char * sourceClass = 0) const
- { log( LogLevel::CONFIG, msg, sourceMethod, sourceClass); }
-
- void fine(const rtl::OUString & msg, const char * sourceMethod = 0, const char * sourceClass = 0) const
- { log( LogLevel::FINE, msg, sourceMethod, sourceClass); }
- void fine(const char * msg, const char * sourceMethod = 0, const char * sourceClass = 0) const
- { log( LogLevel::FINE, msg, sourceMethod, sourceClass); }
-
- void finer(const rtl::OUString & msg, const char * sourceMethod = 0, const char * sourceClass = 0) const
- { log( LogLevel::FINER, msg, sourceMethod, sourceClass); }
- void finer(const char * msg, const char * sourceMethod = 0, const char * sourceClass = 0) const
- { log( LogLevel::FINER, msg, sourceMethod, sourceClass); }
-
- void finest(const rtl::OUString & msg, const char * sourceMethod = 0, const char * sourceClass = 0) const
- { log( LogLevel::FINEST, msg, sourceMethod, sourceClass); }
- void finest(const char * msg, const char * sourceMethod = 0, const char * sourceClass = 0) const
- { log( LogLevel::FINEST, msg, sourceMethod, sourceClass); }
-
- uno::Reference< logging::XLogger > getUnoLogger() const { return m_xLogger; }
-
- static
- uno::Reference< logging::XLogger >
- getUnoLoggerFromContext(uno::Reference< uno::XComponentContext > const & xContext);
- };
-// -----------------------------------------------------------------------------
-} // namespace configmgr
-
-#endif // CONFIGMGR_LOGGER_HXX
-
diff --git a/configmgr/source/inc/matchlocale.hxx b/configmgr/source/inc/matchlocale.hxx
deleted file mode 100644
index 5a08595c57..0000000000
--- a/configmgr/source/inc/matchlocale.hxx
+++ /dev/null
@@ -1,215 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-/* PLEASE DON'T DELETE ANY COMMENT LINES, ALSO IT'S UNNECESSARY. */
-
-#ifndef CONFIGMGR_MATCHLOCALE_HXX
-#define CONFIGMGR_MATCHLOCALE_HXX
-
-#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/lang/Locale.hpp>
-
-#include <rtl/ustring.hxx>
-#include <vector>
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
-
- namespace localehelper
- {
- // -------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
-
- // -------------------------------------------------------------------------
- extern char const * const c_sAnyLanguage;
- extern char const * const c_sDefLanguage;
-
- extern bool isAnyLanguage(rtl::OUString const & _sLanguage);
- extern bool isDefaultLanguage(rtl::OUString const & _sLanguage);
-
- extern rtl::OUString getAnyLanguage();
- extern rtl::OUString getDefaultLanguage();
-
- extern com::sun::star::lang::Locale getAnyLocale();
- extern com::sun::star::lang::Locale getDefaultLocale();
-
- // -------------------------------------------------------------------------
- // the max value of std::vector< com::sun::star::lang::Locale >::size_type - marks out-of-range (Value == -1 == ~0)
- std::vector< com::sun::star::lang::Locale >::size_type const c_noPosition = std::vector< com::sun::star::lang::Locale >::size_type(0)-std::vector< com::sun::star::lang::Locale >::size_type(1);
-
- // conversion helpers
- com::sun::star::lang::Locale makeLocale(rtl::OUString const& sLocaleName_);
- rtl::OUString makeIsoLocale(com::sun::star::lang::Locale const& aUnoLocale_);
-
- std::vector< com::sun::star::lang::Locale > makeLocaleSequence(uno::Sequence<rtl::OUString> const& sLocaleNames_);
- uno::Sequence<rtl::OUString> makeIsoSequence(std::vector< com::sun::star::lang::Locale > const& aLocales_);
-
- inline
- bool equalLocale(com::sun::star::lang::Locale const & lhs, com::sun::star::lang::Locale const & rhs)
- { return lhs.Language == rhs.Language && lhs.Country == rhs.Country; }
-
- inline
- bool equalLanguage(com::sun::star::lang::Locale const & lhs, com::sun::star::lang::Locale const & rhs)
- { return lhs.Language == rhs.Language; }
- // -------------------------------------------------------------------------
- bool designatesAllLocales(com::sun::star::lang::Locale const& aLocale_);
- bool designatesAllLocales(std::vector< com::sun::star::lang::Locale > const& aLocales_);
- // -------------------------------------------------------------------------
-
- /// result of matching a locale against a target locale
- enum MatchQuality
- {
- MISMATCH = 0, /// match: locales do not match (must be zero!)
- MATCH_LANGUAGE, /// match: languages match - country mismatch
- MATCH_LANGUAGE_PLAIN, /// match: languages match - no country to match
- MATCH_LOCALE, /// match: full match
- BEST_MATCH = MATCH_LOCALE
- };
-
- /// compare two locales for 'nearness'
- MatchQuality match(com::sun::star::lang::Locale const& aLocale_, com::sun::star::lang::Locale const& aTarget_);
-
-
- // -------------------------------------------------------------------------
- /// result of matching a Locale against a target sequence of locales
- class MatchResult
- {
- std::vector< com::sun::star::lang::Locale >::size_type m_nPos;
- MatchQuality m_eQuality;
-
- public:
- /// construct a default (no match) result
- MatchResult()
- { reset(); }
-
- /// construct a result from given parameters - use with care
- MatchResult(std::vector< com::sun::star::lang::Locale >::size_type nPos_, MatchQuality eQuality_)
- : m_nPos( nPos_ )
- , m_eQuality(eQuality_)
- {}
-
- /// construct an optimum result
- static MatchResult best() { return MatchResult(0,MATCH_LOCALE); }
-
- /// has there been a match
- bool isMatch() const { return m_eQuality != MISMATCH; }
- /// is this the best match possible ?
- bool isBest() const { return m_nPos == 0 && m_eQuality == MATCH_LOCALE; }
-
- /// retrieve the position that was matched
- std::vector< com::sun::star::lang::Locale >::size_type position() const { return m_nPos; }
- /// retrieve the quality of match
- MatchQuality quality() const { return m_eQuality; }
-
- /// assign the given position and quality, if they are an improvement
- bool improve(std::vector< com::sun::star::lang::Locale >::size_type nPos, MatchQuality eQuality_);
-
- /// reset to no match or best match state
- void reset()
- {
- m_nPos = c_noPosition;
- m_eQuality = MISMATCH;
- }
-
- // ---------------------------------------------------------------------
- // comparing MatchResults
- friend bool operator ==(MatchResult const& lhs, MatchResult const& rhs)
- {
- return lhs.m_nPos == rhs.m_nPos &&
- lhs.m_eQuality == rhs.m_eQuality;
- }
-
- // ordering of MatchResults - greater is better
- friend bool operator < (MatchResult const& lhs, MatchResult const& rhs)
- {
- if (lhs.m_nPos > rhs.m_nPos) return true; // greater position is worse
- if (lhs.m_nPos < rhs.m_nPos) return false;
-
- return (lhs.m_eQuality < rhs.m_eQuality); // least Quality is worse
- }
-
- };
-
- // ---------------------------------------------------------------------
- // derived relational operators
- inline bool operator !=(MatchResult const& lhs, MatchResult const& rhs)
- { return !(lhs == rhs); }
- inline bool operator > (MatchResult const& lhs, MatchResult const& rhs)
- { return rhs < lhs; }
- inline bool operator <= (MatchResult const& lhs, MatchResult const& rhs)
- { return !(rhs < lhs); }
- inline bool operator >=(MatchResult const& lhs, MatchResult const& rhs)
- { return !(lhs < rhs); }
-
- /// improve an existing match of a locale against a sequence of locales
- bool improveMatch(MatchResult& rMatch_, com::sun::star::lang::Locale const& aLocale_, std::vector< com::sun::star::lang::Locale > const& aTarget_);
-
- /// match a locale against a sequence of locales for a given quality level
- bool isMatch(com::sun::star::lang::Locale const& aLocales, std::vector< com::sun::star::lang::Locale > const& aTarget_, MatchQuality eRequiredQuality_);
-
- // -------------------------------------------------------------------------
- /// add defaults to a sequence of locales
- void addFallbackLocales(std::vector< com::sun::star::lang::Locale >& aTargetList_);
-
- // -------------------------------------------------------------------------
- class FindBestLocale
- {
- public:
- /// construct a MatchLocale with a single target locale
- FindBestLocale(com::sun::star::lang::Locale const& aTarget_);
-
- /// is there any match ?
- bool isMatch() const { return m_aResult.isMatch(); }
-
- /// is there an optimum match (so we are done) ?
- bool isBestMatch() const { return m_aResult.isBest(); }
-
- /// get the quality of the best match found
- MatchQuality getMatchQuality() const { return m_aResult.quality(); }
-
- /// check, if the given locale improves the quality. if it does, accept it
- bool accept(com::sun::star::lang::Locale const& aLocale_);
-
- /// reset the match result, indicating whether a match is needed at all
- void reset(bool bNeedLocale_ = true);
-
- private:
- void implSetTarget(std::vector< com::sun::star::lang::Locale > const& aTarget_);
-
- std::vector< com::sun::star::lang::Locale > m_aTarget;
- MatchResult m_aResult;
- };
-
- } // namespace
-// -----------------------------------------------------------------------------
-
-} // namespace
-
-#endif
-
diff --git a/configmgr/source/inc/mergechange.hxx b/configmgr/source/inc/mergechange.hxx
deleted file mode 100644
index 24d1649e8a..0000000000
--- a/configmgr/source/inc/mergechange.hxx
+++ /dev/null
@@ -1,68 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef INCLUDED_CONFIGMGR_MERGECHANGE_HXX
-#define INCLUDED_CONFIGMGR_MERGECHANGE_HXX
-
-#include "namecreator.hxx"
-#include "change.hxx"
-#include "treechangelist.hxx"
-
-namespace configmgr
-{
- // method that applies changes on a existing subtree
- void combineUpdates (SubtreeChange const& _anUpdate, SubtreeChange& _aCombinedUpdate);
-
- // -----------------------------------------------------------------------------
- class OStripDefaults : private ChangeTreeModification
- {
- SubtreeChange& m_rParent;
- public:
- OStripDefaults(SubtreeChange& _rSubtree) : m_rParent(_rSubtree) {}
-
- bool isEmpty() const { return m_rParent.size() == 0; }
-
- OStripDefaults& strip();
-
- static bool strip(SubtreeChange& _rSubtree)
- {
- return OStripDefaults(_rSubtree).strip().isEmpty();
- }
- private:
- void stripOne(Change& _rChange);
-
- virtual void handle(ValueChange& _rValueNode);
- virtual void handle(AddNode& _rAddNode);
- virtual void handle(RemoveNode& _rRemoveNode);
- virtual void handle(SubtreeChange& _rSubtree);
- };
-
- // -----------------------------------------------------------------------------
-} // namespace configmgr
-
-#endif
-
diff --git a/configmgr/source/inc/mergeddataprovider.hxx b/configmgr/source/inc/mergeddataprovider.hxx
deleted file mode 100644
index 94ba2d3679..0000000000
--- a/configmgr/source/inc/mergeddataprovider.hxx
+++ /dev/null
@@ -1,173 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_MERGEDDATAPROVIDER_HXX
-#define CONFIGMGR_BACKEND_MERGEDDATAPROVIDER_HXX
-
-#include "sal/config.h"
-
-#include "salhelper/simplereferenceobject.hxx"
-
-#include "request.hxx"
-#include "requesttypes.hxx"
-#include "utility.hxx"
-
-namespace configmgr
-{
-// ---------------------------------------------------------------------------
- namespace backend
- {
-// ---------------------------------------------------------------------------
- /** Listener interface for receiving notifications
- about changes to previously requested data
- */
- struct SAL_NO_VTABLE INodeDataListener
- {
- /** is called to indicate changes within the data being observed.
-
- @param _aOriginalRequest
- identifies the data that changed
- */
- virtual void dataChanged(ComponentRequest const & _aOriginalRequest) SAL_THROW(()) = 0;
- };
-// ---------------------------------------------------------------------------
-
- /// Interface providing access to template (schema) data
- struct SAL_NO_VTABLE ITemplateDataProvider
- {
- /** loads a given template and returns it as return value
-
- @param _aRequest
- identifies the template to be loaded
-
- @returns
- A valid instance of the given template.
-
- <p> Currently a request with empty template name
- will retrieve a group node holding all templates
- of a component.
- </p>
-
- @throws com::sun::star::uno::Exception
- if the template cannot be retrieved.
- The exact exception being thrown may depend on the underlying backend.
- */
- virtual ResultHolder< TemplateInstance > getTemplateData(TemplateRequest const & _aRequest)
- SAL_THROW((com::sun::star::uno::Exception)) = 0;
- };
-// ---------------------------------------------------------------------------
-
- /** Composite interface providing full access to merged configuration data
- from some data store.
-
- <p> Loading and updating of data is supported.
- Support for notification depends on the backend.
- </p>
- */
- struct IMergedDataProvider
- : salhelper::SimpleReferenceObject
- , ITemplateDataProvider
- {
- /** loads merged data for a (partial) tree and returns it as return value.
-
- @param _aRequest
- identifies the component to be loaded
-
- @param _pListener
- a listener to observe subsequent changes to the data requested
-
- <p> If NULL, no notifications will be sent. </p>
-
- <p> Otherwise the listener will be notified of changes.
- The listener must subsequently be removed by calling
- <member>removeRequestListener</member>.
- The listener must live at least until it is removed.
- </p>
-
- @returns
- A valid component instance for the given request.
-
- @throws com::sun::star::uno::Exception
- if the node cannot be retrieved.
- The exact exception being thrown may depend on the underlying backend.
- */
- virtual ResultHolder< ComponentInstance > getNodeData(ComponentRequest const & _aRequest,
- ITemplateDataProvider* _aTemplateProvider,
- INodeDataListener * _pListener = NULL)
- SAL_THROW((com::sun::star::uno::Exception)) = 0;
-
- /** remove a listener registered for a previous request.
- <p>This may also release some open resources for the request.</p>
-
- @param _pListener
- a listener that was passed to a previous succes
-
- @param _aRequest
- identifies the component associated with the listener
- */
- virtual void removeRequestListener(INodeDataListener * _pListener,
- const ComponentRequest& aRequest) SAL_THROW(()) = 0;
-
- /** applies an update to the stored data.
-
- @param _anUpdate
- identifies the node to be updated and
- describes the changes to be applied.
-
- @throws com::sun::star::uno::Exception
- if the node cannot be updated.
- The exact exception being thrown may depend on the underlying backend.
- */
- virtual void updateNodeData(UpdateRequest const & _anUpdate)
- SAL_THROW((com::sun::star::uno::Exception)) = 0;
-
- /** loads default data for a (partial) tree and returns it as return value
-
- @param _aRequest
- identifies the node to be loaded
-
- @returns
- A valid node instance for the default state of the given node.
-
- <p>May be NULL, if the node exists but has no default equivalent.</p>
-
- @throws com::sun::star::uno::Exception
- if the default cannot be retrieved.
- The exact exception being thrown may depend on the underlying backend.
- */
- virtual ResultHolder< NodeInstance > getDefaultData(NodeRequest const & _aRequest)
- SAL_THROW((com::sun::star::uno::Exception)) = 0;
- };
-
-// ---------------------------------------------------------------------------
- } // namespace backend
-
-// ---------------------------------------------------------------------------
-} // namespace configmgr
-
-#endif
-
diff --git a/configmgr/source/inc/namecreator.hxx b/configmgr/source/inc/namecreator.hxx
deleted file mode 100644
index 8d0e11383a..0000000000
--- a/configmgr/source/inc/namecreator.hxx
+++ /dev/null
@@ -1,73 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef INCLUDED_CONFIGMGR_NAMECREATOR_HXX
-#define INCLUDED_CONFIGMGR_NAMECREATOR_HXX
-
-#include "configpath.hxx"
-
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
- class Change;
- class SubtreeChange;
- // -----------------------------------------------------------------------------
-
- class ONameCreator
- {
- public:
- ONameCreator() {}
-
- void pushName(const configuration::Path::Component &_aName) { m_aNameList.push_back(_aName); }
- void popName() { m_aNameList.pop_back(); }
-
- void clear() { m_aNameList.clear(); }
-
- static configuration::Path::Component createName(Change const& _rChange, SubtreeChange const* _pParent);
- private:
- std::vector< configuration::Path::Component > m_aNameList;
- };
-
- template <class PathClass>
- class OPathCreator : public ONameCreator
- {
- public:
- OPathCreator() : m_aBasePath( configuration::Path::Rep() ) {}
- OPathCreator(PathClass const & _aBasePath) : m_aBasePath(_aBasePath) {}
-
- void init(PathClass const & _aBasePath)
- { clear(); m_aBasePath = _aBasePath; }
-
- private:
- PathClass m_aBasePath;
- };
- // -----------------------------------------------------------------------------
-
-} // namespace configmgr
-
-#endif
-
diff --git a/configmgr/source/inc/node.hxx b/configmgr/source/inc/node.hxx
deleted file mode 100644
index 6c0ca04a31..0000000000
--- a/configmgr/source/inc/node.hxx
+++ /dev/null
@@ -1,229 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef INCLUDED_SHARABLE_NODE_HXX
-#define INCLUDED_SHARABLE_NODE_HXX
-
-#include "rtl/ustring.hxx"
-
-#include "flags.hxx"
-#include "anydata.hxx"
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace node { struct Attributes; }
-//-----------------------------------------------------------------------------
- namespace sharable
- {
- struct TreeFragment;
- union Node;
- //-----------------------------------------------------------------------------
- struct NodeInfo
- {
- rtl_uString * name;
- sal_uInt16 parent; // always counts backwards
- sal_uInt8 flags;
- sal_uInt8 type; // contains discriminator for union
-
- rtl::OUString getName() const;
- node::Attributes getNodeInfoAttributes() const;
- bool isDefault() const;
- bool isLocalized() const;
-
- void markAsDefault(bool bDefault = true);
- };
- //-----------------------------------------------------------------------------
- struct GroupNode
- {
- NodeInfo info;
- sal_uInt16 numDescendants; // = number of descendants
-
- bool hasDefaultsAvailable() const;
-
- Node * getFirstChild() const;
- Node * getNextChild(Node * child) const;
- Node * getChild(rtl::OUString const & name) const;
-
- static inline GroupNode * from(Node * node);
- };
- //-----------------------------------------------------------------------------
- struct SetNode
- {
-
- NodeInfo info;
- sal_uInt8 * elementType; // points to template [MM:SetNode *?]
- TreeFragment * elements; // points to first element (TreeFragmentHeader)
-
- rtl::OUString getElementTemplateName() const;
- rtl::OUString getElementTemplateModule() const;
-
- TreeFragment * getFirstElement() const;
- TreeFragment * getNextElement(TreeFragment * _pElement) const;
- TreeFragment * getElement(rtl::OUString const & name) const;
-
- void addElement(TreeFragment * newElement);
- TreeFragment * removeElement(rtl::OUString const & name);
-
- static inline SetNode * from(Node * node);
-
- // low-level helper for template data abstraction
- static
- sal_uInt8 * allocTemplateData(const rtl::OUString &rName,
- const rtl::OUString &rModule);
- static
- sal_uInt8 * copyTemplateData(sal_uInt8 * _aTemplateData);
- static
- void releaseTemplateData(sal_uInt8 * _aTemplateData);
- };
- //-----------------------------------------------------------------------------
- struct ValueNode
- {
- NodeInfo info;
- AnyData value;
- AnyData defaultValue;
-
- bool isNull() const;
- bool hasUsableDefault() const;
-
- com::sun::star::uno::Any getValue() const;
- com::sun::star::uno::Type getValueType() const;
- com::sun::star::uno::Any getUserValue() const;
- com::sun::star::uno::Any getDefaultValue() const;
-
- void setValue(com::sun::star::uno::Any const & newValue);
- void setToDefault();
- void changeDefault(com::sun::star::uno::Any const & newDefault);
-
- static inline ValueNode * from(Node * node);
-
- private:
- void releaseValue();
- sal_uInt8 adaptType(com::sun::star::uno::Any const & newValue);
- };
- //-----------------------------------------------------------------------------
- // TODO: optimized representation of localized values (now as set; mapping locale->element-name)
- // TODO (?): better representation of sets of values
- //-----------------------------------------------------------------------------
- union Node
- {
- NodeInfo info;
- GroupNode group;
- SetNode set;
- ValueNode value;
-
- // info access
- bool isNamed(rtl::OUString const & _aName) const;
- rtl::OUString getName() const;
- node::Attributes getAttributes() const;
- bool isDefault() const;
-
- // type checks
- bool isGroup() const { return typeIs (data::Type::nodetype_group); }
- bool isSet() const { return typeIs (data::Type::nodetype_set); }
- bool isValue() const { return typeIs (data::Type::nodetype_value); }
-
- // checked access
- inline GroupNode * groupData();
- inline GroupNode const * groupData() const;
- inline SetNode * setData();
- inline SetNode const * setData() const;
- inline ValueNode * valueData();
- inline ValueNode const * valueData() const;
-
- // navigation
- bool isFragmentRoot() const;
-#if OSL_DEBUG_LEVEL > 0
- Node * getParentNode();
- Node const * getParentNode() const;
-#endif
- TreeFragment * getTreeFragment();
- TreeFragment const * getTreeFragment() const;
-
- Node * getSubnode(rtl::OUString const & name);
-
- private:
- bool typeIs(data::Type::Type eType) const
- { return (info.type & data::Type::mask_nodetype) == eType; }
- };
-
- //-----------------------------------------------------------------------------
- inline GroupNode * GroupNode::from(Node * node)
- { return node == 0 ? 0 : node->groupData(); }
-
- inline SetNode * SetNode::from(Node * node)
- { return node == 0 ? 0 : node->setData(); }
-
- inline ValueNode * ValueNode::from(Node * node)
- { return node == 0 ? 0 : node->valueData(); }
-
- inline GroupNode * Node::groupData()
- { return isGroup() ? &this->group : NULL; }
- inline GroupNode const * Node::groupData() const
- { return isGroup() ? &this->group : NULL; }
- inline SetNode * Node::setData()
- { return isSet() ? &this->set : NULL; }
- inline SetNode const * Node::setData() const
- { return isSet() ? &this->set : NULL; }
- inline ValueNode * Node::valueData()
- { return isValue() ? &this->value : NULL; }
- inline ValueNode const * Node::valueData() const
- { return isValue() ? &this->value : NULL; }
-
- inline Node * node(ValueNode * pNode)
- { return reinterpret_cast<Node*>(pNode); }
- inline Node * node(GroupNode * pNode)
- { return reinterpret_cast<Node*>(pNode); }
- inline Node * node(SetNode * pNode)
- { return reinterpret_cast<Node*>(pNode); }
-
- inline Node const * node(ValueNode const* pNode)
- { return reinterpret_cast<Node const*>(pNode); }
- inline Node const * node(GroupNode const* pNode)
- { return reinterpret_cast<Node const*>(pNode); }
- inline Node const * node(SetNode const* pNode)
- { return reinterpret_cast<Node const*>(pNode); }
- //-----------------------------------------------------------------------------
- inline Node & node(ValueNode & pNode)
- { return reinterpret_cast<Node&>(pNode); }
- inline Node & node(GroupNode & pNode)
- { return reinterpret_cast<Node&>(pNode); }
- inline Node & node(SetNode & pNode)
- { return reinterpret_cast<Node&>(pNode); }
-
- inline Node const & node(ValueNode const& pNode)
- { return reinterpret_cast<Node const&>(pNode); }
- inline Node const & node(GroupNode const& pNode)
- { return reinterpret_cast<Node const&>(pNode); }
- inline Node const & node(SetNode const& pNode)
- { return reinterpret_cast<Node const&>(pNode); }
- //-----------------------------------------------------------------------------
- }
-//-----------------------------------------------------------------------------
-}
-
-#endif // INCLUDED_SHARABLE_NODE_HXX
diff --git a/configmgr/source/inc/nodechange.hxx b/configmgr/source/inc/nodechange.hxx
deleted file mode 100644
index cecf9874b0..0000000000
--- a/configmgr/source/inc/nodechange.hxx
+++ /dev/null
@@ -1,157 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CONFIGCHANGE_HXX_
-#define CONFIGMGR_CONFIGCHANGE_HXX_
-
-#include "rtl/ref.hxx"
-
-#include "configexcept.hxx"
-
-#include <vector>
-
-namespace configmgr
-{
- namespace configuration
- {
-//-----------------------------------------------------------------------------
- class AbsolutePath;
- class RelativePath;
- class NodeRef;
- class NodeID;
- class SubNodeID;
- class Tree;
-//-----------------------------------------------------------------------------
-
- class NodeChange;
- class NodeChangeImpl;
- class NodeChangeLocation;
- class NodeChangeInformation;
- class NodeChangesInformation;
-//-----------------------------------------------------------------------------
-
- /// represents a node position in some tree
- class NodeChange
- {
- public:
- /// constructs an empty (unchanging) node change
- NodeChange();
- /// constructs a node change with a given implementation
- NodeChange(NodeChangeImpl* pImpl);
- /// copies a node change with reference semantics
- NodeChange(NodeChange const& rOther);
- /// copies a node change with reference semantics
- NodeChange& operator=(NodeChange const& rOther);
- /// swaps the contents of this with another NodeChange
- void swap(NodeChange& rOther);
- /// destroys a node change
- ~NodeChange();
-
- /// checks, if this may represent an actual change (might not be tested)
- bool maybeChange() const;
- /// checks, if this represents an actual change (PRE: must be tested)
- bool isChange() const;
- /// retrieve information about the changed data, appending to a sequence, returning the count
- sal_uInt32 getChangeInfos(NodeChangesInformation& rInfo) const;
- /// retrieve information about what node is changed
- bool getChangeLocation(NodeChangeLocation& rLoc) const;
-
- /// test whether this would really be a change (as close as possible)
- NodeChange& test();
- NodeChange const& test() const;
-
- /// apply this change and check whether the target node changed
- NodeChange& apply();
- NodeChange const& apply() const;
-
- // retrieve the tree where the change is actually taking place
- rtl::Reference< Tree > getAffectedTree() const;
- // retrieve the node where the change is actually taking place
- NodeRef getAffectedNode() const;
-
- // Comparison
- friend bool operator==(NodeChange const& lhs, NodeChange const& rhs)
- {
- return lhs.m_pImpl == rhs.m_pImpl;
- }
- friend bool operator!=(NodeChange const& lhs, NodeChange const& rhs)
- {
- return lhs.m_pImpl != rhs.m_pImpl;
- }
-
- /// provides access to the internal Implementation for related classes
- NodeChangeImpl* impl() const { return m_pImpl; }
- private:
- NodeChangeImpl* m_pImpl;
- void init(), deinit();
- };
-
- /** represents a collection of updates to nodes (identified by <type>NodeChange</type>s) within a hierarchy of config entries
- */
- class NodeChanges
- {
- public:
- /// Constructs an empty collection of changes
- NodeChanges();
-
- /// checks whether there are any (non-empty) changes in this
- bool isEmpty() const;
-
- /// retrieves the total count of changes in this collection
- std::vector<NodeChange>::size_type getCount() const { return m_aChanges.size(); }
-
- /// retrieve information about the changed data, appending to a sequence, returning the count
- sal_uInt32 getChangesInfos(NodeChangesInformation& rInfos) const;
-
- /// test all changes
- NodeChanges& test() { implTest(); return *this; }
- NodeChanges const& test() const { implTest(); return *this; }
-
- /// remove all changes known to be doing nothing from this collection.
- NodeChanges& compact();
-
- /** insert a change into this collection
- */
- void add(NodeChange const& aChange);
-
- /// returns an STL-style iterator to the first element of the collection
- std::vector<NodeChange>::const_iterator begin() const { return m_aChanges.begin(); }
- std::vector<NodeChange>::iterator begin() { return m_aChanges.begin(); }
-
- /// returns an STL-style iterator to past the last element of the collection
- std::vector<NodeChange>::const_iterator end() const { return m_aChanges.end(); }
- std::vector<NodeChange>::iterator end() { return m_aChanges.end(); }
-
- private:
- void implTest() const;
- std::vector<NodeChange> m_aChanges;
- };
-
- }
-}
-
-#endif // CONFIGMGR_CONFIGCHANGE_HXX_
diff --git a/configmgr/source/inc/nodechangeinfo.hxx b/configmgr/source/inc/nodechangeinfo.hxx
deleted file mode 100644
index 20c9f4ba5d..0000000000
--- a/configmgr/source/inc/nodechangeinfo.hxx
+++ /dev/null
@@ -1,246 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CONFIGCHANGEINFO_HXX_
-#define CONFIGMGR_CONFIGCHANGEINFO_HXX_
-
-#include "configpath.hxx"
-#include "noderef.hxx"
-#include "valueref.hxx"
-#include <rtl/ref.hxx>
-
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif
-
-namespace configmgr
-{
- namespace configuration
- {
-//-----------------------------------------------------------------------------
- class NodeRef;
- class ValueRef;
- class NodeID;
- class SubNodeID;
-
- class ElementTree;
-
-//-----------------------------------------------------------------------------
- /// captures the values of something changing
- template <class DataT>
- struct DataChange
- {
- DataT newValue;
- DataT oldValue;
-
- DataChange()
- : newValue(), oldValue()
- {}
-
- DataChange(DataT const& newValue_, DataT const& oldValue_)
- : newValue(newValue_), oldValue(oldValue_)
- {}
-
- // note: maybe we should support a comparison object
- bool isDataChange() const
- { return !(oldValue == newValue); } // not using != to avoid conversion warning
- };
-
-//-----------------------------------------------------------------------------
- /// information about what changed (but close to no context)
- class NodeChangeData
- {
- public:
- //-------------------------------------------------
- enum Type
- {
- eNoChange,
-
- // Changes to value nodes
- eSetValue,
- eSetDefault,
-
- // Changes to set nodes
- eInsertElement,
- eReplaceElement,
- eRemoveElement,
-
- eRenameElementTree, // not fully supported yet
-
- eResetSetDefault
- };
- //-------------------------------------------------
-
- bool isEmptyChange() const { return eNoChange == type; }
- bool isValueChange() const { return eSetValue <= type && type <= eSetDefault; }
- bool isSetChange() const { return eInsertElement <= type && type <= eRemoveElement; }
- bool isRemoveSetChange() const { return eRemoveElement == type;}
- bool isReplaceSetChange() const { return eReplaceElement == type;}
- //-------------------------------------------------
- bool isDataChange() const;
-
- //-------------------------------------------------
- // wrapper object creation
- rtl::Reference< Tree > getNewElementTree() const;
- rtl::Reference< Tree > getOldElementTree() const;
-
- NodeID getNewElementNodeID() const;
- NodeID getOldElementNodeID() const;
- //-------------------------------------------------
-
- //-- Compiler barrier for element tree ------------
- NodeChangeData();
- NodeChangeData(NodeChangeData const& aOther);
- NodeChangeData& operator=(NodeChangeData const& aOther);
- ~NodeChangeData();
- //-------------------------------------------------
- Type type;
-
- // Value change: old/new value; Set change: new/old api element (if known); Rename: old/new name
- DataChange< com::sun::star::uno::Any > unoData;
- // Value change: NULL,NULL; Set change: new/old tree element; Rename: the affected element-tree (twice)
- DataChange< rtl::Reference<ElementTree> > element;
- //-------------------------------------------------
- };
-
- //-------------------------------------------------
- // Identify the location of a change. Interpretation of members may depend upon
- class NodeChangeLocation
- {
- public:
- //-------------------------------------------------
- // checks whether the base has been properly set up.
- // Does not check for existence of the affected node
-#if OSL_DEBUG_LEVEL > 0
- /// check whether the location has been initialized properly
- bool isValidData() const;
-#endif
- /// check whether the location is for a valid object
- bool isValidLocation() const;
-
- //-------------------------------------------------
- /// retrieve the path from the base node to the changed node (which might be a child of the affected node)
- RelativePath getAccessor() const { return m_path; }
-
- /// retrieve the tree where the change is actually initiated/reported
- rtl::Reference< Tree > getBaseTree() const;
- /// retrieve the node where the change is actually initiated/reported
- NodeRef getBaseNode() const;
-
- /// retrieve the tree where the change is actually taking place (may be Empty, if the tree has never been accessed)
- rtl::Reference< Tree > getAffectedTreeRef() const;
- /// identify the node where the change is actually taking place
- NodeID getAffectedNodeID() const;
-
- /// identify the node (within the affected tree), that actually is changed (this one may be a value node)
- SubNodeID getChangingValueID() const;
-
- //-------------------------------------------------
- void setAccessor( RelativePath const& aAccessor );
-
- void setBase( NodeID const& aBaseID );
- void setBase( rtl::Reference< Tree > const& aBaseTree, NodeRef const& aBaseNode )
- { setBase( NodeID(aBaseTree,aBaseNode) ); }
-
- void setAffected( NodeID const& aTargetID );
- void setAffected( rtl::Reference< Tree > const& aTargetTree, NodeRef const& aTargetNode )
- { setAffected( NodeID(aTargetTree,aTargetNode) ); }
-
- void setChangingSubnode( bool bSubnode = true );
- //-------------------------------------------------
- NodeChangeLocation();
- // NodeChangeLocation(NodeChangeLocation const& aOther);
- // NodeChangeLocation& operator=(NodeChangeLocation const& aOther);
- // ~NodeChangeLocation();
- //-------------------------------------------------
- private:
- RelativePath m_path; // path from baseNode to changing node
- NodeID m_base; // a (non-empty) node
- NodeID m_affected; // identifies the affected node (if available)
- bool m_bSubNodeChanging; // do we change a value ?
- //-------------------------------------------------
- };
-//-----------------------------------------------------------------------------
- class NodeChangeInformation
- {
- public:
- //-------------------------------------------------
- explicit
- NodeChangeInformation()
- : change()
- , location()
- {
- }
- //-------------------------------------------------
- NodeChangeData change;
- NodeChangeLocation location;
-
- //-------------------------------------------------
- bool hasValidLocation() const { return location.isValidLocation(); }
- bool isDataChange() const { return change.isDataChange(); }
-
- bool isEmptyChange() const { return change.isEmptyChange(); }
- bool isValueChange() const { return change.isValueChange(); }
- bool isSetChange() const { return change.isSetChange(); }
- //-------------------------------------------------
- };
-//-----------------------------------------------------------------------------
-
- class NodeChangesInformation
- {
- public:
- std::vector< NodeChangeInformation >::size_type size() const { return m_data.size(); }
- bool empty() const { return m_data.empty(); }
-
- void reserve(std::vector< NodeChangeInformation >::size_type sz_) { m_data.reserve(sz_); }
- void clear() { m_data.clear(); }
- void swap(NodeChangesInformation& aOther) throw() { m_data.swap(aOther.m_data); }
-
- void push_back(NodeChangeInformation const& aChange_)
- { m_data.push_back(aChange_); }
-
- std::vector< NodeChangeInformation >::const_iterator begin() const { return m_data.begin(); }
- std::vector< NodeChangeInformation >::const_iterator end() const { return m_data.end(); }
- private:
- std::vector< NodeChangeInformation > m_data;
- };
-//-----------------------------------------------------------------------------
- }
-}
-
-#if !defined(WNT) || (defined(WNT) && _MSC_VER < 1400)
-namespace std
-{
- template <>
- inline
- void swap(configmgr::configuration::NodeChangesInformation& lhs, configmgr::configuration::NodeChangesInformation& rhs)
- { lhs.swap(rhs); }
-}
-#endif
-
-#endif // CONFIGMGR_CONFIGCHANGEINFO_HXX_
diff --git a/configmgr/source/inc/nodeconverter.hxx b/configmgr/source/inc/nodeconverter.hxx
deleted file mode 100644
index d56e72c52c..0000000000
--- a/configmgr/source/inc/nodeconverter.hxx
+++ /dev/null
@@ -1,61 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_NODECONVERTER_HXX
-#define CONFIGMGR_NODECONVERTER_HXX
-
-#include "change.hxx"
-
-//..........................................................................
-namespace configmgr
-{
-//..........................................................................
- class OTreeNodeFactory;
-//..........................................................................
- class OTreeNodeConverter
- {
- OTreeNodeFactory& m_rFactory;
- public:
- OTreeNodeConverter();
- OTreeNodeConverter(OTreeNodeFactory& _rFactory)
- : m_rFactory(_rFactory) {}
-
- OTreeNodeFactory& nodeFactory() const { return m_rFactory; }
- // node conversion functions
- std::auto_ptr<ISubtree> createCorrespondingNode(SubtreeChange const& _rChange);
- std::auto_ptr<ValueNode> createCorrespondingNode(ValueChange const& _rChange);
-
- std::auto_ptr<ISubtree> createCorrespondingTree(SubtreeChange& _rChange);
- };
-
-//..........................................................................
-} // namespace configmgr
-//..........................................................................
-
-#endif // CONFIGMGR_NODECONVERTER_HXX
-
-
diff --git a/configmgr/source/inc/noderef.hxx b/configmgr/source/inc/noderef.hxx
deleted file mode 100644
index a61758c688..0000000000
--- a/configmgr/source/inc/noderef.hxx
+++ /dev/null
@@ -1,268 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CONFIGNODE_HXX_
-#define CONFIGMGR_CONFIGNODE_HXX_
-
-#include "rtl/ref.hxx"
-
-#include "configexcept.hxx"
-#include "configpath.hxx"
-#include "tree.hxx"
-
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif
-
-namespace configmgr
-{
- class INode;
-
- namespace view { class ViewTreeAccess; }
- namespace configapi { class Factory; }
- namespace node { struct Attributes; }
- namespace configuration
- {
- //-------------------------------------------------------------------------
- class AbsolutePath;
- class RelativePath;
- namespace Path { class Component; }
-
- class NodeChange;
- class NodeChanges;
- class NodeRef;
- class ValueRef;
- class AnyNodeRef;
-
- class NodeID;
-
- const unsigned int C_TreeDepthAll = ~0u;
- //-------------------------------------------------------------------------
-
- /// represents a inner node position in some tree
- class NodeRef
- {
- public:
- /// constructs an empty (invalid) node
- NodeRef();
-
- NodeRef(unsigned int nPos, unsigned int nDepth);
-
- /// copy a node (with reference semantics)
- NodeRef(NodeRef const& rOther);
- /// copy a node (with reference semantics)
- NodeRef& operator=(NodeRef const& rOther);
-
- void swap(NodeRef& rOther);
-
- ~NodeRef();
-
- /// checks, if this represents an existing node
- inline bool isValid() const;
-
- /// returns the offset of this Node
- inline unsigned int getOffset() const;
-
- /// returns the offset of this Node
- inline unsigned int getDepth() const;
-
- private:
- friend class AnyNodeRef;
- private:
- unsigned int m_nPos;
- unsigned int m_nDepth;
- };
- //-------------------------------------------------------------------------
-
- class NodeID
- {
- public:
- NodeID(rtl::Reference< Tree > const& rTree, NodeRef const& rNode);
- NodeID(Tree* pImpl, unsigned int nNode);
-
- // comparison
- // equality
- friend bool operator==(NodeID const& lhs, NodeID const& rhs)
- { return lhs.m_pTree == rhs.m_pTree && lhs.m_nNode == rhs.m_nNode; }
- // ordering
- friend bool operator < (NodeID const& lhs, NodeID const& rhs);
- // checking
- bool isEmpty() const;
- // checking
- bool isValidNode() const;
- // hashing
- size_t hashCode() const;
- // use as index - returns a value in the range 0..rTree.getContainedNodes() for the tree used to construct this
- unsigned int toIndex() const;
-
- Tree * getTree() const { return m_pTree; }
-
- unsigned int getOffset() const { return m_nNode; }
-
- NodeRef getNode() const;
-
- private:
- Tree* m_pTree;
- unsigned int m_nNode;
- };
- //-------------------------------------------------------------------------
-
- /** make a name out of <var>sName</var>.
- @throws InvalidName
- if <var>sName</var> is not a valid name for a member of group <var>aNode</var> within <var>aTree</var>
-
- */
- rtl::OUString validateChildName(rtl::OUString const& sName, rtl::Reference< Tree > const& aTree, NodeRef const& aNode );
-
- /** make a name out of <var>sName</var>.
- @throws InvalidName
- if <var>sName</var> is not a valid name for an element of set <var>aNode</var> within <var>aTree</var>
-
- */
- rtl::OUString validateElementName(rtl::OUString const& sName, rtl::Reference< Tree > const& aTree, NodeRef const& aNode );
-
- /** make a name out of <var>sName</var>.
- @throws InvalidName
- if <var>sName</var> is not a valid name for a child of <var>aNode</var> within <var>aTree</var>
-
- */
- rtl::OUString validateChildOrElementName(rtl::OUString const& sName, rtl::Reference< Tree > const& aTree, NodeRef const& aNode );
-
- /** make one path component out of <var>sName</var>.
- @throws InvalidName
- if <var>sName</var> is not a valid name for an element of set <var>aNode</var> within <var>aTree</var>
-
- */
- Path::Component validateElementPathComponent(rtl::OUString const& sName, rtl::Reference< Tree > const& aTree, NodeRef const& aNode );
-
- /** parse <var>aPath</var> into a relative path,
- valid in the context of node <var>aNode<var/> in <var>aTree<var/>.
-
- @returns
- <var>aPath<var/> parsed as a relative path
- @throws InvalidName
- if <var>aPath<var/> is not a relative path or not valid in the context of <var>aNode<var/>
- */
- RelativePath validateRelativePath(rtl::OUString const& aPath, rtl::Reference< Tree > const& aTree, NodeRef const& aNode);
-
- /** parse <var>aPath</var> as a configuration path
- and reduce it to be relative to node <var>aNode<var/> in <var>aTree<var/>.
-
- @returns
- the result of parsing <var>aPath<var/>, if that results in a relative path, or
- the part of it relative to <var>aNode<var/>,
- if it is an absolute path to a descendant of <var>aNode<var/>
- @throws InvalidName
- if <var>aPath<var/> is not awell-formed path or
- if it is an absolute path that is not to a descendant of <var>aNode<var/>
- */
- RelativePath validateAndReducePath(rtl::OUString const& aPath, rtl::Reference< Tree > const& aTree, NodeRef const& aNode);
- /** checks whether there is an immediate child of <var>aNode</var> (which is in <var>aTree</var>)
- specified by <var>aName</var>
-
- @return
- <TRUE/> if the child node exists
- <FALSE/> otherwise
- */
- bool hasChildOrElement(rtl::Reference< Tree > const& aTree, NodeRef const& aNode, rtl::OUString const& aName);
-
- /** checks whether there is an immediate child of <var>aNode</var> (which is in <var>aTree</var>)
- specified by <var>aName</var>
-
- @return
- <TRUE/> if the child node exists
- <FALSE/> otherwise
- */
- bool hasChildOrElement(rtl::Reference< Tree > const& aTree, NodeRef const& aNode, Path::Component const& aName);
-
- /** tries to find the immediate child of <var>aNode</var> (which is in <var>aTree</var>)
- specified by <var>aName</var>
- <p> On return <var>aNode</var> is modified to refer to the node found and
- <var>aTree</var> will then refer to the tree that node is in.
- <p/>
- <p>Caution: May miss an existing child unless the child has been accessed before.</p>
-
- @return
- <TRUE/> if the child node exists and is available
- (so <var>aNode</var> and <var>aTree</var> refer to the desired node),
- <FALSE/> otherwise
-
- @see NodeRef::getAvailableChild
- */
- bool findInnerChildOrAvailableElement(rtl::Reference< Tree >& aTree, NodeRef& aNode, rtl::OUString const& aName);
-
- /// test whether the given node is a structural (inner) node
- bool isStructuralNode(rtl::Reference< Tree > const& aTree, NodeRef const& aNode);
-
- /// test whether the given inner node is a group node
- bool isGroupNode(rtl::Reference< Tree > const& aTree, NodeRef const& aNode);
-
- /// get the value for a node that is a simple value (as tree element)
- com::sun::star::uno::Any getSimpleElementValue(rtl::Reference< Tree > const& aTree, NodeRef const& aNode);
-
- /// test whether the given inner node is a set node
- bool isSetNode(rtl::Reference< Tree > const& aTree, NodeRef const& aNode);
-
- void getAllContainedNodes(rtl::Reference< Tree > const& aTree, std::vector<NodeID>& aList);
- NodeID findNodeFromIndex(rtl::Reference< Tree > const& aTreeRef, unsigned int nIndex);
-
- //-------------------------------------------------------------------------
- inline bool NodeRef::isValid() const
- {
- return m_nPos != 0;
- }
-
- //-------------------------------------------------------------------------
- inline unsigned int NodeRef::getOffset() const
- {
- return m_nPos;
- }
-
- //-------------------------------------------------------------------------
- inline unsigned int NodeRef::getDepth() const
- {
- return m_nDepth;
- }
-
- //-------------------------------------------------------------------------
- inline bool operator!=(NodeID const& lhs, NodeID const& rhs)
- { return !(lhs == rhs); }
- //---------------------------------------------------------------------
-
- inline bool operator>=(NodeID const& lhs, NodeID const& rhs)
- { return !(lhs < rhs); }
- //---------------------------------------------------------------------
- inline bool operator > (NodeID const& lhs, NodeID const& rhs)
- { return (rhs < lhs); }
- inline bool operator<=(NodeID const& lhs, NodeID const& rhs)
- { return !(rhs < lhs); }
- //-------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_CONFIGNODE_HXX_
diff --git a/configmgr/source/inc/nodevisitor.hxx b/configmgr/source/inc/nodevisitor.hxx
deleted file mode 100644
index ce5a4d5ef2..0000000000
--- a/configmgr/source/inc/nodevisitor.hxx
+++ /dev/null
@@ -1,77 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef INCLUDED_CONFIGMGR_SOURCE_INC_NODEVISITOR_HXX
-#define INCLUDED_CONFIGMGR_SOURCE_INC_NODEVISITOR_HXX
-
-#include "sal/config.h"
-
-namespace configmgr { namespace sharable {
- struct GroupNode;
- struct SetNode;
- struct TreeFragment;
- struct ValueNode;
- union Node;
-} }
-
-namespace configmgr { namespace data {
-
-class NodeVisitor {
-public:
- virtual ~NodeVisitor() = 0;
-
- bool visitNode(sharable::Node * node);
-
- bool visitChildren(sharable::GroupNode * node);
-
-protected:
- virtual bool handle(sharable::Node * node);
-
- virtual bool handle(sharable::ValueNode * node);
-
- virtual bool handle(sharable::GroupNode * node);
-
- virtual bool handle(sharable::SetNode * node);
-};
-
-class SetVisitor: public NodeVisitor {
-public:
- virtual ~SetVisitor() = 0;
-
- bool visitTree(sharable::TreeFragment * tree);
-
- bool visitElements(sharable::SetNode * node);
-
-protected:
- using NodeVisitor::handle;
-
- virtual bool handle(sharable::TreeFragment * tree);
-};
-
-} }
-
-#endif
diff --git a/configmgr/source/inc/options.hxx b/configmgr/source/inc/options.hxx
deleted file mode 100644
index 9027a11a91..0000000000
--- a/configmgr/source/inc/options.hxx
+++ /dev/null
@@ -1,102 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_MISC_OPTIONS_HXX_
-#define CONFIGMGR_MISC_OPTIONS_HXX_
-
-#include "requestoptions.hxx"
-#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/uno/Reference.hxx>
-#include "utility.hxx"
-#include <salhelper/simplereferenceobject.hxx>
-#include <vos/ref.hxx>
-
-namespace configmgr
-{
- namespace css = ::com::sun::star;
-
- /**
- class OOptions is created one time per Configuration[update]Access
- all important options should stored in this class.
- The object will be forwarded to all other objects so we only
- need to extend this classobject and all other class can work with
- the new options or important options etc.
- */
-
- class OOptions : public salhelper::SimpleReferenceObject
- {
- RequestOptions m_aRequestOptions; // current options to use
-
- public:
- OOptions()
- : m_aRequestOptions()
- {}
-
- explicit
- OOptions(const RequestOptions& _aDefaultOptions)
- : m_aRequestOptions(_aDefaultOptions)
- {
- }
-
- OOptions(const OOptions& _aOtherOptions)
- : SimpleReferenceObject()
- , m_aRequestOptions(_aOtherOptions.m_aRequestOptions)
- {
- }
-
- bool isForSessionUser() const { return ! m_aRequestOptions.hasEntity(); }
-
- rtl::OUString getLocale() const { return m_aRequestOptions.getLocale(); }
- rtl::OUString getUser() const { return m_aRequestOptions.getEntity(); }
-
- RequestOptions const & getRequestOptions() const
- { return m_aRequestOptions; }
-
- void setUser(const rtl::OUString & _rUser)
- { m_aRequestOptions.setEntity(_rUser); }
-
- void setLocale(const com::sun::star::lang::Locale & _rLocale)
- { m_aRequestOptions.setLocale(_rLocale); }
-
- void setMultiLocaleMode()
- { m_aRequestOptions.setAllLocales(); }
-
- void enableAsync(bool _bEnable)
- { m_aRequestOptions.enableAsync(_bEnable); }
- };
-
- struct ltOptions
- {
- lessRequestOptions ltData;
- bool operator()(vos::ORef<OOptions> const &o1, vos::ORef<OOptions> const &o2) const
- {
- return ltData(o1->getRequestOptions(),o2->getRequestOptions());
- }
- };
-} // namespace
-
-#endif
diff --git a/configmgr/source/inc/oslstream.hxx b/configmgr/source/inc/oslstream.hxx
deleted file mode 100644
index 7d6f3a1577..0000000000
--- a/configmgr/source/inc/oslstream.hxx
+++ /dev/null
@@ -1,131 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONFIGMGR_OSLSTREAM_HXX_
-#define _CONFIGMGR_OSLSTREAM_HXX_
-
-#include <com/sun/star/io/XOutputStream.hpp>
-#include <com/sun/star/io/XInputStream.hpp>
-#include <cppuhelper/implbase1.hxx>
-#include <osl/mutex.hxx>
-
-#include "bufferedfile.hxx"
-
-namespace osl
-{
- class File;
-}
-
-namespace configmgr
-{
- namespace stario = ::com::sun::star::io;
- namespace staruno = ::com::sun::star::uno;
-
-// -----------------------------------------------------------------------------
- /// OSLInputStreamWrapper - implementation of XInputStream on an (unbuffered) osl::File
- class OSLInputStreamWrapper : public ::cppu::WeakImplHelper1<stario::XInputStream>
- {
- ::osl::Mutex m_aMutex;
- ::osl::File* m_pFile;
- sal_Bool m_bFileOwner : 1;
-
- public:
- /// c'tor. _rStream must live at least until closeInput() is called on this stream
- OSLInputStreamWrapper(::osl::File& _rStream);
- /// c'tor. if bOwner is <FALSE/> *pStream must live at least until closeInput() is called on this stream
- OSLInputStreamWrapper(::osl::File* pStream, sal_Bool bOwner=sal_False);
- virtual ~OSLInputStreamWrapper();
-
- // stario::XInputStream
- virtual sal_Int32 SAL_CALL
- readBytes(staruno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead)
- throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
-
- virtual sal_Int32 SAL_CALL
- readSomeBytes(staruno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead)
- throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
-
- virtual void SAL_CALL
- skipBytes(sal_Int32 nBytesToSkip)
- throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
-
- virtual sal_Int32 SAL_CALL available() throw(stario::NotConnectedException, staruno::RuntimeException);
- virtual void SAL_CALL closeInput() throw(stario::NotConnectedException, staruno::RuntimeException);
- };
-
-// -----------------------------------------------------------------------------
- /// OSLOutputStreamWrapper - implementation of XOutputStream on an (unbuffered) osl::File
- class OSLOutputStreamWrapper : public ::cppu::WeakImplHelper1<stario::XOutputStream>
- {
- ::osl::Mutex m_aMutex;
- ::osl::File& rFile;
-
- public:
- /// c'tor. _rStream must live at least until closeOutput() is called on this stream
- OSLOutputStreamWrapper(::osl::File& _rFile) :rFile(_rFile) { }
-
- // stario::XOutputStream
- virtual void SAL_CALL writeBytes(const staruno::Sequence< sal_Int8 >& aData)
- throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
-
- virtual void SAL_CALL flush()
- throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
-
- virtual void SAL_CALL closeOutput()
- throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
- };
-// -----------------------------------------------------------------------------
- /// BufferedFileOutputStream - buffered implementation of XOutputStream on an osl::File
- class BufferedFileOutputStream: public ::cppu::WeakImplHelper1<stario::XOutputStream>
- {
- BufferedOutputFile m_aFile;
-
- public:
- BufferedFileOutputStream(rtl::OUString const & aFileURL, bool bCreate=true, sal_uInt32 nBufferSizeHint=0);
- virtual ~BufferedFileOutputStream();
-
- // stario::XOutputStream
- virtual void SAL_CALL writeBytes(const staruno::Sequence< sal_Int8 >& aData)
- throw(stario::NotConnectedException, stario::BufferSizeExceededException,
- stario::IOException, staruno::RuntimeException);
-
- virtual void SAL_CALL flush()
- throw(stario::NotConnectedException, stario::BufferSizeExceededException,
- stario::IOException, staruno::RuntimeException);
-
- virtual void SAL_CALL closeOutput()
- throw(stario::NotConnectedException, stario::BufferSizeExceededException,
- stario::IOException, staruno::RuntimeException);
- };
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-
-#endif // _CONFIGMGR_OSLSTREAM_HXX_
-
-
-
diff --git a/configmgr/source/inc/propertysethelper.hxx b/configmgr/source/inc/propertysethelper.hxx
deleted file mode 100644
index b755cf0e52..0000000000
--- a/configmgr/source/inc/propertysethelper.hxx
+++ /dev/null
@@ -1,110 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_MISC_PROPERTYSETHELPER_HXX
-#define CONFIGMGR_MISC_PROPERTYSETHELPER_HXX
-
-#include <cppuhelper/propshlp.hxx>
-#include <cppuhelper/weak.hxx>
-
-//..........................................................................
-namespace configmgr {
- namespace apihelper {
-//..........................................................................
- namespace uno = com::sun::star::uno;
- namespace lang = com::sun::star::lang;
- namespace beans = com::sun::star::beans;
-//..........................................................................
-class BroadcasterBase
-{
- osl::Mutex m_aMutex;
- cppu::OBroadcastHelper m_aBroadcastHelper;
-
-protected:
- BroadcasterBase() : m_aMutex(), m_aBroadcastHelper(m_aMutex) {}
- ~BroadcasterBase() {}
-
- osl::Mutex & getBroadcastMutex() { return m_aMutex; }
- cppu::OBroadcastHelper & getBroadcastHelper() { return m_aBroadcastHelper; }
-};
-
-//..........................................................................
-
-class PropertySetHelper : protected BroadcasterBase // must be first
- , public cppu::OWeakObject
- , public cppu::OPropertySetHelper // not copyable
-{
-public:
- PropertySetHelper();
- ~PropertySetHelper();
-
- // XInterface
- virtual uno::Any SAL_CALL queryInterface( uno::Type const & rType ) throw (uno::RuntimeException);
- virtual void SAL_CALL acquire() throw ();
- virtual void SAL_CALL release() throw ();
- // XTypeProvider
- virtual uno::Sequence< uno::Type > SAL_CALL getTypes() throw (uno::RuntimeException);
-
- // to be provided by derived classes
- // virtual uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (uno::RuntimeException) = 0;
-
- // XPropertySet
- virtual uno::Reference< beans::XPropertySetInfo > SAL_CALL
- getPropertySetInfo( ) throw (uno::RuntimeException);
-
-
-protected:
-// new methods still to be overridden
- virtual cppu::IPropertyArrayHelper * SAL_CALL newInfoHelper() = 0;
-
-// cppu::OPropertySetHelper interface
-#if 0 // these methods still must be overridden
- virtual cppu::IPropertyArrayHelper * SAL_CALL newInfoHelper() = 0;
-
- virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const uno::Any& rValue )
- throw (uno::Exception) = 0;
-
- virtual void SAL_CALL getFastPropertyValue( uno::Any& rValue, sal_Int32 nHandle ) const = 0;
-#endif
- virtual cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
-
- // default implementation: does not do any conversion
- virtual sal_Bool SAL_CALL convertFastPropertyValue(
- uno::Any & rConvertedValue, uno::Any & rOldValue,
- sal_Int32 nHandle, const uno::Any& rValue )
- throw (lang::IllegalArgumentException);
-private:
- cppu::IPropertyArrayHelper * m_pHelper;
-};
-//..........................................................................
- } // namespace apihelper
-} // namespace configmgr
-//..........................................................................
-
-#endif
-
-
diff --git a/configmgr/source/inc/request.hxx b/configmgr/source/inc/request.hxx
deleted file mode 100644
index a39a5b26b1..0000000000
--- a/configmgr/source/inc/request.hxx
+++ /dev/null
@@ -1,152 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_REQUEST_HXX_
-#define CONFIGMGR_BACKEND_REQUEST_HXX_
-
-#include "requestoptions.hxx"
-#include "requesttypes.hxx"
-#include "configpath.hxx"
-
-namespace configmgr
-{
-// ---------------------------------------------------------------------------
- namespace backend
- {
-// ---------------------------------------------------------------------------
-
- class NodeRequest
- {
- configuration::AbsolutePath m_aNodePath;
- RequestOptions m_aOptions;
- public:
- NodeRequest(configuration::AbsolutePath const& _aNodePath, RequestOptions const & _aOptions)
- : m_aNodePath(_aNodePath)
- , m_aOptions(_aOptions)
- {
- }
-
- configuration::AbsolutePath const & getPath() const { return m_aNodePath; }
- RequestOptions const & getOptions() const { return m_aOptions; }
- };
-// ---------------------------------------------------------------------------
-
- class ComponentRequest
- {
- rtl::OUString m_aComponentName;
- RequestOptions m_aOptions;
- bool m_bForcedReload;
- public:
- ComponentRequest(rtl::OUString const& _aComponentName, RequestOptions const & _aOptions)
- : m_aComponentName(_aComponentName)
- , m_aOptions(_aOptions)
- , m_bForcedReload(false)
- {
- }
-
- rtl::OUString const & getComponentName() const { return m_aComponentName; }
- RequestOptions const & getOptions() const { return m_aOptions; }
-
- bool isForcingReload() const { return m_bForcedReload; }
- void forceReload(bool _bForce = true) { m_bForcedReload = _bForce; }
- };
-// ---------------------------------------------------------------------------
-
- class TemplateRequest
- {
- rtl::OUString m_aComponentName;
- rtl::OUString m_aTemplateName;
-
- public:
- static
- TemplateRequest forComponent(rtl::OUString const & _aComponentName)
- {
- return TemplateRequest( rtl::OUString(), _aComponentName);
- }
-
- explicit
- TemplateRequest(rtl::OUString const & _aTemplateName, rtl::OUString const & _aComponentName)
- : m_aComponentName(_aComponentName)
- , m_aTemplateName(_aTemplateName)
- {}
-
- bool isComponentRequest() const { return m_aTemplateName.getLength() == 0; }
- rtl::OUString getTemplateName() const { return m_aTemplateName; }
- rtl::OUString getComponentName() const { return m_aComponentName; }
-
- };
-
-// ---------------------------------------------------------------------------
-
- class UpdateRequest
- {
- ConstUpdateInstance m_aUpdate;
- RequestOptions m_aOptions;
- rtl::OUString m_aRQID;
- public:
- explicit
- UpdateRequest( UpdateInstance const & _aUpdate,
- RequestOptions const & _aOptions)
- : m_aUpdate(_aUpdate)
- , m_aOptions(_aOptions)
- {}
-
- explicit
- UpdateRequest( ConstUpdateInstance const & _aUpdate,
- RequestOptions const & _aOptions)
- : m_aUpdate(_aUpdate)
- , m_aOptions(_aOptions)
- {}
-
- explicit
- UpdateRequest( ConstUpdateInstance::Data _aUpdateData,
- configuration::AbsolutePath const & _aRootpath,
- RequestOptions const & _aOptions)
- : m_aUpdate(_aUpdateData, _aRootpath)
- , m_aOptions(_aOptions)
- {}
-
- bool isSyncRequired() const { return !m_aOptions.isAsyncEnabled(); }
-
- RequestOptions const & getOptions() const { return m_aOptions; }
- configuration::AbsolutePath const & getUpdateRoot() const { return m_aUpdate.root(); }
-
- ConstUpdateInstance const & getUpdate() const { return m_aUpdate; }
- ConstUpdateInstance::Data getUpdateData() const { return m_aUpdate.data(); }
-
- void setRequestId(rtl::OUString const & _aRQID) { m_aRQID = _aRQID; }
- rtl::OUString getRequestId() const { return m_aRQID; }
- };
-
- inline ComponentRequest getComponentRequest(UpdateRequest const & _aUR)
- { return ComponentRequest(_aUR.getUpdateRoot().getModuleName(), _aUR.getOptions()); }
-// ---------------------------------------------------------------------------
- } // namespace
-// ---------------------------------------------------------------------------
-} // namespace
-
-#endif
diff --git a/configmgr/source/inc/requestoptions.hxx b/configmgr/source/inc/requestoptions.hxx
deleted file mode 100644
index b669f92fe2..0000000000
--- a/configmgr/source/inc/requestoptions.hxx
+++ /dev/null
@@ -1,121 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_MISC_REQUESTOPTIONS_HXX_
-#define CONFIGMGR_MISC_REQUESTOPTIONS_HXX_
-
-#include <com/sun/star/lang/Locale.hpp>
-#include <rtl/ustring.hxx>
-
-namespace configmgr
-{
-// ---------------------------------------------------------------------------
-
- /**
- Options which can be used to modify a request for data
- */
- class RequestOptions
- {
- public:
- /// Default constructor. Sets options to use defaults.
- RequestOptions()
- : m_sLocale()
- , m_sEntity()
- , m_bEnableAsync(true)
- , m_bReload(false)
- {}
-
- /// @returns <TRUE/>, if data can be written asynchronously
- bool isAsyncEnabled() const { return m_bEnableAsync; }
- /// @returns <TRUE/>, if data is reloaded into cache
- bool isRefreshEnabled() const { return m_bReload; }
- /** @returns
- <TRUE/>, if a locale is specified, <BR/>
- <FALSE/>, if the default locale should be used
- */
- bool hasLocale() const { return m_sLocale.Language.getLength() != 0; }
- /// @returns the locale to get data for
- bool isForAllLocales() const;
- /// @returns the locale to get data for - compatibilty version
- rtl::OUString getLocale() const { return getIsoLocale(); }
- /// @returns the locale to get data for
- rtl::OUString getIsoLocale() const;
- /// @returns the locale to get data for
- com::sun::star::lang::Locale const & getUnoLocale() const { return m_sLocale; }
-
- /** @returns
- <TRUE/>, if an entity is specified, <BR/>
- <FALSE/>, if data of the session user is requested
- */
- bool hasEntity() const { return m_sEntity.getLength() != 0; }
- /// @returns the entity to get data for
- rtl::OUString getEntity() const { return m_sEntity; }
-
- /// sets the entity to get data for to the given entity
- void setEntity(rtl::OUString const & _sEntity) { m_sEntity = _sEntity; }
- /// resets the entity to get data for to be the session user
- void clearEntity() { m_sEntity = rtl::OUString(); }
-
- /// sets the locale so data is gotten for all locales
- void setAllLocales();
- /// sets the locale to get data for to the given locale
- void setLocale(com::sun::star::lang::Locale const & _aLocale) { m_sLocale = _aLocale; }
- /// sets the locale to get data for to the given locale
- void setIsoLocale(rtl::OUString const & _sLocale);
- /// sets a fallback locale, if no locale is set yet
- void ensureLocaleSet();
-
- /// marks asyncronous access a enabled or disabled
- void enableAsync(bool _bEnable = true) { m_bEnableAsync = _bEnable; }
- /// enforce a refresh to cache
- void forceRefresh(bool _bEnable = true) { m_bReload = _bEnable; }
- // comparison/container helpers
- /// function that defines a weak strict ordering on RequestOptions
- friend sal_Int32 compareRequestOptions(RequestOptions const& lhs, RequestOptions const& rhs);
- private:
- com::sun::star::lang::Locale m_sLocale; /// locale to fetch data for
- rtl::OUString m_sEntity; /// user/group/role to fetch data for
- bool m_bEnableAsync; /// true, if data may be
- bool m_bReload; /// reload into cache from backend
- };
-
-// ---------------------------------------------------------------------------
- struct lessRequestOptions
- {
- bool operator()(RequestOptions const & lhs, RequestOptions const & rhs) const
- { return compareRequestOptions(lhs,rhs) < 0; }
- };
-// ---------------------------------------------------------------------------
- struct equalRequestOptions
- {
- bool operator()(RequestOptions const & lhs, RequestOptions const & rhs) const
- { return compareRequestOptions(lhs,rhs) == 0; }
- };
-// ---------------------------------------------------------------------------
-} // namespace
-
-#endif
diff --git a/configmgr/source/inc/requesttypes.hxx b/configmgr/source/inc/requesttypes.hxx
deleted file mode 100644
index 577a1bf797..0000000000
--- a/configmgr/source/inc/requesttypes.hxx
+++ /dev/null
@@ -1,234 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_REQUESTTYPES_HXX_
-#define CONFIGMGR_BACKEND_REQUESTTYPES_HXX_
-
-#include "sal/config.h"
-
-#include "salhelper/simplereferenceobject.hxx"
-
-#include "valuenode.hxx"
-#include "treechangelist.hxx"
-#include "configpath.hxx"
-
-#ifndef _CONFIGMGR_UTILITY_HXX_
-#include <utility.hxx>
-#endif
-
-#ifndef INCLUDED_MEMORY
-#include <memory>
-#define INCLUDED_MEMORY
-#endif
-
-namespace configmgr
-{
-// ---------------------------------------------------------------------------
- namespace backend
- {
-// ---------------------------------------------------------------------------
- struct ComponentDataStruct
- {
- const std::auto_ptr<ISubtree>& data;
- rtl::OUString name;
- ComponentDataStruct (const std::auto_ptr<ISubtree>& _data, rtl::OUString _name)
- : data(_data), name(_name) {}
- };
-// ---------------------------------------------------------------------------
- struct NodeInstance
- {
- typedef std::auto_ptr<ISubtree> Data;
-
- explicit
- NodeInstance(Data _node, configuration::AbsolutePath const & _rootpath)
- : m_node(_node)
- , m_root(_rootpath)
- {
- }
-
- Data const & data() const { return m_node; }
- configuration::AbsolutePath const & root() const { return m_root; }
-
- Data & mutableData() { return m_node; }
- Data extractData() { return m_node; }
- private:
- Data m_node;
- configuration::AbsolutePath m_root;
- };
-// ---------------------------------------------------------------------------
- struct TemplateInstance
- {
- typedef std::auto_ptr<INode> Data;
-
- explicit
- TemplateInstance(Data _node, rtl::OUString const & _name, rtl::OUString const & _component)
- : m_node(_node)
- , m_name(_name)
- , m_component(_component)
- {
- }
-
- Data const & data() const { return m_node; }
- rtl::OUString const & name() const { return m_name; }
- rtl::OUString const & component() const { return m_component; }
-
- Data extractData() { return m_node; }
- private:
- Data m_node;
- rtl::OUString m_name; // if empty, this is a complete set of component templates
- rtl::OUString m_component;
- };
-// ---------------------------------------------------------------------------
- struct ComponentInstance
- {
- typedef std::auto_ptr<ISubtree> Data;
-
- explicit
- ComponentInstance(Data _node, Data _template, rtl::OUString const & _component)
- : m_node(_node)
- , m_template(_template)
- , m_component(_component)
- {
- }
-
- Data const & data() const { return m_node; }
- Data const & templateData() const { return m_template; }
- rtl::OUString const & component() const { return m_component; }
-
- ComponentDataStruct componentTemplateData () const { return ComponentDataStruct(m_template,m_component);}
- ComponentDataStruct componentNodeData () const { return ComponentDataStruct(m_node,m_component);}
- Data & mutableData() { return m_node; }
- Data extractData() { return m_node; }
- Data extractTemplateData() { return m_template; }
- private:
- Data m_node;
- Data m_template;
- rtl::OUString m_component;
- };
-// ---------------------------------------------------------------------------
- struct UpdateInstance
- {
- typedef SubtreeChange * Data;
-
- explicit
- UpdateInstance(Data _update, configuration::AbsolutePath const & _rootpath)
- : m_update(_update)
- , m_root(_rootpath)
- {
- }
-
- UpdateInstance(UpdateInstance & _aModifiableOther)
- : m_update(_aModifiableOther.m_update)
- , m_root(_aModifiableOther.m_root)
- {
- }
-
- Data data() { return m_update; }
- SubtreeChange const * data() const { return m_update; }
- configuration::AbsolutePath const & root() const { return m_root; }
- private:
- Data m_update;
- configuration::AbsolutePath m_root;
- };
-// ---------------------------------------------------------------------------
- struct ConstUpdateInstance
- {
- typedef SubtreeChange const * Data;
-
- explicit
- ConstUpdateInstance(Data _update, configuration::AbsolutePath const & _rootpath)
- : m_update(_update)
- , m_root(_rootpath)
- {
- }
-
- // conversion
- ConstUpdateInstance(UpdateInstance const & _aModifiable)
- : m_update(_aModifiable.data())
- , m_root(_aModifiable.root())
- {
- }
-
- Data data() const { return m_update; }
- configuration::AbsolutePath const & root() const { return m_root; }
- private:
- Data m_update;
- configuration::AbsolutePath m_root;
- };
-// ---------------------------------------------------------------------------
-// ---------------------------------------------------------------------------
-// Due to the use of auto_ptr, the XxxInstance classes cannot easily be used as return values
-// To return them, they should be wrapped into a ResultHolder
-
- template <class Instance_>
- class ResultHolder
- {
- struct RCInstance : public salhelper::SimpleReferenceObject
- {
- RCInstance(Instance_ & _instance)
- : instance(_instance) {}
- Instance_ instance;
- };
-
- rtl::Reference< RCInstance > m_xInstance;
- public:
- explicit
- ResultHolder(Instance_ & _rInstance)
- : m_xInstance( new RCInstance(_rInstance) )
- {}
-
- bool isEmpty() const { return !m_xInstance.is(); }
-
- bool is() const { return m_xInstance.is() && m_xInstance->instance.data().get(); }
-
- Instance_ const & instance() const { return m_xInstance->instance; }
-
- Instance_ const & operator *() const { return instance(); }
- Instance_ const * operator->() const { return &instance(); }
- Instance_ & mutableInstance() { return m_xInstance->instance; }
-
- typename Instance_::Data extractDataAndClear()
- {
- typename Instance_::Data aData = m_xInstance->instance.extractData();
- this->clear();
- return aData;
- }
-
- void releaseAndClear()
- {
- typename Instance_::Data aData = this->extractDataAndClear();
- aData.release();
- }
-
- void clear() { m_xInstance.clear(); }
- };
-// ---------------------------------------------------------------------------
- }
-// ---------------------------------------------------------------------------
-} // namespace
-
-#endif
diff --git a/configmgr/source/inc/roottree.hxx b/configmgr/source/inc/roottree.hxx
deleted file mode 100644
index 39f96fabdd..0000000000
--- a/configmgr/source/inc/roottree.hxx
+++ /dev/null
@@ -1,112 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_ROOTTREE_HXX_
-#define CONFIGMGR_ROOTTREE_HXX_
-
-#include "sal/config.h"
-
-#include <memory>
-
-#include "boost/utility.hpp"
-#include "rtl/ref.hxx"
-
-#include "utility.hxx"
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace sharable { union Node; }
- class SubtreeChange;
- struct TreeChangeList;
-
- namespace configuration
- {
-//-----------------------------------------------------------------------------
- class Tree;
- class NodeRef;
- class NodeChangesInformation;
- class AbsolutePath;
- class TemplateProvider;
-
-//-----------------------------------------------------------------------------
-
- rtl::Reference< Tree > createReadOnlyTree( AbsolutePath const& aRootPath,
- sharable::Node * _aCacheNode,
- unsigned int nDepth,
- TemplateProvider const& aTemplateProvider);
-
- rtl::Reference< Tree > createUpdatableTree( AbsolutePath const& aRootPath,
- sharable::Node * _aCacheNode,
- unsigned int nDepth,
- TemplateProvider const& aTemplateProvider);
-
-//-----------------------------------------------------------------------------
- class CommitHelper: private boost::noncopyable
- {
- struct Data;
-
- std::auto_ptr<Data> m_pData;
- Tree* m_pTree;
- public:
- CommitHelper(rtl::Reference< Tree > const& aTree);
- ~CommitHelper();
-
- // collect all changes into rChangeList
- bool prepareCommit(TreeChangeList& rChangeList);
-
- // finish and clean up the changes in rChangeList after they are integrated
- void finishCommit(TreeChangeList& rChangeList);
- // throw away and clean up the changes in rChangeList after a commit failed
- void failedCommit(TreeChangeList& rChangeList);
- };
-
-//-----------------------------------------------------------------------------
- /** adjusts <var>aTree</var> tree to the (externally produced) changes under <var>aExternalChanges</var>
- and collects the changes this induces locally.
- @param rLocalChanges
- a collection that will hold the changes induced by <var>aExternalChanges</var>.
- @param aExternalChanges
- a structured change that has already been applied to the master tree.
- @param aBaseTree
- the tree that contains (directly) the affected node of <var>aExternalChanges</var>.
- @param aBaseNode
- a NodeRef referring to the (directly) affected node of <var>aExternalChanges</var>.
- @return
- <TRUE/> if any changes occur in this tree (so rLocalChanges is not empty), <FALSE/> otherwise.
-
- */
- bool adjustToChanges( NodeChangesInformation& rLocalChanges,
- rtl::Reference< Tree > const& aBaseTree, NodeRef const& aBaseNode,
- SubtreeChange const& aExternalChange) ;
-
-
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_ROOTTREE_HXX_
diff --git a/configmgr/source/inc/sequence.hxx b/configmgr/source/inc/sequence.hxx
deleted file mode 100644
index be94ddd416..0000000000
--- a/configmgr/source/inc/sequence.hxx
+++ /dev/null
@@ -1,105 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef INCLUDED_SHARABLE_SEQUENCE_HXX
-#define INCLUDED_SHARABLE_SEQUENCE_HXX
-
-#include "anydata.hxx"
-#include <com/sun/star/uno/Sequence.hxx>
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace sharable
- {
- //-----------------------------------------------------------------------------
-
- sal_uInt8 * allocSequence(sal_uInt8 _aElementType, ::sal_Sequence const * _pSeqData);
- void freeSequence(sal_uInt8 _aElementType, sal_uInt8 * _aSeq);
-
- ::sal_Sequence * readSequence(sal_uInt8 _aElementType, sal_uInt8 * _aSeq);
- ::com::sun::star::uno::Any readAnySequence(sal_uInt8 _aElementType, sal_uInt8 * _aSeq);
- //-----------------------------------------------------------------------------
-
- sal_uInt8 * allocBinary(::com::sun::star::uno::Sequence<sal_Int8> const & _aBinaryValue);
- void freeBinary(sal_uInt8 * _aSeq);
-
- ::com::sun::star::uno::Sequence<sal_Int8> readBinary(sal_uInt8 * _aSeq);
- //-----------------------------------------------------------------------------
-
- template <class ET>
- inline
- sal_uInt8 getElementTypeCode(::com::sun::star::uno::Sequence<ET> const & )
- {
- ::com::sun::star::uno::Type aElementType = ::getCppuType( static_cast<ET const *>(NULL) );
- return getTypeCode(aElementType);
- }
-
- template <class ET>
- sal_uInt8 * allocSequence(::com::sun::star::uno::Sequence<ET> const & _aSeq)
- {
- sal_uInt8 aTC = getElementTypeCode(_aSeq);
- ::sal_Sequence const * pSeqData = _aSeq.get();
- return allocSequence(aTC, pSeqData);
- }
-
- template <class ET>
- void readSequence(::com::sun::star::uno::Sequence<ET> & _rSeq, sal_uInt8 * _aSeq)
- {
- sal_uInt8 aElementType = getElementTypeCode(_rSeq);
-
- ::sal_Sequence * pNewSequence = readSequence(aElementType, _aSeq);
-
- if (!pNewSequence) return;
-
- ::com::sun::star::uno::Sequence<ET> aNewSequence(pNewSequence, SAL_NO_ACQUIRE);
-
- _rSeq = aNewSequence;
- }
-
- template <class ET>
- bool readSequence(::com::sun::star::uno::Sequence<ET> & _rSeq, sal_uInt8 _aElementType, sal_uInt8 * _aSeq)
- {
- if (getElementTypeCode(_rSeq) != _aElementType) return false;
-
- ::sal_Sequence * pNewSequence = readSequence(_aElementType, _aSeq);
-
- if (!pNewSequence) return false;
-
- ::com::sun::star::uno::Sequence<ET> aNewSequence(pNewSequence, SAL_NO_ACQUIRE);
-
- _rSeq = aNewSequence;
-
- return true;
- }
-//-----------------------------------------------------------------------------
- }
-//-----------------------------------------------------------------------------
-}
-
-
-#endif // INCLUDED_SHARABLE_SEQUENCE_HXX
diff --git a/configmgr/source/inc/serviceinfohelper.hxx b/configmgr/source/inc/serviceinfohelper.hxx
deleted file mode 100644
index f2c8fb2007..0000000000
--- a/configmgr/source/inc/serviceinfohelper.hxx
+++ /dev/null
@@ -1,135 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_SERVICEINFOHELPER_HXX_
-#define CONFIGMGR_SERVICEINFOHELPER_HXX_
-
-#include <com/sun/star/lang/XServiceInfo.hpp>
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
-// -----------------------------------------------------------------------------
-
- /// POD struct describing the registration information of a service implementation
- struct ServiceRegistrationInfo
- {
- /// The implementation name of this service implementation
- sal_Char const * implementationName;
- /// The services for which this service implementation is registered
- sal_Char const * const * registeredServiceNames;
- };
-// -----------------------------------------------------------------------------
-
- /// POD struct describing the implementation information of a service implementation
- struct ServiceImplementationInfo
- {
- /// The implementation name of this service implementation
- sal_Char const * implementationName;
- /// The services for which this service implementation is registered
- sal_Char const * const * registeredServiceNames;
- /// Additional services implemented by this service implementation, for which it is not registered
- sal_Char const * const * additionalServiceNames;
- };
-// -----------------------------------------------------------------------------
-
- // ServiceImplementationInfo has a compatible initial sequence with struct ServiceRegistrationInfo
-
- inline
- ServiceRegistrationInfo const *
- getRegistrationInfo(ServiceImplementationInfo const * _info)
- {
- return reinterpret_cast<ServiceRegistrationInfo const *>(_info);
- }
-// -----------------------------------------------------------------------------
-
- /// POD struct describing the registration information of a singleton
- struct SingletonRegistrationInfo
- {
- /// The name of this singleton
- sal_Char const * singletonName;
- /// The implementation, which owns this singleton
- sal_Char const * implementationName;
- /// The service, which should be instatiated for this singleton
- sal_Char const * instantiatedServiceName;
- /// A name for a pseudo-implementation, which is mapped to this singleton
- ServiceRegistrationInfo const * mappedImplementation;
- };
-// -----------------------------------------------------------------------------
-
- class ServiceRegistrationHelper
- {
- ServiceRegistrationInfo const*const m_info;
-
- public:
- ServiceRegistrationHelper(ServiceRegistrationInfo const* _info)
- : m_info(_info)
- {}
-
- ServiceRegistrationHelper(ServiceImplementationInfo const* _info)
- : m_info(getRegistrationInfo(_info))
- {}
-
- sal_Int32 countServices() const;
-
- rtl::OUString getImplementationName( ) const
- throw(uno::RuntimeException);
-
- uno::Sequence< rtl::OUString > getRegisteredServiceNames( ) const
- throw(uno::RuntimeException);
- };
-// -----------------------------------------------------------------------------
-
- class ServiceInfoHelper
- {
- ServiceImplementationInfo const*const m_info;
-
- public:
- ServiceInfoHelper(ServiceImplementationInfo const* _info)
- : m_info(_info)
- {}
-
- sal_Int32 countServices() const;
-
- rtl::OUString getImplementationName( ) const
- throw(uno::RuntimeException);
-
- sal_Bool supportsService( rtl::OUString const & ServiceName ) const
- throw(uno::RuntimeException);
-
- uno::Sequence< rtl::OUString > getSupportedServiceNames( ) const
- throw(uno::RuntimeException);
- };
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-
-#endif
-
-
diff --git a/configmgr/source/inc/simpleinteractionrequest.hxx b/configmgr/source/inc/simpleinteractionrequest.hxx
deleted file mode 100644
index 279b433df4..0000000000
--- a/configmgr/source/inc/simpleinteractionrequest.hxx
+++ /dev/null
@@ -1,101 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_SIMPLEINTERACTIONREQUEST_HXX
-#define CONFIGMGR_SIMPLEINTERACTIONREQUEST_HXX
-
-#include "interactionrequest.hxx"
-
-// this file was copied and adapted from the corresponding file in module ucbhelper
-
-namespace configmgr {
-namespace apihelper {
-
- namespace uno = com::sun::star::uno;
-/**
- This class implements a simple interaction request. The user must not deal
- with XInteractionContinuations directly, but can use constants that are
- mapped internally to the according objects. This class encapsulates the
- standard Interaction Continuations "Abort", "Retry", "Approve" and
- "Disaprrove". Instances can be passed directly to
- XInteractionHandler::handle(...).
-
- @see InteractionRequest
- @see InteractionAbort
- @see InteractionRetry
- @see InteractionApprove
- @see InteractionDisapprove
- */
- class SimpleInteractionRequest : public InteractionRequest
- {
- public:
- /**
- * Constructor.
- *
- * @param rRequest is the exception describing the error.
- * @param nContinuations contains the possible "answers" for the request.
- * This can be any of the CONTINUATION_* constants combinations
- * listed above.
- */
- SimpleInteractionRequest( const uno::Any & rRequest,
- const sal_uInt32 nContinuations );
-
- /**
- * After passing this request to XInteractionHandler::handle, this method
- * returns the continuation that was choosen by the interaction handler.
- *
- * @return the continuation choosen by an interaction handler or
- * CONTINUATION_UNKNOWN, if the request was not (yet) handled.
- */
- sal_uInt32 getResponse() const;
- };
-
-/** These are the constants that can be passed to the constructor of class
- * SimpleInteractionRequest and that are returned by method
- * SimpleInteractionRequest::getResponse().
- */
-
- /** The request was not (yet) handled by the interaction handler. */
- const sal_uInt32 CONTINUATION_UNKNOWN = 0;
-
- /** The interaction handler selected XInteractionAbort. */
- const sal_uInt32 CONTINUATION_ABORT = 1;
-
- /** The interaction handler selected XInteractionRetry. */
- const sal_uInt32 CONTINUATION_RETRY = 2;
-
- /** The interaction handler selected XInteractionApprove. */
- const sal_uInt32 CONTINUATION_APPROVE = 4;
-
- /** The interaction handler selected XInteractionDisapprove. */
- const sal_uInt32 CONTINUATION_DISAPPROVE = 8;
-
-
-} // namespace apihelper
-} // namespace configmgr
-
-#endif /* !CONFIGMGR_SIMPLEINTERACTIONREQUEST_HXX */
diff --git a/configmgr/source/inc/simpletypehelper.hxx b/configmgr/source/inc/simpletypehelper.hxx
deleted file mode 100644
index 8c52492243..0000000000
--- a/configmgr/source/inc/simpletypehelper.hxx
+++ /dev/null
@@ -1,53 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_SIMPLETYPEHELPER_HXX
-#define CONFIGMGR_SIMPLETYPEHELPER_HXX
-
-#include <com/sun/star/uno/Type.hxx>
-
-namespace configmgr
-{
- namespace uno = com::sun::star::uno;
-
- namespace SimpleTypeHelper
- {
- uno::Type getBooleanType();
-
- uno::Type getShortType();
- uno::Type getIntType();
- uno::Type getLongType();
-
- uno::Type getDoubleType();
-
- uno::Type getStringType();
-
- uno::Type getBinaryType();
- uno::Type getAnyType();
- }
-}
-#endif
diff --git a/configmgr/source/inc/stack.hxx b/configmgr/source/inc/stack.hxx
deleted file mode 100644
index 2beb6a341c..0000000000
--- a/configmgr/source/inc/stack.hxx
+++ /dev/null
@@ -1,58 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_STACK_HXX_
-#define CONFIGMGR_STACK_HXX_
-
-#ifndef INCLUDED_STACK
-#include <stack>
-#define INCLUDED_STACK
-#endif
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif
-
-namespace configmgr
-{
-
- // simple wrapper for a vector-based stack
- template <typename T_>
- struct Stack : public std::stack< T_, std::vector<T_> >
- {
- typedef typename std::vector<T_>::const_iterator bottomup_iterator;
- typedef typename std::vector<T_>::const_reverse_iterator topdown_iterator;
- bottomup_iterator begin_up() const { return this->c.begin(); }
- bottomup_iterator end_up() const { return this->c.end(); }
- topdown_iterator begin_down() const { return this->c.rbegin(); }
- topdown_iterator end_down() const { return this->c.rend(); }
- };
-}
-
-#endif // CONFIGMGR_STACK_HXX_
-
-
diff --git a/configmgr/source/inc/strdecl.hxx b/configmgr/source/inc/strdecl.hxx
deleted file mode 100644
index 407b55d6e1..0000000000
--- a/configmgr/source/inc/strdecl.hxx
+++ /dev/null
@@ -1,60 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _CONFIGMGR_STRDECL_HXX_
-#define _CONFIGMGR_STRDECL_HXX_
-
-#include "strings.hxx"
-
-//.........................................................................
-namespace configmgr
-{
-//.........................................................................
-
-// extern declaration for predefined strings
-
- // simple types names
- DECLARE_CONSTASCII_USTRING(TYPE_BOOLEAN);
- DECLARE_CONSTASCII_USTRING(TYPE_SHORT);
- DECLARE_CONSTASCII_USTRING(TYPE_INT);
- DECLARE_CONSTASCII_USTRING(TYPE_LONG);
- DECLARE_CONSTASCII_USTRING(TYPE_DOUBLE);
- DECLARE_CONSTASCII_USTRING(TYPE_STRING);
- // Type: Sequence<bytes>
- DECLARE_CONSTASCII_USTRING(TYPE_BINARY);
- // Universal type: Any
- DECLARE_CONSTASCII_USTRING(TYPE_ANY);
-
- // special template names for native/localized value types
- DECLARE_CONSTASCII_USTRING(TEMPLATE_MODULE_NATIVE_PREFIX);
- DECLARE_CONSTASCII_USTRING(TEMPLATE_MODULE_NATIVE_VALUE);
- DECLARE_CONSTASCII_USTRING(TEMPLATE_MODULE_LOCALIZED_VALUE);
-
- DECLARE_CONSTASCII_USTRING(TEMPLATE_LIST_SUFFIX);
-
-} // namespace configmgr
-#endif
-
diff --git a/configmgr/source/inc/strings.hxx b/configmgr/source/inc/strings.hxx
deleted file mode 100644
index 9e18a2013d..0000000000
--- a/configmgr/source/inc/strings.hxx
+++ /dev/null
@@ -1,74 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONFIGMGR_STRINGS_HXX_
-#define _CONFIGMGR_STRINGS_HXX_
-
-#include <sal/types.h>
-#include <rtl/ustring.hxx>
-
-
-//.........................................................................
-namespace configmgr
-{
-//.........................................................................
-
-struct UStringDescription
-{
- const sal_Char* m_pZeroTerminatedName;
- sal_Int32 m_nLen;
- rtl_TextEncoding m_encoding;
-
- UStringDescription(const sal_Char* _pName, sal_Int32 _nLen, rtl_TextEncoding _encoding)
- : m_pZeroTerminatedName( _pName )
- , m_nLen( _nLen )
- , m_encoding(_encoding )
- , m_aString (_pName, _nLen, _encoding)
- {
- }
-
- sal_Int32 getLength() const { return m_nLen; }
- operator ::rtl::OUString const&() const { return m_aString; }
- operator const sal_Char*() const { return m_pZeroTerminatedName; }
-
-private:
- rtl::OUString m_aString;
- UStringDescription();
-};
-
-#define DECLARE_CONSTASCII_USTRING(name) \
- extern ::configmgr::UStringDescription name
-
-#define IMPLEMENT_CONSTASCII_USTRING(name, asciivalue) \
- ::configmgr::UStringDescription name(RTL_CONSTASCII_USTRINGPARAM(asciivalue))
-
-//.........................................................................
-} // namespace frm
-//.........................................................................
-
-#endif // _CONFIGMGR_STRINGS_HXX_
-
diff --git a/configmgr/source/inc/template.hxx b/configmgr/source/inc/template.hxx
deleted file mode 100644
index a4409f016f..0000000000
--- a/configmgr/source/inc/template.hxx
+++ /dev/null
@@ -1,107 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CONFIGTEMPLATE_HXX_
-#define CONFIGMGR_CONFIGTEMPLATE_HXX_
-
-#include "configexcept.hxx"
-#include "configpath.hxx"
-#include <rtl/ref.hxx>
-#include <salhelper/simplereferenceobject.hxx>
-#ifndef _CONFIGMGR_UTILITY_HXX_
-#include <utility.hxx>
-#endif
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- class RequestOptions;
- class TreeManager;
- namespace sharable { struct SetNode; }
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-
- class AbsolutePath;
-//-----------------------------------------------------------------------------
-
- struct TemplateProvider_Impl;
- class TemplateProvider
- {
- friend class SetElementFactory;
- friend class TemplateImplHelper;
-
- rtl::Reference<TemplateProvider_Impl> m_aImpl;
- public:
- TemplateProvider(); // creates an empty (invalid) template instance provider
- TemplateProvider(rtl::Reference< TreeManager > const & xProvider, RequestOptions const& xOptions);
- TemplateProvider(TemplateProvider const& aOther);
- TemplateProvider& operator=(TemplateProvider const& aOther);
- ~TemplateProvider();
-
- bool isValid() const { return !!m_aImpl.is(); }
- };
-//-----------------------------------------------------------------------------
-
- /// provides information about the elements of a <type>Node</type> that is a Container ("set").
- class Template : public salhelper::SimpleReferenceObject
- {
- rtl::OUString m_aName;
- rtl::OUString m_aModule;
- com::sun::star::uno::Type m_aInstanceType;
- private:
- explicit Template(rtl::OUString const& aName, rtl::OUString const& aModule,com::sun::star::uno::Type const& aType);
-
- public:
- /// checks if the type of an instance of this is known
- bool isInstanceTypeKnown() const;
-
- /// checks if this is a 'value' template <p> PRE: the instance type is known </p>
- bool isInstanceValue() const;
-
- /// get the UNO type for instances (primarily (only ?) for 'value' templates) <p> PRE: the instance type is known </p>
- com::sun::star::uno::Type getInstanceType() const;
-
- /// get the path where the template is located
- rtl::OUString getPathString() const;
-
- /// get the local name of the template
- rtl::OUString getName() const { return m_aName; }
-
- /// get the package name of the template
- rtl::OUString getModule() const { return m_aModule; }
-
- friend class TemplateImplHelper;
- };
-
- /// make a template instance that matches the elements of the given set. Ensures that the element type is known
- rtl::Reference<Template> makeSetElementTemplate(sharable::SetNode * set, TemplateProvider const& _aProvider);
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_CONFIGTEMPLATE_HXX_
diff --git a/configmgr/source/inc/tracer.hxx b/configmgr/source/inc/tracer.hxx
deleted file mode 100644
index 31dc7d3554..0000000000
--- a/configmgr/source/inc/tracer.hxx
+++ /dev/null
@@ -1,135 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONFIGMGR_TRACER_HXX_
-#define _CONFIGMGR_TRACER_HXX_
-
-#if OSL_DEBUG_LEVEL > 0
-#define CFG_ENABLE_TRACING
-#endif
-
-#ifdef CFG_ENABLE_TRACING
-
-#include <sal/types.h>
-#include <rtl/string.hxx>
-#include <osl/mutex.hxx>
-
-#include <stdarg.h>
-#include <stdio.h>
-
-#ifdef WNT
-#include <sys/timeb.h>
-#else
-#include <sys/time.h>
-#endif
-
-#define OUSTRING2ASCII(rtlOUString) ::rtl::OString((rtlOUString).getStr(), (rtlOUString).getLength(), RTL_TEXTENCODING_ASCII_US).getStr()
-
-#define CFG_TRACE_INFO OTraceIndent aIndent; OConfigTracer::traceInfo
-// FIXME: do something more intelligent here
-// the CFG_TRACE_INFO2 macro exists only to have a unique name of aIndent2
-// so it does not hide aIndent in an outer scope (which would produce a
-// a shadowing warning
-#define CFG_TRACE_INFO2 OTraceIndent aIndent2; OConfigTracer::traceInfo
-#define CFG_TRACE_WARNING OTraceIndent aIndent; OConfigTracer::traceWarning
-#define CFG_TRACE_ERROR OTraceIndent aIndent; OConfigTracer::traceError
-#define CFG_TRACE_INFO_NI OConfigTracer::traceInfo
-#define CFG_TRACE_WARNING_NI OConfigTracer::traceWarning
-#define CFG_TRACE_ERROR_NI OConfigTracer::traceError
-
-namespace configmgr
-{
-
-struct OTracerSetup;
-class OConfigTracer
-{
- friend class OTraceIndent;
-
-protected:
- static ::osl::Mutex & getMutex();
- static OTracerSetup* s_pImpl;
-#ifdef WNT
- static timeb s_aStartTime;
-#else
- static timeval s_aStartTime;
-#endif
-
-private:
- OConfigTracer(); // never implemented, no instantiation of this class allowed, only static members
-
-public:
- static void traceInfo(const sal_Char* _pFormat, ...);
-#if OSL_DEBUG_LEVEL > 0
- static void traceWarning(const sal_Char* _pFormat, ...);
- static void traceError(const sal_Char* _pFormat, ...);
-#endif
-protected:
- static void implTrace(const sal_Char* _pType, const sal_Char* _pFormat, va_list args);
- static void startGlobalTimer();
- static sal_uInt32 getGlobalTimer();
-
- static void inc();
- static void dec();
-
- static void indent();
-
- static void ensureData();
- static void ensureInitalized();
-};
-
-class OTraceIndent
-{
-public:
- OTraceIndent() { OConfigTracer::inc(); }
- ~OTraceIndent() { OConfigTracer::dec(); }
-};
-
-} // namespace configmgr
-
-#else // !CFG_ENABLE_TRACING
-
-#include <stdio.h>
-
-#define OUSTRING2ASCII(rtlOUString) "nothing"
-
-namespace configmgr {
-inline static void dont_trace(const char*,...) {}
-}
-
-#define CFG_TRACE_INFO dont_trace
-#define CFG_TRACE_INFO2 dont_trace
-#define CFG_TRACE_WARNING dont_trace
-#define CFG_TRACE_ERROR dont_trace
-#define CFG_TRACE_INFO_NI dont_trace
-#define CFG_TRACE_WARNING_NI dont_trace
-#define CFG_TRACE_ERROR_NI dont_trace
-#define CFG_TRACE_TO_DEVICE dont_trace
-
-#endif // CFG_ENABLE_TRACING
-
-#endif // _CONFIGMGR_TRACER_HXX_
-
diff --git a/configmgr/source/inc/tree.hxx b/configmgr/source/inc/tree.hxx
deleted file mode 100644
index 6cff49de9b..0000000000
--- a/configmgr/source/inc/tree.hxx
+++ /dev/null
@@ -1,665 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CONFIGNODEIMPL_HXX_
-#define CONFIGMGR_CONFIGNODEIMPL_HXX_
-
-#include "change.hxx"
-#include "configpath.hxx"
-#include "template.hxx"
-#include "utility.hxx"
-#include <rtl/ref.hxx>
-#include <salhelper/simplereferenceobject.hxx>
-#include <osl/diagnose.h>
-
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif
-#ifndef INCLUDED_MAP
-#include <map>
-#define INCLUDED_MAP
-#endif
-#ifndef INCLUDED_MEMORY
-#include <memory>
-#define INCLUDED_MEMORY
-#endif
-
-namespace configmgr
-{
- namespace node { struct Attributes; }
- namespace sharable { union Node; }
- namespace view { class ViewStrategy; }
- namespace configuration
- {
-//-----------------------------------------------------------------------------
- class AnyNodeRef;
- class ElementTree;
- class GroupNodeImpl;
- class NodeChange;
- class NodeChanges;
- class NodeImpl;
- class NodeRef;
- class SetNodeImpl;
- class TemplateProvider;
- class Tree;
- class ValueElementNodeImpl;
- class ValueMemberNode;
- class ValueRef;
-//-----------------------------------------------------------------------------
- // WARNING: a similar item is in noderef.hxx
- const unsigned int c_TreeDepthAll = ~0u;
-
-//-----------------------------------------------------------------------------
- inline
- unsigned int& incDepth(unsigned int& rDepth)
- {
- if (rDepth != c_TreeDepthAll) ++rDepth;
- return rDepth;
- }
-
- inline
- unsigned int& decDepth(unsigned int& rDepth)
- {
- OSL_ENSURE(rDepth != 0,"Cannot decrement zero depth");
- if (rDepth != c_TreeDepthAll && rDepth != 0) --rDepth;
- return rDepth;
- }
-
- inline
- unsigned int childDepth(unsigned int nDepth)
- { return decDepth(nDepth); }
-
- inline
- unsigned int parentDepth(unsigned int nDepth)
- { return incDepth(nDepth); }
-
- inline
- unsigned int remainingDepth(unsigned int nOuterDepth, unsigned int nRelativeDepth)
- {
- OSL_ENSURE(nRelativeDepth != c_TreeDepthAll,"RelativeDepth can't be infinite");
- OSL_ENSURE(nRelativeDepth <= nOuterDepth,"ERROR: RelativeDepth is larger than enclosing depth");
-
- unsigned int nInnerDepth = (nOuterDepth == c_TreeDepthAll) ? nOuterDepth :
- (nRelativeDepth < nOuterDepth) ? nOuterDepth-nRelativeDepth :
- 0;
- return nInnerDepth;
- }
- //-------------------------------------------------------------------------
-
- /// interface for a class that can be used to do some operation on a set of <type>NodeRef</type>s and <type>ValueRef</type>s.
- struct NodeVisitor
- {
- /// returned from <method>handle</method> to indicate whether the operation is complete or should continue
- enum Result { DONE, CONTINUE };
- /// do the operation on <var>aNode</var>. needs to be implemented by concrete visitor classes
- virtual Result handle(rtl::Reference< Tree > const& aTree, NodeRef const& aNode) = 0;
- /// do the operation on <var>aValue</var>. needs to be implemented by concrete visitor classes
- virtual Result handle(rtl::Reference< Tree > const& aTree, ValueRef const& aValue) = 0;
- protected:
- virtual ~NodeVisitor() {}
- };
-//-----------------------------------------------------------------------------
-
-// class Node Impl
-//-----------------------------------------------------------------------------
-
- /** is the Implementation class for class <type>Node</type>, held inside a <type>Tree</type>.
- <p> Implements some functionality common to all node types.
- </p>
- <p> Otherwise it provides (not really typesafe) access to a
- <type scope='configmgr::configuration::NodeType>NodeImpl</type> which implements
- functionality for a node of a given type
- (as given by a <type scope='configmgr::configuration::NodeType>Enum</type> value).
- </p>
- */
- class NodeData
- {
- rtl::Reference<NodeImpl> m_pSpecificNode;
- rtl::OUString m_aName_; // cached for better performance
- unsigned int m_nParent;
- public:
- NodeData(rtl::Reference<NodeImpl> const& aSpecificNodeImpl, rtl::OUString const& aName, unsigned int nParent);
-
- void rebuild(rtl::Reference<view::ViewStrategy> const& _xNewStrategy, sharable::Node * _aNewData);
- // COMMON: information
- rtl::OUString getName() const { return m_aName_; }
- unsigned int getParent() const { return m_nParent; }
-
- // change management
- public:
- // BASIC NODE: access to common attributes
- NodeImpl & nodeImpl() { return implGetNodeImpl(); }
- NodeImpl const & nodeImpl() const { return implGetNodeImpl(); }
-
- // SET: access to child elements
- bool isSetNode() const;
- SetNodeImpl& setImpl() { return implGetSetImpl(); }
- SetNodeImpl const& setImpl() const { return implGetSetImpl(); }
-
- // VALUES: access to data
- bool isValueElementNode() const;
- ValueElementNodeImpl& valueElementImpl() { return implGetValueImpl(); }
- ValueElementNodeImpl const& valueElementImpl() const { return implGetValueImpl(); }
-
- // GROUP: access to children
- bool isGroupNode() const;
- GroupNodeImpl& groupImpl() { return implGetGroupImpl(); }
- GroupNodeImpl const&groupImpl() const { return implGetGroupImpl(); }
-
- // access helper
- public:
- sharable::Node * getOriginalNodeAccess() const;
-
- private:
- NodeImpl& implGetNodeImpl() const;
- SetNodeImpl& implGetSetImpl() const;
- GroupNodeImpl& implGetGroupImpl() const ;
- ValueElementNodeImpl& implGetValueImpl() const ;
- };
-//-----------------------------------------------------------------------------
- /** represents a hierarchy of config entries (identified by <type>NodeRef</type>s and <type>ValueRef</type>s)
-
- <p>Examples for trees include</p>
- <ulist>
- <li>A module tree (for a specific set of parameters).</li>
- <li>An updating tree (for a part of the whole).</li>
- <li>A set element (updating or not), which could be detached.</li>
- <ulist>
- <p> Holds a list of <type>Node</type> which it allows to access by
- <type>unsigned int</type> (which is basically a one-based index).
- </p>
- <p> Also provides for navigation to the context this tree is located in
- </p>
- */
- class Tree : public salhelper::SimpleReferenceObject
- {
- friend class view::ViewStrategy;
- protected:
- // Construction
- /// creates a Tree for a detached, virgin tree
- Tree( );
-
- /// creates a Tree with a parent tree
- Tree(Tree& rParentTree, unsigned int nParentNode);
-
- virtual ~Tree() = 0;
-
- /// fills this Tree starting from _aRootNode, using the given factory and the tree's template provider
- void build(rtl::Reference<view::ViewStrategy> const& _xStrategy, sharable::Node * _aRootNode, unsigned int nDepth, TemplateProvider const& aTemplateProvider);
-
- void rebuild(rtl::Reference<view::ViewStrategy> const& _xNewStrategy, sharable::Node * _aNewData);
-
- public:
- // realeses the data this refers to
- virtual void disposeData();
-
- // Context Access
- /// gets the path to the root node of this tree
- AbsolutePath getRootPath() const;
- /// gets the tree of parent node of this tree
- Tree* getContextTree() { return m_pParentTree; }
- /// gets the tree of parent node of this tree
- Tree const *getContextTree() const { return m_pParentTree; }
- /// gets the offset of parent node of this tree within its tree
- unsigned int getContextNode() const { return m_nParentNode; }
-
- // Node Collection information
- /// checks whether <var>nNode</var> is a valid node offset in this tree
- bool isValidNode(unsigned int nNode) const;
-
- bool isRootNode(NodeRef const & node) const;
-
- NodeRef getRootNode() const;
-
- NodeRef getContextNodeRef() const;
-
- bool isValidValueNode(ValueRef const & value);
-
-#if OSL_DEBUG_LEVEL > 0
- bool isValidAnyNode(AnyNodeRef const & node);
-#endif
-
- /// checks whether the node has any element nodes (of its own)
- bool hasElements(NodeRef const & node);
-
- bool hasElement(NodeRef const & node, rtl::OUString const & name);
-
- bool hasElement(NodeRef const & node, Path::Component const & name);
-
- /** gets the element with the given name of the given node
- <p>PRE: <code>hasElement(node, name)</code></p>
- <p>If there is no such element, may return an empty node or
- raise an exception (?)</p>
-
- @throws InvalidName
- if name is not a valid child name for this node
- */
- rtl::Reference< ElementTree > getElement(
- NodeRef const & node, rtl::OUString const & name);
-
- /** gets the element with the given name of the given node, if it is
- available
- <p>PRE: <code>hasElement(node, name)</code></p>
- <p>If there is no such element, may return an empty node or
- raise an exception (?)</p>
- <p>Caution: May miss existing children unless hasChild/getChild
- has been called before.</p>
-
- @throws InvalidName
- if name is not a valid child name for this node
- */
- rtl::Reference< ElementTree > getAvailableElement(
- NodeRef const & node, rtl::OUString const & name);
-
- /// checks whether the node has any child nodes (in this tree)
- bool hasChildren(NodeRef const & node);
-
- bool hasChildValue(
- NodeRef const & node, rtl::OUString const & name);
-
- bool hasChildNode(NodeRef const & node, rtl::OUString const & name);
-
- bool hasChild(NodeRef const & node, rtl::OUString const & name);
-
- /** gets the child value (in this tree) with the given name of the
- given node
- <p>PRE: <code>hasChildValue(node, name)</code></p>
- <P>If there is no such node, may return an empty node or raise
- an exception (?)</p>
-
- @throws InvalidName
- if <var>aName</var> is not a valid child name for this node
- */
- ValueRef getChildValue(
- NodeRef const & node, rtl::OUString const & name);
-
- NodeRef getChildNode(
- NodeRef const & node, rtl::OUString const & name);
-
- AnyNodeRef getAnyChild(
- NodeRef const& node, rtl::OUString const & name);
-
- node::Attributes getAttributes(NodeRef const & node);
-
- node::Attributes getAttributes(AnyNodeRef const & node);
-
- node::Attributes getAttributes(ValueRef const & value);
-
- com::sun::star::uno::Type getUnoType(ValueRef const & value);
-
- /// return the parent of the given node (or an empty node, if it is
- /// the tree root)
- NodeRef getParent(NodeRef const & node);
-
- /// return the parent of the given value (or an empty node, if it is
- /// the tree root)
- NodeRef getParent(ValueRef const & value);
-
- AbsolutePath getAbsolutePath(NodeRef const & node);
-
- /// retrieves the current value for the given node, provided there
- /// is one and it is available (only works for value nodes)
- com::sun::star::uno::Any getNodeValue(ValueRef const & value);
-
- /// checks whether the given node has a default value (only works
- /// for value nodes)
- bool hasNodeDefault(ValueRef const & value);
-
- /// checks whether the given node assumes its default value (only
- /// works for value nodes)
- bool isNodeDefault(ValueRef const & value);
-
- /// checks whether the given node has a default state
- bool hasNodeDefault(NodeRef const & node);
-
- /// checks whether the given node assumes its default state
- bool isNodeDefault(NodeRef const & node);
-
- /// checks whether the given node has a default state
- bool hasNodeDefault(AnyNodeRef const & node);
-
- /// checks whether the given node assumes its default state
- bool isNodeDefault(AnyNodeRef const & node);
-
- /// checks whether the default values are available for the children
- /// of the given node (if applicable)
- bool areValueDefaultsAvailable(NodeRef const & node);
-
- /// retrieves the default value for the given node, provided there
- /// is one and it is available (only works for value nodes)
- com::sun::star::uno::Any getNodeDefaultValue(
- ValueRef const & value);
-
- bool hasChanges();
-
- /// lists any pending changes on this tree
- bool collectChanges(NodeChanges & changes);
-
- void integrate(
- NodeChange & change, NodeRef const & node, bool local);
-
- void integrate(
- NodeChanges & changes, NodeRef const & node, bool local);
-
- NodeVisitor::Result visit(
- NodeRef const & node, NodeVisitor & visitor)
- { return visitor.handle(this, node); }
-
- NodeVisitor::Result visit(
- ValueRef const & value, NodeVisitor & visitor)
- { return visitor.handle(this, value); }
-
- /** lets the given visitor visit the child nodes of the given node
-
- The order in which nodes are visited is repeatable (but
- currently unspecified). Visits nodes until NodeVisitor::DONE is
- returned, then returns NodeVisitor::DONE. If all visits return
- NodeVisitor::CONTINUE, returns NodeVisitor::CONTINUE. If no
- children are present, returns NodeVisitor::CONTINUE.
- */
- NodeVisitor::Result dispatchToChildren(
- NodeRef const & node, NodeVisitor & visitor);
-
- NodeRef getNode(unsigned int offset) const;
-
- rtl::Reference< Template > extractElementInfo(NodeRef const & node);
-
- /// gets the depth that is available in this tree (due to the original request)
- unsigned int getAvailableDepth() const { return m_nDepth; }
-
- /// gets the depth that is available in this tree within the given node
- unsigned int getRemainingDepth(unsigned int nNode) const
- { return remainingDepth(getAvailableDepth(),depthTo(nNode)); }
-
- // Node Collection navigation
- /** gets the simple name of the node <var>nNode</var>
- <p>PRE: <code>isValidNode(nNode)</code>
- </p>
- */
- rtl::OUString getSimpleNodeName(unsigned int nNode) const;
-
- /** gets the simple name of the root node (i.e. of the tree as a whole)
- */
- virtual rtl::OUString getSimpleRootName() const;
-
- /** gets the full name of the root node
- */
- Path::Component getExtendedRootName() const;
-
- /** gets the number of hierarchy levels from the root node to node <var>nNode</var>
- in this tree
- <p>In particular <code>depthTo(N) == 0</code> if <code>N == root()</code>
- </p>
- <p>PRE: <code>isValidNode(nNode)</code>
- </p>
- */
- unsigned int depthTo(unsigned int nNode) const;
-
- /// append the local path (relative to root) to a node to a collection of names
- void prependLocalPathTo(unsigned int nNode, Path::Rep& rNames);
-
- // check whether defaults are available
- bool hasDefaults(unsigned int _nNode) const;
- public:
- enum { ROOT = 1 }; /// base of <type>unsigned int</type>s used in this class
-
- /** gets the <type>unsigned int</type> of the parent node <var>nNode</var> in this tree
- or 0 (zero) if it is the root node
- <p>PRE: <code>isValidNode(nNode)</code>
- </p>
- */
- unsigned int parent_(unsigned int nNode) const;
-
- // Node iteration and access
- /** gets the <type>unsigned int</type> of the first child node
- of node <var>nParent</var> in this tree (in list order)
- or 0 (zero) if it has no children in this tree
- <p>PRE: <code>isValidNode(nParent)</code>
- </p>
- */
- unsigned int firstChild_ (unsigned int nParent) const;
-
- /** gets the <type>unsigned int</type> of the first child node
- of node <var>nParent</var> that is after
- node <var>nNode</var> in this tree (in list order)
- or 0 (zero) if there is no such node
- <p>if <code>nStartAfter == 0</code> searching starts at the beginning
- </p>
- <p>PRE: <code>isValidNode(nParent)</code>
- </p>
- <p>PRE: <code>isValidNode(nStartAfter) || nStartAfter == 0</code>
- </p>
- */
- unsigned int findNextChild_(unsigned int nParent, unsigned int nStartAfter) const;
-
- /** gets the <type>unsigned int</type> of the first (and only) child node
- of node <var>nParent</var> in this tree (in list order)
- where the name of the node is <var>aName</var>,
- or 0 (zero) if there is no such node
- <p>PRE: <code>isValidNode(nParent)</code>
- </p>
- */
- unsigned int findChild_(unsigned int nParent, rtl::OUString const& aName) const;
-
- // Node Collection access
- /// get the number of nodes in this tree
- unsigned int nodeCount() const;
-
- /// get the <type>NodeData</type> for node <var>nNode</var> in this tree
- NodeData* nodeData(unsigned int nNode);
- /// get the <type>NodeData</type> for node <var>nNode</var> in this tree
- NodeData const* nodeData(unsigned int nNode) const;
- /// get the <type>NodeData</type> for node <var>nNode</var> in this tree
- NodeImpl& nodeImpl(unsigned int nNode) { return nodeData(nNode)->nodeImpl(); }
- /// get the <type>NodeData</type> for node <var>nNode</var> in this tree
- NodeImpl const& nodeImpl(unsigned int nNode) const { return nodeData(nNode)->nodeImpl(); }
-
- unsigned int nodeOffset(NodeData const & rNodeData) const;
-
- // Behavior
- rtl::Reference< view::ViewStrategy > getViewBehavior() const;
- protected:
- // immediate commit
-/* // implementation of commit protocol
- void commitDirect();
-
- void implCommitDirectFrom(unsigned int nNode);
-*/
- void implRebuild(unsigned int nNode, sharable::Node * _aNewData);
-
- protected:
- /// set a new parent context for this tree
- void setContext(Tree* pParentTree, unsigned int nParentNode);
- /// set no-parent context for this tree
- void clearContext();
-
- inline // is protected and should be used only in the implementation
- rtl::OUString implGetOriginalName(unsigned int nNode) const;
-
- private:
- /// get the full name of the root of this tree
- virtual Path::Component doGetRootName() const = 0;
-
- /// prepend the absolute path to the root of this tree (no context use)
- virtual void doFinishRootPath(Path::Rep& rPath) const = 0;
-
- ValueMemberNode getMemberNode(ValueRef const & value);
-
- rtl::Reference<view::ViewStrategy> m_xStrategy;
- std::vector<NodeData> m_aNodes;
- Tree* m_pParentTree;
- unsigned int m_nParentNode;
- unsigned int m_nDepth;
-
- /// prepend the absolute path to the root of this tree (using context if present)
- void implPrependRootPath(Path::Rep& rPath) const;
-
- friend class TreeImplBuilder;
- };
-
- /// checks, if tree represents a real tree
- bool isEmpty(Tree * tree);
-//-----------------------------------------------------------------------------
-
- class ElementTree : public Tree
- {
- public:
-
- /// creates a Tree for a detached, virgin instance of <var>aTemplate</var> (always will be direct)
- ElementTree(rtl::Reference< data::TreeSegment > const& _aElementData, rtl::Reference<Template> aTemplate, TemplateProvider const& aTemplateProvider );
-
- /** creates a Tree with a parent tree, that (supposedly)
- is an instance of <var>aTemplateInfo</var>
- */
- ElementTree(rtl::Reference<view::ViewStrategy> const& _xStrategy,
- Tree& rParentTree, unsigned int nParentNode,
- sharable::TreeFragment * dataTree, unsigned int nDepth,
- rtl::Reference<Template> aTemplateInfo,
- TemplateProvider const& aTemplateProvider );
-
- /** creates a Tree with no parent node, that (supposedly)
- is an instance of <var>aTemplateInfo</var>
- */
- ElementTree(rtl::Reference<view::ViewStrategy> const& _xStrategy,
- sharable::TreeFragment * dataTree, unsigned int nDepth,
- rtl::Reference<Template> aTemplateInfo,
- TemplateProvider const& aTemplateProvider );
-
- ~ElementTree();
-
- // realeses the data this refers to
- virtual void disposeData();
-
- // rebuilding
- using Tree::rebuild;
- void rebuild(rtl::Reference<view::ViewStrategy> const& _xNewStrategy, sharable::TreeFragment * newData);
-
- // data access
- sharable::TreeFragment * getOriginalTreeAccess() const { return m_aDataAddress; }
-
- // Tree information
- virtual rtl::OUString getSimpleRootName() const;
- /// checks whether this is an instance of a known template
- bool isTemplateInstance() const { return !!m_aInstanceInfo.is(); }
- /// checks whether this is an instance of the given template
- bool isInstanceOf(rtl::Reference<Template> const& aTemplateInfo) const
- { return m_aInstanceInfo == aTemplateInfo && aTemplateInfo.is(); }
- /// retrieves the template that this is an instance of
- rtl::Reference<Template> getTemplate() const { return m_aInstanceInfo; }
- /// makes a complete name from a simple name and template information
- Path::Component makeExtendedName(rtl::OUString const& aSimpleName) const;
-
- // node control operation
- /// check if this is a free-floating tree
- bool isFree() const { return m_aOwnData.is(); }
- /// transfer ownership to the given set
- void attachTo(sharable::SetNode * updatableSetNode, rtl::OUString const& aElementName);
- /// tranfer ownership from the given set
- void detachFrom(sharable::SetNode * updatableSetNode, rtl::OUString const& aElementName);
-
- /// take ownership of the given tree (which must not already be the one in use)
- void takeTreeAndRebuild(rtl::Reference< data::TreeSegment > const& _aElementData);
- /// take ownership of the given tree (which must already be the one in use)
- void takeTreeBack(rtl::Reference< data::TreeSegment > const& _aElementData);
-
- /// release ownership
- rtl::Reference< data::TreeSegment > releaseOwnedTree();
-
- // context operation
- /// set a new root name
- void renameTree(rtl::OUString const& aNewName);
- /// set a new parent context for this tree
- void moveTree(Tree* pParentTree, unsigned int nParentNode);
- /// set no-parent context for this tree
- void detachTree();
-
- private:
- static bool isUpdatableSegment(Tree& _rTree);
-
- virtual Path::Component doGetRootName() const;
-
- virtual void doFinishRootPath(Path::Rep& rPath) const;
- private:
- rtl::Reference<Template> const m_aInstanceInfo;
- rtl::OUString m_aElementName;
- sharable::TreeFragment * m_aDataAddress;
- rtl::Reference< data::TreeSegment > m_aOwnData;
- };
-//-----------------------------------------------------------------------------
- inline
- bool Tree::isValidNode(unsigned int nNode) const
- {
- return ROOT <= nNode && nNode < nodeCount() + ROOT;
- }
- //---------------------------------------------------------------------
- inline
- unsigned int Tree::nodeCount() const
- {
- return m_aNodes.size();
- }
- //---------------------------------------------------------------------
- inline
- NodeData* Tree::nodeData(unsigned int nNode)
- {
- if (nNode == 0) return NULL;
- OSL_ASSERT(isValidNode(nNode));
- return &m_aNodes[nNode - ROOT];
- }
- //---------------------------------------------------------------------
- inline
- NodeData const* Tree::nodeData(unsigned int nNode) const
- {
- if (nNode == 0) return NULL;
- OSL_ASSERT(isValidNode(nNode));
- return &m_aNodes[nNode - ROOT];
- }
- //---------------------------------------------------------------------
- inline
- unsigned int Tree::nodeOffset(NodeData const & rNode) const
- {
- unsigned int nOffset = ROOT + (&rNode - &m_aNodes[0]);
- OSL_ASSERT(isValidNode(nOffset));
- return nOffset;
- }
-
-//-----------------------------------------------------------------------------
-// helper for other impl classes
-//-----------------------------------------------------------------------------
-#if OSL_DEBUG_LEVEL > 0
- struct ElementHelper
- {
- static
- com::sun::star::uno::Type getUnoType(rtl::Reference< ElementTree > const& aElement);
- };
-#endif
-//-----------------------------------------------------------------------------
- }
-//-----------------------------------------------------------------------------
-}
-
-#endif // CONFIGMGR_CONFIGNODEIMPL_HXX_
diff --git a/configmgr/source/inc/treeactions.hxx b/configmgr/source/inc/treeactions.hxx
deleted file mode 100644
index 01fd60b7ef..0000000000
--- a/configmgr/source/inc/treeactions.hxx
+++ /dev/null
@@ -1,89 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONFIGMGR_TREEACTIONS_HXX_
-#define _CONFIGMGR_TREEACTIONS_HXX_
-
-#include "change.hxx"
-
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif
-
-//..........................................................................
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
-
-//==========================================================================
-//= OChangeActionCounter
-//==========================================================================
-/** collects meta data about a changes tree
-*/
-struct OChangeActionCounter : public ChangeTreeAction
-{
- sal_Int32 nValues, nAdds, nRemoves;
-
- OChangeActionCounter() :nValues(0), nAdds(0), nRemoves(0) {}
-
- virtual void handle(ValueChange const& aValueNode);
- virtual void handle(AddNode const& aAddNode);
- virtual void handle(RemoveNode const& aRemoveNode);
- virtual void handle(SubtreeChange const& aSubtree);
-
- sal_Bool hasChanges() const {return nValues || nAdds || nRemoves;}
-};
-
-// ===================================================================
-// = CollectNames
-// ===================================================================
-class CollectNames : public NodeAction
-{
-public:
- std::vector<rtl::OUString> const& list() const { return aList; }
-
- CollectNames() : aList() {}
-
- void handle(ValueNode const& aValue) { add(aValue); }
- void handle(ISubtree const& m_aSubtree) { add(m_aSubtree); }
-
- void add(INode const& aNode)
- {
- aList.push_back(aNode.getName());
- }
-private:
- std::vector<rtl::OUString> aList;
-};
-
-//..........................................................................
-} // namespace configmgr
-//..........................................................................
-
-#endif // _CONFIGMGR_TREEACTIONS_HXX_
-
-
diff --git a/configmgr/source/inc/treechangefactory.hxx b/configmgr/source/inc/treechangefactory.hxx
deleted file mode 100644
index 61cef48940..0000000000
--- a/configmgr/source/inc/treechangefactory.hxx
+++ /dev/null
@@ -1,104 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_TREE_CHANGEFACTORY_HXX
-#define CONFIGMGR_TREE_CHANGEFACTORY_HXX
-
-#include "change.hxx"
-
-#ifndef INCLUDED_MEMORY
-#include <memory>
-#define INCLUDED_MEMORY
-#endif
-
-
-namespace configmgr
-{
-
- namespace uno = ::com::sun::star::uno;
-
- //==========================================================================
-
- class OTreeChangeFactory
- {
- public:
- //-----------------------------------------------
- std::auto_ptr<SubtreeChange> createSetNodeChange(
- rtl::OUString const& _aName,
- rtl::OUString const& _aTemplateName,
- rtl::OUString const& _aTemplateModule,
- node::Attributes _aAttrs,
- bool _bToDefault = false);
- //-----------------------------------------------
-
- //= Set Changes ============================================================
- std::auto_ptr<AddNode> createAddNodeChange(
- rtl::Reference< data::TreeSegment > const & _aNewTree,
- rtl::OUString const& _aName,
- bool _bToDefault = false);
-
- //-----------------------------------------------
- std::auto_ptr<RemoveNode> createRemoveNodeChange(
- rtl::OUString const& _aName,
- bool _bToDefault = false);
-
- //= special case: Dummy ISubtree ============================================================
- static std::auto_ptr<SubtreeChange> createDummyChange(
- rtl::OUString const& _aName,
- rtl::OUString const& _aElementTypeName);
-
- //-----------------------------------------------
- };
-
- OTreeChangeFactory& getDefaultTreeChangeFactory();
- //==========================================================================
- inline
- std::auto_ptr<Change> base_ptr(std::auto_ptr<SubtreeChange> pChange)
- { return std::auto_ptr<Change>(pChange.release()); }
- //==========================================================================
- inline
- std::auto_ptr<Change> base_ptr(std::auto_ptr<ValueChange> pChange)
- { return std::auto_ptr<Change>(pChange.release()); }
- //==========================================================================
- inline
- std::auto_ptr<Change> base_ptr(std::auto_ptr<AddNode> pChange)
- { return std::auto_ptr<Change>(pChange.release()); }
- //==========================================================================
- inline
- std::auto_ptr<Change> base_ptr(std::auto_ptr<RemoveNode> pChange)
- { return std::auto_ptr<Change>(pChange.release()); }
- //==========================================================================
-
- bool isGenericSetElementType(rtl::OUString const& _aElementType);
- bool isDummySetElementModule(rtl::OUString const& _aElementModule);
- rtl::OUString getGenericSetElementType();
- rtl::OUString getDummySetElementModule();
- //==========================================================================
-
-} // namespace configmgr
-
-#endif
diff --git a/configmgr/source/inc/treechangelist.hxx b/configmgr/source/inc/treechangelist.hxx
deleted file mode 100644
index dd536d4624..0000000000
--- a/configmgr/source/inc/treechangelist.hxx
+++ /dev/null
@@ -1,120 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-/* PLEASE DON'T DELETE ANY COMMENT LINES, ALSO IT'S UNNECESSARY. */
-
-
-#ifndef CONFIGMGR_TREECHANGELIST_HXX
-#define CONFIGMGR_TREECHANGELIST_HXX
-
-#include "change.hxx"
-#include "attributes.hxx"
-#include "configpath.hxx"
-#include "requestoptions.hxx"
-
-namespace configmgr
-{
-
-////////////////////////////////////////////////////////////////////////////////
-
- //==========================================================================
- //= TreeChangeList
- //==========================================================================
- struct TreeChangeList
- {
- TreeChangeList(const RequestOptions& _aOptions,
- const configuration::AbsolutePath& _rRootPath,
- const SubtreeChange& _aSubtree,
- treeop::DeepChildCopy _doDeepCopy)
- : root(_aSubtree,_doDeepCopy)
- , m_aLocation(_rRootPath)
- , m_aOptions(_aOptions)
- {}
-
- /** ctor
- @param _rRootPath path to the root of the whole to-be-updated subtree
- */
- TreeChangeList( const RequestOptions& _aOptions,
- const configuration::AbsolutePath& _rRootPath,
- const node::Attributes& _rAttr = node::Attributes())
- : root(_rRootPath.getLocalName().getName(), _rAttr)
- , m_aLocation(_rRootPath)
- , m_aOptions(_aOptions)
- {}
-
- /** ctor
- @param _rLocalName relative path within the to-be-updated subtree
- */
- TreeChangeList( const RequestOptions& _aOptions,
- const configuration::AbsolutePath& _rRootPath,
- rtl::OUString const & _rChildTemplateName,
- rtl::OUString const & _rChildTemplateModule,
- const node::Attributes& _rAttr = node::Attributes())
- : root(_rRootPath.getLocalName().getName(), _rChildTemplateName, _rChildTemplateModule, _rAttr)
- , m_aLocation(_rRootPath)
- , m_aOptions(_aOptions)
- {}
-
- /** ctor
- @param _rTreeList list to initialize the path, no childs are copied
- */
- TreeChangeList( const TreeChangeList& _rTree, treeop::NoChildCopy _rNoCopy)
- : root(_rTree.root, _rNoCopy)
- , m_aLocation(_rTree.m_aLocation)
- , m_aOptions(_rTree.m_aOptions)
- {}
-
- /// is root a change for the module root
- bool isModuleRootChange() const { return m_aLocation.getDepth() <= 1; }
-
- /// get the module these changes belong to
- rtl::OUString getModuleName() const { return m_aLocation.getModuleName(); }
-
- /// get the full path to the root (location + root-name)
- void setRootPath(const configuration::AbsolutePath& _rRootPath)
- { m_aLocation = _rRootPath; }
-
- /// get the full path to the root (location + root-name)
- configuration::AbsolutePath const& getRootNodePath() const { return m_aLocation; }
-
- /// get the full path to the root (location)
- configuration::AbsolutePath getRootContextPath() const { return m_aLocation.getParentPath(); }
-
- RequestOptions const & getOptions() const { return m_aOptions; }
-
- public:
- SubtreeChange root; // the root of the whole tree of updates
- private:
- configuration::AbsolutePath m_aLocation; // absolute path to the parent of the node corresponding to this->root
- RequestOptions m_aOptions; // options for the tree that is concerned by these changes
- };
-//----------------------------------------------------------------------------
-
-} // namespace configmgr
-
-#endif
-
diff --git a/configmgr/source/inc/treefragment.hxx b/configmgr/source/inc/treefragment.hxx
deleted file mode 100644
index 8193cff082..0000000000
--- a/configmgr/source/inc/treefragment.hxx
+++ /dev/null
@@ -1,138 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef INCLUDED_SHARABLE_TREEFRAGMENT_HXX
-#define INCLUDED_SHARABLE_TREEFRAGMENT_HXX
-
-#include "flags.hxx"
-#include "node.hxx"
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace sharable
- {
- //-----------------------------------------------------------------------------
- /* a TreeFragment header is interpreted differently, depending on the kind of TreeFragment
-
- - for a set element
- name points to the element name (the name in the root node is the template name)
- parent points to the SetNode that is the parent. The containing treefragment can
- be recovered from this with some care
- next points to the next element of the same set. It is null for the last element.
- state is fully used here
-
- - for a template tree
- name points to the template name (same as the name in the root node)
- component points to the home component name of the template
- (often the same as 'component' in the component tree)
- next points to another template TreeFragment. It is null for the last template.
- state must be 'replaced' here (rarely it might be marked as mandatory)
-
- - for a component tree
- name points to the component name (same as the name in the root node)
- component is equal to name (or NULL ?)
- next points to another template TreeFragment. It is null if there is no template.
- state must be either 'defaulted' or 'merged'
- (it should be marked as mandatory although that is not used yet)
- */
- struct TreeFragmentHeader
- {
- struct TreeFragment *next; // next sibling set element or template
- rtl_uString * name; // element-name/template name
- union // context
- {
- union Node *parent; // parent node
- rtl_uString * component; // component name
- };
- sal_uInt16 count; // number of contained nodes
- sal_uInt8 state;
- sal_uInt8 reserved;
- };
- //-----------------------------------------------------------------------------
- /* a tree fragment is stored as a variable-sized struct
- containing a header and a fixed sequence of nodes
-
- R - - A - - A1
- | |
- | - A2
- |
- - B
- |
- - C - - C1 - - C11
- | | |
- | | - C12
- | |
- | - C2 - - C21
- |
- - D
-
- is stored as
-
- H(count = 12) : [R;A;A1;A2;B;C;C1;C11;C12;C2;C21;D]
- */
- //-----------------------------------------------------------------------------
- /* tree fragments are used for: Component trees, Template trees, Set elements
-
- They are only fragments, as for a TreeFragment a Set is considered a leaf node.
- Set elements are maintained as a singly linked list that is accessible from the set node
-
- A cache component has the Root (component tree) TreeFragment at a well-known location.
- The 'next' element of the component tree points to the list of template TreeFragments
- used in the component.
- */
- struct TreeFragment
- {
- TreeFragmentHeader header; // really variable-sized:
- Node nodes[1]; // nodes[header.count]
-
- // header info access
- bool hasDefaultsAvailable() const;
-
- bool isDefault() const;
- bool isNew() const;
-
- bool isNamed(rtl::OUString const & _aName) const;
-
- rtl::OUString getName() const;
-
- void setName(rtl::OUString const & name);
-
- configmgr::node::Attributes getAttributes()const;
-
- Node * getRootNode() { return nodes; }
-
- static TreeFragment *allocate(sal_uInt32 nFragments);
- static void free_shallow( TreeFragment *pFragment );
- };
- //-----------------------------------------------------------------------------
-
- }
-//-----------------------------------------------------------------------------
-}
-
-#endif // INCLUDED_SHARABLE_TREEFRAGMENT_HXX
diff --git a/configmgr/source/inc/treemanager.hxx b/configmgr/source/inc/treemanager.hxx
deleted file mode 100644
index 4db44eaf4b..0000000000
--- a/configmgr/source/inc/treemanager.hxx
+++ /dev/null
@@ -1,157 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_TREEMANAGER_HXX_
-#define CONFIGMGR_TREEMANAGER_HXX_
-
-#include <memory>
-
-#include "salhelper/simplereferenceobject.hxx"
-
-#include "defaultprovider.hxx"
-#include "confevents.hxx"
-#include "options.hxx"
-#include "autoreferencemap.hxx"
-#include "autoobject.hxx"
-
-namespace configmgr
-{
- namespace uno = ::com::sun::star::uno;
-
- namespace backend {
- class CacheController;
- class ComponentRequest;
- class UpdateRequest;
- }
- namespace sharable {
- struct TreeFragment;
- union Node;
- }
-
- //==========================================================================
- //= TreeManager
- //==========================================================================
- class CacheClientAccess;
- class CacheData;
- class ConfigChangeBroadcastHelper;
- class ISubtree;
- //==========================================================================
- class TreeManager: public salhelper::SimpleReferenceObject {
- typedef AutoReferenceMap< RequestOptions, CacheClientAccess, lessRequestOptions> CacheList;
-
- osl::Mutex m_aCacheControllerMutex;
- rtl::Reference< backend::CacheController > m_xCacheController;
-
- rtl::Reference< backend::CacheController > maybeGetBackendCache() SAL_THROW(());
- rtl::Reference< backend::CacheController > getCacheLoader() SAL_THROW((com::sun::star::uno::RuntimeException));
- void disposeBackendCache() SAL_THROW(());
-
- CacheList m_aCacheList; // Map
- AutoObject< CacheData > m_aTemplates;
- sal_Bool m_bEnableAsync;
-
- virtual ~TreeManager();
-
- public:
- /** ctor
- */
- explicit
- TreeManager(rtl::Reference< backend::CacheController > const & _xBackend);
-
- // disposing the cache before destroying
- void dispose();
-
- /** requests a node given by it's path. Basicly, this means
- that the node is fetch from the cache when it contains it else it ask the server
- system into it's cache.
- @param _rSubtreePath the path to the node in URI notation.
- @param _nMinLevels indicates how many tree levels under the node determined by <arg>_rSubtreePath</arg>
- should be loaded
- */
- sharable::Node * requestSubtree(configuration::AbsolutePath const& _rSubtreePath,
- RequestOptions const& _aOptions
- ) SAL_THROW((com::sun::star::uno::Exception));
-
- void updateTree(TreeChangeList& aChanges) SAL_THROW((com::sun::star::uno::Exception));
-
- void saveAndNotifyUpdate(TreeChangeList const& aChanges) SAL_THROW((com::sun::star::uno::Exception));
-
- void releaseSubtree(configuration::AbsolutePath const& aSubtreePath,
- RequestOptions const& _aOptions ) SAL_THROW(());
-
- void fetchSubtree( configuration::AbsolutePath const& aSubtreePath,
- RequestOptions const& _xOptions
- ) SAL_THROW(());
-
- void refreshAll() SAL_THROW((com::sun::star::uno::Exception));
- void flushAll() SAL_THROW(());
- void enableAsync(const sal_Bool& bEnableAsync) SAL_THROW(()) ;
-
- sal_Bool fetchDefaultData( configuration::AbsolutePath const& aSubtreePath,
- RequestOptions const& _aOptions
- ) SAL_THROW((com::sun::star::uno::Exception));
-
- std::auto_ptr<ISubtree> requestDefaultData(configuration::AbsolutePath const& aSubtreePath,
- const RequestOptions& _aOptions
- ) SAL_THROW((com::sun::star::uno::Exception));
-
- sharable::TreeFragment * requestTemplate( rtl::OUString const& aName, rtl::OUString const& aModule
- ) SAL_THROW((com::sun::star::uno::Exception));
-
- // implementation interfaces
- void refreshSubtree(const configuration::AbsolutePath &_aAbsoluteSubtreePath,
- const RequestOptions& _aOptions) SAL_THROW((com::sun::star::uno::Exception));
-
- void addListener(configuration::AbsolutePath const& aName, const RequestOptions& _aOptions, rtl::Reference<INodeListener> const& pListener);
- void removeListener(const RequestOptions& _aOptions, rtl::Reference<INodeListener> const& pListener);
-
- void componentCreated(backend::ComponentRequest const & _aComponent) SAL_THROW(());
- void componentChanged(backend::UpdateRequest const & _anUpdate) SAL_THROW(());
-
- private:
- CacheData & getTemplates() { return * m_aTemplates.get(); }
-
- configuration::AbsolutePath encodeTemplateLocation(rtl::OUString const & _rLogicalTemplateName, rtl::OUString const &_rModule);
-
- private:
- rtl::Reference<CacheClientAccess> getCacheAlways(RequestOptions const & _aOptions);
-
- // disposing
- void disposeAll();
-
- void fireChanges(TreeChangeList const& _aChanges, sal_Bool _bError);
- ConfigChangeBroadcastHelper* getBroadcastHelper(RequestOptions const& _aOptions, bool bCreate);
- void disposeBroadcastHelper(ConfigChangeBroadcastHelper* pHelper);
-
- void nodeUpdated(TreeChangeList& _rChanges);
- };
-
-}
-
-
-#endif
-
diff --git a/configmgr/source/inc/treenodefactory.hxx b/configmgr/source/inc/treenodefactory.hxx
deleted file mode 100644
index 641fa37bbf..0000000000
--- a/configmgr/source/inc/treenodefactory.hxx
+++ /dev/null
@@ -1,96 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_TREE_NODEFACTORY_HXX
-#define CONFIGMGR_TREE_NODEFACTORY_HXX
-
-#include "valuenode.hxx"
-
-#ifndef INCLUDED_MEMORY
-#include <memory>
-#define INCLUDED_MEMORY
-#endif
-#if defined(_MSC_VER) && (_MSC_VER >= 1400)
-#pragma warning(disable : 4350)
-#endif
-namespace configmgr
-{
-
- namespace uno = ::com::sun::star::uno;
-
- //==========================================================================
-
- class OTreeNodeFactory
- {
- public:
- //= ValueNodes ============================================================
- std::auto_ptr<ValueNode> createValueNode(
- rtl::OUString const& aName,
- uno::Any const& aValue,
- node::Attributes _aAttrs);
-
- //-----------------------------------------------
- std::auto_ptr<ValueNode> createValueNode(
- rtl::OUString const& aName,
- uno::Any const& aValue,
- uno::Any const& aDefault,
- node::Attributes _aAttrs);
-
- //-----------------------------------------------
- std::auto_ptr<ValueNode> createNullValueNode(
- rtl::OUString const& aName,
- uno::Type const& aType,
- node::Attributes _aAttrs);
-
- //= ISubtree ============================================================
- std::auto_ptr<ISubtree> createGroupNode(
- rtl::OUString const& aName,
- node::Attributes _aAttrs);
-
- //-----------------------------------------------
- std::auto_ptr<ISubtree> createSetNode(
- rtl::OUString const& aName,
- rtl::OUString const& _rTemplateName,
- rtl::OUString const& _rTemplateModule,
- node::Attributes _aAttrs);
- };
-
- OTreeNodeFactory& getDefaultTreeNodeFactory();
- //==========================================================================
- inline
- std::auto_ptr<INode> base_ptr(std::auto_ptr<ISubtree> pNode)
- { return std::auto_ptr<INode>(pNode.release()); }
- //==========================================================================
- inline
- std::auto_ptr<INode> base_ptr(std::auto_ptr<ValueNode> pNode)
- { return std::auto_ptr<INode>(pNode.release()); }
- //==========================================================================
-
-
-} // namespace configmgr
-
-#endif
diff --git a/configmgr/source/inc/treesegment.hxx b/configmgr/source/inc/treesegment.hxx
deleted file mode 100644
index d17930e9c7..0000000000
--- a/configmgr/source/inc/treesegment.hxx
+++ /dev/null
@@ -1,73 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef INCLUDED_CONFIGMGR_SOURCE_INC_TREESEGMENT_HXX
-#define INCLUDED_CONFIGMGR_SOURCE_INC_TREESEGMENT_HXX
-
-#include "sal/config.h"
-
-#include <memory>
-
-#include "rtl/ref.hxx"
-#include "salhelper/simplereferenceobject.hxx"
-
-namespace rtl { class OUString; }
-
-namespace configmgr {
- class INode;
- namespace sharable { struct TreeFragment; }
-
- namespace data {
- // rtl::Reference< TreeSegment > is a reference counted
- // sharable::TreeFragment *. A null reference is always modeled as an
- // empty rtl::Reference< TreeSegment >, never as a null fragment.
- class TreeSegment: public salhelper::SimpleReferenceObject {
- public:
- static rtl::Reference< TreeSegment > create(
- std::auto_ptr< INode > tree, rtl::OUString const & type);
-
- static rtl::Reference< TreeSegment > create(
- rtl::OUString const & name, std::auto_ptr< INode > tree);
-
- static rtl::Reference< TreeSegment > create(
- sharable::TreeFragment * tree);
-
- static rtl::Reference< TreeSegment > create(
- rtl::Reference< TreeSegment > const & tree)
- { return create(tree.is() ? tree->fragment : 0); }
-
- sharable::TreeFragment * const fragment; // non-null
-
- private:
- TreeSegment(sharable::TreeFragment * tree);
-
- virtual ~TreeSegment();
- };
- }
-}
-
-#endif
diff --git a/configmgr/source/inc/typeconverter.hxx b/configmgr/source/inc/typeconverter.hxx
deleted file mode 100644
index 10b423ae72..0000000000
--- a/configmgr/source/inc/typeconverter.hxx
+++ /dev/null
@@ -1,80 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONFIGMGR_TYPECONVERTER_HXX
-#define CONFIGMGR_TYPECONVERTER_HXX
-
-#include "utility.hxx"
-#include <com/sun/star/script/XTypeConverter.hpp>
-#include <rtl/ustring.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-
-namespace configmgr
-{
- namespace uno = ::com::sun::star::uno;
- namespace script = ::com::sun::star::script;
-
- // UNO Type handling
- uno::Type getSequenceElementType(uno::Type const& rSequenceType);
-
- uno::Type getBasicType(uno::Type const& rType, bool& bSequence);
- inline
- uno::Type getBasicType(uno::Type const& rType)
- { bool dummy; return getBasicType(rType,dummy); }
-
- // Any Conversion - uses TypeConverter
- uno::Any toAny( const uno::Reference< script::XTypeConverter >& xTypeConverter,
- const ::rtl::OUString& _rValue,
- const uno::TypeClass& _rTypeClass)
- SAL_THROW((script::CannotConvertException , com::sun::star::uno::RuntimeException));
-
- rtl::OUString toString(const uno::Reference< script::XTypeConverter >& xTypeConverter, const uno::Any& rValue)
- SAL_THROW((script::CannotConvertException , com::sun::star::uno::RuntimeException));
-
- // Type conversion
- ::rtl::OUString toTypeName(const uno::TypeClass& _rTypeClass);
-
- uno::Type toType(const ::rtl::OUString& _rsType);
- uno::Type toListType(const ::rtl::OUString& _rsElementType);
- ::rtl::OUString toTypeName(const uno::Type& _rType);
-
- inline
- uno::Type toType(const ::rtl::OUString& _rsSimpleType, bool isList)
- {
- return isList ? toListType(_rsSimpleType) : toType(_rsSimpleType);
- }
-
- // template names
- ::rtl::OUString toTemplateName(const uno::Type& _rType);
- ::rtl::OUString toTemplateName(const uno::TypeClass& _rBasicType, bool bList = false);
- ::rtl::OUString toTemplateName(const ::rtl::OUString& _rBasicTypeName, bool bList = false);
-
- uno::Type parseTemplateName(::rtl::OUString const& sTypeName);
- bool parseTemplateName(::rtl::OUString const& sTypeName, ::rtl::OUString& _rBasicName, bool& bList);
-
-} // namespace configmgr
-
-#endif /* CONFIGMGR_TYPECONVERTER_HXX */
diff --git a/configmgr/source/inc/updatehelper.hxx b/configmgr/source/inc/updatehelper.hxx
deleted file mode 100644
index 86675e1d0b..0000000000
--- a/configmgr/source/inc/updatehelper.hxx
+++ /dev/null
@@ -1,46 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_UPDATEHELPER_HXX
-#define CONFIGMGR_UPDATEHELPER_HXX
-
-#include "change.hxx"
-
-namespace configmgr {
- namespace sharable { union Node; }
-
-// apply a already matching set of changes to the target tree
- void applyUpdateToTree(SubtreeChange& _anUpdateTree, sharable::Node * _aRootNode);
-
-// apply a set of changes to the target tree
- void applyUpdateWithAdjustmentToTree(SubtreeChange& _anUpdateTree, sharable::Node * _aRootNode);
-
-// apply a set of changes to the target tree, return true, if there are changes found
- bool createUpdateFromDifference(SubtreeChange& _rResultingUpdateTree, sharable::Node * existingData, ISubtree const & _aNewData);
-}
-
-#endif
diff --git a/configmgr/source/inc/valuenode.hxx b/configmgr/source/inc/valuenode.hxx
deleted file mode 100644
index 2a68819ac0..0000000000
--- a/configmgr/source/inc/valuenode.hxx
+++ /dev/null
@@ -1,293 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONFIGMGR_TREE_VALUENODE_HXX
-#define _CONFIGMGR_TREE_VALUENODE_HXX
-
-#include "attributes.hxx"
-#include "anypair.hxx"
-#include <com/sun/star/uno/Any.h>
-#include <rtl/ustring.hxx>
-
-#include <string.h>
-#ifndef INCLUDED_MEMORY
-#include <memory>
-#define INCLUDED_MEMORY
-#endif
-
-namespace configmgr
-{
-
- namespace css = com::sun::star;
- namespace uno = css::uno;
-
- class INode;
- class ISubtree;
- class ValueNode;
-
- // helper (tag) class
- namespace treeop { struct NoChildCopy {}; struct DeepChildCopy {}; enum { ALL_LEVELS = -1 }; }
- //==========================================================================
- //= Visitors
- //==========================================================================
- struct NodeAction
- {
- virtual void handle(ValueNode const&) = 0;
- virtual void handle(ISubtree const&) = 0;
-
- void applyToNode(INode const&);
- void applyToChildren(ISubtree const&);
- protected:
- virtual ~NodeAction() {}
- };
-
- struct NodeModification
- {
- virtual void handle(ValueNode&) = 0;
- virtual void handle(ISubtree&) = 0;
-
- void applyToNode(INode&);
- void applyToChildren(ISubtree&);
- protected:
- virtual ~NodeModification() {}
- };
-
- class INode
- {
- rtl::OUString m_aName;
- node::Attributes m_aAttributes;
-
- protected:
- INode(){}
-
- void markAsDefault(bool _bDefault = true)
- {
- m_aAttributes.markAsDefault(_bDefault);
- }
- public:
- explicit
- INode(rtl::OUString const& aName, node::Attributes);
-
- virtual ~INode();
-
- virtual std::auto_ptr<INode> clone() const = 0;
- public:
-
- const rtl::OUString& getName() const { return m_aName; }
- node::Attributes getAttributes() const { return m_aAttributes; }
-
- bool isDefault() const { return m_aAttributes.isDefault(); }
- bool isLocalized() const { return m_aAttributes.isLocalized(); }
-
- void modifyState(node::State _eNewState);
- void modifyAccess(node::Access _aAccessLevel);
- void markMandatory();
- void markRemovable();
- void promoteAccessToDefault();
-
- // to be used with caution. If the node is referenced from somewhere else under it's old name,
- // you may have problems with this inconsistence
- void setName(const rtl::OUString& _rNewName) { m_aName = _rNewName; }
-
- virtual ValueNode* asValueNode();
- virtual ValueNode const* asValueNode() const;
- virtual ISubtree* asISubtree();
- virtual ISubtree const* asISubtree() const;
-
- // double dispatch support
- virtual void dispatch(NodeAction&) const = 0;
- virtual void dispatch(NodeModification&) = 0;
- };
-
-// -----------------------------------------------------------------------------
-
- //==========================================================================
- //= ISubtree
- //==========================================================================
- class ISubtree : public INode
- {
- sal_Int16 m_nLevel; /// determines if everything is read
- sal_Int16 m_nDefaultLevels; /// determines if defaults are read
- rtl::OUString m_sId;
- rtl::OUString m_sTemplateName; /// path of the template for child instantiation
- rtl::OUString m_sTemplateModule; /// module of the template for child instantiation
-
- virtual INode* doGetChild(rtl::OUString const& name) const = 0;
-
- protected:
- ISubtree():m_nLevel(0){}
-
- ISubtree(ISubtree const& other)
- :INode(other)
- ,m_nLevel(other.m_nLevel)
- ,m_nDefaultLevels(other.m_nDefaultLevels)
- ,m_sId() // do not copy ID while cloning !
- ,m_sTemplateName(other.m_sTemplateName)
- ,m_sTemplateModule(other.m_sTemplateModule)
- {}
-
- public:
- // Ctor for group trees
- ISubtree(const rtl::OUString& aName, const node::Attributes& _rAttrs)
- :INode(aName, _rAttrs)
- ,m_nLevel(0)
- ,m_nDefaultLevels(0)
- {}
-
- // Ctor for set trees
- ISubtree(const rtl::OUString& aName,
- const rtl::OUString& _rTemplateName,
- const rtl::OUString& _rTemplateModule,
- const node::Attributes& _rAttrs)
- :INode(aName, _rAttrs)
- ,m_nLevel(0)
- ,m_nDefaultLevels(0)
- ,m_sTemplateName(_rTemplateName)
- ,m_sTemplateModule(_rTemplateModule){}
-
- INode* getChild(rtl::OUString const& name) { return doGetChild(name); }
- INode const* getChild(rtl::OUString const& name) const { return doGetChild(name); }
-
- ISubtree* asISubtree();
- ISubtree const* asISubtree() const;
-
- using INode::markAsDefault;
-
- sal_Int16 getLevel() const { return m_nLevel; }
-
- void setLevels(sal_Int16 _nLevel,sal_Int16 _nDefaultsLevel);
-
- bool isSetNode() const { return m_sTemplateName.getLength() != 0; }
-
- void makeSetNode(rtl::OUString const& _sTemplateName, rtl::OUString const& _sTemplateModule)
- { m_sTemplateName = _sTemplateName; m_sTemplateModule = _sTemplateModule; }
-
- rtl::OUString const& getElementTemplateName() const { return m_sTemplateName; }
- rtl::OUString const& getElementTemplateModule() const { return m_sTemplateModule; }
-
- virtual INode* addChild(std::auto_ptr<INode> node) =0; // takes ownership
- virtual ::std::auto_ptr<INode> removeChild(rtl::OUString const& name) =0; // releases ownership
-
- // Iteration support, stop if (action returns true)
- virtual void forEachChild(NodeAction& anAction) const = 0;
- virtual void forEachChild(NodeModification& anAction) = 0;
-
- // double dispatch support
- virtual void dispatch(NodeAction& anAction) const { anAction.handle(*this); }
- virtual void dispatch(NodeModification& anAction) { anAction.handle(*this); }
- };
-
- //==========================================================================
- //= ValueNode
- //==========================================================================
- class ValueNode : public INode
- {
- AnyPair m_aValuePair;
- // uno::Type m_aType;
- // uno::Any m_aValue;
- // uno::Any m_aDefaultValue;
-
- public:
- //ValueNode(){}
-
- //explicit ValueNode(node::Attributes _aAttrs):INode(_aAttrs){}
-
- /*
- ValueNode(rtl::OUString const& aName, node::Attributes _aAttrs)
- : INode(aName, _aAttrs)
- , m_aValuePair()
- {}
- */
- ValueNode(rtl::OUString const& aName,uno::Type const& aType, node::Attributes _aAttrs)
- : INode(aName, _aAttrs)
- , m_aValuePair(aType)
- {
- }
- ValueNode(rtl::OUString const& aName,uno::Any const& anAny, node::Attributes _aAttrs)
- : INode(aName, _aAttrs)
- , m_aValuePair(anAny, selectMember(_aAttrs.isDefault()))
- {
- }
- ValueNode(rtl::OUString const& aName,uno::Any const& anAny,uno::Any const& aDefault, node::Attributes _aAttrs)
- : INode(aName, _aAttrs)
- , m_aValuePair(anAny, aDefault)
- {
- }
-
- bool isEmpty() const {return m_aValuePair.isEmpty();}
- bool isValid() const {return !m_aValuePair.isEmpty();}
-
- bool isNull() const {return m_aValuePair.isNull();}
- bool hasUsableDefault() const {return getAttributes().isNullable() || m_aValuePair.hasSecond();}
-
- uno::Type getValueType() const {return m_aValuePair.getValueType();}
- uno::Any getValue() const {return m_aValuePair.getValue( selectMember(this->isDefault()) );}
- uno::Any getUserValue() const {return m_aValuePair.getFirst();}
- uno::Any getDefault() const {return m_aValuePair.getSecond();}
-
- bool setValueType(uno::Type const& _aType);
- bool setValue(uno::Any const& _aValue);
- void setDefault();
-
- bool changeDefault(uno::Any const& _aValue);
- void promoteToDefault();
-
- virtual std::auto_ptr<INode> clone() const;
-
- ValueNode* asValueNode();
- ValueNode const* asValueNode() const;
- // double dispatch support
- virtual void dispatch(NodeAction& anAction) const { anAction.handle(*this); }
- virtual void dispatch(NodeModification& anAction) { anAction.handle(*this); }
-
- private:
- static AnyPair::SelectMember selectValue() { return AnyPair::SELECT_FIRST; }
- static AnyPair::SelectMember selectDeflt() { return AnyPair::SELECT_SECOND; }
- static AnyPair::SelectMember selectMember(bool bDeflt)
- { return bDeflt ? AnyPair::SELECT_SECOND : AnyPair::SELECT_FIRST; }
- };
- //==========================================================================
-
- extern bool isLocalizedValueSet(ISubtree const& _aSubtree);
-
- //==========================================================================
- //= inlines
- //==========================================================================
- inline void NodeAction::applyToNode(INode const& aNode)
- { aNode.dispatch(*this); }
- inline void NodeAction::applyToChildren(ISubtree const& aSubtree)
- { aSubtree.forEachChild(*this); }
-
- inline void NodeModification::applyToNode(INode& aNode)
- { aNode.dispatch(*this); }
- inline void NodeModification::applyToChildren(ISubtree& aSubtree)
- { aSubtree.forEachChild(*this); }
-
-
-} // namespace configmgr
-
-#endif
diff --git a/configmgr/source/inc/valueref.hxx b/configmgr/source/inc/valueref.hxx
deleted file mode 100644
index 75fce71bf2..0000000000
--- a/configmgr/source/inc/valueref.hxx
+++ /dev/null
@@ -1,132 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CONFIGVALUEREF_HXX_
-#define CONFIGMGR_CONFIGVALUEREF_HXX_
-
-#include "noderef.hxx"
-
-namespace configmgr
-{
- namespace node { struct Attributes; }
-
- namespace configuration
- {
- //-------------------------------------------------------------------------
- class Tree;
- //-------------------------------------------------------------------------
-
- /// represents a value node in some tree
- class ValueRef
- {
- public:
- /// constructs an empty (invalid) node
- ValueRef();
-
- ValueRef(rtl::OUString const& aName, unsigned int nParentPos);
-
- /// copy a node (with reference semantics)
- ValueRef(ValueRef const& rOther);
- /// copy a node (with reference semantics)
- ValueRef& operator=(ValueRef const& rOther);
-
- void swap(ValueRef& rOther);
-
- ~ValueRef();
-
- /// checks, if this represents an existing node
- inline bool isValid() const;
-
- bool checkValidState() const;
-
- rtl::OUString m_sNodeName;
- unsigned int m_nParentPos;
- };
- //-------------------------------------------------------------------------
-
- /** extract the value from a plain value
- */
- inline
- com::sun::star::uno::Any getSimpleValue(rtl::Reference< Tree > const& aTree, ValueRef const& aNode)
- { return aTree->getNodeValue( aNode ); }
-
- //-------------------------------------------------------------------------
- inline bool ValueRef::isValid() const
- {
- OSL_ASSERT( m_nParentPos == 0 || checkValidState() );
- return m_nParentPos != 0;
- }
-
- //-------------------------------------------------------------------------
-
- class SubNodeID
- {
- public:
- static SubNodeID createEmpty() { return SubNodeID(); }
- SubNodeID(rtl::Reference< Tree > const& rTree, NodeRef const& rParentNode, rtl::OUString const& aName);
- SubNodeID(NodeID const& rParentNodeID, rtl::OUString const& aName);
-
- // comparison
- // equality
- friend bool operator==(SubNodeID const& lhs, SubNodeID const& rhs)
- { return lhs.m_aParentID == rhs.m_aParentID && lhs.m_sNodeName == rhs.m_sNodeName; }
- // ordering
- friend bool operator < (SubNodeID const& lhs, SubNodeID const& rhs);
- // checking
- bool isValidNode() const;
- // hashing
- size_t hashCode() const { return m_aParentID.hashCode() + 5*m_sNodeName.hashCode(); }
- // containing node this
- NodeID getParentID() const { return m_aParentID; }
- // containing node this
- rtl::OUString getNodeName() const { return m_sNodeName; }
- private:
- SubNodeID(); // create an empty one
- rtl::OUString m_sNodeName;
- NodeID m_aParentID;
- };
- //-------------------------------------------------------------------------
-
- void getAllChildrenHelper(NodeID const& aNode, std::vector<SubNodeID>& aList);
-
- //-------------------------------------------------------------------------
- inline bool operator!=(SubNodeID const& lhs, SubNodeID const& rhs)
- { return !(lhs == rhs); }
- //---------------------------------------------------------------------
-
- inline bool operator>=(SubNodeID const& lhs, SubNodeID const& rhs)
- { return !(lhs < rhs); }
- //---------------------------------------------------------------------
- inline bool operator > (SubNodeID const& lhs, SubNodeID const& rhs)
- { return (rhs < lhs); }
- inline bool operator<=(SubNodeID const& lhs, SubNodeID const& rhs)
- { return !(rhs < lhs); }
- //-------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_CONFIGVALUENODE_HXX_
diff --git a/configmgr/source/inc/valuetypeconverter.hxx b/configmgr/source/inc/valuetypeconverter.hxx
deleted file mode 100644
index ce34e8995f..0000000000
--- a/configmgr/source/inc/valuetypeconverter.hxx
+++ /dev/null
@@ -1,155 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_VALUECONVERTER_HXX
-#define CONFIGMGR_VALUECONVERTER_HXX
-
-#include "utility.hxx"
-#include <com/sun/star/script/XTypeConverter.hpp>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/uno/Type.hxx>
-
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif
-
-namespace configmgr
-{
- namespace uno = ::com::sun::star::uno;
- namespace script = ::com::sun::star::script;
-
-// -----------------------------------------------------------------------------
- class ValueConverter
- {
- /// TypeConverter is used for converting type from string values
- uno::Reference< script::XTypeConverter > m_xTypeConverter;
- /// Value info
- uno::Type m_aType;
- rtl::OUString m_sSeparator;
- bool m_bNull;
- public:
- /// construct a value converter with no initial type info
- ValueConverter(const uno::Reference< script::XTypeConverter > & _xTC)
- : m_xTypeConverter(_xTC)
- , m_aType()
- {
- implReset();
- }
-
- /// construct a value converter with a type
- ValueConverter(uno::Type const& _aType, const uno::Reference< script::XTypeConverter > & _xTC)
- : m_xTypeConverter(_xTC)
- , m_aType(_aType)
- {
- implReset();
- }
-
- /// provide access to the TypeConverter that is used for converting string format
- uno::Reference< script::XTypeConverter > const& getTypeConverter() const SAL_THROW(())
- {
- return m_xTypeConverter;
- }
-
- /// (re)start the converter with the current type
- void restart()
- {
- implReset();
- }
-
- /// (re)start the converter with a new type info (or none)
- void reset(uno::Type const & _aType = uno::Type())
- {
- m_aType = _aType;
- implReset();
- }
-
- /// set the NULL state of this converter
- void setIsNull(bool bNull = true)
- {
- m_bNull = bNull;
- }
-
- /// set the separator of this converter
- void setSeparator(rtl::OUString const & _aSeparator)
- {
- m_sSeparator = _aSeparator;
- }
-
- /// get the (UNO) type
- bool isTypeSet() const { return m_aType.getTypeClass() != uno::TypeClass_VOID; }
-
- /// get the (UNO) type
- uno::Type getType() const { return m_aType; }
-
- /// is this marked null
- bool isNull() const { return m_bNull; }
-
- /// does this have a list type
- bool isList() const;
-
- /// does this have a separator set
- bool hasSeparator() const { return m_sSeparator.getLength() != 0; }
-
- /// converting a value
- uno::Any convertToAny(rtl::OUString const& aContent) const
- SAL_THROW((script::CannotConvertException , com::sun::star::uno::RuntimeException));
-
- /// converting a list
- uno::Any convertListToAny(uno::Sequence< rtl::OUString > const& aContentList) const
- SAL_THROW((script::CannotConvertException , com::sun::star::uno::RuntimeException));
-
- /// converting a binary value
- uno::Sequence<sal_Int8> parseBinary(rtl::OUString const& aBinaryString) const
- SAL_THROW((script::CannotConvertException , com::sun::star::uno::RuntimeException));
-
- /// splits a string list
- uno::Sequence< rtl::OUString > splitStringList(rtl::OUString const& aContent) const;
- private:
- /// converting a list
- bool convertListToAny(std::vector< rtl::OUString > const& aContentList, uno::Any& rValue) const
- SAL_THROW((script::CannotConvertException , com::sun::star::uno::RuntimeException));
-
- /// converting a scalar value
- bool convertScalarToAny(rtl::OUString const& aContent, uno::Any& rValue) const
- SAL_THROW((script::CannotConvertException , com::sun::star::uno::RuntimeException));
-
- /// splitting a string list
- void splitListData(rtl::OUString const& aContent, std::vector< rtl::OUString >& rContentList) const
- SAL_THROW(());
- private:
- void implReset() SAL_THROW(())
- {
- m_sSeparator = rtl::OUString();
- m_bNull = false;
- }
- };
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-} // namespace
-
-#endif
diff --git a/configmgr/source/inc/wrapexception.hxx b/configmgr/source/inc/wrapexception.hxx
deleted file mode 100644
index f775ee39c5..0000000000
--- a/configmgr/source/inc/wrapexception.hxx
+++ /dev/null
@@ -1,128 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_WRAPEXCEPTION_HXX
-#define CONFIGMGR_WRAPEXCEPTION_HXX
-
-#include <com/sun/star/configuration/MissingBootstrapFileException.hpp>
-#include <com/sun/star/configuration/InvalidBootstrapFileException.hpp>
-#include <com/sun/star/configuration/InstallationIncompleteException.hpp>
-#include <com/sun/star/configuration/CannotLoadConfigurationException.hpp>
-#include <com/sun/star/configuration/backend/BackendSetupException.hpp>
-#include <com/sun/star/configuration/backend/AuthenticationFailedException.hpp>
-#include <com/sun/star/configuration/backend/InvalidAuthenticationMechanismException.hpp>
-#include <com/sun/star/configuration/backend/CannotConnectException.hpp>
-#include <com/sun/star/configuration/backend/InsufficientAccessRightsException.hpp>
-
-#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
-#include <com/sun/star/configuration/backend/ConnectionLostException.hpp>
-#include <com/sun/star/configuration/backend/MalformedDataException.hpp>
-
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/lang/WrappedTargetException.hpp>
-#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
-#include <com/sun/star/xml/sax/SAXException.hpp>
-#include <com/sun/star/xml/sax/SAXParseException.hpp>
-
-#define WRAP_EXCEPTION( ETyp, Raise ) \
- catch (ETyp & _e_) { Raise( uno::makeAny(_e_) ); }
-
-#define WRAP_EXCEPTION1( ETyp, Raise, Arg ) \
- catch (ETyp & _e_) { Raise( uno::makeAny(_e_), (Arg) ); }
-
-#define PASS_EXCEPTION( ETyp ) \
- catch (ETyp & ) { throw; }
-
-#define WRAP_CONFIGBACKEND_CREATION_EXCEPTIONS( Raise ) \
- WRAP_EXCEPTION(::com::sun::star::configuration::backend::InsufficientAccessRightsException, Raise) \
- WRAP_EXCEPTION(::com::sun::star::configuration::backend::AuthenticationFailedException, Raise) \
- WRAP_EXCEPTION(::com::sun::star::configuration::backend::InvalidAuthenticationMechanismException, Raise) \
- WRAP_EXCEPTION(::com::sun::star::configuration::backend::CannotConnectException, Raise) \
- WRAP_EXCEPTION(::com::sun::star::configuration::backend::BackendSetupException, Raise) \
- WRAP_EXCEPTION(::com::sun::star::configuration::backend::BackendAccessException, Raise) \
- WRAP_EXCEPTION(::com::sun::star::configuration::MissingBootstrapFileException, Raise) \
- WRAP_EXCEPTION(::com::sun::star::configuration::InvalidBootstrapFileException, Raise) \
- WRAP_EXCEPTION(::com::sun::star::configuration::InstallationIncompleteException, Raise) \
- WRAP_EXCEPTION(::com::sun::star::configuration::CannotLoadConfigurationException, Raise) \
- WRAP_EXCEPTION(::com::sun::star::lang::WrappedTargetException, Raise) \
- WRAP_EXCEPTION(::com::sun::star::lang::WrappedTargetRuntimeException, Raise) \
- WRAP_EXCEPTION(::com::sun::star::lang::DisposedException, Raise) \
- WRAP_EXCEPTION(::com::sun::star::uno::RuntimeException, Raise) \
- WRAP_EXCEPTION(::com::sun::star::uno::Exception, Raise)
-
-#define WRAP_CONFIGBACKEND_EXCEPTIONS( Raise ) \
- WRAP_EXCEPTION(::com::sun::star::configuration::backend::InsufficientAccessRightsException, Raise) \
- WRAP_EXCEPTION(::com::sun::star::configuration::backend::ConnectionLostException, Raise) \
- WRAP_EXCEPTION(::com::sun::star::configuration::backend::BackendAccessException, Raise) \
-
-#define WRAP_CONFIGDATA_EXCEPTIONS( Raise ) \
- WRAP_EXCEPTION(::com::sun::star::configuration::backend::MalformedDataException, Raise) \
- WRAP_CONFIGBACKEND_EXCEPTIONS( Raise ) \
- WRAP_EXCEPTION(::com::sun::star::lang::WrappedTargetException, Raise) \
-
-#define WRAP_SAX_EXCEPTIONS( Raise ) \
- WRAP_EXCEPTION(::com::sun::star::xml::sax::SAXParseException, Raise) \
- WRAP_EXCEPTION(::com::sun::star::xml::sax::SAXException, Raise) \
-
-#define WRAP_OTHER_EXCEPTIONS( Raise ) \
- WRAP_EXCEPTION(::com::sun::star::uno::Exception, Raise)
-
-#define WRAP_CONFIGBACKEND_CREATION_EXCEPTIONS1( Raise, Arg ) \
- WRAP_EXCEPTION1(::com::sun::star::configuration::backend::InsufficientAccessRightsException, Raise, Arg) \
- WRAP_EXCEPTION1(::com::sun::star::configuration::backend::AuthenticationFailedException, Raise, Arg) \
- WRAP_EXCEPTION1(::com::sun::star::configuration::backend::InvalidAuthenticationMechanismException, Raise, Arg) \
- WRAP_EXCEPTION1(::com::sun::star::configuration::backend::CannotConnectException, Raise, Arg) \
- WRAP_EXCEPTION1(::com::sun::star::configuration::backend::BackendSetupException, Raise, Arg) \
- WRAP_EXCEPTION1(::com::sun::star::configuration::backend::BackendAccessException, Raise, Arg) \
- WRAP_EXCEPTION1(::com::sun::star::configuration::MissingBootstrapFileException, Raise, Arg) \
- WRAP_EXCEPTION1(::com::sun::star::configuration::InvalidBootstrapFileException, Raise, Arg) \
- WRAP_EXCEPTION1(::com::sun::star::configuration::InstallationIncompleteException, Raise, Arg) \
- WRAP_EXCEPTION1(::com::sun::star::configuration::CannotLoadConfigurationException, Raise, Arg) \
- WRAP_EXCEPTION1(::com::sun::star::lang::WrappedTargetException, Raise, Arg) \
- WRAP_EXCEPTION1(::com::sun::star::lang::WrappedTargetRuntimeException, Raise, Arg) \
- WRAP_EXCEPTION1(::com::sun::star::lang::DisposedException, Raise, Arg) \
- WRAP_EXCEPTION1(::com::sun::star::uno::RuntimeException, Raise, Arg) \
- WRAP_EXCEPTION1(::com::sun::star::uno::Exception, Raise, Arg)
-
-#define WRAP_CONFIGBACKEND_EXCEPTIONS1( Raise, Arg ) \
- WRAP_EXCEPTION1(::com::sun::star::configuration::backend::InsufficientAccessRightsException, Raise, Arg) \
- WRAP_EXCEPTION1(::com::sun::star::configuration::backend::ConnectionLostException, Raise, Arg) \
- WRAP_EXCEPTION1(::com::sun::star::configuration::backend::BackendAccessException, Raise, Arg) \
-
-#define WRAP_CONFIGDATA_EXCEPTIONS1( Raise, Arg ) \
- WRAP_EXCEPTION1(::com::sun::star::configuration::backend::MalformedDataException, Raise, Arg) \
- WRAP_CONFIGBACKEND_EXCEPTIONS1( Raise, Arg ) \
- WRAP_EXCEPTION1(::com::sun::star::lang::WrappedTargetException, Raise, Arg) \
-
-#define WRAP_SAX_EXCEPTIONS1( Raise, Arg ) \
- WRAP_EXCEPTION1(::com::sun::star::xml::sax::SAXParseException, Raise, Arg) \
- WRAP_EXCEPTION1(::com::sun::star::xml::sax::SAXException, Raise, Arg) \
-
-#define WRAP_OTHER_EXCEPTIONS1( Raise, Arg ) \
- WRAP_EXCEPTION1(::com::sun::star::uno::Exception, Raise, Arg)
-
-#endif // CONFIGMGR_WRAPEXCEPTION_HXX
diff --git a/configmgr/source/localbe/localdataimportsvc.cxx b/configmgr/source/localbe/localdataimportsvc.cxx
deleted file mode 100644
index 3b98fdb73c..0000000000
--- a/configmgr/source/localbe/localdataimportsvc.cxx
+++ /dev/null
@@ -1,357 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "localdataimportsvc.hxx"
-#include "localsinglebackend.hxx"
-
-#ifndef CONFIGMGR_API_FACTORY_HXX_
-#include "confapifactory.hxx"
-#endif
-#include <rtl/ustrbuf.hxx>
-#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
-#include <com/sun/star/configuration/backend/XLayerImporter.hpp>
-
-// -----------------------------------------------------------------------------
-#define OUSTRING( constascii ) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(constascii))
-// -----------------------------------------------------------------------------
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace localbe
- {
-// -----------------------------------------------------------------------------
- namespace backend = ::com::sun::star::configuration::backend;
-// -----------------------------------------------------------------------------
-
-sal_Char const * const aLocalDataImportServices[] =
-{
- "com.sun.star.configuration.backend.LocalDataImporter",
- 0,
- "com.sun.star.configuration.backend.DataImporter",
- 0
-};
-const ServiceImplementationInfo aLocalDataImportSI =
-{
- "com.sun.star.comp.configuration.backend.LocalDataImporter",
- aLocalDataImportServices,
- aLocalDataImportServices + 3
-};
-// -----------------------------------------------------------------------------
-
-const ServiceRegistrationInfo* getLocalDataImportServiceInfo()
-{ return getRegistrationInfo(& aLocalDataImportSI); }
-// -----------------------------------------------------------------------------
-
-inline
-ServiceInfoHelper LocalDataImportService::getServiceInfo()
-{
- return & aLocalDataImportSI;
-}
-// -----------------------------------------------------------------------------
-
-uno::Reference< uno::XInterface > SAL_CALL instantiateLocalDataImporter
-( uno::Reference< uno::XComponentContext > const& xContext )
-{
- return * new LocalDataImportService( xContext );
-}
-// -----------------------------------------------------------------------------
-
-LocalDataImportService::LocalDataImportService(uno::Reference< uno::XComponentContext > const & _xContext)
-: m_xServiceFactory(_xContext->getServiceManager(), uno::UNO_QUERY)
-{
- if (!m_xServiceFactory.is())
- {
- rtl::OUString sMessage = OUSTRING("Configuration Importer: Context has no service manager (or interface is missing)");
- throw lang::NullPointerException(sMessage,NULL);
- }
-}
-// -----------------------------------------------------------------------------
-
-LocalDataImportService::~LocalDataImportService()
-{}
-// -----------------------------------------------------------------------------
-
-namespace
-{
-// -----------------------------------------------------------------------------
- struct JobDesc
- {
- explicit JobDesc(task::XJob * pJob, const uno::Sequence< beans::NamedValue >& aArguments);
-
- rtl::OUString aLayerDataUrl;
- rtl::OUString aImporterService;
-
- rtl::OUString aComponent;
- rtl::OUString aEntity;
-
- uno::Reference< backend::XLayer > xLayerFilter;
-
- sal_Bool overwrite;
- sal_Bool truncate;
-
- sal_Bool use_component;
- sal_Bool use_entity;
- sal_Bool use_overwrite;
- sal_Bool use_truncate;
- };
- // -----------------------------------------------------------------------------
-
- JobDesc::JobDesc(task::XJob * pJob, const uno::Sequence< beans::NamedValue >& aArguments)
- : aLayerDataUrl()
- , aImporterService()
- , aComponent()
- , aEntity()
- , xLayerFilter()
- , overwrite(true)
- , truncate(false)
- , use_component(false)
- , use_entity(false)
- , use_overwrite(false)
- , use_truncate(false)
- {
- sal_Int16 const nCount = static_cast<sal_Int16>(aArguments.getLength());
-
- if (sal_Int32(nCount) != aArguments.getLength())
- {
- rtl::OUString sMessage = OUSTRING("Too many arguments for LocalDataImporter Job");
- throw lang::IllegalArgumentException(sMessage,pJob,0);
- }
-
- for (sal_Int16 i=0; i < nCount; ++i)
- {
- sal_Bool bKnown = false;
- sal_Bool bGood = false;
-
- if (aArguments[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("LayerDataUrl")))
- {
- bKnown = true;
- bGood = (aArguments[i].Value >>= aLayerDataUrl);
- }
- else if (aArguments[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ImporterService")))
- {
- bKnown = true;
- bGood = (aArguments[i].Value >>= aImporterService);
- }
- else if (aArguments[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Component")))
- {
- bKnown = true;
- bGood = (aArguments[i].Value >>= aComponent);
- use_component = bGood && (aComponent.getLength() != 0);
- }
- else if (aArguments[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Entity")))
- {
- bKnown = true;
- bGood = (aArguments[i].Value >>= aEntity);
- use_entity = bGood && (aEntity.getLength() != 0);
- }
- else if (aArguments[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("LayerFilter")))
- {
- bKnown = true;
- bGood = (aArguments[i].Value >>= xLayerFilter);
- if (xLayerFilter.is() && !uno::Reference<lang::XInitialization>::query(xLayerFilter).is())
- bGood = false;
- }
- else if (aArguments[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("OverwriteExisting")))
- {
- bKnown = true;
- bGood = (aArguments[i].Value >>= overwrite);
- use_overwrite = bGood;
- }
- else if (aArguments[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("TruncateExisting")))
- {
- bKnown = true;
- bGood = (aArguments[i].Value >>= truncate);
- use_truncate = bGood;
- }
-
- if (!bGood)
- {
- rtl::OUStringBuffer sMsg;
- sMsg.appendAscii("LocalDataImportService - Illegal argument: ");
- if (bKnown)
- sMsg.appendAscii("Wrong value type for argument '");
- else
- sMsg.appendAscii("Unknown argument '");
-
- sMsg.append(aArguments[i].Name).appendAscii("'.");
-
- throw lang::IllegalArgumentException(sMsg.makeStringAndClear(),pJob,i+1);
- }
- }
- if (aLayerDataUrl.getLength() == 0)
- {
- rtl::OUStringBuffer sMsg;
- sMsg.appendAscii("LocalDataImportService - Missing argument: ");
- sMsg.appendAscii("No data URL available");
- throw lang::IllegalArgumentException(sMsg.makeStringAndClear(),pJob,0);
- }
- if (aImporterService.getLength() == 0)
- {
- if ( (use_truncate && truncate) || (use_overwrite && !overwrite) )
- aImporterService = OUSTRING("com.sun.star.configuration.backend.CopyImporter");
- else
- aImporterService = OUSTRING("com.sun.star.configuration.backend.MergeImporter");
- }
- }
- // -----------------------------------------------------------------------------
-
- static
- inline
- uno::Type getOverwriteFailedExceptionType()
- {
- lang::IllegalAccessException const * const selected = 0;
- return ::getCppuType(selected);
- }
-// -----------------------------------------------------------------------------
-}
-// -----------------------------------------------------------------------------
-// XJob
-
-uno::Any SAL_CALL
- LocalDataImportService::execute( const uno::Sequence< beans::NamedValue >& Arguments )
- throw (lang::IllegalArgumentException, uno::Exception, uno::RuntimeException)
-{
- JobDesc const aJob(this,Arguments);
-
- uno::Reference< lang::XMultiServiceFactory > aFactory = this->getServiceFactory();
-
- uno::Reference< backend::XLayer > xLayer = aJob.use_component ?
- LocalSingleBackend::createSimpleLayer(aFactory,aJob.aLayerDataUrl, aJob.aComponent ):
- LocalSingleBackend::createSimpleLayer(aFactory,aJob.aLayerDataUrl) ;
-
- if (!xLayer.is())
- {
- rtl::OUString sMessage = OUSTRING("LocalDataImportService - Cannot create layer to import from");
- throw lang::NullPointerException(sMessage,*this);
- }
-
- uno::Reference< lang::XInitialization > xFilterInit(aJob.xLayerFilter,uno::UNO_QUERY);
- if (xFilterInit.is())
- {
- beans::NamedValue argvalue(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Source") ),
- uno::makeAny( xLayer) );
-
- uno::Sequence< uno::Any > args(1);
- args[0] <<= argvalue;
-
- xFilterInit->initialize(args);
-
- xLayer = aJob.xLayerFilter;
- }
-
- uno::Reference< backend::XLayerImporter > xImporter;
-
- int nArgCount = 0;
- if (aJob.use_overwrite) ++nArgCount;
- if (aJob.use_truncate) ++nArgCount;
-
- if (nArgCount)
- {
- uno::Sequence< uno::Any > aArgs(nArgCount);
-
- int n = 0;
- if (aJob.use_overwrite)
- aArgs[n++] <<= beans::NamedValue(OUSTRING("Overwrite"), uno::makeAny(aJob.overwrite));
-
- if (aJob.use_truncate)
- aArgs[n++] <<= beans::NamedValue(OUSTRING("Truncate"), uno::makeAny(aJob.truncate));
-
- OSL_ASSERT(n == nArgCount);
-
- xImporter.set( aFactory->createInstanceWithArguments(aJob.aImporterService,aArgs), uno::UNO_QUERY);
- }
- else
- xImporter.set( aFactory->createInstance(aJob.aImporterService), uno::UNO_QUERY);
-
- if (!xImporter.is())
- {
- rtl::OUString sMessage = OUSTRING("LocalDataImportService - Cannot create importer service: ") + aJob.aImporterService;
- throw lang::NullPointerException(sMessage,*this);
- }
-
- try
- {
- if (aJob.use_entity)
- xImporter->importLayerForEntity(xLayer,aJob.aEntity);
-
- else
- xImporter->importLayer(xLayer);
- }
- catch (lang::WrappedTargetException & e)
- {
- if (aJob.overwrite || !e.TargetException.isExtractableTo(getOverwriteFailedExceptionType())) throw;
- return e.TargetException;
- }
- catch (lang::WrappedTargetRuntimeException & e)
- {
- if (aJob.overwrite || !e.TargetException.isExtractableTo(getOverwriteFailedExceptionType())) throw;
- return e.TargetException;
- }
-
- return uno::Any();
-}
-// -----------------------------------------------------------------------------
-
-// XServiceInfo
-
-rtl::OUString SAL_CALL
- LocalDataImportService::getImplementationName( )
- throw (uno::RuntimeException)
-{
- return getServiceInfo().getImplementationName( );
-}
-// -----------------------------------------------------------------------------
-
-
-sal_Bool SAL_CALL
- LocalDataImportService::supportsService( const rtl::OUString& ServiceName )
- throw (uno::RuntimeException)
-{
- return getServiceInfo().supportsService( ServiceName );
-}
-// -----------------------------------------------------------------------------
-
-
-uno::Sequence< ::rtl::OUString > SAL_CALL
- LocalDataImportService::getSupportedServiceNames( )
- throw (uno::RuntimeException)
-{
- return getServiceInfo().getSupportedServiceNames( );
-}
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace
-
-// -----------------------------------------------------------------------------
-} // namespace
-
diff --git a/configmgr/source/localbe/localdataimportsvc.hxx b/configmgr/source/localbe/localdataimportsvc.hxx
deleted file mode 100644
index 4a087f61ba..0000000000
--- a/configmgr/source/localbe/localdataimportsvc.hxx
+++ /dev/null
@@ -1,98 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_LOCALBE_IMPORTSVC_HXX
-#define CONFIGMGR_LOCALBE_IMPORTSVC_HXX
-
-#include "serviceinfohelper.hxx"
-#include <cppuhelper/implbase2.hxx>
-#include <osl/mutex.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/task/XJob.hpp>
-
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace localbe
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace task = ::com::sun::star::task;
- namespace beans = ::com::sun::star::beans;
-// -----------------------------------------------------------------------------
-
- class LocalDataImportService : public ::cppu::WeakImplHelper2<
- task::XJob,
- lang::XServiceInfo
- >
- {
- public:
- explicit
- LocalDataImportService(uno::Reference< uno::XComponentContext > const & _xContext);
- ~LocalDataImportService();
-
- // XServiceInfo
- virtual rtl::OUString SAL_CALL
- getImplementationName( )
- throw (uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- supportsService( const rtl::OUString& ServiceName )
- throw (uno::RuntimeException);
-
- virtual uno::Sequence< rtl::OUString > SAL_CALL
- getSupportedServiceNames( )
- throw (uno::RuntimeException);
-
- // XJob
- virtual uno::Any SAL_CALL
- execute( const uno::Sequence< beans::NamedValue >& Arguments )
- throw (lang::IllegalArgumentException, uno::Exception, uno::RuntimeException);
-
- protected:
- uno::Reference< lang::XMultiServiceFactory > getServiceFactory() const
- { return m_xServiceFactory; }
-
- private:
- uno::Reference< lang::XMultiServiceFactory > m_xServiceFactory;
-
- static ServiceInfoHelper getServiceInfo();
- };
-// -----------------------------------------------------------------------------
- } // namespace xml
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/localbe/localfilehelper.cxx b/configmgr/source/localbe/localfilehelper.cxx
deleted file mode 100644
index a6a9b009f8..0000000000
--- a/configmgr/source/localbe/localfilehelper.cxx
+++ /dev/null
@@ -1,242 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include "localfilehelper.hxx"
-#include "filehelper.hxx"
-#include <rtl/ustrbuf.hxx>
-#include "tools/getprocessworkingdir.hxx"
-#include <vector>
-
-namespace configmgr
-{
- namespace localbe
- {
- //------------------------------------------------------------------------------
- bool isValidFileURL (rtl::OUString const& _sFileURL)
- {
- rtl::OUString sSystemPath;
- return _sFileURL.getLength() && (osl::File::E_None == osl::File::getSystemPathFromFileURL(_sFileURL, sSystemPath));
- }
- //------------------------------------------------------------------------------
- void validateFileURL(const rtl::OUString& _sFileURL, const uno::Reference<uno::XInterface>& pContext)
- throw(css::configuration::InvalidBootstrapFileException)
- {
- if (!isValidFileURL( _sFileURL))
- {
- rtl::OUStringBuffer sMsg;
- sMsg.appendAscii(" Not a Valid File URL: \"");
- sMsg.append(_sFileURL);
- sMsg.appendAscii("\"");
- throw com::sun::star::configuration::InvalidBootstrapFileException(
- sMsg.makeStringAndClear(),pContext, rtl::OUString() ) ;
- }
- }
- //------------------------------------------------------------------------------
- void checkFileExists(const rtl::OUString& _sFileURL,const uno::Reference<uno::XInterface>& pContext)
- throw (backend::CannotConnectException)
- {
- if (!FileHelper::fileExists(_sFileURL))
- {
- rtl::OUStringBuffer sMsg;
- sMsg.appendAscii(" No Such File or Directory: \"");
- sMsg.append(_sFileURL);
- sMsg.appendAscii("\"");
-
- throw backend::CannotConnectException(sMsg.makeStringAndClear(), pContext, uno::Any()) ;
- }
- }
- //------------------------------------------------------------------------------
- void checkIfDirectory(const rtl::OUString& _sFileURL, const uno::Reference<uno::XInterface>& pContext)
- throw (backend::BackendSetupException)
- {
- if (!FileHelper::dirExists(_sFileURL))
- {
- rtl::OUStringBuffer sMsg;
- sMsg.appendAscii(" File:\"");
- sMsg.append(_sFileURL);
- sMsg.appendAscii("\" Must be a Directory\"");
-
- throw backend::BackendSetupException(sMsg.makeStringAndClear(),pContext, uno::Any()) ;
- }
- }
-
- // ---------------------------------------------------------------------------------------
- bool implEnsureAbsoluteURL(rtl::OUString & _rsURL) // also strips embedded dots etc.
- {
- rtl::OUString sBasePath;
- OSL_VERIFY(tools::getProcessWorkingDir(&sBasePath));
-
- rtl::OUString sAbsolute;
- if ( osl::File::E_None == osl::File::getAbsoluteFileURL(sBasePath, _rsURL, sAbsolute))
- {
- _rsURL = sAbsolute;
- return true;
- }
- else
- {
- OSL_ENSURE(false, "Could not get absolute file URL for valid URL");
- return false;
- }
- }
- // ---------------------------------------------------------------------------------------
- osl::DirectoryItem::RC implNormalizeURL(rtl::OUString & _sURL, osl::DirectoryItem& aDirItem)
- {
- OSL_PRECOND(aDirItem.is(), "Opened DirItem required");
-
- static const sal_uInt32 cFileStatusMask = FileStatusMask_FileURL;
-
- osl::FileStatus aFileStatus(cFileStatusMask);
-
- osl::DirectoryItem::RC rc = aDirItem.getFileStatus(aFileStatus);
-
- if (rc == osl::DirectoryItem::E_None)
- {
- rtl::OUString aNormalizedURL = aFileStatus.getFileURL();
-
- if (aNormalizedURL.getLength() != 0)
- _sURL = aNormalizedURL;
- else
- rc = osl::DirectoryItem::E_INVAL;
- }
- return rc;
- }
-
- // ---------------------------------------------------------------------------------------
-
- bool normalizeURL(rtl::OUString & _sURL, const uno::Reference<uno::XInterface>& pContext, bool bNothrow )
- throw (backend::InsufficientAccessRightsException, backend::BackendAccessException)
- {
- if (_sURL.getLength() == 0)
- return false;
-
- osl::DirectoryItem aDirItem;
-
- osl::DirectoryItem::RC rc = osl::DirectoryItem::get(_sURL, aDirItem);
-
- if (rc == osl::DirectoryItem::E_None)
- rc = implNormalizeURL(_sURL,aDirItem);
-
- switch (rc)
- {
- case osl::DirectoryItem::E_None: return true;
-
- case osl::DirectoryItem::E_NOENT: return true;
-
- case osl::DirectoryItem::E_ACCES:
- if (!bNothrow)
- {
- rtl::OUStringBuffer msg;
- msg.appendAscii("LocalBackend: Cannot normalize URL \"" );
- msg.append(_sURL);
- msg.appendAscii("\" - InsufficientAccess");
- throw backend::InsufficientAccessRightsException(msg.makeStringAndClear(),pContext,uno::Any());
- }
- return false;
-
- default:
- if (!bNothrow)
- {
- rtl::OUStringBuffer msg;
- msg.appendAscii("LocalBackend: Cannot normalize URL \"" );
- msg.append(_sURL);
- msg.appendAscii("\" - ").append(FileHelper::createOSLErrorString(rc));
- throw backend::BackendAccessException(msg.makeStringAndClear(),pContext,uno::Any());
- }
- return false;
-
- }
- }
-
- // ---------------------------------------------------------------------------------------
- static const sal_Unicode kComponentSeparator = '.' ;
- static const sal_Unicode kPathSeparator = '/' ;
-
- rtl::OUString componentToPath(const rtl::OUString& aComponent)
- {
- rtl::OUStringBuffer retCode ;
-
- retCode.append(kPathSeparator) ;
- retCode.append(aComponent.replace(kComponentSeparator, kPathSeparator)) ;
- return retCode.makeStringAndClear() ;
- }
- //------------------------------------------------------------------------------
- rtl::OUString layeridToPath(const rtl::OUString& aLayerId)
- {
- sal_Int32 const nSplit = aLayerId.indexOf(k_cLayerIdSeparator);
- if (nSplit < 0)
- return componentToPath(aLayerId);
-
- rtl::OUString const aComponent= aLayerId.copy(0,nSplit);
- rtl::OUString const aSubid = aLayerId.copy(nSplit+1);
-
- rtl::OUStringBuffer retCode ;
-
- retCode.append(kPathSeparator) ;
- retCode.append(aComponent.replace(kComponentSeparator, kPathSeparator)) ;
- retCode.append(kPathSeparator) ;
- retCode.append(aSubid) ;
- return retCode.makeStringAndClear() ;
- }
- //------------------------------------------------------------------------------
- bool checkOptionalArg(rtl::OUString& aArg)
- {
- if (aArg.getLength() && aArg[0] == sal_Unicode('?'))
- {
- aArg = aArg.copy(1);
- return true;
- }
- else
- {
- return false;
- }
- }
- //------------------------------------------------------------------------------
- void fillFromBlankSeparated(const rtl::OUString& aList,
- uno::Sequence<rtl::OUString>& aTarget)
- {
- std::vector<rtl::OUString> tokens ;
- sal_Int32 nextToken = 0 ;
-
- do {
- tokens.push_back(aList.getToken(0, ' ', nextToken)) ;
- } while (nextToken >= 0) ;
- if (tokens.size() > 0) {
- aTarget.realloc(tokens.size()) ;
- std::vector<rtl::OUString>::const_iterator token ;
- sal_Int32 i = 0 ;
-
- for (token = tokens.begin() ; token != tokens.end() ; ++ token) {
- aTarget [i ++] = *token ;
- }
- }
- }
- //------------------------------------------------------------------------------
- }
-} // namespace configmgr
diff --git a/configmgr/source/localbe/localfilehelper.hxx b/configmgr/source/localbe/localfilehelper.hxx
deleted file mode 100644
index f042150933..0000000000
--- a/configmgr/source/localbe/localfilehelper.hxx
+++ /dev/null
@@ -1,124 +0,0 @@
-#ifndef CONFIGMGR_LOCALBE_LOCALFILEHELPER_HXX_
-#define CONFIGMGR_LOCALBE_LOCALFILEHELPER_HXX_
-
-#include <com/sun/star/configuration/InvalidBootstrapFileException.hpp>
-#include <com/sun/star/configuration/backend/CannotConnectException.hpp>
-#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
-#include <com/sun/star/configuration/backend/InsufficientAccessRightsException.hpp>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <osl/file.hxx>
-
-
-namespace configmgr
-{
-
- namespace localbe
- {
- namespace css = com::sun::star ;
- namespace uno = css::uno ;
- namespace backend = css::configuration::backend ;
-
- /**
- Validates a file URL
-
- @param _sFileURL URL of the file to validate
- @return bool true if URL valid, false if URL invalid
- */
-
- bool isValidFileURL (rtl::OUString const& _sFileURL);
- /**
- Ensures Absolute URL
- @param _sFileURL URL of the file to validate
- @return bool true if URL is absolute URL,
- false if URL is not absolute URL
- */
-
- bool implEnsureAbsoluteURL(rtl::OUString & _sFileURL);
- /**
- Normalize URL
- @param _sFileURL URL of the file to validate
- @param aDirItem Directory Item
- @return RC error code
- */
-
- osl::DirectoryItem::RC implNormalizeURL(rtl::OUString & _sFileURL, osl::DirectoryItem& aDirItem);
- /**
- Normalize URL
- @param _sFileURL URL of the file to validate
- @param pContext pointer to context class
- @param bNothrow param indicating that exception should not be thrown
- @return bool true if URL is normalized URL
- false if URL is not normalized URL
- */
-
-
- bool normalizeURL(rtl::OUString & _sFileURL,
- const uno::Reference<uno::XInterface>& pContext,
- bool bNothrow = false )
- throw (backend::InsufficientAccessRightsException,
- backend::BackendAccessException);
-
- /**
- Validates a file URL
-
- @param _sFileURL URL of the file to validate
- @param pContext pointer to context class
- @throws css::configuration::InvalidBootstrapFileException
- */
- void validateFileURL(const rtl::OUString& _sFileURL,
- const uno::Reference<uno::XInterface>& pContext)
- throw(css::configuration::InvalidBootstrapFileException);
- /**
- Checks if a Directory exist for a given file URL
-
- @param _sFileURL URL of the file to validate
- @param pContext pointer to context class
- @throws backend::BackendSetupException
- */
- void checkIfDirectory(const rtl::OUString& _sFileURL,
- const uno::Reference<uno::XInterface>& pContext )
- throw (backend::BackendSetupException);
- /**
- Checks if a File exist for a given file URL
- @param pContext pointer to context class
- @param _sFileURL URL of the file to validate
- @throws backend::CannotConnectException
- */
- void checkFileExists(const rtl::OUString& _sFileURL,
- const uno::Reference<uno::XInterface>& pContext)
- throw (backend::CannotConnectException);
-
- /**
- Convert Component name to Path name
- @param aComponent Component name
- */
- rtl::OUString componentToPath(const rtl::OUString& aComponent);
-
- /// character that can be used to delimit a sub-id within a layerid
- const sal_Unicode k_cLayerIdSeparator = ':';
- /**
- Convert layer id to Path name
- Format of layer id is <component> [:<sub-id>]
- @param aLayerId layer id
- */
- rtl::OUString layeridToPath(const rtl::OUString& aLayerId);
-
-
- /**
- Checks if Arguement is Optional
- @param aArg Argument
- @return bool returns true is Argument is Optional, false otherwise
- */
- bool checkOptionalArg(rtl::OUString& aArg);
-
- /*
- parses sequence of strings from blank separated list
- @param aList blank separated list
- @param aTarget sequence of parsed strings
- */
- void fillFromBlankSeparated(const rtl::OUString& aList,
- uno::Sequence<rtl::OUString>& aTarget);
-
- }
-}
-#endif
diff --git a/configmgr/source/localbe/localfilelayer.cxx b/configmgr/source/localbe/localfilelayer.cxx
deleted file mode 100644
index 0f749bca6d..0000000000
--- a/configmgr/source/localbe/localfilelayer.cxx
+++ /dev/null
@@ -1,608 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include "localfilelayer.hxx"
-#include "localoutputstream.hxx"
-#include "oslstream.hxx"
-#include <rtl/ustrbuf.hxx>
-#include <com/sun/star/io/XActiveDataSource.hpp>
-#include <com/sun/star/io/XActiveDataSink.hpp>
-#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
-#include <com/sun/star/beans/PropertyAttribute.hpp>
-
-namespace configmgr { namespace localbe {
-
-//==============================================================================
-
-//------------------------------------------------------------------------------
-
-BasicLocalFileLayer::BasicLocalFileLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- const rtl::OUString& aComponentFile)
-: mFactory(xFactory)
-, mFileUrl(aComponentFile)
-{
- static const rtl::OUString kXMLLayerParser(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.backend.xml.LayerParser")) ;
-
- mLayerReader = uno::Reference<backend::XLayer>::query(
- mFactory->createInstance(kXMLLayerParser)) ;
-
-}
-//------------------------------------------------------------------------------
-
-SimpleLocalFileLayer::SimpleLocalFileLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- const rtl::OUString& aComponentFile)
-: BasicLocalFileLayer(xFactory,aComponentFile)
-{
-}
-//------------------------------------------------------------------------------
-
-SimpleLocalFileLayer::SimpleLocalFileLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- const rtl::OUString& aBaseDir,
- const rtl::OUString& aComponent)
-: BasicLocalFileLayer(xFactory,aBaseDir + aComponent)
-{
-}
-//------------------------------------------------------------------------------
-
-FlatLocalFileLayer::FlatLocalFileLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- const rtl::OUString& aBaseDir,
- const rtl::OUString& aComponent)
-: BasicLocalFileLayer(xFactory,aBaseDir + aComponent)
-, mLayerWriter( createLayerWriter() )
-{
-}
-//------------------------------------------------------------------------------
-
-BasicCompositeLocalFileLayer::BasicCompositeLocalFileLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- const rtl::OUString& aComponentFile)
-: BasicLocalFileLayer(xFactory,aComponentFile)
-{
-}
-//------------------------------------------------------------------------------
-
-CompositeLocalFileLayer::CompositeLocalFileLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- const rtl::OUString& aComponent,
- const std::vector<rtl::OUString>& aSublayerDirectories)
-: BasicCompositeLocalFileLayer(xFactory,rtl::OUString())
-{
- fillSubLayerLists(aSublayerDirectories, aComponent) ;
-}
-//------------------------------------------------------------------------------
-
-FullCompositeLocalFileLayer::FullCompositeLocalFileLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- const rtl::OUString& aBaseDir,
- const rtl::OUString& aComponent,
- const std::vector<rtl::OUString>& aSublayerDirectories)
-: BasicCompositeLocalFileLayer(xFactory,aBaseDir + aComponent)
-, mLayerWriter( createLayerWriter() )
-{
- fillSubLayerLists(aSublayerDirectories, aComponent) ;
-}
-//------------------------------------------------------------------------------
-
-BasicLocalFileLayer::~BasicLocalFileLayer() {}
-//------------------------------------------------------------------------------
-
-SimpleLocalFileLayer::~SimpleLocalFileLayer() {}
-//------------------------------------------------------------------------------
-
-FlatLocalFileLayer::~FlatLocalFileLayer() {}
-//------------------------------------------------------------------------------
-
-CompositeLocalFileLayer::~CompositeLocalFileLayer() {}
-//------------------------------------------------------------------------------
-
-FullCompositeLocalFileLayer::~FullCompositeLocalFileLayer() {}
-//------------------------------------------------------------------------------
-
-uno::Reference<backend::XLayerHandler> BasicLocalFileLayer::createLayerWriter()
-{
- static const rtl::OUString kXMLLayerWriter(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.backend.xml.LayerWriter")) ;
-
- uno::Reference< uno::XInterface > xWriter = mFactory->createInstance(kXMLLayerWriter);
-
- return uno::Reference<backend::XLayerHandler>(xWriter,uno::UNO_REF_QUERY_THROW) ;
-}
-//------------------------------------------------------------------------------
-
-static inline void readEmptyLayer(const uno::Reference<backend::XLayerHandler>& xHandler)
-{
- OSL_ASSERT(xHandler.is());
- xHandler->startLayer();
- xHandler->endLayer();
-}
-//------------------------------------------------------------------------------
-
-void BasicLocalFileLayer::readData(
- backend::XLayer * pContext,
- const uno::Reference<backend::XLayerHandler>& xHandler,
- const rtl::OUString& aFileUrl)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException)
-{
- if (!xHandler.is())
- {
- rtl::OUString const sMessage(RTL_CONSTASCII_USTRINGPARAM(
- "LocalFileLayer - Cannot readData: Handler is NULL."));
-
- throw lang::NullPointerException(sMessage,pContext);
- }
-
- osl::File blobFile(aFileUrl) ;
- osl::File::RC errorCode = blobFile.open(OpenFlag_Read) ;
-
- switch (errorCode)
- {
- case osl::File::E_None: // got it
- {
- uno::Reference<io::XActiveDataSink> xAS(mLayerReader, uno::UNO_QUERY_THROW);
-
- uno::Reference<io::XInputStream> xStream( new OSLInputStreamWrapper(blobFile) );
-
- xAS->setInputStream(xStream);
-
- mLayerReader->readData(xHandler) ;
- }
- break;
-
- case osl::File::E_NOENT: // no layer => empty layer
- readEmptyLayer(xHandler);
- break;
-
- default:
- {
- rtl::OUStringBuffer sMsg;
- sMsg.appendAscii("LocalFile Layer: Cannot open input file \"");
- sMsg.append(aFileUrl);
- sMsg.appendAscii("\" : ");
- sMsg.append(FileHelper::createOSLErrorString(errorCode));
-
- io::IOException ioe(sMsg.makeStringAndClear(),pContext);
-
- sMsg.appendAscii("LocalFileLayer - Cannot readData: ").append(ioe.Message);
- throw backend::BackendAccessException(sMsg.makeStringAndClear(),pContext,uno::makeAny(ioe));
- }
- }
-}
-//------------------------------------------------------------------------------
-
-void SAL_CALL SimpleLocalFileLayer::readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException)
-{
- BasicLocalFileLayer::readData(this,xHandler, getFileUrl()) ;
-}
-//------------------------------------------------------------------------------
-
-void SAL_CALL FlatLocalFileLayer::readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException)
-{
- BasicLocalFileLayer::readData(this,xHandler, getFileUrl() ) ;
-}
-//------------------------------------------------------------------------------
-
-void SAL_CALL CompositeLocalFileLayer::readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException)
-{
- if (!xHandler.is())
- {
- rtl::OUString const sMessage(RTL_CONSTASCII_USTRINGPARAM(
- "LocalFileLayer - Cannot readData: Handler is NULL."));
-
- throw lang::NullPointerException(sMessage,*this);
- }
-
- readEmptyLayer(xHandler) ;
-}
-//------------------------------------------------------------------------------
-
-void SAL_CALL FullCompositeLocalFileLayer::readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException)
-{
- BasicLocalFileLayer::readData(static_cast<backend::XCompositeLayer*>(this),xHandler, getFileUrl() ) ;
-}
-//------------------------------------------------------------------------------
-
-void SAL_CALL BasicCompositeLocalFileLayer::readSubLayerData(
- backend::XCompositeLayer * pContext,
- const uno::Reference<backend::XLayerHandler>& xHandler,
- const rtl::OUString& aSubLayerId)
- throw ( backend::MalformedDataException,
- lang::IllegalArgumentException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException)
-{
- if (!xHandler.is())
- {
- rtl::OUString const sMessage(RTL_CONSTASCII_USTRINGPARAM(
- "CompositeLocalFileLayer - Cannot readSubLayerData: Handler is NULL."));
-
- throw lang::NullPointerException(sMessage,pContext);
- }
-
- sal_Int32 i ;
-
- for (i = 0 ; i < mSubLayers.getLength() ; ++ i) {
- if (mSubLayers [i].equals(aSubLayerId)) { break ; }
- }
- if (i == mSubLayers.getLength())
- {
- rtl::OUStringBuffer message ;
-
- message.appendAscii("Sublayer Id '").append(aSubLayerId) ;
- message.appendAscii("' is unknown") ;
- throw lang::IllegalArgumentException(message.makeStringAndClear(),
- pContext, 2) ;
- }
- if (mSubLayerFiles[i].getLength() != 0)
- BasicLocalFileLayer::readData(pContext,xHandler, mSubLayerFiles [i]) ;
- else
- readEmptyLayer(xHandler);
-}
-//------------------------------------------------------------------------------
-
-void SAL_CALL CompositeLocalFileLayer::readSubLayerData(
- const uno::Reference<backend::XLayerHandler>& xHandler,
- const rtl::OUString& aSubLayerId)
- throw ( backend::MalformedDataException,
- lang::IllegalArgumentException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException)
-{
- return BasicCompositeLocalFileLayer::readSubLayerData(this,xHandler,aSubLayerId);
-}
-//------------------------------------------------------------------------------
-
-void SAL_CALL FullCompositeLocalFileLayer::readSubLayerData(
- const uno::Reference<backend::XLayerHandler>& xHandler,
- const rtl::OUString& aSubLayerId)
- throw ( backend::MalformedDataException,
- lang::IllegalArgumentException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException)
-{
- return BasicCompositeLocalFileLayer::readSubLayerData(this,xHandler,aSubLayerId);
-}
-//------------------------------------------------------------------------------
-
-void SAL_CALL FlatLocalFileLayer::replaceWith(
- const uno::Reference<backend::XLayer>& aNewLayer)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException)
-{
- if (!aNewLayer.is())
- {
- rtl::OUString const sMessage(RTL_CONSTASCII_USTRINGPARAM(
- "LocalFileLayer - Cannot replaceWith: Replacement layer is NULL."));
-
- throw lang::NullPointerException(sMessage,*this);
- }
- OSL_ENSURE( !uno::Reference<backend::XCompositeLayer>::query(aNewLayer).is(),
- "Warning: correct updates with composite layers are not implemented");
-
- uno::Reference<io::XActiveDataSource> xAS(mLayerWriter, uno::UNO_QUERY_THROW);
-
- LocalOutputStream * pStream = new LocalOutputStream(getFileUrl());
- uno::Reference<io::XOutputStream> xStream( pStream );
-
- xAS->setOutputStream(xStream);
-
- aNewLayer->readData(mLayerWriter) ;
-
- pStream->finishOutput();
-
- // clear the output stream
- xStream.clear();
- xAS->setOutputStream(xStream);
-}
-//------------------------------------------------------------------------------
-
-void SAL_CALL FullCompositeLocalFileLayer::replaceWith(
- const uno::Reference<backend::XLayer>& aNewLayer)
- throw (backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- if (!aNewLayer.is())
- {
- rtl::OUString const sMessage(RTL_CONSTASCII_USTRINGPARAM(
- "LocalFileLayer - Cannot replaceWith: Replacement layer is NULL."));
-
- throw lang::NullPointerException(sMessage,*this);
- }
- OSL_ENSURE( !uno::Reference<backend::XCompositeLayer>::query(aNewLayer).is(),
- "Warning: correct updates with composite layers are not implemented");
-
- uno::Reference<io::XActiveDataSource> xAS(mLayerWriter, uno::UNO_QUERY_THROW);
-
- LocalOutputStream * pStream = new LocalOutputStream(getFileUrl());
- uno::Reference<io::XOutputStream> xStream( pStream );
-
- xAS->setOutputStream(xStream);
-
- aNewLayer->readData(mLayerWriter) ;
-
- pStream->finishOutput();
-
- // clear the output stream
- xStream.clear();
- xAS->setOutputStream(xStream);
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString BasicLocalFileLayer::getTimestamp(const rtl::OUString& aFileUrl)
-{
- TimeValue timevalue = {0,0};
- sal_uInt64 aSize = FileHelper::getModifyStatus(aFileUrl,timevalue) ;
- oslDateTime fileStamp ;
- rtl::OUString retCode ;
-
- if (osl_getDateTimeFromTimeValue(&timevalue, &fileStamp))
- {
- // truncate to 32 bits
- unsigned long aLongSize = static_cast<sal_Int32>(aSize);
-
- sal_Char asciiStamp [50] ;
-
- sprintf(asciiStamp, "%04u%02u%02u%02u%02u%02uZ%010lu",
- unsigned(fileStamp.Year), unsigned(fileStamp.Month), unsigned(fileStamp.Day),
- unsigned(fileStamp.Hours), unsigned(fileStamp.Minutes), unsigned(fileStamp.Seconds),
- aLongSize) ;
- retCode = rtl::OUString::createFromAscii(asciiStamp) ;
- }
- return retCode ;
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString SimpleLocalFileLayer::getTimestamp()
- throw (uno::RuntimeException)
-{
- rtl::OUString sStamp = BasicLocalFileLayer::getTimestamp(getFileUrl());
-
- return sStamp;
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString FlatLocalFileLayer::getTimestamp()
- throw (uno::RuntimeException)
-{
- rtl::OUString sStamp = BasicLocalFileLayer::getTimestamp(getFileUrl());
-
- return sStamp;
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString FullCompositeLocalFileLayer::getTimestamp()
- throw (uno::RuntimeException)
-{
- rtl::OUString sStamp = BasicLocalFileLayer::getTimestamp(getFileUrl());
-#if 0 // thus far composite layers are only manipulated via the main layer
- for (std::vector<rtl::OUString>::const_iterator it = mSubLayerFiles.begin();
- it != mSubLayerFiles.end();
- ++it)
- {
- rtl::OUString sSublayerTime = BasicLocalFileLayer::getTimestamp(*it);
- if (sStamp < sSublayerTime)
- sStamp = sSublayerTime;
- }
-#endif
- return sStamp;
-}
-//------------------------------------------------------------------------------
-
-void BasicCompositeLocalFileLayer::fillSubLayerLists( const std::vector<rtl::OUString>& aSublayerDirectories,
- const rtl::OUString& aComponent)
-{
- std::vector<rtl::OUString>::size_type const nSublayerCount = aSublayerDirectories.size();
- mSubLayers.realloc(nSublayerCount);
- mSubLayerFiles.resize(nSublayerCount);
-
- for (std::vector<rtl::OUString>::size_type i = 0; i < nSublayerCount; ++i)
- {
- mSubLayers[i] = FileHelper::getFileName(aSublayerDirectories[i]);
-
- // Let's check whether the sublayer exists for the
- // particular component.
- rtl::OUString subLayerFile(aSublayerDirectories[i] + aComponent) ;
- if (FileHelper::fileExists(subLayerFile))
- {
- mSubLayerFiles[i] = subLayerFile;
- }
- else
- OSL_ASSERT(mSubLayerFiles[i].getLength() == 0);
- }
-}
-//------------------------------------------------------------------------------
-
-static bool findSubLayers(const rtl::OUString& aResDir,
- std::vector<rtl::OUString>& aSublayerDirectories)
-{
- if (aResDir.getLength() == 0) return false;
-
- // Extract the directory where the file is located
- osl::Directory directory(aResDir) ;
- if (directory.open() != osl::Directory::E_None) return false;
-
- osl::DirectoryItem item ;
- osl::FileStatus status(osl_FileStatus_Mask_Type |
- osl_FileStatus_Mask_FileURL) ;
-
- while (directory.getNextItem(item) == osl::Directory::E_None)
- {
- if (item.getFileStatus(status) == osl::Directory::E_None)
- {
- if (status.getFileType() == osl::FileStatus::Directory)
- {
- aSublayerDirectories.push_back(status.getFileURL()) ;
- }
- }
- }
- return !aSublayerDirectories.empty();
-}
-//------------------------------------------------------------------------------
-
-uno::Reference<backend::XLayer> createReadonlyLocalFileLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- const rtl::OUString& aBaseDir,
- const rtl::OUString& aComponent,
- const rtl::OUString& aResDir)
-{
- uno::Reference<backend::XLayer> xResult;
-
- std::vector<rtl::OUString> aSublayers;
- if (aBaseDir.getLength() == 0)
- {
- findSubLayers(aResDir,aSublayers);
- xResult.set( new CompositeLocalFileLayer(xFactory,aComponent,aSublayers) );
- }
- else if (findSubLayers(aResDir,aSublayers))
- {
- // there is no readonly full composite layer - take the updatable one
- backend::XCompositeLayer * pNewLayer =
- new FullCompositeLocalFileLayer(xFactory,aBaseDir,aComponent,aSublayers);
- xResult.set( pNewLayer );
- }
- else
- {
- xResult.set( new SimpleLocalFileLayer(xFactory,aBaseDir,aComponent) );
- }
- return xResult;
-}
-//------------------------------------------------------------------------------
-
-uno::Reference<backend::XUpdatableLayer> createUpdatableLocalFileLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- const rtl::OUString& aBaseDir,
- const rtl::OUString& aComponent,
- const rtl::OUString& aResDir)
-{
- uno::Reference<backend::XUpdatableLayer> xResult;
-
- std::vector<rtl::OUString> aSublayers;
- if (findSubLayers(aResDir,aSublayers))
- {
- xResult.set( new FullCompositeLocalFileLayer(xFactory,aBaseDir,aComponent,aSublayers) );
- }
- else if (aBaseDir.getLength() != 0)
- {
- xResult.set( new FlatLocalFileLayer(xFactory,aBaseDir,aComponent) );
- }
- else
- OSL_ENSURE(false,"WARNING: Trying to create an updatable ressource-only layer");
-
- return xResult;
-}
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-enum
-{
- LAYER_PROPERTY_URL = 1
-};
-
-#define PROPNAME( name ) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( name ) )
-#define PROPTYPE( type ) getCppuType( static_cast< type const *>( 0 ) )
-
-// cppu::OPropertySetHelper
-cppu::IPropertyArrayHelper * SAL_CALL LayerPropertyHelper::newInfoHelper()
-{
- com::sun::star::beans::Property properties[] =
- {
- com::sun::star::beans::Property(PROPNAME("URL"), LAYER_PROPERTY_URL, PROPTYPE(rtl::OUString), com::sun::star::beans::PropertyAttribute::READONLY)
- };
-
- return new cppu::OPropertyArrayHelper(properties, sizeof(properties)/sizeof(properties[0]));
-}
-
-#define MESSAGE( text ) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ERROR: Layer Properties: " text ) )
-
-void SAL_CALL LayerPropertyHelper::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const uno::Any& /*rValue*/ )
- throw (uno::Exception)
-{
- namespace beans = com::sun::star::beans;
-
- switch (nHandle)
- {
- case LAYER_PROPERTY_URL:
- OSL_ENSURE(false, "Error: trying to set a READONLY property");
- throw beans::PropertyVetoException(MESSAGE("Property 'URL' is read-only"),*this);
-
- default:
- OSL_ENSURE(false, "Error: trying to set an UNKNOWN property");
- throw beans::UnknownPropertyException(MESSAGE("Trying to set an unknown property"),*this);
- }
-}
-
-void SAL_CALL LayerPropertyHelper::getFastPropertyValue( uno::Any& rValue, sal_Int32 nHandle ) const
-{
- switch (nHandle)
- {
- case LAYER_PROPERTY_URL:
- rValue = uno::makeAny( this->getLayerUrl() );
- break;
-
- default:
- OSL_ENSURE(false, "Error: trying to get an UNKNOWN property");
- break;
- }
-}
-
-//------------------------------------------------------------------------------
-} } // configmgr.localbe
-
diff --git a/configmgr/source/localbe/localfilelayer.hxx b/configmgr/source/localbe/localfilelayer.hxx
deleted file mode 100644
index 25c01e64e4..0000000000
--- a/configmgr/source/localbe/localfilelayer.hxx
+++ /dev/null
@@ -1,492 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_LOCALBE_LOCALFILELAYER_HXX_
-#define CONFIGMGR_LOCALBE_LOCALFILELAYER_HXX_
-
-#include "propertysethelper.hxx"
-#include <com/sun/star/configuration/backend/XUpdatableLayer.hpp>
-#include <com/sun/star/configuration/backend/XCompositeLayer.hpp>
-#include <com/sun/star/util/XTimeStamped.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <cppuhelper/implbase3.hxx>
-#include <cppuhelper/implbase2.hxx>
-#include <cppuhelper/implbase1.hxx>
-
-#ifndef VECTOR_INCLUDED_
-#define VECTOR_INCLUDED_
-#include <vector>
-#endif // VECTOR_INCLUDED_
-
-namespace configmgr { namespace localbe {
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace util = css::util ;
-namespace backend = css::configuration::backend ;
-
-/**
- Basic Implementation of the readonly XLayer interfaces for a local file access.
- The read data is accessible through a canned implementation of an XML parser.
- The layer is defined by the URL of the file containing its contents.
- */
-class BasicLocalFileLayer
-{
-protected :
- /**
- Constructor providing the base directory and the
- file subpath describing the file to access.
- An optional resource directory provides the location
- of sublayers of the component.
-
- @param xFactory service factory used to access canned services
- @param aComponentFile path describing the component file
- */
- BasicLocalFileLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- const rtl::OUString& aComponentFile) ;
- /** Destructor */
- ~BasicLocalFileLayer() ;
-
-protected :
- /**
- Describes the contents of a particular file to a handler.
-
- @param xHandler handler to describe the data to
- @param aFileUrl URL of the file
- @throws com::sun::star::configuration::backend::MalformedDataException
- if the file contains invalid data.
- @throws com::sun::star::lang::NullPointerException
- if pContext is NULL.
- @throws com::sun::star::lang::WrappedTargetException
- if an error occurs while accessing the data.
- */
- void readData(backend::XLayer * pContext,
- const uno::Reference<backend::XLayerHandler>& xHandler,
- const rtl::OUString& aFileUrl)
- throw (backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, uno::RuntimeException);
-
- /**
- Returns an object that can be used to write a layer.
- */
- uno::Reference<backend::XLayerHandler> createLayerWriter();
-
-public:
- /**
- Returns a timestamp associated to a file defined by its URL.
-
- @param aFileUrl URL of the file
- @return timestamp
- */
- static rtl::OUString getTimestamp(const rtl::OUString& aFileUrl) ;
-
- rtl::OUString const & getFileUrl() const { return mFileUrl; };
-
-private :
- /** Service factory */
- uno::Reference<lang::XMultiServiceFactory> const mFactory ;
- /** URL of the file being accessed */
- rtl::OUString const mFileUrl ;
- /** XLayer implementation used for readData */
- uno::Reference<backend::XLayer> mLayerReader ;
-
-} ;
-
-// provides properties for file layers
-class LayerPropertyHelper : public apihelper::PropertySetHelper
-{
-protected:
- LayerPropertyHelper(){};
- virtual ~LayerPropertyHelper(){};
-
-protected:
- virtual rtl::OUString const & getLayerUrl() const = 0;
-
-protected:
- // cppu::OPropertySetHelper
- virtual cppu::IPropertyArrayHelper * SAL_CALL newInfoHelper();
-
- virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const uno::Any& rValue )
- throw (uno::Exception);
-
- using PropertySetHelper::getFastPropertyValue;
- virtual void SAL_CALL getFastPropertyValue( uno::Any& rValue, sal_Int32 nHandle ) const;
-
-};
-
-/**
- Implementation of the readonly XLayer interfaces for a local file access.
- The read data is accessible through a canned implementation of
- an XML parser.
- The layer is defined by the URL of the file containing its
- contents.
- */
-class SimpleLocalFileLayer : public BasicLocalFileLayer
- , public cppu::ImplInheritanceHelper2< LayerPropertyHelper,
- backend::XLayer,
- util::XTimeStamped>
-{
-public :
- /**
- Constructor providing the base directory and the
- file subpath describing the file to access.
- An optional resource directory provides the location
- of sublayers of the component.
-
- @param xFactory service factory used to access canned services
- @param aComponentFile URL describing the component file
- */
- SimpleLocalFileLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- const rtl::OUString& aComponentFile) ;
- /**
- Constructor providing the base directory and the
- file subpath describing the file to access.
- An optional resource directory provides the location
- of sublayers of the component.
-
- @param xFactory service factory used to access canned services
- @param aBaseDir base directory
- @param aComponent subpath describing the component file
- */
- SimpleLocalFileLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- const rtl::OUString& aBaseDir,
- const rtl::OUString& aComponent) ;
-
- /** Destructor */
- ~SimpleLocalFileLayer() ;
-
- // XLayer
- using BasicLocalFileLayer::readData;
- virtual void SAL_CALL readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw (backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, uno::RuntimeException);
-
- // XTimeStamped
- virtual rtl::OUString SAL_CALL getTimestamp()
- throw (uno::RuntimeException);
-
-protected:
- virtual rtl::OUString const & getLayerUrl() const
- { return getFileUrl(); }
-} ;
-
-/**
- Implementation of the XUpdatableLayer
- interface for a local file access.
- The read data is accessible through a canned implementation of
- an XML parser, and the write data is defined through a canned
- implementation of an XML writer.
- The layer is defined by the URL of the file containing its
- contents, and that file will be either read or updated by
- the access to the handlers.
- The timestamp is refreshed on each read operation only.
- */
-class FlatLocalFileLayer : public BasicLocalFileLayer
- , public cppu::ImplInheritanceHelper2< LayerPropertyHelper,
- backend::XUpdatableLayer,
- util::XTimeStamped>
-{
-public :
- /**
- Constructor providing the base directory and the
- file subpath describing the file to access.
-
- @param xFactory service factory used to access canned services
- @param aBaseDir base directory
- @param aComponent subpath describing the component file
- */
- FlatLocalFileLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- const rtl::OUString& aBaseDir,
- const rtl::OUString& aComponent) ;
- /** Destructor */
- ~FlatLocalFileLayer(void) ;
-
- // XLayer
- using BasicLocalFileLayer::readData;
- virtual void SAL_CALL readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw (backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, uno::RuntimeException);
-
- // XUpdatableLayer
- virtual void SAL_CALL replaceWith(
- const uno::Reference<backend::XLayer>& aNewLayer)
- throw (backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, uno::RuntimeException);
-
- // XTimeStamped
- virtual rtl::OUString SAL_CALL getTimestamp()
- throw (uno::RuntimeException);
-
-protected:
- virtual rtl::OUString const & getLayerUrl() const
- { return getFileUrl(); }
-
-private :
- /** XLayerHandler implementation for getWriteHandler */
- uno::Reference<backend::XLayerHandler> mLayerWriter ;
-
-} ;
-
-/**
- Implementation of the XCompositeLayer
- interface for a local file access.
- The read data is accessible through a canned implementation of
- an XML parser.
- The layer is defined by the URL of the file containing its
- contents, and that file will be either read or updated by
- the access to the handlers.
- The timestamp is refreshed on each read operation only.
- */
-class BasicCompositeLocalFileLayer : public BasicLocalFileLayer
-{
-protected:
- /**
- Constructor providing the base directory and the
- file subpath describing the file to access.
- An resource directory provides the location
- of sublayers of the component.
-
- @param xFactory service factory used to access canned services
- @param aComponent path describing the component file
- */
- BasicCompositeLocalFileLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- const rtl::OUString& aComponent) ;
-
- // XCompositeLayer helpers
- uno::Sequence<rtl::OUString> SAL_CALL listSubLayerIds()
- throw (lang::WrappedTargetException, uno::RuntimeException)
- { return mSubLayers ; }
-
- void SAL_CALL readSubLayerData(
- backend::XCompositeLayer * context,
- const uno::Reference<backend::XLayerHandler>& xHandler,
- const rtl::OUString& aSubLayerId)
- throw (backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, lang::IllegalArgumentException,
- uno::RuntimeException);
-
- /**
- Fills the list of available sublayers.
-
- @param aResDir resource directory containing potential sublayers
- @param aComponent component subpath
- */
- void fillSubLayerLists(const std::vector<rtl::OUString>& aSublayerDirectories,
- const rtl::OUString& aComponent) ;
-private :
- /** List of available sublayers... */
- uno::Sequence<rtl::OUString> mSubLayers ;
- /** .. and the corresponding file URLs. */
- std::vector<rtl::OUString> mSubLayerFiles ;
-
-};
-
-/**
- Implementation of the XCompositeLayer
- interface for a local file access.
- The read data is accessible through a canned implementation of
- an XML parser.
- The layer is defined by the URL of the file containing its
- contents, and that file will be either read or updated by
- the access to the handlers.
- The timestamp is refreshed on each read operation only.
- */
-class CompositeLocalFileLayer : public BasicCompositeLocalFileLayer
- , public cppu::WeakImplHelper1< backend::XCompositeLayer>
-{
-public :
- /**
- Constructor providing the base directory and the
- file subpath describing the file to access.
- An resource directory provides the location
- of sublayers of the component.
-
- @param xFactory service factory used to access canned services
- @param aBaseDir base directory
- @param aComponent subpath describing the component file
- @param aResDir resource directory, if empty it is
- assumed the layer does not have sublayers.
- */
- CompositeLocalFileLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- const rtl::OUString& aComponent,
- const std::vector<rtl::OUString>& aSublayerDirectories) ;
- /** Destructor */
- ~CompositeLocalFileLayer(void) ;
- // XLayer
- using BasicCompositeLocalFileLayer::readData;
- virtual void SAL_CALL readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw (backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, uno::RuntimeException);
-
- // XCompositeLayer
- virtual uno::Sequence<rtl::OUString> SAL_CALL listSubLayerIds()
- throw (lang::WrappedTargetException, uno::RuntimeException)
- { return BasicCompositeLocalFileLayer::listSubLayerIds() ; }
-
- using BasicCompositeLocalFileLayer::readSubLayerData;
- virtual void SAL_CALL readSubLayerData(
- const uno::Reference<backend::XLayerHandler>& xHandler,
- const rtl::OUString& aSubLayerId)
- throw (backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, lang::IllegalArgumentException,
- uno::RuntimeException);
-
-private :
- // not implemented: warn of attempts to use this here
- void getFileUrl() const;
-} ;
-/**
- Implementation of the XUpdatableLayer and XCompositeLayer
- interfaces for a local file access.
- The read data is accessible through a canned implementation of
- an XML parser, and the write data is defined through a canned
- implementation of an XML writer.
- The layer is defined by the URL of the file containing its
- contents, and that file will be either read or updated by
- the access to the handlers.
- The timestamp is refreshed on each read operation only.
- */
-class FullCompositeLocalFileLayer : public BasicCompositeLocalFileLayer
- , public cppu::ImplInheritanceHelper3<
- LayerPropertyHelper,
- backend::XUpdatableLayer,
- backend::XCompositeLayer,
- util::XTimeStamped>
-{
-public :
- /**
- Constructor providing the base directory and the
- file subpath describing the file to access.
- An resource directory provides the location
- of sublayers of the component.
-
- @param xFactory service factory used to access canned services
- @param aBaseDir base directory
- @param aComponent subpath describing the component file
- @param aResDir resource directory, if empty it is
- assumed the layer does not have sublayers.
- */
- FullCompositeLocalFileLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- const rtl::OUString& aBaseDir,
- const rtl::OUString& aComponent,
- const std::vector<rtl::OUString>& aSublayerDirectories) ;
- /** Destructor */
- ~FullCompositeLocalFileLayer(void) ;
- // XLayer
- using BasicCompositeLocalFileLayer::readData;
- virtual void SAL_CALL readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw (backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, uno::RuntimeException);
-
- // XUpdatableLayer
- virtual void SAL_CALL replaceWith(
- const uno::Reference<backend::XLayer>& aNewLayer)
- throw (backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, uno::RuntimeException);
-
- // XCompositeLayer
- virtual uno::Sequence<rtl::OUString> SAL_CALL listSubLayerIds()
- throw (lang::WrappedTargetException, uno::RuntimeException)
- { return BasicCompositeLocalFileLayer::listSubLayerIds() ; }
-
- using BasicCompositeLocalFileLayer::readSubLayerData;
- virtual void SAL_CALL readSubLayerData(
- const uno::Reference<backend::XLayerHandler>& xHandler,
- const rtl::OUString& aSubLayerId)
- throw (backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, lang::IllegalArgumentException,
- uno::RuntimeException);
-
- // XTimeStamped
- virtual rtl::OUString SAL_CALL getTimestamp()
- throw (uno::RuntimeException);
-
-protected:
- virtual rtl::OUString const & getLayerUrl() const
- { return getFileUrl(); }
-
-private :
- /** XLayerHandler implementation for getWriteHandler */
- uno::Reference<backend::XLayerHandler> mLayerWriter ;
-} ;
-/**
- Factory function to create the appropriate Flat- or Composite-
- LocalFileLayer for a set of parameters.
-
- Arguments provide the base directory and the
- file subpath describing the file to access.
- An optional resource directory provides the location
- of sublayers of the component.
-
- @param xFactory service factory used to access canned services
- @param aBaseDir base directory
- @param aComponent subpath describing the component file
- @param aResDir resource directory, if empty it is
- assumed the layer does not have sublayers.
- */
-uno::Reference<backend::XLayer> createReadonlyLocalFileLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- const rtl::OUString& aBaseDir,
- const rtl::OUString& aComponent,
- const rtl::OUString& aResDir) ;
-
-/**
- Factory function to create the appropriate Flat- or Composite-
- LocalFileLayer for a set of parameters.
-
- Arguments provide the base directory and the
- file subpath describing the file to access.
- An optional resource directory provides the location
- of sublayers of the component.
-
- @param xFactory service factory used to access canned services
- @param aBaseDir base directory
- @param aComponent subpath describing the component file
- @param aResDir resource directory, if empty it is
- assumed the layer does not have sublayers.
- */
-uno::Reference<backend::XUpdatableLayer> createUpdatableLocalFileLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- const rtl::OUString& aBaseDir,
- const rtl::OUString& aComponent,
- const rtl::OUString& aResDir) ;
-
-} } // configmgr.localbe
-
-#endif // CONFIGMGR_LOCALBE_LOCALFILELAYER_HXX_
diff --git a/configmgr/source/localbe/localhierarchybrowsersvc.cxx b/configmgr/source/localbe/localhierarchybrowsersvc.cxx
deleted file mode 100644
index 9a76285098..0000000000
--- a/configmgr/source/localbe/localhierarchybrowsersvc.cxx
+++ /dev/null
@@ -1,533 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "localhierarchybrowsersvc.hxx"
-#include "localsinglebackend.hxx"
-
-#ifndef CONFIGMGR_API_FACTORY_HXX_
-#include "confapifactory.hxx"
-#endif
-#include <com/sun/star/lang/NullPointerException.hpp>
-#include <rtl/ustrbuf.hxx>
-
-#include <algorithm>
-// -----------------------------------------------------------------------------
-
-#define OUSTRING( constascii ) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(constascii))
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace localbe
- {
-// -----------------------------------------------------------------------------
-
-sal_Char const * const aLocalHierarchyBrowserServices[] =
-{
- "com.sun.star.configuration.backend.LocalHierarchyBrowser",
- 0,
- "com.sun.star.configuration.backend.HierarchyBrowser",
- 0
-};
-const ServiceImplementationInfo aLocalHierarchyBrowserSI =
-{
- "com.sun.star.comp.configuration.backend.LocalHierarchyBrowser",
- aLocalHierarchyBrowserServices,
- aLocalHierarchyBrowserServices + 3
-};
-// -----------------------------------------------------------------------------
-
-const ServiceRegistrationInfo* getLocalHierarchyBrowserServiceInfo()
-{ return getRegistrationInfo(& aLocalHierarchyBrowserSI); }
-// -----------------------------------------------------------------------------
-
-inline
-ServiceInfoHelper LocalHierarchyBrowserService::getServiceInfo()
-{
- return & aLocalHierarchyBrowserSI;
-}
-// -----------------------------------------------------------------------------
-
-uno::Reference< uno::XInterface > SAL_CALL instantiateLocalHierarchyBrowser
-( uno::Reference< uno::XComponentContext > const& rServiceManager )
-{
- return * new LocalHierarchyBrowserService( rServiceManager );
-}
-// -----------------------------------------------------------------------------
-
-LocalHierarchyBrowserService::LocalHierarchyBrowserService(uno::Reference< uno::XComponentContext > const & _xContext)
-: m_xServiceFactory(_xContext->getServiceManager(), uno::UNO_QUERY)
-{
- if (!m_xServiceFactory.is())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration Importer: Unexpected NULL context"));
- throw lang::NullPointerException(sMessage,NULL);
- }
-}
-// -----------------------------------------------------------------------------
-
-LocalHierarchyBrowserService::~LocalHierarchyBrowserService()
-{}
-// -----------------------------------------------------------------------------
-
-namespace
-{
- struct JobDesc
- {
- explicit JobDesc(task::XJob * pJob, const uno::Sequence< beans::NamedValue >& aArguments);
-
- enum Mode { findNone, findSchemas, findLayers };
- enum Result { getDefault,getUrls, getNames };
-
- rtl::OUString aBaseDataUrl;
- uno::Sequence< rtl::OUString > aExcludeList;
- Mode mode;
- Result result_type;
- };
-
- JobDesc::JobDesc(task::XJob * pJob, const uno::Sequence< beans::NamedValue >& aArguments)
- : aBaseDataUrl()
- , aExcludeList()
- , mode(findNone)
- , result_type(getDefault)
- {
- sal_Int16 const nCount = static_cast<sal_Int16>(aArguments.getLength());
-
- if (sal_Int32(nCount) != aArguments.getLength())
- {
- rtl::OUString sMessage = OUSTRING("Too many arguments for LocalHierarchyBrowser Job");
- throw lang::IllegalArgumentException(sMessage,pJob,0);
- }
-
- for (sal_Int16 i=0; i < nCount; ++i)
- {
- sal_Bool bKnown = false;
- sal_Bool bGood = false;
-
- if (aArguments[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("SchemaDataUrl")))
- {
- bKnown = true;
- bGood = (aArguments[i].Value >>= aBaseDataUrl);
- mode = (bGood && aBaseDataUrl.getLength()) ? findSchemas : findNone;
- }
- else if (aArguments[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("LayerDataUrl")))
- {
- bKnown = true;
-
- rtl::OUString aLayerBaseUrl;
- bGood = (aArguments[i].Value >>= aLayerBaseUrl);
-
- if (aLayerBaseUrl.getLength())
- {
- rtl::OUString aLocalizedSubDir;
- LocalSingleBackend::getLayerSubDirectories(aLayerBaseUrl,this->aBaseDataUrl,aLocalizedSubDir);
-
- mode = findLayers;
- }
- else
- {
- mode = findNone;
- }
- }
- else if (aArguments[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ExcludeComponents")))
- {
- bKnown = true;
-
- sal_Int32 const nNextIndex = aExcludeList.getLength();
-
- switch (aArguments[i].Value.getValueTypeClass())
- {
- case uno::TypeClass_STRING:
- {
- rtl::OUString aComponent;
- bGood = (aArguments[i].Value >>= aComponent);
-
- OSL_ASSERT(bGood);
-
- aExcludeList.realloc(nNextIndex + 1);
- aExcludeList[nNextIndex] = aComponent;
- }
- break;
-
- case uno::TypeClass_SEQUENCE:
- {
- uno::Sequence<rtl::OUString> aComponentList;
- bGood = (aArguments[i].Value >>= aComponentList);
-
- if (bGood)
- {
- sal_Int32 const nCompListCount = aComponentList.getLength();
- aExcludeList.realloc(nNextIndex + nCompListCount);
-
- rtl::OUString const * pSrc = aComponentList.getConstArray();
- std::copy(pSrc,pSrc+nCompListCount,aExcludeList.getArray());
- }
- }
- break;
-
- default:
- OSL_ASSERT(!bGood);
- break;
- }
- }
- else if (aArguments[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("FetchComponentNames")))
- {
- sal_Bool bComponents = sal_False;
-
- bKnown = true;
- if (aArguments[i].Value.hasValue())
- {
- bGood = (aArguments[i].Value >>= bComponents);
- if (bGood) result_type = bComponents ? getNames : getUrls;
- }
- else
- {
- bGood = true;
- result_type = getDefault;
- }
- }
-
- if (!bGood)
- {
- rtl::OUStringBuffer sMsg;
- sMsg.appendAscii("LocalHierarchyBrowser - Illegal argument: ");
- if (bKnown)
- sMsg.appendAscii("Wrong value type for argument '");
- else
- sMsg.appendAscii("Unknown argument '");
-
- sMsg.append(aArguments[i].Name).appendAscii("'.");
-
- throw lang::IllegalArgumentException(sMsg.makeStringAndClear(),pJob,i+1);
- }
- }
- if (findNone == mode)
- {
- rtl::OUStringBuffer sMsg;
- sMsg.appendAscii("LocalHierarchyBrowser - Missing argument: ");
- sMsg.appendAscii("No data URL available");
- throw lang::IllegalArgumentException(sMsg.makeStringAndClear(),pJob,0);
- }
- if (getDefault == result_type)
- result_type = (mode == findSchemas) ? getNames : getUrls;
-
- }
-
- static
- inline
- rtl::OUString getDataFileExtension(JobDesc::Mode mode)
- {
- switch (mode)
- {
- case JobDesc::findSchemas: return OUSTRING(".xcs");
- case JobDesc::findLayers: return OUSTRING(".xcu");
- default: OSL_ASSERT(false); return rtl::OUString();
- }
- }
-}
-// -----------------------------------------------------------------------------
-
-// XJob
-
-uno::Any SAL_CALL
- LocalHierarchyBrowserService::execute( const uno::Sequence< beans::NamedValue >& Arguments )
- throw (lang::IllegalArgumentException, uno::Exception, uno::RuntimeException)
-{
- JobDesc const aJob(this,Arguments);
-
- OSL_ASSERT(JobDesc::getUrls == aJob.result_type || JobDesc::getNames == aJob.result_type);
-
- uno::Sequence< rtl::OUString > (LocalHierarchyBrowserService::* const find)( rtl::OUString const & _aBaseDirectory, rtl::OUString const & _aComponentFileExtension, uno::Sequence< rtl::OUString > const & aExcludeList) = (JobDesc::getUrls == aJob.result_type) ?
- &LocalHierarchyBrowserService::findLocalComponentUrls :
- &LocalHierarchyBrowserService::findLocalComponentNames;
-
- uno::Sequence< rtl::OUString > aComponents = (this->*find)(aJob.aBaseDataUrl,getDataFileExtension(aJob.mode), aJob.aExcludeList);
-
- return uno::makeAny(aComponents);
-}
-// -----------------------------------------------------------------------------
-
-// XServiceInfo
-
-rtl::OUString SAL_CALL
- LocalHierarchyBrowserService::getImplementationName( )
- throw (uno::RuntimeException)
-{
- return getServiceInfo().getImplementationName( );
-}
-// -----------------------------------------------------------------------------
-
-sal_Bool SAL_CALL
- LocalHierarchyBrowserService::supportsService( const rtl::OUString& ServiceName )
- throw (uno::RuntimeException)
-{
- return getServiceInfo().supportsService( ServiceName );
-}
-// -----------------------------------------------------------------------------
-
-
-uno::Sequence< ::rtl::OUString > SAL_CALL
- LocalHierarchyBrowserService::getSupportedServiceNames( )
- throw (uno::RuntimeException)
-{
- return getServiceInfo().getSupportedServiceNames( );
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace
-
-// -----------------------------------------------------------------------------
-} // namespace
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-#include "filehelper.hxx"
-#include <osl/file.hxx>
-#include "tools/getprocessworkingdir.hxx"
-#include <vector>
-// -----------------------------------------------------------------------------
-
- namespace uno = com::sun::star::uno;
- // -----------------------------------------------------------------------------
-
- #define OSL_VERIFY_RC( expr ) OSL_VERIFY( (expr) == osl::FileBase::E_None )
- //------------------------------------------------------------------------------
- static
- inline
- bool matchesExtension( rtl::OUString const & aFileName, rtl::OUString const & aExt )
- {
- sal_Int32 const nExtStart = aFileName.getLength() - aExt.getLength();
- return nExtStart > 0 && !!aFileName.copy(nExtStart).equalsIgnoreAsciiCase(aExt);
- }
- //------------------------------------------------------------------------------
- static
- inline
- rtl::OUString stripExtension( rtl::OUString const & aFileName, rtl::OUString const & aExt )
- {
- OSL_PRECOND( matchesExtension(aFileName,aExt), "File name doesn't have expected extension");
-
- sal_Int32 const nExtStart = aFileName.getLength() - aExt.getLength();
- return aFileName.copy(0,nExtStart);
- }
-//------------------------------------------------------------------------------
- static
- inline
- bool matchesExtension( osl::FileStatus const & aFileDescriptor, rtl::OUString const & aExt )
- {
- OSL_PRECOND( aFileDescriptor.isValid(FileStatusMask_Type | FileStatusMask_FileName),
- "Not all required file-status fields available for filter" );
-
- if (aFileDescriptor.getFileType() != osl::FileStatus::Regular)
- return false;
-
- return matchesExtension(aFileDescriptor.getFileName(),aExt);
- }
-//------------------------------------------------------------------------------
-
- static
- bool makeAbsoluteURL(rtl::OUString & rURL )
- {
- rtl::OUString aBaseDir; tools::getProcessWorkingDir(&aBaseDir);
-
- osl::File::RC errcode = osl::File::getAbsoluteFileURL(aBaseDir,rURL,rURL);
-
- return osl::File::E_None == errcode;
- }
-//------------------------------------------------------------------------------
- static
- inline
- bool getNextDirectoryItem(osl::Directory & aDirectory, osl::DirectoryItem & aItem, osl::Directory::RC & errcode)
- {
- switch (errcode = aDirectory.getNextItem(aItem))
- {
- case osl::Directory::E_None:
- return true;
-
- case osl::Directory::E_NOENT:
- errcode = osl::Directory::E_None;
- return false;
-
- default:
- return false;
- }
- }
-//------------------------------------------------------------------------------
- static inline bool isExcluded(rtl::OUString const & aName, uno::Sequence< rtl::OUString > const & aExcludeList)
- {
- for (sal_Int32 i = 0; i<aExcludeList.getLength(); ++i)
- {
- if (aExcludeList[i].equals(aName)) return true;
- }
- return false;
- }
-//------------------------------------------------------------------------------
- static
- osl::FileBase::RC findComponents( std::vector<rtl::OUString> * componentNames, std::vector<rtl::OUString> * componentUrls,
- rtl::OUString const& aDirectoryPath, rtl::OUString const& aComponentExtension,
- rtl::OUString const& aPackagePrefix, rtl::OUString const & aComponentSeparator,
- uno::Sequence< rtl::OUString > const & aExcludeList)
- {
- static sal_Unicode const chDirSep = '/';
- static rtl::OUString const sDirectorySeparator(&chDirSep,1);
-
- osl::Directory aDirectory(aDirectoryPath);
-
- osl::Directory::RC errcode = aDirectory.open();
-
- if (errcode == osl::Directory::E_None)
- {
- sal_uInt32 n_STATUS_FIELDS = FileStatusMask_Type | FileStatusMask_FileName;
- if (componentUrls) n_STATUS_FIELDS |= FileStatusMask_FileURL;
-
- osl::DirectoryItem aItem;
- while( getNextDirectoryItem(aDirectory,aItem,errcode) )
- {
-
- osl::FileStatus aItemDescriptor( n_STATUS_FIELDS );
- errcode = aItem.getFileStatus(aItemDescriptor);
-
- if ( errcode != osl::DirectoryItem::E_None )
- {
- OSL_TRACE("Locating Configuration Components - Error (%u) getting status of directory item - skipping\n", unsigned(errcode));
- continue;
- }
-
- OSL_ENSURE( aItemDescriptor.isValid(FileStatusMask_Type), "Could not get type of directory item");
-
- if (aItemDescriptor.getFileType() == osl::FileStatus::Directory)
- {
- OSL_ENSURE( aItemDescriptor.isValid(FileStatusMask_FileName), "Could not get name of subdirectory");
-
- rtl::OUString const aSubdirName = aItemDescriptor.getFileName();
- rtl::OUString const aSubdirPath = aDirectoryPath + sDirectorySeparator + aSubdirName;
- rtl::OUString const aSubpackagePrefix = aPackagePrefix + aSubdirName + aComponentSeparator;
- // recurse
- if (!isExcluded(aSubpackagePrefix,aExcludeList))
- OSL_VERIFY_RC( findComponents( componentNames, componentUrls,
- aSubdirPath, aComponentExtension,
- aSubpackagePrefix, aComponentSeparator,
- aExcludeList) );
- }
- else if (matchesExtension(aItemDescriptor,aComponentExtension))
- {
- OSL_ENSURE( aItemDescriptor.isValid(FileStatusMask_FileName), "Could not get name of component found");
-
- rtl::OUString const aComponentName = stripExtension( aItemDescriptor.getFileName(), aComponentExtension );
- rtl::OUString const aFullComponentName = aPackagePrefix + aComponentName;
-
- if (!isExcluded(aFullComponentName,aExcludeList))
- {
- if (componentNames)
- {
- componentNames->push_back(aFullComponentName);
- }
-
- if (componentUrls)
- {
- OSL_ENSURE( aItemDescriptor.isValid(FileStatusMask_FileURL), "Could not get URL of component found");
-
- componentUrls->push_back(aItemDescriptor.getFileURL());
- }
- }
- }
- }
- aDirectory.close();
- }
- return errcode;
- }
-// -----------------------------------------------------------------------------
-
- uno::Sequence< rtl::OUString > configmgr::localbe::LocalHierarchyBrowserService::findLocalComponentNames( rtl::OUString const & _aBaseDirectory, rtl::OUString const & _aComponentFileExtension, uno::Sequence< rtl::OUString > const & aExcludeList)
- {
- rtl::OUString aBaseDirectory(_aBaseDirectory);
- OSL_VERIFY( makeAbsoluteURL(aBaseDirectory) );
-
- static const sal_Unicode chPkgSep = '.';
-
- std::vector< rtl::OUString > components;
-
- osl::Directory::RC errcode = findComponents(&components, NULL,
- aBaseDirectory, _aComponentFileExtension,
- rtl::OUString(), rtl::OUString(&chPkgSep,1),
- aExcludeList );
-
- if (errcode != osl::Directory::E_None)
- {
- OSL_TRACE("Locating Configuration Components failed - Error (%u) trying to locate files\n", unsigned(errcode));
-
- if (errcode != osl::Directory::E_NOENT)
- {
- rtl::OUString sMsg = OUSTRING("LocalHierarchyBrowser - IO Error while scanning for components: ") +
- FileHelper::createOSLErrorString(errcode);
-
- throw com::sun::star::io::IOException(sMsg,*this);
- }
- }
-
- return uno::Sequence< rtl::OUString >(&components.front(),components.size());
- }
-// -----------------------------------------------------------------------------
-
- uno::Sequence< rtl::OUString > configmgr::localbe::LocalHierarchyBrowserService::findLocalComponentUrls( rtl::OUString const & _aBaseDirectory, rtl::OUString const & _aComponentFileExtension, uno::Sequence< rtl::OUString > const & aExcludeList)
- {
- rtl::OUString aBaseDirectory(_aBaseDirectory);
- OSL_VERIFY( makeAbsoluteURL(aBaseDirectory) );
-
- static const sal_Unicode chPkgSep = '.';
-
- std::vector< rtl::OUString > components;
-
- osl::Directory::RC errcode = findComponents(NULL, &components,
- aBaseDirectory, _aComponentFileExtension,
- rtl::OUString(), rtl::OUString(&chPkgSep,1),
- aExcludeList );
-
- if (errcode != osl::Directory::E_None)
- {
- OSL_TRACE("Locating Configuration Components failed - Error (%u) trying to locate files\n", unsigned(errcode));
-
- if (errcode != osl::Directory::E_NOENT)
- {
- rtl::OUString sMsg = OUSTRING("LocalHierarchyBrowser - IO Error while scanning for component files: ") +
- FileHelper::createOSLErrorString(errcode);
-
- throw com::sun::star::io::IOException(sMsg,*this);
- }
- }
-
- return uno::Sequence< rtl::OUString >(&components.front(),components.size());
- }
-//------------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
diff --git a/configmgr/source/localbe/localhierarchybrowsersvc.hxx b/configmgr/source/localbe/localhierarchybrowsersvc.hxx
deleted file mode 100644
index 5c33a5c974..0000000000
--- a/configmgr/source/localbe/localhierarchybrowsersvc.hxx
+++ /dev/null
@@ -1,100 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_LOCALBE_BROWSERSVC_HXX
-#define CONFIGMGR_LOCALBE_BROWSERSVC_HXX
-
-#include "serviceinfohelper.hxx"
-#include <cppuhelper/implbase2.hxx>
-#include <osl/mutex.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/task/XJob.hpp>
-
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace localbe
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace task = ::com::sun::star::task;
- namespace beans = ::com::sun::star::beans;
-// -----------------------------------------------------------------------------
-
- class LocalHierarchyBrowserService : public ::cppu::WeakImplHelper2<
- task::XJob,
- lang::XServiceInfo
- >
- {
- public:
- explicit
- LocalHierarchyBrowserService(uno::Reference< uno::XComponentContext > const & _xContext);
- ~LocalHierarchyBrowserService();
-
- // XServiceInfo
- virtual rtl::OUString SAL_CALL
- getImplementationName( )
- throw (uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- supportsService( const rtl::OUString& ServiceName )
- throw (uno::RuntimeException);
-
- virtual uno::Sequence< rtl::OUString > SAL_CALL
- getSupportedServiceNames( )
- throw (uno::RuntimeException);
-
- // XJob
- virtual uno::Any SAL_CALL
- execute( const uno::Sequence< beans::NamedValue >& Arguments )
- throw (lang::IllegalArgumentException, uno::Exception, uno::RuntimeException);
-
- private:
- uno::Reference< lang::XMultiServiceFactory > getServiceFactory() const
- { return m_xServiceFactory; }
-
- uno::Sequence< rtl::OUString > findLocalComponentNames( rtl::OUString const & _aBaseDirectory, rtl::OUString const & _aComponentFileExtension, uno::Sequence< rtl::OUString > const & aExcludeList);
- uno::Sequence< rtl::OUString > findLocalComponentUrls( rtl::OUString const & _aBaseDirectory, rtl::OUString const & _aComponentFileExtension, uno::Sequence< rtl::OUString > const & aExcludeList);
- private:
- uno::Reference< lang::XMultiServiceFactory > m_xServiceFactory;
-
- static ServiceInfoHelper getServiceInfo();
- };
-// -----------------------------------------------------------------------------
- } // namespace localbe
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/localbe/localmultistratum.cxx b/configmgr/source/localbe/localmultistratum.cxx
deleted file mode 100644
index 0d2cb34666..0000000000
--- a/configmgr/source/localbe/localmultistratum.cxx
+++ /dev/null
@@ -1,247 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "localmultistratum.hxx"
-#include "localfilehelper.hxx"
-#include "filehelper.hxx"
-
-#ifndef CONFIGMGR_API_FACTORY_HXX_
-#include "confapifactory.hxx"
-#endif // CONFIGMGR_API_FACTORY_HXX_
-#include "serviceinfohelper.hxx"
-#include <rtl/ustrbuf.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/configuration/backend/InsufficientAccessRightsException.hpp>
-#include <osl/file.hxx>
-
-namespace configmgr { namespace localbe {
-
-//==============================================================================
-
-static inline
-rtl::OUString const & impl_getLayerDataDirectory(rtl::OUString const & aLayerBaseUrl)
-{ return aLayerBaseUrl; }
-//------------------------------------------------------------------------------
-static //inline
-rtl::OUString makeLayerId(rtl::OUString const & aComponent,rtl::OUString const & aParticleFile)
-{
- OSL_ASSERT(aParticleFile.endsWithIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM(kLocalDataSuffix)));
- const sal_Int32 kExtLength = RTL_CONSTASCII_LENGTH(kLocalDataSuffix);
- rtl::OUString const aParticleName = aParticleFile.copy(0,aParticleFile.getLength() - kExtLength);
-
- rtl::OUStringBuffer aLayerId(aComponent);
- aLayerId.append(k_cLayerIdSeparator);
- aLayerId.append(aParticleName);
-
- return aLayerId.makeStringAndClear();
-}
-
-LocalMultiStratum::LocalMultiStratum(const uno::Reference<uno::XComponentContext>& xContext)
-: cppu::ImplInheritanceHelper1< LocalStratumBase, backend::XMultiLayerStratum >(xContext)
-{
-}
-//------------------------------------------------------------------------------
-
-LocalMultiStratum::~LocalMultiStratum() {}
-
-//------------------------------------------------------------------------------
-uno::Sequence< rtl::OUString > SAL_CALL
- LocalMultiStratum::listLayerIds( const rtl::OUString& aComponent,
- const rtl::OUString& /*aEntity*/ )
- throw (backend::BackendAccessException, lang::IllegalArgumentException, uno::RuntimeException)
-{
- rtl::OUString const aLayerUrl = impl_getLayerDataDirectory(getBaseUrl());
- rtl::OUString const aComponentUrl = aLayerUrl + componentToPath(aComponent);
-
- const sal_uInt32 k_STATUS_FIELDS = FileStatusMask_Type | FileStatusMask_FileName;
- osl::Directory aComponentDirectory(aComponentUrl);
- osl::DirectoryItem aItem;
- std::vector< rtl::OUString > aResult;
-
- osl::Directory::RC errcode = aComponentDirectory.open();
- switch (errcode)
- {
- case osl::Directory::E_NOENT:
- return uno::Sequence< rtl::OUString >();
-
- case osl::Directory::E_None:
- while (osl::Directory::E_None == (errcode=aComponentDirectory.getNextItem(aItem)))
- {
- osl::FileStatus aItemDescriptor( k_STATUS_FIELDS );
- errcode = aItem.getFileStatus(aItemDescriptor);
-
- if ( errcode != osl::DirectoryItem::E_None )
- {
- OSL_ASSERT(errcode != osl::Directory::E_NOENT); // unexpected failure for getFileStatus for existing file
- if (errcode == osl::Directory::E_NOENT) continue;
-
- OSL_TRACE("Reading Component Directory - Error (%u) getting status of directory item.\n", unsigned(errcode));
- break;
- }
-
- OSL_ENSURE( aItemDescriptor.isValid(FileStatusMask_Type), "Could not get type of directory item");
- if (aItemDescriptor.getFileType() != osl::FileStatus::Regular)
- continue;
-
- OSL_ENSURE( aItemDescriptor.isValid(FileStatusMask_FileName), "Could not get name of component found");
- rtl::OUString const aFileName = aItemDescriptor.getFileName();
- if (!aFileName.endsWithIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM(kLocalDataSuffix)))
- continue;
-
- aResult.push_back( makeLayerId(aComponent,aFileName) );
- }
- OSL_ASSERT(errcode != osl::Directory::E_None); // Loop postcond
-
- // joint error handling with open failure
- if (errcode != osl::Directory::E_NOENT) // normal loop termination
- {
- default: // if open() truly failed we also go here
- rtl::OUStringBuffer errbuf;
- errbuf.appendAscii("LocalMultiStratum::listLayerIds: ");
- errbuf.appendAscii("Error scanning directory ").append(aComponentUrl)
- .appendAscii(" for particle files. ");
- errbuf.appendAscii("Error: ").append(FileHelper::createOSLErrorString(errcode));
- rtl::OUString const errmsg = errbuf.makeStringAndClear();
- throw backend::BackendAccessException(errmsg,*this,uno::Any());
- }
-
- return aResult.empty()
- ? uno::Sequence< rtl::OUString >()
- : uno::Sequence< rtl::OUString >(
- &aResult.front(), static_cast<sal_Int32>(aResult.size()));
- }
-}
-
-//------------------------------------------------------------------------------
-rtl::OUString SAL_CALL
- LocalMultiStratum::getUpdateLayerId( const rtl::OUString& aComponent,
- const rtl::OUString& /*aEntity*/ )
- throw (backend::BackendAccessException, lang::NoSupportException,
- lang::IllegalArgumentException, uno::RuntimeException)
-{
- failReadonly();
- return aComponent;
-}
-
-//------------------------------------------------------------------------------
-uno::Reference< backend::XLayer > SAL_CALL
- LocalMultiStratum::getLayer( const rtl::OUString& aLayerId,
- const rtl::OUString& aTimestamp )
- throw (backend::BackendAccessException, lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- return LocalStratumBase::getLayer(aLayerId,aTimestamp);
-}
-//------------------------------------------------------------------------------
-uno::Sequence< uno::Reference< backend::XLayer > > SAL_CALL
- LocalMultiStratum::getLayers( const uno::Sequence< rtl::OUString >& aLayerIds,
- const rtl::OUString& aTimestamp )
- throw (backend::BackendAccessException, lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- sal_Int32 const nLayers = aLayerIds.getLength();
- uno::Sequence< uno::Reference< backend::XLayer > > aResult(nLayers);
- for (sal_Int32 ix=0; ix<nLayers; ++ix)
- {
- aResult[ix] = LocalStratumBase::getLayer(aLayerIds[ix],aTimestamp);
- }
- return aResult;
-}
-
-//------------------------------------------------------------------------------
-uno::Sequence< uno::Reference< backend::XLayer > > SAL_CALL
- LocalMultiStratum::getMultipleLayers( const uno::Sequence< rtl::OUString >& aLayerIds,
- const uno::Sequence< rtl::OUString >& aTimestamps )
- throw (backend::BackendAccessException, lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- if (aLayerIds.getLength() != aTimestamps.getLength()) {
- throw lang::IllegalArgumentException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "LocalStratum::getMultipleLayers(): Timestamp count does not match layer count")),
- *this, 0) ;
- }
- sal_Int32 const nLayers = aLayerIds.getLength();
- uno::Sequence< uno::Reference< backend::XLayer > > aResult(nLayers);
- for (sal_Int32 ix=0; ix<nLayers; ++ix)
- {
- aResult[ix] = LocalStratumBase::getLayer(aLayerIds[ix],aTimestamps[ix]);
- }
- return aResult;
-}
-
-//------------------------------------------------------------------------------
-uno::Reference< backend::XUpdatableLayer > SAL_CALL
- LocalMultiStratum::getUpdatableLayer( const rtl::OUString& /*aLayerId*/ )
- throw (backend::BackendAccessException, lang::IllegalArgumentException,
- lang::NoSupportException, uno::RuntimeException)
-{
- failReadonly();
- return 0;
-}
-//------------------------------------------------------------------------------
-
-void LocalMultiStratum::getLayerDirectories(rtl::OUString& aLayerUrl,
- rtl::OUString& aSubLayerUrl) const
-{
- aLayerUrl = impl_getLayerDataDirectory(getBaseUrl());
- aSubLayerUrl = rtl::OUString();
-}
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-static const sal_Char * const kMultiStratumImplementation =
- "com.sun.star.comp.configuration.backend.LocalMultiStratum" ;
-static const sal_Char * const kBackendService =
- "com.sun.star.configuration.backend.MultiStratum" ;
-static const sal_Char * const kLocalService =
- "com.sun.star.configuration.backend.LocalMultiStratum" ;
-
-static sal_Char const * kServiceNames [] = { kLocalService, 0, kBackendService, 0 } ;
-static const ServiceImplementationInfo kMultiStratumServiceInfo = { kMultiStratumImplementation , kServiceNames, kServiceNames + 2 } ;
-
-const ServiceRegistrationInfo *getLocalMultiStratumServiceInfo()
-{ return getRegistrationInfo(&kMultiStratumServiceInfo) ; }
-
-uno::Reference<uno::XInterface> SAL_CALL
-instantiateLocalMultiStratum(const uno::Reference< uno::XComponentContext >& xContext) {
- return *new LocalMultiStratum(xContext) ;
-}
-
-//------------------------------------------------------------------------------
-
-const ServiceImplementationInfo * LocalMultiStratum::getServiceInfoData() const
-{
- return &kMultiStratumServiceInfo;
-}
-//------------------------------------------------------------------------------
-// ---------------------------------------------------------------------------------------
-
-} } // configmgr.localsinglestratum
diff --git a/configmgr/source/localbe/localmultistratum.hxx b/configmgr/source/localbe/localmultistratum.hxx
deleted file mode 100644
index ab8c809171..0000000000
--- a/configmgr/source/localbe/localmultistratum.hxx
+++ /dev/null
@@ -1,97 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_LOCALBE_LOCALMULTISTRATUM_HXX_
-#define CONFIGMGR_LOCALBE_LOCALMULTISTRATUM_HXX_
-
-#include "localstratumbase.hxx"
-#include <com/sun/star/configuration/backend/XMultiLayerStratum.hpp>
-#include <cppuhelper/implbase1.hxx>
-
-namespace configmgr
-{
- namespace localbe
- {
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-
-/**
- Implements the MultiLayerStratum service for local file access.
- */
-class LocalMultiStratum : public cppu::ImplInheritanceHelper1< LocalStratumBase, backend::XMultiLayerStratum >
-{
-public :
- /**
- Service constructor from a service factory.
-
- @param xContext component context
- */
- LocalMultiStratum(const uno::Reference<uno::XComponentContext>& xContext) ;
-
- /** Destructor */
- ~LocalMultiStratum() ;
-
-
- // XMultiLayerStratum
- virtual uno::Sequence< rtl::OUString > SAL_CALL
- listLayerIds( const rtl::OUString& aComponent, const rtl::OUString& aEntity )
- throw (backend::BackendAccessException, lang::IllegalArgumentException, uno::RuntimeException);
-
- virtual rtl::OUString SAL_CALL
- getUpdateLayerId( const rtl::OUString& aComponent, const rtl::OUString& aEntity )
- throw (backend::BackendAccessException, lang::NoSupportException,
- lang::IllegalArgumentException, uno::RuntimeException);
-
- virtual uno::Reference< backend::XLayer > SAL_CALL
- getLayer( const rtl::OUString& aLayerId, const rtl::OUString& aTimestamp )
- throw (backend::BackendAccessException, lang::IllegalArgumentException, uno::RuntimeException);
-
- virtual uno::Sequence< uno::Reference< backend::XLayer > > SAL_CALL
- getLayers( const uno::Sequence< rtl::OUString >& aLayerIds, const rtl::OUString& aTimestamp )
- throw (backend::BackendAccessException, lang::IllegalArgumentException, uno::RuntimeException);
-
- virtual uno::Sequence< uno::Reference< backend::XLayer > > SAL_CALL
- getMultipleLayers( const uno::Sequence< rtl::OUString >& aLayerIds, const uno::Sequence< rtl::OUString >& aTimestamps )
- throw (backend::BackendAccessException, lang::IllegalArgumentException, uno::RuntimeException);
-
- virtual uno::Reference< backend::XUpdatableLayer > SAL_CALL
- getUpdatableLayer( const rtl::OUString& aLayerId )
- throw (backend::BackendAccessException, lang::NoSupportException,
- lang::IllegalArgumentException, uno::RuntimeException);
-
-private:
- virtual void getLayerDirectories(rtl::OUString& aLayerUrl, rtl::OUString& aSubLayerUrl) const;
- virtual const ServiceImplementationInfo * getServiceInfoData() const;
-} ;
-
-
-} } // configmgr.localbe
-
-#endif
diff --git a/configmgr/source/localbe/localoutputstream.cxx b/configmgr/source/localbe/localoutputstream.cxx
deleted file mode 100644
index 4ca235b46b..0000000000
--- a/configmgr/source/localbe/localoutputstream.cxx
+++ /dev/null
@@ -1,196 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include "localoutputstream.hxx"
-#include <rtl/ustrbuf.hxx>
-#include <com/sun/star/configuration/backend/InsufficientAccessRightsException.hpp>
-
-namespace configmgr { namespace localbe {
-
-//==============================================================================
-
-//------------------------------------------------------------------------------
-
-LocalOutputStream::LocalOutputStream(const rtl::OUString& aFileUrl)
- throw (backend::BackendAccessException, uno::RuntimeException)
-: mFileUrl(aFileUrl)
-, mTemporaryFileUrl(mFileUrl)
-, mWriteFile(NULL)
-{
- // First, ensure the directory where the file is supposed to be
- // put exists.
- mTemporaryFileUrl += rtl::OUString::createFromAscii("_tmp") ;
- rtl::OUString parentDirectory = FileHelper::getParentDir(aFileUrl) ;
-
- if (osl::File::RC errorCode = FileHelper::mkdirs(parentDirectory))
- {
- rtl::OUStringBuffer message ;
- message.appendAscii("Cannot create directory \"") ;
- message.append(parentDirectory).appendAscii("\". Error is ") ;
- message.append(FileHelper::createOSLErrorString(errorCode));
- message.appendAscii(" [").append(sal_Int32(errorCode)).appendAscii("].") ;
-
- rtl::OUString const sIOMsg = message.makeStringAndClear();
- uno::Any ioe = uno::makeAny(io::IOException(sIOMsg,0));
-
- switch (errorCode)
- {
- case osl::File::E_ACCES:
- case osl::File::E_ROFS:
- message.appendAscii("Configuration LocalOutputStream - No Write Access: ");
- message.append(sIOMsg);
- throw backend::InsufficientAccessRightsException(message.makeStringAndClear(), NULL, ioe) ;
-
- case osl::File::E_None: OSL_ASSERT(!"can't happen");
- default:
- message.appendAscii("Configuration LocalOutputStream - IO Error: ");
- message.append(sIOMsg);
- throw backend::BackendAccessException(message.makeStringAndClear(), NULL, ioe) ;
- }
- }
-
- osl::File::remove(mTemporaryFileUrl) ;
- mWriteFile = new osl::File(mTemporaryFileUrl) ;
-
- if (osl::File::RC errorCode = mWriteFile->open(OpenFlag_Write | OpenFlag_Create) )
- {
- delete mWriteFile, mWriteFile = NULL;
-
- rtl::OUStringBuffer message ;
- message.appendAscii("Cannot open file \"") ;
- message.append(mTemporaryFileUrl).appendAscii("\" for writing. ");
- message.appendAscii("Error is ").append(FileHelper::createOSLErrorString(errorCode));
- message.appendAscii(" [").append(sal_Int32(errorCode)).appendAscii("].") ;
-
- rtl::OUString const sIOMsg = message.makeStringAndClear();
- uno::Any ioe = uno::makeAny(io::IOException(sIOMsg,0));
-
- switch (errorCode)
- {
- case osl::File::E_EXIST: // take inability to remove as indicator of missing rights
- case osl::File::E_ACCES:
- case osl::File::E_ROFS:
- message.appendAscii("Configuration LocalOutputStream - No Write Access: ");
- message.append(sIOMsg);
- throw backend::InsufficientAccessRightsException(message.makeStringAndClear(), NULL, ioe) ;
-
- case osl::File::E_None: OSL_ASSERT(!"can't happen");
- default:
- message.appendAscii("Configuration LocalOutputStream - IO Error: ");
- message.append(sIOMsg);
- throw backend::BackendAccessException(message.makeStringAndClear(), NULL, ioe) ;
- }
- }
- mTemporaryFile = new OSLOutputStreamWrapper(*mWriteFile) ;
-}
-//------------------------------------------------------------------------------
-
-LocalOutputStream::~LocalOutputStream()
-{
- try
- {
- this->closeOutput();
- }
- catch (uno::Exception&)
- {
- OSL_ENSURE(false,"Exception from closing LocalOutputStream ignored.");
- }
-
- delete mWriteFile;
-}
-//------------------------------------------------------------------------------
-
-void LocalOutputStream::finishOutput()
- throw (backend::BackendAccessException, uno::RuntimeException)
-{
- if (mWriteFile)
- try
- {
- this->closeOutput();
- delete mWriteFile, mWriteFile = NULL;
-
- FileHelper::replaceFile(mFileUrl, mTemporaryFileUrl) ;
- }
- catch (io::IOException& ioe)
- {
- rtl::OUStringBuffer message ;
- message.appendAscii("Configuration LocalOutputStream - IO Error: ");
- message.appendAscii("Cannot finish output to \"").append(mTemporaryFileUrl) ;
- message.appendAscii("\" or copy the result to \"").append(mFileUrl).appendAscii("\". ");
- message.appendAscii("Error is \"").append(ioe.Message).appendAscii("\". ");
- throw backend::BackendAccessException(message.makeStringAndClear(), *this, uno::makeAny(ioe));
- }
-}
-//------------------------------------------------------------------------------
-
-inline
-uno::Reference<io::XOutputStream> LocalOutputStream::getOutputFile()
-{
- if (!mTemporaryFile.is())
- {
- throw io::NotConnectedException(
- rtl::OUString::createFromAscii("LocalOutputStream: no output file."),
- *this);
- }
- return mTemporaryFile;
-}
-//------------------------------------------------------------------------------
-
-void SAL_CALL LocalOutputStream::writeBytes(const uno::Sequence<sal_Int8>& aData)
- throw (io::NotConnectedException,
- io::BufferSizeExceededException,
- io::IOException, uno::RuntimeException)
-{
- getOutputFile()->writeBytes(aData) ;
-}
-//------------------------------------------------------------------------------
-
-void SAL_CALL LocalOutputStream::flush()
- throw (io::NotConnectedException,
- io::BufferSizeExceededException,
- io::IOException, uno::RuntimeException)
-{
- getOutputFile()->flush() ;
-}
-//------------------------------------------------------------------------------
-
-void SAL_CALL LocalOutputStream::closeOutput()
- throw (io::NotConnectedException, io::BufferSizeExceededException,
- io::IOException, uno::RuntimeException)
-{
- if (mTemporaryFile.is())
- {
- mTemporaryFile->closeOutput() ;
-
- mTemporaryFile.clear();
- }
-}
-//------------------------------------------------------------------------------
-
-} } // configmgr.localbe
diff --git a/configmgr/source/localbe/localoutputstream.hxx b/configmgr/source/localbe/localoutputstream.hxx
deleted file mode 100644
index 9bd9d11bd1..0000000000
--- a/configmgr/source/localbe/localoutputstream.hxx
+++ /dev/null
@@ -1,103 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_LOCALBE_LOCALOUTPUTSTREAM_HXX_
-#define CONFIGMGR_LOCALBE_LOCALOUTPUTSTREAM_HXX_
-
-#include "oslstream.hxx"
-#include "filehelper.hxx"
-#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
-
-namespace configmgr { namespace localbe {
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace io = css::io ;
-namespace backend = css::configuration::backend ;
-
-/**
- Class wrapping the use of the XOutputStream implementation on a file
- to make it handle a temporary file and synch the contents to the
- actual file being accessed only on successful completion of the output
- process.
- */
-class LocalOutputStream : public cppu::WeakImplHelper1<io::XOutputStream>
-{
- public :
- /**
- Constructor using the URL of the file to access.
- The actual writing will occur in a temporary file
- whose name is derived from the URL, and the file
- specified by the parameter will be overwritten
- on closing the stream.
-
- @param aFileUrl URL of the file to write
- @throws com::sun::star::io::IOException
- if access to the temporary file fails.
- */
- LocalOutputStream(const rtl::OUString& aFileUrl)
- throw (backend::BackendAccessException, uno::RuntimeException) ;
- /** Destructor */
- ~LocalOutputStream(void) ;
-
- // closeOutput and mark as successful
- void finishOutput()
- throw (backend::BackendAccessException, uno::RuntimeException) ;
- protected :
- // XOutputStream
- virtual void SAL_CALL writeBytes(const uno::Sequence<sal_Int8>& aData)
- throw (io::NotConnectedException,
- io::BufferSizeExceededException,
- io::IOException, uno::RuntimeException);
-
- virtual void SAL_CALL flush(void)
- throw (io::NotConnectedException,
- io::BufferSizeExceededException,
- io::IOException, uno::RuntimeException);
-
- virtual void SAL_CALL closeOutput(void)
- throw (io::NotConnectedException,
- io::BufferSizeExceededException,
- io::IOException, uno::RuntimeException) ;
-
-
- private :
- uno::Reference<io::XOutputStream> getOutputFile() ;
-
- /** Temporary file used during access */
- uno::Reference<io::XOutputStream> mTemporaryFile ;
- /** URL of the target file */
- rtl::OUString mFileUrl ;
- /** URL of the temporary file */
- rtl::OUString mTemporaryFileUrl ;
- /** File being written */
- osl::File *mWriteFile ;
-} ;
-
-} } // configmgr.localbe
-
-#endif // CONFIGMGR_LOCALBE_LOCALOUTPUTSTREAM_HXX_
diff --git a/configmgr/source/localbe/localschemasupplier.cxx b/configmgr/source/localbe/localschemasupplier.cxx
deleted file mode 100644
index 9204ff38db..0000000000
--- a/configmgr/source/localbe/localschemasupplier.cxx
+++ /dev/null
@@ -1,288 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "localschemasupplier.hxx"
-#include "localfilehelper.hxx"
-#include "oslstream.hxx"
-
-#ifndef CONFIGMGR_API_FACTORY_HXX_
-#include "confapifactory.hxx"
-#endif // CONFIGMGR_API_FACTORY_HXX_
-#include "serviceinfohelper.hxx"
-#include "bootstrap.hxx"
-#include "filehelper.hxx"
-#include <rtl/ustrbuf.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/configuration/backend/InsufficientAccessRightsException.hpp>
-#include <osl/file.hxx>
-#include <osl/process.h>
-#include <memory>
-
-namespace configmgr { namespace localbe {
-
-//==============================================================================
-
-//------------------------------------------------------------------------------
-
-LocalSchemaSupplier::LocalSchemaSupplier(
- const uno::Reference<uno::XComponentContext>& xContext)
- : cppu::WeakComponentImplHelper3<backend::XVersionedSchemaSupplier, lang::XInitialization, lang::XServiceInfo>(mMutex), mFactory(xContext->getServiceManager(),uno::UNO_QUERY) {
-}
-//------------------------------------------------------------------------------
-
-LocalSchemaSupplier::~LocalSchemaSupplier(void) {}
-//------------------------------------------------------------------------------
-static const rtl::OUString kSchemaDataUrl(
- RTL_CONSTASCII_USTRINGPARAM(CONTEXT_ITEM_PREFIX_"SchemaDataUrl")) ;
-
-static const rtl::OUString kSchemaVersion(
- RTL_CONSTASCII_USTRINGPARAM(CONTEXT_ITEM_PREFIX_"SchemaVersion")) ;
-
-void SAL_CALL LocalSchemaSupplier::initialize(
- const uno::Sequence<uno::Any>& aParameters)
- throw (uno::RuntimeException, uno::Exception,
- css::configuration::InvalidBootstrapFileException,
- backend::CannotConnectException,
- backend::BackendSetupException)
-{
- if (aParameters.getLength() == 0) {
- throw lang::IllegalArgumentException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "No parameters provided to LocalSchemaSupplier")),
- *this, 0) ;
- }
- uno::Reference<uno::XComponentContext> context ;
-
- for (sal_Int32 i = 0 ; i < aParameters.getLength() ; ++ i) {
- if (aParameters [i] >>= context) { break ; }
- }
-
- // Setting: schema version
- // TODO: Add support for repository-specific versions
- uno::Any const aSchemaVersionSetting = context->getValueByName(kSchemaVersion);
- aSchemaVersionSetting >>= mSchemaVersion;
-
- // Setting: schema diretory(ies)
- uno::Any const aSchemaDataSetting = context->getValueByName(kSchemaDataUrl);
- uno::Sequence< rtl::OUString > aSchemas;
- rtl::OUString schemas;
-
- if (aSchemaDataSetting >>= schemas)
- {
- fillFromBlankSeparated(schemas, aSchemas) ;
- }
- else
- {
- aSchemaDataSetting >>= aSchemas;
- }
- //validate SchemaDataUrls
- mSchemaDataUrls.realloc(aSchemas.getLength());
-
- sal_Int32 nSchemaLocations =0;
- sal_Int32 nExistingSchemaLocations = 0;
- for (sal_Int32 j = 0; j < aSchemas.getLength(); ++j)
- {
- bool bOptional = checkOptionalArg(aSchemas[j]);
-
- if(!bOptional)
- validateFileURL(aSchemas[j],*this);
- else if (!isValidFileURL(aSchemas[j]))
- continue;
-
- OSL_ASSERT(isValidFileURL(aSchemas[j]));
-
- //NormalizeURL
- implEnsureAbsoluteURL(aSchemas[j]);
- if(!normalizeURL(aSchemas[j],*this,bOptional))
- continue;
-
- //now we have a correct file URL, which we will use
- mSchemaDataUrls[nSchemaLocations++]= aSchemas[j];
- if (!bOptional)
- checkFileExists(aSchemas[j],*this);
-
- else if(!FileHelper::fileExists(aSchemas[j]))
- continue; // skip the directory check
-
- checkIfDirectory(aSchemas[j],*this);
- ++nExistingSchemaLocations;
- }
- if (0 == nExistingSchemaLocations)
- {
- rtl::OUString sMsg = rtl::OUString::createFromAscii("LocalBackend: No schema directories found");
- throw backend::BackendSetupException(sMsg,*this, uno::Any()) ;
- }
- mSchemaDataUrls.realloc(nSchemaLocations);
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL
- LocalSchemaSupplier::getSchemaVersion(const rtl::OUString& /*aComponent*/)
- throw (backend::BackendAccessException, lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- // TODO: Add support for repository-specific versions
- return mSchemaVersion;
-}
-//------------------------------------------------------------------------------
-static const rtl::OUString kSchemaSuffix(RTL_CONSTASCII_USTRINGPARAM(".xcs")) ;
-static const rtl::OUString kXMLSchemaParser(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.backend.xml.SchemaParser")) ;
-
-uno::Reference<backend::XSchema> SAL_CALL
- LocalSchemaSupplier::getComponentSchema(const rtl::OUString& aComponent)
- throw (backend::BackendAccessException, lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- rtl::OUString subPath = componentToPath(aComponent) ;
-
- osl::File * schemaFile = NULL;
- rtl::OUString errorMessage;
- bool bInsufficientAccess = false;
- for (sal_Int32 ix = 0; ix < mSchemaDataUrls.getLength(); ++ix)
- {
- rtl::OUStringBuffer schemaUrl(mSchemaDataUrls[ix]) ;
-
- schemaUrl.append(subPath).append(kSchemaSuffix) ;
-
- rtl::OUString const aFileUrl = schemaUrl.makeStringAndClear();
-
- std::auto_ptr<osl::File> checkFile( new osl::File(aFileUrl) );
- osl::File::RC rc = checkFile->open(OpenFlag_Read) ;
-
- if (rc == osl::File::E_None)
- {
- schemaFile = checkFile.release();
- break;
- }
- else if (rc != osl::File::E_NOENT)
- {
- if (rc == osl::File::E_ACCES)
- bInsufficientAccess =true;
-
- // accumulate error messages
- rtl::OUStringBuffer sMsg(errorMessage);
- if (errorMessage.getLength())
- sMsg.appendAscii("LocalFile SchemaSupplier - Error accessing schema: ");
-
- sMsg.appendAscii("\n- Cannot open input file \"");
- sMsg.append(aFileUrl);
- sMsg.appendAscii("\" : ");
- sMsg.append(FileHelper::createOSLErrorString(rc));
-
- errorMessage = sMsg.makeStringAndClear();
- }
- }
-
- if (NULL == schemaFile)
- {
- if (errorMessage.getLength() != 0)
- {
- // a real error occured
- io::IOException ioe(errorMessage,*this);
-
- rtl::OUStringBuffer sMsg;
- sMsg.appendAscii("LocalFileLayer - Cannot readData: ").append(errorMessage);
-
- if (bInsufficientAccess)
- throw backend::InsufficientAccessRightsException(sMsg.makeStringAndClear(),*this,uno::makeAny(ioe));
- else
- throw backend::BackendAccessException(sMsg.makeStringAndClear(),*this,uno::makeAny(ioe));
- }
- // simply not found
- return NULL;
- }
-
- uno::Sequence<uno::Any> arguments(1) ;
- uno::Reference<io::XInputStream> stream( new OSLInputStreamWrapper(schemaFile, true) );
-
- arguments [0] <<= stream ;
- uno::Reference<backend::XSchema> schema(
- mFactory->createInstanceWithArguments(kXMLSchemaParser, arguments),
- uno::UNO_QUERY) ;
-
- if (!schema.is())
- {
- throw uno::RuntimeException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "Cannot instantiate Schema Parser for ")) + aComponent,
- *this) ;
- }
- return schema ;
-}
-//------------------------------------------------------------------------------
-
-
-//------------------------------------------------------------------------------
-
-static const sal_Char * const kImplementation =
- "com.sun.star.comp.configuration.backend.LocalSchemaSupplier" ;
-static const sal_Char * const kSchemaService =
- "com.sun.star.configuration.backend.SchemaSupplier" ;
-static const sal_Char * const kLocalService =
- "com.sun.star.configuration.backend.LocalSchemaSupplier" ;
-
-static sal_Char const * kServiceNames [] = {kLocalService, 0, kSchemaService, 0 } ;
-static const ServiceImplementationInfo kServiceInfo = { kImplementation, kServiceNames,kServiceNames+2 } ;
-
-const ServiceRegistrationInfo *getLocalSchemaSupplierServiceInfo()
-{ return getRegistrationInfo(&kServiceInfo) ; }
-
-uno::Reference<uno::XInterface> SAL_CALL
-instantiateLocalSchemaSupplier(const uno::Reference< uno::XComponentContext >& xContext) {
- return *new LocalSchemaSupplier(xContext) ;
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL LocalSchemaSupplier::getImplementationName(void)
- throw (uno::RuntimeException)
-{
- return ServiceInfoHelper(&kServiceInfo).getImplementationName() ;
-}
-//------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL LocalSchemaSupplier::supportsService(
- const rtl::OUString& aServiceName)
- throw (uno::RuntimeException)
-{
- return ServiceInfoHelper(&kServiceInfo).supportsService(aServiceName);
-}
-//------------------------------------------------------------------------------
-
-uno::Sequence<rtl::OUString>
-SAL_CALL LocalSchemaSupplier::getSupportedServiceNames(void)
- throw (uno::RuntimeException)
-{
- return ServiceInfoHelper(&kServiceInfo).getSupportedServiceNames() ;
-}
-
-// ---------------------------------------------------------------------------------------
-
-} } // configmgr.localbe
diff --git a/configmgr/source/localbe/localschemasupplier.hxx b/configmgr/source/localbe/localschemasupplier.hxx
deleted file mode 100644
index bdd2db5f14..0000000000
--- a/configmgr/source/localbe/localschemasupplier.hxx
+++ /dev/null
@@ -1,115 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_LOCALBE_LOCALSCHEMASUPPLIER_HXX_
-#define CONFIGMGR_LOCALBE_LOCALSCHEMASUPPLIER_HXX_
-
-#include <com/sun/star/configuration/backend/XVersionedSchemaSupplier.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/configuration/InvalidBootstrapFileException.hpp>
-#include <com/sun/star/configuration/backend/CannotConnectException.hpp>
-#include <cppuhelper/compbase3.hxx>
-
-namespace configmgr { namespace localbe {
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-
-/**
- Implements the SchemaSupplier service for local schema file access.
- */
-class LocalSchemaSupplier : public cppu::WeakComponentImplHelper3<backend::XVersionedSchemaSupplier, lang::XInitialization, lang::XServiceInfo> {
- public :
- /**
- Service constructor from a service factory.
-
- @param xConxtext Component Context
- */
- LocalSchemaSupplier(const uno::Reference<uno::XComponentContext>& xContext) ;
-
- /** Destructor */
- ~LocalSchemaSupplier(void) ;
-
-
- // XInitialize
- virtual void SAL_CALL
- initialize( const uno::Sequence<uno::Any>& aParameters)
- throw (uno::RuntimeException, uno::Exception,
- css::configuration::InvalidBootstrapFileException,
- backend::CannotConnectException,
- backend::BackendSetupException);
-
- // XVersionedSchemaSupplier
- virtual rtl::OUString SAL_CALL
- getSchemaVersion( const rtl::OUString& aComponent )
- throw (backend::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
-
- // XSchemaSupplier
- virtual uno::Reference<backend::XSchema> SAL_CALL
- getComponentSchema( const rtl::OUString& aComponent )
- throw (backend::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
-
- // XServiceInfo
- virtual rtl::OUString SAL_CALL
- getImplementationName( )
- throw (uno::RuntimeException) ;
-
- virtual sal_Bool SAL_CALL
- supportsService( const rtl::OUString& aServiceName )
- throw (uno::RuntimeException) ;
-
- virtual uno::Sequence<rtl::OUString> SAL_CALL
- getSupportedServiceNames( )
- throw (uno::RuntimeException) ;
-
- private :
- /** Service factory */
- uno::Reference<lang::XMultiServiceFactory> mFactory ;
- /** Mutex for resources protection */
- osl::Mutex mMutex ;
- /**
- Base of the schema data. Is a list to allow
- for multiple schema directories.
- */
- uno::Sequence<rtl::OUString> mSchemaDataUrls ;
- /** Version of the schema repository */
- // TODO: Add support for repository-specific versions
- rtl::OUString mSchemaVersion;
-} ;
-
-} } // configmgr.localschemasupplirt
-
-#endif // CONFIGMGR_LOCALBE_LOCALSCHEMASUPPLIER_HXX_
diff --git a/configmgr/source/localbe/localsinglebackend.cxx b/configmgr/source/localbe/localsinglebackend.cxx
deleted file mode 100644
index baa13a9a6e..0000000000
--- a/configmgr/source/localbe/localsinglebackend.cxx
+++ /dev/null
@@ -1,798 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "localsinglebackend.hxx"
-#include "localfilehelper.hxx"
-#include "localfilelayer.hxx"
-#include "oslstream.hxx"
-
-#ifndef CONFIGMGR_API_FACTORY_HXX_
-#include "confapifactory.hxx"
-#endif // CONFIGMGR_API_FACTORY_HXX_
-#include "serviceinfohelper.hxx"
-#include "bootstrap.hxx"
-#include "filehelper.hxx"
-#include <rtl/ustrbuf.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/configuration/backend/InsufficientAccessRightsException.hpp>
-#include <osl/file.hxx>
-#include <osl/process.h>
-#include <memory>
-
-namespace configmgr { namespace localbe {
-
-//==============================================================================
-
-//------------------------------------------------------------------------------
-
-LocalSingleBackend::LocalSingleBackend(
- const uno::Reference<uno::XComponentContext>& xContext)
- : cppu::WeakComponentImplHelper5<backend::XSchemaSupplier, backend::XMultiLayerStratum, backend::XBackendEntities, lang::XInitialization, lang::XServiceInfo>(mMutex), mFactory(xContext->getServiceManager(),uno::UNO_QUERY) {
-}
-//------------------------------------------------------------------------------
-
-LocalSingleBackend::~LocalSingleBackend(void) {}
-//------------------------------------------------------------------------------
-static const rtl::OUString kSchemaDataUrl(
- RTL_CONSTASCII_USTRINGPARAM(CONTEXT_ITEM_PREFIX_"SchemaDataUrl")) ;
-static const rtl::OUString kDefaultDataUrl(
- RTL_CONSTASCII_USTRINGPARAM(CONTEXT_ITEM_PREFIX_"DefaultLayerUrls")) ;
-static const rtl::OUString kUserDataUrl(
- RTL_CONSTASCII_USTRINGPARAM(CONTEXT_ITEM_PREFIX_"UserLayerUrl")) ;
-static const rtl::OUString kEntity(
- RTL_CONSTASCII_USTRINGPARAM(CONTEXT_ITEM_PREFIX_"EntityLayer")) ;
-
-static const rtl::OUString kAdminModeFlag(
- RTL_CONSTASCII_USTRINGPARAM(CONTEXT_ITEM_ADMINFLAG)) ;
-
-void SAL_CALL LocalSingleBackend::initialize(
- const uno::Sequence<uno::Any>& aParameters)
- throw (uno::RuntimeException, uno::Exception,
- css::configuration::InvalidBootstrapFileException,
- backend::CannotConnectException,
- backend::BackendSetupException)
-{
- if (aParameters.getLength() == 0) {
- throw lang::IllegalArgumentException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "No parameters provided to SingleBackend")),
- *this, 0) ;
- }
- uno::Reference<uno::XComponentContext> context ;
-
- for (sal_Int32 i = 0 ; i < aParameters.getLength() ; ++ i) {
- if (aParameters [i] >>= context) { break ; }
- }
-
- // Setting: schema diretory(ies)
- uno::Any const aSchemaDataSetting = context->getValueByName(kSchemaDataUrl);
- uno::Sequence< rtl::OUString > aSchemas;
- rtl::OUString schemas;
-
- if (aSchemaDataSetting >>= schemas)
- {
- fillFromBlankSeparated(schemas, aSchemas) ;
- }
- else
- {
- aSchemaDataSetting >>= aSchemas;
- }
- //validate SchemaDataUrls
- mSchemaDataUrls.realloc(aSchemas.getLength());
-
- sal_Int32 nSchemaLocations = 0;
- sal_Int32 nExistingSchemaLocations = 0;
- for (sal_Int32 j = 0; j < aSchemas.getLength(); ++j)
- {
- bool bOptional = checkOptionalArg(aSchemas[j]);
-
- if (!bOptional)
- validateFileURL(aSchemas[j],*this);
-
- else if (!isValidFileURL(aSchemas[j]))
- continue;
-
- OSL_ASSERT(isValidFileURL(aSchemas[j]));
-
- //NormalizeURL
- implEnsureAbsoluteURL(aSchemas[j]);
- if (!normalizeURL(aSchemas[j],*this,bOptional))
- continue;
-
- // now we have a correct file URL, which we will use
- mSchemaDataUrls[nSchemaLocations++] = aSchemas[j];
-
- // check existence
- if (!bOptional)
- checkFileExists(aSchemas[j], *this);
-
- else if(!FileHelper::fileExists(aSchemas[j]))
- continue; // skip the directory check
-
-
- checkIfDirectory(aSchemas[j],*this);
-
- ++nExistingSchemaLocations;
- }
- mSchemaDataUrls.realloc(nSchemaLocations);
-
- if (0 == nExistingSchemaLocations)
- {
- rtl::OUString sMsg = rtl::OUString::createFromAscii("LocalBackend: No schema directories found");
- throw backend::BackendSetupException(sMsg,*this, uno::Any()) ;
- }
-
- // Setting: default layer(s)
- uno::Any const aDefaultDataSetting = context->getValueByName(kDefaultDataUrl);
- uno::Sequence< rtl::OUString > aDefaults;
- rtl::OUString defaults;
-
- if (aDefaultDataSetting >>= defaults)
- {
- fillFromBlankSeparated(defaults, aDefaults) ;
- }
- else
- {
- aDefaultDataSetting >>= aDefaults ;
- }
-
- //validate DefaultDataUrls
- mDefaultDataUrls.realloc(aDefaults.getLength());
- sal_Int32 nDefaultLayers = 0;
-
- for (sal_Int32 ix = 0; ix < aDefaults.getLength(); ++ix)
- {
- // skip invalid URLs
- if (!isValidFileURL(aDefaults[ix]))
- continue;
-
- //NormalizeURL
- implEnsureAbsoluteURL(aDefaults[ix]);
- if (!normalizeURL(aDefaults[ix],*this,true))
- continue;
-
- if(FileHelper::fileExists(aDefaults[ix]))
- {
- checkIfDirectory(aDefaults[ix],*this);
- }
-
- // good URL -> use it
- mDefaultDataUrls[nDefaultLayers++] = aDefaults[ix];
- }
- mDefaultDataUrls.realloc(nDefaultLayers);
-
- // Setting: admin mode tag
- sal_Bool bAdminMode = false;
- context->getValueByName(kAdminModeFlag) >>= bAdminMode;
-
- if (bAdminMode)
- {
- // find given entity
- if ( (context->getValueByName(kEntity) >>= mUserDataUrl) && mUserDataUrl.getLength() )
- {
- //Validate UserDataUrl
- validateFileURL(mUserDataUrl,*this);
- //NormalizeURL
- implEnsureAbsoluteURL(mUserDataUrl);
- normalizeURL(mUserDataUrl,*this);
- if(FileHelper::fileExists(mUserDataUrl))
- {
- checkIfDirectory(mUserDataUrl,*this);
- }
-
- for (sal_Int32 ix = 0; ix < mDefaultDataUrls.getLength(); ++ix)
- {
- if (mDefaultDataUrls.getConstArray()[ix].equals(mUserDataUrl))
- {
- mDefaultDataUrls.realloc(ix);
- // this is the last round through the loop
- }
- }
- }
- else if (aDefaults.getLength()) // administrate first default layer
- {
- mUserDataUrl = aDefaults[0];
- mDefaultDataUrls.realloc(0);
- }
- else
- {
- OSL_ENSURE(false, "Cannot find target entity for admin mode - fallback to local mode");
- bAdminMode = false;
- }
- }
-
- if (!bAdminMode)
- {
- context->getValueByName(kUserDataUrl) >>= mUserDataUrl ;
- //Validate UserDataUrl
- if (isValidFileURL(mUserDataUrl))
- {
- implEnsureAbsoluteURL(mUserDataUrl);
- normalizeURL(mUserDataUrl,*this);
- if(FileHelper::fileExists(mUserDataUrl))
- {
- checkIfDirectory(mUserDataUrl,*this);
- }
- }
- }
-
- if (mUserDataUrl.getLength() == 0)
- {
- mUserDataUrl = rtl::OUString::createFromAscii("*");
- OSL_ASSERT(!isValidFileURL(mUserDataUrl));
- }
-}
-//------------------------------------------------------------------------------
-const sal_Int32 k_UserLayerEntity = 0;
-const sal_Int32 k_InvalidEntity = k_UserLayerEntity - 1;
-const sal_Int32 k_DefaultEntityOffset = k_UserLayerEntity + 1;
-//------------------------------------------------------------------------------
-static inline bool isValidEntity(sal_Int32 ent)
-{
- return ent > k_InvalidEntity;
-}
-//------------------------------------------------------------------------------
-static inline sal_Int32 indexToEntity(sal_Int32 ix)
-{
- OSL_ASSERT(0 <= ix);
- return ix + k_DefaultEntityOffset;
-}
-static inline sal_Int32 entityToIndex(sal_Int32 ent)
-{
- OSL_ASSERT(k_DefaultEntityOffset <= ent);
- return ent - k_DefaultEntityOffset;
-}
-//------------------------------------------------------------------------------
-
-
-/**
- Transforms a file url into a layer id. The layer id will
- contain the URL passed plus an integer indicating which
- layer the URL points to. If the integer is 0, the URL
- is a user layer, otherwise it is one of the default layers.
-
- @param aFileUrl URL to encode
- @param aIndex index of the layer concerned (0 = user, other = default)
- @return layer id
- */
-static
-rtl::OUString urlToLayerId(const rtl::OUString& aFileUrl,sal_Int32 aIndex)
-{
- rtl::OUStringBuffer id ;
-
- OSL_ASSERT(isValidEntity(aIndex));
- if (aIndex)
- id.append(aIndex).appendAscii(" ",1); // non-user layers
- else
- id.appendAscii("U ",2); // user layer
-
- id.append(aFileUrl) ;
- return id.makeStringAndClear() ;
-}
-
-static
-inline
-bool layerIdToUrl( const rtl::OUString& aLayerId,
- rtl::OUString& aFileUrl,
- sal_Int32& aIndex)
-{
- sal_Int32 const sep = aLayerId.indexOf(sal_Unicode(' ')) ;
-
- if (sep < 0) return false;
-
- // detect user layer id
- if (aLayerId[0] == sal_Unicode('U'))
- {
- if (sep != 1) return false;
- aIndex = 0;
- }
- else
- {
- aIndex = aLayerId.copy(0, sep).toInt32() ;
- if (0 == aIndex || !isValidEntity(aIndex)) return false;
-
- OSL_ENSURE( aLayerId.copy(0, sep).equals(rtl::OUString::valueOf(aIndex)),
- "Invalid layer id was not detected");
- }
- aFileUrl = aLayerId.copy(sep + 1);
-
- return true;
-}
-//------------------------------------------------------------------------------
-sal_Int32 LocalSingleBackend::resolveLayerId(const rtl::OUString& aLayerId,
- rtl::OUString& aFileUrl)
-{
- sal_Int32 nIndex = k_InvalidEntity;
- if (!layerIdToUrl(aLayerId,aFileUrl,nIndex))
- {
- rtl::OUString const sMsg(RTL_CONSTASCII_USTRINGPARAM(
- "LocalSingleBackend - Invalid layer id: "));
-
- // layer id is always the second parameter
- throw lang::IllegalArgumentException(sMsg.concat(aLayerId), *this, 2);
- }
- OSL_ASSERT(isValidEntity(nIndex));
- return nIndex;
-}
-//------------------------------------------------------------------------------
-
-sal_Int32 LocalSingleBackend::findEntity(const rtl::OUString& aEntity)
-{
- if (aEntity.getLength() == 0)
- {
- return k_InvalidEntity;
- }
-
- // quick check for OwnerEntity first
- if (aEntity.equals(mUserDataUrl))
- {
- return k_UserLayerEntity;
- }
-
- rtl::OUString sNormalizedEntityUrl(aEntity);
- normalizeURL(sNormalizedEntityUrl,*this);
-
- for (sal_Int32 ix = 0; ix < mDefaultDataUrls.getLength(); ++ix)
- {
- rtl::OUString sNormalizedDefaultUrl(mDefaultDataUrls[ix]);
- OSL_VERIFY(normalizeURL(sNormalizedDefaultUrl,*this,true));
-
- if (sNormalizedEntityUrl.equals(sNormalizedDefaultUrl))
- {
- // found it
- return indexToEntity(ix);
- }
- }
-
- //Try normalized version of mUserDataUrl
- rtl::OUString sNormalizedUserUrl(mUserDataUrl);
-
- if (normalizeURL(sNormalizedUserUrl,*this,true))
- {
- if (sNormalizedEntityUrl.equals(sNormalizedUserUrl))
- {
- return k_UserLayerEntity;
- }
- }
-
- // not found
- return k_InvalidEntity;
-}
-//------------------------------------------------------------------------------
-
-static const rtl::OUString kDataSuffix(RTL_CONSTASCII_USTRINGPARAM(".xcu")) ;
-
-uno::Sequence<rtl::OUString> SAL_CALL LocalSingleBackend::listLayerIds(
- const rtl::OUString& aComponent, const rtl::OUString& aEntity)
- throw (backend::BackendAccessException, lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- sal_Int32 nEntity = findEntity(aEntity);
- if ( !isValidEntity(nEntity) )
- {
- rtl::OUString const sMsg(RTL_CONSTASCII_USTRINGPARAM(
- "LocalSingleBackend - Unknown entity: "));
-
- throw lang::IllegalArgumentException(sMsg.concat(aEntity), *this, 2);
- }
-
- sal_Int32 nDefLayers = (k_UserLayerEntity == nEntity)
- ? mDefaultDataUrls.getLength()
- : entityToIndex(nEntity);
-
- OSL_ASSERT(0 <= nDefLayers && nDefLayers <= mDefaultDataUrls.getLength());
-
- rtl::OUString const componentSubPath = componentToPath(aComponent) + kDataSuffix ;
-
- uno::Sequence<rtl::OUString> aLayerIds(nDefLayers + 1) ;
- OSL_ASSERT(0 < aLayerIds.getLength());
-
- // First, the defaults...
- for (sal_Int32 ix = 0; ix < nDefLayers ; ++ ix)
- {
- aLayerIds[ix] = urlToLayerId(componentSubPath, indexToEntity(ix)) ;
- }
- // Then the entity data.
- aLayerIds [nDefLayers] = urlToLayerId(componentSubPath, nEntity) ;
-
- return aLayerIds;
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL LocalSingleBackend::getUpdateLayerId(
- const rtl::OUString& aComponent, const rtl::OUString& aEntity)
- throw (backend::BackendAccessException, lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- sal_Int32 nEntity = findEntity(aEntity);
- if ( !isValidEntity(nEntity) )
- {
- rtl::OUString const sMsg(RTL_CONSTASCII_USTRINGPARAM(
- "LocalSingleBackend - Unknown entity for update: "));
-
- throw lang::IllegalArgumentException(sMsg.concat(aEntity), *this, 2);
- }
-
- return urlToLayerId(componentToPath(aComponent) + kDataSuffix, nEntity) ;
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL LocalSingleBackend::getOwnerEntity()
- throw (uno::RuntimeException)
-{
- return mUserDataUrl ;
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL LocalSingleBackend::getAdminEntity()
- throw (uno::RuntimeException)
-{
- return mDefaultDataUrls.getLength() > 0 ? mDefaultDataUrls[0] : mUserDataUrl;
-}
-//------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL LocalSingleBackend::supportsEntity( const rtl::OUString& aEntity )
- throw (backend::BackendAccessException, uno::RuntimeException)
-{
- return isValidEntity(findEntity(aEntity)) ;
-}
-//------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL LocalSingleBackend::isEqualEntity(const rtl::OUString& aEntity, const rtl::OUString& aOtherEntity)
- throw (backend::BackendAccessException, lang::IllegalArgumentException, uno::RuntimeException)
-{
- if (aEntity.getLength() == 0)
- {
- rtl::OUString const sMsg(RTL_CONSTASCII_USTRINGPARAM(
- "LocalSingleBackend - Invalid empty entity."));
-
- throw lang::IllegalArgumentException(sMsg, *this, 1);
- }
- if (aOtherEntity.getLength() == 0)
- {
- rtl::OUString const sMsg(RTL_CONSTASCII_USTRINGPARAM(
- "LocalSingleBackend - Invalid empty entity."));
-
- throw lang::IllegalArgumentException(sMsg, *this, 2);
- }
- rtl::OUString aNormalizedEntity(aEntity);
- normalizeURL(aNormalizedEntity,*this);
-
- rtl::OUString aNormalizedOther(aOtherEntity);
- normalizeURL(aNormalizedOther,*this);
-
- return aNormalizedEntity == aNormalizedOther;
-}
-//------------------------------------------------------------------------------
-
-sal_Bool LocalSingleBackend::isMoreRecent(const rtl::OUString& aFileUrl,
- sal_Int32 aLayerIndex,
- const rtl::OUString& aTimestamp) {
- rtl::OUString layerUrl ;
- rtl::OUString subLayerUrl ;
-
- // if we don't find a layer, but have a non-empty timestamp -> modified
- if (!getLayerDirectories(aLayerIndex,layerUrl, subLayerUrl))
- return aTimestamp.getLength() != 0;
-
- return layerUrl.getLength() == 0 ||
- BasicLocalFileLayer::getTimestamp(layerUrl + aFileUrl).compareTo( aTimestamp) != 0;
-}
-//------------------------------------------------------------------------------
-
-static const rtl::OUString kDataSubPath(
- RTL_CONSTASCII_USTRINGPARAM("/data")) ;
-static const rtl::OUString kLocalisedDataSubPath(
- RTL_CONSTASCII_USTRINGPARAM("/res")) ;
-
-uno::Reference<backend::XLayer> SAL_CALL LocalSingleBackend::getLayer(
- const rtl::OUString& aLayerId, const rtl::OUString& aTimestamp)
- throw (backend::BackendAccessException, lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- rtl::OUString fileUrl ;
-
- sal_Int32 defaultIndex = resolveLayerId(aLayerId, fileUrl) ;
-
- if (!isMoreRecent(fileUrl, defaultIndex, aTimestamp)) { return NULL ; }
-
- uno::Reference<backend::XUpdatableLayer> xLayer = getFileLayer(fileUrl,defaultIndex);
- uno::Reference<backend::XLayer> xResult = xLayer.get();
- return xResult;
-}
-//------------------------------------------------------------------------------
-
-uno::Sequence<uno::Reference<backend::XLayer> > SAL_CALL
-LocalSingleBackend::getLayers(const uno::Sequence<rtl::OUString>& aLayerIds,
- const rtl::OUString& aTimestamp)
- throw (backend::BackendAccessException, lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- uno::Sequence<uno::Reference<backend::XLayer> >
- retCode(aLayerIds.getLength()) ;
-
- for (sal_Int32 i = 0 ; i < aLayerIds.getLength() ; ++ i) {
- retCode [i] = getLayer(aLayerIds [i], aTimestamp) ;
- }
- return retCode ;
-}
-//------------------------------------------------------------------------------
-
-uno::Sequence<uno::Reference<backend::XLayer> > SAL_CALL
-LocalSingleBackend::getMultipleLayers(
- const uno::Sequence<rtl::OUString>& aLayerIds,
- const uno::Sequence<rtl::OUString>& aTimestamps)
- throw (backend::BackendAccessException, lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- if (aLayerIds.getLength() != aTimestamps.getLength()) {
- throw lang::IllegalArgumentException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "Not enough or too many timestamps")),
- *this, 0) ;
- }
- uno::Sequence<uno::Reference<backend::XLayer> >
- retCode(aLayerIds.getLength()) ;
-
- for (sal_Int32 i = 0 ; i < aLayerIds.getLength() ; ++ i) {
- retCode [i] = getLayer(aLayerIds [i], aTimestamps [i]) ;
- }
- return retCode ;
-}
-//------------------------------------------------------------------------------
-
-uno::Reference<backend::XUpdatableLayer> SAL_CALL
-LocalSingleBackend::getUpdatableLayer(const rtl::OUString& aLayerId)
- throw (backend::BackendAccessException, lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- return getFileLayer(aLayerId) ;
-}
-//------------------------------------------------------------------------------
-
-static const rtl::OUString kSchemaSuffix(RTL_CONSTASCII_USTRINGPARAM(".xcs")) ;
-static const rtl::OUString kXMLSchemaParser(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.backend.xml.SchemaParser")) ;
-
-uno::Reference<backend::XSchema> SAL_CALL
- LocalSingleBackend::getComponentSchema(const rtl::OUString& aComponent)
- throw (backend::BackendAccessException, lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- rtl::OUString subPath = componentToPath(aComponent) ;
-
- osl::File * schemaFile = NULL;
- rtl::OUString errorMessage;
- bool bInsufficientAccess = false;
- for (sal_Int32 ix = 0; ix < mSchemaDataUrls.getLength(); ++ix)
- {
- rtl::OUStringBuffer schemaUrl(mSchemaDataUrls[ix]) ;
-
- schemaUrl.append(subPath).append(kSchemaSuffix) ;
-
- rtl::OUString const aFileUrl = schemaUrl.makeStringAndClear();
-
- std::auto_ptr<osl::File> checkFile( new osl::File(aFileUrl) );
- osl::File::RC rc = checkFile->open(OpenFlag_Read) ;
-
- if (rc == osl::File::E_None)
- {
- schemaFile = checkFile.release();
- break;
- }
- else if (rc != osl::File::E_NOENT)
- {
- if (rc == osl::File::E_ACCES)
- bInsufficientAccess =true;
-
- // accumulate error messages
- rtl::OUStringBuffer sMsg(errorMessage);
- if (errorMessage.getLength())
- sMsg.appendAscii("LocalFile SchemaSupplier - Error accessing schema: ");
-
- sMsg.appendAscii("\n- Cannot open input file \"");
- sMsg.append(aFileUrl);
- sMsg.appendAscii("\" : ");
- sMsg.append(FileHelper::createOSLErrorString(rc));
-
- errorMessage = sMsg.makeStringAndClear();
- }
- }
-
- if (NULL == schemaFile)
- {
- if (errorMessage.getLength() != 0)
- {
- // a real error occured
- io::IOException ioe(errorMessage,*this);
-
- rtl::OUStringBuffer sMsg;
- sMsg.appendAscii("LocalFileLayer - Cannot readData: ").append(errorMessage);
-
- if (bInsufficientAccess)
- throw backend::InsufficientAccessRightsException(sMsg.makeStringAndClear(),*this,uno::makeAny(ioe));
- else
- throw backend::BackendAccessException(sMsg.makeStringAndClear(),*this,uno::makeAny(ioe));
- }
- // simply not found
- return NULL;
- }
-
- uno::Sequence<uno::Any> arguments(1) ;
- uno::Reference<io::XInputStream> stream( new OSLInputStreamWrapper(schemaFile, true) );
-
- arguments [0] <<= stream ;
- uno::Reference<backend::XSchema> schema(
- mFactory->createInstanceWithArguments(kXMLSchemaParser, arguments),
- uno::UNO_QUERY) ;
-
- if (!schema.is())
- {
- throw uno::RuntimeException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "Cannot instantiate Schema Parser for ")) + aComponent,
- *this) ;
- }
- return schema ;
-}
-//------------------------------------------------------------------------------
-
-static
-inline
-bool impl_getLayerSubDirectories(rtl::OUString const & aLayerBaseUrl,
- rtl::OUString& aMainLayerUrl,
- rtl::OUString& aSubLayerUrl)
-{
- if (!isValidFileURL(aLayerBaseUrl)) return false;
-
- aMainLayerUrl = aLayerBaseUrl + kDataSubPath ;
- aSubLayerUrl = aLayerBaseUrl + kLocalisedDataSubPath ;
- return true;
-}
-//------------------------------------------------------------------------------
-
-bool LocalSingleBackend::getLayerSubDirectories(rtl::OUString const & aLayerBaseUrl,
- rtl::OUString& aMainLayerUrl,
- rtl::OUString& aSubLayerUrl)
-{
- return impl_getLayerSubDirectories(aLayerBaseUrl,aMainLayerUrl,aSubLayerUrl);
-}
-//------------------------------------------------------------------------------
-
-bool LocalSingleBackend::getLayerDirectories(sal_Int32 aLayerIndex,
- rtl::OUString& aLayerUrl,
- rtl::OUString& aSubLayerUrl)
-{
- OSL_ASSERT(isValidEntity(aLayerIndex));
- rtl::OUString aLayerBaseUrl = (aLayerIndex == k_UserLayerEntity) ? mUserDataUrl : mDefaultDataUrls [entityToIndex(aLayerIndex)] ;
-
- return impl_getLayerSubDirectories(aLayerBaseUrl,aLayerUrl,aSubLayerUrl);
-}
-//------------------------------------------------------------------------------
-
-uno::Reference<backend::XLayer> LocalSingleBackend::createSimpleLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- rtl::OUString const & aComponentUrl)
-{
- SimpleLocalFileLayer * pLayer = new SimpleLocalFileLayer(xFactory, aComponentUrl);
- return pLayer;
-}
-//------------------------------------------------------------------------------
-
-uno::Reference<backend::XLayer> LocalSingleBackend::createSimpleLayer(
- const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- rtl::OUString const & aLayerBaseUrl,
- rtl::OUString const & aComponent)
-{
- rtl::OUString aLayerUrl, aSubLayerUrl;
- if (!impl_getLayerSubDirectories(aLayerBaseUrl,aLayerUrl,aSubLayerUrl))
- return NULL;
-
- SimpleLocalFileLayer * pLayer = new SimpleLocalFileLayer(xFactory, aLayerUrl, componentToPath(aComponent) + kDataSuffix);
- return pLayer;
-}
-//------------------------------------------------------------------------------
-
-
-uno::Reference<backend::XUpdatableLayer> LocalSingleBackend::getFileLayer(const rtl::OUString& aLayerId)
- throw (lang::IllegalArgumentException)
-{
- rtl::OUString fileUrl ;
- sal_Int32 defaultIndex = resolveLayerId(aLayerId, fileUrl) ;
-
- return getFileLayer(fileUrl, defaultIndex) ;
-}
-//------------------------------------------------------------------------------
-
-uno::Reference<backend::XUpdatableLayer> LocalSingleBackend::getFileLayer(
- const rtl::OUString& aComponent, sal_Int32 aLayerIndex) {
- rtl::OUString layerPath ;
- rtl::OUString subLayerPath ;
-
- if (!getLayerDirectories(aLayerIndex, layerPath, subLayerPath))
- {
- OSL_ENSURE(aLayerIndex == k_UserLayerEntity, "Unexpected: Invalid non-user layer url");
-
- rtl::OUStringBuffer sMsg;
- sMsg.appendAscii("LocalSingleBackend: Cannot create file layer - Layer URL '");
- sMsg.append(mUserDataUrl).appendAscii("' is invalid.");
-
- throw lang::IllegalArgumentException(sMsg.makeStringAndClear(),*this,1);
- }
-
- return createUpdatableLocalFileLayer(mFactory, layerPath, aComponent, subLayerPath) ;
-}
-//------------------------------------------------------------------------------
-
-static const sal_Char * const kImplementation =
- "com.sun.star.comp.configuration.backend.LocalSingleBackend" ;
-static const sal_Char * const kBackendService =
- "com.sun.star.configuration.backend.SingleBackend" ;
-static const sal_Char * const kLocalService =
- "com.sun.star.configuration.backend.LocalSingleBackend" ;
-
-static sal_Char const * kServiceNames [] = { kLocalService, 0, kBackendService, 0 } ;
-static const ServiceImplementationInfo kServiceInfo = { kImplementation, kServiceNames, kServiceNames + 2 } ;
-
-const ServiceRegistrationInfo *getLocalBackendServiceInfo()
-{ return getRegistrationInfo(&kServiceInfo) ; }
-
-uno::Reference<uno::XInterface> SAL_CALL
-instantiateLocalBackend(const uno::Reference< uno::XComponentContext >& xContext) {
- return *new LocalSingleBackend(xContext) ;
-}
-
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL LocalSingleBackend::getImplementationName(void)
- throw (uno::RuntimeException)
-{
- return ServiceInfoHelper(&kServiceInfo).getImplementationName() ;
-}
-//------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL LocalSingleBackend::supportsService(
- const rtl::OUString& aServiceName)
- throw (uno::RuntimeException)
-{
- return ServiceInfoHelper(&kServiceInfo).supportsService(aServiceName);
-}
-//------------------------------------------------------------------------------
-
-uno::Sequence<rtl::OUString>
-SAL_CALL LocalSingleBackend::getSupportedServiceNames(void)
- throw (uno::RuntimeException)
-{
- return ServiceInfoHelper(&kServiceInfo).getSupportedServiceNames() ;
-}
-
-// ---------------------------------------------------------------------------------------
-
-} } // configmgr.localbe
diff --git a/configmgr/source/localbe/localsinglebackend.hxx b/configmgr/source/localbe/localsinglebackend.hxx
deleted file mode 100644
index 2c9af1be33..0000000000
--- a/configmgr/source/localbe/localsinglebackend.hxx
+++ /dev/null
@@ -1,245 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_LOCALBE_LOCALSINGLEBACKEND_HXX_
-#define CONFIGMGR_LOCALBE_LOCALSINGLEBACKEND_HXX_
-
-#include <com/sun/star/configuration/backend/XSchemaSupplier.hpp>
-#include <com/sun/star/configuration/backend/XMultiLayerStratum.hpp>
-#include <com/sun/star/configuration/backend/XBackendEntities.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/configuration/InvalidBootstrapFileException.hpp>
-#include <com/sun/star/configuration/backend/CannotConnectException.hpp>
-#include <cppuhelper/compbase5.hxx>
-
-namespace configmgr { namespace localbe {
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-
-/**
- Implements the SingleBackend service for local file access.
- Layer identifiers in that backend are file URLs.
- */
-class LocalSingleBackend : public cppu::WeakComponentImplHelper5<backend::XSchemaSupplier, backend::XMultiLayerStratum, backend::XBackendEntities, lang::XInitialization, lang::XServiceInfo> {
- public :
- /**
- Service constructor from a service factory.
-
- @param xFactory service factory
- */
- LocalSingleBackend(const uno::Reference<uno::XComponentContext>& xContext) ;
-
- /** Destructor */
- ~LocalSingleBackend(void) ;
-
-
- // XInitialize
- virtual void SAL_CALL
- initialize( const uno::Sequence<uno::Any>& aParameters)
- throw (uno::RuntimeException, uno::Exception,
- css::configuration::InvalidBootstrapFileException,
- backend::CannotConnectException,
- backend::BackendSetupException);
-
- // XSchemaSupplier
- virtual uno::Reference<backend::XSchema> SAL_CALL
- getComponentSchema( const rtl::OUString& aComponent )
- throw (backend::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
-
- // XMultiLayerStratum
- virtual uno::Sequence<rtl::OUString> SAL_CALL
- listLayerIds( const rtl::OUString& aComponent, const rtl::OUString& aEntity )
- throw (backend::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
-
- virtual rtl::OUString SAL_CALL
- getUpdateLayerId( const rtl::OUString& aComponent, const rtl::OUString& aEntity )
- throw (backend::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
-
- virtual uno::Reference<backend::XLayer> SAL_CALL
- getLayer( const rtl::OUString& aLayerId, const rtl::OUString& aTimestamp )
- throw (backend::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
-
- virtual uno::Sequence<uno::Reference<backend::XLayer> > SAL_CALL
- getLayers(const uno::Sequence<rtl::OUString>& aLayerIds,
- const rtl::OUString& aTimestamp)
- throw (backend::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
-
- virtual uno::Sequence<uno::Reference<backend::XLayer> > SAL_CALL
- getMultipleLayers(const uno::Sequence<rtl::OUString>& aLayerIds,
- const uno::Sequence<rtl::OUString>& aTimestamps)
- throw (backend::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
-
- virtual uno::Reference<backend::XUpdatableLayer> SAL_CALL
- getUpdatableLayer( const rtl::OUString& aLayerId )
- throw (backend::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
-
- // XBackendEntities
- virtual rtl::OUString SAL_CALL
- getOwnerEntity( )
- throw (uno::RuntimeException);
-
- virtual rtl::OUString SAL_CALL
- getAdminEntity( )
- throw (uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- supportsEntity( const rtl::OUString& aEntity )
- throw (backend::BackendAccessException, uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- isEqualEntity( const rtl::OUString& aEntity, const rtl::OUString& aOtherEntity )
- throw (backend::BackendAccessException, lang::IllegalArgumentException, uno::RuntimeException);
-
- // XServiceInfo
- virtual rtl::OUString SAL_CALL
- getImplementationName( )
- throw (uno::RuntimeException) ;
-
- virtual sal_Bool SAL_CALL
- supportsService( const rtl::OUString& aServiceName )
- throw (uno::RuntimeException) ;
-
- virtual uno::Sequence<rtl::OUString> SAL_CALL
- getSupportedServiceNames( )
- throw (uno::RuntimeException) ;
-
- public: // helpers for other implementation that need to use the same data
- /**
- Locates the main layer data and localized data directories in a layer directory hierarchy
- */
- static bool getLayerSubDirectories( rtl::OUString const & aLayerBaseUrl,
- rtl::OUString& aMainLayerUrl,
- rtl::OUString& aSubLayerUrl);
- /**
- Creates a simple readonly non-composite layer for a component in a base directory
- */
- static uno::Reference<backend::XLayer>
- createSimpleLayer(const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- rtl::OUString const & aLayerBaseUrl,
- rtl::OUString const & aComponent);
-
- /**
- Creates a simple readonly non-composite layer for a component in a given file
- */
- static uno::Reference<backend::XLayer>
- createSimpleLayer(const uno::Reference<lang::XMultiServiceFactory>& xFactory,
- rtl::OUString const & aComponentUrl);
- private :
- /** Service factory */
- uno::Reference<lang::XMultiServiceFactory> mFactory ;
- /** Mutex for resources protection */
- osl::Mutex mMutex ;
- /**
- Base of the schema data. Is a list to allow
- for multiple schema directories.
- */
- uno::Sequence<rtl::OUString> mSchemaDataUrls ;
- /**
- Base of the default data. Is a list to allow
- for multiple layers of default data.
- */
- uno::Sequence<rtl::OUString> mDefaultDataUrls ;
- /** Base of the user data */
- rtl::OUString mUserDataUrl ;
-
- /** special index for entity */
- sal_Int32 findEntity(rtl::OUString const & _aEntity);
- /** parse and translate layer-id */
- sal_Int32 resolveLayerId(rtl::OUString const & _aLayerId, rtl::OUString & _aFile);
-
- /**
- Builds a LocalFileLayer object given a layer id.
- Since the LocalFileLayer implements the various
- interfaces a layer can be accessed as, a few methods
- need one. This method handles the layer id mapping
- and the existence or not of sublayers.
-
- @param aLayerId layer id
- @return local file layer
- @throws com::sun::star::lang::IllegalArgumentException
- if the layer id is invalid.
- */
- uno::Reference<backend::XUpdatableLayer> getFileLayer(const rtl::OUString& aLayerId)
- throw (lang::IllegalArgumentException) ;
- /**
- Same as above, but using a component URL and layer index
- combination instead of a layer id (which encodes both).
-
- @param aComponent component URL
- @param aLayerIndex layer index
- @return local file layer
- */
- uno::Reference<backend::XUpdatableLayer> getFileLayer(const rtl::OUString& aComponent,
- sal_Int32 aLayerIndex) ;
- /**
- Maps a layer index (-1 for user layer, 0-x for defaults)
- to the appropriate layer and sublayers base directories.
-
- @param aLayerIndex layer index
- @param aLayerUrl layer base URL, filled on return
- @param aSubLayerUrl sublayer base URL, filled on return
- */
- bool getLayerDirectories(sal_Int32 aLayerIndex,
- rtl::OUString& aLayerUrl,
- rtl::OUString& aSubLayerUrl) ;
- /**
- Tells if a file is more recent than a given date.
- The date is formatted YYYYMMDDhhmmssZ.
-
- @param aComponent URL of the component to check
- @param aLayerIndex index of the layer involved (-1 = user)
- @param aTimestamp timestamp to check against
- @return sal_True if the file is more recent, sal_False otherwise
- */
- sal_Bool isMoreRecent(const rtl::OUString& aComponent,
- sal_Int32 aLayerId,
- const rtl::OUString& aTimestamp) ;
- } ;
-
-} } // configmgr.localbe
-
-#endif // CONFIGMGR_LOCALBE_LOCALSINGLEBACKEND_HXX_
diff --git a/configmgr/source/localbe/localsinglestratum.cxx b/configmgr/source/localbe/localsinglestratum.cxx
deleted file mode 100644
index c60e44f659..0000000000
--- a/configmgr/source/localbe/localsinglestratum.cxx
+++ /dev/null
@@ -1,230 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "localsinglestratum.hxx"
-#include "localfilehelper.hxx"
-
-#ifndef CONFIGMGR_API_FACTORY_HXX_
-#include "confapifactory.hxx"
-#endif // CONFIGMGR_API_FACTORY_HXX_
-#include "serviceinfohelper.hxx"
-#include <rtl/ustrbuf.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/configuration/backend/InsufficientAccessRightsException.hpp>
-
-namespace configmgr { namespace localbe {
-
-//==============================================================================
-
-static inline rtl::OUString getDataSubPath()
-{ return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/data")); }
-
-static inline rtl::OUString getLocalisedDataSubPath()
-{ return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/res")); }
-//------------------------------------------------------------------------------
-
-LocalSingleStratumBase::LocalSingleStratumBase(const uno::Reference<uno::XComponentContext>& xContext)
-: cppu::ImplInheritanceHelper1< LocalStratumBase, backend::XSingleLayerStratum >(xContext)
-{
-}
-//------------------------------------------------------------------------------
-
-LocalSingleStratumBase::~LocalSingleStratumBase() {}
-
-//------------------------------------------------------------------------------
-uno::Reference<backend::XLayer> SAL_CALL
- LocalSingleStratumBase::getLayer( const rtl::OUString& aComponent, const rtl::OUString& aTimestamp )
- throw (backend::BackendAccessException, lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- return LocalStratumBase::getLayer(aComponent,aTimestamp);
-}
-//------------------------------------------------------------------------------
-uno::Reference<backend::XUpdatableLayer> SAL_CALL
- LocalSingleStratumBase::getUpdatableLayer(const rtl::OUString& aComponent)
- throw (backend::BackendAccessException, lang::IllegalArgumentException,
- lang::NoSupportException, uno::RuntimeException)
-{
- if (aComponent.getLength() == 0){
- throw lang::IllegalArgumentException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "LocalSingleStratum:getLayer - no component specified")),
- *this, 0) ;
- }
- rtl::OUString const componentSubPath = componentToPath(aComponent) + getDataSuffix();
- return createUpdatableFileLayer( componentSubPath) ;
-}
-//------------------------------------------------------------------------------
-uno::Reference<backend::XUpdatableLayer> SAL_CALL
- LocalReadonlyStratum::getUpdatableLayer(const rtl::OUString& /*aComponent*/)
- throw (backend::BackendAccessException, lang::IllegalArgumentException,
- lang::NoSupportException, uno::RuntimeException)
-{
- failReadonly();
- return 0;
-}
-uno::Reference<backend::XUpdatableLayer> SAL_CALL
- LocalResourceStratum::getUpdatableLayer(const rtl::OUString& /*aComponent*/)
- throw (backend::BackendAccessException, lang::IllegalArgumentException,
- lang::NoSupportException, uno::RuntimeException)
-{
- failReadonly();
- return 0;
-}
-//------------------------------------------------------------------------------
-static
-inline
-void impl_getLayerDataDirectory(rtl::OUString const & aLayerBaseUrl,
- rtl::OUString& aMainLayerUrl)
-{
- aMainLayerUrl = aLayerBaseUrl + getDataSubPath() ;
-}
-//------------------------------------------------------------------------------
-static
-inline
-void impl_getLayerResDirectory(rtl::OUString const & aLayerBaseUrl,
- rtl::OUString& aSubLayerUrl)
-{
- aSubLayerUrl = aLayerBaseUrl + getLocalisedDataSubPath() ;
-}
-//------------------------------------------------------------------------------
-
-void LocalSingleStratum::getLayerDirectories(rtl::OUString& aLayerUrl,
- rtl::OUString& aSubLayerUrl) const
-{
- impl_getLayerDataDirectory(getBaseUrl(),aLayerUrl);
- impl_getLayerResDirectory(getBaseUrl(),aSubLayerUrl);
-}
-//------------------------------------------------------------------------------
-
-void LocalDataStratum::getLayerDirectories(rtl::OUString& aLayerUrl,
- rtl::OUString& aSubLayerUrl) const
-{
- impl_getLayerDataDirectory(getBaseUrl(),aLayerUrl);
- aSubLayerUrl = rtl::OUString();
-}
-//------------------------------------------------------------------------------
-
-void LocalReadonlyStratum::getLayerDirectories(rtl::OUString& aLayerUrl,
- rtl::OUString& aSubLayerUrl) const
-{
- impl_getLayerDataDirectory(getBaseUrl(),aLayerUrl);
- aSubLayerUrl = rtl::OUString();
-}
-//------------------------------------------------------------------------------
-
-void LocalResourceStratum::adjustBaseURL(rtl::OUString& aBaseUrl)
-{
- impl_getLayerResDirectory(aBaseUrl,aBaseUrl);
-}
-//------------------------------------------------------------------------------
-
-void LocalResourceStratum::getLayerDirectories(rtl::OUString& aLayerUrl,
- rtl::OUString& aSubLayerUrl) const
-{
- aLayerUrl = rtl::OUString();
- aSubLayerUrl = getBaseUrl();
- // impl_getLayerResDirectory(getBaseUrl(),aSubLayerUrl);
-}
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-static const sal_Char * const kLegacyStratumImplementation =
- "com.sun.star.comp.configuration.backend.LocalSingleStratum" ;
-static const sal_Char * const kDataStratumImplementation =
- "com.sun.star.comp.configuration.backend.LocalStratum" ;
-static const sal_Char * const kReadonlyStratumImplementation =
- "com.sun.star.comp.configuration.backend.LocalReadonlyStratum" ;
-static const sal_Char * const kResourceStratumImplementation =
- "com.sun.star.comp.configuration.backend.LocalResourceStratum" ;
-static const sal_Char * const kBackendService =
- "com.sun.star.configuration.backend.SingleStratum" ;
-static const sal_Char * const kLocalService =
- "com.sun.star.configuration.backend.LocalSingleStratum" ;
-
-static sal_Char const * kServiceNames [] = { kLocalService, 0, kBackendService, 0 } ;
-static const ServiceImplementationInfo kLegacyStratumServiceInfo = { kLegacyStratumImplementation , kServiceNames, kServiceNames + 2 } ;
-static const ServiceImplementationInfo kDataStratumServiceInfo = { kDataStratumImplementation , kServiceNames, kServiceNames + 2 } ;
-static const ServiceImplementationInfo kReadonlyStratumServiceInfo = { kReadonlyStratumImplementation, kServiceNames, kServiceNames + 2 } ;
-static const ServiceImplementationInfo kResourceStratumServiceInfo = { kResourceStratumImplementation, kServiceNames, kServiceNames + 2 } ;
-
-const ServiceRegistrationInfo *getLocalLegacyStratumServiceInfo()
-{ return getRegistrationInfo(&kLegacyStratumServiceInfo) ; }
-
-const ServiceRegistrationInfo *getLocalDataStratumServiceInfo()
-{ return getRegistrationInfo(&kDataStratumServiceInfo) ; }
-
-const ServiceRegistrationInfo *getLocalReadonlyStratumServiceInfo()
-{ return getRegistrationInfo(&kReadonlyStratumServiceInfo) ; }
-
-const ServiceRegistrationInfo *getLocalResourceStratumServiceInfo()
-{ return getRegistrationInfo(&kResourceStratumServiceInfo) ; }
-
-uno::Reference<uno::XInterface> SAL_CALL
-instantiateLocalLegacyStratum(const uno::Reference< uno::XComponentContext >& xContext) {
- return *new LocalSingleStratum(xContext) ;
-}
-
-uno::Reference<uno::XInterface> SAL_CALL
-instantiateLocalDataStratum(const uno::Reference< uno::XComponentContext >& xContext) {
- return *new LocalDataStratum(xContext) ;
-}
-
-uno::Reference<uno::XInterface> SAL_CALL
-instantiateLocalReadonlyStratum(const uno::Reference< uno::XComponentContext >& xContext) {
- return *new LocalReadonlyStratum(xContext) ;
-}
-
-uno::Reference<uno::XInterface> SAL_CALL
-instantiateLocalResourceStratum(const uno::Reference< uno::XComponentContext >& xContext) {
- return *new LocalResourceStratum(xContext) ;
-}
-//------------------------------------------------------------------------------
-
-const ServiceImplementationInfo * LocalSingleStratum::getServiceInfoData() const
-{
- return &kLegacyStratumServiceInfo;
-}
-const ServiceImplementationInfo * LocalDataStratum::getServiceInfoData() const
-{
- return &kDataStratumServiceInfo;
-}
-const ServiceImplementationInfo * LocalReadonlyStratum::getServiceInfoData() const
-{
- return &kReadonlyStratumServiceInfo;
-}
-const ServiceImplementationInfo * LocalResourceStratum::getServiceInfoData() const
-{
- return &kResourceStratumServiceInfo;
-}
-//------------------------------------------------------------------------------
-// ---------------------------------------------------------------------------------------
-
-} } // configmgr.localsinglestratum
diff --git a/configmgr/source/localbe/localsinglestratum.hxx b/configmgr/source/localbe/localsinglestratum.hxx
deleted file mode 100644
index 04d5da135c..0000000000
--- a/configmgr/source/localbe/localsinglestratum.hxx
+++ /dev/null
@@ -1,147 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_LOCALBE_LOCALSINGLESTRATUM_HXX_
-#define CONFIGMGR_LOCALBE_LOCALSINGLESTRATUM_HXX_
-
-#include "localstratumbase.hxx"
-#include <com/sun/star/configuration/backend/XSingleLayerStratum.hpp>
-#include <cppuhelper/implbase1.hxx>
-
-namespace configmgr
-{
- namespace localbe
- {
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-
-/**
- Implements the SingleLayerStratum service for local file access.
- */
-class LocalSingleStratumBase : public cppu::ImplInheritanceHelper1< LocalStratumBase, backend::XSingleLayerStratum >
-{
-public :
- /**
- Service constructor from a service factory.
-
- @param xContext component context
- */
- LocalSingleStratumBase(const uno::Reference<uno::XComponentContext>& xContext) ;
-
- /** Destructor */
- ~LocalSingleStratumBase() ;
-
-
- // XSingleLayerStratum
- virtual uno::Reference<backend::XLayer> SAL_CALL
- getLayer( const rtl::OUString& aLayerId, const rtl::OUString& aTimestamp )
- throw (backend::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
-
- virtual uno::Reference<backend::XUpdatableLayer> SAL_CALL
- getUpdatableLayer( const rtl::OUString& aLayerId )
- throw (backend::BackendAccessException,
- lang::IllegalArgumentException,
- lang::NoSupportException,
- uno::RuntimeException) ;
-
-} ;
-
-class LocalSingleStratum : public LocalSingleStratumBase
-{
-public:
- LocalSingleStratum(const uno::Reference<uno::XComponentContext>& xContext)
- : LocalSingleStratumBase(xContext)
- {};
-
-private:
- virtual void getLayerDirectories(rtl::OUString& aLayerUrl, rtl::OUString& aSubLayerUrl) const;
- virtual const ServiceImplementationInfo * getServiceInfoData() const;
-};
-
-class LocalDataStratum : public LocalSingleStratumBase
-{
-public:
- LocalDataStratum(const uno::Reference<uno::XComponentContext>& xContext)
- : LocalSingleStratumBase(xContext)
- {};
-
-private:
- virtual void getLayerDirectories(rtl::OUString& aLayerUrl, rtl::OUString& aSubLayerUrl) const;
- virtual const ServiceImplementationInfo * getServiceInfoData() const;
-};
-
-class LocalReadonlyStratum : public LocalSingleStratumBase
-{
-public:
- LocalReadonlyStratum(const uno::Reference<uno::XComponentContext>& xContext)
- : LocalSingleStratumBase(xContext)
- {};
-
- // XSingleLayerStratum - readonly implementation
- virtual uno::Reference<backend::XUpdatableLayer> SAL_CALL
- getUpdatableLayer( const rtl::OUString& aLayerId )
- throw (backend::BackendAccessException,
- lang::IllegalArgumentException,
- lang::NoSupportException,
- uno::RuntimeException) ;
-
-private:
- virtual void getLayerDirectories(rtl::OUString& aLayerUrl, rtl::OUString& aSubLayerUrl) const;
- virtual const ServiceImplementationInfo * getServiceInfoData() const;
-};
-
-class LocalResourceStratum : public LocalSingleStratumBase
-{
-public:
- LocalResourceStratum(const uno::Reference<uno::XComponentContext>& xContext)
- : LocalSingleStratumBase(xContext)
- {};
-
- // XSingleLayerStratum - readonly implementation
- virtual uno::Reference<backend::XUpdatableLayer> SAL_CALL
- getUpdatableLayer( const rtl::OUString& aLayerId )
- throw (backend::BackendAccessException,
- lang::IllegalArgumentException,
- lang::NoSupportException,
- uno::RuntimeException) ;
-
-private:
- virtual void adjustBaseURL(rtl::OUString& aBaseURL);
- virtual void getLayerDirectories(rtl::OUString& aLayerUrl, rtl::OUString& aSubLayerUrl) const;
- virtual const ServiceImplementationInfo * getServiceInfoData() const;
-};
-
-
-
-} } // configmgr.localbe
-
-#endif
diff --git a/configmgr/source/localbe/localstratumbase.cxx b/configmgr/source/localbe/localstratumbase.cxx
deleted file mode 100644
index 7ade0bbefd..0000000000
--- a/configmgr/source/localbe/localstratumbase.cxx
+++ /dev/null
@@ -1,253 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "localstratumbase.hxx"
-#include "localfilehelper.hxx"
-#include "localfilelayer.hxx"
-#include "oslstream.hxx"
-#include "serviceinfohelper.hxx"
-#include "bootstrap.hxx"
-#include "filehelper.hxx"
-#include <rtl/ustrbuf.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/NoSupportException.hpp>
-#include <com/sun/star/configuration/backend/InsufficientAccessRightsException.hpp>
-#include <osl/file.hxx>
-#include <osl/process.h>
-#include <memory>
-
-namespace configmgr { namespace localbe {
-
-//==============================================================================
-
-//------------------------------------------------------------------------------
-
-LocalStratumBase::LocalStratumBase(const uno::Reference<uno::XComponentContext>& xContext)
-: cppu::WeakComponentImplHelper3<lang::XInitialization, backend::XBackendEntities, lang::XServiceInfo>(mMutex)
-, mFactory(xContext->getServiceManager(),uno::UNO_QUERY)
-{
-}
-//------------------------------------------------------------------------------
-
-LocalStratumBase::~LocalStratumBase()
-{}
-
-//------------------------------------------------------------------------------
-void SAL_CALL LocalStratumBase::initialize(const uno::Sequence<uno::Any>& aParameters)
- throw (uno::RuntimeException, uno::Exception,
- css::configuration::InvalidBootstrapFileException,
- backend::CannotConnectException,
- backend::BackendSetupException)
-{
-
-
-
- if (aParameters.getLength() == 0)
- {
- throw lang::IllegalArgumentException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "No parameters provided to local Stratum")),
- *this, 0) ;
- }
-
-
- for (sal_Int32 i = 0 ; i < aParameters.getLength() ; ++ i)
- {
- if (aParameters [i] >>= mStrataDataUrl )
- { break ; }
-
- }
-
- // get modified base for special layer implementations (e.g. resources)
- this->adjustBaseURL(mStrataDataUrl);
-
- validateFileURL(mStrataDataUrl, *this);
- implEnsureAbsoluteURL(mStrataDataUrl);
- normalizeURL(mStrataDataUrl,*this, true);
-
- if(FileHelper::fileExists(mStrataDataUrl))
- {
- checkIfDirectory(mStrataDataUrl, *this);
- }
-}
-
-//------------------------------------------------------------------------------
-
-void LocalStratumBase::adjustBaseURL(rtl::OUString& )
-{
-}
-//------------------------------------------------------------------------------
-
-sal_Bool LocalStratumBase::isMoreRecent(const rtl::OUString& aFileUrl,
- const rtl::OUString& aTimestamp) {
- rtl::OUString layerUrl ;
- rtl::OUString subLayerUrl ;
-
- getLayerDirectories(layerUrl, subLayerUrl) ;
-
- return layerUrl.getLength() == 0 ||
- !BasicLocalFileLayer::getTimestamp(layerUrl + aFileUrl).equals( aTimestamp);
-}
-//------------------------------------------------------------------------------
-
-uno::Reference<backend::XLayer> SAL_CALL
- LocalStratumBase::getLayer( const rtl::OUString& aLayerId, const rtl::OUString& aTimestamp )
- throw (backend::BackendAccessException, lang::IllegalArgumentException,
- uno::RuntimeException)
-{
-
- if (aLayerId.getLength() == 0){
- throw lang::IllegalArgumentException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "LocalStratum:getLayer - no LayerId specified")),
- *this, 0) ;
- }
- rtl::OUString const componentSubPath = layeridToPath(aLayerId) + getDataSuffix();
- if (!isMoreRecent(componentSubPath, aTimestamp)) { return NULL ; }
-
- return createReadonlyFileLayer(componentSubPath);
-}
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL LocalStratumBase::getOwnerEntity()
- throw (uno::RuntimeException)
-{
- return mStrataDataUrl ;
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL LocalStratumBase::getAdminEntity()
- throw (uno::RuntimeException)
-{
- return rtl::OUString();
-}
-//------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL LocalStratumBase::supportsEntity( const rtl::OUString& aEntity )
- throw (backend::BackendAccessException, uno::RuntimeException)
-{
- if(mStrataDataUrl.getLength() == 0)
- {
- return false;
- }
- if (aEntity.getLength() == 0)
- {
- return false;
- }
- return isEqualEntity(mStrataDataUrl,aEntity);
-}
-//------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL LocalStratumBase::isEqualEntity(const rtl::OUString& aEntity, const rtl::OUString& aOtherEntity)
- throw (backend::BackendAccessException, lang::IllegalArgumentException, uno::RuntimeException)
-{
- if (aEntity.getLength() == 0)
- {
- rtl::OUString const sMsg(RTL_CONSTASCII_USTRINGPARAM(
- "LocalSingleBackend - Invalid empty entity."));
-
- throw lang::IllegalArgumentException(sMsg, *this, 1);
- }
- if (aOtherEntity.getLength() == 0)
- {
- rtl::OUString const sMsg(RTL_CONSTASCII_USTRINGPARAM(
- "LocalSingleBackend - Invalid empty entity."));
-
- throw lang::IllegalArgumentException(sMsg, *this, 2);
- }
- rtl::OUString aNormalizedEntity(aEntity);
- normalizeURL(aNormalizedEntity,*this);
-
- rtl::OUString aNormalizedOther(aOtherEntity);
- normalizeURL(aNormalizedOther,*this);
-
- return aNormalizedEntity == aNormalizedOther;
-}
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-uno::Reference<backend::XLayer>
- LocalStratumBase::createReadonlyFileLayer(const rtl::OUString& aSubpath)
- throw (lang::IllegalArgumentException)
-{
- rtl::OUString layerPath ;
- rtl::OUString subLayerPath ;
-
- getLayerDirectories(layerPath, subLayerPath) ;
- return createReadonlyLocalFileLayer(mFactory, layerPath, aSubpath, subLayerPath) ;
-}
-//------------------------------------------------------------------------------
-uno::Reference<backend::XUpdatableLayer>
- LocalStratumBase::createUpdatableFileLayer(const rtl::OUString& aSubpath)
- throw (lang::IllegalArgumentException)
-{
- rtl::OUString layerPath ;
- rtl::OUString subLayerPath ;
-
- getLayerDirectories(layerPath, subLayerPath) ;
- return createUpdatableLocalFileLayer(mFactory, layerPath, aSubpath, subLayerPath) ;
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL LocalStratumBase::getImplementationName()
- throw (uno::RuntimeException)
-{
- return ServiceInfoHelper(getServiceInfoData()).getImplementationName() ;
-}
-//------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL LocalStratumBase::supportsService(const rtl::OUString& aServiceName)
- throw (uno::RuntimeException)
-{
- return ServiceInfoHelper(getServiceInfoData()).supportsService(aServiceName);
-}
-//------------------------------------------------------------------------------
-
-uno::Sequence<rtl::OUString> SAL_CALL LocalStratumBase::getSupportedServiceNames()
- throw (uno::RuntimeException)
-{
- return ServiceInfoHelper(getServiceInfoData()).getSupportedServiceNames() ;
-}
-
-// ---------------------------------------------------------------------------------------
-
-void LocalStratumBase::failReadonly()
-{
- rtl::OUStringBuffer aMessage;
- aMessage.appendAscii("Configurations - ")
- .appendAscii("Cannot get update access to layer: ")
- .appendAscii("Local file-based stratum at ")
- .append(this->getBaseUrl())
- .appendAscii(" is readonly.");
- throw lang::NoSupportException(aMessage.makeStringAndClear(),*this);
-}
-//------------------------------------------------------------------------------
-
-} } // configmgr.localsinglestratum
diff --git a/configmgr/source/localbe/localstratumbase.hxx b/configmgr/source/localbe/localstratumbase.hxx
deleted file mode 100644
index 251905c502..0000000000
--- a/configmgr/source/localbe/localstratumbase.hxx
+++ /dev/null
@@ -1,199 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_LOCALBE_LOCALSTRATUMBASE_HXX_
-#define CONFIGMGR_LOCALBE_LOCALSTRATUMBASE_HXX_
-
-#include <com/sun/star/configuration/backend/XBackendEntities.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/configuration/backend/XUpdatableLayer.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/configuration/InvalidBootstrapFileException.hpp>
-#include <com/sun/star/configuration/backend/CannotConnectException.hpp>
-#include <cppuhelper/compbase3.hxx>
-
-namespace configmgr
-{
- struct ServiceImplementationInfo;
-
- namespace localbe
- {
-//------------------------------------------------------------------------------
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-//------------------------------------------------------------------------------
-
-struct LocalStratumMutexHolder { osl::Mutex mMutex; };
-//------------------------------------------------------------------------------
-static const char kLocalDataSuffix[] = ".xcu";
-//------------------------------------------------------------------------------
-
-/**
- Helper for implementing the [Single|Multi]LayerStratum service for local file access.
- */
-class LocalStratumBase : protected LocalStratumMutexHolder, public cppu::WeakComponentImplHelper3<lang::XInitialization, backend::XBackendEntities, lang::XServiceInfo>
-{
-protected :
- /**
- Service constructor from a service factory.
-
- @param xContext component context
- */
- LocalStratumBase(const uno::Reference<uno::XComponentContext>& xContext) ;
-
- /** Destructor */
- ~LocalStratumBase() ;
-
-
-public:
- // XInitialize
- virtual void SAL_CALL
- initialize( const uno::Sequence<uno::Any>& aParameters)
- throw (uno::RuntimeException, uno::Exception,
- css::configuration::InvalidBootstrapFileException,
- backend::CannotConnectException,
- backend::BackendSetupException);
-
-
- // XBackendEntities
- virtual rtl::OUString SAL_CALL
- getOwnerEntity( )
- throw (uno::RuntimeException);
-
- virtual rtl::OUString SAL_CALL
- getAdminEntity( )
- throw (uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- supportsEntity( const rtl::OUString& aEntity )
- throw (backend::BackendAccessException, uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- isEqualEntity( const rtl::OUString& aEntity, const rtl::OUString& aOtherEntity )
- throw (backend::BackendAccessException, lang::IllegalArgumentException, uno::RuntimeException);
-
- // XServiceInfo
- virtual rtl::OUString SAL_CALL
- getImplementationName( )
- throw (uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- supportsService( const rtl::OUString& aServiceName )
- throw (uno::RuntimeException) ;
-
- virtual uno::Sequence<rtl::OUString> SAL_CALL
- getSupportedServiceNames( )
- throw (uno::RuntimeException) ;
-
-protected:
- rtl::OUString const & getBaseUrl() const
- { return mStrataDataUrl; }
-
- static rtl::OUString getDataSuffix()
- { return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(kLocalDataSuffix)); }
-//------------------------------------------------------------------------------
- /// raise a NoSupportException for an attempt to update this layer
- void failReadonly();
-
- // helper for implementing the stratum getLayer[s] function[s]
- uno::Reference<backend::XLayer> SAL_CALL
- getLayer( const rtl::OUString& aLayerId, const rtl::OUString& aTimestamp )
- throw (backend::BackendAccessException, lang::IllegalArgumentException, uno::RuntimeException);
-
- /**
- Builds a LocalFileLayer object given a subpath
- Since the LocalFileLayer implements the various
- interfaces a layer can be accessed as, a few methods
- need one.
-
- @param aSubpath Subpath
- @return local file layer
- @throws com::sun::star::lang::IllegalArgumentException
- if the subpath is invalid.
- */
- uno::Reference<backend::XLayer> createReadonlyFileLayer(const rtl::OUString& aSubpath)
- throw (lang::IllegalArgumentException) ;
-
- /**
- Builds a LocalFileLayer object given a subpath.
- Since the LocalFileLayer implements the various
- interfaces a layer can be accessed as, a few methods
- need one.
-
- @param aSubpath subpath
- @return local file layer
- @throws com::sun::star::lang::IllegalArgumentException
- if the subpath is invalid.
- */
- uno::Reference<backend::XUpdatableLayer> createUpdatableFileLayer(const rtl::OUString& aSubpath)
- throw (lang::IllegalArgumentException) ;
-
- /**
- Tells if a file is more recent than a given date.
- The date is formatted YYYYMMDDhhmmssZ.
-
- @param aSubpath relative URL of the component to check
- @param aTimestamp timestamp to check against
- @return sal_True if the file is more recent, sal_False otherwise
- */
- sal_Bool isMoreRecent(const rtl::OUString& aSubpath,
- const rtl::OUString& aTimestamp) ;
-
-protected:
- /// Parses and adjusts the passed base URL
- virtual void adjustBaseURL(rtl::OUString& aBaseURL);
-
-private:
- /**
- Retrieves the appropriate layer and sublayers base directories.
-
- @param aLayerUrl layer base URL, filled on return
- @param aSubLayerUrl sublayer base URL, filled on return
- */
- virtual void getLayerDirectories(rtl::OUString& aLayerUrl,
- rtl::OUString& aSubLayerUrl) const = 0;
- virtual const ServiceImplementationInfo * getServiceInfoData() const = 0;
-
-private :
- /** Service factory */
- uno::Reference<lang::XMultiServiceFactory> mFactory ;
- /**
- Base of the strata data.
- */
- rtl::OUString mStrataDataUrl ;
-
-} ;
-
-
-} } // configmgr.localbe
-
-#endif
diff --git a/configmgr/source/localbe/makefile.mk b/configmgr/source/localbe/makefile.mk
deleted file mode 100644
index a0445f7a9d..0000000000
--- a/configmgr/source/localbe/makefile.mk
+++ /dev/null
@@ -1,57 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJINC=$(PRJ)$/source$/inc
-PRJNAME=configmgr
-TARGET=localbe
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings ----------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/makefile.pmk
-
-# --- Files -------------------------------------
-
-SLOFILES=\
- $(SLO)$/localsinglebackend.obj \
- $(SLO)$/localfilelayer.obj \
- $(SLO)$/localoutputstream.obj \
- $(SLO)$/localdataimportsvc.obj \
- $(SLO)$/localhierarchybrowsersvc.obj \
- $(SLO)$/localschemasupplier.obj \
- $(SLO)$/localstratumbase.obj \
- $(SLO)$/localsinglestratum.obj \
- $(SLO)$/localmultistratum.obj \
- $(SLO)$/localfilehelper.obj
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/configmgr/source/localizedpropertynode.cxx b/configmgr/source/localizedpropertynode.cxx
new file mode 100644
index 0000000000..9c5fa3328a
--- /dev/null
+++ b/configmgr/source/localizedpropertynode.cxx
@@ -0,0 +1,87 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include "com/sun/star/uno/Any.hxx"
+#include "rtl/ref.hxx"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+
+#include "localizedpropertynode.hxx"
+#include "node.hxx"
+#include "nodemap.hxx"
+#include "type.hxx"
+
+namespace configmgr {
+
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
+LocalizedPropertyNode::LocalizedPropertyNode(
+ int layer, Type staticType, bool nillable):
+ Node(layer), staticType_(staticType), nillable_(nillable)
+{}
+
+rtl::Reference< Node > LocalizedPropertyNode::clone() const {
+ return new LocalizedPropertyNode(*this);
+}
+
+NodeMap & LocalizedPropertyNode::getMembers() {
+ return members_;
+}
+
+Type LocalizedPropertyNode::getStaticType() const {
+ return staticType_;
+}
+
+bool LocalizedPropertyNode::isNillable() const {
+ return nillable_;
+}
+
+LocalizedPropertyNode::LocalizedPropertyNode(
+ LocalizedPropertyNode const & other):
+ Node(other), staticType_(other.staticType_), nillable_(other.nillable_)
+{
+ cloneNodeMap(other.members_, &members_);
+}
+
+LocalizedPropertyNode::~LocalizedPropertyNode() {}
+
+Node::Kind LocalizedPropertyNode::kind() const {
+ return KIND_LOCALIZED_PROPERTY;
+}
+
+void LocalizedPropertyNode::clear() {
+ members_.clear();
+}
+
+}
diff --git a/configmgr/source/localizedpropertynode.hxx b/configmgr/source/localizedpropertynode.hxx
new file mode 100644
index 0000000000..d5a16af0e5
--- /dev/null
+++ b/configmgr/source/localizedpropertynode.hxx
@@ -0,0 +1,76 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_LOCALIZEDPROPERTYNODE_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_LOCALIZEDPROPERTYNODE_HXX
+
+#include "sal/config.h"
+
+#include "rtl/ref.hxx"
+
+#include "node.hxx"
+#include "nodemap.hxx"
+#include "type.hxx"
+
+namespace com { namespace sun { namespace star { namespace uno {
+ class Any;
+} } } }
+namespace rtl { class OUString; }
+
+namespace configmgr {
+
+class LocalizedPropertyNode: public Node {
+public:
+ LocalizedPropertyNode(int layer, Type staticType, bool nillable);
+
+ virtual rtl::Reference< Node > clone() const;
+
+ virtual NodeMap & getMembers();
+
+ Type getStaticType() const;
+
+ bool isNillable() const;
+
+private:
+ LocalizedPropertyNode(LocalizedPropertyNode const & other);
+
+ virtual ~LocalizedPropertyNode();
+
+ virtual Kind kind() const;
+
+ virtual void clear();
+
+ Type staticType_;
+ // as specified in the component-schema (TYPE_ANY, ...,
+ // TYPE_HEXBINARY_LIST; not TYPE_ERROR or TYPE_NIL)
+ bool nillable_;
+ NodeMap members_;
+};
+
+}
+
+#endif
diff --git a/configmgr/source/localizedvaluenode.cxx b/configmgr/source/localizedvaluenode.cxx
new file mode 100644
index 0000000000..f6246106c8
--- /dev/null
+++ b/configmgr/source/localizedvaluenode.cxx
@@ -0,0 +1,78 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include "com/sun/star/uno/Any.hxx"
+#include "rtl/ref.hxx"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+
+#include "localizedvaluenode.hxx"
+#include "node.hxx"
+
+namespace configmgr {
+
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
+LocalizedValueNode::LocalizedValueNode(int layer, css::uno::Any const & value):
+ Node(layer), value_(value)
+{}
+
+rtl::Reference< Node > LocalizedValueNode::clone() const {
+ return new LocalizedValueNode(*this);
+}
+
+rtl::OUString LocalizedValueNode::getTemplateName() const {
+ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*"));
+}
+
+css::uno::Any LocalizedValueNode::getValue() const {
+ return value_;
+}
+
+void LocalizedValueNode::setValue(int layer, css::uno::Any const & value) {
+ setLayer(layer);
+ value_ = value;
+}
+
+LocalizedValueNode::LocalizedValueNode(LocalizedValueNode const & other):
+ Node(other), value_(other.value_)
+{}
+
+LocalizedValueNode::~LocalizedValueNode() {}
+
+Node::Kind LocalizedValueNode::kind() const {
+ return KIND_LOCALIZED_VALUE;
+}
+
+}
diff --git a/configmgr/source/localizedvaluenode.hxx b/configmgr/source/localizedvaluenode.hxx
new file mode 100644
index 0000000000..7f8a5dd987
--- /dev/null
+++ b/configmgr/source/localizedvaluenode.hxx
@@ -0,0 +1,66 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_LOCALIZEDVALUENODE_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_LOCALIZEDVALUENODE_HXX
+
+#include "sal/config.h"
+
+#include "com/sun/star/uno/Any.hxx"
+#include "rtl/ref.hxx"
+
+#include "node.hxx"
+
+namespace rtl { class OUString; }
+
+namespace configmgr {
+
+class LocalizedValueNode: public Node {
+public:
+ LocalizedValueNode(int layer, com::sun::star::uno::Any const & value);
+
+ virtual rtl::Reference< Node > clone() const;
+
+ virtual rtl::OUString getTemplateName() const;
+
+ com::sun::star::uno::Any getValue() const;
+
+ void setValue(int layer, com::sun::star::uno::Any const & value);
+
+private:
+ LocalizedValueNode(LocalizedValueNode const & other);
+
+ virtual ~LocalizedValueNode();
+
+ virtual Kind kind() const;
+
+ com::sun::star::uno::Any value_;
+};
+
+}
+
+#endif
diff --git a/configmgr/source/lock.cxx b/configmgr/source/lock.cxx
new file mode 100644
index 0000000000..dc7f26a34e
--- /dev/null
+++ b/configmgr/source/lock.cxx
@@ -0,0 +1,39 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include "osl/mutex.hxx"
+
+#include "lock.hxx"
+
+namespace configmgr {
+
+osl::Mutex lock;
+
+}
diff --git a/configmgr/source/lock.hxx b/configmgr/source/lock.hxx
new file mode 100644
index 0000000000..b541f48fbe
--- /dev/null
+++ b/configmgr/source/lock.hxx
@@ -0,0 +1,41 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_LOCK_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_LOCK_HXX
+
+#include "sal/config.h"
+
+#include "osl/mutex.hxx"
+
+namespace configmgr {
+
+extern osl::Mutex lock;
+
+}
+
+#endif
diff --git a/configmgr/source/makefile.mk b/configmgr/source/makefile.mk
new file mode 100644
index 0000000000..d6972e12b9
--- /dev/null
+++ b/configmgr/source/makefile.mk
@@ -0,0 +1,83 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#***********************************************************************/
+
+PRJ = ..
+PRJNAME = configmgr
+TARGET = configmgr
+
+ENABLE_EXCEPTIONS = TRUE
+VISIBILITY_HIDDEN = TRUE
+
+.INCLUDE: settings.mk
+
+CDEFS += -DOOO_DLLIMPLEMENTATION_CONFIGMGR
+
+SLOFILES = \
+ $(SLO)/access.obj \
+ $(SLO)/broadcaster.obj \
+ $(SLO)/childaccess.obj \
+ $(SLO)/components.obj \
+ $(SLO)/configurationprovider.obj \
+ $(SLO)/configurationregistry.obj \
+ $(SLO)/data.obj \
+ $(SLO)/defaultprovider.obj \
+ $(SLO)/groupnode.obj \
+ $(SLO)/localizedpropertynode.obj \
+ $(SLO)/localizedvaluenode.obj \
+ $(SLO)/lock.obj \
+ $(SLO)/modifications.obj \
+ $(SLO)/node.obj \
+ $(SLO)/nodemap.obj \
+ $(SLO)/pad.obj \
+ $(SLO)/parsemanager.obj \
+ $(SLO)/propertynode.obj \
+ $(SLO)/rootaccess.obj \
+ $(SLO)/services.obj \
+ $(SLO)/setnode.obj \
+ $(SLO)/type.obj \
+ $(SLO)/update.obj \
+ $(SLO)/valueparser.obj \
+ $(SLO)/writemodfile.obj \
+ $(SLO)/xcdparser.obj \
+ $(SLO)/xcsparser.obj \
+ $(SLO)/xcuparser.obj \
+ $(SLO)/xmldata.obj \
+ $(SLO)/xmlreader.obj
+
+SHL1IMPLIB = i$(SHL1TARGET)
+SHL1OBJS = $(SLOFILES)
+SHL1STDLIBS = \
+ $(COMPHELPERLIB) \
+ $(CPPUHELPERLIB) \
+ $(CPPULIB) \
+ $(SALHELPERLIB) \
+ $(SALLIB)
+SHL1TARGET = configmgr
+SHL1USE_EXPORTS = name
+DEF1NAME = $(SHL1TARGET)
+
+.INCLUDE: target.mk
diff --git a/configmgr/source/misc/anypair.cxx b/configmgr/source/misc/anypair.cxx
deleted file mode 100644
index 9a34c3c299..0000000000
--- a/configmgr/source/misc/anypair.cxx
+++ /dev/null
@@ -1,688 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <anypair.hxx>
-#include <uno/any2.h>
-#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/uno/Type.hxx>
-
-#define CFG_PRECOND( expr ) OSL_PRECOND ( expr, "Violated Precondition: " #expr)
-#define CFG_POSTCOND( expr ) OSL_POSTCOND( expr, "Violated Postcondition: " #expr)
-
-namespace configmgr
-{
- namespace css = com::sun::star;
- namespace uno = css::uno;
-
-// -----------------------------------------------------------------------------
- static inline bool impl_Any_hasValue(uno_Any const * _pData)
- { return (typelib_TypeClass_VOID != _pData->pType->eTypeClass); }
-
-// -----------------------------------------------------------------------------
- static inline bool impl_Any_storesData(uno_Any const * _pData)
- {
- const void * pAnyData = _pData->pData;
-
- const bool bSelfReferential = (pAnyData == &_pData->pReserved);
- OSL_ENSURE( bSelfReferential == ( _pData <= pAnyData && pAnyData < _pData+1 ),
- "uno_Any layout changed: Unreckognized self-referentiality" );
-
- return bSelfReferential;
- }
-
-// -----------------------------------------------------------------------------
- static inline void * impl_getDataPointer(const void * const * _pAnyPairData)
- {
- const void * const pResult = *_pAnyPairData;
-
- return const_cast<void*>(pResult);
- }
-
-// -----------------------------------------------------------------------------
- static inline void * impl_getData(const void * const * _pAnyPairData, bool _bStoredData)
- {
- const void * const pResult = _bStoredData ? _pAnyPairData : *_pAnyPairData;
-
- return const_cast<void*>(pResult);
- }
-
-// -----------------------------------------------------------------------------
- static inline void impl_setDataPointer(const void * * _pAnyPairData, void* _pData)
- {
- *_pAnyPairData = _pData;
- }
-// -----------------------------------------------------------------------------
- static const unsigned SHIFT_DATA_FLAG = 4;
-// -----------------------------------------------------------------------------
- static
- inline void impl_state_setState(sal_uInt8* _pState, sal_uInt8 _nState, sal_uInt8 _nSelect)
- {
- sal_uInt8 const nSelectMask = _nSelect | (_nSelect<<SHIFT_DATA_FLAG);
- OSL_ENSURE( (_nState & nSelectMask) == _nState, "State specified does not belong to the selector");
-
- *_pState &= ~nSelectMask;
- *_pState |= _nState;
- }
-
-// -----------------------------------------------------------------------------
- static
- inline void impl_state_setNull(sal_uInt8* _pState, sal_uInt8 _nSelect)
- {
- sal_uInt8 const nSelectMask = _nSelect | (_nSelect<<SHIFT_DATA_FLAG);
- *_pState &= ~nSelectMask;
- }
-
-// -----------------------------------------------------------------------------
- static inline
- void impl_state_setData(sal_uInt8* _pState, sal_uInt8 _nSelect)
- {
- sal_uInt8 const nSelectMask = _nSelect | (_nSelect<<SHIFT_DATA_FLAG);
- *_pState |= nSelectMask;
- }
-
-// -----------------------------------------------------------------------------
- static inline
- void impl_state_setValue(sal_uInt8* _pState, sal_uInt8 _nSelect, bool _bStoresData)
- {
- *_pState |= _nSelect;
-
- _nSelect <<= SHIFT_DATA_FLAG;
- if (_bStoresData)
- *_pState |= _nSelect;
- else
- *_pState &= ~_nSelect;
- }
-
-// -----------------------------------------------------------------------------
- static
- inline bool impl_state_isNull(sal_uInt8 const _nState, sal_uInt8 _nSelect)
- {
- return 0 == (_nState & _nSelect);
- }
-
-// -----------------------------------------------------------------------------
- static
- inline bool impl_state_isData(sal_uInt8 const _nState, sal_uInt8 _nSelect)
- {
- return 0 != (_nState & (_nSelect<<SHIFT_DATA_FLAG));
- }
-
-
-// -----------------------------------------------------------------------------
- static
- typelib_TypeDescriptionReference * impl_getVoidType()
- {
- static const uno::Type aNullType;
- return aNullType.getTypeLibType();
- }
-
-// -----------------------------------------------------------------------------
- static inline
- void anypair_type_construct_Desc( cfgmgr_AnyPair_Desc* _pAnyPairDesc,
- typelib_TypeDescriptionReference * _pType)
- {
- _pAnyPairDesc->nState = 0;
- _pAnyPairDesc->pType = _pType;
-
- typelib_typedescriptionreference_acquire( _pAnyPairDesc->pType );
- }
-
-// -----------------------------------------------------------------------------
- static inline
- void anypair_default_construct_Desc( cfgmgr_AnyPair_Desc* _pAnyPairDesc )
- {
- anypair_type_construct_Desc(_pAnyPairDesc, impl_getVoidType());
- }
-
-// -----------------------------------------------------------------------------
- static inline
- void anypair_empty_set_Data( const void ** _pAnyPairData )
- {
- impl_setDataPointer(_pAnyPairData, NULL);
- OSL_DEBUG_ONLY( impl_setDataPointer(_pAnyPairData, reinterpret_cast<void*>(0xdeadbeef)) );
- }
-
-// -----------------------------------------------------------------------------
- // returns a state for the specified selector
- static inline
- sal_uInt8 anypair_any_set_Data( const void ** _pAnyPairData,
- sal_uInt8 _nSelect,
- uno_Any const *_pUnoAny)
- {
- sal_uInt8 nState = 0;
-
- bool bValue = impl_Any_hasValue(_pUnoAny);
- if (bValue)
- {
- uno_Any aTmpAny;
- uno_type_any_construct(&aTmpAny, _pUnoAny->pData, _pUnoAny->pType, reinterpret_cast< uno_AcquireFunc >( uno::cpp_acquire ));
-
- bool bData = impl_Any_storesData(&aTmpAny);
-
- impl_setDataPointer(_pAnyPairData, bData ? aTmpAny.pReserved : aTmpAny.pData);
-
- impl_state_setValue(&nState, _nSelect, bData);
- }
- else
- anypair_empty_set_Data(_pAnyPairData);
-
- return nState;
- }
-
-// -----------------------------------------------------------------------------
- static inline
- sal_uInt8 anypair_copy_Data( const void ** _pAnyPairData,
- sal_uInt8 _nSelect,
- cfgmgr_AnyPair_Desc const* _pAnyPairDescFrom,
- const void * const* _pAnyPairDataFrom )
- {
- sal_uInt8 nState = 0;
-
- if (impl_state_isNull(_pAnyPairDescFrom->nState, _nSelect))
- {
- anypair_empty_set_Data(_pAnyPairData);
- }
-
- else
- {
- bool bOldIsData = impl_state_isData(_pAnyPairDescFrom->nState, _nSelect);
-
- void * pFromData = impl_getData(_pAnyPairDataFrom, bOldIsData);
-
- uno_Any aTmpAny;
- uno_type_any_construct(&aTmpAny, pFromData, _pAnyPairDescFrom->pType, reinterpret_cast< uno_AcquireFunc >( uno::cpp_acquire ));
-
- bool bNewIsData = impl_Any_storesData(&aTmpAny);
- OSL_ENSURE(bOldIsData == bNewIsData, "INFO [safe to ignore]: Copy of uno_Any changes directness !?");
-
- impl_setDataPointer(_pAnyPairData, bNewIsData ? aTmpAny.pReserved : aTmpAny.pData);
-
- impl_state_setValue(&nState, _nSelect, bNewIsData);
- }
-
- return nState;
- }
-
-// -----------------------------------------------------------------------------
- static inline
- void anypair_destruct_Desc(cfgmgr_AnyPair_Desc* _pAnyPairDesc)
- {
- typelib_typedescriptionreference_release( _pAnyPairDesc->pType );
- OSL_DEBUG_ONLY(_pAnyPairDesc->nState = 0xDD);
- OSL_DEBUG_ONLY(_pAnyPairDesc->pType = (typelib_TypeDescriptionReference*)0xdeadbeef);
- }
-
-// -----------------------------------------------------------------------------
- static
- void anypair_clear_Data( const void ** _pAnyPairData,
- sal_uInt8 _nSelect,
- cfgmgr_AnyPair_Desc const* _pAnyPairDesc
- )
- {
- if (!impl_state_isNull(_pAnyPairDesc->nState,_nSelect))
- {
- uno_Any aTmpAny;
- aTmpAny.pType = _pAnyPairDesc->pType;
-
- if (impl_state_isData(_pAnyPairDesc->nState,_nSelect))
- {
- aTmpAny.pReserved = impl_getDataPointer(_pAnyPairData);
- aTmpAny.pData = &aTmpAny.pReserved;
- }
- else
- {
- aTmpAny.pReserved = NULL;
- aTmpAny.pData = impl_getDataPointer(_pAnyPairData);
- }
-
- typelib_typedescriptionreference_acquire( aTmpAny.pType );
- uno_any_destruct(&aTmpAny, reinterpret_cast< uno_ReleaseFunc >( uno::cpp_release ));
-
- impl_setDataPointer(_pAnyPairData, NULL);
- OSL_DEBUG_ONLY(impl_setDataPointer(_pAnyPairData, reinterpret_cast<void*>(0xDeadBeef)));
- }
- }
-
-// -----------------------------------------------------------------------------
- static
- void anypair_Data_fill_Any( uno_Any* _pUnoAny,
- cfgmgr_AnyPair_Desc const* _pAnyPairDesc,
- const void * const* _pAnyPairData,
- sal_uInt8 _nSelect )
- {
- if (impl_state_isNull(_pAnyPairDesc->nState,_nSelect))
- {
- _pUnoAny->pType = impl_getVoidType();
- _pUnoAny->pReserved = NULL;
- _pUnoAny->pData = NULL;
- }
- else if (impl_state_isData(_pAnyPairDesc->nState,_nSelect))
- {
- _pUnoAny->pType = _pAnyPairDesc->pType;
- _pUnoAny->pReserved = impl_getDataPointer(_pAnyPairData);
- _pUnoAny->pData = &_pUnoAny->pReserved;
- }
- else
- {
- _pUnoAny->pType = _pAnyPairDesc->pType;
- _pUnoAny->pReserved = NULL;
- _pUnoAny->pData = impl_getDataPointer(_pAnyPairData);
- }
- }
-
-// -----------------------------------------------------------------------------
- static inline
- typelib_TypeDescriptionReference*
- anypair_test_assigned_type( typelib_TypeDescriptionReference* _pOldType,
- typelib_TypeDescriptionReference* _pNewType)
- {
- typelib_TypeDescriptionReference* pResult;
- if ( _pNewType->eTypeClass == typelib_TypeClass_VOID)
- pResult = _pOldType;
-
- else if (_pOldType->eTypeClass == typelib_TypeClass_VOID || _pOldType->eTypeClass == typelib_TypeClass_ANY )
- pResult = _pNewType;
-
- else if ( typelib_typedescriptionreference_equals(_pOldType,_pNewType) )
- pResult = _pOldType;
-
- else
- pResult = NULL;
-
- return pResult;
- }
-
-// -----------------------------------------------------------------------------
- static
- sal_Bool anypair_any_assign_Data( cfgmgr_AnyPair_Desc* _pAnyPairDesc,
- const void ** _pAnyPairData,
- sal_uInt8 _nSelect,
- uno_Any const *_pUnoAny)
- {
- typelib_TypeDescriptionReference* pOldType = _pAnyPairDesc->pType;
- typelib_TypeDescriptionReference* pNewType = anypair_test_assigned_type(pOldType,_pUnoAny->pType);
-
- if (pNewType != NULL)
- {
- uno_Any aTmpAny;
- anypair_Data_fill_Any(&aTmpAny,_pAnyPairDesc,_pAnyPairData,_nSelect);
-
- typelib_typedescriptionreference_acquire(aTmpAny.pType);
-
- uno_type_any_assign(&aTmpAny,
- _pUnoAny->pData,
- _pUnoAny->pType,
- reinterpret_cast< uno_AcquireFunc >( uno::cpp_acquire ),
- reinterpret_cast< uno_AcquireFunc >( uno::cpp_release ));
-
- sal_uInt8 nNewState = anypair_any_set_Data(_pAnyPairData,_nSelect,&aTmpAny);
- impl_state_setState(&_pAnyPairDesc->nState, nNewState, _nSelect);
-
- uno_any_destruct(
- &aTmpAny,
- reinterpret_cast< uno_ReleaseFunc >(uno::cpp_release));
-
- if (pNewType != pOldType)
- {
- typelib_typedescriptionreference_acquire(pNewType);
- typelib_typedescriptionreference_release(pOldType);
- _pAnyPairDesc->pType = pNewType;
- }
-
- CFG_POSTCOND( cfgmgr_AnyPair_isNull(_pAnyPairDesc,_nSelect) == !impl_Any_hasValue(_pUnoAny) );
- CFG_POSTCOND( typelib_typedescriptionreference_equals(_pAnyPairDesc->pType,pNewType) );
- }
- else
- OSL_ENSURE(false, "anypair_assign_XXX(): Cannot assign - Type mismatch");
-
- return (pNewType != NULL);
- }
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- void anypair_construct_default(cfgmgr_AnyPair * _pAnyPair)
- {
- CFG_PRECOND( _pAnyPair != NULL );
-
- anypair_default_construct_Desc(&_pAnyPair->desc);
- anypair_empty_set_Data(&_pAnyPair->first);
- anypair_empty_set_Data(&_pAnyPair->second);
-
- CFG_POSTCOND( cfgmgr_AnyPair_isNull(&_pAnyPair->desc,cfgmgr_SELECT_BOTH) );
- CFG_POSTCOND( cfgmgr_AnyPair_isEmpty(&_pAnyPair->desc) );
- }
-
-// -----------------------------------------------------------------------------
- void anypair_construct_type(cfgmgr_AnyPair * _pAnyPair, typelib_TypeDescriptionReference* _pType)
- {
- CFG_PRECOND( _pAnyPair != NULL );
- CFG_PRECOND( _pType != NULL );
-
- anypair_type_construct_Desc(&_pAnyPair->desc, _pType);
- anypair_empty_set_Data(&_pAnyPair->first);
- anypair_empty_set_Data(&_pAnyPair->second);
-
- CFG_POSTCOND( cfgmgr_AnyPair_isNull(&_pAnyPair->desc,cfgmgr_SELECT_BOTH) );
- CFG_POSTCOND( typelib_typedescriptionreference_equals(_pAnyPair->desc.pType,_pType) );
- }
-
-// -----------------------------------------------------------------------------
- void anypair_construct_first(cfgmgr_AnyPair * _pAnyPair, uno_Any const *_pUnoAny)
- {
- CFG_PRECOND( _pAnyPair != NULL );
- CFG_PRECOND( _pUnoAny != NULL );
-
- anypair_type_construct_Desc(&_pAnyPair->desc, _pUnoAny->pType);
-
- _pAnyPair->desc.nState = anypair_any_set_Data (&_pAnyPair->first, cfgmgr_SELECT_FIRST, _pUnoAny);
-
- anypair_empty_set_Data(&_pAnyPair->second);
-
- CFG_POSTCOND( cfgmgr_AnyPair_isNull(&_pAnyPair->desc,cfgmgr_SELECT_FIRST) == !impl_Any_hasValue(_pUnoAny) );
- CFG_POSTCOND( cfgmgr_AnyPair_isNull(&_pAnyPair->desc,cfgmgr_SELECT_SECOND) );
- CFG_POSTCOND( typelib_typedescriptionreference_equals(_pAnyPair->desc.pType,_pUnoAny ->pType) );
- }
-
-// -----------------------------------------------------------------------------
- void anypair_construct_second(cfgmgr_AnyPair * _pAnyPair, uno_Any const *_pUnoAny)
- {
- CFG_PRECOND( _pAnyPair != NULL );
- CFG_PRECOND( _pUnoAny != NULL );
-
- anypair_type_construct_Desc(&_pAnyPair->desc, _pUnoAny->pType);
-
- anypair_empty_set_Data(&_pAnyPair->first);
-
- _pAnyPair->desc.nState = anypair_any_set_Data (&_pAnyPair->second, cfgmgr_SELECT_SECOND, _pUnoAny);
-
- CFG_POSTCOND( cfgmgr_AnyPair_isNull(&_pAnyPair->desc,cfgmgr_SELECT_FIRST) );
- CFG_POSTCOND( cfgmgr_AnyPair_isNull(&_pAnyPair->desc,cfgmgr_SELECT_SECOND) == !impl_Any_hasValue(_pUnoAny) );
- CFG_POSTCOND( typelib_typedescriptionreference_equals(_pAnyPair->desc.pType,_pUnoAny ->pType) );
- }
-
-// -----------------------------------------------------------------------------
- // if type not equal, you got false and the struct contains undefined values
- sal_Bool anypair_construct(cfgmgr_AnyPair * _pAnyPair, uno_Any const * _pFirstAny, uno_Any const *_pSecondAny)
- {
- CFG_PRECOND( _pAnyPair != NULL );
- CFG_PRECOND( _pFirstAny != NULL );
- CFG_PRECOND( _pSecondAny != NULL );
-
- bool bHasFirst = impl_Any_hasValue(_pFirstAny);
- bool bHasSecond = impl_Any_hasValue(_pSecondAny);
-
- if (bHasFirst && bHasSecond)
- {
- if ( ! typelib_typedescriptionreference_equals(_pFirstAny->pType,_pSecondAny->pType))
- {
- OSL_ENSURE(false, "anypair_construct(): Cannot construct - Different types");
- return false;
- }
- }
-
- anypair_type_construct_Desc(&_pAnyPair->desc, bHasFirst ? _pFirstAny->pType : _pSecondAny->pType);
-
- sal_uInt8 nState = 0;
-
- nState |= anypair_any_set_Data (&_pAnyPair->first, cfgmgr_SELECT_FIRST, _pFirstAny);
- nState |= anypair_any_set_Data (&_pAnyPair->second, cfgmgr_SELECT_SECOND, _pSecondAny);
-
- _pAnyPair->desc.nState = nState;
-
- CFG_POSTCOND((bHasFirst || bHasSecond) == !cfgmgr_AnyPair_isEmpty(&_pAnyPair->desc) );
- CFG_POSTCOND( bHasFirst == !cfgmgr_AnyPair_isNull(&_pAnyPair->desc,cfgmgr_SELECT_FIRST) );
- CFG_POSTCOND( bHasSecond == !cfgmgr_AnyPair_isNull(&_pAnyPair->desc,cfgmgr_SELECT_SECOND) );
- CFG_POSTCOND( !bHasFirst || typelib_typedescriptionreference_equals(_pAnyPair->desc.pType,_pFirstAny ->pType) );
- CFG_POSTCOND( !bHasSecond || typelib_typedescriptionreference_equals(_pAnyPair->desc.pType,_pSecondAny->pType) );
-
- return true;
- }
-
-// -----------------------------------------------------------------------------
- void anypair_copy_construct(cfgmgr_AnyPair* _pAnyPair, cfgmgr_AnyPair const * _pAnyPairFrom)
- {
- CFG_PRECOND( _pAnyPair != NULL );
- CFG_PRECOND( _pAnyPairFrom != NULL );
-
- anypair_type_construct_Desc(&_pAnyPair->desc, _pAnyPairFrom->desc.pType);
-
- sal_uInt8 nState = 0;
-
- nState |= anypair_copy_Data(&_pAnyPair->first, cfgmgr_SELECT_FIRST,
- &_pAnyPairFrom->desc, &_pAnyPairFrom->first );
-
- nState |= anypair_copy_Data(&_pAnyPair->second, cfgmgr_SELECT_SECOND,
- &_pAnyPairFrom->desc, &_pAnyPairFrom->second );
-
- _pAnyPair->desc.nState = nState;
-
- OSL_ENSURE(_pAnyPairFrom->desc.nState == nState, "Unexpected: Copy changes state");
- CFG_POSTCOND( typelib_typedescriptionreference_equals(_pAnyPair->desc.pType,_pAnyPairFrom->desc.pType) );
- }
-
-// -----------------------------------------------------------------------------
- void anypair_destruct(cfgmgr_AnyPair* _pAnyPair)
- {
- CFG_PRECOND( _pAnyPair != NULL );
-
- anypair_clear_Data(&_pAnyPair->first, cfgmgr_SELECT_FIRST, &_pAnyPair->desc);
- anypair_clear_Data(&_pAnyPair->second, cfgmgr_SELECT_SECOND, &_pAnyPair->desc);
- anypair_destruct_Desc(&_pAnyPair->desc );
- }
-
-// -----------------------------------------------------------------------------
- sal_Bool anypair_assign_first(cfgmgr_AnyPair* _pAnyPair, uno_Any const * _pUnoAny)
- {
- CFG_PRECOND( _pAnyPair != NULL );
- CFG_PRECOND( _pUnoAny != NULL );
-
- return anypair_any_assign_Data(&_pAnyPair->desc, &_pAnyPair->first, cfgmgr_SELECT_FIRST, _pUnoAny);
- }
-
-// -----------------------------------------------------------------------------
- sal_Bool anypair_assign_second(cfgmgr_AnyPair* _pAnyPair, uno_Any const * _pUnoAny)
- {
- CFG_PRECOND( _pAnyPair != NULL );
- CFG_PRECOND( _pUnoAny != NULL );
-
- return anypair_any_assign_Data(&_pAnyPair->desc, &_pAnyPair->second, cfgmgr_SELECT_SECOND, _pUnoAny);
- }
-
-// -----------------------------------------------------------------------------
- void anypair_assign(cfgmgr_AnyPair* _pAnyPair, cfgmgr_AnyPair const * _pAnyPairFrom)
- {
- if (_pAnyPair != _pAnyPairFrom)
- {
- anypair_destruct(_pAnyPair);
- anypair_copy_construct(_pAnyPair, _pAnyPairFrom);
- }
- }
-
-// -----------------------------------------------------------------------------
- void anypair_clear_first(cfgmgr_AnyPair* _pAnyPair)
- {
- CFG_PRECOND( _pAnyPair != NULL );
-
- anypair_clear_Data(&_pAnyPair->first, cfgmgr_SELECT_FIRST, &_pAnyPair->desc);
- impl_state_setNull(&_pAnyPair->desc.nState, cfgmgr_SELECT_FIRST);
-
- CFG_POSTCOND( cfgmgr_AnyPair_isNull(&_pAnyPair->desc,cfgmgr_SELECT_FIRST) );
- }
-
-// -----------------------------------------------------------------------------
- void anypair_clear_second(cfgmgr_AnyPair* _pAnyPair)
- {
- CFG_PRECOND( _pAnyPair != NULL );
-
- anypair_clear_Data(&_pAnyPair->second, cfgmgr_SELECT_SECOND, &_pAnyPair->desc );
- impl_state_setNull(&_pAnyPair->desc.nState, cfgmgr_SELECT_SECOND);
-
- CFG_POSTCOND( cfgmgr_AnyPair_isNull(&_pAnyPair->desc,cfgmgr_SELECT_SECOND) );
- }
-
-// -----------------------------------------------------------------------------
- void anypair_clear_values(cfgmgr_AnyPair* _pAnyPair)
- {
- CFG_PRECOND( _pAnyPair != NULL );
-
- anypair_clear_Data(&_pAnyPair->first, cfgmgr_SELECT_FIRST, &_pAnyPair->desc);
- anypair_clear_Data(&_pAnyPair->second, cfgmgr_SELECT_SECOND, &_pAnyPair->desc );
- impl_state_setNull(&_pAnyPair->desc.nState, cfgmgr_SELECT_BOTH);
-
- CFG_POSTCOND( cfgmgr_AnyPair_isNull(&_pAnyPair->desc,cfgmgr_SELECT_BOTH) );
- }
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- static
- inline
- uno::Any anypair_Data_toAny(cfgmgr_AnyPair_Desc const* _pAnyPairDesc,
- const void * const* _pAnyPairData,
- sal_uInt8 _nSelect)
- {
- uno_Any aTmpAny;
- anypair_Data_fill_Any(&aTmpAny,_pAnyPairDesc,_pAnyPairData,_nSelect);
-
- return uno::Any( aTmpAny.pData, aTmpAny.pType );
- }
-
-// -----------------------------------------------------------------------------
- AnyPair::AnyPair(uno::Type const& _aType) // one Type, any's are null
- {
- anypair_construct_type(&m_aAnyPair, _aType.getTypeLibType());
- }
-
-// -----------------------------------------------------------------------------
- AnyPair::AnyPair(uno::Any const& _aAny, SelectMember _select)
- {
- switch (_select)
- {
- case SELECT_FIRST: anypair_construct_first(&m_aAnyPair,&_aAny); break;
- case SELECT_SECOND: anypair_construct_second(&m_aAnyPair,&_aAny); break;
- case SELECT_BOTH: OSL_VERIFY( anypair_construct(&m_aAnyPair,&_aAny,&_aAny) ); break;
-
- default: OSL_ENSURE(false, "AnyPair: Unknown member selector");
- anypair_construct_default(&m_aAnyPair); break;
- }
- }
-
-// -----------------------------------------------------------------------------
- AnyPair::AnyPair(uno::Any const& _aAny, uno::Any const& _aAny2) SAL_THROW((lang::IllegalArgumentException))
- {
- if (!anypair_construct(&m_aAnyPair,&_aAny, &_aAny2))
- {
- throw lang::IllegalArgumentException(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AnyPair: Type mismatch in constructor.")),NULL,-1);
- }
- }
-
-// -----------------------------------------------------------------------------
- // copy-ctor
- AnyPair::AnyPair(AnyPair const& _aOther)
- {
- anypair_copy_construct(&m_aAnyPair, &_aOther.m_aAnyPair);
- }
-
-// -----------------------------------------------------------------------------
- // assign operator
- AnyPair& AnyPair::operator=(AnyPair const& _aOther)
- {
- anypair_assign(&m_aAnyPair, &_aOther.m_aAnyPair);
- return *this;
- }
-
-// -----------------------------------------------------------------------------
- // d-tor
- AnyPair::~AnyPair()
- {
- anypair_destruct(&m_aAnyPair);
- }
-
-
-// -----------------------------------------------------------------------------
- sal_Bool AnyPair::setFirst(uno::Any const& _aAny)
- {
- return anypair_assign_first(&m_aAnyPair,&_aAny);
- }
-
-// -----------------------------------------------------------------------------
- sal_Bool AnyPair::setSecond(uno::Any const& _aAny)
- {
- return anypair_assign_second(&m_aAnyPair,&_aAny);
- }
-
-// -----------------------------------------------------------------------------
- void AnyPair::clear(SelectMember _select)
- {
- switch (_select)
- {
- case SELECT_FIRST: anypair_clear_first(&m_aAnyPair); break;
- case SELECT_SECOND: anypair_clear_second(&m_aAnyPair); break;
- case SELECT_BOTH: anypair_clear_values(&m_aAnyPair); break;
-
- default: OSL_ENSURE(false, "AnyPair: Unknown member selector");
- break;
- }
- }
-
-// -----------------------------------------------------------------------------
- uno::Type AnyPair::getValueType() const
- {
- return uno::Type(m_aAnyPair.desc.pType);
- }
-
-// -----------------------------------------------------------------------------
- uno::Any AnyPair::getFirst() const
- {
- return anypair_Data_toAny( &m_aAnyPair.desc, &m_aAnyPair.first, cfgmgr_SELECT_FIRST );
- }
-// -----------------------------------------------------------------------------
- uno::Any AnyPair::getSecond() const
- {
- return anypair_Data_toAny( &m_aAnyPair.desc, &m_aAnyPair.second, cfgmgr_SELECT_SECOND );
- }
-
-// -----------------------------------------------------------------------------
- uno::Any AnyPair::getValue(SelectMember _select) const
- {
- switch (_select)
- {
- case SELECT_FIRST: return getFirst();
- case SELECT_SECOND: return getSecond();
-
- default: OSL_ENSURE(false, "AnyPair: Unknown member selector");
- case SELECT_BOTH: OSL_ENSURE(false, "AnyPair: Cannot get value - Invalid selector");
- return uno::Any();
- }
- }
-
-// -----------------------------------------------------------------------------
-
-} // namespace
-
diff --git a/configmgr/source/misc/bootstrap.cxx b/configmgr/source/misc/bootstrap.cxx
deleted file mode 100644
index 4a29c5e922..0000000000
--- a/configmgr/source/misc/bootstrap.cxx
+++ /dev/null
@@ -1,701 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <stdio.h>
-
-#include "bootstrap.hxx"
-
-#ifndef CONFIGMGR_API_FACTORY_HXX_
-#include "confapifactory.hxx"
-#endif
-#include "serviceinfohelper.hxx"
-#include "matchlocale.hxx"
-#include "tracer.hxx"
-#include <cppuhelper/component_context.hxx>
-#include <rtl/bootstrap.hxx>
-#include <rtl/ustring.hxx>
-#include <rtl/ustrbuf.hxx>
-#include <osl/file.hxx>
-#include <osl/process.h>
-#include <osl/diagnose.h>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/configuration/MissingBootstrapFileException.hpp>
-#include <com/sun/star/configuration/InvalidBootstrapFileException.hpp>
-#include <com/sun/star/configuration/InstallationIncompleteException.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-
-// ---------------------------------------------------------------------------------------
-// legacy argument names
-#define ARGUMENT_LOCALE_COMPAT "locale"
-#define ARGUMENT_ASYNC_COMPAT "lazywrite"
-#define ARGUMENT_SERVERTYPE_COMPAT "servertype"
-
-// legacy servertype setting
-#define SETTING_SERVERTYPE_COMPAT "ServerType"
-#define BOOTSTRAP_SERVERTYPE_COMPAT CONTEXT_ITEM_PREFIX_ SETTING_SERVERTYPE_COMPAT
-
-#define SERVERTYPE_UNO_COMPAT "uno"
-#define SERVERTYPE_PLUGIN_COMPAT "plugin"
-// ---------------------------------------------------------------------------------------
-
-#define NAME( N ) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(N))
-#define ITEM( N ) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(N))
-// ---------------------------------------------------------------------------------------
-// -------------------------------------------------------------------------
-
-// ---------------------------------------------------------------------------------------
-namespace configmgr
-{
-// ---------------------------------------------------------------------------------------
-// ---------------------------------------------------------------------------------------
- static void convertToBool(const uno::Any& aValue, sal_Bool& bValue)
- {
- rtl::OUString aStrValue;
- if (aValue >>= aStrValue)
- {
- if (aStrValue.equalsIgnoreAsciiCaseAscii("true"))
- {
- bValue = sal_True;
- }
- else if (aStrValue.equalsIgnoreAsciiCaseAscii("false"))
- {
- bValue = sal_False;
- }
- }
- }
- // ----------------------------------------------------------------------------------
- const sal_Char k_BootstrapContextImplName[] = "com.sun.star.comp.configuration.bootstrap.BootstrapContext" ;
- const sal_Char k_BootstrapContextServiceName[] = "com.sun.star.configuration.bootstrap.BootstrapContext" ;
-
- // -------------------------------------------------------------------------
- static sal_Char const * const k_BootstrapContextServiceNames [] =
- {
- k_BootstrapContextServiceName,
- 0
- };
- static const ServiceImplementationInfo k_BootstrapContextServiceInfo =
- {
- k_BootstrapContextImplName,
- k_BootstrapContextServiceNames,
- 0
- };
- static const SingletonRegistrationInfo k_BootstrapContextSingletonInfo =
- {
- A_BootstrapContextSingletonName,
- k_BootstrapContextImplName,
- k_BootstrapContextServiceName,
- 0
- };
-// ---------------------------------------------------------------------------------------
-// ---------------------------------------------------------------------------------------
- uno::Reference<uno::XInterface> SAL_CALL
- instantiateBootstrapContext( uno::Reference< uno::XComponentContext > const& xTargetContext )
- {
- uno::Reference< uno::XComponentContext > xContext = UnoContextTunnel::recoverContext(xTargetContext);
-
- BootstrapContext * pContext = new BootstrapContext(xContext);
- uno::Reference< uno::XComponentContext > xResult(pContext);
-
- pContext->initialize();
-
- return uno::Reference< uno::XInterface >( xResult, uno::UNO_QUERY );
- }
-
- const SingletonRegistrationInfo * getBootstrapContextSingletonInfo()
- {
- return &k_BootstrapContextSingletonInfo;
- }
- const ServiceRegistrationInfo * getBootstrapContextServiceInfo()
- {
- return getRegistrationInfo(&k_BootstrapContextServiceInfo);
- }
-// ---------------------------------------------------------------------------------------
-// ---------------------------------------------------------------------------
-
- static
- inline
- cppu::ContextEntry_Init makeEntry(beans::NamedValue const & aOverride)
- {
- return cppu::ContextEntry_Init(aOverride.Name,aOverride.Value);
- }
-// ---------------------------------------------------------------------------
-
- static
- cppu::ContextEntry_Init makeSingleton(SingletonRegistrationInfo const * pSingletonInfo)
- {
- OSL_ASSERT( pSingletonInfo &&
- pSingletonInfo->singletonName &&
- pSingletonInfo->instantiatedServiceName );
-
- rtl::OUStringBuffer aSingletonName;
- aSingletonName.appendAscii( RTL_CONSTASCII_STRINGPARAM(SINGLETON_) );
- aSingletonName.appendAscii(pSingletonInfo->singletonName);
-
- rtl::OUString const aServiceName = rtl::OUString::createFromAscii(pSingletonInfo->instantiatedServiceName);
-
- return cppu::ContextEntry_Init(aSingletonName.makeStringAndClear(), uno::makeAny(aServiceName), true);
- }
-// ---------------------------------------------------------------------------
-
-uno::Reference< uno::XComponentContext > BootstrapContext::createWrapper(uno::Reference< uno::XComponentContext > const & _xContext, uno::Sequence < beans::NamedValue > const & _aOverrides)
-{
- std::vector< cppu::ContextEntry_Init > aContextEntries;
- aContextEntries.reserve(_aOverrides.getLength() + 5);
-
- // marker + bootstrap context
- aContextEntries.push_back( cppu::ContextEntry_Init(NAME(CONTEXT_ITEM_IS_WRAPPER_CONTEXT), uno::makeAny(sal_True)) );
- aContextEntries.push_back( cppu::ContextEntry_Init(NAME(CONTEXT_ITEM_IS_BOOTSTRAP_CONTEXT), uno::makeAny(sal_False)) );
-
- aContextEntries.push_back( makeSingleton(getBootstrapContextSingletonInfo()) );
-
- // singletons except for passthrough
- if (!isPassthrough(_xContext))
- {
- aContextEntries.push_back( makeSingleton(getDefaultProviderSingletonInfo()) );
- aContextEntries.push_back( makeSingleton(backend::getDefaultBackendSingletonInfo()) );
- }
-
- for (sal_Int32 i = 0; i<_aOverrides.getLength(); ++i)
- aContextEntries.push_back( makeEntry(_aOverrides[i]) );
-
- return cppu::createComponentContext(&aContextEntries.front(),aContextEntries.size(),_xContext);
-}
-// ---------------------------------------------------------------------------
-
-sal_Bool BootstrapContext::isWrapper(uno::Reference< uno::XComponentContext > const & _xContext)
-{
- OSL_ASSERT(_xContext.is());
- if (!_xContext.is()) return false;
-
- uno::Any aSetting = _xContext->getValueByName( NAME(CONTEXT_ITEM_IS_WRAPPER_CONTEXT) );
-
- if (!aSetting.hasValue()) return false;
-
- sal_Bool bValue = false;
- OSL_VERIFY(aSetting >>= bValue);
-
- return bValue;
-}
-// ---------------------------------------------------------------------------
-// ---------------------------------------------------------------------------
-
-BootstrapContext::BootstrapContext(uno::Reference< uno::XComponentContext > const & _xContext)
-: ComponentContext(_xContext)
-{
-}
-// ---------------------------------------------------------------------------
-
-BootstrapContext::~BootstrapContext()
-{
-}
-// ---------------------------------------------------------------------------
-
-void BootstrapContext::initialize()
-{
- // get default Bootstrap URL
- rtl::OUString sURL;
- uno::Any aExplicitURL;
- if ( this->lookupInContext(aExplicitURL,NAME(CONTEXT_ITEM_PREFIX_ SETTING_INIFILE)) )
- {
- OSL_VERIFY(aExplicitURL >>= sURL);
- }
- else if (!rtl::Bootstrap::get(NAME(BOOTSTRAP_ITEM_INIFILE),sURL))
- {
- sURL = getDefaultConfigurationBootstrapURL();
- }
-
- ComponentContext::initialize(sURL);
-}
-// ---------------------------------------------------------------------------------------
-
-rtl::OUString BootstrapContext::getDefaultConfigurationBootstrapURL()
-{
- rtl::OUString url(
- RTL_CONSTASCII_USTRINGPARAM(
- "$OOO_BASE_DIR/program/" SAL_CONFIGFILE("configmgr")));
- rtl::Bootstrap::expandMacros(url); //TODO: detect failure
- return url;
-}
-// ---------------------------------------------------------------------------------------
-
-rtl::OUString BootstrapContext::makeContextName(rtl::OUString const & _aName)
-{
- // check that it isn't long already
- OSL_ENSURE(!_aName.matchIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM(CONTEXT_MODULE_PREFIX_) ),
- "configmgr::BootstrapContext: passing argument in long context form won't work");
-
- return NAME(CONTEXT_ITEM_PREFIX_).concat(_aName);
-}
-// ---------------------------------------------------------------------------
-
-rtl::OUString BootstrapContext::makeBootstrapName(rtl::OUString const & _aName)
-{
- // check if already is short
- if (!_aName.matchIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM(CONTEXT_ITEM_PREFIX_) ) )
- {
- OSL_TRACE( "configmgr: Cannot map name to bootstrap name: %s",
- rtl::OUStringToOString(_aName,RTL_TEXTENCODING_ASCII_US).getStr() );
- return _aName;
- }
- return NAME(BOOTSTRAP_ITEM_PREFIX_).concat(_aName.copy(RTL_CONSTASCII_LENGTH(CONTEXT_ITEM_PREFIX_)));
-}
-// ---------------------------------------------------------------------------
-
-uno::Any SAL_CALL
- BootstrapContext::getValueByName( const rtl::OUString& aName )
- throw (uno::RuntimeException)
-{
- sal_Bool const bOurName = aName.matchIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM(CONTEXT_MODULE_PREFIX_) );
-
- if (bOurName)
- {
- if (aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(CONTEXT_ITEM_BOOTSTRAP_ERROR) ) )
- return this->makeBootstrapException();
-
- if (aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(CONTEXT_ITEM_PREFIX_ SETTING_INIFILE) ) )
- return uno::makeAny( this->getBootstrapURL() );
-
- if (aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(CONTEXT_ITEM_IS_BOOTSTRAP_CONTEXT) ) )
- return uno::makeAny( sal_True );
- }
- else if (aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(SINGLETON_ A_BootstrapContextSingletonName) ) )
- {
- return uno::makeAny( uno::Reference< uno::XComponentContext >(this) );
- }
-
- uno::Any aResult;
-
- bool bFound = lookupInContext ( aResult, aName );
-
- if (!bFound && bOurName) // requires: CONTEXT_ITEM_PREFIX_ starts with CONTEXT_MODULE_PREFIX_
- {
- if ( aName.matchIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM(CONTEXT_ITEM_PREFIX_) ) )
- {
- bFound = lookupInBootstrap( aResult, makeBootstrapName(aName) );
- }
- }
- return aResult;
-}
-
-// ---------------------------------------------------------------------------
-// class ContextReader
-// ---------------------------------------------------------------------------
-
- ContextReader::ContextReader(uno::Reference< uno::XComponentContext > const & context)
- : m_basecontext(context)
- , m_fullcontext()
- {
- OSL_ENSURE(context.is(), "ERROR: trying to create reader on NULL context\n");
- if (context.is())
- {
- uno::Any aBootstrapContext = context->getValueByName( SINGLETON(A_BootstrapContextSingletonName) );
- aBootstrapContext >>= m_fullcontext;
- }
- }
-// ---------------------------------------------------------------------------
-
- uno::Reference< lang::XMultiComponentFactory > ContextReader::getServiceManager() const
- {
- OSL_ASSERT(m_basecontext.is());
- return m_basecontext->getServiceManager();
- }
-// ---------------------------------------------------------------------------
- inline
- uno::Any ContextReader::getSetting(rtl::OUString const & _aSetting) const
- {
- OSL_ASSERT(m_basecontext.is());
- return getBestContext()->getValueByName(_aSetting);
- }
-
- inline
- sal_Bool ContextReader::hasSetting(rtl::OUString const & _aSetting) const
- {
- return getSetting(_aSetting).hasValue();
- }
-
- inline
- sal_Bool ContextReader::getBoolSetting(rtl::OUString const & _aSetting, sal_Bool bValue = false) const
- {
- uno::Any aValue = getSetting(_aSetting);
- if (!(aValue >>= bValue))
- convertToBool(aValue, bValue);
-
- return bValue;
- }
-
- inline
- rtl::OUString ContextReader::getStringSetting(rtl::OUString const & _aSetting, rtl::OUString aValue = rtl::OUString()) const
- {
- getSetting(_aSetting) >>= aValue;
- return aValue;
- }
-// ---------------------------------------------------------------------------------------
-
- sal_Bool ContextReader::isUnoBackend() const
- {
- rtl::OUString aSettingName = NAME(BOOTSTRAP_SERVERTYPE_COMPAT);
-
- rtl::OUString aValue;
- if (getSetting(aSettingName) >>= aValue)
- {
- return aValue.equalsAscii(SERVERTYPE_UNO_COMPAT);
- }
- else
- {
- return true;
- }
- }
-// ---------------------------------------------------------------------------------------
-
- sal_Bool ContextReader::hasUnoBackendService() const
- {
- return hasSetting( NAME(CONTEXT_ITEM_PREFIX_ SETTING_UNOSERVICE) );
- }
- sal_Bool ContextReader::hasUnoBackendWrapper() const
- {
- return hasSetting( NAME(CONTEXT_ITEM_PREFIX_ SETTING_UNOWRAPPER) );
- }
-
- sal_Bool ContextReader::hasLocale() const
- {
- return hasSetting( NAME(CONTEXT_ITEM_PREFIX_ SETTING_LOCALE_NEW) );
- }
- sal_Bool ContextReader::hasAsyncSetting() const
- {
- return hasSetting( NAME(CONTEXT_ITEM_PREFIX_ SETTING_ASYNC_NEW) );
- }
- sal_Bool ContextReader::hasOfflineSetting() const
- {
- return hasSetting( NAME(CONTEXT_ITEM_PREFIX_ SETTING_OFFLINE) );
- }
-// ---------------------------------------------------------------------------------------
-
- rtl::OUString ContextReader::getUnoBackendService() const
- {
- return getStringSetting( NAME(CONTEXT_ITEM_PREFIX_ SETTING_UNOSERVICE) );
- }
- rtl::OUString ContextReader::getUnoBackendWrapper() const
- {
- return getStringSetting( NAME(CONTEXT_ITEM_PREFIX_ SETTING_UNOWRAPPER) );
- }
-
- rtl::OUString ContextReader::getLocale() const
- {
- return getStringSetting( NAME(CONTEXT_ITEM_PREFIX_ SETTING_LOCALE_NEW) );
- }
- sal_Bool ContextReader::getAsyncSetting() const
- {
- return getBoolSetting( NAME(CONTEXT_ITEM_PREFIX_ SETTING_ASYNC_NEW) );
- }
- sal_Bool ContextReader::getOfflineSetting() const
- {
- return getBoolSetting( NAME(CONTEXT_ITEM_PREFIX_ SETTING_OFFLINE) );
- }
-
- // get a special setting
- sal_Bool ContextReader::isAdminService() const
- {
- return getBoolSetting( NAME(CONTEXT_ITEM_ADMINFLAG) );
- }
-
- sal_Bool ContextReader::isBootstrapValid() const
- {
- return this->isUnoBackend() &&
- this->hasUnoBackendService() &&
- (this->hasUnoBackendWrapper() || !this->getOfflineSetting());
- }
-
- uno::Any ContextReader::getBootstrapError() const
- {
- return getSetting( NAME(CONTEXT_ITEM_BOOTSTRAP_ERROR) );
- }
-// ---------------------------------------------------------------------------------------
-
- bool ContextReader::testAdminService(uno::Reference< uno::XComponentContext > const & context, bool bAdmin)
- {
- OSL_ASSERT(context.is());
- if (!context.is()) return false;
-
- uno::Any aSetting = context->getValueByName( NAME(CONTEXT_ITEM_ADMINFLAG) );
-
- sal_Bool bValue = false;
- bool bTest = (aSetting >>= bValue) && bValue;
-
- return bTest == bAdmin;
- }
-// ---------------------------------------------------------------------------
-// ---------------------------------------------------------------------------------------
-
- bool ArgumentHelper::extractArgument(beans::NamedValue & rValue, const uno::Any & aOverride)
- {
- if ( ! (aOverride >>= rValue) )
- {
- // it must be a PropertyValue, if it isn't a NamedValue
- beans::PropertyValue aPV;
- if ( !(aOverride >>= aPV) )
- return false;
-
- rValue.Name = aPV.Name;
- rValue.Value = aPV.Value;
- }
-
- return true;
- }
-
-// ---------------------------------------------------------------------------------------
-
- bool ArgumentHelper::checkBackendArgument(beans::NamedValue const & aAdjustedValue)
- {
- bool isWrappable =
- aAdjustedValue.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(CONTEXT_ITEM_PREFIX_ SETTING_ASYNC_NEW)) ||
- aAdjustedValue.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(CONTEXT_ITEM_PREFIX_ SETTING_LOCALE_NEW));
-
- if (isWrappable) return false;
-
- m_bHasBackendArguments = true;
- return true;
- }
-// ---------------------------------------------------------------------------------------
-
- bool ArgumentHelper::filterAndAdjustArgument(beans::NamedValue & rValue)
- {
- // handle old servertype argument and filter the 'plugin' value
- if (rValue.Name.equalsAscii(ARGUMENT_SERVERTYPE_COMPAT))
- {
- rtl::OUString aServertype;
- if (! (rValue.Value >>= aServertype))
- return false;
-
- if (aServertype.equalsAscii(SERVERTYPE_PLUGIN_COMPAT))
- return false;
-
- rValue.Name = NAME(BOOTSTRAP_SERVERTYPE_COMPAT);
- // check, if it is already there
- uno::Any const aExistingValue = m_context->getValueByName(rValue.Name);
-
- if (aExistingValue.hasValue())
- return !(aExistingValue == rValue.Value);
-
- else
- return !aServertype.equalsAscii(SERVERTYPE_UNO_COMPAT);
- }
-
- // map old argument names for comatibility
- else if (rValue.Name.equalsAscii(ARGUMENT_LOCALE_COMPAT))
- rValue.Name = NAME(SETTING_LOCALE_NEW);
-
- else if (rValue.Name.equalsAscii(ARGUMENT_ASYNC_COMPAT))
- rValue.Name = NAME(SETTING_ASYNC_NEW);
-
- // give the item a long name
- rValue.Name = BootstrapContext::makeContextName(rValue.Name);
-
- // check, if it is already there
- uno::Any const aExistingValue = m_context->getValueByName(rValue.Name);
-
- return ! (aExistingValue == rValue.Value);
- }
-// ---------------------------------------------------------------------------------------
-
- beans::NamedValue ArgumentHelper::makeAdminServiceOverride(sal_Bool bAdmin)
- {
- return beans::NamedValue( NAME(CONTEXT_ITEM_ADMINFLAG), uno::makeAny(bAdmin) );
- }
-// ---------------------------------------------------------------------------------------
-// ---------------------------------------------------------------------------------------
-// - bootstrapping error checking helper
-// ---------------------------------------------------------------------------------------
-namespace {
-// ---------------------------------------------------------------------------------------
-// error handling
-// ---------------------------------------------------------------------------------------
- enum BootstrapResult
- {
- BOOTSTRAP_DATA_OK,
- INCOMPLETE_BOOTSTRAP_DATA,
- INCOMPLETE_BOOTSTRAP_FILE,
- MISSING_BOOTSTRAP_FILE,
- BOOTSTRAP_FAILURE
- };
-// ---------------------------------------------------------------------------------------
- static
- rtl::OUString getFallbackErrorMessage( BootstrapResult _rc )
- {
- rtl::OUString sMessage(RTL_CONSTASCII_USTRINGPARAM("The program cannot start. "));
-
- switch (_rc)
- {
- case MISSING_BOOTSTRAP_FILE:
- sMessage = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("A main configuration file is missing"));
- break;
-
- case INCOMPLETE_BOOTSTRAP_FILE:
- sMessage = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("A main configuration file is invalid"));
- break;
-
- case INCOMPLETE_BOOTSTRAP_DATA:
- sMessage = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Required bootstrap data is not available"));
- break;
-
- default:
- sMessage = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Unexpected bootstrap failure"));
- break;
-
- case BOOTSTRAP_DATA_OK:
- break;
- }
- sMessage += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" (No detailed error message available.)"));
-
- return sMessage;
- }
-// ---------------------------------------------------------------------------------------
-
- static
- uno::Any impl_makeBootstrapException( BootstrapResult _rc, rtl::OUString const& _sMessage, rtl::OUString const& _sURL, uno::Reference< uno::XInterface > _xContext )
- {
- rtl::OUString sMessage(_sMessage);
- // ensure a message
- if (sMessage.getLength()== 0)
- {
- OSL_ENSURE(false, "Bootstrap error message missing");
-
- sMessage = getFallbackErrorMessage(_rc);
- }
-
- // raise the error
- switch (_rc)
- {
- case MISSING_BOOTSTRAP_FILE:
- return uno::makeAny( com::sun::star::configuration::MissingBootstrapFileException(sMessage, _xContext, _sURL) );
-
- case INCOMPLETE_BOOTSTRAP_FILE:
- return uno::makeAny( com::sun::star::configuration::InvalidBootstrapFileException(sMessage, _xContext, _sURL) );
-
- default: OSL_ENSURE(false, "Undefined BootstrapResult code");
- case INCOMPLETE_BOOTSTRAP_DATA:
- case BOOTSTRAP_FAILURE:
- return uno::makeAny( com::sun::star::configuration::CannotLoadConfigurationException(sMessage, _xContext) );
-
- case BOOTSTRAP_DATA_OK:
- break;
- }
- return uno::Any();
- }
-// ---------------------------------------------------------------------------------------
-
- static
- inline
- bool urlExists(rtl::OUString const& _sURL)
- {
- osl::DirectoryItem aCheck;
- return (osl::DirectoryItem::get(_sURL,aCheck) == osl::DirectoryItem::E_None);
- }
-// ---------------------------------------------------------------------------------------
-
- static
- rtl::OUString buildBootstrapError( sal_Char const* _sWhat, rtl::OUString const& _sName, sal_Char const* _sHow)
- {
- rtl::OUStringBuffer sMessage;
-
- sMessage.appendAscii(RTL_CONSTASCII_STRINGPARAM("The program cannot start. "));
- sMessage.appendAscii(_sWhat);
- sMessage.appendAscii(RTL_CONSTASCII_STRINGPARAM(" '")).append(_sName).appendAscii(RTL_CONSTASCII_STRINGPARAM("' "));
- sMessage.appendAscii(_sHow).appendAscii(". ");
-
- return sMessage.makeStringAndClear();
- }
-// ---------------------------------------------------------------------------------------
-
- BootstrapResult getBootstrapErrorMessage(BootstrapContext const & aContext, ContextReader const & aSettings, rtl::OUString& _rMessage, rtl::OUString& _rIniFile )
- {
- BootstrapResult eResult = BOOTSTRAP_DATA_OK;
-
- _rIniFile = aContext.getBootstrapURL();
-
- if ( !urlExists(_rIniFile) )
- {
- _rMessage = buildBootstrapError("The configuration file ",_rIniFile.copy(1+_rIniFile.lastIndexOf('/')),"is missing");
- eResult = MISSING_BOOTSTRAP_FILE;
- }
- else if (!aSettings.isUnoBackend())
- {
- _rMessage = buildBootstrapError("The configuration file ",_rIniFile.copy(1+_rIniFile.lastIndexOf('/')),"is for an older version of the configuration database");
- eResult = INCOMPLETE_BOOTSTRAP_FILE;
- }
- else if (!aSettings.isBootstrapValid() )
- {
- _rMessage = buildBootstrapError("Needed information to access",rtl::OUString::createFromAscii("application"), "configuration data is missing");
- eResult = INCOMPLETE_BOOTSTRAP_DATA;
- }
-
- return eResult;
- }
-// ---------------------------------------------------------------------------------------
-} // anonymous namespace
-// ---------------------------------------------------------------------------------------
-uno::Any BootstrapContext::makeBootstrapException()
-{
- ContextReader aReader(this);
-
- if (aReader.isBootstrapValid()) return uno::Any();
-
- rtl::OUString sMessage,sURL;
-
- BootstrapResult rc = getBootstrapErrorMessage(*this,aReader,sMessage,sURL);
-
- return impl_makeBootstrapException(rc,sMessage,sURL,*this);
-}
-// ---------------------------------------------------------------------------
-rtl::OUString SAL_CALL
- BootstrapContext::getImplementationName(void)
- throw (uno::RuntimeException)
-{
- return ServiceInfoHelper(&k_BootstrapContextServiceInfo).getImplementationName() ;
-}
-//------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL
- BootstrapContext::supportsService(const rtl::OUString& aServiceName)
- throw (uno::RuntimeException)
-{
- return ServiceInfoHelper(&k_BootstrapContextServiceInfo).supportsService(aServiceName) ;
-}
-//------------------------------------------------------------------------------
-uno::Sequence<rtl::OUString> SAL_CALL
- BootstrapContext::getSupportedServiceNames(void)
- throw (uno::RuntimeException)
-{
- return ServiceInfoHelper(&k_BootstrapContextServiceInfo).getSupportedServiceNames() ;
-}
-// ---------------------------------------------------------------------------------------
-} // namespace configmgr
-
-
diff --git a/configmgr/source/misc/bootstrapcontext.cxx b/configmgr/source/misc/bootstrapcontext.cxx
deleted file mode 100644
index 0e6887b222..0000000000
--- a/configmgr/source/misc/bootstrapcontext.cxx
+++ /dev/null
@@ -1,414 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "bootstrapcontext.hxx"
-#include "datalock.hxx"
-#include <uno/current_context.hxx>
-#include <cppuhelper/implbase2.hxx>
-#include <cppuhelper/exc_hlp.hxx>
-#include <cppuhelper/typeprovider.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include "utility.hxx"
-
-namespace configmgr
-{
-// ---------------------------------------------------------------------------
-#define IMPL_ITEM_PREFIX_ "/implementations/com.sun.star.com.configuration.bootstrap.ComponentContext/"
-#define IMPL_ITEM_PASSTHRU IMPL_ITEM_PREFIX_"isPassthrough"
-#define IMPL_ITEM_BASECONTEXT IMPL_ITEM_PREFIX_"theBaseContext"
-#define A_SERVICEMANAGER "com.sun.star.lang.theServiceManager"
-// ---------------------------------------------------------------------------
-
-#define OUSTR( text ) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( text ) )
-#define OU2ASCII( str ) ( rtl::OUStringToOString(str,RTL_TEXTENCODING_ASCII_US) .getStr() )
-// ---------------------------------------------------------------------------
-#if 0
-static void testComplete()
-{
- uno::Reference< uno::XInterface > test = * new ComponentContext(uno::Reference< uno::XComponentContext >,uno::Sequence < beans::NamedValue >(),true);
-}
-#endif
-// ---------------------------------------------------------------------------
-
-ComponentContext::ComponentContext(uno::Reference< uno::XComponentContext > const & _xContext)
-: cppu::WeakComponentImplHelper3 < uno::XComponentContext, uno::XCurrentContext, lang::XServiceInfo >(UnoApiLock::getLock())
-, m_xContext(_xContext)
-, m_hBootstrapData(NULL)
-, m_xServiceManager()
-{
-}
-// ---------------------------------------------------------------------------
-
-ComponentContext::~ComponentContext()
-{
- if (m_hBootstrapData) rtl_bootstrap_args_close(m_hBootstrapData);
-}
-// ---------------------------------------------------------------------------
-
-void ComponentContext::initialize( const rtl::OUString& _aURL )
-{
- UnoApiLock aLock;
-
- OSL_ASSERT(!m_hBootstrapData);
- m_hBootstrapData = rtl_bootstrap_args_open(_aURL.pData);
-
- uno::Reference< lang::XComponent > xOwner(m_xContext, uno::UNO_QUERY);
-
- if (xOwner.is()) DisposingForwarder::forward(xOwner,this);
-
- if (!m_xContext.is())
- {
- OSL_ENSURE(rBHelper.bDisposed,"ComponentContext::initialize - Context unexpectedly missing");
- throw lang::DisposedException(OUSTR("Parent context has been disposed early"),*this);
- }
-}
-// ---------------------------------------------------------------------------
-
-// ComponentHelper
-void SAL_CALL ComponentContext::disposing()
-{
- UnoApiLock aLock;
-
- m_xContext.clear();
-
- if (m_hBootstrapData)
- {
- rtl_bootstrap_args_close(m_hBootstrapData);
- m_hBootstrapData = NULL;
- }
-}
-// ---------------------------------------------------------------------------
-
-rtl::OUString ComponentContext::getBootstrapURL() const
-{
- rtl::OUString aResult;
-
- UnoApiLock aLock;
-
- if (m_hBootstrapData)
- {
- rtl_bootstrap_get_iniName_from_handle(m_hBootstrapData,&aResult.pData);
- }
- else
- {
- OSL_TRACE( "configmgr: No bootstrap data URL set");
- }
-
- return aResult;
-}
-// ---------------------------------------------------------------------------
-
-uno::Reference< lang::XMultiComponentFactory > SAL_CALL
- ComponentContext::getServiceManager( )
- throw (uno::RuntimeException)
-{
- UnoApiLock aLock;
-
- if (!m_xServiceManager.is())
- {
- uno::Reference< uno::XComponentContext > xBase = basecontext();
- if (!xBase.is())
- throw lang::DisposedException(OUSTR("Parent context has been disposed"),*this);
-
- uno::Reference< lang::XMultiComponentFactory > xBaseServiceManager = xBase->getServiceManager();
- OSL_ENSURE( xBaseServiceManager.is(), "Base context has no service manager");
-
- if (xBaseServiceManager.is())
- {
- // create new smgr based on delegate's one
- m_xServiceManager.set(
- xBaseServiceManager->createInstanceWithContext( OUSTR("com.sun.star.comp.stoc.OServiceManagerWrapper"), xBase ),
- uno::UNO_QUERY );
- // patch DefaultContext property of new one
- uno::Reference< beans::XPropertySet > xProps( m_xServiceManager, uno::UNO_QUERY );
- OSL_ASSERT( xProps.is() );
- if (xProps.is())
- {
- uno::Reference< XComponentContext > xThis( this );
- xProps->setPropertyValue( OUSTR("DefaultContext"), uno::makeAny( xThis ) );
- }
- else
- OSL_ENSURE(!m_xServiceManager.is(), "Cannot set Default Context of Service Manager Wrapper: no property set");
- }
- }
- return m_xServiceManager;
-}
-// ---------------------------------------------------------------------------
-
-
-// ---------------------------------------------------------------------------
-
-sal_Bool ComponentContext::isPassthrough(uno::Reference< uno::XComponentContext > const & _xContext)
-{
- OSL_ENSURE(_xContext.is(),"Unexpected NULL context");
- if (!_xContext.is()) return false;
-
- sal_Bool bValue = false;
- _xContext->getValueByName(OUSTR(IMPL_ITEM_PASSTHRU)) >>= bValue;
- return bValue;
-}
-// ---------------------------------------------------------------------------
-
-beans::NamedValue ComponentContext::makePassthroughMarker(sal_Bool bPassthrough)
-{
- return beans::NamedValue(OUSTR(IMPL_ITEM_PASSTHRU),uno::makeAny(bPassthrough));
-}
-// ---------------------------------------------------------------------------
-
-bool ComponentContext::lookupInContext( uno::Any & _rValue, const rtl::OUString& _aName ) const
-{
- uno::Reference< uno::XComponentContext > xBase = basecontext();
- if (!xBase.is())
- throw lang::DisposedException(OUSTR("Parent context has been disposed"),const_cast<ComponentContext&>(*this));
-
- if (_aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM( IMPL_ITEM_BASECONTEXT )))
- {
- _rValue = uno::makeAny(xBase);
- return true;
- }
-
- uno::Any aCtxValue = xBase->getValueByName( _aName );
-
- if (aCtxValue.hasValue())
- {
- _rValue = aCtxValue;
- return true;
- }
- else
- return false;
-}
-// ---------------------------------------------------------------------------
-
-bool ComponentContext::lookupInBootstrap( uno::Any & _rValue, const rtl::OUString& _aName ) const
-{
- UnoApiLock aLock;
- rtl::OUString sResult;
- if ( rtl_bootstrap_get_from_handle( m_hBootstrapData, _aName.pData, &sResult.pData, 0) )
- {
- _rValue <<= sResult;
- return true;
- }
- else
- return false;
-}
-// ---------------------------------------------------------------------------
-// ---------------------------------------------------------------------------
-
-static const char k_TunneledContext[] = "/services/com.sun.star.configuration.bootstrap.Context";
-
-class UnoContextTunnel::Tunnel
-: public ::cppu::WeakImplHelper2< uno::XCurrentContext, lang::XUnoTunnel >
-{
- uno::Reference< uno::XComponentContext > m_xTunneledContext;
- uno::Reference< uno::XCurrentContext > m_xOldContext;
- uno::Any m_aFailure;
-public:
- Tunnel(uno::Reference< uno::XComponentContext > const & xTunneledContext, uno::Reference< uno::XCurrentContext > const & xOldContext)
- : m_xTunneledContext(xTunneledContext)
- , m_xOldContext(xOldContext)
- , m_aFailure()
- {}
-
- virtual uno::Any SAL_CALL
- getValueByName( const rtl::OUString& name )
- throw (uno::RuntimeException)
- {
- if (name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(k_TunneledContext) ) )
- {
- return uno::makeAny(m_xTunneledContext);
- }
- else if (m_xOldContext.is())
- {
- return m_xOldContext->getValueByName(name);
- }
- else
- {
- return uno::Any();
- }
- }
-
- virtual sal_Int64 SAL_CALL
- getSomething( const uno::Sequence< sal_Int8 >& aIdentifier )
- throw (uno::RuntimeException)
- {
- if (getTunnelId() == aIdentifier)
- return reinterpret_cast<sal_Int64>(&m_aFailure);
- else
- return 0;
- }
-
- static uno::Any * getFailure(uno::Reference< lang::XUnoTunnel > const & xTunnel);
-
- static uno::Sequence< sal_Int8 > getTunnelId();
-};
-// ---------------------------------------------------------------------------
-
-uno::Sequence< sal_Int8 > UnoContextTunnel::Tunnel::getTunnelId()
-{
- static ::cppu::OImplementationId aTunnelId;
- return aTunnelId.getImplementationId();
-}
-// ---------------------------------------------------------------------------
-
-uno::Any * UnoContextTunnel::Tunnel::getFailure(uno::Reference< lang::XUnoTunnel > const & xTunnel)
-{
- if (xTunnel.is())
- {
- if (sal_Int64 nSomething = xTunnel->getSomething(getTunnelId()))
- {
- return reinterpret_cast<uno::Any *>(nSomething);
- }
- }
- return NULL;
-}
-// ---------------------------------------------------------------------------
-
-UnoContextTunnel::UnoContextTunnel()
-: m_xOldContext( uno::getCurrentContext() )
-, m_xActiveTunnel()
-{
-}
-// ---------------------------------------------------------------------------
-
-UnoContextTunnel::~UnoContextTunnel()
-{
- uno::setCurrentContext( m_xOldContext );
-}
-// ---------------------------------------------------------------------------
-
-void UnoContextTunnel::passthru(uno::Reference< uno::XComponentContext > const & xContext)
-{
- OSL_ASSERT( xContext.is() );
- if ( ComponentContext::isPassthrough(xContext) )
- {
- this ->tunnel(xContext);
- }
- else
- {
- this->tunnel(NULL);
- }
-}
-// ---------------------------------------------------------------------------
-
-void UnoContextTunnel::tunnel(uno::Reference< uno::XComponentContext > const & xContext)
-{
- Tunnel * pNewTunnel = new Tunnel(xContext,m_xOldContext);
- m_xActiveTunnel = pNewTunnel;
- uno::setCurrentContext( pNewTunnel );
-}
-// ---------------------------------------------------------------------------
-
-uno::Reference< uno::XComponentContext > UnoContextTunnel::recoverContext(uno::Reference< uno::XComponentContext > const & xFallback )
-{
- try
- {
- uno::Reference< uno::XCurrentContext > const xCurrContext = uno::getCurrentContext();
-
- if (xCurrContext.is())
- {
- rtl::OUString aName(RTL_CONSTASCII_USTRINGPARAM(k_TunneledContext));
- uno::Reference< uno::XComponentContext > xResult;
- if (xCurrContext->getValueByName(aName) >>= xResult)
- {
- if (xResult.is())
- return xResult;
- }
- else
- {
- OSL_ASSERT( !xResult.is() );
- OSL_ENSURE( !xCurrContext->getValueByName(aName).hasValue(),
- "Value in context has wrong type");
- }
- }
- }
- catch (uno::Exception &)
- {
- OSL_ENSURE(false, "Unexpected: Exception from accessing current context");
- }
-
- return xFallback;
-}
-// ---------------------------------------------------------------------------
-
-uno::Any UnoContextTunnel::recoverFailure(bool bRaise)
-{
- if (uno::Any * pFail = UnoContextTunnel::Tunnel::getFailure(m_xActiveTunnel))
- {
- if (bRaise)
- {
- if (pFail->hasValue())
- cppu::throwException(*pFail);
- else
- throw;
- }
- return *pFail;
- }
-
- return uno::Any();
-}
-// ---------------------------------------------------------------------------
-
-bool UnoContextTunnel::tunnelFailure(uno::Any const & aException, bool bRaise)
-{
- OSL_ASSERT( !aException.hasValue() || aException.getValueTypeClass() == uno::TypeClass_EXCEPTION );
-
- uno::Reference< lang::XUnoTunnel > xTunnel( uno::getCurrentContext(), uno::UNO_QUERY );
-
- if (uno::Any * pFail = Tunnel::getFailure(xTunnel))
- {
- *pFail = aException;
-
- if (bRaise && aException.hasValue())
- cppu::throwException(aException);
-
- if (bRaise) throw;
- return true;
- }
- else
- {
- if (bRaise) throw;
- return false;
- }
-}
-// ---------------------------------------------------------------------------
-// ---------------------------------------------------------------------------
-void DisposingForwarder::disposing( lang::EventObject const & /*rSource*/ )
-throw (uno::RuntimeException)
-{
- m_xTarget->dispose();
- m_xTarget.clear();
-}
-// ---------------------------------------------------------------------------
-// ---------------------------------------------------------------------------
-} // namespace config
-
-
diff --git a/configmgr/source/misc/bufferedfile.cxx b/configmgr/source/misc/bufferedfile.cxx
deleted file mode 100644
index 23769c5ab8..0000000000
--- a/configmgr/source/misc/bufferedfile.cxx
+++ /dev/null
@@ -1,130 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <string.h>
-#include "bufferedfile.hxx"
-
-#include "filehelper.hxx"
-
-#include <algorithm>
-
-
-namespace configmgr
-{
-
-BufferedOutputFile::BufferedOutputFile( rtl::OUString const& aFileURL, sal_uInt32 nBufferSizeHint )
-: m_pFile(new osl::File(aFileURL))
-, m_buffer()
-{
- m_buffer.reserve( nBufferSizeHint ? nBufferSizeHint : 512 );
-}
-
-BufferedOutputFile::~BufferedOutputFile ()
-{
- delete m_pFile;
-}
-
-
-BufferedOutputFile::RC BufferedOutputFile::open( sal_uInt32 uFlags )
-{
- if (!m_pFile) return E_BADF;
-
- return m_pFile->open(uFlags);
-}
-
-BufferedOutputFile::RC BufferedOutputFile::close()
-{
- if (!m_pFile) return E_BADF;
-
- RC rc = this->sync();
- RC rc2 = m_pFile->close();
-
- delete m_pFile, m_pFile = 0;
- if (rc == E_None)
- rc = rc2;
- return rc;
-}
-
-
-//BufferedOutputFile::RC BufferedOutputFile::getPos( sal_uInt64& uPos )
-
-BufferedOutputFile::RC BufferedOutputFile::write(const void *pBuffer, sal_uInt64 uBytesToWrite, sal_uInt64& rBytesWritten)
-{
- if (!m_pFile) return E_BADF;
-
- if (uBytesToWrite > m_buffer.max_size()-m_buffer.size())
- {
- // write big chunks natively
- RC rc = this->sync();
- if (rc == E_None)
- {
- OSL_ASSERT(m_buffer.empty());
- rc = m_pFile->write(pBuffer, uBytesToWrite, rBytesWritten);
- }
- return rc;
- }
-
- // FIXME: handle out-out-memory here
- const sal_uInt8 * data = static_cast<const sal_uInt8 *>(pBuffer);
- m_buffer.insert(m_buffer.end(), data, data + uBytesToWrite);
- rBytesWritten = uBytesToWrite;
-
- return E_None;
-}
-
-BufferedOutputFile::RC BufferedOutputFile::sync()
-{
- if (!m_pFile) return E_BADF;
-
- sal_uInt64 size = m_buffer.size();
- sal_uInt64 written = 0;
-
- RC rc = m_pFile->write(&m_buffer.front(),size,written);
-
- if (rc != E_None)
- return rc;
-
- // we don't support special files where multiple write passes are needed
- if (written < size)
- {
- // but we try our best to stay consistent
- m_buffer.erase(m_buffer.begin(),
- m_buffer.end() + sal::static_int_cast<sal_uInt32>( written ));
-
- return E_IO;
- }
-
- m_buffer.clear();
-
- return E_None;
-}
-
-} // namespace configmgr
-
diff --git a/configmgr/source/misc/configinteractionhandler.cxx b/configmgr/source/misc/configinteractionhandler.cxx
deleted file mode 100644
index 044899d5c8..0000000000
--- a/configmgr/source/misc/configinteractionhandler.cxx
+++ /dev/null
@@ -1,112 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "sal/config.h"
-
-#include "configinteractionhandler.hxx"
-
-#include "com/sun/star/task/XInteractionHandler.hpp"
-#include "com/sun/star/uno/Any.hxx"
-#include "com/sun/star/uno/Reference.hxx"
-#include "com/sun/star/uno/RuntimeException.hpp"
-#include "com/sun/star/uno/XCurrentContext.hpp"
-#include "cppuhelper/implbase1.hxx"
-#include "rtl/string.h"
-#include "rtl/ustring.h"
-#include "rtl/ustring.hxx"
-#include "uno/current_context.hxx"
-
-namespace {
-
-namespace css = com::sun::star;
-
-static char const INTERACTION_HANDLER[] = "configuration.interaction-handler";
-
-}
-
-namespace configmgr { namespace apihelper {
-
-class ConfigurationInteractionHandler::Context:
- public cppu::WeakImplHelper1< css::uno::XCurrentContext >
-{
-public:
- explicit Context(ConfigurationInteractionHandler * parent):
- m_parent(parent) {}
-
- virtual css::uno::Any SAL_CALL getValueByName(rtl::OUString const & name)
- throw (css::uno::RuntimeException)
- {
- return
- name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(INTERACTION_HANDLER))
- ? m_handler : m_parent->getPreviousContextValue(name);
- }
-
- void setInteractionHandler(
- css::uno::Reference< css::task::XInteractionHandler > const & handler)
- { m_handler <<= handler; }
-
-private:
- Context(Context &); // not defined
- void operator =(Context &); // not defined
-
- virtual ~Context() {}
-
- ConfigurationInteractionHandler * m_parent;
- css::uno::Any m_handler;
-};
-
-ConfigurationInteractionHandler::ConfigurationInteractionHandler():
- m_context(new Context(this)), m_layer(m_context.get()) {}
-
-ConfigurationInteractionHandler::~ConfigurationInteractionHandler() {}
-
-css::uno::Reference< css::task::XInteractionHandler >
-ConfigurationInteractionHandler::get() const {
- return css::uno::Reference< css::task::XInteractionHandler >(
- getPreviousContextValue(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(INTERACTION_HANDLER))),
- css::uno::UNO_QUERY);
-}
-
-void ConfigurationInteractionHandler::setRecursive(
- css::uno::Reference< css::task::XInteractionHandler > const & handler)
-{
- m_context->setInteractionHandler(handler);
-}
-
-css::uno::Any ConfigurationInteractionHandler::getPreviousContextValue(
- rtl::OUString const & name) const
-{
- css::uno::Reference< css::uno::XCurrentContext > c(
- m_layer.getPreviousContext());
- return c.is() ? c->getValueByName(name) : css::uno::Any();
-}
-
-} }
diff --git a/configmgr/source/misc/configunoreg.cxx b/configmgr/source/misc/configunoreg.cxx
deleted file mode 100644
index 3c4f7a77ca..0000000000
--- a/configmgr/source/misc/configunoreg.cxx
+++ /dev/null
@@ -1,386 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-
-#include "confapifactory.hxx"
-#include "serviceinfohelper.hxx"
-#include <cppuhelper/factory.hxx>
-#include <rtl/ustrbuf.hxx>
-
-// ***************************************************************************************
-//
-// Die vorgeschriebene C-Api muss erfuellt werden!
-// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen.
-//
-
-//---------------------------------------------------------------------------------------
-void RegisterService(
- const configmgr::ServiceRegistrationInfo* pInfo,
- const com::sun::star::uno::Reference< com::sun::star::registry::XRegistryKey > & xKey)
-{
- if (pInfo == 0 || pInfo->registeredServiceNames==0 || pInfo->implementationName==0)
- return;
-
- rtl::OUStringBuffer aMainKeyName;
- aMainKeyName.appendAscii("/");
- aMainKeyName.appendAscii(pInfo->implementationName);
- aMainKeyName.appendAscii("/UNO/SERVICES");
-
- com::sun::star::uno::Reference< com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName.makeStringAndClear()) );
- OSL_ENSURE(xNewKey.is(), "CONFMGR::component_writeInfo : could not create a registry key !");
-
- for(sal_Char const * const* p = pInfo->registeredServiceNames ; *p; ++p)
- {
- xNewKey->createKey(rtl::OUString::createFromAscii(*p));
- }
-}
-
-//---------------------------------------------------------------------------------------
-
-void RegisterSingleton(
- const configmgr::SingletonRegistrationInfo* pInfo,
- const com::sun::star::uno::Reference< com::sun::star::registry::XRegistryKey > & xKey)
-{
- if (pInfo == 0 || pInfo->singletonName ==0 ||
- pInfo->implementationName ==0 ||
- pInfo->instantiatedServiceName ==0 )
- return;
-
- rtl::OUStringBuffer aSingletonKeyName;
- aSingletonKeyName.appendAscii("/");
- aSingletonKeyName.appendAscii(pInfo->implementationName);
- aSingletonKeyName.appendAscii("/UNO/SINGLETONS/");
- aSingletonKeyName.appendAscii(pInfo->singletonName);
-
- com::sun::star::uno::Reference< com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aSingletonKeyName.makeStringAndClear()) );
- OSL_ENSURE(xNewKey.is(), "CONFMGR::component_writeInfo : could not create a registry key !");
-
- xNewKey->setStringValue(rtl::OUString::createFromAscii(pInfo->instantiatedServiceName));
-
- if (pInfo->mappedImplementation != 0)
- RegisterService(pInfo->mappedImplementation,xKey);
-}
-
-
-//-----------------------------------------------------------------------------
-struct ServiceImplementationRequest
-{
- com::sun::star::uno::Reference< com::sun::star::uno::XInterface > xRet;
- com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > const m_xServiceManager;
- rtl::OUString const sImplementationName;
-
- //-------------------------------------------------------------------------
- ServiceImplementationRequest(
- void* pServiceManager,
- sal_Char const* pImplementationName
- )
- : m_xServiceManager(reinterpret_cast<com::sun::star::lang::XMultiServiceFactory*>(pServiceManager))
- , sImplementationName(rtl::OUString::createFromAscii(pImplementationName))
- {
- }
- //-------------------------------------------------------------------------
- inline
- sal_Bool shouldCreate(const configmgr::ServiceRegistrationInfo* pInfo) const
- {
- OSL_ENSURE(!xRet.is(), "CreateProvider : invalid creation request: we already have a return value !");
- return !xRet.is() &&
- pInfo != 0 &&
- 0 == sImplementationName.compareToAscii(pInfo->implementationName);
- }
-
- //-------------------------------------------------------------------------
-
- sal_Bool CreateProviderFactory(
- const configmgr::ServiceRegistrationInfo* pInfo,
- bool bAdmin
- )
- {
- if (this->shouldCreate(pInfo))
- try
- {
- configmgr::ServiceRegistrationHelper aInfo(pInfo);
-
- const com::sun::star::uno::Sequence< rtl::OUString > Services= aInfo.getRegisteredServiceNames();
-
- xRet = configmgr::createProviderFactory( aInfo.getImplementationName(), bAdmin);
-
- OSL_ENSURE(xRet.is(), "CreateProvider : WHERE IS THE return value !");
- }
- catch(com::sun::star::uno::Exception&)
- {
- }
- return xRet.is();
- }
-
- //-------------------------------------------------------------------------
-
- sal_Bool CreateServiceFactory(
- const configmgr::ServiceRegistrationInfo* pInfo,
- ::cppu::ComponentFactoryFunc Factory
- )
- {
- if (this->shouldCreate(pInfo))
- try
- {
- configmgr::ServiceRegistrationHelper aInfo(pInfo);
-
- const com::sun::star::uno::Sequence< rtl::OUString > Services= aInfo.getRegisteredServiceNames();
-
- xRet = cppu::createSingleComponentFactory( Factory, aInfo.getImplementationName(), Services, 0);
-
- OSL_ENSURE(xRet.is(), "CreateProvider : WHERE IS THE return value !");
- }
- catch(com::sun::star::uno::Exception&)
- {
- }
- return xRet.is();
- }
-
- //-------------------------------------------------------------------------
-
- sal_Bool CreateSingletonMapperFactory(
- const configmgr::SingletonRegistrationInfo* pInfo,
- ::cppu::ComponentFactoryFunc Mapper
- )
- {
- OSL_ENSURE(pInfo && pInfo->mappedImplementation, "CreateProvider : Cannot map unmapped singleton !");
-
- return pInfo && pInfo->mappedImplementation &&
- CreateServiceFactory(pInfo->mappedImplementation,Mapper);
- }
-
- //-------------------------------------------------------------------------
- void* getService() const
- {
- // we want to transport the interface pointer as flat C void pointer, so this prevents deletion
- if (xRet.is())
- xRet->acquire();
-
- return xRet.get();
- }
-};
-
-//---------------------------------------------------------------------------------------
-
-extern "C" SAL_DLLPUBLIC_EXPORT
-void SAL_CALL component_getImplementationEnvironment(
- const sal_Char **ppEnvTypeName,
- uno_Environment ** /* ppEnv */
- )
-{
- *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
-}
-
-//---------------------------------------------------------------------------------------
-extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- void* /* pServiceManager */,
- void* pRegistryKey
- )
-{
- if (pRegistryKey)
- try
- {
- com::sun::star::uno::Reference< com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast<com::sun::star::registry::XRegistryKey*>(pRegistryKey));
-
- // configuration access entry points: configuration provider
- RegisterSingleton(configmgr::getDefaultProviderSingletonInfo(), xKey) ;
-
- RegisterService(configmgr::getConfigurationProviderServiceInfo(), xKey);
- RegisterService(configmgr::getDefaultProviderServiceInfo(), xKey);
- RegisterService(configmgr::getAdminProviderServiceInfo(), xKey);
-
- // registry wrapper (deprecated)
- RegisterService(configmgr::getConfigurationRegistryServiceInfo(), xKey);
-
- // updating
- RegisterService(configmgr::backend::getUpdateMergerServiceInfo(), xKey);
-
- // xml handling
- RegisterService(configmgr::xml::getSchemaParserServiceInfo(), xKey);
- RegisterService(configmgr::xml::getLayerParserServiceInfo(), xKey);
- RegisterService(configmgr::xml::getLayerWriterServiceInfo(), xKey);
-
- // bootstrap handling
- RegisterSingleton(configmgr::getBootstrapContextSingletonInfo(), xKey) ;
- RegisterService(configmgr::getBootstrapContextServiceInfo(), xKey) ;
-
- // backend singletons
- RegisterSingleton(configmgr::backend::getDefaultBackendSingletonInfo(), xKey) ;
-
- // backends
- RegisterService(configmgr::backend::getDefaultBackendServiceInfo(), xKey) ;
- RegisterService(configmgr::backend::getSingleBackendAdapterServiceInfo(), xKey) ;
- RegisterService(configmgr::backend::getMultiStratumBackendServiceInfo(), xKey) ;
- RegisterService(configmgr::localbe::getLocalBackendServiceInfo(), xKey) ;
- RegisterService(configmgr::localbe::getLocalDataImportServiceInfo(), xKey) ;
- RegisterService(configmgr::localbe::getLocalHierarchyBrowserServiceInfo(), xKey) ;
- RegisterService(configmgr::localbe::getLocalSchemaSupplierServiceInfo(), xKey) ;
- RegisterService(configmgr::localbe::getLocalLegacyStratumServiceInfo(), xKey) ;
- RegisterService(configmgr::localbe::getLocalDataStratumServiceInfo(), xKey) ;
- RegisterService(configmgr::localbe::getLocalReadonlyStratumServiceInfo(), xKey) ;
- RegisterService(configmgr::localbe::getLocalResourceStratumServiceInfo(), xKey) ;
- RegisterService(configmgr::localbe::getLocalMultiStratumServiceInfo(), xKey) ;
-
- // im/export
- RegisterService(configmgr::backend::getMergeImportServiceInfo(), xKey);
- RegisterService(configmgr::backend::getCopyImportServiceInfo(), xKey);
-
- return sal_True;
- }
- catch (::com::sun::star::registry::InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "configmgr: component_writeInfo : could not create a registry key ! ## InvalidRegistryException !");
- }
-
- return sal_False;
-}
-
-//---------------------------------------------------------------------------------------
-extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
- const sal_Char* pImplementationName,
- void* pServiceManager,
- void* /*pRegistryKey*/)
-{
- void* pRet = 0;
- if (pServiceManager)
- {
- ServiceImplementationRequest aReq(pServiceManager,pImplementationName);
-
- // configuration access entry points: configuration provider
- aReq.CreateProviderFactory(
- configmgr::getConfigurationProviderServiceInfo(),
- false)
- ||
- aReq.CreateProviderFactory(
- configmgr::getAdminProviderServiceInfo(),
- true)
- ||
- aReq.CreateServiceFactory(
- configmgr::getDefaultProviderServiceInfo(),
- &configmgr::instantiateDefaultProvider)
- ||
- // registry wrapper (deprecated)
- aReq.CreateServiceFactory(
- configmgr::getConfigurationRegistryServiceInfo(),
- &configmgr::instantiateConfigRegistry)
- ||
- // updating
- aReq.CreateServiceFactory(
- configmgr::backend::getUpdateMergerServiceInfo(),
- &configmgr::backend::instantiateUpdateMerger)
- ||
- // xml handling
- aReq.CreateServiceFactory(
- configmgr::xml::getSchemaParserServiceInfo(),
- &configmgr::xml::instantiateSchemaParser)
- ||
- aReq.CreateServiceFactory(
- configmgr::xml::getLayerParserServiceInfo(),
- &configmgr::xml::instantiateLayerParser)
- ||
- aReq.CreateServiceFactory(
- configmgr::xml::getLayerWriterServiceInfo(),
- &configmgr::xml::instantiateLayerWriter)
- ||
- // bootstrap handling
- aReq.CreateServiceFactory(
- configmgr::getBootstrapContextServiceInfo(),
- &configmgr::instantiateBootstrapContext)
- ||
- // backend singletons
- aReq.CreateSingletonMapperFactory(
- configmgr::backend::getDefaultBackendSingletonInfo(),
- configmgr::backend::getDefaultBackendSingleton)
- ||
- // backends
- aReq.CreateServiceFactory(
- configmgr::backend::getDefaultBackendServiceInfo(),
- configmgr::backend::instantiateDefaultBackend)
- ||
- aReq.CreateServiceFactory(
- configmgr::backend::getSingleBackendAdapterServiceInfo(),
- configmgr::backend::instantiateSingleBackendAdapter)
- ||
- aReq.CreateServiceFactory(
- configmgr::backend::getMultiStratumBackendServiceInfo(),
- configmgr::backend::instantiateMultiStratumBackend)
- ||
- aReq.CreateServiceFactory(
- configmgr::localbe::getLocalBackendServiceInfo(),
- configmgr::localbe::instantiateLocalBackend)
- ||
- aReq.CreateServiceFactory(
- configmgr::localbe::getLocalDataImportServiceInfo(),
- configmgr::localbe::instantiateLocalDataImporter)
- ||
- aReq.CreateServiceFactory(
- configmgr::localbe::getLocalHierarchyBrowserServiceInfo(),
- configmgr::localbe::instantiateLocalHierarchyBrowser)
- ||
- aReq.CreateServiceFactory(
- configmgr::localbe::getLocalSchemaSupplierServiceInfo(),
- configmgr::localbe::instantiateLocalSchemaSupplier)
- ||
- aReq.CreateServiceFactory(
- configmgr::localbe::getLocalLegacyStratumServiceInfo(),
- configmgr::localbe::instantiateLocalLegacyStratum)
- ||
- aReq.CreateServiceFactory(
- configmgr::localbe::getLocalDataStratumServiceInfo(),
- configmgr::localbe::instantiateLocalDataStratum)
- ||
- aReq.CreateServiceFactory(
- configmgr::localbe::getLocalReadonlyStratumServiceInfo(),
- configmgr::localbe::instantiateLocalReadonlyStratum)
- ||
- aReq.CreateServiceFactory(
- configmgr::localbe::getLocalResourceStratumServiceInfo(),
- configmgr::localbe::instantiateLocalResourceStratum)
- ||
- aReq.CreateServiceFactory(
- configmgr::localbe::getLocalMultiStratumServiceInfo(),
- configmgr::localbe::instantiateLocalMultiStratum)
- ||
- // im/export
- aReq.CreateServiceFactory(
- configmgr::backend::getMergeImportServiceInfo(),
- &configmgr::backend::instantiateMergeImporter)
- ||
- aReq.CreateServiceFactory(
- configmgr::backend::getCopyImportServiceInfo(),
- &configmgr::backend::instantiateCopyImporter);
-
- pRet = aReq.getService();
- }
-
- return pRet;
-}
-//---------------------------------------------------------------------------------------
-
diff --git a/configmgr/source/misc/filehelper.cxx b/configmgr/source/misc/filehelper.cxx
deleted file mode 100644
index 57b196e802..0000000000
--- a/configmgr/source/misc/filehelper.cxx
+++ /dev/null
@@ -1,387 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-
-#ifndef _RTL_USTRING_H_
-#include <rtl/ustring.hxx>
-#endif
-#include <osl/file.hxx>
-#include "filehelper.hxx"
-#include <rtl/ustrbuf.hxx>
-#include <osl/diagnose.h>
-
-#define ASCII(x) rtl::OUString::createFromAscii(x)
-
-namespace configmgr
-{
- //==========================================================================
- //= FileHelper
- //==========================================================================
-
- // -----------------------------------------------------------------------------
- bool FileHelper::tryToRemoveFile(const rtl::OUString& _aURL, bool tryBackupFirst)
- {
- if (tryBackupFirst)
- {
- rtl::OUString aBakURL = _aURL.concat( ASCII(".bak") );
- osl::File::RC eBakError = osl::File::move(_aURL,aBakURL);
- if (eBakError == osl::File::E_None)
- return true;
- }
- osl::File::RC eError = osl::File::remove(_aURL);
- return eError == osl::File::E_None || eError == osl::File::E_NOENT;
- }
- // -----------------------------------------------------------------------------
- void FileHelper::replaceFile(
- const rtl::OUString& _aToURL, const rtl::OUString &_aFromURL) SAL_THROW((io::IOException))
- {
- osl::File::remove(_aToURL);
- osl::File::RC eError = osl::File::move(_aFromURL, _aToURL);
- if (eError != osl::File::E_None &&
- eError != osl::File::E_NOENT)
- {
- rtl::OUStringBuffer sErrorBuf;
- sErrorBuf.appendAscii("Configmgr: replaceFile failed ");
- sErrorBuf.appendAscii("for replacing file \"").append(_aFromURL).appendAscii("\". ");
- sErrorBuf.appendAscii("by file \"").append(_aToURL).appendAscii("\". ");
- sErrorBuf.appendAscii("Error = \"").append(FileHelper::createOSLErrorString(eError)).appendAscii("\" ");
- sErrorBuf.appendAscii("[").append(sal_Int32(eError)).appendAscii("] ");
-
- rtl::OUString const sError = sErrorBuf.makeStringAndClear();
- OSL_ENSURE(0, rtl::OUStringToOString(sError,RTL_TEXTENCODING_ASCII_US).getStr());
- throw io::IOException(sError, NULL);
- }
- }
-
- // -----------------------------------------------------------------------------
- bool FileHelper::fileExists(rtl::OUString const& _sFileURL)
- {
- osl::DirectoryItem aItem;
- return osl::DirectoryItem::get(_sFileURL, aItem) == osl::Directory::E_None;
- }
-
- // -----------------------------------------------------------------------------
- bool FileHelper::dirExists(rtl::OUString const& _sDirURL)
- {
- return osl::Directory(_sDirURL).open() == osl::Directory::E_None;
- }
-
- // -----------------------------------------------------------------------------
- sal_uInt64 FileHelper::getModifyStatus(rtl::OUString const& _sURL, TimeValue & rModifyTime)
- {
- static const TimeValue k_NullTime = {0,0};
- sal_uInt64 aSize = 0;
- rModifyTime = k_NullTime;
-
- osl::DirectoryItem aItem;
- if (osl::FileBase::E_None == osl::DirectoryItem::get(_sURL, aItem))
- {
- osl::FileStatus aStatus(osl_FileStatus_Mask_ModifyTime|osl_FileStatus_Mask_Type|osl_FileStatus_Mask_FileSize);
- if (osl::FileBase::E_None == aItem.getFileStatus(aStatus))
- {
- if (aStatus.isValid(osl_FileStatus_Mask_ModifyTime))
- rModifyTime = aStatus.getModifyTime();
-
- if (aStatus.isValid(osl_FileStatus_Mask_FileSize))
- aSize = aStatus.getFileSize();
- }
- }
- return aSize;
- }
-
- // -----------------------------------------------------------------------------
- rtl::OUString FileHelper::createOSLErrorString(osl::FileBase::RC eError)
- {
- rtl::OUString aRet;
- switch(eError)
- {
- case osl::FileBase::E_None:
- break;
-
- case osl::FileBase::E_PERM:
- aRet = ASCII("Operation not permitted");
- break;
-
- case osl::FileBase::E_NOENT:
- aRet = ASCII("No such file or directory");
- break;
-
- case osl::FileBase::E_SRCH:
- aRet = ASCII("unknown error: osl_File_E_SRCH");
- break;
-
- case osl::FileBase::E_INTR:
- aRet = ASCII("function call was interrupted");
- break;
-
- case osl::FileBase::E_IO:
- aRet = ASCII("I/O error");
- break;
-
- case osl::FileBase::E_NXIO:
- aRet = ASCII("No such device or address");
- break;
-
- case osl::FileBase::E_2BIG:
- aRet = ASCII("unknown error: osl_File_E_2BIG");
- break;
-
- case osl::FileBase::E_NOEXEC:
- aRet = ASCII("unknown error: osl_File_E_NOEXEC");
- break;
-
- case osl::FileBase::E_BADF:
- aRet = ASCII("Bad file");
- break;
-
- case osl::FileBase::E_CHILD:
- aRet = ASCII("unknown error: osl_File_E_CHILD");
- break;
-
- case osl::FileBase::E_AGAIN:
- aRet = ASCII("Operation would block");
- break;
-
- case osl::FileBase::E_NOMEM:
- aRet = ASCII("not enough memory for allocating structures");
- break;
-
- case osl::FileBase::E_ACCES:
- aRet = ASCII("Permission denied");
- break;
-
- case osl::FileBase::E_FAULT:
- aRet = ASCII("Bad address");
- break;
-
- case osl::FileBase::E_BUSY:
- aRet = ASCII("Text file busy");
- break;
-
- case osl::FileBase::E_EXIST:
- aRet = ASCII("File exists");
- break;
-
- case osl::FileBase::E_XDEV:
- aRet = ASCII("unknown error: osl_File_E_XDEV");
- break;
-
- case osl::FileBase::E_NODEV:
- aRet = ASCII("No such device");
- break;
-
- case osl::FileBase::E_NOTDIR:
- aRet = ASCII("Not a directory");
- break;
-
- case osl::FileBase::E_ISDIR:
- aRet = ASCII("Is a director");
- break;
-
- case osl::FileBase::E_INVAL:
- aRet = ASCII("the format of the parameters was not valid");
- break;
-
- case osl::FileBase::E_NFILE:
- aRet = ASCII("too many open files in the system");
- break;
-
- case osl::FileBase::E_MFILE:
- aRet = ASCII("too many open files used by the process");
- break;
-
- case osl::FileBase::E_NOTTY:
- aRet = ASCII("unknown error: osl_File_E_NOTTY");
- break;
-
- case osl::FileBase::E_FBIG:
- aRet = ASCII("File too large");
- break;
-
- case osl::FileBase::E_NOSPC:
- aRet = ASCII("No space left on device");
- break;
-
- case osl::FileBase::E_SPIPE:
- aRet = ASCII("unknown error: osl_File_E_SPIPE");
- break;
-
- case osl::FileBase::E_ROFS:
- aRet = ASCII("Read-only file system");
- break;
-
- case osl::FileBase::E_MLINK:
- aRet = ASCII("Too many links");
- break;
-
- case osl::FileBase::E_PIPE:
- aRet = ASCII("unknown error: osl_File_E_PIPE");
- break;
-
- case osl::FileBase::E_DOM:
- aRet = ASCII("unknown error: osl_File_E_DOM");
- break;
-
- case osl::FileBase::E_RANGE:
- aRet = ASCII("unknown error: osl_File_E_RANGE");
- break;
-
- case osl::FileBase::E_DEADLK:
- aRet = ASCII("unknown error: osl_File_E_DEADLK");
- break;
-
- case osl::FileBase::E_NAMETOOLONG:
- aRet = ASCII("File name too long");
- break;
-
- case osl::FileBase::E_NOLCK:
- aRet = ASCII("No record locks available");
- break;
-
- case osl::FileBase::E_NOSYS:
- aRet = ASCII("Function not implemente");
- break;
-
- case osl::FileBase::E_NOTEMPTY:
- aRet = ASCII("Directory not empt");
- break;
-
- case osl::FileBase::E_LOOP:
- aRet = ASCII("Too many symbolic links encountered");
- break;
-
- case osl::FileBase::E_ILSEQ:
- aRet = ASCII("unknown error: osl_File_E_ILSEQ");
- break;
-
- case osl::FileBase::E_NOLINK:
- aRet = ASCII("Link has been severed");
- break;
-
- case osl::FileBase::E_MULTIHOP:
- aRet = ASCII("Multihop attempted");
- break;
-
- case osl::FileBase::E_USERS:
- aRet = ASCII("unknown error: osl_File_E_USERS");
- break;
-
- case osl::FileBase::E_OVERFLOW:
- aRet = ASCII("Value too large for defined data type");
- break;
-
- /* unmapped error: always last entry in enum! */
- default: OSL_ENSURE(false, "Found unknown OSL File Error");
- case osl::FileBase::E_invalidError:
- aRet = ASCII("unmapped Error");
- break;
- }
- return aRet;
- }
-
- // -----------------------------------------------------------------------------
- rtl::OUString FileHelper::getParentDir(rtl::OUString const& _sURL)
- {
- rtl::OUString parentDirectory ;
- rtl::OUString fileName ;
-
- splitFileUrl(_sURL, parentDirectory, fileName) ;
- return parentDirectory ;
- }
-
- // -----------------------------------------------------------------------------
- void FileHelper::splitFileUrl(const rtl::OUString& aFileUrl,
- rtl::OUString& aParentDirectory,
- rtl::OUString& aFileName) {
- // goto last '/' and cut the rest.
- sal_Int32 nIdx = aFileUrl.lastIndexOf(delimiter, aFileUrl.getLength());
- if (nIdx > 0) {
- aParentDirectory = aFileUrl.copy(0, nIdx);
- aFileName = aFileUrl.copy(nIdx + 1) ;
- }
- else {
- aParentDirectory = rtl::OUString() ;
- aFileName = aFileUrl ;
- }
- }
-
- // -----------------------------------------------------------------------------
- rtl::OUString FileHelper::getFileName(const rtl::OUString& aFileUrl) {
- rtl::OUString parentDirectory ;
- rtl::OUString fileName ;
-
- splitFileUrl(aFileUrl, parentDirectory, fileName) ;
- return fileName ;
- }
- // -----------------------------------------------------------------------------
- osl::FileBase::RC FileHelper::mkdir(rtl::OUString const& _sDirURL)
- {
- // direct create a directory
- osl::FileBase::RC eError = osl::Directory::create(_sDirURL); // try to create the directory
- if (eError == osl::FileBase::E_EXIST ||
- eError == osl::FileBase::E_None ||
- FileHelper::dirExists(_sDirURL))
- {
- eError = osl::FileBase::E_None; // Exists or created
- }
- return eError;
- }
-
- // -----------------------------------------------------------------------------
- osl::FileBase::RC FileHelper::mkdirs(rtl::OUString const& _sDirURL)
- {
- osl::FileBase::RC eError = mkdir(_sDirURL);
- switch (eError)
- {
- case osl::FileBase::E_EXIST: OSL_ASSERT(false);
- case osl::FileBase::E_None:
- break;
-
- case osl::FileBase::E_NOENT:
- {
- rtl::OUString sParentDir = FileHelper::getParentDir(_sDirURL);
- if (sParentDir.getLength() == 0)
- break;
-
- eError = mkdirs(sParentDir);
- if (eError != osl::FileBase::E_None)
- break;
-
- eError = mkdir(_sDirURL);
- }
- break;
-
- default: OSL_TRACE("configmgr: Could not create directory (%d).", int(eError));
- break;
- }
- return eError;
- }
-
-} // namespace configmgr
diff --git a/configmgr/source/misc/interactionrequest.cxx b/configmgr/source/misc/interactionrequest.cxx
deleted file mode 100644
index a836bafbc4..0000000000
--- a/configmgr/source/misc/interactionrequest.cxx
+++ /dev/null
@@ -1,115 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "interactionrequest.hxx"
-
-namespace configmgr {
-namespace apihelper {
- namespace uno = com::sun::star::uno;
- namespace task = com::sun::star::task;
-//=========================================================================
-//=========================================================================
-//
-// InteractionRequest Implementation.
-//
-//=========================================================================
-//=========================================================================
-
-struct InteractionRequest::Impl
-{
- uno::Reference< task::XInteractionContinuation > m_xSelection;
- uno::Any m_aRequest;
- uno::Sequence< uno::Reference< task::XInteractionContinuation > > m_aContinuations;
-
- Impl() {}
- Impl( const uno::Any & rRequest )
- : m_aRequest( rRequest )
- {}
-};
-
-//=========================================================================
-InteractionRequest::InteractionRequest( const uno::Any & rRequest )
-: m_pImpl( new Impl( rRequest ) )
-{
-}
-
-//=========================================================================
-// virtual
-InteractionRequest::~InteractionRequest()
-{
- delete m_pImpl;
-}
-
-//=========================================================================
-void InteractionRequest::setContinuations(
- const uno::Sequence< uno::Reference<
- task::XInteractionContinuation > > & rContinuations )
-{
- m_pImpl->m_aContinuations = rContinuations;
-}
-
-//=========================================================================
-uno::Reference< task::XInteractionContinuation > InteractionRequest::getSelection() const
-{
- return m_pImpl->m_xSelection;
-}
-
-//=========================================================================
-void InteractionRequest::setSelection( const uno::Reference< task::XInteractionContinuation > & rxSelection )
-{
- m_pImpl->m_xSelection = rxSelection;
-}
-
-//=========================================================================
-//
-// XInteractionRequest methods.
-//
-//=========================================================================
-
-// virtual
-uno::Any SAL_CALL InteractionRequest::getRequest()
- throw( uno::RuntimeException )
-{
- return m_pImpl->m_aRequest;
-}
-
-//=========================================================================
-// virtual
-uno::Sequence< uno::Reference< task::XInteractionContinuation > > SAL_CALL
- InteractionRequest::getContinuations()
- throw( uno::RuntimeException )
-{
- return m_pImpl->m_aContinuations;
-}
-
-//=========================================================================
-
-} // namespace apihelper
-} // namespace configmgr
diff --git a/configmgr/source/misc/logger.cxx b/configmgr/source/misc/logger.cxx
deleted file mode 100644
index 8744cd57cb..0000000000
--- a/configmgr/source/misc/logger.cxx
+++ /dev/null
@@ -1,93 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "logger.hxx"
-
-#define CONFIG_LOGGER_SINGLETON "/singletons/com.sun.star.configuration.theLogger"
-#define OUSTR( lit ) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( lit ) )
-#define OU2A( ustr ) rtl::OUStringToOString( ustr, RTL_TEXTENCODING_UTF8 ).getStr()
-#define A2OU( astr ) rtl::OUString::createFromAscii( astr )
-
-static const sal_Char k_unspecifiedClass[] = "configmgr";
-static const sal_Char k_unspecifiedMethod[] = "log-message";
-
-namespace configmgr
-{
-
-//--------------------------------------------------------------------------
-void Logger::log(sal_Int32 nLevel, const char * msg, const char * sourceMethod, const char * sourceClass) const
-{
- OSL_ASSERT(msg);
- if (!msg) msg = "";
-
- this->log(nLevel,A2OU(msg),sourceMethod,sourceClass);
-}
-
-//--------------------------------------------------------------------------
-void Logger::log(sal_Int32 nLevel, const rtl::OUString & msg, const char * sourceMethod, const char * sourceClass) const
-{
- if (!sourceClass) sourceClass = k_unspecifiedClass;
- if (!sourceMethod) sourceMethod = k_unspecifiedMethod;
-
- // this place can be used to further enrich or instrument log output
- if (m_xLogger.is())
- try
- {
- m_xLogger->logp(nLevel,A2OU(sourceClass),A2OU(sourceMethod),msg);
- }
- catch (uno::Exception & e)
- {
- OSL_TRACE("Configuration Log failure: %s\n"
- "Log message was [Level=%04d] %s::%s : %s\n",
- OU2A(e.Message),int(nLevel),sourceClass,sourceMethod,OU2A(msg));
- }
- else if (nLevel >= (LogLevel::SEVERE - OSL_DEBUG_LEVEL*(LogLevel::SEVERE-LogLevel::WARNING)))
- OSL_TRACE("Configuration Log [%04d] %s::%s : %s\n", int(nLevel),sourceClass,sourceMethod,OU2A(msg));
-
-}
-
-//--------------------------------------------------------------------------
-uno::Reference< logging::XLogger >
- Logger::getUnoLoggerFromContext(uno::Reference< uno::XComponentContext > const & xContext)
-{
- uno::Reference< logging::XLogger > xLogger;
-
- if (xContext.is())
- try { xContext->getValueByName( OUSTR(CONFIG_LOGGER_SINGLETON) ) >>= xLogger; }
- catch (uno::Exception & ) {}
-
- return xLogger;
-}
-
-//--------------------------------------------------------------------------
-
-} // namespace configmgr
-
-
diff --git a/configmgr/source/misc/makefile.mk b/configmgr/source/misc/makefile.mk
deleted file mode 100644
index 0c5abcc7ef..0000000000
--- a/configmgr/source/misc/makefile.mk
+++ /dev/null
@@ -1,73 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJINC=$(PRJ)$/source
-PRJNAME=configmgr
-TARGET=misc
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings ----------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/makefile.pmk
-.INCLUDE : $(PRJ)$/version.mk
-
-# --- Files -------------------------------------
-
-SLOFILES= \
- $(SLO)$/bootstrap.obj \
- $(SLO)$/providerfactory.obj \
- $(SLO)$/providerwrapper.obj \
- $(SLO)$/logger.obj \
- $(SLO)$/tracer.obj \
- $(SLO)$/configunoreg.obj \
- $(SLO)$/serviceinfohelper.obj \
- $(SLO)$/bootstrapcontext.obj \
- $(SLO)$/anypair.obj \
- $(SLO)$/strimpl.obj \
- $(SLO)$/mergechange.obj \
- $(SLO)$/oslstream.obj \
- $(SLO)$/filehelper.obj \
- $(SLO)$/bufferedfile.obj \
- $(SLO)$/requestoptions.obj \
- $(SLO)$/interactionrequest.obj \
- $(SLO)$/configinteractionhandler.obj \
- $(SLO)$/simpleinteractionrequest.obj \
- $(SLO)$/propertysethelper.obj \
-
-OBJFILES= \
- $(OBJ)$/oslstream.obj \
- $(OBJ)$/filehelper.obj \
- $(OBJ)$/bufferedfile.obj \
-
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/configmgr/source/misc/mergechange.cxx b/configmgr/source/misc/mergechange.cxx
deleted file mode 100644
index fca86546b2..0000000000
--- a/configmgr/source/misc/mergechange.cxx
+++ /dev/null
@@ -1,828 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "builddata.hxx"
-#include "mergechange.hxx"
-#include "updatehelper.hxx"
-#include "treeactions.hxx"
-#include "treefragment.hxx"
-#include "change.hxx"
-#include "treechangefactory.hxx"
-#include "treechangelist.hxx"
-#include "configexcept.hxx"
-#include "tracer.hxx"
-
-#define ASCII(x) rtl::OUString::createFromAscii(x)
-
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
- // -----------------------------------------------------------------------------
- class OMergeChanges : private ChangeTreeAction, private OPathCreator<configuration::RelativePath>
- {
- SubtreeChange &m_rSubtreeChange; // ChangeList, which will be grown
- SubtreeChange *m_pCurrentParent; // our current position
-
- // ------- Helper for Path stack -------
- SubtreeChange* pushTree(SubtreeChange& _rTree);
- void popTree(SubtreeChange* _pSaveTree);
-
- public:
- // CTor
- OMergeChanges(SubtreeChange& _rTree);
-
- // start function, with the Change we want to do.
- // WARNING this could be a big tree, because a change can contain subtreechanges!
- void mergeChanges(const SubtreeChange &_rChange, const configuration::RelativePath& _aPathToChange);
- void mergeChanges(const SubtreeChange &_rChange);
-
- private:
- void initRoot(const SubtreeChange &_rRootChange, const configuration::RelativePath& _aPathToChange);
- private:
- virtual void handle(ValueChange const& _rValueNode);
- virtual void handle(AddNode const& _rAddNode);
- virtual void handle(RemoveNode const& _rRemoveNode);
- virtual void handle(SubtreeChange const& _rSubtree);
-
- };
- // -----------------------------------------------------------------------------
- void combineUpdates(SubtreeChange const& _anUpdate, SubtreeChange& _aCombinedUpdate)
- {
- OMergeChanges aCombined(_aCombinedUpdate);
- aCombined.mergeChanges(_anUpdate);
- }
- // -----------------------------------------------------------------------------
-
- configuration::Path::Component ONameCreator::createName(Change const& _rChange, SubtreeChange const* _pParent)
- {
- OSL_ENSURE(_pParent, "ONameCreator: Cannot create proper name without a parent");
- if (_pParent && _pParent->isSetNodeChange())
- {
- rtl::OUString sElementName = _rChange.getNodeName();
- rtl::OUString sTypeName = _pParent->getElementTemplateName();
-
- return configuration::Path::makeCompositeName(sElementName, sTypeName);
- }
- else
- {
- rtl::OUString sElementName = _rChange.getNodeName();
-
- // OSL_ENSURE(isSimpleName(sElementName),"Unexpected: Non-simple name in non-set node");
-
- return configuration::Path::wrapSafeName(sElementName);
- }
- }
-
-
- // -----------------------------------------------------------------------------
- class OMergeValueChange : private ChangeTreeModification
- {
- SubtreeChange& m_rTargetParent;
- const ValueChange& m_aValueChange;
- public:
- OMergeValueChange(SubtreeChange& _rTargetParent, const ValueChange& _aValueChange)
- :m_rTargetParent(_rTargetParent)
- ,m_aValueChange(_aValueChange)
- {
-
- }
- void handleChange(Change &_rNode)
- {
- this->applyToChange(_rNode);
- }
- private:
- virtual void handle(ValueChange& _rValueChange)
- {
- // POST: Handle ValueChange
- _rValueChange.setNewValue(m_aValueChange.getNewValue(), m_aValueChange.getMode());
- }
- virtual void handle(RemoveNode& /*_rRemoveNode*/)
- {
- OSL_ENSURE(false, "OMergeValueChange::handle(ValueChange): have a ValueChange for a removed node!");
- // should never happen. How did the user change a value for a node which is obviously flagged as removed?
- }
- virtual void handle(AddNode& _rAddNode);
- virtual void handle(SubtreeChange& _rSubtree)
- {
- if ( isLocalizedValueSet(_rSubtree) )
- {
- std::auto_ptr<ValueChange> pNewValueChange( new ValueChange(m_aValueChange) );
- OSL_ENSURE(pNewValueChange->isLocalizedValue(), "OMergeValueChange:handle(SubtreeChange): have a non-localized ValueChange a for a localized node!");
-
- std::auto_ptr<Change> pNewChange( pNewValueChange.release() );
-
- replaceExistingEntry(pNewChange);
- }
- else
- OSL_ENSURE(false, "OMergeValueChange:handle(SubtreeChange): have a ValueChange for a sub tree!");
- }
-
- void replaceExistingEntry(std::auto_ptr<Change> pNewChange)
- {
- m_rTargetParent.removeChange(pNewChange->getNodeName());
- m_rTargetParent.addChange(pNewChange);
- }
- static std::auto_ptr<ValueNode> createNodeFromChange(ValueChange const& rChange)
- {
- std::auto_ptr<ValueNode> aRet;
-
- uno::Any aNewValue = rChange.getNewValue();
-
- // currently not supporting change modes !
- if (aNewValue.hasValue())
- aRet.reset( new ValueNode(rChange.getNodeName(), aNewValue, rChange.getAttributes()) );
-
- else // NULL
- {
- aRet.reset( new ValueNode(rChange.getNodeName(), rChange.getValueType(), rChange.getAttributes()) );
-
- OSL_ENSURE(aRet->isValid(), "Cannot recover type for change to NULL");
- }
- return aRet;
- }
-
- };
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- // TODO: operate directly on new data structures
-
- void OMergeValueChange::handle(AddNode& _rAddNode)
- {
- if (m_aValueChange.isToDefault())
- {
- std::auto_ptr<Change> aChangeToDefault(m_aValueChange.clone());
- m_rTargetParent.removeChange(_rAddNode.getNodeName());
- m_rTargetParent.addChange( aChangeToDefault );
- }
- else
- {
- // POST: Handle ValueChange in AddNode
- rtl::Reference< data::TreeSegment > seg(_rAddNode.getNewTree());
- std::auto_ptr<INode> pAddedNode = data::convertTree(seg.is() ? seg->fragment : 0, false);
-
- if (ValueNode *pValueNode = pAddedNode->asValueNode())
- {
- m_aValueChange.applyChangeNoRecover(*pValueNode);
- }
-
- else if (ISubtree* pValueSetNode = pAddedNode->asISubtree() )
- {
- if ( isLocalizedValueSet(*pValueSetNode) )
- {
- std::auto_ptr<ValueNode> pNewValueNode = createNodeFromChange(m_aValueChange);
- if (pNewValueNode.get())
- {
- OSL_ENSURE(pNewValueNode->isLocalized(), "OMergeValueChange:handle(AddNode): have a non-localized ValueChange a for a localized node!");
- pNewValueNode->setName(pAddedNode->getName());
- }
- else
- OSL_ENSURE(false, "OMergeValueChange:handle(SubtreeChange): Creating a NULL node to replace a localized value set not yet supported");
-
-
- pAddedNode.reset(pNewValueNode.release());
- }
- else
- {
- OSL_ENSURE(sal_False, "OMergeValueChange:handle(AddNode): have a ValueChange a for non-value node!");
- pAddedNode.reset(); // leave unchanged
- }
-
- }
- else
- {
- OSL_ENSURE(sal_False, "OMergeValueChange:handle(AddNode): Found unknown node type!");
- pAddedNode.reset(); // leave unchanged
- }
-
- if (pAddedNode.get() != NULL)
- {
- rtl::Reference< data::TreeSegment > aNewTree = data::TreeSegment::create(_rAddNode.getNodeName(),pAddedNode);
-
- std::auto_ptr<AddNode> pNewAdd( new AddNode(aNewTree,m_aValueChange.getNodeName(), m_aValueChange.isToDefault()) );
- if (_rAddNode.isReplacing())
- pNewAdd->setReplacing();
-
- std::auto_ptr<Change> pNewChange( pNewAdd.release() );
- replaceExistingEntry(pNewChange);
- }
- }
- }
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- // -----------------------------------------------------------------------------
- class OMergeRemoveNode : private ChangeTreeModification
- {
- public:
- // actions to take with the remove node change
- enum Action
- {
- RemoveCompletely,
- FlagDeleted,
- Undetermined
- };
-
- protected:
- Action m_eAction;
-
- public:
- OMergeRemoveNode() : m_eAction(Undetermined) { }
-
- Action getAction() const { return m_eAction; }
-
- void handleChange(Change* _pChange)
- {
- if (_pChange)
- applyToChange(*_pChange);
- else
- // no change -> flag as deleted
- m_eAction = FlagDeleted;
- }
-
- private:
- virtual void handle(ValueChange& aValueChange)
- {
- if (aValueChange.getAttributes().existsInDefault())
- m_eAction = FlagDeleted;
- else
- m_eAction = RemoveCompletely;
- }
-
- virtual void handle(RemoveNode& /*_rRemoveNode*/)
- {
- OSL_ENSURE(false, "OMergeRemoveNode::handle(RemoveNode): should never happen!");
- // how can a RemoveNode change exist if in the file we're merging it into
- // there already is such a RemoveNode change (_rRemoveNode)?
- }
-
- virtual void handle(AddNode& _rAddNode)
- {
- if (_rAddNode.isReplacing())
- m_eAction = FlagDeleted;
- else
- m_eAction = RemoveCompletely;
- }
-
- virtual void handle(SubtreeChange& _rSubtree)
- {
- if (_rSubtree.getAttributes().existsInDefault())
- m_eAction = FlagDeleted;
- else
- m_eAction = RemoveCompletely;
- }
- };
- // -----------------------------------------------------------------------------
- // -----------------------------------------------------------------------------
-
- static
- inline
- Change* findExistingChange(SubtreeChange* pCurrentParent, configuration::Path::Component const & _aName)
- {
- OSL_ASSERT(pCurrentParent);
-
- Change *pChange = pCurrentParent->getChange(_aName.getName());
-
- if (!pChange && !_aName.isSimpleName())
- {
- pChange = pCurrentParent->getChange(_aName.toPathString());
- OSL_ENSURE(!pChange, "Update trouble: Existing node found only by composite name while merging");
- }
-
- return pChange;
- }
-
- static
- inline
- Change* findExistingChange(SubtreeChange* pCurrentParent, rtl::OUString const & _aName)
- {
- OSL_ASSERT(pCurrentParent);
-
- Change *pChange = pCurrentParent->getChange(_aName);
-
- return pChange;
- }
- // -----------------------------------------------------------------------------
-
- void adjustElementTemplate(SubtreeChange& _rChange, const rtl::OUString& _rName, const rtl::OUString& _rModule)
- {
- if (!_rChange.isSetNodeChange() || isGenericSetElementType(_rChange.getElementTemplateName()))
- {
- _rChange.setElementTemplate(_rName,_rModule);
- }
- else if ( isDummySetElementModule(_rChange.getElementTemplateModule()) &&
- !isGenericSetElementType(_rName) && !isDummySetElementModule(_rModule))
- {
- OSL_ENSURE(_rChange.getElementTemplateName() == _rName, "Adjusting: Template modules do not match");
-
- _rChange.setElementTemplate(_rName,_rModule);
- }
- OSL_POSTCOND(_rChange.getElementTemplateName() == _rName || isGenericSetElementType(_rName),
- "Adjusting: Template modules do not match");
- OSL_POSTCOND(_rChange.getElementTemplateModule() == _rModule || isDummySetElementModule(_rModule),
- "Adjusting: Template modules do not match");
- }
- // -----------------------------------------------------------------------------
-
- inline void adjustElementTemplate(SubtreeChange& _rChange, SubtreeChange const& _rSource)
- {
- if (_rSource.isSetNodeChange())
- adjustElementTemplate(_rChange, _rSource.getElementTemplateName(), _rSource.getElementTemplateModule());
- }
-
- // -----------------------------------------------------------------------------
-
- // CTor
- OMergeChanges::OMergeChanges(SubtreeChange& _rTree)
- : m_rSubtreeChange(_rTree), m_pCurrentParent(NULL)
- {
- }
- // -----------------------------------------------------------------------------
-
- void OMergeChanges::initRoot(const SubtreeChange &_rRootChange, const configuration::RelativePath& _aPathToChange)
- {
- SubtreeChange* pCurrentParent = &m_rSubtreeChange;
-
- if (!_aPathToChange.isEmpty())
- {
- OSL_PRECOND(_aPathToChange.getLocalName().getName() == _rRootChange.getNodeName(),
- "Path to change root does not match change being merged" );
-
- std::vector<configuration::Path::Component>::const_reverse_iterator const firstEnsure = _aPathToChange.begin();
- std::vector<configuration::Path::Component>::const_reverse_iterator lastEnsure = _aPathToChange.end();
- std::vector<configuration::Path::Component>::const_reverse_iterator it;
-
- OSL_ASSERT( firstEnsure != lastEnsure );
- --lastEnsure; // last to ensure is the actual root
-
- for( it = firstEnsure; it != lastEnsure; ++it)
- {
- OSL_ASSERT( it != _aPathToChange.end() );
-
- Change *pChange = findExistingChange(pCurrentParent,*it);
-
- if (!pChange)
- {
- OSL_ASSERT( it+1 != _aPathToChange.end());
- rtl::OUString const aElementTypeName = (it+1)->getTypeName();
-
- // create a correspondens for the name, we did not find.
- std::auto_ptr<SubtreeChange> pNewChange =
- OTreeChangeFactory::createDummyChange(it->getName(), aElementTypeName);
-
- pChange = pNewChange.get();
-
- pCurrentParent->addChange(base_ptr(pNewChange));
-
- OSL_ENSURE(pChange == findExistingChange(pCurrentParent,*it),
- "ERROR: Newly added change cannot be found in parent change");
- }
-
- pCurrentParent = dynamic_cast<SubtreeChange*>( pChange);
- if (pCurrentParent == 0)
- {
- OSL_ENSURE(false, "Change to merge does not point to a Subtree Change");
- throw configuration::InvalidName(_aPathToChange.toString(), "points to a non- subtree change in this changes list, but a subtree change is required as root.");
- }
- }
-
- Change *pRootChange = findExistingChange(pCurrentParent,*lastEnsure);
-
- if (!pRootChange)
- {
- // create a correspondens for the name, we did not find.
- std::auto_ptr<SubtreeChange> pNewChange(
- new SubtreeChange(_rRootChange, treeop::NoChildCopy()) );
-
- pRootChange = pNewChange.get();
-
- pCurrentParent->addChange(base_ptr(pNewChange));
-
- OSL_ENSURE(pRootChange == findExistingChange(pCurrentParent,*it),
- "ERROR: Newly added change cannot be found in parent change");
- }
-
- pCurrentParent = dynamic_cast<SubtreeChange*>( pRootChange);
- if (pCurrentParent == 0)
- {
- OSL_ENSURE(false, "Change to merge does not point to a Subtree Change");
- throw configuration::InvalidName(_aPathToChange.toString(), "points to a non-subtree change in this changes list, but a subtree change is required as root.");
- }
- }
-
- OSL_ENSURE(pCurrentParent->getNodeName() == _rRootChange.getNodeName(),
- "Change being merged has a different name");
-
- adjustElementTemplate(*pCurrentParent,_rRootChange);
-
- this->init(_aPathToChange);
-
- m_pCurrentParent = pCurrentParent;
- }
- // -----------------------------------------------------------------------------
-
- // ------- Helper for Path stack -------
- SubtreeChange* OMergeChanges::pushTree(SubtreeChange& _rTree)
- {
- pushName( ONameCreator::createName(_rTree,m_pCurrentParent) );
-
- SubtreeChange* pSave = m_pCurrentParent;
- m_pCurrentParent = &_rTree;
- return pSave;
- }
- void OMergeChanges::popTree(SubtreeChange* _pSaveTree)
- {
- m_pCurrentParent = _pSaveTree;
-
- popName();
- }
- // -----------------------------------------------------------------------------
-
- // start function, with the Change we want to do.
- // WARNING this could be a big tree, because a change can contain subtreechanges!
- void OMergeChanges::mergeChanges(const SubtreeChange &_rChange)
- {
- mergeChanges(_rChange, configuration::RelativePath());
- }
- // -----------------------------------------------------------------------------
-
- // start function, with the Change we want to do.
- // WARNING this could be a big tree, because a change can contain subtreechanges!
- void OMergeChanges::mergeChanges(const SubtreeChange &_rChange, const configuration::RelativePath& _aPathToChange)
- {
- initRoot(_rChange, _aPathToChange); // path location being merged must exist
-
- this->applyToChildren(_rChange); //- semantics ?
- }
- // -----------------------------------------------------------------------------
-
- // Algorithm: search the actual path in the out m_aSubtreeChange
- // if we found something, we must merge/convert the Node with our Node
- // if we found nothing, we must create a new Node with our change
- // thats it.
-
- // the merge is contructed with helper classes because, it's possible that we
- // are a ValueChange but in the TreeChangeList this change is an AddNode, so
- // we have something to do.
-
- void OMergeChanges::handle(ValueChange const& _rValueNode)
- {
- // Handle a ValueChange,
- rtl::OUString aNodeName = _rValueNode.getNodeName();
-
- if (Change *pChange = findExistingChange(m_pCurrentParent,aNodeName))
- {
- // Value found, merge content
- OMergeValueChange aMergeValue(*m_pCurrentParent,_rValueNode);
- aMergeValue.handleChange(*pChange);
- }
- else
- {
- // there is no ValueChange in the List, insert new one
- std::auto_ptr<Change> pNewChange(new ValueChange(_rValueNode));
- m_pCurrentParent->addChange(pNewChange);
- }
- }
- // -----------------------------------------------------------------------------
-
- void OMergeChanges::handle(AddNode const& _rAddNode)
- {
- // Handle an AddNode
- bool bReplacing = _rAddNode.isReplacing();
-
- rtl::OUString aNodeName = _rAddNode.getNodeName();
-
- if (Change *pChange = findExistingChange(m_pCurrentParent,aNodeName))
- {
- OSL_ENSURE(dynamic_cast< RemoveNode * >(pChange) != 0 || bReplacing, "OMergeChanges::handle(AddNode): the changes tree given already contains a change for this!");
-
- m_pCurrentParent->removeChange(pChange->getNodeName());
-
- bReplacing = true;
- }
-
- // insert manually
- rtl::Reference< data::TreeSegment > aAddedTree = data::TreeSegment::create(_rAddNode.getNewTree());
-
- std::auto_ptr<AddNode> pNewAdd(new AddNode(aAddedTree, _rAddNode.getNodeName(), _rAddNode.isToDefault()));
- if (bReplacing)
- pNewAdd->setReplacing();
-
- std::auto_ptr<Change> pNewChange( pNewAdd.release() );
- m_pCurrentParent->addChange(pNewChange);
- }
- // -----------------------------------------------------------------------------
-
- void OMergeChanges::handle(RemoveNode const& _rRemoveNode)
- {
- // Handle a RemoveNode
- rtl::OUString aNodeName = _rRemoveNode.getNodeName();
-
- Change *pChange = findExistingChange(m_pCurrentParent,aNodeName);
-
- // examine what to do with this change
- OMergeRemoveNode aExaminer;
- aExaminer.handleChange(pChange);
-
- // remove the change from it's parent (may it's re-inserted in another form below)
- if (pChange)
- m_pCurrentParent->removeChange(pChange->getNodeName());
-
- // insert a new change if necessary
- switch (aExaminer.getAction())
- {
- case OMergeRemoveNode::RemoveCompletely:
- // nothing to do, we already removed it
- break;
- default:
- OSL_ENSURE(sal_False, "OMergeChanges::handle(RemoveNode): don't know what to do with this!");
- // NO BREAK.
- // defaulting this so that the node will be marked as deleted
- case OMergeRemoveNode::FlagDeleted:
- {
- std::auto_ptr<Change> pNewChange(new RemoveNode(_rRemoveNode.getNodeName(),_rRemoveNode.isToDefault()));
- m_pCurrentParent->addChange(pNewChange);
- }
- break;
- }
- }
-
-// -----------------------------------------------------------------------------
- inline
- void OStripDefaults::stripOne(Change& _rChange)
- {
- m_rParent.removeChange(_rChange.getNodeName());
- }
-
- void OStripDefaults::handle(ValueChange& _rValueNode)
- {
- if (_rValueNode.isToDefault())
- stripOne(_rValueNode);
- }
- void OStripDefaults::handle(AddNode& _rAddNode)
- {
- if (_rAddNode.isToDefault())
- {
- sharable::TreeFragment const * pAdded = _rAddNode.getNewTreeData();
- OSL_ENSURE(pAdded,"No Data in AddNode");
- if (pAdded == NULL || pAdded->getAttributes().isDefault())
- stripOne(_rAddNode);
-
- // else we should strip the defaults from the added node
- }
- }
- void OStripDefaults::handle(RemoveNode& _rRemoveNode)
- {
- if (_rRemoveNode.isToDefault())
- stripOne(_rRemoveNode);
- }
- void OStripDefaults::handle(SubtreeChange& _rSubtree)
- {
- if ( strip(_rSubtree) )
- if (_rSubtree.isToDefault() || !_rSubtree.isSetNodeChange())
- stripOne(_rSubtree);
- }
-
- OStripDefaults& OStripDefaults::strip()
- {
- SubtreeChange::MutatingChildIterator it = m_rParent.begin_changes(), stop = m_rParent.end_changes();
-
- while (it != stop)
- {
- this->applyToChange(*it++);
- }
-
- return *this;
- }
-
-
-// -----------------------------------------------------------------------------
- class TreeUpdater : public ChangeTreeAction
- {
- ISubtree* m_pCurrentSubtree;
-#if OSL_DEBUG_LEVEL > 1
- std::vector<rtl::OString> aLog;
-#endif
-
- public:
- TreeUpdater(ISubtree* pSubtree):m_pCurrentSubtree(pSubtree){}
-
- void handle(ValueChange const& aValueNode);
- void handle(AddNode const& aAddNode);
- void handle(RemoveNode const& aRemoveNode);
- void handle(SubtreeChange const& aSubtree);
- };
-
-// -----------------------------------------------------------------------------
-
-
- void OMergeChanges::handle(SubtreeChange const& _rSubtree)
- {
- // Handle a SubtreeChange
- // we must check if exact this SubtreeChange is in the TreeChangeList, if not,
- // we must add this SubtreeChange to the TreeChangeList
- // with the pointer m_pCurrentParent we remember our SubtreeChange in witch we
- // add all other Changes.
-
- rtl::OUString aNodeName = _rSubtree.getNodeName();
-
- Change *pChange = findExistingChange(m_pCurrentParent,aNodeName);
-
- // const sal_Char* pType = pChange ? pChange->getType() : NULL;
- SubtreeChange* pSubtreeChange = NULL;
- if (pChange == NULL || dynamic_cast< SubtreeChange * >(pChange) != 0)
- {
- // need to create a new Subtreechange
- if (!pChange)
- {
- // create a new SubtreeChange
- std::auto_ptr<SubtreeChange> pNewChange(new SubtreeChange(_rSubtree, treeop::NoChildCopy()));
- pSubtreeChange = pNewChange.get();
-
- // add the new SubtreeChange in m_aTreeChangeList
- m_pCurrentParent->addChange(std::auto_ptr<Change>(pNewChange.release()));
- // check list for this new SubtreeChange
- OSL_ASSERT(pSubtreeChange == findExistingChange(m_pCurrentParent,aNodeName));
- }
- else
- {
- pSubtreeChange = dynamic_cast<SubtreeChange*>(pChange);
- OSL_ASSERT(pSubtreeChange != 0);
- adjustElementTemplate(*pSubtreeChange,_rSubtree);
- }
-
- // save this SubtreeChange so we allways have the last Subtree
- SubtreeChange* pSaveParent = pushTree(*pSubtreeChange);
- this->applyToChildren(_rSubtree);
- popTree( pSaveParent );
- }
- else if (AddNode* pAddNode = dynamic_cast<AddNode*>(pChange))
- {
- rtl::Reference< data::TreeSegment > seg(pAddNode->getNewTree());
- std::auto_ptr<INode> pAddedNode = data::convertTree(seg.is() ? seg->fragment : 0, false);
- ISubtree* pSubtree = pAddedNode.get() ? pAddedNode->asISubtree() : 0;
- if (pSubtree)
- {
- pSubtree->markAsDefault( _rSubtree.isToDefault() );
-
- // Now apply _rSubtree to the subtree
- TreeUpdater aTreeUpdate(pSubtree);
- aTreeUpdate.applyToChildren(_rSubtree);
-
- // make a new subtree with the changed data
- rtl::Reference< data::TreeSegment > aNewTree = data::TreeSegment::create(pAddNode->getNodeName(), pAddedNode);
-
- std::auto_ptr<AddNode> pNewAdd( new AddNode(aNewTree, pAddNode->getNodeName(), pAddNode->isToDefault()) );
- if (pAddNode->isReplacing())
- pNewAdd->setReplacing();
-
- std::auto_ptr<Change> pNewChange( pNewAdd.release() );
-
- m_pCurrentParent->removeChange(pAddNode->getNodeName());
- m_pCurrentParent->addChange( pNewChange );
- }
- else
- {
- OSL_ENSURE(false, "OMergeChanges: Unexpected node type found in an AddNode.");
- /* wrong type of node found: böse ASSERTEN/WERFEN */;
- }
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- }
- else
- {
- OSL_ENSURE(false, "OMergeChanges: Unexpected change type found for a subtree.");
- /* wrong type of node found: böse ASSERTEN/WERFEN */;
- }
- }
-
- // --------------------------------- updateTree ---------------------------------
- void TreeUpdater::handle(ValueChange const& aValueNode)
- {
- // Change a Value
- OSL_ENSURE(m_pCurrentSubtree,"Cannot apply ValueChange without subtree");
-
- INode* pBaseNode = m_pCurrentSubtree ? m_pCurrentSubtree->getChild(aValueNode.getNodeName()) : 0;
- OSL_ENSURE(pBaseNode,"Cannot apply Change: No node to change");
-
- ValueNode* pValue = pBaseNode ? pBaseNode->asValueNode() : 0;
- OSL_ENSURE(pValue,"Cannot apply ValueChange: Node is not a value");
-
- if (pValue)
- aValueNode.applyChangeNoRecover(*pValue);
-#if OSL_DEBUG_LEVEL > 1
- else
- {
- ::rtl::OString aStr("TreeUpdater: Can't find value with name:=");
- aStr += rtl::OUStringToOString(aValueNode.getNodeName(),RTL_TEXTENCODING_ASCII_US);
- OSL_ENSURE(pValue, aStr.getStr());
- aLog.push_back(aStr);
- }
-#endif
- }
-
- void TreeUpdater::handle(AddNode const& aAddNode)
- {
- // Add a new Value
- if (m_pCurrentSubtree)
- {
- if (aAddNode.isReplacing())
- {
- std::auto_ptr<INode> aOldNode = m_pCurrentSubtree->removeChild(aAddNode.getNodeName());
-
-#if OSL_DEBUG_LEVEL > 1
- OSL_ENSURE(aOldNode.get(), "TreeUpdater:AddNode: can't recover node being replaced");
- if (aOldNode.get() == NULL)
- aLog.push_back(rtl::OString("TreeUpdater: can't recover node being replaced (for AddNode)"));
-#endif
- }
-
- rtl::Reference< data::TreeSegment > seg(aAddNode.getNewTree());
- std::auto_ptr<INode> pNode(data::convertTree(seg.is() ? seg->fragment : 0, true));
-
- m_pCurrentSubtree->addChild(pNode);
- }
-#if OSL_DEBUG_LEVEL > 1
- else
- aLog.push_back(rtl::OString("TreeUpdater: no CurrentSubtree for AddNode"));
-#endif
-
- }
-
- void TreeUpdater::handle(RemoveNode const& aRemoveNode)
- {
- // remove a Value
- if (m_pCurrentSubtree)
- {
- std::auto_ptr<INode> aOldNode = m_pCurrentSubtree->removeChild(aRemoveNode.getNodeName());
-
-#if OSL_DEBUG_LEVEL > 1
- if (NULL == aOldNode.get())
- {
- ::rtl::OString aStr("TreeUpdater: Can't remove child with name:=");
- aStr += rtl::OUStringToOString(aRemoveNode.getNodeName(),RTL_TEXTENCODING_ASCII_US);
- OSL_ENSURE(false, aStr.getStr());
- aLog.push_back(aStr);
- }
-#endif
- }
- }
-
- void TreeUpdater::handle(SubtreeChange const& _aSubtree)
- {
- // handle traversion
- ISubtree *pOldSubtree = m_pCurrentSubtree;
- rtl::OUString aNodeName = _aSubtree.getNodeName();
-
- INode* pChild = m_pCurrentSubtree->getChild(aNodeName);
- OSL_ENSURE(pChild, "TreeUpdater::handle : invalid subtree change ... no child for change !");
- m_pCurrentSubtree = pChild ? pChild->asISubtree() : NULL;
-
-#if OSL_DEBUG_LEVEL > 1
- if (!m_pCurrentSubtree)
- {
- ::rtl::OString aStr("TreeUpdater: there is no Subtree for name:=");
- aStr += rtl::OUStringToOString(_aSubtree.getNodeName(),RTL_TEXTENCODING_ASCII_US);
- OSL_ENSURE(false, aStr.getStr());
- aLog.push_back(aStr);
- }
-#endif
- // recurse
- if (m_pCurrentSubtree)
- {
- m_pCurrentSubtree->markAsDefault( _aSubtree.isToDefault() );
- _aSubtree.forEachChange(*this);
- }
-
- m_pCurrentSubtree = pOldSubtree;
- }
-
-} // namespace configmgr
diff --git a/configmgr/source/misc/oslstream.cxx b/configmgr/source/misc/oslstream.cxx
deleted file mode 100644
index cbe45c681b..0000000000
--- a/configmgr/source/misc/oslstream.cxx
+++ /dev/null
@@ -1,261 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include "oslstream.hxx"
-
-#include "filehelper.hxx"
-
-namespace configmgr
-{
- static void raiseIOException(osl::File::RC error, staruno::Reference<staruno::XInterface> const & context)
- {
- const rtl::OUString message = FileHelper::createOSLErrorString(error);
- switch (error)
- {
- case osl::File::E_NOMEM:
- throw stario::BufferSizeExceededException(message, context);
-
- case osl::File::E_BADF:
- throw stario::NotConnectedException(message, context);
-
- default:
- throw stario::IOException(message, context);
- }
- }
-//------------------------------------------------------------------
-OSLInputStreamWrapper::OSLInputStreamWrapper( osl::File& _rFile )
- :m_pFile(&_rFile)
- ,m_bFileOwner(sal_False)
-{
-}
-
-//------------------------------------------------------------------
-OSLInputStreamWrapper::OSLInputStreamWrapper( osl::File* pStream, sal_Bool bOwner )
- :m_pFile( pStream )
- ,m_bFileOwner( bOwner )
-{
-}
-
-//------------------------------------------------------------------
-OSLInputStreamWrapper::~OSLInputStreamWrapper()
-{
- if( m_bFileOwner )
- delete m_pFile;
-}
-
-//------------------------------------------------------------------------------
-sal_Int32 SAL_CALL OSLInputStreamWrapper::readBytes(staruno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead)
- throw( stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException )
-{
- if (!m_pFile)
- throw stario::NotConnectedException(::rtl::OUString(), static_cast<staruno::XWeak*>(this));
-
- if (nBytesToRead < 0)
- throw stario::BufferSizeExceededException(::rtl::OUString(),static_cast<staruno::XWeak*>(this));
-
- osl::MutexGuard aGuard( m_aMutex );
-
- aData.realloc(nBytesToRead);
-
- sal_uInt64 nRead = 0;
- osl::File::RC eError = m_pFile->read(aData.getArray(), nBytesToRead, nRead);
- if (eError != osl::File::E_None)
- throw stario::BufferSizeExceededException(::rtl::OUString(),static_cast<staruno::XWeak*>(this));
-
- // Wenn gelesene Zeichen < MaxLength, staruno::Sequence anpassen
- if (nRead < (sal_uInt64)nBytesToRead)
- aData.realloc( sal::static_int_cast<sal_Int32>( nRead ));
-
- return sal::static_int_cast<sal_Int32>( nRead );
-}
-
-//------------------------------------------------------------------------------
-sal_Int32 SAL_CALL OSLInputStreamWrapper::readSomeBytes(staruno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead) throw( stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException )
-{
- if (!m_pFile)
- throw stario::NotConnectedException(::rtl::OUString(), static_cast<staruno::XWeak*>(this));
-
- if (nMaxBytesToRead < 0)
- throw stario::BufferSizeExceededException(::rtl::OUString(),static_cast<staruno::XWeak*>(this));
-
- /*
- if (m_pFile->IsEof())
- {
- aData.realloc(0);
- return 0;
- }
- else
- */
- return readBytes(aData, nMaxBytesToRead);
-}
-
-//------------------------------------------------------------------------------
-void SAL_CALL OSLInputStreamWrapper::skipBytes(sal_Int32 nBytesToSkip) throw( stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException )
-{
- osl::MutexGuard aGuard( m_aMutex );
- if (!m_pFile)
- throw stario::NotConnectedException(::rtl::OUString(), static_cast<staruno::XWeak*>(this));
-
- sal_uInt64 nCurrentPos;
- m_pFile->getPos(nCurrentPos);
-
- sal_uInt64 nNewPos = nCurrentPos + nBytesToSkip;
- osl::File::RC eError = m_pFile->setPos(osl_Pos_Absolut, nNewPos);
- if (eError != osl::File::E_None)
- {
- throw stario::NotConnectedException(::rtl::OUString(), static_cast<staruno::XWeak*>(this));
- }
-}
-
-//------------------------------------------------------------------------------
-sal_Int32 SAL_CALL OSLInputStreamWrapper::available() throw( stario::NotConnectedException, staruno::RuntimeException )
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- if (!m_pFile)
- throw stario::NotConnectedException(::rtl::OUString(), static_cast<staruno::XWeak*>(this));
-
- sal_uInt64 nPos;
- osl::File::RC eError = m_pFile->getPos(nPos);
- if (eError != osl::File::E_None)
- throw stario::NotConnectedException(::rtl::OUString(), static_cast<staruno::XWeak*>(this));
-
- sal_uInt64 nDummy = 0;
- eError = m_pFile->setPos(Pos_End, nDummy);
- if (eError != osl::File::E_None)
- throw stario::NotConnectedException(::rtl::OUString(),static_cast<staruno::XWeak*>(this));
-
- sal_uInt64 nAvailable;
- eError = m_pFile->getPos(nAvailable);
- if (eError != osl::File::E_None)
- throw stario::NotConnectedException(::rtl::OUString(),static_cast<staruno::XWeak*>(this));
-
- nAvailable = nAvailable - nPos;
- eError = m_pFile->setPos(Pos_Absolut, nPos);
- if (eError != osl::File::E_None)
- throw stario::NotConnectedException(::rtl::OUString(),static_cast<staruno::XWeak*>(this));
- return sal::static_int_cast<sal_Int32>( nAvailable );
-}
-
-//------------------------------------------------------------------------------
-void SAL_CALL OSLInputStreamWrapper::closeInput() throw( stario::NotConnectedException, staruno::RuntimeException )
-{
- if (!m_pFile)
- throw stario::NotConnectedException(::rtl::OUString(), static_cast<staruno::XWeak*>(this));
-
- m_pFile->close();
- if (m_bFileOwner)
- delete m_pFile;
-
- m_pFile = NULL;
-}
-
-/*************************************************************************/
-// stario::XOutputStream
-//------------------------------------------------------------------------------
-void SAL_CALL OSLOutputStreamWrapper::writeBytes(const staruno::Sequence< sal_Int8 >& aData) throw( stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException )
-{
- sal_uInt32 const nLength = sal_uInt32(aData.getLength());
- if (nLength != 0)
- {
- sal_uInt64 nWritten;
- osl::File::RC eError = rFile.write(aData.getConstArray(),nLength, nWritten);
- if (eError != osl::File::E_None || nWritten != nLength)
- {
- throw stario::BufferSizeExceededException(::rtl::OUString(),static_cast<staruno::XWeak*>(this));
- }
- }
-}
-
-
-//------------------------------------------------------------------
-void SAL_CALL OSLOutputStreamWrapper::flush() throw( stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException )
-{
-}
-
-//------------------------------------------------------------------
-void SAL_CALL OSLOutputStreamWrapper::closeOutput() throw( stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException )
-{
- rFile.close();
-}
-
-//------------------------------------------------------------------
-//------------------------------------------------------------------
-BufferedFileOutputStream::BufferedFileOutputStream( rtl::OUString const & aFileURL, bool bCreate, sal_uInt32 nBufferSizeHint)
-: m_aFile( aFileURL, nBufferSizeHint )
-{
- sal_Int32 flags = bCreate ? OpenFlag_Write|OpenFlag_Create : OpenFlag_Write;
-
- osl::File::RC rc = m_aFile.open(flags);
- if (rc != osl::File::E_None)
- raiseIOException(rc,NULL);
-}
-
-//------------------------------------------------------------------
-BufferedFileOutputStream::~BufferedFileOutputStream()
-{
-}
-
-//------------------------------------------------------------------------------
-void SAL_CALL BufferedFileOutputStream::writeBytes(const staruno::Sequence< sal_Int8 >& aData)
- throw( stario::NotConnectedException, stario::BufferSizeExceededException,
- stario::IOException, staruno::RuntimeException )
-{
- const sal_uInt64 size = sal_uInt64(aData.getLength());
- sal_uInt64 written = 0;
-
- osl::File::RC rc = m_aFile.write(aData.getConstArray(), size, written);
- if (rc != osl::File::E_None)
- raiseIOException(rc,*this);
-
- // we don't support special files where multiple write passes are needed
- if (written < size)
- raiseIOException(osl::File::E_IO,*this);
-}
-
-void SAL_CALL BufferedFileOutputStream::flush()
- throw( stario::NotConnectedException, stario::BufferSizeExceededException,
- stario::IOException, staruno::RuntimeException )
-{
- osl::File::RC rc = m_aFile.sync();
- if (rc != osl::File::E_None)
- raiseIOException(rc,*this);
-}
-
-void SAL_CALL BufferedFileOutputStream::closeOutput()
- throw( stario::NotConnectedException, stario::BufferSizeExceededException,
- stario::IOException, staruno::RuntimeException )
-{
- osl::File::RC rc = m_aFile.close();
- if (rc != osl::File::E_None)
- raiseIOException(rc,*this);
-}
-
-} // namespace configmgr
-
-
diff --git a/configmgr/source/misc/propertysethelper.cxx b/configmgr/source/misc/propertysethelper.cxx
deleted file mode 100644
index 68064354b0..0000000000
--- a/configmgr/source/misc/propertysethelper.cxx
+++ /dev/null
@@ -1,131 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "propertysethelper.hxx"
-#include <com/sun/star/lang/XTypeProvider.hpp>
-
-#include <cppuhelper/typeprovider.hxx>
-
-//..........................................................................
-namespace configmgr {
- namespace apihelper {
-//..........................................................................
- namespace uno = com::sun::star::uno;
- namespace lang = com::sun::star::lang;
- namespace beans = com::sun::star::beans;
-//..........................................................................
-PropertySetHelper::PropertySetHelper()
-: BroadcasterBase()
-, cppu::OWeakObject()
-, cppu::OPropertySetHelper( BroadcasterBase::getBroadcastHelper() )
-, m_pHelper(0)
-{
-}
-
-//..........................................................................
-PropertySetHelper::~PropertySetHelper()
-{
- delete m_pHelper;
-}
-
-//..........................................................................
-// XInterface
-uno::Any SAL_CALL PropertySetHelper::queryInterface( uno::Type const & rType ) throw (uno::RuntimeException)
-{
- uno::Any aResult = cppu::OPropertySetHelper::queryInterface(rType);
- if (!aResult.hasValue())
- aResult = OWeakObject::queryInterface(rType);
- return aResult;
-}
-
-void SAL_CALL PropertySetHelper::acquire() throw ()
-{
- OWeakObject::acquire();
-}
-
-void SAL_CALL PropertySetHelper::release() throw ()
-{
- if (m_refCount == 1)
- this->disposing();
-
- OWeakObject::release();
-}
-
-//..........................................................................
-// XTypeProvider
-uno::Sequence< uno::Type > SAL_CALL PropertySetHelper::getTypes() throw (uno::RuntimeException)
-{
- // could be static instance
- cppu::OTypeCollection aTypes(
- ::getCppuType( static_cast< uno::Reference< beans::XPropertySet > const * >(0) ),
- ::getCppuType( static_cast< uno::Reference< beans::XMultiPropertySet > const * >(0) ),
- ::getCppuType( static_cast< uno::Reference< beans::XFastPropertySet > const * >(0) ),
- ::getCppuType( static_cast< uno::Reference< lang::XTypeProvider > const * >(0) ) );
-
- return aTypes.getTypes();
-}
-
-//..........................................................................
-// cppu::OPropertySetHelper
-uno::Reference< beans::XPropertySetInfo > SAL_CALL PropertySetHelper::getPropertySetInfo( )
- throw (uno::RuntimeException)
-{
- return createPropertySetInfo(getInfoHelper());
-}
-
-//..........................................................................
-cppu::IPropertyArrayHelper & SAL_CALL PropertySetHelper::getInfoHelper()
-{
- osl::MutexGuard aGuard( getBroadcastMutex() );
- if (!m_pHelper)
- m_pHelper = newInfoHelper();
-
- OSL_ENSURE(m_pHelper,"Derived class did not create new PropertyInfoHelper");
- if (!m_pHelper)
- throw uno::RuntimeException(rtl::OUString::createFromAscii("No PropertyArrayHelper available"),*this);
-
- return *m_pHelper;
-}
-
-//..........................................................................
-sal_Bool SAL_CALL PropertySetHelper::convertFastPropertyValue(
- uno::Any & rConvertedValue, uno::Any & rOldValue, sal_Int32 nHandle, const uno::Any& rValue )
- throw (lang::IllegalArgumentException)
-{
- this->getFastPropertyValue(rOldValue, nHandle);
- rConvertedValue = rValue;
- return rValue.isExtractableTo( rOldValue.getValueType() );
-}
-//..........................................................................
- } // namespace apihelper
-} // namespace configmgr
-//..........................................................................
-
-
diff --git a/configmgr/source/misc/providerfactory.cxx b/configmgr/source/misc/providerfactory.cxx
deleted file mode 100644
index 0faf2cabb6..0000000000
--- a/configmgr/source/misc/providerfactory.cxx
+++ /dev/null
@@ -1,241 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-
-#include "providerfactory.hxx"
-
-#ifndef CONFIGMGR_API_FACTORY_HXX_
-#include "confapifactory.hxx"
-#endif
-#include "bootstrap.hxx"
-#include "providerwrapper.hxx"
-#include <com/sun/star/lang/IllegalArgumentException.hpp>
-#include <com/sun/star/configuration/CannotLoadConfigurationException.hpp>
-#include <cppuhelper/exc_hlp.hxx>
-#include <rtl/ustrbuf.hxx>
-#include <osl/diagnose.h>
-#include <rtl/logfile.hxx>
-
-//---------------------------------------------------------------------------------------
-namespace configmgr
-{
- //---------------------------------------------------------------------------------------
- //= OProviderFactory
- //---------------------------------------------------------------------------------------
-
- //---------------------------------------------------------------------------------------
-
- ProviderFactory::ProviderFactory(rtl::OUString const & aImplementationName, bool bAdmin)
- : m_aImplementationName(aImplementationName)
- , m_bAdmin(bAdmin)
- {
- }
- //---------------------------------------------------------------------------------------
-
- ProviderFactory::~ProviderFactory()
- {
- }
- //---------------------------------------------------------------------------------------
-
- uno::Reference< uno::XInterface > ProviderFactory::getProviderAlways(uno::Reference< uno::XComponentContext > const & xContext)
- {
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::ProviderFactory", "jb99855", "configmgr::ProviderFactory::getProviderAlways()");
- uno::Reference< uno::XInterface > xResult = getDefaultConfigProviderSingleton(xContext);
-
- // check for success
- OSL_ENSURE(xResult.is(), "Context could not create provider, but returned NULL instead of throwing an exception");
- if (!xResult.is())
- {
- static sal_Char const sCannotCreate[] = "Cannot create ConfigurationProvider. Unknown backend or factory error.";
-
- throw com::sun::star::configuration::CannotLoadConfigurationException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sCannotCreate)), *this );
- }
-
- return xResult;
- }
- //---------------------------------------------------------------------------------------
- uno::Reference< uno::XInterface > ProviderFactory::getProviderFromContext(uno::Reference< uno::XComponentContext > const & xContext)
- {
- OSL_ENSURE(ContextReader::testAdminService(xContext, this->m_bAdmin),
- "Creation context admin flag does not match service being created");
-
- try
- {
- return getProviderAlways(xContext);
- }
- catch(uno::Exception& e)
- {
- ContextReader aContext(xContext);
-
- uno::Any aError = aContext.getBootstrapError();
- if (aError.hasValue())
- {
- OSL_ASSERT(aError.getValueTypeClass() == uno::TypeClass_EXCEPTION);
- cppu::throwException(aError);
- }
-
- OSL_ASSERT(aContext.isBootstrapValid());
-
- static const sal_Char sErrContext[] = "Cannot open Configuration: ";
- rtl::OUString const sContext(RTL_CONSTASCII_USTRINGPARAM(sErrContext));
- e.Message = sContext.concat(e.Message);
- throw;
- }
- }
- //---------------------------------------------------------------------------------------
- uno::Reference< uno::XInterface > ProviderFactory::createProviderWithArguments(uno::Reference< uno::XComponentContext > const & xContext, uno::Sequence < uno::Any > const & _aArguments)
- {
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::ProviderFactory", "jb99855", "configmgr::ProviderFactory::createProviderWithArguments()");
-
- ContextReader aContext(xContext);
- ArgumentHelper aParser(aContext.getBootstrapContext());
-
- uno::Sequence < beans::NamedValue > aValues(_aArguments.getLength() + 2);
- sal_Int32 nCount = parseArguments(aParser,aValues,_aArguments);
-
- bool bNeedNewBackend = aParser.hasBackendArguments();
-
- if (!aContext.testAdminService(aContext.getBaseContext(),m_bAdmin))
- {
- bNeedNewBackend = true;
- OSL_ASSERT( nCount+2 <= aValues.getLength());
- aValues[nCount++] = ArgumentHelper::makeAdminServiceOverride(m_bAdmin);
- aValues[nCount++] = BootstrapContext::makePassthroughMarker(sal_False);
- }
-
- OSL_ASSERT(nCount <= aValues.getLength());
- aValues.realloc(nCount);
-
- if (bNeedNewBackend)
- {
- uno::Reference< uno::XComponentContext > xMergedContext = BootstrapContext::createWrapper(xContext,aValues);
- uno::Reference< uno::XInterface > xResult = getProviderFromContext(xMergedContext);
-
- return xResult;
- }
- else
- {
- uno::Reference< uno::XInterface > xBaseProvider = getProviderFromContext(xContext);
- uno::Reference< uno::XInterface > xResult = ProviderWrapper::create(xBaseProvider,aValues);
-
- return xResult;
- }
- }
- //---------------------------------------------------------------------------------------
- uno::Reference< uno::XInterface > ProviderFactory::createProvider(uno::Reference< uno::XComponentContext > const & xContext, bool bAdmin)
- {
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::ProviderFactory", "jb99855", "configmgr::ProviderFactory::createProvider(bAdmin)");
-
- uno::Sequence < beans::NamedValue > aValues(2);
- aValues[0] = ArgumentHelper::makeAdminServiceOverride(bAdmin);
- aValues[1] = BootstrapContext::makePassthroughMarker(sal_False);
-
- uno::Reference< uno::XComponentContext > xMergedContext = BootstrapContext::createWrapper(xContext,aValues);
- uno::Reference< uno::XInterface > xResult = getProviderFromContext(xMergedContext);
-
- return xResult;
- }
- //---------------------------------------------------------------------------------------
- uno::Reference< uno::XInterface > ProviderFactory::createProvider(uno::Reference< uno::XComponentContext > const & xContext)
- {
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::ProviderFactory", "jb99855", "configmgr::ProviderFactory::createProvider()");
-
- if (BootstrapContext::isPassthrough(xContext))
- {
- // make sure this uses a new BootstrapContext !
- uno::Reference< uno::XComponentContext > xPatchedContext = BootstrapContext::createWrapper(xContext,uno::Sequence < beans::NamedValue >());
- return getProviderFromContext(xPatchedContext);
- }
- else
- return getProviderFromContext(xContext);
- }
- //---------------------------------------------------------------------------------------
-
- sal_Int32 ProviderFactory::parseArguments(ArgumentHelper & aParser, uno::Sequence < beans::NamedValue > & rValues, uno::Sequence < uno::Any > const & _aArguments)
- {
- OSL_ASSERT(rValues.getLength() >= _aArguments.getLength());
-
- sal_Int32 nCount = 0;
- for (sal_Int32 i = 0; i < _aArguments.getLength(); ++i)
- {
- if (!aParser.extractArgument(rValues[nCount],_aArguments[i]))
- {
- rtl::OUStringBuffer sMsg;
- sMsg.appendAscii("ProviderFactory: Unexpected Argument Type. ");
- sMsg.appendAscii("Expected NamedValue or PropertyValue, ");
- sMsg.appendAscii("found ").append(_aArguments[i].getValueTypeName()).appendAscii(". ");
- throw lang::IllegalArgumentException(sMsg.makeStringAndClear(),*this,static_cast<sal_Int16>(i));
- }
-
- if (aParser.filterAndAdjustArgument(rValues[nCount]))
- {
- aParser.checkBackendArgument(rValues[nCount]);
- ++nCount;
- }
- }
- return nCount;
- }
- //---------------------------------------------------------------------------------------
-
- uno::Reference< uno::XInterface >
- SAL_CALL ProviderFactory::createInstanceWithContext( const uno::Reference< uno::XComponentContext >& xContext )
- throw (uno::Exception, ::com::sun::star::uno::RuntimeException)
- {
- // default provider ?
- if (ContextReader::testAdminService(xContext,m_bAdmin))
- return createProvider( xContext );
-
- else
- return createProvider(xContext,m_bAdmin);
- }
- //---------------------------------------------------------------------------------------
-
- uno::Reference< uno::XInterface > SAL_CALL
- ProviderFactory::createInstanceWithArgumentsAndContext( const uno::Sequence< uno::Any >& aArguments, const uno::Reference< uno::XComponentContext >& xContext )
- throw (uno::Exception, uno::RuntimeException)
- {
- // default request
- return createProviderWithArguments(xContext, aArguments);
- }
-
- //---------------------------------------------------------------------------------------
- //---------------------------------------------------------------------------------------
-
- uno::Reference< lang::XSingleComponentFactory > SAL_CALL createProviderFactory(
- rtl::OUString const & aImplementationName,
- bool bAdmin
- )
- {
- return new ProviderFactory(aImplementationName, bAdmin);
- }
- //---------------------------------------------------------------------------------------
-} // namespace configmgr
-//........................................................................
-
diff --git a/configmgr/source/misc/providerfactory.hxx b/configmgr/source/misc/providerfactory.hxx
deleted file mode 100644
index 10c5442951..0000000000
--- a/configmgr/source/misc/providerfactory.hxx
+++ /dev/null
@@ -1,88 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONFIGMGR_PROVIDER_FACTORY_HXX_
-#define _CONFIGMGR_PROVIDER_FACTORY_HXX_
-
-#include <cppuhelper/implbase1.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XSingleComponentFactory.hpp>
-#include <com/sun/star/lang/XEventListener.hpp>
-#include <com/sun/star/beans/NamedValue.hpp>
-/*
-#include <com/sun/star/lang/IllegalArgumentException.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <comphelper/stl_types.hxx>
-*/
-//------------------------------------------------------------------------
-namespace configmgr
-{
- //------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace beans = ::com::sun::star::beans;
- //------------------------------------------------------------------------
- class ContextReader;
- class ArgumentHelper;
- //------------------------------------------------------------------------
- //= OProviderFactory
- //------------------------------------------------------------------------
- /** a special factory for the configuration provider,
- which maps creation arguments into a context.
- */
- class ProviderFactory : public cppu::WeakImplHelper1< lang::XSingleComponentFactory >
- {
- rtl::OUString const m_aImplementationName;
- bool m_bAdmin;
-
- public:
- explicit
- ProviderFactory(rtl::OUString const & aImplementationName, bool bAdmin);
- ~ProviderFactory();
-
- virtual uno::Reference< uno::XInterface >
- SAL_CALL createInstanceWithContext(uno::Reference< uno::XComponentContext > const & xContext )
- throw (uno::Exception, uno::RuntimeException);
-
- virtual uno::Reference< uno::XInterface > SAL_CALL
- createInstanceWithArgumentsAndContext( uno::Sequence < uno::Any > const & aArguments, uno::Reference< uno::XComponentContext > const & xContext )
- throw (uno::Exception, uno::RuntimeException);
-
- private:
- uno::Reference< uno::XInterface > getProviderFromContext(uno::Reference< uno::XComponentContext > const & aContext);
- uno::Reference< uno::XInterface > getProviderAlways(uno::Reference< uno::XComponentContext > const & xContext);
- uno::Reference< uno::XInterface > createProviderWithArguments(uno::Reference< uno::XComponentContext > const & xContext, uno::Sequence < uno::Any > const & _aArguments);
- uno::Reference< uno::XInterface > createProvider(uno::Reference< uno::XComponentContext > const & xContext,bool bAdmin);
- uno::Reference< uno::XInterface > createProvider(uno::Reference< uno::XComponentContext > const & xContext);
- sal_Int32 parseArguments(ArgumentHelper & aParser, uno::Sequence < beans::NamedValue > & rValues, uno::Sequence < uno::Any > const & _aArguments);
- };
-//------------------------------------------------------------------------
-} // namespace configmgr
-//------------------------------------------------------------------------
-
-#endif // _CONFIGMGR_PROVIDER_FACTORY_HXX_
-
diff --git a/configmgr/source/misc/providerwrapper.cxx b/configmgr/source/misc/providerwrapper.cxx
deleted file mode 100644
index 836ff3ac30..0000000000
--- a/configmgr/source/misc/providerwrapper.cxx
+++ /dev/null
@@ -1,193 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "providerwrapper.hxx"
-#include "bootstrap.hxx"
-#include "bootstrapcontext.hxx"
-
-
-#include <com/sun/star/lang/NullPointerException.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
-
-#include <algorithm>
-
-
-namespace configmgr
-{
- //==========================================================================
- namespace uno = com::sun::star::uno;
- namespace lang = com::sun::star::lang;
- //==========================================================================
- //= ProviderWrapper
- //==========================================================================
-
- uno::Reference< uno::XInterface > ProviderWrapper::create( uno::Reference< uno::XInterface > xDelegate, uno::Sequence< com::sun::star::beans::NamedValue > const & aPresets)
- {
- uno::Reference< lang::XMultiServiceFactory > xProvDelegate(xDelegate, uno::UNO_QUERY);
- if (!xProvDelegate.is())
- {
- rtl::OUString sMsg(RTL_CONSTASCII_USTRINGPARAM("ProviderWrapper: Cannot wrap a NULL provider"));
- throw lang::NullPointerException(sMsg,NULL);
- }
- //Strip prefixes
- uno::Sequence< com::sun::star::beans::NamedValue > aStrippedPresets = aPresets;
-
- for (sal_Int32 i = 0; i < aPresets.getLength(); ++i)
- {
- if(aPresets[i].Name.matchAsciiL(RTL_CONSTASCII_STRINGPARAM(CONTEXT_ITEM_PREFIX_ )))
- {
- aStrippedPresets[i].Name = aPresets[i].Name.copy(RTL_CONSTASCII_LENGTH(CONTEXT_ITEM_PREFIX_ ));
- }
- }
-
- uno::Reference< lang::XMultiServiceFactory > xResult( new ProviderWrapper(xProvDelegate,aStrippedPresets) );
-
- DisposingForwarder::forward( uno::Reference< lang::XComponent >::query(xProvDelegate),uno::Reference< lang::XComponent >::query(xResult) );
- return uno::Reference< uno::XInterface >( xResult, uno::UNO_QUERY );
- }
-
-
- ProviderWrapper::ProviderWrapper(uno::Reference< lang::XMultiServiceFactory > const & xDelegate, uno::Sequence< com::sun::star::beans::NamedValue > const & aPresets)
- : cppu::WeakComponentImplHelper2< lang::XMultiServiceFactory, lang::XServiceInfo >( PWMutexHolder::mutex )
- , m_xDelegate(xDelegate)
- , m_aDefaults(aPresets.getLength())
- {
- OSL_ASSERT(m_xDelegate.is());
-
- for (sal_Int32 i = 0; i<aPresets.getLength(); ++i)
- {
- m_aDefaults[i] <<= aPresets[i];
- }
- }
-
- ProviderWrapper::~ProviderWrapper() {}
-
- void SAL_CALL ProviderWrapper::disposing()
- {
- osl::MutexGuard lock(mutex);
- m_xDelegate.clear();
- }
-
- uno::Reference< lang::XMultiServiceFactory > ProviderWrapper::getDelegate()
- {
- osl::MutexGuard lock(mutex);
- if (!m_xDelegate.is())
- {
- rtl::OUString sMsg(RTL_CONSTASCII_USTRINGPARAM("ProviderWrapper: Delegate Provider has been disposed"));
- throw lang::DisposedException(sMsg,*this);
- }
- return m_xDelegate;
- }
-
-
- uno::Reference<lang::XServiceInfo> ProviderWrapper::getDelegateInfo()
- {
- uno::Reference<lang::XServiceInfo> xDelegate( this->getDelegate(), uno::UNO_QUERY );
- if (!xDelegate.is())
- {
- rtl::OUString sMsg(RTL_CONSTASCII_USTRINGPARAM("ProviderWrapper: Delegate Provider has no service info"));
- throw uno::RuntimeException(sMsg,*this);
- }
- return xDelegate;
- }
-
- /// XMultiServiceFactory
- static inline uno::Any const * begin(uno::Sequence< uno::Any > const & aArgs)
- { return aArgs.getConstArray(); }
- static inline uno::Any const * end(uno::Sequence< uno::Any > const & aArgs)
- { return aArgs.getConstArray() + aArgs.getLength(); }
- static inline uno::Any * begin(uno::Sequence< uno::Any > & aArgs)
- { return aArgs.getArray(); }
- static inline uno::Any * end(uno::Sequence< uno::Any > & aArgs)
- { return aArgs.getArray() + aArgs.getLength(); }
-
- uno::Sequence< uno::Any > ProviderWrapper::patchArguments(uno::Sequence< uno::Any > const & aArgs) const
- {
- // rely on evaluation order front to back
- if (m_aDefaults.getLength() == 0) return aArgs;
-
- uno::Sequence< uno::Any > aResult(m_aDefaults.getLength() + aArgs.getLength());
-
- uno::Any * pNext = std::copy(begin(m_aDefaults),end(m_aDefaults),begin(aResult));
- pNext = std::copy(begin(aArgs),end(aArgs),pNext);
-
- OSL_ASSERT(end(aResult) == pNext);
-
- return aResult;
- }
-
- uno::Reference< uno::XInterface > SAL_CALL
- ProviderWrapper::createInstance( const rtl::OUString& aServiceSpecifier )
- throw(uno::Exception, uno::RuntimeException)
- {
- return getDelegate()->createInstanceWithArguments(aServiceSpecifier,m_aDefaults);
- }
-
- uno::Reference< uno::XInterface > SAL_CALL
- ProviderWrapper::createInstanceWithArguments( const ::rtl::OUString& ServiceSpecifier, const uno::Sequence< uno::Any >& rArguments )
- throw(uno::Exception, uno::RuntimeException)
- {
- return getDelegate()->createInstanceWithArguments(ServiceSpecifier,patchArguments(rArguments));
- }
-
- uno::Sequence< rtl::OUString > SAL_CALL
- ProviderWrapper::getAvailableServiceNames( )
- throw(uno::RuntimeException)
- {
- return getDelegate()->getAvailableServiceNames( );
- }
-
- /// XServiceInfo
- rtl::OUString SAL_CALL
- ProviderWrapper::getImplementationName( )
- throw(uno::RuntimeException)
- {
- return rtl::OUString::createFromAscii("com.sun.star.comp.configuration.ConfigurationProviderWrapper");
- }
-
- sal_Bool SAL_CALL
- ProviderWrapper::supportsService( const ::rtl::OUString& ServiceName )
- throw(uno::RuntimeException)
- {
- return getDelegateInfo()->supportsService( ServiceName );
- }
-
- uno::Sequence< rtl::OUString > SAL_CALL
- ProviderWrapper::getSupportedServiceNames( )
- throw(uno::RuntimeException)
- {
- return getDelegateInfo()->getSupportedServiceNames( );
- }
-
-
-} // namespace configmgr
-
-
-
diff --git a/configmgr/source/misc/providerwrapper.hxx b/configmgr/source/misc/providerwrapper.hxx
deleted file mode 100644
index f5776722d2..0000000000
--- a/configmgr/source/misc/providerwrapper.hxx
+++ /dev/null
@@ -1,98 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONFIGMGR_API_PROVIDERWRAPPER_HXX_
-#define CONFIGMGR_API_PROVIDERWRAPPER_HXX_
-
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/beans/NamedValue.hpp>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <cppuhelper/compbase2.hxx>
-#include <osl/mutex.hxx>
-
-namespace configmgr
-{
- //==========================================================================
- namespace uno = com::sun::star::uno;
- namespace lang = com::sun::star::lang;
- //==========================================================================
- //= ProviderWrapper
- //==========================================================================
- struct PWMutexHolder { osl::Mutex mutex; }; // ad hoc ...
-
- class ProviderWrapper : private PWMutexHolder, public cppu::WeakComponentImplHelper2< lang::XMultiServiceFactory, lang::XServiceInfo >
- {
- private:
- uno::Reference< lang::XMultiServiceFactory > m_xDelegate;
- uno::Sequence< uno::Any > m_aDefaults;
- private:
- ProviderWrapper(uno::Reference< lang::XMultiServiceFactory > const & xDelegate, uno::Sequence< com::sun::star::beans::NamedValue > const & aPresets);
-
- public:
- static uno::Reference< uno::XInterface > create( uno::Reference< uno::XInterface > xDelegate, uno::Sequence< com::sun::star::beans::NamedValue > const & aPresets);
- ~ProviderWrapper();
-
- /// XMultiServiceFactory
- virtual uno::Reference< uno::XInterface > SAL_CALL
- createInstance( const rtl::OUString& aServiceSpecifier )
- throw(uno::Exception, uno::RuntimeException);
-
- virtual uno::Reference< uno::XInterface > SAL_CALL
- createInstanceWithArguments( const ::rtl::OUString& ServiceSpecifier, const uno::Sequence< uno::Any >& Arguments )
- throw(uno::Exception, uno::RuntimeException);
-
- virtual uno::Sequence< rtl::OUString > SAL_CALL
- getAvailableServiceNames( )
- throw(uno::RuntimeException);
-
- /// XServiceInfo
- virtual rtl::OUString SAL_CALL
- getImplementationName( )
- throw(uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- supportsService( const ::rtl::OUString& ServiceName )
- throw(uno::RuntimeException);
-
- virtual uno::Sequence< rtl::OUString > SAL_CALL
- getSupportedServiceNames( )
- throw(uno::RuntimeException);
-
- protected:
- virtual void SAL_CALL disposing();
- private:
- uno::Reference< lang::XMultiServiceFactory > getDelegate();
- uno::Reference<lang::XServiceInfo> getDelegateInfo();
- uno::Sequence< uno::Any > patchArguments(uno::Sequence< uno::Any > const & aArgs) const;
- };
-
-
-} // namespace configmgr
-
-#endif // CONFIGMGR_API_CONFPROVIDER2_HXX_
-
-
diff --git a/configmgr/source/misc/requestoptions.cxx b/configmgr/source/misc/requestoptions.cxx
deleted file mode 100644
index 140876ef6b..0000000000
--- a/configmgr/source/misc/requestoptions.cxx
+++ /dev/null
@@ -1,104 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "requestoptions.hxx"
-#include "matchlocale.hxx"
-#include "tracer.hxx"
-#include <osl/diagnose.h>
-
-namespace configmgr
-{
-// ---------------------------------------------------------------------------
-
- rtl::OUString RequestOptions::getIsoLocale() const
- {
- return localehelper::makeIsoLocale( m_sLocale );
- }
-// ---------------------------------------------------------------------------
-
- bool RequestOptions::isForAllLocales() const
- {
- return localehelper::designatesAllLocales( m_sLocale );
- }
-// ---------------------------------------------------------------------------
-
- void RequestOptions::setIsoLocale(rtl::OUString const & _sLocale)
- {
- setLocale( localehelper::makeLocale( _sLocale ) );
- }
-// ---------------------------------------------------------------------------
-
- void RequestOptions::setAllLocales()
- {
- m_sLocale = localehelper::getAnyLocale();
- }
-// ---------------------------------------------------------------------------
-
- void RequestOptions::ensureLocaleSet()
- {
- if (!hasLocale())
- m_sLocale = localehelper::getDefaultLocale();
- }
-// ---------------------------------------------------------------------------
-
- static inline
- sal_Int32 hashRequestLocale(com::sun::star::lang::Locale const & aLocale)
- {
- return aLocale.Language.hashCode() ^ aLocale.Country.hashCode();
- }
-// ---------------------------------------------------------------------------
-
- static inline
- sal_Int32 compareRequestLocale(com::sun::star::lang::Locale const& lhs, com::sun::star::lang::Locale const& rhs)
- {
- sal_Int32 nDiff = lhs.Language.compareTo(rhs.Language);
- if (nDiff == 0)
- {
- nDiff = lhs.Country.compareTo(rhs.Country);
- }
-
- return nDiff;
- }
-// ---------------------------------------------------------------------------
-
- sal_Int32 compareRequestOptions(RequestOptions const& lhs, RequestOptions const& rhs)
- {
- sal_Int32 nDiff = lhs.getEntity().compareTo(rhs.getEntity());
- if (nDiff == 0)
- {
- nDiff = compareRequestLocale(lhs.getUnoLocale(),rhs.getUnoLocale());
- }
-
- return nDiff;
- }
-// ---------------------------------------------------------------------------
-} // namespace config
-
-
diff --git a/configmgr/source/misc/serviceinfohelper.cxx b/configmgr/source/misc/serviceinfohelper.cxx
deleted file mode 100644
index 5c4d14fb67..0000000000
--- a/configmgr/source/misc/serviceinfohelper.cxx
+++ /dev/null
@@ -1,189 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "serviceinfohelper.hxx"
-
-namespace configmgr
-{
-// ---------------------------------------------------------------------------
-
- sal_Int32 ServiceInfoHelper::countServices( ) const
- {
- if (m_info == 0)
- return 0;
-
- sal_Int32 nCount = 0;
- if (sal_Char const * const* p= m_info->registeredServiceNames)
- {
- while (*p != 0)
- {
- ++nCount;
- ++p;
- }
- }
- if (sal_Char const * const* p= m_info->additionalServiceNames)
- {
- while (*p != 0)
- {
- ++nCount;
- ++p;
- }
- }
-
- return nCount;
- }
-// ---------------------------------------------------------------------------
-
- rtl::OUString ServiceInfoHelper::getImplementationName( ) const
- throw(uno::RuntimeException)
- {
- sal_Char const * p= m_info ? m_info->implementationName : 0;
-
- return p ? rtl::OUString::createFromAscii(p) : rtl::OUString();
- }
-// ---------------------------------------------------------------------------
-
- sal_Bool ServiceInfoHelper::supportsService( rtl::OUString const & ServiceName ) const
- throw(uno::RuntimeException)
- {
- if (m_info == 0)
- return false;
-
- if (sal_Char const * const* p= m_info->registeredServiceNames)
- {
- while (*p != 0)
- {
- if (ServiceName.equalsAscii(*p))
- return true;
- ++p;
- }
- }
- if (sal_Char const * const* p= m_info->additionalServiceNames)
- {
- while (*p != 0)
- {
- if (ServiceName.equalsAscii(*p))
- return true;
- ++p;
- }
- }
-
- return false;
- }
-// ---------------------------------------------------------------------------
-
- uno::Sequence< rtl::OUString > ServiceInfoHelper::getSupportedServiceNames( ) const
- throw(uno::RuntimeException)
- {
- sal_Int32 const nCount = countServices();
-
- uno::Sequence< rtl::OUString > aServices( nCount );
-
- if (nCount)
- {
- OSL_ASSERT(m_info);
- sal_Int32 i = 0;
- if (sal_Char const * const* p= m_info->registeredServiceNames)
- {
- while (*p != 0)
- {
- aServices[i++] = rtl::OUString::createFromAscii(*p++);
- }
- }
- if (sal_Char const * const* p= m_info->additionalServiceNames)
- {
- while (*p != 0)
- {
- aServices[i++] = rtl::OUString::createFromAscii(*p++);
- }
- }
- OSL_ASSERT( i == nCount );
- }
-
- return aServices;
- }
-// ---------------------------------------------------------------------------
-// ---------------------------------------------------------------------------
-
- sal_Int32 ServiceRegistrationHelper::countServices( ) const
- {
- if (m_info == 0)
- return 0;
-
- sal_Int32 nCount = 0;
- if (sal_Char const * const* p= m_info->registeredServiceNames)
- {
- while (*p != 0)
- {
- ++nCount;
- ++p;
- }
- }
-
- return nCount;
- }
-// ---------------------------------------------------------------------------
-
- rtl::OUString ServiceRegistrationHelper::getImplementationName( ) const
- throw(uno::RuntimeException)
- {
- sal_Char const * p= m_info ? m_info->implementationName : 0;
-
- return p ? rtl::OUString::createFromAscii(p) : rtl::OUString();
- }
-// ---------------------------------------------------------------------------
-
- uno::Sequence< rtl::OUString > ServiceRegistrationHelper::getRegisteredServiceNames( ) const
- throw(uno::RuntimeException)
- {
- sal_Int32 const nCount = countServices();
-
- uno::Sequence< rtl::OUString > aServices( nCount );
-
- if (nCount)
- {
- OSL_ASSERT(m_info);
- sal_Int32 i = 0;
- if (sal_Char const * const* p= m_info->registeredServiceNames)
- {
- while (*p != 0)
- {
- aServices[i++] = rtl::OUString::createFromAscii(*p++);
- }
- }
- OSL_ASSERT( i == nCount );
- }
-
- return aServices;
- }
-// ---------------------------------------------------------------------------
-} // namespace config
-
-
diff --git a/configmgr/source/misc/simpleinteractionrequest.cxx b/configmgr/source/misc/simpleinteractionrequest.cxx
deleted file mode 100644
index dd2ee6c5cf..0000000000
--- a/configmgr/source/misc/simpleinteractionrequest.cxx
+++ /dev/null
@@ -1,97 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "simpleinteractionrequest.hxx"
-
-namespace configmgr { namespace apihelper {
-
-namespace uno = com::sun::star::uno;
-namespace task = com::sun::star::task;
-//=========================================================================
-SimpleInteractionRequest::SimpleInteractionRequest(
- const uno::Any & rRequest,
- const sal_uInt32 nContinuations )
-: InteractionRequest( rRequest )
-{
- // Set continuations.
- OSL_ENSURE( nContinuations != CONTINUATION_UNKNOWN,
- "SimpleInteractionRequest - No continuation!" );
-
- sal_Int32 nLength = 0;
-
- const sal_uInt32 k_NumContinuationTypes = 4;
- uno::Reference< task::XInteractionContinuation > xContinuations[ k_NumContinuationTypes ];
-
- if ( nContinuations & CONTINUATION_ABORT )
- xContinuations[nLength++] = new InteractionContinuation< task::XInteractionAbort >( this );
-
- if ( nContinuations & CONTINUATION_RETRY )
- xContinuations[nLength++] = new InteractionContinuation< task::XInteractionRetry >( this );
-
- if ( nContinuations & CONTINUATION_APPROVE )
- xContinuations[nLength++] = new InteractionContinuation< task::XInteractionApprove >( this );
-
- if ( nContinuations & CONTINUATION_DISAPPROVE )
- xContinuations[nLength++] = new InteractionContinuation< task::XInteractionDisapprove >( this );
-
- OSL_ENSURE( nLength > 0,
- "SimpleInteractionRequest - No continuation!" );
-
- uno::Sequence< uno::Reference< task::XInteractionContinuation > >
- aContinuations( xContinuations, nLength );
-
- this->setContinuations( aContinuations );
-}
-
-//=========================================================================
-sal_uInt32 SimpleInteractionRequest::getResponse() const
-{
- uno::Reference< task::XInteractionContinuation > xSelection = this->getSelection();
- if ( xSelection.is() )
- {
- if ( uno::Reference< task::XInteractionApprove >::query(xSelection).is() )
- return CONTINUATION_APPROVE;
-
- if ( uno::Reference< task::XInteractionDisapprove >::query(xSelection).is() )
- return CONTINUATION_DISAPPROVE;
-
- if ( uno::Reference< task::XInteractionRetry >::query(xSelection).is() )
- return CONTINUATION_RETRY;
-
- if ( uno::Reference< task::XInteractionAbort >::query(xSelection).is() )
- return CONTINUATION_ABORT;
-
- OSL_ENSURE( sal_False,
- "SimpleInteractionRequest::getResponse - Unknown continuation!" );
- }
- return CONTINUATION_UNKNOWN;
-}
-
-} }
diff --git a/configmgr/source/misc/strimpl.cxx b/configmgr/source/misc/strimpl.cxx
deleted file mode 100644
index f54f9caf54..0000000000
--- a/configmgr/source/misc/strimpl.cxx
+++ /dev/null
@@ -1,60 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include "strdecl.hxx"
-
-namespace configmgr
-{
- // simple types names
- IMPLEMENT_CONSTASCII_USTRING(TYPE_BOOLEAN, "boolean");
- IMPLEMENT_CONSTASCII_USTRING(TYPE_SHORT, "short");
- IMPLEMENT_CONSTASCII_USTRING(TYPE_INT, "int");
- IMPLEMENT_CONSTASCII_USTRING(TYPE_LONG, "long");
- IMPLEMENT_CONSTASCII_USTRING(TYPE_DOUBLE, "double");
- IMPLEMENT_CONSTASCII_USTRING(TYPE_STRING, "string");
- // Type: Sequence<bytes>
- IMPLEMENT_CONSTASCII_USTRING(TYPE_BINARY, "binary");
- // Universal type: Any
- IMPLEMENT_CONSTASCII_USTRING(TYPE_ANY, "any");
-
- // special template names for native/localized value types
- IMPLEMENT_CONSTASCII_USTRING(TEMPLATE_MODULE_NATIVE_PREFIX, "cfg:");
- IMPLEMENT_CONSTASCII_USTRING(TEMPLATE_MODULE_NATIVE_VALUE, "cfg:value");
- IMPLEMENT_CONSTASCII_USTRING(TEMPLATE_MODULE_LOCALIZED_VALUE, "cfg:localized");
-
- IMPLEMENT_CONSTASCII_USTRING(TEMPLATE_LIST_SUFFIX, "-list");
-
-
-
-// emacs:
-// create the declare from the implement
-// (fset 'create-declare-from-implement
-// [home M-right ?\C- ?\C-s ?, left right left ?\M-w f12 return up tab ?D ?E ?C ?L ?A ?R ?E ?\C-y ?) ?; home down f12 home down])
-
-} // namespace configmgr
diff --git a/configmgr/source/misc/tracer.cxx b/configmgr/source/misc/tracer.cxx
deleted file mode 100644
index eac08eec2f..0000000000
--- a/configmgr/source/misc/tracer.cxx
+++ /dev/null
@@ -1,471 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-// SUNPRO5 does not like the following to be done after including stdio.h, that's why it's here at the very
-// beginning of the file
-#undef _TIME_T_DEFINED
-#include <time.h>
-#include <rtl/string.hxx>
-#include <map>
-
-#include "tracer.hxx"
-
-#ifdef CFG_ENABLE_TRACING
-
-#include <cstdarg>
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-
-#include <osl/process.h>
-#include <osl/thread.h>
-#include <osl/diagnose.h>
-#include <rtl/ustring.hxx>
-#include <rtl/instance.hxx>
-
-namespace configmgr
-{
-
-extern "C"
-{
- static void call_freeThreadData(void*);
-}
-
-struct OTracerSetup
-{
- enum {
- INFO = 0x01,
- WARNING = 0x02,
- ERROR = 0x04,
- LEVEL_MASK = 0x0f,
-
- TIME = 0x10,
- THREAD = 0x20,
- DATA_MASK = 0xf0
- };
-
- sal_uInt32 m_nTraceMask;
- FILE* m_pOutputMedium;
- sal_Bool m_bInitialized;
- oslThreadKey m_nThreadKey;
-
- ::std::map< ::rtl::OString, void*, ::std::less< ::rtl::OString > > m_aDevices;
-
- OTracerSetup()
- :m_nTraceMask(WARNING | ERROR)
- ,m_pOutputMedium(NULL)
- ,m_bInitialized(sal_False)
- {
- m_nThreadKey = ::osl_createThreadKey(call_freeThreadData);
- }
- ~OTracerSetup()
- {
- ::osl_destroyThreadKey(m_nThreadKey);
- }
-
- bool isTracing(sal_uInt32 nTraceValue) const
- { return (nTraceValue & this->m_nTraceMask) == nTraceValue; }
-
- void setTracing(sal_uInt32 nTraceValue)
- { this->m_nTraceMask |= nTraceValue; }
-
- void setTracing(sal_uInt32 nTraceValue, sal_uInt32 nMask)
- {
- OSL_ENSURE( (nTraceValue&nMask) == nTraceValue, "Flags being set must be part of mask");
- this->m_nTraceMask &= ~nMask;
- this->m_nTraceMask |= nTraceValue;
- }
-
- sal_Int32& indentDepth();
-
- struct ThreadData
- {
- ThreadData() : m_nIndentDepth(0) {}
- sal_Int32 m_nIndentDepth;
- };
-
- ThreadData& ensureThreadData();
- static void freeThreadData(void*p);
-};
-
-//==========================================================================
-//= OConfigTracer
-//==========================================================================
-OTracerSetup* OConfigTracer::s_pImpl = NULL;
-#ifdef WNT
-timeb OConfigTracer::s_aStartTime;
-#else
-timeval OConfigTracer::s_aStartTime;
-#endif
-
-::osl::Mutex & OConfigTracer::getMutex()
-{
- return rtl::Static<osl::Mutex,OConfigTracer>::get();
-}
-//--------------------------------------------------------------------------
-void OConfigTracer::startGlobalTimer()
-{
-#ifdef WNT
- ftime( &s_aStartTime );
-#else
- gettimeofday( &s_aStartTime, NULL );
-#endif
-}
-
-//--------------------------------------------------------------------------
-sal_uInt32 OConfigTracer::getGlobalTimer()
-{
-#ifdef WNT
- struct timeb currentTime;
- sal_uInt32 nSeconds;
- ftime( &currentTime );
- nSeconds = (sal_uInt32)( currentTime.time - s_aStartTime.time );
- return ( nSeconds * 1000 ) + (long)( currentTime.millitm - s_aStartTime.millitm );
-#else
- struct timeval currentTime;
- sal_uInt32 nSeconds;
- gettimeofday( &currentTime, NULL );
- nSeconds = (sal_uInt32)( currentTime.tv_sec - s_aStartTime.tv_sec );
- return ( nSeconds * 1000 ) + (long)( currentTime.tv_usec - s_aStartTime.tv_usec )/1000;
-#endif
-}
-
-//--------------------------------------------------------------------------
-sal_Int32& OTracerSetup::indentDepth()
-{
- return ensureThreadData().m_nIndentDepth;
-}
-
-//--------------------------------------------------------------------------
-OTracerSetup::ThreadData& OTracerSetup::ensureThreadData()
-{
- void * pThreadData = ::osl_getThreadKeyData(m_nThreadKey);
-
- OTracerSetup::ThreadData* pRet
- = static_cast< OTracerSetup::ThreadData * >(pThreadData);
-
- if (pRet == NULL)
- {
- pThreadData = pRet = new ThreadData();
-
- if (!::osl_setThreadKeyData(m_nThreadKey,pThreadData))
- {
- OSL_ENSURE(false, "Cannot create per-thread data for tracing");
- freeThreadData(pThreadData);
-
- static ThreadData sharedThreadData;
- pRet = &sharedThreadData;
- }
- else
- OSL_ASSERT( pThreadData == ::osl_getThreadKeyData(m_nThreadKey) );
-
- OSL_ASSERT( pRet != NULL );
- }
-
- return *pRet;
-}
-
-static void call_freeThreadData( void* p )
-{
- OTracerSetup::freeThreadData( p );
-}
-
-//--------------------------------------------------------------------------
-void OTracerSetup::freeThreadData(void* p)
-{
- delete static_cast< OTracerSetup::ThreadData * > (p);
-}
-
-//--------------------------------------------------------------------------
-void OConfigTracer::ensureData()
-{
- if (s_pImpl)
- return;
- s_pImpl = new OTracerSetup;
-}
-
-//--------------------------------------------------------------------------
-void OConfigTracer::inc()
-{
- ::osl::MutexGuard aGuard(getMutex());
- ensureData();
- ++s_pImpl->indentDepth();
-}
-
-//--------------------------------------------------------------------------
-void OConfigTracer::dec()
-{
- ::osl::MutexGuard aGuard(getMutex());
- ensureData();
- --s_pImpl->indentDepth();
-}
-
-//--------------------------------------------------------------------------
-void OConfigTracer::traceInfo(const sal_Char* _pFormat, ...)
-{
- ::osl::MutexGuard aGuard(getMutex());
- ensureData();
- ensureInitalized();
- if (s_pImpl->isTracing(OTracerSetup::INFO) )
- {
-
-
- va_list args;
- va_start(args, _pFormat);
- implTrace("info", _pFormat, args);
- va_end(args);
- }
-}
-#if OSL_DEBUG_LEVEL > 0
-//--------------------------------------------------------------------------
-void OConfigTracer::traceWarning(const sal_Char* _pFormat, ...)
-{
- ::osl::MutexGuard aGuard(getMutex());
- ensureData();
- ensureInitalized();
- if (s_pImpl->isTracing(OTracerSetup::WARNING))
- {
- va_list args;
- va_start(args, _pFormat);
- implTrace("warning", _pFormat, args);
- va_end(args);
- }
-}
-
-//--------------------------------------------------------------------------
-void OConfigTracer::traceError(const sal_Char* _pFormat, ...)
-{
- ::osl::MutexGuard aGuard(getMutex());
- ensureData();
- ensureInitalized();
- if (s_pImpl->isTracing(OTracerSetup::ERROR))
- {
- va_list args;
- va_start(args, _pFormat);
- implTrace("error", _pFormat, args);
- va_end(args);
- }
-}
-#endif
-//--------------------------------------------------------------------------
-void OConfigTracer::indent()
-{
- sal_Int32 nIndent = s_pImpl->indentDepth();
- for (sal_Int32 i=0; i<nIndent; ++i)
- fprintf(s_pImpl->m_pOutputMedium, " ");
-}
-
-//--------------------------------------------------------------------------
-FILE* disambiguate(const ::rtl::OString& _rFileName)
-{
- FILE* pExistenceCheck = NULL;
- sal_Int32 i = 1;
- ::rtl::OString sLoop;
- while (i <= 256)
- {
- sLoop = _rFileName;
- sLoop += ".";
- sLoop += ::rtl::OString::valueOf(i);
-
- pExistenceCheck = fopen(sLoop.getStr(), "r");
- if (!pExistenceCheck)
- // does not exist
- return fopen(sLoop.getStr(), "w+");
-
- // already exists, try the next name
- fclose(pExistenceCheck);
- ++i;
- }
-
- // could not open such a file
- return NULL;
-}
-
-//--------------------------------------------------------------------------
-void OConfigTracer::ensureInitalized()
-{
- if (s_pImpl->m_bInitialized)
- return;
-
- s_pImpl->m_bInitialized = sal_True;
-
- char* pSettings = getenv("ENVCFGFLAGS");
- if (!pSettings)
- return;
-
- /* currently recognized structure :
- + switches have to be separated by whitespaces
- + valid switches are:
- -m[e|o|f<file>] - output to stderr (e), stdout (o) or a file (f). In the latter case the whole rest
- of the param ('til the next one, means 'til the next whitespace) is the filename
- -t{i,w,e,p,d}* - type of output : i includes infos, w includes warnings, e includes errors
- content : p includes timestamp, d includes thread-id
- */
-
- s_pImpl->m_pOutputMedium = stderr;
- s_pImpl->setTracing(0, OTracerSetup::LEVEL_MASK);
- s_pImpl->setTracing(0, OTracerSetup::DATA_MASK);
-
- char* pParamLoop = pSettings;
- while (*pParamLoop)
- {
- while (!isspace(*pParamLoop) && *pParamLoop)
- ++pParamLoop;
-
- sal_Int32 nLen = pParamLoop - pSettings;
- if ((nLen > 1) && (*pSettings == '-'))
- {
- ++pSettings;
- switch (*pSettings)
- {
- case 'm':
- case 'w':
- if (nLen > 2)
- {
- ++pSettings;
- switch (*pSettings)
- {
- case 'e':
- s_pImpl->m_pOutputMedium = stderr;
- break;
- case 'o':
- s_pImpl->m_pOutputMedium = stdout;
- break;
- case 'f':
- {
- ++pSettings;
- // copy the filename into an own buffer
- ::rtl::OString sFileName(pSettings, pParamLoop - pSettings);
-
- // open the file
- s_pImpl->m_pOutputMedium = disambiguate(sFileName);
-
- break;
- }
- }
- }
- break;
- case 'd':
- { // assign a virtual device
- // copy the device assingment description
- ::rtl::OString sDescription(pSettings + 1, pParamLoop - pSettings - 1);
- sal_Int32 nSep = sDescription.indexOf(':');
- if (-1 == nSep)
- break; // invalid format
-
- ::rtl::OString sVirtualDeviceName, sFileName;
- sVirtualDeviceName = sDescription.copy(0, nSep);
- sFileName = sDescription.copy(nSep + 1);
-
- FILE* pVirtualDevice = disambiguate(sFileName);
- if (pVirtualDevice)
- s_pImpl->m_aDevices[sVirtualDeviceName] = pVirtualDevice;
- }
- case 't':
- {
- ++pSettings;
- while (pSettings != pParamLoop)
- {
- switch (*pSettings)
- {
- case 'i': s_pImpl->setTracing( OTracerSetup::INFO ); break;
- case 'w': s_pImpl->setTracing( OTracerSetup::WARNING ); break;
- case 'e': s_pImpl->setTracing( OTracerSetup::ERROR ); break;
- case 'p': s_pImpl->setTracing( OTracerSetup::TIME );
- startGlobalTimer();
- break;
- case 'd': s_pImpl->setTracing( OTracerSetup::THREAD ); break;
- }
- ++pSettings;
- }
- }
- }
- }
-
- if (!*pParamLoop)
- break;
-
- ++pParamLoop;
- pSettings = pParamLoop;
- }
-
- // trace some initial information
- CFG_TRACE_INFO_NI("initialization: process id: 0x%08X", osl_getProcess(0));
- ::rtl::OUString sExecutable;
- osl_getExecutableFile(&sExecutable.pData);
- CFG_TRACE_INFO_NI("initialization: executable file name: %s", OUSTRING2ASCII(sExecutable));
-}
-
-//--------------------------------------------------------------------------
-//-----------------------------------------------------------
-// need raw unsigned int to safely printf a value
-static inline
-unsigned int getThreadID()
-{
- oslThreadIdentifier nRealThreadID = ::osl_getThreadIdentifier(NULL);
-
- return nRealThreadID; // if this loses data, we can still hope that lsb is changing between thraeds
-}
-
-//--------------------------------------------------------------------------
-void OConfigTracer::implTrace(const sal_Char* _pType, const sal_Char* _pFormat, va_list args)
-{
- ensureInitalized();
- if (!s_pImpl->m_pOutputMedium)
- // no tracing enabled
- return;
-
- if (_pType && strlen(_pType))
- {
- if (s_pImpl->isTracing(OTracerSetup::THREAD))
- {
- fprintf(s_pImpl->m_pOutputMedium, "[%04x] ", getThreadID());
- }
-
- fprintf(s_pImpl->m_pOutputMedium, "%s ", _pType);
-
- if (s_pImpl->isTracing(OTracerSetup::TIME))
- {
- fprintf(s_pImpl->m_pOutputMedium, "(%06" SAL_PRIuUINT32 ")", getGlobalTimer());
- }
- }
- fprintf(s_pImpl->m_pOutputMedium, ": ");
-
- indent();
-
- vfprintf(s_pImpl->m_pOutputMedium, _pFormat, args);
- fprintf(s_pImpl->m_pOutputMedium,"\n");
- fflush(s_pImpl->m_pOutputMedium);
-}
-
-} // namespace configmgr
-
-#endif // CFG_ENABLE_TRACING
-
diff --git a/configmgr/source/modifications.cxx b/configmgr/source/modifications.cxx
new file mode 100644
index 0000000000..2ad3b5ef8b
--- /dev/null
+++ b/configmgr/source/modifications.cxx
@@ -0,0 +1,66 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include "rtl/ustring.hxx"
+
+#include "modifications.hxx"
+#include "path.hxx"
+
+namespace configmgr {
+
+Modifications::Modifications() {}
+
+Modifications::~Modifications() {}
+
+void Modifications::add(Path const & path) {
+ Node * p = &root_;
+ bool wasPresent = false;
+ for (Path::const_iterator i(path.begin()); i != path.end(); ++i) {
+ Node::Children::iterator j(p->children.find(*i));
+ if (j == p->children.end()) {
+ if (wasPresent && p->children.empty()) {
+ return;
+ }
+ j = p->children.insert(Node::Children::value_type(*i, Node())).
+ first;
+ wasPresent = false;
+ } else {
+ wasPresent = true;
+ }
+ p = &j->second;
+ }
+ p->children.clear();
+}
+
+Modifications::Node const & Modifications::getRoot() const {
+ return root_;
+}
+
+}
diff --git a/configmgr/source/modifications.hxx b/configmgr/source/modifications.hxx
new file mode 100644
index 0000000000..e29a101501
--- /dev/null
+++ b/configmgr/source/modifications.hxx
@@ -0,0 +1,65 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_MODIFICATIONS_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_MODIFICATIONS_HXX
+
+#include "sal/config.h"
+
+#include <map>
+
+#include "boost/noncopyable.hpp"
+
+#include "path.hxx"
+
+namespace rtl { class OUString; }
+
+namespace configmgr {
+
+class Modifications: private boost::noncopyable {
+public:
+ struct Node {
+ typedef std::map< rtl::OUString, Node > Children;
+
+ Children children;
+ };
+
+ Modifications();
+
+ ~Modifications();
+
+ void add(Path const & path);
+
+ Node const & getRoot() const;
+
+private:
+ Node root_;
+};
+
+}
+
+#endif
diff --git a/configmgr/source/node.cxx b/configmgr/source/node.cxx
new file mode 100644
index 0000000000..a5a089106b
--- /dev/null
+++ b/configmgr/source/node.cxx
@@ -0,0 +1,108 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "osl/diagnose.h"
+#include "rtl/ref.hxx"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+
+#include "data.hxx"
+#include "node.hxx"
+#include "nodemap.hxx"
+
+namespace configmgr {
+
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
+NodeMap & Node::getMembers() {
+ OSL_ASSERT(false);
+ throw css::uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("this cannot happen")),
+ css::uno::Reference< css::uno::XInterface >());
+}
+
+rtl::OUString Node::getTemplateName() const {
+ return rtl::OUString();
+}
+
+void Node::setMandatory(int layer) {
+ (void) layer; // avoid warnings
+ OSL_ASSERT(layer == Data::NO_LAYER);
+}
+
+int Node::getMandatory() const {
+ return Data::NO_LAYER;
+}
+
+void Node::setLayer(int layer) {
+ OSL_ASSERT(layer >= layer_);
+ layer_ = layer;
+}
+
+int Node::getLayer() const {
+ return layer_;
+}
+
+void Node::setFinalized(int layer) {
+ finalized_ = layer;
+}
+
+int Node::getFinalized() const {
+ return finalized_;
+}
+
+rtl::Reference< Node > Node::getMember(rtl::OUString const & name) {
+ NodeMap & members = getMembers();
+ NodeMap::iterator i(members.find(name));
+ return i == members.end() ? rtl::Reference< Node >() : i->second;
+}
+
+Node::Node(int layer): layer_(layer), finalized_(Data::NO_LAYER) {}
+
+Node::Node(const Node & other):
+ SimpleReferenceObject(), layer_(other.layer_), finalized_(other.finalized_)
+{}
+
+Node::~Node() {}
+
+void Node::clear() {}
+
+rtl::Reference< Node > Node::findMember(rtl::OUString const &) {
+ return rtl::Reference< Node >();
+}
+
+}
diff --git a/configmgr/source/node.hxx b/configmgr/source/node.hxx
new file mode 100644
index 0000000000..10f1685205
--- /dev/null
+++ b/configmgr/source/node.hxx
@@ -0,0 +1,86 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_NODE_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_NODE_HXX
+
+#include "sal/config.h"
+
+#include "rtl/ref.hxx"
+#include "rtl/ustring.hxx"
+#include "salhelper/simplereferenceobject.hxx"
+
+#include "nodemap.hxx"
+
+namespace configmgr {
+
+class Node: public salhelper::SimpleReferenceObject {
+public:
+ enum Kind {
+ KIND_PROPERTY, KIND_LOCALIZED_PROPERTY, KIND_LOCALIZED_VALUE,
+ KIND_GROUP, KIND_SET };
+
+ virtual Kind kind() const = 0;
+
+ virtual rtl::Reference< Node > clone() const = 0;
+
+ virtual NodeMap & getMembers();
+
+ virtual rtl::OUString getTemplateName() const;
+
+ virtual void setMandatory(int layer);
+
+ virtual int getMandatory() const;
+
+ void setLayer(int layer);
+
+ int getLayer() const;
+
+ void setFinalized(int layer);
+
+ int getFinalized() const;
+
+ rtl::Reference< Node > getMember(rtl::OUString const & name);
+
+protected:
+ explicit Node(int layer);
+
+ Node(const Node & other);
+
+ virtual ~Node();
+
+ virtual void clear();
+
+ virtual rtl::Reference< Node > findMember(rtl::OUString const & name);
+
+ int layer_;
+ int finalized_;
+};
+
+}
+
+#endif
diff --git a/configmgr/source/nodemap.cxx b/configmgr/source/nodemap.cxx
new file mode 100644
index 0000000000..6b22863b56
--- /dev/null
+++ b/configmgr/source/nodemap.cxx
@@ -0,0 +1,50 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include <algorithm>
+
+#include "osl/diagnose.h"
+#include "rtl/ustring.hxx"
+
+#include "node.hxx"
+#include "nodemap.hxx"
+
+namespace configmgr {
+
+void cloneNodeMap(NodeMap const & source, NodeMap * target) {
+ OSL_ASSERT(target != 0 && target->empty());
+ NodeMap clone(source);
+ for (NodeMap::iterator i(clone.begin()); i != clone.end(); ++i) {
+ i->second = i->second->clone();
+ }
+ std::swap(clone, *target);
+}
+
+}
diff --git a/configmgr/source/nodemap.hxx b/configmgr/source/nodemap.hxx
new file mode 100644
index 0000000000..92ea324091
--- /dev/null
+++ b/configmgr/source/nodemap.hxx
@@ -0,0 +1,49 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_NODEMAP_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_NODEMAP_HXX
+
+#include "sal/config.h"
+
+#include <map>
+
+#include "rtl/ref.hxx"
+
+namespace rtl { class OUString; }
+
+namespace configmgr {
+
+class Node;
+
+typedef std::map< rtl::OUString, rtl::Reference< Node > > NodeMap;
+
+void cloneNodeMap(NodeMap const & source, NodeMap * target);
+
+}
+
+#endif
diff --git a/configmgr/source/pad.cxx b/configmgr/source/pad.cxx
new file mode 100644
index 0000000000..c8c7218b6d
--- /dev/null
+++ b/configmgr/source/pad.cxx
@@ -0,0 +1,91 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include "osl/diagnose.h"
+#include "rtl/string.h"
+#include "sal/types.h"
+
+#include "pad.hxx"
+#include "span.hxx"
+
+namespace configmgr {
+
+void Pad::add(char const * begin, sal_Int32 length) {
+ OSL_ASSERT(
+ begin != 0 && length >= 0 && !(span_.is() && buffer_.getLength() != 0));
+ if (length != 0) {
+ flushSpan();
+ if (buffer_.getLength() == 0) {
+ span_ = Span(begin, length);
+ } else {
+ buffer_.append(begin, length);
+ }
+ }
+}
+
+void Pad::addEphemeral(char const * begin, sal_Int32 length) {
+ OSL_ASSERT(
+ begin != 0 && length >= 0 && !(span_.is() && buffer_.getLength() != 0));
+ if (length != 0) {
+ flushSpan();
+ buffer_.append(begin, length);
+ }
+}
+
+void Pad::clear() {
+ OSL_ASSERT(!(span_.is() && buffer_.getLength() != 0));
+ span_.clear();
+ buffer_.setLength(0);
+}
+
+bool Pad::is() const {
+ OSL_ASSERT(!(span_.is() && buffer_.getLength() != 0));
+ return span_.is() || buffer_.getLength() != 0;
+}
+
+Span Pad::get() const {
+ OSL_ASSERT(!(span_.is() && buffer_.getLength() != 0));
+ if (span_.is()) {
+ return span_;
+ } else if (buffer_.getLength() == 0) {
+ return Span(RTL_CONSTASCII_STRINGPARAM(""));
+ } else {
+ return Span(buffer_.getStr(), buffer_.getLength());
+ }
+}
+
+void Pad::flushSpan() {
+ if (span_.is()) {
+ buffer_.append(span_.begin, span_.length);
+ span_.clear();
+ }
+}
+
+}
diff --git a/configmgr/source/pad.hxx b/configmgr/source/pad.hxx
new file mode 100644
index 0000000000..66a51f4800
--- /dev/null
+++ b/configmgr/source/pad.hxx
@@ -0,0 +1,61 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_PAD_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_PAD_HXX
+
+#include "sal/config.h"
+
+#include "rtl/strbuf.hxx"
+#include "sal/types.h"
+
+#include "span.hxx"
+
+namespace configmgr {
+
+class Pad {
+public:
+ void add(char const * begin, sal_Int32 length);
+
+ void addEphemeral(char const * begin, sal_Int32 length);
+
+ void clear();
+
+ bool is() const;
+
+ Span get() const;
+
+private:
+ void flushSpan();
+
+ Span span_;
+ rtl::OStringBuffer buffer_;
+};
+
+}
+
+#endif
diff --git a/configmgr/source/parsemanager.cxx b/configmgr/source/parsemanager.cxx
new file mode 100644
index 0000000000..69a5515b97
--- /dev/null
+++ b/configmgr/source/parsemanager.cxx
@@ -0,0 +1,85 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include "com/sun/star/container/NoSuchElementException.hpp"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "osl/diagnose.h"
+#include "sal/types.h"
+
+#include "parsemanager.hxx"
+#include "parser.hxx"
+#include "xmlreader.hxx"
+
+namespace configmgr {
+
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
+ParseManager::ParseManager(
+ rtl::OUString const & url, rtl::Reference< Parser > const & parser)
+ SAL_THROW((
+ css::container::NoSuchElementException, css::uno::RuntimeException)):
+ reader_(url), parser_(parser)
+{
+ OSL_ASSERT(parser.is());
+}
+
+bool ParseManager::parse() {
+ for (;;) {
+ switch (itemData_.is()
+ ? XmlReader::RESULT_BEGIN
+ : reader_.nextItem(
+ parser_->getTextMode(), &itemData_, &itemNamespace_))
+ {
+ case XmlReader::RESULT_BEGIN:
+ if (!parser_->startElement(reader_, itemNamespace_, itemData_))
+ {
+ return false;
+ }
+ break;
+ case XmlReader::RESULT_END:
+ parser_->endElement(reader_);
+ break;
+ case XmlReader::RESULT_TEXT:
+ parser_->characters(itemData_);
+ break;
+ case XmlReader::RESULT_DONE:
+ return true;
+ }
+ itemData_.clear();
+ }
+}
+
+ParseManager::~ParseManager() {}
+
+}
diff --git a/configmgr/source/parsemanager.hxx b/configmgr/source/parsemanager.hxx
new file mode 100644
index 0000000000..18292859ab
--- /dev/null
+++ b/configmgr/source/parsemanager.hxx
@@ -0,0 +1,69 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_PARSEMANAGER_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_PARSEMANAGER_HXX
+
+#include "sal/config.h"
+
+#include "com/sun/star/container/NoSuchElementException.hpp"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "rtl/ref.hxx"
+#include "sal/types.h"
+#include "salhelper/simplereferenceobject.hxx"
+
+#include "span.hxx"
+#include "xmlreader.hxx"
+
+namespace rtl { class OUString; }
+
+namespace configmgr {
+
+class Parser;
+
+class ParseManager: public salhelper::SimpleReferenceObject {
+public:
+ ParseManager(
+ rtl::OUString const & url, rtl::Reference< Parser > const & parser)
+ SAL_THROW((
+ com::sun::star::container::NoSuchElementException,
+ com::sun::star::uno::RuntimeException));
+
+ bool parse();
+
+private:
+ virtual ~ParseManager();
+
+ XmlReader reader_;
+ rtl::Reference< Parser > parser_;
+ Span itemData_;
+ XmlReader::Namespace itemNamespace_;
+};
+
+}
+
+#endif
diff --git a/configmgr/source/parser.hxx b/configmgr/source/parser.hxx
new file mode 100644
index 0000000000..da29941953
--- /dev/null
+++ b/configmgr/source/parser.hxx
@@ -0,0 +1,62 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_PARSER_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_PARSER_HXX
+
+#include "sal/config.h"
+
+#include <memory>
+
+#include "salhelper/simplereferenceobject.hxx"
+
+#include "xmlreader.hxx"
+
+namespace configmgr {
+
+struct Span;
+
+class Parser: public salhelper::SimpleReferenceObject {
+public:
+ virtual XmlReader::Text getTextMode() = 0;
+
+ virtual bool startElement(
+ XmlReader & reader, XmlReader::Namespace ns, Span const & name) = 0;
+
+ virtual void endElement(XmlReader const & reader) = 0;
+
+ virtual void characters(Span const & text) = 0;
+
+protected:
+ Parser() {}
+
+ virtual ~Parser() {}
+};
+
+}
+
+#endif
diff --git a/configmgr/source/path.hxx b/configmgr/source/path.hxx
new file mode 100644
index 0000000000..fc70287dfe
--- /dev/null
+++ b/configmgr/source/path.hxx
@@ -0,0 +1,43 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_PATH_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_PATH_HXX
+
+#include "sal/config.h"
+
+#include <vector>
+
+namespace rtl { class OUString; }
+
+namespace configmgr {
+
+typedef std::vector< rtl::OUString > Path;
+
+}
+
+#endif
diff --git a/configmgr/source/platformbe/componentdefn.cxx b/configmgr/source/platformbe/componentdefn.cxx
deleted file mode 100644
index 2671b74861..0000000000
--- a/configmgr/source/platformbe/componentdefn.cxx
+++ /dev/null
@@ -1,90 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include "systemintegrationmanager.hxx"
-#include <com/sun/star/registry/XRegistryKey.hpp>
-#ifndef _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_
-#include <cppuhelper/implementationentry.hxx>
-#endif // _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_
-
-//==============================================================================
-
-static com::sun::star::uno::Reference<com::sun::star::uno::XInterface> SAL_CALL createSystemIntegrationManager(
- const com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext>& aContext) {
- return * new configmgr::backend::SystemIntegrationManager(aContext) ;
-}
-//==============================================================================
-
-//------------------------------------------------------------------------------
-
-static const cppu::ImplementationEntry kImplementations_entries[] =
-{
- {
- createSystemIntegrationManager,
- configmgr::backend::SystemIntegrationManager::getSystemIntegrationManagerName,
- configmgr::backend::SystemIntegrationManager::getServiceNames,
- cppu::createSingleComponentFactory,
- NULL,
- 0
- },
- { NULL, NULL, NULL, NULL, NULL, 0 }
-} ;
-//------------------------------------------------------------------------------
-
-extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL
-component_getImplementationEnvironment(
- const sal_Char **ppEnvTypeName,
- uno_Environment ** /* ppEnv */
- )
-{
- *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
-}
-
-//------------------------------------------------------------------------------
-
-extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- void *aServiceManager, void *aRegistryKey)
-{
- return cppu::component_writeInfoHelper(aServiceManager,
- aRegistryKey,
- kImplementations_entries) ;
-}
-//------------------------------------------------------------------------------
-
-extern "C" SAL_DLLPUBLIC_EXPORT void *component_getFactory(
- const sal_Char *aImplementationName, void *aServiceManager,
- void *aRegistryKey)
-{
- return cppu::component_getFactoryHelper(aImplementationName,
- aServiceManager,
- aRegistryKey,
- kImplementations_entries) ;
-}
-//------------------------------------------------------------------------------
-
diff --git a/configmgr/source/platformbe/exports.dxp b/configmgr/source/platformbe/exports.dxp
deleted file mode 100644
index 9630d7e067..0000000000
--- a/configmgr/source/platformbe/exports.dxp
+++ /dev/null
@@ -1,3 +0,0 @@
-component_getImplementationEnvironment
-component_writeInfo
-component_getFactory
diff --git a/configmgr/source/platformbe/makefile.mk b/configmgr/source/platformbe/makefile.mk
deleted file mode 100644
index 5818341bbc..0000000000
--- a/configmgr/source/platformbe/makefile.mk
+++ /dev/null
@@ -1,72 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJINC=$(PRJ)$/source
-PRJNAME=configmgr
-TARGET=sysmgr
-ENABLE_EXCEPTIONS=TRUE
-
-# Version
-SYSMGR_MAJOR=1
-
-# --- Settings ---
-
-.INCLUDE : settings.mk
-.IF "$(L10N_framework)"==""
-.INCLUDE : $(PRJ)$/makefile.pmk
-DLLPRE =
-
-# --- Files ---
-
-
-SLOFILES=\
- $(SLO)$/systemintegrationmanager.obj \
- $(SLO)$/componentdefn.obj
-
-LIB1TARGET=$(SLB)$/_$(TARGET).lib
-LIB1OBJFILES=$(SLOFILES)
-
-SHL1TARGET=$(TARGET)$(SYSMGR_MAJOR).uno
-SHL1DEF=$(MISC)$/$(SHL1TARGET).def
-SHL1LIBS=$(LIB1TARGET)
-SHL1IMPLIB=i$(SHL1TARGET)
-SHL1STDLIBS= \
- $(CPPUHELPERLIB) \
- $(CPPULIB) \
- $(SALLIB)
-
-DEF1NAME=$(SHL1TARGET)
-DEF1EXPORTFILE=exports.dxp
-DEF1DES=Configuration: System Integration Manager
-
-# --- Targets ---
-.ENDIF # L10N_framework
-
-.INCLUDE : target.mk
-
diff --git a/configmgr/source/platformbe/sysmgr1.uno.xml b/configmgr/source/platformbe/sysmgr1.uno.xml
deleted file mode 100644
index e20c85347d..0000000000
--- a/configmgr/source/platformbe/sysmgr1.uno.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-c<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module-description PUBLIC "-//StarOffice/DTD ComponentDescription 1.0//EN" "module-description.dtd">
-<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
- <module-name>sysmgr1</module-name>
- <component-description>
- <author>Sarah Smith</author>
- <name>com.sun.star.comp.configuration.backend.SystemIntegration</name>
- <description>The SystemIntegration backend co-ordinates access to a number of configured backends.Each Backend access configuration data from a configured data source</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language>C++</language>
- <status value="final"/>
- <supported-service>com.sun.star.configuration.backend.SystemIntegration</supported-service>
- <type>com.sun.star.configuration.CannotLoadConfigurationException</type>
- <type>com.sun.star.configuration.backend.BackendAccessException</type>
- <type>com.sun.star.configuration.backend.BackendSetupException</type>
- <type>com.sun.star.configuration.backend.XBackend</type>
- <type>com.sun.star.configuration.backend.XLayer</type>
- <type>com.sun.star.configuration.backend.XUpdateHandler</type>
- <type>com.sun.star.configuration.backend.XSingleLayerStratum</type>
- <type>com.sun.star.configuration.backend.XBackendChangesNotifier</type>
- <type>com.sun.star.configuration.backend.XBackendChangesListener</type>
- <type>com.sun.star.uno.XComponentContext</type>
- <type>com.sun.star.container.XContentEnumerationAccess</type>
- <type>com.sun.star.container.XEnumeration</type>
- <type>com.sun.star.beans.XPropertySet</type>
- <type>com.sun.star.lang.IllegalArgumentException</type>
- <type>com.sun.star.lang.XInitialization</type>
- <type>com.sun.star.lang.XMultiServiceFactory</type>
- <type>com.sun.star.lang.XServiceInfo</type>
- <type>com.sun.star.lang.XSingleServiceFactory</type>
- <type>com.sun.star.lang.XSingleComponentFactory</type>
- <type>com.sun.star.lang.XTypeProvider</type>
- <type>com.sun.star.registry.XRegistryKey</type>
- <type>com.sun.star.uno.Any</type>
- <type>com.sun.star.uno.Sequence</type>
- </component-description>
- <project-build-dependency> comphelper </project-build-dependency>
- <project-build-dependency> vos </project-build-dependency>
- <project-build-dependency> cppuhelper </project-build-dependency>
- <project-build-dependency> salhelper </project-build-dependency>
- <project-build-dependency> cppu </project-build-dependency>
- <project-build-dependency> sal </project-build-dependency>
- <runtime-module-dependency> comphelp2$(COM) </runtime-module-dependency>
- <runtime-module-dependency> vos2$(COM) </runtime-module-dependency>
- <runtime-module-dependency> cppuhelper3$(COM) </runtime-module-dependency>
- <runtime-module-dependency> salhelper3$(COM) </runtime-module-dependency>
- <runtime-module-dependency> cppu3 </runtime-module-dependency>
- <runtime-module-dependency> sal3 </runtime-module-dependency>
-</module-description>
diff --git a/configmgr/source/platformbe/systemintegrationmanager.cxx b/configmgr/source/platformbe/systemintegrationmanager.cxx
deleted file mode 100644
index efc448c06f..0000000000
--- a/configmgr/source/platformbe/systemintegrationmanager.cxx
+++ /dev/null
@@ -1,366 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include "systemintegrationmanager.hxx"
-#include <com/sun/star/container/XContentEnumerationAccess.hpp>
-#include <com/sun/star/container/XEnumeration.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/registry/XRegistryKey.hpp>
-
-namespace configmgr { namespace backend {
-
-
-//==============================================================================
-#define OU2A( oustr ) (rtl::OUStringToOString( oustr, RTL_TEXTENCODING_ASCII_US ).getStr())
-//==============================================================================
-uno::Reference<backenduno::XSingleLayerStratum> BackendRef::getBackend(uno::Reference<uno::XComponentContext> const & xContext)
-{
- if (!mBackend.is() && mFactory.is())
- try
- {
- mBackend.set( mFactory->createInstanceWithContext(xContext), uno::UNO_QUERY_THROW );
- }
- catch(uno::Exception& e)
- {
- OSL_TRACE("SystemIntegration::getSupportingBackend - could not create platform Backend: %s",
- OU2A(e.Message) );
- }
- return mBackend;
-}
-//------------------------------------------------------------------------------
-void BackendRef::disposeBackend()
-{
- uno::Reference< lang::XComponent> xComp( mBackend, uno::UNO_QUERY );
- if (xComp.is())
- try
- {
- xComp->dispose();
- }
- catch(uno::Exception &)
- {}
- mBackend.clear();
-}
-//==============================================================================
-SystemIntegrationManager::SystemIntegrationManager(const uno::Reference<uno::XComponentContext>& xContext)
-: cppu::WeakComponentImplHelper4< backenduno::XBackend, backenduno::XBackendChangesNotifier, lang::XInitialization, lang::XServiceInfo>(mMutex)
-, mMutex()
-, mContext(xContext)
-, mPlatformBackends()
-{
-}
-//------------------------------------------------------------------------------
-SystemIntegrationManager::~SystemIntegrationManager()
-{
-}
-//------------------------------------------------------------------------------
-void SAL_CALL SystemIntegrationManager::initialize(
- const uno::Sequence<uno::Any>& /*aParameters*/)
- throw (uno::RuntimeException, uno::Exception,
- lang::IllegalArgumentException,
- backenduno::BackendSetupException)
-{
- buildLookupTable();
-}
-//------------------------------------------------------------------------------
-static const rtl::OUString getAllComponentsName()
-{
- sal_Unicode const kStar = '*';
- return rtl::OUString(&kStar,1);
-}
-
-//------------------------------------------------------------------------------
-
-void SystemIntegrationManager::buildLookupTable()
-{
- static const rtl::OUString kPlatformServiceName(
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.PlatformBackend")) ;
-
- //Build platform backend map componentName -> servicefactory
- uno::Reference<css::container::XContentEnumerationAccess> xEnumAccess
- (mContext->getServiceManager(),uno::UNO_QUERY_THROW);
-
- uno::Reference<css::container::XEnumeration> xEnum =
- xEnumAccess->createContentEnumeration(kPlatformServiceName);
- if (xEnum.is())
- {
- osl::MutexGuard lock(mMutex);
- while (xEnum->hasMoreElements())
- {
- uno::Reference<lang::XSingleComponentFactory> xServiceFactory( xEnum->nextElement(),uno::UNO_QUERY);
- if (xServiceFactory.is())
- {
- uno::Sequence<rtl::OUString> aKeys = getSupportedComponents(xServiceFactory);
-
- for (sal_Int32 i = 0 ; i < aKeys.getLength() ; ++i)
- {
- BackendRef aBackendRef(xServiceFactory);
- //OSL_TRACE("SystemInteg -Adding Factory Backend to map for key %s",
- //rtl::OUStringToOString(aKeys[i], RTL_TEXTENCODING_ASCII_US).getStr() );
- mPlatformBackends.insert( std::multimap<rtl::OUString, BackendRef>::value_type(aKeys[i],aBackendRef));
- }
- }
- }
- }
-}
-//---------------------------------------------------------------------------------------------
-
-uno::Sequence<rtl::OUString>
-SystemIntegrationManager::getSupportedComponents(const uno::Reference<lang::XSingleComponentFactory>& xFactory)
-{
- static const rtl::OUString kProperSubkeyName( RTL_CONSTASCII_USTRINGPARAM("/DATA/SupportedComponents")) ;
- static const rtl::OUString kImplKeyPropertyName( RTL_CONSTASCII_USTRINGPARAM("ImplementationKey")) ;
-
- uno::Reference<css::beans::XPropertySet> xSMProp(xFactory,uno::UNO_QUERY);
- if (xSMProp.is())
- {
- try
- {
- uno::Reference< css::registry::XRegistryKey > xImplKey(
- xSMProp->getPropertyValue(kImplKeyPropertyName), uno::UNO_QUERY);
-
- if (xImplKey.is())
- {
- uno::Reference< css::registry::XRegistryKey > xKey(
- xImplKey->openKey(kProperSubkeyName));
- if(xKey.is())
- return xKey->getAsciiListValue();
- }
- }
- catch(css::beans::UnknownPropertyException&){}
- catch(css::registry::InvalidValueException&){}
- catch(css::registry::InvalidRegistryException&){}
- }
- static const rtl::OUString kAllComponentsName = getAllComponentsName();
- return uno::Sequence<rtl::OUString>(&kAllComponentsName, 1);
-}
-//---------------------------------------------------------------------------------------------
-
-uno::Sequence<uno::Reference<backenduno::XLayer> > SAL_CALL
- SystemIntegrationManager::listOwnLayers(const rtl::OUString& aComponent)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- return listLayers(aComponent, rtl::OUString() ) ;
-}
-//------------------------------------------------------------------------------
-
-uno::Reference<backenduno::XUpdateHandler> SAL_CALL
- SystemIntegrationManager::getOwnUpdateHandler(const rtl::OUString& aComponent)
- throw (backenduno::BackendAccessException,
- lang::NoSupportException,
- lang::IllegalArgumentException,
- uno::RuntimeException)
-{
-
- return getUpdateHandler(aComponent, rtl::OUString()) ;
-}
-//------------------------------------------------------------------------------
-
-std::vector< uno::Reference<backenduno::XSingleLayerStratum> > SystemIntegrationManager::getSupportingBackends(const rtl::OUString& aComponent)
-{
- std::vector< uno::Reference<backenduno::XSingleLayerStratum> > backends;
-
- osl::MutexGuard lock(mMutex);
- std::pair<std::multimap<rtl::OUString, BackendRef>::iterator, std::multimap<rtl::OUString, BackendRef>::iterator> aRange = mPlatformBackends.equal_range(aComponent);
- for (std::multimap<rtl::OUString, BackendRef>::iterator it=aRange.first; it != aRange.second; )
- {
- std::multimap<rtl::OUString, BackendRef>::iterator cur = it++; // increment here, as erase() may invalidate cur
- uno::Reference<backenduno::XSingleLayerStratum> xBackend = cur->second.getBackend(mContext);
- if (xBackend.is())
- backends.push_back(xBackend);
-
- else // prevent repeated attempts to create
- mPlatformBackends.erase(cur);
- }
- return backends;
-}
-//------------------------------------------------------------------------------
-uno::Sequence<uno::Reference<backenduno::XLayer> > SAL_CALL
- SystemIntegrationManager::listLayers(const rtl::OUString& aComponent,
- const rtl::OUString& /*aEntity*/)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException)
-{
- std::vector< uno::Reference<backenduno::XSingleLayerStratum> > const aUniversalBackends = getSupportingBackends(getAllComponentsName());
- std::vector< uno::Reference<backenduno::XSingleLayerStratum> > const aSpecialBackends = getSupportingBackends(aComponent);
-
- uno::Sequence< uno::Reference<backenduno::XLayer> > aLayers(aUniversalBackends.size() + aSpecialBackends.size());
-
- uno::Reference<backenduno::XLayer> * pLayer = aLayers.getArray();
-
- for (std::vector< uno::Reference<backenduno::XSingleLayerStratum> >::size_type i=0 ; i< aUniversalBackends.size(); ++i, ++pLayer)
- *pLayer = aUniversalBackends[i]->getLayer(aComponent, rtl::OUString());
-
- for (std::vector< uno::Reference<backenduno::XSingleLayerStratum> >::size_type j=0 ; j< aSpecialBackends.size(); ++j, ++pLayer)
- *pLayer = aSpecialBackends[j]->getLayer(aComponent, rtl::OUString());
-
- OSL_ASSERT( aLayers.getConstArray()+aLayers.getLength() == pLayer );
- return aLayers;
-}
-//------------------------------------------------------------------------------
-
-uno::Reference<backenduno::XUpdateHandler> SAL_CALL
- SystemIntegrationManager::getUpdateHandler(const rtl::OUString& /*aComponent*/,
- const rtl::OUString& /*aEntity*/)
- throw (backenduno::BackendAccessException,
- lang::NoSupportException,
- lang::IllegalArgumentException,
- uno::RuntimeException)
-{
-
- throw lang::NoSupportException(
- rtl::OUString::createFromAscii(
- "SystemIntegrationManager: No Update Operation allowed, Read Only access"),
- *this) ;
-}
-// ---------------------------------------------------------------------------
-// ComponentHelper
-void SAL_CALL SystemIntegrationManager::disposing()
-{
- osl::MutexGuard lock(mMutex);
- for (std::multimap<rtl::OUString, BackendRef>::iterator it = mPlatformBackends.begin(); it != mPlatformBackends.end(); ++it)
- it->second.disposeBackend();
-
- mPlatformBackends.clear();
- mContext.clear();
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL SystemIntegrationManager::
- getSystemIntegrationManagerName(void)
-{
- static const rtl::OUString kImplementationName(
- RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.configuration.backend.SystemIntegration")) ;
-
- return kImplementationName ;
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL SystemIntegrationManager::getImplementationName(void)
- throw (uno::RuntimeException)
-{
- return getSystemIntegrationManagerName() ;
-}
-//------------------------------------------------------------------------------
-
-uno::Sequence<rtl::OUString> SAL_CALL SystemIntegrationManager::
- getServiceNames(void)
-{
- uno::Sequence<rtl::OUString> aServices(2) ;
- aServices[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.SystemIntegration")) ;
- aServices[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.Backend")) ;
-
- return aServices ;
-}
-//------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL SystemIntegrationManager::supportsService(
- const rtl::OUString& aServiceName)
- throw (uno::RuntimeException)
-{
- uno::Sequence< rtl::OUString > const svc = getServiceNames();
-
- for(sal_Int32 i = 0; i < svc.getLength(); ++i )
- if(svc[i] == aServiceName)
- return true;
- return false;
-}
-//------------------------------------------------------------------------------
-
-uno::Sequence<rtl::OUString>
-SAL_CALL SystemIntegrationManager::getSupportedServiceNames(void)
- throw (uno::RuntimeException)
-{
- return getServiceNames() ;
-}
-//------------------------------------------------------------------------------
-
-void SAL_CALL SystemIntegrationManager::addChangesListener(
- const uno::Reference<backenduno::XBackendChangesListener>& xListener,
- const rtl::OUString& aComponent)
- throw (::com::sun::star::uno::RuntimeException)
-{
- osl::MutexGuard aGuard(mMutex);
-
- // FIXME: we really need our own InterfaceContainer plus a helper object
- // that listens on the backends and forwards notifications
-
- //Simply forward listener to platform backend that support listening
- {
- std::vector< uno::Reference<backenduno::XSingleLayerStratum> > aUniversalBackends = getSupportingBackends(getAllComponentsName());
- for (sal_uInt32 i=0; i< aUniversalBackends.size(); i++)
- {
- uno::Reference<backenduno::XBackendChangesNotifier> xBackend( aUniversalBackends[i], uno::UNO_QUERY) ;
- if (xBackend.is())
- xBackend->addChangesListener(xListener, aComponent);
- }
- }
- {
- std::vector< uno::Reference<backenduno::XSingleLayerStratum> > aSpecialBackends = getSupportingBackends(aComponent);
- for (sal_uInt32 i=0; i< aSpecialBackends.size(); i++)
- {
- uno::Reference<backenduno::XBackendChangesNotifier> xBackend( aSpecialBackends[i], uno::UNO_QUERY) ;
- if (xBackend.is())
- xBackend->addChangesListener(xListener, aComponent);
- }
- }
-}
-//------------------------------------------------------------------------------
-void SAL_CALL SystemIntegrationManager::removeChangesListener(
- const uno::Reference<backenduno::XBackendChangesListener>& xListener,
- const rtl::OUString& aComponent)
- throw (::com::sun::star::uno::RuntimeException)
-{
- osl::MutexGuard aGuard(mMutex);
- {
- std::vector< uno::Reference<backenduno::XSingleLayerStratum> > aUniversalBackends = getSupportingBackends(getAllComponentsName());
- for (sal_uInt32 i=0; i< aUniversalBackends.size(); i++)
- {
- uno::Reference<backenduno::XBackendChangesNotifier> xBackend( aUniversalBackends[i], uno::UNO_QUERY) ;
- if (xBackend.is())
- xBackend->removeChangesListener(xListener, aComponent);
- }
- }
- {
- std::vector< uno::Reference<backenduno::XSingleLayerStratum> > aSpecialBackends = getSupportingBackends(aComponent);
- for (sal_uInt32 i=0; i< aSpecialBackends.size(); i++)
- {
- uno::Reference<backenduno::XBackendChangesNotifier> xBackend( aSpecialBackends[i], uno::UNO_QUERY) ;
- if (xBackend.is())
- xBackend->removeChangesListener(xListener, aComponent);
- }
- }
-}
-//------------------------------------------------------------------------------
-
-
-} } // configmgr.backend
diff --git a/configmgr/source/platformbe/systemintegrationmanager.hxx b/configmgr/source/platformbe/systemintegrationmanager.hxx
deleted file mode 100644
index b2c62b7d29..0000000000
--- a/configmgr/source/platformbe/systemintegrationmanager.hxx
+++ /dev/null
@@ -1,161 +0,0 @@
-#ifndef CONFIGMGR_BACKEND_SYSTEMINTEGRATIONMANAGER_HXX_
-#define CONFIGMGR_BACKEND_SYSTEMINTEGRATIONMANAGER_HXX_
-
-#include <com/sun/star/configuration/backend/XBackend.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/uno/XInterface.hpp>
-#include <com/sun/star/configuration/backend/BackendSetupException.hpp>
-#include <com/sun/star/configuration/backend/XBackendChangesNotifier.hpp>
-#include <com/sun/star/lang/XSingleComponentFactory.hpp>
-#include <com/sun/star/configuration/backend/XSingleLayerStratum.hpp>
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
-#include <cppuhelper/compbase4.hxx>
-
-#ifndef INCLUDED_MAP
-#include <map>
-#define INCLUDED_MAP
-#endif
-
-namespace configmgr { namespace backend {
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backenduno = css::configuration::backend ;
-
-/* Class containing a reference to a service factory(XSingleComponentFactory)
- object and a platform backend (XSingleLayerStratum).
- The reference to the platform backend will be NULL until the platform backend
- is initialised
- */
-class BackendRef
-{
- uno::Reference<lang::XSingleComponentFactory> mFactory;
- uno::Reference<backenduno::XSingleLayerStratum> mBackend;
-public:
- explicit
- BackendRef(const uno::Reference<lang::XSingleComponentFactory>& aFactory)
- :mFactory(aFactory)
- ,mBackend()
- {}
-
- uno::Reference<backenduno::XSingleLayerStratum> getBackend(uno::Reference<uno::XComponentContext> const & xContext);
- void disposeBackend();
-};
-
-/**
- Class implementing the Backend service for system integration backend access.
- It creates the required backends and coordinates access to them.
- */
-class SystemIntegrationManager : public cppu::WeakComponentImplHelper4< backenduno::XBackend, backenduno::XBackendChangesNotifier, lang::XInitialization, lang::XServiceInfo>
-{
-public:
- /**
- Service constructor from a service factory.
-
- @param xContext component context
- */
- explicit
- SystemIntegrationManager( const uno::Reference<uno::XComponentContext>& xContext) ;
-
- /** Destructor */
- ~SystemIntegrationManager() ;
-
- // XBackend
- virtual uno::Sequence<uno::Reference<backenduno::XLayer> >
- SAL_CALL listOwnLayers(const rtl::OUString& aComponent)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
-
- virtual uno::Reference<backenduno::XUpdateHandler>
- SAL_CALL getOwnUpdateHandler(const rtl::OUString& aComponent)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- lang::NoSupportException,
- uno::RuntimeException) ;
-
- virtual uno::Sequence<uno::Reference<backenduno::XLayer> > SAL_CALL
- listLayers(const rtl::OUString& aComponent,
- const rtl::OUString& aEntity)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- uno::RuntimeException) ;
-
- virtual uno::Reference<backenduno::XUpdateHandler> SAL_CALL
- getUpdateHandler(const rtl::OUString& aComponent,
- const rtl::OUString& aEntity)
- throw (backenduno::BackendAccessException,
- lang::IllegalArgumentException,
- lang::NoSupportException,
- uno::RuntimeException) ;
-
- // XInitialize
- virtual void SAL_CALL initialize(const uno::Sequence<uno::Any>& aParameters)
- throw (uno::RuntimeException, uno::Exception,
- lang::IllegalArgumentException,
- backenduno::BackendSetupException) ;
-
- // XServiceInfo
- virtual rtl::OUString SAL_CALL getImplementationName()
- throw (uno::RuntimeException) ;
-
- virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& aServiceName)
- throw (uno::RuntimeException) ;
-
- virtual uno::Sequence<rtl::OUString> SAL_CALL
- getSupportedServiceNames(void) throw (uno::RuntimeException) ;
-
- // XBackendChangesNotifier
- virtual void SAL_CALL addChangesListener( const uno::Reference<backenduno::XBackendChangesListener>& xListner,
- const rtl::OUString& aComponent)
- throw (uno::RuntimeException);
-
-
- virtual void SAL_CALL removeChangesListener( const uno::Reference<backenduno::XBackendChangesListener>& xListner,
- const rtl::OUString& aComponent)
- throw (uno::RuntimeException);
-
- /**
- Provides the implementation name.
-
- @return implementation name
- */
- static rtl::OUString SAL_CALL getSystemIntegrationManagerName(void) ;
- /**
- Provides the list of supported services.
-
- @return list of service names
- */
- static uno::Sequence<rtl::OUString> SAL_CALL getServiceNames(void) ;
-protected:
-// ComponentHelper
- virtual void SAL_CALL disposing();
-private :
- /** build lookup up table
- */
- void buildLookupTable();
-
- /** get list of supported components
- */
- uno::Sequence<rtl::OUString> getSupportedComponents(const uno::Reference<lang::XSingleComponentFactory>& xFactory);
-
- /**
- get supporting backends from lookup table
- */
- std::vector< uno::Reference<backenduno::XSingleLayerStratum> > getSupportingBackends(const rtl::OUString& aComponent);
-
-private :
- /** Mutex for resource protection */
- osl::Mutex mMutex ;
- /** Component Context */
- uno::Reference<uno::XComponentContext> mContext ;
-
- std::multimap<rtl::OUString, BackendRef> mPlatformBackends;
-} ;
-
-} } // configmgr.backend
-
-#endif // CONFIGMGR_BACKEND_SYSTEMINTEGRATIONMANAGER_HXX_
diff --git a/configmgr/source/propertynode.cxx b/configmgr/source/propertynode.cxx
new file mode 100644
index 0000000000..070b56d9be
--- /dev/null
+++ b/configmgr/source/propertynode.cxx
@@ -0,0 +1,110 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include "com/sun/star/beans/Optional.hpp"
+#include "com/sun/star/uno/Any.hxx"
+#include "osl/diagnose.h"
+#include "rtl/ref.hxx"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+
+#include "components.hxx"
+#include "node.hxx"
+#include "propertynode.hxx"
+#include "type.hxx"
+
+namespace configmgr {
+
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
+PropertyNode::PropertyNode(
+ int layer, Type staticType, bool nillable, css::uno::Any const & value,
+ bool extension):
+ Node(layer), staticType_(staticType), nillable_(nillable), value_(value),
+ extension_(extension)
+{}
+
+rtl::Reference< Node > PropertyNode::clone() const {
+ return new PropertyNode(*this);
+}
+
+Type PropertyNode::getStaticType() const {
+ return staticType_;
+}
+
+bool PropertyNode::isNillable() const {
+ return nillable_;
+}
+
+css::uno::Any PropertyNode::getValue(Components & components) {
+ if (externalDescriptor_.getLength() != 0) {
+ css::beans::Optional< css::uno::Any > val(
+ components.getExternalValue(externalDescriptor_));
+ if (val.IsPresent) {
+ value_ = val.Value; //TODO: check value type
+ }
+ externalDescriptor_ = rtl::OUString(); // must not throw
+ }
+ return value_;
+}
+
+void PropertyNode::setValue(int layer, css::uno::Any const & value) {
+ setLayer(layer);
+ value_ = value;
+ externalDescriptor_ = rtl::OUString();
+}
+
+void PropertyNode::setExternal(int layer, rtl::OUString const & descriptor) {
+ OSL_ASSERT(descriptor.getLength() != 0);
+ setLayer(layer);
+ externalDescriptor_ = descriptor;
+}
+
+bool PropertyNode::isExtension() const {
+ return extension_;
+}
+
+PropertyNode::PropertyNode(PropertyNode const & other):
+ Node(other), staticType_(other.staticType_), nillable_(other.nillable_),
+ value_(other.value_), externalDescriptor_(other.externalDescriptor_),
+ extension_(other.extension_)
+{}
+
+PropertyNode::~PropertyNode() {}
+
+Node::Kind PropertyNode::kind() const {
+ return KIND_PROPERTY;
+}
+
+}
diff --git a/configmgr/source/propertynode.hxx b/configmgr/source/propertynode.hxx
new file mode 100644
index 0000000000..1566cbf72d
--- /dev/null
+++ b/configmgr/source/propertynode.hxx
@@ -0,0 +1,83 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_PROPERTYNODE_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_PROPERTYNODE_HXX
+
+#include "sal/config.h"
+
+#include "com/sun/star/uno/Any.hxx"
+#include "rtl/ref.hxx"
+
+#include "node.hxx"
+#include "type.hxx"
+
+namespace rtl { class OUString; }
+
+namespace configmgr {
+
+class Components;
+
+class PropertyNode: public Node {
+public:
+ PropertyNode(
+ int layer, Type staticType, bool nillable,
+ com::sun::star::uno::Any const & value, bool extension);
+
+ virtual rtl::Reference< Node > clone() const;
+
+ Type getStaticType() const;
+
+ bool isNillable() const;
+
+ com::sun::star::uno::Any getValue(Components & components);
+
+ void setValue(int layer, com::sun::star::uno::Any const & value);
+
+ void setExternal(int layer, rtl::OUString const & descriptor);
+
+ bool isExtension() const;
+
+private:
+ PropertyNode(PropertyNode const & other);
+
+ virtual ~PropertyNode();
+
+ virtual Kind kind() const;
+
+ Type staticType_;
+ // as specified in the component-schema (TYPE_ANY, ...,
+ // TYPE_HEXBINARY_LIST; not TYPE_ERROR or TYPE_NIL)
+ bool nillable_;
+ com::sun::star::uno::Any value_;
+ rtl::OUString externalDescriptor_;
+ bool extension_;
+};
+
+}
+
+#endif
diff --git a/configmgr/source/registry/cfgregistrykey.cxx b/configmgr/source/registry/cfgregistrykey.cxx
deleted file mode 100644
index fc32e03499..0000000000
--- a/configmgr/source/registry/cfgregistrykey.cxx
+++ /dev/null
@@ -1,1479 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include "cfgregistrykey.hxx"
-#include "datalock.hxx"
-#include "typeconverter.hxx"
-#include <osl/diagnose.h>
-#include <cppuhelper/extract.hxx>
-#include <com/sun/star/container/XNameContainer.hpp>
-#include <com/sun/star/container/XNamed.hpp>
-#include <com/sun/star/container/XChild.hpp>
-#include <com/sun/star/container/XHierarchicalName.hpp>
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/beans/Property.hpp>
-#include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <com/sun/star/beans/XProperty.hpp>
-#include <com/sun/star/util/XStringEscape.hpp>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <typelib/typedescription.hxx>
-
-#include <limits>
-
-#define THISREF() static_cast< ::cppu::OWeakObject* >(this)
-#define UNISTRING(c) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(c) )
-
-//..........................................................................
-namespace configmgr
-{
-//..........................................................................
-
-//--------------------------------------------------------------------------
-namespace {
- inline
- com::sun::star::uno::Type getBinaryDataType()
- {
- com::sun::star::uno::Sequence<sal_Int8> const * const p= 0;
- return ::getCppuType(p);
- }
- inline
- bool isAscii(sal_Unicode ch)
- {
- return 0 < ch && ch < 128;
- }
- inline
- bool isAscii(sal_Unicode const * ps, sal_Int32 nLen )
- {
- for (int i= 0; i< nLen; ++i)
- if ( !isAscii( ps[i] ) )
- return false;
- return true;
- }
- inline
- bool isAscii(rtl::OUString const& str)
- {
- return isAscii(str.getStr(),str.getLength());
- }
- inline
- bool isAscii(com::sun::star::uno::Sequence< rtl::OUString > const& strList)
- {
- for (int i= 0; i< strList.getLength(); ++i)
- if ( !isAscii( strList[i] ) )
- return false;
- return true;
- }
-}
-// temporary helper
-inline static void checkNullable() {}
-
-//==========================================================================
-//= OConfigurationRegistryKey
-//==========================================================================
-
-static
-rtl::OUString getNodeName(const com::sun::star::uno::Reference< com::sun::star::container::XNameAccess >& _xNode)
-{
- com::sun::star::uno::Reference< com::sun::star::container::XNamed > xName( _xNode, com::sun::star::uno::UNO_QUERY );
- if (xName.is())
- return xName->getName();
-
- OSL_ENSURE( !_xNode.is(), "Cannot get name of node");
- return rtl::OUString();
-}
-//--------------------------------------------------------------------------
-
-static bool splitPath(const rtl::OUString& _sPath, rtl::OUString& _rsParentPath, rtl::OUString& _rsLocalName);
-//--------------------------------------------------------------------------
-
-OConfigurationRegistryKey::OConfigurationRegistryKey
- (const com::sun::star::uno::Reference< com::sun::star::container::XNameAccess >& _rxRootNode
- ,sal_Bool _bWriteable
- ,SubtreeRoot
- )
- :m_bReadOnly(!_bWriteable)
- ,m_xNode(_rxRootNode)
- ,m_xParentNode()
- ,m_sLocalName() // this will be treated as root - maybe use hierarchical name (ß)
-{
- OSL_ENSURE(m_xNode.is(), "OConfigurationRegistryKey::OConfigurationRegistryKey : invalid config node param !");
-}
-
-//--------------------------------------------------------------------------
-OConfigurationRegistryKey::OConfigurationRegistryKey
- (const com::sun::star::uno::Reference< com::sun::star::container::XNameAccess >& _rxNode
- ,sal_Bool _bWriteable
- )
- :m_bReadOnly(!_bWriteable)
- ,m_xNode(_rxNode)
- ,m_xParentNode()
- ,m_sLocalName( getNodeName(_rxNode) ) // this will not be treated as root
-{
- OSL_ENSURE(m_xNode.is(), "OConfigurationRegistryKey::OConfigurationRegistryKey : invalid config node param !");
-}
-
-//--------------------------------------------------------------------------
-OConfigurationRegistryKey::OConfigurationRegistryKey(
- com::sun::star::uno::Any _rCurrentValue,
- const com::sun::star::uno::Reference< com::sun::star::container::XNameAccess >& _rxParentNode,
- const ::rtl::OUString& _rLocalName,
- sal_Bool _bWriteable)
- :m_bReadOnly(!_bWriteable)
- ,m_xNode()
- ,m_xParentNode(_rxParentNode)
- ,m_sLocalName(_rLocalName)
-{
- OSL_ENSURE(m_xParentNode.is(), "OConfigurationRegistryKey::OConfigurationRegistryKey : invalid parent node param !");
- OSL_ENSURE(m_sLocalName.getLength(), "OConfigurationRegistryKey::OConfigurationRegistryKey : invalid relative name !");
- OSL_ENSURE(m_xParentNode->hasByName( m_sLocalName ), "OConfigurationRegistryKey::OConfigurationRegistryKey : key not found in parent node !" ); //
- OSL_ENSURE(m_xParentNode->getByName( m_sLocalName ) == _rCurrentValue, "OConfigurationRegistryKey::OConfigurationRegistryKey : wrong value parameter !" ); //
-
- _rCurrentValue >>= m_xNode; // we don't care if that fails
-}
-//--------------------------------------------------------------------------
-
-com::sun::star::uno::Reference<com::sun::star::beans::XPropertySetInfo> OConfigurationRegistryKey::implGetParentPropertyInfo() throw(com::sun::star::uno::RuntimeException)
-{
- if (!m_xParentNode.is())
- {
- com::sun::star::uno::Reference< com::sun::star::container::XChild > xChild(m_xNode, com::sun::star::uno::UNO_QUERY);
- if (xChild.is())
- m_xParentNode = m_xParentNode.query(xChild->getParent());
- }
-
- com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo > xParentInfo; // the result
-
- com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xParentProperties(m_xParentNode, com::sun::star::uno::UNO_QUERY);
- if (xParentProperties.is())
- {
- xParentInfo = xParentProperties->getPropertySetInfo();
- if (xParentInfo.is() && !xParentInfo->hasPropertyByName(m_sLocalName))
- {
- OSL_ENSURE(false, "OConfigurationRegistryKey: This key is unknown in the parent node's PropertySetInfo !");
- xParentInfo.clear(); // this key is unknow, so don't return the info
- }
- }
-
- return xParentInfo;
-}
-//--------------------------------------------------------------------------
-
-static
-sal_Bool isNodeReadOnly(com::sun::star::uno::Reference< com::sun::star::uno::XInterface > const& _xNode) throw(com::sun::star::uno::RuntimeException)
-{
- OSL_ASSERT( _xNode.is() );
-
- com::sun::star::uno::Reference< com::sun::star::beans::XProperty > xProperty(_xNode, com::sun::star::uno::UNO_QUERY);
- if (xProperty.is())
- {
- com::sun::star::beans::Property aProperty = xProperty->getAsProperty();
-
- return (aProperty.Attributes & com::sun::star::beans::PropertyAttribute::READONLY) != 0;
- }
-
- com::sun::star::uno::Reference< com::sun::star::lang::XServiceInfo > xServiceInfo( _xNode, com::sun::star::uno::UNO_QUERY );
- if (xServiceInfo.is())
- {
- // does it announce update capability ?
- if (xServiceInfo->supportsService(UNISTRING("com.sun.star.configuration.ConfigurationUpdateAccess")))
- return false;
-
- // else does it announce the expected service at all ?
- else if (xServiceInfo->supportsService(UNISTRING("com.sun.star.configuration.ConfigurationAccess")))
- return true;
- }
-
- // no XProperty, no (meaningful) ServiceInfo - what can we do
- return false;
-}
-
-//--------------------------------------------------------------------------
-
-sal_Bool OConfigurationRegistryKey::implIsReadOnly() throw (com::sun::star::uno::RuntimeException)
-{
- sal_Bool bResult = m_bReadOnly;;
-
- // do checks only if this was requested to be writable
- if (m_bReadOnly)
- {
- // nothing to check
- }
-
- // try to ask the node itself
- else if (m_xNode.is())
- {
- bResult = m_bReadOnly = isNodeReadOnly( m_xNode );
- }
-
- // else use the parent
- else if (m_xParentNode.is())
- {
- com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo > xParentInfo = implGetParentPropertyInfo();
-
- if (xParentInfo.is())
- {
- com::sun::star::beans::Property aProperty = xParentInfo->getPropertyByName(m_sLocalName);
-
- bResult = m_bReadOnly = ((aProperty.Attributes & com::sun::star::beans::PropertyAttribute::READONLY) != 0);
- }
- else
- {
- // no property info about this key ? - check if the parent itself is writable
-
- // NOTE: do not set m_bReadOnly here, as we haven't really found out about this object
- bResult = isNodeReadOnly( m_xParentNode );
- }
- }
- else
- {
- // no data at all
- OSL_ENSURE(false, "implIsReadOnly called for invalid object");
- bResult = true; // no object is certainly not writable ;-)
- }
-
- return bResult;
-}
-//--------------------------------------------------------------------------
-
-sal_Bool OConfigurationRegistryKey::implEnsureNode() throw (com::sun::star::registry::InvalidRegistryException,com::sun::star::uno::RuntimeException)
-{
- if (!m_xNode.is())
- {
- OSL_ENSURE( m_xParentNode.is(), "implEnsureNode called for invalid registry key");
- if (m_xParentNode.is())
- {
- try
- {
- com::sun::star::uno::Any aNode = m_xParentNode->getByName( m_sLocalName );
-
- if ( !(aNode >>= m_xNode) )
- OSL_ENSURE( ! (aNode.hasValue() && aNode.getValueTypeClass() == com::sun::star::uno::TypeClass_INTERFACE),
- "OConfigurationRegistryKey: Node object does not implement expected interface");
- }
- catch (com::sun::star::container::NoSuchElementException& e)
- {
- m_xParentNode.clear();
-
- rtl::OUString sMessage = UNISTRING("Invalid OConfigurationRegistryKey. The node \"");
- sMessage += m_sLocalName;
- sMessage += UNISTRING("\" was not found in the parent. Parent error message: \n");
- sMessage += e.Message;
-
- throw com::sun::star::registry::InvalidRegistryException(sMessage, THISREF());
- }
- }
- }
- return m_xNode.is();
-}
-//--------------------------------------------------------------------------
-
-com::sun::star::uno::Type OConfigurationRegistryKey::implGetUnoType() throw (com::sun::star::uno::RuntimeException)
-{
- com::sun::star::uno::Type aType;
- if (m_xNode.is())
- {
- aType = getCppuType(&m_xNode); // Its just an interface type
- }
- else if (m_xParentNode.is())
- {
-
- com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo > xParentInfo = implGetParentPropertyInfo();
- if (xParentInfo.is())
- {
- aType = xParentInfo->getPropertyByName( m_sLocalName ).Type;
- }
- else
- {
- aType = m_xParentNode->getElementType();
- }
- }
- else
- {
- OSL_ASSERT( aType.getTypeClass() == com::sun::star::uno::TypeClass_VOID );
- OSL_ENSURE( false, "implGetUnoType called for invalid registry key");
- }
- return aType;
-}
-//--------------------------------------------------------------------------
-
-sal_Bool OConfigurationRegistryKey::implEnsureValue() throw (com::sun::star::uno::RuntimeException)
-{
- if (m_xNode.is())
- return false;
-
- OSL_ENSURE( m_xParentNode.is(), "implEnsureValue called for invalid registry key");
- if (!m_xParentNode.is())
- return false;
-
- switch (implGetUnoType().getTypeClass())
- {
- case com::sun::star::uno::TypeClass_INTERFACE:
- return false;
-
- case com::sun::star::uno::TypeClass_BYTE:
- case com::sun::star::uno::TypeClass_UNSIGNED_SHORT:
- case com::sun::star::uno::TypeClass_UNSIGNED_LONG:
- case com::sun::star::uno::TypeClass_UNSIGNED_HYPER:
- case com::sun::star::uno::TypeClass_FLOAT:
- OSL_ENSURE(false, "Unexpected (UNSIGNED INTERGRAL or FLOAT) type found for configuration node");
-
- case com::sun::star::uno::TypeClass_STRING:
- case com::sun::star::uno::TypeClass_BOOLEAN:
- case com::sun::star::uno::TypeClass_SHORT:
- case com::sun::star::uno::TypeClass_LONG:
- case com::sun::star::uno::TypeClass_HYPER:
- case com::sun::star::uno::TypeClass_DOUBLE:
- case com::sun::star::uno::TypeClass_SEQUENCE:
- return true;
-
- case com::sun::star::uno::TypeClass_ANY:
- return true;
-
- case com::sun::star::uno::TypeClass_VOID:
- OSL_ENSURE(false, "OConfigurationRegistryKey: Key does not exist or has VOID type");
- return false;
-
- default:
- OSL_ENSURE(false, "OConfigurationRegistryKey: Key has unexpected UNO type (class)");
- return false;
- }
-}
-//--------------------------------------------------------------------------
-
-sal_Bool OConfigurationRegistryKey::implIsValid() throw ()
-{
- return m_xNode.is() || (m_xParentNode.is() && m_xParentNode->hasByName( m_sLocalName ) );
-}
-//--------------------------------------------------------------------------
-
-void OConfigurationRegistryKey::checkValid(KEY_ACCESS_TYPE _eIntentedAccess) throw (com::sun::star::registry::InvalidRegistryException,com::sun::star::uno::RuntimeException)
-{
- if (!implIsValid())
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("The registry is not bound to a configuration node anymore."), THISREF());
- // "anymore", because at the moment the ctor was called it probably was bound ....
-
- switch (_eIntentedAccess)
- {
- case KAT_VALUE_WRITE:
- if (implIsReadOnly())
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("This configuration node is not writeable."), THISREF());
-
- // !!! NO !!! BREAK !!!
- case KAT_VALUE:
- if (m_xNode.is())
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("This configuration node is not a value, but an internal container."), THISREF());
-
- if (!m_xParentNode.is())
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("This configuration node is invalid. It has no parent."), THISREF());
-
- if (!implEnsureValue())
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("This configuration does not have a legal value type."), THISREF());
- break;
-
- case KAT_CHILD:
- if (!implEnsureNode())
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("This configuration node does not have children, it is a value node."), THISREF());
- break;
-
- case KAT_META:
- break;
- }
-}
-
-//--------------------------------------------------------------------------
-com::sun::star::uno::Any OConfigurationRegistryKey::implCreateDefaultElement(com::sun::star::uno::Type const& _aValueType) throw (com::sun::star::uno::RuntimeException)
-{
- com::sun::star::uno::Any aReturn;
-
- switch (_aValueType.getTypeClass())
- {
- case com::sun::star::uno::TypeClass_STRING:
- aReturn <<= rtl::OUString();
- break;
-
- // we don't distinguish between the different integer types or boolean
- // (the RegistryKeyType is not granular enough),
- // but we can't handle them all the same way here
- case com::sun::star::uno::TypeClass_BYTE:
- case com::sun::star::uno::TypeClass_UNSIGNED_SHORT:
- case com::sun::star::uno::TypeClass_SHORT:
- aReturn <<= (sal_Int16)0;
- break;
-
- case com::sun::star::uno::TypeClass_UNSIGNED_LONG:
- case com::sun::star::uno::TypeClass_LONG:
- aReturn <<= (sal_Int32)0;
- break;
-
- case com::sun::star::uno::TypeClass_BOOLEAN:
- aReturn <<= sal_Bool(false);
- break;
-
- // we cannot really handle 64-bit ints in the registry (but here we can)
- case com::sun::star::uno::TypeClass_UNSIGNED_HYPER:
- case com::sun::star::uno::TypeClass_HYPER:
- OSL_ENSURE(false, "Warning: cannot handle 64-bit values correctly in registry");
- aReturn <<= (sal_Int64)0;
- break;
-
- // we cannot really handle doubles in the registry (but here we can)
- case com::sun::star::uno::TypeClass_FLOAT:
- case com::sun::star::uno::TypeClass_DOUBLE:
- OSL_ENSURE(false, "Warning: cannot handle DOUBLE correctly in registry");
- aReturn <<= (double)0;
- break;
-
- // we really want to leave an Any as NULL - hopefully this is acceptable to the set
- case com::sun::star::uno::TypeClass_ANY:
- break;
-
- case com::sun::star::uno::TypeClass_SEQUENCE:
- if (_aValueType == getBinaryDataType())
- aReturn <<= com::sun::star::uno::Sequence< sal_Int8 >();
-
- else
- {
- com::sun::star::uno::Type aElementType = getSequenceElementType(_aValueType);
- switch (aElementType.getTypeClass())
- {
- case com::sun::star::uno::TypeClass_STRING:
- aReturn <<= com::sun::star::uno::Sequence< rtl::OUString >();
- break;
-
- case com::sun::star::uno::TypeClass_BYTE:
- case com::sun::star::uno::TypeClass_UNSIGNED_SHORT:
- case com::sun::star::uno::TypeClass_SHORT:
- aReturn <<= com::sun::star::uno::Sequence< sal_Int16 >();
- break;
-
- case com::sun::star::uno::TypeClass_UNSIGNED_LONG:
- case com::sun::star::uno::TypeClass_LONG:
- aReturn <<= com::sun::star::uno::Sequence< sal_Int32 >();
- break;
-
- case com::sun::star::uno::TypeClass_BOOLEAN:
- aReturn <<= com::sun::star::uno::Sequence< sal_Bool >();
- break;
-
- case com::sun::star::uno::TypeClass_UNSIGNED_HYPER:
- case com::sun::star::uno::TypeClass_HYPER:
- aReturn <<= com::sun::star::uno::Sequence< sal_Int64 >();
- break;
-
- case com::sun::star::uno::TypeClass_FLOAT:
- case com::sun::star::uno::TypeClass_DOUBLE:
- aReturn <<= com::sun::star::uno::Sequence< double >();
- break;
-
- case com::sun::star::uno::TypeClass_SEQUENCE:
- OSL_ENSURE(false, "Warning: cannot handle Sequence< BINARY > correctly in registry");
- if (aElementType == getBinaryDataType())
- {
- OSL_ENSURE(false, "Warning: cannot handle Sequence< BINARY > correctly in registry");
- aReturn <<= com::sun::star::uno::Sequence< com::sun::star::uno::Sequence< sal_Int8 > >();
- break;
- }
-
- // else FALL THRU to default
- default:
- OSL_ENSURE(false, "Unexpected sequence element type for configuration node - returning NULL");
- // throw here ??
- break;
- }
- }
- break;
-
- case com::sun::star::uno::TypeClass_INTERFACE:
- OSL_ENSURE(false, "Invalid call to OConfigurationRegistryKey::implCreateDefaultElement. Inner nodes must be created by a factory");
- break;
-
- default:
- OSL_ENSURE(false, "Unexpected value type for configuration node - returning NULL");
- // throw here ??
- break;
- }
-
- OSL_ENSURE( aReturn.getValueType() == _aValueType || (_aValueType.getTypeClass() == com::sun::star::uno::TypeClass_ANY && !aReturn.hasValue()),
- "Warning: Unexpected data type found in Registry - returning similar value or NULL");
- return aReturn;
-}
-
-//--------------------------------------------------------------------------
-com::sun::star::uno::Any OConfigurationRegistryKey::implGetDescendant(const rtl::OUString& _rDescendantName) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- com::sun::star::uno::Any aElementReturn;
-
- try
- {
- if (!m_xNode.is())
- {
- // implEnsureNode should have been called before this method
- OSL_ENSURE(sal_False, "OConfigurationRegistryKey::getDescendant : invalid call !");
-
- // this method should not be called if the object does not represent a container node ...
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("invalid object."), THISREF());
- }
-
- try
- {
- // look for a local member first
- aElementReturn = m_xNode->getByName(_rDescendantName);
- }
- catch(com::sun::star::container::NoSuchElementException&)
- {
- // is it a (possibly) hierarchical name ?
- if ( _rDescendantName.indexOf('/') <0 ) throw;
-
- // Yes, so try deep access
- com::sun::star::uno::Reference< com::sun::star::container::XHierarchicalNameAccess > xDeepAccess( m_xNode, com::sun::star::uno::UNO_QUERY );
- if (!xDeepAccess.is())
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("Nested element access not supported by this node."), THISREF());
-
- aElementReturn = xDeepAccess->getByHierarchicalName(_rDescendantName);
- }
- }
- catch(com::sun::star::container::NoSuchElementException&)
- { // not allowed to leave the method, wrap it
- rtl::OUString sMessage(UNISTRING("There is no element named "));
- sMessage += _rDescendantName;
- sMessage += UNISTRING(".");
- throw com::sun::star::registry::InvalidRegistryException(sMessage, THISREF());
- }
- catch(com::sun::star::lang::WrappedTargetException& wte)
- { // allowed to be thrown by XNameAccess::getByName, but not allowed to leave this method
- rtl::OUString sMessage(UNISTRING("The configuration node could not provide an element for "));
- sMessage += _rDescendantName;
- sMessage += UNISTRING(". Original Error: ");
- sMessage += wte.Message;
- throw com::sun::star::registry::InvalidRegistryException(sMessage, THISREF());
- }
-
- return aElementReturn;
-}
-
-//--------------------------------------------------------------------------
-void OConfigurationRegistryKey::implSetValue(const com::sun::star::uno::Any& _rValue) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- checkValid(KAT_VALUE_WRITE);
-
- // one possible interface
- com::sun::star::uno::Reference< com::sun::star::container::XNameReplace > xParentValueAccess(m_xParentNode, com::sun::star::uno::UNO_QUERY);
- if (xParentValueAccess.is())
- {
- try
- {
- xParentValueAccess->replaceByName(m_sLocalName, _rValue);
- }
- catch(com::sun::star::lang::IllegalArgumentException& iae)
- {
- rtl::OUString sMessage = UNISTRING("Unable to replace the old value. The configuration node threw an ");
- sMessage += UNISTRING("IllegalArgumentException: ");
- sMessage += iae.Message;
- throw com::sun::star::registry::InvalidRegistryException(sMessage, THISREF());
- }
- catch(com::sun::star::container::NoSuchElementException& nse)
- {
- OSL_ENSURE(false, "OConfigurationRegistryKey::writeValueNode : a NoSuchElementException should be impossible !");
-
- rtl::OUString sMessage = UNISTRING("Unable to replace the old value. The configuration node threw an ");
- sMessage += UNISTRING("NoSuchElementException: ");
- sMessage += nse.Message;
- throw com::sun::star::registry::InvalidRegistryException(sMessage, THISREF());
- }
- catch(com::sun::star::lang::WrappedTargetException& wte)
- {
- rtl::OUString sMessage = UNISTRING("Unable to replace the old value. The configuration node threw an ");
- sMessage += UNISTRING("WrappedTargetException: ");
- sMessage += wte.Message;
- throw com::sun::star::registry::InvalidRegistryException(sMessage, THISREF());
- }
- return;
- }
-
- // not found - try other interface
- com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xParentPropertySet(m_xParentNode, com::sun::star::uno::UNO_QUERY);
- if (xParentPropertySet.is())
- {
- try
- {
- xParentPropertySet->setPropertyValue(m_sLocalName, _rValue);
- }
- catch(com::sun::star::lang::IllegalArgumentException& iae)
- {
- rtl::OUString sMessage = UNISTRING("Unable to set a new value. The configuration node threw an ");
- sMessage += UNISTRING("IllegalArgumentException: ");
- sMessage += iae.Message;
- throw com::sun::star::registry::InvalidRegistryException(sMessage, THISREF());
- }
- catch(com::sun::star::beans::UnknownPropertyException& upe)
- {
- OSL_ENSURE(false, "OConfigurationRegistryKey::writeValueNode : a UnknownPropertyException should be impossible !");
-
- rtl::OUString sMessage = UNISTRING("Unable to set a new value. The configuration node threw an ");
- sMessage += UNISTRING("UnknownPropertyException: ");
- sMessage += upe.Message;
- throw com::sun::star::registry::InvalidRegistryException(sMessage, THISREF());
- }
- catch(com::sun::star::beans::PropertyVetoException& pve)
- {
- rtl::OUString sMessage = UNISTRING("Unable to set a new value. The configuration node threw an ");
- sMessage += UNISTRING("PropertyVetoException: ");
- sMessage += pve.Message;
- throw com::sun::star::registry::InvalidRegistryException(sMessage, THISREF());
- }
- catch(com::sun::star::lang::WrappedTargetException& wte)
- {
- rtl::OUString sMessage = UNISTRING("Unable to set a new value. The configuration node threw an ");
- sMessage += UNISTRING("WrappedTargetException: ");
- sMessage += wte.Message;
- throw com::sun::star::registry::InvalidRegistryException(sMessage, THISREF());
- }
- return;
- }
-
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("No interface found on parent node for writing to configuration value node."), THISREF());
-}
-
-//--------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OConfigurationRegistryKey::getKeyName() throw(com::sun::star::uno::RuntimeException)
-{
- return m_sLocalName;
-}
-
-//--------------------------------------------------------------------------
-sal_Bool SAL_CALL OConfigurationRegistryKey::isReadOnly() throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- OSL_ASSERT(UnoApiLock::isHeld());
- checkValid(KAT_META);
- return m_bReadOnly;
-}
-
-//--------------------------------------------------------------------------
-sal_Bool SAL_CALL OConfigurationRegistryKey::isValid() throw(com::sun::star::uno::RuntimeException)
-{
- OSL_ASSERT(UnoApiLock::isHeld());
- // TODO : perhaps if the registry we're a part of is closed ....
- return implIsValid();
-}
-
-//--------------------------------------------------------------------------
-com::sun::star::registry::RegistryKeyType SAL_CALL OConfigurationRegistryKey::getKeyType( const ::rtl::OUString& /*_rKeyName*/ ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- OSL_ASSERT(UnoApiLock::isHeld());
-
- // no further checks are made (for performance reasons) ...
- // Maybe we should check only KAT_META for consistency ?
- checkValid(KAT_CHILD);
-
- return com::sun::star::registry::RegistryKeyType_KEY;
-}
-
-//--------------------------------------------------------------------------
-com::sun::star::registry::RegistryValueType SAL_CALL OConfigurationRegistryKey::getValueType() throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- checkValid(KAT_META);
-
- const com::sun::star::uno::Type aUnoType = implGetUnoType();
-
- switch (aUnoType.getTypeClass())
- {
- case com::sun::star::uno::TypeClass_INTERFACE: // this is really a case of 'no value type'
- return com::sun::star::registry::RegistryValueType_NOT_DEFINED;
-
- case com::sun::star::uno::TypeClass_ANY: // this is really a case of 'all value types allowed'
- return com::sun::star::registry::RegistryValueType_NOT_DEFINED;
-
- case com::sun::star::uno::TypeClass_STRING:
- return com::sun::star::registry::RegistryValueType_STRING;
-
- case com::sun::star::uno::TypeClass_BYTE:
- case com::sun::star::uno::TypeClass_UNSIGNED_SHORT:
- case com::sun::star::uno::TypeClass_UNSIGNED_LONG:
- OSL_ENSURE(false, "Unexpected UNSIGNED type found for configuration node");
- // FALL THRU
-
- case com::sun::star::uno::TypeClass_BOOLEAN:
- case com::sun::star::uno::TypeClass_SHORT:
- case com::sun::star::uno::TypeClass_LONG:
- return com::sun::star::registry::RegistryValueType_LONG;
-
- case com::sun::star::uno::TypeClass_FLOAT:
- case com::sun::star::uno::TypeClass_DOUBLE:
- OSL_ENSURE(sal_False, "OConfigurationRegistryKey::getValueType : registry does not support floating point numbers !");
- return com::sun::star::registry::RegistryValueType_LONG;
-
- case com::sun::star::uno::TypeClass_UNSIGNED_HYPER:
- case com::sun::star::uno::TypeClass_HYPER:
- OSL_ENSURE(sal_False, "OConfigurationRegistryKey::getValueType : registry does not support 64-bit integer numbers !");
- return com::sun::star::registry::RegistryValueType_LONG;
-
- case com::sun::star::uno::TypeClass_SEQUENCE:
- if ( aUnoType.equals( getBinaryDataType() ) )
- return com::sun::star::registry::RegistryValueType_BINARY;
-
- else
- {
- com::sun::star::uno::Type aElementType = getSequenceElementType(aUnoType);
-
- switch (aElementType.getTypeClass())
- {
- case com::sun::star::uno::TypeClass_STRING:
- return com::sun::star::registry::RegistryValueType_STRINGLIST;
-
- case com::sun::star::uno::TypeClass_BYTE:
- OSL_ASSERT(false); // this is caught by the 'binary' case
-
- case com::sun::star::uno::TypeClass_UNSIGNED_SHORT:
- case com::sun::star::uno::TypeClass_UNSIGNED_LONG:
- OSL_ENSURE(false, "Unexpected UNSIGNED-List type found for configuration node");
- // FALL THRU
-
- case com::sun::star::uno::TypeClass_BOOLEAN:
- case com::sun::star::uno::TypeClass_SHORT:
- case com::sun::star::uno::TypeClass_LONG:
- return com::sun::star::registry::RegistryValueType_LONGLIST;
-
- case com::sun::star::uno::TypeClass_FLOAT:
- case com::sun::star::uno::TypeClass_DOUBLE:
- OSL_ENSURE(sal_False, "OConfigurationRegistryKey::getValueType : registry does not support floating point number lists !");
- return com::sun::star::registry::RegistryValueType_LONGLIST;
-
- case com::sun::star::uno::TypeClass_UNSIGNED_HYPER:
- case com::sun::star::uno::TypeClass_HYPER:
- OSL_ENSURE(sal_False, "OConfigurationRegistryKey::getValueType : registry does not support 64-bit integer number lists !");
- return com::sun::star::registry::RegistryValueType_LONGLIST;
-
- case com::sun::star::uno::TypeClass_ANY:
- OSL_ENSURE(sal_False, "OConfigurationRegistryKey::getValueType : Unexpected: Any as sequence element type !");
- return com::sun::star::registry::RegistryValueType_NOT_DEFINED;
-
- default:
- if (aElementType.equals(getBinaryDataType()))
- OSL_ENSURE(sal_False,"OConfigurationRegistryKey::getValueType : Registry cannot support LIST of BINARY");
- else
- OSL_ENSURE(sal_False, "OConfigurationRegistryKey::getValueType : unknown sequence element type !");
-
- return com::sun::star::registry::RegistryValueType_NOT_DEFINED;
- }
- }
-
- default:
- OSL_ENSURE(sal_False, "OConfigurationRegistryKey::getValueType : unknown entry type !");
- return com::sun::star::registry::RegistryValueType_NOT_DEFINED;
- }
-}
-
-//--------------------------------------------------------------------------
-
-com::sun::star::uno::Any OConfigurationRegistryKey::implGetValue() throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- checkValid(KAT_VALUE);
-
- return m_xParentNode->getByName( m_sLocalName );
-}
-
-//--------------------------------------------------------------------------
-sal_Int32 SAL_CALL OConfigurationRegistryKey::getLongValue() throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::registry::InvalidValueException, com::sun::star::uno::RuntimeException)
-{
- com::sun::star::uno::Any aValue = implGetValue();
-
- sal_Int32 nLongValue(0);
- switch (aValue.getValueTypeClass())
- {
- // integral types that are small enough are straightforward
- case com::sun::star::uno::TypeClass_BYTE : { sal_Int8 nNativeValue = 0; aValue >>= nNativeValue; nLongValue = nNativeValue; } break;
- case com::sun::star::uno::TypeClass_BOOLEAN : { sal_Bool nNativeValue = false; aValue >>= nNativeValue; nLongValue = nNativeValue; } break;
- case com::sun::star::uno::TypeClass_SHORT : { sal_Int16 nNativeValue; aValue >>= nNativeValue; nLongValue = nNativeValue; } break;
- case com::sun::star::uno::TypeClass_UNSIGNED_SHORT : { sal_uInt16 nNativeValue; aValue >>= nNativeValue; nLongValue = nNativeValue; } break;
- case com::sun::star::uno::TypeClass_LONG : { sal_Int32 nNativeValue; aValue >>= nNativeValue; nLongValue = nNativeValue; } break;
-
- // this is lossless, but not value-preserving - use cast to avoid warnings
- case com::sun::star::uno::TypeClass_UNSIGNED_LONG:
- {
- sal_uInt32 nNativeValue;
- aValue >>= nNativeValue;
- nLongValue = sal_Int32(nNativeValue);
- }
- break;
-
- // the following are larger than Long - check for loss and throw if applicable
- case com::sun::star::uno::TypeClass_HYPER:
- {
- sal_Int64 nNativeValue;
- aValue >>= nNativeValue;
- nLongValue = sal_Int32(nNativeValue);
-
- // check for data loss
- if (sal_Int64(nLongValue) != nNativeValue)
- throw com::sun::star::registry::InvalidValueException(UNISTRING("Unsigned Hyper value too large for long; Value cannot be retrieved using registry."), THISREF());
- }
- break;
-
- case com::sun::star::uno::TypeClass_UNSIGNED_HYPER:
- {
- sal_uInt64 nNativeValue;
- aValue >>= nNativeValue;
- nLongValue = sal_Int32(nNativeValue);
-
- // check for data loss
- if (sal_uInt64(sal_uInt32(nLongValue)) != nNativeValue)
- throw com::sun::star::registry::InvalidValueException(UNISTRING("Unsigned Hyper value too large for long; Value cannot be retrieved using registry."), THISREF());
- }
- break;
-
- // for floating point types we need a limit for loss checking
- case com::sun::star::uno::TypeClass_FLOAT:
- OSL_ENSURE(false, "Unexpected type FLOAT in configuration node");
- {
- // treat as double
- float fNativeValue = 0;
- if (aValue >>= fNativeValue)
- aValue <<= double(fNativeValue);
- }
- // fall thru
-
- case com::sun::star::uno::TypeClass_DOUBLE:
- {
- double fNativeValue = 0;
- aValue >>= fNativeValue;
-
- // find a reasonable allowed imprecision
- const double fEps = (2.*fNativeValue + 5.) * std::numeric_limits<double>::epsilon();
-
- // should be rounding here
- nLongValue = sal_Int32(fNativeValue);
-
- // check for data loss
- bool bRecheck = false;
-
- double diff = fNativeValue-double(nLongValue);
- if ( diff > fEps)
- {
- // substitute for rounding here
- if (diff > .5)
- {
- ++nLongValue;
- diff = fNativeValue-double(nLongValue);
- }
- bRecheck = true;
- }
- else if ( diff < -fEps)
- {
- // substitute for rounding here
- if (diff < -.5)
- {
- --nLongValue;
- diff = fNativeValue-double(nLongValue);
- }
- bRecheck = true;
- }
-
- if (bRecheck)
- {
- if (diff > fEps || diff < -fEps)
- throw com::sun::star::registry::InvalidValueException(UNISTRING("Double value cannot fit in Long; Value cannot be retrieved using registry."), THISREF());
- }
- }
- break;
-
- case com::sun::star::uno::TypeClass_VOID:
- // allow NULL values, if we maybe advertise this node as long
- if (this->getValueType() == com::sun::star::registry::RegistryValueType_LONG)
- break;
- // else FALL THRU to exception
-
- default:
- throw com::sun::star::registry::InvalidValueException(UNISTRING("This node does not contain a long (or a compatible) value."), THISREF());
- }
- return nLongValue;
-}
-
-//--------------------------------------------------------------------------
-void SAL_CALL OConfigurationRegistryKey::setLongValue( sal_Int32 _nValue ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- implSetValue(com::sun::star::uno::makeAny(_nValue));
-}
-
-//--------------------------------------------------------------------------
-com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL OConfigurationRegistryKey::getLongListValue() throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::registry::InvalidValueException, com::sun::star::uno::RuntimeException)
-{
- com::sun::star::uno::Any aValue = implGetValue();
-
- com::sun::star::uno::Sequence< sal_Int32 > aReturn;
- if (!aValue.hasValue())
- checkNullable();// let NULL values pass
-
- else if (!(aValue >>= aReturn))
- {
- // TODO : maybe it's a sequence of sal_Int8 or anything like that which we're able to convert ....
-
- throw com::sun::star::registry::InvalidValueException(UNISTRING("This configuration node does not contain a list of longs !"), THISREF());
- }
-
- return aReturn;
-}
-
-//--------------------------------------------------------------------------
-void SAL_CALL OConfigurationRegistryKey::setLongListValue( const com::sun::star::uno::Sequence< sal_Int32 >& _seqValue ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- implSetValue(com::sun::star::uno::makeAny(_seqValue));
-}
-
-//--------------------------------------------------------------------------
-rtl::OUString SAL_CALL OConfigurationRegistryKey::getAsciiValue() throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::registry::InvalidValueException, com::sun::star::uno::RuntimeException)
-{
- rtl::OUString sReturn = getStringValue();
-
- if (!isAscii(sReturn))
- throw com::sun::star::registry::InvalidValueException(UNISTRING("This configuration node value (a string) is not pure ASCII !"), THISREF());
-
- return sReturn;
-}
-
-//--------------------------------------------------------------------------
-void SAL_CALL OConfigurationRegistryKey::setAsciiValue( const ::rtl::OUString& _rValue ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- OSL_ENSURE( isAscii(_rValue), "The string passesd to OConfigurationRegistryKey::setAsciiValue is not pure ASCII");
-
- setStringValue(_rValue);
-}
-
-//--------------------------------------------------------------------------
-com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL OConfigurationRegistryKey::getAsciiListValue() throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::registry::InvalidValueException, com::sun::star::uno::RuntimeException)
-{
- com::sun::star::uno::Sequence<rtl::OUString> aReturn = getStringListValue();
-
- if (!isAscii(aReturn))
- throw com::sun::star::registry::InvalidValueException(UNISTRING("This configuration node value (a string list) is not pure ASCII !"), THISREF());
-
- return aReturn;
-}
-
-//--------------------------------------------------------------------------
-void SAL_CALL OConfigurationRegistryKey::setAsciiListValue( const com::sun::star::uno::Sequence< ::rtl::OUString >& _seqValue ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- OSL_ENSURE( isAscii(_seqValue), "The string passesd to OConfigurationRegistryKey::setAsciiValue is not pure ASCII");
-
- setStringListValue(_seqValue);
-}
-
-//--------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OConfigurationRegistryKey::getStringValue() throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::registry::InvalidValueException, com::sun::star::uno::RuntimeException)
-{
- com::sun::star::uno::Any aValue = implGetValue();
-
- rtl::OUString sReturn;
- if (!aValue.hasValue())
- checkNullable();// let NULL values pass
-
- else if (!(aValue >>= sReturn))
- throw com::sun::star::registry::InvalidValueException(UNISTRING("This node does not contain a string value."), THISREF());
-
- return sReturn;
-}
-
-//--------------------------------------------------------------------------
-void SAL_CALL OConfigurationRegistryKey::setStringValue( const ::rtl::OUString& _rValue ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- implSetValue(com::sun::star::uno::makeAny(_rValue));
-}
-
-//--------------------------------------------------------------------------
-com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL OConfigurationRegistryKey::getStringListValue() throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::registry::InvalidValueException, com::sun::star::uno::RuntimeException)
-{
- com::sun::star::uno::Any aValue = implGetValue();
-
- com::sun::star::uno::Sequence< rtl::OUString > aReturn;
- if (!aValue.hasValue())
- checkNullable();// let NULL values pass
-
- else if (!(aValue >>= aReturn))
- throw com::sun::star::registry::InvalidValueException(UNISTRING("This configuration node does not contain a list of strings !"), THISREF());
-
- return aReturn;
-}
-
-//--------------------------------------------------------------------------
-void SAL_CALL OConfigurationRegistryKey::setStringListValue( const com::sun::star::uno::Sequence< ::rtl::OUString >& _seqValue ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- implSetValue(com::sun::star::uno::makeAny(_seqValue));
-}
-
-//--------------------------------------------------------------------------
-com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL OConfigurationRegistryKey::getBinaryValue() throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::registry::InvalidValueException, com::sun::star::uno::RuntimeException)
-{
- com::sun::star::uno::Any aValue = implGetValue();
-
- com::sun::star::uno::Sequence< sal_Int8 > aReturn;
- if (!aValue.hasValue())
- checkNullable();// let NULL values pass
-
- else if (!(aValue >>= aReturn))
- return aReturn;
-
- throw com::sun::star::registry::InvalidValueException(UNISTRING("This configuration node does not contain a list of strings !"), THISREF());
-}
-
-//--------------------------------------------------------------------------
-void SAL_CALL OConfigurationRegistryKey::setBinaryValue( const com::sun::star::uno::Sequence< sal_Int8 >& _rValue ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- implSetValue(com::sun::star::uno::makeAny(_rValue));
-}
-
-//--------------------------------------------------------------------------
-com::sun::star::uno::Reference< com::sun::star::registry::XRegistryKey > OConfigurationRegistryKey::implGetKey( const ::rtl::OUString& _rKeyName )
- throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- com::sun::star::uno::Any aDescendant = implGetDescendant(_rKeyName);
- if (aDescendant.getValueType().getTypeClass() == com::sun::star::uno::TypeClass_INTERFACE)
- {
- com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > xNode;
- ::cppu::extractInterface(xNode, aDescendant);
- if (!xNode.is())
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("invalid descendant node. No XNameAccess found."), THISREF());
- return new OConfigurationRegistryKey(xNode, !m_bReadOnly);
- }
- else
- {
-#if OSL_DEBUG_LEVEL > 1
- switch (aDescendant.getValueType().getTypeClass())
- {
- case com::sun::star::uno::TypeClass_STRING:
- case com::sun::star::uno::TypeClass_SHORT:
- case com::sun::star::uno::TypeClass_UNSIGNED_SHORT:
- case com::sun::star::uno::TypeClass_BYTE:
- case com::sun::star::uno::TypeClass_LONG:
- case com::sun::star::uno::TypeClass_UNSIGNED_LONG:
- case com::sun::star::uno::TypeClass_BOOLEAN:
- case com::sun::star::uno::TypeClass_SEQUENCE:
- break;
- case com::sun::star::uno::TypeClass_VOID: // NULL value found
- break;
- default:
- OSL_ENSURE(sal_False, "OConfigurationRegistryKey::openKey : unknown, invalid or unhandled descendant value type !");
- }
-#endif
-
- OSL_ASSERT(m_xNode.is());
-
- com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > xDescParent(m_xNode); // the parent config node of the descandent
- rtl::OUString sDescRelativeName( _rKeyName ); // local name of the descendant within xDescParent
-
- if (!m_xNode->hasByName(_rKeyName)) // it is a hierarchical Path -> more work
- {
- rtl::OUString sParentLocation;
-
- if ( !splitPath(_rKeyName, sParentLocation, sDescRelativeName) )
- {
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("Cannot split path for value. The internal registry structure seems to be corrupt."), THISREF());
- }
-
- if (sParentLocation.getLength())
- {
- com::sun::star::uno::Any aDescParent = implGetDescendant(sParentLocation);
- ::cppu::extractInterface(xDescParent, aDescParent);
- if (!xDescParent.is())
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("The internal registry structure seems to be corrupt."), THISREF());
- }
- }
-
- OSL_ENSURE(xDescParent.is(), "No Parent Node found for value ?");
- OSL_ENSURE(xDescParent->hasByName(sDescRelativeName), "Parent Node does not contain found value ?");
-
- return new OConfigurationRegistryKey(aDescendant, xDescParent, sDescRelativeName, !m_bReadOnly);
- }
-}
-
-//--------------------------------------------------------------------------
-com::sun::star::uno::Reference< com::sun::star::registry::XRegistryKey > SAL_CALL OConfigurationRegistryKey::openKey( const ::rtl::OUString& _rKeyName ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- checkValid(KAT_CHILD);
-
- return implGetKey(_rKeyName);
-}
-//--------------------------------------------------------------------------
-bool OConfigurationRegistryKey::checkRelativeKeyName(rtl::OUString& _rKeyName) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- // no empty names allowed
- if (!_rKeyName.getLength())
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("The key name is invalid."), THISREF());
-
- bool bCleanPath = true;
-
- // cut trailing slashes
- sal_Int32 nCleanEnd = _rKeyName.getLength();
- while (nCleanEnd > 0 && _rKeyName[nCleanEnd - 1] == '/' )
- --nCleanEnd;
-
- if (m_xNode.is())
- {
- if (m_xNode-> hasByName(_rKeyName))
- {
- bCleanPath = false;
- }
-
- else
- {
- com::sun::star::uno::Reference< com::sun::star::util::XStringEscape > xSE(m_xNode, com::sun::star::uno::UNO_QUERY);
-
- sal_Bool bPreferLocal = xSE.is();
-
- if (!bPreferLocal)
- {
- com::sun::star::uno::Reference< com::sun::star::lang::XServiceInfo > xSI(m_xNode, com::sun::star::uno::UNO_QUERY);
- if (xSI.is() && xSI->supportsService(rtl::OUString::createFromAscii("com.sun.star.configuration.SetAccess")))
- bPreferLocal = true;
- }
-
- if (bPreferLocal)
- {
- com::sun::star::uno::Reference< com::sun::star::container::XHierarchicalNameAccess > xHA(m_xNode, com::sun::star::uno::UNO_QUERY);
- rtl::OUString sCleanName = _rKeyName.copy(0, nCleanEnd);
-
- if (xHA.is() && xHA->hasByHierarchicalName(sCleanName))
- bPreferLocal = false;
- }
-
- if (bPreferLocal && xSE.is())
- {
- _rKeyName = xSE->escapeString(_rKeyName);
- }
- bCleanPath = !bPreferLocal;
- }
- }
-
- if (bCleanPath)
- {
- // no absolute names ("/...") allowed
- if (_rKeyName.getStr()[0] == '/')
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("The key name is invalid. It must be a relative, not an absolute name."), THISREF());
-
- if (nCleanEnd <= 0)
- // the original name consists of slashes only
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("The key name is invalid."), THISREF());
-
-
- _rKeyName = _rKeyName.copy(0, nCleanEnd);
- }
- return bCleanPath;
-}
-
-//--------------------------------------------------------------------------
-com::sun::star::uno::Reference< com::sun::star::registry::XRegistryKey > SAL_CALL OConfigurationRegistryKey::createKey( const ::rtl::OUString& _rKeyName ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- checkValid(KAT_CHILD);
-
- if (m_bReadOnly)
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("The key is read only."), THISREF());
-
- OSL_ENSURE(m_xNode.is(), "OConfigurationRegistryKey::createKey : somebody changed the checkValid(KAT_CHILD) behaviour !");
-
- rtl::OUString sKeyName(_rKeyName);
- if (checkRelativeKeyName(sKeyName))
- {
- rtl::OUString sParentName, sLocalName;
-
- if (!splitPath(sKeyName,sParentName, sLocalName))
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("The key name is invalid."), THISREF());
-
- if (sParentName.getLength()) // it's a nested key name
- {
- // check if we have the key already
- com::sun::star::uno::Reference< com::sun::star::container::XHierarchicalNameAccess > xDeepAccess(m_xNode, com::sun::star::uno::UNO_QUERY);
- if (xDeepAccess.is() && xDeepAccess->hasByHierarchicalName(sKeyName))
- {
- // already there - just open it
- return implGetKey(sKeyName);
- }
-
- // deep access, but not found. delegate it to a registry key which is one level above the to-be-created one
- com::sun::star::uno::Reference< com::sun::star::registry::XRegistryKey > xSetNode = implGetKey(sParentName);
- if (!xSetNode.is())
- {
- OSL_ENSURE(sal_False, "OConfigurationRegistryKey::createKey : somebody changed the implGetKey behaviour !");
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("An internal error occured."), THISREF());
- }
- return xSetNode->createKey(sLocalName); // problem: request for a/['b/c'] might find a/b/c
- }
- else
- sKeyName = sLocalName;
- }
-
- // The requested new key is one level below ourself. Can't delegate the creation.
- if (m_xNode->hasByName(sKeyName) )
- {
- // already there - just open it
- return implGetKey(sKeyName);
- }
-
- com::sun::star::uno::Reference< com::sun::star::container::XNameContainer > xContainer(m_xNode, com::sun::star::uno::UNO_QUERY);
- if (!xContainer.is())
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("The configuration node represented by this key is not a set node, you can't insert keys."), THISREF());
-
- com::sun::star::uno::Any aValueToInsert;
-
- com::sun::star::uno::Reference< com::sun::star::lang::XSingleServiceFactory > xChildFactory(xContainer, com::sun::star::uno::UNO_QUERY);
- if (xChildFactory.is())
- {
- // In the configuration API, the creation of a new child is two-stage process : first you create a child which
- // is "floating", i.e. does not belong to the configuration tree, yet. After filling it with values, you insert
- // it into the container node which was used for the creation.
- // We can't map this behaviour with the registry API, so we have to combine both steps
-
- // create a new floating child for the container node
- try
- {
- com::sun::star::uno::Reference< com::sun::star::uno::XInterface > xFloatingChild = xChildFactory->createInstance();
- OSL_ENSURE( xFloatingChild.is(), "The newly created element is NULL !");
-
- com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > xInsertedChild(xFloatingChild, com::sun::star::uno::UNO_QUERY);
- OSL_ENSURE( xInsertedChild.is(), "The newly created element does not provide the required interface");
-
- if (!xInsertedChild.is())
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("An internal error occured. The objects provided by the configuration API are invalid."), THISREF());
-
- aValueToInsert <<= xInsertedChild; // xFloatingChild;
- }
- catch (com::sun::star::uno::RuntimeException&)
- { // allowed to leave this method
- throw;
- }
- catch (com::sun::star::uno::Exception& e)
- { // not allowed to leave this method
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("Unable to create a new child for the configuration node. Original error message as provided by the configuration API : ") += e.Message,
- THISREF());
- }
- OSL_ENSURE(aValueToInsert.hasValue(), "New Child node did not get into the Any ?");
- }
- else
- {
- // If the elements of the set are simple values, we need to create a matching value
- com::sun::star::uno::Type aElementType = xContainer->getElementType();
- aValueToInsert = implCreateDefaultElement(aElementType);
-
- OSL_ENSURE(aValueToInsert.hasValue() || aElementType.getTypeClass() == com::sun::star::uno::TypeClass_ANY, "Internal error: NULL value created for new value element ?");
- }
-
- // and immediately insert it into the container
- try
- {
- xContainer->insertByName(sKeyName, aValueToInsert);
- }
- catch (com::sun::star::lang::IllegalArgumentException& e)
- {
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("illegal argument to InsertByName: ") += e.Message, THISREF());
- }
- catch (com::sun::star::container::ElementExistException& e)
- {
- OSL_ENSURE(false, "There was an element of the same name inserted just now");
-
- // try to return that one
- try { return implGetKey(sKeyName); }
- catch (com::sun::star::uno::Exception&) { OSL_ENSURE(false, "But the other element cannot be retrieved"); }
-
-
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("Inserting raised a NoSuchElementException for an unavailable element ! Original error message : ") += e.Message, THISREF());
- }
- catch (com::sun::star::lang::WrappedTargetException& e)
- {
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("Inserting raised a WrappedTargetException. Original error message : ") += e.Message, THISREF());
- }
-
- return new OConfigurationRegistryKey(aValueToInsert, m_xNode, sKeyName, !m_bReadOnly);
-}
-
-//--------------------------------------------------------------------------
-void SAL_CALL OConfigurationRegistryKey::closeKey() throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- OSL_ASSERT(UnoApiLock::isHeld());
- checkValid(KAT_META);
-
- bool bRoot = (m_sLocalName.getLength() == 0);
-
- if (!bRoot) // don't close, if this is the root key ..
- {
- m_xNode.clear();
- m_xParentNode.clear();
-// m_sLocalName = rtl::OUString(); - local name is const ...
- }
-}
-
-//--------------------------------------------------------------------------
-void SAL_CALL OConfigurationRegistryKey::deleteKey( const rtl::OUString& _rKeyName ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- checkValid(KAT_CHILD);
- if (m_bReadOnly)
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("The key is read only."), THISREF());
-
- rtl::OUString sKeyName(_rKeyName);
- if (checkRelativeKeyName(sKeyName))
- {
- rtl::OUString sParentName, sLocalName;
-
- if (!splitPath(sKeyName,sParentName, sLocalName))
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("The key name is invalid."), THISREF());
-
- if (sParentName.getLength()) // it's a nested key name
- {
- com::sun::star::uno::Reference< com::sun::star::registry::XRegistryKey > xSetNode = implGetKey(sParentName);
- if (!xSetNode.is())
- {
- OSL_ENSURE(sal_False, "OConfigurationRegistryKey::createKey : somebody changed the implGetKey behaviour !");
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("An internal error occured."), THISREF());
- }
- xSetNode->deleteKey(sLocalName);
- return;
- }
- else
- sKeyName = sLocalName;
- }
-
- // The requested new key is one level below ourself. Can't delegate the creation.
- com::sun::star::uno::Reference< com::sun::star::container::XNameContainer > xContainer(m_xNode, com::sun::star::uno::UNO_QUERY);
- if (!xContainer.is())
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("The configuration node represented by this key is not a set node, you can't remove keys."), THISREF());
-
- // and immediately remove it from the container
- try
- {
- xContainer->removeByName(sKeyName);
- }
- catch (com::sun::star::container::NoSuchElementException& e)
- {
- if (e.Message.getLength())
- throw com::sun::star::registry::InvalidRegistryException(e.Message, THISREF());
- else
- throw com::sun::star::registry::InvalidRegistryException((UNISTRING("There is no element named ") += sKeyName) += UNISTRING(" to remove."), THISREF());
- }
- catch (com::sun::star::lang::WrappedTargetException& e)
- {
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("Removing a node caused a WrappedTargetException. Original error message : ") += e.Message, THISREF());
- }
-}
-
-//--------------------------------------------------------------------------
-com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::registry::XRegistryKey > > SAL_CALL OConfigurationRegistryKey::openKeys() throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- checkValid(KAT_CHILD);
-
- com::sun::star::uno::Sequence< ::rtl::OUString > aNames(m_xNode->getElementNames());
-
- sal_Int32 const nCount = aNames.getLength();
-
- com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::registry::XRegistryKey > > aReturn(nCount);
-
- for (sal_Int32 i=0; i<nCount; ++i)
- aReturn[i] = implGetKey(aNames[i]);
-
- return aReturn;
-}
-
-//--------------------------------------------------------------------------
-com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL OConfigurationRegistryKey::getKeyNames() throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- checkValid(KAT_CHILD);
- return m_xNode->getElementNames();
-}
-
-//--------------------------------------------------------------------------
-sal_Bool SAL_CALL OConfigurationRegistryKey::createLink( const ::rtl::OUString& /*aLinkName*/, const ::rtl::OUString& /*aLinkTarget*/ ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("This registry, which is base on a configuration tree, does not support links."), THISREF());
-}
-
-//--------------------------------------------------------------------------
-void SAL_CALL OConfigurationRegistryKey::deleteLink( const ::rtl::OUString& /*rLinkName*/ ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("This registry, which is base on a configuration tree, does not support links."), THISREF());
-}
-
-//--------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OConfigurationRegistryKey::getLinkTarget( const ::rtl::OUString& /*rLinkName*/ ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("This registry, which is base on a configuration tree, does not support links."), THISREF());
-}
-
-//--------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OConfigurationRegistryKey::getResolvedName( const ::rtl::OUString& /*aKeyName*/ ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("This registry, which is base on a configuration tree, does not support links."), THISREF());
-}
-//--------------------------------------------------------------------------
-//..........................................................................
-} // namespace configmgr
-//..........................................................................
-// split path
-#include "configpath.hxx"
-#include "configexcept.hxx"
-
-bool configmgr::splitPath(const rtl::OUString& _sPath, rtl::OUString& _rsParentPath, rtl::OUString& _rsLocalName)
-{
- bool bResult = false;
- try
- {
- bool bAbsolute = configmgr::configuration::Path::isAbsolutePath(_sPath);
- configmgr::configuration::Path::Rep aPath ;
-
- if (bAbsolute)
- {
- configmgr::configuration::AbsolutePath parsedPath = configmgr::configuration::AbsolutePath::parse(_sPath) ;
-
- aPath = parsedPath.rep() ;
- }
- else
- {
- configmgr::configuration::RelativePath parsedPath = configmgr::configuration::RelativePath::parse(_sPath) ;
-
- aPath = parsedPath.rep() ;
- }
- //configmgr::configuration::Path::Rep aPath = bAbsolute ? configmgr::configuration::AbsolutePath::parse(_sPath).rep() : configmgr::configuration::RelativePath::parse(_sPath).rep();
-
- OSL_ENSURE(!aPath.isEmpty(), "Trying to split an empty or root path");
- std::vector<configuration::Path::Component>::const_reverse_iterator aFirst = aPath.begin(), aLast = aPath.end();
-
- if (aFirst != aLast)
- {
- --aLast;
-
- _rsLocalName = aLast->getName();
- _rsParentPath = configmgr::configuration::Path::Rep(aFirst,aLast).toString(bAbsolute);
-
- bResult = true;
- }
- // else go on to fail
- }
- catch (configuration::Exception&)
- {
- }
- return bResult;
-}
-//..........................................................................
-
-
diff --git a/configmgr/source/registry/cfgregistrykey.hxx b/configmgr/source/registry/cfgregistrykey.hxx
deleted file mode 100644
index 093014764e..0000000000
--- a/configmgr/source/registry/cfgregistrykey.hxx
+++ /dev/null
@@ -1,244 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONFIGMGR_REGISTRY_CFGREGISTRYKEY_HXX_
-#define _CONFIGMGR_REGISTRY_CFGREGISTRYKEY_HXX_
-
-#include <cppuhelper/implbase1.hxx>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
-#include <com/sun/star/registry/XRegistryKey.hpp>
-#include <com/sun/star/beans/XPropertySetInfo.hpp>
-
-//..........................................................................
-namespace configmgr
-{
-//..........................................................................
-
-//==========================================================================
-//= OConfigurationRegistryKey
-//==========================================================================
-/** wraps the registry-like access to a single node of a configuration sub tree
-*/
-class OConfigurationRegistryKey
- :public cppu::WeakImplHelper1< com::sun::star::registry::XRegistryKey >
-{
- sal_Bool m_bReadOnly; /// is the key readonly ?
-
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >
- m_xNode; /// the config node object, if it is a container
-
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >
- m_xParentNode; /// if the key is not the root, this is it's parent.
-
- const ::rtl::OUString m_sLocalName; /** the name of the element relative to the parent, which is
- m_xParentNode if that is present
- */
-
- // TODO : the current concept does not recognize when config keys are disposed (e.g. when the registry is closed)
- //
- // Possible solutions:
- // 1. each registry key is a listener on the component containing its node
- // may be is expensive ?.
- //
- // At the moment we ignore this restriction, but perhaps we can't do that forever ....
-
-public:
- /// when used as ctor parameter, this indicates that the key wraps a config tree subtree root
- struct SubtreeRoot { };
-
- /** builds an registry key which wraps the root of a configuration registry
- */
- OConfigurationRegistryKey(
- const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxRootNode
- ,sal_Bool _bWriteable
- ,SubtreeRoot
- );
-
- /** builds an registry key for a configuration node
- @param _rxContainerNode the node the key should represent
- @param _bWriteable should the key be writeable ?
- */
- OConfigurationRegistryKey(
- const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxNode
- ,sal_Bool _bWriteable
- );
-
- /** builds an registry key for a configuration value container node.
- @param _rCurrentValue the current value of the node. Must be the same as _rxParentNode->getByName(_rRelativeName) would provide
- @param _rxParentNode the parent of the value node. Used for update access and for obtaining the initial value.
- @param _rRelativeName te relative name within the parent
- @param _bWriteable should the key be writeable ?
- */
- OConfigurationRegistryKey(
- ::com::sun::star::uno::Any _rCurrentValue
- ,const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxParentNode
- ,const ::rtl::OUString& _rRelativeName
- ,sal_Bool _bWriteable
- );
-
- // XRegistryKey
- virtual ::rtl::OUString SAL_CALL getKeyName() throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isReadOnly( ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isValid( ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::registry::RegistryKeyType SAL_CALL getKeyType( const ::rtl::OUString& rKeyName ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::registry::RegistryValueType SAL_CALL getValueType( ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getLongValue( ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::registry::InvalidValueException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setLongValue( sal_Int32 value ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL getLongListValue( ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::registry::InvalidValueException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setLongListValue( const ::com::sun::star::uno::Sequence< sal_Int32 >& seqValue ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getAsciiValue( ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::registry::InvalidValueException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setAsciiValue( const ::rtl::OUString& value ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAsciiListValue( ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::registry::InvalidValueException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setAsciiListValue( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& seqValue ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getStringValue( ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::registry::InvalidValueException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setStringValue( const ::rtl::OUString& value ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getStringListValue( ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::registry::InvalidValueException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setStringListValue( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& seqValue ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getBinaryValue( ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::registry::InvalidValueException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setBinaryValue( const ::com::sun::star::uno::Sequence< sal_Int8 >& value ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > SAL_CALL openKey( const ::rtl::OUString& aKeyName ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > SAL_CALL createKey( const ::rtl::OUString& aKeyName ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL closeKey( ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL deleteKey( const ::rtl::OUString& rKeyName ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > > SAL_CALL openKeys( ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getKeyNames( ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL createLink( const ::rtl::OUString& aLinkName, const ::rtl::OUString& aLinkTarget ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL deleteLink( const ::rtl::OUString& rLinkName ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getLinkTarget( const ::rtl::OUString& rLinkName ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getResolvedName( const ::rtl::OUString& aKeyName ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
-
-protected:
- /** specifies the kind of access to the key.
- */
- enum KEY_ACCESS_TYPE
- {
- KAT_META, /// access on a meta level, e.g. asking for the read-onyl flag
- KAT_VALUE, /// read access to the value the node represents
- KAT_VALUE_WRITE, /// write access to the value the node represents
- KAT_CHILD /// access to one of the (grand-)children of the node
- };
-
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
- implGetParentPropertyInfo()
- throw(::com::sun::star::uno::RuntimeException);
-
- sal_Bool implIsReadOnly()
- throw(::com::sun::star::uno::RuntimeException);
-
- sal_Bool implEnsureNode()
- throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
-
- ::com::sun::star::uno::Type implGetUnoType()
- throw(::com::sun::star::uno::RuntimeException);
-
- sal_Bool implEnsureValue()
- throw(::com::sun::star::uno::RuntimeException);
-
- sal_Bool implIsValid() throw ();
-
- /** check if the registry key is valid
- @param _eIntentedAccess type of access which the caller wants to perform on the object
- @throws <type scope="com.sun.star.registry">InvalidRegistryException</type> if the key is invalid
- */
- void checkValid(KEY_ACCESS_TYPE _eIntentedAccess)
- throw (::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
-
- /** return an child element.
- @param _rDescendantName the name of the descendant to open. May have a depth of more than 1, if
- the node container support XHierarchicalNameAccess
- @return the requested element. The caller can assume that the returned
- <type scope="com.sun.star.uno">Any</type> always contains an object, all other cases are
- handled with exceptions
- @throws <type scope="com.sun.star.registry">InvalidRegistryException</type> if the key is invalid,
- the element refered by _rName does not exist, the configuration node threw an exception, or
- the name has a depth of more than one and the config node does not support this.
- */
- ::com::sun::star::uno::Any
- implGetDescendant(const ::rtl::OUString& _rDescendantName)
- throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
-
- /** write the given value into the configuration node the object represents.
- @throws <type scope="com.sun.star.registry">InvalidRegistryException</type> if the key is invalid,
- not opened for write access or the configurations parent is not able to provide a value access
- @throws <type scope="com.sun.star.uno">RuntimeException</type> if a fatal runtime error occurs
- */
- void implSetValue(const ::com::sun::star::uno::Any& _rValue)
- throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
-
- ::com::sun::star::uno::Any implGetValue()
- throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
-
- /** open the sub key (depth 1 or more) determined by the given name
- @param _rKeyName the name of the descendant node
- @return a XRegistryKey wrapper for the requested configuration node
- @throws <type scope="com.sun.star.registry">InvalidRegistryException</type> if the key is invalid,
- the element refered by _rName does not exist, the configuration node threw an exception, or
- the name has a depth of more than one and the config node does not support this.
- */
- ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey >
- implGetKey( const ::rtl::OUString& _rKeyName )
- throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
-
- /** check the given (relative) key name syntactically.
-
- <p>In particular, this means that no checks are made if a node with the given name exists or something like
- that ...<br/>
- In addition, the given name will be normalized. Basically, this means that it does not contain trailing slashes.
- </p>
- @returns
- <TRUE/> if the name is a valid relative path
- <FALSE/> if the name is a local name only
- @throws InvalidRegistryException
- if the name is invalid or not relative (i.e. if it starts with an slash)
- */
- bool checkRelativeKeyName(::rtl::OUString& _rKeyName)
- throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
-
- /** get a default value for a value of a given type
-
- <p>Creates an Any with an empty or zero value of the given type.</p>
-
- @param _rType the type of the element to create
- @return
- an <type scope="com::sun::star::uno">Any</type> representing a default for the node value type. If the
- return value is still VOID, the node has a nullable type (e.g. any) or is of unsupported type
-
- */
- ::com::sun::star::uno::Any
- implCreateDefaultElement(::com::sun::star::uno::Type const& _rType)
- throw(::com::sun::star::uno::RuntimeException);
-};
-
-
-//..........................................................................
-} // namespace configmgr
-//..........................................................................
-
-#endif // _CONFIGMGR_REGISTRY_CFGREGISTRYKEY_HXX_
-
-
diff --git a/configmgr/source/registry/configregistry.cxx b/configmgr/source/registry/configregistry.cxx
deleted file mode 100644
index 4751b44da3..0000000000
--- a/configmgr/source/registry/configregistry.cxx
+++ /dev/null
@@ -1,376 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-
-#include "configregistry.hxx"
-#include "cfgregistrykey.hxx"
-#include "confapifactory.hxx"
-#include "datalock.hxx"
-#include "utility.hxx"
-#include <comphelper/sequence.hxx>
-#include <cppuhelper/typeprovider.hxx>
-#include <osl/diagnose.h>
-#include <com/sun/star/lang/ServiceNotRegisteredException.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-
-#define THISREF() static_cast< ::cppu::OWeakObject* >(this)
-#define UNISTRING(c) makeUniString(c)
-
-//..........................................................................
-namespace configmgr
-{
-//..........................................................................
-
-namespace beans = ::com::sun::star::beans;
-
-//==========================================================================
-//= OConfigurationRegistry
-//==========================================================================
- inline
- static
- rtl::OUString makeUniString(char const* c)
- {
- return rtl::OUString::createFromAscii(c);
- }
-
-
- // #99130# Don't export SimpleRegistry service
- static sal_Char const * const aExportedConfigRegistryServices[] =
- {
- "com.sun.star.configuration.ConfigurationRegistry",
- NULL
- };
- static sal_Char const * const aAdditionalConfigRegistryServices[] =
- {
- "com.sun.star.registry.SimpleRegistry",
- NULL
- };
-
- sal_Char const * const aConfigRegistryImplementationName = "com.sun.star.comp.configuration.OConfigurationRegistry";
-
- const ServiceImplementationInfo OConfigurationRegistry::s_aServiceInfo =
- {
- aConfigRegistryImplementationName,
- aExportedConfigRegistryServices,
- aAdditionalConfigRegistryServices
- };
-
- com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL instantiateConfigRegistry(uno::Reference< uno::XComponentContext > const& xContext )
- {
- OSL_ASSERT( xContext.is() );
- com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > xServiceManager( xContext->getServiceManager(), com::sun::star::uno::UNO_QUERY );
- ::cppu::OWeakObject * pNewInstance = new OConfigurationRegistry(xServiceManager);
- return pNewInstance;
- }
-
- const ServiceRegistrationInfo* getConfigurationRegistryServiceInfo()
- {
- return getRegistrationInfo(& OConfigurationRegistry::s_aServiceInfo);
- }
-
-//--------------------------------------------------------------------------
-OConfigurationRegistry::OConfigurationRegistry(const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& _rORB) throw(com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException)
- :ServiceComponentImpl(&s_aServiceInfo)
- ,m_xORB(_rORB)
-{
- // create the configuration provider used for accessing the configuration
- OSL_ENSURE(m_xORB.is(), "OConfigurationRegistry::OConfigurationRegistry : invalid service factory !");
- if (m_xORB.is())
- {
- m_xConfigurationProvider =
- m_xConfigurationProvider.query(
- m_xORB->createInstance(UNISTRING("com.sun.star.configuration.ConfigurationProvider"))
- );
- }
-
- if (!m_xConfigurationProvider.is())
- {
- // it's heavily needed ...
- throw com::sun::star::lang::ServiceNotRegisteredException(UNISTRING("Failed to instantiate the mandatory service com.sun.star.configuration.ConfigurationProvider."),
- THISREF());
- }
-}
-
-//--------------------------------------------------------------------------
-com::sun::star::uno::Any SAL_CALL OConfigurationRegistry::queryInterface( const com::sun::star::uno::Type& _rType ) throw(com::sun::star::uno::RuntimeException)
-{
- com::sun::star::uno::Any aReturn = ServiceComponentImpl::queryInterface(_rType);
- if (!aReturn.hasValue())
- aReturn = cppu::ImplHelper2< com::sun::star::registry::XSimpleRegistry, com::sun::star::util::XFlushable >::queryInterface(_rType);
- return aReturn;
-}
-
-//--------------------------------------------------------------------------
-com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL OConfigurationRegistry::getTypes( ) throw(com::sun::star::uno::RuntimeException)
-{
- return ::comphelper::concatSequences(
- ServiceComponentImpl::getTypes(),
- cppu::ImplHelper2< com::sun::star::registry::XSimpleRegistry, com::sun::star::util::XFlushable >::getTypes());
-}
-
-//--------------------------------------------------------------------------
-com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL OConfigurationRegistry::getImplementationId( ) throw(com::sun::star::uno::RuntimeException)
-{
- static cppu::OImplementationId aId;
- return aId.getImplementationId();
-}
-
-//--------------------------------------------------------------------------
-::rtl::OUString OConfigurationRegistry::getNodePathFromURL(const ::rtl::OUString& _rURL)
-{
- // TODO
- return _rURL;
-}
-
-//--------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OConfigurationRegistry::getURL() throw(com::sun::star::uno::RuntimeException)
-{
- UnoApiLock aLock;
- return m_sLocation;
-}
-
-//--------------------------------------------------------------------------
-
-// Not guarded !
-void OConfigurationRegistry::implCheckOpen() throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- if (!implIsOpen())
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("The registry is not bound to a configuration node."), THISREF());
-}
-
-//--------------------------------------------------------------------------
-void SAL_CALL OConfigurationRegistry::open( const ::rtl::OUString& _rURL, sal_Bool _bReadOnly, sal_Bool /*_bCreate*/ ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- UnoApiLock aLock;
-
- if (implIsOpen())
- close();
-
- ::rtl::OUString sNodePath = getNodePathFromURL(_rURL);
-
- if (!m_xConfigurationProvider.is())
- throw com::sun::star::lang::DisposedException(UNISTRING("invalid object. configuration provider is already disposed."), THISREF());
-
- com::sun::star::uno::Reference< com::sun::star::uno::XInterface > xNodeAccess;
- try
- {
- char const * const sAccessType = _bReadOnly ?
- "com.sun.star.configuration.ConfigurationAccess" :
- "com.sun.star.configuration.ConfigurationUpdateAccess";
-
- // prepare parameters for creating the config access : the node path
- beans::PropertyValue aArgValue;
- aArgValue.Handle = -1;
-
- // currently theres is one parameter: the node path
- com::sun::star::uno::Sequence< com::sun::star::uno::Any > aArguments(1);
-
- aArgValue.Name = UNISTRING("nodepath");
- aArgValue.Value <<= sNodePath;
-
- aArguments[0] <<= aArgValue;
-
-
- xNodeAccess = m_xConfigurationProvider->createInstanceWithArguments(UNISTRING(sAccessType), aArguments);
- }
- catch (com::sun::star::uno::RuntimeException&)
- { // allowed to leave this method
- throw;
- }
- catch (com::sun::star::uno::Exception& e)
- { // not allowed to leave this method
- ::rtl::OUString sMessage = UNISTRING("The configuration provider does not supply a registry access for the requested Node.");
- sMessage += UNISTRING(" original error message of the provider : ");
- sMessage += e.Message;
- throw com::sun::star::registry::InvalidRegistryException(sMessage, THISREF());
- }
-
- com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > xReadRoot(xNodeAccess, com::sun::star::uno::UNO_QUERY);
- if (!_bReadOnly)
- m_xUpdateRoot = m_xUpdateRoot.query(xReadRoot);
-
- if (!xReadRoot.is() || (!_bReadOnly && !m_xUpdateRoot.is()))
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("The object supplied the by configuration provider is invalid."), THISREF());
-
- m_xRootKey = new OConfigurationRegistryKey(xReadRoot, !_bReadOnly, OConfigurationRegistryKey::SubtreeRoot());
- m_xSubtreeRoot = xNodeAccess;
-}
-
-//--------------------------------------------------------------------------
-sal_Bool SAL_CALL OConfigurationRegistry::isValid( ) throw(com::sun::star::uno::RuntimeException)
-{
- UnoApiLock aLock;
- return implIsOpen();
-}
-
-//--------------------------------------------------------------------------
-sal_Bool OConfigurationRegistry::implIsOpen( ) throw(com::sun::star::uno::RuntimeException)
-{
- return m_xRootKey.is();
-}
-
-//--------------------------------------------------------------------------
-void SAL_CALL OConfigurationRegistry::close( ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- UnoApiLock aLock;
-
- com::sun::star::uno::Reference< com::sun::star::registry::XRegistryKey > xRootKey(m_xRootKey);
- m_xRootKey = NULL;
-
- com::sun::star::uno::Reference< XComponent > xRootComponent(m_xSubtreeRoot, com::sun::star::uno::UNO_QUERY);
- m_xSubtreeRoot = NULL;
- m_xUpdateRoot = NULL;
-
- m_sLocation = ::rtl::OUString();
-
- if (xRootKey.is())
- xRootKey->closeKey();
-
- if (xRootComponent.is())
- xRootComponent->dispose();
-}
-
-//--------------------------------------------------------------------------
-void SAL_CALL OConfigurationRegistry::disposing()
-{
- close();
-
- {
- UnoApiLock aLock;
-
- m_xConfigurationProvider.clear();
- m_xORB.clear();
- }
-
- ServiceComponentImpl::disposing();
-}
-
-//--------------------------------------------------------------------------
-void SAL_CALL OConfigurationRegistry::destroy( ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- UnoApiLock aLock;
- implCheckOpen();
-
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("This registry is a wrapper for a configuration access. It can not be destroyed."), THISREF());
-}
-
-//--------------------------------------------------------------------------
-com::sun::star::uno::Reference< com::sun::star::registry::XRegistryKey > SAL_CALL OConfigurationRegistry::getRootKey( ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- UnoApiLock aLock;
- implCheckOpen();
-
- return m_xRootKey;
-}
-
-//--------------------------------------------------------------------------
-sal_Bool SAL_CALL OConfigurationRegistry::isReadOnly( ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::uno::RuntimeException)
-{
- UnoApiLock aLock;
- implCheckOpen();
-
- return !m_xUpdateRoot.is();
- // if we don't have the update root, we're readonly
-}
-
-//--------------------------------------------------------------------------
-void SAL_CALL OConfigurationRegistry::mergeKey( const ::rtl::OUString& /*aKeyName*/, const ::rtl::OUString& /*aUrl*/ ) throw(com::sun::star::registry::InvalidRegistryException, com::sun::star::registry::MergeConflictException, com::sun::star::uno::RuntimeException)
-{
- UnoApiLock aLock;
- implCheckOpen();
-
- // not supported. but we can't throw an NoSupportException here ...
- throw com::sun::star::registry::InvalidRegistryException(UNISTRING("You can't merge into this registry. It's just a wrapper for a configuration node, which has a fixed structure which can not be modified"), THISREF());
-}
-
-//--------------------------------------------------------------------------
-void SAL_CALL OConfigurationRegistry::flush( ) throw(com::sun::star::uno::RuntimeException)
-{
- {
- UnoApiLock aLock;
- if (m_xUpdateRoot.is())
- {
- try
- {
- m_xUpdateRoot->commitChanges();
- }
- catch (com::sun::star::lang::WrappedTargetException& e)
- { // not allowed to leave this method
-
- ::rtl::OUString sMessage;
- sMessage = UNISTRING("The changes made could not be committed. Orginal exception message : ");
- sMessage += e.Message;
-
- // TODO : the specification of XFlushable has to be changed !!!!!
- OSL_ENSURE(sal_False, "OConfigurationRegistry::flush : caught an exception, could not flush the data !");
- // return;
-
- throw com::sun::star::lang::WrappedTargetRuntimeException(sMessage, THISREF(), e.TargetException);
- }
- }
- }
-
- com::sun::star::uno::Reference< com::sun::star::util::XFlushListener > const * const pSelector = 0;
- if (cppu::OInterfaceContainerHelper* pContainer = this->rBHelper.getContainer(::getCppuType(pSelector)) )
- {
- ::cppu::OInterfaceIteratorHelper aIter( *pContainer );
-
- com::sun::star::lang::EventObject aFlushed(THISREF());
- while (aIter.hasMoreElements())
- try
- {
- static_cast< com::sun::star::util::XFlushListener* >(aIter.next())->flushed(aFlushed);
- }
- catch (uno::Exception & )
- {}
- }
-}
-
-//--------------------------------------------------------------------------
-void SAL_CALL OConfigurationRegistry::addFlushListener( const com::sun::star::uno::Reference< com::sun::star::util::XFlushListener >& _rxListener ) throw(com::sun::star::uno::RuntimeException)
-{
- this->rBHelper.addListener(::getCppuType(&_rxListener),_rxListener);
-}
-
-//--------------------------------------------------------------------------
-void SAL_CALL OConfigurationRegistry::removeFlushListener( const com::sun::star::uno::Reference< com::sun::star::util::XFlushListener >& _rxListener ) throw(com::sun::star::uno::RuntimeException)
-{
- this->rBHelper.removeListener(::getCppuType(&_rxListener),_rxListener);
-}
-
-//..........................................................................
-} // namespace configmgr
-//..........................................................................
-
-
diff --git a/configmgr/source/registry/configregistry.hxx b/configmgr/source/registry/configregistry.hxx
deleted file mode 100644
index 69b3c5cf4f..0000000000
--- a/configmgr/source/registry/configregistry.hxx
+++ /dev/null
@@ -1,118 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONFIGMGR_REGISTRY_CONFIGREGISTRY_HXX_
-#define _CONFIGMGR_REGISTRY_CONFIGREGISTRY_HXX_
-
-#include <cppuhelper/implbase2.hxx>
-#include "confsvccomponent.hxx"
-#include <com/sun/star/registry/XSimpleRegistry.hpp>
-#include <com/sun/star/util/XFlushable.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/util/XChangesBatch.hpp>
-
-//..........................................................................
-namespace configmgr
-{
-//..........................................................................
-
-//==========================================================================
-//= OConfigurationRegistry
-//==========================================================================
-/** an object implmenting the <service scope="com.sun.star.configuration">ConfigurationRegistry</service>
- service.
-*/
-class OConfigurationRegistry
- :public ServiceComponentImpl
- ,public cppu::ImplHelper2< com::sun::star::registry::XSimpleRegistry, com::sun::star::util::XFlushable >
-{
-public:
- static const ServiceImplementationInfo s_aServiceInfo;
-
-protected:
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
- m_xORB; /// the service provider used for creating the instance
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
- m_xConfigurationProvider; /// the configuration provider used for creating configuration accesses
-
- ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey >
- m_xRootKey; /// the root key for the registry-like configuration access
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
- m_xSubtreeRoot; /// the root of the sub tree the object wraps
- ::com::sun::star::uno::Reference< ::com::sun::star::util::XChangesBatch >
- m_xUpdateRoot; /// the update access to the root of the sub tree, valid if opened for writing
- ::rtl::OUString m_sLocation; /// URL of the configuration node we're representing, if any
-
-
-public:
- OConfigurationRegistry(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rORB)
- throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
-
- // XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL acquire( ) throw() { ServiceComponentImpl::acquire(); }
- virtual void SAL_CALL release( ) throw() { ServiceComponentImpl::release(); }
-
- // XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
-
- // XSimpleRegistry
- virtual ::rtl::OUString SAL_CALL getURL() throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL open( const ::rtl::OUString& rURL, sal_Bool bReadOnly, sal_Bool bCreate ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isValid( ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL close( ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL destroy( ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > SAL_CALL getRootKey( ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isReadOnly( ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL mergeKey( const ::rtl::OUString& aKeyName, const ::rtl::OUString& aUrl ) throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::registry::MergeConflictException, ::com::sun::star::uno::RuntimeException);
-
- // XFlushable
- virtual void SAL_CALL flush( ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL addFlushListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XFlushListener >& l ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL removeFlushListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XFlushListener >& l ) throw(::com::sun::star::uno::RuntimeException);
-
-protected:
- virtual void SAL_CALL disposing();
- /// translates the given URL into a nodepath which may be used with the configuration provider
- ::rtl::OUString getNodePathFromURL(const ::rtl::OUString& _rURL);
-
- void implCheckOpen() throw(::com::sun::star::registry::InvalidRegistryException, ::com::sun::star::uno::RuntimeException);
-
- sal_Bool implIsOpen()
- throw (::com::sun::star::uno::RuntimeException);
-};
-
-
-//..........................................................................
-} // namespace configmgr
-//..........................................................................
-
-#endif // _CONFIGMGR_REGISTRY_CONFIGREGISTRY_HXX_
-
-
diff --git a/configmgr/source/registry/makefile.mk b/configmgr/source/registry/makefile.mk
deleted file mode 100644
index b3864291e5..0000000000
--- a/configmgr/source/registry/makefile.mk
+++ /dev/null
@@ -1,48 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJINC=$(PRJ)$/source$/inc
-PRJNAME=configmgr
-TARGET=registry
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings ----------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/makefile.pmk
-# --- Files -------------------------------------
-
-SLOFILES=\
- $(SLO)$/configregistry.obj \
- $(SLO)$/cfgregistrykey.obj \
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/configmgr/source/rootaccess.cxx b/configmgr/source/rootaccess.cxx
new file mode 100644
index 0000000000..f8ccc6a315
--- /dev/null
+++ b/configmgr/source/rootaccess.cxx
@@ -0,0 +1,319 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include <vector>
+
+#include "com/sun/star/lang/DisposedException.hpp"
+#include "com/sun/star/lang/EventObject.hpp"
+#include "com/sun/star/lang/WrappedTargetException.hpp"
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/Type.hxx"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "com/sun/star/util/ChangesEvent.hpp"
+#include "com/sun/star/util/ChangesSet.hpp"
+#include "com/sun/star/util/ElementChange.hpp"
+#include "com/sun/star/util/XChangesBatch.hpp"
+#include "com/sun/star/util/XChangesListener.hpp"
+#include "com/sun/star/util/XChangesNotifier.hpp"
+#include "comphelper/sequenceasvector.hxx"
+#include "cppu/unotype.hxx"
+#include "cppuhelper/queryinterface.hxx"
+#include "cppuhelper/weak.hxx"
+#include "osl/diagnose.h"
+#include "osl/mutex.hxx"
+#include "rtl/ref.hxx"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+
+#include "broadcaster.hxx"
+#include "childaccess.hxx"
+#include "components.hxx"
+#include "data.hxx"
+#include "lock.hxx"
+#include "modifications.hxx"
+#include "node.hxx"
+#include "path.hxx"
+#include "rootaccess.hxx"
+
+namespace configmgr {
+
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
+RootAccess::RootAccess(
+ Components & components, rtl::OUString const & pathRepresentation,
+ rtl::OUString const & locale, bool update):
+ Access(components), pathRepresentation_(pathRepresentation),
+ locale_(locale), update_(update)
+{}
+
+Path RootAccess::getAbsolutePath() {
+ getNode();
+ return path_;
+}
+
+void RootAccess::initBroadcaster(
+ Modifications::Node const & modifications, Broadcaster * broadcaster)
+{
+ OSL_ASSERT(broadcaster != 0);
+ comphelper::SequenceAsVector< css::util::ElementChange > changes;
+ initBroadcasterAndChanges(
+ modifications, broadcaster, changesListeners_.empty() ? 0 : &changes);
+ if (!changes.empty()) {
+ css::util::ChangesSet set(changes.getAsConstList());
+ for (ChangesListeners::iterator i(changesListeners_.begin());
+ i != changesListeners_.end(); ++i)
+ {
+ broadcaster->addChangesNotification(
+ *i,
+ css::util::ChangesEvent(
+ static_cast< cppu::OWeakObject * >(this),
+ css::uno::makeAny(pathRepresentation_), set));
+ }
+ }
+}
+
+void RootAccess::acquire() throw () {
+ Access::acquire();
+}
+
+void RootAccess::release() throw () {
+ Access::release();
+}
+
+rtl::OUString RootAccess::getLocale() const {
+ return locale_;
+}
+
+bool RootAccess::isUpdate() const {
+ return update_;
+}
+
+RootAccess::~RootAccess() {
+ osl::MutexGuard g(lock);
+ getComponents().removeRootAccess(this);
+}
+
+Path RootAccess::getRelativePath() {
+ return Path();
+}
+
+rtl::OUString RootAccess::getRelativePathRepresentation() {
+ return rtl::OUString();
+}
+
+rtl::Reference< Node > RootAccess::getNode() {
+ if (!node_.is()) {
+ int finalizedLayer;
+ node_ = getComponents().resolvePathRepresentation(
+ pathRepresentation_, &path_, &finalizedLayer);
+ if (!node_.is()) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("cannot find ")) +
+ pathRepresentation_),
+ 0);
+ // RootAccess::queryInterface indirectly calls
+ // RootAccess::getNode, so if this RootAccess were passed out in
+ // RuntimeException.Context, client code that called
+ // queryInterface on it would cause trouble; therefore,
+ // RuntimeException.Context is left null here
+ }
+ OSL_ASSERT(!path_.empty());
+ name_ = path_.back();
+ finalized_ = finalizedLayer != Data::NO_LAYER;
+ }
+ return node_;
+}
+
+bool RootAccess::isFinalized() {
+ getNode();
+ return finalized_;
+}
+
+rtl::OUString RootAccess::getNameInternal() {
+ getNode();
+ return name_;
+}
+
+rtl::Reference< RootAccess > RootAccess::getRootAccess() {
+ return this;
+}
+
+rtl::Reference< Access > RootAccess::getParentAccess() {
+ return rtl::Reference< Access >();
+}
+
+void RootAccess::addTypes(std::vector< css::uno::Type > * types) const {
+ OSL_ASSERT(types != 0);
+ types->push_back(cppu::UnoType< css::util::XChangesNotifier >::get());
+ types->push_back(cppu::UnoType< css::util::XChangesBatch >::get());
+}
+
+void RootAccess::addSupportedServiceNames(
+ std::vector< rtl::OUString > * services)
+{
+ OSL_ASSERT(services != 0);
+ services->push_back(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.AccessRootElement")));
+ if (update_) {
+ services->push_back(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.UpdateRootElement")));
+ }
+}
+
+void RootAccess::initDisposeBroadcaster(Broadcaster * broadcaster) {
+ OSL_ASSERT(broadcaster != 0);
+ for (ChangesListeners::iterator i(changesListeners_.begin());
+ i != changesListeners_.end(); ++i)
+ {
+ broadcaster->addDisposeNotification(
+ i->get(),
+ css::lang::EventObject(static_cast< cppu::OWeakObject * >(this)));
+ }
+ Access::initDisposeBroadcaster(broadcaster);
+}
+
+void RootAccess::clearListeners() throw() {
+ changesListeners_.clear();
+ Access::clearListeners();
+}
+
+css::uno::Any RootAccess::queryInterface(css::uno::Type const & aType)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ css::uno::Any res(Access::queryInterface(aType));
+ if (res.hasValue()) {
+ return res;
+ }
+ res = cppu::queryInterface(
+ aType, static_cast< css::util::XChangesNotifier * >(this));
+ if (res.hasValue()) {
+ return res;
+ }
+ if (!res.hasValue() && update_) {
+ res = cppu::queryInterface(
+ aType, static_cast< css::util::XChangesBatch * >(this));
+ }
+ return res;
+}
+
+void RootAccess::addChangesListener(
+ css::uno::Reference< css::util::XChangesListener > const & aListener)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ {
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ if (!aListener.is()) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("null listener")),
+ static_cast< cppu::OWeakObject * >(this));
+ }
+ if (!isDisposed()) {
+ changesListeners_.insert(aListener);
+ return;
+ }
+ }
+ try {
+ aListener->disposing(
+ css::lang::EventObject(static_cast< cppu::OWeakObject * >(this)));
+ } catch (css::lang::DisposedException &) {}
+}
+
+void RootAccess::removeChangesListener(
+ css::uno::Reference< css::util::XChangesListener > const & aListener)
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_ANY));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ ChangesListeners::iterator i(changesListeners_.find(aListener));
+ if (i != changesListeners_.end()) {
+ changesListeners_.erase(i);
+ }
+}
+
+void RootAccess::commitChanges()
+ throw (css::lang::WrappedTargetException, css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_UPDATE));
+ Broadcaster bc;
+ {
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ int finalizedLayer;
+ Modifications globalMods;
+ commitChildChanges(
+ ((getComponents().resolvePathRepresentation(
+ pathRepresentation_, 0, &finalizedLayer)
+ == node_) &&
+ finalizedLayer == Data::NO_LAYER),
+ &globalMods);
+ getComponents().writeModifications();
+ getComponents().initGlobalBroadcaster(globalMods, this, &bc);
+ }
+ bc.send();
+}
+
+sal_Bool RootAccess::hasPendingChanges() throw (css::uno::RuntimeException) {
+ OSL_ASSERT(thisIs(IS_UPDATE));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ //TODO: Optimize:
+ std::vector< css::util::ElementChange > changes;
+ reportChildChanges(&changes);
+ return !changes.empty();
+}
+
+css::util::ChangesSet RootAccess::getPendingChanges()
+ throw (css::uno::RuntimeException)
+{
+ OSL_ASSERT(thisIs(IS_UPDATE));
+ osl::MutexGuard g(lock);
+ checkLocalizedPropertyAccess();
+ comphelper::SequenceAsVector< css::util::ElementChange > changes;
+ reportChildChanges(&changes);
+ return changes.getAsConstList();
+}
+
+}
diff --git a/configmgr/source/rootaccess.hxx b/configmgr/source/rootaccess.hxx
new file mode 100644
index 0000000000..45d4193d70
--- /dev/null
+++ b/configmgr/source/rootaccess.hxx
@@ -0,0 +1,155 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_ROOTACCESS_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_ROOTACCESS_HXX
+
+#include "sal/config.h"
+
+#include <set>
+#include <vector>
+
+#include "com/sun/star/lang/WrappedTargetException.hpp"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/util/ChangesSet.hpp"
+#include "com/sun/star/util/XChangesBatch.hpp"
+#include "com/sun/star/util/XChangesNotifier.hpp"
+#include "rtl/ref.hxx"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+
+#include "access.hxx"
+#include "modifications.hxx"
+#include "path.hxx"
+
+namespace com { namespace sun { namespace star {
+ namespace uno {
+ class Any;
+ class Type;
+ }
+ namespace util { class XChangesListener; }
+} } }
+
+namespace configmgr {
+
+class Broadcaster;
+class Components;
+class Node;
+
+class RootAccess:
+ public Access, public com::sun::star::util::XChangesNotifier,
+ public com::sun::star::util::XChangesBatch
+{
+public:
+ RootAccess(
+ Components & components, rtl::OUString const & pathRepresenation,
+ rtl::OUString const & locale, bool update);
+
+ virtual Path getAbsolutePath();
+
+ virtual void initBroadcaster(
+ Modifications::Node const & modifications, Broadcaster * broadcaster);
+
+ virtual void SAL_CALL acquire() throw ();
+
+ virtual void SAL_CALL release() throw ();
+
+ rtl::OUString getLocale() const;
+
+ bool isUpdate() const;
+
+private:
+ virtual ~RootAccess();
+
+ virtual Path getRelativePath();
+
+ virtual rtl::OUString getRelativePathRepresentation();
+
+ virtual rtl::Reference< Node > getNode();
+
+ virtual bool isFinalized();
+
+ virtual rtl::OUString getNameInternal();
+
+ virtual rtl::Reference< RootAccess > getRootAccess();
+
+ virtual rtl::Reference< Access > getParentAccess();
+
+ virtual void addTypes(std::vector< com::sun::star::uno::Type > * types)
+ const;
+
+ virtual void addSupportedServiceNames(
+ std::vector< rtl::OUString > * services);
+
+ virtual void initDisposeBroadcaster(Broadcaster * broadcaster);
+
+ virtual void clearListeners() throw ();
+
+ virtual com::sun::star::uno::Any SAL_CALL queryInterface(
+ com::sun::star::uno::Type const & aType)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL addChangesListener(
+ com::sun::star::uno::Reference< com::sun::star::util::XChangesListener >
+ const & aListener)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL removeChangesListener(
+ com::sun::star::uno::Reference< com::sun::star::util::XChangesListener >
+ const & aListener)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL commitChanges()
+ throw (
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL hasPendingChanges()
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual com::sun::star::util::ChangesSet SAL_CALL getPendingChanges()
+ throw (com::sun::star::uno::RuntimeException);
+
+ typedef
+ std::multiset<
+ com::sun::star::uno::Reference<
+ com::sun::star::util::XChangesListener > >
+ ChangesListeners;
+
+ rtl::OUString pathRepresentation_;
+ rtl::OUString locale_;
+ bool update_;
+ Path path_;
+ rtl::Reference< Node > node_;
+ rtl::OUString name_;
+ bool finalized_;
+ ChangesListeners changesListeners_;
+};
+
+}
+
+#endif
diff --git a/configmgr/source/services.cxx b/configmgr/source/services.cxx
new file mode 100644
index 0000000000..3a009b3cee
--- /dev/null
+++ b/configmgr/source/services.cxx
@@ -0,0 +1,118 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include "com/sun/star/registry/XRegistryKey.hpp"
+#include "com/sun/star/uno/Exception.hpp"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "cppuhelper/implementationentry.hxx"
+#include "osl/diagnose.h"
+#include "uno/lbnames.h"
+#include "rtl/textenc.h"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+
+#include "configurationprovider.hxx"
+#include "configurationregistry.hxx"
+#include "defaultprovider.hxx"
+
+namespace {
+
+namespace css = com::sun::star;
+
+css::uno::Reference< css::uno::XInterface > SAL_CALL dummy(
+ css::uno::Reference< css::uno::XComponentContext > const &)
+ SAL_THROW((css::uno::Exception))
+{
+ OSL_ASSERT(false);
+ return css::uno::Reference< css::uno::XInterface >();
+}
+
+static cppu::ImplementationEntry const services[] = {
+ { &dummy, &configmgr::configuration_provider::getImplementationName,
+ &configmgr::configuration_provider::getSupportedServiceNames,
+ &configmgr::configuration_provider::createFactory, 0, 0 },
+ { &dummy, &configmgr::default_provider::getImplementationName,
+ &configmgr::default_provider::getSupportedServiceNames,
+ &configmgr::default_provider::createFactory, 0, 0 },
+ { &dummy, &configmgr::configuration_registry::getImplementationName,
+ &configmgr::configuration_registry::getSupportedServiceNames,
+ &configmgr::configuration_registry::createFactory, 0, 0 },
+ { 0, 0, 0, 0, 0, 0 }
+};
+
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
+ char const * pImplName, void * pServiceManager, void * pRegistryKey)
+{
+ return cppu::component_getFactoryHelper(
+ pImplName, pServiceManager, pRegistryKey, services);
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL
+component_getImplementationEnvironment(
+ char const ** ppEnvTypeName, uno_Environment **)
+{
+ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
+ void * pServiceManager, void * pRegistryKey)
+{
+ if (!component_writeInfoHelper(pServiceManager, pRegistryKey, services)) {
+ return false;
+ }
+ try {
+ css::uno::Reference< css::registry::XRegistryKey >(
+ (css::uno::Reference< css::registry::XRegistryKey >(
+ static_cast< css::registry::XRegistryKey * >(pRegistryKey))->
+ createKey(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "/com.sun.star.comp.configuration.DefaultProvider/UNO/"
+ "SINGLETONS/"
+ "com.sun.star.configuration.theDefaultProvider")))),
+ css::uno::UNO_SET_THROW)->
+ setStringValue(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.DefaultProvider")));
+ } catch (css::uno::Exception & e) {
+ (void) e;
+ OSL_TRACE(
+ "configmgr component_writeInfo exception: %s",
+ rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr());
+ return false;
+ }
+ return true;
+}
diff --git a/configmgr/source/setnode.cxx b/configmgr/source/setnode.cxx
new file mode 100644
index 0000000000..f19c36c0bb
--- /dev/null
+++ b/configmgr/source/setnode.cxx
@@ -0,0 +1,126 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include <algorithm>
+#include <functional>
+#include <vector>
+
+#include "rtl/ref.hxx"
+#include "rtl/ustring.hxx"
+
+#include "data.hxx"
+#include "node.hxx"
+#include "nodemap.hxx"
+#include "setnode.hxx"
+
+namespace configmgr {
+
+namespace {
+
+// Work around some compilers' failure to accept
+// std::binder1st(std::ptr_fun(&Data::equalTemplateNames), ...):
+class EqualTemplateNames:
+ public std::unary_function< rtl::OUString const &, bool >
+{
+public:
+ inline explicit EqualTemplateNames(rtl::OUString const & shortName):
+ shortName_(shortName) {}
+
+ inline bool operator ()(rtl::OUString const & longName) const
+ { return Data::equalTemplateNames(shortName_, longName); }
+
+private:
+ rtl::OUString const & shortName_;
+};
+
+}
+
+SetNode::SetNode(
+ int layer, rtl::OUString const & defaultTemplateName,
+ rtl::OUString const & templateName):
+ Node(layer), defaultTemplateName_(defaultTemplateName),
+ templateName_(templateName), mandatory_(Data::NO_LAYER)
+{}
+
+rtl::Reference< Node > SetNode::clone() const {
+ return new SetNode(*this);
+}
+
+NodeMap & SetNode::getMembers() {
+ return members_;
+}
+
+rtl::OUString SetNode::getTemplateName() const {
+ return templateName_;
+}
+
+void SetNode::setMandatory(int layer) {
+ mandatory_ = layer;
+}
+
+int SetNode::getMandatory() const {
+ return mandatory_;
+}
+
+rtl::OUString const & SetNode::getDefaultTemplateName() const {
+ return defaultTemplateName_;
+}
+
+std::vector< rtl::OUString > & SetNode::getAdditionalTemplateNames() {
+ return additionalTemplateNames_;
+}
+
+bool SetNode::isValidTemplate(rtl::OUString const & templateName) const {
+ return Data::equalTemplateNames(templateName, defaultTemplateName_) ||
+ (std::find_if(
+ additionalTemplateNames_.begin(),
+ additionalTemplateNames_.end(), EqualTemplateNames(templateName)) !=
+ additionalTemplateNames_.end());
+}
+
+SetNode::SetNode(SetNode const & other):
+ Node(other), defaultTemplateName_(other.defaultTemplateName_),
+ additionalTemplateNames_(other.additionalTemplateNames_),
+ templateName_(other.templateName_), mandatory_(other.mandatory_)
+{
+ cloneNodeMap(other.members_, &members_);
+}
+
+SetNode::~SetNode() {}
+
+Node::Kind SetNode::kind() const {
+ return KIND_SET;
+}
+
+void SetNode::clear() {
+ members_.clear();
+}
+
+}
diff --git a/configmgr/source/setnode.hxx b/configmgr/source/setnode.hxx
new file mode 100644
index 0000000000..7bf1ab0a19
--- /dev/null
+++ b/configmgr/source/setnode.hxx
@@ -0,0 +1,84 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_SETNODE_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_SETNODE_HXX
+
+#include "sal/config.h"
+
+#include <vector>
+
+#include "rtl/ref.hxx"
+#include "rtl/ustring.hxx"
+
+#include "node.hxx"
+#include "nodemap.hxx"
+
+namespace configmgr {
+
+class SetNode: public Node {
+public:
+ SetNode(
+ int layer, rtl::OUString const & defaultTemplateName,
+ rtl::OUString const & templateName);
+
+ virtual rtl::Reference< Node > clone() const;
+
+ virtual NodeMap & getMembers();
+
+ virtual rtl::OUString getTemplateName() const;
+
+ virtual void setMandatory(int layer);
+
+ virtual int getMandatory() const;
+
+ rtl::OUString const & getDefaultTemplateName() const;
+
+ std::vector< rtl::OUString > & getAdditionalTemplateNames();
+
+ bool isValidTemplate(rtl::OUString const & templateName) const;
+
+private:
+ SetNode(SetNode const & other);
+
+ virtual ~SetNode();
+
+ virtual Kind kind() const;
+
+ virtual void clear();
+
+ rtl::OUString defaultTemplateName_;
+ std::vector< rtl::OUString > additionalTemplateNames_;
+ NodeMap members_;
+ rtl::OUString templateName_;
+ // non-empty iff this node is a template, free node, or set member
+ int mandatory_;
+};
+
+}
+
+#endif
diff --git a/configmgr/source/span.hxx b/configmgr/source/span.hxx
new file mode 100644
index 0000000000..6896186137
--- /dev/null
+++ b/configmgr/source/span.hxx
@@ -0,0 +1,64 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_SPAN_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_SPAN_HXX
+
+#include "sal/config.h"
+
+#include "rtl/string.h"
+#include "sal/types.h"
+
+namespace configmgr {
+
+struct Span {
+ char const * begin;
+ sal_Int32 length;
+
+ inline Span(): begin(0), length(0) {}
+ // init length to avoid compiler warnings
+
+ inline Span(char const * theBegin, sal_Int32 theLength):
+ begin(theBegin), length(theLength) {}
+
+ inline void clear() throw() { begin = 0; }
+
+ inline bool is() const { return begin != 0; }
+
+ inline bool equals(Span const & text) const {
+ return rtl_str_compare_WithLength(
+ begin, length, text.begin, text.length) == 0;
+ }
+
+ inline bool equals(char const * textBegin, sal_Int32 textLength) const {
+ return equals(Span(textBegin, textLength));
+ }
+};
+
+}
+
+#endif
diff --git a/configmgr/source/tree/builddata.cxx b/configmgr/source/tree/builddata.cxx
deleted file mode 100644
index a633aae87d..0000000000
--- a/configmgr/source/tree/builddata.cxx
+++ /dev/null
@@ -1,1134 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "sal/types.h"
-
-#include "builddata.hxx"
-#include "nodevisitor.hxx"
-#include "node.hxx"
-#include "treefragment.hxx"
-#include "valuenode.hxx"
-#include "treenodefactory.hxx"
-#include "utility.hxx"
-
-#ifndef INCLUDED_CSTDDEF
-#include <cstddef>
-#define INCLUDED_CSTDDEF
-#endif
-#ifndef INCLUDED_ALGORITHM
-#include <algorithm>
-#define INCLUDED_ALGORITHM
-#endif
-#include <vector>
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace data
- {
-//-----------------------------------------------------------------------------
-
- static
- inline
- sharable::Node * offsetNodeBy(sharable::Node * _aNode, sal_uInt16 _nOffset)
- {
- sharable::Node *pNode = _aNode;
- pNode += _nOffset;
- return (sharable::Node *)(pNode);
- }
-
- static
- inline
- sharable::Node * addressOfNodeAt(sharable::TreeFragment * _aTree, sal_uInt16 _nOffset)
- {
- sharable::TreeFragment *pRaw = _aTree;
- return &pRaw->nodes[_nOffset];
- }
-
-//-----------------------------------------------------------------------------
-
- class TreeNodeBuilder
- {
- sharable::TreeFragmentHeader m_header;
- std::vector< sharable::Node > m_nodes;
- sal_uInt16 m_parent;
- public:
- TreeNodeBuilder() : m_header(), m_nodes(), m_parent() {}
-
- sharable::TreeFragmentHeader & header() { return m_header; }
-
- sharable::Node & nodeAt(sal_uInt16 _pos) { checkOffset(_pos); return m_nodes[_pos]; }
- sharable::NodeInfo & nodeInfoAt(sal_uInt16 _pos) { checkOffset(_pos); return m_nodes[_pos].info; }
-
- sharable::Node & lastNode() { checkOffset(0); return m_nodes.back(); }
- sharable::NodeInfo & lastNodeInfo() { checkOffset(0); return m_nodes.back().info; }
-
- void resetTreeFragment(rtl_uString * _treeName, sal_uInt8 _state);
-
- sharable::TreeFragment * createTreeFragment();
-
- sal_uInt16 startGroup( rtl_uString * _aName, sal_uInt8 _aFlags );
- void endGroup( sal_uInt16 _nPos );
-
- void addSet( rtl_uString * _aName, sal_uInt8 _aFlags, sal_uInt8 * _aElementType );
-
- void addValue( rtl_uString * _aName, sal_uInt8 _aFlags,
- sal_uInt8 _aValueType,
- sharable::AnyData _aUserValue,
- sharable::AnyData _aDefaultName );
- public:
- class CollectSetElements;
- class LinkSetNodes;
-
- private:
- sharable::TreeFragment * allocTreeFragment();
- void linkTreeFragment(sharable::TreeFragment * _aTreeAddr);
-
- sal_uInt16 addNode(rtl_uString * _aName, sal_uInt8 _aFlags, sal_uInt8 _aType);
- void checkOffset(sal_uInt16 _pos);
- };
-//-----------------------------------------------------------------------------
-
- class TreeNodeBuilder::CollectSetElements
- {
- sharable::TreeFragment * m_head;
- public:
- explicit
- CollectSetElements() : m_head(NULL) {}
-
- void resetElementList();
- void addElement(sharable::TreeFragment * _aNewElement);
- sharable::TreeFragment * getElementListAndClear();
- };
-//-----------------------------------------------------------------------------
-
- class TreeNodeBuilder::LinkSetNodes: private SetVisitor {
- sharable::Node * m_parent;
- public:
- LinkSetNodes(): m_parent(0) {}
-
- void linkTree(sharable::TreeFragment * tree);
-
- private:
- using SetVisitor::handle;
-
- virtual bool handle(sharable::SetNode * node);
-
- virtual bool handle(sharable::TreeFragment * tree);
- };
-//-----------------------------------------------------------------------------
-
- class BasicDataTreeBuilder
- {
- public:
- explicit
- BasicDataTreeBuilder() {}
-
- sharable::TreeFragment * createTree() { return m_builder.createTreeFragment(); }
-
- protected:
- TreeNodeBuilder& builder() { return m_builder; }
- private:
- TreeNodeBuilder m_builder;
- };
-//-----------------------------------------------------------------------------
-
- class ConvertingDataTreeBuilder : private NodeAction, public BasicDataTreeBuilder
- {
- rtl::OUString m_sRootName;
- bool m_bWithDefaults;
- public:
- explicit
- ConvertingDataTreeBuilder() : BasicDataTreeBuilder() {}
-
- sharable::TreeFragment * buildTree(rtl::OUString const & _aTreeName, INode const& _aNode, bool _bWithDefault);
- sharable::TreeFragment * buildElement(INode const& _aNode, rtl::OUString const & _aTypeName, bool _bWithDefault);
- private:
- class ElementListBuilder;
-
- virtual void handle(ISubtree const & _aNode);
- virtual void handle(ValueNode const & _aNode);
-
- sal_uInt8 * makeTemplateData(rtl::OUString const & _aTemplateName, rtl::OUString const & _aTemplateModule);
-
- rtl_uString * allocName(INode const & _aNode);
- sal_uInt8 makeState(node::Attributes const & _aAttributes);
- sal_uInt8 makeFlags(node::Attributes const & _aAttributes);
- };
-//-----------------------------------------------------------------------------
-
- class ConvertingDataTreeBuilder::ElementListBuilder : private NodeAction
- {
- TreeNodeBuilder::CollectSetElements m_aCollector;
-
- rtl::OUString m_sTypeName;
- bool m_bWithDefaults;
- public:
- explicit
- ElementListBuilder()
- : m_aCollector()
- , m_sTypeName()
- , m_bWithDefaults()
- {}
-
- sharable::TreeFragment *buildElementList(ISubtree const & _aSet, bool _bWithDefaults);
- private:
- void handleNode(INode const & _aSourceNode);
-
- void handle(ValueNode const & _aSourceNode);
- void handle(ISubtree const & _aSourceNode);
- };
-//-----------------------------------------------------------------------------
-
- class CopyingDataTreeBuilder : private NodeVisitor, public BasicDataTreeBuilder
- {
- public:
- explicit
- CopyingDataTreeBuilder() : BasicDataTreeBuilder() {}
-
- sharable::TreeFragment * buildTree(sharable::TreeFragment * sourceTree);
-
- private:
- class ElementListBuilder;
-
- using NodeVisitor::handle;
- virtual bool handle(sharable::ValueNode * node);
- virtual bool handle(sharable::GroupNode * node);
- virtual bool handle(sharable::SetNode * node);
-
- sal_uInt8 * makeTemplateData(sal_uInt8 * _aSourceTemplate);
- };
-//-----------------------------------------------------------------------------
-
- class CopyingDataTreeBuilder::ElementListBuilder : private SetVisitor
- {
- TreeNodeBuilder::CollectSetElements m_aCollector;
- public:
- explicit
- ElementListBuilder() : m_aCollector() {}
-
- sharable::TreeFragment * buildElementList(sharable::SetNode * set);
-
- private:
- using SetVisitor::handle;
- virtual bool handle(sharable::TreeFragment * tree);
- };
-//-----------------------------------------------------------------------------
-
- class ConvertingNodeBuilder : private NodeVisitor
- {
- OTreeNodeFactory & m_rNodeFactory;
-
- std::auto_ptr<INode> m_pNode;
- public:
- ConvertingNodeBuilder(OTreeNodeFactory & _rNodeFactory)
- : m_rNodeFactory(_rNodeFactory)
- , m_pNode()
- {
- }
-
- std::auto_ptr<INode> buildNode(sharable::TreeFragment * tree, bool _bUseTreeName);
- std::auto_ptr<INode> buildNode(sharable::Node * tree);
-
- std::auto_ptr<ISubtree> buildNodeTree(sharable::GroupNode * groupNode) const;
- std::auto_ptr<ISubtree> buildNodeTree(sharable::SetNode * setNode) const;
- std::auto_ptr<ValueNode> buildNodeTree(sharable::ValueNode * valueNode) const
- { return convertNode(valueNode); }
-
- static node::Attributes convertAttributes(sharable::Node * node)
- { return node->getAttributes(); }
-
- private:
- std::auto_ptr<ISubtree> convertNode(sharable::GroupNode * groupNode) const;
- std::auto_ptr<ISubtree> convertNode(sharable::SetNode * setNode) const;
- std::auto_ptr<ValueNode> convertNode(sharable::ValueNode * valueNode) const;
-
- using NodeVisitor::handle;
- virtual bool handle(sharable::ValueNode * node);
- virtual bool handle(sharable::GroupNode * node);
- virtual bool handle(sharable::SetNode * node);
- };
-//-----------------------------------------------------------------------------
-
- class ConvertingSubnodeBuilder : private SetVisitor
- {
- ConvertingNodeBuilder m_aSubnodeBuilder;
- ISubtree & m_rParentNode;
- public:
- ConvertingSubnodeBuilder(OTreeNodeFactory & _rNodeFactory, ISubtree & _rParentNode)
- : m_aSubnodeBuilder(_rNodeFactory)
- , m_rParentNode(_rParentNode)
- {
- }
-
- void addElements(sharable::SetNode * set) { visitElements(set); }
- void addChildren(sharable::GroupNode * group) { visitChildren(group); }
-
- private:
- using SetVisitor::handle;
- virtual bool handle(sharable::Node * node);
- virtual bool handle(sharable::TreeFragment * tree);
- };
-//-----------------------------------------------------------------------------
-
- class DataTreeDefaultMerger : private NodeAction
- {
- public:
- explicit
- DataTreeDefaultMerger() {}
-
- void mergeDefaults(sharable::TreeFragment * _aBaseAddress, INode const& _aDefaultNode);
- private:
- void handle(ValueNode const & _aNode);
- void handle(ISubtree const & _aNode);
- };
-
-//-----------------------------------------------------------------------------
-
- class DataTreeCleanup
- {
- public:
- explicit
- DataTreeCleanup() {}
-
- sharable::TreeFragment * destroyTree(sharable::TreeFragment * _aBaseAddress);
- private:
- void destroyNode(sharable::Node * _aNodeAddress);
-
- void destroyData(sharable::TreeFragmentHeader * _pHeader);
- void destroyData(sharable::NodeInfo * _pNodeInfo);
-
- void destroyData(sharable::GroupNode * _pNode);
- void destroyData(sharable::ValueNode * _pNode);
- void destroyData(sharable::SetNode * _pNode);
- };
-
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-sharable::TreeFragment * buildTree(sharable::TreeFragment * tree)
-{
- return CopyingDataTreeBuilder().buildTree(tree);
-}
-//-----------------------------------------------------------------------------
-
-sharable::TreeFragment * buildTree(rtl::OUString const & _aTreeName, INode const& _aNode, bool _bWithDefaults)
-{
- ConvertingDataTreeBuilder aBuilder;
-
- sharable::TreeFragment * aResult = aBuilder.buildTree(_aTreeName, _aNode,_bWithDefaults);
-
- return aResult;
-}
-//-----------------------------------------------------------------------------
-
-sharable::TreeFragment * buildElementTree(INode const& _aNode, rtl::OUString const & _aTypeName, bool _bWithDefaults)
-{
- ConvertingDataTreeBuilder aBuilder;
-
- sharable::TreeFragment * aResult = aBuilder.buildElement(_aNode, _aTypeName, _bWithDefaults);
-
- return aResult;
-}
-//-----------------------------------------------------------------------------
-
-void mergeDefaults(sharable::TreeFragment * _aBaseAddress, INode const& _aDefaultNode)
-{
- DataTreeDefaultMerger aMergeHelper;
-
- aMergeHelper.mergeDefaults(_aBaseAddress, _aDefaultNode);
-}
-//-----------------------------------------------------------------------------
-
-void destroyTree(sharable::TreeFragment * _aBaseAddress)
-{
- DataTreeCleanup aCleaner;
-
- aCleaner.destroyTree(_aBaseAddress);
-}
-//-----------------------------------------------------------------------------
-
-std::auto_ptr<INode> convertTree(sharable::TreeFragment * tree, bool _bUseTreeName)
-{
- ConvertingNodeBuilder aBuilder( configmgr::getDefaultTreeNodeFactory() );
-
- return aBuilder.buildNode(tree, _bUseTreeName);
-}
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-inline
-void TreeNodeBuilder::CollectSetElements::resetElementList()
-{
- OSL_ENSURE(m_head == NULL, "Joining to a element list that was forgotten");
-}
-//-----------------------------------------------------------------------------
-
-inline
-sharable::TreeFragment * TreeNodeBuilder::CollectSetElements::getElementListAndClear()
-{
- sharable::TreeFragment * aResult = m_head;
- m_head = NULL;
- return aResult;
-}
-//-----------------------------------------------------------------------------
-
-void TreeNodeBuilder::CollectSetElements::addElement(sharable::TreeFragment * _aNewElement)
-{
- if (sharable::TreeFragment * pNewFragment = _aNewElement)
- {
- pNewFragment->header.parent = 0; // data not available here
- pNewFragment->header.next = m_head;
-
- m_head = _aNewElement;
- }
- else
- OSL_ENSURE(false, "Cannot add NULL element");
-}
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-void TreeNodeBuilder::LinkSetNodes::linkTree(sharable::TreeFragment * tree) {
- sharable::Node * old = m_parent;
- m_parent = 0;
- sal_uInt16 n = tree->header.count;
- for (sal_uInt16 i = 0; i < n; ++i) {
- if (visitNode(tree->nodes + i)) {
- break;
- }
- }
- m_parent = old;
-}
-
-bool TreeNodeBuilder::LinkSetNodes::handle(sharable::SetNode * node)
-{
- OSL_ASSERT(m_parent == 0);
- m_parent = sharable::node(node);
- bool done = visitElements(node);
- m_parent = 0;
- return done;
-}
-
-bool TreeNodeBuilder::LinkSetNodes::handle(sharable::TreeFragment * tree)
-{
- OSL_ASSERT(m_parent != 0);
- tree->header.parent = m_parent;
- return false;
-}
-
-//-----------------------------------------------------------------------------
-
-inline void TreeNodeBuilder::checkOffset(sal_uInt16 _pos)
-{
- { (void)_pos; }
- OSL_ENSURE(_pos < m_nodes.size(), "TreeNodeBuilder: Node access past end.");
-}
-//-----------------------------------------------------------------------------
-
-sal_uInt16 TreeNodeBuilder::addNode(rtl_uString * _aName, sal_uInt8 _aFlags, sal_uInt8 _aType)
-{
- OSL_PRECOND(_aName, "TreeNodeBuilder: Unexpected NULL name");
-
- // TODO: consistencý checks for flags
- OSL_ENSURE(m_nodes.size() == m_header.count, "TreeNodeBuilder: node count mismatch");
-
- sal_uInt16 nNewOffset = m_header.count++;
-
- m_nodes.push_back( sharable::Node() );
-
- OSL_ASSERT( &lastNode() == &nodeAt(nNewOffset) );
-
- sharable::NodeInfo & rInfo = lastNode().info;
-
- rInfo.name = _aName;
- rInfo.flags = _aFlags;
- rInfo.type = _aType;
-
- OSL_ENSURE( m_parent <= nNewOffset, "ERROR - TreeNodeBuilder: invalid parent");
- OSL_ENSURE( (nNewOffset == 0) == (nNewOffset == m_parent), "ERROR - TreeNodeBuilder: node is own parent");
-
- rInfo.parent = nNewOffset - m_parent;
-
- return nNewOffset;
-}
-//-----------------------------------------------------------------------------
-
-void TreeNodeBuilder::resetTreeFragment(rtl_uString * _name, sal_uInt8 _state)
-{
- m_header.next = 0;
- m_header.name = _name;
-
- m_header.parent = 0;
-
- m_header.count = 0;
- m_header.state = _state;
-
- m_nodes.clear();
- m_parent = 0;
-}
-//-----------------------------------------------------------------------------
-
-sharable::TreeFragment * TreeNodeBuilder::allocTreeFragment()
-{
- OSL_ENSURE(m_nodes.size() == m_header.count, "TreeNodeBuilder: node count mismatch");
-
- sharable::TreeFragment *pFragment = sharable::TreeFragment::allocate(m_header.count);
- pFragment->header = m_header;
- std::copy(m_nodes.begin(),m_nodes.end(),pFragment->nodes);
-
- return (sharable::TreeFragment *)( pFragment );
-}
-//-----------------------------------------------------------------------------
-
-void TreeNodeBuilder::linkTreeFragment(sharable::TreeFragment * _aTreeFragment)
-{
- LinkSetNodes().linkTree(_aTreeFragment);
-}
-//-----------------------------------------------------------------------------
-
-sharable::TreeFragment * TreeNodeBuilder::createTreeFragment()
-{
- sharable::TreeFragment * aResult = allocTreeFragment();
-
- if (aResult != NULL)
- {
- linkTreeFragment(aResult);
-
- m_nodes.clear(); // ownership of indirect data has gone ...
- }
- return aResult;
-}
-//-----------------------------------------------------------------------------
-
-sal_uInt16 TreeNodeBuilder::startGroup( rtl_uString * _aName, sal_uInt8 _aFlags )
-{
- sal_uInt16 nNewIndex = addNode(_aName,_aFlags,Type::nodetype_group);
-
- lastNode().group.numDescendants = 0;
-
- m_parent = nNewIndex;
-
- return nNewIndex;
-}
-//-----------------------------------------------------------------------------
-
-void TreeNodeBuilder::endGroup( sal_uInt16 _nPos )
-{
- // while (_nPos < m_parent) endGroup(m_parent);
- OSL_PRECOND(_nPos == m_parent, "TreeNodeBuilder: Group being closed is not the current parent");
-
- OSL_ENSURE(nodeAt(_nPos).isGroup(), "TreeNodeBuilder: Group being closed is not a group");
-
- OSL_ENSURE(m_nodes.size() == m_header.count, "TreeNodeBuilder: node count mismatch");
-
- sharable::GroupNode & rGroup = nodeAt(_nPos).group;
-
- rGroup.numDescendants = sal_uInt16( m_nodes.size() - static_cast< ::std::size_t >(_nPos) - 1 );
- m_parent = m_parent - rGroup.info.parent;
-}
-//-----------------------------------------------------------------------------
-
-void TreeNodeBuilder::addSet( rtl_uString * _aName, sal_uInt8 _aFlags, sal_uInt8 * _aElementType )
-{
- addNode(_aName,_aFlags,Type::nodetype_set);
-
- lastNode().set.elementType = _aElementType;
- lastNode().set.elements = 0;
-}
-
-//-----------------------------------------------------------------------------
-
-void TreeNodeBuilder::addValue( rtl_uString * _aName, sal_uInt8 _aFlags,
- sal_uInt8 _aValueType,
- sharable::AnyData _aUserValue,
- sharable::AnyData _aDefaultValue )
-{
- OSL_PRECOND(_aValueType == (_aValueType & Type::mask_valuetype), "TreeNodeBuilder: invalid value type");
-
- addNode(_aName,_aFlags,sal_uInt8(Type::nodetype_value | _aValueType));
-
- lastNode().value.value = _aUserValue;
- lastNode().value.defaultValue = _aDefaultValue;
-}
-//-----------------------------------------------------------------------------
-
-
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-sharable::TreeFragment * CopyingDataTreeBuilder::buildTree(sharable::TreeFragment * sourceTree)
-{
- OSL_ENSURE(sourceTree != 0, "Trying to build a tree from NULL data");
-
- rtl_uString * aTreeName = acquireString( sourceTree->getName());
- this->builder().resetTreeFragment(aTreeName, sourceTree->header.state);
-
- this->visitNode(sourceTree->getRootNode());
-
- return this->createTree();
-}
-//-----------------------------------------------------------------------------
-
-bool CopyingDataTreeBuilder::handle(sharable::ValueNode * node)
-{
- rtl_uString * aNodeName = acquireString( node->info.getName());
- sal_uInt8 aFlags = node->info.flags;
-
- sal_uInt8 aType = sal_uInt8( node->info.type & Type::mask_valuetype );
-
- sharable::AnyData aNewValue, aNewDefault;
- if (aFlags & Flags::valueAvailable)
- aNewValue = sharable::allocData(aType, node->getUserValue());
- else
- aNewValue.data = 0;
-
- if (aFlags & Flags::defaultAvailable)
- aNewDefault = sharable::allocData(aType, node->getDefaultValue());
- else
- aNewDefault.data = 0;
-
- this->builder().addValue(aNodeName,aFlags,aType,aNewValue,aNewDefault);
-
- return false;
-}
-//-----------------------------------------------------------------------------
-
-bool CopyingDataTreeBuilder::handle(sharable::GroupNode * node)
-{
- rtl_uString * aNodeName = acquireString( node->info.getName());
- sal_uInt8 aFlags = node->info.flags;
-
- sal_uInt16 nGroupOffset = this->builder().startGroup(aNodeName,aFlags);
- this->visitChildren(node);
- this->builder().endGroup(nGroupOffset);
-
- return false;
-}
-//-----------------------------------------------------------------------------
-
-bool CopyingDataTreeBuilder::handle(sharable::SetNode * node)
-{
- rtl_uString * aNodeName = acquireString( node->info.getName());
- sal_uInt8 aFlags = node->info.flags;
- sal_uInt8 * aTemplate = this->makeTemplateData(node->elementType);
-
- this->builder().addSet(aNodeName,aFlags,aTemplate);
-
- OSL_ASSERT( this->builder().lastNode().isSet() );
- sharable::SetNode& _aNewSet = this->builder().lastNode().set;
-
- _aNewSet.elements = ElementListBuilder().buildElementList(node);
-
- return false;
-}
-//-----------------------------------------------------------------------------
-
-sal_uInt8 * CopyingDataTreeBuilder::makeTemplateData(sal_uInt8 * _aSourceTemplate)
-{
- return sharable::SetNode::copyTemplateData(_aSourceTemplate);
-}
-//-----------------------------------------------------------------------------
-
-sharable::TreeFragment * CopyingDataTreeBuilder::ElementListBuilder::buildElementList(sharable::SetNode * set)
-{
- OSL_ASSERT(set != 0);
-
- m_aCollector.resetElementList();
-
- this->visitElements(set);
-
- return m_aCollector.getElementListAndClear();
-}
-//-----------------------------------------------------------------------------
-
-bool CopyingDataTreeBuilder::ElementListBuilder::handle(sharable::TreeFragment * tree)
-{
- sharable::TreeFragment * aNewElement = CopyingDataTreeBuilder().buildTree(tree);
-
- m_aCollector.addElement(aNewElement);
-
- return false;
-}
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-rtl_uString * ConvertingDataTreeBuilder::allocName(INode const & _aNode)
-{
- rtl::OUString sNextName = _aNode.getName();
-
- if (m_sRootName.getLength())
- {
- sNextName = m_sRootName;
- m_sRootName = rtl::OUString();
- }
-
- return acquireString( sNextName);
-}
-//-----------------------------------------------------------------------------
-
-sharable::TreeFragment * ConvertingDataTreeBuilder::buildElement(INode const& _aNode, rtl::OUString const & _aTypeName, bool _bWithDefaults)
-{
- m_sRootName = _aTypeName;
- m_bWithDefaults = _bWithDefaults;
-
- rtl_uString * aTreeName = acquireString( _aNode.getName());
- this->builder().resetTreeFragment(aTreeName, makeState(_aNode.getAttributes()));
-
-
- this->applyToNode(_aNode);
-
- return this->createTree();
-}
-//-----------------------------------------------------------------------------
-
-sharable::TreeFragment * ConvertingDataTreeBuilder::buildTree(rtl::OUString const & _aTreeName, INode const& _aNode, bool _bWithDefaults)
-{
- m_sRootName = rtl::OUString();
- m_bWithDefaults = _bWithDefaults;
-
- rtl_uString * aTreeName = acquireString( _aTreeName );
- this->builder().resetTreeFragment(aTreeName, makeState(_aNode.getAttributes()));
-
-
- this->applyToNode(_aNode);
-
- return this->createTree();
-}
-//-----------------------------------------------------------------------------
-
-void ConvertingDataTreeBuilder::handle(ISubtree const & _aNode)
-{
- rtl_uString * aNodeName = allocName( _aNode );
- sal_uInt8 aFlags = makeFlags(_aNode.getAttributes());
-
- if (_aNode.isSetNode())
- {
- sal_uInt8 * aTemplate = this->makeTemplateData(_aNode.getElementTemplateName(),
- _aNode.getElementTemplateModule());
-
- this->builder().addSet(aNodeName,aFlags,aTemplate);
-
- OSL_ASSERT( this->builder().lastNode().isSet() );
- sharable::SetNode& _aNewSet = this->builder().lastNode().set;
-
- _aNewSet.elements = ElementListBuilder().buildElementList(_aNode, m_bWithDefaults);
- }
- else
- {
- sal_uInt16 nGroupOffset = this->builder().startGroup(aNodeName,aFlags);
- this->applyToChildren(_aNode);
- this->builder().endGroup(nGroupOffset);
- }
-}
-//-----------------------------------------------------------------------------
-
-void ConvertingDataTreeBuilder::handle(ValueNode const & _aNode)
-{
- rtl_uString * aNodeName = allocName( _aNode );
- sal_uInt8 aFlags = makeFlags(_aNode.getAttributes());
-
- sal_uInt8 aType = sharable::getTypeCode(_aNode.getValueType());
-
- sharable::AnyData aNewValue; aNewValue.data = 0;
- sharable::AnyData aNewDefault; aNewDefault.data = 0;
-
- OSL_ASSERT( !(aFlags & (Flags::valueAvailable | Flags::defaultAvailable)) );
-
- if (!_aNode.isDefault())
- {
- uno::Any aValue = _aNode.getValue();
- if (aValue.hasValue())
- {
- aNewValue = sharable::allocData(aType, aValue);
- aFlags |= Flags::valueAvailable;
- }
- }
-
- if (_aNode.hasUsableDefault())
- {
- uno::Any aDefault = _aNode.getDefault();
- if (aDefault.hasValue())
- {
- aNewDefault = sharable::allocData(aType, aDefault);
- aFlags |= Flags::defaultAvailable;
- }
- }
-
- this->builder().addValue(aNodeName,aFlags,aType,aNewValue,aNewDefault);
-}
-//-----------------------------------------------------------------------------
-
-sal_uInt8 ConvertingDataTreeBuilder::makeState(node::Attributes const & _aAttributes)
-{
- sal_uInt8 state;
-
- switch (_aAttributes.state())
- {
- case node::isDefault: state = State::defaulted; m_bWithDefaults = true; break;
- case node::isMerged: state = State::merged; break;
- case node::isReplaced: state = State::replaced; m_bWithDefaults = false; break;
- case node::isAdded: state = State::added; m_bWithDefaults = false; break;
-
- default: OSL_ASSERT(false); state = 0; break;
- }
-
- if (_aAttributes.isReadonly())
- state |= State::flag_readonly;
- //Map mandatory and Removable
- if (_aAttributes.isMandatory())
- state |= State::flag_mandatory;
-
- if (_aAttributes.isRemovable())
- state |= State::flag_removable;
-
- if ( m_bWithDefaults )
- state |= State::flag_default_avail;
-
- return state;
-}
-//-----------------------------------------------------------------------------
-
-sal_uInt8 ConvertingDataTreeBuilder::makeFlags(node::Attributes const & _aAttributes)
-{
- sal_uInt8 flags = 0;
-
- if ( _aAttributes.isReadonly())
- flags |= Flags::readonly;
-
- if ( _aAttributes.isFinalized())
- flags |= Flags::finalized;
-
- if ( _aAttributes.isNullable())
- flags |= Flags::nullable;
-
- if ( _aAttributes.isLocalized())
- flags |= Flags::localized;
-
- if (_aAttributes.isDefault())
- flags |= Flags::defaulted; // somewhat redundant with State
-
- if (!_aAttributes.isReplacedForUser())
- flags |= Flags::defaultable; // redundant with State (merged || defaulted)
-
- return flags;
-}
-//-----------------------------------------------------------------------------
-
-sal_uInt8 * ConvertingDataTreeBuilder::makeTemplateData(rtl::OUString const & _aTemplateName, rtl::OUString const & _aTemplateModule)
-{
- return sharable::SetNode::allocTemplateData(_aTemplateName, _aTemplateModule );
-}
-//-----------------------------------------------------------------------------
-
-sharable::TreeFragment * ConvertingDataTreeBuilder::ElementListBuilder::buildElementList(ISubtree const & _aSet, bool _bWithDefaults)
-{
- OSL_PRECOND(_aSet.isSetNode(), "Node must be a set");
-
- m_aCollector.resetElementList();
-
- m_sTypeName = _aSet.getElementTemplateName();
- m_bWithDefaults = _bWithDefaults;
-
- this->applyToChildren(_aSet);
-
- return m_aCollector.getElementListAndClear();
-}
-//-----------------------------------------------------------------------------
-
-void ConvertingDataTreeBuilder::ElementListBuilder::handleNode(INode const & _aSourceNode)
-{
- sharable::TreeFragment * aNewElement = ConvertingDataTreeBuilder()
- .buildElement(_aSourceNode,m_sTypeName,m_bWithDefaults);
-
- m_aCollector.addElement(aNewElement);
-}
-//-----------------------------------------------------------------------------
-
-void ConvertingDataTreeBuilder::ElementListBuilder::handle(ValueNode const & _aSourceNode)
-{
- handleNode(_aSourceNode);
-}
-//-----------------------------------------------------------------------------
-
-void ConvertingDataTreeBuilder::ElementListBuilder::handle(ISubtree const & _aSourceNode)
-{
- handleNode(_aSourceNode);
-}
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-std::auto_ptr<INode> ConvertingNodeBuilder::buildNode(sharable::TreeFragment * sourceTree, bool _bUseTreeName)
-{
- std::auto_ptr<INode> pResult = this->buildNode(sourceTree == 0 ? 0 : sourceTree->getRootNode());
- if (pResult.get() != NULL)
- {
- // use the element name !
- if (_bUseTreeName) pResult->setName( sourceTree->getName() );
-
- // do something about attributes here ?
- }
- return pResult;
-}
-//-----------------------------------------------------------------------------
-
-std::auto_ptr<INode> ConvertingNodeBuilder::buildNode(sharable::Node * sourceNode)
-{
- OSL_ENSURE( !m_pNode.get(), "Old node tree will be dropped");
- visitNode(sourceNode);
- return m_pNode;
-}
-//-----------------------------------------------------------------------------
-
-std::auto_ptr<ISubtree> ConvertingNodeBuilder::buildNodeTree(sharable::GroupNode * groupNode) const
-{
- std::auto_ptr<ISubtree> pResult = convertNode(groupNode);
-
- if (pResult.get() != NULL)
- {
- ConvertingSubnodeBuilder aCollector(m_rNodeFactory, *pResult);
- aCollector.addChildren(groupNode);
- }
-
- return pResult;
-}
-//-----------------------------------------------------------------------------
-
-std::auto_ptr<ISubtree> ConvertingNodeBuilder::buildNodeTree(sharable::SetNode * setNode) const
-{
- std::auto_ptr<ISubtree> pResult = convertNode(setNode);
-
- if (pResult.get() != NULL)
- {
- ConvertingSubnodeBuilder aCollector(m_rNodeFactory, *pResult);
- aCollector.addElements(setNode);
- }
-
- return pResult;
-}
-//-----------------------------------------------------------------------------
-
-std::auto_ptr<ISubtree> ConvertingNodeBuilder::convertNode(sharable::GroupNode * groupNode) const
-{
- return m_rNodeFactory.createGroupNode( groupNode->info.getName(),
- convertAttributes(sharable::node(groupNode)));
-}
-//-----------------------------------------------------------------------------
-
-std::auto_ptr<ISubtree> ConvertingNodeBuilder::convertNode(sharable::SetNode * setNode) const
-{
- return m_rNodeFactory.createSetNode(setNode->info.getName(),
- setNode->getElementTemplateName(),
- setNode->getElementTemplateModule(),
- convertAttributes(sharable::node(setNode)));
-}
-//-----------------------------------------------------------------------------
-
-std::auto_ptr<ValueNode> ConvertingNodeBuilder::convertNode(sharable::ValueNode * valueNode) const
-{
- uno::Any aUserValue = valueNode->getUserValue();
- uno::Any aDefValue = valueNode->getDefaultValue();
-
- if (aUserValue.hasValue() || aDefValue.hasValue())
- {
- return m_rNodeFactory.createValueNode(valueNode->info.getName(),
- aUserValue, aDefValue,
- convertAttributes(sharable::node(valueNode)));
- }
- else
- {
- return m_rNodeFactory.createNullValueNode(valueNode->info.getName(),
- valueNode->getValueType(),
- convertAttributes(sharable::node(valueNode)));
- }
-}
-//-----------------------------------------------------------------------------
-
-bool ConvertingNodeBuilder::handle(sharable::ValueNode * node)
-{
- m_pNode = base_ptr(buildNodeTree(node));
- return true;
-}
-//-----------------------------------------------------------------------------
-
-bool ConvertingNodeBuilder::handle(sharable::GroupNode * node)
-{
- m_pNode = base_ptr(buildNodeTree(node));
- return true;
-}
-//-----------------------------------------------------------------------------
-
-bool ConvertingNodeBuilder::handle(sharable::SetNode * node)
-{
- m_pNode = base_ptr(buildNodeTree(node));
- return true;
-}
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-bool ConvertingSubnodeBuilder::handle(sharable::TreeFragment * tree)
-{
- OSL_ASSERT(m_rParentNode.isSetNode());
- m_rParentNode.addChild(m_aSubnodeBuilder.buildNode(tree, true));
- return false;
-}
-//-----------------------------------------------------------------------------
-
-bool ConvertingSubnodeBuilder::handle(sharable::Node * node)
-{
- OSL_ASSERT(!m_rParentNode.isSetNode());
- m_rParentNode.addChild(m_aSubnodeBuilder.buildNode(node));
- return false;
-}
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-void DataTreeDefaultMerger::mergeDefaults(sharable::TreeFragment * /*_aBaseAddress*/, INode const& /*_aDefaultNode*/)
-{
-}
-//-----------------------------------------------------------------------------
-
-void DataTreeDefaultMerger::handle(ISubtree const & /*_aNode*/)
-{
-}
-//-----------------------------------------------------------------------------
-
-void DataTreeDefaultMerger::handle(ValueNode const & /*_aNode*/)
-{
-}
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-sharable::TreeFragment * DataTreeCleanup::destroyTree(sharable::TreeFragment * _aBaseAddress)
-{
- sharable::TreeFragment *pData = _aBaseAddress;
-
- sharable::TreeFragment *pNext = pData->header.next;
-
- sal_uInt16 const nCount = pData->header.count;
-
- destroyData( & pData->header );
-
- for (sal_uInt16 i = 0; i< nCount; ++i)
- {
- destroyNode( addressOfNodeAt(_aBaseAddress,i) );
- }
-
- sharable::TreeFragment::free_shallow( pData );
-
- return (sharable::TreeFragment *)( pNext );
-}
-//-----------------------------------------------------------------------------
-
-void DataTreeCleanup::destroyNode(sharable::Node * _aNodeAddress)
-{
- sharable::Node * pNode = _aNodeAddress;
-
- sal_uInt8 aTypeTag = pNode->info.type;
- switch ( aTypeTag & Type::mask_nodetype )
- {
- case Type::nodetype_group:
- destroyData( &pNode->group );
- break;
- case Type::nodetype_value:
- destroyData( &pNode->value );
- break;
- case Type::nodetype_set:
- destroyData( &pNode->set );
- break;
- default:
- OSL_ENSURE(false, "Cannot destroy node: Invalid type tag in node");
- break;
- }
-}
-//-----------------------------------------------------------------------------
-
-void DataTreeCleanup::destroyData(sharable::TreeFragmentHeader * _pHeader)
-{
- // 'component' is owned elsewhere -> leave alone
-
- rtl_uString * aName = _pHeader->name;
-
- rtl_uString_release( aName );
-}
-//-----------------------------------------------------------------------------
-
-void DataTreeCleanup::destroyData(sharable::NodeInfo * _pNodeInfo)
-{
- rtl_uString * aName = _pNodeInfo->name;
-
- if (aName) rtl_uString_release( aName );
-}
-//-----------------------------------------------------------------------------
-
-void DataTreeCleanup::destroyData(sharable::SetNode * _pNode)
-{
- sharable::TreeFragment * aElement( _pNode->elements );
-
- sal_uInt8 * aTemplate = _pNode->elementType;;
-
- destroyData(&_pNode->info);
-
- while (aElement != NULL)
- aElement = destroyTree(aElement);
-
- sharable::SetNode::releaseTemplateData( aTemplate );
-}
-//-----------------------------------------------------------------------------
-
-void DataTreeCleanup::destroyData(sharable::GroupNode * _pNode)
-{
- destroyData(&_pNode->info);
- // nothing more to do
-}
-//-----------------------------------------------------------------------------
-
-void DataTreeCleanup::destroyData(sharable::ValueNode * _pNode)
-{
- sal_uInt8 aValueType = sal_uInt8( _pNode->info.type & Type::mask_valuetype );
- sal_uInt8 aFlags = _pNode->info.flags;
-
- destroyData(&_pNode->info);
-
- if (aFlags & Flags::valueAvailable)
- freeData( aValueType, _pNode->value );
-
- if (aFlags & Flags::defaultAvailable)
- freeData( aValueType, _pNode->defaultValue );
-
-}
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
- //-------------------------------------------------------------------------
- }
-//-----------------------------------------------------------------------------
-} // namespace configmgr
-
-
diff --git a/configmgr/source/tree/changes.cxx b/configmgr/source/tree/changes.cxx
deleted file mode 100644
index f8aac31e64..0000000000
--- a/configmgr/source/tree/changes.cxx
+++ /dev/null
@@ -1,244 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-
-#include <stdio.h>
-
-#include "change.hxx"
-#include <osl/diagnose.h>
-
-namespace configmgr
-{
-
-//==========================================================================
-//= ValueChange
-//==========================================================================
-
-// works reliably only if old value is set and the value really changes
-uno::Type implGetValueType(uno::Any const & _aValue, uno::Any const & _aOldValue)
-{
- if (_aValue.hasValue())
- {
- OSL_ENSURE(!_aOldValue.hasValue() || _aOldValue.getValueType() == _aValue.getValueType(),
- "ERROR: Type mismatch in value change");
-
- return _aValue.getValueType();
- }
- else
- {
- OSL_ENSURE(_aOldValue.hasValue(),"WARNING: Cannot determine value type of change");
- return _aOldValue.getValueType();
- }
-}
-// -------------------------------------------------------------------------
-static inline bool isDefaultMode(ValueChange::Mode _eMode)
-{ return (_eMode == ValueChange::setToDefault) || (_eMode == ValueChange::changeDefault); }
-// -------------------------------------------------------------------------
-static inline bool isLayerChangeMode(ValueChange::Mode _eMode)
-{ return (_eMode == ValueChange::setToDefault) || (_eMode == ValueChange::wasDefault); }
-// -----------------------------------------------------------------------------
-ValueChange::ValueChange(rtl::OUString const& _rName,
- const node::Attributes& _rAttributes,
- Mode _eMode,
- uno::Any const & aNewValue, uno::Any const & aOldValue)
- : Change(_rName, isDefaultMode(_eMode))
- ,m_aValueType( implGetValueType(aNewValue,aOldValue) )
- ,m_aValue(aNewValue)
- ,m_aOldValue(aOldValue)
- ,m_aAttributes(_rAttributes)
- ,m_eMode(_eMode)
-{
- m_aAttributes.markAsDefault(Change::isToDefault());
-}
-
-// -----------------------------------------------------------------------------
-void ValueChange::setNewValue(const uno::Any& _rNewVal)
-{
- OSL_ENSURE(_rNewVal.getValueType() == m_aValueType || !_rNewVal.hasValue(),
- "ValueChange: Type mismatch in setNewValue" );
-
- m_aValue = _rNewVal;
-}
-
-// -----------------------------------------------------------------------------
-std::auto_ptr<Change> ValueChange::clone() const
-{
- return std::auto_ptr<Change>(new ValueChange(*this));
-}
-
-// -----------------------------------------------------------------------------
-bool ValueChange::isChange() const // makes sense only if old value is set
-{
- return isLayerChangeMode(m_eMode) || (m_aOldValue != m_aValue);
-}
-// -------------------------------------------------------------------------
-namespace tree_changes_internal {
- inline void doAdjust(uno::Any& aActual, uno::Any const& aTarget)
- {
- // If set - it should already match
- OSL_ASSERT(!aActual.hasValue() || aTarget == aActual);
- aActual = aTarget;
- }
-}
-
-// -------------------------------------------------------------------------
-void ValueChange::applyChangeNoRecover(ValueNode& aValue) const
-{
- switch (getMode())
- {
- case wasDefault:
- OSL_ASSERT(aValue.isDefault());
- case changeValue:
- aValue.setValue(getNewValue());
- break;
-
- case setToDefault:
- aValue.setDefault();
- break;
-
- case changeDefault:
- aValue.changeDefault(getNewValue());
- break;
-
- default:
- OSL_ENSURE(0, "Unknown mode found for ValueChange");
- break;
- }
-}
-
-//==========================================================================
-//= AddNode
-//==========================================================================
-AddNode::AddNode(rtl::Reference< data::TreeSegment > const & _aAddedTree, rtl::OUString const& _rName, bool _bToDefault)
- :Change(_rName,_bToDefault)
- ,m_aOwnNewNode(_aAddedTree)
- ,m_aOwnOldNode()
- ,m_aInsertedTree(NULL)
- ,m_bReplacing(false)
-{
-}
-
-//--------------------------------------------------------------------------
-AddNode::~AddNode()
-{
-}
-
-// -----------------------------------------------------------------------------
-AddNode::AddNode(const AddNode& _aObj)
-: Change(_aObj)
-, m_aOwnNewNode(data::TreeSegment::create(_aObj.m_aOwnNewNode))
-, m_aOwnOldNode(data::TreeSegment::create(_aObj.m_aOwnOldNode))
-, m_aInsertedTree(_aObj.m_aInsertedTree)
-, m_bReplacing(_aObj.m_bReplacing)
-{
-}
-
-// -----------------------------------------------------------------------------
-std::auto_ptr<Change> AddNode::clone() const
-{
- return std::auto_ptr<Change>(new AddNode(*this));
-}
-
-//--------------------------------------------------------------------------
-void AddNode::setInsertedAddress(sharable::TreeFragment * const & _aInsertedTree)
-{
- OSL_ENSURE( m_aInsertedTree == NULL, "AddNode already was applied - inserted a second time ?");
- m_aInsertedTree = _aInsertedTree;
-}
-//--------------------------------------------------------------------------
-
-#if 0
-void AddNode::expectReplacedNode(INode const* pOldNode)
-{
- if (pOldNode != m_aOwnOldNode.getRoot())
- {
- OSL_ENSURE(!m_aOwnOldNode.is(), "This AddNode already owns a replaced Node - throwing that away");
- m_aOwnOldNode.clear();
- }
- m_pOldNode = pOldNode;
-}
-#endif
-//--------------------------------------------------------------------------
-
-void AddNode::takeReplacedTree(rtl::Reference< data::TreeSegment > const & _aReplacedTree)
-{
- m_aOwnOldNode = _aReplacedTree;
-
- if (m_aOwnOldNode.is()) m_bReplacing = true;
-}
-
-
-//==========================================================================
-//= RemoveNode
-//==========================================================================
-RemoveNode::RemoveNode(rtl::OUString const& _rName, bool _bToDefault)
- :Change(_rName,_bToDefault)
- ,m_aOwnOldNode()
-{
-}
-
-//--------------------------------------------------------------------------
-RemoveNode::~RemoveNode()
-{
-}
-// -----------------------------------------------------------------------------
-RemoveNode::RemoveNode(const RemoveNode& _aObj)
-: Change(_aObj)
-, m_aOwnOldNode(data::TreeSegment::create(_aObj.m_aOwnOldNode))
-{
-}
-
-// -----------------------------------------------------------------------------
-std::auto_ptr<Change> RemoveNode::clone() const
-{
- return std::auto_ptr<Change>(new RemoveNode(*this));
-}
-//--------------------------------------------------------------------------
-#if 0
-void RemoveNode::expectRemovedNode(INode const* pOldNode)
-{
- if (pOldNode != m_aOwnOldNode.getRoot())
- {
- OSL_ENSURE(!m_aOwnOldNode.is(), "This RemoveNode already owns a Node - throwing that away");
- m_aOwnOldNode.clear();
- }
- m_pOldNode = pOldNode;
-}
-#endif
-//--------------------------------------------------------------------------
-
-void RemoveNode::takeRemovedTree(rtl::Reference< data::TreeSegment > const & _aRemovedTree)
-{
- m_aOwnOldNode = _aRemovedTree;
-}
-
-//--------------------------------------------------------------------------
-} // namespace configmgr
-
diff --git a/configmgr/source/tree/cmtree.cxx b/configmgr/source/tree/cmtree.cxx
deleted file mode 100644
index c24aaaaf6e..0000000000
--- a/configmgr/source/tree/cmtree.cxx
+++ /dev/null
@@ -1,378 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <stdio.h>
-
-#include "subtree.hxx"
-#include "change.hxx"
-#include "treechangelist.hxx"
-
-//#include "treeactions.hxx"
-#include <rtl/string.hxx>
-#include <rtl/ustring.hxx>
-#include <osl/diagnose.h>
-
-#ifndef INCLUDED_DEQUE
-#include <deque>
-#define INCLUDED_DEQUE
-#endif
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif
-#ifndef INCLUDED_EXCEPTION
-#include <exception>
-#define INCLUDED_EXCEPTION
-#endif
-#ifndef INCLUDED_SET
-#include <set>
-#define INCLUDED_SET
-#endif
-#include <algorithm>
-
-namespace configmgr
-{
-
-// ------------------------ ChildListSet implementations ------------------------
- ChildListSet::ChildListSet(ChildListSet const& aSet, treeop::DeepChildCopy)
- : m_aChildList(aSet.m_aChildList.size())
- {
- for (size_t i = 0; i < aSet.m_aChildList.size(); i++)
- {
- m_aChildList[i] = aSet.m_aChildList[i]->clone().release();
- }
- }
- ChildListSet::~ChildListSet()
- {
- for (size_t i = 0; i < m_aChildList.size(); i++)
- delete m_aChildList[i];
- }
-
- struct ltNode
- {
- ltNode() {}
-
- bool operator()(const configmgr::INode* n1, const configmgr::INode* n2) const
- {
- return n1->getName().compareTo(n2->getName()) < 0;
- }
- };
-
- std::vector< INode* >::iterator ChildListSet::find(INode *pNode) const
- {
- std::vector< INode* > &rList = const_cast<std::vector< INode* > &>(m_aChildList);
- std::pair<std::vector< INode* >::iterator, std::vector< INode* >::iterator> aRange;
- ltNode aCompare;
- aRange = std::equal_range(rList.begin(), rList.end(), pNode, aCompare);
- if (aRange.second - aRange.first == 0)
- return rList.end();
- else
- return aRange.first;
- }
-
- // Keep the list sorted ...
- std::pair<std::vector< INode* >::iterator, bool> ChildListSet::insert(INode *pNode)
- {
- // Inserted records are (mostly) already in order
- if (m_aChildList.size() > 0)
- {
- sal_Int32 nCmp = pNode->getName().compareTo(
- m_aChildList.back()->getName());
- if (nCmp == 0)
- {
- return std::pair<std::vector< INode* >::iterator, bool>(m_aChildList.end(), false);
- }
- else if (nCmp < 0)
- {
- std::vector< INode* >::iterator aIns;
- ltNode aCompare;
- aIns = std::lower_bound(m_aChildList.begin(), m_aChildList.end(), pNode, aCompare);
- if (aIns != m_aChildList.end() && pNode->getName().compareTo((*aIns)->getName()) == 0)
- return std::pair<std::vector< INode* >::iterator, bool>(m_aChildList.end(), false);
- return std::pair<std::vector< INode* >::iterator, bool>(m_aChildList.insert(aIns, pNode), true);
- }
- }
- // simple append - the common case.
- return std::pair<std::vector< INode* >::iterator, bool>(m_aChildList.insert(m_aChildList.end(), pNode), true);
- }
-
- INode *ChildListSet::erase(INode *pNode)
- {
- std::vector< INode* >::iterator aIter = find(pNode);
-
- if (aIter != m_aChildList.end())
- {
- INode *pCopy = *aIter;
- m_aChildList.erase(aIter);
- return pCopy;
- }
- else
- return NULL;
- }
-
-// ---------------------------- Node implementation ----------------------------
-
- INode::INode(rtl::OUString const& aName, node::Attributes _aAttr)
- :m_aName(aName)
- ,m_aAttributes(_aAttr){}
- // CopyCTor will be create automatically
-
- INode::~INode() {}
-
- ISubtree* INode::asISubtree(){return NULL;}
- ISubtree const* INode::asISubtree() const {return NULL;}
- ValueNode* INode::asValueNode() {return NULL;}
- ValueNode const* INode::asValueNode() const {return NULL;}
-
- void INode::modifyState(node::State _eNewState)
- {
- m_aAttributes.setState(_eNewState);
- }
-
- void INode::modifyAccess(node::Access _aAccessLevel)
- {
- OSL_ENSURE( node::accessWritable <= _aAccessLevel && _aAccessLevel <= node::accessReadonly,"Invalid access level for Node");
-
- m_aAttributes.setAccess(_aAccessLevel);
- }
-
- void INode::markMandatory()
- {
- m_aAttributes.markMandatory();
- }
-
- void INode::markRemovable()
- {
- m_aAttributes.markRemovable();
- }
-
- void INode::promoteAccessToDefault()
- {
- if (m_aAttributes.isFinalized())
- m_aAttributes.setAccess(node::accessReadonly);
-
- if ( m_aAttributes.isMandatory())
- m_aAttributes.setRemovability(false,false);
- }
-
-// ------------------------- SearchNode implementation -------------------------
- SearchNode::SearchNode(rtl::OUString const& aName)
- :INode(aName, node::Attributes()){}
-
- std::auto_ptr<INode> SearchNode::clone() const {return std::auto_ptr<INode>(new SearchNode(*this));}
-
- SearchNode::~SearchNode(){}
-
- //==========================================================================
- //= OPropagateLevels
- //==========================================================================
- /** fills a subtree with the correct level informations
- */
- struct OPropagateLevels : public NodeModification
- {
- public:
- OPropagateLevels(sal_Int16 _nParentLevel, sal_Int16 _nParentDefaultLevel)
- : m_nLevel ( childLevel(_nParentLevel) )
- , m_nDefaultLevel ( childLevel(_nParentDefaultLevel) )
- {
- }
- virtual void handle(ValueNode&) { /* not interested in value nodes */ }
- virtual void handle(ISubtree& _rSubtree)
- {
- _rSubtree.setLevels(m_nLevel, m_nDefaultLevel);
- }
-
- static sal_Int16 childLevel(sal_Int16 _nLevel)
- {
- OSL_ASSERT(0 > treeop::ALL_LEVELS);
- return (_nLevel > 0) ? _nLevel-1 : _nLevel;
- }
- protected:
- sal_Int16 m_nLevel;
- sal_Int16 m_nDefaultLevel;
- };
-
-
-// -------------------------- ISubtree implementation --------------------------
- ISubtree* ISubtree::asISubtree() {return this;}
- ISubtree const* ISubtree::asISubtree() const {return this;}
-
- //--------------------------------------------------------------------------
- static inline bool adjustLevel(sal_Int16& _rLevel, sal_Int16 _nNewLevel)
- {
- if (_rLevel == treeop::ALL_LEVELS) return false;
- if (_nNewLevel <= _rLevel &&
- _nNewLevel != treeop::ALL_LEVELS) return false;
-
- _rLevel = _nNewLevel;
- return true;
- }
-
- //--------------------------------------------------------------------------
- void ISubtree::setLevels(sal_Int16 _nLevel, sal_Int16 _nDefaultLevels)
- {
- bool bActive = false;
-
- if (_nLevel && adjustLevel(m_nLevel, _nLevel))
- bActive = true;
-
- if (_nDefaultLevels && adjustLevel(m_nDefaultLevels, _nDefaultLevels))
- bActive = true;
-
- // forward the level numbers to any child subtrees we have
- if (bActive)
- {
- OPropagateLevels aPropagate(_nLevel,_nDefaultLevels);
- aPropagate.applyToChildren(*this);
- }
- }
-
-// --------------------------- Subtree implementation ---------------------------
- std::auto_ptr<INode> Subtree::clone() const
- {
- return std::auto_ptr<INode>(new Subtree(*this, treeop::DeepChildCopy()));
- }
-
- INode* Subtree::doGetChild(rtl::OUString const& aName) const
- {
- SearchNode searchObj(aName);
-
- std::vector< INode* >::iterator aIter = m_aChildren.find(&searchObj);
- return aIter != m_aChildren.end() ? *aIter : NULL;
- }
-
- INode* Subtree::addChild(std::auto_ptr<INode> aNode) // takes ownership
- {
- rtl::OUString aName = aNode->getName();
- std::pair<std::vector< INode* >::iterator, bool> aInserted =
- m_aChildren.insert(aNode.get());
- if (aInserted.second)
- aNode.release();
- return *aInserted.first;
- }
-
- ::std::auto_ptr<INode> Subtree::removeChild(rtl::OUString const& aName)
- {
- SearchNode searchObj(aName);
- return ::std::auto_ptr<INode>(m_aChildren.erase(&searchObj));
- }
-// // -------------------------- ValueNode implementation --------------------------
-
- void Subtree::forEachChild(NodeAction& anAction) const
- {
- for(std::vector< INode* >::const_iterator it = m_aChildren.begin();
- it != m_aChildren.end();
- ++it)
- (**it).dispatch(anAction);
- }
-
- void Subtree::forEachChild(NodeModification& anAction)
- {
- std::vector< INode* >::iterator it = m_aChildren.begin();
- while( it != m_aChildren.end() )
- {
- // modification-safe iteration
- (**it++).dispatch(anAction);
- }
- }
-
-// // -------------------------- ValueNode implementation --------------------------
- bool ValueNode::setValueType(uno::Type const& _aType)
- {
- if (_aType == this->getValueType()) return true;
-
- if (!this->isNull()) return false;
-
- uno::TypeClass eTC = this->getValueType().getTypeClass();
- if (eTC != uno::TypeClass_VOID && eTC != uno::TypeClass_ANY)
- return false;
-
- m_aValuePair = AnyPair(_aType);
-
- OSL_ASSERT(_aType == this->getValueType());
-
- return true;
- }
- bool ValueNode::setValue(com::sun::star::uno::Any const& _aValue)
- {
- sal_Bool bRet = m_aValuePair.setFirst(_aValue);
- if (bRet) this->markAsDefault(false);
- return !! bRet;
- }
-
- bool ValueNode::changeDefault(com::sun::star::uno::Any const& _aValue)
- {
- return !! m_aValuePair.setSecond(_aValue);
- }
-
- void ValueNode::setDefault()
- {
- OSL_PRECOND( hasUsableDefault(), "No default value to set for value node");
- m_aValuePair.clear( selectValue() );
- this->markAsDefault();
- OSL_POSTCOND( isDefault(), "Could not set value node to default");
- }
-
- void ValueNode::promoteToDefault()
- {
- if (!isDefault())
- {
- if (m_aValuePair.hasFirst())
- {
- OSL_VERIFY( m_aValuePair.setSecond(m_aValuePair.getFirst()) );
- m_aValuePair.clear( selectValue() );
- }
- else
- {
- m_aValuePair.clear( selectDeflt() );
- OSL_ASSERT( m_aValuePair.isNull() );
- }
-
- this->markAsDefault();
-
- OSL_ENSURE( !m_aValuePair.hasFirst(), "Leaving orphaned value in after promoting to default");
- }
- else
- OSL_ENSURE( !m_aValuePair.hasFirst(), "Orphaned value in default node won't be promoted");
-
- OSL_POSTCOND( isDefault(), "Could not promote value node to default");
- }
-
- std::auto_ptr<INode> ValueNode::clone() const
- {
- return std::auto_ptr<INode>(new ValueNode(*this));
- }
-
- ValueNode* ValueNode::asValueNode() {return this;}
- ValueNode const* ValueNode::asValueNode() const {return this;}
-
-} // namespace configmgr
-
-
diff --git a/configmgr/source/tree/cmtreemodel.cxx b/configmgr/source/tree/cmtreemodel.cxx
deleted file mode 100644
index 837ff6556f..0000000000
--- a/configmgr/source/tree/cmtreemodel.cxx
+++ /dev/null
@@ -1,371 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <stdio.h>
-
-#include "valuenode.hxx"
-#include "change.hxx"
-#include "configexcept.hxx"
-#include "strdecl.hxx"
-#include <osl/diagnose.h>
-
-#ifndef INCLUDED_ALGORITHM
-#define INCLUDED_ALGORITHM
-#include <algorithm>
-#endif
-
-//..........................................................................
-namespace configmgr
-{
-//==========================================================================
-
-bool isLocalizedValueSet(ISubtree const& _aSubtree)
-{
- if ( !_aSubtree.isSetNode()) return false;
- if ( !_aSubtree.isLocalized()) return false;
- if ( !_aSubtree.getElementTemplateModule().equals(TEMPLATE_MODULE_LOCALIZED_VALUE) ) return false;
- return true;
-}
-// -----------------------------------------------------------------------------
-
-bool isLocalizedValueSet(SubtreeChange const& _aSubtree)
-{
- if ( !_aSubtree.isSetNodeChange()) return false;
- if ( !_aSubtree.isLocalizedContainer()) return false;
- if ( !_aSubtree.getElementTemplateModule().equals(TEMPLATE_MODULE_LOCALIZED_VALUE) ) return false;
- return true;
-}
-
-// -----------------------------------------------------------------------------
-
-bool isValueSet(SubtreeChange const& _aSubtree)
-{
- if ( !_aSubtree.isSetNodeChange()) return false;
- if ( !_aSubtree.getElementTemplateModule().equals(TEMPLATE_MODULE_NATIVE_VALUE) ) return false;
- return true;
-}
-//==========================================================================
-
-//==========================================================================
-//= Change
-//==========================================================================
-void Change::swap(Change& aOther)
-{
- std::swap(m_aName, aOther.m_aName);
- std::swap(m_bIsToDefault, aOther.m_bIsToDefault);
-}
-
-//==========================================================================
-//= SubtreeChange
-//==========================================================================
-//--------------------------------------------------------------------------
-void SubtreeChange::swap(SubtreeChange& aOther)
-{
- Change::swap(aOther);
- m_aChanges.swap(aOther.m_aChanges);
- std::swap(m_sTemplateName, aOther.m_sTemplateName);
- std::swap(m_sTemplateModule, aOther.m_sTemplateModule);
- std::swap(m_aAttributes, aOther.m_aAttributes);
-}
-
-//--------------------------------------------------------------------------
-SubtreeChange::~SubtreeChange()
-{
- for(Children::iterator aIter = m_aChanges.begin();
- aIter != m_aChanges.end();
- ++aIter)
- {
- // Change* pChange = aIter->second;
- delete aIter->second;
- }
-}
-
-// -----------------------------------------------------------------------------
-SubtreeChange::SubtreeChange(const SubtreeChange& _aObj, treeop::DeepChildCopy)
- :Change(_aObj),
- m_sTemplateName(_aObj.m_sTemplateName),
- m_sTemplateModule(_aObj.m_sTemplateModule),
- m_aAttributes(_aObj.m_aAttributes)
-{
- for(Children::const_iterator aIter = _aObj.m_aChanges.begin();
- aIter != _aObj.m_aChanges.end();
- ++aIter)
- {
- OSL_ASSERT(aIter->second);
- Children::value_type aCopy(aIter->first, aIter->second->clone().release());
- m_aChanges.insert(m_aChanges.end(), aCopy);
- }
-}
-
-// -----------------------------------------------------------------------------
-std::auto_ptr<Change> SubtreeChange::clone() const
-{
- return std::auto_ptr<Change>(new SubtreeChange(*this, treeop::DeepChildCopy()));
-}
-//--------------------------------------------------------------------------
-void SubtreeChange::addChange(std::auto_ptr<Change> aChange)
-{
- rtl::OUString aNodeName(aChange->getNodeName());
- m_aChanges.find(aNodeName);
- OSL_ENSURE(m_aChanges.end() == m_aChanges.find(aNodeName),
- "SubtreeChange::addChange : overwriting an existent change !");
- delete m_aChanges[aNodeName];
- m_aChanges[aNodeName] = aChange.release();
-}
-
-//--------------------------------------------------------------------------
-::std::auto_ptr<Change> SubtreeChange::removeChange(rtl::OUString const& _rName)
-{
- Children::iterator aIter = m_aChanges.find(_rName);
-
- ::std::auto_ptr<Change> aReturn;
- if (m_aChanges.end() != aIter)
- {
- aReturn = ::std::auto_ptr<Change>(aIter->second);
- m_aChanges.erase(aIter);
- }
- return aReturn;
-}
-
-//--------------------------------------------------------------------------
-Change* SubtreeChange::getChange(rtl::OUString const& _rName)
-{
- return doGetChild(_rName);
-}
-
-//--------------------------------------------------------------------------
-Change const* SubtreeChange::getChange(rtl::OUString const& _rName) const
-{
- return doGetChild(_rName);
-}
-
-//--------------------------------------------------------------------------
-void SubtreeChange::dispatch(ChangeTreeAction& _anAction) const
-{
- _anAction.handle(*this);
-}
-
-//--------------------------------------------------------------------------
-void SubtreeChange::dispatch(ChangeTreeModification& _anAction)
-{
- _anAction.handle(*this);
-}
-
-//--------------------------------------------------------------------------
-void SubtreeChange::forEachChange(ChangeTreeAction& _anAction) const
-{
- ::std::map< ::rtl::OUString,Change* >::const_iterator aIter = m_aChanges.begin();
- while (aIter != m_aChanges.end())
- {
- (aIter++)->second->dispatch(_anAction);
- }
-}
-
-//--------------------------------------------------------------------------
-void SubtreeChange::forEachChange(ChangeTreeModification& _anAction)
-{
- ::std::map< ::rtl::OUString,Change* >::const_iterator aIter = m_aChanges.begin();
- while (aIter != m_aChanges.end())
- {
- (aIter++)->second->dispatch(_anAction);
- }
-}
-
-//--------------------------------------------------------------------------
-Change* SubtreeChange::doGetChild(rtl::OUString const& _rName) const
-{
- Children::const_iterator aIter = m_aChanges.find(_rName);
- return (aIter != m_aChanges.end()) ? aIter->second : NULL;
-}
-
-//--------------------------------------------------------------------------
-uno::Sequence< rtl::OUString > SubtreeChange::elementNames() const
-{
- uno::Sequence< rtl::OUString > aReturn(size());
- rtl::OUString* pReturn = aReturn.getArray();
-
- for ( Children::const_iterator aCollector = m_aChanges.begin();
- aCollector != m_aChanges.end();
- ++aCollector, ++pReturn
- )
- {
- *pReturn = aCollector->first;
- }
-
- return aReturn;
-}
-
-//--------------------------------------------------------------------------
-SubtreeChange::MutatingChildIterator SubtreeChange::begin_changes() throw()
-{
- return MutatingChildIterator(m_aChanges.begin());
-}
-
-//--------------------------------------------------------------------------
-SubtreeChange::MutatingChildIterator SubtreeChange::end_changes() throw()
-{
- return MutatingChildIterator(m_aChanges.end());
-}
-
-//--------------------------------------------------------------------------
-SubtreeChange::ChildIterator SubtreeChange::begin() const throw()
-{
- return ChildIterator(this);
-}
-
-//--------------------------------------------------------------------------
-SubtreeChange::ChildIterator SubtreeChange::end() const throw()
-{
- return ChildIterator(this, ChildIterator::EndPos());
-}
-
-//--------------------------------------------------------------------------
-SubtreeChange::ChildIterator::ChildIterator(const SubtreeChange* _pTree)
- :m_aNames(_pTree->elementNames())
- ,m_pTree(_pTree)
- ,m_nPos(0)
-{
-}
-
-//--------------------------------------------------------------------------
-SubtreeChange::ChildIterator::ChildIterator(const SubtreeChange* _pTree, struct EndPos)
- :m_aNames(_pTree->elementNames())
- ,m_pTree(_pTree)
- ,m_nPos(_pTree->size())
-{
-}
-
-//--------------------------------------------------------------------------
-Change const & SubtreeChange::ChildIterator::operator*() const
-{
- OSL_ENSURE(isValid(), "SubtreeChange::ChildIterator::operator* : invalid iterator !");
-
- if (!isValid())
- throw configuration::Exception("INTERNAL ERROR: Invalid SubtreeChange::ChildIterator dereferenced");
-
- return *m_pTree->getChange(m_aNames[m_nPos]);
-}
-
-//--------------------------------------------------------------------------
-Change const * SubtreeChange::ChildIterator::operator->() const
-{
- if (isValid())
- return m_pTree->getChange(m_aNames[m_nPos]);
- OSL_ENSURE(sal_False, "SubtreeChange::ChildIterator::operator-> : invalid iterator !");
- return NULL;
-}
-
-//--------------------------------------------------------------------------
-SubtreeChange::ChildIterator& SubtreeChange::ChildIterator::operator++()
-{
- OSL_ENSURE(m_nPos < m_aNames.getLength(), "SubtreeChange::ChildIterator : can't increment the end iterator !");
- if (m_nPos < m_aNames.getLength())
- ++m_nPos;
- return *this;
-}
-
-//--------------------------------------------------------------------------
-SubtreeChange::ChildIterator& SubtreeChange::ChildIterator::operator--()
-{
- OSL_ENSURE(m_nPos > 0, "SubtreeChange::ChildIterator : can't decrement the begin iterator !");
- if (m_nPos > 0)
- --m_nPos;
- return *this;
-}
-
-//--------------------------------------------------------------------------
-bool operator==(SubtreeChange::ChildIterator const& lhs, SubtreeChange::ChildIterator const& rhs)
-{
- return (lhs.m_pTree == rhs.m_pTree) && (lhs.m_nPos == rhs.m_nPos);
-}
-
-//==========================================================================
-//= SubtreeChangeReferrer
-//==========================================================================
-//--------------------------------------------------------------------------
-SubtreeChangeReferrer::SubtreeChangeReferrer(const SubtreeChange& _rSource)
- :SubtreeChange(_rSource, treeop::NoChildCopy())
-{
- ChildIterator aSourceChildren = _rSource.begin();
- while (aSourceChildren != _rSource.end())
- {
- const Change* pChange = &*aSourceChildren;
- OSL_ENSURE(pChange, "SubtreeChangeReferrer::SubtreeChangeReferrer : invalid change !");
- if (dynamic_cast< ValueChange const * >(pChange) != 0 ||
- dynamic_cast< RemoveNode const * >(pChange) != 0 ||
- dynamic_cast< AddNode const * >(pChange) != 0)
- SubtreeChange::addChange(::std::auto_ptr<Change>(const_cast<Change*>(pChange)));
- else if (dynamic_cast< SubtreeChange const * >(pChange) != 0 ||
- dynamic_cast< SubtreeChangeReferrer const * >(pChange) != 0)
- {
- SubtreeChange::addChange(::std::auto_ptr<Change>(new SubtreeChangeReferrer(*static_cast<const SubtreeChange*>(pChange))));
- }
- else
- OSL_ENSURE(sal_False, "SubtreeChangeReferrer::SubtreeChangeReferrer : unknown changes type !");
-
- ++aSourceChildren;
- }
-}
-
-//--------------------------------------------------------------------------
-SubtreeChangeReferrer::~SubtreeChangeReferrer()
-{
- for ( Children::iterator aChildren = m_aChanges.begin();
- aChildren != m_aChanges.end();
-
- )
- {
- const Change* pChange = aChildren->second;
- Children::iterator aCurrent = aChildren++;
-
- if (dynamic_cast< ValueChange const * >(pChange) != 0 ||
- dynamic_cast< RemoveNode const * >(pChange) != 0 ||
- dynamic_cast< AddNode const * >(pChange) != 0)
- {
- // we just hold references to the non-SubtreeChange-objects, so don't delete them
- m_aChanges.erase(aCurrent);
- }
- else if (dynamic_cast< SubtreeChange const * >(pChange) != 0 ||
- dynamic_cast< SubtreeChangeReferrer const * >(pChange) != 0)
- {
- // nothing to do
- }
- else
- OSL_ENSURE(sal_False, "SubtreeChangeReferrer::~SubtreeChangeReferrer : unknown changes type !");
- }
-
- // the base class will remove the remaining SubtreeChanges, which are SubtreeChangeReferrer's in real
-}
-
-//..........................................................................
-} // namespace configmgr
-//..........................................................................
-
-
diff --git a/configmgr/source/tree/localizedtreeactions.cxx b/configmgr/source/tree/localizedtreeactions.cxx
deleted file mode 100644
index dcff8fd609..0000000000
--- a/configmgr/source/tree/localizedtreeactions.cxx
+++ /dev/null
@@ -1,543 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <stdio.h>
-
-#include "localizedtreeactions.hxx"
-#include "treeactions.hxx"
-#include "builddata.hxx"
-#include "subtree.hxx"
-#include "matchlocale.hxx"
-#include "typeconverter.hxx"
-#include "change.hxx"
-#include "treechangefactory.hxx"
-#include "treenodefactory.hxx"
-#include "strdecl.hxx"
-#include <osl/diagnose.h>
-
-
-//..........................................................................
-namespace configmgr
-{
-
-//--------------------------------------------------------------------------
-namespace
-{
-//--------------------------------------------------------------------------
- //==========================================================================
- //= OCloneForLocale
- //==========================================================================
- //= clones a subtree , in the process selecting only the best match locale
- //= from the set representation of localized values
- //==========================================================================
- class OCloneForLocale : public NodeAction
- {
- rtl::OUString m_sTargetLocale;
- std::auto_ptr<INode> m_pClone;
- public:
- OCloneForLocale(rtl::OUString const& aLocale) : m_sTargetLocale(aLocale) {}
- std::auto_ptr<INode> getResult() { return m_pClone; }
-
- private:
- void handle(ValueNode const& _aValue);
- void handle(ISubtree const& _aSubtree);
- };
-//--------------------------------------------------------------------------
- struct OCloneChildrenForLocale : NodeAction
- {
- ISubtree& m_rParent;
- localehelper::FindBestLocale& m_rLocaleMatcher;
- public:
- OCloneChildrenForLocale(ISubtree& _rParent, localehelper::FindBestLocale& _rLocaleMatcher)
- : m_rParent(_rParent)
- , m_rLocaleMatcher(_rLocaleMatcher)
- {}
-
- virtual void handle(ValueNode const& _aValue);
- virtual void handle(ISubtree const& _aSubtree);
- };
-
-//--------------------------------------------------------------------------
- struct OSelectForLocale : NodeAction
- {
- ValueNode const* m_pFound;
- localehelper::FindBestLocale& m_rLocaleMatcher;
- public:
- OSelectForLocale(localehelper::FindBestLocale& _rLocaleMatcher)
- : m_pFound(NULL)
- , m_rLocaleMatcher(_rLocaleMatcher)
- {}
-
-
- bool hasResult() const
- { return m_pFound != NULL; }
-
- ValueNode const* getResult() const
- { return m_pFound; }
-
- private:
- virtual void handle(ValueNode const& _aValue);
- virtual void handle(ISubtree const& _aSubtree);
-
- void maybeSelect(ValueNode const& _aNode);
- };
-
-//--------------------------------------------------------------------------
-//--------------------------------------------------------------------------
- void OSelectForLocale::handle(ValueNode const& _aValue)
- {
- maybeSelect(_aValue);
- }
-//--------------------------------------------------------------------------
- void OSelectForLocale::handle(ISubtree const& /*_aSubtree*/)
- {
- OSL_ENSURE(false, "INTERNAL ERROR: Inconsistent data: Found a Subtree in a set of localized values");
- }
-//--------------------------------------------------------------------------
- void OSelectForLocale::maybeSelect(ValueNode const& _aNode)
- {
- if (m_rLocaleMatcher.accept( localehelper::makeLocale(_aNode.getName()) ) )
- m_pFound = &_aNode;
-
- else
- OSL_ENSURE(m_pFound, "WARNING: Node Locale wasn't accepted, but no node had been found before");
- }
-
-//--------------------------------------------------------------------------
-//--------------------------------------------------------------------------
- std::auto_ptr< INode > implReduceLocalizedSet(ISubtree const& _aSubtree, localehelper::FindBestLocale& _rLocaleMatcher)
- {
- // -- find the best-match locale -----------------------------
- _rLocaleMatcher.reset();
-
- OSelectForLocale aSelector(_rLocaleMatcher);
-
- aSelector.applyToChildren(_aSubtree);
-
- std::auto_ptr< INode > pResult;
-
- // -- look for a non-NULL value -----------------------------
- uno::Type aValueType;
- if (aSelector.hasResult())
- {
- ValueNode const& rSelected = *aSelector.getResult();
-
- aValueType = rSelected.getValueType();
-
- if (!rSelected.isNull()) // values are present - clone it from the values
- {
- pResult.reset ( new ValueNode( _aSubtree.getName(),
- rSelected.getValue(), rSelected.getDefault(),
- _aSubtree.getAttributes()
- ) );
-
- }
- }
- else // no entry - exract the type to be used from the template name
- aValueType = parseTemplateName(_aSubtree.getElementTemplateName());
-
- // -- create NULL value, if none was found -----------------------------
- // create a NULL of the found type
- if (pResult.get() == NULL)
- {
- pResult.reset( new ValueNode( _aSubtree.getName(),
- aValueType,
- _aSubtree.getAttributes()
- ) );
- }
-
- // -- -----------------------------
- OSL_ENSURE( aValueType != uno::Type(), "VOID result type found");
-#if OSL_DEBUG_LEVEL > 0
- uno::Type aTemplateType = parseTemplateName( _aSubtree.getElementTemplateName() );
- OSL_ENSURE( ( aValueType == aTemplateType ) || ( aTemplateType.getTypeClass() == uno::TypeClass_ANY ),
- "ERROR: Found Value Type doesn't match encoded value type in pseudo template name");
-#endif
- OSL_POSTCOND( static_cast<ValueNode&>(*pResult).getValueType() == aValueType,
- "ERROR: Resulting Value Type doesn't match original value type" );
-
- return pResult;
- }
-//--------------------------------------------------------------------------
- std::auto_ptr< INode > implCloneForLocale(ISubtree const& _aSubtree, localehelper::FindBestLocale& _rLocaleMatcher)
- {
- std::auto_ptr< INode > pClone;
-
- if (isLocalizedValueSet(_aSubtree))
- {
- pClone = implReduceLocalizedSet(_aSubtree, _rLocaleMatcher);
- }
- else
- {
- // ISubtree should get a clone(NoChildCopy) member ...
- std::auto_ptr< Subtree > pCloneTree( new Subtree(_aSubtree, treeop::NoChildCopy()) );
-
- OCloneChildrenForLocale aSubCloner(*pCloneTree,_rLocaleMatcher);
-
- aSubCloner.applyToChildren(_aSubtree);
-
- pClone.reset( pCloneTree.release() );
- }
-
- return pClone;
- }
-//--------------------------------------------------------------------------
-//--- OCloneChildrenForLocale:-----------------------------------------------------------------------
-
- void OCloneChildrenForLocale::handle(ValueNode const& _aValue)
- {
- // just a single value - nothing to do
- std::auto_ptr< INode > pClone( _aValue.clone() );
-
- m_rParent.addChild(pClone);
-
- }
-//--------------------------------------------------------------------------
- void OCloneChildrenForLocale::handle(ISubtree const& _aSubtree)
- {
- std::auto_ptr< INode > pClone = implCloneForLocale(_aSubtree,m_rLocaleMatcher);
-
- m_rParent.addChild(pClone);
- }
-
- //--------------------------------------------------------------------------
- //= OCloneForLocale
-
- // rtl::OUString m_sTargetLocale;
- // std::auto_ptr<INode> m_pClone;
-
- void OCloneForLocale::handle(ValueNode const& _aValue)
- {
- // just a single value - nothing to do
- std::auto_ptr< INode > pClone( _aValue.clone() );
-
- m_pClone = pClone;
- }
- //--------------------------------------------------------------------------
- void OCloneForLocale::handle(ISubtree const& _aSubtree)
- {
- localehelper::FindBestLocale aLocaleMatcher( localehelper::makeLocale(m_sTargetLocale) );
-
- m_pClone = implCloneForLocale(_aSubtree,aLocaleMatcher);
- }
- //--------------------------------------------------------------------------
-
-//--------------------------------------------------------------------------
-} // anonymous namespace
-
-//==========================================================================
-// Helper function to invoke the previous ones properly
-
-// convert to the given locale format, assuming the original representation was expanded
-static std::auto_ptr<INode> impl_cloneExpandedForLocale(INode const* _pNode, rtl::OUString const& _sLocale)
-{
- OSL_ASSERT(_pNode != NULL);
-
- if ( localehelper::designatesAllLocales(localehelper::makeLocale(_sLocale)) ) // from expanded to expanded
- {
- return _pNode->clone();
- }
-
- else // needs reduction
- {
- OCloneForLocale aCloner(_sLocale);
- aCloner.applyToNode(*_pNode);
- return aCloner.getResult();
- }
-}
-//--------------------------------------------------------------------------
-
-// convert to the given locale format, assuming the original representation was expanded
-static rtl::Reference< data::TreeSegment > old_cloneExpandedForLocale(rtl::OUString const& _sName, INode const* _pNode, rtl::OUString const& _sLocale)
-{
- if (_pNode == NULL)
- return rtl::Reference< data::TreeSegment >();
-
- std::auto_ptr<INode> aResult;
- if (dynamic_cast< ISubtree const * >(_pNode) == 0) // simple value - nothing to reduce
- aResult = _pNode->clone();
-
- else
- aResult = impl_cloneExpandedForLocale(_pNode,_sLocale);
-
- return data::TreeSegment::create(_sName,aResult);
-}
-//--------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-//--------------------------------------------------------------------------
-rtl::Reference< data::TreeSegment > cloneExpandedForLocale(sharable::TreeFragment * tree, rtl::OUString const& _sLocale)
-{
- std::auto_ptr<INode> aOldTree = data::convertTree(tree, true);
-
- return old_cloneExpandedForLocale(tree->getName(), aOldTree.get(), _sLocale);
-}
-//--------------------------------------------------------------------------
-// convert to the given locale format, assuming the original representation was expanded
-std::auto_ptr<INode> reduceExpandedForLocale(std::auto_ptr<ISubtree> _pNode, rtl::OUString const& _sLocale)
-{
- std::auto_ptr<INode> aResult;
-
- if ( _pNode.get() == NULL || // nothing to reduce
- localehelper::designatesAllLocales(localehelper::makeLocale(_sLocale)) ) // from expanded to expanded
- {
- aResult.reset( _pNode.release() );
- }
-
- else // needs reduction
- {
- OCloneForLocale aCloner(_sLocale);
- aCloner.applyToNode(*_pNode);
- aResult = aCloner.getResult();
-
- OSL_ENSURE(aResult.get(),"Cloning a tree for a locale unexpectedly produced NOTHING");
- }
- return aResult;
-}
-//--------------------------------------------------------------------------
-namespace
-{
-//--------------------------------------------------------------------------
- class ExpandTreeForLocale : NodeModification
- {
- ISubtree & m_rParent;
- rtl::OUString const & m_aSourceLocale;
-
- ExpandTreeForLocale(ISubtree & _rParent,rtl::OUString const & _aSourceLocale)
- : m_rParent(_rParent)
- , m_aSourceLocale(_aSourceLocale)
- {}
-
- void handle(ISubtree& _rNode);
- void handle(ValueNode& _rNode);
-
- void substitute(std::auto_ptr<INode> _aExpanded);
- public:
- static void expand(ISubtree& _rTree, rtl::OUString const & _aSourceLocale)
- {
- ExpandTreeForLocale(_rTree,_aSourceLocale).applyToChildren(_rTree);
- }
-
- // returns NULL, if not a localized value
- static std::auto_ptr<ISubtree> expanded(ValueNode const& _aNode, rtl::OUString const & _aSourceLocale);
- };
-
-//--------------------------------------------------------------------------
- class ExpandChangesForLocale : ChangeTreeModification
- {
- SubtreeChange & m_rParent;
- rtl::OUString const & m_aSourceLocale;
-
- ExpandChangesForLocale(SubtreeChange & _rParent,rtl::OUString const & _aSourceLocale)
- : m_rParent(_rParent)
- , m_aSourceLocale(_aSourceLocale)
- {}
-
- void handle(SubtreeChange& _rNode);
- void handle(ValueChange& _rNode);
-
- void handle(AddNode& _rNode);
- void handle(RemoveNode& _rNode);
-
- void substitute(std::auto_ptr<Change> _aExpanded);
- public:
- static void expand(SubtreeChange& _rTree, rtl::OUString const & _aSourceLocale)
- {
- ExpandChangesForLocale(_rTree,_aSourceLocale).applyToChildren(_rTree);
- }
-
- // returns NULL, if not a localized value
- static std::auto_ptr<SubtreeChange> expanded(ValueChange const& _aNode, rtl::OUString const & _aSourceLocale);
- };
-//--------------------------------------------------------------------------
-inline
-void ExpandTreeForLocale::substitute(std::auto_ptr<INode> _aExpanded)
-{
- m_rParent.removeChild(_aExpanded->getName());
- m_rParent.addChild(_aExpanded);
-}
-
-//--------------------------------------------------------------------------
-void ExpandTreeForLocale::handle(ISubtree& _rNode)
-{
- expand(_rNode,m_aSourceLocale);
-}
-
-//--------------------------------------------------------------------------
-void ExpandTreeForLocale::handle(ValueNode& _rNode)
-{
- std::auto_ptr<ISubtree> aExpanded = expanded(_rNode,m_aSourceLocale);
-
- if (aExpanded.get())
- substitute( base_ptr(aExpanded) );
-}
-
-//--------------------------------------------------------------------------
-
-std::auto_ptr<ISubtree> ExpandTreeForLocale::expanded(ValueNode const& _aNode, rtl::OUString const & _aSourceLocale)
-{
- if (!_aNode.isLocalized()) return std::auto_ptr<ISubtree>();
-
- OTreeNodeFactory & rFactory = getDefaultTreeNodeFactory();
-
- node::Attributes aValueAttributes = _aNode.getAttributes();
-
- aValueAttributes.setLocalized(false);
- if (aValueAttributes.state() == node::isMerged)
- aValueAttributes.setState( node::isReplaced );
-
-
- std::auto_ptr<ValueNode> aValue = _aNode.isNull()
- ? rFactory.createNullValueNode(_aSourceLocale,_aNode.getValueType(),aValueAttributes)
- : rFactory.createValueNode(_aSourceLocale,_aNode.getValue(),aValueAttributes);
-
- std::auto_ptr<ISubtree> aRet = rFactory.createSetNode( _aNode.getName(),
- toTemplateName(_aNode.getValueType()),
- TEMPLATE_MODULE_LOCALIZED_VALUE,
- _aNode.getAttributes() );
-
- aRet->addChild(base_ptr(aValue));
-
- return aRet;
-}
-
-//--------------------------------------------------------------------------
-//--------------------------------------------------------------------------
-inline
-void ExpandChangesForLocale::substitute(std::auto_ptr<Change> _aExpanded)
-{
- m_rParent.removeChange(_aExpanded->getNodeName());
- m_rParent.addChange(_aExpanded);
-}
-
-//--------------------------------------------------------------------------
-
-void ExpandChangesForLocale::handle(SubtreeChange& _rNode)
-{
- expand(_rNode,m_aSourceLocale);
-}
-
-//--------------------------------------------------------------------------
-void ExpandChangesForLocale::handle(ValueChange& _rNode)
-{
- std::auto_ptr<SubtreeChange> aExpanded = expanded(_rNode,m_aSourceLocale);
-
- if (aExpanded.get())
- substitute( base_ptr( aExpanded ) );
-}
-
-//--------------------------------------------------------------------------
-void ExpandChangesForLocale::handle(AddNode& _rNode)
-{
- rtl::Reference< data::TreeSegment > seg(_rNode.getNewTree());
- std::auto_ptr<INode> pAdded(data::convertTree(seg.is() ? seg->fragment : 0, false));
- if (pAdded.get() != NULL)
- {
- std::auto_ptr<INode> pExpanded;
- if (ISubtree * pAddedTree = pAdded->asISubtree())
- {
- ExpandTreeForLocale::expand(*pAddedTree,m_aSourceLocale);
- pExpanded = pAdded;
- }
- else if(ValueNode * pAddedValue = pAdded->asValueNode())
- {
- pExpanded = base_ptr(ExpandTreeForLocale::expanded(*pAddedValue,m_aSourceLocale));
- }
- else
- OSL_ENSURE(false, "Cannot expand unknown Node type (found in AddNode)");
-
-
- if (pExpanded.get())
- {
- rtl::Reference< data::TreeSegment > aExpanded = data::TreeSegment::create( _rNode.getNodeName(),pExpanded);
- std::auto_ptr<AddNode> aExpandedAdd( new AddNode( aExpanded, _rNode.getNodeName(), _rNode.isToDefault() ) );
-
- if (_rNode.isReplacing()) aExpandedAdd->setReplacing();
-
- substitute( base_ptr( aExpandedAdd ) );
- }
- }
- else
- OSL_ENSURE(false, "Cannot expand AddNode without content");
-}
-
-//--------------------------------------------------------------------------
-void ExpandChangesForLocale::handle(RemoveNode& )
-{
- // nothing to do
-}
-
-//--------------------------------------------------------------------------
-std::auto_ptr<SubtreeChange> ExpandChangesForLocale::expanded(ValueChange const& _aNode, rtl::OUString const & _aSourceLocale)
-{
- std::auto_ptr<SubtreeChange> aRet;
- if (_aNode.isLocalizedValue())
- {
- OTreeNodeFactory & rNodeFactory = getDefaultTreeNodeFactory();
- OTreeChangeFactory & rFactory = getDefaultTreeChangeFactory();
-
- node::Attributes aValueAttributes = _aNode.getAttributes();
-
- aValueAttributes.setLocalized(false);
- if (aValueAttributes.state() == node::isMerged)
- aValueAttributes.setState( node::isReplaced );
-
-
- rtl::OUString const sTemplateName = toTemplateName(_aNode.getValueType());
-
- std::auto_ptr<ValueNode> aValue = _aNode.getNewValue().hasValue()
- ? rNodeFactory.createValueNode(sTemplateName,_aNode.getNewValue(),aValueAttributes)
- : rNodeFactory.createNullValueNode(sTemplateName,_aNode.getValueType(),aValueAttributes);
-
- rtl::Reference< data::TreeSegment > aValueSegment = data::TreeSegment::create(_aSourceLocale, base_ptr(aValue));
-
- std::auto_ptr<AddNode> aAddValue = rFactory.createAddNodeChange(aValueSegment,_aSourceLocale,_aNode.isToDefault());
- aAddValue->setReplacing();
-
- aRet = rFactory.createSetNodeChange( _aNode.getNodeName(),
- sTemplateName,
- TEMPLATE_MODULE_LOCALIZED_VALUE,
- _aNode.getAttributes() );
-
- aRet->addChange(base_ptr(aAddValue));
- }
- return aRet;
-}
-
-//--------------------------------------------------------------------------
-} // anonymous namespace
-//--------------------------------------------------------------------------
-
-//--------------------------------------------------------------------------
-//..........................................................................
-} // namespace configmgr
-//..........................................................................
-
-
diff --git a/configmgr/source/tree/makefile.mk b/configmgr/source/tree/makefile.mk
deleted file mode 100644
index 1609db2887..0000000000
--- a/configmgr/source/tree/makefile.mk
+++ /dev/null
@@ -1,66 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJINC=$(PRJ)$/source
-
-PRJNAME=configmgr
-TARGET=cm
-ENABLE_EXCEPTIONS=TRUE
-
-
-# --- Settings ---
-.IF "$(DBGUTIL_OJ)"!=""
-ENVCFLAGS+=/FR$(SLO)$/
-.ENDIF
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/makefile.pmk
-
-# --- Files ---
-
-SLOFILES=\
- $(SLO)$/builddata.obj \
- $(SLO)$/node.obj \
- $(SLO)$/treefragment.obj \
- $(SLO)$/treesegment.obj \
- $(SLO)$/nodevisitor.obj \
- $(SLO)$/changes.obj \
- $(SLO)$/treenodefactory.obj \
- $(SLO)$/treechangefactory.obj \
- $(SLO)$/localizedtreeactions.obj \
- $(SLO)$/treeactions.obj \
- $(SLO)$/cmtreemodel.obj \
- $(SLO)$/cmtree.obj \
- $(SLO)$/nodeconverter.obj \
- $(SLO)$/updatehelper.obj \
- $(SLO)$/mergehelper.obj \
-
-# --- Targets ---
-
-.INCLUDE : target.mk
-
diff --git a/configmgr/source/tree/mergehelper.cxx b/configmgr/source/tree/mergehelper.cxx
deleted file mode 100644
index 806b715f9f..0000000000
--- a/configmgr/source/tree/mergehelper.cxx
+++ /dev/null
@@ -1,456 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <stdio.h>
-
-#include "builddata.hxx"
-#include "nodeconverter.hxx"
-#include "treefragment.hxx"
-#include "treenodefactory.hxx"
-#include "treechangefactory.hxx"
-#include "configpath.hxx"
-#include "tracer.hxx"
-#include <osl/diagnose.h>
-
-
-//..........................................................................
-namespace configmgr
-{
-
-namespace
-{
-//==========================================================================
-//= OCleanupLayerAction
-//==========================================================================
-//= This class cleans up a layer to be merged into an existing tree
-//==========================================================================
-class OCleanupLayerAction : ChangeTreeModification
-{
- SubtreeChange& m_rResultTree; // list which containes changes merged with the existing nodes
- ISubtree const & m_rTargetTree; // reference node needed for merging
- OTreeNodeConverter m_aNodeConverter;
-public:
- static bool adjust(SubtreeChange& _rResultTree, SubtreeChange& _aLayerTree, ISubtree const& _aTargetTree)
- {
- return OCleanupLayerAction(_rResultTree,_aTargetTree).impl_cleanup(_aLayerTree);
- }
- static bool adjust(SubtreeChange& _rResultTree, SubtreeChange& _aLayerTree, ISubtree const& _aTargetTree, OTreeNodeFactory& _rNodeFactory)
- {
- return OCleanupLayerAction(_rResultTree,_aTargetTree,_rNodeFactory).impl_cleanup(_aLayerTree);
- }
-
-private:
- OCleanupLayerAction(SubtreeChange& _rResult, ISubtree const& _rTree)
- :m_rResultTree(_rResult)
- ,m_rTargetTree(_rTree)
- ,m_aNodeConverter()
- {}
-
- OCleanupLayerAction(SubtreeChange& _rResult, ISubtree const& _rTree, OTreeNodeFactory& _rNodeFactory)
- :m_rResultTree(_rResult)
- ,m_rTargetTree(_rTree)
- ,m_aNodeConverter(_rNodeFactory)
- {}
-
- void handle(ValueChange& aValueNode);
- void handle(AddNode& aAddNode);
- void handle(RemoveNode& aRemoveNode);
- void handle(SubtreeChange& aSubtree);
-
- bool impl_cleanup(SubtreeChange& _aUpdateTree);
-
- void add(std::auto_ptr<Change> _pChange);
- void addReplacedNode(rtl::Reference< data::TreeSegment > const & _aReplacedTree);
- void addReplacedNode(std::auto_ptr<INode> _aReplacedNode);
-};
-
-// --------------------------------- MergeLayerToTree ---------------------------------
-
-class MergeLayerToTree : ChangeTreeModification
-{
- ISubtree& m_rTree;
-
-public:
- explicit
- MergeLayerToTree(ISubtree& _rTree):m_rTree(_rTree) {}
-
- MergeLayerToTree& merge(SubtreeChange & _rLayerTree);
-private:
- void handle(ValueChange& aValueNode);
- void handle(AddNode& aAddNode);
- void handle(RemoveNode& aRemoveNode);
- void handle(SubtreeChange& aSubtree);
-
- static void mergeAttributes(INode& _rNode, node::Attributes const& _aChangeAttributes);
-};
-// --------------------------------- AttributeSetter ---------------------------------
-
-class AttributeSetter : NodeModification
-{
- node::State m_state;
- bool m_bPromoteFinalized;
-public:
- explicit
- AttributeSetter(node::State _state, bool _bPromoteFinalized)
- : m_state(_state)
- , m_bPromoteFinalized(_bPromoteFinalized)
- {}
-
- void setNodeAttributes(INode& _rNode);
-
- using NodeModification::applyToNode;
-private:
- void handle(ValueNode& _rValueNode);
- void handle(ISubtree& _rSubtree);
-};
-// -----------------------------------------------------------------------------
-
-} // anon namepsace
-// -----------------------------------------------------------------------------
-// this is our 'exported' function
-
-// -----------------------------------------------------------------------------
-namespace
-{
-//==========================================================================
-//= OCleanupLayerAction
-//==========================================================================
-static inline bool isFinal(node::Attributes const& _aAttributes)
-{
- return _aAttributes.isFinalized() || _aAttributes.isReadonly();
-}
-//==========================================================================
-bool OCleanupLayerAction::impl_cleanup(SubtreeChange& _aUpdateTree)
-{
- OSL_ENSURE(!_aUpdateTree.isReplacedNode(), "Layer cleanup: A replaced tree should not be merged");
-
- if (isFinal(m_rTargetTree.getAttributes()))
- {
- CFG_TRACE_WARNING("Layer cleanup : Ignoring change to write-protected tree '%s'",OUSTRING2ASCII(m_rTargetTree.getName()));
- return false;
- }
-
- // first check the changes
- this->applyToChildren(_aUpdateTree);
-
- return m_rResultTree.size() != 0;
-}
-//--------------------------------------------------------------------------
-inline void OCleanupLayerAction::add(std::auto_ptr<Change> _aChange)
-{
- m_rResultTree.addChange(_aChange);
-}
-//--------------------------------------------------------------------------
-void OCleanupLayerAction::handle(ValueChange& _rChange)
-{
- rtl::OUString const sNodeName = _rChange.getNodeName();
-
- OSL_ENSURE(!_rChange.isToDefault(),"Found change to default in layer being merged");
-
- // replaced state -> should be a full (added/replaced) node
- //if (_rChange.isReplacedNode() && m_rTargetTree.isSetNodeChange())
- if ( _rChange.isReplacedValue() )
- {
- std::auto_ptr<ValueNode> pNode( m_aNodeConverter.createCorrespondingNode(_rChange) );
-
- this->addReplacedNode( base_ptr(pNode) );
-
- }
- else if (INode const * const pTargetNode = m_rTargetTree.getChild(sNodeName))
- {
- // this mismatch is not discarded here (should be ignored while merging though)
- OSL_ENSURE(pTargetNode->asValueNode(), "Layer cleanup : Node type mismatch: Value change applied to non-value node !");
-
- if (!isFinal(pTargetNode->getAttributes()))
- {
- std::auto_ptr<Change> pResult( new ValueChange(_rChange) );
- this->add(pResult);
- }
- else
- {
- CFG_TRACE_WARNING("Layer cleanup : Ignoring change to write-protected value '%s'",OUSTRING2ASCII(sNodeName));
- }
- }
- else
- {
- OSL_TRACE("Layer cleanup : Found orphaned node (value) '%s'",OUSTRING2ASCII(sNodeName));
- CFG_TRACE_INFO("Layer cleanup : Found orphaned node (value) '%s'",OUSTRING2ASCII(sNodeName));
- OSL_ENSURE(false, "Layer cleanup : Found orphaned Value");
- }
-}
-
-//--------------------------------------------------------------------------
-void OCleanupLayerAction::handle(SubtreeChange& _rChange)
-{
- rtl::OUString const sNodeName = _rChange.getNodeName();
-
- OSL_ENSURE(!_rChange.isToDefault(),"Found change to default in layer being merged");
-
- // replaced state -> should be a full (added/replaced) node
- if (_rChange.isReplacedNode())
- {
- std::auto_ptr<ISubtree> pNode = m_aNodeConverter.createCorrespondingTree(_rChange);
-
- // mark as complete with defaults)
- pNode->setLevels(treeop::ALL_LEVELS,treeop::ALL_LEVELS);
-
- this->addReplacedNode( base_ptr(pNode) );
- }
- else if ( INode const * const pTargetNode = m_rTargetTree.getChild(sNodeName) )
- {
- ISubtree const * pTargetTree = pTargetNode->asISubtree();
-
- if (pTargetTree)
- {
- // generate a new change
- std::auto_ptr<SubtreeChange> pResult( new SubtreeChange(_rChange, treeop::NoChildCopy()) );
-
- // recurse
- if ( adjust(*pResult,_rChange,*pTargetTree,m_aNodeConverter.nodeFactory()) )
- this->add(base_ptr(pResult));
-
- else
- CFG_TRACE_INFO("Layer cleanup : Found void modification tree '%s'",OUSTRING2ASCII(sNodeName));
- }
- else
- {
- OSL_ENSURE(false, "Layer cleanup : Node type mismatch: Tree change applied to non-tree node !");
- CFG_TRACE_ERROR("Layer cleanup : Discarding schema violation for node '%s'",OUSTRING2ASCII(sNodeName));
- //throw Whatever();
- }
- }
- else
- {
- OSL_TRACE("Layer cleanup : Found orphaned node (subtree) '%s'",OUSTRING2ASCII(sNodeName));
- CFG_TRACE_INFO("Layer cleanup : Found orphaned node (subtree) '%s'",OUSTRING2ASCII(sNodeName));
- }
-}
-
-//--------------------------------------------------------------------------
-void OCleanupLayerAction::handle(RemoveNode& _rChange)
-{
- rtl::OUString const sNodeName = _rChange.getNodeName();
-
- OSL_ENSURE(!_rChange.isToDefault(),"Found change to default in layer being merged");
-
- OSL_ENSURE(m_rTargetTree.isSetNode(),"Found RemoveNode for non-set-element in layer being merged");
-
- // look up the corresponding node
- INode const * const pTargetNode = m_rTargetTree.getChild(sNodeName);
-
- if (pTargetNode)
- {
- // generate the same change
- std::auto_ptr<Change> pResult( new RemoveNode(sNodeName,false) );
- this->add(pResult);
- }
- else
- {
- OSL_TRACE("Layer cleanup : Found orphaned node (removal) '%s'",OUSTRING2ASCII(sNodeName));
- CFG_TRACE_INFO("Layer cleanup : Found orphaned node (removal) '%s'",OUSTRING2ASCII(sNodeName));
- }
-}
-
-//--------------------------------------------------------------------------
-void OCleanupLayerAction::handle(AddNode& _rChange)
-{
- OSL_ENSURE(!_rChange.isToDefault(),"Found change to default in layer being merged");
-
-// generate the same change
- this->addReplacedNode( _rChange.getNewTree() );
-}
-
-//--------------------------------------------------------------------------
-void OCleanupLayerAction::addReplacedNode(std::auto_ptr<INode> _aReplacedNode)
-{
- OSL_ENSURE(m_rTargetTree.isSetNode(),"Found replaced node for non-set-element in layer being merged");
-
- OSL_ASSERT(_aReplacedNode.get());
-
- rtl::OUString sTypeName = m_rTargetTree.getElementTemplateName();
-
- this->addReplacedNode( data::TreeSegment::create(_aReplacedNode,sTypeName) );
-}
-
-//--------------------------------------------------------------------------
-void OCleanupLayerAction::addReplacedNode(rtl::Reference< data::TreeSegment > const & _aReplacedTree)
-{
- OSL_ENSURE(m_rTargetTree.isSetNode(),"Found replaced node for non-set-element in layer being merged");
-
- OSL_ASSERT(_aReplacedTree.is());
-
- rtl::OUString sNodeName = _aReplacedTree->fragment->getName();
-
- // add the tree to the change list
- std::auto_ptr<AddNode> pResult( new AddNode(_aReplacedTree,sNodeName, false) );
-
- // look up the corresponding existing node
- INode const * const pTargetNode = m_rTargetTree.getChild(sNodeName);
-
- if (pTargetNode) pResult->setReplacing();
-
- this->add( base_ptr(pResult) );
-}
-
-//--------------------------------------------------------------------------
-//--------------------------------------------------------------------------
-
-void MergeLayerToTree::mergeAttributes(INode& _rNode, node::Attributes const& _aChangeAttributes)
-{
- OSL_ENSURE(!isFinal(_rNode.getAttributes()),"Layer merge: Node being merged is READONLY - cleanup broken");
- OSL_ENSURE(_aChangeAttributes.state() == node::isMerged,"Layer merge: Found unexpected state for change being merged");
-
- _rNode.modifyState(node::isMerged);
- _rNode.modifyAccess(_aChangeAttributes.getAccess());
-}
-//--------------------------------------------------------------------------
-
-MergeLayerToTree& MergeLayerToTree::merge(SubtreeChange & _rLayerTree)
-{
- OSL_ENSURE(_rLayerTree.getNodeName() == m_rTree.getName(),"Layer merge: change does not match tree");
-
- this->applyToChildren(_rLayerTree);
- mergeAttributes(m_rTree,_rLayerTree.getAttributes());
-
- return *this;
-}
-//--------------------------------------------------------------------------
-
-void MergeLayerToTree::handle(ValueChange& _rChange)
-{
- OSL_ENSURE(!_rChange.isToDefault(),"Layer merge: Found change to default - cleanup broken");
-
- rtl::OUString const sNodeName = _rChange.getNodeName();
-
- INode * const pTargetNode = m_rTree.getChild(sNodeName);
-
- OSL_ENSURE(pTargetNode,"Layer merge: Found NULL value - cleanup broken");
- OSL_ENSURE(!isFinal(pTargetNode->getAttributes()),"Layer merge: Found READONLY value - cleanup broken");
-
- if (ValueNode* pTargetValue = pTargetNode->asValueNode() )
- {
- _rChange.applyChangeNoRecover(*pTargetValue);
- mergeAttributes(*pTargetValue,_rChange.getAttributes());
- }
- else
- {
- OSL_ENSURE(false, "Layer merge : Node type mismatch: Value change applied to non-value node !");
- CFG_TRACE_ERROR("Layer merge : Discarding schema violation for value '%s'",OUSTRING2ASCII(sNodeName));
- //throw Whatever();
- }
-}
-//--------------------------------------------------------------------------
-
-void MergeLayerToTree::handle(AddNode& _rChange)
-{
- rtl::OUString const sNodeName = _rChange.getNodeName();
-
- node::State eNodeState = node::isAdded;
-
- if (_rChange.isReplacing())
- {
- OSL_VERIFY( m_rTree.removeChild(sNodeName).get() );
- eNodeState = node::isReplaced;
- }
-
- OSL_ENSURE( !m_rTree.getChild(sNodeName),"Layer merge: Found conflicting data on insert - cleanup broken");
-
- rtl::Reference< data::TreeSegment > aAddedTree = _rChange.getNewTree();
-
- OSL_ENSURE(aAddedTree.is(), "Layer merge: Found empty data on insert - cleanup broken");
-
- // clean up the attributes of the added node
- std::auto_ptr<INode> aAddedData(data::convertTree(aAddedTree->fragment, true));
-
- AttributeSetter(eNodeState,false).applyToNode(*aAddedData);
-
- m_rTree.addChild(aAddedData);
-}
-//--------------------------------------------------------------------------
-
-void MergeLayerToTree::handle(RemoveNode& _rChange)
-{
- rtl::OUString const sNodeName = _rChange.getNodeName();
-
- // should have such a node when removing
- OSL_VERIFY( m_rTree.removeChild(sNodeName).get() );
-}
-//--------------------------------------------------------------------------
-
-
-void MergeLayerToTree::handle(SubtreeChange& _rChange)
-{
- OSL_ENSURE(!_rChange.isToDefault(),"Layer merge: Found change to default - cleanup broken");
-
- rtl::OUString const sNodeName = _rChange.getNodeName();
-
- INode * const pTargetNode = m_rTree.getChild(sNodeName);
-
- OSL_ENSURE(pTargetNode,"Layer merge: Found NULL subtree - cleanup broken");
- OSL_ENSURE(!isFinal(pTargetNode->getAttributes()),"Layer merge: Found READONLY subtree - cleanup broken");
-
- ISubtree * const pTargetTree = pTargetNode->asISubtree();
- OSL_ENSURE(pTargetTree,"Layer merge: Found non-tree for SubtreeChange - cleanup broken");
-
- // recurse
- MergeLayerToTree(*pTargetTree).merge(_rChange);
-}
-//--------------------------------------------------------------------------
-
-void AttributeSetter::setNodeAttributes(INode& _rNode)
-{
- node::Attributes const aOldAttributes = _rNode.getAttributes();
-
- _rNode.modifyState(m_state);
- if (m_bPromoteFinalized && isFinal(aOldAttributes))
- _rNode.modifyAccess(node::accessReadonly);
-}
-// -----------------------------------------------------------------------------
-
-void AttributeSetter::handle(ValueNode& _rValueNode)
-{
- setNodeAttributes(_rValueNode);
-}
-// -----------------------------------------------------------------------------
-
-void AttributeSetter::handle(ISubtree& _rSubtree)
-{
- setNodeAttributes(_rSubtree);
-
- this->applyToChildren(_rSubtree);
-}
-//--------------------------------------------------------------------------
-
-} // anonymous namespace
-//..........................................................................
-} // namespace configmgr
-//..........................................................................
-
-
diff --git a/configmgr/source/tree/node.cxx b/configmgr/source/tree/node.cxx
deleted file mode 100644
index 0f8fa815e1..0000000000
--- a/configmgr/source/tree/node.cxx
+++ /dev/null
@@ -1,535 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "node.hxx"
-#include "anydata.hxx"
-#include "treefragment.hxx"
-#include "attributes.hxx"
-#include "utility.hxx"
-#include <rtl/ustring.hxx>
-#include <com/sun/star/uno/Any.hxx>
-
-#ifndef INCLUDED_CSTDDEF
-#include <cstddef>
-#define INCLUDED_CSTDDEF
-#endif
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace sharable
- {
-//-----------------------------------------------------------------------------
-
-rtl::OUString NodeInfo::getName() const
-{
- return rtl::OUString(this->name);
-}
-//-----------------------------------------------------------------------------
-
-configmgr::node::Attributes NodeInfo::getNodeInfoAttributes() const
-{
- configmgr::node::Attributes aResult;
-
- bool help = !!(flags & data::Flags::readonly);
- aResult.setAccess( help,!!(flags & data::Flags::finalized) );
-// aResult.setAccess( !!(flags & data::Flags::readonly),!!(flags & data::Flags::finalized) );
-
- aResult.setNullable(!!(flags & data::Flags::nullable));
- aResult.setLocalized(!!(flags & data::Flags::localized));
-
- configmgr::node::State state = (flags & data::Flags::defaulted) ? configmgr::node::isDefault :
- (flags & data::Flags::defaultable) ? configmgr::node::isMerged :
- configmgr::node::isReplaced;
- aResult.setState(state);
-
- return aResult;
-}
-//-----------------------------------------------------------------------------
-
-bool NodeInfo::isDefault() const
-{
- return !!(this->flags & data::Flags::defaulted);
-}
-//-----------------------------------------------------------------------------
-
-bool NodeInfo::isLocalized() const
-{
- return !!(this->flags & data::Flags::localized);
-}
-//-----------------------------------------------------------------------------
-
-void NodeInfo::markAsDefault(bool bDefault)
-{
- if (bDefault)
- {
- OSL_ENSURE(flags & data::Flags::defaultable,"Marking a non-defaultable node as default");
- this->flags |= data::Flags::defaulted;
- }
- else
- this->flags &= ~data::Flags::defaulted;
-}
-//-----------------------------------------------------------------------------
-
-bool GroupNode::hasDefaultsAvailable() const
-{
- if (this->info.isDefault())
- return true;
-
- if (node(this)->getTreeFragment()->hasDefaultsAvailable())
- return true;
-
-#if 0 // extended check for default state
- for (Node const * pChild = getFirstChild(); pChild != NULL; pChild = getNextChild(pChild))
- if (! pChild->isDefault() )
- return false;
-
- return true;
-#endif
-
- return false;
-}
-//-----------------------------------------------------------------------------
-
-Node * GroupNode::getFirstChild() const
-{
- OSL_ENSURE(numDescendants, "Groups MUST have at least one child");
- return const_cast< Node * >(node(this) + 1);
-}
-//-----------------------------------------------------------------------------
-
-static
-sal_uInt16 implGetNextChildOffset(GroupNode const * _pParent, Node const * _pChild)
-{
- OSL_PRECOND(_pChild, "getNextChild: previous child must not be NULL");
- OSL_PRECOND(_pChild->getParentNode() == node(_pParent), "getNextChild: not a child of this node");
-
-
- OSL_ENSURE( node(_pParent) < _pChild && _pChild <= node(_pParent) + _pParent->numDescendants,
- "getNextChild: child out of descendants range");
-
- // offset to child's next sibling
- sal_uInt16 next = 1;
- if ( _pChild->isGroup())
- {
- next = next + _pChild->group.numDescendants;
- }
-
- if (_pChild->info.parent + next > _pParent->numDescendants)
- {
- OSL_ENSURE(_pChild->info.parent + next == _pParent->numDescendants+1, "Next child candidate should match next sibling here");
- return 0;
- }
-
- OSL_POSTCOND( (_pChild+next)->getParentNode() == node(_pParent), "getNextChild: not a child of this node");
- return next;
-}
-//-----------------------------------------------------------------------------
-
-Node * GroupNode::getNextChild(Node * _pChild) const
-{
- if (sal_uInt16 next = implGetNextChildOffset(this, _pChild))
- return _pChild + next;
-
- else
- return NULL;
-}
-
-Node * GroupNode::getChild(rtl::OUString const & name) const {
- for (Node * child = getFirstChild(); child != 0;
- child = getNextChild(child))
- {
- if (child->isNamed(name)) {
- return child;
- }
- }
- return 0;
-}
-
-//-----------------------------------------------------------------------------
-
-// TODO: optimize this - keep a list of such structs ....
-struct SetNodeTemplateData
-{
- rtl_uString * name;
- rtl_uString * module;
-};
-//-----------------------------------------------------------------------------
-static inline
-SetNodeTemplateData * readTemplateData(sal_uInt8 * _aTemplateData)
-{
- return reinterpret_cast<SetNodeTemplateData *>( _aTemplateData );
-}
-//-----------------------------------------------------------------------------
-
-sal_uInt8 * SetNode::allocTemplateData(const rtl::OUString &rName,
- const rtl::OUString &rModule)
-{
- SetNodeTemplateData * pData = new SetNodeTemplateData();
-
- OSL_ENSURE(pData, "Creating template data: unexpected NULL data");
-
- pData->name = acquireString(rName);
- pData->module = acquireString(rModule);
-
- return reinterpret_cast<sal_uInt8 *>( pData );
-}
-
-sal_uInt8 * SetNode::copyTemplateData(sal_uInt8 * _aTemplateData)
-{
- SetNodeTemplateData const * pData = readTemplateData(_aTemplateData);
-
- OSL_ENSURE(pData, "Copying template data: unexpected NULL data");
-
- return allocTemplateData(rtl::OUString(pData->name), rtl::OUString(pData->module));
-}
-
-//-----------------------------------------------------------------------------
-
-void SetNode::releaseTemplateData(sal_uInt8 * _aTemplateData)
-{
- if (!_aTemplateData) return;
-
- SetNodeTemplateData const * pData = readTemplateData(_aTemplateData);
-
- OSL_ENSURE(pData, "Freeing template data: unexpected NULL data");
-
- rtl_uString_release(pData->name);
- rtl_uString_release(pData->module);
-
- delete pData;
-}
-
-//-----------------------------------------------------------------------------
-
-rtl::OUString SetNode::getElementTemplateName() const
-{
- SetNodeTemplateData const * pData = readTemplateData(this->elementType);
-
- OSL_ENSURE(pData, "ERROR: No template data found for set");
-
- return rtl::OUString(pData->name);
-}
-//-----------------------------------------------------------------------------
-
-rtl::OUString SetNode::getElementTemplateModule() const
-{
- SetNodeTemplateData const * pData = readTemplateData(this->elementType);
-
- OSL_ENSURE(pData, "ERROR: No template data found for set");
-
- return rtl::OUString(pData->module);
-}
-//-----------------------------------------------------------------------------
-
-static inline
-TreeFragment * implGetFragmentFromList(TreeFragment * _aListEntry)
-{
- return reinterpret_cast<TreeFragment *>(_aListEntry);
-}
-//-----------------------------------------------------------------------------
-
-TreeFragment * SetNode::getFirstElement() const
-{
- return implGetFragmentFromList(this->elements);
-}
-//-----------------------------------------------------------------------------
-
-TreeFragment * SetNode::getNextElement(TreeFragment * _pElement) const
-{
- OSL_PRECOND(_pElement, "getNextElement: previous element must not be NULL");
- OSL_PRECOND(_pElement->header.parent == (Node *)this,
- "getNextElement: not an element of this node");
-
- return implGetFragmentFromList(_pElement->header.next);
-}
-
-TreeFragment * SetNode::getElement(rtl::OUString const & name) const {
- for (TreeFragment * element = getFirstElement(); element != 0;
- element = getNextElement(element))
- {
- if (element->isNamed(name)) {
- return element;
- }
- }
- return 0;
-}
-
-void SetNode::addElement(TreeFragment * newElement) {
- OSL_ASSERT(newElement != 0);
- newElement->header.next = elements;
- newElement->header.parent = node(this);
- elements = newElement;
-}
-
-TreeFragment * SetNode::removeElement(rtl::OUString const & name) {
- for (TreeFragment ** link = &elements; *link != 0;
- link = &(*link)->header.next)
- {
- if ((*link)->isNamed(name)) {
- TreeFragment * removed = *link;
- *link = removed->header.next;
- removed->header.next = 0;
- removed->header.parent = 0;
- return removed;
- }
- }
- return 0;
-}
-
-//-----------------------------------------------------------------------------
-
-bool ValueNode::isNull() const
-{
- data::Flags::Type availmask = (info.flags & data::Flags::defaulted) ?
- data::Flags::defaultAvailable :
- data::Flags::valueAvailable;
-
- return !(info.flags & availmask);
-}
-//-----------------------------------------------------------------------------
-
-bool ValueNode::hasUsableDefault() const
-{
- return (info.flags & data::Flags::defaultable) &&
- (info.flags & (data::Flags::defaultAvailable| data::Flags::nullable));
-}
-//-----------------------------------------------------------------------------
-
-com::sun::star::uno::Type ValueNode::getValueType() const
-{
- sal_uInt8 aType = sal_uInt8( info.type & data::Type::mask_valuetype );
-
- return getUnoType(aType);
-}
-//-----------------------------------------------------------------------------
-
-com::sun::star::uno::Any ValueNode::getValue() const
-{
- if (info.flags & data::Flags::defaulted)
- return getDefaultValue();
-
- else
- return getUserValue();
-}
-//-----------------------------------------------------------------------------
-
-com::sun::star::uno::Any ValueNode::getUserValue() const
-{
- if (info.flags & data::Flags::valueAvailable)
- {
- sal_uInt8 aType = sal_uInt8( info.type & data::Type::mask_valuetype );
-
- return readData(aType,this->value);
- }
- else
- return com::sun::star::uno::Any();
-}
-//-----------------------------------------------------------------------------
-
-com::sun::star::uno::Any ValueNode::getDefaultValue() const
-{
- if (info.flags & data::Flags::defaultAvailable)
- {
- sal_uInt8 aType = sal_uInt8( info.type & data::Type::mask_valuetype );
-
- return readData(aType,this->defaultValue);
- }
- else
- return com::sun::star::uno::Any();
-}
-
-void ValueNode::setValue(com::sun::star::uno::Any const & newValue) {
- releaseValue();
- if (newValue.hasValue()) {
- sal_uInt8 type = adaptType(newValue);
- value = allocData(type, newValue);
- info.flags |= data::Flags::valueAvailable;
- }
- info.flags &= ~data::Flags::defaulted;
-}
-
-void ValueNode::setToDefault() {
- OSL_ASSERT(hasUsableDefault());
- releaseValue();
- info.flags |= data::Flags::defaulted;
-}
-
-void ValueNode::changeDefault(com::sun::star::uno::Any const & newDefault) {
- sal_uInt8 type = static_cast< sal_uInt8 >(
- info.type & data::Type::mask_valuetype);
- if (info.flags & data::Flags::defaultAvailable) {
- OSL_ASSERT(type != data::Type::value_any);
- freeData(type, defaultValue);
- defaultValue.data = 0;
- info.flags &= ~data::Flags::defaultAvailable;
- }
- if (newDefault.hasValue()) {
- type = adaptType(newDefault);
- defaultValue = allocData(type, newDefault);
- info.flags |= data::Flags::defaultAvailable;
- }
-}
-
-void ValueNode::releaseValue() {
- if ((info.flags & data::Flags::valueAvailable) != 0) {
- sal_uInt8 type = static_cast< sal_uInt8 >(
- info.type & data::Type::mask_valuetype);
- OSL_ASSERT(type != data::Type::value_any);
- freeData(type, value);
- value.data = 0;
- info.flags &= ~data::Flags::valueAvailable;
- }
-}
-
-sal_uInt8 ValueNode::adaptType(com::sun::star::uno::Any const & newValue) {
- sal_uInt8 newType = getTypeCode(newValue.getValueType());
- OSL_ASSERT(newType != data::Type::value_any);
- sal_uInt8 type = static_cast< sal_uInt8 >(
- info.type & data::Type::mask_valuetype);
- if (type == data::Type::value_any) {
- type = static_cast< sal_uInt8 >(newType & data::Type::mask_valuetype);
- info.type = (info.type & ~data::Type::mask_valuetype) | type;
- }
- OSL_ASSERT(newType == type);
- return type;
-}
-
-//-----------------------------------------------------------------------------
-
-bool Node::isNamed(rtl::OUString const & _aName) const
-{
- rtl_uString *pCmpData = _aName.pData;
- rtl_uString *pNodeData = info.name;
-
- // Creating an OUString does rather expensive interlocking here.
- if (pCmpData == pNodeData)
- return true;
- if (pCmpData->length != pNodeData->length)
- return false;
- return !rtl_ustr_compare_WithLength( pCmpData->buffer,
- pCmpData->length,
- pNodeData->buffer,
- pNodeData->length);
-}
-//-----------------------------------------------------------------------------
-
-rtl::OUString Node::getName() const
-{
- return info.getName();
-}
-//-----------------------------------------------------------------------------
-
-configmgr::node::Attributes Node::getAttributes() const
-{
- if(this->isFragmentRoot())
- {
- return this->getTreeFragment()->getAttributes();
- }
- else
- {
- return info.getNodeInfoAttributes();
- }
-}
-//-----------------------------------------------------------------------------
-
-bool Node::isDefault() const
-{
- return info.isDefault();
-}
-//-----------------------------------------------------------------------------
-
-bool Node::isFragmentRoot() const
-{
- return !info.parent;
-}
-#if OSL_DEBUG_LEVEL > 0
-//-----------------------------------------------------------------------------
-Node * Node::getParentNode()
-{
- return info.parent ? this - info.parent : NULL;
-}
-//-----------------------------------------------------------------------------
-
-Node const * Node::getParentNode() const
-{
- return info.parent ? this - info.parent : NULL;
-}
-#endif
-//-----------------------------------------------------------------------------
-static sal_uInt16 getFragmentIndex(Node const * pNode)
-{
- sal_uInt16 result = 0;
- while (sal_uInt16 step = pNode->info.parent)
- {
- result = result + step;
- pNode -= step;
- }
- return result;
-}
-//-----------------------------------------------------------------------------
-
-TreeFragment * Node::getTreeFragment()
-{
- void * pRoot = this - getFragmentIndex(this);
-
- void * pFrag = static_cast<char*>(pRoot) - offsetof(TreeFragment,nodes);
-
- return static_cast<TreeFragment *>(pFrag);
-}
-//-----------------------------------------------------------------------------
-
-TreeFragment const * Node::getTreeFragment() const
-{
- void const * pRoot = this - getFragmentIndex(this);
-
- void const * pFrag = static_cast<char const*>(pRoot) - offsetof(TreeFragment,nodes);
-
- return static_cast<TreeFragment const *>(pFrag);
-}
-
-Node * Node::getSubnode(rtl::OUString const & name) {
- if (isGroup()) {
- return group.getChild(name);
- } else if (isSet()) {
- TreeFragment * element = set.getElement(name);
- return element == 0 ? 0 : element->getRootNode();
- } else {
- OSL_ASSERT(false);
- return 0;
- }
-}
-
-//-----------------------------------------------------------------------------
- } // namespace sharable
-//-----------------------------------------------------------------------------
-} // namespace configmgr
-
-
diff --git a/configmgr/source/tree/nodeconverter.cxx b/configmgr/source/tree/nodeconverter.cxx
deleted file mode 100644
index dab8bf1217..0000000000
--- a/configmgr/source/tree/nodeconverter.cxx
+++ /dev/null
@@ -1,210 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "builddata.hxx"
-#include "nodeconverter.hxx"
-#include "treenodefactory.hxx"
-#include <osl/diagnose.h>
-
-
-//..........................................................................
-namespace configmgr
-{
-
-//==========================================================================
-//= OTreeNodeConverter
-//==========================================================================
-OTreeNodeConverter::OTreeNodeConverter()
-: m_rFactory( getDefaultTreeNodeFactory() )
-{
-}
-
-std::auto_ptr<ISubtree> OTreeNodeConverter::createCorrespondingNode(SubtreeChange const& _rChange)
-{
- std::auto_ptr<ISubtree> aRet;
-
- //if ( isLocalizedValueSet(aSubtree) ) { ... } else - no special case yet
- if (_rChange.isSetNodeChange())
- {
- aRet = nodeFactory().createSetNode(_rChange.getNodeName(),
- _rChange.getElementTemplateName(),
- _rChange.getElementTemplateModule(),
- _rChange.getAttributes());
- }
- else
- {
- aRet = nodeFactory().createGroupNode(_rChange.getNodeName(),
- _rChange.getAttributes());
- }
- return aRet;
-}
-
-//--------------------------------------------------------------------------
-std::auto_ptr<ValueNode> OTreeNodeConverter::createCorrespondingNode(ValueChange const& _rChange)
-{
- // DEFAULT-TODO
- OSL_ENSURE(_rChange.getValueType().getTypeClass() != uno::TypeClass_VOID, "Losing type information converting change to value");
-
- std::auto_ptr<ValueNode> aRet;
- if (_rChange.getNewValue().hasValue())
- aRet = nodeFactory().createValueNode(_rChange.getNodeName(), _rChange.getNewValue(), _rChange.getAttributes());
-
- else
- aRet = nodeFactory().createNullValueNode(_rChange.getNodeName(), _rChange.getValueType(), _rChange.getAttributes());
-
- OSL_ENSURE(aRet.get() && aRet->isValid(), "Could not create corresponding value node");
-
- return aRet;
-}
-
-//==========================================================================
-//= ONodeConverter
-//==========================================================================
-class ONodeConverter : public ChangeTreeModification
-{
- OTreeNodeConverter& m_rFactory;
- std::auto_ptr<INode> m_pNode;
-
-public:
- explicit
- ONodeConverter(OTreeNodeConverter& rFactory)
- : m_rFactory(rFactory)
- {
- }
-
- virtual void handle(ValueChange& aValueNode);
- virtual void handle(AddNode& aAddNode);
- virtual void handle(RemoveNode& aRemoveNode);
- virtual void handle(SubtreeChange& aSubtree);
-
- std::auto_ptr<INode> result() { return m_pNode; }
-
-};
-//==========================================================================
-//= OCreateSubtreeAction
-//==========================================================================
-//= creates a subtree out of a changes list
-//==========================================================================
-struct OCreateSubtreeAction : public ChangeTreeModification
-{
- ISubtree& m_rTree;
- OTreeNodeConverter& m_rNodeFactory;
-
-public:
- OCreateSubtreeAction(ISubtree& _rTree, OTreeNodeConverter& rFactory)
- :m_rTree(_rTree)
- ,m_rNodeFactory(rFactory) {}
-
- void handle(ValueChange& aValueNode);
- void handle(AddNode& aAddNode);
- void handle(RemoveNode& aRemoveNode);
- void handle(SubtreeChange& aSubtree);
-};
-
-
-//--------------------------------------------------------------------------
-std::auto_ptr<ISubtree> OTreeNodeConverter::createCorrespondingTree(SubtreeChange& _rChange)
-{
- std::auto_ptr<ISubtree> pBaseTree = this->createCorrespondingNode(_rChange);
-
- OCreateSubtreeAction aNextLevel(*pBaseTree,*this);
- _rChange.forEachChange(aNextLevel);
-
- return pBaseTree;
-}
-
-//--------------------------------------------------------------------------
-void ONodeConverter::handle(ValueChange& aValueNode)
-{
- m_pNode = base_ptr(m_rFactory.createCorrespondingNode(aValueNode));
-}
-
-//--------------------------------------------------------------------------
-void ONodeConverter::handle(AddNode& aAddNode)
-{
- rtl::Reference< data::TreeSegment > seg(aAddNode.getNewTree());
- m_pNode = data::convertTree(seg.is() ? seg->fragment : 0, true);
-}
-
-//--------------------------------------------------------------------------
-void ONodeConverter::handle(RemoveNode& /*aRemoveNode*/)
-{
- m_pNode.reset();
-}
-
-//--------------------------------------------------------------------------
-void ONodeConverter::handle(SubtreeChange& aSubtree)
-{
- m_pNode = base_ptr(m_rFactory.createCorrespondingNode(aSubtree));
-}
-
-//--------------------------------------------------------------------------
-void OCreateSubtreeAction::handle(ValueChange& _rChange)
-{
- // create a node by a ValueChange
- std::auto_ptr<ValueNode> pNode = m_rNodeFactory.createCorrespondingNode(_rChange);
-
- m_rTree.addChild(base_ptr(pNode));
-}
-
-//--------------------------------------------------------------------------
-void OCreateSubtreeAction::handle(SubtreeChange& _rChange)
-{
- // create a node from a SubtreeChange (recursively)
- std::auto_ptr<ISubtree> pNode = m_rNodeFactory.createCorrespondingTree(_rChange);
-
- // add it to the tree
- m_rTree.addChild(base_ptr(pNode));
-}
-
-//--------------------------------------------------------------------------
-void OCreateSubtreeAction::handle(RemoveNode& _rChange)
-{
- { (void)_rChange; }
- // we have nothing to do
- OSL_ENSURE(!m_rTree.getChild(_rChange.getNodeName()), "Removed node found in tree being built");
-}
-
-//--------------------------------------------------------------------------
-void OCreateSubtreeAction::handle(AddNode& _rChange)
-{
- // free the node and add it to the subtree
- rtl::Reference< data::TreeSegment > aNewNode = _rChange.getNewTree();
- m_rTree.addChild(data::convertTree(aNewNode.is() ? aNewNode->fragment : 0, true));
-}
-
-
-//--------------------------------------------------------------------------
-
-//..........................................................................
-} // namespace configmgr
-//..........................................................................
-
-
diff --git a/configmgr/source/tree/nodevisitor.cxx b/configmgr/source/tree/nodevisitor.cxx
deleted file mode 100644
index 5206ac7e38..0000000000
--- a/configmgr/source/tree/nodevisitor.cxx
+++ /dev/null
@@ -1,104 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "precompiled_configmgr.hxx"
-#include "sal/config.h"
-
-#include "osl/diagnose.h"
-
-#include "flags.hxx"
-#include "nodevisitor.hxx"
-#include "node.hxx"
-#include "treefragment.hxx"
-
-namespace configmgr { namespace data {
-
-NodeVisitor::~NodeVisitor() {}
-
-bool NodeVisitor::visitNode(sharable::Node * node) {
- switch (node->info.type & data::Type::mask_nodetype) {
- case data::Type::nodetype_value:
- return handle(&node->value);
- case data::Type::nodetype_group:
- return handle(&node->group);
- case data::Type::nodetype_set:
- return handle(&node->set);
- default:
- OSL_ASSERT(false);
- return false;
- }
-}
-
-bool NodeVisitor::visitChildren(sharable::GroupNode * node) {
- for (sharable::Node * child = node->getFirstChild(); child != 0;
- child = node->getNextChild(child))
- {
- if (visitNode(child)) {
- return true;
- }
- }
- return false;
-}
-
-bool NodeVisitor::handle(sharable::Node *) {
- return false;
-}
-
-bool NodeVisitor::handle(sharable::ValueNode * node) {
- return handle(sharable::node(node));
-}
-
-bool NodeVisitor::handle(sharable::GroupNode * node) {
- return handle(sharable::node(node));
-}
-
-bool NodeVisitor::handle(sharable::SetNode * node) {
- return handle(sharable::node(node));
-}
-
-SetVisitor::~SetVisitor() {}
-
-bool SetVisitor::visitTree(sharable::TreeFragment * tree) {
- return handle(tree);
-}
-
-bool SetVisitor::visitElements(sharable::SetNode * node) {
- for (sharable::TreeFragment * element = node->getFirstElement();
- element != 0; element = node->getNextElement(element))
- {
- if (handle(element)) {
- return true;
- }
- }
- return false;
-}
-
-bool SetVisitor::handle(sharable::TreeFragment * tree) {
- return visitNode(tree->getRootNode());
-}
-
-} }
diff --git a/configmgr/source/tree/subtree.hxx b/configmgr/source/tree/subtree.hxx
deleted file mode 100644
index 9697486be9..0000000000
--- a/configmgr/source/tree/subtree.hxx
+++ /dev/null
@@ -1,110 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_SUBTREE_HXX
-#define CONFIGMGR_SUBTREE_HXX
-
-#include "valuenode.hxx"
-#include <rtl/ustring.hxx>
-
-#include <memory>
-#include <set>
-#include <vector>
-
-namespace configmgr
-{
- // List sorted by name for binary search
- class ChildListSet {
- std::vector< INode* > m_aChildList;
-
- ChildListSet(ChildListSet const&);
- ChildListSet& operator=(ChildListSet const& aSet);
- public:
- std::vector< INode* >::iterator begin() const { return const_cast<std::vector< INode* >*>(&m_aChildList)->begin(); }
- std::vector< INode* >::iterator end() const { return const_cast<std::vector< INode* >*>(&m_aChildList)->end(); }
- INode *erase(INode *pNode);
- std::vector< INode* >::iterator find(INode *pNode) const;
- std::pair<std::vector< INode* >::iterator, bool> insert(INode *aInsert);
-
- ChildListSet() : m_aChildList(0) {}
- ChildListSet(ChildListSet const&, treeop::DeepChildCopy);
- ~ChildListSet();
- };
-
-// Inner Node
- class Subtree : public ISubtree
- {
- ChildListSet m_aChildren;
- virtual INode* doGetChild(rtl::OUString const& name) const;
-
- public:
- Subtree(){}
- Subtree(const rtl::OUString& _rName,
- const node::Attributes& _rAttrs)
- :ISubtree(_rName, _rAttrs){};
-
- Subtree(const ISubtree& _rOther, treeop::NoChildCopy)
- : ISubtree(_rOther), m_aChildren(){};
-
- Subtree(const rtl::OUString& _rName,
- const rtl::OUString& _rTemplateName, const rtl::OUString& _rTemplateModule,
- const node::Attributes& _rAttrs)
- :ISubtree(_rName, _rTemplateName, _rTemplateModule, _rAttrs){};
-
- Subtree(const Subtree& _rOther, treeop::DeepChildCopy _dc)
- : ISubtree(_rOther), m_aChildren(_rOther.m_aChildren,_dc){}
-
- virtual INode* addChild(std::auto_ptr<INode> node); // takes ownership
- virtual ::std::auto_ptr<INode> removeChild(rtl::OUString const& name);
-
- virtual std::auto_ptr<INode> clone() const;
-
-// Iteration support
- virtual void forEachChild(NodeAction& anAction) const;
- virtual void forEachChild(NodeModification& anAction);
- };
-
-
-
- // to search in ChildListSet a value
- class SearchNode : public INode
- {
- public:
- SearchNode(rtl::OUString const& aName);
- virtual ~SearchNode();
- virtual std::auto_ptr<INode> clone() const;
-
-// double dispatch support
- virtual void dispatch(NodeAction& /*anAction*/) const { }
- virtual void dispatch(NodeModification& /*anAction*/) { }
- };
-
-// -----------------------------------------------------------------------------
-} // namespace configmgr
-
-#endif
-
diff --git a/configmgr/source/tree/treeactions.cxx b/configmgr/source/tree/treeactions.cxx
deleted file mode 100644
index d94215d82b..0000000000
--- a/configmgr/source/tree/treeactions.cxx
+++ /dev/null
@@ -1,64 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <stdio.h>
-
-#include "treeactions.hxx"
-#include <osl/diagnose.h>
-
-
-//..........................................................................
-namespace configmgr
-{
-
-//==========================================================================
-//= OChangeActionCounter
-//==========================================================================
-
-//--------------------------------------------------------------------------
-void OChangeActionCounter::handle(ValueChange const& /*aValueNode*/){ ++nValues; }
-
-//--------------------------------------------------------------------------
-void OChangeActionCounter::handle(AddNode const& /*aAddNode*/){ ++nAdds; }
-
-//--------------------------------------------------------------------------
-void OChangeActionCounter::handle(RemoveNode const& /*aRemoveNode*/){ ++nRemoves; }
-
-//--------------------------------------------------------------------------
-void OChangeActionCounter::handle(SubtreeChange const& aSubtree)
-{
- applyToChildren(aSubtree);
-}
-
-//..........................................................................
-} // namespace configmgr
-//..........................................................................
-
-
diff --git a/configmgr/source/tree/treechangefactory.cxx b/configmgr/source/tree/treechangefactory.cxx
deleted file mode 100644
index e752bed878..0000000000
--- a/configmgr/source/tree/treechangefactory.cxx
+++ /dev/null
@@ -1,123 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <stdio.h>
-
-#include "treechangefactory.hxx"
-#include "change.hxx"
-#include "configpath.hxx"
-
-namespace configmgr
-{
-//= dummy helpe ============================================================
-bool isGenericSetElementType(rtl::OUString const& _aElementType)
-{
- return !! _aElementType.equals( getGenericSetElementType() );
-}
-
-bool isDummySetElementModule(rtl::OUString const& _aElementModule)
-{
- return !! _aElementModule.equals( getDummySetElementModule() );
-}
-
-rtl::OUString getGenericSetElementType()
-{
- return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*"));
-}
-
-rtl::OUString getDummySetElementModule()
-{
- return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("cfg:dummy-change"));
-}
-
-//= static default ============================================================
-OTreeChangeFactory& getDefaultTreeChangeFactory()
-{
- static OTreeChangeFactory aDefaultFactory;
- return aDefaultFactory;
-}
-
-//= SubtreeChanges ============================================================
-std::auto_ptr<SubtreeChange> OTreeChangeFactory::createDummyChange(
- rtl::OUString const& _aName, rtl::OUString const& _aElementTypeName)
-{
- std::auto_ptr<SubtreeChange> pResult;
-
- if (_aElementTypeName.getLength() == 0)
- {
- pResult.reset( new SubtreeChange(_aName, node::Attributes()) );
- }
- else
- {
- pResult.reset( new SubtreeChange(_aName,
- _aElementTypeName,
- getDummySetElementModule(),
- node::Attributes()) );
- }
- return pResult;
-}
-
-//-----------------------------------------------
-std::auto_ptr<SubtreeChange> OTreeChangeFactory::createSetNodeChange(
- rtl::OUString const& _aName,
- rtl::OUString const& _aTemplateName,
- rtl::OUString const& _aTemplateModule,
- node::Attributes _aAttrs,
- bool _bToDefault)
-{
- return std::auto_ptr<SubtreeChange>(new SubtreeChange(_aName,
- _aTemplateName,
- _aTemplateModule,
- _aAttrs,_bToDefault));
-}
-//-----------------------------------------------
-
-//= Set Changes ============================================================
-std::auto_ptr<AddNode> OTreeChangeFactory::createAddNodeChange(
- rtl::Reference< data::TreeSegment > const & _aNewTree,
- rtl::OUString const& _aName,
- bool _bToDefault)
-{
- return std::auto_ptr<AddNode>(new AddNode(_aNewTree,_aName,_bToDefault));
-}
-
-//-----------------------------------------------
-std::auto_ptr<RemoveNode> OTreeChangeFactory::createRemoveNodeChange(
- rtl::OUString const& _aName,
- bool _bToDefault)
-{
- return std::auto_ptr<RemoveNode>(new RemoveNode(_aName,_bToDefault));
-}
-
-//-----------------------------------------------
-
-} // namespace configmgr
-
-
diff --git a/configmgr/source/tree/treefragment.cxx b/configmgr/source/tree/treefragment.cxx
deleted file mode 100644
index ae93dff2aa..0000000000
--- a/configmgr/source/tree/treefragment.cxx
+++ /dev/null
@@ -1,130 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "treefragment.hxx"
-#include "utility.hxx"
-#include "attributes.hxx"
-#include <rtl/ustring.hxx>
-
-// memset
-#include <string.h>
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace sharable
- {
-//-----------------------------------------------------------------------------
-rtl::OUString TreeFragment::getName() const
-{
- return rtl::OUString(this->header.name);
-}
-
-void TreeFragment::setName(rtl::OUString const & name) {
- rtl_uString * old = header.name;
- header.name = acquireString(name);
- rtl_uString_release(old);
-}
-
-//-----------------------------------------------------------------------------
-
-bool TreeFragment::isNamed(rtl::OUString const & _aName) const
-{
- // TODO: optimize comparison
- return !!(this->getName() == _aName);
-}
-//-----------------------------------------------------------------------------
-
-bool TreeFragment::hasDefaultsAvailable() const
-{
- return (this->header.state & data::State::flag_default_avail) || isDefault();
-}
-//-----------------------------------------------------------------------------
-
-
-bool TreeFragment::isDefault() const
-{
- return (this->header.state & data::State::mask_state) == data::State::defaulted;
-}
-//-----------------------------------------------------------------------------
-
-bool TreeFragment::isNew() const
-{
- return (this->header.state & data::State::mask_state) == data::State::added;
-}
-//-----------------------------------------------------------------------------
-
-configmgr::node::Attributes TreeFragment::getAttributes() const
-{
- configmgr::node::Attributes aResult;
-
- switch (this->header.state & data::State::mask_state)
- {
- case data::State::merged: aResult.setState(configmgr::node::isMerged); break;
- case data::State::defaulted: aResult.setState(configmgr::node::isDefault); break;
- case data::State::replaced: aResult.setState(configmgr::node::isReplaced); break;
- case data::State::added: aResult.setState(configmgr::node::isAdded); break;
- default: OSL_ASSERT(false); break; // not reachable
- }
-
- aResult.setRemovability(!!(this->header.state & data::State::flag_removable),
- !!(this->header.state & data::State::flag_mandatory));
-
-
- OSL_ASSERT( header.count != 0 );
- NodeInfo const & aRootNodeInfo = this->nodes[0].info;
-
- aResult.setAccess( !!(this->header.state & data::State::flag_readonly),
- !!(aRootNodeInfo.flags & data::Flags::finalized) );
-
- aResult.setLocalized ( !!(aRootNodeInfo.flags & data::Flags::localized));
-
- return aResult;
-}
-
-TreeFragment *TreeFragment::allocate(sal_uInt32 nFragments)
-{
- sal_uInt32 nSize = sizeof(TreeFragment) + sizeof(Node) * (nFragments-1);
- sal_uInt8 *pMem = new sal_uInt8 [nSize];
- memset (pMem, 0, nSize);
- return reinterpret_cast<TreeFragment *>(pMem);
-}
-
-void TreeFragment::free_shallow(TreeFragment *pFragment )
-{
- delete[] (sal_uInt8 *) pFragment;
-}
-
-//-----------------------------------------------------------------------------
- } // namespace sharable
-//-----------------------------------------------------------------------------
-} // namespace configmgr
-
-
diff --git a/configmgr/source/tree/treenodefactory.cxx b/configmgr/source/tree/treenodefactory.cxx
deleted file mode 100644
index 5a5249fdb1..0000000000
--- a/configmgr/source/tree/treenodefactory.cxx
+++ /dev/null
@@ -1,110 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <stdio.h>
-
-#include "treenodefactory.hxx"
-#include "valuenode.hxx"
-#include "subtree.hxx"
-#include "treechangefactory.hxx"
-#include "configpath.hxx"
-
-namespace configmgr
-{
-
-//= static default ============================================================
-OTreeNodeFactory& getDefaultTreeNodeFactory()
-{
- static OTreeNodeFactory aDefaultFactory;
- return aDefaultFactory;
-}
-
-//= ValueNodes ============================================================
-
-std::auto_ptr<ValueNode> OTreeNodeFactory::createValueNode(
- rtl::OUString const& aName,
- uno::Any const& aValue,
- node::Attributes _aAttrs)
-{
- OSL_ENSURE(aValue.hasValue(), "OTreeNodeFactory: Creating a value node having no type");
- return std::auto_ptr<ValueNode>( new ValueNode(aName, aValue, _aAttrs) );
-}
-
-//-----------------------------------------------
-
-std::auto_ptr<ValueNode> OTreeNodeFactory::createValueNode(
- rtl::OUString const& aName,
- uno::Any const& aValue,
- uno::Any const& aDefault,
- node::Attributes _aAttrs)
-{
- OSL_ENSURE(aValue.hasValue() || aDefault.hasValue(), "OTreeNodeFactory: Creating a value node having no type");
- return std::auto_ptr<ValueNode>( new ValueNode(aName, aValue, aDefault, _aAttrs) );
-}
-
-
-//-----------------------------------------------
-
-std::auto_ptr<ValueNode> OTreeNodeFactory::createNullValueNode(
- rtl::OUString const& aName,
- uno::Type const& aType,
- node::Attributes _aAttrs)
-{
- OSL_ENSURE(aType.getTypeClass() != uno::TypeClass_VOID, "OTreeNodeFactory: Creating a value node having VOID type");
- return std::auto_ptr<ValueNode>( new ValueNode(aName, aType, _aAttrs) );
-}
-
-
-//-----------------------------------------------
-
-std::auto_ptr<ISubtree> OTreeNodeFactory::createGroupNode(
- rtl::OUString const& aName,
- node::Attributes _aAttrs)
-{
- return std::auto_ptr<ISubtree>( new Subtree(aName, _aAttrs) );
-}
-
-
-//-----------------------------------------------
-
-std::auto_ptr<ISubtree> OTreeNodeFactory::createSetNode(
- rtl::OUString const& aName,
- rtl::OUString const& _rTemplateName,
- rtl::OUString const& _rTemplateModule,
- node::Attributes _aAttrs)
-{
- return std::auto_ptr<ISubtree>( new Subtree(aName, _rTemplateName, _rTemplateModule, _aAttrs) );
-}
-
-//-----------------------------------------------
-
-} // namespace configmgr
-
-
diff --git a/configmgr/source/tree/treesegment.cxx b/configmgr/source/tree/treesegment.cxx
deleted file mode 100644
index 6cb01216c9..0000000000
--- a/configmgr/source/tree/treesegment.cxx
+++ /dev/null
@@ -1,88 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "precompiled_configmgr.hxx"
-#include "sal/config.h"
-
-#include <memory>
-
-#include "osl/diagnose.h"
-#include "rtl/ref.hxx"
-#include "salhelper/simplereferenceobject.hxx"
-
-#include "builddata.hxx"
-#include "treesegment.hxx"
-
-namespace configmgr { namespace data {
-
-rtl::Reference< TreeSegment > TreeSegment::create(
- std::auto_ptr< INode > tree, rtl::OUString const & type)
-{
- rtl::Reference< TreeSegment > r;
- if (tree.get() != 0) {
- std::auto_ptr< sharable::TreeFragment > p(
- buildElementTree(*tree, type, false));
- r = new TreeSegment(p.get());
- p.release();
- }
- return r;
-}
-
-rtl::Reference< TreeSegment > TreeSegment::create(
- rtl::OUString const & name, std::auto_ptr< INode > tree)
-{
- rtl::Reference< TreeSegment > r;
- if (tree.get() != 0) {
- std::auto_ptr< sharable::TreeFragment > p(
- buildTree(name, *tree, false));
- r = new TreeSegment(p.get());
- p.release();
- }
- return r;
-}
-
-rtl::Reference< TreeSegment > TreeSegment::create(
- sharable::TreeFragment * tree)
-{
- rtl::Reference< TreeSegment > r;
- if (tree != 0) {
- std::auto_ptr< sharable::TreeFragment > p(data::buildTree(tree));
- r = new TreeSegment(p.get());
- p.release();
- }
- return r;
-}
-
-TreeSegment::TreeSegment(sharable::TreeFragment * tree): fragment(tree) {
- OSL_ASSERT(tree != 0);
-}
-
-TreeSegment::~TreeSegment() {
- destroyTree(fragment);
-}
-
-} }
diff --git a/configmgr/source/tree/updatehelper.cxx b/configmgr/source/tree/updatehelper.cxx
deleted file mode 100644
index 89e02616e7..0000000000
--- a/configmgr/source/tree/updatehelper.cxx
+++ /dev/null
@@ -1,622 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <stdio.h>
-
-#include "updatehelper.hxx"
-#include "change.hxx"
-#include "nodeconverter.hxx"
-#include "treeactions.hxx"
-#include "treechangefactory.hxx"
-#include "treenodefactory.hxx"
-
-// -----------------------------------------------------------------------------
-#include "node.hxx"
-#include "treefragment.hxx"
-#include "builddata.hxx"
-#include "nodevisitor.hxx"
-// -----------------------------------------------------------------------------
-#include "tracer.hxx"
-#include <osl/diagnose.h>
-
-
-//..........................................................................
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
-//==========================================================================
-//= AdjustUpdate
-//==========================================================================
-//= This class tests changes on an existing tree and drops them if they
-//= are not need anymore or alters add nodes in node changes and vice versa
-//==========================================================================
-class AdjustUpdate : ChangeTreeModification
-{
- SubtreeChange& m_rChangeList; // list which containes changes merged with the existing nodes
- sharable::Node * m_refNode; // reference node needed for merging
- OTreeNodeConverter m_aNodeConverter;
-public:
- static bool adjust(SubtreeChange& _rResultTree, SubtreeChange& _aUpdateTree,
- sharable::Node * targetNode)
- {
- return AdjustUpdate(_rResultTree, targetNode).impl_adjust(_aUpdateTree);
- }
- static bool adjust(SubtreeChange& _rResultTree, SubtreeChange& _aUpdateTree,
- sharable::Node * targetNode,
- OTreeNodeFactory& _rNodeFactory)
- {
- return AdjustUpdate(_rResultTree, targetNode, _rNodeFactory).impl_adjust(_aUpdateTree);
- }
-private:
- AdjustUpdate(SubtreeChange& rList, sharable::Node * node)
- :m_rChangeList(rList)
- ,m_refNode(node)
- ,m_aNodeConverter()
- {}
-
- AdjustUpdate(SubtreeChange& rList, sharable::Node * node, OTreeNodeFactory& _rNodeFactory)
- :m_rChangeList(rList)
- ,m_refNode(node)
- ,m_aNodeConverter(_rNodeFactory)
- {}
-
- void handle(ValueChange& aValueNode);
- void handle(AddNode& aAddNode);
- void handle(RemoveNode& aRemoveNode);
- void handle(SubtreeChange& aSubtree);
-
- bool impl_adjust(SubtreeChange& _aUpdateTree);
-private:
- // ensuring the correct state
- bool checkNode() const;
-};
-
-// --------------------------------- ApplyUpdate ---------------------------------
-
-class ApplyUpdate : public ChangeTreeModification
-{
- sharable::Node * m_aCurrentNode;
-public:
- ApplyUpdate(sharable::Node * _aNode)
- : m_aCurrentNode(_aNode)
- {}
-
- void handle(ValueChange& aValueNode);
- void handle(AddNode& aAddNode);
- void handle(RemoveNode& aRemoveNode);
- void handle(SubtreeChange& aSubtree);
-};
-//--------------------------------------------------------------------------
-class ApplyValueChange
-{
- static
- void adjust(uno::Any& aActual, uno::Any const& aTarget);
-
-public:
- static
- void apply(ValueChange& _rValueChange, sharable::ValueNode * valueNode);
-};
-//--------------------------------------------------------------------------
-//--------------------------------------------------------------------------
-
-// apply a already matching set of changes to the target tree
- void applyUpdateToTree(SubtreeChange& _anUpdateTree, sharable::Node * _aRootNode)
- {
- ApplyUpdate aUpdater(_aRootNode);
- _anUpdateTree.forEachChange(aUpdater);
- }
-//--------------------------------------------------------------------------
-// apply a set of changes to the target tree
- void applyUpdateWithAdjustmentToTree(SubtreeChange& _anUpdateTree, sharable::Node * _aRootNode)
- {
- // POST: pSubtree = pSubtree + aChangeList
- SubtreeChange aActualChanges(_anUpdateTree, treeop::NoChildCopy());
-
- if ( AdjustUpdate::adjust(aActualChanges,_anUpdateTree, _aRootNode) )
- {
- applyUpdateToTree(aActualChanges, _aRootNode);
- }
- _anUpdateTree.swap(aActualChanges);
-
- }
-//--------------------------------------------------------------------------
-//--------------------------------------------------------------------------
-
-static inline
-rtl::OUString getNodeName(INode const & _aNode)
-{
- return _aNode.getName();
-}
-//--------------------------------------------------------------------------
-
-static inline
-rtl::OUString getChangeNodeName(Change const & _aChange)
-{
- return _aChange.getNodeName();
-}
-//--------------------------------------------------------------------------
-
-bool AdjustUpdate::impl_adjust(SubtreeChange& _aUpdateTree)
-{
- // first check the changes
- this->applyToChildren(_aUpdateTree);
-
- // now check whether there are real modifications
- OChangeActionCounter aChangeCounter;
- aChangeCounter.handle(m_rChangeList);
- CFG_TRACE_INFO_NI("cache manager: counted changes : additions: %i , removes: %i, value changes: %i", aChangeCounter.nAdds, aChangeCounter.nRemoves, aChangeCounter.nValues);
-
- return !! aChangeCounter.hasChanges();
-}
-// -----------------------------------------------------------------------------
-
-inline bool AdjustUpdate::checkNode() const
-{
- // Change a Value
- OSL_ENSURE(m_refNode != 0, "AdjustUpdate: no data");
-
- return m_refNode != 0;
-}
-//--------------------------------------------------------------------------
-
-void AdjustUpdate::handle(ValueChange& _rChange)
-{
- if (checkNode())
- {
- // We need to find the element in the tree
- sharable::Node * childNode = m_refNode->getSubnode(getChangeNodeName(_rChange));
-
- // We have a node so we can keep the Change and the values do not differ
- if (childNode != 0)
- {
- bool bIsValue = childNode->isValue();
- OSL_ENSURE(bIsValue, "AdjustUpdate : node must be a value node!");
-
- if (bIsValue && _rChange.isChange())
- {
- std::auto_ptr<Change> pChange( new ValueChange(_rChange) );
- m_rChangeList.addChange(pChange);
- }
- }
- else
- {
- std::auto_ptr<ValueNode> pNode = m_aNodeConverter.createCorrespondingNode(_rChange);
-
- OSL_ENSURE(m_rChangeList.isSetNodeChange(), "Adding a new value to a non-set node");
- rtl::OUString sTypeName = m_rChangeList.getElementTemplateName();
-
- rtl::Reference< data::TreeSegment > aNewTree = data::TreeSegment::create(base_ptr(pNode),sTypeName);
- // add the tree to the change list
- std::auto_ptr<Change> pChange( new AddNode( aNewTree,_rChange.getNodeName(), _rChange.isToDefault()) );
- m_rChangeList.addChange(pChange);
- }
- }
-}
-//--------------------------------------------------------------------------
-
-void AdjustUpdate::handle(SubtreeChange& _rChange)
-{
- if (checkNode())
- {
- // We need to find the element in the tree
- sharable::Node * childNode = m_refNode->getSubnode(getChangeNodeName(_rChange));
-
- // if there is a node we continue
- if (childNode != 0)
- {
- bool bIsSubtree = childNode->isGroup() || childNode->isSet();
- OSL_ENSURE(bIsSubtree, "AdjustUpdate : node must be a inner node!");
-
- if (bIsSubtree)
- {
- // generate a new change
- std::auto_ptr<SubtreeChange> pChange( new SubtreeChange(_rChange, treeop::NoChildCopy()) );
-
- // recurse
- if ( adjust(*pChange,_rChange,childNode,m_aNodeConverter.nodeFactory()) )
- m_rChangeList.addChange(base_ptr(pChange));
- }
- else
- OSL_ENSURE(false, "Inconsistent data: Subtree Change is merged into non-subtree node.");
- }
- // otherwise we have to create the node
- else
- {
- std::auto_ptr<ISubtree> pNode = m_aNodeConverter.createCorrespondingTree(_rChange);
- OSL_ASSERT(pNode.get() != NULL);
-
- // set the level
- pNode->setLevels(treeop::ALL_LEVELS,treeop::ALL_LEVELS);
-
- OSL_ENSURE(m_rChangeList.isSetNodeChange(), "Adding a new value to a non-set node");
- rtl::OUString sTypeName = m_rChangeList.getElementTemplateName();
-
- rtl::Reference< data::TreeSegment > aNewTree = data::TreeSegment::create(base_ptr(pNode), sTypeName);
-
- // add the tree to the change list
- std::auto_ptr<Change> pChange( new AddNode(aNewTree,_rChange.getNodeName(), _rChange.isToDefault()) );
- m_rChangeList.addChange( pChange );
- }
- }
-}
-//--------------------------------------------------------------------------
-
-void AdjustUpdate::handle(RemoveNode& _rChange)
-{
- if (checkNode())
- {
- // We need to find the element in the tree
- sharable::Node * childNode = m_refNode->getSubnode(getChangeNodeName(_rChange));
-
- // only if there is a node, we will keep the change
- if (childNode != 0)
- {
- // generate a new change
- std::auto_ptr<Change> pChange( new RemoveNode(_rChange.getNodeName(),_rChange.isToDefault()) );
- m_rChangeList.addChange(pChange);
- }
- }
-}
-//--------------------------------------------------------------------------
-
-void AdjustUpdate::handle(AddNode& _rChange)
-{
- if (checkNode())
- {
- // We need to find the element in the tree
- sharable::Node * childNode = m_refNode->getSubnode(getChangeNodeName(_rChange));
-
- rtl::Reference< data::TreeSegment > aNewNode = _rChange.getNewTree();
- std::auto_ptr<AddNode> pChange( new AddNode(aNewNode,_rChange.getNodeName(),_rChange.isToDefault()) );
- if (childNode != 0)
- {
- pChange->setReplacing();
- }
- m_rChangeList.addChange(base_ptr(pChange));
- }
-}
-//--------------------------------------------------------------------------
-//--------------------------------------------------------------------------
-
-inline
-void ApplyValueChange::adjust(uno::Any& aActual, uno::Any const& aTarget)
-{
- // If set - it should already match
- OSL_ASSERT(!aActual.hasValue() || aTarget == aActual);
- aActual = aTarget;
-}
-
-//--------------------------------------------------------------------------
-// _rValueChange.applyTo(_aValueNode)
-void ApplyValueChange::apply(ValueChange& _rValueChange, sharable::ValueNode * valueNode)
-{
- switch (_rValueChange.getMode())
- {
- case ValueChange::wasDefault:
- OSL_ASSERT(valueNode->info.isDefault());
-
- case ValueChange::changeValue:
- adjust( _rValueChange.m_aOldValue, valueNode->getValue());
- valueNode->setValue(_rValueChange.getNewValue());
- break;
-
- case ValueChange::setToDefault:
- adjust(_rValueChange.m_aOldValue, valueNode->getValue());
- adjust(_rValueChange.m_aValue, valueNode->getDefaultValue());
- valueNode->setToDefault();
- break;
-
- case ValueChange::changeDefault:
- adjust(_rValueChange.m_aOldValue, valueNode->getDefaultValue());
- valueNode->changeDefault(_rValueChange.getNewValue());
- break;
-
- default:
- OSL_ENSURE(0, "Unknown mode found for ValueChange");
- break;
- }
-}
-//--------------------------------------------------------------------------
-
-void ApplyUpdate::handle(ValueChange& _rChange)
-{
- // Change a Value
- OSL_ENSURE(m_aCurrentNode != NULL,"Cannot apply ValueChange without node");
-
- sharable::Node * childNode = m_aCurrentNode->getSubnode(getChangeNodeName(_rChange));
- OSL_ENSURE(childNode != 0, "Cannot apply Change: No node to change");
-
- sharable::ValueNode * aValueAddr = childNode->valueData();
- OSL_ENSURE(aValueAddr != NULL,"Cannot apply ValueChange: Node is not a value");
-
- if (aValueAddr != NULL)
- ApplyValueChange::apply(_rChange,aValueAddr);
-}
-//--------------------------------------------------------------------------
-
-void ApplyUpdate::handle(SubtreeChange& _rChange)
-{
- // handle traversion
- OSL_ENSURE(m_aCurrentNode != NULL,"Cannot apply SubtreeChange without node");
-
- sharable::Node * childNode = m_aCurrentNode->getSubnode(getChangeNodeName(_rChange));
- OSL_ENSURE(childNode != 0, "Cannot apply Change: No node to change");
-
- OSL_ENSURE( childNode->isGroup() || childNode->isSet(),
- "Cannot Apply SubtreeChange: Node is not an inner node");
-
- if (childNode != 0)
- {
- childNode->info.markAsDefault( _rChange.isToDefault() );
-
- sharable::Node * aOldNode = m_aCurrentNode;
- m_aCurrentNode = childNode;
-
- _rChange.forEachChange(*this);
-
- m_aCurrentNode = aOldNode;
- }
-}
-//--------------------------------------------------------------------------
-
-void ApplyUpdate::handle(AddNode& _rChange)
-{
- OSL_ENSURE(m_aCurrentNode != NULL,"Cannot apply AddNode without node");
-
- sharable::SetNode * aSetNodeAddr = sharable::SetNode::from(m_aCurrentNode);
- OSL_ENSURE(aSetNodeAddr != NULL,"Cannot apply AddNode: Node is not a set node");
-
- // Add a new element
- if (aSetNodeAddr != NULL)
- {
- if (_rChange.isReplacing())
- {
- sharable::TreeFragment * old = aSetNodeAddr->removeElement(getChangeNodeName(_rChange));
- OSL_ASSERT(old != 0);
- _rChange.takeReplacedTree(data::TreeSegment::create(old));
- }
-
- sharable::TreeFragment * aNewAddress = data::buildTree(_rChange.getNewTree()->fragment);
- OSL_ENSURE(aNewAddress != NULL, "ApplyUpdate: AddNode: could not create new element");
-
- aSetNodeAddr->addElement(aNewAddress);
-
- _rChange.setInsertedAddress( aNewAddress );
- }
-}
-//--------------------------------------------------------------------------
-
-void ApplyUpdate::handle(RemoveNode& _rChange)
-{
- OSL_ENSURE(m_aCurrentNode != NULL,"Cannot apply RemoveNode without node");
-
- sharable::SetNode * aSetNodeAddr = sharable::SetNode::from(m_aCurrentNode);
- OSL_ENSURE(aSetNodeAddr != NULL,"Cannot apply RemoveNode: Node is not a set node");
-
- // Remove an element
- if (aSetNodeAddr != NULL)
- {
- sharable::TreeFragment * old = aSetNodeAddr->removeElement(getChangeNodeName(_rChange));
- OSL_ASSERT(old != 0);
- _rChange.takeRemovedTree(data::TreeSegment::create(old));
- }
-}
-//--------------------------------------------------------------------------
-//--------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- struct ForwardTreeDifferenceBuilder : NodeAction
- {
- protected:
- SubtreeChange& m_rChangeList;
- sharable::Node * m_cacheNode;
-
- public:
- ForwardTreeDifferenceBuilder(SubtreeChange& rList, sharable::Node * cacheNode)
- : m_rChangeList(rList)
- , m_cacheNode(cacheNode)
- {
- }
-
- virtual void handle(ValueNode const& _aNewNode)
- {
- sharable::Node * childNode = m_cacheNode->getSubnode(getNodeName(_aNewNode));
- if (childNode != 0)
- {
- sharable::ValueNode * valueNode = childNode->valueData();
-
- OSL_ENSURE(valueNode != 0, "TreeDifferenceBuilder: node must be a value node!");
-
- // if the values differ add a new change
- if (_aNewNode.getValue() != valueNode->getValue())
- {
- bool bNewDefault = _aNewNode.isDefault();
- bool bOldDefault = valueNode->info.isDefault();
-
- ValueChange::Mode eMode;
- if (bNewDefault)
- if (bOldDefault)
- eMode = ValueChange::changeDefault;
- else
- eMode = ValueChange::setToDefault;
- else
- if (bOldDefault)
- eMode = ValueChange::wasDefault;
- else
- eMode = ValueChange::changeValue;
-
- std::auto_ptr<Change> pChange(
- new ValueChange(_aNewNode.getName(), _aNewNode.getAttributes(), eMode,
- _aNewNode.getValue(), valueNode->getValue()) );
-
- m_rChangeList.addChange(pChange);
- }
- }
- }
- virtual void handle(ISubtree const& _aNewNode)
- {
- sharable::Node * childNode = m_cacheNode->getSubnode(getNodeName(_aNewNode));
-
- if (childNode != 0)
- {
- OSL_ENSURE( childNode->isGroup() || childNode->isSet(),
- "ForwardTreeDifferenceBuilder: Node must be an inner node");
-
- // generate a new change
- std::auto_ptr<SubtreeChange> pNewChange( new SubtreeChange(_aNewNode) );
-
- // .. and recurse
- ForwardTreeDifferenceBuilder aNextLevel(*pNewChange, childNode);
- aNextLevel.applyToChildren(_aNewNode);
-
- // now count if there are any changes
- OChangeActionCounter aCounter;
- aCounter.applyToChange(*pNewChange);
-
- if (aCounter.hasChanges())
- m_rChangeList.addChange(base_ptr(pNewChange));
- }
- else if (m_cacheNode != 0 && m_cacheNode->isSet())
- {
- // Subtree not in Cache, add in TreeChangeList
- // SubtreeChange* pChange = new SubtreeChange(_rSubtree);
- OSL_ENSURE(m_rChangeList.isSetNodeChange(), "Found newly added node in non-set node");
- rtl::OUString sTypeName = m_rChangeList.getElementTemplateName();
-
- std::auto_ptr<INode> pSubtree( _aNewNode.clone() );
- rtl::Reference< data::TreeSegment > aNewTree = data::TreeSegment::create(pSubtree,sTypeName);
-
- std::auto_ptr<Change> pAdd(new AddNode(aNewTree, _aNewNode.getName(), _aNewNode.isDefault()));
-
- m_rChangeList.addChange(pAdd);
- }
- else
- OSL_ENSURE(false, "Found newly added node in group");
-
- }
- };
-// -----------------------------------------------------------------------------
-
-class BackwardTreeDifferenceBuilder: public data::SetVisitor {
-public:
- BackwardTreeDifferenceBuilder(SubtreeChange & list, ISubtree const * node):
- m_changeList(list), m_newNode(node) {}
-
- void applyToChildren(sharable::Node * cacheNode) {
- OSL_ASSERT(cacheNode != 0);
- if (cacheNode->isGroup()) {
- OSL_ASSERT(!m_changeList.isSetNodeChange());
- visitChildren(&cacheNode->group);
- } else if (cacheNode->isSet()) {
- OSL_ASSERT(m_changeList.isSetNodeChange());
- visitElements(&cacheNode->set);
- } else {
- OSL_ASSERT(false);
- }
- }
-
-private:
- using NodeVisitor::handle;
-
- virtual bool handle(sharable::Node * node) {
- OSL_ASSERT(!node->isValue());
- INode const * newChild = m_newNode->getChild(node->getName());
- ISubtree const * newTree = newChild == 0 ? 0 : newChild->asISubtree();
- if (newTree != 0) {
- // Traverse down to next change:
- Change * change = m_changeList.getChange(node->getName());
- std::auto_ptr< Change > newChange;
- SubtreeChange * groupChange = 0;
- if (change == 0) {
- groupChange = new SubtreeChange(*newTree);
- newChange.reset(groupChange);
- } else {
- groupChange = dynamic_cast< SubtreeChange * >(change);
- OSL_ASSERT(groupChange != 0);
- }
- if (groupChange != 0) {
- BackwardTreeDifferenceBuilder(*groupChange, newTree).
- applyToChildren(node);
- if (newChange.get() != 0) {
- // Now count if there are any real changes:
- OChangeActionCounter counter;
- counter.applyToChange(*newChange);
- if (counter.hasChanges()) {
- m_changeList.addChange(newChange);
- }
- }
- }
- }
- return false;
- }
-
- virtual bool handle(sharable::ValueNode *) {
- return false;
- }
-
- virtual bool handle(sharable::TreeFragment * tree) {
- INode const * newElement = m_newNode->getChild(tree->getName());
- if (newElement == 0) {
- // Remove node:
- std::auto_ptr< Change > remove(
- new RemoveNode(tree->getName(), tree->isNew()));
- m_changeList.addChange(remove);
- return false;
- } else {
- // Handle the root node:
- return SetVisitor::handle(tree);
- }
- }
-
- SubtreeChange & m_changeList;
- ISubtree const * m_newNode;
-};
-
-//--------------------------------------------------------------------------
-
-// apply a set of changes to the target tree, return true, if there are changes found
- bool createUpdateFromDifference(SubtreeChange& _rResultingUpdateTree, sharable::Node * existingData, ISubtree const & _aNewData)
- {
- OSL_ENSURE(existingData != 0, "Trying to create diffrence for empty data");
- // create the differences
- ForwardTreeDifferenceBuilder aForwardTreeDifference(_rResultingUpdateTree, existingData);
- aForwardTreeDifference.applyToChildren(_aNewData);
-
- BackwardTreeDifferenceBuilder aBackwardTreeDifference(_rResultingUpdateTree, & _aNewData);
- aBackwardTreeDifference.applyToChildren(existingData);
-
- return true;
- }
-//--------------------------------------------------------------------------
-
-//..........................................................................
-} // namespace configmgr
-//..........................................................................
-
-
diff --git a/configmgr/source/treecache/cacheaccess.cxx b/configmgr/source/treecache/cacheaccess.cxx
deleted file mode 100644
index c1014903d9..0000000000
--- a/configmgr/source/treecache/cacheaccess.cxx
+++ /dev/null
@@ -1,352 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "cacheaccess.hxx"
-#include "tracer.hxx"
-#include "configpath.hxx"
-
-namespace configmgr
-{
-// -------------------------------------------------------------------------
-
-CacheClientAccess::CacheClientAccess(ConfigChangeBroadcastHelper * _pBroadcastHelper)
-: m_pBroadcastHelper( _pBroadcastHelper )
-{
-}
-// -------------------------------------------------------------------------
-
-CacheClientAccess::~CacheClientAccess()
-{
- OSL_ENSURE(!m_pBroadcastHelper, "Forgot to dispose broadcast helper");
-}
-// -------------------------------------------------------------------------
-
-ConfigChangeBroadcastHelper * CacheClientAccess::releaseBroadcaster()
-{
- ConfigChangeBroadcastHelper * pRet = m_pBroadcastHelper;
- m_pBroadcastHelper = NULL;
- return pRet;
-}
-
-// -------------------------------------------------------------------------
-
-bool CacheClientAccess::hasModule(const configuration::AbsolutePath& _aLocation)
-{
- return this->m_aData.hasModule(_aLocation.getModuleName());
-}
-// -------------------------------------------------------------------------
-
-bool CacheClientAccess::hasModuleDefaults(configuration::AbsolutePath const& _aLocation)
-{
- return this->m_aData.hasModuleDefaults(_aLocation.getModuleName());
-}
-// -------------------------------------------------------------------------
-void CacheClientAccess::attachModule(sharable::TreeFragment * _aLocation, rtl::OUString const & _aModule)
-{
- this->m_aData.attachModule(_aLocation, _aModule);
-}
-// -------------------------------------------------------------------------
-
-sharable::Node * CacheClientAccess::acquireNode(configuration::AbsolutePath const& rLocation )
-{
- CFG_TRACE_INFO("CacheClientAccess: Requesting data for path '%s'", OUSTRING2ASCII(rLocation.toString()) );
-
- sharable::Node * aResult = this->m_aData.acquireNode(rLocation);
-
- if (aResult != NULL)
- {
- CFG_TRACE_INFO_NI("- Data is available - returning Subtree");
- }
- else
- CFG_TRACE_INFO_NI("- Data is not available - returning NULL");
-
- return aResult;
-}
-// -------------------------------------------------------------------------
-
-oslInterlockedCount CacheClientAccess::releaseNode( configuration::AbsolutePath const& rLocation )
-{
- CFG_TRACE_INFO("Tree Info: Releasing subtree data for path '%s'", OUSTRING2ASCII(rLocation.toString()) );
-
- oslInterlockedCount nRet = this->m_aData.releaseModule(rLocation.getModuleName(),false);
-
- return nRet;
-}
-// -----------------------------------------------------------------------------
-
-void CacheClientAccess::applyUpdate(backend::UpdateInstance & _aUpdate) SAL_THROW((com::sun::star::uno::RuntimeException))
-{
- CFG_TRACE_INFO("CacheClientAccess: Merging changes into subtree '%s'", OUSTRING2ASCII(_aUpdate.root().toString()) );
-
- this->m_aData.applyUpdate(_aUpdate );
-}
-
-// -----------------------------------------------------------------------------
-sharable::Node * CacheClientAccess::findInnerNode( configuration::AbsolutePath const& aComponentName )
-{
- sharable::Node * node = m_aData.getNode(aComponentName);
- return node == 0 || node->isValue() ? 0 : node;
-}
-
-// -------------------------------------------------------------------------
-
-bool CacheClientAccess::insertDefaults( backend::NodeInstance const & _aDefaultData ) SAL_THROW((com::sun::star::uno::RuntimeException))
-{
- CFG_TRACE_INFO("Tree Info: Adding default data for path '%s'", OUSTRING2ASCII(_aDefaultData.root().toString()) );
-
- return this->m_aData.insertDefaults(_aDefaultData);
-}
-// -------------------------------------------------------------------------
-
-// -------------------------------------------------------------------------
-// -------------------------------------------------------------------------
-
-CacheLoadingAccess::CacheLoadingAccess()
-: m_aDeadModules()
-{
-}
-// -------------------------------------------------------------------------
-
-CacheLoadingAccess::~CacheLoadingAccess()
-{
-}
-
-// -------------------------------------------------------------------------
-
-/// gets a tree reference for the given path if exists
-sharable::TreeFragment * CacheLoadingAccess::getTreeAddress(rtl::OUString const & _aModule)
-{
- return this->m_aData.getTreeAddress(_aModule);
-}
-// -------------------------------------------------------------------------
-void CacheLoadingAccess::createModule(rtl::OUString const & _aModule)
-{
- this->m_aData.createModule(_aModule);
-}
-// -------------------------------------------------------------------------
-bool CacheLoadingAccess::hasModule(rtl::OUString const & _aModule)
-{
- return this->m_aData.hasModule(_aModule);
-}
-// -------------------------------------------------------------------------
-
-bool CacheLoadingAccess::acquireModule(rtl::OUString const & _aModule)
-{
- CFG_TRACE_INFO("Tree Info: Requesting data for module '%s'", OUSTRING2ASCII(_aModule));
-
- if (this->m_aData.acquireModule(_aModule))
- {
- m_aDeadModules.erase( _aModule );
- CFG_TRACE_INFO_NI("- Data is available - returning Subtree");
- return true;
- }
- else
- {
- CFG_TRACE_INFO_NI("- Data is not available - returning NULL");
- return false;
- }
-}
-// -------------------------------------------------------------------------
-
-oslInterlockedCount CacheLoadingAccess::releaseModule( rtl::OUString const & _aModule )
-{
- CFG_TRACE_INFO("Tree Info: Releasing data for module '%s'", OUSTRING2ASCII(_aModule) );
-
- oslInterlockedCount nRet = this->m_aData.releaseModule(_aModule,true); // keep
- if (nRet == 0)
- {
- m_aDeadModules[ _aModule ] = TimeStamp::getCurrentTime();
- CFG_TRACE_INFO_NI("- Last reference released - marking data for cleanup");
- }
-
- return nRet;
-}
-// -----------------------------------------------------------------------------
-
-bool CacheLoadingAccess::isEmpty()
-{
- ExtendedCacheData::ModuleList& rModules = this->m_aData.accessModuleList();
-
- bool bRet = rModules.empty();
-
- if (bRet) // while we are at it - clean up
- m_aDeadModules.clear();
-
- return bRet;
-}
-// -------------------------------------------------------------------------
-
-sharable::TreeFragment * CacheLoadingAccess::addComponentData( backend::ComponentInstance const & _aComponentInstance,
- bool _bIncludesDefaults
- ) SAL_THROW((com::sun::star::uno::RuntimeException))
-{
- CFG_TRACE_INFO("CacheLoadingAccess: Adding component data for module '%s' : %s",
- OUSTRING2ASCII(_aComponentInstance.component()),
- _bIncludesDefaults ? "Data includes defaults." : "Data does not include defaults." );
-
- sharable::TreeFragment * aResult = this->m_aData.addComponentData(_aComponentInstance, _bIncludesDefaults);
- if (aResult != NULL)
- {
- m_aDeadModules.erase( _aComponentInstance.component() );
- CFG_TRACE_INFO_NI("- Data added successfully - returning Subtree");
- }
- else
- CFG_TRACE_INFO_NI("- Data not added - returning NULL");
-
- return aResult;
-}
-// -------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-void CacheLoadingAccess::addChangesToPending( backend::ConstUpdateInstance const& _anUpdate ) SAL_THROW((com::sun::star::uno::RuntimeException))
-{
- // NICE: m_pPending[_rLocation] += pSubtreeChange;
- CFG_TRACE_INFO("CacheLoadingAccess: Adding pending changes for subtree '%s'", OUSTRING2ASCII(_anUpdate.root().toString()) );
-
- this->m_aData.addPending(_anUpdate);
-}
-
-// -----------------------------------------------------------------------------
-std::auto_ptr<SubtreeChange> CacheLoadingAccess::releasePendingChanges(rtl::OUString const& _aComponentName)
-{
- CFG_TRACE_INFO("Tree Info: extract pending changes from subtree '%s'", OUSTRING2ASCII(_aComponentName) );
- return this->m_aData.releasePending(_aComponentName);
-}
-
-// -----------------------------------------------------------------------------
-bool CacheLoadingAccess::findPendingChangedModules( std::vector< rtl::OUString > & _rPendingList )
-{
- this->m_aData.findPendingModules(_rPendingList);
- return !_rPendingList.empty();
-}
-
-// -------------------------------------------------------------------------
-
-TimeStamp CacheLoadingAccess::collectDisposeList(std::vector< rtl::Reference<CacheLine> > & _rList, TimeStamp const & _aLimitTime, TimeInterval const & _aDelay)
-{
- TimeStamp aRetTime = TimeStamp::never();
-
- CFG_TRACE_INFO("Tree Info: Collecting disposable module trees for cleanup" );
-
- ExtendedCacheData::ModuleList& rActiveModules = this->m_aData.accessModuleList();
-
- std::map< rtl::OUString, TimeStamp >::iterator it = m_aDeadModules.begin();
-
- while (it != m_aDeadModules.end())
- {
- std::map< rtl::OUString, TimeStamp >::iterator current = it;
- // increment here, as we may later erase(current)
- ++it;
-
-#if (OSL_DEBUG_LEVEL > 0) || defined _DBG_UTIL || defined CFG_TRACE_ENABLE
- rtl::OUString sCurrentName( current->first );
-#endif
- TimeStamp aExpireTime = current->second + _aDelay;
- if (aExpireTime <= _aLimitTime)
- {
- ExtendedCacheData::ModuleList::iterator itModule = rActiveModules.find( current->first );
-
- if (itModule != rActiveModules.end())
- {
- rtl::Reference<CacheLine> xModule = itModule->second;
-
- bool bHandled = false;
-
- if (!xModule.is())
- {
- CFG_TRACE_ERROR_NI("- Unexpected: Module '%s' is NULL in active module list", OUSTRING2ASCII(sCurrentName) );
- bHandled = true;
- }
- else if (xModule->clientReferences() != 0)// at least in temporary use
- {
- OSL_ENSURE( false, "Referenced entry in dead module list");
-
- CFG_TRACE_WARNING_NI("- Module '%s' in (temporary ?) use - rescheduling", OUSTRING2ASCII(sCurrentName) );
- bHandled = false; // still remove from the lists
- }
- else if (m_aData.hasPending(current->first))
- {
- CFG_TRACE_WARNING_NI("- Module '%s' has pending changes - rescheduling disposal", OUSTRING2ASCII(sCurrentName) );
- bHandled = false;
- }
- else // now this really can be disposed
- {
- CFG_TRACE_INFO_NI("- Removing module '%s' for disposal", OUSTRING2ASCII(sCurrentName) );
-
- // It really is ok to dispose this entry
- _rList.push_back(xModule);
-
- bHandled = true;
- }
-
-
- if (bHandled)
- {
- // really remove
- rActiveModules.erase(itModule);
- m_aDeadModules.erase(current);
- }
- else
- {
- // reschedule
- TimeStamp aRetryTime = _aLimitTime + _aDelay;
- OSL_ASSERT(aRetryTime > _aLimitTime);
-
- current->second = _aLimitTime; // ?
- if (aRetryTime < aRetTime)
- aRetTime = aRetryTime;
- }
- }
- else
- {
- // obsolete dispose list entry - discard
- OSL_ENSURE( false, "Obsolete entry in dead module list");
-
- CFG_TRACE_WARNING_NI("- Module '%s' not found any more - obsolete entry in dead module list", OUSTRING2ASCII(sCurrentName) );
-
- m_aDeadModules.erase(current);
- }
- }
- else // consider for restart time
- {
- CFG_TRACE_INFO_NI("- Module '%s' has not expired yet - rescheduling", OUSTRING2ASCII(sCurrentName) );
-
- if (aExpireTime < aRetTime)
- aRetTime = aExpireTime;
- }
- }
-
- OSL_ASSERT(aRetTime > _aLimitTime);
- return aRetTime;
-}
-// -------------------------------------------------------------------------
-
-} // namespace configmgr
-
-
diff --git a/configmgr/source/treecache/cacheaccess.hxx b/configmgr/source/treecache/cacheaccess.hxx
deleted file mode 100644
index f63b47176c..0000000000
--- a/configmgr/source/treecache/cacheaccess.hxx
+++ /dev/null
@@ -1,157 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CACHEACCESS_HXX
-#define CONFIGMGR_CACHEACCESS_HXX
-
-#include "cachedata.hxx"
-#include "timestamp.hxx"
-#include "utility.hxx"
-#include <boost/utility.hpp>
-#include <osl/mutex.hxx>
-#ifndef _CONFIGMGR_UTILITY_HXX_
-#include <utility.hxx>
-#endif
-#include <rtl/ref.hxx>
-#include <salhelper/simplereferenceobject.hxx>
-
-namespace configmgr
-{
-////////////////////////////////////////////////////////////////////////////////
- class ConfigChangeBroadcastHelper;
- namespace backend
- {
- class CacheController;
- }
-//-----------------------------------------------------------------------------
-
- class CacheClientAccess: private boost::noncopyable, public salhelper::SimpleReferenceObject
- {
- private:
- CacheData m_aData;
-
- ConfigChangeBroadcastHelper* m_pBroadcastHelper;
- public:
- explicit
- CacheClientAccess(ConfigChangeBroadcastHelper* _pBroadcastHelper);
-
- ~CacheClientAccess();
-
- /// gets a helper to broadcast changes for
- ConfigChangeBroadcastHelper * getBroadcaster() const
- { return m_pBroadcastHelper; }
-
- /// removes an existing broadcast helper
- ConfigChangeBroadcastHelper * releaseBroadcaster();
-
- // attach a module with a given name
- void attachModule(sharable::TreeFragment * _aLocation, rtl::OUString const & _aModule);
- /// check if the given module exists already (and is not empty)
- bool hasModule(const configuration::AbsolutePath& _aLocation);
- /// checks if the given module exists and has defaults available
- bool hasModuleDefaults(configuration::AbsolutePath const & _aLocation);
-
- /// retrieve the subtree at _aPath (maybe if it has the requested defaults) and clientAcquire() it
- sharable::Node * acquireNode(configuration::AbsolutePath const& _aPath);
-
- /** add or merge the given subtree at the given location,
- return <TRUE/> if the tree has defaults then
- */
- bool insertDefaults( backend::NodeInstance const & _aDefaultData ) SAL_THROW((com::sun::star::uno::RuntimeException));
-
- /// clientRelease() the tree at aComponentName, and return the resulting reference count
- oslInterlockedCount releaseNode( configuration::AbsolutePath const& _aPath );
-
- /// retrieve the given subtree without changing its ref count
- sharable::Node * findInnerNode(configuration::AbsolutePath const& _aPath );
-
- /// merge the given change list into this tree - reflects old data to _aUpdate
- void applyUpdate(backend::UpdateInstance & _aUpdate) SAL_THROW((com::sun::star::uno::RuntimeException));
- };
-
-
-////////////////////////////////////////////////////////////////////////////////
-
- class CacheLoadingAccess: private boost::noncopyable, public salhelper::SimpleReferenceObject
- {
- public:
- friend class backend::CacheController;
- private:
- friend class CacheDisposeScheduler;
-
- ExtendedCacheData m_aData;
- std::map< rtl::OUString, TimeStamp > m_aDeadModules; /// list of nodes which are registered for throwing away
- public:
- explicit
- CacheLoadingAccess();
- ~CacheLoadingAccess();
-
- /// gets a tree address for the given module if it exists
- sharable::TreeFragment * getTreeAddress(rtl::OUString const & _aModule);
-
- /// return TRUE if there is no data (left) in this object's cache data
- bool isEmpty();
-
- // create a module with a given name
- void createModule(rtl::OUString const & _aModule);
- /// check if the given module exists already (and is not empty)
- bool hasModule(rtl::OUString const & _aLocation);
- /// retrieve the subtree at aComponentName and clientAcquire() it, true if succeeded
- bool acquireModule(rtl::OUString const & _aModule);
-
- /// clientRelease() the tree at aComponentName, and return the resulting reference count
- oslInterlockedCount releaseModule( rtl::OUString const & _aModule );
-
- /// collect the modules that can be disposed now (i.e. released after _rLimitReleaseTime)
- TimeStamp collectDisposeList(std::vector< rtl::Reference<CacheLine> > & _rList,
- TimeStamp const & _aLimitTime,
- TimeInterval const & _aDelay);
-
- // stuff that is particular for CacheLoadingAccess
- /** add the given subtree at the given location,
- return the tree that is then pertinent and clientAcquire() it once
- */
- sharable::TreeFragment * addComponentData( backend::ComponentInstance const & _aComponentInstance,
- bool _bIncludesDefaults
- ) SAL_THROW((com::sun::star::uno::RuntimeException));
-
- /// merge the given change list into the pending change list of this tree
- void addChangesToPending( backend::ConstUpdateInstance const& _anUpdate ) SAL_THROW((com::sun::star::uno::RuntimeException));
- /// retrieve accumulated pending changes
- std::auto_ptr<SubtreeChange> releasePendingChanges(rtl::OUString const& _aModule);
-
- /// find the modules having pending changes
- bool findPendingChangedModules( std::vector< rtl::OUString > & _rPendingList );
- };
-
-
-////////////////////////////////////////////////////////////////////////////////
-
-} // namespace configmgr
-
-#endif
-
diff --git a/configmgr/source/treecache/cachecontroller.cxx b/configmgr/source/treecache/cachecontroller.cxx
deleted file mode 100644
index f09be796b1..0000000000
--- a/configmgr/source/treecache/cachecontroller.cxx
+++ /dev/null
@@ -1,716 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "cachecontroller.hxx"
-#include "disposetimer.hxx"
-#include "cachewritescheduler.hxx"
-#include "builddata.hxx"
-#include "localizedtreeactions.hxx"
-#include "configexcept.hxx"
-#include "tracer.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/container/NoSuchElementException.hpp>
-#include <osl/diagnose.h>
-#include <rtl/logfile.hxx>
-
-#ifndef _CONFIGMGR_BOOTSTRAP_HXX
-#include "bootstrap.hxx"
-#endif
-
-
-#define RTL_LOGFILE_OU2A(rtlOUString) (::rtl::OUStringToOString((rtlOUString), RTL_TEXTENCODING_ASCII_US).getStr())
-
-namespace configmgr
-{
-// -------------------------------------------------------------------------
- namespace backend
- {
-
-static const rtl::OUString kCacheDisposeDelay(
- RTL_CONSTASCII_USTRINGPARAM( CONTEXT_ITEM_PREFIX_ "CacheDisposeDelay"));
-static const rtl::OUString kCacheDisposeInterval(
- RTL_CONSTASCII_USTRINGPARAM( CONTEXT_ITEM_PREFIX_ "CacheDisposeInterval"));
-static const rtl::OUString kCacheWriteInterval(
- RTL_CONSTASCII_USTRINGPARAM( CONTEXT_ITEM_PREFIX_ "CacheWriteInterval"));
-// -------------------------------------------------------------------------
-
-OTreeDisposeScheduler* CacheController::createDisposer(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _xContext)
-{
- ContextReader aReader(_xContext);
- sal_uInt32 c_nDefaultDelay = 0;
- rtl::OUString sDefaultDelay;
- aReader.getBestContext()->getValueByName(kCacheDisposeDelay) >>= sDefaultDelay;
- c_nDefaultDelay = sDefaultDelay.toInt32()==0?900:sDefaultDelay.toInt32() ;
-
- sal_uInt32 c_nDefaultInterval = 0;
- rtl::OUString sDefaultInterval;
- aReader.getBestContext()->getValueByName(kCacheDisposeInterval) >>= sDefaultInterval;
- c_nDefaultInterval = sDefaultInterval.toInt32()==0?60:sDefaultInterval.toInt32();
-
- TimeInterval aDelay(c_nDefaultDelay);
- TimeInterval aInterval(c_nDefaultInterval);
-
- return new OTreeDisposeScheduler(*this, aDelay, aInterval);
-}
-
-// -----------------------------------------------------------------------------
-
-OCacheWriteScheduler* CacheController::createCacheWriter(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _xContext)
-{
- ContextReader aReader(_xContext);
- sal_uInt32 c_nDefaultInterval=0;
- rtl::OUString sDefaultInterval;
- aReader.getBestContext()->getValueByName(kCacheWriteInterval) >>= sDefaultInterval;
- c_nDefaultInterval = sDefaultInterval.toInt32()==0?2:sDefaultInterval.toInt32();
-
- TimeInterval aInterval(c_nDefaultInterval);
- return new OCacheWriteScheduler(*this, aInterval);
-}
-// ----------------------------------------------------------------------------
-
-rtl::Reference<CacheLoadingAccess> CacheController::getCacheAlways(RequestOptions const & _aOptions)
-{
- rtl::Reference<CacheLoadingAccess> aResult = m_aCacheMap.get(_aOptions);
- if (!aResult.is())
- {
- rtl::Reference<CacheLoadingAccess> aNewCache( new CacheLoadingAccess() );
- aResult = m_aCacheMap.insert(_aOptions,aNewCache);
- }
- return aResult;
-}
-
-// -------------------------------------------------------------------------
-
-// disposing
-// -------------------------------------------------------------------------
-void CacheController::disposeAll(bool _bFlushRemainingUpdates)
-{
- CFG_TRACE_INFO("CacheController: Disposing all data" );
- CacheMap::Map aReleaseList;
-
- if (m_pDisposer)
- {
- m_pDisposer->stopAndClearTasks();
- m_aCacheMap.swap(aReleaseList); // move data out of m_aCacheMap and empty m_aCacheMap
- }
-
- if (_bFlushRemainingUpdates)
- {
- for (CacheMap::Map::iterator it = aReleaseList.begin(); it != aReleaseList.end(); ++it)
- saveAllPendingChanges(it->second,it->first);
- }
- // free all the trees
- aReleaseList.clear();
-}
-
-// -------------------------------------------------------------------------
-void CacheController::dispose() SAL_THROW((com::sun::star::uno::RuntimeException))
-{
- UnoApiLock aLock;
-
- CFG_TRACE_INFO("CacheController: dispose()" );
-
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::backend::CacheController", "jb99855", "configmgr: CacheController::dispose(), disable lazy write cache.");
- m_bDisposing = true; // we are in dispose, handling of errors must be something different.
-
- // writing of pending updates
- this->flushCacheWriter();
-
- // cleaning the cache
- this->disposeAll(true);
-}
-
-// -------------------------------------------------------------------------
-CacheController::CacheController(rtl::Reference< backend::IMergedDataProvider > const & _xBackend,
- const uno::Reference<uno::XComponentContext>& xContext)
-: m_aNotifier()
-, m_xBackend(_xBackend)
-, m_aCacheMap()
-, m_aTemplates()
-, m_pDisposer()
-, m_pCacheWriter()
-, m_bDisposing(false)
-{
- m_pDisposer = this->createDisposer(xContext);
- m_pCacheWriter = this->createCacheWriter(xContext);
-}
-
-// -------------------------------------------------------------------------
-CacheController::~CacheController()
-{
- OSL_ENSURE(m_bDisposing == true, "CacheController::dispose() wasn't called, something went wrong.");
-
- delete m_pDisposer;
- delete m_pCacheWriter;
-}
-
-// -------------------------------------------------------------------------
-void CacheController::closeModules(std::vector< rtl::Reference<CacheLine> > & _aList, RequestOptions const & _aOptions)
-{
- //Remove listeners from Backend as module no longer in cache
- for (sal_uInt32 i =0; i < _aList.size(); ++i)
- {
- rtl::OUString aModuleName = _aList[i]->getModuleName();
- ComponentRequest aRequest(aModuleName, _aOptions);
- m_xBackend->removeRequestListener(this, aRequest);
- }
-}
-// -------------------------------------------------------------------------
-#if 0
-static
-std::auto_ptr<ISubtree> reduceSubtreeForLocale(std::auto_ptr<ISubtree> _pSubtree, RequestOptions const & _aOptions)
-{
- OSL_ENSURE(!_pSubtree.get() || !isLocalizedValueSet(*_pSubtree), "Unexpected node. Expecting a subtree, Found a single localized value.");
-
- std::auto_ptr<ISubtree> aRet;
-
- std::auto_ptr<INode> aReduced = reduceExpandedForLocale(_pSubtree, _aOptions.getLocale());
-
- if (aReduced.get())
- {
- if (ISubtree* pReduced =aReduced->asISubtree())
- {
- aRet.reset(pReduced);
- aReduced.release();
- }
- else
- {
- OSL_ENSURE(false, "Tree unexpectedly reduced to non-tree");
- }
- }
- else
- OSL_ENSURE(!_pSubtree.get(), "Tree unexpectedly reduced to nothing");
-
- return aRet;
-}
-#endif
-
-// -------------------------------------------------------------------------
-sharable::TreeFragment * CacheController::loadComponent(ComponentRequest const & _aRequest)
-{
- CFG_TRACE_INFO("CacheController: loading component '%s'", OUSTRING2ASCII(_aRequest.getComponentName()));
-
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::backend::CacheController", "jb99855", "configmgr: CacheController::loadComponent()");
- RTL_LOGFILE_CONTEXT_TRACE1(aLog, "component: %s", RTL_LOGFILE_OU2A(_aRequest.getComponentName().toString()) );
-
- rtl::Reference<CacheLoadingAccess> aCache = this->getCacheAlways(_aRequest.getOptions());
-
- OSL_ENSURE(aCache.is(), "Could not create CacheAccess");
-
- sharable::TreeFragment * aTemplateResultAdddress;
-
- OSL_ENSURE(!_aRequest.isForcingReload(),"CacheController: No support for forced requests");
- if (aCache->hasModule(_aRequest.getComponentName()))
- {
- CFG_TRACE_INFO_NI("CacheController: found node in cache");
- if (_aRequest.getOptions().isRefreshEnabled())
- {
- refreshComponent(_aRequest);
- }
- aCache->acquireModule(_aRequest.getComponentName());
- }
- else
- {
- ResultHolder< ComponentInstance > aData = this->loadDirectly(_aRequest,true);
-
- CFG_TRACE_INFO_NI("CacheController: adding loaded data to the cache");
-
- aCache->createModule(_aRequest.getComponentName());
-
- aCache->addComponentData(aData.instance(), true);
- if (aData.instance().templateData().get()!=NULL)
- aTemplateResultAdddress = addTemplates(aData.mutableInstance().componentTemplateData() );
-
- // notify the new data to all clients
- m_aNotifier.notifyCreated(_aRequest);
- }
-
- return aCache->getTreeAddress(_aRequest.getComponentName());
-}
-// -------------------------------------------------------------------------
-
-ResultHolder< ComponentInstance > CacheController::getComponentData(ComponentRequest const & _aRequest,
- bool _bAddListenter ) SAL_THROW((com::sun::star::uno::Exception))
-{
- // TODO: Insert check here, if the data is in the cache already - and then clone
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::backend::CacheController", "jb99855", "configmgr: CacheController::getComponentData()");
- RTL_LOGFILE_CONTEXT_TRACE1(aLog, "component: %s", RTL_LOGFILE_OU2A(_aRequest.getComponentName().toString()) );
-
- ResultHolder< ComponentInstance > aRet = this->loadDirectly(_aRequest, _bAddListenter);
-
- return aRet;
-}
-// -------------------------------------------------------------------------
-
-ResultHolder< NodeInstance > CacheController::getDefaultData(NodeRequest const & _aRequest) SAL_THROW((com::sun::star::uno::Exception))
-{
- // TODO: Insert check here, if the data is in the cache already - and then clone
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::backend::CacheController", "jb99855", "configmgr: CacheController::getDefaultData()");
- RTL_LOGFILE_CONTEXT_TRACE1(aLog, "path: %s", RTL_LOGFILE_OU2A(_aRequest.getPath().toString()) );
-
- ResultHolder< NodeInstance > aRet = this->loadDefaultsDirectly(_aRequest);
-
- return aRet;
-}
-// -------------------------------------------------------------------------
-
-configuration::AbsolutePath CacheController::encodeTemplateLocation(const rtl::OUString& _rName, const rtl::OUString &_rModule) const
-{
- namespace Path = configuration::Path;
-
-// static const
-// Component aTemplateRoot = wrapSimpleName(rtl::OUString::createFromAscii("org.openoffice.Templates"));
-
- Path::Component aTemplateModule = Path::wrapSimpleName(_rModule);
- Path::Component aTemplateName = Path::wrapSimpleName(_rName);
-
- Path::Rep aResult(aTemplateName);
- aResult.prepend(aTemplateModule);
-// aResult.prepend(aTemplateRoot);
-
- return configuration::AbsolutePath(aResult);
-}
-// -------------------------------------------------------------------------
-#if 0
-static
-configuration::AbsolutePath templateLoadLocation(const configuration::AbsolutePath &_rTemplateLocation)
-{
- namespace Path = configuration::Path;
-
- static const
- Path::Component aTemplateRoot = Path::wrapSimpleName(rtl::OUString::createFromAscii("org.openoffice.Templates"));
-
- Path::Rep aResult(_rTemplateLocation.rep());
- aResult.prepend(aTemplateRoot);
-
- return configuration::AbsolutePath(aResult);
-}
-#endif
-// -------------------------------------------------------------------------
-std::auto_ptr<ISubtree> CacheController::loadTemplateData(TemplateRequest const & _aTemplateRequest) SAL_THROW((com::sun::star::uno::Exception))
-{
- std::auto_ptr<ISubtree> aMultiTemplates;
- ResultHolder< TemplateInstance > aTemplateInstance = m_xBackend->getTemplateData(_aTemplateRequest);
- if (aTemplateInstance.is())
- {
- OSL_ASSERT(aTemplateInstance->name().getLength() == 0);
- if (ISubtree * pMulti = aTemplateInstance->data()->asISubtree())
- {
- aTemplateInstance.releaseAndClear();
- aMultiTemplates.reset(pMulti);
- }
- else
- OSL_ENSURE(false,"Requested multiple templates, got non-subtree node");
- }
- else
- OSL_ENSURE(false,"Requested configuration template does not exist");
-
- if (aMultiTemplates.get() == NULL)
- {
- CFG_TRACE_ERROR_NI("CacheController: could not load the templates");
- throw uno::Exception(::rtl::OUString::createFromAscii("The template description could not be loaded. The template does not exist."), NULL);
- }
-
- return aMultiTemplates;
-}
-// -------------------------------------------------------------------------
-sharable::TreeFragment * CacheController::addTemplates ( backend::ComponentDataStruct const & _aComponentInstance )
-{
- OSL_PRECOND(_aComponentInstance.data.get(), "addTemplates: Data must not be NULL");
- rtl::OUString aModuleName = _aComponentInstance.name;
- m_aTemplates.createModule(aModuleName);
- configuration::AbsolutePath aTemplateLocation = configuration::AbsolutePath::makeModulePath(_aComponentInstance.name);
- sharable::TreeFragment * aTemplateAddr = NULL;
-
- if (!m_aTemplates.hasNode(aTemplateLocation ))
- {
- CFG_TRACE_INFO_NI("CacheController: cache miss for that template - loading from backend");
- aTemplateAddr = m_aTemplates.addTemplates(_aComponentInstance );
- }
- OSL_ASSERT (aTemplateAddr != NULL);
- return aTemplateAddr;
- }
-// -------------------------------------------------------------------------
-
-sharable::TreeFragment * CacheController::loadTemplate(TemplateRequest const & _aRequest) SAL_THROW((com::sun::star::uno::Exception))
-{
-
- OSL_ENSURE(_aRequest.getTemplateName().getLength() != 0, "CacheController::loadTemplate : invalid template name !");
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::backend::CacheController", "jb99855", "configmgr: CacheController::loadTemplate()");
- RTL_LOGFILE_CONTEXT_TRACE2(aLog, "requested template: %s/%s",
- RTL_LOGFILE_OU2A(_aRequest.getComponentName().toString()) ,
- _aRequest.isComponentRequest() ?
- "*" : RTL_LOGFILE_OU2A(_aRequest.getComponentName().toString()) );
-
-
- configuration::AbsolutePath aTemplateLocation = encodeTemplateLocation(_aRequest.getTemplateName(), _aRequest.getComponentName());
-
- rtl::OUString aModuleName = aTemplateLocation.getModuleName();
-
- configuration::AbsolutePath aTemplateParent (aTemplateLocation.getParentPath());
-
- //Load-if-not-there (componentwise)
- if (!m_aTemplates.hasNode(aTemplateParent))
- {
- OSL_ENSURE(aTemplateLocation.getDepth() > 1, "CacheController::ensureTemplate : invalid template location !");
- TemplateRequest aTemplateRequest = TemplateRequest::forComponent(_aRequest.getComponentName());
-
- std::auto_ptr<ISubtree> aMultiTemplates = loadTemplateData(aTemplateRequest);
- //add-if-not-loaded
- addTemplates(backend::ComponentDataStruct(aMultiTemplates, aModuleName));
-
- }
- sharable::TreeFragment * aTemplateAddr = m_aTemplates.getTemplateTree(aTemplateLocation);
- if (aTemplateAddr == NULL)
- throw uno::Exception(::rtl::OUString::createFromAscii("Unknown template. Type description could not be found in the given module."), NULL);
-
- return m_aTemplates.getTreeAddress(aTemplateLocation.getModuleName());
-}
-// -----------------------------------------------------------------------------
-
-ResultHolder< TemplateInstance > CacheController::getTemplateData(TemplateRequest const & _aRequest)
- SAL_THROW((com::sun::star::uno::Exception))
-{
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::backend::CacheController", "jb99855", "configmgr: CacheController::getTemplateData()");
- RTL_LOGFILE_CONTEXT_TRACE2(aLog, "requested template: %s/%s",
- RTL_LOGFILE_OU2A(_aRequest.getComponentName().toString()) ,
- _aRequest.isComponentRequest() ?
- "*" : RTL_LOGFILE_OU2A(_aRequest.getComponentName().toString()) );
-
- configuration::AbsolutePath aTemplateLocation = encodeTemplateLocation(_aRequest.getTemplateName(), _aRequest.getComponentName());
-
- loadTemplate(_aRequest);
- //configuration::AbsolutePath aTemplateLocation = ensureTemplate(_aRequest.getTemplateName(), _aRequest.getComponentName());
-
- sharable::TreeFragment * aTemplateAddr = m_aTemplates.getTemplateTree(aTemplateLocation);
- if (aTemplateAddr == NULL)
- throw uno::Exception(::rtl::OUString::createFromAscii("Unknown template. Type description could not be found in the given module."), NULL);
-
- std::auto_ptr<INode> aResultTree = data::convertTree(aTemplateAddr, true);
-
- TemplateInstance aResult(aResultTree,_aRequest.getTemplateName(), _aRequest.getComponentName());
-
- return ResultHolder< TemplateInstance >(aResult);
-}
-// -----------------------------------------------------------------------------
-
-void CacheController::saveAndNotify(UpdateRequest const & _anUpdate) SAL_THROW((com::sun::star::uno::Exception))
-{
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::backend::CacheController", "jb99855", "configmgr: CacheController::saveAndNotify()");
- RTL_LOGFILE_CONTEXT_TRACE1(aLog, "location: %s", RTL_LOGFILE_OU2A(_anUpdate.getUpdateRoot().toString()) );
- try
- {
- // ---------- preworking on the changes ----------
- // caller must own a read lock on this cache line
- CFG_TRACE_INFO("CacheController: saving an update for '%s'",OUSTRING2ASCII(_anUpdate.getUpdateRoot().toString()));
-
- rtl::Reference<CacheLoadingAccess> aCache = m_aCacheMap.get(_anUpdate.getOptions());
-
- OSL_ENSURE(aCache.is(), "No cache data to update in saveAndNotify");
-
- if (!aCache.is()) throw lang::DisposedException(rtl::OUString::createFromAscii("Tree to be updated was already disposed"), NULL);
-
- aCache->addChangesToPending(_anUpdate.getUpdate());
-
- if ( _anUpdate.isSyncRequired()|| m_bDisposing ) // cannot do it asynchronously
- {
- CFG_TRACE_INFO_NI("Running synchronous write");
- savePendingChanges( aCache, getComponentRequest(_anUpdate) );
- }
-
- else
- {
- CFG_TRACE_INFO_NI("Posting asynchronous write");
- m_pCacheWriter->scheduleWrite( getComponentRequest(_anUpdate) );
- }
-
- CFG_TRACE_INFO_NI("Notifying the changes");
- // notify the changes to all clients
- m_aNotifier.notifyChanged(_anUpdate);
- }
- catch(configuration::Exception& ex)
- {
- CFG_TRACE_ERROR_NI("Got unexpected exception: %s", ex.what());
- configapi::ExceptionMapper e(ex);
- e.unhandled();
- }
-
-}
-// -----------------------------------------------------------------------------
-
-void CacheController::flushPendingUpdates()SAL_THROW((com::sun::star::uno::Exception))
-{
- CacheMap::Map aFlushList = m_aCacheMap.copy();
-
- for (CacheMap::Map::iterator it = aFlushList.begin(); it != aFlushList.end(); ++it)
- saveAllPendingChanges(it->second,it->first);
-}
-
-void CacheController::flushCacheWriter()SAL_THROW(())
-{
- //OSL_ASSERT(m_bDisposing);
-
- if (m_pCacheWriter)
- {
- CFG_TRACE_INFO("CacheController: flushing all pending updates");
-
- m_pCacheWriter->stopAndWriteCache();
- }
-}
-// -----------------------------------------------------------------------------
-
-bool CacheController::normalizeResult(std::auto_ptr<ISubtree> & _aResult, RequestOptions const & _aOptions)
-{
-
- if (_aResult.get()==NULL) return false;
-
- if (_aOptions.isForAllLocales()) return true;
-
- std::auto_ptr<INode> aReduced = reduceExpandedForLocale(_aResult, _aOptions.getLocale());
-
- std::auto_ptr<ISubtree> aReducedTree;
- if (aReduced.get())
- {
- if (ISubtree* pReducedTree =aReduced->asISubtree())
- {
- aReduced.release();
- aReducedTree.reset(pReducedTree);
- }
- else
- {
- OSL_ENSURE(false, "Tree unexpectedly reduced to non-tree");
- }
- }
- else
- OSL_ENSURE(false, "Tree unexpectedly reduced to nothing");
-
-
- _aResult = aReducedTree;
- bool retCode = _aResult.get()!=NULL ? true : false;
- return retCode;
-}
-// -----------------------------------------------------------------------------
-
-ResultHolder< ComponentInstance > CacheController::loadDirectly(ComponentRequest const & _aRequest, bool _bAddListenter) SAL_THROW((com::sun::star::uno::Exception))
-{
- CFG_TRACE_INFO("CacheController: loading data for component '%s' from the backend", OUSTRING2ASCII(_aRequest.getComponentName()));
-
- configuration::AbsolutePath aRequestPath = configuration::AbsolutePath::makeModulePath(_aRequest.getComponentName());
-
- NodeRequest aNodeRequest(aRequestPath, _aRequest.getOptions());
-
- ResultHolder< ComponentInstance > aResult = m_xBackend->getNodeData(_aRequest, this, _bAddListenter?this:NULL);
-
- OSL_PRECOND(aResult.mutableInstance().mutableData().get(), "loadDirectly: Data must not be NULL");
-
- CFG_TRACE_INFO_NI("- loading data completed - normalizing result");
-
- if (!normalizeResult( aResult.mutableInstance().mutableData(),_aRequest.getOptions()))
- {
- CFG_TRACE_ERROR_NI(" - cannot normalized result: failing");
-
- rtl::OUString sMsg(RTL_CONSTASCII_USTRINGPARAM("Requested data at '"));
- sMsg += aRequestPath.toString();
- sMsg += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("'is not available: "));
-
- throw com::sun::star::container::NoSuchElementException(sMsg,NULL);
- }
-
- CFG_TRACE_INFO_NI(" - returning normalized defaults");
-
- return aResult;
-}
-// -----------------------------------------------------------------------------
-
-ResultHolder< NodeInstance > CacheController::loadDefaultsDirectly(NodeRequest const & _aRequest) SAL_THROW((com::sun::star::uno::Exception))
-{
- CFG_TRACE_INFO("CacheController: loading defaults for '%s' from the backend", OUSTRING2ASCII(_aRequest.getPath().toString()));
-
- ResultHolder< NodeInstance > aResult = m_xBackend->getDefaultData(_aRequest);
-
- CFG_TRACE_INFO_NI("- loading defaultscompleted - normalizing result");
-
- normalizeResult(aResult.mutableInstance().mutableData(),_aRequest.getOptions());
-
- CFG_TRACE_INFO_NI(" - returning normalized defaults");
-
- return aResult;
-}
-// -----------------------------------------------------------------------------
-
-void CacheController::saveDirectly(UpdateRequest const & _anUpdate) SAL_THROW((com::sun::star::uno::Exception))
-{
- m_xBackend->updateNodeData(_anUpdate);
-}
-// -----------------------------------------------------------------------------
-
-void CacheController::savePendingChanges(rtl::Reference<CacheLoadingAccess> const & _aCache, ComponentRequest const & _aComponent) SAL_THROW((com::sun::star::uno::Exception))
-{
- CFG_TRACE_INFO("CacheController: saving updates for tree: '%s'", OUSTRING2ASCII(_aComponent.getComponentName()));
-
- try
- {
- CFG_TRACE_INFO2("CacheController: saving updates for tree: '%s'", OUSTRING2ASCII(_aComponent.getComponentName()));
-
- std::auto_ptr<SubtreeChange> aChangeData = _aCache->releasePendingChanges(_aComponent.getComponentName());
-
- if (aChangeData.get())
- {
- CFG_TRACE_INFO_NI("- found changes - sending to backend");
-
- configuration::AbsolutePath aRootPath = configuration::AbsolutePath::makeModulePath(_aComponent.getComponentName());
-
- backend::UpdateRequest anUpdateSpec(aChangeData.get(),aRootPath,_aComponent.getOptions());
-
- // anUpdateSpec.setRequestId(pInfo->getRequestId(_aRootPath));
-
- this->saveDirectly(anUpdateSpec);
-
- CFG_TRACE_INFO_NI("- saving changes completed successfully");
- }
- else
- CFG_TRACE_WARNING_NI("- no changes found - cannot save");
- }
- catch(uno::Exception& e)
- {
- (void)e;
- CFG_TRACE_ERROR_NI("CacheController: saving tree '%s' failed: %s",
- OUSTRING2ASCII(_aComponent.getComponentName()),
- OUSTRING2ASCII(e.Message) );
-
- refreshComponent(_aComponent);
- CFG_TRACE_INFO_NI("- component data invalidated");
-
- throw;
- }
-}
-// -----------------------------------------------------------------------------
-
-bool CacheController::saveAllPendingChanges(rtl::Reference<CacheLoadingAccess> const & _aCache, RequestOptions const & _aOptions)
- SAL_THROW((com::sun::star::uno::RuntimeException))
-{
- CFG_TRACE_INFO("CacheController: Saving all pending changes for cache line");
- OSL_ASSERT(_aCache.is());
-
- std::vector< rtl::OUString > aPendingModules;
- _aCache->findPendingChangedModules(aPendingModules);
-
- CFG_TRACE_INFO_NI("Found %d changed modules",int(aPendingModules.size()));
-
- bool bSuccess = true;
- for (std::vector< rtl::OUString >::iterator it = aPendingModules.begin();
- it != aPendingModules.end();
- ++it )
- {
- try
- {
- this->savePendingChanges(_aCache, ComponentRequest(*it,_aOptions) );
- }
- catch (uno::Exception & )
- {
- CFG_TRACE_ERROR_NI("CacheController: Exception while saving one module - ignoring");
- bSuccess = false;
- }
- }
- CFG_TRACE_INFO_NI("Done saving pending changes for cache line");
-
- return bSuccess;
-}
-// -----------------------------------------------------------------------------
-
-
-//-----------------------------------------------------------------------------
-void CacheController::freeComponent(ComponentRequest const & _aRequest) SAL_THROW(())
-{
- CFG_TRACE_INFO("CacheController: releasing module '%s' for user '%s' with locale '%s'",
- OUSTRING2ASCII(_aRequest.getComponentName()),
- OUSTRING2ASCII(_aRequest.getOptions().getEntity()),
- OUSTRING2ASCII(_aRequest.getOptions().getLocale()) );
-
- rtl::Reference<CacheLoadingAccess> aCache = m_aCacheMap.get(_aRequest.getOptions());
-
- OSL_ENSURE(aCache.is(), "Releasing a nonexisting module");
-
- if (aCache.is())
- {
- if (aCache->releaseModule(_aRequest.getComponentName()) == 0)
- {
- // start the cleanup
- m_pDisposer->scheduleCleanup(_aRequest.getOptions());
- }
- }
-}
-// -----------------------------------------------------------------------------
-void CacheController::dataChanged(const ComponentRequest& _aRequest) SAL_THROW(())
-{
- refreshComponent(_aRequest);
-}
-// -----------------------------------------------------------------------------
-void CacheController::refreshAllComponents() SAL_THROW((com::sun::star::uno::Exception))
-{
- CacheMap::Map aRefreshList = m_aCacheMap.copy();
-
- for (CacheMap::Map::iterator i = aRefreshList.begin();
- i != aRefreshList.end(); ++i)
- {
- if (!i->second->isEmpty())
- {
- ExtendedCacheData aCacheData = i->second->m_aData;
- RequestOptions aOption = i->first;
- CacheData::ModuleList aModuleList = aCacheData.accessModuleList();
- for (CacheData::ModuleList::iterator itr = aModuleList.begin();
- itr != aModuleList.end(); ++itr)
- {
- //Check the cacheline has atleast one client reference
-
-
- if (itr->second->clientReferences() > 0)
- {
- ComponentRequest aRequest(itr->first,i->first);
- refreshComponent(aRequest);
- } else
- {
- // FIXME: otherwise dispose now
- // XXX: (lo) refresh all, preventing cache corruption.
- // An unused component should be purged from the cache
- // instead of being refreshed
- ComponentRequest aRequest(itr->first,i->first);
- refreshComponent(aRequest);
- }
- }
- }
- }
-}
-
-// -------------------------------------------------------------------------
- } // namespace
-
-// -------------------------------------------------------------------------
-} // namespace
diff --git a/configmgr/source/treecache/cachecontroller.hxx b/configmgr/source/treecache/cachecontroller.hxx
deleted file mode 100644
index 2aa574795a..0000000000
--- a/configmgr/source/treecache/cachecontroller.hxx
+++ /dev/null
@@ -1,338 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_CACHECONTROLLER_HXX
-#define CONFIGMGR_BACKEND_CACHECONTROLLER_HXX
-
-#include "sal/config.h"
-
-#include "salhelper/simplereferenceobject.hxx"
-
-#include "utility.hxx"
-#include "mergeddataprovider.hxx"
-#include "cacheaccess.hxx"
-#include "cachemulticaster.hxx"
-#include "requestoptions.hxx"
-#include "autoreferencemap.hxx"
-#include <com/sun/star/uno/XComponentContext.hpp>
-
-namespace configmgr
-{
-// ---------------------------------------------------------------------------
- class OTreeDisposeScheduler;
- class OCacheWriteScheduler;
-// ---------------------------------------------------------------------------
- namespace backend
- {
-// ---------------------------------------------------------------------------
-
- /** manages a shared data cache for configuration data
- trying to ensure consistency with a backend
- and provides access to the data for clients
- */
- class CacheController:
- public salhelper::SimpleReferenceObject,
- public ITemplateDataProvider, public INodeDataListener
- {
- public:
- /** ctor
- */
- explicit
- CacheController(rtl::Reference< backend::IMergedDataProvider > const & _xBackend,
- const uno::Reference<uno::XComponentContext>& xContext);
-
- // disposing the cache before destroying
- void dispose() SAL_THROW((com::sun::star::uno::RuntimeException));
-
- /** locates data of a component in the cache.
-
- <p> If the data isn't in the cache it is loaded from the backend. </p>
-
- @param _aRequest
- identifies the component to be loaded.
-
- @returns
- data that can be used to locate the loaded data in the cache.
-
- @throws com::sun::star::uno::Exception
- if loading the data fails.
- The exact exception being thrown may depend on the underlying backend.
- */
- sharable::TreeFragment * loadComponent(ComponentRequest const & _aRequest)
- SAL_THROW((com::sun::star::uno::Exception));
-
- /** releases data of a component from the cache.
-
- <p> Should be called when a client is done with a component.
- Each calls to <method>loadComponent</method> should
- be balanced by exactly one call to <method>freeComponent</method>.
- </p>
-
- @param _aRequest
- identifies a component previously loaded via <method>loadComponent</method>.
-
- @returns
- data that can be used to locate the loaded data in the cache.
- */
- void freeComponent(ComponentRequest const & _aRequest)
- SAL_THROW(());
-
- /** refreshes data of an existing component from the backend
-
- <p> If the data is in the cache already, it is refreshed from the
- backend and the change are notified to all registered listeners.
- </p>
- <p> If the data isn't in the cache nothing is done and
- a NULL location is returned.
- </p>
-
- <p>Note: the caller <strong>must not</strong> hold any lock on the cache line affected.</p>
-
- @param _aRequest
- identifies the component to be refreshed.
-
- @returns
- data that can be used to locate the refreshed data in the cache.
-
- <p>If there is no data to refresh a NULL location is returned.</p>
-
- @throws com::sun::star::uno::Exception
- if loading the data fails.
- The exact exception being thrown may depend on the underlying backend.
- */
- sharable::TreeFragment * refreshComponent(ComponentRequest const & _aRequest)
- SAL_THROW((com::sun::star::uno::Exception));
- /** refreshes data of all existing components from the backend
-
- <p> If the data is in the cache already, it is refreshed from the
- backend and the change are notified to all registered listeners.
- </p>
- <p> If the data isn't in the cache nothing is done and
- a NULL location is returned.
- </p>
-
- <p>Note: the caller <strong>must not</strong> hold any lock on the cache line affected.</p>
-
- @throws com::sun::star::uno::Exception
- if loading the data fails.
- The exact exception being thrown may depend on the underlying backend.
- */
- void refreshAllComponents()
- SAL_THROW((com::sun::star::uno::Exception));
-
- /** flushes data of all pending updates from cache to the backend(s)
- @throws com::sun::star::uno::Exception
- if flushing the data fails.
- The exact exception being thrown may depend on the underlying backend.
- */
- void flushPendingUpdates() SAL_THROW((com::sun::star::uno::Exception));
-
- /** locates a template in the cache.
-
- <p> If the data isn't in the cache it is loaded from the backend. </p>
-
- <p>Note: the caller <strong>must not</strong> hold any lock on the cache line affected.</p>
-
- @param _aRequest
- identifies the template to be loaded.
-
- @returns
- data that can be used to locate the template data in the cache.
-
- @throws com::sun::star::uno::Exception
- if loading the template data fails.
- The exact exception being thrown may depend on the underlying backend.
- */
- sharable::TreeFragment * loadTemplate(TemplateRequest const & _aRequest)
- SAL_THROW((com::sun::star::uno::Exception));
-
- /** saves changes to the backend and notifies them to registered listeners.
-
- <p> Must be called after the changes have been applied to the cache
- and before any subsequent changes to the same component.
- </p>
-
- <p> Notifications are guaranteed to be delivered
- before any subsequent changes to the same component are possible.
- </p>
-
- <p> Note: the caller <strong>must</strong> hold a read lock (but no write lock)
- on the cache line affected during the call.</p>
-
- @param _anUpdate
- identifies the node that changed and describes the changes.
-
- @throws com::sun::star::uno::Exception
- if saving the changes to the backend fails.
- The exact exception being thrown may depend on the underlying backend.
- */
- void saveAndNotify(UpdateRequest const & _anUpdate)
- SAL_THROW((com::sun::star::uno::Exception));
-
- /** @returns
- an object that can used to broadcast changes done through this object.
- <p> The object returned is guaranteed to live as long
- as this object lives.
- </p>
- */
- CacheChangeMulticaster & getNotifier() SAL_THROW(())
- { return m_aNotifier; }
-
- /** loads merged data for a (complete) tree and returns it as return value.
-
- @param _aRequest
- identifies the component to be loaded
-
- @param __bAddListenter
- identifies is listener is to be registered to backend
-
- @returns
- A valid component instance for the given component.
-
- @throws com::sun::star::uno::Exception
- if the node cannot be retrieved.
- The exact exception being thrown may depend on the underlying backend.
-
- */
- ResultHolder< ComponentInstance > getComponentData(ComponentRequest const & _aRequest,
- bool _bAddListenter)
- SAL_THROW((com::sun::star::uno::Exception));
-
- /** loads default data for a (partial) tree and returns it as return value
-
- @param _aRequest
- identifies the node to be loaded
-
- @returns
- A valid node instance for the default state of the given node.
-
- <p>May be NULL, if the node exists but has no default equivalent.</p>
-
- @throws com::sun::star::uno::Exception
- if the default cannot be retrieved.
- The exact exception being thrown may depend on the underlying backend.
- */
- ResultHolder< NodeInstance > getDefaultData(NodeRequest const & _aRequest)
- SAL_THROW((com::sun::star::uno::Exception));
-
- /** loads a given template and returns it as return value
-
- @param _aRequest
- identifies the template to be loaded
-
- @returns
- A valid instance of the given template.
-
- <p> Currently a request with empty template name
- will retrieve a group node holding all templates
- of a component.
- </p>
-
- @throws com::sun::star::uno::Exception
- if the template cannot be retrieved.
- The exact exception being thrown may depend on the underlying backend.
- */
- virtual ResultHolder< TemplateInstance > getTemplateData(TemplateRequest const & _aRequest)
- SAL_THROW((com::sun::star::uno::Exception));
- //INodeDataListener Implementation
- /** Triggered when component data is changed
-
- @param _aRequest
- identifies the data that changed
- */
- virtual void dataChanged(const ComponentRequest& _aRequest) SAL_THROW(());
- protected:
- // ref counted, that's why no public dtor
- ~CacheController();
- // implementation
- private:
- configuration::AbsolutePath encodeTemplateLocation(rtl::OUString const & _rName, rtl::OUString const & _rModule) const;
-
- configuration::AbsolutePath ensureTemplate(rtl::OUString const& _rName, rtl::OUString const& _rModule) SAL_THROW((com::sun::star::uno::Exception));
-
- // adjust a node result for locale, ...
- bool normalizeResult(std::auto_ptr<ISubtree> & _aResult, RequestOptions const & _aOptions);
-
- // reads data from the backend directly
- ResultHolder< ComponentInstance > loadDirectly(ComponentRequest const & _aRequest, bool _bAddListenter )
- SAL_THROW((com::sun::star::uno::Exception));
- // reads default data from the backend directly
- ResultHolder< NodeInstance > loadDefaultsDirectly(NodeRequest const & _aRequest) SAL_THROW((com::sun::star::uno::Exception));
- // writes an update to the backend directly
- void saveDirectly(UpdateRequest const & _anUpdate) SAL_THROW((com::sun::star::uno::Exception));
-
- // writes updates for a component to the backend directly
- void savePendingChanges(rtl::Reference<CacheLoadingAccess> const & _aCache, ComponentRequest const & _aComponent)
- SAL_THROW((com::sun::star::uno::Exception));
- // saves all pending changes from a cache access to the backend
- bool saveAllPendingChanges(rtl::Reference<CacheLoadingAccess> const & _aCache, RequestOptions const & _aOptions)
- SAL_THROW((com::sun::star::uno::RuntimeException));
- // load templates componentwise from backend
- std::auto_ptr<ISubtree> loadTemplateData(TemplateRequest const & _aRequest)
- SAL_THROW((com::sun::star::uno::Exception));
-
-
- void flushCacheWriter() SAL_THROW(());
- // add templates componentwise to cache
- sharable::TreeFragment * addTemplates ( backend::ComponentDataStruct const & _aComponentInstance );
- rtl::Reference<CacheLoadingAccess> getCacheAlways(RequestOptions const & _aOptions);
-
- OTreeDisposeScheduler * createDisposer(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _xContext);
- OCacheWriteScheduler * createCacheWriter(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _xContext);
-
-
-
- // disposing
- void disposeAll(bool _bFlushRemainingUpdates);
-
- void closeModules(std::vector< rtl::Reference<CacheLine> > & _aList, RequestOptions const & _aOptions);
- private:
- typedef AutoReferenceMap<RequestOptions,CacheLoadingAccess,lessRequestOptions> CacheMap;
-
- CacheChangeMulticaster m_aNotifier;
- rtl::Reference< backend::IMergedDataProvider > m_xBackend;
- CacheMap m_aCacheMap;
- TemplateCacheData m_aTemplates;
-
- OTreeDisposeScheduler* m_pDisposer;
- OCacheWriteScheduler * m_pCacheWriter;
-
- bool m_bDisposing; // disables async writing and automatic refresh
-
- friend class configmgr::OTreeDisposeScheduler;
- friend class configmgr::OCacheWriteScheduler;
- friend class OInvalidateTreeThread;
-
- };
-// ---------------------------------------------------------------------------
- } // namespace backend
-
-// ---------------------------------------------------------------------------
-} // namespace configmgr
-
-#endif
-
diff --git a/configmgr/source/treecache/cachedata.cxx b/configmgr/source/treecache/cachedata.cxx
deleted file mode 100644
index 51a92238ce..0000000000
--- a/configmgr/source/treecache/cachedata.cxx
+++ /dev/null
@@ -1,495 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "cachedata.hxx"
-#include "node.hxx"
-#include "updatehelper.hxx"
-#include "tracer.hxx"
-#include <osl/diagnose.h>
-#include "configpath.hxx"
-
-namespace configmgr
-{
- // ---------------------------- Client Acquire helper ----------------------------
-
- struct CacheLineClientRef
- {
- rtl::Reference<CacheLine> xModule;
-
- CacheLineClientRef(rtl::Reference<CacheLine> const& _xModule)
- : xModule(_xModule)
- {
- if (xModule.is())
- xModule->clientAcquire();
- }
-
- ~CacheLineClientRef() // release the client reference unless it was 'kept'
- {
- if (xModule.is())
- xModule->clientRelease();
- }
-
- void rebind(rtl::Reference<CacheLine> const& _xModule)
- {
- if (_xModule.is())
- _xModule->clientAcquire();
- if (xModule.is())
- xModule->clientRelease();
- xModule = _xModule;
- }
-
- /// release the contained module so that the client reference will be kept active
- void keep()
- {
- xModule.clear();
- OSL_ASSERT(!xModule.is());
- }
-
- /// return the contained module so that the client reference will be kept active
- rtl::Reference<CacheLine> keepModule()
- {
- rtl::Reference<CacheLine> xRet = xModule;
- this->keep();
- return xRet;
- }
- private:
- CacheLineClientRef(CacheLineClientRef const& );
- CacheLineClientRef& operator=(CacheLineClientRef const& );
-
- };
-
-// -----------------------------------------------------------------------------
- static inline rtl::OUString implExtractModuleName(configuration::AbsolutePath const& aConfigPath)
- {
- return aConfigPath.getModuleName();
- }
-
-// -----------------------------------------------------------------------------
-
- CacheData::CacheData()
- {
- }
-// -----------------------------------------------------------------------------
-
- CacheData::~CacheData()
- {
- CFG_TRACE_INFO("Discarding CacheData (Still holding %d module trees)", int (m_aModules.size()) );
- }
-// -----------------------------------------------------------------------------
- inline
- rtl::Reference<CacheLine> CacheData::internalGetModule(rtl::OUString const & _aModuleName ) const
- {
- OSL_ASSERT(_aModuleName.getLength() != 0);
-
- ModuleList::const_iterator it = m_aModules.find(_aModuleName);
-
- return it!=m_aModules.end() ? it->second : rtl::Reference<CacheLine>();
- }
-// -----------------------------------------------------------------------------
- inline
- rtl::Reference<CacheLine> CacheData::internalGetModule(const configuration::AbsolutePath& _aPath) const
- {
- return internalGetModule( implExtractModuleName(_aPath) );
- }
-// -----------------------------------------------------------------------------
-
- inline
- void CacheData::internalAddModule(rtl::OUString const & _aName, const rtl::Reference<CacheLine> & _aModule)
- {
- //OSL_PRECOND(m_aModules.find(_aName) == m_aModules.end(), "ERROR: Module already present in CacheData");
-
- m_aModules[_aName] = _aModule;
-
- CFG_TRACE_INFO("CacheData Data: Added new module tree for module %s", OUSTRING2ASCII(_aName) );
- }
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
- rtl::Reference<CacheLine> CacheData::internalAttachModule(sharable::TreeFragment * _aLocation, rtl::OUString const & _aName) SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- rtl::Reference<CacheLine> aNewModule = doCreateAttachedModule(_aLocation,_aName);
-
- internalAddModule( _aName, aNewModule );
-
- return aNewModule;
- }
-
-// -------------------------------------------------------------------------
-
- void CacheData::attachModule(sharable::TreeFragment * _aLocation, rtl::OUString const & _aModule)
- {
- this->internalAttachModule(_aLocation,_aModule);
- }
-// -------------------------------------------------------------------------
-
- rtl::Reference<CacheLine> CacheData::doCreateAttachedModule(sharable::TreeFragment * _aLocation, rtl::OUString const & _aName) SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- return CacheLine::createAttached( _aName, _aLocation );
- }
-// -----------------------------------------------------------------------------
-
- /// gets a data segment reference for the given path if exists
- sharable::TreeFragment * CacheData::getTreeAddress(rtl::OUString const & _aModule) const
- {
- rtl::Reference<CacheLine> aModule = internalGetModule(_aModule);
-
- return aModule.is() ? aModule->getTreeAddress() : NULL;
- }
-// -------------------------------------------------------------------------
-
- bool CacheData::hasModule(rtl::OUString const & _aModule) const
- {
- rtl::Reference<CacheLine> aModule = internalGetModule(_aModule);
-
- return aModule.is() && !aModule->isEmpty();
- }
-// -------------------------------------------------------------------------
-
- bool CacheData::hasModuleDefaults(rtl::OUString const & _aModule) const
- {
- rtl::Reference<CacheLine> aModule = internalGetModule(_aModule);
-
- return aModule.is() && !aModule->hasDefaults();
- }
-// -------------------------------------------------------------------------
-
- sharable::TreeFragment * CacheData::internalGetPartialTree(const configuration::AbsolutePath& aComponentName ) const
- {
- rtl::Reference<CacheLine> xModule = internalGetModule(aComponentName);
-
- if ( !xModule.is() )
- return NULL;
-
- sharable::TreeFragment * pSubtree = xModule->getPartialTree(aComponentName);
-
- OSL_ENSURE( pSubtree == NULL || xModule->clientReferences() != 0 ,
- "WARNING: returning subtree from module without clients\n" );
-#ifdef CFG_ENABLE_TRACING
- if( pSubtree != NULL && xModule->clientReferences() == 0)
- {
- CFG_TRACE_WARNING("CacheData data: returning subtree %s from module without clients", OUSTRING2ASCII( aComponentName.toString() ) );
- }
-#endif // CFG_ENABLE_TRACING
-
- return pSubtree;
- }
-// -----------------------------------------------------------------------------
- sharable::Node * CacheData::internalGetNode(const configuration::AbsolutePath& aComponentName ) const
- {
- rtl::Reference<CacheLine> xModule = internalGetModule(aComponentName);
-
- if ( !xModule.is() )
- return 0;
-
- if ( xModule->isEmpty() )
- return 0;
-
- sharable::Node * pNode = xModule->getNode(aComponentName);
-
- OSL_ENSURE( pNode == NULL || xModule->clientReferences() != 0,
- "WARNING: returning node from module without clients\n" );
- #ifdef CFG_ENABLE_TRACING
- if( pNode != NULL && xModule->clientReferences() == 0)
- {
- CFG_TRACE_WARNING("CacheData data: returning node %s from module without clients", OUSTRING2ASCII( aComponentName.toString() ) );
- }
-#endif // CFG_ENABLE_TRACING
-
- return pNode;
- }
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- bool CacheData::acquireModule(rtl::OUString const & _aModule)
- {
- rtl::Reference<CacheLine> xModule = internalGetModule(_aModule);
-
- if (xModule.is())
- {
- CacheLineClientRef aClientRef(xModule);
- aClientRef.keep();
- }
-
- return xModule.is();
- }
-// -----------------------------------------------------------------------------
- sharable::Node * CacheData::acquireNode(configuration::AbsolutePath const& _aPath)
- {
- CacheLineClientRef aClientRef(internalGetModule(_aPath));
-
- sharable::Node * aNodeAddr = internalGetNode(_aPath);
-
- if (sharable::Node const * pNode = aNodeAddr)
- {
- if (pNode->isValue())
- aNodeAddr = 0; // invalid: cannot acquire single value
- }
- else
- OSL_ASSERT( aNodeAddr == NULL );
-
- if (aNodeAddr != NULL)
- aClientRef.keep();
-
- return aNodeAddr;
- }
-// -----------------------------------------------------------------------------
-
- bool CacheData::insertDefaults( backend::NodeInstance const & _aDefaultInstance) SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- OSL_PRECOND(_aDefaultInstance.data().get(), "insertDefaults: Data must not be NULL");
- OSL_PRECOND(_aDefaultInstance.root().getDepth() == 1, "insertDefaults: Default tree being added must be for module");
-
- // we should already have the module in cache !
- rtl::Reference<CacheLine> xModule = internalGetModule(_aDefaultInstance.root());
-
- OSL_ENSURE( xModule.is(), "CacheData::insertDefaults: No module to insert the defaults to - where did the data segment come from ?");
-
- if (!xModule.is()) return false;
-
- // make sure to keep the module alive
- CacheLineClientRef( xModule ).keep();
-
- sharable::TreeFragment * aResultTree = xModule->insertDefaults(_aDefaultInstance);
-
- return aResultTree != NULL;
- }
-// -----------------------------------------------------------------------------
-
- void CacheData::applyUpdate( backend::UpdateInstance & _anUpdate ) SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- // request the subtree, atleast one level must exist!
- sharable::Node * aNodeAddr = internalGetNode(_anUpdate.root());
-
- if (aNodeAddr != NULL)
- {
- applyUpdateToTree(*_anUpdate.data(),aNodeAddr);
- }
- else
- {
- OSL_ENSURE(false, "CacheData::applyUpdate called for non-existing tree");
- rtl::OUString aStr(RTL_CONSTASCII_USTRINGPARAM("CacheData: update to non-existing node: "));
-
- aStr += _anUpdate.root().toString();
-
- throw uno::RuntimeException(aStr,0);
- }
- }
-// -----------------------------------------------------------------------------
- oslInterlockedCount CacheData::releaseModule( rtl::OUString const & _aModule, bool _bKeepDeadModule )
- {
- rtl::Reference<CacheLine> xModule = internalGetModule(_aModule);
-
- const oslInterlockedCount c_nErrorCount = -1;
-
- OSL_ENSURE( xModule.is(), "ERROR: Releasing non-existent subtree");
- if ( !xModule.is()) return c_nErrorCount;
-
- OSL_ENSURE( xModule->clientReferences() > 0, "ERROR: Releasing non-referenced subtree");
-
- oslInterlockedCount nResult = xModule->clientRelease();
-
- if (nResult == 0 && !_bKeepDeadModule)
- {
- m_aModules.erase( _aModule );
- }
- return nResult;
- }
-
-// -----------------------------------------------------------------------------
- sharable::TreeFragment * CacheData::getTemplateTree(configuration::AbsolutePath const& aTemplateName ) const
- {
- return internalGetPartialTree(aTemplateName);
- }
-// -----------------------------------------------------------------------------
- sharable::Node * CacheData::getNode(const configuration::AbsolutePath& _rPath)
- {
- return internalGetNode(_rPath);
- }
-// -----------------------------------------------------------------------------
- bool CacheData::hasNode(const configuration::AbsolutePath& _rPath) const
- {
- return internalGetNode(_rPath) != NULL;
- }
-// -----------------------------------------------------------------------------
-
- sharable::TreeFragment * TemplateCacheData::addTemplates( backend::ComponentDataStruct const & _aComponentInstance) SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- OSL_PRECOND(_aComponentInstance.data.get(), "addTemplates: Data must not be NULL");
- // we should already have the module in cache !
- rtl::OUString aModuleName ( _aComponentInstance.name);
- rtl::Reference<CacheLine> xModule = internalGetModule(aModuleName);
-
- OSL_ENSURE( xModule.is(), "ExtendedCacheData::addTemplates: No module to add the templates to - where did the data segment come from ?");
-
- if (!xModule.is()) return NULL;
-
- // make sure to keep the module alive
- CacheLineClientRef( xModule ).keep();
-
- static const rtl::OUString aDummyTemplateName(RTL_CONSTASCII_USTRINGPARAM("cfg:Template"));
- static const rtl::OUString aDummyTemplateModule(RTL_CONSTASCII_USTRINGPARAM("cfg:Templates"));
- _aComponentInstance.data->makeSetNode(aDummyTemplateName,aDummyTemplateModule);
-
- sharable::TreeFragment * aResult = xModule->setComponentData(_aComponentInstance, true);
-
- OSL_ASSERT(aResult != NULL);
-
- return aResult;
- }
-// -----------------------------------------------------------------------------
-
- rtl::Reference<CacheLine> TemplateCacheData::doCreateAttachedModule(sharable::TreeFragment * _aLocation, rtl::OUString const & _aName) SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- rtl::Reference<CacheLine> aNewModule = CacheLine::createAttached(_aName, _aLocation);
-
- return aNewModule.get();
- }
-// -----------------------------------------------------------------------------
-
- void TemplateCacheData::createModule(rtl::OUString const & _aModule) SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- rtl::Reference<CacheLine> aNewModule = CacheLine::createNew(_aModule);
-
- internalAddModule( _aModule, aNewModule.get() );
- }
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- inline
- rtl::Reference<ExtendedCacheLine> ExtendedCacheData::implExtended(const rtl::Reference<CacheLine>& _aSimpleRef) const
- {
- CacheLine * pBasic = _aSimpleRef.get();
- ExtendedCacheLine * pExtended = static_cast<ExtendedCacheLine *>(pBasic);
- return rtl::Reference<ExtendedCacheLine>(pExtended);
- }
-
-// -----------------------------------------------------------------------------
-
- rtl::Reference<CacheLine> ExtendedCacheData::doCreateAttachedModule(sharable::TreeFragment * _aLocation, rtl::OUString const & _aName) SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- rtl::Reference<ExtendedCacheLine> aNewModule =
- ExtendedCacheLine::createAttached(_aName, _aLocation);
-
- return rtl::Reference<CacheLine>( aNewModule.get() );
- }
-// -----------------------------------------------------------------------------
-
- void ExtendedCacheData::createModule(rtl::OUString const & _aModule) SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- rtl::Reference<ExtendedCacheLine> aNewModule = ExtendedCacheLine::createNew(_aModule);
-
- internalAddModule( _aModule, aNewModule.get() );
- }
-// -----------------------------------------------------------------------------
-
- sharable::TreeFragment * ExtendedCacheData::addComponentData(backend::ComponentInstance const & _aComponentInstance,
- bool _bWithDefaults) SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- OSL_PRECOND(_aComponentInstance.data().get(), "addComponentData: Data must not be NULL");
- // we should already have the module in cache !
- //rtl::Reference<CacheLine> xModule = internalGetModule(_aNodeInstance.root().location());
- rtl::Reference<CacheLine> xModule = internalGetModule(_aComponentInstance.component() );
-
- OSL_ENSURE( xModule.is(), "ExtendedCacheData::addComponentData: No module to add the subtree to - where did the data segment come from ?");
-
- if (!xModule.is()) return NULL;
-
- CacheLineClientRef aClientRef( xModule );
-
- sharable::TreeFragment * aResult = xModule->setComponentData(_aComponentInstance.componentNodeData(), _bWithDefaults);
-
- OSL_ASSERT(aResult != NULL);
-
- if (aResult != NULL) aClientRef.keep();
-
- return aResult;
- }
-// -----------------------------------------------------------------------------
-
- void ExtendedCacheData::addPending(backend::ConstUpdateInstance const & _anUpdate) SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- // do we already have the module in cache ?
- rtl::Reference<CacheLine> xModule = internalGetModule(_anUpdate.root());
-
- if (xModule.is())
- {
- implExtended(xModule)->addPending(_anUpdate);
- }
- else
- {
- OSL_ENSURE(false, "We can only change Nodes if we already know something about it. So this must be a big bug.");
- }
- }
-// -----------------------------------------------------------------------------
-
- std::auto_ptr<SubtreeChange> ExtendedCacheData::releasePending(rtl::OUString const& _aModule)
- {
- rtl::Reference<ExtendedCacheLine> xModule = implExtended(internalGetModule(_aModule));
-
- if (xModule.is())
- {
- if (xModule->hasPending())
- return xModule->releasePending();
- else
- return std::auto_ptr<SubtreeChange>();
- }
- else
- {
- OSL_ENSURE(false, "We can only get Nodes if we already know something about it.");
- }
- return std::auto_ptr<SubtreeChange>();
- }
-// -----------------------------------------------------------------------------
-
- bool ExtendedCacheData::hasPending(rtl::OUString const & _aModule)
- {
- rtl::Reference<ExtendedCacheLine> xModule = implExtended(internalGetModule(_aModule));
-
- return xModule.is() && xModule->hasPending();
- }
-
-// -----------------------------------------------------------------------------
-
- void ExtendedCacheData::findPendingModules( std::vector< rtl::OUString > & _rPendingList )
- {
- ModuleList& rModules = CacheData::accessModuleList();
- for (ModuleList::iterator it = rModules.begin();
- it != rModules.end();
- ++it)
- {
- OSL_ASSERT( it->second.is() );
- if ( implExtended(it->second)->hasPending() )
- _rPendingList.push_back( it->first );
- }
- }
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-} // namespace configmgr
-
-
diff --git a/configmgr/source/treecache/cachedata.hxx b/configmgr/source/treecache/cachedata.hxx
deleted file mode 100644
index 78866406cf..0000000000
--- a/configmgr/source/treecache/cachedata.hxx
+++ /dev/null
@@ -1,176 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CACHEDATA_HXX
-#define CONFIGMGR_CACHEDATA_HXX
-
-#include "cacheline.hxx"
-
-#ifndef INCLUDED_MAP
-#include <map>
-#define INCLUDED_MAP
-#endif
-
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif
-
-namespace configmgr
-{
-////////////////////////////////////////////////////////////////////////////////
- namespace backend
- {
- struct NodeInstance;
- struct TemplateInstance;
- struct UpdateInstance;
- struct ConstUpdateInstance;
- }
-
-////////////////////////////////////////////////////////////////////////////////
- /** A collection of CacheLines
- */
-
- class CacheData
- {
- public:
- CacheData();
- virtual ~CacheData();
-
- // attach a module with a given name
- void attachModule(sharable::TreeFragment * _aLocation, rtl::OUString const & _aModule);
- /// check if the given module exists already (and is not empty)
- bool hasModule(rtl::OUString const & _aModule) const;
- /// checks if the given module exists and has defaults available
- bool hasModuleDefaults(rtl::OUString const & _aModule) const;
-
- /// gets a tree address for the given module if it exists
- sharable::TreeFragment * getTreeAddress(rtl::OUString const & _aModule) const;
-
- /// checks whether a certain node exists in the tree
- bool hasNode(configuration::AbsolutePath const & _aLocation) const;
-
- /// retrieve the given node without changing its ref count
- sharable::Node * getNode(configuration::AbsolutePath const & _rPath);
- /// retrieve the given template tree without changing its ref count
- sharable::TreeFragment * getTemplateTree( configuration::AbsolutePath const & aTemplateName ) const;
-
- /// retrieve the subtree at _aPath and clientAcquire() it
- sharable::Node * acquireNode(configuration::AbsolutePath const & _aPath );
- /// retrieve the subtree at _aPath and clientAcquire() it, return true on success
- bool acquireModule( rtl::OUString const & _aModule );
- /// clientRelease() the tree at aComponentName, and return the resulting reference count
- oslInterlockedCount releaseModule( rtl::OUString const & _aModule, bool _bKeepDeadModule = false );
-
- bool insertDefaults( backend::NodeInstance const & _aDefaultInstance
- ) SAL_THROW((com::sun::star::uno::RuntimeException));
-
- /// merge the given changes into this tree - reflects old values to _anUpdate
- void applyUpdate( backend::UpdateInstance & _anUpdate) SAL_THROW((com::sun::star::uno::RuntimeException));
-
- // low-level interface for cache management
- typedef std::map<rtl::OUString, rtl::Reference<CacheLine> > ModuleList;
- ModuleList& accessModuleList() { return m_aModules; }
-
- protected:
- virtual rtl::Reference<CacheLine> doCreateAttachedModule(sharable::TreeFragment * _aLocation, rtl::OUString const & _aName) SAL_THROW((com::sun::star::uno::RuntimeException));
-
- sharable::TreeFragment * internalGetPartialTree(configuration::AbsolutePath const & _aPath ) const;
- sharable::Node * internalGetNode(const configuration::AbsolutePath& _rPath) const;
-
- rtl::Reference<CacheLine> internalAttachModule(sharable::TreeFragment * _aLocation, rtl::OUString const & _aName) SAL_THROW((com::sun::star::uno::RuntimeException));
- void internalAddModule(rtl::OUString const & _aName, rtl::Reference<CacheLine> const & _aModule);
-
- rtl::Reference<CacheLine> internalGetModule(rtl::OUString const & _aName) const;
- rtl::Reference<CacheLine> internalGetModule(const configuration::AbsolutePath& _aLocation) const;
-
- private:
- ModuleList m_aModules;
- };
-////////////////////////////////////////////////////////////////////////////////
- /** A collection of CacheLines for templates
- */
-
- class TemplateCacheData : public CacheData
- {
- public:
- TemplateCacheData() : CacheData()
- {
- }
-
- /** add the given template tree at the given location,
- return the tree that is now pertinent and clientAcquire() it once
- */
- sharable::TreeFragment * addTemplates( backend::ComponentDataStruct const & _aComponentInstance
- ) SAL_THROW((com::sun::star::uno::RuntimeException));
-
- // create a new module with the given name
- void createModule(rtl::OUString const & _aModule) SAL_THROW((com::sun::star::uno::RuntimeException));
- private:
- virtual rtl::Reference<CacheLine> doCreateAttachedModule(sharable::TreeFragment * _aLocation, rtl::OUString const & _aName) SAL_THROW((com::sun::star::uno::RuntimeException));
- };
-//-----------------------------------------------------------------------------
- /** A collection of CacheLines
- */
-
- class ExtendedCacheData : public CacheData
- {
- public:
- ExtendedCacheData() : CacheData()
- {
- }
-
- /** add the given subtree at the given location,
- return the tree that is now pertinent and clientAcquire() it once
- */
- sharable::TreeFragment * addComponentData( backend::ComponentInstance const & _aComponentInstance,
- bool _bWithDefaults
- ) SAL_THROW((com::sun::star::uno::RuntimeException));
-
- /// find the modules having pending changes
- bool hasPending(rtl::OUString const & _aModule);
- /// find the modules having pending changes
- void findPendingModules( std::vector< rtl::OUString > & _rPendingList );
-
- /// add or merge the given subtreechange at the given location
- void addPending(backend::ConstUpdateInstance const & _anUpdate) SAL_THROW((com::sun::star::uno::RuntimeException));
- /// remove and return pending changes for the given component
- std::auto_ptr<SubtreeChange> releasePending(rtl::OUString const & _aModule) SAL_THROW((com::sun::star::uno::RuntimeException));
-
- // create a new module with the given name
- void createModule(rtl::OUString const & _aModule) SAL_THROW((com::sun::star::uno::RuntimeException));
- private:
- virtual rtl::Reference<CacheLine> doCreateAttachedModule(sharable::TreeFragment * _aLocation, rtl::OUString const & _aName) SAL_THROW((com::sun::star::uno::RuntimeException));
-
- rtl::Reference<ExtendedCacheLine> implExtended(rtl::Reference<CacheLine> const & _aSimpleRef) const;
- };
-//-----------------------------------------------------------------------------
-
-} // namespace configmgr
-
-#endif
-
diff --git a/configmgr/source/treecache/cachefactory.cxx b/configmgr/source/treecache/cachefactory.cxx
deleted file mode 100644
index 991a524fbe..0000000000
--- a/configmgr/source/treecache/cachefactory.cxx
+++ /dev/null
@@ -1,75 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "cachefactory.hxx"
-#include "treemanager.hxx"
-#include "cachecontroller.hxx"
-#include "backendfactory.hxx"
-
-namespace configmgr
-{
-// -------------------------------------------------------------------------
-
- static
- rtl::Reference<TreeManager> buildCacheManager(rtl::Reference< backend::IMergedDataProvider > const & _xBackend,
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & _xContext)
- {
- rtl::Reference< TreeManager > xCache;
-
- if (_xBackend.is())
- {
- rtl::Reference< backend::CacheController > xLoader
- = new backend::CacheController(_xBackend.get(), _xContext);
-
- xCache.set( new TreeManager(xLoader.get()) );
- }
-
- return xCache;
- }
-// -------------------------------------------------------------------------
-
- rtl::Reference<TreeManager>
- CacheFactory::createCacheManager(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & _xContext)
- {
- rtl::Reference< backend::IMergedDataProvider > xBackend = backend::BackendFactory::instance(_xContext).createBackend();
-
- return buildCacheManager(xBackend, _xContext);
- }
-
-// -------------------------------------------------------------------------
-
- CacheFactory & CacheFactory::instance()
- {
- static CacheFactory aStaticFactory;
- return aStaticFactory;
- }
-
-//-----------------------------------------------------------------------------
-} // namespace
diff --git a/configmgr/source/treecache/cacheline.cxx b/configmgr/source/treecache/cacheline.cxx
deleted file mode 100644
index 0ed5fe8611..0000000000
--- a/configmgr/source/treecache/cacheline.cxx
+++ /dev/null
@@ -1,353 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "cacheline.hxx"
-#include "builddata.hxx"
-#include "treechangefactory.hxx"
-#include "mergechange.hxx"
-#include "configexcept.hxx"
-#include "tracer.hxx"
-#include <osl/diagnose.h>
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- static inline rtl::OUString implExtractModuleName(configuration::AbsolutePath const& _aConfigPath)
- {
- return _aConfigPath.getModuleName();
- }
-
-
-// -----------------------------------------------------------------------------
-// class CacheLine
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-
- CacheLine::CacheLine(rtl::OUString const & _aModuleName)
- : m_base(NULL)
- , m_name(_aModuleName)
- , m_nDataRefs(0)
- {
- }
-// -----------------------------------------------------------------------------
-
- CacheLine::CacheLine(rtl::OUString const & _aModuleName, sharable::TreeFragment * _pSegment)
- : m_base(_pSegment)
- , m_name(_aModuleName)
- , m_nDataRefs(0)
- {
- }
-
-// -----------------------------------------------------------------------------
-
- void CacheLine::setBase(sharable::TreeFragment * _base)
- {
- OSL_PRECOND(m_base == NULL, "CacheLine: Data base address was already set");
- OSL_PRECOND( _base != NULL, "CacheLine: Cannot set NULL base address");
- m_base = _base;
- }
-// -----------------------------------------------------------------------------
-
- rtl::Reference<CacheLine> CacheLine::createAttached( rtl::OUString const & _aModuleName,
- sharable::TreeFragment * _aSegment
- ) SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- if (_aModuleName.getLength() == 0)
- {
- OSL_ENSURE(false, "Cannot make a cache line without a name");
- return NULL;
- }
- if (_aSegment == NULL)
- {
- OSL_ENSURE(false, "Cannot attach a cache line to a NULL segment");
- return NULL;
- }
-
- rtl::Reference<CacheLine> xResult = new CacheLine(_aModuleName,_aSegment);
-
- return xResult;
- }
-// -----------------------------------------------------------------------------
-
- rtl::Reference<CacheLine> CacheLine::createNew( rtl::OUString const & _aModuleName
- ) SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- if (_aModuleName.getLength() == 0)
- {
- OSL_ENSURE(false, "Cannot make a cache line without a name");
- return NULL;
- }
-
- rtl::Reference<CacheLine> xResult = new CacheLine(_aModuleName);
-
- return xResult;
- }
-// -------------------------------------------------------------------------
-
- rtl::OUString CacheLine::getModuleName() const
- {
- return m_name;
- }
-// -----------------------------------------------------------------------------
-
- sharable::TreeFragment * CacheLine::getPartialTree(configuration::AbsolutePath const& aConfigName) const
- {
- sharable::Node * parent = internalGetNode(aConfigName.getParentPath());
-
- if (parent != 0 && parent->isSet())
- return parent->set.getElement(aConfigName.getLocalName().getName());
- else
- return NULL;
- }
-// -----------------------------------------------------------------------------
-
- bool CacheLine::hasDefaults() const
- {
- return m_base != 0 && m_base->hasDefaultsAvailable();
- }
-// -----------------------------------------------------------------------------
- sharable::Node * CacheLine::internalGetNode(configuration::AbsolutePath const& aConfigName) const
- {
- OSL_ASSERT(m_base != 0);
- sharable::Node * node = m_base->getRootNode();
- OSL_ASSERT(node != 0);
- std::vector< configuration::Path::Component >::const_reverse_iterator i(
- aConfigName.begin());
- OSL_ASSERT(
- i != aConfigName.end() && node->getName() == i->getInternalName());
- while (node != 0 && ++i != aConfigName.end()) {
- node = node->getSubnode(i->getName());
- }
- return node;
- }
-// -----------------------------------------------------------------------------
-
- sharable::Node * CacheLine::getNode(configuration::AbsolutePath const& aConfigName) const
- {
- return internalGetNode(aConfigName);
- }
-// -------------------------------------------------------------------------
-
- sharable::TreeFragment * CacheLine::setComponentData( backend::ComponentDataStruct const & _aComponentInstance,
- bool _bWithDefaults
- ) SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- OSL_PRECOND(_aComponentInstance.data.get(), "CacheLine::insertDefaults: inserting NULL defaults !");
- OSL_PRECOND(_aComponentInstance.name == this->getModuleName(),"Data location does not match module");
-
- OSL_PRECOND(base() == NULL, "Data is already loaded");
-
- if (base() == NULL) // no data yet
- {
- this->setBase( data::buildTree(_aComponentInstance.data->getName(), *_aComponentInstance.data, _bWithDefaults) );
- }
-
- return this->base();
- }
-// -----------------------------------------------------------------------------
-
- sharable::TreeFragment * CacheLine::insertDefaults( backend::NodeInstance const & _aDefaultInstance
- ) SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- OSL_PRECOND(_aDefaultInstance.data().get(), "CacheLine::insertDefaults: inserting NULL defaults !");
- OSL_PRECOND(_aDefaultInstance.root().getDepth() == 1, "Should have complete component to fill tree with defaults");
- OSL_PRECOND(_aDefaultInstance.root().getModuleName() == this->getModuleName(),"Data location does not match module");
-
- OSL_PRECOND(m_base != NULL, "Data must already be loaded to insert defaults");
-
- if (m_base != NULL)
- {
- data::mergeDefaults(m_base,*_aDefaultInstance.data());
- }
-
- return m_base;
- }
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
- ExtendedCacheLine::ExtendedCacheLine(rtl::OUString const & _aModuleName)
- : CacheLine(_aModuleName)
- , m_pPending()
- {
- }
-
-// -----------------------------------------------------------------------------
-
- ExtendedCacheLine::ExtendedCacheLine(rtl::OUString const & _aModuleName,
- sharable::TreeFragment * _aSegment)
- : CacheLine(_aModuleName,_aSegment)
- , m_pPending()
- {
- }
-
-// -----------------------------------------------------------------------------
-
- rtl::Reference<ExtendedCacheLine> ExtendedCacheLine::createAttached( rtl::OUString const & _aModuleName,
- sharable::TreeFragment * _aSegment
- ) SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- if (_aModuleName.getLength() == 0)
- {
- OSL_ENSURE(false, "Cannot make a cache line without a name");
- return NULL;
- }
- if (_aSegment == NULL)
- {
- OSL_ENSURE(false, "Cannot attach a cache line to a NULL segment");
- return NULL;
- }
-
- rtl::Reference<ExtendedCacheLine> xResult = new ExtendedCacheLine(_aModuleName,_aSegment);
-
- return xResult;
- }
-// -----------------------------------------------------------------------------
-
- rtl::Reference<ExtendedCacheLine> ExtendedCacheLine::createNew( rtl::OUString const & _aModuleName
- ) SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- if (_aModuleName.getLength() == 0)
- {
- OSL_ENSURE(false, "Cannot make a cache line without a name");
- return NULL;
- }
-
- rtl::Reference<ExtendedCacheLine> xResult = new ExtendedCacheLine(_aModuleName);
-
- return xResult;
- }
-// -------------------------------------------------------------------------
-
- void ExtendedCacheLine::addPending(backend::ConstUpdateInstance const & _anUpdate) SAL_THROW((com::sun::star::uno::RuntimeException))
- {
- configuration::AbsolutePath aRootLocation = _anUpdate.root();
-
- OSL_PRECOND(!aRootLocation.isRoot(),"Pending change cannot be located at root");
- OSL_PRECOND(aRootLocation.getModuleName() == this->getModuleName(),"Pending change location does not match module");
-
- OSL_PRECOND(_anUpdate.data() != NULL,"Adding NULL 'pending' change");
- OSL_PRECOND(_anUpdate.data()->getNodeName() == aRootLocation.getLocalName().getName(),
- "Path to pending change does not match change name");
-
- using std::auto_ptr;
-
- // first make the _pSubtreeChange a full tree starting at the module root
- auto_ptr<SubtreeChange> pRootChange;
- SubtreeChange *pExistingEntry = NULL;
-
- std::vector<configuration::Path::Component>::const_reverse_iterator last = aRootLocation.end();
-
- OSL_ASSERT(last != aRootLocation.begin());
- --last;
-
- for (std::vector<configuration::Path::Component>::const_reverse_iterator it = aRootLocation.begin();
- it != last;
- ++it)
- {
- OSL_ASSERT( it != aRootLocation.end());
- OSL_ASSERT( it+1 != aRootLocation.end());
- // We need to create a new SubtreeChange
- rtl::OUString const aChangeName = it->getName();
- rtl::OUString const aElementTypeName = (it+1)->getTypeName();
-
- auto_ptr<SubtreeChange> pNewChange =
- OTreeChangeFactory::createDummyChange(aChangeName, aElementTypeName);
-
- if (pExistingEntry == NULL)
- {
- OSL_ASSERT(pRootChange.get() == NULL);
-
- pRootChange = pNewChange;
- pExistingEntry = pRootChange.get();
- }
- else
- {
- OSL_ASSERT(pRootChange.get() != NULL);
-
- pExistingEntry->addChange(base_ptr(pNewChange));
-
- Change* pChange = pExistingEntry->getChange(aChangeName);
- pExistingEntry = static_cast<SubtreeChange*>(pChange);
-
- OSL_ENSURE(dynamic_cast< SubtreeChange * >(pChange) != 0, "ERROR: Cannot recover change just added");
- }
- }
-
- auto_ptr<SubtreeChange> pAddedChange( new SubtreeChange(*_anUpdate.data(), treeop::DeepChildCopy()) );
-
- if (aRootLocation.getDepth() > 1)
- {
- OSL_ASSERT(pRootChange.get() != NULL && pExistingEntry != NULL);
-
- // the _pSubtreeChange did not start at root, so add its clone to the built dummies
- pExistingEntry->addChange(base_ptr(pAddedChange));
- }
- else
- {
- OSL_ASSERT(pRootChange.get() == NULL && pExistingEntry == NULL);
-
- // the _pSubtreeChange starts at root, so just reset pRootChange
- pRootChange = pAddedChange;
- }
- OSL_ASSERT(pRootChange.get() != NULL);
-
- if (m_pPending.get() == NULL)
- {
- // no merge is need, because the existing pending changes are empty
- m_pPending = pRootChange;
- }
- else
- {
- try
- {
- // We need to merge the new rebased changes into the m_pPending
- combineUpdates(*pRootChange,*m_pPending);
- }
- catch (configuration::Exception& e)
- {
- rtl::OUString sMessage(RTL_CONSTASCII_USTRINGPARAM("Update cache for module: Could not add pending changes at"));
-
- sMessage += aRootLocation.toString();
-
- sMessage += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(". Internal Exception:")) + e.message();
-
- throw uno::RuntimeException(sMessage,0);
- }
- }
-
- OSL_POSTCOND(m_pPending.get() != NULL, "Could not insert new pending changes");
- }
-// -----------------------------------------------------------------------------
-
-
-} // namespace configmgr
-
-
diff --git a/configmgr/source/treecache/cacheline.hxx b/configmgr/source/treecache/cacheline.hxx
deleted file mode 100644
index 881e45119b..0000000000
--- a/configmgr/source/treecache/cacheline.hxx
+++ /dev/null
@@ -1,137 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CACHELINE_HXX
-#define CONFIGMGR_CACHELINE_HXX
-
-#include "configpath.hxx"
-#include "requesttypes.hxx"
-#include "utility.hxx"
-#include "treefragment.hxx"
-#include <osl/interlck.h>
-#include <rtl/ref.hxx>
-#include <salhelper/simplereferenceobject.hxx>
-
-namespace configmgr
-{
- /** This object represents a cache line for a single configuration tree
- */
- class CacheLine: public salhelper::SimpleReferenceObject
- {
- public:
- // create a new CacheLine for the given component name
- static rtl::Reference<CacheLine>
- createNew( rtl::OUString const & _aModuleName );
-
- // create a new CacheLine attached to the given memory location
- static rtl::Reference<CacheLine>
- createAttached( rtl::OUString const & _aModuleName, sharable::TreeFragment * _aLocation );
-
- bool hasDefaults() const;
-
- bool isEmpty() const { return m_base == NULL; }
- sharable::TreeFragment * getTreeAddress() const { return m_base; }
- sharable::TreeFragment * getPartialTree(configuration::AbsolutePath const & _aTemplatePath ) const;
- sharable::Node * getNode(configuration::AbsolutePath const & _aPath) const;
-
- sharable::TreeFragment * setComponentData( backend::ComponentDataStruct const & _aComponentInstance,
- bool _bWithDefaults
- ) SAL_THROW((com::sun::star::uno::RuntimeException));
-
- sharable::TreeFragment * insertDefaults( backend::NodeInstance const & _aDefaultInstance
- ) SAL_THROW((com::sun::star::uno::RuntimeException));
-
- // get the module name for this component
- rtl::OUString getModuleName() const;
-
- /// add a client for this module's data
- oslInterlockedCount clientReferences() const { return m_nDataRefs; }
- /// add a client for this modules data
- oslInterlockedCount clientAcquire() { return osl_incrementInterlockedCount(&m_nDataRefs); }
- /// subtract a client for this modules data
- oslInterlockedCount clientRelease() { return osl_decrementInterlockedCount(&m_nDataRefs); }
-
- protected:
- // create a new CacheLine attached to the given memory location
- explicit
- CacheLine( rtl::OUString const & _aModuleName, sharable::TreeFragment * _pLocation );
-
- // create a new empty CacheLine for the given component name
- explicit
- CacheLine( rtl::OUString const & _aModuleName );
-
- sharable::Node * internalGetNode(configuration::AbsolutePath const & _rPath) const;
-
- sharable::TreeFragment * base() const { return m_base; }
- void setBase(sharable::TreeFragment * _base);
-
- private:
- sharable::TreeFragment * m_base;
- rtl::OUString m_name;
-
- oslInterlockedCount m_nDataRefs; /// the number of clients on this modules data
- };
-
-////////////////////////////////////////////////////////////////////////////////
- /** This object represents a cache line and associated data for a single configuration tree
- */
- class ExtendedCacheLine : public CacheLine
- {
- public:
- // create a new CacheLine for the given component name
- static rtl::Reference<ExtendedCacheLine>
- createNew( rtl::OUString const & _aModuleName );
-
- // create a new CacheLine attached to the given memory location
- static rtl::Reference<ExtendedCacheLine>
- createAttached( rtl::OUString const & _aModuleName,
- sharable::TreeFragment * _aLocation );
-
- // management of pending changes
- bool hasPending() const {return m_pPending.get() != NULL;}
-
- void addPending(backend::ConstUpdateInstance const & _anUpdate) SAL_THROW((com::sun::star::uno::RuntimeException));
- std::auto_ptr<SubtreeChange> releasePending() {return m_pPending;}
-
- private:
- // create a new empty CacheLine for the given component name
- explicit
- ExtendedCacheLine( rtl::OUString const & _aModuleName );
-
- // create a new CacheLine attached to the given memory location
- explicit
- ExtendedCacheLine( rtl::OUString const & _aModuleName,
- sharable::TreeFragment * _aLocation );
-
- private:
- std::auto_ptr<SubtreeChange> m_pPending;
- };
-
-} // namespace configmgr
-
-#endif
-
diff --git a/configmgr/source/treecache/cachemulticaster.cxx b/configmgr/source/treecache/cachemulticaster.cxx
deleted file mode 100644
index d2ff6196b0..0000000000
--- a/configmgr/source/treecache/cachemulticaster.cxx
+++ /dev/null
@@ -1,144 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "cachemulticaster.hxx"
-#include "treemanager.hxx"
-
-#ifndef INCLUDED_ALGORITHM
-#include <algorithm>
-#define INCLUDED_ALGORITHM
-#endif
-#ifndef INCLUDED_FUNCTIONAL
-#include <functional>
-#define INCLUDED_FUNCTIONAL
-#endif
-
-namespace configmgr
-{
-// ---------------------------------------------------------------------------
- namespace backend
- {
-// ---------------------------------------------------------------------------
-namespace
-{
-// manually implemented helpers, as rtl::References don't work well with std binders
-
-// ---------------------------------------------------------------------------
-
- // replacing std::bind2nd( std::mem_fun(&TreeManager::componentCreated), _aComponentName )
- struct NotifyCreated : std::unary_function<rtl::Reference<TreeManager>,void>
- {
- ComponentRequest const & m_arg;
-
- NotifyCreated(ComponentRequest const * _pComponent) SAL_THROW(())
- : m_arg(*_pComponent)
- {}
-
- void operator()(rtl::Reference<TreeManager> const & _xListener) const SAL_THROW(())
- { _xListener->componentCreated(m_arg); }
- };
-// ---------------------------------------------------------------------------
-
- // replacing std::bind2nd( std::mem_fun(&TreeManager::componentChanged), _aComponentName )
- struct NotifyChanged : std::unary_function<rtl::Reference<TreeManager>,void>
- {
- UpdateRequest const & m_arg;
-
- NotifyChanged(UpdateRequest const * _pUpdate) SAL_THROW(())
- : m_arg(*_pUpdate)
- {}
-
- void operator()(rtl::Reference<TreeManager> const & _xListener) const SAL_THROW(())
- { _xListener->componentChanged(m_arg); }
- };
-// ---------------------------------------------------------------------------
-} // anonymous namespace
-//----------------------------------------------------------------------------
-
-CacheChangeMulticaster::CacheChangeMulticaster()
-: m_aMutex()
-, m_aListeners()
-{
-}
-// ---------------------------------------------------------------------------
-
-CacheChangeMulticaster::~CacheChangeMulticaster()
-{
- OSL_ENSURE( m_aListeners.empty(), "Forgot to dispose multicaster" );
-}
-// ---------------------------------------------------------------------------
-
-inline std::list< rtl::Reference<TreeManager> > CacheChangeMulticaster::copyListenerList()
-{
- osl::MutexGuard aListGuard(m_aMutex);
- return m_aListeners;
-}
-// ---------------------------------------------------------------------------
-
-void CacheChangeMulticaster::notifyCreated(ComponentRequest const & _aComponent) SAL_THROW(())
-{
- std::list< rtl::Reference<TreeManager> > aNotifyListeners( this->copyListenerList() );
-
- std::for_each( aNotifyListeners.begin(), aNotifyListeners.end(), NotifyCreated(&_aComponent) );
-}
-// ---------------------------------------------------------------------------
-
-void CacheChangeMulticaster::notifyChanged(UpdateRequest const & _anUpdate) SAL_THROW(())
-{
- std::list< rtl::Reference<TreeManager> > aNotifyListeners( this->copyListenerList() );
-
- std::for_each( aNotifyListeners.begin(), aNotifyListeners.end(), NotifyChanged(&_anUpdate) );
-}
-// ---------------------------------------------------------------------------
-
-void CacheChangeMulticaster::addListener(rtl::Reference<TreeManager> _xListener) SAL_THROW(())
-{
- osl::MutexGuard aListGuard(m_aMutex);
-
- OSL_PRECOND(std::find(m_aListeners.begin(),m_aListeners.end(),_xListener) == m_aListeners.end(),
- "WARNING: Cache Change Listener was already registered - will be notified multiply.");
-
- OSL_PRECOND(_xListener.is(), "ERROR: trying to register a NULL listener");
-
- if (_xListener.is())
- m_aListeners.push_front(_xListener);
-}
-// ---------------------------------------------------------------------------
-
-void CacheChangeMulticaster::removeListener(rtl::Reference<TreeManager> _xListener) SAL_THROW(())
-{
- osl::MutexGuard aListGuard(m_aMutex);
- m_aListeners.remove(_xListener);
-}
-// ---------------------------------------------------------------------------
- } // namespace backend
-
-// ---------------------------------------------------------------------------
-} // namespace configmgr
diff --git a/configmgr/source/treecache/cachemulticaster.hxx b/configmgr/source/treecache/cachemulticaster.hxx
deleted file mode 100644
index 53330ea03e..0000000000
--- a/configmgr/source/treecache/cachemulticaster.hxx
+++ /dev/null
@@ -1,88 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_BACKEND_CACHEMULTICASTER_HXX
-#define CONFIGMGR_BACKEND_CACHEMULTICASTER_HXX
-
-#include "sal/config.h"
-
-#include <list>
-
-#include "osl/mutex.hxx"
-#include "rtl/ref.hxx"
-
-#include "utility.hxx"
-
-namespace configmgr
-{
- class TreeManager;
-
- namespace backend
- {
- class ComponentRequest;
- class UpdateRequest;
-// ---------------------------------------------------------------------------
-
- /** Interface providing a multicasting service for changes to the cache
- managed by a <type>CacheController</type>
- */
- class CacheChangeMulticaster
- {
- public:
- CacheChangeMulticaster();
- virtual ~CacheChangeMulticaster();
-
- /** notify a new component to all registered listeners.
- <p> Must be called after the component has been created in the cache.</p>
- */
- void notifyCreated(ComponentRequest const & _aComponentName) SAL_THROW(());
-
- /** notify changed data to all registered listeners.
- <p> Must be called after the change has been applied to the cache
- and before any subsequent changes to the same component.</p>
- */
- void notifyChanged(UpdateRequest const & _anUpdate) SAL_THROW(());
-
- // notification support.
- /// register a listener for observing changes to the cached data
- void addListener(rtl::Reference<TreeManager> _xListener) SAL_THROW(());
- /// unregister a listener previously registered
- void removeListener(rtl::Reference<TreeManager> _xListener) SAL_THROW(());
- private:
- std::list< rtl::Reference<TreeManager> > copyListenerList();
-
- osl::Mutex m_aMutex;
- std::list< rtl::Reference<TreeManager> > m_aListeners;
- };
-// ---------------------------------------------------------------------------
- } // namespace backend
-
-// ---------------------------------------------------------------------------
-} // namespace configmgr
-
-#endif
-
diff --git a/configmgr/source/treecache/cachewritescheduler.cxx b/configmgr/source/treecache/cachewritescheduler.cxx
deleted file mode 100644
index 0762f030dd..0000000000
--- a/configmgr/source/treecache/cachewritescheduler.cxx
+++ /dev/null
@@ -1,213 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <stdio.h>
-
-#include "cachewritescheduler.hxx"
-#include "cachecontroller.hxx"
-#include "tracer.hxx"
-
-
-namespace configmgr
-{
-// =========================================================================
-OCacheWriteScheduler::~OCacheWriteScheduler()
-{
- stopAndWriteCache();// last chance - violates precond
-}
-
-void OCacheWriteScheduler::stopAndWriteCache()
-{
- OSL_ASSERT(UnoApiLock::isHeld());
- CFG_TRACE_INFO("Cancelling all cache writings, Stopping timer");
-
- if (m_xTimer.isValid())
- m_xTimer->dispose(); // just to be sure
-
- runWriter();
-
- m_aWriteList.clear();
-}
-
-// -------------------------------------------------------------------------
-void OCacheWriteScheduler::Timer::onShot()
-{
- UnoApiLock aLock;
-
- if (pParent)
- pParent->onTimerShot();
- else
- CFG_TRACE_WARNING("Timer shot for disposed cache writer");
-}
-
-// -----------------------------------------------------------------------------
-void OCacheWriteScheduler::onTimerShot()
-{
- //m_aTimer.stop();
-
- CFG_TRACE_INFO("Write Timer invoked - executing write task");
-
- try
- {
- runWriter();
- CFG_TRACE_INFO_NI("Write timer: writing ended");
- }
- catch (...)
- {
- CFG_TRACE_ERROR_NI("Write timer: writing failed with an unknown exception");
- OSL_ENSURE(false, "ERROR: Unknown Exception left a writer");
- }
-
- TimeStamp aNewTime = implGetScheduleTime(TimeStamp::getCurrentTime(), m_aWriteInterval);
-
- implStartBefore(aNewTime);
-}
-// -------------------------------------------------------------------------
-void OCacheWriteScheduler::runWriter()
-{
- // Write Cache
- OSL_ASSERT(UnoApiLock::isHeld());
- CFG_TRACE_INFO("Running write operations");
-
- CacheWriteList aPendingWrites;
- m_aWriteList.swap(aPendingWrites);
-
- CFG_TRACE_INFO_NI("Found %d sections to write", int(aPendingWrites.size()));
- for (CacheWriteList::iterator it = aPendingWrites.begin();
- it != aPendingWrites.end();
- ++it)
- {
- RequestOptions aTaskOption = *it;
- try
- {
- writeOneTreeFoundByOption(aTaskOption);
- }
- catch (uno::Exception& e)
- {
- (void)e;
- CFG_TRACE_ERROR_NI("TreeCacheWriteScheduler: Attempt to write data failed - error is '%s' (currently ignored)",OUSTRING2ASCII(e.Message));
- }
- }
- // m_aWriteList.clear();
- CFG_TRACE_INFO_NI("DONE: Running write operations");
-}
-
-// -----------------------------------------------------------------------------
-void OCacheWriteScheduler::writeOneTreeFoundByOption(RequestOptions const& _aOptions) SAL_THROW((com::sun::star::uno::Exception))
-{
- CFG_TRACE_INFO("Writeing one cache tree for user '%s' with locale '%s'",
- OUSTRING2ASCII(_aOptions.getEntity()),
- OUSTRING2ASCII(_aOptions.getLocale()));
-
- rtl::Reference<CacheLoadingAccess> aCache;
- aCache = m_rTreeManager.m_aCacheMap.get(_aOptions);
-
- if (aCache.is())
- {
- CFG_TRACE_INFO_NI("- Found matching data container - starting write task");
- if (!m_rTreeManager.saveAllPendingChanges(aCache,_aOptions))
- {
- m_aWriteList.insert(_aOptions);
-
- CFG_TRACE_INFO_NI("- Write task incomplete -reregistering");
- }
- // we got a pending list with pointers from TreeInfo.
- }
- else
- {
- CFG_TRACE_WARNING_NI("- Data container (TreeInfo) to write not found: Ignoring task");
- }
-
- CFG_TRACE_INFO_NI("Removing written cache tree (for user '%s' with locale '%s')",
- OUSTRING2ASCII(_aOptions.getEntity()),
- OUSTRING2ASCII(_aOptions.getLocale()));
-}
-
-// -----------------------------------------------------------------------------
-bool OCacheWriteScheduler::clearTasks(RequestOptions const& _aOptions)
-{
- // sadly list::remove doesn't return an indication of what it did
- bool bFound = m_aWriteList.erase(_aOptions) !=0;
- if (bFound)
- {
- CFG_TRACE_INFO("Write Scheduler: Dropped cache tree (for user '%s' with locale '%s') from task list",
- OUSTRING2ASCII(_aOptions.getEntity()),
- OUSTRING2ASCII(_aOptions.getLocale()));
- }
-
- return bFound;
-}
-
-// -----------------------------------------------------------------------------
-// should be called guarded only
-void OCacheWriteScheduler::implStartBefore(TimeStamp const& _aTime)
-{
- CFG_TRACE_INFO("Triggering write timer");
- // check if we were cleared
- if (!m_aWriteList.empty())
- {
- if (!m_xTimer->isTicking())
- {
- m_xTimer->setAbsoluteTime(_aTime.getTimeValue());
-
- if (!m_xTimer->isTicking())
- m_xTimer->start();
-
- OSL_ASSERT( m_xTimer->isTicking() );
- }
- CFG_TRACE_INFO_NI("- Write timer running - next execution in %d seconds", int (m_xTimer->getRemainingTime().Seconds) );
- CFG_TRACE_INFO_NI("- %d write tasks are pending", int(m_aWriteList.size()) );
- }
- else
- {
- m_xTimer->stop();
- CFG_TRACE_INFO_NI("- Stopped timer - no more open write tasks");
- }
-}
-
-// -----------------------------------------------------------------------------
-void OCacheWriteScheduler::scheduleWrite(backend::ComponentRequest _aComponent) SAL_THROW((com::sun::star::uno::Exception))
-{
- OSL_ENSURE(_aComponent.getOptions().hasLocale(), "ERROR: OTreeDisposeScheduler: cannot handle complete user scheduling");
-
- CFG_TRACE_INFO("Scheduling cache write for user '%s' with locale '%s'",
- OUSTRING2ASCII(_aComponent.getOptions().getEntity()),
- OUSTRING2ASCII(_aComponent.getOptions().getLocale()));
-
- // lasy writing
- m_aWriteList.insert(_aComponent.getOptions());
-
- TimeStamp aNewTime = implGetScheduleTime(TimeStamp::getCurrentTime(), m_aWriteInterval);
- implStartBefore(aNewTime);
-}
-
-// -----------------------------------------------------------------------------
-} // namespace
-
diff --git a/configmgr/source/treecache/cachewritescheduler.hxx b/configmgr/source/treecache/cachewritescheduler.hxx
deleted file mode 100644
index 44f2632af6..0000000000
--- a/configmgr/source/treecache/cachewritescheduler.hxx
+++ /dev/null
@@ -1,125 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CACHEWRITESCHEDULER_HXX
-#define CONFIGMGR_CACHEWRITESCHEDULER_HXX
-
-#include "datalock.hxx"
-#include "requestoptions.hxx"
-#include "timestamp.hxx"
-#include "utility.hxx"
-
-#ifndef INCLUDED_SET
-#include <set>
-#define INCLUDED_SET
-#endif
-#include <vos/timer.hxx>
-#ifndef _VOS_REF_HXX_
-#include <vos/ref.hxx>
-
-#endif
-#include <osl/mutex.hxx>
-
-// -----------------------------------------------------------------------------
-namespace configmgr
-{
- class RequestOptions;
- namespace backend { class ComponentRequest; class CacheController; }
-
- // Write down the Cache, much less complex than caching Nodes
- // (better control)
- class OCacheWriteScheduler
- {
- typedef std::set< RequestOptions, lessRequestOptions > CacheWriteList; // fire and forget!
-
- class Timer : public vos::OTimer
- {
- public:
- OCacheWriteScheduler* pParent;
-
- Timer(OCacheWriteScheduler& _rParent) : pParent(&_rParent) {};
-
- // vos::OTimer
- virtual void SAL_CALL onShot();
-
- // stop the scheduling
- void dispose() {
- stop();
- pParent = NULL;
- }
-
- };
- friend void Timer::onShot();
- private:
- vos::ORef<Timer> m_xTimer;
- backend::CacheController &m_rTreeManager;
- CacheWriteList m_aWriteList;
- TimeInterval m_aWriteInterval;
-
- public:
- //-------- Construction and destruction -----------------------------------
- explicit
- OCacheWriteScheduler(backend::CacheController& _rTreeManager, TimeInterval const& _aWriteInterval)
- : m_rTreeManager(_rTreeManager)
- , m_aWriteInterval(_aWriteInterval)
- {
- m_xTimer = new Timer(*this);
- }
- ~OCacheWriteScheduler();
-
- //-------- Delay and Interval ---------------------------------------------
- /// retrieves the recurrance interval used for cleanup
- TimeInterval const& getWriteInterval() const
- {
- UnoApiLock aLock;
- return m_aWriteInterval;
- }
-
- static TimeStamp implGetScheduleTime(TimeStamp const& aBaseTime, TimeInterval const& aDelay)
- {
- return aBaseTime + aDelay;
- }
- //-------- Control of execution ------------------------------------------
- void scheduleWrite(backend::ComponentRequest _aComponent) SAL_THROW((com::sun::star::uno::Exception));
-
- /// stop pending activities for one set of options (do not discard them)
- bool clearTasks(RequestOptions const& _xOptions);
-
- /// stop and discard pending activities
- void stopAndWriteCache();
- private:
- // vos::OTimer
- void onTimerShot();
-
- void runWriter();
- void implStartBefore(TimeStamp const& _aTime);
- void writeOneTreeFoundByOption(RequestOptions const& _aOption) SAL_THROW((com::sun::star::uno::Exception));
- };
-} // namespace configmgr
-
-#endif // CONFIGMGR_DISPOSETIMER_HXX
-
diff --git a/configmgr/source/treecache/disposetimer.cxx b/configmgr/source/treecache/disposetimer.cxx
deleted file mode 100644
index 1259aa70e6..0000000000
--- a/configmgr/source/treecache/disposetimer.cxx
+++ /dev/null
@@ -1,302 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "datalock.hxx"
-#include "disposetimer.hxx"
-#include "cachecontroller.hxx"
-#include "configexcept.hxx"
-#include "tracer.hxx"
-#include <osl/diagnose.h>
-
-
-namespace configmgr
-{
-//==========================================================================
-//=
-//==========================================================================
-
-
-void OTreeDisposeScheduler::scheduleCleanup(RequestOptions const& _aOptions)
-{
- OSL_ENSURE(_aOptions.hasLocale(), "ERROR: OTreeDisposeScheduler: cannot handle complete user scheduling");
-
- CFG_TRACE_INFO("Scheduling data cleanup for user '%s' with locale '%s'",
- OUSTRING2ASCII(_aOptions.getEntity()),
- OUSTRING2ASCII(_aOptions.getLocale()));
-
- CFG_TRACE_INFO_NI("- Cleanup will be started in about %d seconds", int(m_aCleanupDelay.getTimeValue().Seconds));
-
- TimeStamp aNewTime = implGetCleanupTime(TimeStamp::getCurrentTime(), m_aCleanupDelay);
- OSL_ASSERT(!aNewTime.isNever());
-
- TimeStamp aScheduleTime = implAddTask(_aOptions, aNewTime);
-
- OSL_ASSERT(aScheduleTime <= aNewTime);
- OSL_ASSERT(!aScheduleTime.isNever());
-
- implStartBefore(aNewTime);
-}
-// -------------------------------------------------------------------------
-
-static
-inline
-bool equivalentOptions(RequestOptions const& lhs, RequestOptions const& rhs)
-{
- lessRequestOptions lessThan;
- return ! (lessThan(lhs,rhs) || lessThan(rhs,lhs));
-}
-// -------------------------------------------------------------------------
-
-void OTreeDisposeScheduler::stopAndClearTasks()
-{
- CFG_TRACE_INFO("Cancelling all data cleanup tasks, Stopping Cleanup timer");
- CFG_TRACE_INFO_NI("- %d cleanup tasks were pending", int(m_aAgenda.size()) );
-
- if (m_xTimer.isValid())
- m_xTimer->dispose(); // just to be sure
-
- m_aAgenda.clear();
-}
-// -------------------------------------------------------------------------
-
-std::pair<bool,RequestOptions> OTreeDisposeScheduler::getTask(TimeStamp const& _aActualTime, TimeStamp& _rNextTime)
-{
- OSL_ASSERT( _rNextTime.isNever() ); // internal contract, we set this only in the positive case
-
- std::pair<bool,RequestOptions> aTask( false, RequestOptions() );
-
- if (!m_aAgenda.empty())
- {
- Agenda::iterator const it = m_aAgenda.begin();
-
- if (it->first <= _aActualTime)
- {
- aTask = std::make_pair(true,it->second);
- m_aAgenda.erase(it);
- }
- }
-
- if (!m_aAgenda.empty())
- {
- Agenda::iterator const it = m_aAgenda.begin();
-
- _rNextTime = it->first;
- }
-
- return aTask;
-}
-// -------------------------------------------------------------------------
-
-void OTreeDisposeScheduler::Timer::onShot()
-{
- UnoApiLock aLock;
- if (pParent)
- pParent->onTimerShot();
-}
-// -------------------------------------------------------------------------
-
-void OTreeDisposeScheduler::onTimerShot()
-{
- CFG_TRACE_INFO("Cleanup Timer invoked - executing dispose task");
-
- TimeStamp aActualTime = TimeStamp::getCurrentTime();
- TimeStamp aNextTime = implGetCleanupTime(aActualTime, getCleanupInterval());
-
- try
- {
- TimeStamp aNextDisposeTime = runDisposer(aActualTime);
-
- if (aNextTime < aNextDisposeTime)
- aNextTime = aNextDisposeTime;
- }
-
- catch (uno::Exception& )
- {
- OSL_ENSURE(false, "ERROR: UNO Exception left a disposer");
- }
- catch (configuration::Exception& )
- {
- OSL_ENSURE(false, "ERROR: configuration::Exception left a disposer");
- }
- catch (...)
- {
- OSL_ENSURE(false, "ERROR: Unknown Exception left a disposer");
- }
-
- OSL_ASSERT(UnoApiLock::isHeld());
- implStartBefore(aNextTime);
-}
-// -------------------------------------------------------------------------
-
-// this really should be a member of the TreeManager (see TreeManager::disposeOne etc.)
-TimeStamp OTreeDisposeScheduler::runDisposer(TimeStamp const& _aActualTime)
-{
- TimeStamp aNextTime = TimeStamp::never();
- OSL_ASSERT(aNextTime.isNever());
-
- OSL_ASSERT(UnoApiLock::isHeld());
-
- std::pair<bool,RequestOptions> aTask = this->getTask( _aActualTime, aNextTime );
- if (aTask.first)
- {
- RequestOptions & rTaskOptions = aTask.second;
-
- CFG_TRACE_INFO("Found cleanup task for user %s and locale %s",
- OUSTRING2ASCII(rTaskOptions.getEntity()),
- OUSTRING2ASCII(rTaskOptions.getLocale()));
-
- rtl::Reference<CacheLoadingAccess> aCache = m_rTreeManager.m_aCacheMap.get(rTaskOptions);
- if (aCache.is())
- {
- CFG_TRACE_INFO_NI("- Found matching data container (TreeInfo) - collecting data");
-
- std::vector< rtl::Reference<CacheLine> > aDisposeList;
-
- TimeStamp aNextTaskTime = aCache->collectDisposeList(aDisposeList, _aActualTime, m_aCleanupDelay);
-
- CFG_TRACE_INFO_NI("- Found %d module trees to dispose", int(aDisposeList.size()) );
-
- if (!aNextTaskTime.isNever())
- {
- OSL_ENSURE( !aCache->isEmpty(), "ERROR: Empty TreeInfo returning finite dispose time");
-
- // repost with new time
- OSL_ASSERT(UnoApiLock::isHeld());
-
- CFG_TRACE_INFO_NI("- Rescheduling current option set" );
-
- aNextTime = this->implAddTask(rTaskOptions,aNextTaskTime);
- }
-
- else if (aCache->isEmpty())// may have been the last one - check that
- {
- // currently it is not possible to release options which are
- // because it is not save to delete the info if another thread is running in
- // a read request
- }
- else
- CFG_TRACE_INFO_NI("- Currently no more cleanup tasks for this options set" );
-
- if (!aDisposeList.empty())
- {
- CFG_TRACE_INFO_NI("- Closing %d modules", int(aDisposeList.size()) );
- m_rTreeManager.closeModules(aDisposeList,rTaskOptions);
- }
- else
- CFG_TRACE_INFO_NI("- No modules trees to dispose");
- }
- else
- CFG_TRACE_INFO_NI("- No matching data container (TreeInfo) found - task is obsolete");
- }
- else
- CFG_TRACE_INFO("No eligible task found - may reschedule");
-
- return aNextTime;
-}
-// -------------------------------------------------------------------------
-
-static inline
-TimeStamp getExpirationTime( vos::OTimer const& aTimer )
-{
- OSL_ENSURE(aTimer.isTicking(), "Timer is already expired !");
-
- // note: order ensures that result time may be earlier, but not later
- TimeStamp const now ( TimeStamp::getCurrentTime() );
- TimeInterval const left( aTimer.getRemainingTime() );
- TimeStamp const expires = now + left;
-
- return expires;
-}
-
-// -------------------------------------------------------------------------
-
-#if OSL_DEBUG_LEVEL > 0
-static
-void checkTimerStarted( vos::OTimer const& aTimer, TimeStamp const& _aLimit)
-{
- const TimeInterval tolerance( vos::TTimeValue(1) ); // milliseconds
- if (aTimer.isTicking())
- {
- TimeStamp const expires = getExpirationTime(aTimer);
- TimeStamp const limit = _aLimit + tolerance;
-
- OSL_ENSURE(expires <= limit, "Timer does not expire within expected time (tolerance 1 ms) !");
- // OSL_ENSURE(expires <= _aLimit, "Timer does not expire within expected time !");
- OSL_ENSURE(aTimer.isTicking(), "Timer just started already expired ?!");
- }
- else
- {
- OSL_ENSURE(false, "Timer just started is not ticking ?!");
- }
-}
-#endif
-
-// -------------------------------------------------------------------------
-// should be called guarded only
-void OTreeDisposeScheduler::implStartBefore(TimeStamp const& _aTime)
-{
- // check if we were cleared
- if (!m_aAgenda.empty() && !_aTime.isNever())
- {
- if (!m_xTimer->isTicking() || _aTime < getExpirationTime(*m_xTimer))
- {
- m_xTimer->setAbsoluteTime(_aTime.getTimeValue());
-
- if (!m_xTimer->isTicking()) m_xTimer->start();
-
- OSL_DEBUG_ONLY( checkTimerStarted(*m_xTimer,_aTime) );
- }
- CFG_TRACE_INFO_NI("- Cleanup timer running - next execution in %d seconds", int (m_xTimer->getRemainingTime().Seconds) );
- CFG_TRACE_INFO_NI("- %d cleanup tasks are pending", int(m_aAgenda.size()) );
- }
- else
- {
- m_xTimer->stop();
- CFG_TRACE_INFO_NI("- Stopped timer - no more open cleanup tasks");
- }
-}
-// -------------------------------------------------------------------------
-
-TimeStamp OTreeDisposeScheduler::implAddTask(RequestOptions const& _aOptions, TimeStamp const& _aTime)
-{
- OSL_ASSERT(UnoApiLock::isHeld());
-
- // try to insert after euivalent entries (but STL may ignore the hint)
- Agenda::iterator where = m_aAgenda.upper_bound(_aTime);
-
- m_aAgenda.insert(where, Agenda::value_type(_aTime,_aOptions));
-
- OSL_ASSERT(!m_aAgenda.empty());
-
- return m_aAgenda.begin()->first;
-}
-// -------------------------------------------------------------------------
-
-} // namespace
diff --git a/configmgr/source/treecache/disposetimer.hxx b/configmgr/source/treecache/disposetimer.hxx
deleted file mode 100644
index 8f36264ddc..0000000000
--- a/configmgr/source/treecache/disposetimer.hxx
+++ /dev/null
@@ -1,169 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_DISPOSETIMER_HXX
-#define CONFIGMGR_DISPOSETIMER_HXX
-
-#include "timestamp.hxx"
-#include "requestoptions.hxx"
-#include <osl/mutex.hxx>
-#include <vos/timer.hxx>
-#include <vos/ref.hxx>
-#include <com/sun/star/lang/WrappedTargetException.hpp>
-#include <com/sun/star/uno/RuntimeException.hpp>
-
-#ifndef INCLUDED_UTILITY
-#include <utility>
-#define INCLUDED_UTILITY
-#endif
-#ifndef INCLUDED_MAP
-#include <map>
-#define INCLUDED_MAP
-#endif
-
-namespace uno = ::com::sun::star::uno;
-namespace lang = ::com::sun::star::lang;
-
-namespace configmgr
-{
- namespace backend { class CacheController; }
-////////////////////////////////////////////////////////////////////////////////
-/* OTreeDisposeScheduler:
- does something special????
-*/
-
- class OTreeDisposeScheduler
- {
- typedef std::multimap< TimeStamp, RequestOptions, ltTimeStamp > Agenda;
-
- class Timer : public vos::OTimer
- {
- public:
- OTreeDisposeScheduler* pParent;
-
- Timer(OTreeDisposeScheduler& _rParent) : pParent(&_rParent) {};
-
- // vos::OTimer
- virtual void SAL_CALL onShot();
-
- // stop the scheduling
- void dispose() {stop(); pParent = NULL;}
- };
- friend void Timer::onShot();
-
- private:
- Agenda m_aAgenda;
- vos::ORef<Timer> m_xTimer;
- backend::CacheController& m_rTreeManager;
-
- TimeInterval m_aCleanupDelay;
- TimeInterval m_aCleanupInterval;
- public:
- //-------- Construction and destruction -----------------------------------
- explicit
- OTreeDisposeScheduler(backend::CacheController& _rTreeManager, TimeInterval const& _aCleanupDelay)
- : m_rTreeManager(_rTreeManager)
- , m_aCleanupDelay(_aCleanupDelay)
- , m_aCleanupInterval(_aCleanupDelay)
- {
- m_xTimer = new Timer(*this);
- }
-
- explicit
- OTreeDisposeScheduler(backend::CacheController& _rTreeManager, TimeInterval const& _aCleanupDelay, TimeInterval const& _aCleanupInterval)
- : m_rTreeManager(_rTreeManager)
- , m_aCleanupDelay(_aCleanupDelay)
- , m_aCleanupInterval(_aCleanupInterval)
- {
- m_xTimer = new Timer(*this);
- }
-
- ~OTreeDisposeScheduler() { stopAndClearTasks(); }
-
- //-------- Delay and Interval ---------------------------------------------
- /// sets the initial delay to be used for cleanup in the future, does not affect an already started process
- void setCleanupDelay(TimeInterval const& _aCleanupDelay)
- {
- m_aCleanupDelay = _aCleanupDelay;
- }
-
- /// sets the initial delay and recurrance interval to be used for cleanup in the future, does not affect an already started process
- void setCleanupDelay(TimeInterval const& _aCleanupDelay, TimeInterval const& _aCleanupInterval)
- {
- m_aCleanupDelay = _aCleanupDelay;
- m_aCleanupInterval = _aCleanupInterval;
- }
-
- /// sets the recurrance interval to be used for cleanup in the future, does not affect an already started process
- void setCleanupInterval(TimeInterval const& _aCleanupInterval)
- {
- m_aCleanupInterval = _aCleanupInterval;
- }
-
- /// retrieves the initial delay used for cleanup
- TimeInterval const& getCleanupDelay() const
- {
- return m_aCleanupDelay;
- }
-
- /// retrieves the recurrance interval used for cleanup
- TimeInterval const& getCleanupInterval() const
- {
- return m_aCleanupInterval;
- }
-
- //-------- Control of execution ------------------------------------------
- /// ensure this will execute cleanup duties for _xOptions (no later than after getCleanupDelay() has elapsed)
- void scheduleCleanup(RequestOptions const & _aOptions);
-
- /// stop and discard pending activities
- void stopAndClearTasks();
-
- private:
- // vos::OTimer
- void onTimerShot();
-
- std::pair<bool,RequestOptions> getTask(TimeStamp const& _aActualTime, TimeStamp& _aNextTime);
-
- /// ensure this will execute cleanup duties for _xOptions (no later than after getCleanupDelay() has elapsed)
- // TimeStamp fillDisposeList(CacheLoadingAccess & _aCache, DisposeList& _rList, TimeStamp const& aLimitTime)
-
- TimeStamp runDisposer(TimeStamp const& _aActualTime);
- private:
- TimeStamp implAddTask(RequestOptions const& _xOptions, TimeStamp const& _aTime);
- void implStartBefore(TimeStamp const& _aTime);
-
- static TimeStamp implGetCleanupTime(TimeStamp const& aPostingTime, TimeInterval const& aDelay)
- { return aPostingTime + aDelay; }
- };
-
-
-////////////////////////////////////////////////////////////////////////////////
-} // namespace configmgr
-
-#endif // CONFIGMGR_DISPOSETIMER_HXX
-
diff --git a/configmgr/source/treecache/invalidatetree.cxx b/configmgr/source/treecache/invalidatetree.cxx
deleted file mode 100644
index 0e6e328bb2..0000000000
--- a/configmgr/source/treecache/invalidatetree.cxx
+++ /dev/null
@@ -1,173 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-
-#include "cachecontroller.hxx"
-#include "change.hxx"
-#include "valuenode.hxx"
-#include "updatehelper.hxx"
-#include "treeactions.hxx"
-#include "tracer.hxx"
-#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/container/NoSuchElementException.hpp>
-
-#ifndef INCLUDED_ALGORITHM
-#include <algorithm>
-#define INCLUDED_ALGORITHM
-#endif
-
-namespace configmgr
-{
-
- namespace container = com::sun::star::container;
-// -----------------------------------------------------------------------------
-// ------------------------------- invalidateTree -------------------------------
-// -----------------------------------------------------------------------------
-
-namespace backend
-{
-// -----------------------------------------------------------------------------
-std::auto_ptr<SubtreeChange> createDiffs(sharable::Node * cachedNode,
- ISubtree const * _pLoadedSubtree,
- configuration::AbsolutePath const& _aAbsoluteSubtreePath)
-{
- OSL_PRECOND(cachedNode != 0, "Need an existing node to create a diff");
- OSL_PRECOND(_pLoadedSubtree != 0, "Need a result node to create a diff");
- // Create a TreeChangeList with the right name, parentname and ConfigurationProperties
- std::auto_ptr<SubtreeChange> aNewChange(new SubtreeChange(_aAbsoluteSubtreePath.getLocalName().getName(),
- node::Attributes()) );
-
- if (!createUpdateFromDifference(*aNewChange, cachedNode, *_pLoadedSubtree))
- aNewChange.reset();
-
- return aNewChange;
-}
-// -----------------------------------------------------------------------------
-#if 0
-std::auto_ptr<ISubtree> TreeManager::loadNodeFromSession( configuration::AbsolutePath const& _aAbsoluteSubtreePath,
- const vos::ORef < OOptions >& _xOptions,
- sal_Int16 _nMinLevels) SAL_THROW((com::sun::star::uno::Exception))
-{
- TreeInfo* pInfo = this->requestTreeInfo(_xOptions,true /*create TreeInfo*/);
-
- CFG_TRACE_INFO_NI("cache manager: cache miss. going to load the node");
- rtl::Reference< OTreeLoader > xLoader = pInfo->getNewLoaderWithoutPending(_aAbsoluteSubtreePath, _nMinLevels, _xOptions, m_xBackend.get());
-
- OSL_ENSURE(xLoader.is(), "Did not receive a loader for retrieving the node");
- CFG_TRACE_INFO_NI("cache manager: cache miss. going to load the node");
- if (!xLoader.is())
- throw container::NoSuchElementException((::rtl::OUString::createFromAscii("Error while retrieving the node")), NULL);
-
- // now block for reading
- std::auto_ptr<ISubtree> pResponse;
- try
- {
- pResponse = xLoader->waitToResponse();
- }
- catch (uno::Exception& e)
- {
- pInfo->releaseLoader(xLoader);
- throw;
- }
-
- pInfo->releaseLoader(xLoader);
-
- return pResponse;
-}
-#endif
-// -----------------------------------------------------------------------------
-
-sharable::TreeFragment * CacheController::refreshComponent(ComponentRequest const & _aRequest) SAL_THROW((com::sun::star::uno::Exception))
-{
- if (m_bDisposing) return NULL;
-
- rtl::Reference<CacheLoadingAccess> aCache = this->getCacheAlways(_aRequest.getOptions());
-
- if (!aCache.is()) return NULL;
-
- // load the Node direct from the session, without using the cache
- ComponentRequest aForcedRequest(_aRequest);
- aForcedRequest.forceReload();
-
- ResultHolder< ComponentInstance > aLoadedInstance = this->getComponentData(aForcedRequest,false);
- configuration::AbsolutePath aRequestPath = configuration::AbsolutePath::makeModulePath(_aRequest.getComponentName());
- NodeInstance aNodeInstance(aLoadedInstance.mutableInstance().mutableData(),aRequestPath) ;
- ResultHolder< NodeInstance > aLoadedNodeInstance(aNodeInstance) ;
-
- sharable::TreeFragment * aResult = NULL;
- if (aLoadedNodeInstance.is())
- {
- rtl::OUString aModuleName = aLoadedNodeInstance->root().getModuleName();
-
- bool bAcquired = aCache->acquireModule(aModuleName);
- aResult = (sharable::TreeFragment *)( aCache->getTreeAddress(aModuleName) );
-
- if (bAcquired)
- try
- {
- std::auto_ptr<SubtreeChange> aTreeChanges;
- sharable::Node * aRootAddress;
-
- {
- sharable::Node * rootNode = aResult == 0 ? 0 : aResult->getRootNode();
-
- aTreeChanges = createDiffs(rootNode, aLoadedNodeInstance->data().get(), aLoadedNodeInstance->root());
- aRootAddress = rootNode;
- }
-
- if (aTreeChanges.get() != NULL)
- {
- // change all Values... found in the Subtree in the CacheTree
- applyUpdateWithAdjustmentToTree(*aTreeChanges, aRootAddress);
-
- UpdateRequest anUpdateReq( aTreeChanges.get(),
- aLoadedNodeInstance->root(),
- _aRequest.getOptions()
- );
-
- m_aNotifier.notifyChanged(anUpdateReq);
- }
- aCache->releaseModule(aModuleName);
- }
- catch (...)
- {
- aCache->releaseModule(aModuleName);
- throw;
- }
- }
- return aResult;
-}
-
-// -----------------------------------------------------------------------------
- } // namespace backend
-
-// -----------------------------------------------------------------------------
-} // namespace configmgr
-
diff --git a/configmgr/source/treecache/makefile.mk b/configmgr/source/treecache/makefile.mk
deleted file mode 100644
index 718ee5ca4e..0000000000
--- a/configmgr/source/treecache/makefile.mk
+++ /dev/null
@@ -1,58 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJINC=$(PRJ)$/source
-PRJNAME=configmgr
-TARGET=treecache
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings ----------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/makefile.pmk
-
-# --- Files -------------------------------------
-
-SLOFILES= \
- $(SLO)$/timestamp.obj \
- $(SLO)$/disposetimer.obj \
- $(SLO)$/cachewritescheduler.obj \
- $(SLO)$/invalidatetree.obj \
- $(SLO)$/cachefactory.obj \
- $(SLO)$/cacheaccess.obj \
- $(SLO)$/cachedata.obj \
- $(SLO)$/cacheline.obj \
- $(SLO)$/cachemulticaster.obj \
- $(SLO)$/cachecontroller.obj \
- $(SLO)$/treemanager.obj \
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/configmgr/source/treecache/timestamp.cxx b/configmgr/source/treecache/timestamp.cxx
deleted file mode 100644
index 6a33de732a..0000000000
--- a/configmgr/source/treecache/timestamp.cxx
+++ /dev/null
@@ -1,60 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <stdio.h>
-
-#include "timestamp.hxx"
-#include <osl/diagnose.h>
-
-namespace configmgr
-{
- const sal_uInt32 maxTimeValueSeconds = 0xFF000000ul; // catches accidetally added values as well
- const sal_uInt32 maxTimeValueNanos = 999999999ul;
- const sal_uInt32 minTimeValueSeconds = 0ul;
- const sal_uInt32 minTimeValueNanos = 0ul;
-// -------------------------------------------------------------------------
- TimeStamp TimeStamp::never()
- {
- const ::TimeValue maxTimeValue = { maxTimeValueSeconds, maxTimeValueNanos };
-
- return TimeStamp( maxTimeValue );
- }
-// -------------------------------------------------------------------------
- TimeStamp TimeStamp::getCurrentTime()
- {
- TimeStamp aResult;
- if (! ::osl_getSystemTime( &aResult.m_aTime ) )
- return never();
- return aResult;
- }
-// -------------------------------------------------------------------------
-} // namespace configmgr
-
-
diff --git a/configmgr/source/treecache/timestamp.hxx b/configmgr/source/treecache/timestamp.hxx
deleted file mode 100644
index e8bc0c2d32..0000000000
--- a/configmgr/source/treecache/timestamp.hxx
+++ /dev/null
@@ -1,125 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_TIMESTAMP_HXX
-#define CONFIGMGR_TIMESTAMP_HXX
-
-#include <vos/timer.hxx>
-
-namespace configmgr
-{
-////////////////////////////////////////////////////////////////////////////////
-
- class TimeInterval
- {
- vos::TTimeValue m_aTime;
- public:
- TimeInterval() : m_aTime()
- {}
-
- explicit
- TimeInterval(sal_uInt32 nSeconds) : m_aTime(nSeconds,0)
- {}
-
- explicit
- TimeInterval(const TimeValue& rTimeValue) : m_aTime(rTimeValue)
- {}
-
- sal_Bool isEmpty() const { return m_aTime.isEmpty(); }
-
- vos::TTimeValue const& getTimeValue() const { return m_aTime; }
- };
-////////////////////////////////////////////////////////////////////////////////
-
- class TimeStamp
- {
- vos::TTimeValue m_aTime;
- public:
- TimeStamp() : m_aTime()
- {}
-
- explicit
- TimeStamp(TimeValue const& rTimeValue) : m_aTime(rTimeValue)
- {}
-
- TimeStamp& operator += (TimeInterval const& aInterval)
- { m_aTime.addTime(aInterval.getTimeValue()); return *this; }
-
- vos::TTimeValue const& getTimeValue() const { return m_aTime; }
-
- sal_Bool isNever() const;
-
- static TimeStamp getCurrentTime();
- static TimeStamp never(); // is later than (>) any other TimeStamp
- };
-
- inline
- TimeStamp operator +(TimeStamp const& aTime, TimeInterval const& aInterval)
- {
- TimeStamp aResult(aTime);
- aResult += aInterval;
- return aResult;
- }
- inline
- TimeStamp operator +(TimeInterval const& aInterval, TimeStamp const& aTime)
- {
- TimeStamp aResult(aTime);
- aResult += aInterval;
- return aResult;
- }
-////////////////////////////////////////////////////////////////////////////////
- inline sal_Bool operator ==(TimeStamp const& lhs, TimeStamp const& rhs)
- { return lhs.getTimeValue() == rhs.getTimeValue(); }
- inline sal_Bool operator < (TimeStamp const& lhs, TimeStamp const& rhs)
- { return lhs.getTimeValue() < rhs.getTimeValue(); }
- inline sal_Bool operator > (TimeStamp const& lhs, TimeStamp const& rhs)
- { return lhs.getTimeValue() > rhs.getTimeValue(); }
-
- inline sal_Bool operator !=(TimeStamp const& lhs, TimeStamp const& rhs)
- { return !(lhs == rhs); }
- inline sal_Bool operator <=(TimeStamp const& lhs, TimeStamp const& rhs)
- { return !(rhs < lhs); }
- inline sal_Bool operator >=(TimeStamp const& lhs, TimeStamp const& rhs)
- { return !(lhs < rhs); }
-
- inline sal_Bool TimeStamp::isNever() const
- {
- return never() <= *this;
- }
-////////////////////////////////////////////////////////////////////////////////
-
- struct ltTimeStamp //: std::binary_function<TimeStamp,TimeStamp,bool>
- {
- bool operator()(TimeStamp const& lhs, TimeStamp const& rhs) const
- { return !!(lhs < rhs); }
- };
-
-////////////////////////////////////////////////////////////////////////////////
-} // namespace configmgr
-
-#endif // CONFIGMGR_TIMESTAMP_HXX
-
diff --git a/configmgr/source/treecache/treemanager.cxx b/configmgr/source/treecache/treemanager.cxx
deleted file mode 100644
index e9a9bd6c82..0000000000
--- a/configmgr/source/treecache/treemanager.cxx
+++ /dev/null
@@ -1,512 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "treemanager.hxx"
-#include "mergeddataprovider.hxx"
-#include "cacheaccess.hxx"
-#include "cachecontroller.hxx"
-#include "cachemulticaster.hxx"
-#include <com/sun/star/container/NoSuchElementException.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include "tracer.hxx"
-#include <osl/diagnose.h>
-#include <rtl/logfile.hxx>
-
-namespace configmgr
-{
-
- namespace uno = ::com::sun::star::uno;
- namespace lang= ::com::sun::star::lang;
-
- namespace Path = configuration::Path;
-// =========================================================================
-//#if OSL_DEBUG_LEVEL > 0
-#if 0 // currently not used in debug build!
-static void test_complete(memory::HeapManager & _rDummy)
-{ new TreeManager(NULL,_rDummy); }
-#endif
-// =========================================================================
-
-#define MAKEUSTRING( char_array ) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( char_array ) )
-// =========================================================================
-
-static inline
-configuration::AbsolutePath extractModulePath(configuration::AbsolutePath const & _aPath)
-{
- if (_aPath.getDepth() <= 1) return _aPath;
-
- rtl::OUString aModule = _aPath.getModuleName();
-
- return configuration::AbsolutePath::makeModulePath(aModule);
-}
-// =========================================================================
-
-// disposing
-// -------------------------------------------------------------------------
-void TreeManager::disposeAll()
-{
- CFG_TRACE_INFO("TreeManager: Disposing all data" );
- CacheList::Map aReleaseList;
-
- m_aCacheList.swap(aReleaseList); // move data out of m_aCacheList
-
- // free all the trees - not exception safe !! (i.e. disposeBroadcastHelper() must not throw)
- for (CacheList::Map::iterator i = aReleaseList.begin(); i != aReleaseList.end(); ++i)
- {
- if (ConfigChangeBroadcastHelper * pHelper = i->second->releaseBroadcaster())
- disposeBroadcastHelper(pHelper);
- i->second.clear();
- }
-}
-
-// -------------------------------------------------------------------------
-void TreeManager::dispose()
-{
- CFG_TRACE_INFO("TreeManager: dispoing the treemanager" );
-
- RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::TreeManager", "jb99855", "configmgr: TreeManager::dispose().");
-
- rtl::Reference< backend::CacheController > xBackendCache = maybeGetBackendCache();
-
- if (xBackendCache.is()) xBackendCache->getNotifier().removeListener(this);
-
- // cleaning the cache
- disposeAll();
-
- disposeBackendCache();
-}
-
-// -------------------------------------------------------------------------
-ConfigChangeBroadcastHelper* TreeManager::getBroadcastHelper(RequestOptions const& _aOptions, bool bCreate)
-{
- rtl::Reference<CacheClientAccess> aCache = bCreate ? this->getCacheAlways(_aOptions)
- : m_aCacheList.get(_aOptions);
-
- return aCache.is() ? aCache->getBroadcaster() : NULL;
-}
-
-
-// -------------------------------------------------------------------------
-TreeManager::TreeManager(rtl::Reference< backend::CacheController > const & _xBackend)
-: m_xCacheController(_xBackend)
-, m_aCacheList()
-, m_aTemplates(new CacheData())
-, m_bEnableAsync(true)
-{
- OSL_PRECOND(_xBackend.is(),"Trying to create a TreeManager without a backend");
-
- if (m_xCacheController.is()) m_xCacheController->getNotifier().addListener(this);
-}
-
-// -------------------------------------------------------------------------
-TreeManager::~TreeManager()
-{
-}
-
-// -------------------------------------------------------------------------
-rtl::Reference< backend::CacheController > TreeManager::maybeGetBackendCache() SAL_THROW(())
-{
- osl::MutexGuard aGuard(m_aCacheControllerMutex);
- rtl::Reference< backend::CacheController > xResult(m_xCacheController);
- return xResult;
-}
-
-// -------------------------------------------------------------------------
-rtl::Reference< backend::CacheController > TreeManager::getCacheLoader() SAL_THROW((com::sun::star::uno::RuntimeException))
-{
- osl::MutexGuard aGuard(m_aCacheControllerMutex);
- if (!m_xCacheController.is())
- {
- rtl::OUString sMsg = rtl::OUString::createFromAscii("TreeManager: No backend available - tree manager was already disposed.");
- throw com::sun::star::lang::DisposedException(sMsg,NULL);
- }
- rtl::Reference< backend::CacheController > xResult(m_xCacheController);
- return xResult;
-}
-
-// -------------------------------------------------------------------------
-void TreeManager::disposeBackendCache() SAL_THROW(())
-{
- osl::ClearableMutexGuard aGuard(m_aCacheControllerMutex);
- if (m_xCacheController.is())
- {
- rtl::Reference< backend::CacheController > xBackendCache(m_xCacheController);
- m_xCacheController.clear();
- aGuard.clear();
- xBackendCache->dispose();
- }
-}
-
-// -------------------------------------------------------------------------
-
-rtl::Reference<CacheClientAccess> TreeManager::getCacheAlways(RequestOptions const & _aOptions)
-{
- rtl::Reference<CacheClientAccess> aResult = m_aCacheList.get(_aOptions);
- if (!aResult.is())
- {
- rtl::Reference<CacheClientAccess> aNewCache( new CacheClientAccess(new ConfigChangeBroadcastHelper()) );
- aResult = m_aCacheList.insert(_aOptions,aNewCache);
- }
- return aResult;
-}
-
-// -------------------------------------------------------------------------
-
-sharable::Node * TreeManager::requestSubtree(configuration::AbsolutePath const& aSubtreePath,
- const RequestOptions& _aOptions)
- SAL_THROW((com::sun::star::uno::Exception))
-{
- CFG_TRACE_INFO("TreeManager: request for subtree '%s'", OUSTRING2ASCII(aSubtreePath.toString()));
-
- rtl::Reference<CacheClientAccess> aCache = getCacheAlways(_aOptions);
- OSL_ENSURE(aCache.is(),"TreeManager: Cannot create cache access for loading node");
-
- if (!aCache->hasModule(aSubtreePath))
- {
- CFG_TRACE_INFO_NI("TreeManager: cache miss. going to load the node");
- backend::ComponentRequest aQuery( aSubtreePath.getModuleName(), _aOptions );
-
- sharable::TreeFragment * aLoadedLocation = getCacheLoader()->loadComponent(aQuery);
- if (aLoadedLocation == NULL)
- {
- CFG_TRACE_WARNING_NI("TreeManager: requested component not found");
- throw com::sun::star::container::
- NoSuchElementException( MAKEUSTRING("Requested component not found"), NULL);
- }
-
- CFG_TRACE_INFO_NI("TreeManager: attaching loaded cache segment ");
- aCache->attachModule(aLoadedLocation,aSubtreePath.getModuleName());
- }
- else
- {
- CFG_TRACE_INFO_NI("TreeManager: found node in cache");
- if (_aOptions.isRefreshEnabled())
- {
- backend::ComponentRequest aRequest( aSubtreePath.getModuleName(), _aOptions );
- getCacheLoader()->refreshComponent(aRequest);
- }
- }
-
- return aCache->acquireNode(aSubtreePath);
-}
-
-// -------------------------------------------------------------------------
-void TreeManager::fetchSubtree(configuration::AbsolutePath const& aSubtreePath, const RequestOptions& ) SAL_THROW(())
-{
- (void) aSubtreePath; // avoid warning about unused parameter
- CFG_TRACE_WARNING("TreeManager: Prefetching not implemented. (Request to prefetch component %s.", OUSTRING2ASCII(aSubtreePath.toString()));
-}
-
-// -------------------------------------------------------------------------
-sal_Bool TreeManager::fetchDefaultData( configuration::AbsolutePath const& aSubtreePath,
- const RequestOptions& _aOptions
- ) SAL_THROW((com::sun::star::uno::Exception))
-{
- CFG_TRACE_INFO("tree manager: checking the cache for defaults");
-
- rtl::Reference<CacheClientAccess> aCache = m_aCacheList.get(_aOptions);
-
- if (!aCache.is())
- {
- OSL_ENSURE(aCache.is(),"TreeManager: Cache access to fetch defaults for does not exist ! Where does the node access come from ?");
- return false;
- }
-
- if (aCache->hasModuleDefaults(aSubtreePath))
- {
- CFG_TRACE_INFO_NI("TreeManager: found default data in cache");
- return true;
- }
-
- configuration::AbsolutePath aRequestPath = extractModulePath(aSubtreePath);
-
- backend::NodeRequest aRequest(aRequestPath,_aOptions);
-
- backend::ResultHolder< backend::NodeInstance > aDefaults = getCacheLoader()->getDefaultData( aRequest );
-
- if (!aDefaults.is())
- {
- CFG_TRACE_INFO_NI("TreeManager: merging loaded defaults into cache");
- return aCache->insertDefaults(aDefaults.instance());
- }
- else
- {
- CFG_TRACE_WARNING_NI("TreeManager: cannot load defaults: no data available or not supported");
- return false;
- }
-}
-
-// -------------------------------------------------------------------------
-std::auto_ptr<ISubtree> TreeManager::requestDefaultData(configuration::AbsolutePath const& aSubtreePath,
- const RequestOptions& _aOptions
- ) SAL_THROW((com::sun::star::uno::Exception))
-{
- // to do: check cache for existing default data (?!)
- CFG_TRACE_INFO_NI("TreeManager: loading default data directly");
-
- backend::NodeRequest aRequest(aSubtreePath,_aOptions);
-
- backend::ResultHolder< backend::NodeInstance > aDefaults = getCacheLoader()->getDefaultData( aRequest );
-
- return aDefaults.extractDataAndClear();
-}
-
-// -------------------------------------------------------------------------
-configuration::AbsolutePath TreeManager::encodeTemplateLocation(const rtl::OUString& _rLogicalTemplateName, const rtl::OUString &_rModule)
-{
-// static const
-// configuration::Path::Component aTemplateRoot = configuration::Path::wrapSimpleName(rtl::OUString::createFromAscii("org.openoffice.Templates"));
-
- configuration::Path::Component aTemplateModule = configuration::Path::wrapSimpleName(_rModule);
- configuration::Path::Component aTemplateName = configuration::Path::wrapSimpleName(_rLogicalTemplateName);
-
- Path::Rep aResult(aTemplateName);
- aResult.prepend(aTemplateModule);
-// aResult.prepend(aTemplateRoot);
-
- return configuration::AbsolutePath(aResult);
-}
-
-// -------------------------------------------------------------------------
-sharable::TreeFragment * TreeManager::requestTemplate(rtl::OUString const& _rName,
- rtl::OUString const& _rModule) SAL_THROW((com::sun::star::uno::Exception))
-{
- OSL_ENSURE(_rName.getLength() != 0, "TreeManager::requestTemplate : invalid template name !");
-
- CFG_TRACE_INFO("TreeManager: going to get a template named %s", OUSTRING2ASCII(_rName));
-
- configuration::AbsolutePath aTemplateLocation = encodeTemplateLocation(_rName, _rModule);
- rtl::OUString aCacheModule = aTemplateLocation.getModuleName();
-
- if (!getTemplates().hasNode(aTemplateLocation))
- {
- CFG_TRACE_INFO_NI("TreeManager: cache miss. going to load the template");
- backend::TemplateRequest aQuery( _rName, _rModule );
-
- sharable::TreeFragment * aLoadedLocation = getCacheLoader()->loadTemplate(aQuery);
- if (aLoadedLocation == NULL)
- {
- CFG_TRACE_ERROR_NI("TreeManager: requested template module not found");
- throw com::sun::star::container::
- NoSuchElementException( MAKEUSTRING("Requested template module not found"), NULL);
- }
-
- CFG_TRACE_INFO_NI("TreeManager: attaching to loaded template module");
-
- getTemplates().attachModule(aLoadedLocation,aCacheModule);
-
- // create a client ref count on the template module
- getTemplates().acquireNode(aTemplateLocation);
- }
- else
- {
- CFG_TRACE_INFO_NI("TreeManager: template module found in cache");
- }
-
- sharable::TreeFragment * aTemplateAddr = getTemplates().getTemplateTree(aTemplateLocation);
- if (aTemplateAddr == NULL)
- {
- CFG_TRACE_ERROR_NI("TreeManager: template not found in module");
- throw com::sun::star::container::
- NoSuchElementException( MAKEUSTRING("Unknown template. Type description could not be found in the given module."), NULL);
- }
- return aTemplateAddr;
-}
-
-// -------------------------------------------------------------------------
-void TreeManager::saveAndNotifyUpdate(TreeChangeList const& aChangeTree) SAL_THROW((com::sun::star::uno::Exception))
-{
- {
- CFG_TRACE_INFO("TreeManager: committing an Update to the cache controller");
- RequestOptions aOptions = aChangeTree.getOptions();;
- //Modify RequestOptions - suppress async commit, if disabled
- if(!m_bEnableAsync)
- aOptions.enableAsync(false);
-
- backend::UpdateRequest anUpdate(
- & aChangeTree.root,
- aChangeTree.getRootNodePath(),
- aOptions);
-
- getCacheLoader()->saveAndNotify(anUpdate);
- CFG_TRACE_INFO_NI("TreeManager: committing done");
- }
-}
-
-// -----------------------------------------------------------------------------
-void TreeManager::updateTree(TreeChangeList& _aChanges) SAL_THROW((com::sun::star::uno::Exception))
-{
- CFG_TRACE_INFO("TreeManager: updating the cache from a changes list");
-
- backend::UpdateInstance anUpdate(&_aChanges.root,_aChanges.getRootNodePath());
-
- rtl::Reference<CacheClientAccess> aCache = m_aCacheList.get(_aChanges.getOptions());
-
- if (!aCache.is())
- {
- CFG_TRACE_ERROR_NI("TreeManager: Cache access to update into does not exist !");
- OSL_ENSURE(aCache.is(),"TreeManager: Cache access to update into does not exist ! Where does the update access come from ?");
- throw lang::DisposedException(rtl::OUString::createFromAscii("Tree to be updated was already disposed"), NULL);
- }
-
- // merge the changes into the tree
- aCache->applyUpdate(anUpdate);
-
- CFG_TRACE_INFO_NI("TreeManager: cache update done");
-}
-
-// -----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-void TreeManager::releaseSubtree( configuration::AbsolutePath const& aSubtreePath, const RequestOptions& _aOptions ) SAL_THROW(())
-{
- CFG_TRACE_INFO("TreeManager: releasing subtree '%s' for entity '%s' with locale '%s'", OUSTRING2ASCII(aSubtreePath.toString()), OUSTRING2ASCII(_aOptions.getEntity()), OUSTRING2ASCII(_aOptions.getLocale()) );
-
- rtl::Reference<CacheClientAccess> aCache = m_aCacheList.get(_aOptions);
-
- OSL_ENSURE(aCache.is(),"TreeManager: No local data to release");
-
- if (aCache.is())
- {
- CFG_TRACE_INFO_NI("TreeManager: decrementing refcount for subtree '%s'", OUSTRING2ASCII(aSubtreePath.toString()) );
- if (aCache->releaseNode(aSubtreePath) == 0)
- {
- backend::ComponentRequest aComponentDesc(aSubtreePath.getModuleName(),_aOptions);
- rtl::Reference< backend::CacheController > xBackendCache = maybeGetBackendCache();
- if (xBackendCache.is()) xBackendCache->freeComponent(aComponentDesc);
- }
- }
-}
-// ----------------------------------------------------------------------------
-void TreeManager::refreshAll() SAL_THROW((com::sun::star::uno::Exception))
-{
- //Find what components are in cache and that have client references and reload
- //such components.
- rtl::Reference< backend::CacheController > aCacheRef = maybeGetBackendCache();
- if (aCacheRef.is()) aCacheRef->refreshAllComponents();
-}
-// ----------------------------------------------------------------------------
-void TreeManager::flushAll()SAL_THROW(())
-{
- rtl::Reference< backend::CacheController > aCacheRef = maybeGetBackendCache();
- if (aCacheRef.is()) aCacheRef->flushPendingUpdates();
-}
-//-----------------------------------------------------------------------------
-void TreeManager::enableAsync(const sal_Bool& bEnableAsync) SAL_THROW(())
-{
- m_bEnableAsync = bEnableAsync;
-}
-
- /////////////////////////////////////////////////////////////////////////
- void TreeManager::addListener(configuration::AbsolutePath const& aName, RequestOptions const & _aOptions, rtl::Reference<INodeListener> const& pHandler)
- {
- if (ConfigChangeBroadcastHelper* pHelper = getBroadcastHelper(_aOptions,true))
- {
- pHelper->addListener(aName, pHandler);
- }
- else
- OSL_ASSERT(false);
- }
-
- void TreeManager::removeListener(RequestOptions const & _aOptions, rtl::Reference<INodeListener> const& pHandler)
- {
- if (ConfigChangeBroadcastHelper* pHelper = getBroadcastHelper(_aOptions,false))
- {
- pHelper->removeListener( pHandler);
- }
- }
-
- /////////////////////////////////////////////////////////////////////////
- void TreeManager::fireChanges(TreeChangeList const& rList_, sal_Bool bError_)
- {
- if (ConfigChangeBroadcastHelper* pHelper = getBroadcastHelper(rList_.getOptions(),false))
- {
- pHelper->broadcast(rList_, bError_, this);
- }
- }
-
- /////////////////////////////////////////////////////////////////////////
- void TreeManager::disposeBroadcastHelper(ConfigChangeBroadcastHelper* pHelper)
- {
- if (pHelper)
- {
- pHelper->dispose(this);
- delete pHelper;
- }
- }
-
-// ----------------------------------------------------------------------------
-void TreeManager::nodeUpdated(TreeChangeList& _rChanges)
-{
- CFG_TRACE_INFO("TreeManager: nodeUpdated");
- try
- {
- rtl::Reference<CacheClientAccess> aCache = m_aCacheList.get(_rChanges.getOptions());
-
- if (aCache.is())
- {
- // first approve the changes and merge them with the current tree
- configuration::AbsolutePath aSubtreeName = _rChanges.getRootNodePath();
-
- sharable::Node * aCacheTree = aCache->findInnerNode(aSubtreeName);
- //OSL_ENSURE(aCacheTree != NULL, "TreeManager::nodeUpdated : node not found in cache!");
-
- if (aCacheTree != NULL)
- this->fireChanges(_rChanges,false);
- }
- }
- catch (uno::RuntimeException&)
- {
- CFG_TRACE_ERROR_NI("TreeManager::nodeUpdated : could not notify !");
- }
- CFG_TRACE_INFO_NI("TreeManager: nodeUpdated done");
-}
-
-// ----------------------------------------------------------------------------
-
-void TreeManager::componentCreated(backend::ComponentRequest const & ) SAL_THROW(())
-{
- CFG_TRACE_INFO("TreeManager: component was created");
-}
-// ----------------------------------------------------------------------------
-
-void TreeManager::componentChanged(backend::UpdateRequest const & _anUpdate) SAL_THROW(())
-{
- TreeChangeList aChanges(_anUpdate.getOptions(),
- _anUpdate.getUpdateRoot(),
- *_anUpdate.getUpdateData(),
- treeop::DeepChildCopy() );
-
- this->nodeUpdated(aChanges);
-}
-// ----------------------------------------------------------------------------
-
-// ----------------------------------------------------------------------------
-} // namespace
diff --git a/configmgr/source/treemgr/collectchanges.cxx b/configmgr/source/treemgr/collectchanges.cxx
deleted file mode 100644
index fa1689ef69..0000000000
--- a/configmgr/source/treemgr/collectchanges.cxx
+++ /dev/null
@@ -1,241 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <string.h>
-#include "collectchanges.hxx"
-
-#include "nodechangeinfo.hxx"
-
-#include <osl/diagnose.h>
-
-namespace configmgr
-{
- namespace configuration
- {
-
-//-----------------------------------------------------------------------------
-// conversion helper function
-//-----------------------------------------------------------------------------
-bool convertNodeChange(NodeChangeData& aData_, ValueChange const& aChange_)
-{
- switch(aChange_.getMode())
- {
- case ValueChange::wasDefault:
- case ValueChange::changeValue:
- aData_.type = NodeChangeData::eSetValue;
- break;
-
- case ValueChange::setToDefault:
- aData_.type = NodeChangeData::eSetDefault;
- break;
-
- case ValueChange::changeDefault:
- aData_.type = NodeChangeData::eNoChange; // ??
- break;
-
- default:
- OSL_ENSURE(false,"Unknown change type found");
- return false;
- }
-
- aData_.unoData.newValue = aChange_.getNewValue();
- aData_.unoData.oldValue = aChange_.getOldValue();
- return true;
-}
-//-----------------------------------------------------------------------------
-
-bool convertNodeChange(NodeChangeData& aData_, AddNode const& aChange_)
-{
- aData_.type = aChange_.isReplacing()
- ? NodeChangeData::eReplaceElement
- : NodeChangeData::eInsertElement;
-
- return true;
-}
-//-----------------------------------------------------------------------------
-
-bool convertNodeChange(NodeChangeData& aData_, RemoveNode const& /*aChange_*/)
-{
- aData_.type = NodeChangeData::eRemoveElement;
-
- return true;
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// CollectChanges visitor class
-//-----------------------------------------------------------------------------
-
-CollectChanges::CollectChanges( NodeChangesInformation& rTargetList_,
- Tree& rStartTree_, unsigned int nStartNode_,
- rtl::Reference<Template> aElementTemplate_,
- unsigned int nMaxDepth)
-: m_rTargetList(rTargetList_)
-, m_aAccessor()
-, m_aContextTypeName()
-, m_pBaseTree(&rStartTree_)
-, m_nBaseNode(nStartNode_)
-, m_nDepthLeft( nMaxDepth )
-{
- if (aElementTemplate_.is())
- m_aContextTypeName = aElementTemplate_->getName();
-}
-
-//-----------------------------------------------------------------------------
-CollectChanges::CollectChanges( CollectChanges const& rBase, Path::Component const& rChildName, rtl::OUString const& aSubTypeName_)
-: m_rTargetList(rBase.m_rTargetList)
-, m_aAccessor(rBase.m_aAccessor.compose(rChildName))
-, m_aContextTypeName(aSubTypeName_)
-, m_pBaseTree(rBase.m_pBaseTree)
-, m_nBaseNode(rBase.m_nBaseNode)
-, m_nDepthLeft(childDepth(rBase.m_nDepthLeft))
-{
- OSL_ASSERT(rBase.m_nDepthLeft > 0);
-}
-
-//-----------------------------------------------------------------------------
-inline
-Path::Component CollectChanges::implGetNodeName(Change const& aChange_) const
-{
- rtl::OUString aSimpleNodeName( aChange_.getNodeName() );
-
- if (m_aContextTypeName.getLength() == 0)
- {
- OSL_ENSURE(isSimpleName(aSimpleNodeName),"Unexpected: Found non-simple name without a type");
- return Path::wrapSafeName(aSimpleNodeName);
- }
- else
- return Path::makeCompositeName(aSimpleNodeName, m_aContextTypeName);
-}
-
-//-----------------------------------------------------------------------------
-void CollectChanges::collectFrom(ValueChange const& aChange_)
-{
- NodeChangeInformation aInfo;
-
- if ( convertNodeChange( aInfo.change, aChange_ ) &&
- implSetLocation( aInfo.location, aChange_, false ) )
- {
- implAdd( aInfo );
- }
-}
-
-//-----------------------------------------------------------------------------
-void CollectChanges::collectFrom(AddNode const& aChange_)
-{
- NodeChangeInformation aInfo;
-
- if ( convertNodeChange( aInfo.change, aChange_ ) &&
- implSetLocation( aInfo.location, aChange_, true ) )
- {
- implAdd( aInfo );
- }
-}
-
-//-----------------------------------------------------------------------------
-void CollectChanges::collectFrom(RemoveNode const& aChange_)
-{
- NodeChangeInformation aInfo;
-
- if ( convertNodeChange( aInfo.change, aChange_ ) &&
- implSetLocation( aInfo.location, aChange_, true ) )
- {
- implAdd( aInfo );
- }
-}
-
-//-----------------------------------------------------------------------------
-void CollectChanges::collectFrom(SubtreeChange const& aChanges_)
-{
- if (m_nDepthLeft > 0)
- {
- rtl::OUString aSubTypeName( aChanges_.getElementTemplateName() );
-
- CollectChanges aSubcollector( *this, implGetNodeName(aChanges_), aSubTypeName );
-
- aSubcollector.applyToChildren(aChanges_);
- }
-}
-
-//-----------------------------------------------------------------------------
-void CollectChanges::implAdd(NodeChangeInformation const& aChangeInfo_)
-{
- m_rTargetList.push_back(aChangeInfo_);
-}
-
-//-----------------------------------------------------------------------------
-bool CollectChanges::implSetLocation(NodeChangeLocation& rLocation_, Change const& aOriginal_, bool bSet_) const
-{
- NodeID aBaseID(m_pBaseTree,m_nBaseNode);
- if (aBaseID.isEmpty())
- return false;
-
- rLocation_.setBase( aBaseID );
-
- if (bSet_ && m_aAccessor.isEmpty()) // It is a set change affecting the base ...
- rLocation_.setAffected( aBaseID );
-
- Path::Component aChangeName = implGetNodeName( aOriginal_ );
- rLocation_.setAccessor( m_aAccessor.compose( aChangeName ) );
-
- return true;
-}
-
-// ChangeTreeAction implementations
-//-----------------------------------------------------------------------------
-void CollectChanges::handle(ValueChange const& aValueNode_)
-{
- collectFrom(aValueNode_);
-}
-
-//-----------------------------------------------------------------------------
-void CollectChanges::handle(AddNode const& aAddNode_)
-{
- collectFrom(aAddNode_);
-}
-
-//-----------------------------------------------------------------------------
-void CollectChanges::handle(RemoveNode const& aRemoveNode_)
-{
- collectFrom(aRemoveNode_);
-}
-
-//-----------------------------------------------------------------------------
-void CollectChanges::handle(SubtreeChange const& aSubtree_)
-{
- collectFrom( aSubtree_ );
-}
-
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
- }
-}
-
diff --git a/configmgr/source/treemgr/collectchanges.hxx b/configmgr/source/treemgr/collectchanges.hxx
deleted file mode 100644
index ce84f04e50..0000000000
--- a/configmgr/source/treemgr/collectchanges.hxx
+++ /dev/null
@@ -1,121 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_COLLECTCHANGES_HXX_
-#define CONFIGMGR_COLLECTCHANGES_HXX_
-
-// low.level (cache model) changes (needed for change tree action class)
-#include "change.hxx"
-
-// pathes for accessors
-#include "configpath.hxx"
-
-// need c_TreeDepthAll
-#include "tree.hxx"
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace configuration
- {
-//-----------------------------------------------------------------------------
- class NodeChangeData;
- class NodeChangeLocation;
- class NodeChangeInformation;
- class NodeChangesInformation;
-//-----------------------------------------------------------------------------
-
- /// Change model translation: Create a NodeChangeData from a ValueChange object
- bool convertNodeChange(NodeChangeData& aData_, ValueChange const& aChange_);
- /// Change model translation: Create a NodeChangeData from an AddNode change object
- bool convertNodeChange(NodeChangeData& aData_, AddNode const& aChange_);
- /// Change model translation: Create a NodeChangeData from a RemoveNode change object
- bool convertNodeChange(NodeChangeData& aData_, RemoveNode const& aChange_);
-
- /** Change Tree Visitor that appends all changes in the changes tree
- to a NodeChanges list, optionally restricted to a given depth
- */
- class CollectChanges : private ChangeTreeAction
- {
- NodeChangesInformation& m_rTargetList;
- RelativePath m_aAccessor;
- rtl::OUString m_aContextTypeName;
- Tree* m_pBaseTree;
- unsigned int m_nBaseNode;
- unsigned int m_nDepthLeft;
-
- public:
- /// Constructs a Visitor object, sets the output target list and context
- CollectChanges( NodeChangesInformation& rTargetList_,
- Tree& rStartTree_, unsigned int nStartNode_,
- rtl::Reference<Template> aElementTemplate_,
- unsigned int nMaxDepth = c_TreeDepthAll);
-
- /// Adds a (translated) ValueChange to the target list
- void collectFrom(ValueChange const& aChange_);
-
- /// Adds a (translated) AddNode to the target list
- void collectFrom(AddNode const& aChange_);
-
- /// Adds a (translated) RemoveNode to the target list
- void collectFrom(RemoveNode const& aChange_);
-
- /// Appends (translated) Changes from the subtree to the target list, possibly with a depth limit
- void collectFrom(SubtreeChange const& aChange_);
-
- /// Appends the given Change and its descendants to the target list, possibly with a depth limit
- void collectFrom(Change const& aChange_)
- {
- this->applyToChange( aChange_ );
- }
-
- /// Appends the descendants of the given Change to the target list, possibly with a depth limit
- void collectFromChildren(SubtreeChange const& aParent_)
- {
- this->applyToChildren( aParent_ );
- }
-
- protected:
- /// Constructs a Visitor object for a child of another one's context
- CollectChanges( CollectChanges const& rBase, Path::Component const& rChildName, rtl::OUString const& aSubTypeName );
-
- private:
- // ChangeTreeAction implementations
- virtual void handle(ValueChange const& aValueNode);
- virtual void handle(AddNode const& aAddNode);
- virtual void handle(RemoveNode const& aRemoveNode);
- virtual void handle(SubtreeChange const& aSubtree);
-
- bool implSetLocation(NodeChangeLocation& rLocation_, Change const& aOriginal_, bool bSet_) const;
- void implAdd(NodeChangeInformation const& aChangeInfo_);
- Path::Component implGetNodeName(Change const& _aChange_) const;
- };
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_COLLECTCHANGES_HXX_
diff --git a/configmgr/source/treemgr/configdefaultprovider.cxx b/configmgr/source/treemgr/configdefaultprovider.cxx
deleted file mode 100644
index 74135ad8c4..0000000000
--- a/configmgr/source/treemgr/configdefaultprovider.cxx
+++ /dev/null
@@ -1,150 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "configdefaultprovider.hxx"
-#include "defaultproviderproxy.hxx"
-#include "noderef.hxx"
-#include "valuenode.hxx"
-#include "tree.hxx"
-#include "options.hxx"
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-// class DefaultProvider
-//-----------------------------------------------------------------------------
-
-// standard c/d-tors to make compiler barrier
-DefaultProvider DefaultProvider::createEmpty()
-{
- return DefaultProvider(NULL);
-}
-//-----------------------------------------------------------------------------
-
-DefaultProvider DefaultProvider::create(rtl::Reference< Tree > const& _aRootTree, RequestOptions const& _aOptions,
- rtl::Reference< TreeManager > const & _xDefaultProvider,
- IDefaultableTreeManager* _pDefaultableTree)
-{
- OSL_PRECOND( !isEmpty(_aRootTree.get()), "ERROR: Cannot create DefaultProvider for NULL tree");
-
- rtl::Reference< DefaultProviderProxy > xNewProxy;
-
- if (!isEmpty(_aRootTree.get()))
- {
- xNewProxy = new DefaultProviderProxy(_xDefaultProvider,_pDefaultableTree,
- _aRootTree->getRootPath(), _aOptions );
- }
-
- return DefaultProvider( xNewProxy );
-}
-//-----------------------------------------------------------------------------
-
-DefaultProvider::DefaultProvider(DefaultProvider const& _aOther)
-: m_aProxy(_aOther.m_aProxy)
-{
-}
-//-----------------------------------------------------------------------------
-
-DefaultProvider& DefaultProvider::operator=(DefaultProvider const& _aOther)
-{
- m_aProxy = _aOther.m_aProxy;
- return *this;
-}
-//-----------------------------------------------------------------------------
-
-DefaultProvider::~DefaultProvider()
-{
-}
-//-----------------------------------------------------------------------------
-
-DefaultProvider::DefaultProvider(rtl::Reference< DefaultProviderProxy > const& _xProviderProxy)
-: m_aProxy(_xProviderProxy)
-{
-}
-//-----------------------------------------------------------------------------
-
-/// tries to load a default instance of the specified node
-std::auto_ptr<ISubtree> DefaultProvider::getDefaultTree(
- rtl::Reference< Tree > const& _aTree, NodeRef const& _aNode
- ) const SAL_THROW((com::sun::star::uno::Exception))
-{
- std::auto_ptr<ISubtree> aRet;
-
- node::Attributes aAttributes = _aTree->getAttributes(_aNode);
-
-// if (aAttributes.bDefaulted)
-// clone the ISubtree (no interface for that) :-(
-
- if (m_aProxy.is() && aAttributes.existsInDefault())
- aRet = m_aProxy->getDefaultTree(_aTree->getAbsolutePath(_aNode));
-
- return aRet;
-}
-
-//-----------------------------------------------------------------------------
-/// tries to load default data into the specified tree
-static bool shouldFetchDefaultData(rtl::Reference< Tree > const& _aTreeRef, bool & _rbHasDefaults)
-{
- bool bShouldFetch = false;
-
- node::Attributes aAttributes = _aTreeRef->getAttributes(_aTreeRef->getRootNode());
-
- if (aAttributes.isDefault())
- _rbHasDefaults = true;
-
- // in replaced/added parts, defaults are considered non-existing
- else if (!aAttributes.isReplacedForUser())
- _rbHasDefaults = false;
-
- else
- bShouldFetch = true;
-
- return bShouldFetch;
-}
-
-//-----------------------------------------------------------------------------
-/// tries to load default data into the specified tree
-bool DefaultProvider::fetchDefaultData(rtl::Reference< Tree > const& _aTreeRef) const SAL_THROW((com::sun::star::uno::Exception))
-{
- bool bHasDefaults = false;
-
- if (shouldFetchDefaultData(_aTreeRef,bHasDefaults) && m_aProxy.is() )
- bHasDefaults = m_aProxy->fetchDefaultData();
-
- return bHasDefaults;
-}
-
-//-----------------------------------------------------------------------------
- }
-}
-
diff --git a/configmgr/source/treemgr/configexcept.cxx b/configmgr/source/treemgr/configexcept.cxx
deleted file mode 100644
index c5fb3fb6f6..0000000000
--- a/configmgr/source/treemgr/configexcept.cxx
+++ /dev/null
@@ -1,181 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "configexcept.hxx"
-#include <osl/diagnose.h>
-
-namespace configmgr
-{
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-
- //---------------------------------------------------------------------
- Exception::Exception(char const* sAsciiMessage)
- : m_sAsciiMessage(sAsciiMessage)
- {
- }
- //---------------------------------------------------------------------
- Exception::Exception(rtl::OString const& sAsciiMessage)
- : m_sAsciiMessage(sAsciiMessage)
- {
- }
- //---------------------------------------------------------------------
-
- rtl::OUString Exception::message() const
- {
-
- return rtl::OStringToOUString( m_sAsciiMessage, RTL_TEXTENCODING_ASCII_US );
- }
- //---------------------------------------------------------------------
- char const* Exception::what() const
- {
- return m_sAsciiMessage.getLength() ? m_sAsciiMessage.getStr() : "FAILURE in CONFIGURATION: No description available";
- }
- //---------------------------------------------------------------------
-
- static const char c_sInvalidNamePre[] = "CONFIGURATION: Invalid path or name: ";
- static const char c_sInvalidName[] = "CONFIGURATION: <Invalid path or name>";
-//-----------------------------------------------------------------------------
-
- //---------------------------------------------------------------------
-
- InvalidName::InvalidName(rtl::OUString const& sName, char const* sAsciiDescription)
- : Exception( rtl::OString(RTL_CONSTASCII_STRINGPARAM(c_sInvalidName)) += sAsciiDescription )
- , m_sName( sName.concat(rtl::OUString::createFromAscii(sAsciiDescription)) )
- {
- }
- //---------------------------------------------------------------------
-
- rtl::OUString InvalidName::message() const
- {
- return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(c_sInvalidNamePre)).concat( m_sName );
- }
-//-----------------------------------------------------------------------------
-
- static const char c_sViolation[] = "CONFIGURATION: Update Violates Constraint: ";
- //---------------------------------------------------------------------
-
- ConstraintViolation::ConstraintViolation(char const* sConstraint)
- : Exception( rtl::OString(RTL_CONSTASCII_STRINGPARAM(c_sViolation)) += sConstraint)
- {
- }
-
-//-----------------------------------------------------------------------------
-
- static const char c_sTypeMismatch[] = "CONFIGURATION: Data Types do not match: ";
- //---------------------------------------------------------------------
- rtl::OUString TypeMismatch::describe(rtl::OUString const& sFoundType, rtl::OUString const& sExpectedType)
- {
- rtl::OUString sRet = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Found Type: '"));
- sRet += sFoundType;
- if (sExpectedType.getLength() != 0)
- {
- sRet += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("' - Expected Type: '"));
- sRet += sExpectedType;
- sRet += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("'"));
- }
- else
- {
- sRet += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("' is not valid in this context"));
- }
- return sRet;
- }
- //---------------------------------------------------------------------
-
- //---------------------------------------------------------------------
-
- TypeMismatch::TypeMismatch(rtl::OUString const& sType1, rtl::OUString const& sType2)
- : Exception( rtl::OString(RTL_CONSTASCII_STRINGPARAM(c_sTypeMismatch)) )
- , m_sTypes( describe(sType1,sType2) )
- {
- }
- //---------------------------------------------------------------------
- TypeMismatch::TypeMismatch(rtl::OUString const& sType1, rtl::OUString const& sType2, char const* sAsciiDescription)
- : Exception( rtl::OString(RTL_CONSTASCII_STRINGPARAM(c_sTypeMismatch)) += sAsciiDescription)
- , m_sTypes( describe(sType1,sType2).concat(rtl::OUString::createFromAscii(sAsciiDescription)) )
- {
- }
- //---------------------------------------------------------------------
-
- rtl::OUString TypeMismatch::message() const
- {
- return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(c_sTypeMismatch)).concat( m_sTypes );
- }
-//-----------------------------------------------------------------------------
- }
-
- namespace configapi
- {
-//-----------------------------------------------------------------------------
- ExceptionMapper::ExceptionMapper(configuration::Exception& e)
- : m_eOriginal(e)
- , m_xContext()
- , m_sMessage(e.message())
- {
- }
- //---------------------------------------------------------------------
-
- ExceptionMapper::~ExceptionMapper()
- {
- }
- //---------------------------------------------------------------------
-
- void ExceptionMapper::setContext(uno::XInterface* pContext)
- {
- m_xContext = pContext;
- }
- //---------------------------------------------------------------------
-
- rtl::OUString ExceptionMapper::message() const
- {
- return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FAILURE in CONFIGMGR: ")).concat( m_sMessage );
- }
- //---------------------------------------------------------------------
-
- uno::Reference<uno::XInterface> ExceptionMapper::context() const
- {
- return m_xContext;
- }
- //---------------------------------------------------------------------
-
- void ExceptionMapper::illegalArgument(sal_Int16 nArgument) throw(lang::IllegalArgumentException)
- {
- throw lang::IllegalArgumentException(message(),context(),nArgument);
- }
- //---------------------------------------------------------------------
-
- void ExceptionMapper::unhandled() throw(uno::RuntimeException)
- {
- throw uno::RuntimeException(message(),context());
- }
-//-----------------------------------------------------------------------------
- }
-}
diff --git a/configmgr/source/treemgr/configgroup.cxx b/configmgr/source/treemgr/configgroup.cxx
deleted file mode 100644
index 3028437610..0000000000
--- a/configmgr/source/treemgr/configgroup.cxx
+++ /dev/null
@@ -1,404 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "configgroup.hxx"
-#include "configset.hxx"
-#include "valueref.hxx"
-#include "anynoderef.hxx"
-#include "nodechange.hxx"
-#include "nodechangeimpl.hxx"
-#include "tree.hxx"
-#include "groupnodeimpl.hxx"
-#include "valuenodeimpl.hxx"
-#include "typeconverter.hxx"
-#include "tracer.hxx"
-#include <com/sun/star/script/XTypeConverter.hpp>
-
-namespace configmgr
-{
- namespace configuration
- {
-
-//-----------------------------------------------------------------------------
-// class GroupUpdateHelper
-//-----------------------------------------------------------------------------
-
-GroupUpdateHelper::GroupUpdateHelper(rtl::Reference< Tree > const& aParentTree, NodeRef const& aGroupNode)
-: m_aTree(aParentTree)
-, m_aNode(aGroupNode)
-{
- implValidateTree(m_aTree);
- implValidateNode(m_aTree,m_aNode);
-
- if (! view::ViewTreeAccess(m_aTree.get()).isGroupNode(m_aNode) )
- throw Exception("INTERNAL ERROR: Group Member Update: node is not a group");
-}
-//-----------------------------------------------------------------------------
-
-void GroupUpdateHelper::implValidateTree(rtl::Reference< Tree > const& aTree) const
-{
- if (isEmpty(aTree.get()))
- throw Exception("INTERNAL ERROR: Group Member Update: Unexpected NULL tree");
-
- // check for proper nesting
- for(rtl::Reference<Tree> aTestTree = aTree;
- aTestTree != m_aTree; // search this as ancestor tree
- aTestTree = aTestTree->getContextTree() )
- {
- if (!aTestTree.is()) // no more trees to look for
- throw Exception("INTERNAL ERROR: Group Member Update: improper tree relationship");
- }
-}
-//-----------------------------------------------------------------------------
-
-void GroupUpdateHelper::implValidateNode(rtl::Reference< Tree > const& aTree, NodeRef const& aNode) const
-{
- if (!aNode.isValid())
- throw Exception("INTERNAL ERROR: Group Member Update: Unexpected NULL node");
-
- if (!aTree->isValidNode(aNode.getOffset()))
- throw Exception("INTERNAL ERROR: Group Member Update: node does not match tree");
-}
-//-----------------------------------------------------------------------------
-
-void GroupUpdateHelper::implValidateNode(rtl::Reference< Tree > const& aTree, ValueRef const& aNode) const
-{
- if (!aNode.isValid())
- throw Exception("INTERNAL ERROR: Group Member Update: Unexpected NULL node");
-
- if (!aTree->isValidValueNode(aNode))
- throw Exception("INTERNAL ERROR: Group Member Update: changed node does not match tree");
-
- if (aTree->getAttributes(aNode).isReadonly())
- throw ConstraintViolation( "Group Member Update: Node is read-only !" );
-
-}
-//-----------------------------------------------------------------------------
-
-void GroupUpdateHelper::validateNode(ValueRef const& aNode) const
-{
- implValidateNode(m_aTree,aNode);
-}
-//-----------------------------------------------------------------------------
-
-void GroupUpdateHelper::validateNode(NodeRef const& aNode) const
-{
- implValidateNode(m_aTree,aNode);
-}
-//-----------------------------------------------------------------------------
-
-/** a helper that gets the UNO <type scope='com::sun::star::uno'>Type</type>
- for a UNO <type scope='com::sun::star::uno'>Any</type>.
-*/
-static inline com::sun::star::uno::Type getUnoAnyType()
-{
- com::sun::star::uno::Any const * const selectAny = 0;
- return ::getCppuType(selectAny);
-}
-//-----------------------------------------------------------------------------
-
-bool isPossibleValueType(com::sun::star::uno::Type const& aValueType)
-{
- switch(aValueType.getTypeClass())
- {
- case uno::TypeClass_BOOLEAN:
- case uno::TypeClass_SHORT:
- case uno::TypeClass_LONG:
- case uno::TypeClass_HYPER:
- case uno::TypeClass_DOUBLE:
- case uno::TypeClass_STRING:
- return true;
-
- case uno::TypeClass_SEQUENCE:
- switch(getSequenceElementType(aValueType).getTypeClass())
- {
- case uno::TypeClass_BYTE: // scalar binary
-
- case uno::TypeClass_BOOLEAN:
- case uno::TypeClass_SHORT:
- case uno::TypeClass_LONG:
- case uno::TypeClass_HYPER:
- case uno::TypeClass_DOUBLE:
- case uno::TypeClass_STRING:
- return true;
-
- case uno::TypeClass_SEQUENCE:
- {
- uno::Sequence< uno::Sequence< sal_Int8 > > const * const forBinaryList = 0;
- return !!(aValueType == ::getCppuType(forBinaryList));
- }
-
- default:
- return false;
- }
-
- default:
- return false;
- }
-}
-
-//-----------------------------------------------------------------------------
-bool convertCompatibleValue(com::sun::star::uno::Reference<com::sun::star::script::XTypeConverter> const& xTypeConverter, uno::Any& rConverted, com::sun::star::uno::Any const& rNewValue, com::sun::star::uno::Type const& rTargetType)
-{
- OSL_ASSERT( isPossibleValueType(rTargetType) );
-
- if (rTargetType == rNewValue.getValueType())
- {
- rConverted = rNewValue;
- return true;
- }
-
- if (xTypeConverter.is())
- try
- {
- rConverted = xTypeConverter->convertTo(rNewValue,rTargetType);
-
- OSL_ASSERT( rConverted.getValueType() == rTargetType );
- }
- catch(uno::RuntimeException&) { throw; }
- catch(css::lang::IllegalArgumentException&)
- {
- // try to do more conversion here ?!
- return false;
- }
- catch(css::script::CannotConvertException&)
- {
- // try to do more conversion here ?!
- return false;
- }
- catch(uno::Exception&)
- {
- OSL_ENSURE(sal_False, "ValueUpdater::convertValue : generic exception ... thought we caught all allowed exceptions !");
- // try to do more conversion here ?!
- return false;
- }
-
- return true;
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// class GroupUpdater
-//-----------------------------------------------------------------------------
-
-GroupUpdater::GroupUpdater(rtl::Reference< Tree > const& aParentTree, NodeRef const& aGroupNode, com::sun::star::uno::Reference<com::sun::star::script::XTypeConverter> const& xConverter)
-: m_aHelper(aParentTree,aGroupNode)
-, m_xTypeConverter(xConverter)
-{
-}
-//-----------------------------------------------------------------------------
-
-com::sun::star::uno::Any GroupUpdater::implValidateValue(rtl::Reference< Tree > const& aTree, ValueRef const& aNode, com::sun::star::uno::Any const& aValue) const
-{
- com::sun::star::uno::Type aValueType = aValue.getValueType();
- com::sun::star::uno::Type aTargetType = aTree->getUnoType(aNode);
-
- OSL_ENSURE( aTargetType.getTypeClass() == uno::TypeClass_ANY || isPossibleValueType(aTargetType),
- "Invalid value type found on existing property" );
-
- OSL_ASSERT( aValueType.getTypeClass() != uno::TypeClass_ANY);
-
- com::sun::star::uno::Any aRet;
-
- if (!aValue.hasValue())
- {
- if (!aTree->getAttributes(aNode).isNullable())
- {
- rtl::OString sError("Group Member Update: Node (");
- sError += OUSTRING2ASCII(aNode.m_sNodeName);
- sError += ") is not nullable !";
- throw ConstraintViolation( sError );
- }
- OSL_ASSERT( !aRet.hasValue() );
- }
-
- else if (aValueType == aTargetType)
- {
- aRet = aValue;
- }
-
- else if (aTargetType == getUnoAnyType())
- {
- if ( ! isPossibleValueType(aValueType) )
- throw TypeMismatch(aValueType.getTypeName(), aTargetType.getTypeName(), " - new property value has no legal configuration data type");
-
- // OK - any type
- aRet = aValue;
- }
-
- else
- {
- if (!convertCompatibleValue(m_xTypeConverter, aRet, aValue,aTargetType))
- throw TypeMismatch(aValueType.getTypeName(), aTargetType.getTypeName(), " cannot set incompatible value");
- }
-
-
- OSL_ASSERT( !aRet.hasValue() || isPossibleValueType(aRet.getValueType()) );
-
- return aRet;
-}
-//-----------------------------------------------------------------------------
-
-NodeChange GroupUpdater::validateSetValue(ValueRef const& aValueNode, com::sun::star::uno::Any const& newValue )
-{
- m_aHelper.validateNode(aValueNode);
-
- com::sun::star::uno::Any aNewValue = implValidateValue(m_aHelper.tree(), aValueNode, newValue);
-
- // now build the specific change
- std::auto_ptr<ValueChangeImpl> pChange( new ValueReplaceImpl(aNewValue) );
-
- NodeRef aParent = m_aHelper.tree()->getParent(aValueNode);
- pChange->setTarget(
- view::ViewTreeAccess(m_aHelper.tree().get()).toGroupNode(aParent),
- aValueNode.m_sNodeName
- );
-
- return NodeChange(pChange.release());
-}
-
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// helper class NodeDefaulter
-//-----------------------------------------------------------------------------
-
-namespace
-{
- struct NodeDefaulter : NodeVisitor
- {
- GroupDefaulter& updater;
- NodeChanges result;
-
- explicit
- NodeDefaulter(GroupDefaulter& _rUpdater) : updater(_rUpdater), result() {}
-
- /// do the operation on <var>aNode</var>. needs to be implemented by concrete visitor classes
- Result handle(rtl::Reference< Tree > const& aTree, NodeRef const& aNode);
-
- /// do the operation on <var>aValue</var>. needs to be implemented by concrete visitor classes
- Result handle(rtl::Reference< Tree > const& aTree, ValueRef const& aValue);
-
- inline void addResult(NodeChange const& aChange)
- {
- if (aChange.maybeChange())
- this->result.add(aChange);
- }
- };
-
- NodeVisitor::Result NodeDefaulter::handle(rtl::Reference< Tree > const& , NodeRef const& aNode)
- {
- addResult( updater.validateSetToDefaultState(aNode) );
- return CONTINUE;
- }
-
- NodeVisitor::Result NodeDefaulter::handle(rtl::Reference< Tree > const& , ValueRef const& aValue)
- {
- addResult( updater.validateSetToDefaultValue(aValue) );
- return CONTINUE;
- }
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// class GroupDefaulter
-//-----------------------------------------------------------------------------
-
-GroupDefaulter::GroupDefaulter(rtl::Reference< Tree > const& _aParentTree, NodeRef const& _aGroupNode, DefaultProvider const& _aProvider)
-: m_aHelper(_aParentTree,_aGroupNode)
-, m_aDefaultProvider(_aProvider)
-, m_bHasDoneSet(false)
-{
-}
-//-----------------------------------------------------------------------------
-bool GroupDefaulter::isDataAvailable(rtl::Reference< Tree > const& _aParentTree, NodeRef const& _aGroupNode)
-{
- return _aParentTree->areValueDefaultsAvailable(_aGroupNode);
-}
-//-----------------------------------------------------------------------------
-bool GroupDefaulter::ensureDataAvailable(rtl::Reference< Tree > const& _aParentTree, NodeRef const& _aGroupNode, DefaultProvider const& _aDataSource)
-{
- return isDataAvailable(_aParentTree, _aGroupNode) ||
- _aDataSource.fetchDefaultData( _aParentTree );
-}
-//-----------------------------------------------------------------------------
-
-NodeChange GroupDefaulter::validateSetToDefaultValue(ValueRef const& aValueNode)
-{
- m_aHelper.validateNode(aValueNode);
-
- if (!m_aHelper.tree()->hasNodeDefault(aValueNode))
- throw Exception("INTERNAL ERROR: Group Member Update: Node has no default value" );
-
- // now build the specific change
- std::auto_ptr<ValueChangeImpl> pChange( new ValueResetImpl() );
-
- NodeRef aParent = m_aHelper.tree()->getParent(aValueNode);
- pChange->setTarget(
- view::ViewTreeAccess(m_aHelper.tree().get()).toGroupNode(aParent),
- aValueNode.m_sNodeName
- );
-
- return NodeChange(pChange.release());
-}
-//-----------------------------------------------------------------------------
-
-NodeChange GroupDefaulter::validateSetToDefaultState(NodeRef const& aNode)
-{
- m_aHelper.validateNode(aNode);
-
- NodeChange aResult;
-
- // only works for set nodes - groups are left alone
- if ( view::ViewTreeAccess(m_aHelper.tree().get()).isSetNode(aNode) )
- {
- aResult = SetDefaulter( m_aHelper.tree(), aNode, m_aDefaultProvider ).validateSetToDefaultState();
- }
-
- m_bHasDoneSet = aResult.maybeChange();
-
- return aResult;
-}
-//-----------------------------------------------------------------------------
-
-NodeChanges GroupDefaulter::validateSetAllToDefault()
-{
- NodeDefaulter aDefaulter(*this);
-
- m_aHelper.tree()->dispatchToChildren(m_aHelper.node(),aDefaulter);
-
- return aDefaulter.result;
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
- }
-}
-
diff --git a/configmgr/source/treemgr/configpath.cxx b/configmgr/source/treemgr/configpath.cxx
deleted file mode 100644
index 75bab48ae1..0000000000
--- a/configmgr/source/treemgr/configpath.cxx
+++ /dev/null
@@ -1,998 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "configpath.hxx"
-#include "configexcept.hxx"
-#include <rtl/ustrbuf.hxx>
-
-#ifndef INCLUDED_ALGORITHM
-#include <algorithm>
-#define INCLUDED_ALGORITHM
-#endif
-
-#ifndef CFG_PATH_STRICT
-//#define CFG_PATH_STRICT 1
-#endif
-
-#define dprint(a,b,c)
-
-namespace configmgr
-{
- namespace configuration
- {
-
- //-------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// Name validation
-//-----------------------------------------------------------------------------
-namespace
-{
- //-------------------------------------------------------------------------
- inline
- bool isValidNameStart(sal_Unicode ch) SAL_THROW(())
- {
- return (sal_Unicode('A') <= ch && ch <= sal_Unicode('Z')) ||
- (sal_Unicode('a') <= ch && ch <= sal_Unicode('z')) ||
- sal_Unicode('_') == ch;
- }
- inline
- bool isValidNameCont(sal_Unicode ch) SAL_THROW(())
- {
- return ( (sal_Unicode('0') <= ch && ch <= sal_Unicode('9'))
- || (sal_Unicode('.') == ch) // eg for module names
- || (sal_Unicode('-') == ch) // eg for locale names
- || (sal_Unicode(':') == ch) // support special namespaced names
- );
- }
-
- //-------------------------------------------------------------------------
-}
-//-----------------------------------------------------------------------------
-
-bool isSimpleName(rtl::OUString const& sName) SAL_THROW(())
-{
- sal_Unicode const* const pStr = sName.getStr();
- sal_Unicode const* const pEnd = pStr + sName.getLength();
-
- if ( (pStr == pEnd) || !isValidNameStart(*pStr) )
- return false;
-
- for (sal_Unicode const* pValidate = pStr+1; pValidate != pEnd; ++pValidate)
- {
- if (!isValidNameStart(*pValidate) && !isValidNameCont(*pValidate))
- return false;
- }
-
- return true;
-}
-//-----------------------------------------------------------------------------
-
-rtl::OUString validateNodeName(rtl::OUString const& sName)
-{
- if (!isSimpleName(sName))
- throw InvalidName(sName, "is not a valid name for a configuration node");
-
- return sName;
-}
-//-----------------------------------------------------------------------------
-
-rtl::OUString validateElementName(rtl::OUString const& sName)
-{
- if (sName.getLength() == 0)
- throw InvalidName(sName, "is not a valid name for a configuration item (empty names are not permitted)");
-
- return sName;
-}
-//-----------------------------------------------------------------------------
-
-namespace // path helpers I
-{
-//-----------------------------------------------------------------------------
- const sal_Unicode c_cDelimiter = '/';
-
- const sal_Unicode c_lBracket = '[', c_rBracket = ']';
-
- const sal_Unicode c_cAnytype = '*';
-//-----------------------------------------------------------------------------
-
- // Textually an Absolute path starts with a slash
- static
- inline
- bool detectAbsolutePath(sal_Unicode const* _pPath) SAL_THROW(())
- {
- OSL_ASSERT( _pPath != NULL );
- return *_pPath == c_cDelimiter;
- }
-//-----------------------------------------------------------------------------
-
- static
- inline
- rtl::OUString makeWildcardType() SAL_THROW(())
- {
- return rtl::OUString(&c_cAnytype,1);
- }
-//-----------------------------------------------------------------------------
-
- // even handles empty strings (if NUL-terminated)
- static
- inline
- bool isWildcardType(sal_Unicode const* _sType) SAL_THROW(())
- {
- OSL_ASSERT( _sType != NULL );
- return _sType[0] == c_cAnytype &&
- _sType[1] == 0;
- }
-//-----------------------------------------------------------------------------
-
- static
- inline
- bool isEmptyString(sal_Unicode const* _sType) SAL_THROW(())
- {
- OSL_ASSERT( _sType != NULL );
- return _sType[0] == 0;
- }
-//-----------------------------------------------------------------------------
- static
- inline
- sal_Unicode lastChar(rtl::OUString const& _sString) SAL_THROW(())
- {
- sal_Int32 const nLen = _sString.getLength();
-
- OSL_PRECOND( nLen > 0, "Non-empty string expected");
-
- return _sString[nLen-1];
- }
-//-----------------------------------------------------------------------------
-
- rtl::OUString implMakeCompositeName(rtl::OUString const& _sBaseName, rtl::OUString const& _sPredicate) SAL_THROW((InvalidName));
- void implSplitCompositeName(rtl::OUString const& _aCompositeName, rtl::OUString& _rBaseName, rtl::OUString& _rPredicate) SAL_THROW(());
-//-----------------------------------------------------------------------------
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-namespace Path
-{
-//-----------------------------------------------------------------------------
-// class configuration::Path::Component
-//-----------------------------------------------------------------------------
-
-inline // though public, this method is not available outside this translation unit
-Component::Component(rtl::OUString const& _sName) SAL_THROW(())
-: m_aName(_sName)
-{
-}
-//-----------------------------------------------------------------------------
-
-bool Component::isSimpleName() const SAL_THROW(())
-{
- return m_aName.getLength() != 0 && lastChar(m_aName) != c_rBracket;
-}
-//-----------------------------------------------------------------------------
-
-rtl::OUString Component::getName() const SAL_THROW(())
-{
- if (isSimpleName()) return m_aName;
-
- rtl::OUString sName, sType;
- implSplitCompositeName(m_aName,sType,sName);
-
- return sName;
-}
-//-----------------------------------------------------------------------------
-
-rtl::OUString Component::getTypeName() const SAL_THROW(())
-{
- if (isSimpleName()) return rtl::OUString();
-
- rtl::OUString sName, sType;
- implSplitCompositeName(m_aName,sType,sName);
-
- return sType;
-}
-//-----------------------------------------------------------------------------
-
-Component makeEmptyComponent() SAL_THROW(())
-{
- return Component( rtl::OUString() );
-}
-//-----------------------------------------------------------------------------
-
-Component wrapSimpleName(rtl::OUString const& _sName)
-{
- OSL_ENSURE( isSimpleName(_sName), "Simple name expected creating path component");
- if (!isSimpleName(_sName))
- throw InvalidName(_sName, "is not a simple name. Cannot convert to path component");
-
- return Component( _sName );
-}
-//-----------------------------------------------------------------------------
-
-Component makeCompositeName(rtl::OUString const& _sElementName, rtl::OUString const& _sTypeName)
-{
- return Component( implMakeCompositeName(_sTypeName,_sElementName) );
-}
-//-----------------------------------------------------------------------------
-
-
-bool matches(Component const& lhs,Component const& rhs) SAL_THROW(())
-{
- // this extra preflight check might be left out (is it good for performance ?)
- if (lhs.getInternalName() == rhs.getInternalName())
- return true;
-
- if (lhs.getName() != rhs.getName())
- return false;
-
- // simple names are considered equivalent to wildcard namess
- if (lhs.isSimpleName() || rhs.isSimpleName())
- return true;
-
- rtl::OUString aTypeLHS = lhs.getTypeName();
- rtl::OUString aTypeRHS = rhs.getTypeName();
-
- // this would need an extra test without our preflight check
- OSL_ASSERT(aTypeLHS != aTypeRHS); // would have been dicovered by first check
-
- if ( isWildcardType(aTypeLHS) || isWildcardType(aTypeRHS) )
- return true;
-
- return false;
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// weak comparison of components
-//-----------------------------------------------------------------------------
-bool before(Component const& lhs, Component const& rhs) SAL_THROW(())
-{ return lhs.getName() < rhs.getName(); }
-
-//-----------------------------------------------------------------------------
-bool equiv(Component const& lhs, Component const& rhs) SAL_THROW(())
-{ return lhs.getName() == rhs.getName(); }
-
-//-----------------------------------------------------------------------------
-size_t hashCode(Component const& comp) SAL_THROW(())
-{ return comp.getName().hashCode(); }
-
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// class configuration::Path::Rep
-//-----------------------------------------------------------------------------
-void Rep::check_not_empty() const
-{
- if (m_aComponents.empty())
- {
- OSL_ENSURE(!m_aComponents.empty(),"Trying to access components of an empty path");
- throw Exception("Trying to access components of an empty path");
- }
-}
-//-----------------------------------------------------------------------------
-
-void Rep::prepend(Rep const& _aOther) SAL_THROW(())
-{
- // to prepend the other path append its components
- m_aComponents.insert( m_aComponents.end(),
- _aOther.m_aComponents.begin(),
- _aOther.m_aComponents.end());
-
-}
-//-----------------------------------------------------------------------------
-
-rtl::OUString Rep::toString(bool _bAbsolute) const SAL_THROW(())
-{
- std::vector<Component>::const_reverse_iterator cur = begin();
- std::vector<Component>::const_reverse_iterator const stop = end();
-
- rtl::OUStringBuffer sRet;
-
- if (!_bAbsolute && cur != stop)
- sRet = cur++->toPathString();
-
- for ( ;cur != stop; ++cur)
- sRet.append( c_cDelimiter ).append( cur->toPathString() );
-
- return sRet.makeStringAndClear();
-}
-//-----------------------------------------------------------------------------
-
-size_t Rep::hashCode() const SAL_THROW(())
-{
- const unsigned long mangle_factor = 11; // 1011 (2)
- unsigned long nHash = 0;
- for (std::vector<Component>::const_reverse_iterator it = begin(), stop = end(); it != stop; ++it)
- {
- nHash = mangle_factor*nHash + Path::hashCode(*it);
- }
- return nHash;
-}
-//-----------------------------------------------------------------------------
-
-bool before(Rep const& lhs, Rep const& rhs) SAL_THROW(())
-{
- return std::lexicographical_compare(lhs.begin(),lhs.end(),rhs.begin(),rhs.end(), Before());
-}
-//-----------------------------------------------------------------------------
-
-bool equiv(Rep const& lhs, Rep const& rhs) SAL_THROW(())
-{
- return (lhs.countComponents() == rhs.countComponents()) &&
- std::equal(lhs.begin(),lhs.end(),rhs.begin(),Equiv());
-}
-//-----------------------------------------------------------------------------
-
-bool matches(Rep const& lhs, Rep const& rhs) SAL_THROW(())
-{
- return (lhs.countComponents() == rhs.countComponents()) &&
- std::equal(lhs.begin(),lhs.end(),rhs.begin(),Matches());
-}
-//-----------------------------------------------------------------------------
-
-bool isAbsolutePath(rtl::OUString const& _sPath) SAL_THROW(())
-{
- return detectAbsolutePath(_sPath);
-}
-//-----------------------------------------------------------------------------
-
-bool hasMatchingPrefix(Rep const& _aPath, Rep const& _aPrefix) SAL_THROW(())
-{
- return (_aPath.countComponents() >= _aPrefix.countComponents()) &&
- std::equal( _aPrefix.begin(), _aPrefix.end(), _aPath.begin(), Matches());
-}
-//-----------------------------------------------------------------------------
-
-Rep stripMatchingPrefix(Rep const& _aPath,Rep const& _aPrefix) // SAL_THROW((InvalidName))
-{
- Rep aResult(_aPath);
-
- for (std::vector<Component>::const_reverse_iterator it = _aPrefix.begin(); it != _aPrefix.end(); ++it)
- {
- if (aResult.isEmpty() || !matches(*it,aResult.getFirstName()))
- throw InvalidName(aResult.getFirstName().toPathString(), "does not match the expected location.");
-
- aResult.dropFirstName();
- }
-
- return aResult;
-}
-//-----------------------------------------------------------------------------
-} // namespace Path
-//-----------------------------------------------------------------------------
-
-namespace
-{
-//-----------------------------------------------------------------------------
- const sal_Unicode c_quot = '\"';
- const sal_Unicode c_apos = '\'';
- const sal_Unicode c_amp = '&';
-
- const sal_Unicode c_end_escape = ';';
-
- const sal_Unicode c_normal_quot = c_apos;
- //-------------------------------------------
- static sal_Char const c_amp_name[] = "&amp;";
- static sal_Char const c_apos_name[] = "&apos;";
- static sal_Char const c_quot_name[] = "&quot;";
-
- const sal_Int32 c_nMinEscapeLen = sizeof c_amp_name - 1;
- const sal_Int32 c_nMaxEscapeLen = sizeof c_quot_name - 1;
-//-------------------------------------------------------------------------
- /// distinguishes which kind of path is held in a path object
- enum PathType { eRELATIVE = 1, eABSOLUTE = 2 };
-
-//-----------------------------------------------------------------------------
- // missing or mis leading in SAL/rtl: pStr1[nLength] must NOT be evaluated
- static
- sal_Int32 cfg_ustr_ascii_compare_WithLength( const sal_Unicode* pStr1,
- sal_Int32 nStr1Len,
- const sal_Char* pStr2 )
- {
- while( nStr1Len )
- {
- sal_Int32 nRet = static_cast<sal_Int32>(*pStr1)-
- static_cast<sal_Int32>(static_cast<unsigned char>(*pStr2));
-
- if (nRet != 0 || *pStr2 == 0) return nRet;
-
- ++pStr1;
- ++pStr2;
- --nStr1Len;
- }
-
- return -static_cast<sal_Int32>(static_cast<unsigned char>(*pStr2));
- }
-//-----------------------------------------------------------------------------
-
-
- /** find the char being escaped by the escape sequence in the given string range
- @return
- the char being escaped or zero, if the range is no known escape
- */
- sal_Unicode implParseEscape(sal_Unicode const * pBegin, sal_Unicode const * pEnd) SAL_THROW(())
- {
- OSL_PRECOND( pBegin < pEnd, "Nonempty string range expected" );
- OSL_PRECOND( pBegin[0] == c_amp, "String range is not a possible escape: missing start marker" );
- OSL_PRECOND( pEnd[-1] == c_end_escape, "String range is not a possible escape: missing end marker" );
-
- sal_Int32 const nLen = pEnd - pBegin;
-
- sal_Unicode chResult;
-
- if ( c_nMinEscapeLen > nLen || nLen > c_nMaxEscapeLen) // quick check, if there is no possible match
- chResult = 0;
- // the standard escapes
- else if (0 == cfg_ustr_ascii_compare_WithLength(pBegin,nLen,c_amp_name)) chResult = c_amp;
- else if (0 == cfg_ustr_ascii_compare_WithLength(pBegin,nLen,c_apos_name)) chResult = c_apos;
- else if (0 == cfg_ustr_ascii_compare_WithLength(pBegin,nLen,c_quot_name)) chResult = c_quot;
- // extra escapes for XML compatibility
- else if (0 == cfg_ustr_ascii_compare_WithLength(pBegin,nLen,"&lt;")) chResult = sal_Unicode('<');
- else if (0 == cfg_ustr_ascii_compare_WithLength(pBegin,nLen,"&gt;")) chResult = sal_Unicode('>');
- else chResult = 0;
-
- return chResult;
- }
-
-//-----------------------------------------------------------------------------
-
- /** find the escape sequence to use for the given char
- @return
- an escape sequence, or NULL, if the char should not be escaped
- */
- inline
- sal_Char const* implGetEscape(sal_Unicode ch ) SAL_THROW(())
- {
- switch (ch)
- {
- case c_amp: return c_amp_name;
- case c_apos: return c_apos_name;
- case c_quot: return c_quot_name;
-
- default: return NULL;
- }
- }
-
-//-----------------------------------------------------------------------------
-
- /** find the start of the path component ending before pEnd in the string starting at pBegin
- @return
- a pointer to the last character before pEnd that is not a name delimiter
- */
- sal_Unicode const * implFindNameStart(sal_Unicode const * pBegin, sal_Unicode const * pEnd) SAL_THROW(())
- {
- OSL_PRECOND(pBegin <= pEnd, "Invalid string range");
-
- sal_Int32 const nLen = pEnd-pBegin;
- sal_Int32 const nPos = rtl_ustr_lastIndexOfChar_WithLength(pBegin, nLen, c_cDelimiter) + 1;
-
- OSL_ASSERT(0 <= nPos && nPos <= nLen);
-
- return pBegin + nPos;
- }
-//-----------------------------------------------------------------------------
-
- /** find the start of the bracketed & quoted predicate ending before pEnd in the string starting at pBegin
- @return
- <ul><li>a pointer to the opening bracket matching the closing bracket at pEnd[-1], if found</li>
- <li><var>pEnd</var>, if no bracketed string was found</li>
- <li>NULL, if there was a closing bracket, but the beginning could not be discovered</li></ul>
- */
- sal_Unicode const * implFindPredicateStart(sal_Unicode const * pBegin, sal_Unicode const * pEnd) SAL_THROW(())
- {
- OSL_PRECOND(pBegin < pEnd, "Nonempty string range required");
-
- if (pEnd == pBegin || pEnd[-1] != c_rBracket) return pEnd;
-
- if (--pEnd == pBegin)
- {
- OSL_ENSURE(false, "Invalid path component: single ']'");
- return NULL; // string was only "]"
- }
-
- sal_Unicode chQuote = *--pEnd;
-
- if (chQuote != c_quot && chQuote != c_apos)
- {
- // should we support empty brackets ?
- if (chQuote == c_lBracket)
- {
- OSL_ENSURE(false, "Empty predicate brackets found");
- return NULL; // for now we don't
-
- }
-
- // should we support brackets with non-quoted strings ?
- chQuote = c_lBracket; // for now we do
- }
-
- sal_Int32 nStart = rtl_ustr_lastIndexOfChar_WithLength(pBegin, pEnd-pBegin, chQuote);
-
- if (chQuote != c_lBracket) // needed to support non-quoted strings
- --nStart;
-
- if (nStart < 0)
- {
- OSL_ENSURE(false, "Could not find opening quote or bracket for bracketed predicate");
- return NULL;
- }
-
- if (pBegin[nStart] != c_lBracket)
- {
- OSL_ENSURE(false, "Illegal quote character in string");
- return NULL; // for now we don't
- }
-
- return pBegin + nStart;
- }
-//-----------------------------------------------------------------------------
-
- /// find the position of the given char in the range given.
- inline
- sal_Int32 indexOfCharInRange(sal_Unicode const * pBegin, sal_Unicode const * pEnd, sal_Unicode ch) SAL_THROW(())
- {
- return rtl_ustr_indexOfChar_WithLength(pBegin, pEnd-pBegin, ch);
- }
-//-----------------------------------------------------------------------------
-
- /// find the position of the given char in the range given.
- inline
- bool containsChar(sal_Unicode const * pString, sal_Unicode ch) SAL_THROW(())
- {
- return rtl_ustr_indexOfChar(pString, ch) >= 0;
- }
-//-----------------------------------------------------------------------------
-
- /** validate and normalize a bracketed & quoted predicate from content the string range [pBegin,pEnd)
- @param pRequiredEscapes
- contains a list of characters that must be preescaped or are otherwise invalid
- if NULL is passed, the source range is presumed to contain no escaped data
- otherwise the ampersand (&) and all characters in the list are required to be escaped
- @return
- the normalized, bracketed and quoted predicate
- @throw
- InvalidName, if the predicate data is not valid
- */
- rtl::OUString implMakeNormalizedPredicate(sal_Unicode const * pBeginContent, sal_Unicode const * pEndContent, sal_Unicode const* pRequiredEscapes) SAL_THROW((InvalidName))
- {
- OSL_PRECOND(pBeginContent <= pEndContent, "Invalid string range");
- if (pBeginContent == pEndContent)
- return rtl::OUString();
-
- rtl::OUStringBuffer aNormalized(pEndContent-pBeginContent + 4); // reserve approximate size initially
-
- // prefix: opening bracket and quote
- aNormalized.append(c_lBracket).append(c_normal_quot);
-
- // content: copy over each char and handle escaping
- for(sal_Unicode const * pCur = pBeginContent; pCur != pEndContent; ++pCur)
- {
- sal_Unicode ch = *pCur;
-
- // maybe parse contained escaping
- if (pRequiredEscapes)
- {
- if (ch == c_amp)
- {
- // find an escape end marker (after pCur). Result is pCur, if the end marker is not there
- sal_Unicode const * pEndEscape = pCur + 1 + indexOfCharInRange(pCur+1,pEndContent,c_end_escape);
- sal_Unicode ch2 = pCur != pEndEscape ? implParseEscape(pCur,pEndEscape+1) : 0;
-
- if (ch2 != 0) // found and read a valid escape sequence
- {
- ch = ch2;
- pCur = pEndEscape;
- OSL_ASSERT(*pCur == c_end_escape);
- }
- else
- {
- OSL_ENSURE(false, "Character '&' must be escaped in this context");
- #if 0
- throw InvalidName(rtl::OUString(pBeginContent,pEndContent-pBeginContent),
- "is not a valid element name string. "
- "Character '&' must be escaped in this context");
- #endif
- }
- }
- else if ( containsChar(pRequiredEscapes, ch) )
- {
- throw InvalidName(rtl::OUString(pBeginContent,pEndContent-pBeginContent),
- "is not a valid element name string. "
- "Some characters must be escaped in this context");
- }
- }
-
- // now append (escape if normal)
- if (sal_Char const * pEscape = implGetEscape(ch))
- aNormalized.appendAscii( pEscape );
-
- else
- aNormalized.append( ch );
- }
-
- // suffix: closing quote and bracket
- aNormalized.append(c_normal_quot).append(c_rBracket);
-
- return aNormalized.makeStringAndClear();
- }
-//-----------------------------------------------------------------------------
-
- /** extract and unescape the normalized predicate content in the string range [pBegin,pEnd)
- @return
- the denormalized predicate content
- */
- rtl::OUString implReadPredicate(sal_Unicode const * pBegin, sal_Unicode const * pEnd) SAL_THROW(())
- {
- OSL_PRECOND(pBegin <= pEnd, "Invalid string range");
-
- rtl::OUStringBuffer aContent(pEnd-pBegin); // reserve approximate size initially
-
- sal_Unicode const * pReadPos = pBegin;
-
- // content: copy data, handling escapes
- for(sal_Unicode const * pCur = pReadPos; pCur != pEnd; ++pCur)
- {
- if (*pCur != c_amp) continue; // no escape here
-
- // handle an escape
- // find an escape end marker (after pCur). Result is pCur, if the end marker is not there
- sal_Unicode const * pEndEscape = pCur + 1 + indexOfCharInRange(pCur+1,pEnd,c_end_escape);
-
- OSL_ENSURE(pEndEscape != pCur, "Found dangling ampersand in normalized data");
-
- sal_Unicode ch = implParseEscape(pCur,pEndEscape+1);
-
- OSL_ENSURE(ch != 0, "Found unreckognized escape in normalized data");
-
- if (ch != 0) // found and read a valid escape sequence
- {
- // do copy of preceding data
- aContent.append(pReadPos, pCur-pReadPos).append(ch);
- pCur = pReadPos = pEndEscape;
-
- ++pReadPos;
-
- OSL_ASSERT(*pCur == c_end_escape);
- }
- // otherwise just treat the ampersand as a mormal character
- }
-
- // do copy of remaining data
- if (pReadPos != pEnd)
- aContent.append(pReadPos, pEnd-pReadPos);
-
- return aContent.makeStringAndClear();
- }
-//-----------------------------------------------------------------------------
-
- /** validate and normalize the bracketed & quoted predicate in the string range [pBegin,pEnd)
- @return
- the normalized predicate
- @throw
- InvalidName, if the predicate is not valid
- */
- rtl::OUString implNormalizePredicate(sal_Unicode const * pBegin, sal_Unicode const * pEnd) SAL_THROW((InvalidName))
- {
- sal_Unicode sStopCharBuf[2];
- sal_Unicode const * pStopChars;
-
- OSL_PRECOND(pBegin < pEnd, "Nonempty string range expected");
- OSL_PRECOND(pEnd-pBegin >= 2, "Bracketed string range expected");
- OSL_PRECOND(pBegin[0] == c_lBracket,"Bracketed string range expected");
- OSL_PRECOND(pEnd[-1] == c_rBracket, "Bracketed string range expected");
-
- ++pBegin; --pEnd; // skip brackets
-
- sal_Unicode const chUsedQuot = *pBegin;
- if (chUsedQuot == c_apos || chUsedQuot == c_quot)
- {
- OSL_PRECOND(pBegin < pEnd && pEnd-pBegin >= 2, "Bracketed quoted string range expected");
- OSL_PRECOND(pEnd[-1] == chUsedQuot, "Non-matching quotes in bracketed quoted string");
-
- if (pEnd-pBegin <= 1 || pEnd[-1] != chUsedQuot)
- throw InvalidName( rtl::OUString(pBegin, pEnd-pBegin), "is not a valid element predicate: quotes do not match");
-
- ++pBegin; --pEnd; // skip quotes
-
- sStopCharBuf[0] = chUsedQuot;
- sStopCharBuf[1] = 0;
-
- pStopChars = sStopCharBuf;
- }
-
- // non-quoted strings are not really valid, but we tolerate them
- else
- {
- OSL_ENSURE(false, "Warning: Invalid path - non-quoted data in bracketed predicate");
-
- static sal_Unicode const sGeneralStoppers[] = { c_quot, c_apos, c_rBracket, c_lBracket, 0 };
-
- pStopChars = sGeneralStoppers;
- }
-
- if (pBegin == pEnd)
- throw InvalidName(rtl::OUString(pBegin-1,2),"Empty element name in predicate");
-
- return implMakeNormalizedPredicate(pBegin, pEnd, pStopChars);
- }
-//-----------------------------------------------------------------------------
- /// parse a path into a sequence of components
- Path::Rep implParsePath(rtl::OUString const& _aPathString, PathType eType) SAL_THROW((InvalidName))
- {
- Path::Rep aResult;
-
- dprint (stderr, "implParsePath '%s' ",
- rtl::OUStringToOString(_aPathString, RTL_TEXTENCODING_UTF8).getStr());
-
- sal_Unicode const * pBegin = _aPathString.getStr();
- sal_Unicode const * pEnd = pBegin + _aPathString.getLength();
-
- if (eType == eABSOLUTE)
- {
- if ( detectAbsolutePath(_aPathString) )
- ++pBegin; // skip the leading slash
-
-#ifdef CFG_PATH_STRICT
- else
- OSL_ENSURE(false, "Warning: trying to parse relative path as absolute");
-#endif
- }
- else
- OSL_ENSURE(!detectAbsolutePath(_aPathString), "ERROR: trying to parse absolute path as relative one");
-
- if (detectAbsolutePath(pBegin))
- throw InvalidName(_aPathString, "is not a valid path. Illegal empty first component");
-
- else if (pBegin != pEnd && pEnd[-1] == '/')
- {
-#ifdef CFG_PATH_STRICT
- OSL_ENSURE(false, "Illegal configuration path. Terminating '/' found.");
-#endif
- --pEnd;
- }
-
- while (pEnd != pBegin)
- {
- // check for predicate
- sal_Unicode const * pQuoteStart = implFindPredicateStart(pBegin, pEnd);
- if (pQuoteStart == NULL)
- throw InvalidName(_aPathString, "is not a valid path. Invalid name or predicate syntax");
-
- sal_Unicode const * pNameStart = implFindNameStart(pBegin, pQuoteStart);
-
- rtl::OUString aElementName(pNameStart, pQuoteStart-pNameStart);
-
- if (!isSimpleName(aElementName))
- {
- // this is OK only for few cases WITH predicate
- if (pQuoteStart == pEnd)
- throw InvalidName(_aPathString, "is not a valid path. Invalid name");
-
- if (isEmptyString(aElementName))
- aElementName = makeWildcardType();
-
- else if ( !isWildcardType(aElementName))
- throw InvalidName(_aPathString, "is not a valid path. Invalid type tag for predicate");
- }
- if (pQuoteStart != pEnd)
- {
- dprint (stderr, "add 'normalize predicate'", "");
- rtl::OUString aPred = implNormalizePredicate(pQuoteStart,pEnd);
- aElementName += aPred;
- dprint (stderr, " [result pred '%s']",
- rtl::OUStringToOString(aPred, RTL_TEXTENCODING_UTF8).getStr());
- }
-
- aResult.prepend( Path::Component(aElementName) );
-
- pEnd = pNameStart;
- if (pNameStart != pBegin) --pEnd;
- }
- dprint (stderr, "\n", "");
- return aResult;
- }
-//-----------------------------------------------------------------------------
-
- /// build a composite path component from a base name (type) and a (somewhat optional) predicate
- rtl::OUString implMakeCompositeName(rtl::OUString const& _sBaseName, rtl::OUString const& _sPredicate) SAL_THROW((InvalidName))
- {
- rtl::OUString sComposite(_sBaseName);
-
- if (isEmptyString(_sBaseName))
- sComposite = makeWildcardType();
-
- else if (!isWildcardType(_sBaseName) && !isSimpleName(_sBaseName))
- throw InvalidName(_sBaseName, "The base-name (type) part of a composite node name must be a simple word");
-
- dprint (stderr, "implMakeNormalizePred '%s' ",
- rtl::OUStringToOString(_sPredicate, RTL_TEXTENCODING_UTF8).getStr());
-
- sal_Unicode const * pPredStart = _sPredicate.getStr();
- sal_Unicode const * pPredEnd = pPredStart + _sPredicate.getLength();
-
- if (pPredStart != pPredEnd)
- sComposite += implMakeNormalizedPredicate(pPredStart, pPredEnd, NULL);
-
- dprint (stderr, " [result pred '%s']\n",
- rtl::OUStringToOString(sComposite, RTL_TEXTENCODING_UTF8).getStr());
-
- return sComposite;
- }
-//-----------------------------------------------------------------------------
-
- /// split a composite path component into a base name (type) and a predicate (if present)
- void implSplitCompositeName(rtl::OUString const& _aCompositeName, rtl::OUString& _rBaseName, rtl::OUString& _rPredicate) SAL_THROW(())
- {
- sal_Int32 nPos = _aCompositeName.indexOf(c_lBracket);
-
- if (nPos >= 0)
- {
- OSL_ENSURE( nPos > 0, "Invalid name: Only predicate, no base type");
-
- _rBaseName = _aCompositeName.copy(0,nPos);
-
- sal_Unicode const * pBeginPred = _aCompositeName.getStr() + nPos;
- sal_Unicode const * pEndPred = _aCompositeName.getStr() + _aCompositeName.getLength();
-
- OSL_ASSERT(pBeginPred[0] == c_lBracket);
- OSL_ENSURE(pBeginPred[1] == c_normal_quot, "Missing or unexpected quote mark");
- OSL_ENSURE(pEndPred[-1] == c_rBracket, "Invalid name: Predicate brackets not closed");
- OSL_ENSURE(pEndPred[-2] == c_normal_quot, "Missing or unexpected quote mark");
-
- // skip brackets and quotes - then read data
- _rPredicate = implReadPredicate(pBeginPred+2, pEndPred-2);
- }
- else
- {
- OSL_ENSURE( _aCompositeName.indexOf(c_rBracket) < 0, "Invalid name: Predicate brackets not opened");
- _rBaseName = _aCompositeName;
- _rPredicate = rtl::OUString();
- }
- }
-//-----------------------------------------------------------------------------
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// class RelativePath
-//-----------------------------------------------------------------------------
-
-// Currently unused method to check/ensure validity
-void RelativePath::init() SAL_THROW(())
-{
-}
-//-----------------------------------------------------------------------------
-
-RelativePath RelativePath::parse(rtl::OUString const& aString)
-{
- return RelativePath( implParsePath(aString, eRELATIVE) );
-}
-//-----------------------------------------------------------------------------
-
-RelativePath::RelativePath(Path::Component const& aName) SAL_THROW(())
-: m_aRep(aName)
-{
- if (aName.isEmpty()) m_aRep.clearComponents();
-}
-//-----------------------------------------------------------------------------
-
-RelativePath RelativePath::compose(RelativePath const& aPath) const SAL_THROW(())
-{
- Path::Rep aResult = aPath.rep();
- aResult.prepend( this->m_aRep );
- return RelativePath( aResult );
-}
-//-----------------------------------------------------------------------------
-rtl::OUString RelativePath::toString() const SAL_THROW(())
-{
- return m_aRep.toString(false);
-}
-
-//-----------------------------------------------------------------------------
-// class AbsolutePath
-//-----------------------------------------------------------------------------
-
-// Currently unused method to check/ensure validity
-void AbsolutePath::init() SAL_THROW(())
-{
-}
-//-----------------------------------------------------------------------------
-
-AbsolutePath AbsolutePath::parse(rtl::OUString const& aString)
-{
- return AbsolutePath( implParsePath(aString, eABSOLUTE) );
-}
-//-----------------------------------------------------------------------------
-
-AbsolutePath AbsolutePath::root() SAL_THROW(())
-{
- return AbsolutePath( Path::Rep() );
-}
-//-----------------------------------------------------------------------------
-
-AbsolutePath AbsolutePath::detachedRoot() SAL_THROW(())
-{
- Path::Rep aRep( Path::makeEmptyComponent() ); // use 1 empty component here, to start detached names
- return AbsolutePath( aRep );
-}
-//-----------------------------------------------------------------------------
-
-static inline Path::Component implMakeSafeModuleName(rtl::OUString const& _sModuleName) SAL_THROW(())
-{
- OSL_ENSURE( isSimpleName(_sModuleName), "A module name must be a simple name");
-
- // if (isSimpleName(_sModuleName)) sModuleName = escape_name( _sModuleName );
-
- return Path::Component(_sModuleName);
-}
-//-----------------------------------------------------------------------------
-
-AbsolutePath AbsolutePath::makeModulePath(rtl::OUString const& _sModuleName) SAL_THROW(())
-{
- return AbsolutePath( Path::Rep( implMakeSafeModuleName(_sModuleName) ) );
-}
-//-----------------------------------------------------------------------------
-
-AbsolutePath AbsolutePath::compose(RelativePath const& aPath) const SAL_THROW(())
-{
- Path::Rep aResult = aPath.rep();
- aResult.prepend( this->m_aRep );
- return AbsolutePath( aResult );
-}
-//-----------------------------------------------------------------------------
-
-AbsolutePath AbsolutePath::getParentPath() const
-{
- // or: m_aRep.check_not_empty();
- OSL_ENSURE(!isRoot(), "ERROR: Requesting the parent of a root path");
- if (isRoot()) return *this;
-
- OSL_ENSURE(!isDetached(), "ERROR: Requesting the parent of a detached path");
-
- return AbsolutePath( Path::Rep(begin(),end()-1) );
-}
-#if OSL_DEBUG_LEVEL > 0
-//-----------------------------------------------------------------------------
-
-bool AbsolutePath::isDetached() const SAL_THROW(())
-{
- return !m_aRep.isEmpty() && begin()->isEmpty();
-}
-#endif
-//-----------------------------------------------------------------------------
-
-rtl::OUString AbsolutePath::toString() const SAL_THROW(())
-{
- return m_aRep.toString(true);
-}
-//-----------------------------------------------------------------------------
- }
-}
-
diff --git a/configmgr/source/treemgr/configset.cxx b/configmgr/source/treemgr/configset.cxx
deleted file mode 100644
index 6322503a0b..0000000000
--- a/configmgr/source/treemgr/configset.cxx
+++ /dev/null
@@ -1,574 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h> // needed for Solaris 8
-#include "configset.hxx"
-#include "nodechange.hxx"
-#include "nodechangeimpl.hxx"
-#include "tree.hxx"
-#include "treefragment.hxx"
-#include "template.hxx"
-#include "templateimpl.hxx"
-#include "configgroup.hxx"
-#include "valuenode.hxx"
-#include "valuenodeimpl.hxx"
-#include "setnodeimpl.hxx"
-#include <vos/refernce.hxx>
-
-namespace configmgr
-{
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-// class SetElementFactory
-//-----------------------------------------------------------------------------
-
-SetElementFactory::SetElementFactory(TemplateProvider const& aProvider)
-: m_aProvider(aProvider)
-{
- OSL_ENSURE(aProvider.m_aImpl.is(), "WARNING: Template Instance Factory created without template provider - cannot instantiate elements");
-}
-//-----------------------------------------------------------------------------
-
-SetElementFactory::SetElementFactory(SetElementFactory const& aOther)
-: m_aProvider(aOther.m_aProvider)
-{
-}
-//-----------------------------------------------------------------------------
-
-SetElementFactory& SetElementFactory::operator=(SetElementFactory const& aOther)
-{
- m_aProvider = aOther.m_aProvider;
- return *this;
-}
-//-----------------------------------------------------------------------------
-
-SetElementFactory::~SetElementFactory()
-{
-}
-
-//-----------------------------------------------------------------------------
-rtl::Reference< ElementTree > SetElementFactory::instantiateTemplate(rtl::Reference<Template> const& aTemplate)
-{
- OSL_ENSURE(m_aProvider.m_aImpl.is(), "ERROR: Template Instance Factory has no template provider - cannot instantiate element");
- OSL_ENSURE(aTemplate.is(), "ERROR: Template is NULL - cannot instantiate element");
-
- rtl::Reference< data::TreeSegment > aInstanceTree( m_aProvider.m_aImpl->instantiate(aTemplate) );
- OSL_ENSURE(aInstanceTree.is(), "ERROR: Cannot create Element Instance: Provider could not instantiate template");
-
- //set removable state
- aInstanceTree->fragment->header.state |= data::State::flag_removable;
-
- return new ElementTree( aInstanceTree, aTemplate, m_aProvider );
-}
-//-----------------------------------------------------------------------------
-rtl::Reference< ElementTree > SetElementFactory::instantiateOnDefault(rtl::Reference< data::TreeSegment > const& _aElementData, rtl::Reference<Template> const& aDummyTemplate)
-{
-// OSL_ENSURE(m_aProvider.m_aImpl(), "ERROR: Template Instance Factory has no template provider - cannot instantiate element");
- OSL_ENSURE(_aElementData.is(), "ERROR: Tree is NULL - cannot instantiate element");
- OSL_ENSURE(aDummyTemplate.is(), "ERROR: Template is NULL - cannot instantiate element");
-
- return new ElementTree( _aElementData, aDummyTemplate, m_aProvider );
-}
-//-----------------------------------------------------------------------------
-
-TemplateProvider SetElementFactory::findTemplateProvider(rtl::Reference< Tree > const& aTree, NodeRef const& aNode)
-{
- OSL_ENSURE(!isEmpty(aTree.get()), "ERROR: Getting Element Factory requires a valid tree");
- OSL_ENSURE(aNode.isValid(), "ERROR: Getting Element Factory requires a valid node");
- OSL_ENSURE(aTree->isValidNode(aNode.getOffset()), "ERROR: Tree/Node mismatch");
- if (aNode.isValid() )
- {
- view::ViewTreeAccess aView(aTree.get());
-
- OSL_ENSURE (aView.isSetNode(aNode), "WARNING: Getting Element Factory requires a SET node");
- if (aView.isSetNode(aNode))
- return aView.getTemplateProvider(aView.toSetNode(aNode));
- }
- return TemplateProvider();
-}
-
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// class TreeSetUpdater and ValueSetUpdater
-//-----------------------------------------------------------------------------
-
-static node::Attributes getNewElementAttributes(bool bInserting)
-{
- node::Attributes aResult;
- aResult.setState( node::isReplaced );
- //Check if you are inserting new dynamic property
- if(bInserting)
- {
- aResult.markRemovable();
- }
- return aResult;
-}
-
-// Value Element Factory methods
-//-----------------------------------------------------------------------------
-
-rtl::Reference<ElementTree> ValueSetUpdater::makeValueElement(rtl::OUString const& aName, com::sun::star::uno::Any const& aValue, bool bInserting)
-{
-
- const node::Attributes aNewValueAttributes = getNewElementAttributes(bInserting); // TODO: get real value
-
- com::sun::star::uno::Type aType = m_aTemplate->getInstanceType();
-
- rtl::OUString aTypeName = m_aTemplate->getName();
-
- std::auto_ptr<INode> pNode;
- if (aValue.hasValue())
- pNode.reset( new ValueNode(aTypeName, aValue, aNewValueAttributes) );
- else
- pNode.reset( new ValueNode(aTypeName, aType, aNewValueAttributes) );
-
- rtl::Reference< data::TreeSegment > aValueTree = data::TreeSegment::create(aName, pNode);
-
- return new ElementTree(aValueTree, m_aTemplate, TemplateProvider() );
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference<ElementTree> ValueSetUpdater::makeValueElement(rtl::OUString const& aName, rtl::Reference< Tree > const& , com::sun::star::uno::Any const& aValue, bool bInserting)
-{
- // for now ignoring the node.
- // TODO: merge attributes etc. from that node's value
- return makeValueElement(aName, aValue,bInserting);
-}
-//-----------------------------------------------------------------------------
-
-
-TreeSetUpdater::TreeSetUpdater(rtl::Reference< Tree > const& aParentTree, NodeRef const& aSetNode, rtl::Reference< Template > const& aTemplate)
-: m_aParentTree(aParentTree)
-, m_aSetNode(aSetNode)
-, m_aTemplate(aTemplate)
-{
- implValidateSet();
-}
-//-----------------------------------------------------------------------------
-
-ValueSetUpdater::ValueSetUpdater(rtl::Reference< Tree > const& aParentTree, NodeRef const& aSetNode,
- rtl::Reference< Template > const& aTemplate, com::sun::star::uno::Reference<com::sun::star::script::XTypeConverter> const& xConverter)
-: m_aParentTree(aParentTree)
-, m_aSetNode(aSetNode)
-, m_aTemplate(aTemplate)
-, m_xTypeConverter(xConverter)
-{
- implValidateSet();
-}
-//-----------------------------------------------------------------------------
-
-SetDefaulter::SetDefaulter(rtl::Reference< Tree > const& aParentTree, NodeRef const& aSetNode,
- DefaultProvider const& aDefaultProvider)
-: m_aParentTree(aParentTree)
-, m_aSetNode(aSetNode)
-, m_aDefaultProvider(aDefaultProvider)
-{
- implValidateSet();
-}
-//-----------------------------------------------------------------------------
-
-/// validates that a actual set and an updater's construction parameters match
-static void doValidateSet(rtl::Reference< Tree > const& aParentTree, NodeRef const& aSetNode)
-{
- if (isEmpty(aParentTree.get()))
- throw Exception("INTERNAL ERROR: Set Update: Unexpected NULL tree");
-
- if (!aSetNode.isValid())
- throw Exception("INTERNAL ERROR: Set Update: Unexpected NULL node");
-
- if (!aParentTree->isValidNode(aSetNode.getOffset()))
- throw Exception("INTERNAL ERROR: Set Update: node does not match tree");
-
- if (! view::ViewTreeAccess(aParentTree.get()).isSetNode(aSetNode))
- throw Exception("INTERNAL ERROR: Set Update: node is not a set");
-
- if (aParentTree->getAttributes(aSetNode).isReadonly())
- throw ConstraintViolation( "Set Update: Set is read-only !" );
-}
-//-----------------------------------------------------------------------------
-
-/// validates that the actual set and the construction parameters match
-void TreeSetUpdater::implValidateSet()
-{
- doValidateSet(m_aParentTree,m_aSetNode);
-
- if (!m_aTemplate.is())
- throw Exception("INTERNAL ERROR: No template available for tree set update");
-
- if (m_aTemplate->isInstanceValue())
- throw Exception("INTERNAL ERROR: Tree set update invoked on a value-set");
-
- view::ViewTreeAccess aParentView(m_aParentTree.get());
-
- if ( aParentView.getElementTemplate(aParentView.toSetNode(m_aSetNode)) != m_aTemplate)
- throw Exception("INTERNAL ERROR: Set Update: template mismatch");
-}
-//-----------------------------------------------------------------------------
-
-/// validates that the actual set and the construction parameters match
-void ValueSetUpdater::implValidateSet()
-{
- doValidateSet(m_aParentTree,m_aSetNode);
-
- com::sun::star::uno::Type aThisType = m_aTemplate->getInstanceType();
-
- switch ( aThisType.getTypeClass())
- {
- case uno::TypeClass_VOID: throw Exception("INTERNAL ERROR: Value set element type is void");
- case uno::TypeClass_INTERFACE: throw Exception("INTERNAL ERROR: Value update invoked on a complex set");
-
- case uno::TypeClass_STRUCT:
- case uno::TypeClass_EXCEPTION: throw Exception("INTERNAL ERROR: Unexpected/Invalid type for set elements");
-
- default: break;
- }
-
- view::ViewTreeAccess aParentView(m_aParentTree.get());
-
- if ( aParentView.getElementTemplate(aParentView.toSetNode(m_aSetNode))->getInstanceType() != aThisType)
- throw Exception("INTERNAL ERROR: Set Update: element type mismatch");
-}
-//-----------------------------------------------------------------------------
-
-/// validates that the actual set and the construction parameters match
-void SetDefaulter::implValidateSet()
-{
- doValidateSet(m_aParentTree,m_aSetNode);
-
- if (!m_aDefaultProvider.isValid())
- throw Exception("INTERNAL ERROR: No default provider available for restoring set default state");
-}
-//-----------------------------------------------------------------------------
-
-static void doValidateElement(rtl::Reference< ElementTree > const& aElement, bool bReqRemovable)
-{
- if (!aElement.is())
- throw Exception("INTERNAL ERROR: Set Update: Unexpected NULL element");
-
- if ( bReqRemovable)
- {
- rtl::Reference< Tree > aElementTree = aElement.get();
-
- if(!aElementTree->getAttributes(aElementTree->getRootNode()).isRemovable())
- throw ConstraintViolation( "New Set Update: Existing element cannot be removed (or replaced) !" );
- }
-}
-//-----------------------------------------------------------------------------
-
-/// validates that the given element is valid in this context and returns its name
-Path::Component TreeSetUpdater::implValidateElement(rtl::Reference< ElementTree > const& aElement, bool bReqRemovable)
-{
- doValidateElement(aElement,bReqRemovable);
- return aElement->getExtendedRootName();
-}
-//-----------------------------------------------------------------------------
-
-/// validates that the given element is valid and can be replaced in this context and returns its name
-Path::Component ValueSetUpdater::implValidateElement(rtl::Reference< ElementTree > const& aElement, bool mReqRemovable)
-{
- doValidateElement(aElement,mReqRemovable);
-
-#if OSL_DEBUG_LEVEL > 0
- com::sun::star::uno::Type aNodeType = ElementHelper::getUnoType(aElement);
-
- OSL_ENSURE(aNodeType.getTypeClass() != uno::TypeClass_VOID, "INTERNAL ERROR: Set Element without associated type found");
- OSL_ENSURE(aNodeType.getTypeClass() != uno::TypeClass_INTERFACE,"INTERNAL ERROR: Set Element with complex type found");
-
- OSL_ENSURE(aNodeType == m_aTemplate->getInstanceType() ||
- uno::TypeClass_ANY == m_aTemplate->getInstanceType().getTypeClass(),
- "INTERNAL ERROR: Set Update: existing element does not match template type");
-#endif
-
- return aElement->getExtendedRootName();
-}
-//-----------------------------------------------------------------------------
-static void checkEligibleChild(rtl::Reference< ElementTree > const& aElementTree, rtl::Reference< Tree > const& aParentTree)
-{
- ElementTree const * const pElement = aElementTree.get(); OSL_ASSERT(pElement);
-
- if (pElement->getContextTree() != NULL)
- throw ConstraintViolation( "Set Update: cannot insert an element that already has a parent." );
-
- Tree const* pAncestor = aParentTree.get();
- while (pAncestor != NULL)
- {
- if (pElement == pAncestor)
- throw ConstraintViolation( "Set Update: Circular insertion - trying to insert an element into self or descendant" );
-
- pAncestor = pAncestor->getContextTree();
- OSL_ENSURE(pAncestor != aParentTree.get(), "ERROR: Circular tree found");
- }
-}
-
-//-----------------------------------------------------------------------------
-
-void TreeSetUpdater::implValidateTree(rtl::Reference< ElementTree > const& aElementTree)
-{
- if (!aElementTree.is())
- throw ConstraintViolation( "Set Update: cannot replace element of complex set with NULL node. Remove the element instead !" );
-
- checkEligibleChild(aElementTree,m_aParentTree);
-
- if (! aElementTree->isTemplateInstance())
- {
- throw TypeMismatch(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("<Unnamed> (Template missing)")),
- m_aTemplate->getName(), " - new element without template in Set Update");
- }
-
- if (!aElementTree->isInstanceOf(m_aTemplate))
- {
- throw TypeMismatch( aElementTree->getTemplate()->getPathString(),
- m_aTemplate->getPathString(), " - new element without template in Set Update");
- }
-}
-//-----------------------------------------------------------------------------
-
-com::sun::star::uno::Any ValueSetUpdater::implValidateValue(com::sun::star::uno::Any const& aValue)
-{
- com::sun::star::uno::Type const aThisType = m_aTemplate->getInstanceType();
-
- OSL_ENSURE( aThisType.getTypeClass() == uno::TypeClass_ANY || isPossibleValueType(aThisType),
- "Invalid element type for value set" );
-
- com::sun::star::uno::Any aRet;
- if (aValue.hasValue())
- {
- com::sun::star::uno::Type const aValType = aValue.getValueType();
-
- if (aValType.getTypeClass() == uno::TypeClass_INTERFACE)
- throw TypeMismatch(aValType.getTypeName(), aThisType.getTypeName(), " - cannot replace value by complex tree in Set update");
-
- if (aValType == aThisType)
- {
- aRet = aValue;
- }
-
- else if ( uno::TypeClass_ANY == aThisType.getTypeClass() )
- {
- if ( ! isPossibleValueType(aValType) )
- throw TypeMismatch(aValType.getTypeName(), aThisType.getTypeName(), " - new element has no legal configuration data type");
-
- aRet = aValue;
- }
-
- else
- {
- if (!convertCompatibleValue(m_xTypeConverter, aRet, aValue, aThisType))
- throw TypeMismatch(aValType.getTypeName(), aThisType.getTypeName(), " - new element does not match template type in SetUpdate");
- }
-
- OSL_ASSERT( isPossibleValueType(aRet.getValueType()) );
- }
- else
- {
- // cannot do anything about null values here
- OSL_ASSERT(aValue.getValueTypeClass() == uno::TypeClass_VOID);
-
- }
- return aRet;
-}
-//-----------------------------------------------------------------------------
-
-com::sun::star::uno::Any ValueSetUpdater::implValidateValue(rtl::Reference< Tree > const& aElementTree, com::sun::star::uno::Any const& aValue)
-{
- node::Attributes aAttributes = aElementTree->getAttributes(aElementTree->getRootNode());
- // Here we assume writable == removable/replaceable
- if (aAttributes.isReadonly())
- throw ConstraintViolation( "Set Update: Existing element is read-only !" );
-
- // Here we assume nullable != removable
- if (!aValue.hasValue())
- {
- if (!aAttributes.isNullable())
- throw ConstraintViolation( "Set Update: Value is not nullable !" );
- }
- return implValidateValue( aValue);
-}
-//-----------------------------------------------------------------------------
-
-NodeChange TreeSetUpdater::validateInsertElement (rtl::OUString const& aName, rtl::Reference< ElementTree > const& aNewElement)
-{
- view::ViewTreeAccess aParentView(m_aParentTree.get());
-
- SetEntry anEntry = aParentView.findElement(aParentView.toSetNode(m_aSetNode),aName);
- if (anEntry.isValid())
- throw Exception("INTERNAL ERROR: Set Update: Element to be inserted already exists");
-
- implValidateTree(aNewElement);
-
- std::auto_ptr<SetElementChangeImpl> pChange( new SetInsertImpl(aNewElement->makeExtendedName(aName), aNewElement) );
-
- pChange->setTarget(aParentView.makeNode(m_aSetNode));
-
- return NodeChange(pChange.release());
-}
-//-----------------------------------------------------------------------------
-
-NodeChange ValueSetUpdater::validateInsertElement (rtl::OUString const& aName, com::sun::star::uno::Any const& aNewValue)
-{
- view::ViewTreeAccess aParentView(m_aParentTree.get());
-
- SetEntry anEntry = aParentView.findElement(aParentView.toSetNode(m_aSetNode),aName);
- if (anEntry.isValid())
- throw Exception("INTERNAL ERROR: Set Update: Element to be inserted already exists");
-
- com::sun::star::uno::Any aValidValue = implValidateValue(aNewValue);
-
- rtl::Reference<ElementTree> aNewElement = makeValueElement(aName, aValidValue,true);
-
- std::auto_ptr<SetElementChangeImpl> pChange( new SetInsertImpl(aNewElement->makeExtendedName(aName), aNewElement) );
-
- pChange->setTarget(aParentView.makeNode(m_aSetNode));
-
- return NodeChange(pChange.release());
-}
-//-----------------------------------------------------------------------------
-
-NodeChange TreeSetUpdater::validateReplaceElement(rtl::Reference< ElementTree > const& aElement, rtl::Reference< ElementTree > const& aNewElement)
-{
- Path::Component aName = implValidateElement(aElement,true);
-
- implValidateTree(aNewElement);
-
- std::auto_ptr<SetElementChangeImpl> pChange( new SetReplaceImpl(aName, aNewElement) );
-
- pChange->setTarget(view::ViewTreeAccess(m_aParentTree.get()).makeNode(m_aSetNode));
-
- return NodeChange(pChange.release());
-}
-//-----------------------------------------------------------------------------
-
-NodeChange ValueSetUpdater::validateReplaceElement(rtl::Reference< ElementTree > const& aElement, com::sun::star::uno::Any const& aNewValue)
-{
- Path::Component aName = implValidateElement(aElement,false);
-
- rtl::Reference< Tree > aElementNode = extractElementNode(aElement);
-
- com::sun::star::uno::Any aValidValue = implValidateValue(aElementNode, aNewValue);
-
- rtl::Reference< Tree > aElementTree = aElement.get();
-
- rtl::Reference<ElementTree> aNewElement;
- if(aElementTree->getAttributes(aElementTree->getRootNode()).isRemovable())
- {
- aNewElement = makeValueElement(aName.getName(), aElementNode, aValidValue,true);
- }
- else
- {
- aNewElement = makeValueElement(aName.getName(), aElementNode, aValidValue,false);
- }
-
- std::auto_ptr<SetElementChangeImpl> pChange( new SetReplaceImpl(aName, aNewElement) );
-
- pChange->setTarget(view::ViewTreeAccess(m_aParentTree.get()).makeNode(m_aSetNode));
-
- return NodeChange(pChange.release());
-}
-//-----------------------------------------------------------------------------
-
-NodeChange TreeSetUpdater::validateRemoveElement (rtl::Reference< ElementTree > const& aElement)
-{
- Path::Component aName = implValidateElement(aElement,true);
-
- std::auto_ptr<SetElementChangeImpl> pChange( new SetRemoveImpl(aName) );
-
- pChange->setTarget(view::ViewTreeAccess(m_aParentTree.get()).makeNode(m_aSetNode));
-
- return NodeChange(pChange.release());
-}
-
-//-----------------------------------------------------------------------------
-
-NodeChange ValueSetUpdater::validateRemoveElement (rtl::Reference< ElementTree > const& aElement)
-{
- Path::Component aName = implValidateElement(aElement,true);
-
- std::auto_ptr<SetElementChangeImpl> pChange( new SetRemoveImpl(aName) );
-
- pChange->setTarget(view::ViewTreeAccess(m_aParentTree.get()).makeNode(m_aSetNode));
-
- return NodeChange(pChange.release());
-}
-
-//-----------------------------------------------------------------------------
-
-NodeChange SetDefaulter::validateSetToDefaultState()
-{
- std::auto_ptr< ISubtree > aDefault = m_aDefaultProvider.getDefaultTree(m_aParentTree,m_aSetNode);
-
- // now build the specific change
- std::auto_ptr<SetChangeImpl> pChange;
-
- if (aDefault.get())
- {
- TemplateProvider aProvider = SetElementFactory::findTemplateProvider(m_aParentTree,m_aSetNode);
-
- configmgr::configuration::SetElementFactory aTmp(aProvider);
- pChange.reset( new SetResetImpl(aTmp, aDefault) );
- pChange->setTarget(view::ViewTreeAccess(m_aParentTree.get()).makeNode(m_aSetNode));
- }
- return NodeChange(pChange.release());
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference< Tree > ValueSetUpdater::extractElementNode (rtl::Reference< ElementTree > const& aElement)
-{
- return aElement.get();
-}
-//-----------------------------------------------------------------------------
-
-#if OSL_DEBUG_LEVEL > 0
-com::sun::star::uno::Type ElementHelper::getUnoType(rtl::Reference< ElementTree > const& aElement)
-{
- OSL_PRECOND( aElement.is(), "ERROR: Configuration: ElementTree operation requires valid node" );
-
- rtl::Reference< Tree > aElementTree(aElement.get());
-
- NodeRef aNode = aElementTree->getRootNode();
- OSL_ASSERT( aNode.isValid() );
-
- view::ViewTreeAccess aElementView(aElementTree.get());
-
- if ( aElementView.isValueNode(aNode) )
- {
- return aElementView.getValueType(aElementView.toValueNode(aNode));
- }
- else
- {
- uno::Reference< uno::XInterface > const * const selectInterface=0;
- return ::getCppuType(selectInterface);
- }
-}
-#endif
-//-----------------------------------------------------------------------------
- }
-}
-
diff --git a/configmgr/source/treemgr/defaultproviderproxy.cxx b/configmgr/source/treemgr/defaultproviderproxy.cxx
deleted file mode 100644
index 483b0d74dd..0000000000
--- a/configmgr/source/treemgr/defaultproviderproxy.cxx
+++ /dev/null
@@ -1,91 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "defaultproviderproxy.hxx"
-#include "defaultprovider.hxx"
-#include "treemanager.hxx"
-#include "valuenode.hxx"
-#include "options.hxx"
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-
-DefaultProviderProxy::DefaultProviderProxy(
- rtl::Reference< TreeManager > const & _xDefaultTreeProvider,
- IDefaultableTreeManager * _pDefaultTreeManager,
- AbsolutePath const& _aBaseLocation,
- RequestOptions const& _aOptions
- )
-: m_aBaseLocation(_aBaseLocation)
-, m_aOptions(_aOptions)
-, m_xDefaultTreeProvider(_xDefaultTreeProvider)
-, m_pDefaultTreeManager(_pDefaultTreeManager)
-{
-}
-//-----------------------------------------------------------------------------
-
-DefaultProviderProxy::~DefaultProviderProxy()
-{
-}
-//-----------------------------------------------------------------------------
-
-/// tries to load a default instance of the specified node (which must be within the request range owned)
-std::auto_ptr<ISubtree> DefaultProviderProxy::getDefaultTree(
- AbsolutePath const& _aLocation
- ) const SAL_THROW((com::sun::star::uno::Exception))
-{
- OSL_ENSURE( Path::hasPrefix(_aLocation,m_aBaseLocation),
- "ERROR: DefaultProviderProxy called for out-of-scope location" );
-
- std::auto_ptr<ISubtree> aRet;
-
- if (m_xDefaultTreeProvider.is())
- aRet = m_xDefaultTreeProvider->requestDefaultData(_aLocation, m_aOptions);
-
- return aRet;
-}
-
-//-----------------------------------------------------------------------------
-/// tries to load default data into the specified tree
-bool DefaultProviderProxy::fetchDefaultData() SAL_THROW((com::sun::star::uno::Exception))
-{
- OSL_PRECOND(m_pDefaultTreeManager, "No tree to fetch defaults into");
- if (!m_pDefaultTreeManager) return false;
-
- return !! m_pDefaultTreeManager->fetchDefaultData(m_aBaseLocation,m_aOptions);
-}
-//-----------------------------------------------------------------------------
- }
-}
-
diff --git a/configmgr/source/treemgr/defaultproviderproxy.hxx b/configmgr/source/treemgr/defaultproviderproxy.hxx
deleted file mode 100644
index 1ed91fe8d4..0000000000
--- a/configmgr/source/treemgr/defaultproviderproxy.hxx
+++ /dev/null
@@ -1,86 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_DEFAULTPROVIDER_PROXY_HXX_
-#define CONFIGMGR_DEFAULTPROVIDER_PROXY_HXX_
-
-#include "configpath.hxx"
-#include "utility.hxx"
-#include "requestoptions.hxx"
-#include <rtl/ref.hxx>
-#include <salhelper/simplereferenceobject.hxx>
-
-#ifndef INCLUDED_MEMORY
-#include <memory>
-#define INCLUDED_MEMORY
-#endif
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- class ISubtree;
- class IDefaultableTreeManager;
- class OOptions;
- class TreeManager;
-//-----------------------------------------------------------------------------
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-
- /// provides access to the defaults for a given request
- class DefaultProviderProxy
- : public salhelper::SimpleReferenceObject
- {
- // the data defining a request
- AbsolutePath m_aBaseLocation;
- RequestOptions m_aOptions;
-
- // the object(s) that provide the defaults
- rtl::Reference< TreeManager > m_xDefaultTreeProvider;
- IDefaultableTreeManager * m_pDefaultTreeManager;
- public:
- explicit
- DefaultProviderProxy(
- rtl::Reference< TreeManager > const & _xDefaultTreeProvider,
- IDefaultableTreeManager * _pDefaultTreeManager,
- AbsolutePath const& _aBaseLocation,
- RequestOptions const& _aOptions
- );
-
- ~DefaultProviderProxy();
-
- /// tries to load a default instance of the specified node (which must be within the request range owned)
- std::auto_ptr<ISubtree> getDefaultTree(AbsolutePath const& _aLocation) const SAL_THROW((com::sun::star::uno::Exception));
-
- /// tries to load default data into the owned tree - call only outside of any locks
- bool fetchDefaultData() SAL_THROW((com::sun::star::uno::Exception));
- };
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_DEFAULTPROVIDER_PROXY_HXX_
diff --git a/configmgr/source/treemgr/deferredview.cxx b/configmgr/source/treemgr/deferredview.cxx
deleted file mode 100644
index 53bd0b5252..0000000000
--- a/configmgr/source/treemgr/deferredview.cxx
+++ /dev/null
@@ -1,443 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-#include "deferredview.hxx"
-#include "viewfactory.hxx"
-#include "nodeimplobj.hxx"
-
-namespace configmgr
-{
- namespace view
- {
-//-----------------------------------------------------------------------------
-static inline configuration::DeferredGroupNodeImpl* deferredGroupNode(Node const& _aNode)
-{
- return static_cast<configuration::DeferredGroupNodeImpl*>(_aNode.get_impl());
-}
-//-----------------------------------------------------------------------------
-
-static inline configuration::DeferredGroupNodeImpl* deferredGroupNode(GroupNode const& _aNode)
-{
- return static_cast<configuration::DeferredGroupNodeImpl*>(_aNode.get_impl());
-}
-//-----------------------------------------------------------------------------
-
-static inline configuration::DeferredSetNodeImpl* deferredSetNode(Node const& _aNode)
-{
- return static_cast<configuration::DeferredSetNodeImpl*>(_aNode.get_impl());
-}
-//-----------------------------------------------------------------------------
-
-static inline configuration::DeferredSetNodeImpl* deferredSetNode(SetNode const& _aNode)
-{
- return static_cast<configuration::DeferredSetNodeImpl*>(_aNode.get_impl());
-}
-//-----------------------------------------------------------------------------
-
-static inline void deferredValueNode(Node const& _aNode)
-{
- { (void)_aNode; }
- OSL_ENSURE( _aNode.isValueNode(),"Unknown Node type in deferred view");
- OSL_ENSURE(_aNode.get_offset() == configuration::Tree::ROOT, "Tree: Unexpected node type - non-root value element");
-}
-//-----------------------------------------------------------------------------
-
-static void deferredValueNodeChanged(Node const& _aNode)
-{
- { (void)_aNode; }
- OSL_ENSURE( _aNode.isValueNode(),"Unknown Node type in deferred view");
- OSL_ENSURE(_aNode.get_offset() == configuration::Tree::ROOT, "Tree: Unexpected node type - non-root value element");
- OSL_ENSURE(!_aNode.isValueNode(),"Value node changes not supported in deferred view");
- throw configuration::Exception("Internal Error: Invalid operation applied to element");
-}
-//-----------------------------------------------------------------------------
-
-bool DeferredViewStrategy::doHasChanges(Node const& _aNode) const
-{
- if (_aNode.isGroupNode())
- return deferredGroupNode(_aNode)->hasChanges();
-
- else if (_aNode.isSetNode())
- return deferredSetNode(_aNode)->hasChanges();
-
- else
- deferredValueNode(_aNode);
-
- return false;
-}
-
-//-----------------------------------------------------------------------------
-void DeferredViewStrategy::doMarkChanged(Node const& _aNode)
-{
- if (_aNode.isGroupNode())
- deferredGroupNode(_aNode)->markChanged();
-
- else if (_aNode.isSetNode())
- deferredSetNode(_aNode)->markChanged();
-
- else
- deferredValueNodeChanged(_aNode);
-}
-
-//-----------------------------------------------------------------------------
-void DeferredViewStrategy::doCollectChanges(Node const& _aNode, configuration::NodeChanges& _rChanges) const
-{
- implCollectChangesIn(_aNode,_rChanges);
-}
-
-//-----------------------------------------------------------------------------
-void DeferredViewStrategy::implCollectChangesIn(Node const& _aNode, configuration::NodeChanges& _rChanges) const
-{
- if ( hasChanges(_aNode) )
- {
- if (_aNode.isSetNode())
- {
- deferredSetNode(_aNode)->collectElementChanges( _rChanges);
- }
- else if (_aNode.isGroupNode())
- {
- GroupNode aGroup(_aNode);
-
- deferredGroupNode(aGroup)->collectValueChanges( _rChanges, _aNode.tree(), _aNode.get_offset());
-
- for( Node aChild = aGroup.getFirstChild();
- aChild.is();
- aChild = aGroup.getNextChild(aChild)
- )
- {
- this->implCollectChangesIn( aChild, _rChanges );
- }
- }
- else
- OSL_ASSERT(!"Unreachable code");
- }
-}
-
-//-----------------------------------------------------------------------------
-std::auto_ptr<SubtreeChange> DeferredViewStrategy::doPreCommitChanges(configuration::Tree * tree, std::vector< rtl::Reference<configuration::ElementTree> >& _rRemovedElements)
-{
- std::auto_ptr<SubtreeChange> pRet;
- if (hasChanges(tree))
- {
- pRet = implPreCommitChanges(getRootNode(tree),_rRemovedElements);
- if (pRet.get() != NULL)
- {
- pRet->setNodeName(getSimpleRootName(tree));
- }
- }
- return pRet;
-}
-
-//-----------------------------------------------------------------------------
-void DeferredViewStrategy::doFailedCommit(configuration::Tree * tree, SubtreeChange& rChanges)
-{
- implFailedCommit(getRootNode(tree),rChanges);
-}
-
-//-----------------------------------------------------------------------------
-void DeferredViewStrategy::doFinishCommit(configuration::Tree * tree, SubtreeChange& rChanges)
-{
- implFinishCommit(getRootNode(tree),rChanges);
-}
-
-//-----------------------------------------------------------------------------
-void DeferredViewStrategy::doRevertCommit(configuration::Tree * tree, SubtreeChange& rChanges)
-{
- implRevertCommit(getRootNode(tree),rChanges);
-}
-
-//-----------------------------------------------------------------------------
-configuration::ValueChangeImpl* DeferredViewStrategy::doAdjustToValueChange(GroupNode const& _aGroupNode, rtl::OUString const& _aName, ValueChange const& rExternalChange)
-{
- rtl::Reference<configuration::ValueMemberNode::DeferredImpl> aChange = deferredGroupNode(_aGroupNode)->findValueChange(_aName);
-
- if (aChange.is())
- {
- if (configuration::ValueChangeImpl* pValueChange = aChange->adjustToChange(rExternalChange))
- {
- OSL_ENSURE(aChange->isChange(), "Got an adjusted change from a non-changing value");
-
- return pValueChange;
- }
- else // a non-change
- {
- OSL_ENSURE(!aChange->isChange(), "Got no adjusted change from a changing value") ;
- OSL_ENSURE(false, "Got a non-change from a (deferred) group") ;
- // then do as without deferred change
- }
- }
-
- return ViewStrategy::doAdjustToValueChange(_aGroupNode, _aName, rExternalChange);
-
-}
-
-//-----------------------------------------------------------------------------
-node::Attributes DeferredViewStrategy::doAdjustAttributes(node::Attributes const& _aAttributes) const
-{
- return _aAttributes;
-}
-
-//-----------------------------------------------------------------------------
-configuration::ValueMemberNode DeferredViewStrategy::doGetValueMember(GroupNode const& _aNode, rtl::OUString const& _aName, bool _bForUpdate) const
-{
- return deferredGroupNode(_aNode)->makeValueMember(_aName,_bForUpdate);
-}
-
-//-----------------------------------------------------------------------------
-void DeferredViewStrategy::doInsertElement(SetNode const& _aNode, rtl::OUString const& aName, configuration::SetEntry const& _aNewEntry)
-{
- // move to this memory segment
- // should be direct (as any free-floating one)
-
- //implMakeElement(aNewEntry)
- configuration::ElementTreeData aNewElement = implMakeElement(_aNode, _aNewEntry );
-
- deferredSetNode(_aNode)->insertNewElement(aName, aNewElement);
-}
-
-//-----------------------------------------------------------------------------
-void DeferredViewStrategy::doRemoveElement(SetNode const& _aNode, rtl::OUString const& aName)
-{
- deferredSetNode(_aNode)->removeOldElement(aName);
-}
-
-//-----------------------------------------------------------------------------
-extern NodeFactory& getDeferredChangeFactory();
-
-NodeFactory& DeferredViewStrategy::doGetNodeFactory()
-{
- return getDeferredChangeFactory();
-}
-
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-rtl::Reference<ViewStrategy> createDeferredChangeStrategy()
-{
- return new DeferredViewStrategy();
-}
-
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-std::auto_ptr<SubtreeChange> DeferredViewStrategy::implPreCommitChanges(Node const& _aNode, std::vector< rtl::Reference<configuration::ElementTree> >& _rRemovedElements)
-{
- std::auto_ptr<SubtreeChange> aRet;
-
- OSL_ASSERT (this->hasChanges( _aNode) );
-
- if (_aNode.isSetNode())
- {
- aRet = deferredSetNode(_aNode)->preCommitChanges(_rRemovedElements);
- }
- else if (_aNode.isGroupNode())
- {
- std::auto_ptr<SubtreeChange> aGroupChange(deferredGroupNode(_aNode)->preCommitValueChanges());
-
- OSL_ASSERT(aGroupChange.get());
- if (aGroupChange.get())
- implPreCommitSubChanges( GroupNode(_aNode), _rRemovedElements, *aGroupChange);
-
- aRet = aGroupChange;
- }
- else
- deferredValueNode(_aNode);
-
- return aRet;
-}
-//-----------------------------------------------------------------------------
-
-void DeferredViewStrategy::implFinishCommit(Node const& _aNode, SubtreeChange& rSubtreeChange)
-{
- OSL_PRECOND( getSimpleNodeName(_aNode) == rSubtreeChange.getNodeName(), "ERROR: Change name does not match node");
-
- if (_aNode.isSetNode())
- {
- OSL_ENSURE(rSubtreeChange.isSetNodeChange(),"ERROR: Change type GROUP does not match set");
-
- deferredSetNode(_aNode)->finishCommit(rSubtreeChange);
- }
- else if (_aNode.isGroupNode())
- {
- OSL_ENSURE(!rSubtreeChange.isSetNodeChange(),"ERROR: Change type SET does not match group");
-
- deferredGroupNode(_aNode)->finishCommit(rSubtreeChange);
- implFinishSubCommitted( GroupNode(_aNode), rSubtreeChange );
- }
- else
- {
- deferredValueNode(_aNode);
- OSL_ENSURE(false, "Tree: Cannot finish commit: Unexpected node type");
- }
-}
-//-----------------------------------------------------------------------------
-
-void DeferredViewStrategy::implRevertCommit(Node const& _aNode, SubtreeChange& rSubtreeChange)
-{
- OSL_PRECOND( getSimpleNodeName(_aNode) == rSubtreeChange.getNodeName(), "ERROR: Change name does not match node");
-
- if (_aNode.isSetNode())
- {
- OSL_ENSURE(rSubtreeChange.isSetNodeChange(),"ERROR: Change type GROUP does not match set");
-
- deferredSetNode(_aNode)->revertCommit(rSubtreeChange);
- }
- else if (_aNode.isGroupNode())
- {
- OSL_ENSURE(!rSubtreeChange.isSetNodeChange(),"ERROR: Change type SET does not match group");
-
- deferredGroupNode(_aNode)->revertCommit(rSubtreeChange);
- implRevertSubCommitted( GroupNode(_aNode), rSubtreeChange );
- }
- else
- {
- deferredValueNode(_aNode);
- OSL_ENSURE(false, "Tree: Cannot revert commit: Unexpected node type");
- }
-}
-//-----------------------------------------------------------------------------
-
-void DeferredViewStrategy::implFailedCommit(Node const& _aNode, SubtreeChange& rSubtreeChange)
-{
- OSL_PRECOND( getSimpleNodeName(_aNode) == rSubtreeChange.getNodeName(), "ERROR: Change name does not match node");
-
- if (_aNode.isSetNode())
- {
- OSL_ENSURE(rSubtreeChange.isSetNodeChange(),"ERROR: Change type GROUP does not match set");
-
- deferredSetNode(_aNode)->failedCommit(rSubtreeChange);
- }
- else if (_aNode.isGroupNode())
- {
- OSL_ENSURE(!rSubtreeChange.isSetNodeChange(),"ERROR: Change type SET does not match group");
-
- deferredGroupNode(_aNode)->failedCommit(rSubtreeChange);
- implFailedSubCommitted( GroupNode(_aNode), rSubtreeChange );
- }
- else
- {
- deferredValueNode(_aNode);
- OSL_ENSURE(false, "Tree: Cannot handle commit failure: Unexpected node type");
- }
-}
-//-----------------------------------------------------------------------------
-
-void DeferredViewStrategy::implPreCommitSubChanges(GroupNode const & _aGroup, std::vector< rtl::Reference<configuration::ElementTree> >& _rRemovedElements, SubtreeChange& _rParentChange)
-{
- for( Node aChild = _aGroup.getFirstChild(); aChild.is(); aChild = _aGroup.getNextChild(aChild) )
- {
- if (this->hasChanges(aChild))
- {
- std::auto_ptr<SubtreeChange> aSubChanges( this->implPreCommitChanges(aChild,_rRemovedElements) );
- std::auto_ptr<Change> aSubChangesBase( aSubChanges.release() );
- _rParentChange.addChange( aSubChangesBase );
- }
- }
-}
-//-----------------------------------------------------------------------------
-
-void DeferredViewStrategy::implFinishSubCommitted(GroupNode const & _aGroup, SubtreeChange& aChangesParent)
-{
- for(SubtreeChange::MutatingChildIterator
- it = aChangesParent.begin_changes(),
- stop = aChangesParent.end_changes();
- it != stop;
- ++it)
- {
- if (dynamic_cast< SubtreeChange * >(&*it) != 0)
- {
- Node aChild = _aGroup.findChild( it->getNodeName() );
- OSL_ENSURE( aChild.is(), "Changed sub-node not found in tree");
-
- this->implFinishCommit(aChild, static_cast<SubtreeChange&>(*it));
- }
- else
- {
- OSL_ENSURE(dynamic_cast< ValueChange * >(&*it) != 0, "Unexpected change type for inner node; change is ignored");
- OSL_ENSURE(! _aGroup.findChild(it->getNodeName()).is() ,
- "Found sub(tree) node where a value was changed");
- }
- }
-}
-//-----------------------------------------------------------------------------
-
-void DeferredViewStrategy::implRevertSubCommitted(GroupNode const & _aGroup, SubtreeChange& aChangesParent)
-{
- for(SubtreeChange::MutatingChildIterator
- it = aChangesParent.begin_changes(),
- stop = aChangesParent.end_changes();
- it != stop;
- ++it)
- {
- if (dynamic_cast< SubtreeChange * >(&*it) != 0)
- {
- Node aChild = _aGroup.findChild( it->getNodeName() );
- OSL_ENSURE( aChild.is(), "Changed sub-node not found in tree");
-
- this->implRevertCommit(aChild, static_cast<SubtreeChange&>(*it));
- }
- else
- {
- OSL_ENSURE(dynamic_cast< ValueChange * >(&*it) != 0, "Unexpected change type for inner node; change is ignored");
- OSL_ENSURE(! _aGroup.findChild(it->getNodeName()).is() ,
- "Found sub(tree) node where a value was changed");
- }
- }
-}
-//-----------------------------------------------------------------------------
-
-void DeferredViewStrategy::implFailedSubCommitted(GroupNode const & _aGroup, SubtreeChange& aChangesParent)
-{
- for(SubtreeChange::MutatingChildIterator
- it = aChangesParent.begin_changes(),
- stop = aChangesParent.end_changes();
- it != stop;
- ++it)
- {
- if (dynamic_cast< SubtreeChange * >(&*it) != 0)
- {
- Node aChild = _aGroup.findChild( it->getNodeName() );
- OSL_ENSURE( aChild.is(), "Changed sub-node not found in tree");
-
- this->implFailedCommit(aChild, static_cast<SubtreeChange&>(*it));
- }
- else
- {
- OSL_ENSURE(dynamic_cast< ValueChange * >(&*it) != 0, "Unexpected change type for inner node; change is ignored");
- OSL_ENSURE(! _aGroup.findChild(it->getNodeName()).is() ,
- "Found sub(tree) node where a value was changed");
- }
- }
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
- }
-}
diff --git a/configmgr/source/treemgr/deferredview.hxx b/configmgr/source/treemgr/deferredview.hxx
deleted file mode 100644
index f91228745c..0000000000
--- a/configmgr/source/treemgr/deferredview.hxx
+++ /dev/null
@@ -1,97 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_DEFERREDVIEW_HXX_
-#define CONFIGMGR_DEFERREDVIEW_HXX_
-
-#include "viewstrategy.hxx"
-
-
-namespace configmgr
-{
- namespace view
- {
-//-----------------------------------------------------------------------------
-// View behavior for direct data access
-//-----------------------------------------------------------------------------
-
- class DeferredViewStrategy : public ViewStrategy
- {
- public:
- explicit
- DeferredViewStrategy() {}
-
- // ViewStrategy implementation
- private:
- // change handling -required
- virtual bool doHasChanges(Node const& _aNode) const;
- virtual void doMarkChanged(Node const& _aNode);
-
-
- // change handling
- virtual void doCollectChanges(Node const& _aNode, configuration::NodeChanges& rChanges) const;
-
- // commit protocol
- virtual std::auto_ptr<SubtreeChange> doPreCommitChanges(configuration::Tree * tree, std::vector< rtl::Reference<configuration::ElementTree> >& _rRemovedElements);
- virtual void doFailedCommit(configuration::Tree * tree, SubtreeChange& rChanges);
- virtual void doFinishCommit(configuration::Tree * tree, SubtreeChange& rChanges);
- virtual void doRevertCommit(configuration::Tree * tree, SubtreeChange& rChanges);
-
- // notification protocol
- virtual configuration::ValueChangeImpl* doAdjustToValueChange(GroupNode const& _aGroupNode, rtl::OUString const& aName, ValueChange const& rExternalChange);
- // virtual void doAdjustToElementChanges(configuration::NodeChangesInformation& rLocalChanges, SetNode const& _aNode, SubtreeChange const& rExternalChanges, TreeDepth nDepth);
-
- // common attributes
- virtual node::Attributes doAdjustAttributes(node::Attributes const& _aAttributes) const;
-
- // group member access
- virtual configuration::ValueMemberNode doGetValueMember(GroupNode const& _aNode, rtl::OUString const& _aName, bool _bForUpdate) const;
-
- // set element access
- virtual void doInsertElement(SetNode const& _aNode, rtl::OUString const& aName, configuration::SetEntry const& aNewEntry);
- virtual void doRemoveElement(SetNode const& _aNode, rtl::OUString const& aName);
-
- virtual NodeFactory& doGetNodeFactory();
- private:
- void implCollectChangesIn(Node const& _aNode, configuration::NodeChanges& rChanges) const;
- // commit protocol
- std::auto_ptr<SubtreeChange> implPreCommitChanges(Node const& _aNode, std::vector< rtl::Reference<configuration::ElementTree> >& _rRemovedElements);
- void implFailedCommit(Node const& _aNode, SubtreeChange& rChanges);
- void implFinishCommit(Node const& _aNode, SubtreeChange& rChanges);
- void implRevertCommit(Node const& _aNode, SubtreeChange& rChanges);
-
- void implPreCommitSubChanges(GroupNode const & _aGroup, std::vector< rtl::Reference<configuration::ElementTree> >& _rRemovedElements, SubtreeChange& _rParentChange);
- void implFailedSubCommitted(GroupNode const & _aGroup, SubtreeChange& rChanges);
- void implFinishSubCommitted(GroupNode const & _aGroup, SubtreeChange& rChanges);
- void implRevertSubCommitted(GroupNode const & _aGroup, SubtreeChange& rChanges);
-
- };
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_DEFERREDVIEW_HXX_
diff --git a/configmgr/source/treemgr/directview.cxx b/configmgr/source/treemgr/directview.cxx
deleted file mode 100644
index beabf70ed0..0000000000
--- a/configmgr/source/treemgr/directview.cxx
+++ /dev/null
@@ -1,127 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-#include "directview.hxx"
-#include "viewfactory.hxx"
-#include "setnodeimpl.hxx"
-
-namespace configmgr
-{
- namespace view
- {
-//-----------------------------------------------------------------------------
-
-void DirectViewStrategy::implMarkNondefault(SetNode const& _aSetNode)
-{
- sharable::SetNode * set = _aSetNode.getAccess();
-
- OSL_ASSERT(set != 0);
-
- sharable::SetNode* pNode = NULL;
- if (m_aTreeSegment.is())
- pNode = set;
-
- OSL_ASSERT(pNode);
-
- pNode->info.markAsDefault(false);
-}
-//-----------------------------------------------------------------------------
-
-bool DirectViewStrategy::doHasChanges(Node const& ) const
-{
- return false;
-}
-//-----------------------------------------------------------------------------
-
-void DirectViewStrategy::doMarkChanged(Node const& )
-{
- // do nothing
-}
-//-----------------------------------------------------------------------------
-
-node::Attributes DirectViewStrategy::doAdjustAttributes(node::Attributes const& _aAttributes) const
-{
- node::Attributes aAttributes = _aAttributes;
-
- if (aAttributes.isReadonly())
- aAttributes.setAccess(node::accessFinal);
-
- return aAttributes;
-}
-//-----------------------------------------------------------------------------
-
-configuration::ValueMemberNode DirectViewStrategy::doGetValueMember(GroupNode const& _aNode, rtl::OUString const& _aName, bool _bForUpdate) const
-{
- return ViewStrategy::doGetValueMember(_aNode,_aName,_bForUpdate);
-}
-//-----------------------------------------------------------------------------
-void DirectViewStrategy::doInsertElement(SetNode const& _aNode, rtl::OUString const& _aName, configuration::SetEntry const& _aNewEntry)
-{
- // move to this memory segment
- // should already be direct (as any free-floating one)
-
- //implMakeElement(aNewEntry)
- configuration::ElementTreeData aNewElement = implMakeElement(_aNode, _aNewEntry );
- // _aNewEntry.tree()->rebuild(this, _aNode.accessor());
-
- _aNode.get_impl()->insertElement(_aName, aNewElement);
-
- aNewElement->attachTo( _aNode.getAccess(), _aName );
-
- implMarkNondefault( _aNode );
-}
-//-----------------------------------------------------------------------------
-
-void DirectViewStrategy::doRemoveElement(SetNode const& _aNode, rtl::OUString const& _aName)
-{
- configuration::ElementTreeData aOldElement = _aNode.get_impl()->removeElement(_aName);
-
- aOldElement->detachFrom( _aNode.getAccess(), _aName);
-
- implMarkNondefault( _aNode );
-}
-//-----------------------------------------------------------------------------
-
-extern NodeFactory& getDirectAccessFactory();
-
-NodeFactory& DirectViewStrategy::doGetNodeFactory()
-{
- return getDirectAccessFactory();
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference<ViewStrategy> createDirectAccessStrategy(rtl::Reference< data::TreeSegment > const & _aTreeSegment)
-{
- return new DirectViewStrategy(_aTreeSegment);
-}
-
-//-----------------------------------------------------------------------------
- }
-}
diff --git a/configmgr/source/treemgr/directview.hxx b/configmgr/source/treemgr/directview.hxx
deleted file mode 100644
index 949dc4519d..0000000000
--- a/configmgr/source/treemgr/directview.hxx
+++ /dev/null
@@ -1,75 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_DIRECTVIEW_HXX_
-#define CONFIGMGR_DIRECTVIEW_HXX_
-
-#include "viewstrategy.hxx"
-#include "treesegment.hxx"
-
-namespace configmgr
-{
- namespace view
- {
-//-----------------------------------------------------------------------------
-// View behavior for direct data access
-//-----------------------------------------------------------------------------
-
- class DirectViewStrategy : public ViewStrategy
- {
- rtl::Reference< data::TreeSegment > m_aTreeSegment;
- public:
- explicit
- DirectViewStrategy(rtl::Reference< data::TreeSegment > const & _aTreeSegment)
- : m_aTreeSegment(_aTreeSegment)
- {}
-
- protected:
- // change handling -required
- virtual bool doHasChanges(Node const& _aNode) const;
- virtual void doMarkChanged(Node const& _aNode);
-
- // common attributes
- virtual node::Attributes doAdjustAttributes(node::Attributes const& _aAttributes) const;
-
- // group member access
- virtual configuration::ValueMemberNode doGetValueMember(GroupNode const& _aNode, rtl::OUString const& _aName, bool _bForUpdate) const;
-
- // set element access
- virtual void doInsertElement(SetNode const& _aNode, rtl::OUString const& aName, configuration::SetEntry const& aNewEntry);
- virtual void doRemoveElement(SetNode const& _aNode, rtl::OUString const& aName);
-
- virtual NodeFactory& doGetNodeFactory();
-
- private:
- void implMarkNondefault(SetNode const& _aNode);
- };
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_DIRECTVIEW_HXX_
diff --git a/configmgr/source/treemgr/groupnodeimpl.hxx b/configmgr/source/treemgr/groupnodeimpl.hxx
deleted file mode 100644
index cfbcfce4fa..0000000000
--- a/configmgr/source/treemgr/groupnodeimpl.hxx
+++ /dev/null
@@ -1,88 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_GROUPNODEBEHAVIOR_HXX_
-#define CONFIGMGR_GROUPNODEBEHAVIOR_HXX_
-
-#include "nodeimpl.hxx"
-#include "valuemembernode.hxx"
-
-#ifndef INCLUDED_MEMORY
-#include <memory>
-#define INCLUDED_MEMORY
-#endif
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- class SubtreeChange;
- class ValueChange;
-
- namespace configuration
- {
-//-----------------------------------------------------------------------------
- class ValueChangeImpl;
-//-----------------------------------------------------------------------------
-// a visitor
-//-----------------------------------------------------------------------------
- struct GroupMemberVisitor
- {
- enum Result { DONE, CONTINUE };
- virtual Result visit(ValueMemberNode const& aValue) = 0;
- protected:
- virtual ~GroupMemberVisitor() {}
- };
-
-
-// Specific type of nodes
-//-----------------------------------------------------------------------------
-
- class GroupNodeImpl : public NodeImpl
- {
- mutable sharable::Node *m_pCache;
- public:
- explicit GroupNodeImpl(sharable::GroupNode * _pNodeRef);
-
- sharable::GroupNode * getDataAccess() const;
-
- bool areValueDefaultsAvailable() const;
-
- sharable::ValueNode * getOriginalValueNode(rtl::OUString const& aName) const;
-
- ValueMemberNode makeValueMember(sharable::ValueNode * node);
- };
-
-//-----------------------------------------------------------------------------
-
- // domain-specific 'dynamic_cast' replacements
- GroupNodeImpl& AsGroupNode(NodeImpl& rNode);
-
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_GROUPNODEBEHAVIOR_HXX_
diff --git a/configmgr/source/treemgr/makefile.mk b/configmgr/source/treemgr/makefile.mk
deleted file mode 100644
index 0fe253b77b..0000000000
--- a/configmgr/source/treemgr/makefile.mk
+++ /dev/null
@@ -1,74 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJINC=$(PRJ)$/source$/inc
-PRJNAME=configmgr
-TARGET=treemgr
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings ----------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/makefile.pmk
-
-# --- Files -------------------------------------
-
-SLOFILES= \
- $(SLO)$/collectchanges.obj \
- $(SLO)$/configdefaultprovider.obj \
- $(SLO)$/configexcept.obj \
- $(SLO)$/configgroup.obj \
- $(SLO)$/configpath.obj \
- $(SLO)$/configset.obj \
- $(SLO)$/defaultproviderproxy.obj \
- $(SLO)$/valuemembernode.obj \
- $(SLO)$/nodechange.obj \
- $(SLO)$/nodechangeimpl.obj \
- $(SLO)$/nodechangeinfo.obj \
- $(SLO)$/nodefactory.obj \
- $(SLO)$/nodeimpl.obj \
- $(SLO)$/nodeimplobj.obj \
- $(SLO)$/noderef.obj \
- $(SLO)$/roottree.obj \
- $(SLO)$/setnodeimpl.obj \
- $(SLO)$/template.obj \
- $(SLO)$/templateimpl.obj \
- $(SLO)$/treeimpl.obj \
- $(SLO)$/viewaccess.obj \
- $(SLO)$/viewstrategy.obj \
- $(SLO)$/viewnode.obj \
- $(SLO)$/deferredview.obj \
- $(SLO)$/directview.obj \
- $(SLO)$/readonlyview.obj \
-
-
-# --- Targets ----------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/configmgr/source/treemgr/nodechange.cxx b/configmgr/source/treemgr/nodechange.cxx
deleted file mode 100644
index 32e2735d64..0000000000
--- a/configmgr/source/treemgr/nodechange.cxx
+++ /dev/null
@@ -1,273 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "nodechange.hxx"
-#include "nodechangeimpl.hxx"
-#include "nodechangeinfo.hxx"
-
-#include "noderef.hxx"
-#include "tree.hxx"
-
-#include <algorithm>
-#include <osl/diagnose.h>
-
-namespace configmgr
-{
- namespace configuration
- {
-
-//-----------------------------------------------------------------------------
-// NodeChange handle class
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-inline void NodeChange::init()
-{
- if (m_pImpl) m_pImpl->acquire();
-}
-inline void NodeChange::deinit()
-{
- if (m_pImpl) m_pImpl->release();
-}
-
-//-----------------------------------------------------------------------------
-NodeChange::NodeChange()
-: m_pImpl(0)
-{
-}
-//-----------------------------------------------------------------------------
-
-NodeChange::NodeChange(NodeChangeImpl* pImpl)
-: m_pImpl(pImpl)
-{
- init();
-}
-//-----------------------------------------------------------------------------
-
-NodeChange::NodeChange(NodeChange const& rOther)
-: m_pImpl(rOther.m_pImpl)
-{
- init();
-}
-//-----------------------------------------------------------------------------
-
-NodeChange& NodeChange::operator=(NodeChange const& rOther)
-{
- NodeChange(rOther).swap(*this);
- return *this;
-}
-//-----------------------------------------------------------------------------
-
-void NodeChange::swap(NodeChange& rOther)
-{
- std::swap(m_pImpl,rOther.m_pImpl);
-}
-//-----------------------------------------------------------------------------
-
-NodeChange::~NodeChange()
-{
- deinit();
-}
-//-----------------------------------------------------------------------------
-
-bool NodeChange::maybeChange() const
-{
- return m_pImpl && m_pImpl->isChange(true);
-}
-//-----------------------------------------------------------------------------
-
-bool NodeChange::isChange() const
-{
- return m_pImpl && m_pImpl->isChange(false);
-}
-//-----------------------------------------------------------------------------
-
-sal_uInt32 NodeChange::getChangeInfos(NodeChangesInformation& _rInfos) const
-{
- sal_uInt32 nCount = 0;
- if (m_pImpl)
- {
- sal_uInt32 nChanges = m_pImpl->getChangeDataCount();
-
- for (sal_uInt32 ix = 0; ix < nChanges; ++ix)
- {
- NodeChangeInformation aSingleInfo;
- aSingleInfo.change.type = NodeChangeData::eNoChange;
-
- m_pImpl->fillChangeInfo(aSingleInfo,ix);
-
- if ( !aSingleInfo.isEmptyChange() )
- {
- _rInfos.push_back(aSingleInfo);
- ++nCount;
- }
- }
- }
-
- return nCount;
-}
-//-----------------------------------------------------------------------------
-
-bool NodeChange::getChangeLocation(NodeChangeLocation& rLoc) const
-{
- return m_pImpl && m_pImpl->fillChangeLocation(rLoc);
-}
-
-//-----------------------------------------------------------------------------
-
-// retrieve the tree where the change is actually taking place
-rtl::Reference< Tree > NodeChange::getAffectedTree() const
-{
- if (this->maybeChange())
- return m_pImpl->getTargetTree().get();
- else
- return NULL;
-}
-//-----------------------------------------------------------------------------
-
-// retrieve the tree where the change is actually taking place
-NodeRef NodeChange::getAffectedNode() const
-{
- if (this->maybeChange())
- {
- rtl::Reference<Tree> aTree = m_pImpl->getTargetTree();
- unsigned int nOffset = m_pImpl->getTargetNode();
-
- OSL_ASSERT(aTree.is() && aTree->isValidNode(nOffset));
-
- if (aTree.is() && nOffset)
- return aTree->getNode(nOffset);
- }
- return NodeRef();
-}
-//-----------------------------------------------------------------------------
-
-NodeChange& NodeChange::test()
-{
- if (m_pImpl) m_pImpl->test();
- return *this;
-}
-
-//-----------------------------------------------------------------------------
-NodeChange const& NodeChange::test() const
-{
- if (m_pImpl) m_pImpl->test();
- return *this;
-}
-
-//-----------------------------------------------------------------------------
-NodeChange& NodeChange::apply()
-{
- if (m_pImpl) m_pImpl->apply();
- return *this;
-}
-
-//-----------------------------------------------------------------------------
-NodeChange const& NodeChange::apply() const
-{
- if (m_pImpl) m_pImpl->apply();
- return *this;
-}
-
-//-----------------------------------------------------------------------------
-// NodeChanges collection
-//-----------------------------------------------------------------------------
-
-NodeChanges::NodeChanges()
-: m_aChanges()
-{
-}
-//-----------------------------------------------------------------------------
-
-bool NodeChanges::isEmpty() const
-{
- return m_aChanges.empty();
-}
-//-----------------------------------------------------------------------------
-
-/// predicate for compact
-
-static bool isEmptyChange(NodeChange const& aChange)
-{
- return !aChange.maybeChange();
-}
-//-----------------------------------------------------------------------------
-
-
-NodeChanges& NodeChanges::compact()
-{
- m_aChanges.erase( std::remove_if(begin(),end(),isEmptyChange), end() );
- return *this;
-}
-//-----------------------------------------------------------------------------
-
-void NodeChanges::implTest() const
-{
- for(std::vector<NodeChange>::const_iterator it = begin(), stop = end(); it != stop; ++it)
- {
- it ->test();
- }
-}
-//-----------------------------------------------------------------------------
-/** insert a change into this collection
-*/
-void NodeChanges::add(NodeChange const& aChange)
-{
- m_aChanges.push_back(aChange);
-}
-
-//-----------------------------------------------------------------------------
-
-/** removes a change to <var>aNode</var> from this collection (if there is one)
-void NodeChanges::reset(Node const& aNode)
-{
-}
-*/
-
-sal_uInt32 NodeChanges::getChangesInfos(NodeChangesInformation& _rInfos) const
-{
- if (isEmpty()) return 0;
-
- _rInfos.reserve(_rInfos.size() + this->getCount());
-
- sal_Int32 nResult = 0;
- for (std::vector<NodeChange>::const_iterator it = begin(); it != end(); ++it)
- {
- nResult += it->getChangeInfos(_rInfos);
- }
-
- return nResult;
-}
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
- }
-}
-
diff --git a/configmgr/source/treemgr/nodechangeimpl.cxx b/configmgr/source/treemgr/nodechangeimpl.cxx
deleted file mode 100644
index 8ae8e67005..0000000000
--- a/configmgr/source/treemgr/nodechangeimpl.cxx
+++ /dev/null
@@ -1,785 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "nodechangeimpl.hxx"
-#include "nodechangeinfo.hxx"
-#include "nodeimpl.hxx"
-#include "tree.hxx"
-#include "configset.hxx"
-#include "setnodeimpl.hxx"
-#include "groupnodeimpl.hxx"
-#include "valuenode.hxx"
-#include "change.hxx"
-
-namespace configmgr
-{
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// All Changes:NodeChangeImpl - common base
-//-----------------------------------------------------------------------------
-
-// life cycle states for a NodeChangeImpl
-enum { eTestedChange = 0x01, eAppliedChange = 0x02, eNoCheck = 0x07 };
-//-----------------------------------------------------------------------------
-
-NodeChangeImpl::NodeChangeImpl(bool bNoCheck)
-: m_aAffectedTree()
-, m_nAffectedNode(0)
-, m_nState(0)
-{
- if (bNoCheck) m_nState = eNoCheck;
-}
-//-----------------------------------------------------------------------------
-
-view::ViewTreeAccess NodeChangeImpl::getTargetView()
-{
- OSL_ENSURE( m_aAffectedTree.is(), "ERROR: Configuration Change: Target Tree Access has not been set up" );
-
- return view::ViewTreeAccess(m_aAffectedTree.get());
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference<Tree> NodeChangeImpl::getTargetTree() const
-{
- rtl::Reference<Tree> aRet = m_aAffectedTree;
- OSL_ENSURE( aRet.is(), "ERROR: Configuration Change: Target Tree has not been set up" );
-
- return aRet;
-}
-//-----------------------------------------------------------------------------
-
-unsigned int NodeChangeImpl::getTargetNode() const
-{
- unsigned int nRet = m_nAffectedNode;
- OSL_ENSURE( nRet != 0, "ERROR: Configuration Change: Target Node has not been set up" );
- OSL_ENSURE( m_aAffectedTree.is() && m_aAffectedTree->isValidNode(nRet),
- "ERROR: Configuration Change: Changing Node does not match tree" );
-
- return nRet;
-}
-//-----------------------------------------------------------------------------
-
-void NodeChangeImpl::setTarget(view::Node _aAffectedNode)
-{
- this->setTarget(_aAffectedNode.tree(), _aAffectedNode.get_offset());
-
-}
-void NodeChangeImpl::setTarget(rtl::Reference<Tree> const& _aAffectedTree, unsigned int _nAffectedNode)
-{
- OSL_ENSURE(m_nState == 0 || (!m_aAffectedTree.is() && m_nState == eNoCheck), "WARNING: Configuration: Retargeting change that already was tested or applied");
-
- OSL_ENSURE( _aAffectedTree.is(), "ERROR: Configuration Change: NULL Target Tree is not allowed" );
- OSL_ENSURE( _nAffectedNode, "ERROR: Configuration Change: NULL Target Node is not allowed" );
- OSL_ENSURE( _aAffectedTree->isValidNode(_nAffectedNode), "ERROR: Configuration Change: Target Node does not match Tree" );
-
- if (m_nState != eNoCheck) m_nState = 0; // previous checks are invalidated
-
- m_aAffectedTree = _aAffectedTree;
- m_nAffectedNode = _nAffectedNode;
-}
-//-----------------------------------------------------------------------------
-
-bool NodeChangeImpl::isChange(bool bAllowUntested) const
-{
- OSL_ENSURE(bAllowUntested || (m_nState & eTestedChange), "WARNING: Configuration: Change was not tested - isChange is meaningless");
-
- if (m_nState == eNoCheck)
- return true;
-
- if (!(m_nState & eTestedChange))
- return bAllowUntested;
-
- return doIsChange();
-}
-//-----------------------------------------------------------------------------
-
-sal_uInt32 NodeChangeImpl::getChangeDataCount() const
-{
- OSL_PRECOND(m_nState & eTestedChange, "WARNING: Configuration: Change was not tested - change data count may be incorrect");
-
- return doGetChangeCount();
-}
-//-----------------------------------------------------------------------------
-
-bool NodeChangeImpl::fillChangeData(NodeChangeData& rChange, sal_uInt32 _ix) const
-{
- OSL_PRECOND(_ix < doGetChangeCount(), "ERROR: Configuration: Change index out of range");
- OSL_PRECOND(m_nState & eTestedChange, "WARNING: Configuration: Change was not tested - fillChange is partially meaningless");
-
- return doFillChange(rChange, _ix) || rChange.isDataChange(); // force true if the data is signaling change
-}
-//-----------------------------------------------------------------------------
-
-bool NodeChangeImpl::fillChangeLocation(NodeChangeLocation& rChange, sal_uInt32 _ix) const
-{
- if (!m_aAffectedTree.is()) return false;
-
- rChange.setBase( NodeID(this->getTargetTree().get(), this->getTargetNode()) );
-
- rChange.setAccessor( this->doGetChangingNodePath(_ix) );
-
- rChange.setAffected( NodeID(this->getTargetTree().get(), this->getTargetNode()) );
-
- rChange.setChangingSubnode( this->doIsChangingSubnode() );
-
- return true;
-}
-//-----------------------------------------------------------------------------
-
-bool NodeChangeImpl::fillChangeInfo(NodeChangeInformation& rChange, sal_uInt32 _ix) const
-{
- return fillChangeLocation(rChange.location, _ix) & fillChangeData(rChange.change, _ix);
-}
-//-----------------------------------------------------------------------------
-
-void NodeChangeImpl::test()
-{
- if (!(m_nState & eTestedChange))
- {
- doTest(implGetTarget());
- m_nState |= eTestedChange;
- }
-}
-//-----------------------------------------------------------------------------
-
-void NodeChangeImpl::apply()
-{
- if (!(m_nState & eAppliedChange))
- {
- implApply();
-
- OSL_ENSURE(m_nState & eAppliedChange, "ERROR: Configuration: Change could not be applied");
- OSL_ENSURE(m_nState & eTestedChange, "ERROR: Configuration: Change was not tested while applied");
- }
- else
- OSL_ENSURE(m_nState & eTestedChange, "ERROR: Configuration: Change marked applied but not tested");
-}
-//-----------------------------------------------------------------------------
-
-// default count is 1
-sal_uInt32 NodeChangeImpl::doGetChangeCount() const
-{
- return 1;
-}
-//-----------------------------------------------------------------------------
-
-/// apply this change to the given node - start state is nState (which is then updated)
-void NodeChangeImpl::implApply()
-{
- OSL_ASSERT( !(m_nState & eAppliedChange)); // Caller must check
-
- view::Node aTarget = implGetTarget();
-
- if (!(m_nState & eTestedChange)) // Test checks the old value if there is realy a change
- { // for eventlisteners to say "the old value is kept"
- doTest(aTarget);
- m_nState |= eTestedChange;
- }
-
- doApply(aTarget);
- m_nState |= eAppliedChange;
-}
-//-----------------------------------------------------------------------------
-
-view::Node NodeChangeImpl::implGetTarget()
-{
- OSL_ENSURE(m_aAffectedTree.is(), "ERROR: Configuration Change: no target tree set");
-
- OSL_ENSURE(m_aAffectedTree->isValidNode(m_nAffectedNode), "ERROR: Configuration Change: target node not in target tree");
-
- view::Node aTarget = getTargetView().makeNode(m_nAffectedNode);
- OSL_ENSURE(aTarget.is(), "ERROR: Configuration: No target for change");
- return aTarget;
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// Value operations: ValueChangeImpl = common base
-//-----------------------------------------------------------------------------
-
-ValueChangeImpl::ValueChangeImpl()
-: m_aNewValue()
-, m_aOldValue()
-{
-}
-//-----------------------------------------------------------------------------
-
-ValueChangeImpl::ValueChangeImpl(com::sun::star::uno::Any const& aNewValue)
-: m_aNewValue(aNewValue)
-, m_aOldValue()
-{
-}
-//-----------------------------------------------------------------------------
-
-ValueChangeImpl::ValueChangeImpl(com::sun::star::uno::Any const& aNewValue, com::sun::star::uno::Any const& aOldValue)
-: NodeChangeImpl(true)
-, m_aNewValue(aNewValue)
-, m_aOldValue(aOldValue)
-{
-}
-//-----------------------------------------------------------------------------
-
-ValueChangeImpl::~ValueChangeImpl()
-{
-}
-//-----------------------------------------------------------------------------
-
-void ValueChangeImpl::setTarget(view::GroupNode const& _aParentNode, rtl::OUString const& sNodeName)
-{
- OSL_ENSURE(sNodeName.getLength() != 0, "ValueChangeTarget is being set without a name");
-
- NodeChangeImpl::setTarget(_aParentNode.node());
- m_aName = sNodeName;
-}
-//-----------------------------------------------------------------------------
-
-void ValueChangeImpl::setTarget(rtl::Reference<Tree> const& aAffectedTree, unsigned int nParentNode, rtl::OUString const& sNodeName)
-{
- OSL_ENSURE(sNodeName.getLength() != 0, "ValueChangeTarget is being set without a name");
-
- NodeChangeImpl::setTarget(aAffectedTree,nParentNode);
- m_aName = sNodeName;
-}
-//-----------------------------------------------------------------------------
-
-RelativePath ValueChangeImpl::doGetChangingNodePath(sal_uInt32 ) const
-{
- return RelativePath( Path::wrapSimpleName(m_aName) );
-}
-//-----------------------------------------------------------------------------
-
-bool ValueChangeImpl::doIsChangingSubnode() const
-{
- return m_aName.getLength() != 0;
-}
-//-----------------------------------------------------------------------------
-
-bool ValueChangeImpl::doIsChange() const
-{
- return !!(getNewValue() != getOldValue());
-}
-//-----------------------------------------------------------------------------
-
-bool ValueChangeImpl::doFillChange(NodeChangeData& rChange, sal_uInt32) const
-{
- rChange.unoData.newValue = getNewValue();
- rChange.unoData.oldValue = getOldValue();
- return rChange.unoData.isDataChange();
-}
-//-----------------------------------------------------------------------------
-
-void ValueChangeImpl::doTest( view::Node const& rTarget)
-{
- view::ViewTreeAccess aTargetView = getTargetView();
-
- OSL_ENSURE(rTarget.isGroupNode(), "ERROR: Configuration: Target type mismatch: expected a group node holding the value");
-
- ValueMemberNode aValueTarget = aTargetView.getValue( view::GroupNode(rTarget), m_aName );
-
- OSL_ENSURE(aValueTarget.isValid(), "ERROR: Configuration: Target missing: could not find the changing value");
-
- preCheckValue(aValueTarget, m_aOldValue, m_aNewValue);
-}
-//-----------------------------------------------------------------------------
-
-void ValueChangeImpl::doApply( view::Node const& rTarget)
-{
- view::ViewTreeAccess aTargetView = getTargetView();
-
- OSL_ENSURE(rTarget.isGroupNode(), "ERROR: Configuration: Target type mismatch: expected a group node holding the value");
-
- ValueMemberUpdate aValueTarget = aTargetView.getValueForUpdate( view::GroupNode(rTarget), m_aName );
-
- OSL_ENSURE(aValueTarget.isValid(), "ERROR: Configuration: Target missing: could not find the changing value");
-
- doApplyChange(aValueTarget);
- configmgr::configuration::ValueMemberNode aNode(aValueTarget.getNode());
- postCheckValue(aNode, m_aNewValue); // Sideeffect: m_aNewValue will be changed
-}
-//-----------------------------------------------------------------------------
-
-void ValueChangeImpl::preCheckValue(ValueMemberNode& rNode, com::sun::star::uno::Any& rOld, com::sun::star::uno::Any& )
-{
- com::sun::star::uno::Any aPrevValue = rNode.getValue();
- OSL_ENSURE(!rOld.hasValue() || rOld == aPrevValue, "ERROR: Configuration: Stored old value of target does not match the actual value");
- rOld = aPrevValue;
-}
-//-----------------------------------------------------------------------------
-
-void ValueChangeImpl::postCheckValue(ValueMemberNode& rNode, com::sun::star::uno::Any& rNew)
-{
- com::sun::star::uno::Any aResultValue = rNode.getValue();
- OSL_ENSURE(!rNew.hasValue() || rNew == aResultValue, "ERROR: Configuration: New value of target does not match the predicted result");
- rNew = aResultValue;
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// Value operations: ValueReplaceImpl = set local value
-//-----------------------------------------------------------------------------
-
-ValueReplaceImpl::ValueReplaceImpl(com::sun::star::uno::Any const& aNewValue)
-:ValueChangeImpl(aNewValue)
-{
-}
-//-----------------------------------------------------------------------------
-
-ValueReplaceImpl::ValueReplaceImpl(com::sun::star::uno::Any const& aNewValue, com::sun::star::uno::Any const& aOldValue)
-:ValueChangeImpl(aNewValue, aOldValue)
-{
-}
-//-----------------------------------------------------------------------------
-
-void ValueReplaceImpl::doApplyChange( ValueMemberUpdate& rNode)
-{
- rNode.setValue(getNewValue());
-}
-//-----------------------------------------------------------------------------
-
-bool ValueReplaceImpl::doFillChange( NodeChangeData& rChange, sal_uInt32 _ix) const
-{
- rChange.type = NodeChangeData::eSetValue;
- return ValueChangeImpl::doFillChange(rChange, _ix);
-}
-
-//-----------------------------------------------------------------------------
-// Value operations: ValueResetImpl = set to default
-//-----------------------------------------------------------------------------
-
-ValueResetImpl::ValueResetImpl()
-:ValueChangeImpl()
-, m_bTargetIsDefault(false)
-{
-}
-//-----------------------------------------------------------------------------
-
-ValueResetImpl::ValueResetImpl(com::sun::star::uno::Any const& aNewValue, com::sun::star::uno::Any const& aOldValue)
-:ValueChangeImpl(aNewValue, aOldValue)
-, m_bTargetIsDefault(false)
-{
-}
-//-----------------------------------------------------------------------------
-
-void ValueResetImpl::doApplyChange( ValueMemberUpdate& rNode)
-{
- rNode.setDefault();
-}
-//-----------------------------------------------------------------------------
-
-bool ValueResetImpl::doIsChange() const
-{
- return !m_bTargetIsDefault;
-}
-//-----------------------------------------------------------------------------
-
-bool ValueResetImpl::doFillChange( NodeChangeData& rChange, sal_uInt32 _ix) const
-{
- rChange.type = NodeChangeData::eSetDefault;
- ValueChangeImpl::doFillChange(rChange,_ix);
- return !m_bTargetIsDefault && !rChange.isEmptyChange(); // do it defensively here - default (= 'new') may be unknown still
-}
-//-----------------------------------------------------------------------------
-
-void ValueResetImpl::preCheckValue(ValueMemberNode& rNode, com::sun::star::uno::Any& rOld, com::sun::star::uno::Any& rNew)
-{
- ValueChangeImpl::preCheckValue(rNode,rOld,rNew);
-
- com::sun::star::uno::Any aDefaultValue = rNode.getDefaultValue();
- OSL_ENSURE(!rNew.hasValue() || rNew == aDefaultValue, "ERROR: Configuration: Stored new value of target does not match the actual default value");
- rNew = aDefaultValue;
- m_bTargetIsDefault = rNode.isDefault();
-}
-
-//-----------------------------------------------------------------------------
-// All Set Changes: SetChangeImpl - common base
-//-----------------------------------------------------------------------------
-
-SetChangeImpl::SetChangeImpl(bool bNoCheck)
-: NodeChangeImpl(bNoCheck)
-{
-}
-//-----------------------------------------------------------------------------
-
-bool SetChangeImpl::doIsChangingSubnode() const
-{
- return false;
-}
-
-//-----------------------------------------------------------------------------
-// Resetting a set to its default state
-//-----------------------------------------------------------------------------
-
-SetResetImpl::SetResetImpl(
- SetElementFactory& _rElementFactory,
- std::auto_ptr<ISubtree> _pDefaultData,
- bool _bNoCheck
-)
-: SetChangeImpl(_bNoCheck)
-, m_aDefaultData(_pDefaultData)
-, m_rElementFactory(_rElementFactory)
-, m_aTreeChanges()
-{
-}
-//-----------------------------------------------------------------------------
-
-SetResetImpl::~SetResetImpl()
-{
-}
-//-----------------------------------------------------------------------------
-
-RelativePath SetResetImpl::doGetChangingNodePath(sal_uInt32 _ix) const
-{
- OSL_ENSURE( _ix < m_aTreeChanges.size() || _ix == scCommonBase, "Illegal Change index" );
- OSL_ASSERT( static_cast<size_t>(scCommonBase) > m_aTreeChanges.size() );
-
- if ( _ix < m_aTreeChanges.size() )
- return RelativePath( m_aTreeChanges[_ix].m_aElementName);
-
- else
- return RelativePath();
-}
-//-----------------------------------------------------------------------------
-
-static NodeChangeData::Type getChangeType(ElementTreeChange const& aChange)
-{
- sal_Bool bHasNew = aChange.m_aAddedElement.is();
- sal_Bool bHasOld = aChange.m_aRemovedElement.is();
-
- NodeChangeData::Type aResult;
- if (bHasNew)
- aResult = bHasOld ? NodeChangeData::eReplaceElement : NodeChangeData::eInsertElement;
- else
- aResult = bHasOld ? NodeChangeData::eRemoveElement : NodeChangeData::eSetDefault;
-
- return aResult;
-}
-//-----------------------------------------------------------------------------
-
-bool SetResetImpl::doIsChange() const
-{
- return !m_aTreeChanges.empty() || m_aDefaultData.get();
-}
-//-----------------------------------------------------------------------------
-
-bool SetResetImpl::doFillChange(NodeChangeData& rChange, sal_uInt32 _ix) const
-{
- OSL_ENSURE( _ix < m_aTreeChanges.size() || _ix == scCommonBase, "Illegal Change index" );
- if (_ix >= m_aTreeChanges.size())
- {
- rChange.type = NodeChangeData::eResetSetDefault;
- return m_aDefaultData.get() != NULL;
- }
- ElementTreeChange const& aChange = m_aTreeChanges[_ix];
-
- rChange.type = getChangeType(aChange);
-
- rChange.element.newValue = aChange.m_aAddedElement;
- rChange.element.oldValue = aChange.m_aRemovedElement;
-
- return true;
-}
-//-----------------------------------------------------------------------------
-
-void SetResetImpl::doTest( view::Node const& rTarget)
-{
- if ( m_aDefaultData.get() )
- {
- view::ViewTreeAccess accessor = this->getTargetView();
-
- view::SetNode aTargetSet(rTarget);
-
- std::auto_ptr<SubtreeChange> pChanges = accessor.differenceToDefaultState(aTargetSet, *m_aDefaultData);
-
- if (pChanges.get())
- {
- for (SubtreeChange::MutatingChildIterator it = pChanges->begin_changes(),
- stop = pChanges->end_changes();
- it != stop;
- ++it)
- {
- rtl::OUString aName(it->getNodeName());
-
- SetEntry anExistingEntry = accessor.findElement(aTargetSet,aName);
-
- rtl::Reference<ElementTree> aOldTree = anExistingEntry.tree();
- rtl::Reference<ElementTree> aNewTree;
-
- if (AddNode * addNode = dynamic_cast< AddNode * >(&*it))
- {
- rtl::Reference< data::TreeSegment > pAddedNode = addNode->getNewTree();
-
- OSL_ENSURE(pAddedNode.is(), "Processing an addNode to default - no node to add");
-
- aNewTree = m_rElementFactory.instantiateOnDefault(pAddedNode,accessor.getElementTemplate(aTargetSet)).get();
- }
-
-
- Path::Component aFullName =
- aNewTree.is() ? aNewTree->getExtendedRootName() :
- aOldTree.is() ? aOldTree->getExtendedRootName() :
- Path::makeCompositeName(aName,accessor.getElementTemplate(aTargetSet)->getName());
-
- OSL_ENSURE(aOldTree.is() || aNewTree.is(), "No data for change to default");
-
- m_aTreeChanges.push_back(ElementTreeChange(aFullName,aNewTree,aOldTree));
- }
- }
-
- m_aDefaultData.reset();
- }
-}
-//-----------------------------------------------------------------------------
-
-void SetResetImpl::doApply( view::Node const& rTarget)
-{
- view::ViewTreeAccess accessor = this->getTargetView();
-
- view::SetNode aTargetSet(rTarget);
-
- for (std::vector< ElementTreeChange >::iterator it = m_aTreeChanges.begin(); it != m_aTreeChanges.end(); ++it)
- {
- rtl::OUString aElementName = it->m_aElementName.getName();
-
- if (it->m_aRemovedElement.is())
- accessor.removeElement(aTargetSet, aElementName);
-
- if (it->m_aAddedElement.is())
- {
- SetEntry aNewEntry( it->m_aAddedElement.get() );
- accessor.insertElement(aTargetSet, aElementName, aNewEntry);
- }
-
- OSL_ENSURE(getChangeType(*it) != NodeChangeData::eSetDefault,
- "Cannot apply change without data");
- }
-}
-
-//-----------------------------------------------------------------------------
-// All Set Changes affecting a single element: SetElementChangeImpl - common base
-//-----------------------------------------------------------------------------
-
-SetElementChangeImpl::SetElementChangeImpl(Path::Component const& aName, bool bNoCheck)
-: SetChangeImpl(bNoCheck)
-, m_aName(aName)
-{
-}
-//-----------------------------------------------------------------------------
-
-RelativePath SetElementChangeImpl::doGetChangingNodePath(sal_uInt32 ) const
-{
- return RelativePath(getFullElementName());
-}
-//-----------------------------------------------------------------------------
-
-void SetElementChangeImpl::doTest( view::Node const& rTarget)
-{
- doTestElement(view::SetNode(rTarget), getElementName() );
-}
-//-----------------------------------------------------------------------------
-
-void SetElementChangeImpl::doApply( view::Node const& rTarget)
-{
- doApplyToElement(view::SetNode(rTarget), getElementName() );
-}
-
-//-----------------------------------------------------------------------------
-// Full Sets: SetInsertTreeImpl
-//-----------------------------------------------------------------------------
-
-SetInsertImpl::SetInsertImpl(Path::Component const& aName, rtl::Reference<ElementTree> const& aNewTree, bool bNoCheck)
-: SetElementChangeImpl(aName,bNoCheck)
-, m_aNewTree(aNewTree)
-{
-}
-//-----------------------------------------------------------------------------
-
-bool SetInsertImpl::doIsChange() const
-{
- return !!m_aNewTree.is();
-}
-//-----------------------------------------------------------------------------
-
-bool SetInsertImpl::doFillChange(NodeChangeData& rChange, sal_uInt32) const
-{
- rChange.type = NodeChangeData::eInsertElement;
- if (m_aNewTree.is())
- rChange.element.newValue = m_aNewTree;
-
- return isChange(true);
-}
-//-----------------------------------------------------------------------------
-
-void SetInsertImpl::doTestElement( view::SetNode const& _aNode, rtl::OUString const& aName)
-{
- SetEntry anEntry = getTargetView().findElement(_aNode,aName); // require loaded children
- OSL_ENSURE(!anEntry.isValid(), "ERROR: Configuration: Adding a node that already exists");
-}
-//-----------------------------------------------------------------------------
-
-void SetInsertImpl::doApplyToElement( view::SetNode const& _aNode, rtl::OUString const& aName)
-{
- if (m_aNewTree.is())
- {
- SetEntry aNewEntry( m_aNewTree.get() );
- getTargetView().insertElement( _aNode, aName, aNewEntry);
- }
-}
-
-//-----------------------------------------------------------------------------
-// Full Sets: SetReplaceTreeImpl
-//-----------------------------------------------------------------------------
-
-SetReplaceImpl::SetReplaceImpl(Path::Component const& aName, rtl::Reference<ElementTree> const& aNewTree)
-: SetElementChangeImpl(aName)
-, m_aNewTree(aNewTree)
-, m_aOldTree()
-{
-}
-//-----------------------------------------------------------------------------
-
-SetReplaceImpl::SetReplaceImpl(Path::Component const& aName, rtl::Reference<ElementTree> const& aNewTree, rtl::Reference<ElementTree> const& aOldTree)
-: SetElementChangeImpl(aName,true)
-, m_aNewTree(aNewTree)
-, m_aOldTree(aOldTree)
-{
-}
-//-----------------------------------------------------------------------------
-
-/// checks, if this represents an actual change
-bool SetReplaceImpl::doIsChange() const
-{
- return !(m_aOldTree == m_aNewTree);
-}
-//-----------------------------------------------------------------------------
-
-/// fills in pre- and post-change values, returns wether they differ
-bool SetReplaceImpl::doFillChange(NodeChangeData& rChange, sal_uInt32) const
-{
- rChange.type = NodeChangeData::eReplaceElement;
- if (m_aNewTree.is())
- rChange.element.newValue = m_aNewTree;
-
- if (m_aOldTree.is())
- rChange.element.oldValue = m_aOldTree;
-
- return isChange(true);
-}
-//-----------------------------------------------------------------------------
-
-void SetReplaceImpl::doTestElement( view::SetNode const& _aNode, rtl::OUString const& aName)
-{
- OSL_ASSERT(!m_aOldTree.is()); // already tested ?
-
- // remove the old node
- SetEntry anEntry = getTargetView().findElement(_aNode,aName); // require loaded children
- OSL_ENSURE(anEntry.isValid(), "ERROR: Configuration: Replacing a node that doesn't exist");
-
- m_aOldTree = anEntry.tree();
-}
-//-----------------------------------------------------------------------------
-
-void SetReplaceImpl::doApplyToElement( view::SetNode const& _aNode, rtl::OUString const& aName)
-{
- if (m_aOldTree != m_aNewTree)
- {
- view::ViewTreeAccess aTargetView = this->getTargetView();
-
- OSL_ENSURE(m_aOldTree.is(), "ERROR: Configuration: Replacing a node that doesn't exist");
- aTargetView.removeElement(_aNode, aName);
-
- // add the new one
- OSL_ENSURE(m_aNewTree.is(), "ERROR: Configuration: Replacing a node with nothing");
- if (m_aNewTree.is())
- {
- SetEntry aNewEntry( m_aNewTree.get() );
- aTargetView.insertElement( _aNode, aName, aNewEntry);
- }
- }
-}
-
-//-----------------------------------------------------------------------------
-// Full Sets: SetRemoveTreeImpl
-//-----------------------------------------------------------------------------
-
-SetRemoveImpl::SetRemoveImpl(Path::Component const& aName)
-: SetElementChangeImpl(aName)
-, m_aOldTree()
-{
-}
-//-----------------------------------------------------------------------------
-
-SetRemoveImpl::SetRemoveImpl(Path::Component const& aName, rtl::Reference<ElementTree> const& aOldTree)
-: SetElementChangeImpl(aName,true)
-, m_aOldTree(aOldTree)
-{
-}
-//-----------------------------------------------------------------------------
-
-/// checks, if this represents an actual change
-bool SetRemoveImpl::doIsChange() const
-{
- return !!m_aOldTree.is();
-}
-//-----------------------------------------------------------------------------
-
-/// fills in pre- and post-change values, returns wether they differ
-bool SetRemoveImpl::doFillChange(NodeChangeData& rChange, sal_uInt32) const
-{
- rChange.type = NodeChangeData::eRemoveElement;
- if (m_aOldTree.is())
- rChange.element.oldValue = m_aOldTree;
-
- return isChange(true);
-}
-//-----------------------------------------------------------------------------
-
-void SetRemoveImpl::doTestElement( view::SetNode const& _aNode, rtl::OUString const& aName)
-{
- OSL_ASSERT(!m_aOldTree.is()); // already tested ?
-
- // remove the old node
- SetEntry anEntry = getTargetView().findElement(_aNode,aName); // require loaded children
- OSL_ENSURE(anEntry.isValid(), "ERROR: Configuration: Removing a node that doesn't exist");
-
- m_aOldTree = anEntry.tree();
-}
-//-----------------------------------------------------------------------------
-
-void SetRemoveImpl::doApplyToElement( view::SetNode const& _aNode, rtl::OUString const& aName)
-{
- getTargetView().removeElement(_aNode, aName);
-}
-
-//-----------------------------------------------------------------------------
- }
-}
diff --git a/configmgr/source/treemgr/nodechangeimpl.hxx b/configmgr/source/treemgr/nodechangeimpl.hxx
deleted file mode 100644
index 2a4b77404f..0000000000
--- a/configmgr/source/treemgr/nodechangeimpl.hxx
+++ /dev/null
@@ -1,429 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CONFIGCHANGEIMPL_HXX_
-#define CONFIGMGR_CONFIGCHANGEIMPL_HXX_
-
-#include "configexcept.hxx"
-#include "configpath.hxx"
-#include "viewaccess.hxx"
-#include <rtl/ref.hxx>
-#include <salhelper/simplereferenceobject.hxx>
-#include "utility.hxx"
-
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif
-
-#ifndef INCLUDED_MEMORY
-#include <memory>
-#define INCLUDED_MEMORY
-#endif
-
-namespace configmgr
-{
- class ISubtree;
-
- namespace view { class ViewTreeAccess; struct Node; struct GroupNode; struct SetNode; }
-//-----------------------------------------------------------------------------
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-
- class ValueMemberNode;
- class ValueMemberUpdate;
-//-----------------------------------------------------------------------------
- class NodeChangeData;
- class NodeChangeLocation;
- class NodeChangeInformation;
-//-----------------------------------------------------------------------------
- struct ElementTreeChange
- {
- Path::Component m_aElementName;
- rtl::Reference<ElementTree> m_aAddedElement;
- rtl::Reference<ElementTree> m_aRemovedElement;
-
- ElementTreeChange(
- Path::Component const& _aElementName,
- rtl::Reference<ElementTree> const& _aAddedElement,
- rtl::Reference<ElementTree> const& _aRemovedElement
- )
- : m_aElementName(_aElementName)
- , m_aAddedElement(_aAddedElement)
- , m_aRemovedElement(_aRemovedElement)
- {}
-
- bool isChange() const
- {
- return !!(m_aAddedElement != m_aRemovedElement);
- }
- };
-//-----------------------------------------------------------------------------
-
-
- /// represents a node position in some tree
- class NodeChangeImpl
- : public salhelper::SimpleReferenceObject
- {
- public:
- explicit
- NodeChangeImpl(bool bNoCheck = false);
-
- public:
- // related/affected nodes and trees
- /// the tree within which the change occurs
- rtl::Reference<Tree> getTargetTree() const;
-
- /// the node that is affected by the change
- unsigned int getTargetNode() const;
-
- protected:
- /// setup the 'target' node that is to be affected or changed
- void setTarget(rtl::Reference<Tree> const& _aAffectedTree, unsigned int _nAffectedNode);
- void setTarget(view::Node _aAffectedNode);
-
- view::ViewTreeAccess getTargetView();
- public:
- // getting information
- /*static const sal_uInt32*/ enum { scCommonBase = ~0u };
-
- /// checks, if this represents an actual change - with or without requiring a preceding test
- bool isChange(bool bAllowUntested) const;
-
- /// return the number of distict changes in this object
- sal_uInt32 getChangeDataCount() const;
-
- /// fills in base change location, returns whether it is set
- bool fillChangeLocation(NodeChangeLocation& rChange, sal_uInt32 _ix = scCommonBase) const;
-
- /// fills in pre- and post-change values, returns whether they may differ
- bool fillChangeData(NodeChangeData& rChange, sal_uInt32 _ix) const;
-
- /// fills in change location and values, returns whether data may be changed
- bool fillChangeInfo(NodeChangeInformation& rChange, sal_uInt32 _ix) const;
-
- /// test whether this really is a change to the stored 'changing' node
- void test();
-
- /// apply this change to the stored 'changing' node
- void apply();
-
- private:
- /// virtual hooks for some of the public methods
- /// return the number of distict changes in this object
- sal_uInt32 doGetChangeCount() const;
-
- /// the path from base to 'changing' node
- virtual RelativePath doGetChangingNodePath(sal_uInt32 _ix) const = 0;
-
- /// is the change really affecting a child (or children) of the affected node (true for values)
- virtual bool doIsChangingSubnode() const = 0;
-
- /// checks, if this represents an actual change (given whether the change has been applied or not)
- virtual bool doIsChange() const = 0;
-
- /// fills in pre- and post-change values, returns wether they differ
- virtual bool doFillChange(NodeChangeData& rChange, sal_uInt32 _ix) const = 0;
-
- /// dry-check whether this is a change
- virtual void doTest( view::Node const& rTarget) = 0;
- /// do apply the actual change
- virtual void doApply( view::Node const& rTarget) = 0;
-
- private:
- rtl::Reference<Tree> m_aAffectedTree;
- unsigned int m_nAffectedNode;
- sal_uInt16 m_nState;
-
- void implApply();
- view::Node implGetTarget();
- };
-//-----------------------------------------------------------------------------
-
- /// represents a node position in some tree
- class ValueChangeImpl
- : public NodeChangeImpl
- {
- rtl::OUString m_aName;
- com::sun::star::uno::Any m_aNewValue;
- com::sun::star::uno::Any m_aOldValue;
- public:
- explicit ValueChangeImpl();
- explicit ValueChangeImpl(com::sun::star::uno::Any const& aNewValue);
- explicit ValueChangeImpl(com::sun::star::uno::Any const& aNewValue, com::sun::star::uno::Any const& aOldValue);
- ~ValueChangeImpl();
-
- public:
- /// setup the 'target' node that is to be affected or changed
- void setTarget(view::GroupNode const& _aParentNode, rtl::OUString const& sNodeName);
- void setTarget(rtl::Reference<Tree> const& aAffectedTree, unsigned int nParentNode, rtl::OUString const& sNodeName);
-
- public:
- /// get the name of the value
- rtl::OUString getValueName() const { return m_aName; }
-
- /// get the pre-change value (if known)
- com::sun::star::uno::Any getOldValue() const { return m_aOldValue; }
- /// get the post-change value (if known)
- com::sun::star::uno::Any getNewValue() const { return m_aNewValue; }
-
- protected:
- using NodeChangeImpl::setTarget;
- // override information items
- /// the path from base to 'affected' node - here is the name of the changing node
- virtual RelativePath doGetChangingNodePath(sal_uInt32 _ix) const;
-
- /// is the change really affecting a child of the affected node (true here)
- virtual bool doIsChangingSubnode() const;
-
- protected:
- // override change information items
- /// checks, if this represents an actual change (given whether the change has been applied or not)
- virtual bool doIsChange() const;
-
- /// fills in pre- and post-change values, returns wether they differ
- virtual bool doFillChange(NodeChangeData& rChange, sal_uInt32 _ix) const = 0;
-
- protected:
- // override apply functionality
- /// retrieve the old value from the given node
- virtual void doTest( view::Node const& rTarget);
- /// do apply the actual change
- virtual void doApply( view::Node const& rTarget);
-
- protected:
- // new overrideables
- /// extract the pre-change value from the target context
- virtual void preCheckValue(ValueMemberNode& rNode, com::sun::star::uno::Any& rOld, com::sun::star::uno::Any& rNew);
- /// extract the post-change value from the target context
- virtual void postCheckValue(ValueMemberNode& rNode, com::sun::star::uno::Any& rNew);
- /// apply the new value to the target context
- virtual void doApplyChange(ValueMemberUpdate& rNode) = 0;
- };
-//-----------------------------------------------------------------------------
-
- /// represents setting a value node to a given value
- class ValueReplaceImpl
- : public ValueChangeImpl
- {
- public:
- explicit ValueReplaceImpl(com::sun::star::uno::Any const& aNewValue);
- explicit ValueReplaceImpl(com::sun::star::uno::Any const& aNewValue, com::sun::star::uno::Any const& aOldValue);
-
- protected:
- // implement: set the target to the new value
- virtual void doApplyChange( ValueMemberUpdate& rNode);
-
- /// fills in pre- and post-change values, returns wether they differ
- virtual bool doFillChange(NodeChangeData& rChange, sal_uInt32 _ix) const;
-
-// friend class SetReplaceValueImpl;
- };
-//-----------------------------------------------------------------------------
-
- /// represents resetting a value node to its default value
- class ValueResetImpl
- : public ValueChangeImpl
- {
- bool m_bTargetIsDefault;
- public:
- explicit ValueResetImpl();
- explicit ValueResetImpl(com::sun::star::uno::Any const& aNewValue, com::sun::star::uno::Any const& aOldValue);
-
- protected:
- // override: set the new value as well and check the default state
- virtual void preCheckValue(ValueMemberNode& rNode, com::sun::star::uno::Any& rOld, com::sun::star::uno::Any& rNew);
-
- /// checks, if this represents an actual change (given whether the change has been applied or not)
- virtual bool doIsChange() const;
-
- // implement: set the target to default
- virtual void doApplyChange( ValueMemberUpdate& rNode);
-
- /// fills in pre- and post-change values, returns wether they differ
- virtual bool doFillChange(NodeChangeData& rChange, sal_uInt32 _ix) const;
- };
-//-----------------------------------------------------------------------------
-
-
- /// represents a change to a set (as a container)
- class SetChangeImpl
- : public NodeChangeImpl
- {
- public:
- explicit SetChangeImpl(bool bNoCheck = false);
-
- using NodeChangeImpl::setTarget;
-
- protected:
- /// virtual hooks for some of the public methods
- /// is the change really affecting a child of the affected node (false here)
- virtual bool doIsChangingSubnode() const;
- };
-//-----------------------------------------------------------------------------
- class SetElementFactory;
-
- /// represents setting to its default state a set (as a container)
- class SetResetImpl
- : public SetChangeImpl
- {
- std::auto_ptr<ISubtree> m_aDefaultData;
- SetElementFactory& m_rElementFactory;
- std::vector< ElementTreeChange > m_aTreeChanges;
- public:
- explicit SetResetImpl(
- SetElementFactory& _rElementFactory,
- std::auto_ptr<ISubtree> _pDefaultData,
- bool _bNoCheck = false);
-
- ~SetResetImpl();
-
- protected:
- /// virtual hooks for some of the public methods
- /// retrieve the count of elements affected
- sal_uInt32 doGetChangeCount() const;
-
- /// the path from base to 'affected' node
- virtual RelativePath doGetChangingNodePath(sal_uInt32 _ix) const;
-
- /// checks, if this represents an actual change (given whether the change has been applied or not)
- virtual bool doIsChange() const;
- /// fills in pre- and post-change values, returns wether they differ
- virtual bool doFillChange(NodeChangeData& rChange, sal_uInt32 _ix) const;
-
-
- /// retrieve the old value from the given node
- virtual void doTest( view::Node const& rTarget);
- /// do apply the actual change
- virtual void doApply( view::Node const& rTarget);
- };
-//-----------------------------------------------------------------------------
-
- /// represents a change to an element of a set (as a container)
- class SetElementChangeImpl
- : public SetChangeImpl
- {
- Path::Component m_aName;
- public:
- explicit SetElementChangeImpl(Path::Component const& aName, bool bNoCheck = false);
-
- /// the name of the element being changed
- Path::Component getFullElementName() const { return m_aName; }
-
- /// the name of the element being changed
- rtl::OUString getElementName() const { return m_aName.getName(); }
-
- protected:
- /// virtual hooks for some of the public methods
- /// the path from base to 'affected' node - use element name
- virtual RelativePath doGetChangingNodePath(sal_uInt32 _ix) const;
-
- /// retrieve the old value from the given node
- virtual void doTest( view::Node const& rTarget);
- /// do apply the actual change
- virtual void doApply( view::Node const& rTarget);
-
- private:
- /// new overridable: retrieve the old value from a properly typed node
- virtual void doTestElement(view::SetNode const& _aNode, rtl::OUString const& aName) = 0;
- /// new overridable: apply the change to a properly typed node
- virtual void doApplyToElement(view::SetNode const& _aNode, rtl::OUString const& aName) = 0;
- };
-//-----------------------------------------------------------------------------
-
- /// represents an insertion into a set of trees
- class SetInsertImpl
- : public SetElementChangeImpl
- {
- rtl::Reference<ElementTree> m_aNewTree;
- public:
- explicit SetInsertImpl(Path::Component const& aName, rtl::Reference<ElementTree> const& aNewTree, bool bNoCheck = false);
-
- protected:
- /// checks, if this represents an actual change (given whether the change has been applied or not)
- virtual bool doIsChange() const;
- /// fills in pre- and post-change values, returns wether they differ
- virtual bool doFillChange(NodeChangeData& rChange, sal_uInt32 _ix) const;
-
- /// new overridable: retrieve the old value from a properly typed node
- virtual void doTestElement(view::SetNode const& _aNode, rtl::OUString const& aName);
- /// new overridable: apply the change to a properly typed node
- virtual void doApplyToElement(view::SetNode const& _aNode, rtl::OUString const& aName);
- };
-//-----------------------------------------------------------------------------
-
- /// represents a substitution within a set of trees
- class SetReplaceImpl
- : public SetElementChangeImpl
- {
- rtl::Reference<ElementTree> m_aNewTree;
- rtl::Reference<ElementTree> m_aOldTree;
- public:
- explicit SetReplaceImpl(Path::Component const& aName, rtl::Reference<ElementTree> const& aNewTree);
- explicit SetReplaceImpl(Path::Component const& aName, rtl::Reference<ElementTree> const& aNewTree, rtl::Reference<ElementTree> const& aOldTree);
-
- protected:
- /// checks, if this represents an actual change (given whether the change has been applied or not)
- virtual bool doIsChange() const;
- /// fills in pre- and post-change values, returns wether they differ
- virtual bool doFillChange(NodeChangeData& rChange, sal_uInt32 _ix) const;
-
- /// new overridable: retrieve the old value from a properly typed node
- virtual void doTestElement(view::SetNode const& _aNode, rtl::OUString const& aName);
- /// new overridable: apply the change to a properly typed node
- virtual void doApplyToElement(view::SetNode const& _aNode, rtl::OUString const& aName);
- };
-//-----------------------------------------------------------------------------
-
- /// represents a removal from of a set of trees
- class SetRemoveImpl
- : public SetElementChangeImpl
- {
- rtl::Reference<ElementTree> m_aOldTree;
- public:
- explicit SetRemoveImpl(Path::Component const& aName);
- explicit SetRemoveImpl(Path::Component const& aName, rtl::Reference<ElementTree> const& aOldTree);
-
- protected:
- /// checks, if this represents an actual change (given whether the change has been applied or not)
- virtual bool doIsChange() const;
- /// fills in pre- and post-change values, returns wether they differ
- virtual bool doFillChange(NodeChangeData& rChange, sal_uInt32 _ix) const;
-
- /// new overridable: retrieve the old value from a properly typed node
- virtual void doTestElement(view::SetNode const& _aNode, rtl::OUString const& aName);
- /// new overridable: apply the change to a properly typed node
- virtual void doApplyToElement(view::SetNode const& _aNode, rtl::OUString const& aName);
- };
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_CONFIGCHANGEIMPL_HXX_
diff --git a/configmgr/source/treemgr/nodechangeinfo.cxx b/configmgr/source/treemgr/nodechangeinfo.cxx
deleted file mode 100644
index ff07cc6c49..0000000000
--- a/configmgr/source/treemgr/nodechangeinfo.cxx
+++ /dev/null
@@ -1,221 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "nodechangeinfo.hxx"
-
-#include "noderef.hxx"
-#include "tree.hxx"
-
-namespace configmgr
-{
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-
-NodeChangeData::NodeChangeData()
-: type(eNoChange)
-, unoData()
-, element()
-{
-}
-//-----------------------------------------------------------------------------
-
-NodeChangeData::NodeChangeData(NodeChangeData const& aOther)
-: type(aOther.type)
-, unoData(aOther.unoData)
-, element(aOther.element)
-{
-}
-//-----------------------------------------------------------------------------
-
-NodeChangeData& NodeChangeData::operator=(NodeChangeData const& aOther)
-{
- type = aOther.type;
- unoData = aOther.unoData;
- element = aOther.element;
- return *this;
-}
-//-----------------------------------------------------------------------------
-
-NodeChangeData::~NodeChangeData()
-{
-}
-//-----------------------------------------------------------------------------
-
-bool NodeChangeData::isDataChange() const
-{
- if (isSetChange() && element.isDataChange())
- return true;
-
- return unoData.isDataChange();
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference< Tree > NodeChangeData::getNewElementTree() const
-{
- return element.newValue.get();
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference< Tree > NodeChangeData::getOldElementTree() const
-{
- return element.oldValue.get();
-}
-//-----------------------------------------------------------------------------
-
-NodeID NodeChangeData::getNewElementNodeID() const
-{
- rtl::Reference<ElementTree> newElement = this->element.newValue;
- if ( newElement.is() && newElement->nodeCount() > 0)
- {
- return NodeID( newElement.get(), Tree::ROOT );
- }
- else
- return NodeID(0,0);
-}
-//-----------------------------------------------------------------------------
-
-NodeID NodeChangeData::getOldElementNodeID() const
-{
- rtl::Reference<ElementTree> oldElement = this->element.oldValue;
- if ( oldElement.is() && oldElement->nodeCount() > 0)
- {
- return NodeID( oldElement.get(), Tree::ROOT );
- }
- else
- return NodeID(0,0);
-}
-//-----------------------------------------------------------------------------
-
-NodeChangeLocation::NodeChangeLocation()
-: m_path()
-, m_base(0,0)
-, m_affected(0,0)
-, m_bSubNodeChanging(false)
-{
-}
-//-----------------------------------------------------------------------------
-bool NodeChangeLocation::isValidLocation() const
-{
- return m_base.isValidNode() &&
- (m_affected.isEmpty()
- ? ! m_bSubNodeChanging
- : ( m_affected.isValidNode() &&
- (! m_bSubNodeChanging ||
- (!m_path.isEmpty() &&
- SubNodeID(m_affected,m_path.getLocalName().getName()).isValidNode()
- ) ) ) );
-}
-#if OSL_DEBUG_LEVEL > 0
-//-----------------------------------------------------------------------------
-bool NodeChangeLocation::isValidData() const
-{
- return m_base.isValidNode() &&
- (m_affected.isEmpty()
- ? ! m_bSubNodeChanging
- : ( m_affected.isValidNode() &&
- (! m_bSubNodeChanging || !m_path.isEmpty() )
- ) );
-}
-#endif
-//-----------------------------------------------------------------------------
-
-void NodeChangeLocation::setAccessor(RelativePath const& aAccessor)
-{
- m_path = aAccessor;
-}
-//-----------------------------------------------------------------------------
-
-void NodeChangeLocation::setBase(NodeID const& aBaseNode)
-{
- m_base = aBaseNode;
-}
-//-----------------------------------------------------------------------------
-
-void NodeChangeLocation::setAffected(NodeID const& aTargetNode)
-{
- m_affected = aTargetNode;
-
- if (m_base.isEmpty())
- setBase(aTargetNode);
-}
-//-----------------------------------------------------------------------------
-
-void NodeChangeLocation::setChangingSubnode( bool bSubnode )
-{
- OSL_ENSURE(!m_affected.isEmpty() || !bSubnode, "Change without target cannot affect subnode");
-
- m_bSubNodeChanging = bSubnode;
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference< Tree > NodeChangeLocation::getBaseTree() const
-{
- OSL_ENSURE(m_base.isValidNode(), "Invalid base location set in NodeChangeLocation");
- return m_base.getTree();
-}
-//-----------------------------------------------------------------------------
-
-NodeRef NodeChangeLocation::getBaseNode() const
-{
- OSL_ENSURE(m_base.isValidNode(), "Invalid base location set in NodeChangeLocation");
- return m_base.getNode();
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference< Tree > NodeChangeLocation::getAffectedTreeRef() const
-{
- NodeID aAffected = this->getAffectedNodeID();
- return aAffected.getTree();
-}
-//-----------------------------------------------------------------------------
-
-NodeID NodeChangeLocation::getAffectedNodeID() const
-{
- OSL_ENSURE(m_affected.isEmpty() || m_affected.isValidNode(), "Invalid target location set in NodeChangeLocation");
- return m_affected;
-}
-//-----------------------------------------------------------------------------
-
-SubNodeID NodeChangeLocation::getChangingValueID() const
-{
- if (!m_bSubNodeChanging) return SubNodeID::createEmpty();
-
- OSL_ENSURE(!m_affected.isEmpty() && m_affected.isValidNode(), "Invalid target location set in NodeChangeLocation with subnode");
- OSL_ENSURE(!m_path.isEmpty(), "No target accessor set in NodeChangeLocation with subnode");
-
- SubNodeID aResult( m_affected, m_path.getLocalName().getName() );
-
- return aResult;
-}
-//-----------------------------------------------------------------------------
- }
-}
-
diff --git a/configmgr/source/treemgr/nodefactory.cxx b/configmgr/source/treemgr/nodefactory.cxx
deleted file mode 100644
index ea11e230cf..0000000000
--- a/configmgr/source/treemgr/nodefactory.cxx
+++ /dev/null
@@ -1,133 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-#include "nodefactory.hxx"
-#include "nodeimplobj.hxx"
-#include "configpath.hxx"
-#include <osl/diagnose.h>
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
-namespace view
-{
-
-// Creating Specific types of nodes
-//-----------------------------------------------------------------------------
-namespace
-{
-//---------------------------------------------------------------------
- struct BasicNodeFactory : NodeFactory
- {
- rtl::Reference<configuration::NodeImpl> makeValueNode(sharable::ValueNode * node);
- rtl::Reference<configuration::NodeImpl> makeGroupNode(sharable::GroupNode * node);
- rtl::Reference<configuration::NodeImpl> makeSetNode(sharable::SetNode * node, configuration::Template* pTemplate);
- };
- //-------------------------------------------------------------------------
-
- rtl::Reference<configuration::NodeImpl> BasicNodeFactory::makeValueNode(sharable::ValueNode * node)
- {
- return new configuration::ValueElementNodeImpl(node);
- }
- //-------------------------------------------------------------------------
-
- rtl::Reference<configuration::NodeImpl> BasicNodeFactory::makeGroupNode(sharable::GroupNode * node)
- {
- return new configuration::GroupNodeImpl(node);
- }
- //-------------------------------------------------------------------------
-
- rtl::Reference<configuration::NodeImpl> BasicNodeFactory::makeSetNode(sharable::SetNode * node, configuration::Template* pTemplate)
- {
- return new configuration::SetNodeImpl(node, pTemplate);
- }
- //-------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-
- struct DeferredNodeFactory : NodeFactory
- {
- rtl::Reference<configuration::NodeImpl> makeValueNode(sharable::ValueNode * node);
- rtl::Reference<configuration::NodeImpl> makeGroupNode(sharable::GroupNode * node);
- rtl::Reference<configuration::NodeImpl> makeSetNode(sharable::SetNode * node, configuration::Template* pTemplate);
- };
- //-------------------------------------------------------------------------
-
- rtl::Reference<configuration::NodeImpl> DeferredNodeFactory::makeValueNode(sharable::ValueNode * node)
- {
- // OSL_ENSURE(false, "Wrong factory for value elements - should be immutable (=read-only)");
- return new configuration::ValueElementNodeImpl(node);
- }
- //-------------------------------------------------------------------------
-
- rtl::Reference<configuration::NodeImpl> DeferredNodeFactory::makeGroupNode(sharable::GroupNode * node)
- {
- return new configuration::DeferredGroupNodeImpl(node);
- }
- //-------------------------------------------------------------------------
-
- rtl::Reference<configuration::NodeImpl> DeferredNodeFactory::makeSetNode(sharable::SetNode * node, configuration::Template* pTemplate)
- {
- return new configuration::DeferredSetNodeImpl(node, pTemplate);
- }
- //-------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-} // anonymous
-//-----------------------------------------------------------------------------
-
-// Different standard (static) factories
-//---------------------------------------------------------------------
-
- /// provides a factory for immediately commiting node implementations
- NodeFactory& getDirectAccessFactory()
- {
- static BasicNodeFactory aFactory;
- return aFactory;
- }
- /// provides a factory for read-only node implementations
- NodeFactory& getReadAccessFactory()
- {
- static BasicNodeFactory aFactory;
- return aFactory;
- }
- /// provides a factory for nodes that cache changes temporarily
- NodeFactory& getDeferredChangeFactory()
- {
- static DeferredNodeFactory aFactory;
- return aFactory;
- }
-
-//---------------------------------------------------------------------
-} // view
-
-//-----------------------------------------------------------------------------
-} // configmgr
-
diff --git a/configmgr/source/treemgr/nodefactory.hxx b/configmgr/source/treemgr/nodefactory.hxx
deleted file mode 100644
index a19019ce25..0000000000
--- a/configmgr/source/treemgr/nodefactory.hxx
+++ /dev/null
@@ -1,64 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CONFIGNODEFACTORY_HXX_
-#define CONFIGMGR_CONFIGNODEFACTORY_HXX_
-
-#include <rtl/ref.hxx>
-
-namespace configmgr
-{
- namespace configuration
- {
- class NodeImpl;
- class Template;
- }
- namespace sharable {
- struct GroupNode;
- struct SetNode;
- struct ValueNode;
- }
-//-----------------------------------------------------------------------------
- namespace view
- {
-//-----------------------------------------------------------------------------
-
-// Creating Specific types of nodes
-//-----------------------------------------------------------------------------
-
- struct NodeFactory
- {
- virtual rtl::Reference<configuration::NodeImpl> makeValueNode(sharable::ValueNode * node) = 0;
- virtual rtl::Reference<configuration::NodeImpl> makeGroupNode(sharable::GroupNode * node) = 0;
- virtual rtl::Reference<configuration::NodeImpl> makeSetNode(sharable::SetNode * node, configuration::Template* pTemplate) = 0;
- };
- }
-//-----------------------------------------------------------------------------
-
-}
-
-#endif // CONFIGMGR_CONFIGNODEFACTORY_HXX_
diff --git a/configmgr/source/treemgr/nodeimpl.cxx b/configmgr/source/treemgr/nodeimpl.cxx
deleted file mode 100644
index 03e796ff5d..0000000000
--- a/configmgr/source/treemgr/nodeimpl.cxx
+++ /dev/null
@@ -1,137 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-#include "nodeimpl.hxx"
-#include "valuenodeimpl.hxx"
-#include "groupnodeimpl.hxx"
-#include "nodevisitor.hxx"
-#include "tree.hxx"
-#include "nodechange.hxx"
-#include "nodechangeimpl.hxx"
-#include "nodechangeinfo.hxx"
-#include "change.hxx"
-#include <osl/diagnose.h>
-
-namespace configmgr
-{
- namespace configuration
- {
-
-// Specific types of nodes
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// class GroupNodeImpl
-//-----------------------------------------------------------------------------
-
-sharable::GroupNode * GroupNodeImpl::getDataAccess() const
-{
- sharable::Node * node = getOriginalNodeAccess();
- OSL_ASSERT(node != 0 && node->isGroup());
- return &node->group;
-}
-//-----------------------------------------------------------------------------
-
-GroupNodeImpl::GroupNodeImpl(sharable::GroupNode * _pNodeRef)
- : NodeImpl(reinterpret_cast<sharable::Node *>(_pNodeRef))
- , m_pCache( NULL )
-{
-}
-//-----------------------------------------------------------------------------
-
-bool GroupNodeImpl::areValueDefaultsAvailable() const
-{
- return getDataAccess()->hasDefaultsAvailable();
-}
-//-----------------------------------------------------------------------------
-
-ValueMemberNode GroupNodeImpl::makeValueMember(sharable::ValueNode * node)
-{
- return ValueMemberNode(node);
-}
-//-----------------------------------------------------------------------------
-
-sharable::ValueNode * GroupNodeImpl::getOriginalValueNode(rtl::OUString const& _aName) const
-{
- OSL_ENSURE( _aName.getLength() != 0, "Cannot get nameless child value");
-
- sharable::GroupNode * group = getDataAccess();
-
- if (m_pCache)
- {
- if (m_pCache->isNamed(_aName))
- return m_pCache->valueData();
-
- m_pCache = group->getNextChild(m_pCache);
-
- if (m_pCache && m_pCache->isNamed(_aName))
- return m_pCache->valueData();
- m_pCache = NULL;
- }
-
- sharable::Node * child = group->getChild(_aName);
- m_pCache = child;
-
- // to do: investigate cache lifecycle more deeply.
-
- return child == 0 ? 0 : child->valueData();
-}
-
-//-----------------------------------------------------------------------------
-// class ValueElementNodeImpl
-//-----------------------------------------------------------------------------
-
-sharable::ValueNode * ValueElementNodeImpl::getDataAccess() const
-{
- sharable::Node * node = getOriginalNodeAccess();
- OSL_ASSERT(node != 0 && node->isValue());
- return &node->value;
-}
-//-----------------------------------------------------------------------------
-
-ValueElementNodeImpl::ValueElementNodeImpl(sharable::ValueNode * const& _aNodeRef)
- : NodeImpl(reinterpret_cast<sharable::Node *>(_aNodeRef))
-{
-}
-//-----------------------------------------------------------------------------
-
-com::sun::star::uno::Any ValueElementNodeImpl::getValue() const
-{
- return getDataAccess()->getValue();
-}
-//-----------------------------------------------------------------------------
-
-com::sun::star::uno::Type ValueElementNodeImpl::getValueType() const
-{
- return getDataAccess()->getValueType();
-}
-//-----------------------------------------------------------------------------
- }
-}
diff --git a/configmgr/source/treemgr/nodeimpl.hxx b/configmgr/source/treemgr/nodeimpl.hxx
deleted file mode 100644
index 0a5fc172c3..0000000000
--- a/configmgr/source/treemgr/nodeimpl.hxx
+++ /dev/null
@@ -1,89 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_CONFIGNODEBEHAVIOR_HXX_
-#define CONFIGMGR_CONFIGNODEBEHAVIOR_HXX_
-
-#include "attributes.hxx"
-#include "node.hxx"
-#include "utility.hxx"
-#include <rtl/ref.hxx>
-#include <salhelper/simplereferenceobject.hxx>
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace view { class ViewStrategy; }
-//-----------------------------------------------------------------------------
- namespace configuration
- {
- //-----------------------------------------------------------------------------
- class Tree;
- class NodeChange;
- class NodeChanges;
- class NodeChangesInformation;
-
-//-----------------------------------------------------------------------------
-// Specific types of nodes
-//-----------------------------------------------------------------------------
-
- class NodeImpl;
- struct INodeHandler;
-
- // Almost an interface, but derives from concrete OReference
- class NodeImpl : public salhelper::SimpleReferenceObject
- {
- friend class view::ViewStrategy;
- sharable::Node * m_pNodeRef;
- public:
- NodeImpl(sharable::Node * _pNodeRef)
- : m_pNodeRef(_pNodeRef) {}
-
- public:
- /// provide access to the data of the underlying node
- sharable::Node * getOriginalNodeAccess() const
- { return m_pNodeRef; }
- };
-
-//-----------------------------------------------------------------------------
- class ValueElementNodeImpl;
- class GroupNodeImpl;
- class SetNodeImpl;
-//-----------------------------------------------------------------------------
-
- struct INodeHandler
- {
- virtual void handle( ValueElementNodeImpl& rNode) = 0;
- virtual void handle( GroupNodeImpl& rNode) = 0;
- virtual void handle( SetNodeImpl& rNode) = 0;
- };
-
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_CONFIGNODEBEHAVIOR_HXX_
diff --git a/configmgr/source/treemgr/nodeimplobj.cxx b/configmgr/source/treemgr/nodeimplobj.cxx
deleted file mode 100644
index d255c357a4..0000000000
--- a/configmgr/source/treemgr/nodeimplobj.cxx
+++ /dev/null
@@ -1,1162 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-#include "nodeimplobj.hxx"
-
-
-#include "nodechange.hxx"
-#include "nodechangeinfo.hxx"
-#include "nodechangeimpl.hxx"
-#include "valuenode.hxx"
-#include "change.hxx"
-#include "viewaccess.hxx"
-#include "viewfactory.hxx"
-
-namespace configmgr
-{
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-// Value Nodes
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// class DeferredValueElementNodeImpl
-//-----------------------------------------------------------------------------
-
-// Group Nodes
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// class DeferredGroupNodeImpl
-//-----------------------------------------------------------------------------
-
-DeferredGroupNodeImpl::DeferredGroupNodeImpl(sharable::GroupNode * const& _aNodeRef)
-: GroupNodeImpl(_aNodeRef)
-, m_aChanges()
-{
-}
-//-----------------------------------------------------------------------------
-
-DeferredGroupNodeImpl::~DeferredGroupNodeImpl()
-{
-}
-//-----------------------------------------------------------------------------
-
-ValueMemberNode DeferredGroupNodeImpl::makeValueMember(rtl::OUString const& _aName, bool _bForUpdate)
-{
- MemberChanges::iterator it = m_aChanges.find(_aName);
-
- if (it != m_aChanges.end())
- {
- if (!it->second.is())
- OSL_ENSURE(_aName.getLength() == 0, "ERROR: Found empty change reference");
-
- else if (_bForUpdate || it->second->isChange()) // found one
- return ValueMemberNode(it->second);
-
- else // leftover non-change
- m_aChanges.erase(it);
-
- // if not found continue with default
- }
-
- sharable::ValueNode * original = getOriginalValueNode(_aName);
-
- if (_bForUpdate) // create a new change
- {
- if (original != 0)
- {
- rtl::Reference<ValueMemberNode::DeferredImpl> aNewChange(new ValueMemberNode::DeferredImpl(original));
- m_aChanges[_aName] = aNewChange;
-
- return ValueMemberNode(aNewChange);
- }
- }
-
- return GroupNodeImpl::makeValueMember(original);
-}
-//-----------------------------------------------------------------------------
-
-bool DeferredGroupNodeImpl::hasChanges() const
-{
- for (MemberChanges::const_iterator it = m_aChanges.begin(); it != m_aChanges.end(); ++it)
- {
- if (!it->second.is())
- {
- // empty element is present -> marked as changed
- OSL_ASSERT(it->first.getLength() == 0);
- return true;
- }
-
- if (it->second->isChange())
- return true;
- }
-
- return false;
-}
-//-----------------------------------------------------------------------------
-
-void DeferredGroupNodeImpl::collectValueChanges(NodeChanges& rChanges, Tree* pParentTree, unsigned int nNode) const
-{
- for (MemberChanges::const_iterator it = m_aChanges.begin(); it != m_aChanges.end(); ++it)
- {
- if (it->second.is())
- {
- OSL_ASSERT(it->first.getLength() != 0);
- if (ValueChangeImpl* pValueChange = it->second->collectChange())
- {
- pValueChange->setTarget(pParentTree,nNode,it->first);
-
- rChanges.add( NodeChange(pValueChange) );
- }
- else // leftover non-change
- OSL_ENSURE(!it->second->isChange(), "Got no change from a changing value") ;
- }
- else
- OSL_ASSERT(it->first.getLength() == 0);
- }
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference<ValueMemberNode::DeferredImpl> DeferredGroupNodeImpl::findValueChange(rtl::OUString const& aName)
-{
- rtl::Reference<ValueMemberNode::DeferredImpl> aResult;
-
- MemberChanges::iterator it = m_aChanges.find(aName);
-
- if (it != m_aChanges.end())
- {
- if (it->second.is() )
- {
- if (it->second->isChange())
- {
- aResult = it->second;
- }
-
- else // leftover non-change -> drop
- {
- m_aChanges.erase(it);
- }
- }
- else
- OSL_ENSURE(aName.getLength() == 0, "ERROR: Found empty change reference");
- }
-
- return aResult;
-}
-
-//-----------------------------------------------------------------------------
-
-std::auto_ptr<SubtreeChange> DeferredGroupNodeImpl::preCommitValueChanges()
-{
- std::auto_ptr<SubtreeChange> aRet;
-
- if (!m_aChanges.empty())
- {
- sharable::Node * originalData = this->getOriginalNodeAccess();
- aRet.reset( new SubtreeChange( originalData->getName(),
- originalData->getAttributes() ) );
-
- for (MemberChanges::iterator pos = m_aChanges.begin(); pos != m_aChanges.end(); )
- {
- MemberChanges::iterator it = pos++; // this is used to allow erasing below
-
- if (!it->second.is())
- {
- OSL_ASSERT(it->first.getLength() == 0);
- }
- else if (it->second->isChange())
- {
- std::auto_ptr<ValueChange> aValueChange = it->second->preCommitChange();
- if (aValueChange.get())
- {
- std::auto_ptr<Change> aBaseChange(aValueChange.release());
- aRet->addChange( aBaseChange );
- }
- else
- OSL_ENSURE(false, "Got no change from a changed member");
- }
- else // found left-over non-change
- m_aChanges.erase(it);
- }
- if (m_aChanges.empty()) aRet.reset();
- }
-
- return aRet;
-}
-//-----------------------------------------------------------------------------
-
-void DeferredGroupNodeImpl::finishCommit(SubtreeChange& rChanges)
-{
- OSL_ENSURE(!rChanges.isSetNodeChange(),"ERROR: Change type SET does not match group");
-
- for(SubtreeChange::MutatingChildIterator it = rChanges.begin_changes(), stop = rChanges.end_changes();
- it != stop;
- ++it)
- {
- rtl::OUString aValueName(it->getNodeName());
-
- MemberChanges::iterator itStoredChange = m_aChanges.find(aValueName);
-
- if (itStoredChange != m_aChanges.end())
- {
- ValueChange * valueChange = dynamic_cast< ValueChange * >(&*it);
- OSL_ENSURE(valueChange != 0, "Unexpected type of element change");
- if (valueChange == 0) throw Exception("Unexpected type of element change");
-
- rtl::Reference<ValueMemberNode::DeferredImpl> aStoredChange = itStoredChange->second;
- OSL_ENSURE( aStoredChange.is(), "Found empty change object for Member value change");
-
- if (aStoredChange.is())
- {
- aStoredChange->finishCommit(*valueChange);
- OSL_ENSURE(!aStoredChange->isChange(),"ValueChange is not moot after finishCommit");
- }
-
- m_aChanges.erase( itStoredChange ); // remove finished change
- }
- else
- OSL_ENSURE(dynamic_cast< ValueChange * >(&*it) == 0, "Value member change has no change data representation");
-
- }
-
- OSL_DEBUG_ONLY( m_aChanges.erase( rtl::OUString() ) ); // remove change marker (if present)
- OSL_ENSURE(m_aChanges.empty(), "Found unprocessed changes to values in group");
-
- m_aChanges.clear(); // remove all pending stuff and marker
-}
-//-----------------------------------------------------------------------------
-
-void DeferredGroupNodeImpl::revertCommit(SubtreeChange& rChanges)
-{
- OSL_ENSURE(!rChanges.isSetNodeChange(),"ERROR: Change type SET does not match group");
-
- for(SubtreeChange::MutatingChildIterator it = rChanges.begin_changes(), stop = rChanges.end_changes();
- it != stop;
- ++it)
- {
- rtl::OUString aValueName(it->getNodeName());
-
- MemberChanges::iterator itStoredChange = m_aChanges.find(aValueName);
-
- if (itStoredChange != m_aChanges.end())
- {
- ValueChange * valueChange = dynamic_cast< ValueChange * >(&*it);
- OSL_ENSURE(valueChange != 0, "Unexpected type of element change");
- if (valueChange == 0) continue;
-
- rtl::Reference<ValueMemberNode::DeferredImpl> aStoredChange = itStoredChange->second;
- OSL_ENSURE( aStoredChange.is(), "Cannot restore change: found empty change object for Member value change");
-
- if (aStoredChange.is())
- {
- aStoredChange->revertCommit(*valueChange);
- OSL_ENSURE(!aStoredChange->isChange(),"ValueChange is not moot after reverting - will be discarded nevertheless");
- }
- m_aChanges.erase( itStoredChange ); // remove change if it is moot
- }
- else
- OSL_ENSURE(dynamic_cast< ValueChange * >(&*it) == 0, "Value member change has no change data representation");
- }
-}
-//-----------------------------------------------------------------------------
-
-void DeferredGroupNodeImpl::failedCommit(SubtreeChange& rChanges)
-{
- OSL_ENSURE(!rChanges.isSetNodeChange(),"ERROR: Change type SET does not match group");
-
- for(SubtreeChange::MutatingChildIterator it = rChanges.begin_changes(), stop = rChanges.end_changes();
- it != stop;
- ++it)
- {
- rtl::OUString aValueName(it->getNodeName());
-
- MemberChanges::iterator itStoredChange = m_aChanges.find(aValueName);
-
- if (itStoredChange != m_aChanges.end())
- {
- ValueChange * valueChange = dynamic_cast< ValueChange * >(&*it);
- OSL_ENSURE(valueChange != 0, "Unexpected type of element change");
- if (valueChange == 0) continue;
-
- rtl::Reference<ValueMemberNode::DeferredImpl> aStoredChange = itStoredChange->second;
- OSL_ENSURE( aStoredChange.is(), "Cannot recover from failed change: found empty change object for Member value change");
-
- if (aStoredChange.is())
- aStoredChange->failedCommit(*valueChange);
- {
- if (!aStoredChange->isChange())
- m_aChanges.erase( itStoredChange ); // remove change if it is moot
- }
- }
- else
- OSL_ENSURE(dynamic_cast< ValueChange * >(&*it) == 0, "Value member change has no change data representation");
- }
-
- OSL_DEBUG_ONLY( m_aChanges.erase( rtl::OUString() ) ); // remove change marker (if present)
- OSL_ENSURE(m_aChanges.empty(), "RevertCommit: Found unprocessed changes to values in group");
-
- m_aChanges.clear(); // discard all pending stuff and marker
-}
-//-----------------------------------------------------------------------------
-
-
-void DeferredGroupNodeImpl::markChanged()
-{
- // special mark: a NULL rtl::Reference<ValueMemberNode::DeferredImpl> at empty name
- m_aChanges.insert( MemberChanges::value_type() );
-}
-//-----------------------------------------------------------------------------
-
-// Set nodes
-//-----------------------------------------------------------------------------
-
-
-//-----------------------------------------------------------------------------
-// class DeferredTreeSetNodeImpl
-//-----------------------------------------------------------------------------
-
-DeferredSetNodeImpl::DeferredSetNodeImpl(sharable::SetNode * const& _aNodeRef, Template* pTemplate)
-: SetNodeImpl(_aNodeRef,pTemplate)
-, m_aChangedData()
-, m_bChanged(false)
-, m_bDefault(false)
-{
-}
-//-----------------------------------------------------------------------------
-
-bool DeferredSetNodeImpl::doIsEmpty() const
-{
- if (m_aChangedData.isEmpty())
- return SetNodeImpl::doIsEmpty();
-
- // look for added elements
- {for(ElementSet::ConstIterator it = m_aChangedData.begin(), stop = m_aChangedData.end();
- it != stop;
- ++it)
- {
- if (it->isValid()) return false;
- }}
-
-
- // look for elements in the base set that are not 'deleted' (the changes are all deletions here)
- {for(ElementSet::Data::const_iterator it = SetNodeImpl::beginElementSet(), stop = SetNodeImpl::endElementSet();
- it != stop;
- ++it)
- {
- if (!m_aChangedData.hasElement(it->first)) return false;
- }}
-
- return true;
-}
-//-----------------------------------------------------------------------------
-
-ElementTree* DeferredSetNodeImpl::doFindElement(rtl::OUString const& aName)
-{
- ElementTreeData* pElement = m_aChangedData.getElement(aName);
- if (!pElement)
- pElement = SetNodeImpl::getStoredElement(aName);
-
- return pElement ? pElement->get() : 0;
-}
-//-----------------------------------------------------------------------------
-
-SetNodeVisitor::Result DeferredSetNodeImpl::doDispatchToElements(SetNodeVisitor& aVisitor)
-{
- SetNodeVisitor::Result eRet = SetNodeVisitor::CONTINUE;
- // look for elements in the base set that are not hidden by changes
- {for(ElementSet::Data::const_iterator it = SetNodeImpl::beginElementSet(), stop = SetNodeImpl::endElementSet();
- it != stop && eRet != SetNodeVisitor::DONE;
- ++it)
- {
- if (m_aChangedData.getElement(it->first) == 0)
- {
- OSL_ASSERT(it->second.isValid());
- eRet = aVisitor.visit(SetEntry(it->second.get()));
- }
- }}
-
- // look for added elements
- {for(ElementSet::ConstIterator it = m_aChangedData.begin(), stop = m_aChangedData.end();
- it != stop && eRet != SetNodeVisitor::DONE;
- ++it)
- {
- if (it->isValid())
- {
- eRet = aVisitor.visit(SetEntry(it->get()));
- }
- }}
- return eRet;
-}
-//-----------------------------------------------------------------------------
-
-bool DeferredSetNodeImpl::hasChanges() const
-{
- return m_bChanged || !m_aChangedData.isEmpty();
-}
-//-----------------------------------------------------------------------------
-
-void DeferredSetNodeImpl::collectElementChanges(NodeChanges& rChanges) const
-{
- // collect added and deleted nodes
- {for(ElementSet::Data::const_iterator it = m_aChangedData.beginNative(), stop = m_aChangedData.endNative();
- it != stop;
- ++it)
- {
- ElementTreeData const* pOriginal = SetNodeImpl::getStoredElement(it->first);
-
- if (it->second.isValid()) // added one
- {
- if (pOriginal)
- {
- rChanges.add(NodeChange(implCreateReplace(it->first,it->second,*pOriginal)));
- }
- else
- {
- rChanges.add(NodeChange(implCreateInsert(it->first,it->second)));
- }
- }
- else
- {
- if (pOriginal)
- {
- rChanges.add(NodeChange(implCreateRemove(it->first,*pOriginal)));
- }
-
- //else nothing to do
- }
- }}
-
- // collect preexisting nodes
- // if (!containsValues()) // value elements ar immutable !
- {for(ElementSet::Data::const_iterator it = SetNodeImpl::beginElementSet(), stop = SetNodeImpl::endElementSet();
- it != stop;
- ++it)
- {
- if (m_aChangedData.getElement(it->first) == 0)
- {
- OSL_ASSERT(it->second.isValid());
- view::ViewTreeAccess aElementView(it->second.get());
-
- if (aElementView.hasChanges())
- aElementView.collectChanges(rChanges);
- }
- }}
-
-}
-//-----------------------------------------------------------------------------
-
-void DeferredSetNodeImpl::markChanged()
-{
- m_bChanged = true;
-}
-//-----------------------------------------------------------------------------
-
-void DeferredSetNodeImpl::doTransferElements(ElementSet& rReplacement)
-{
- // transfer preexisting nodes (unless replaced/deleted)
- {for(ElementSet::Data::const_iterator it = SetNodeImpl::beginElementSet(), stop = SetNodeImpl::endElementSet();
- it != stop;
- ++it)
- {
- if (m_aChangedData.getElement(it->first) == 0)
- {
- OSL_ASSERT(it->second.isValid());
-
- rReplacement.insertElement(it->first,it->second);
- }
- }}
-
- // commit added and deleted nodes
- {
- ElementSet::Data::const_iterator it = m_aChangedData.beginNative();
- ElementSet::Data::const_iterator const stop = m_aChangedData.endNative();
-
- while(it != stop)
- {
- if (it->second.isValid())
- rReplacement.insertElement(it->first,it->second);
-
- ++it;
- m_aChangedData.removeElement(it->first);
- }
- }
-
- m_bChanged = false;
-}
-//-----------------------------------------------------------------------------
-
-void DeferredSetNodeImpl::rebuildElement(rtl::OUString const& _aName, ElementTreeData const& _aElement)
-{
- Tree* pContext = this->getParentTree();
- OSL_ENSURE(pContext, "Context tree must be set before rebuilding");
-
- rtl::Reference<view::ViewStrategy> xContextBehavior = pContext->getViewBehavior();
-
- sharable::TreeFragment * elementAccessor = this->getDataAccess()->getElement(_aName);
- OSL_ENSURE(elementAccessor != 0, "Element Tree not found in data");
-
- OSL_ENSURE(_aElement.isValid(), "Element not found in view");
- _aElement->rebuild(xContextBehavior, elementAccessor);
-}
-
-//-----------------------------------------------------------------------------
-std::auto_ptr<SubtreeChange> DeferredSetNodeImpl::preCommitChanges(std::vector< rtl::Reference<ElementTree> >& _rRemovedElements)
-{
- sharable::Node * originalData = this->getOriginalNodeAccess();
- // now first get the name of this node
- rtl::OUString sSetName = originalData->getName();
-
- // and make a SubtreeChange
- std::auto_ptr<SubtreeChange> pSetChange( new SubtreeChange(sSetName,
- getElementTemplate()->getName(),
- getElementTemplate()->getModule(),
- originalData->getAttributes() ) );
-
- // commit preexisting nodes
- {
- for(ElementSet::Data::const_iterator it = SetNodeImpl::beginElementSet(), stop = SetNodeImpl::endElementSet();
- it != stop;
- ++it)
- {
- if (m_aChangedData.getElement(it->first) == 0)
- {
- OSL_ASSERT(it->second.isValid());
- OSL_ENSURE( !m_bDefault || it->second.inDefault, "m_bDefault is inconsistent");
-
- view::ViewTreeAccess aElementView(it->second.get());
- std::auto_ptr<SubtreeChange> pNewChange = aElementView.preCommitChanges(_rRemovedElements);
- if (pNewChange.get() != 0)
- {
- //OSL_ENSURE( !containsValues(), "Unexpected change generated by value set element");
- std::auto_ptr<Change> pNewChangeBase( pNewChange.release() );
- pSetChange->addChange(pNewChangeBase);
- }
- }
- }
- }
-
- // commit added and deleted nodes
- {
- ElementSet::Data::const_iterator it = m_aChangedData.beginNative();
- ElementSet::Data::const_iterator const stop = m_aChangedData.endNative();
-
- while(it != stop)
- {
- rtl::OUString aName = it->first;
- ElementTreeData aNewElement = it->second;
-
- ElementTreeData* pOriginal = SetNodeImpl::getStoredElement(aName);
-
- if (aNewElement.isValid())
- {
- rtl::Reference< data::TreeSegment > aAddedTree = aNewElement->releaseOwnedTree();
- if (!aAddedTree.is())
- {
- throw Exception("INTERNAL ERROR: Could not find data for the added ElementTree");
- }
-
- OSL_ENSURE( !m_bDefault || aNewElement.inDefault, "m_bDefault is inconsistent");
-
- AddNode* pAddNode = new AddNode(aAddedTree, aName, aNewElement.inDefault );
-
- std::auto_ptr<Change> pNewChange( pAddNode );
-
- if (pOriginal)
- pAddNode->setReplacing();
-
- pSetChange->addChange(pNewChange);
- }
- else
- {
- if (pOriginal)
- {
- OSL_ENSURE( !m_bDefault || aNewElement.inDefault, "m_bDefault is inconsistent");
-
- std::auto_ptr<Change> pNewChange( new RemoveNode(aName,aNewElement.inDefault) );
-
- pSetChange->addChange(pNewChange);
- }
- //else nothing to do
- }
-
- // collect removed or replaced element
- if (pOriginal)
- _rRemovedElements.push_back( pOriginal->tree );
-
- ++it;
- }
- }
- return pSetChange;
-}
-//-----------------------------------------------------------------------------
-
-void DeferredSetNodeImpl::finishCommit(SubtreeChange& rChanges)
-{
- OSL_ENSURE(rChanges.isSetNodeChange(),"ERROR: Change type GROUP does not match set");
- OSL_ENSURE( rChanges.getElementTemplateName() == getElementTemplate()->getName(),
- "ERROR: Element template of change does not match the template of the set");
- OSL_ENSURE( rChanges.getElementTemplateModule() == getElementTemplate()->getModule(),
- "ERROR: Element template module of change does not match the template of the set");
-
- for(SubtreeChange::MutatingChildIterator it = rChanges.begin_changes(), stop = rChanges.end_changes();
- it != stop;
- ++it)
- {
- rtl::OUString aElementName(it->getNodeName());
-
- ElementTreeData* pOriginal = getStoredElement(aElementName);
-
- if (ElementTreeData* pNewElement = m_aChangedData.getElement(aElementName))
- {
- ElementTreeData aOriginal;
- if (pOriginal)
- {
- aOriginal = *pOriginal;
- OSL_ASSERT(aOriginal.isValid());
- }
- else
- OSL_ASSERT(!aOriginal.isValid());
-
- // handle a added, replaced or deleted node
- rtl::Reference< data::TreeSegment > aRemovedTree;
-
- if (pNewElement->isValid())
- {
- AddNode * addNode = dynamic_cast< AddNode * >(&*it);
- OSL_ENSURE(addNode != 0, "Unexpected type of element change");
- if (addNode == 0) throw Exception("Unexpected type of element change");
-
- aRemovedTree = addNode->getReplacedTree();
- OSL_ASSERT( addNode->isReplacing() == (0!=pOriginal) );
- OSL_ASSERT( addNode->isReplacing() == (bool) aRemovedTree.is() );
-
- if (aOriginal.isValid())
- SetNodeImpl::replaceElement(aElementName,*pNewElement);
-
- else
- SetNodeImpl::insertElement(aElementName,*pNewElement);
-
- this->rebuildElement(aElementName,*pNewElement);
- }
- else
- {
- RemoveNode * removeNode = dynamic_cast< RemoveNode * >(&*it);
- OSL_ENSURE(removeNode != 0, "Unexpected type of element change");
- if (removeNode == 0) throw Exception("Unexpected type of element change");
-
- aRemovedTree = removeNode->getRemovedTree();
-
- OSL_ASSERT(aOriginal.isValid());
- if (aOriginal.isValid())
- SetNodeImpl::removeElement(aElementName);
- }
- // handle a added or deleted node
- if (aOriginal.isValid())
- {
- OSL_ENSURE(aRemovedTree.is(), "Cannot take over the removed node");
-
- aOriginal->takeTreeAndRebuild(aRemovedTree);
- }
- m_aChangedData.removeElement(aElementName);
- }
- else
- {
- // handle preexisting nodes
- //OSL_ENSURE(!containsValues(), "Unexpected change to value set element");
- OSL_ENSURE(pOriginal && pOriginal->isValid(), "Changed Element is missing");
- SubtreeChange * subtreeChange = dynamic_cast< SubtreeChange * >(&*it);
- OSL_ENSURE(subtreeChange != 0, "Unexpected type of element change");
-
- if (subtreeChange == 0) throw Exception("Unexpected set element change");
-
- if (pOriginal && pOriginal->isValid())
- view::ViewTreeAccess(pOriginal->get()).finishCommit(*subtreeChange);
- }
- }
- m_bChanged = false;
-
- OSL_ENSURE(m_aChangedData.isEmpty(), "ERROR: Uncommitted changes left in set node");
-}
-//-----------------------------------------------------------------------------
-
-void DeferredSetNodeImpl::revertCommit(SubtreeChange& rChanges)
-{
- OSL_ENSURE(rChanges.isSetNodeChange(),"ERROR: Change type GROUP does not match set");
- OSL_ENSURE( rChanges.getElementTemplateName() == getElementTemplate()->getName(),
- "ERROR: Element template of change does not match the template of the set");
- OSL_ENSURE( rChanges.getElementTemplateModule() == getElementTemplate()->getModule(),
- "ERROR: Element template module of change does not match the template of the set");
-
-
- for(SubtreeChange::MutatingChildIterator it = rChanges.begin_changes(), stop = rChanges.end_changes();
- it != stop;
- ++it)
- {
- rtl::OUString aElementName(it->getNodeName());
-
- ElementTreeData* pOriginal = getStoredElement(aElementName);
-
- if (ElementTreeData* pNewElement = m_aChangedData.getElement(aElementName))
- {
- // handle a added, replaced or deleted node
- rtl::Reference< data::TreeSegment > pRemovedTree;
-
- if (pNewElement->isValid())
- {
- AddNode * addNode = dynamic_cast< AddNode * >(&*it);
- OSL_ENSURE(addNode != 0, "Unexpected type of element change");
- if (addNode == 0) throw Exception("Unexpected type of element change");
-
- pRemovedTree = addNode->getReplacedTree();
- OSL_ASSERT( addNode->isReplacing() == (0!=pOriginal) );
- OSL_ASSERT( addNode->isReplacing() == (0!=pRemovedTree.is()) );
-
- OSL_ENSURE(!addNode->wasInserted(), "Cannot retract new node: Change was integrated");
-
- rtl::Reference< data::TreeSegment > aAddedTree = addNode->getNewTree();
- OSL_ENSURE(aAddedTree.is(), "Cannot restore new node: Change lost ownership");
-
- // restore the tree
- (*pNewElement)->takeTreeBack(aAddedTree);
- }
- else
- {
- RemoveNode * removeNode = dynamic_cast< RemoveNode * >(&*it);
- OSL_ENSURE(removeNode != 0, "Unexpected type of element change");
- if (removeNode == 0) throw Exception("Unexpected type of element change");
-
- pRemovedTree = removeNode->getRemovedTree();
-
- OSL_ASSERT(pOriginal);
- OSL_ASSERT((0 != pOriginal) == (0!=pRemovedTree.is()) );
- }
- OSL_ENSURE(pRemovedTree.is(), "Possible problems reverting removed node: Change took ownership");
- // try handle a added or deleted node
- if (pOriginal)
- {
- OSL_ASSERT(pOriginal->isValid());
- (*pOriginal)->takeTreeAndRebuild(pRemovedTree);
- OSL_DEBUG_ONLY(pRemovedTree.clear());
- }
- OSL_ENSURE(!pRemovedTree.is(), "Could not revert removed node: Nowhere to put ownership");
- }
- else
- {
- // handle preexisting nodes
- //OSL_ENSURE(!containsValues(), "Unexpected change to value set element");
- OSL_ENSURE(pOriginal && pOriginal->isValid(), "Changed Element is missing");
- SubtreeChange * subtreeChange = dynamic_cast< SubtreeChange * >(&*it);
- OSL_ENSURE(subtreeChange != 0, "Unexpected set element change");
-
- if (subtreeChange == 0) throw Exception("Unexpected set element change");
-
- if (pOriginal && pOriginal->isValid())
- view::ViewTreeAccess(pOriginal->get()).revertCommit(*subtreeChange);
- }
- }
-}
-//-----------------------------------------------------------------------------
-
-void DeferredSetNodeImpl::failedCommit(SubtreeChange& rChanges)
-{
- OSL_ENSURE(rChanges.isSetNodeChange(),"ERROR: Change type GROUP does not match set");
- OSL_ENSURE( rChanges.getElementTemplateName() == getElementTemplate()->getName(),
- "ERROR: Element template of change does not match the template of the set");
- OSL_ENSURE( rChanges.getElementTemplateModule() == getElementTemplate()->getModule(),
- "ERROR: Element template module of change does not match the template of the set");
-
- for(SubtreeChange::MutatingChildIterator it = rChanges.begin_changes(), stop = rChanges.end_changes();
- it != stop;
- ++it)
- {
- rtl::OUString aElementName(it->getNodeName());
-
- ElementTreeData* pOriginal = getStoredElement(aElementName);
-
- if (ElementTreeData* pNewElement = m_aChangedData.getElement(aElementName))
- {
- ElementTreeData aOriginal;
- if (pOriginal)
- {
- aOriginal = *pOriginal;
- OSL_ASSERT(aOriginal.isValid());
- }
- else
- OSL_ASSERT(!aOriginal.isValid());
-
- // handle a added, replaced or deleted node
- rtl::Reference< data::TreeSegment > aRemovedTree;
-
- if (pNewElement->isValid())
- {
- AddNode * addNode = dynamic_cast< AddNode * >(&*it);
- OSL_ENSURE(addNode != 0, "Unexpected type of element change");
- if (addNode == 0) throw Exception("Unexpected type of element change");
-
- aRemovedTree = addNode->getReplacedTree();
- OSL_ASSERT( addNode->isReplacing() == (0!=pOriginal) );
- OSL_ASSERT( addNode->isReplacing() == (bool) aRemovedTree.is() );
-
- if (addNode->wasInserted())
- { // it has been integrated into the master tree
- OSL_ENSURE(getDataAccess()->getElement(aElementName) == addNode->getInsertedTree(),
- "Internal Error: Inserted tree address does not match actual data");
-
- // so add it
- if (aOriginal.isValid())
- SetNodeImpl::replaceElement(aElementName,*pNewElement);
-
- else
- SetNodeImpl::insertElement(aElementName,*pNewElement);
-
- this->rebuildElement(aElementName,*pNewElement);
- }
- else // Change not done; need to restore new node (element will be released into the wild then)
- {
- rtl::Reference< data::TreeSegment > aAddedTree = addNode->getNewTree();
-
- OSL_ENSURE(aAddedTree.is(), "Unexpected: added node is gone, but where ? May cause invalid references");
- (*pNewElement)->takeTreeBack(aAddedTree);
- detach(*pNewElement);
- }
- }
- else
- {
- RemoveNode * removeNode = dynamic_cast< RemoveNode * >(&*it);
- OSL_ENSURE(removeNode != 0, "Unexpected type of element change");
- if (removeNode == 0) throw Exception("Unexpected type of element change");
-
- aRemovedTree = removeNode->getRemovedTree();
-
- OSL_ASSERT(aOriginal.isValid());
- if (aRemovedTree.is() && getDataAccess()->getElement(aElementName) == 0)
- {
- // really removed - then remove the originel
- if (aOriginal.isValid())
- SetNodeImpl::removeElement(aElementName);
- }
- }
-
- // handle a added or deleted node
- if (aOriginal.isValid() && aRemovedTree.is())
- {
- aOriginal->takeTreeAndRebuild(aRemovedTree);
- //aOriginal->getAccess().makeDirect();
- OSL_DEBUG_ONLY(aRemovedTree.clear());
- }
- OSL_ENSURE(!aRemovedTree.is(), "Could not revert removed node: Nowhere to put ownership");
-
- m_aChangedData.removeElement(aElementName);
- }
- else
- {
- // handle preexisting nodes
- //OSL_ENSURE(!containsValues(), "Unexpected change to value set element");
- OSL_ENSURE(pOriginal && pOriginal->isValid(), "Changed Element is missing");
- SubtreeChange * subtreeChange = dynamic_cast< SubtreeChange * >(&*it);
- OSL_ENSURE(subtreeChange != 0, "Unexpected set element change");
-
- if (subtreeChange == 0) throw Exception("Unexpected set element change");
-
- if (pOriginal && pOriginal->isValid())
- view::ViewTreeAccess(pOriginal->get()).recoverFailedCommit(*subtreeChange);
- }
- }
- m_bChanged = false;
- m_bDefault = false;
-
- OSL_ENSURE(m_aChangedData.isEmpty(), "ERROR: Uncommitted changes left in set node");
-}
-//-----------------------------------------------------------------------------
-
-void DeferredSetNodeImpl::insertNewElement(rtl::OUString const& aName, ElementTreeData const& aNewElement)
-{
- attach(aNewElement,aName);
- try
- {
- // put the new element into the changed set
- ElementTreeData* pAddedElement = m_aChangedData.getElement(aName);
- if (pAddedElement)
- {
- OSL_ENSURE(!pAddedElement->isValid(),"WARNING: Element being inserted was already there - replacing");
- detach(m_aChangedData.replaceElement(aName,aNewElement));
- }
- else
- {
- m_aChangedData.insertElement(aName, aNewElement);
- }
- m_bChanged = true;
- m_bDefault = false;
- }
- catch (std::exception&)
- {
- detach(aNewElement);
- throw;
- }
-}
-//-------------------------------------------------------------------------
-
-void DeferredSetNodeImpl::removeOldElement(rtl::OUString const& aName)
-{
- // put an empty (dummy) element into the changed set
- ElementTreeData* pAddedElement = m_aChangedData.getElement(aName);
- if (pAddedElement)
- {
- OSL_ENSURE(pAddedElement->isValid(),"WARNING: Element being removed was already removed");
- detach(m_aChangedData.replaceElement(aName, ElementTreeData()));
- m_bChanged = true;
- m_bDefault = false;
- }
- else
- {
- m_aChangedData.insertElement(aName, ElementTreeData());
- }
-
- // now check the original one
- ElementTreeData* pOldElement = getStoredElement(aName);
- if (pOldElement)
- {
- OSL_ASSERT(pOldElement->isValid());
- detach(*pOldElement);
- m_bChanged = true;
- m_bDefault = false;
- }
- else // just clear things out
- {
- m_aChangedData.removeElement(aName);
- }
-
- OSL_ENSURE(pOldElement || pAddedElement,"WARNING: Element being removed was not found in set");
-}
-//-----------------------------------------------------------------------------
-
-SetElementChangeImpl* DeferredSetNodeImpl::doAdjustChangedElement(NodeChangesInformation& rLocalChanges, rtl::OUString const& aName, Change const& aChange)
-{
- if (ElementTreeData* pLocalElement = m_aChangedData.getElement(aName))
- {
- if (ElementTreeData* pElement = getStoredElement(aName))
- {
- OSL_ASSERT(pElement->isValid());
-
- if (SubtreeChange const * subtreeChange = dynamic_cast< SubtreeChange const * >(&aChange))
- {
- // recurse to element tree - but do not notify those changes (?)
- Tree * elementTree = pElement->get();
-
- NodeChangesInformation aIgnoredChanges;
- view::getViewBehavior(elementTree)->adjustToChanges(aIgnoredChanges, view::getRootNode(elementTree), *subtreeChange);
- }
- else
- {
- OSL_ENSURE(dynamic_cast<ValueChange const * >(&aChange) != 0, "Unexpected kind of change to value set element" );
- //OSL_ENSURE( containsValues(), "Unexpected kind of change: Value change applied to tree set element" );
- }
-
- }
- else
- {
- // could be changed to do an insert instead (?)
- OSL_ENSURE( false, "Changed Element didn't exist before it was removed/replaced" );
- }
-
- if (pLocalElement->isValid())
- {
- // we have a complete replacement for the changed node
- ElementTreeData aLocalElement = *pLocalElement;
-
- // also signal something happened
- return implCreateReplace(aName,aLocalElement,aLocalElement);
- }
- else
- {
- // already removed locally - should be notified by different route (if applicable)
- return NULL;
- }
- }
- else
- {
- return SetNodeImpl::doAdjustChangedElement( rLocalChanges,aName,aChange);
- }
-}
-//-----------------------------------------------------------------------------
-
-SetElementChangeImpl* DeferredSetNodeImpl::doAdjustToAddedElement(rtl::OUString const& aName, AddNode const& aAddNodeChange, ElementTreeData const& aNewElement)
-{
- m_bDefault = false;
- if (ElementTreeData* pLocalElement = m_aChangedData.getElement(aName))
- {
- // We have another element replacing ours - what do we do ?
- if (hasStoredElement(aName))
- {
- OSL_ENSURE( aAddNodeChange.isReplacing(), "Added Element already exists - replacing" );
-
- this->replaceElement(aName,aNewElement);
- }
- else
- {
- OSL_ENSURE( !aAddNodeChange.isReplacing(), "Replaced Element doesn't exist - simply adding" );
- this->insertElement(aName,aNewElement);
- }
-
-
- if (pLocalElement->isValid()) // ours remains a valid replacement
- {
- ElementTreeData aLocalElement = *pLocalElement;
-
- // just signal something happened
- return implCreateReplace(aName,aLocalElement,aLocalElement);
- }
- else // had been removed locally
- {
- // signal what happened
- return implCreateInsert(aName,aNewElement);
- }
- }
- else
- {
- return SetNodeImpl::implAdjustToAddedElement(aName,aNewElement,aAddNodeChange.isReplacing());
- }
-}
-//-----------------------------------------------------------------------------
-
-SetElementChangeImpl* DeferredSetNodeImpl::doAdjustToRemovedElement(rtl::OUString const& aName, RemoveNode const& /*aRemoveNodeChange*/)
-{
- m_bDefault = false;
- if (ElementTreeData* pLocalElement = m_aChangedData.getElement(aName))
- {
- if (hasStoredElement(aName))
- {
- // take away the original
- this->removeElement(aName);
- }
-
- if (pLocalElement->isValid()) // remains a valid replacement
- {
- ElementTreeData aLocalElement = *pLocalElement;
-
- // signal something happened
- return implCreateReplace(aName,aLocalElement,aLocalElement);
- }
- else // already was removed locally
- {
- return 0;
- }
- }
- else
- {
- return SetNodeImpl::implAdjustToRemovedElement(aName);
- }
-}
-//-----------------------------------------------------------------------------
-
-void DeferredSetNodeImpl::doDifferenceToDefaultState(SubtreeChange& _rChangeToDefault, ISubtree& _rDefaultTree)
-{
- if (!m_bDefault)
- {
- implDifferenceToDefaultState(_rChangeToDefault,_rDefaultTree);
-
- ElementSet::Data::const_iterator it = m_aChangedData.beginNative();
- ElementSet::Data::const_iterator const stop = m_aChangedData.endNative();
-
- while(it != stop)
- {
- rtl::OUString aName = it->first;
- ElementTreeData aElement = it->second;
-
- Change* pChange = _rChangeToDefault.getChange( aName );
- OSL_ENSURE(pChange == NULL || dynamic_cast< AddNode * >(pChange) != 0 || dynamic_cast< RemoveNode * >(pChange) != 0,
- "Unexpected change type found in difference to default tree");
-
- if (pChange == NULL)
- {
- std::auto_ptr<INode> aDefaultNode = _rDefaultTree.removeChild(aName);
- OSL_ENSURE( aDefaultNode.get(), "Error: unused Default tree not found after SetNodeImpl::implDifferenceToDefaultState");
-
- rtl::OUString aElementTypeName = _rDefaultTree.getElementTemplateName();
- OSL_ENSURE( _rDefaultTree.isSetNode(), "Error: missing set template information in default data");
-
- rtl::Reference< data::TreeSegment > aDefaultTree = data::TreeSegment::create(aDefaultNode,aElementTypeName);
- OSL_ENSURE(aDefaultTree.is(), "Error: unused Default tree not accessible after SetNodeImpl::implDifferenceToDefaultState");
-
- AddNode* pAddIt = new AddNode(aDefaultTree, aName, true );
-
- std::auto_ptr<Change> pNewChange( pAddIt );
-
- if (aElement.isValid())
- {
- OSL_ENSURE(!aElement.inDefault, "Default element replaced by default");
- pAddIt->setReplacing();
- }
-
- _rChangeToDefault.addChange(pNewChange);
-
- }
- else if (AddNode * addNode = dynamic_cast< AddNode * >(pChange))
- {
- // adjust the AddNode - remove the original expected node
- addNode->clearReplacedTree();
-
- if (aElement.isValid())
- {
- if (aElement.inDefault)
- {
- // change already done locally
- _rChangeToDefault.removeChange(aName);
- }
- else // adjust here
- addNode->setReplacing();
- }
-
- else
- OSL_ENSURE(!addNode->isReplacing(),"Could not unmark the 'replacing' state of an AddNode");
- }
- else if (RemoveNode * removeNode = dynamic_cast< RemoveNode * >(pChange))
- {
- if (aElement.isValid())
- {
- OSL_ENSURE(!aElement.inDefault, "Default element replaced by default");
- // adjust the RemoveNode - remove the original expected node
- removeNode->clearRemovedTree();
- }
- else
- {
- // change already done locally
- _rChangeToDefault.removeChange(aName);
- }
- // TODO: mark local removal as to-default
- }
- }
- }
-}
-//-----------------------------------------------------------------------------
- }
-}
diff --git a/configmgr/source/treemgr/nodeimplobj.hxx b/configmgr/source/treemgr/nodeimplobj.hxx
deleted file mode 100644
index fca0995974..0000000000
--- a/configmgr/source/treemgr/nodeimplobj.hxx
+++ /dev/null
@@ -1,198 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_NODEIMPLOBJECTS_HXX_
-#define CONFIGMGR_NODEIMPLOBJECTS_HXX_
-
-#include "sal/config.h"
-
-#include "salhelper/simplereferenceobject.hxx"
-
-#include "node.hxx"
-#include "nodeimpl.hxx"
-#include "groupnodeimpl.hxx"
-#include "setnodeimpl.hxx"
-#include "valuenodeimpl.hxx"
-#include "utility.hxx"
-
-#ifndef INCLUDED_MEMORY
-#include <memory>
-#define INCLUDED_MEMORY
-#endif
-
-namespace configmgr
-{
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-
-// Specific types of nodes for direct or read only access
-//-----------------------------------------------------------------------------
-
-// Value Nodes
-//-----------------------------------------------------------------------------
-
- class ValueMemberNode::DeferredImpl : public salhelper::SimpleReferenceObject
- {
- sharable::ValueNode * m_valueNode;
-
- com::sun::star::uno::Any m_aNewValue;
- bool m_bToDefault;
- bool m_bChange;
- public:
- explicit DeferredImpl(sharable::ValueNode * valueNode);
-
- /// does this wrap a change
- bool isChange() const { return m_bChange; }
-
- /// retrieve the underlying (original) node
- sharable::ValueNode * getOriginalNode() const
- { return m_valueNode; }
-
- /// Does this node change to default
- bool isToDefault() const { return m_bToDefault; }
-
- /// retrieve the current value of this node
- com::sun::star::uno::Any getNewValue() const { return m_aNewValue; }
-
- /// Set this node to a new value
- void setValue(com::sun::star::uno::Any const& aNewValue, sharable::ValueNode * originalNode);
-
- /// Set this node to assume its default value
- void setValueToDefault(sharable::ValueNode * originalNode);
-
- public:
- // commit protocol
- std::auto_ptr<ValueChange> preCommitChange();
- void finishCommit(ValueChange& rChange);
- void revertCommit(ValueChange& rChange);
- void failedCommit(ValueChange& rChange);
-
- ValueChangeImpl* collectChange();
- ValueChangeImpl* adjustToChange(ValueChange const& rExternalChange);
-
- // notification protocol
- void adjustToChange(NodeChangesInformation& rLocalChange, ValueChange const& rExternalChange, Tree& rParentTree, unsigned int nParentPos, rtl::OUString const& aName);
- };
-//-----------------------------------------------------------------------------
-
-
-//-----------------------------------------------------------------------------
-
-// Group Nodes
-//-----------------------------------------------------------------------------
-
- class DeferredGroupNodeImpl : public GroupNodeImpl
- {
- public:
- explicit
- DeferredGroupNodeImpl(sharable::GroupNode * const& _aNodeRef);
- explicit
- DeferredGroupNodeImpl(sharable::GroupNode * const& _aNewAddress, GroupNodeImpl& rOriginal);
-
- ~DeferredGroupNodeImpl();
-
- public:
- // commit protocol
- std::auto_ptr<SubtreeChange> preCommitValueChanges();
- void finishCommit(SubtreeChange& rChange);
- void revertCommit(SubtreeChange& rChange);
- void failedCommit(SubtreeChange& rChange);
-
- void collectValueChanges(NodeChanges& rChanges, Tree* pParent, unsigned int nNode) const;
-
- public:
- // data access
- bool hasChanges() const;
- void markChanged();
-
- rtl::Reference<ValueMemberNode::DeferredImpl> findValueChange(rtl::OUString const& aName);
-
- using GroupNodeImpl::makeValueMember;
- ValueMemberNode makeValueMember(rtl::OUString const& _aName, bool _bForUpdate);
-
- private:
- typedef std::map< rtl::OUString, rtl::Reference<ValueMemberNode::DeferredImpl> > MemberChanges;
-
- MemberChanges m_aChanges;
- };
-//-----------------------------------------------------------------------------
-
-// Set nodes
-//-----------------------------------------------------------------------------
-
- class DeferredSetNodeImpl : public SetNodeImpl
- {
- public:
- explicit
- DeferredSetNodeImpl(sharable::SetNode * const& _aNodeRef, Template* pTemplate);
-
- public:
- bool hasChanges() const;
- void markChanged();
- void collectElementChanges(NodeChanges& rChanges) const;
-
- public:
- std::auto_ptr<SubtreeChange> preCommitChanges(std::vector< rtl::Reference<ElementTree> >& _rRemovedElements);
- void failedCommit(SubtreeChange& rChanges);
- void finishCommit(SubtreeChange& rChanges);
- void revertCommit(SubtreeChange& rChanges);
-
- void insertNewElement(rtl::OUString const& aName, ElementTreeData const& aNewElement);
- void removeOldElement(rtl::OUString const& aName);
- // Base Overrideables
- private:
- // NodeImpl implementation
- virtual bool doIsEmpty() const;
- virtual ElementTree* doFindElement(rtl::OUString const& aName) ;
- virtual SetNodeVisitor::Result doDispatchToElements(SetNodeVisitor& aVisitor);
-
- virtual void doDifferenceToDefaultState(SubtreeChange& _rChangeToDefault, ISubtree& _rDefaultTree);
-
- virtual SetElementChangeImpl* doAdjustToAddedElement(rtl::OUString const& aName, AddNode const& aAddNodeChange, ElementTreeData const & aNewElement);
- virtual SetElementChangeImpl* doAdjustToRemovedElement(rtl::OUString const& aName, RemoveNode const& aRemoveNodeChange);
-
- virtual SetElementChangeImpl* doAdjustChangedElement(NodeChangesInformation& rLocalChanges, rtl::OUString const& aName, Change const& aChange);
-
- virtual void doTransferElements(ElementSet& rReplacement);
-
- // Implementation
- private:
- void rebuildElement(rtl::OUString const& aName, ElementTreeData const& _aElement);
-
- private:
- ElementSet m_aChangedData;
- bool m_bChanged;
- bool m_bDefault;
- };
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_NODEIMPLOBJECTS_HXX_
diff --git a/configmgr/source/treemgr/noderef.cxx b/configmgr/source/treemgr/noderef.cxx
deleted file mode 100644
index ec65c543e3..0000000000
--- a/configmgr/source/treemgr/noderef.cxx
+++ /dev/null
@@ -1,917 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "anynoderef.hxx"
-#include "valueref.hxx"
-#include "noderef.hxx"
-#include "tree.hxx"
-#include "viewaccess.hxx"
-#include "configpath.hxx"
-#include "nodechange.hxx"
-#include "configexcept.hxx"
-#include "configset.hxx"
-#include "tracer.hxx"
-
-#ifndef INCLUDED_ALGORITHM
-#include <algorithm> // for swap
-#define INCLUDED_ALGORITHM
-#endif
-#ifndef INCLUDED_FUNCTIONAL
-#include <functional> // for less
-#define INCLUDED_FUNCTIONAL
-#endif
-
-namespace configmgr
-{
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-// local helpers
-//-----------------------------------------------------------------------------
-
-namespace
-{
-//-----------------------------------------------------------------------------
- struct CollectValueIDs : GroupMemberVisitor
- {
- CollectValueIDs(NodeID const& aParentID, std::vector<SubNodeID>& rValueList)
- : m_aParentID(aParentID)
- , m_rValueList(rValueList)
- {
- }
-
- Result visit(ValueMemberNode const& anEntry);
-
- NodeID m_aParentID;
- std::vector<SubNodeID>& m_rValueList;
- };
-
- GroupMemberVisitor::Result CollectValueIDs::visit(ValueMemberNode const& aValue)
- {
- OSL_ASSERT(aValue.isValid());
-
- rtl::OUString aValueName = aValue.getNodeName();
-
- m_rValueList.push_back(SubNodeID( m_aParentID, aValueName));
-
- return CONTINUE;
- }
-//-----------------------------------------------------------------------------
-}
-
-//-----------------------------------------------------------------------------
-// class NodeRef
-//-----------------------------------------------------------------------------
-
-NodeRef::NodeRef()
-: m_nPos(0)
-, m_nDepth(0)
-{
-}
-//-----------------------------------------------------------------------------
-
-NodeRef::NodeRef(unsigned int nPos, unsigned int nDepth)
-: m_nPos(nPos)
-, m_nDepth(nDepth)
-{}
-//-----------------------------------------------------------------------------
-
-NodeRef::NodeRef(NodeRef const& rOther)
-: m_nPos(rOther.m_nPos)
-, m_nDepth(rOther.m_nDepth)
-{
-}
-//-----------------------------------------------------------------------------
-
-NodeRef& NodeRef::operator=(NodeRef const& rOther)
-{
- NodeRef(rOther).swap(*this);
- return *this;
-}
-//-----------------------------------------------------------------------------
-
-void NodeRef::swap(NodeRef& rOther)
-{
- std::swap(m_nPos, rOther.m_nPos);
- std::swap(m_nDepth, rOther.m_nDepth);
-}
-//-----------------------------------------------------------------------------
-
-NodeRef::~NodeRef()
-{
-}
-
-//-----------------------------------------------------------------------------
-// class ValueRef
-//-----------------------------------------------------------------------------
-
-bool ValueRef::checkValidState() const
-{
- if (m_nParentPos == 0) return false;
-
- // old node semantics for now
- if ( m_sNodeName.getLength() == 0 ) return false;
-
- return true;
-}
-//-----------------------------------------------------------------------------
-
-ValueRef::ValueRef()
-: m_sNodeName()
-, m_nParentPos(0)
-{
-}
-//-----------------------------------------------------------------------------
-
-ValueRef::ValueRef(rtl::OUString const& aName, unsigned int nParentPos)
-: m_sNodeName(aName)
-, m_nParentPos(nParentPos)
-{
- OSL_ENSURE( nParentPos == 0 || checkValidState(), "Constructing invalid ValueRef");
-}
-//-----------------------------------------------------------------------------
-
-ValueRef::ValueRef(ValueRef const& rOther)
-: m_sNodeName(rOther.m_sNodeName)
-, m_nParentPos(rOther.m_nParentPos)
-{
-}
-//-----------------------------------------------------------------------------
-
-ValueRef& ValueRef::operator=(ValueRef const& rOther)
-{
- ValueRef(rOther).swap(*this);
- return *this;
-}
-//-----------------------------------------------------------------------------
-
-void ValueRef::swap(ValueRef& rOther)
-{
- std::swap(m_sNodeName, rOther.m_sNodeName);
- std::swap(m_nParentPos, rOther.m_nParentPos);
-}
-//-----------------------------------------------------------------------------
-
-ValueRef::~ValueRef()
-{
-}
-
-//-----------------------------------------------------------------------------
-// class AnyNodeRef
-//-----------------------------------------------------------------------------
-#if OSL_DEBUG_LEVEL > 0
-bool AnyNodeRef::checkValidState() const
-{
- if (m_nUsedPos == 0) return false;
-
- if ( m_sNodeName.getLength() != 0 ) // it's a local value
- {
- // not used as runtime check as it should not be dangerous
- OSL_ENSURE(m_nDepth ==0, "AnyNodeRef that wraps a ValueRef should have no depth"); // value has no depth
- }
-
- return true;
-}
-#endif
-//-----------------------------------------------------------------------------
-
-AnyNodeRef::AnyNodeRef()
-: m_sNodeName()
-, m_nUsedPos(0)
-, m_nDepth(0)
-{
-}
-//-----------------------------------------------------------------------------
-
-AnyNodeRef::AnyNodeRef(unsigned int nPos, unsigned int nDepth)
-: m_sNodeName()
-, m_nUsedPos(nPos)
-, m_nDepth(nDepth)
-{}
-//-----------------------------------------------------------------------------
-
-AnyNodeRef::AnyNodeRef(rtl::OUString const& aName, unsigned int nParentPos)
-: m_sNodeName(aName)
-, m_nUsedPos(nParentPos)
-, m_nDepth(0)
-{}
-//-----------------------------------------------------------------------------
-
-AnyNodeRef::AnyNodeRef(AnyNodeRef const& rOther)
-: m_sNodeName(rOther.m_sNodeName)
-, m_nUsedPos(rOther.m_nUsedPos)
-, m_nDepth(rOther.m_nDepth)
-{
-}
-//-----------------------------------------------------------------------------
-
-AnyNodeRef::AnyNodeRef(NodeRef const& aNodeRef)
-: m_sNodeName()
-, m_nUsedPos( aNodeRef.m_nPos )
-, m_nDepth( aNodeRef.m_nDepth )
-{}
-//-----------------------------------------------------------------------------
-
-AnyNodeRef::AnyNodeRef(ValueRef const& aValueRef)
-: m_sNodeName( aValueRef.m_sNodeName )
-, m_nUsedPos( aValueRef.m_nParentPos )
-, m_nDepth( 0 )
-{}
-//-----------------------------------------------------------------------------
-
-AnyNodeRef& AnyNodeRef::operator=(AnyNodeRef const& rOther)
-{
- AnyNodeRef(rOther).swap(*this);
- return *this;
-}
-//-----------------------------------------------------------------------------
-
-void AnyNodeRef::swap(AnyNodeRef& rOther)
-{
- std::swap(m_sNodeName, rOther.m_sNodeName);
- std::swap(m_nUsedPos, rOther.m_nUsedPos);
- std::swap(m_nDepth, rOther.m_nDepth);
-}
-//-----------------------------------------------------------------------------
-
-AnyNodeRef::~AnyNodeRef()
-{
-}
-
-//-----------------------------------------------------------------------------
-
-bool AnyNodeRef::isNode() const
-{
- OSL_PRECOND( isValid(), "ERROR: Configuration: AnyNodeRef operation requires valid node" );
- if (!isValid()) return false;
-
- return m_sNodeName.getLength() == 0;
-}
-//-----------------------------------------------------------------------------
-
-NodeRef AnyNodeRef::toNode() const
-{
- OSL_PRECOND( isValid(), "ERROR: Configuration: AnyNodeRef operation requires valid node" );
- if (!isValid() || !isNode()) return NodeRef();
-
- return NodeRef(m_nUsedPos,m_nDepth);
-}
-//-----------------------------------------------------------------------------
-
-ValueRef AnyNodeRef::toValue() const
-{
- OSL_PRECOND( isValid(), "ERROR: Configuration: AnyNodeRef operation requires valid node" );
- if (!isValid() || isNode()) return ValueRef();
-
- return ValueRef(m_sNodeName, m_nUsedPos);
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// hashing any pointer
-//-----------------------------------------------------------------------------
-static // for now
-// should move this to a more public place sometime
-// need this, as STLPORT does not hash sal_(u)Int64 (at least on MSVC)
-inline
-size_t hash64(sal_uInt64 n)
-{
- // simple solution (but the same that STLPORT uses for unsigned long long (if enabled))
- return static_cast<size_t>(n);
-}
-//-----------------------------------------------------------------------------
-
-static // for now
-// should move this to a more public place sometime
-inline
-size_t hashAnyPointer(void* p)
-{
- // most portable quick solution IMHO (we need this cast for UNO tunnels anyway)
- sal_uInt64 n = reinterpret_cast<sal_uInt64>(p);
-
- return hash64(n);
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// class NodeID
-//-----------------------------------------------------------------------------
-
-NodeID::NodeID(rtl::Reference< Tree > const& rTree, NodeRef const& rNode)
-: m_pTree( rTree.get() )
-, m_nNode( rNode.getOffset() )
-{
-}
-//-----------------------------------------------------------------------------
-
-NodeID::NodeID(Tree* pImpl, unsigned int nNode)
-: m_pTree( pImpl )
-, m_nNode( nNode )
-{
-}
-//-----------------------------------------------------------------------------
-
-bool NodeID::isEmpty() const
-{
- OSL_ENSURE( m_pTree == NULL || m_pTree->isValidNode(m_nNode), "Node does not match tree in NodeID");
- return m_pTree == NULL;
-}
-//-----------------------------------------------------------------------------
-
-bool NodeID::isValidNode() const
-{
- return m_pTree != NULL && m_pTree->isValidNode(m_nNode);
-}
-//-----------------------------------------------------------------------------
-
-// hashing
-size_t NodeID::hashCode() const
-{
- return hashAnyPointer(m_pTree) + 5*m_nNode;
-}
-//-----------------------------------------------------------------------------
-
-unsigned int NodeID::toIndex() const
-{
- unsigned int n = m_nNode;
- if (m_pTree)
- {
- OSL_ENSURE(m_pTree->isValidNode(n),"Cannot produce valid Index for NodeID");
-
- n -= Tree::ROOT;
- }
- return n;
-}
-
-NodeRef NodeID::getNode() const {
- return m_pTree == 0 ? NodeRef() : m_pTree->getNode(m_nNode);
-}
-
-//-----------------------------------------------------------------------------
-bool operator < (NodeID const& lhs, NodeID const& rhs)
-{
- if (lhs.m_pTree == rhs.m_pTree)
- return lhs.m_nNode < rhs.m_nNode;
- else
- return std::less<Tree*>()(lhs.m_pTree,rhs.m_pTree);
-}
-
-//-----------------------------------------------------------------------------
-// class SubNodeID
-//-----------------------------------------------------------------------------
-
-SubNodeID::SubNodeID()
-: m_sNodeName()
-, m_aParentID(0,0)
-{
-}
-//-----------------------------------------------------------------------------
-
-SubNodeID::SubNodeID(rtl::Reference< Tree > const& rTree, NodeRef const& rParentNode, rtl::OUString const& aName)
-: m_sNodeName(aName)
-, m_aParentID(rTree,rParentNode)
-{
-}
-//-----------------------------------------------------------------------------
-
-SubNodeID::SubNodeID(NodeID const& rParentNodeID, rtl::OUString const& aName)
-: m_sNodeName(aName)
-, m_aParentID(rParentNodeID)
-{
-}
-//-----------------------------------------------------------------------------
-
-bool SubNodeID::isValidNode() const
-{
- if (!m_aParentID.isValidNode()) return false;
-
- OSL_ENSURE(m_sNodeName.getLength() != 0,"Invalid subnode ID: Missing name");
-
- rtl::Reference< Tree > aCheck( m_aParentID.getTree() );
- return aCheck->hasChild( m_aParentID.getNode(), m_sNodeName );
-}
-//-----------------------------------------------------------------------------
-
-bool operator < (SubNodeID const& lhs, SubNodeID const& rhs)
-{
- if (lhs.m_aParentID == rhs.m_aParentID)
- return !!(lhs.m_sNodeName < rhs.m_sNodeName);
- else
- return lhs.m_aParentID < rhs.m_aParentID;
-}
-
-//-----------------------------------------------------------------------------
-// Free functions
-//-----------------------------------------------------------------------------
-
-rtl::OUString validateElementName(rtl::OUString const& sName, rtl::Reference< Tree > const& aTree, NodeRef const& aNode )
-{
- { (void)aTree; (void)aNode; }
- OSL_PRECOND( !isEmpty(aTree.get()), "ERROR: Configuration: Tree operation requires a valid Tree");
- OSL_PRECOND( aNode.isValid(), "ERROR: Configuration: Node operation requires a valid NodeRef");
- OSL_PRECOND( aTree->isValidNode(aNode.getOffset()), "ERROR: Configuration: NodeRef does not match Tree");
-
- OSL_PRECOND( view::ViewTreeAccess(aTree.get()).isSetNode(aNode), "ERROR: Configuration: Set node expected.");
-
- return validateElementName(sName);
-}
-//-----------------------------------------------------------------------------
-
-rtl::OUString validateChildName(rtl::OUString const& sName, rtl::Reference< Tree > const& aTree, NodeRef const& aNode )
-{
- { (void)aTree; (void)aNode; }
- OSL_PRECOND( !isEmpty(aTree.get()), "ERROR: Configuration: Tree operation requires a valid Tree");
- OSL_PRECOND( aNode.isValid(), "ERROR: Configuration: Node operation requires a valid NodeRef");
- OSL_PRECOND( aTree->isValidNode(aNode.getOffset()), "ERROR: Configuration: NodeRef does not match Tree");
-
- OSL_PRECOND( view::ViewTreeAccess(aTree.get()).isGroupNode(aNode), "ERROR: Configuration: Group node expected.");
-
- return validateNodeName(sName);
-}
-//-----------------------------------------------------------------------------
-
-rtl::OUString validateChildOrElementName(rtl::OUString const& sName, rtl::Reference< Tree > const& aTree, NodeRef const& aNode )
-{
- OSL_PRECOND( !isEmpty(aTree.get()), "ERROR: Configuration: Tree operation requires a valid Tree");
- OSL_PRECOND( aNode.isValid(), "ERROR: Configuration: Node operation requires a valid NodeRef");
- OSL_PRECOND( aTree->isValidNode(aNode.getOffset()), "ERROR: Configuration: NodeRef does not match Tree");
-
- OSL_PRECOND( isStructuralNode(aTree,aNode), "ERROR: Configuration: Inner node expected.");
-
- if (view::ViewTreeAccess(aTree.get()).isSetNode(aNode))
- return validateElementName(sName);
-
- else
- return validateNodeName(sName);
-}
-//-----------------------------------------------------------------------------
-
-Path::Component validateElementPathComponent(rtl::OUString const& sName, rtl::Reference< Tree > const& aTree, NodeRef const& aNode )
-{
- rtl::OUString aElementName = validateElementName(sName,aTree,aNode);
-
- rtl::Reference<Template> aTemplate = aTree->extractElementInfo(aNode);
- if (aTemplate.is())
- {
- return Path::makeCompositeName( aElementName, aTemplate->getName() );
- }
- else
- {
- OSL_ENSURE(false, "WARNING: Cannot find element type information for building an element name");
- return Path::wrapElementName(aElementName);
- }
-}
-//-----------------------------------------------------------------------------
-
-static void implValidateLocalPath(RelativePath& _rPath, rtl::Reference< Tree > const& aTree, NodeRef const& aNode)
-{
- if (_rPath.isEmpty())
- throw InvalidName(_rPath.toString(), "is an empty path.");
-
- // FOR NOW: validate only the first component
- if (!view::ViewTreeAccess(aTree.get()).isSetNode(aNode))
- if (!_rPath.getFirstName().isSimpleName())
- throw InvalidName(_rPath.toString(), "is not valid in this context. Predicate expression used to select group member.");
-}
-//-----------------------------------------------------------------------------
-
-RelativePath validateRelativePath(rtl::OUString const& _sPath, rtl::Reference< Tree > const& aTree, NodeRef const& aNode)
-{
- OSL_PRECOND( !isEmpty(aTree.get()), "ERROR: Configuration: Tree operation requires a valid Tree");
- OSL_PRECOND( aNode.isValid(), "ERROR: Configuration: Node operation requires a valid NodeRef");
- OSL_PRECOND( aTree->isValidNode(aNode.getOffset()), "ERROR: Configuration: NodeRef does not match Tree");
-
- OSL_PRECOND( isStructuralNode(aTree,aNode), "ERROR: Configuration: Inner node expected.");
-
- if ( Path::isAbsolutePath(_sPath) )
- {
- OSL_ENSURE(false, "Absolute pathes are not allowed here (compatibility support enabled");
- return validateAndReducePath(_sPath,aTree,aNode);
- }
-
- RelativePath aResult = RelativePath::parse(_sPath);
-
- implValidateLocalPath(aResult,aTree,aNode);
-
- return aResult;
-}
-//-----------------------------------------------------------------------------
-
-RelativePath validateAndReducePath(rtl::OUString const& _sPath, rtl::Reference< Tree > const& aTree, NodeRef const& aNode)
-{
- OSL_PRECOND( !isEmpty(aTree.get()), "ERROR: Configuration: Tree operation requires a valid Tree");
- OSL_PRECOND( aNode.isValid(), "ERROR: Configuration: Node operation requires a valid NodeRef");
- OSL_PRECOND( aTree->isValidNode(aNode.getOffset()), "ERROR: Configuration: NodeRef does not match Tree");
-
- OSL_PRECOND( isStructuralNode(aTree,aNode), "ERROR: Configuration: Inner node expected.");
-
- if ( !Path::isAbsolutePath(_sPath) )
- return validateRelativePath(_sPath,aTree,aNode);
-
- AbsolutePath aInputPath = AbsolutePath::parse(_sPath);
-
- RelativePath aStrippedPath = Path::stripPrefix( aInputPath, aTree->getAbsolutePath(aNode) );
-
- implValidateLocalPath(aStrippedPath,aTree,aNode);
-
- return aStrippedPath;
-}
-//-----------------------------------------------------------------------------
-
-bool hasChildOrElement(rtl::Reference< Tree > const& aTree, NodeRef const& aNode, rtl::OUString const& aName)
-{
- return view::ViewTreeAccess(aTree.get()).isSetNode(aNode) ? aTree->hasElement(aNode,aName) : aTree->hasChild(aNode,aName);
-}
-//-----------------------------------------------------------------------------
-
-bool hasChildOrElement(rtl::Reference< Tree > const& aTree, NodeRef const& aNode, Path::Component const& aName)
-{
- return view::ViewTreeAccess(aTree.get()).isSetNode(aNode) ? aTree->hasElement(aNode,aName) : aTree->hasChild(aNode,aName.getName());
-}
-//-----------------------------------------------------------------------------
-
-bool findInnerChildOrAvailableElement(rtl::Reference< Tree > & aTree, NodeRef& aNode, rtl::OUString const& aName)
-{
- if ( view::ViewTreeAccess(aTree.get()).isSetNode(aNode) )
- {
- rtl::Reference< ElementTree > aElement = aTree->getAvailableElement(aNode,aName);
- if (aElement.is())
- {
- aTree = aElement.get();
- aNode = aTree->getRootNode();
- return true;
- }
- }
- else
- {
- NodeRef aChild = aTree->getChildNode(aNode,aName);
-
- if ( aChild.isValid() )
- {
- aNode = aChild;
- return true;
- }
- }
-
- return false;
-}
-//-----------------------------------------------------------------------------
-
-AnyNodeRef getChildOrElement(rtl::Reference< Tree > & aTree, NodeRef const& aParentNode, rtl::OUString const& aName)
-{
- if (aTree->hasChildValue(aParentNode,aName))
- {
- return AnyNodeRef(aTree->getChildValue(aParentNode,aName));
- }
-
- else if ( view::ViewTreeAccess(aTree.get()).isSetNode(aParentNode) )
- {
- rtl::Reference< ElementTree > aElement = aTree->getElement(aParentNode,aName);
- if (aElement.is())
- {
- aTree = aElement.get();
- return AnyNodeRef(aTree->getRootNode());
- }
- }
-
- else
- {
- NodeRef aChild = aTree->getChildNode(aParentNode,aName);
-
- if ( aChild.isValid() )
- {
- return AnyNodeRef(aChild);
- }
- }
-
- return AnyNodeRef();
-}
-//-----------------------------------------------------------------------------
-
-static
-inline
-bool findLocalInnerChild(rtl::Reference< Tree > const& aTree, NodeRef& aNode, Path::Component const& aName)
-{
- NodeRef aChild = aTree->getChildNode(aNode,aName.getName());
-
- if ( !aChild.isValid() ) return false;
-
- OSL_ENSURE( aName.isSimpleName(), "Child of group was found by request using element name format -failing");
- if ( !aName.isSimpleName()) return false;
-
- aNode = aChild;
-
- return true;
-}
-//-----------------------------------------------------------------------------
-
-static
-inline
-bool findElement(rtl::Reference< Tree > & aTree, NodeRef& aNode, Path::Component const& aName)
-{
- rtl::Reference< ElementTree > aElement = aTree->getElement(aNode,aName.getName());
-
- if (!aElement.is()) return false;
-
- rtl::Reference< Tree > aFoundTree = aElement.get();
-
- OSL_ENSURE(matches(aFoundTree->getExtendedRootName(),aName), "Element found, but type prefix does not match - failing");
- if ( !matches(aFoundTree->getExtendedRootName(),aName) ) return false;
-
- aTree = aFoundTree;
- aNode = aTree->getRootNode();
-
- return true;
-}
-//-----------------------------------------------------------------------------
-
-static
-bool findLocalInnerDescendant(rtl::Reference< Tree > const& aTree, NodeRef& aNode, RelativePath& rPath)
-{
- while ( !rPath.isEmpty() )
- {
- if ( view::ViewTreeAccess(aTree.get()).isSetNode(aNode) ) return false;
-
- if ( ! findLocalInnerChild(aTree,aNode,rPath.getFirstName()) ) return false;
-
- rPath.dropFirstName();
- }
-
- return true;
-}
-//-----------------------------------------------------------------------------
-
-static
-bool findDeepInnerDescendant(rtl::Reference< Tree > & aTree, NodeRef& aNode, RelativePath& rPath)
-{
- while ( !rPath.isEmpty() )
- {
- if ( view::ViewTreeAccess(aTree.get()).isSetNode(aNode) )
- {
- if ( ! findElement(aTree,aNode,rPath.getFirstName()) ) return false;
- }
- else
- {
- if ( ! findLocalInnerChild(aTree,aNode,rPath.getFirstName()) ) return false;
- }
-
- rPath.dropFirstName();
- }
-
- return true;
-}
-//-----------------------------------------------------------------------------
-
-static
-inline
-bool identifiesLocalValue(rtl::Reference< Tree > const& aTree, NodeRef const& aNode, RelativePath const& aPath)
-{
- if ( aPath.getDepth() == 1 )
- {
- Path::Component const & aLocalName = aPath.getLocalName();
- rtl::OUString aName = aLocalName.getName();
-
- if (aTree->hasChildValue(aNode,aName))
- {
- OSL_ENSURE( aLocalName.isSimpleName(), "Value in group was found by request using element name format");
- if ( aLocalName.isSimpleName())
- return true;
- }
- }
- return false;
-}
-//-----------------------------------------------------------------------------
-
-AnyNodeRef getLocalDescendant(rtl::Reference< Tree > const& aTree, NodeRef const& aNode, RelativePath const& rPath)
-{
- NodeRef aNestedNode( aNode );
- RelativePath aRemainingPath(rPath);
-
- if ( findLocalInnerDescendant(aTree,aNestedNode,aRemainingPath) )
- {
- OSL_ASSERT(
- aNestedNode.isValid() &&
- aTree->isValidNode(aNestedNode.getOffset()));
- return AnyNodeRef(aNestedNode);
- }
-
- if ( identifiesLocalValue(aTree,aNestedNode,aRemainingPath) )
- {
- ValueRef aValue = aTree->getChildValue(aNestedNode,rPath.getLocalName().getName());
- OSL_ASSERT(aTree->isValidValueNode(aValue));
- return AnyNodeRef(aValue);
- }
-
- return AnyNodeRef();
-}
-//-----------------------------------------------------------------------------
-
-AnyNodeRef getDeepDescendant(rtl::Reference< Tree > & aTree, NodeRef& aNode, RelativePath& rPath)
-{
- if ( findDeepInnerDescendant(aTree,aNode,rPath) )
- {
- OSL_ASSERT(
- aNode.isValid() && aTree->isValidNode(aNode.getOffset()));
- return AnyNodeRef(aNode);
- }
-
- if ( identifiesLocalValue(aTree,aNode,rPath) )
- {
- ValueRef aValue = aTree->getChildValue(aNode,rPath.getLocalName().getName());
- OSL_ASSERT(aTree->isValidValueNode(aValue));
- return AnyNodeRef(aValue);
- }
-
- return AnyNodeRef();
-}
-//-----------------------------------------------------------------------------
-
-void getAllContainedNodes(rtl::Reference< Tree > const& aTree, std::vector<NodeID>& aList)
-{
- aList.clear();
-
- if (Tree* pImpl = aTree.get())
- {
- unsigned int nCount = pImpl->nodeCount();
- aList.reserve(nCount);
-
- unsigned int const nEnd = Tree::ROOT + nCount;
-
- for(unsigned int nOffset = Tree::ROOT;
- nOffset < nEnd;
- ++nOffset)
- {
- OSL_ASSERT( pImpl->isValidNode(nOffset) );
- aList.push_back( NodeID(pImpl,nOffset) );
- }
-
- OSL_ASSERT( aList.size()==nCount );
- }
-}
-//-----------------------------------------------------------------------------
-
-void getAllChildrenHelper(NodeID const& aNode, std::vector<SubNodeID>& aList)
-{
- aList.clear();
-
- if (Tree* pTreeImpl = aNode.getTree())
- {
- view::ViewTreeAccess aView(pTreeImpl);
-
- if (unsigned int const nParent = aNode.getOffset())
- {
- OSL_ASSERT( pTreeImpl->isValidNode(nParent) );
-
- if (aView.isGroupNodeAt(nParent))
- {
- view::GroupNode aParent = aView.getGroupNodeAt(nParent);
-
- {
- CollectValueIDs aCollector(aNode, aList);
- aView.dispatchToValues(aView.getGroupNodeAt(nParent),aCollector);
- }
-
- for(view::Node aChild = aParent.getFirstChild();
- aChild.is();
- aChild = aParent.getNextChild(aChild))
- {
- OSL_ASSERT( pTreeImpl->isValidNode(aChild.get_offset()) );
- aList.push_back( SubNodeID( aNode, pTreeImpl->getSimpleNodeName(aChild.get_offset())) );
- }
- }
- }
- }
-}
-
-//-----------------------------------------------------------------------------
-NodeID findNodeFromIndex(rtl::Reference< Tree > const& aTree, unsigned int nIndex)
-{
- if (Tree* pImpl = aTree.get())
- {
- unsigned int nNode = nIndex + Tree::ROOT;
- if (pImpl->isValidNode(nNode))
- {
- return NodeID(pImpl,nNode);
- }
- }
- return NodeID(0,0);
-}
-
-//-----------------------------------------------------------------------------
-
-static inline bool isRootNode(NodeRef const& aNode)
-{
- return aNode.getOffset() == Tree::ROOT;
-}
-//-----------------------------------------------------------------------------
-#if OSL_DEBUG_LEVEL > 0
-bool isSimpleValueElement(rtl::Reference< Tree > const& aTree, NodeRef const& aNode)
-{
- OSL_PRECOND( !aNode.isValid() || !isEmpty(aTree.get()), "ERROR: Configuration: Tree operation requires a valid Tree");
- OSL_PRECOND( !aNode.isValid() || aTree->isValidNode(aNode.getOffset()), "WARNING: Configuration: NodeRef does not match Tree");
-
- view::ViewTreeAccess aView = view::ViewTreeAccess(aTree.get());
-
- OSL_ASSERT( !aNode.isValid() ||
- aView.isGroupNode(aNode) ||
- aView.isSetNode(aNode) ||
- (aView.isValueNode(aNode) && isRootNode(aNode)) );
-
- return aNode.isValid() && isRootNode(aNode) && aView.isValueNode(aNode);
-}
-#endif
-//-----------------------------------------------------------------------------
-
-bool isStructuralNode(rtl::Reference< Tree > const& aTree, NodeRef const& aNode)
-{
- OSL_PRECOND( !aNode.isValid() || !isEmpty(aTree.get()), "ERROR: Configuration: Tree operation requires a valid Tree");
- OSL_PRECOND( !aNode.isValid() || aTree->isValidNode(aNode.getOffset()), "WARNING: Configuration: NodeRef does not match Tree");
-
- view::ViewTreeAccess aView = view::ViewTreeAccess(aTree.get());
-
- OSL_ASSERT( !aNode.isValid() ||
- aView.isGroupNode(aNode) ||
- aView.isSetNode(aNode) ||
- (aView.isValueNode(aNode) && isRootNode(aNode)) );
-
- return aNode.isValid() && ! aView.isValueNode(aNode);
-}
-//-----------------------------------------------------------------------------
-
-bool isGroupNode(rtl::Reference< Tree > const& aTree, NodeRef const& aNode)
-{
- OSL_PRECOND( !aNode.isValid() || !isEmpty(aTree.get()), "ERROR: Configuration: Tree operation requires a valid Tree");
- OSL_PRECOND( !aNode.isValid() || aTree->isValidNode(aNode.getOffset()), "WARNING: Configuration: NodeRef does not match Tree");
-
- view::ViewTreeAccess aView = view::ViewTreeAccess(aTree.get());
-
- OSL_ASSERT( !aNode.isValid() ||
- aView.isGroupNode(aNode) ||
- aView.isSetNode(aNode) ||
- (aView.isValueNode(aNode) && isRootNode(aNode)) );
-
- return aNode.isValid() && aView.isGroupNode(aNode);
-}
-//-----------------------------------------------------------------------------
-
-bool isSetNode(rtl::Reference< Tree > const& aTree, NodeRef const& aNode)
-{
- OSL_PRECOND( !aNode.isValid() || !isEmpty(aTree.get()), "ERROR: Configuration: Tree operation requires a valid Tree");
- OSL_PRECOND( !aNode.isValid() || aTree->isValidNode(aNode.getOffset()), "WARNING: Configuration: NodeRef does not match Tree");
-
- view::ViewTreeAccess aView = view::ViewTreeAccess(aTree.get());
-
- OSL_ASSERT( !aNode.isValid() ||
- aView.isGroupNode(aNode) ||
- aView.isSetNode(aNode) ||
- (aView.isValueNode(aNode) && isRootNode(aNode)) );
-
- return aNode.isValid() && aView.isSetNode(aNode);
-}
-//-----------------------------------------------------------------------------
-
-com::sun::star::uno::Any getSimpleElementValue(rtl::Reference< Tree > const& aTree, NodeRef const& aNode)
-{
- OSL_PRECOND( !isEmpty(aTree.get()), "ERROR: Configuration: Tree operation requires a valid Tree");
- OSL_PRECOND( aNode.isValid(), "ERROR: Configuration: Node operation requires a valid Node");
- OSL_PRECOND( aTree->isValidNode(aNode.getOffset()), "WARNING: Configuration: NodeRef does not match Tree");
-
- if (!aNode.isValid()) return com::sun::star::uno::Any();
-
- OSL_PRECOND( isSimpleValueElement(aTree, aNode), "ERROR: Configuration: Getting value is supported only for value nodes");
-
- view::ViewTreeAccess aView = view::ViewTreeAccess(aTree.get());
-
- return aView.getValue(aView.toValueNode(aNode));
-}
-
-//-----------------------------------------------------------------------------
- } // namespace configuration
-} // namespace configmgr
diff --git a/configmgr/source/treemgr/readonlyview.cxx b/configmgr/source/treemgr/readonlyview.cxx
deleted file mode 100644
index 6a10ac2aeb..0000000000
--- a/configmgr/source/treemgr/readonlyview.cxx
+++ /dev/null
@@ -1,105 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-#include "readonlyview.hxx"
-#include "viewfactory.hxx"
-#include "configexcept.hxx"
-
-namespace configmgr
-{
- namespace view
- {
-//-----------------------------------------------------------------------------
-void ReadOnlyViewStrategy::failReadOnly() const
-{
- OSL_ENSURE(false, "Changing operation attempted on read-only node data");
- throw configuration::ConstraintViolation("INTERNAL ERROR: Trying to update a read-only node");
-}
-
-//-----------------------------------------------------------------------------
-
-bool ReadOnlyViewStrategy::doHasChanges(Node const& ) const
-{
- return false;
-}
-//-----------------------------------------------------------------------------
-
-void ReadOnlyViewStrategy::doMarkChanged(Node const& )
-{
- failReadOnly();
-}
-//-----------------------------------------------------------------------------
-
-node::Attributes ReadOnlyViewStrategy::doAdjustAttributes(node::Attributes const& _aAttributes) const
-{
- node::Attributes aAttributes = _aAttributes;
- aAttributes.markReadonly();
- return aAttributes;
-}
-//-----------------------------------------------------------------------------
-
-configuration::ValueMemberNode ReadOnlyViewStrategy::doGetValueMember(GroupNode const& _aNode, rtl::OUString const& _aName, bool _bForUpdate) const
-{
- if (_bForUpdate) failReadOnly();
-
- return ViewStrategy::doGetValueMember(_aNode,_aName,_bForUpdate);
-}
-//-----------------------------------------------------------------------------
-
-void ReadOnlyViewStrategy::doInsertElement(SetNode const& , rtl::OUString const& , configuration::SetEntry const& )
-{
- failReadOnly();
-}
-//-----------------------------------------------------------------------------
-
-void ReadOnlyViewStrategy::doRemoveElement(SetNode const& /*_aNode*/, rtl::OUString const& /*_aName*/)
-{
- failReadOnly();
-}
-//-----------------------------------------------------------------------------
-
-extern NodeFactory& getReadAccessFactory();
-
-NodeFactory& ReadOnlyViewStrategy::doGetNodeFactory()
-{
- return getReadAccessFactory();
-}
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-
-rtl::Reference<ViewStrategy> createReadOnlyStrategy()
-{
- return new ReadOnlyViewStrategy();
-}
-
-//-----------------------------------------------------------------------------
-
- }
-}
diff --git a/configmgr/source/treemgr/readonlyview.hxx b/configmgr/source/treemgr/readonlyview.hxx
deleted file mode 100644
index d98f16c581..0000000000
--- a/configmgr/source/treemgr/readonlyview.hxx
+++ /dev/null
@@ -1,71 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_READONLYVIEW_HXX_
-#define CONFIGMGR_READONLYVIEW_HXX_
-
-#include "viewstrategy.hxx"
-
-
-namespace configmgr
-{
- namespace view
- {
-//-----------------------------------------------------------------------------
-// View behavior for direct read-only access
-//-----------------------------------------------------------------------------
-
- class ReadOnlyViewStrategy : public ViewStrategy
- {
- public:
- explicit
- ReadOnlyViewStrategy() {}
-
- protected:
- // change handling -required
- virtual bool doHasChanges(Node const& _aNode) const;
- virtual void doMarkChanged(Node const& _aNode);
-
- // common attributes
- virtual node::Attributes doAdjustAttributes(node::Attributes const& _aAttributes) const;
-
- // group member access
- virtual configuration::ValueMemberNode doGetValueMember(GroupNode const& _aNode, rtl::OUString const& _aName, bool _bForUpdate) const;
-
- // set element access
- virtual void doInsertElement(SetNode const& _aNode, rtl::OUString const& aName, configuration::SetEntry const& aNewEntry);
- virtual void doRemoveElement(SetNode const& _aNode, rtl::OUString const& aName);
-
- virtual NodeFactory& doGetNodeFactory();
- private:
- void failReadOnly() const;
- };
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_READONLYVIEW_HXX_
diff --git a/configmgr/source/treemgr/roottree.cxx b/configmgr/source/treemgr/roottree.cxx
deleted file mode 100644
index 3e95d2017c..0000000000
--- a/configmgr/source/treemgr/roottree.cxx
+++ /dev/null
@@ -1,171 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-
-#include "roottree.hxx"
-#include "roottreeimpl.hxx"
-#include "viewaccess.hxx"
-#include "viewfactory.hxx"
-#include "noderef.hxx"
-#include "nodechangeinfo.hxx"
-#include "treechangelist.hxx"
-
-namespace configmgr
-{
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-// factory methods
-//-----------------------------------------------------------------------------
-
-rtl::Reference< Tree > createReadOnlyTree( AbsolutePath const& aRootPath,
- sharable::Node * cacheNode,
- unsigned int nDepth,
- TemplateProvider const& aTemplateProvider)
-{
- return new RootTree(view::createReadOnlyStrategy(),
- aRootPath, cacheNode, nDepth,
- aTemplateProvider
- );
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference< Tree > createUpdatableTree( AbsolutePath const& aRootPath,
- sharable::Node * cacheNode,
- unsigned int nDepth,
- TemplateProvider const& aTemplateProvider)
-{
- return new RootTree(view::createDeferredChangeStrategy(),
- aRootPath, cacheNode, nDepth,
- aTemplateProvider
- );
-}
-
-//-----------------------------------------------------------------------------
-// update on notify method
-//-----------------------------------------------------------------------------
-bool adjustToChanges( NodeChangesInformation& rLocalChanges,
- rtl::Reference< Tree > const& aBaseTree, NodeRef const& aBaseNode,
- SubtreeChange const& aExternalChange)
-{
- OSL_PRECOND( !isEmpty(aBaseTree.get()), "ERROR: Configuration: Tree operation requires a valid Tree");
- OSL_PRECOND( aBaseNode.isValid() && aBaseTree->isValidNode(aBaseNode.getOffset()), "ERROR: Configuration: NodeRef does not match Tree");
-
- if (!isEmpty(aBaseTree.get()))
- {
- OSL_ENSURE(rLocalChanges.empty(), "Should pass empty container to adjustToChanges(...)");
-
- view::ViewTreeAccess(aBaseTree.get()).adjustToChanges(rLocalChanges, aBaseNode, aExternalChange);
-
- return !rLocalChanges.empty();
- }
- else
- return false;
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// class CommitHelper
-//-----------------------------------------------------------------------------
-struct CommitHelper::Data
-{
- std::vector< rtl::Reference<ElementTree> > m_aRemovedElements; // filled to keep the elements alive 'till after notification
-};
-
-//-----------------------------------------------------------------------------
-CommitHelper::CommitHelper(rtl::Reference< Tree > const& aTree)
-: m_pData( )
-, m_pTree( aTree.get() )
-{
- OSL_ENSURE(m_pTree, "INTERNAL ERROR: Unexpected NULL tree in commit helper");
-}
-//-----------------------------------------------------------------------------
-CommitHelper::~CommitHelper()
-{
-}
-
-//-----------------------------------------------------------------------------
-bool CommitHelper::prepareCommit(TreeChangeList& rChangeList)
-{
- OSL_ENSURE(m_pTree,"ERROR: CommitHelper: Cannot commit without a tree");
- if (m_pTree == NULL)
- return false;
-
- OSL_ENSURE(m_pData.get() == NULL,"ERROR: CommitHelper: Need to reset before reusing");
- m_pData.reset( new Data() );
-
- // get and check the changes
- std::auto_ptr<SubtreeChange> pTreeChange(view::ViewTreeAccess(m_pTree).preCommitChanges(m_pData->m_aRemovedElements));
- if (pTreeChange.get() == NULL)
- return false;
-
- // find the name and path of the change
- OSL_ENSURE(m_pTree->getSimpleRootName() == pTreeChange->getNodeName(), "ERROR in Commit: Change name mismatch");
-
- // now fill the TreeChangeList
- rChangeList.setRootPath( m_pTree->getRootPath() );
- rChangeList.root.swap( *pTreeChange );
-
- return true;
-}
-//-----------------------------------------------------------------------------
-
-void CommitHelper::finishCommit(TreeChangeList& rChangeList)
-{
- OSL_ENSURE(m_pTree,"INTERNAL ERROR: Nothing to finish without a tree");
-
- // find the name and path of the change
- AbsolutePath aPath = m_pTree->getRootPath();
-
- OSL_ENSURE( rChangeList.getRootNodePath().toString() == aPath.toString(), "ERROR: FinishCommit cannot handle rebased changes trees");
- if ( !matches(rChangeList.getRootNodePath(), aPath) )
- throw configuration::Exception("INTERNAL ERROR: FinishCommit cannot handle rebased changes trees");
-
- view::ViewTreeAccess(m_pTree).finishCommit(rChangeList.root);
-}
-//-----------------------------------------------------------------------------
-
-void CommitHelper::failedCommit(TreeChangeList& rChangeList)
-{
- OSL_ENSURE(m_pTree,"INTERNAL ERROR: Nothing to finish without a tree");
-
- AbsolutePath aPath = m_pTree->getRootPath();
-
- OSL_ENSURE( rChangeList.getRootNodePath().toString() == aPath.toString(), "ERROR: FinishCommit cannot handle rebased changes trees");
- if ( !matches(rChangeList.getRootNodePath(), aPath) )
- throw configuration::Exception("INTERNAL ERROR: FinishCommit cannot handle rebased changes trees");
-
- view::ViewTreeAccess(m_pTree).recoverFailedCommit(rChangeList.root);
-}
-//-----------------------------------------------------------------------------
-
- }
-}
-
diff --git a/configmgr/source/treemgr/roottreeimpl.hxx b/configmgr/source/treemgr/roottreeimpl.hxx
deleted file mode 100644
index e08f7238b0..0000000000
--- a/configmgr/source/treemgr/roottreeimpl.hxx
+++ /dev/null
@@ -1,67 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_ROOTTREEIMPL_HXX_
-#define CONFIGMGR_ROOTTREEIMPL_HXX_
-
-#include "tree.hxx"
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace configuration
- {
-//-----------------------------------------------------------------------------
- /** is the Implementation class for class <type>Tree</type>.
- <p> Holds a list of <type>Node</type> which it allows to access by
- <type>unsigned int</type> (which is basically a one-based index).
- </p>
- <p> Also provides for navigation to the context this tree is located in
- </p>
- */
- class RootTree : public Tree
- {
- public:
- // Construction
- /// creates a Tree without a parent tree
- RootTree( rtl::Reference<view::ViewStrategy> const& _xStrategy,
- AbsolutePath const& aRootPath,
- sharable::Node * cacheNode, unsigned int nDepth,
- TemplateProvider const& aTemplateProvider);
-
- // make it public
- private:
- virtual Path::Component doGetRootName() const;
- virtual void doFinishRootPath(Path::Rep& rPath) const;
-
- AbsolutePath m_aRootPath;
- };
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_ROOTTREEIMPL_HXX_
diff --git a/configmgr/source/treemgr/setnodeimpl.cxx b/configmgr/source/treemgr/setnodeimpl.cxx
deleted file mode 100644
index 86a0c03be6..0000000000
--- a/configmgr/source/treemgr/setnodeimpl.cxx
+++ /dev/null
@@ -1,994 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-
-#include "builddata.hxx"
-#include "setnodeimpl.hxx"
-#include "treefragment.hxx"
-#include "viewfactory.hxx"
-#include "configpath.hxx"
-#include "tree.hxx"
-#include "valuenodeimpl.hxx"
-#include "nodechange.hxx"
-#include "nodechangeimpl.hxx"
-#include "nodevisitor.hxx"
-#include "change.hxx"
-#include "viewaccess.hxx"
-#include "nodeconverter.hxx"
-#include "treeactions.hxx"
-#include "treechangefactory.hxx"
-#include "collectchanges.hxx"
-#include <osl/diagnose.h>
-
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif
-
-namespace configmgr
-{
- namespace configuration
- {
-//-------------------------------------------------------------------------
-// initialization helpers
-//-------------------------------------------------------------------------
-namespace
-{
- class CollectElementTrees : data::SetVisitor
- {
- public:
- CollectElementTrees(rtl::Reference<view::ViewStrategy> const& _xStrategy,
- Tree* pParentTree, unsigned int nPos,
- unsigned int nDepth,
- rtl::Reference<Template> const& aTemplate,
- TemplateProvider const& aTemplateProvider)
- : m_aTemplate(aTemplate)
- , m_aTemplateProvider(aTemplateProvider)
- , m_xStrategy(_xStrategy)
- , m_pParentTree(pParentTree)
- , m_nPos(nPos)
- , m_nDepth(nDepth)
- {
- OSL_ENSURE(m_aTemplate.is(),"WARNING: Collecting a set without a template");
- }
-
- void collect(sharable::SetNode * node)
- {
- visitElements(node);
- }
-
- ElementTreeData create(sharable::TreeFragment * elementTree)
- {
- OSL_ENSURE(collection.empty(),"warning: trying to reuse a full collection");
-
- collection.resize(1); // make an empty one for case of failure
- this->visitTree(elementTree);
-
- OSL_ENSURE(collection.size()==2,"warning: could not create an element");
- return collection.back();
- }
-
- std::vector<ElementTreeData> collection;
-
- private:
- using SetVisitor::handle;
-
- virtual bool handle(sharable::Node * node);
-
- virtual bool handle(sharable::ValueNode * node);
-
- virtual bool handle(sharable::TreeFragment * tree);
-
- void add(sharable::TreeFragment * node);
-
- rtl::Reference<Template> m_aTemplate;
- TemplateProvider m_aTemplateProvider;
- rtl::Reference<view::ViewStrategy> m_xStrategy;
- Tree* m_pParentTree;
- unsigned int m_nPos;
- unsigned int m_nDepth;
- };
- //-------------------------------------------------------------------------
-
- static
- rtl::OUString validatedName(ElementTreeData const& aTree)
- {
- OSL_ENSURE(aTree.isValid(), "INTERNAL ERROR: Unexpected null tree constructed in set node");
- if (!aTree.isValid()) throw Exception("INTERNAL ERROR: Unexpected null tree in set node");
-
- OSL_ENSURE(aTree->nodeCount(), "INTERNAL ERROR: Unexpected empty (!) tree constructed in set node");
- OSL_ENSURE(aTree->isValidNode(Tree::ROOT), "INTERNAL ERROR: Corrupt tree constructed in set node");
-
- return aTree->getSimpleRootName();
- }
- //-------------------------------------------------------------------------
-
- static
- bool isInDefault(SetEntry const& _anEntry)
- {
- if (!_anEntry.isValid()) return false;
-
- node::Attributes aAttributes = _anEntry.getTreeView().getRootAttributes();
-
- bool bReplaced = aAttributes.isReplacedForUser();
-
- return !bReplaced;
- }
- //-------------------------------------------------------------------------
- bool CollectElementTrees::handle(sharable::ValueNode * node)
- {
- if (m_aTemplate.is())
- {
- OSL_ENSURE(m_aTemplate->isInstanceTypeKnown(),"ERROR: Template must have a validated type when building a set.");
- OSL_ENSURE(m_aTemplate->isInstanceValue(),"ERROR: Found a value node in a Complex Template Set");
-
- if (!m_aTemplate->isInstanceValue())
- throw Exception("INTERNAL ERROR: Corrupt tree contains a value node within a template-set");
-
- com::sun::star::uno::Type aValueType = node->getValueType();
- com::sun::star::uno::Type aExpectedType = m_aTemplate->getInstanceType();
-
- if (aValueType.getTypeClass() != aExpectedType.getTypeClass() &&
- aExpectedType.getTypeClass() != uno::TypeClass_ANY &&
- aValueType.getTypeClass() != uno::TypeClass_VOID)
- {
- OSL_ENSURE(false, "WARNING: ValueType of set node does not match the template type");
- // throw TypeMismatch(aValueType.getTypeName(),aExpectedType.getTypeName(), "INTERNAL ERROR: - Corrupt tree contains mistyped value node within a value-set")));
- }
- }
- return false;
- }
- //-------------------------------------------------------------------------
- bool CollectElementTrees::handle(sharable::Node * node)
- {
- (void) node; // avoid warnings
- OSL_ENSURE(!node->isValue(), "Unexpected: Value-node dispatched to wrong handler");
- if (m_aTemplate.is())
- {
- OSL_ENSURE(m_aTemplate->isInstanceTypeKnown(),"ERROR: Template must have a validated type when building a set.");
- OSL_ENSURE(!m_aTemplate->isInstanceValue(),"ERROR: Found a non-leaf node in a Value Set");
-
- if (m_aTemplate->isInstanceValue())
- throw Exception("INTERNAL ERROR: Corrupt tree contains a non-leaf node within a value-set");
-
- }
- return false;
- }
- //-------------------------------------------------------------------------
- bool CollectElementTrees::handle(sharable::TreeFragment * tree)
- {
- bool done = visitNode(tree->getRootNode());
- if (!done) {
- add(tree);
- }
- return done;
- }
- //-------------------------------------------------------------------------
- void CollectElementTrees::add(sharable::TreeFragment * tree)
- {
- node::Attributes const aAttributes = tree->getAttributes();
-
- bool bReadonly = aAttributes.isReadonly();
- bool bInDefault = !aAttributes.isReplacedForUser();
-
- rtl::Reference<view::ViewStrategy> xStrategy = !bReadonly ? m_xStrategy : view::createReadOnlyStrategy();
-
- ElementTree * pNewTree;
- if (m_pParentTree)
- pNewTree = new ElementTree(xStrategy, *m_pParentTree, m_nPos, tree, m_nDepth, m_aTemplate, m_aTemplateProvider);
-
- else
- pNewTree = new ElementTree(xStrategy, tree, m_nDepth, m_aTemplate, m_aTemplateProvider);
-
- collection.push_back( ElementTreeData(pNewTree,bInDefault));
- }
-}
-
-//-------------------------------------------------------------------------
-// class ElementSet
-//-------------------------------------------------------------------------
-
-bool ElementSet::hasElement(rtl::OUString const& aName) const
-{
- return m_aData.find(aName) != m_aData.end();
-}
-//-------------------------------------------------------------------------
-
-ElementTreeData* ElementSet::getElement(rtl::OUString const& aName)
-{
- Data::iterator it = m_aData.find(aName);
- if (it != m_aData.end())
- return &it->second;
- else
- return 0;
-}
-//-------------------------------------------------------------------------
-
-
-ElementTreeData const* ElementSet::getElement(rtl::OUString const& aName) const
-{
- Data::const_iterator it = m_aData.find(aName);
- if (it != m_aData.end())
- return &it->second;
- else
- return 0;
-}
-//-------------------------------------------------------------------------
-
-ElementTreeData ElementSet::findElement(rtl::OUString const& aName)
-{
- ElementTreeData aRet;
-
- Data::iterator it = m_aData.find(aName);
- if (it != m_aData.end())
- aRet = it->second;
-
- return aRet;
-}
-//-------------------------------------------------------------------------
-
-void ElementSet::insertElement(rtl::OUString const& aName, ElementTreeData const& aNewEntry)
-{
- bool bInserted = m_aData.insert(Data::value_type(aName, aNewEntry)).second;
-
- OSL_ENSURE(bInserted,"INTERNAL ERROR: Inserted set Element was already present");
- if (!bInserted) throw Exception("INTERNAL ERROR: Inserted set Element was already present");
-}
-//-------------------------------------------------------------------------
-
-ElementTreeData ElementSet::replaceElement(rtl::OUString const& aName, ElementTreeData const& aNewEntry)
-{
- OSL_ENSURE(m_aData.find(aName) != m_aData.end(),"INTERNAL ERROR: Replaced set Element is not present");
-
- ElementTreeData& rElement = m_aData[aName];
-
- ElementTreeData aOld = rElement;
- rElement = aNewEntry;
-
- return aOld;
-}
-//-------------------------------------------------------------------------
-
-ElementTreeData ElementSet::removeElement(rtl::OUString const& aName)
-{
- Data::iterator it = m_aData.find(aName);
- OSL_ENSURE(it != m_aData.end(),"INTERNAL ERROR: Removed set Element is not present");
-
- ElementTreeData aOld;
- if (it != m_aData.end())
- {
- aOld = it->second;
- m_aData.erase(it);
- }
- return aOld;
-}
-//-------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// class SetEntry
-//-----------------------------------------------------------------------------
-
-SetEntry::SetEntry(ElementTree* pTree_)
-: m_pTree(pTree_)
-{
- OSL_ENSURE(pTree_ == 0 || pTree_->isValidNode(Tree::ROOT),
- "INTERNAL ERROR: Invalid empty tree used for SetEntry ");
-}
-
-//-----------------------------------------------------------------------------
-
-view::ViewTreeAccess SetEntry::getTreeView() const
-{
- OSL_ENSURE(isValid(), "Cannot get View Access for NULL SetEntry");
- return view::ViewTreeAccess(m_pTree);
-}
-
-//-----------------------------------------------------------------------------
-//-------------------------------------------------------------------------
-
-//-------------------------------------------------------------------------
-// class SetNodeImpl
-//-------------------------------------------------------------------------
-
-SetNodeImpl::SetNodeImpl(sharable::SetNode * _pNodeRef,Template* pTemplate)
-: NodeImpl(reinterpret_cast<sharable::Node *>(_pNodeRef))
-,m_aTemplate(pTemplate)
-,m_aTemplateProvider()
-,m_pParentTree(0)
-,m_nContextPos(0)
-,m_aInit(0)
-{
-}
- // unbind the original
-//-----------------------------------------------------------------------------
-
-SetNodeImpl::~SetNodeImpl()
-{
-}
-//-----------------------------------------------------------------------------
-
-void SetNodeImpl::rebuildFrom(SetNodeImpl& rOldData, sharable::SetNode * newNode)
-{
- m_aTemplate = rOldData.m_aTemplate;
- m_aTemplateProvider = rOldData.m_aTemplateProvider;
- m_pParentTree = rOldData.m_pParentTree;
- m_nContextPos = rOldData.m_nContextPos;
- m_aInit = rOldData.m_aInit;
-
- if (rOldData.implHasLoadedElements())
- {
- rOldData.doTransferElements(m_aDataSet);
- implRebuildElements(newNode);
- OSL_ASSERT(this->implHasLoadedElements());
- }
- else
- OSL_ASSERT(!this->implHasLoadedElements());
-
- rOldData.m_aTemplate.clear();
- rOldData.m_aTemplateProvider = TemplateProvider();
- rOldData.m_pParentTree = 0;
- rOldData.m_nContextPos = 0;
-
-}
-
-//-----------------------------------------------------------------------------
-void SetNodeImpl::doTransferElements(ElementSet& rReplacement)
-{
- m_aDataSet.swap(rReplacement);
-}
-//-----------------------------------------------------------------------------
-
-void SetNodeImpl::implRebuildElements(sharable::SetNode * newNode)
-{
- OSL_ENSURE(m_pParentTree,"Cannot rebuild set without context tree");
- rtl::Reference<view::ViewStrategy> xNewStrategy = m_pParentTree->getViewBehavior();
-
- for(ElementSet::Iterator it = m_aDataSet.begin(), stop = m_aDataSet.end();
- it != stop;
- ++it)
- {
- OSL_ASSERT(it->isValid());
- if (!it->isValid()) continue;
-
- ElementTreeData aElement = *it;
- rtl::OUString aName = aElement->getSimpleRootName();
-
- sharable::TreeFragment * aNewElementAccess = newNode->getElement(aName);
- OSL_ASSERT(
- aNewElementAccess != 0 && aElement->getOriginalTreeAccess() != 0);
-
- aElement->rebuild(xNewStrategy,aNewElementAccess);
- }
-}
-//-----------------------------------------------------------------------------
-
-sharable::SetNode * SetNodeImpl::getDataAccess() const
-{
- sharable::Node * node = getOriginalNodeAccess();
- OSL_ASSERT(node != 0 && node->isSet());
- return &node->set;
-}
-//-----------------------------------------------------------------------------
-
-Tree* SetNodeImpl::getParentTree() const
-{
- OSL_ENSURE(m_pParentTree,"Set Node: Parent tree not set !");
- return m_pParentTree;
-}
-//-----------------------------------------------------------------------------
-
-unsigned int SetNodeImpl::getContextOffset() const
-{
- OSL_ENSURE(m_nContextPos,"Set Node: Position within parent tree not set !");
- return m_nContextPos;
-}
-//-----------------------------------------------------------------------------
-
-bool SetNodeImpl::doIsEmpty() const
-{
- /*
- for(ElementSet::Iterator it = m_aDataSet.begin(), stop = m_aDataSet.end();
- it != stop;
- ++it)
- {
- if (!it->isEmpty())
- return false;
- }
- return true;
- */
- return m_aDataSet.isEmpty();
-}
-//-------------------------------------------------------------------------
-
-ElementTree* SetNodeImpl::doFindElement(rtl::OUString const& aName)
-{
- return m_aDataSet.findElement(aName).get();
-}
-//-------------------------------------------------------------------------
-void SetNodeImpl::doDifferenceToDefaultState(SubtreeChange& _rChangeToDefault, ISubtree& _rDefaultTree)
-{
- OSL_ENSURE(implHasLoadedElements(),"Should not query difference to default state for set that is not loaded");
- implDifferenceToDefaultState(_rChangeToDefault,_rDefaultTree);
-}
-//-----------------------------------------------------------------------------
-
-SetElementChangeImpl* SetNodeImpl::doAdjustToAddedElement(rtl::OUString const& aName, AddNode const& aAddNodeChange, ElementTreeData const & aNewElement)
-{
- return implAdjustToAddedElement(aName,aNewElement,aAddNodeChange.isReplacing());
-}
-//-------------------------------------------------------------------------
-
-SetElementChangeImpl* SetNodeImpl::implAdjustToAddedElement(rtl::OUString const& aName, ElementTreeData const & aNewElement, bool _bReplacing)
-{
- { (void)_bReplacing; }
- OSL_ENSURE( validatedName(aNewElement) == aName, "Unexpected name on new element" );
-
- if (hasStoredElement(aName))
- {
- OSL_ENSURE( _bReplacing, "Added Element already exists - replacing" );
-
- ElementTreeData aOldElement = this->replaceElement(aName,aNewElement);
-
- return implCreateReplace(aName,aNewElement,aOldElement);
- }
- else
- {
- OSL_ENSURE( !_bReplacing, "Replaced Element doesn't exist - simply adding" );
- this->insertElement(aName,aNewElement);
-
- return implCreateInsert(aName,aNewElement);
- }
-}
-//-------------------------------------------------------------------------
-
-SetElementChangeImpl* SetNodeImpl::doAdjustToRemovedElement(rtl::OUString const& aName, RemoveNode const& /*aRemoveNodeChange*/)
-{
- return implAdjustToRemovedElement(aName);
-}
-//-------------------------------------------------------------------------
-
-SetElementChangeImpl* SetNodeImpl::implAdjustToRemovedElement(rtl::OUString const& aName)
-{
- if (ElementTreeData* pOriginal = getStoredElement(aName))
- {
- ElementTreeData aOldElement = *pOriginal;
- this->removeElement(aName);
-
- return implCreateRemove(aName,aOldElement);
- }
- else
- {
- OSL_ENSURE( false, "Removed Element doesn't exist - ignoring" );
- return 0;
- }
-}
-//-------------------------------------------------------------------------
-
-SetElementChangeImpl* SetNodeImpl::implCreateInsert(rtl::OUString const& aName, ElementTreeData const& aNewElement) const
-{
- Path::Component aFullName = Path::makeCompositeName(aName, this->getElementTemplate()->getName());
-
- SetElementChangeImpl* pRet = new SetInsertImpl(aFullName, aNewElement.tree, true);
- pRet->setTarget( getParentTree(), getContextOffset() );
- return pRet;
-}
-//-------------------------------------------------------------------------
-
-SetElementChangeImpl* SetNodeImpl::implCreateReplace(rtl::OUString const& aName, ElementTreeData const& aNewElement, ElementTreeData const& aOldElement) const
-{
- Path::Component aFullName = Path::makeCompositeName(aName, this->getElementTemplate()->getName());
-
- SetElementChangeImpl* pRet = new SetReplaceImpl(aFullName, aNewElement.tree, aOldElement.tree);
- pRet->setTarget( getParentTree(), getContextOffset() );
- return pRet;
-}
-//-------------------------------------------------------------------------
-
-SetElementChangeImpl* SetNodeImpl::implCreateRemove(rtl::OUString const& aName, ElementTreeData const& aOldElement) const
-{
- Path::Component aFullName = Path::makeCompositeName(aName, this->getElementTemplate()->getName());
-
- SetElementChangeImpl* pRet = new SetRemoveImpl(aFullName, aOldElement.tree);
- pRet->setTarget( getParentTree(), getContextOffset() );
- return pRet;
-}
-//-------------------------------------------------------------------------
-
-void SetNodeImpl::insertElement(rtl::OUString const& aName, ElementTreeData const& aNewElement)
-{
- attach(aNewElement,aName);
- try
- {
- m_aDataSet.insertElement(aName,aNewElement);
- }
- catch (std::exception&)
- {
- detach(aNewElement);
- throw;
- }
-}
-//-------------------------------------------------------------------------
-
-ElementTreeData SetNodeImpl::replaceElement(rtl::OUString const& aName, ElementTreeData const& aNewElement)
-{
- attach(aNewElement,aName);
- try
- {
- ElementTreeData aOldElement = m_aDataSet.replaceElement(aName,aNewElement);
- detach(aOldElement);
- return aOldElement;
- }
- catch (std::exception&)
- {
- detach(aNewElement);
- throw;
- }
-}
-//-------------------------------------------------------------------------
-
-ElementTreeData SetNodeImpl::removeElement(rtl::OUString const& aName)
-{
- ElementTreeData aOldElement = m_aDataSet.removeElement(aName);
- detach(aOldElement);
- return aOldElement;
-}
-//-------------------------------------------------------------------------
-SetNodeVisitor::Result SetNodeImpl::doDispatchToElements(SetNodeVisitor& aVisitor)
-{
- SetNodeVisitor::Result eRet = SetNodeVisitor::CONTINUE;
- for(ElementSet::Iterator it = m_aDataSet.begin(), stop = m_aDataSet.end();
- it != stop && eRet != SetNodeVisitor::DONE;
- ++it)
- {
- eRet = aVisitor.visit( SetEntry(it->get()) );
- }
- return eRet;
-}
-//-----------------------------------------------------------------------------
-
-void SetNodeImpl::attach(ElementTreeData const& aNewElement, rtl::OUString const& aName)
-{
- // check for name (this also reject NULLs, therefore it should go first)
- rtl::OUString aActualName = validatedName(aNewElement);
-
- Tree* pParentContext = getParentTree();
- unsigned int nParentOffset = getContextOffset();
-
- OSL_ENSURE(nParentOffset != 0 && pParentContext != 0,"INTERNAL ERROR: Set has no context");
-
- bool bHasContext = (aNewElement->getContextTree() != 0);
-
- if (bHasContext)
- {
- if (aNewElement->getContextTree() != pParentContext)
- {
- OSL_ENSURE(false,"INTERNAL ERROR: New set element belongs to another context tree" );
- throw Exception("INTERNAL ERROR: New set element belongs to another context tree" );
- }
- if (aNewElement->getContextNode() != nParentOffset)
- {
- OSL_ENSURE(false,"INTERNAL ERROR: New set element belongs to another context node" );
- throw Exception("INTERNAL ERROR: New set element belongs to another context node" );
- }
- }
- else
- {
- OSL_ENSURE(aNewElement->getContextNode() == 0, "INTERNAL ERROR: New element has context position without a parent");
- aNewElement->moveTree(pParentContext,nParentOffset);
- }
-
- // check for and correct a misnomer - do only after parenthood is assured (else we don't own it anyways)
- if (aName != aActualName)
- {
- // OSL_ENSURE(aActualName.isEmpty(), "WARNING: Wrongly named tree inserted in set node");
- aNewElement->renameTree(aName);
-
- aActualName = validatedName(aNewElement);
- if (aName !=aActualName )
- {
- OSL_ENSURE(false, "INTERNAL ERROR: Cannot rename tree in set node");
- throw Exception("INTERNAL ERROR: Cannot rename tree for insertion into set node");
- }
- }
-}
-//-------------------------------------------------------------------------
-
-void SetNodeImpl::detach(ElementTreeData const& aOldElement)
-{
- if (aOldElement.isValid())
- {
- aOldElement->detachTree();
- }
-}
-//-------------------------------------------------------------------------
-
-ElementTreeData SetNodeImpl::entryToElement(SetEntry const& _anEntry)
-{
- ElementTree * pTree = _anEntry.tree();
- return ElementTreeData(pTree, isInDefault(_anEntry));
-}
-//-------------------------------------------------------------------------
-
-
-SetElementChangeImpl* SetNodeImpl::doAdjustChangedElement(NodeChangesInformation& rLocalChanges, rtl::OUString const& aName, Change const& _aElementChange)
-{
- SetElementChangeImpl* pThisChange = NULL;
-
- if (ElementTreeData* pElement = getStoredElement(aName))
- {
- OSL_ASSERT(pElement->isValid());
-
- if (SubtreeChange const * subtreeChange = dynamic_cast< SubtreeChange const * >(&_aElementChange))
- {
- // recurse to element tree
- Tree * elementTree = pElement->get();
-
- view::getViewBehavior(elementTree)->adjustToChanges(rLocalChanges, view::getRootNode(elementTree), *subtreeChange);
- }
- else if (ValueChange const * valueChange = dynamic_cast< ValueChange const * >(&_aElementChange))
- {
- // make an element for the old element
- std::auto_ptr<ValueNode> aOldNode = OTreeNodeConverter().createCorrespondingNode(*valueChange);
- aOldNode->setValue(valueChange->getOldValue());
-
- bool bWasDefault = (valueChange->getMode() == ValueChange::wasDefault);
-
- std::auto_ptr<INode> aBasePtr(aOldNode.release());
- rtl::OUString aElementTypeName = getElementTemplate()->getName();
- rtl::Reference< data::TreeSegment > aOldBaseTree = data::TreeSegment::create( aBasePtr, aElementTypeName );
-
- rtl::Reference<ElementTree> aOldElement = new ElementTree(aOldBaseTree, getElementTemplate(), getTemplateProvider());
-
- OSL_ASSERT(aOldBaseTree.is()); // the tree took ownership
- OSL_ASSERT(aOldElement->isFree()); // the tree is free-floating
-
- pThisChange = implCreateReplace(aName,*pElement,ElementTreeData(aOldElement,bWasDefault));
- }
- else
- OSL_ENSURE( false, "Unexpected kind of change to set element" );
-
- }
- else
- {
- // could be changed to do an insert instead (?)
- OSL_ENSURE( false, "Changed Element doesn't exist - (and not adding now)" );
- }
- return pThisChange;
-}
-//-------------------------------------------------------------------------
-
-bool SetNodeImpl::implHasLoadedElements() const
-{
- return m_aInit == 0; // cannot check whether init was called though ...
-}
-//-----------------------------------------------------------------------------
-
-void SetNodeImpl::initElements(TemplateProvider const& aTemplateProvider,Tree& rParentTree,unsigned int nPos,unsigned int nDepth)
-{
- OSL_ENSURE(m_pParentTree == 0 || m_pParentTree == &rParentTree, "WARNING: Set Node: Changing parent");
- OSL_ENSURE(m_nContextPos == 0 || m_nContextPos == nPos, "WARNING: Set Node: Changing location within parent");
- m_pParentTree = &rParentTree;
- m_nContextPos = nPos;
-
- OSL_ENSURE(!m_aTemplateProvider.isValid() || !implHasLoadedElements(),"ERROR: Reinitializing set"); //doClearElements();
- OSL_ASSERT(doIsEmpty()); //doClearElements();
-
- OSL_ENSURE(!m_aTemplate.is() || m_aTemplate->isInstanceTypeKnown(),"ERROR: Need a type-validated template to fill a set");
- OSL_ENSURE(aTemplateProvider.isValid() || nDepth == 0 || m_aTemplate->isInstanceValue(), "ERROR: Need a template provider to fill a non-primitive set");
-
- if (nDepth > 0) // dont set a template provider for zero-depth sets
- {
- m_aInit = nDepth;
- m_aTemplateProvider = aTemplateProvider;
- }
-}
-//-----------------------------------------------------------------------------
-
-bool SetNodeImpl::implLoadElements()
-{
- if (m_aInit > 0)
- {
- OSL_ENSURE(!getElementTemplate().is() || getElementTemplate()->isInstanceTypeKnown(),"ERROR: Need a type-validated template to fill a set");
- OSL_ENSURE(getTemplateProvider().isValid() || getElementTemplate()->isInstanceValue(), "ERROR: Need a template provider to fill a non-primitive set");
-
- unsigned int nDepth = m_aInit;
- implInitElements(this->getDataAccess(),nDepth);
- m_aInit = 0;
- }
- OSL_ASSERT(implHasLoadedElements());
-
- return m_aInit == 0;
-}
-//-----------------------------------------------------------------------------
-
-void SetNodeImpl::implEnsureElementsLoaded()
-{
- if (!implLoadElements())
- throw ConstraintViolation("Trying to access set elements beyond the loaded nestíng level");
-}
-//-----------------------------------------------------------------------------
-
-void SetNodeImpl::implInitElements(sharable::SetNode * node, unsigned int nDepth)
-{
- Tree* pThisTree = getParentTree();
-
- OSL_ENSURE(pThisTree,"Cannot load elements of a set that has no parent tree");
-
- CollectElementTrees aCollector( pThisTree->getViewBehavior(), pThisTree, getContextOffset(),
- nDepth, getElementTemplate(), getTemplateProvider() );
- aCollector.collect(node);
-
- for(std::vector<ElementTreeData>::const_iterator it = aCollector.collection.begin(), stop = aCollector.collection.end();
- it != stop; ++it)
- {
- implInitElement(implValidateElement(*it));
- }
-}
-//-------------------------------------------------------------------------
-
-void SetNodeImpl::implInitElement(ElementTreeData const& aNewElement)
-{
- OSL_PRECOND(aNewElement.isValid(),"INTERNAL ERROR: Set element is NULL");
- OSL_ENSURE(!aNewElement->isFree(),"INTERNAL ERROR: Set element is free-floating");
-
- OSL_ENSURE(aNewElement->getContextTree() == getParentTree(),"INTERNAL ERROR: Set element has wrong context tree");
- OSL_ENSURE(aNewElement->getContextNode() == getContextOffset(),"INTERNAL ERROR: Set element has wrong context node");
-
- rtl::OUString aName = validatedName(aNewElement);
-
- OSL_ENSURE(aName.getLength() != 0,"INTERNAL ERROR: Unnamed element in set");
- OSL_ENSURE(m_aDataSet.getElement(aName) == 0,"INTERNAL ERROR: Duplicate element name in set");
-
- m_aDataSet.insertElement(aName,aNewElement);
-}
-//-------------------------------------------------------------------------
-
-ElementTreeData SetNodeImpl::makeAdditionalElement(rtl::Reference<view::ViewStrategy> const& _xStrategy, AddNode const& aAddNodeChange, unsigned int nDepth)
-{
- OSL_ENSURE(aAddNodeChange.wasInserted(), "Cannot integrate element that is not in tree yet");
-
- sharable::TreeFragment * aAddedTree = aAddNodeChange.getInsertedTree();
- // need 'unsafe', because ownership would be gone when notifications are sent
- if (aAddedTree != NULL)
- {
- CollectElementTrees aCollector( _xStrategy, getParentTree(), getContextOffset(),
- nDepth, getElementTemplate(), getTemplateProvider() );
-
- return implValidateElement(aCollector.create(aAddedTree));
- }
-
- return ElementTreeData();
-}
-//-------------------------------------------------------------------------
-
-ElementTreeData SetNodeImpl::implValidateElement(ElementTreeData const& aNewElement)
-{
- rtl::Reference<Template> aTemplate = getElementTemplate();
- OSL_ENSURE(aTemplate.is(),"INTERNAL ERROR: No template in set node");
- OSL_ENSURE(aTemplate->isInstanceTypeKnown(),"INTERNAL ERROR: Unspecifed template in set node");
-
- OSL_ENSURE(aNewElement.isValid(),"INTERNAL ERROR: Unexpected NULL element in set node");
- if (aNewElement.isValid())
- {
- if (aTemplate->isInstanceValue())
- {
- if (aNewElement->nodeCount() == 0)
- {
- OSL_ENSURE(false,"INTERNAL ERROR: Invalid (empty) element tree in value set");
- throw Exception("INTERNAL ERROR: Invalid (empty) element tree in value set");
- }
- if (aNewElement->nodeCount() > 1)
- {
- OSL_ENSURE(false,"INTERNAL ERROR: Complex element tree in value set");
- throw Exception("INTERNAL ERROR: Complex element tree in value set");
- }
-
- view::Node aElementRoot = view::getRootNode(aNewElement.get());
-
- OSL_ENSURE(aElementRoot.isValueNode(),"INTERNAL ERROR: Inserting complex type into value set node");
-
- view::ValueNode aValueNode(aElementRoot);
- com::sun::star::uno::Type aValueType = aValueNode.get_impl()->getValueType();
-
- OSL_ENSURE( aValueType.getTypeClass() != uno::TypeClass_INTERFACE,
- "INTERNAL ERROR: Inserting complex type into value set node");
-
- com::sun::star::uno::Type aElementType = aTemplate->getInstanceType();
-
- if (aValueType != aElementType)
- {
- // handle 'Any'
- if (aElementType.getTypeClass() != uno::TypeClass_ANY)
- {
- OSL_ENSURE(false,"INTERNAL ERROR: ´Wrong value type inserting into value set");
- throw TypeMismatch(aValueType.getTypeName(), aElementType.getTypeName(),
- "- INTERNAL ERROR: Mistyped element in value set");
- }
- }
- }
- else // a complete tree
- {
- // TODO: add some validation here
- if (!aNewElement->isTemplateInstance())
- {
- throw TypeMismatch( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("<Unknown> [Missing Template]")),
- aTemplate->getName(),
- " - Trying to insert element without template into set");
- }
- if (!aNewElement->isInstanceOf(aTemplate))
- {
- throw TypeMismatch( aNewElement->getTemplate()->getPathString(),
- aTemplate->getPathString(),
- " - Trying to insert element with wrong template into set");
- }
- }
- }
- return aNewElement;
-}
-//-------------------------------------------------------------------------
-
-namespace
-{
- //-------------------------------------------------------------------------
- class DiffToDefault : data::SetVisitor
- {
- SubtreeChange& m_rChange;
- ISubtree& m_rDefaultTree;
- OTreeChangeFactory& m_rChangeFactory;
- public:
- explicit
- DiffToDefault(SubtreeChange& _rChange, ISubtree& _rDefaultTree)
- : m_rChange(_rChange)
- , m_rDefaultTree(_rDefaultTree)
- , m_rChangeFactory( getDefaultTreeChangeFactory() )
- {
- }
-
- void diff(sharable::SetNode * actualTree)
- {
- translate(m_rDefaultTree);
- visitElements(actualTree);
- }
-
- private:
- void translate(ISubtree& _rDefaultTree);
- void handleDefault(rtl::Reference< data::TreeSegment > const & _pDefaultElement);
- void handleActual(sharable::TreeFragment * element);
-
- using SetVisitor::handle;
- virtual bool handle(sharable::TreeFragment * tree)
- { handleActual(tree); return false; }
- };
- //-------------------------------------------------------------------------
-
- void DiffToDefault::translate(ISubtree& _rDefaultTree)
- {
- rtl::OUString aTypeName = _rDefaultTree.getElementTemplateName();
- OSL_ENSURE(aTypeName.getLength(),"Cannot get element type for default set");
-
- CollectNames aCollector;
- aCollector.applyToChildren(_rDefaultTree);
-
- std::vector<rtl::OUString> const& aNames = aCollector.list();
-
- for(std::vector<rtl::OUString>::const_iterator it = aNames.begin(); it != aNames.end(); ++it)
- {
- std::auto_ptr<INode> aChild = _rDefaultTree.removeChild(*it);
- handleDefault( data::TreeSegment::create(aChild,aTypeName) );
- }
-
- }
- //-------------------------------------------------------------------------
-
- void DiffToDefault::handleDefault(rtl::Reference< data::TreeSegment > const &_pDefaultElement)
- {
- OSL_PRECOND(_pDefaultElement.is(), "Unexpected NULL default node");
-
- rtl::OUString sName = _pDefaultElement->fragment->getName();
-
- OSL_ENSURE(_pDefaultElement->fragment->getAttributes().isDefault(), "Missing default state on default element tree");
- OSL_ENSURE(_pDefaultElement->fragment->nodes[0].isDefault(), "Missing default attribute on default node");
-
- std::auto_ptr<AddNode> pAddIt( m_rChangeFactory.createAddNodeChange(_pDefaultElement, sName,true) );
-
- m_rChange.addChange(base_ptr(pAddIt));
- }
- //-------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
- void DiffToDefault::handleActual(sharable::TreeFragment * element)
- {
- bool bDefaultElement = element->getRootNode()->isDefault();
-
- rtl::OUString sName = element->getName();
-
- if (Change* pDefaultNode = m_rChange.getChange(sName) )
- {
-
- if (AddNode * addNode = dynamic_cast< AddNode * >(pDefaultNode))
- {
- if (bDefaultElement)
- {
- rtl::Reference< data::TreeSegment > aDefaultTree = addNode->getNewTree();
- m_rDefaultTree.addChild(data::convertTree(aDefaultTree.is() ? aDefaultTree->fragment : 0, true));
-
- // no change needed - remove the change and recover the default
- m_rChange.removeChange(sName);
- }
- }
- else
- {
- // should never happen
- OSL_ASSERT(false);
- if (bDefaultElement) m_rChange.removeChange(sName);
- }
- }
- else
- {
- OSL_ENSURE(!bDefaultElement, "Node marked 'default' not found in actual default data");
-
- std::auto_ptr<RemoveNode> pRemoveIt( m_rChangeFactory.createRemoveNodeChange(sName,true) );
- // pRemoveIt->expectRemovedNode(pActualNode);
- m_rChange.addChange(base_ptr(pRemoveIt));
- }
- }
-//-----------------------------------------------------------------------------
-}
-//-----------------------------------------------------------------------------
-void SetNodeImpl::implDifferenceToDefaultState(SubtreeChange& _rChangeToDefault, ISubtree& _rDefaultTree) const
-{
- DiffToDefault(_rChangeToDefault,_rDefaultTree).diff( getDataAccess() );
-}
-//-----------------------------------------------------------------------------
-void SetNodeImpl::convertChanges(NodeChangesInformation& rLocalChanges, SubtreeChange const& rExternalChange,
- unsigned int nDepth)
-{
- OSL_ASSERT(nDepth > 0);
-
- if (Tree* pParentTree = this->getParentTree())
- {
- unsigned int nNode = getContextOffset();
-
- OSL_ENSURE(pParentTree->isValidNode(nNode), "Invalid context node in Set");
- OSL_ENSURE(view::Node(pParentTree, nNode).get_impl() == this,
- "Wrong context node in Set");
-
- CollectChanges aCollector(rLocalChanges, *pParentTree, nNode, getElementTemplate(), nDepth);
-
- aCollector.collectFromChildren(rExternalChange);
- }
- else
- OSL_ENSURE(false, "Missing context tree in Set");
-}
-//-----------------------------------------------------------------------------
-
- }
-}
-
diff --git a/configmgr/source/treemgr/setnodeimpl.hxx b/configmgr/source/treemgr/setnodeimpl.hxx
deleted file mode 100644
index ef0419641f..0000000000
--- a/configmgr/source/treemgr/setnodeimpl.hxx
+++ /dev/null
@@ -1,306 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_SETNODEBEHAVIOR_HXX_
-#define CONFIGMGR_SETNODEBEHAVIOR_HXX_
-
-#include "nodeimpl.hxx"
-#include "tree.hxx"
-#include "template.hxx"
-#include <rtl/ref.hxx>
-
-#ifndef INCUDED_MAP
-#include <map>
-#define INCUDED_MAP
-#endif
-#ifndef INCLUDED_MEMORY
-#include <memory>
-#define INCLUDED_MEMORY
-#endif
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- class SubtreeChange;
- class AddNode;
- class RemoveNode;
- namespace view { class ViewTreeAccess; }
-//-----------------------------------------------------------------------------
-
- namespace configuration
- {
-//-----------------------------------------------------------------------------
- class SetElementChangeImpl;
-
-//-----------------------------------------------------------------------------
-
- struct SetEntry
- {
- SetEntry(ElementTree* _pTree);
-
- bool isValid() const { return m_pTree != 0; }
-
- ElementTree* tree() const { return m_pTree; };
-
- view::ViewTreeAccess getTreeView() const;
- private:
- ElementTree* m_pTree;
- };
- //-------------------------------------------------------------------------
-
- struct SetNodeVisitor
- {
- enum Result { DONE, CONTINUE };
- virtual Result visit(SetEntry const& anEntry) = 0;
- };
-
- //-----------------------------------------------------------------------------
-
- // basic implementations of set node contents
- //-----------------------------------------------------------------------------
-
- struct ElementTreeData
- {
- // construction
- ElementTreeData() : tree(), inDefault(false) {}
-
- ElementTreeData(rtl::Reference<ElementTree> const& _tree, bool _bDefault)
- : tree(_tree), inDefault(_bDefault) {}
-
- // ORef compatibility
- sal_Bool isValid() const { return this->tree.is(); }
- ElementTree* get() const { return this->tree.get(); }
- rtl::Reference<ElementTree> const& operator->() const { return this->tree; }
- ElementTree& operator*() const { return *get(); }
-
- // data
- rtl::Reference<ElementTree> tree;
- bool inDefault;
- };
- //-----------------------------------------------------------------------------
-
- class ElementSet
- {
- struct FastLess
- {
- bool operator ()(
- rtl::OUString const & a, rtl::OUString const & b) const
- {
- // first sort by length; order is immaterial, and it is fast
- return a.getLength() == b.getLength()
- ? a < b : a.getLength() < b.getLength();
- }
- };
-
- public:
- typedef std::map<rtl::OUString, ElementTreeData, FastLess> Data;
-
- // the following must be implemented by derived classes
- bool isEmpty() const { return m_aData.empty(); }
-
- bool hasElement(rtl::OUString const& aName) const;
- ElementTreeData* getElement(rtl::OUString const& aName);
- ElementTreeData const* getElement(rtl::OUString const& aName) const;
- ElementTreeData findElement(rtl::OUString const& aName);
-
- void insertElement(rtl::OUString const& aName, ElementTreeData const& aNewEntry);
- ElementTreeData replaceElement(rtl::OUString const& aName, ElementTreeData const& aNewEntry);
- ElementTreeData removeElement(rtl::OUString const& aName);
-
- void clearElements() { m_aData.clear(); }
-
- void swap(ElementSet& aOther) { m_aData.swap(aOther.m_aData); }
-
- // STL style iteration
- class ConstIterator
- {
- public:
- ConstIterator(Data::const_iterator const& it) : m_base(it) {}
-
- ElementTreeData const& operator* () const { return m_base->second; }
- ElementTreeData const* operator->() const { return &m_base->second; }
-
- ConstIterator& operator++() { ++m_base; return *this; }
- ConstIterator operator++(int) { return ConstIterator(m_base++); }
-
- ConstIterator& operator--() { --m_base; return *this; }
- ConstIterator operator--(int) { return ConstIterator(m_base--); }
-
- friend bool operator ==(ConstIterator const& lhs, ConstIterator const& rhs)
- { return lhs.m_base == rhs.m_base; }
- friend bool operator !=(ConstIterator const& lhs, ConstIterator const& rhs)
- { return lhs.m_base != rhs.m_base; }
- private:
- Data::const_iterator m_base;
- };
- ConstIterator begin() const { return ConstIterator(m_aData.begin()); }
- ConstIterator end() const { return ConstIterator(m_aData.end()); }
-
- class Iterator
- {
- public:
- Iterator(Data::iterator const& it) : m_base(it) {}
-
- ElementTreeData& operator* () const { return m_base->second; }
- ElementTreeData* operator->() const { return &m_base->second; }
-
- Iterator& operator++() { ++m_base; return *this; }
- Iterator operator++(int) { return Iterator(m_base++); }
-
- Iterator& operator--() { --m_base; return *this; }
- Iterator operator--(int) { return Iterator(m_base--); }
-
- friend bool operator ==(Iterator const& lhs, Iterator const& rhs)
- { return lhs.m_base == rhs.m_base; }
- friend bool operator !=(Iterator const& lhs, Iterator const& rhs)
- { return lhs.m_base != rhs.m_base; }
-
- operator ConstIterator() const { return ConstIterator(m_base); }
- private:
- Data::iterator m_base;
- };
- Iterator begin() { return Iterator(m_aData.begin()); }
- Iterator end() { return Iterator(m_aData.end()); }
-
- Data::const_iterator beginNative() const { return m_aData.begin(); }
- Data::const_iterator endNative() const { return m_aData.end(); }
- private:
- Data m_aData;
- };
- //-------------------------------------------------------------------------
-
- // Basic implementation of a set node
- //-------------------------------------------------------------------------
-
- class SetNodeImpl : public NodeImpl
- {
- friend class view::ViewStrategy;
- ElementSet m_aDataSet;
- rtl::Reference<Template> m_aTemplate;
- TemplateProvider m_aTemplateProvider;
- Tree* m_pParentTree;
- unsigned int m_nContextPos;
-
- unsigned int m_aInit;
-
- public:
- SetNodeImpl(sharable::SetNode * _pNodeRef, Template* pTemplate);
-
- sharable::SetNode * getDataAccess() const;
-
- /// Get the template that describes elements of this set
- rtl::Reference<Template> getElementTemplate() const { return m_aTemplate; }
-
- /// Get a template provider that can create new elements for this set
- TemplateProvider getTemplateProvider() const { return m_aTemplateProvider; }
-
- void convertChanges(NodeChangesInformation& rLocalChanges, SubtreeChange const& rExternalChange, unsigned int nDepth);
-
- void insertElement(rtl::OUString const& aName, ElementTreeData const& aNewElement);
- ElementTreeData replaceElement(rtl::OUString const& aName, ElementTreeData const& aNewElement);
- ElementTreeData removeElement(rtl::OUString const& aName);
-
- void rebuildFrom(SetNodeImpl& rOldData, sharable::SetNode * newNode);
-
- protected:
- ~SetNodeImpl();
-
- protected:
- // new overrideables
- virtual bool doIsEmpty() const;
- virtual ElementTree* doFindElement(rtl::OUString const& aName) ;
- virtual SetNodeVisitor::Result doDispatchToElements( SetNodeVisitor& aVisitor);
- virtual void doDifferenceToDefaultState( SubtreeChange& _rChangeToDefault, ISubtree& _rDefaultTree);
-
- virtual SetElementChangeImpl* doAdjustToAddedElement( rtl::OUString const& aName, AddNode const& aAddNodeChange, ElementTreeData const & aNewElement);
- virtual SetElementChangeImpl* doAdjustToRemovedElement( rtl::OUString const& aName, RemoveNode const& aRemoveNodeChange);
- virtual SetElementChangeImpl* doAdjustChangedElement( NodeChangesInformation& rLocalChanges, rtl::OUString const& aName, Change const& aChange);
-
- virtual void doTransferElements(ElementSet& rReplacement);
-
- protected:
- // helpers
- Tree* getParentTree() const;
- unsigned int getContextOffset() const;
-
- ElementTreeData makeElement( SetEntry const & _anEntry);
- static ElementTreeData entryToElement(SetEntry const& _anEntry);
- view::ViewTreeAccess getElementView();
-
- /// Initialize the set data: Set context information, and build the view (actually loading the elements may be deferred)
- friend class TreeImplBuilder;
- void initElements(TemplateProvider const& aTemplateProvider, Tree& rParentTree, unsigned int nPos, unsigned int nDepth);
-
- protected:
- /// does this set contain any elements (loads elements if needed)
- bool implHasLoadedElements() const;
- bool implLoadElements();
- void implEnsureElementsLoaded();
- void implInitElements(sharable::SetNode * node, unsigned int nDepth);
- void implInitElement(ElementTreeData const& aNewElement);
-
- void implRebuildElements(sharable::SetNode * newNode);
- protected:
- SetElementChangeImpl* implCreateInsert ( rtl::OUString const& aName, ElementTreeData const& aNewElement) const;
- SetElementChangeImpl* implCreateReplace ( rtl::OUString const& aName, ElementTreeData const& aNewElement, ElementTreeData const& aOldElement) const;
- SetElementChangeImpl* implCreateRemove ( rtl::OUString const& aName, ElementTreeData const& aOldElement) const;
-
- SetElementChangeImpl* implAdjustToAddedElement( rtl::OUString const& aName, ElementTreeData const& aNewElement, bool _bReplacing);
- SetElementChangeImpl* implAdjustToRemovedElement( rtl::OUString const& aName);
-
- ElementTreeData makeAdditionalElement( rtl::Reference<view::ViewStrategy> const& _xStrategy, AddNode const& aAddNodeChange, unsigned int nDepth);
-
- ElementTreeData implValidateElement(ElementTreeData const& aNewElement);
-
- void implDifferenceToDefaultState( SubtreeChange& _rChangeToDefault, ISubtree& _rDefaultTree) const;
- protected:
- bool hasStoredElement(rtl::OUString const& aName) const
- { return m_aDataSet.hasElement(aName); }
- ElementTreeData* getStoredElement(rtl::OUString const& aName)
- { return m_aDataSet.getElement(aName); }
- ElementTreeData const* getStoredElement(rtl::OUString const& aName) const
- { return m_aDataSet.getElement(aName); }
-
- ElementSet::Data::const_iterator beginElementSet() const
- { return m_aDataSet.beginNative(); }
- ElementSet::Data::const_iterator endElementSet() const
- { return m_aDataSet.endNative(); }
-
- void attach(ElementTreeData const& aNewElement, rtl::OUString const& aName);
- void detach(ElementTreeData const& aNewElement);
- };
-
-//-----------------------------------------------------------------------------
- // domain-specific 'dynamic_cast' replacement
- SetNodeImpl& AsSetNode (NodeImpl& rNode);
-
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_SETNODEBEHAVIOR_HXX_
diff --git a/configmgr/source/treemgr/template.cxx b/configmgr/source/treemgr/template.cxx
deleted file mode 100644
index f3f0c03c26..0000000000
--- a/configmgr/source/treemgr/template.cxx
+++ /dev/null
@@ -1,124 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "node.hxx"
-#include "template.hxx"
-#include "templateimpl.hxx"
-#include "apitypes.hxx"
-
-namespace configmgr
-{
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-// class TemplateProvider
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-TemplateProvider::TemplateProvider()
-: m_aImpl()
-{
-}
-
-//-----------------------------------------------------------------------------
-TemplateProvider::TemplateProvider(rtl::Reference< TreeManager > const & xProvider, RequestOptions const& aOptions)
-: m_aImpl( new TemplateProvider_Impl(xProvider,aOptions) )
-{
-}
-
-//-----------------------------------------------------------------------------
-TemplateProvider::TemplateProvider(TemplateProvider const& aOther)
-: m_aImpl(aOther.m_aImpl)
-{
-}
-
-//-----------------------------------------------------------------------------
-TemplateProvider& TemplateProvider::operator =(TemplateProvider const& aOther)
-{
- m_aImpl = aOther.m_aImpl;
- return *this;
-}
-
-//-----------------------------------------------------------------------------
-TemplateProvider::~TemplateProvider()
-{
-}
-
-//-----------------------------------------------------------------------------
-// class Template
-//-----------------------------------------------------------------------------
-
-Template::Template(rtl::OUString const& aName, rtl::OUString const& aModule,com::sun::star::uno::Type const& aType)
-: m_aName(aName)
-, m_aModule(aModule)
-, m_aInstanceType(aType)
-{
-}
-//-----------------------------------------------------------------------------
-
-bool Template::isInstanceTypeKnown() const
-{
- OSL_ASSERT( TemplateImplHelper::getNoTypeAvailable().getTypeClass() == uno::TypeClass_VOID );
- return m_aInstanceType.getTypeClass() != uno::TypeClass_VOID;
-}
-//-----------------------------------------------------------------------------
-
-/// checks if this is a 'value' template
-bool Template::isInstanceValue() const
-{
- OSL_ENSURE( isInstanceTypeKnown(), "Template instance type unknown - cannot determine kind");
- return m_aInstanceType.getTypeClass() != uno::TypeClass_INTERFACE;
-}
-//-----------------------------------------------------------------------------
-
-com::sun::star::uno::Type Template::getInstanceType() const
-{
- OSL_ENSURE( isInstanceTypeKnown(), "Template instance type unknown - returning invalid (VOID) type");
- return m_aInstanceType;
-}
-//-----------------------------------------------------------------------------
-
-/// get the path where the template is located
-rtl::OUString Template::getPathString() const
-{
- TemplateName aNames(m_aName,m_aModule);
- return aNames.makePathString( );
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference<Template> makeSetElementTemplate(sharable::SetNode * set, TemplateProvider const& _aProvider)
-{
- TemplateName aNames( set->getElementTemplateName(), set->getElementTemplateModule() );
- return TemplateImplHelper::makeElementTemplateWithType(aNames, _aProvider, set);
-}
-//-----------------------------------------------------------------------------
- }
-}
-
diff --git a/configmgr/source/treemgr/templateimpl.cxx b/configmgr/source/treemgr/templateimpl.cxx
deleted file mode 100644
index ac3b0d8961..0000000000
--- a/configmgr/source/treemgr/templateimpl.cxx
+++ /dev/null
@@ -1,361 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <stdio.h>
-#include "templateimpl.hxx"
-#include "treemanager.hxx"
-#include "node.hxx"
-#include "nodevisitor.hxx"
-#include "strdecl.hxx"
-#include "typeconverter.hxx"
-#include "localizedtreeactions.hxx"
-#include "treeactions.hxx"
-#include "apitypes.hxx"
-
-#ifndef INCLUDED_MAP
-#include <map>
-#define INCLUDED_MAP
-#endif
-
-namespace configmgr
-{
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-
-com::sun::star::uno::Type TemplateName::resolveSimpleTypeName(rtl::OUString const& aName)
-{
- rtl::OUString sTypeName = aName;
- return parseTemplateName(sTypeName);
-}
-//-----------------------------------------------------------------------------
-#if OSL_DEBUG_LEVEL > 0
-rtl::OUString TemplateName::makeNativeTypeModuleName()
-{
- return rtl::OUString( TEMPLATE_MODULE_NATIVE_VALUE );
-}
-
-//-----------------------------------------------------------------------------
-rtl::OUString TemplateName::makeLocalizedTypeModuleName()
-{
- return rtl::OUString( TEMPLATE_MODULE_LOCALIZED_VALUE );
-}
-#endif
-//-----------------------------------------------------------------------------
-bool TemplateName::isSimpleTypeName() const
-{
- bool bIsSimple = (aModule.compareToAscii(TEMPLATE_MODULE_NATIVE_PREFIX,
- TEMPLATE_MODULE_NATIVE_PREFIX.getLength()) == 0);
-
- OSL_ENSURE(!bIsSimple ||
- aModule == makeNativeTypeModuleName() ||
- aModule == makeLocalizedTypeModuleName(),
- "ERROR: Invalid template module with native prefix found");
-
- return bIsSimple;
-}
-//-----------------------------------------------------------------------------
-
-com::sun::star::uno::Type TemplateName::resolveToSimpleType() const
-{
- com::sun::star::uno::Type aType;
- if ( isSimpleTypeName() )
- {
- aType = resolveSimpleTypeName( aName );
- }
- else
- OSL_ENSURE(false, "TemplateName::resolveToSimpleType must be called only for simple type name pairs");
- return aType;
-}
-//-----------------------------------------------------------------------------
-// class TemplateImplHelper
-//-----------------------------------------------------------------------------
-
-rtl::Reference<Template> TemplateImplHelper::createNew (TemplateName const& aNames,com::sun::star::uno::Type const& aType)
-{
- return new Template(aNames.aName, aNames.aModule, aType);
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference<Template> TemplateImplHelper::makeElementTemplateWithType(TemplateName const& _aNames, TemplateProvider const& _aProvider, sharable::SetNode * set)
-{
- OSL_ENSURE(_aProvider.m_aImpl.is(), "ERROR: Cannot find a template without a provider");
-
- if (_aProvider.m_aImpl.is())
- return _aProvider.m_aImpl->makeElementTemplateWithType(_aNames, set);
-
- else
- return rtl::Reference<Template>(0);
-}
-//-----------------------------------------------------------------------------
-
-void TemplateImplHelper::assignActualType (Template& aTemplate,com::sun::star::uno::Type const& aType)
-{
- OSL_PRECOND( aType != getNoTypeAvailable(), "ERROR: Assigning NO type to a template" );
-
- if (!aTemplate.isInstanceTypeKnown())
- aTemplate.m_aInstanceType = aType;
-
- OSL_ENSURE(aTemplate.isInstanceTypeKnown(), "ERROR: Could not assign given type to a template");
- OSL_ENSURE(aTemplate.getInstanceType() == aType, "ERROR: Trying to change instance type of a template");
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// class TemplateProvider_Impl
-//-----------------------------------------------------------------------------
-
-TemplateProvider_Impl::TemplateProvider_Impl(rtl::Reference< TreeManager > const & xProvider, RequestOptions const& aOptions)
-: m_xProvider(xProvider)
-, m_aOptions(aOptions)
-, m_aRepository()
-{
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference< data::TreeSegment > TemplateProvider_Impl::instantiate(rtl::Reference<Template> const& aTemplate)
-{
- if (aTemplate.is())
- {
- sharable::TreeFragment * aTemplateData = m_xProvider->requestTemplate(aTemplate->getName(), aTemplate->getModule());
-
- return cloneExpandedForLocale(aTemplateData, m_aOptions.getLocale());
- } else {
- return rtl::Reference< data::TreeSegment >();
- }
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-namespace
-{
-//-----------------------------------------------------------------------------
- struct TypeDetector : data::SetVisitor
- {
- enum State
- {
- Contradicting = -1,
- NotFound = 0,
- SomeValue,
- VariousValue,
- SomeTree
- };
-
- State result;
- com::sun::star::uno::Type type;
-
- TypeDetector() : result(NotFound), type() {}
-
- private:
- using SetVisitor::handle;
- virtual bool handle(sharable::Node * node);
- virtual bool handle(sharable::ValueNode * node);
- };
-//-----------------------------------------------------------------------------
- static com::sun::star::uno::Type detectNodeType(sharable::TreeFragment * element)
- {
- if (element == 0)
- throw configuration::Exception("Could not load required template to detect set elements");
-
- TypeDetector aDetector;
- aDetector.visitTree(element);
-
- switch(aDetector.result)
- {
- case TypeDetector::SomeTree: // found tree
- case TypeDetector::VariousValue: // found an Any
- case TypeDetector::SomeValue: // found a particular value type
- break;
-
-#ifdef DBG_UTIL
- case TypeDetector::NotFound: OSL_ENSURE(false,"Impossible Result: Node not handled"); if (false) // dirty abuse of case
- case TypeDetector::Contradicting: OSL_ENSURE(false,"Impossible Result: Node contradicts itself"); if (false) // dirty abuse of case
-#endif // DBG_UTIL
- default: OSL_ENSURE(false,"Impossible Result: Unknown result code");
-
- throw configuration::Exception("INTERNAL ERROR: Could not detect set element type from loaded instance");
- }
- return aDetector.type;
- }
-
- //-------------------------------------------------------------------------
- static bool detectElementType(com::sun::star::uno::Type& aType, sharable::SetNode * set)
- {
- TypeDetector aDetector;
- aDetector.visitElements(set);
-
- bool bResult = false;
- switch(aDetector.result)
- {
- case TypeDetector::SomeTree: // found tree
- case TypeDetector::VariousValue: // found an Any
- aType = aDetector.type;
- bResult = true;
- break;
-
- case TypeDetector::SomeValue: // found a value or an any
- case TypeDetector::NotFound: // found no element
- break;
-
- case TypeDetector::Contradicting:
- OSL_ENSURE(false,"Invalid Set: contains values and subtrees");
- break;
-
- default: OSL_ENSURE(false,"Unreachable code"); break;
- }
- return bResult;
- }
-//-----------------------------------------------------------------------------
-
-}
-//-----------------------------------------------------------------------------
-rtl::Reference<Template> TemplateProvider_Impl::makeElementTemplateWithType(TemplateName const& _aNames, sharable::SetNode * set)
-{
- TemplateRepository::iterator it = m_aRepository.find(_aNames);
-
- if (it == m_aRepository.end() || !it->second->isInstanceTypeKnown())
- {
- com::sun::star::uno::Type aType;
- if (_aNames.isSimpleTypeName()) // native type found
- {
- aType = _aNames.resolveToSimpleType();
-
- if (aType == TemplateImplHelper::getNoTypeAvailable())
- throw configuration::Exception("INTERNAL ERROR: Could not resolve native type");
- }
-
- else if (!detectElementType(aType, set))
- {
- OSL_ASSERT(_aNames.aName == set->getElementTemplateName());
- OSL_ASSERT(_aNames.aModule == set->getElementTemplateModule());
-
- sharable::TreeFragment * aTemplateData = m_xProvider->requestTemplate(_aNames.aName, _aNames.aModule);
-
- aType = detectNodeType(aTemplateData); // throws if necessary
- }
- OSL_ASSERT( aType != TemplateImplHelper::getNoTypeAvailable() );
-
- if (it == m_aRepository.end())
- it = m_aRepository.insert( TemplateRepository::value_type( _aNames, TemplateImplHelper::createNew(_aNames,aType) ) ).first;
-
- else
- TemplateImplHelper::assignActualType(*it->second, aType);
-
- OSL_ENSURE(it->second->isInstanceTypeKnown(), "No type assigned to Template");
- OSL_ENSURE(it->second->getInstanceType() == aType, "Inconsistent type found for Template");
- }
-
-#ifdef DBG_UTIL
- else
- {
- OSL_ENSURE(it->second->isInstanceTypeKnown(), "No type assigned to Template");
- com::sun::star::uno::Type aTestType;
- if (detectElementType(aTestType, set))
- OSL_ENSURE(it->second->getInstanceType() == aTestType, "Inconsistent type found for Template");
- }
-#endif // DBG_UTIL
-
- return it->second;
-
-}
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-namespace
-{
-//-----------------------------------------------------------------------------
- bool TypeDetector::handle(sharable::ValueNode * node)
- {
- com::sun::star::uno::Type aFoundType = node->getValueType();
-
- bool isNullType = (aFoundType.getTypeClass() == uno::TypeClass_VOID);
- bool isAnyType = (aFoundType.getTypeClass() == uno::TypeClass_ANY);
-
- switch (this->result) // transition depends on previous state
- {
- case NotFound:
- this->type = aFoundType;
-
- if (isAnyType)
- this->result = VariousValue;
-
- else if (!isNullType)
- this->result = SomeValue;
-
- break;
-
- case SomeValue:
- if (!isNullType && this->type != aFoundType)
- {
- this->result = VariousValue;
- this->type = configapi::getAnyType();
- OSL_ASSERT(type.getTypeClass() == uno::TypeClass_ANY);
- }
- break;
-
- case VariousValue: // remain unchanged - type already is 'Any'
- break;
-
- case SomeTree: OSL_ENSURE(false, "Found value node does not match previous (tree) sibling");
- default:
- this->result = Contradicting;
- break;
- }
- return false; // always continue to detect errors in data
- }
-//-----------------------------------------------------------------------------
- bool TypeDetector::handle(sharable::Node * node)
- {
- (void) node; // avoid warnings
- OSL_ENSURE(!node->isValue(), "Value node dipatched to wrong handler");
- switch (this->result) // transition depends on previous state
- {
- case NotFound:
- this->type = configapi::getUnoInterfaceType();
- this->result = SomeTree;
- break;
-
- case SomeTree: // remain unchanged - type already is Tree
- break;
-
- case SomeValue:
- case VariousValue: OSL_ENSURE(false, "Found Subtree node does not match previous (value) sibling");
- default:
- this->result = Contradicting;
- break;
- }
- return false; // always continue to detect errors in data
- }
-
-//-----------------------------------------------------------------------------
-} // anonymous
-//-----------------------------------------------------------------------------
- } // configuration
-} // configmgr
-
diff --git a/configmgr/source/treemgr/templateimpl.hxx b/configmgr/source/treemgr/templateimpl.hxx
deleted file mode 100644
index 2a1d4a24c5..0000000000
--- a/configmgr/source/treemgr/templateimpl.hxx
+++ /dev/null
@@ -1,172 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_TEMPLATEIMPL_HXX_
-#define CONFIGMGR_TEMPLATEIMPL_HXX_
-
-#include "template.hxx"
-#include "configpath.hxx"
-#include "requestoptions.hxx"
-#include <rtl/ustrbuf.hxx>
-#include <rtl/ref.hxx>
-#include <salhelper/simplereferenceobject.hxx>
-#include "utility.hxx"
-
-#ifndef INCLUDED_MAP
-#include <map>
-#define INCLUDED_MAP
-#endif
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace data { class TreeSegment; }
-//-----------------------------------------------------------------------------
-
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-
-
- //-----------------------------------------------------------------------------
- // class TemplateName
- //-----------------------------------------------------------------------------
- struct TemplateName
- {
- //-----------------------------------------------------------------
- rtl::OUString aName, aModule;
-
- //-----------------------------------------------------------------
- TemplateName()
- : aName()
- , aModule()
- {}
-
- TemplateName(rtl::OUString const& aName_)
- : aName(aName_)
- , aModule()
- {}
-
- TemplateName(rtl::OUString const& aName_, rtl::OUString const& aModule_)
- : aName(aName_)
- , aModule(aModule_)
- {}
-
- //-----------------------------------------------------------------
-
- /// compose the path where the template is located
- rtl::OUString makePathString() const
- {
- rtl::OUStringBuffer aBuffer;
-
- if (aModule.getLength() != 0)
- aBuffer.append( this->aModule ).append(sal_Unicode('/'));
-
- aBuffer.append( this->aName );
-
- return aBuffer.makeStringAndClear();
- }
- //-----------------------------------------------------------------
- bool isEmpty() const
- {
- return aName.getLength() == 0;
- }
-
- bool isSimpleTypeName() const;
-
- com::sun::star::uno::Type resolveToSimpleType() const;
- //-----------------------------------------------------------------
-
- bool operator<(TemplateName const& aOther) const
- {
- return (aModule == aOther.aModule) ? (aName < aOther.aName) : (aModule < aOther.aModule);
- }
-
- //-----------------------------------------------------------------
- static com::sun::star::uno::Type resolveSimpleTypeName(rtl::OUString const& aName);
- //-----------------------------------------------------------------
-#if OSL_DEBUG_LEVEL > 0
- static rtl::OUString makeNativeTypeModuleName();
- //-----------------------------------------------------------------
- static rtl::OUString makeLocalizedTypeModuleName();
-#endif
- //-----------------------------------------------------------------
- };
- //-------------------------------------------------------------------------
-
- //---------------------------------------------------------------------
- // class TemplateImplHelper
- //---------------------------------------------------------------------
-
- class TemplateImplHelper
- {
- public:
- //-----------------------------------------------------------------
-
- static com::sun::star::uno::Type getNoTypeAvailable()
- {
- return getVoidCppuType();
- }
- //-----------------------------------------------------------------
-
- static void assignActualType (Template& aTemplate,com::sun::star::uno::Type const& aType);
- //-----------------------------------------------------------------
-
- static rtl::Reference<Template> makeElementTemplateWithType(TemplateName const& aNames, TemplateProvider const& _aProvider, sharable::SetNode * set);
- //-----------------------------------------------------------------
-
- static rtl::Reference<Template> createNew (TemplateName const& aNames,com::sun::star::uno::Type const& aType);
- //-----------------------------------------------------------------
- };
- //-------------------------------------------------------------------------
-
- typedef std::map< TemplateName, rtl::Reference<Template> > TemplateRepository;
- //-------------------------------------------------------------------------
-
- //---------------------------------------------------------------------
- // class TemplateProvider_Impl
- //---------------------------------------------------------------------
-
- struct TemplateProvider_Impl : salhelper::SimpleReferenceObject
- {
- TemplateProvider_Impl(rtl::Reference< TreeManager > const & xProvider, RequestOptions const& aOptions);
-
- rtl::Reference< data::TreeSegment > instantiate(rtl::Reference<Template> const& aTemplate);
-
- rtl::Reference<Template> makeElementTemplateWithType(TemplateName const& _aNames, sharable::SetNode * set);
- private:
- rtl::Reference< TreeManager > m_xProvider;
- RequestOptions m_aOptions;
-
- TemplateRepository m_aRepository;
- };
-
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_TEMPLATEIMPL_HXX_
diff --git a/configmgr/source/treemgr/treeimpl.cxx b/configmgr/source/treemgr/treeimpl.cxx
deleted file mode 100644
index 22dbd63eb7..0000000000
--- a/configmgr/source/treemgr/treeimpl.cxx
+++ /dev/null
@@ -1,1370 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-#include "anynoderef.hxx"
-#include "builddata.hxx"
-#include "configset.hxx"
-#include "tracer.hxx"
-#include "tree.hxx"
-#include "roottreeimpl.hxx"
-#include "nodeimpl.hxx"
-#include "nodechange.hxx"
-#include "nodechangeimpl.hxx"
-#include "noderef.hxx"
-#include "template.hxx"
-#include "nodevisitor.hxx"
-#include "valueref.hxx"
-#include "valuenode.hxx"
-#include "change.hxx"
-#include "valuenodeimpl.hxx"
-#include "setnodeimpl.hxx"
-#include "groupnodeimpl.hxx"
-#include "viewaccess.hxx"
-#include "viewfactory.hxx"
-#include "nodefactory.hxx"
-#include <osl/diagnose.h>
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-// class TreeImplBuilder - friend of Tree
-//-----------------------------------------------------------------------------
-
-/** is a visitor-style algorithm to construct a <type>Tree::NodeList</type>
- representing a configuration hierarchy
-*/
-class TreeImplBuilder : public data::NodeVisitor
-{
-public:
- /** constructs a TreeImplBuilder to append onto <var>rList</var>
- the products of <var>rFactory</var> up to depth <var>nDepth</var>
- */
- TreeImplBuilder(
- TemplateProvider const& aTemplateProvider,
- rtl::Reference<view::ViewStrategy> const& _xStrategy,
- Tree& rTree
- )
- : m_xStrategy(_xStrategy)
- , m_aTemplateProvider(aTemplateProvider)
- , m_rFactory(_xStrategy->getNodeFactory())
- , m_rTree(rTree)
- , m_nParent(0)
- , m_nDepthLeft(rTree.m_nDepth)
- {
- OSL_ASSERT(m_rTree.m_aNodes.empty());
- OSL_DEBUG_ONLY(m_bMemberCheck = false);
- m_rTree.m_xStrategy = _xStrategy;
- }
-
-private:
- using NodeVisitor::handle;
-
- virtual bool handle(sharable::ValueNode * node);
-
- virtual bool handle(sharable::GroupNode * node);
-
- virtual bool handle(sharable::SetNode * node);
-
- /// add a Node for group node <var>_aGroup</var> to the list
- void addGroup(sharable::GroupNode * group);
- /// add a Node for set node <var>_aSet</var> to the list
- void addSet(sharable::SetNode * set);
- /// add a Node for value node <var>rValue</var> to the list
- void addValueElement(sharable::ValueNode * value);
- /// add a Member for value node <var>rValue</var> to the list
- void addValueMember(sharable::ValueNode * value);
-
- rtl::Reference<view::ViewStrategy> m_xStrategy;
- TemplateProvider m_aTemplateProvider;
- view::NodeFactory& m_rFactory;
- Tree& m_rTree;
- unsigned int m_nParent;
- unsigned int m_nDepthLeft;
-#if OSL_DEBUG_LEVEL > 0
- bool m_bMemberCheck;
-#endif
-};
-//-----------------------------------------------------------------------------
-
-bool TreeImplBuilder::handle(sharable::ValueNode * node)
-{
- if (m_nParent == 0)
- addValueElement(node); // if it is the root it is a value set element
- else
- addValueMember(node); // if it is not the root it is a group member
-
- return false;
-}
-//-----------------------------------------------------------------------------
-
-bool TreeImplBuilder::handle(sharable::GroupNode * node)
-{
- addGroup(node);
- return false;
-}
-//-----------------------------------------------------------------------------
-
-bool TreeImplBuilder::handle(sharable::SetNode * node)
-{
- addSet(node);
- return false;
-}
-//-----------------------------------------------------------------------------
-
-void TreeImplBuilder::addValueElement(sharable::ValueNode * value)
-{
- rtl::Reference<NodeImpl> aValueNode( m_rFactory.makeValueNode(value) );
- OSL_ENSURE( aValueNode.is(), "could not make value node wrapper" );
-
- OSL_ENSURE( m_nParent == 0, "Adding value element that is not root of its fragment" );
- // TODO:!isValid() => maybe substitute a SimpleValueNodeImpl if possible
- if( aValueNode.is() )
- {
- m_rTree.m_aNodes.push_back( NodeData(aValueNode, value->info.getName(), m_nParent) );
- }
-}
-//-----------------------------------------------------------------------------
-
-void TreeImplBuilder::addValueMember(sharable::ValueNode *)
-{
- // nothing to do
- OSL_DEBUG_ONLY(m_bMemberCheck = true);
-}
-//-----------------------------------------------------------------------------
-
-void TreeImplBuilder::addGroup(sharable::GroupNode * group)
-{
- rtl::Reference<NodeImpl> aGroupNode( m_rFactory.makeGroupNode(group) );
- OSL_ENSURE( aGroupNode.is(), "could not make group node wrapper" );
-
- // TODO:!isValid() => maybe substitute a SimpleValueNodeImpl if possible
- if( aGroupNode.is() )
- {
- m_rTree.m_aNodes.push_back( NodeData(aGroupNode,group->info.getName(),m_nParent) );
-
- // now fill in group members
- if (m_nDepthLeft > 0)
- {
- unsigned int nSaveParent = m_nParent;
- decDepth(m_nDepthLeft);
-
- m_nParent = m_rTree.m_aNodes.size() + Tree::ROOT - 1;
-
- #if OSL_DEBUG_LEVEL > 0
- bool bSaveMemberCheck = m_bMemberCheck;
- m_bMemberCheck = false;
- #endif
-
- // now recurse:
- this->visitChildren(group);
-
- OSL_ENSURE(m_nParent < m_rTree.m_aNodes.size() || m_bMemberCheck,
- "WARNING: Configuration: Group within requested depth has no members");
-
- OSL_DEBUG_ONLY(m_bMemberCheck = bSaveMemberCheck);
-
- incDepth(m_nDepthLeft);
- m_nParent = nSaveParent;
- }
- }
-}
-//-----------------------------------------------------------------------------
-
-void TreeImplBuilder::addSet(sharable::SetNode * set)
-{
- rtl::Reference<Template> aTemplate = makeSetElementTemplate(set, m_aTemplateProvider);
- OSL_ASSERT(aTemplate.is());
- OSL_ENSURE(aTemplate->isInstanceTypeKnown(),"ERROR: Cannor create set instance without knowing the instance type");
-
- rtl::Reference<NodeImpl> aSetNode( m_rFactory.makeSetNode(set, aTemplate.get()) );
- OSL_ENSURE( aSetNode.is(), "could not make set node wrapper" );
-
- // TODO:!isValid() => maybe substitute a SimpleValueNodeImpl if possible
- if( aSetNode.is() )
- {
- m_rTree.m_aNodes.push_back( NodeData(aSetNode, set->info.getName(), m_nParent) );
-
- // this also relies on one based offsets
- unsigned int nNodeAdded = m_rTree.m_aNodes.size() + Tree::ROOT - 1;
-
- OSL_ASSERT(&m_rTree.m_aNodes.back().nodeImpl() == aSetNode.get());
- static_cast<SetNodeImpl&>(*aSetNode).initElements(m_aTemplateProvider, m_rTree, nNodeAdded, m_nDepthLeft);
- }
-}
-
-namespace {
- class FindNonDefaultElement: public SetNodeVisitor {
- public:
- static bool hasNonDefaultElement(
- view::ViewTreeAccess const & view, view::SetNode const & set)
- {
- FindNonDefaultElement visitor;
- return view.dispatchToElements(set, visitor) == DONE;
- }
-
- protected:
- virtual Result visit(SetEntry const & entry) {
- OSL_ASSERT(entry.isValid());
- rtl::Reference< Tree > tree(entry.tree());
- OSL_ASSERT(tree.is());
- node::Attributes atts(tree->getAttributes(tree->getRootNode()));
- // A set element is considered default iff it is not replaced/added:
- bool dflt = !atts.isReplacedForUser();
- return dflt ? CONTINUE : DONE;
- }
- };
-
- class SetVisitorAdapter: public SetNodeVisitor {
- public:
- explicit SetVisitorAdapter(NodeVisitor & visitor): m_visitor(visitor) {}
-
- protected:
- virtual Result visit(SetEntry const & entry) {
- OSL_ASSERT(entry.isValid());
- rtl::Reference< Tree > tree(entry.tree());
- if (tree.is()) {
- OSL_ASSERT(
- Result(NodeVisitor::DONE) == SetNodeVisitor::DONE &&
- Result(NodeVisitor::CONTINUE) == SetNodeVisitor::CONTINUE);
- return Result(tree->visit(tree->getRootNode(), m_visitor));
- } else {
- return CONTINUE;
- }
- }
-
- private:
- NodeVisitor & m_visitor;
- };
-
- class GroupVisitorAdapter: public GroupMemberVisitor {
- public:
- GroupVisitorAdapter(
- rtl::Reference< Tree > const & parentTree,
- NodeRef const & parentNode, NodeVisitor & visitor):
- m_parentTree(parentTree), m_parentPos(parentNode.getOffset()),
- m_visitor(visitor)
- {
- OSL_ASSERT(
- !isEmpty(parentTree.get()) && parentNode.isValid() &&
- parentTree->isValidNode(parentNode.getOffset()));
- }
-
- protected:
- virtual Result visit(ValueMemberNode const & value) {
- OSL_ASSERT(
- value.isValid() &&
- Result(NodeVisitor::DONE) == GroupMemberVisitor::DONE &&
- Result(NodeVisitor::CONTINUE) == GroupMemberVisitor::CONTINUE);
- return Result(
- m_parentTree->visit(
- ValueRef(value.getNodeName(), m_parentPos), m_visitor));
- }
-
- private:
- rtl::Reference< Tree > m_parentTree;
- unsigned int m_parentPos;
- NodeVisitor & m_visitor;
- };
-}
-
-//-----------------------------------------------------------------------------
-// class NodeData
-//-----------------------------------------------------------------------------
-
-NodeData::NodeData(rtl::Reference<NodeImpl> const& aSpecificNode, rtl::OUString const& aName, unsigned int nParent)
-: m_pSpecificNode(aSpecificNode)
-, m_aName_(aName)
-, m_nParent(nParent)
-{
-}
-
-//-----------------------------------------------------------------------------
-
-void NodeData::rebuild(rtl::Reference<view::ViewStrategy> const & _xNewStrategy, sharable::Node * newData)
-{
- rtl::Reference<NodeImpl> aNewImpl;
- if (this->isSetNode())
- {
- sharable::SetNode * newSet = newData == 0 ? 0 : newData->setData();
- aNewImpl = _xNewStrategy->getNodeFactory().makeSetNode(newSet, 0);
-
- SetNodeImpl & rOldSetData = this->setImpl();
- SetNodeImpl & rNewSetData = static_cast<SetNodeImpl &>(*aNewImpl);
-
- rNewSetData.rebuildFrom(rOldSetData, newSet);
- }
- else if (this->isGroupNode())
- aNewImpl = _xNewStrategy->getNodeFactory().makeGroupNode(newData == 0 ? 0 : newData->groupData());
-
- else if (this->isValueElementNode())
- aNewImpl = _xNewStrategy->getNodeFactory().makeValueNode(newData == 0 ? 0 : newData->valueData());
-
- m_pSpecificNode = aNewImpl;
-}
-
-//-----------------------------------------------------------------------------
-
-bool NodeData::isSetNode() const
-{
- sharable::Node * node = getOriginalNodeAccess();
- return node != 0 && node->isSet();
-}
-//-----------------------------------------------------------------------------
-
-bool NodeData::isValueElementNode() const
-{
- sharable::Node * node = getOriginalNodeAccess();
- return node != 0 && node->isValue();
-}
-//-----------------------------------------------------------------------------
-
-bool NodeData::isGroupNode() const
-{
- sharable::Node * node = getOriginalNodeAccess();
- return node != 0 && node->isGroup();
-}
-//-----------------------------------------------------------------------------
-
-SetNodeImpl& NodeData::implGetSetImpl() const
-{
- OSL_ASSERT(m_pSpecificNode != 0);
- OSL_ASSERT(isSetNode());
-
- if (!isSetNode())
- throw Exception( "INTERNAL ERROR: Node is not a set node. Cast failing." );
-
- return static_cast<SetNodeImpl&>(*m_pSpecificNode);
-}
-//---------------------------------------------------------------------
-
-GroupNodeImpl& NodeData::implGetGroupImpl() const
-{
- OSL_ASSERT(m_pSpecificNode != 0);
- OSL_ASSERT(isGroupNode());
-
- if (!isGroupNode())
- throw Exception( "INTERNAL ERROR: Node is not a group node. Cast failing." );
-
- return static_cast<GroupNodeImpl&>(*m_pSpecificNode);
-}
-//---------------------------------------------------------------------
-
-ValueElementNodeImpl& NodeData::implGetValueImpl() const
-{
- OSL_ASSERT(m_pSpecificNode != 0);
- OSL_ASSERT(isValueElementNode());
-
- if (!isValueElementNode())
- throw Exception( "INTERNAL ERROR: Node is not a value node. Cast failing." );
-
- return static_cast<ValueElementNodeImpl&>(*m_pSpecificNode);
-}
-
-sharable::Node * NodeData::getOriginalNodeAccess() const
-{
- return m_pSpecificNode->getOriginalNodeAccess();
-}
-
-NodeImpl & NodeData::implGetNodeImpl() const
-{
- OSL_ASSERT(m_pSpecificNode != 0);
- return *m_pSpecificNode;
-}
-
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// class Tree
-//-----------------------------------------------------------------------------
-
-/// creates a Tree for a detached, virgin instance of <var>aTemplate</var>
-Tree::Tree( )
-: m_aNodes()
-, m_pParentTree(0)
-, m_nParentNode(0)
-, m_nDepth(0)
-{
-}
-//-----------------------------------------------------------------------------
-
-Tree::Tree( Tree& rParentTree, unsigned int nParentNode )
-: m_aNodes()
-, m_pParentTree(&rParentTree)
-, m_nParentNode(nParentNode)
-, m_nDepth(0)
-{
-}
-//-----------------------------------------------------------------------------
-
-Tree::~Tree()
-{
-}
-//-----------------------------------------------------------------------------
-
-void Tree::disposeData()
-{
- m_aNodes.clear();
-}
-
-bool Tree::isRootNode(NodeRef const & node) const {
- OSL_ASSERT(
- nodeCount() != 0 && (!node.isValid() || isValidNode(node.getOffset())));
- return node.isValid() && node.getOffset() == ROOT;
-}
-
-NodeRef Tree::getRootNode() const {
- OSL_ASSERT(nodeCount() != 0);
- return NodeRef(ROOT, m_nDepth);
-}
-
-NodeRef Tree::getContextNodeRef() const {
- OSL_ASSERT(nodeCount() != 0 && (m_pParentTree == 0 || m_nParentNode != 0));
- return m_pParentTree == 0
- ? NodeRef() : m_pParentTree->getNode(m_nParentNode);
-}
-
-bool Tree::isValidValueNode(ValueRef const & value) {
- OSL_ASSERT(nodeCount() != 0);
- if (!(value.isValid() &&
- value.checkValidState() &&
- isValidNode(value.m_nParentPos) &&
- view::ViewTreeAccess(this).isGroupNodeAt(value.m_nParentPos) &&
- getMemberNode(value).isValid()))
- {
- return false;
- }
- OSL_ASSERT(value.m_sNodeName.getLength() != 0); // old value handling?
- return true;
-}
-
-#if OSL_DEBUG_LEVEL > 0
-bool Tree::isValidAnyNode(AnyNodeRef const & node) {
- OSL_ASSERT(nodeCount() != 0);
- return node.isValid() && isValidNode(node.m_nUsedPos) &&
- (node.isNode() ||
- (view::ViewTreeAccess(this).isGroupNodeAt(node.m_nUsedPos) &&
- getMemberNode(node.toValue()).isValid()));
-}
-#endif
-
-bool Tree::hasElements(NodeRef const & node) {
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- if (node.getDepth() == 0) {
- CFG_TRACE_WARNING(
- "configuration: Querying node beyond available depth" );
- }
- view::ViewTreeAccess v(this);
- return v.isSetNode(node) && !v.isEmpty(v.toSetNode(node));
-}
-
-bool Tree::hasElement(NodeRef const & node, rtl::OUString const & name) {
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- if (node.getDepth() == 0) {
- CFG_TRACE_WARNING(
- "configuration: Querying node beyond available depth");
- }
- view::ViewTreeAccess v(this);
- return v.isSetNode(node) &&
- v.findElement(v.toSetNode(node), name).isValid();
-}
-
-bool Tree::hasElement(NodeRef const & node, Path::Component const & name) {
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- if (node.getDepth() == 0) {
- CFG_TRACE_WARNING(
- "configuration: Querying node beyond available depth");
- }
- view::ViewTreeAccess v(this);
- if (v.isSetNode(node)) {
- SetEntry e(v.findElement(v.toSetNode(node), name.getName()));
- // Check if types match:
- return e.isValid() &&
- Path::matches(e.tree()->getExtendedRootName(), name);
- } else {
- return false;
- }
-}
-
-rtl::Reference< ElementTree > Tree::getElement(NodeRef const & node, rtl::OUString const & name) {
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- if (node.getDepth() == 0) {
- CFG_TRACE_WARNING(
- "configuration: Querying node beyond available depth");
- }
- view::ViewTreeAccess v(this);
- if (v.isSetNode(node)) {
- SetEntry e(v.findElement(v.toSetNode(node), name));
- return rtl::Reference< ElementTree >(e.tree());
- } else {
- return rtl::Reference< ElementTree >();
- }
-}
-
-rtl::Reference< ElementTree > Tree::getAvailableElement(
- NodeRef const & node, rtl::OUString const & name)
-{
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- view::ViewTreeAccess v(this);
- if (v.isSetNode(node)) {
- SetEntry e(v.findAvailableElement(v.toSetNode(node), name));
- return rtl::Reference< ElementTree >(e.tree());
- } else {
- return rtl::Reference< ElementTree >();
- }
-}
-
-bool Tree::hasChildren(NodeRef const & node) {
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- if (node.getDepth() == 0) {
- CFG_TRACE_WARNING(
- "configuration: Querying node beyond available depth");
- }
- view::ViewTreeAccess v(this);
- if (v.isGroupNode(node)) {
- view::GroupNode g(v.toGroupNode(node));
- return v.hasValue(g) || g.getFirstChild().is();
- } else {
- return false;
- }
-}
-
-bool Tree::hasChildValue(NodeRef const & node, rtl::OUString const & name) {
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- if (node.getDepth() == 0) {
- CFG_TRACE_WARNING(
- "configuration: Querying node beyond available depth");
- }
- view::ViewTreeAccess v(this);
- return v.isGroupNode(node) && v.hasValue(v.toGroupNode(node), name);
-}
-
-bool Tree::hasChildNode(NodeRef const & node, rtl::OUString const & name) {
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- if (node.getDepth() == 0) {
- CFG_TRACE_WARNING(
- "configuration: Querying node beyond available depth");
- }
- view::ViewTreeAccess v(this);
- return v.isGroupNode(node) && v.toGroupNode(node).findChild(name).is();
-}
-
-bool Tree::hasChild(NodeRef const & node, rtl::OUString const & name) {
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- if (node.getDepth() == 0) {
- CFG_TRACE_WARNING(
- "configuration: Querying node beyond available depth");
- }
- view::ViewTreeAccess v(this);
- if (v.isGroupNode(node)) {
- view::GroupNode g(v.toGroupNode(node));
- return v.hasValue(g, name) || g.findChild(name).is();
- } else {
- return false;
- }
-}
-
-ValueRef Tree::getChildValue(NodeRef const & node, rtl::OUString const & name) {
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- if (node.getDepth() == 0) {
- CFG_TRACE_WARNING(
- "configuration: Querying node beyond available depth");
- }
- view::ViewTreeAccess v(this);
- return v.isGroupNode(node) && v.hasValue(v.toGroupNode(node), name)
- ? ValueRef(name, node.getOffset()) : ValueRef();
-}
-
-NodeRef Tree::getChildNode(NodeRef const & node, rtl::OUString const & name)
-{
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- if (node.getDepth() == 0) {
- CFG_TRACE_WARNING(
- "configuration: Querying node beyond available depth");
- }
- view::ViewTreeAccess v(this);
- return NodeRef(
- (v.isGroupNode(node)
- ? v.toGroupNode(node).findChild(name).get_offset() : 0),
- childDepth(node.getDepth()));
-}
-
-AnyNodeRef Tree::getAnyChild(NodeRef const & node, rtl::OUString const & name) {
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- if (node.getDepth() == 0) {
- CFG_TRACE_WARNING(
- "configuration: Querying node beyond available depth");
- }
- view::ViewTreeAccess v(this);
- unsigned int n = 0;
- if (v.isGroupNode(node)) {
- if (v.hasValue(v.toGroupNode(node), name)) {
- return AnyNodeRef(name, node.getOffset());
- }
- n = v.toGroupNode(node).findChild(name).get_offset();
- }
- return AnyNodeRef(n, childDepth(node.getDepth()));
-}
-
-node::Attributes Tree::getAttributes(NodeRef const & node) {
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- return view::ViewTreeAccess(this).getAttributes(node);
-}
-
-node::Attributes Tree::getAttributes(AnyNodeRef const & node) {
- OSL_ASSERT(nodeCount() != 0 && isValidAnyNode(node));
- if (node.isNode()) {
- return view::ViewTreeAccess(this).getAttributes(node.toNode());
- } else {
- return getMemberNode(node.toValue()).getAttributes();
- }
-}
-
-node::Attributes Tree::getAttributes(ValueRef const & value) {
- OSL_ASSERT(nodeCount() != 0 && isValidValueNode(value));
- return getMemberNode(value).getAttributes();
-}
-
-com::sun::star::uno::Type Tree::getUnoType(ValueRef const & value) {
- OSL_ASSERT(nodeCount() != 0 && isValidValueNode(value));
- return getMemberNode(value).getValueType();
-}
-
-NodeRef Tree::getParent(NodeRef const & node) {
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- view::ViewTreeAccess v(this);
- OSL_ASSERT(!v.makeNode(getRootNode()).getParent().is());
- view::Node p(v.makeNode(node).getParent());
- OSL_ASSERT(isValidNode(p.get_offset()));
- return NodeRef(p.get_offset(), parentDepth(node.getDepth()));
-}
-
-NodeRef Tree::getParent(ValueRef const & value) {
- OSL_ASSERT(nodeCount() != 0 && isValidValueNode(value));
- unsigned int n = value.m_nParentPos;
- OSL_ASSERT(n == 0 || value.m_sNodeName.getLength() != 0);
- return getNode(n);
-}
-
-AbsolutePath Tree::getAbsolutePath(NodeRef const & node) {
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- Path::Rep r;
- prependLocalPathTo(node.getOffset(), r);
- r.prepend(getRootPath().rep());
- return AbsolutePath(r);
-}
-
-com::sun::star::uno::Any Tree::getNodeValue(ValueRef const & value) {
- OSL_ASSERT(isValidValueNode(value));
- return getMemberNode(value).getValue();
-}
-
-bool Tree::hasNodeDefault(ValueRef const & value) {
- OSL_ASSERT(nodeCount() != 0 && isValidValueNode(value));
- return getMemberNode(value).canGetDefaultValue();
-}
-
-bool Tree::isNodeDefault(ValueRef const & value) {
- OSL_ASSERT(nodeCount() != 0 && isValidValueNode(value));
- return hasNodeDefault(value) && getMemberNode(value).isDefault();
-}
-
-bool Tree::hasNodeDefault(NodeRef const & node) {
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- // Not a set, then it has no default:
- return view::ViewTreeAccess(this).isSetNode(node);
-}
-
-bool Tree::isNodeDefault(NodeRef const & node) {
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- if (!hasNodeDefault(node)) {
- return false;
- }
- view::ViewTreeAccess v(this);
- OSL_ASSERT(v.isSetNode(node)); // not a set, then it has no default
- // A set is default if all its elements are default:
- return !FindNonDefaultElement::hasNonDefaultElement(v, v.toSetNode(node));
-}
-
-bool Tree::hasNodeDefault(AnyNodeRef const & node) {
- OSL_ASSERT(nodeCount() != 0 && isValidAnyNode(node));
- return node.isNode()
- ? hasNodeDefault(node.toNode()) : hasNodeDefault(node.toValue());
-}
-
-bool Tree::isNodeDefault(AnyNodeRef const & node) {
- OSL_ASSERT(nodeCount() != 0 && isValidAnyNode(node));
- return node.isNode()
- ? isNodeDefault(node.toNode()) : isNodeDefault(node.toValue());
-}
-
-bool Tree::areValueDefaultsAvailable(NodeRef const & node) {
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- view::ViewTreeAccess v(this);
- OSL_ASSERT(v.isGroupNode(node));
- return v.isGroupNode(node) &&
- v.areValueDefaultsAvailable(v.toGroupNode(node));
-}
-
-com::sun::star::uno::Any Tree::getNodeDefaultValue(ValueRef const & value) {
- OSL_ASSERT(nodeCount() != 0 && isValidValueNode(value));
- ValueMemberNode m(getMemberNode(value));
- return m.canGetDefaultValue() ?
- m.getDefaultValue() : com::sun::star::uno::Any();
-}
-
-bool Tree::hasChanges() {
- return view::ViewTreeAccess(this).hasChanges();
-}
-
-bool Tree::collectChanges(NodeChanges & changes) {
- OSL_ASSERT(nodeCount() != 0);
- view::ViewTreeAccess v(this);
- if (v.hasChanges()) {
- v.collectChanges(changes);
- return true;
- } else {
- return false;
- }
-}
-
-void Tree::integrate(NodeChange & change, NodeRef const & node, bool local)
-{
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- if (change.test().isChange()) {
- change.apply();
- if (local) {
- view::ViewTreeAccess(this).markChanged(node);
- } else {
- rtl::Reference< Tree > at(change.getAffectedTree());
- NodeRef an(change.getAffectedNode());
- OSL_ASSERT(
- !isEmpty(at.get()) && an.isValid() &&
- at->isValidNode(an.getOffset()));
- view::ViewTreeAccess(at.get()).markChanged(an);
- OSL_ASSERT(view::ViewTreeAccess(this).hasChanges());
- }
- }
-}
-
-void Tree::integrate(NodeChanges& changes, NodeRef const & node, bool local)
-{
- for (std::vector< NodeChange >::iterator it(changes.begin());
- it != changes.end(); ++it)
- {
- integrate(*it, node, local);
- }
-}
-
-NodeVisitor::Result Tree::dispatchToChildren(
- NodeRef const & node, NodeVisitor & visitor)
-{
- OSL_ASSERT(
- nodeCount() != 0 && node.isValid() && isValidNode(node.getOffset()));
- if (node.getDepth() == 0) {
- CFG_TRACE_WARNING(
- "configuration: Querying node beyond available depth");
- }
- view::ViewTreeAccess v(this);
- if (v.isGroupNode(node)) {
- view::GroupNode const p(v.toGroupNode(node));
- OSL_ASSERT(
- (NodeVisitor::Result(GroupMemberVisitor::DONE) ==
- NodeVisitor::DONE) &&
- (NodeVisitor::Result(GroupMemberVisitor::CONTINUE) ==
- NodeVisitor::CONTINUE));
- GroupVisitorAdapter adapter(this, node, visitor);
- NodeVisitor::Result ret = NodeVisitor::Result(
- v.dispatchToValues(p, adapter));
- unsigned int n = childDepth(node.getDepth());
- for (view::Node c(p.getFirstChild());
- c.is() && ret != NodeVisitor::DONE; c = p.getNextChild(c))
- {
- ret = visit(NodeRef(c.get_offset(), n), visitor);
- }
- return ret;
- } else if (v.isSetNode(node)) {
- OSL_ASSERT(
- NodeVisitor::Result(SetNodeVisitor::DONE) == NodeVisitor::DONE &&
- (NodeVisitor::Result(SetNodeVisitor::CONTINUE) ==
- NodeVisitor::CONTINUE));
- SetVisitorAdapter adapter(visitor);
- return NodeVisitor::Result(
- v.dispatchToElements(v.toSetNode(node), adapter));
- } else {
- OSL_TRACE("configuration: Trying to iterate a value node");
- return NodeVisitor::CONTINUE;
- }
-}
-
-NodeRef Tree::getNode(unsigned int offset) const {
- if (offset == 0) {
- return NodeRef();
- } else {
- OSL_ASSERT(isValidNode(offset));
- return NodeRef(
- offset, remainingDepth(getAvailableDepth(), depthTo(offset)));
- }
-}
-
-rtl::Reference< Template > Tree::extractElementInfo(NodeRef const & node) {
- OSL_ASSERT(node.isValid() && isValidNode(node.getOffset()));
- view::ViewTreeAccess v(this);
- OSL_ASSERT(v.isSetNode(node));
- return v.getElementTemplate(v.toSetNode(node));
-}
-
-//-----------------------------------------------------------------------------
-void Tree::rebuild(rtl::Reference<view::ViewStrategy> const & _xNewStrategy, sharable::Node * newData)
-{
- m_xStrategy = _xNewStrategy;
- this->implRebuild(ROOT, newData);
-}
-
-//-----------------------------------------------------------------------------
-void Tree::implRebuild(unsigned int nNode, sharable::Node * newData)
-{
- NodeData * pNode = nodeData(nNode);
- if (pNode->isGroupNode())
- {
- // first rebuild the children
- OSL_ASSERT(newData != 0 && newData->isGroup());
- sharable::GroupNode * newGroup = &newData->group;
-
- for (unsigned int nChild = firstChild_(nNode); isValidNode(nChild); nChild = findNextChild_(nNode,nChild))
- {
- sharable::Node * childAccess = newGroup->getChild(implGetOriginalName(nChild));
- OSL_ASSERT(childAccess != 0);
- implRebuild(nChild, childAccess);
- }
- }
-
- pNode->rebuild(m_xStrategy, newData);
-}
-
-//-----------------------------------------------------------------------------
-
-void ElementTree::doFinishRootPath(Path::Rep& rPath) const
-{
- rPath.prepend( doGetRootName() );
- rPath.prepend( AbsolutePath::detachedRoot().rep() );
-}
-//-----------------------------------------------------------------------------
-
-void RootTree::doFinishRootPath(Path::Rep& rPath) const
-{
- rPath.prepend( m_aRootPath.rep() );
-}
-
-//-----------------------------------------------------------------------------
-
-void Tree::implPrependRootPath(Path::Rep& rPath) const
-{
- if (m_pParentTree)
- {
- rPath.prepend( doGetRootName() );
- OSL_ASSERT(m_nParentNode);
- m_pParentTree->prependLocalPathTo(m_nParentNode,rPath);
- m_pParentTree->implPrependRootPath(rPath);
- }
- else
- {
- doFinishRootPath( rPath );
- }
-}
-//-----------------------------------------------------------------------------
-
-AbsolutePath Tree::getRootPath() const
-{
- Path::Rep aPath;
- implPrependRootPath(aPath);
- return AbsolutePath(aPath);
-}
-//-----------------------------------------------------------------------------
-void Tree::build(rtl::Reference<view::ViewStrategy> const& _xStrategy, sharable::Node * rootNode, unsigned int nDepth, TemplateProvider const& aTemplateProvider)
-{
- OSL_ASSERT(m_aNodes.empty());
- m_nDepth = nDepth;
- TreeImplBuilder a(aTemplateProvider, _xStrategy,*this);
- a.visitNode(rootNode);
-}
-//-----------------------------------------------------------------------------
-
-rtl::Reference< view::ViewStrategy > Tree::getViewBehavior() const
-{
- return m_xStrategy;
-}
-
-// context handling
-//-----------------------------------------------------------------------------
-
-void Tree::setContext(Tree* pParentTree, unsigned int nParentNode)
-{
- OSL_ENSURE(pParentTree,"ERROR: Moving tree to nowhere");
-
- if (pParentTree)
- {
- OSL_ENSURE( pParentTree->isValidNode(nParentNode),"ERROR: Moving tree to invalid node");
- if (!pParentTree->isValidNode(nParentNode))
- throw Exception("INTERNAL ERROR: Moving tree to invalid parent node");
-
- // OSL_ENSURE( pParentTree->isSetNodeAt(nParentNode),"WARNING: Moving tree to node that is not a set");
- }
- else
- {
- OSL_ENSURE( nParentNode == 0,"WARNING: Moving tree to node without a tree");
- nParentNode = 0;
- }
-
- m_pParentTree = pParentTree;
- m_nParentNode = nParentNode;
-}
-//-----------------------------------------------------------------------------
-
-void Tree::clearContext()
-{
- m_pParentTree = 0;
- m_nParentNode = 0;
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// Node Collection navigation
-//-----------------------------------------------------------------------------
-
-unsigned int Tree::parent_(unsigned int nNode) const
-{
- OSL_ASSERT(isValidNode(nNode));
- return nodeData(nNode)->getParent();
-}
-//-----------------------------------------------------------------------------
-inline // is protected and should be used only here
-rtl::OUString Tree::implGetOriginalName(unsigned int nNode) const
-{
- OSL_ASSERT(isValidNode(nNode));
-
- return nodeData(nNode)->getName();
-}
-//-----------------------------------------------------------------------------
-
-Path::Component ElementTree::doGetRootName() const
-{
- return makeExtendedName( m_aElementName );
-}
-
-//-----------------------------------------------------------------------------
-
-rtl::OUString ElementTree::getSimpleRootName() const
-{
- // Tree::getSimpleRootName tends to parse &
- // then split the same name, burning CPU L&R
- return m_aElementName;
-}
-
-//-----------------------------------------------------------------------------
-
-Path::Component RootTree::doGetRootName() const
-{
- return m_aRootPath.getLocalName();
-}
-//-----------------------------------------------------------------------------
-
-
-rtl::OUString Tree::getSimpleNodeName(unsigned int nNode) const
-{
- if (nNode == ROOT) return getSimpleRootName();
-
- return implGetOriginalName(nNode);
-}
-//-----------------------------------------------------------------------------
-
-rtl::OUString Tree::getSimpleRootName() const
-{
- return doGetRootName().getName();
-}
-
-//-----------------------------------------------------------------------------
-
-Path::Component Tree::getExtendedRootName() const
-{
- return doGetRootName();
-}
-//-----------------------------------------------------------------------------
-
-unsigned int Tree::depthTo(unsigned int nNode) const
-{
- OSL_ASSERT(isValidNode(nNode));
-
- unsigned int nDepth = 0;
- while( 0 != (nNode=parent_(nNode)) )
- {
- ++nDepth;
- }
-
- return nDepth;
-}
-//-----------------------------------------------------------------------------
-
-void Tree::prependLocalPathTo(unsigned int nNode, Path::Rep& rNames)
-{
- OSL_ASSERT(isValidNode(nNode));
-
- for (; nNode != ROOT; nNode = parent_(nNode) )
- {
- OSL_ENSURE( isValidNode(nNode), "ERROR: Configuration: node has invalid parent");
- rNames.prepend( Path::wrapSimpleName( implGetOriginalName(nNode) ) );
- }
-
- OSL_ASSERT(nNode == ROOT);
-}
-//-----------------------------------------------------------------------------
-
-// Node iteration and access
-unsigned int Tree::firstChild_ (unsigned int nParent) const
-{
- return findNextChild_(nParent,nParent);
-}
-//-----------------------------------------------------------------------------
-
-unsigned int Tree::findNextChild_(unsigned int nParent, unsigned int nStartAfter) const
-{
- OSL_ASSERT(isValidNode(nParent));
- OSL_ASSERT(nStartAfter == 0 || isValidNode(nStartAfter));
-
- unsigned int nPos = nStartAfter ? nStartAfter : ROOT - 1;
- unsigned int const nAfterLast = nodeCount() + ROOT;
- while (++nPos < nAfterLast)
- {
- if(parent_(nPos) == nParent) return nPos;
- }
- return 0;
-}
-//-----------------------------------------------------------------------------
-
-unsigned int Tree::findChild_(unsigned int nParent, rtl::OUString const& aName) const
-{
- OSL_ASSERT(isValidNode(nParent));
-
- unsigned int nPos = nParent;
- unsigned int const nAfterLast = nodeCount() + ROOT;
- while (++nPos < nAfterLast)
- {
- if(parent_(nPos) == nParent && implGetOriginalName(nPos) == aName)
- return nPos;
- }
- return 0;
-}
-
-ValueMemberNode Tree::getMemberNode(ValueRef const & value) {
- OSL_ASSERT(nodeCount() != 0);
- view::ViewTreeAccess v(this);
- return v.getValue(v.getGroupNodeAt(value.m_nParentPos), value.m_sNodeName);
-}
-
-//-----------------------------------------------------------------------------
-// class RootTree
-//-----------------------------------------------------------------------------
-
-RootTree::RootTree( rtl::Reference<view::ViewStrategy> const& _xStrategy,
- AbsolutePath const& aRootPath,
- sharable::Node * cacheNode, unsigned int nDepth,
- TemplateProvider const& aTemplateProvider)
-: Tree()
-, m_aRootPath(aRootPath)
-{
-// OSL_ENSURE( aRootPath.getLocalName().getName() == cacheNode->getName(),
-// "Constructing root node: Path does not match node name");
-
- Tree::build(_xStrategy,cacheNode,nDepth,aTemplateProvider);
-}
-
-bool isEmpty(Tree * tree)
-{
- return tree == 0 || tree->nodeCount() == 0;
-}
-
-//-----------------------------------------------------------------------------
-// class ElementTree
-//-----------------------------------------------------------------------------
-
-ElementTree::ElementTree( rtl::Reference<view::ViewStrategy> const& _xStrategy,
- sharable::TreeFragment * cacheTree, unsigned int nDepth,
- rtl::Reference<Template> aTemplateInfo,
- TemplateProvider const& aTemplateProvider )
-: Tree()
-, m_aInstanceInfo(aTemplateInfo)
-, m_aElementName(cacheTree->getName())
-, m_aDataAddress(cacheTree)
-, m_aOwnData()
-{
- Tree::build( _xStrategy, cacheTree->getRootNode(), nDepth, aTemplateProvider );
-}
-//-----------------------------------------------------------------------------
-
-ElementTree::ElementTree( rtl::Reference<view::ViewStrategy> const& _xStrategy,
- Tree& rParentTree, unsigned int nParentNode,
- sharable::TreeFragment * cacheTree, unsigned int nDepth,
- rtl::Reference<Template> aTemplateInfo,
- TemplateProvider const& aTemplateProvider )
-: Tree( rParentTree, nParentNode )
-, m_aInstanceInfo(aTemplateInfo)
-, m_aElementName(cacheTree->getName())
-, m_aDataAddress(cacheTree)
-, m_aOwnData()
-{
- Tree::build( _xStrategy, cacheTree->getRootNode(), nDepth, aTemplateProvider );
-}
-//-----------------------------------------------------------------------------
-
-ElementTree::ElementTree( rtl::Reference< data::TreeSegment > const& pNewTree,
- rtl::Reference<Template> aTemplate,
- TemplateProvider const& aTemplateProvider )
-: Tree()
-, m_aInstanceInfo(aTemplate)
-, m_aOwnData(pNewTree)
-{
- if (!pNewTree.is())
- throw Exception("ERROR: Provider can't create Element Instance From Template");
- m_aElementName = pNewTree->fragment->getName();
- m_aDataAddress = pNewTree->fragment;
-
- Tree::build( view::createDirectAccessStrategy(m_aOwnData), m_aOwnData->fragment->nodes, c_TreeDepthAll, aTemplateProvider );
-}
-//-----------------------------------------------------------------------------
-
-ElementTree::~ElementTree()
-{
-}
-//-----------------------------------------------------------------------------
-
-bool ElementTree::isUpdatableSegment(Tree& _rTree)
-{
- Tree * pTree = &_rTree;
-
- while (ElementTree * pElement = dynamic_cast< ElementTree * >(pTree))
- {
- if (pElement->m_aOwnData.is())
- {
- OSL_ENSURE( pElement->getContextTree()==NULL ||
- pElement->getContextTree()->getViewBehavior() != pElement->getViewBehavior(),
- "ElementTree with parent in same fragment should not own its data");
- return true;
- }
-
- pTree = pElement->getContextTree();
-
- if (!pTree)
- {
- OSL_ENSURE( false, "ElementTree without own data should have a parent");
- return false;
- }
-
- }
- OSL_ENSURE( false, "Tree is not part of free-floating segment - cannot support direct update");
-
- return false;
-}
-//-----------------------------------------------------------------------------
-
-void ElementTree::disposeData()
-{
- Tree::disposeData();
- m_aOwnData.clear();
-}
-//-----------------------------------------------------------------------------
-
-Path::Component ElementTree::makeExtendedName(rtl::OUString const& _aSimpleName) const
-{
- rtl::OUString aTypeName = implGetOriginalName(ROOT);
-
- OSL_ENSURE(this->isTemplateInstance(), "ElementTree: Cannot discover the type this instantiatiates");
-
- OSL_ENSURE(! this->isTemplateInstance() || this->getTemplate()->getName() == aTypeName,
- "ElementTree: Type name does not match template");
-
- return Path::makeCompositeName(_aSimpleName, aTypeName);
-}
-//-----------------------------------------------------------------------------
-
-// ownership handling
-//-----------------------------------------------------------------------------
-void ElementTree::rebuild(rtl::Reference<view::ViewStrategy> const & _aStrategy, sharable::TreeFragment * newTree)
-{
- Tree::rebuild(_aStrategy, newTree->getRootNode());
- m_aDataAddress = newTree;
- m_aElementName = newTree->getName();
-}
-
-//-----------------------------------------------------------------------------
-/// transfer ownership to the given set
-// -----------------------------------------------------------------------------
-void ElementTree::attachTo(sharable::SetNode * owningSet, rtl::OUString const& aElementName)
-{
- OSL_ENSURE(m_aOwnData.is(), "ERROR: Cannot add a non-owned node to a subtree");
-
- if (m_aOwnData.is())
- {
- OSL_ENSURE(this->getSimpleRootName() == aElementName,"ElementTree: Attaching with unexpected element name");
- m_aOwnData->fragment->setName(aElementName);
-
- Tree* pOwningTree = this->getContextTree();
- OSL_ENSURE(pOwningTree, "Element Tree Context must be set before attaching data");
-
- if (isUpdatableSegment(*pOwningTree))
- {
- // copy over to the new segment
- sharable::TreeFragment * aNewElement = data::buildTree(m_aOwnData->fragment);
-
- owningSet->addElement(aNewElement);
-
- rtl::Reference<view::ViewStrategy> xNewBehavior = pOwningTree->getViewBehavior();
-
- this->rebuild(xNewBehavior,aNewElement);
- }
- else
- OSL_ENSURE( false, "Cannot attach directly to new tree - no update access available");
-
- m_aOwnData.clear();
- OSL_ASSERT(!m_aOwnData.is());
- }
-}
-//-----------------------------------------------------------------------------
-
-/// tranfer ownership from the given set
-void ElementTree::detachFrom(sharable::SetNode * owningSet, rtl::OUString const& aElementName)
-{
- OSL_ENSURE(!m_aOwnData.is(),"ERROR: Cannot detach a already owned node from a subtree");
- OSL_ENSURE(this->getSimpleRootName() == aElementName,"ElementTree: Detaching with unexpected element name");
-
- rtl::Reference< view::ViewStrategy > xOldStrategy = this->getViewBehavior();
- OSL_ENSURE(xOldStrategy.is(), "Element Tree Context must still have the old strategy when detaching data");
-
- {
- // make a new segment with a copy of the data
- rtl::Reference< data::TreeSegment > aNewSegment = data::TreeSegment::create( this->getOriginalTreeAccess() );
-
- OSL_ENSURE(aNewSegment.is(),"ERROR: Could not create detached copy of elment data");
-
- this->takeTreeAndRebuild( aNewSegment );
-
- sharable::TreeFragment * aOldElement = owningSet->removeElement(aElementName );
- OSL_ENSURE(aOldElement != NULL,"ERROR: Detached node not found in the given subtree");
-
- data::destroyTree(aOldElement);
- }
-
- OSL_ENSURE(m_aOwnData.is(),"ERROR: Could not create own data segment for detached node");
-}
-//-----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-/// transfer ownership from the given owner
-void ElementTree::takeTreeBack(rtl::Reference< data::TreeSegment > const & _aDataSegment)
-{
- OSL_ENSURE(!m_aOwnData.is(), "ERROR: Cannot take over a node - already owning");
- OSL_ENSURE(_aDataSegment.is(), "ERROR: Cannot take over NULL tree segment");
-
- m_aOwnData = _aDataSegment;
- OSL_ENSURE(m_aOwnData.is(), "ERROR: Could not take over data segment");
-
- m_aDataAddress = m_aOwnData->fragment;
- m_aElementName = m_aOwnData->fragment->getName();
-}
-//-----------------------------------------------------------------------------
-
-/// transfer ownership from the given owner
-void ElementTree::takeTreeAndRebuild(rtl::Reference< data::TreeSegment > const & _aDataSegment)
-{
- OSL_ENSURE(!m_aOwnData.is(), "ERROR: Cannot take over a node - already owning");
- OSL_ENSURE(_aDataSegment.is(), "ERROR: Cannot take over NULL tree segment");
- this->rebuild(view::createDirectAccessStrategy(_aDataSegment), _aDataSegment->fragment);
- m_aOwnData = _aDataSegment;
-}
-//-----------------------------------------------------------------------------
-
-/// release ownership
-rtl::Reference< data::TreeSegment > ElementTree::releaseOwnedTree()
-{
- OSL_ENSURE(m_aOwnData.is(), "ERROR: Cannot release and rename a non-owned node");
- rtl::Reference< data::TreeSegment > aTree(m_aOwnData);
- m_aOwnData.clear();
- aTree->fragment->setName(m_aElementName);
- return aTree;
-}
-//-----------------------------------------------------------------------------
-
-// context handling
-//-----------------------------------------------------------------------------
-
-/// renames the tree's root without concern for context consistency !
-void ElementTree::renameTree(rtl::OUString const& aNewName)
-{
- m_aElementName = aNewName;
-}
-//-----------------------------------------------------------------------------
-
-void ElementTree::moveTree(Tree* pParentTree, unsigned int nParentNode)
-{
- Tree::setContext(pParentTree,nParentNode);
-}
-//-----------------------------------------------------------------------------
-
-void ElementTree::detachTree()
-{
- Tree::clearContext();
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
- } // namespace configuration
-} // namespace configmgr
-
diff --git a/configmgr/source/treemgr/valuemembernode.cxx b/configmgr/source/treemgr/valuemembernode.cxx
deleted file mode 100644
index 695ee8600a..0000000000
--- a/configmgr/source/treemgr/valuemembernode.cxx
+++ /dev/null
@@ -1,333 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <stdio.h>
-
-#include "valuemembernode.hxx"
-#include "nodeimplobj.hxx"
-#include "nodechangeimpl.hxx"
-#include "change.hxx"
-#include "valuenode.hxx"
-#include <osl/diagnose.h>
-
-namespace configmgr
-{
- namespace configuration
- {
-
-// helpers
-//-----------------------------------------------------------------------------
-
-namespace
-{
-
-//-----------------------------------------------------------------------------
-// internal accessors for direct updates to data
-//-----------------------------------------------------------------------------
-
-inline
-void setOriginalValue(sharable::ValueNode * const& rOriginalAddress, com::sun::star::uno::Any const& aNewValue)
-{
- rOriginalAddress->setValue(aNewValue);
-}
-//-----------------------------------------------------------------------------
-
-inline
-void setOriginalToDefault(sharable::ValueNode * const& rOriginalAddress)
-{
- rOriginalAddress->setToDefault();
-}
-} // anonymous namespace
-
-
-//-----------------------------------------------------------------------------
-// class ValueMemberNode
-//-----------------------------------------------------------------------------
-
-ValueMemberNode::ValueMemberNode(sharable::ValueNode * node)
- : m_node(node)
- , m_xDeferredOperation()
-{}
-//-----------------------------------------------------------------------------
-ValueMemberNode::ValueMemberNode(rtl::Reference<DeferredImpl> const& _xDeferred) // must be valid
- : m_node( _xDeferred->getOriginalNode() )
- , m_xDeferredOperation(_xDeferred)
-{}
-//-----------------------------------------------------------------------------
-
-ValueMemberNode::ValueMemberNode(ValueMemberNode const& rOriginal)
- : m_node(rOriginal.m_node)
- , m_xDeferredOperation(rOriginal.m_xDeferredOperation)
-{}
-//-----------------------------------------------------------------------------
-ValueMemberNode& ValueMemberNode::operator=(ValueMemberNode const& rOriginal)
-{
- m_node = rOriginal.m_node;
- m_xDeferredOperation = rOriginal.m_xDeferredOperation;
- return *this;
-}
-//-----------------------------------------------------------------------------
-ValueMemberNode::~ValueMemberNode()
-{
-}
-//-----------------------------------------------------------------------------
-
-bool ValueMemberNode::isValid() const
-{
- OSL_ASSERT( !m_xDeferredOperation.is() ||
- m_node == m_xDeferredOperation->getOriginalNode());
-
- return m_node != 0;
-}
-//-----------------------------------------------------------------------------
-
-bool ValueMemberNode::hasChange() const
-{
- return m_xDeferredOperation.is()
- && m_xDeferredOperation->isChange();
-}
-//-----------------------------------------------------------------------------
-
-
-//-----------------------------------------------------------------------------
-// external accessors
-//-----------------------------------------------------------------------------
-
-rtl::OUString ValueMemberNode::getNodeName() const
-{
- return m_node->info.getName();
-}
-//-----------------------------------------------------------------------------
-
-node::Attributes ValueMemberNode::getAttributes() const
-{
- return sharable::node(m_node)->getAttributes();
-}
-//-----------------------------------------------------------------------------
-
-
-bool ValueMemberNode::isDefault() const
-{
- if (hasChange())
- return m_xDeferredOperation->isToDefault();
-
- return m_node->info.isDefault();
-}
-//-----------------------------------------------------------------------------
-
-bool ValueMemberNode::canGetDefaultValue() const
-{
- return m_node->hasUsableDefault();
-}
-//-----------------------------------------------------------------------------
-
-com::sun::star::uno::Any ValueMemberNode::getValue() const
-{
- if (hasChange())
- return m_xDeferredOperation->getNewValue();
-
- return m_node->getValue();
-}
-//-----------------------------------------------------------------------------
-
-com::sun::star::uno::Any ValueMemberNode::getDefaultValue() const
-{
- return m_node->getDefaultValue();
-}
-//-----------------------------------------------------------------------------
-
-com::sun::star::uno::Type ValueMemberNode::getValueType() const
-{
- return m_node->getValueType();
-}
-//-----------------------------------------------------------------------------
-
-
-void ValueMemberUpdate::setValue(com::sun::star::uno::Any const& aNewValue)
-{
- if (m_aMemberNode.m_xDeferredOperation.is())
- m_aMemberNode.m_xDeferredOperation->setValue(aNewValue, m_aMemberNode.m_node);
- else
- setOriginalValue(m_aMemberNode.m_node, aNewValue );
-}
-//-----------------------------------------------------------------------------
-
-void ValueMemberUpdate::setDefault()
-{
- if (m_aMemberNode.m_xDeferredOperation.is())
- m_aMemberNode.m_xDeferredOperation->setValueToDefault(m_aMemberNode.m_node);
- else
- setOriginalToDefault(m_aMemberNode.m_node);
-}
-
-//-----------------------------------------------------------------------------
-// class ValueMemberNode::DeferredImpl
-//-----------------------------------------------------------------------------
-
-ValueMemberNode::DeferredImpl::DeferredImpl(sharable::ValueNode * valueNode)
-: m_valueNode(valueNode)
-, m_aNewValue(valueNode->getValue())
-, m_bToDefault(false)
-, m_bChange(false)
-{}
-//-----------------------------------------------------------------------------
-
-void ValueMemberNode::DeferredImpl::setValue(com::sun::star::uno::Any const& aNewValue, sharable::ValueNode * originalNode)
-{
- OSL_ENSURE(originalNode == m_valueNode, "Incorrect original node passed");
-
- m_aNewValue = aNewValue;
- m_bToDefault = false;
-
- m_bChange = originalNode->info.isDefault() || aNewValue != originalNode->getValue();
-}
-//-----------------------------------------------------------------------------
-
-void ValueMemberNode::DeferredImpl::setValueToDefault(sharable::ValueNode * originalNode)
-{
- OSL_ENSURE(originalNode == m_valueNode, "Incorrect original node passed");
-
- m_aNewValue = originalNode->getDefaultValue();
- m_bToDefault = true;
-
- m_bChange = !originalNode->info.isDefault();
-}
-//-----------------------------------------------------------------------------
-
-std::auto_ptr<ValueChange> ValueMemberNode::DeferredImpl::preCommitChange()
-{
- OSL_ENSURE(isChange(), "Trying to commit a non-change");
-
- sharable::ValueNode * originalNode = getOriginalNode();
-
- // first find the mode of the change
- ValueChange::Mode eMode;
-
- if (m_bToDefault)
- eMode = ValueChange::setToDefault;
-
- else if (! originalNode->info.isDefault())
- eMode = ValueChange::changeValue;
-
- else
- eMode = ValueChange::wasDefault;
-
- // now make a ValueChange
- std::auto_ptr<ValueChange>pChange( new ValueChange( originalNode->info.getName(),
- sharable::node(originalNode)->getAttributes(),
- eMode,
- this->getNewValue(),
- originalNode->getValue()
- ) );
-
- return pChange;
-}
-//-----------------------------------------------------------------------------
-
-void ValueMemberNode::DeferredImpl::finishCommit(ValueChange& rChange)
-{
- { (void)rChange; }
- OSL_ENSURE(rChange.getNewValue() == this->getNewValue(),"Committed change does not match the intended value");
-
- sharable::ValueNode * originalNode = getOriginalNode();
-
- m_aNewValue = originalNode->getValue();
- m_bToDefault = false;
-
- OSL_ENSURE(rChange.getNewValue() == m_aNewValue,"Committed change does not match the actual value");
- m_bChange= false;
-}
-//-----------------------------------------------------------------------------
-
-void ValueMemberNode::DeferredImpl::revertCommit(ValueChange& rChange)
-{
- { (void)rChange; }
-
- OSL_ENSURE(rChange.getNewValue() == this->getNewValue(),"Reverted change does not match the intended value");
- OSL_ENSURE(isChange(), "ValueMemeberNode::DeferredImpl: No Changes to revert");
-}
-//-----------------------------------------------------------------------------
-
-void ValueMemberNode::DeferredImpl::failedCommit(ValueChange&)
-{
- sharable::ValueNode * originalNode = getOriginalNode();
-
- // discard the change
- m_aNewValue = originalNode->getValue();
- m_bToDefault = false;
-
- m_bChange= false;
-}
-//-----------------------------------------------------------------------------
-ValueChangeImpl* ValueMemberNode::DeferredImpl::collectChange()
-{
- sharable::ValueNode * originalNode = getOriginalNode();
-
- com::sun::star::uno::Any aOldValue = originalNode->getValue();
- if (!m_bChange)
- {
- return NULL;
- }
- else if (m_bToDefault)
- {
- OSL_ASSERT( m_aNewValue == originalNode->getDefaultValue() );
- return new ValueResetImpl( m_aNewValue, aOldValue );
- }
-
- else
- {
- return new ValueReplaceImpl( m_aNewValue, aOldValue );
- }
-}
-//-----------------------------------------------------------------------------
-
-ValueChangeImpl* ValueMemberNode::DeferredImpl::adjustToChange(ValueChange const& rExternalChange)
-{
- if (!m_bChange)
- {
- return NULL;
- }
- else if (m_bToDefault && rExternalChange.getMode() == ValueChange::changeDefault)
- {
- OSL_ASSERT( m_aNewValue == rExternalChange.getOldValue() );
-
- m_aNewValue = rExternalChange.getNewValue();
-
- return new ValueReplaceImpl(m_aNewValue, rExternalChange.getOldValue());
- }
- else // return Surrogate - does not honor m_bToDefault
- {
- return new ValueReplaceImpl(m_aNewValue, m_aNewValue);
- }
-}
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
- }
-}
diff --git a/configmgr/source/treemgr/valuemembernode.hxx b/configmgr/source/treemgr/valuemembernode.hxx
deleted file mode 100644
index dea24b30ef..0000000000
--- a/configmgr/source/treemgr/valuemembernode.hxx
+++ /dev/null
@@ -1,114 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_VALUEMEMBERNODE_HXX_
-#define CONFIGMGR_VALUEMEMBERNODE_HXX_
-
-#include "nodeimpl.hxx"
-
-namespace configmgr
-{
- namespace configuration
- {
-//-----------------------------------------------------------------------------
- /// handle class for values that are not nodes themselves, but members of a group
- class ValueMemberNode
- {
- public:
- class DeferredImpl;
- private:
- sharable::ValueNode * m_node;
- rtl::Reference<DeferredImpl> m_xDeferredOperation;
- private:
- friend class GroupNodeImpl;
- friend class DeferredGroupNodeImpl;
- friend class ValueMemberUpdate;
-
- /// create a ValueMemberNode for a given node
- explicit ValueMemberNode(sharable::ValueNode * node);
- /// create a deferred ValueMemberNode (xOriginal must not be empty)
- ValueMemberNode(rtl::Reference<DeferredImpl> const& _xDeferred);
- public:
- ValueMemberNode(ValueMemberNode const& rOriginal);
- ValueMemberNode& operator=(ValueMemberNode const& rOriginal);
- ~ValueMemberNode();
-
- /// does this wrap a valid value ?
- bool isValid() const;
-
- /// does this wrap a change
- bool hasChange() const;
-
- /// retrieve the name of the underlying node
- rtl::OUString getNodeName() const;
- /// retrieve the attributes
- node::Attributes getAttributes() const;
-
- /// Does this node assume its default value
- bool isDefault() const;
- /// is the default value of this node available
- bool canGetDefaultValue() const;
- /// retrieve the current value of this node
- com::sun::star::uno::Any getValue() const;
- /// retrieve the default value of this node
- com::sun::star::uno::Any getDefaultValue() const;
-
- com::sun::star::uno::Type getValueType() const;
-
- };
- //-------------------------------------------------------------------------
-
- /// handle class for updating values that are members of a group
- class ValueMemberUpdate
- {
- ValueMemberNode m_aMemberNode;
- view::ViewStrategy * m_pStrategy;
- private:
- friend class view::ViewStrategy;
-
- ValueMemberUpdate(ValueMemberNode const& rOriginal, view::ViewStrategy& _rStrategy)
- : m_aMemberNode(rOriginal), m_pStrategy(&_rStrategy) {}
-
- public:
- /// does this wrap a valid value ?
- bool isValid() const { return m_aMemberNode.isValid(); }
-
- /// get access to the wrapped data
- ValueMemberNode getNode() const { return m_aMemberNode; }
-
- /// Set this node to a new value
- void setValue(com::sun::star::uno::Any const& aNewValue);
-
- /// Set this node to assume its default value
- void setDefault();
- };
-
-//-----------------------------------------------------------------------------
- }
-}
-
-#endif // CONFIGMGR_GROUPNODEBEHAVIOR_HXX_
diff --git a/configmgr/source/treemgr/valuenodeimpl.hxx b/configmgr/source/treemgr/valuenodeimpl.hxx
deleted file mode 100644
index e5cd8e928c..0000000000
--- a/configmgr/source/treemgr/valuenodeimpl.hxx
+++ /dev/null
@@ -1,69 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_VALUENODEBEHAVIOR_HXX_
-#define CONFIGMGR_VALUENODEBEHAVIOR_HXX_
-
-#include "nodeimpl.hxx"
-
-namespace configmgr
-{
- class ValueChange;
-
- namespace configuration
- {
-//-----------------------------------------------------------------------------
-// Another types of node
-//-----------------------------------------------------------------------------
-
- /** a special kind of node that is used to represent an element of a set of values
- <p> This is an immutable value (changes are done by adding/replacing/removing set elements)
- </p>
- */
- class ValueElementNodeImpl : public NodeImpl
- {
- public:
- explicit ValueElementNodeImpl(sharable::ValueNode * const& _aNodeRef) ;
-
- // the following delegate directly to the original node
- public:
- /// Does this node assume its default value
- /// retrieve the current value of this node
- com::sun::star::uno::Any getValue() const;
-
- /// get the type of this value
- com::sun::star::uno::Type getValueType() const;
-
- sharable::ValueNode * getDataAccess() const;
- };
-
- // domain-specific 'dynamic_cast' replacement
- ValueElementNodeImpl& AsValueNode(NodeImpl& rNode);
- }
-}
-
-#endif // CONFIGMGR_VALUENODEBEHAVIOR_HXX_
diff --git a/configmgr/source/treemgr/viewaccess.hxx b/configmgr/source/treemgr/viewaccess.hxx
deleted file mode 100644
index 4341331311..0000000000
--- a/configmgr/source/treemgr/viewaccess.hxx
+++ /dev/null
@@ -1,228 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_VIEWACCESS_HXX_
-#define CONFIGMGR_VIEWACCESS_HXX_
-
-#include "viewnode.hxx"
-#include "viewstrategy.hxx"
-#include <rtl/ref.hxx>
-
-//-----------------------------------------------------------------------------
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace configuration { class NodeRef; }
-//-----------------------------------------------------------------------------
- namespace view
- {
-//-----------------------------------------------------------------------------
-
- class ViewTreeAccess
- {
- rtl::Reference< ViewStrategy > m_xStrategy;
- configuration::Tree * m_tree;
-
- public:
- explicit ViewTreeAccess(configuration::Tree * tree):
- m_xStrategy(tree->getViewBehavior()), m_tree(tree) {}
-
- rtl::Reference< view::ViewStrategy > getViewBehavior() { return m_xStrategy; }
- public:
- configuration::NodeData* nodeData(configuration::NodeRef const& _aNodeArg) const;
- configuration::NodeData* nodeData(unsigned int _aNodePos) const;
-
- Node makeNode(configuration::NodeRef const& _aNodeArg) const { return Node(m_tree,nodeData(_aNodeArg)); }
- Node makeNode(unsigned int _aNodePos) const { return Node(m_tree,nodeData(_aNodePos)); }
-
- bool isSetNode (configuration::NodeRef const& _aNodeArg) const { return makeNode(_aNodeArg).isSetNode(); }
- bool isGroupNode(configuration::NodeRef const& _aNodeArg) const { return makeNode(_aNodeArg).isGroupNode(); }
- bool isValueNode(configuration::NodeRef const& _aNodeArg) const { return makeNode(_aNodeArg).isValueNode(); }
-
- bool isSetNodeAt (unsigned int _aNodeArg) const { return makeNode(_aNodeArg).isSetNode(); }
- bool isGroupNodeAt(unsigned int _aNodeArg) const { return makeNode(_aNodeArg).isGroupNode(); }
- bool isValueNodeAt(unsigned int _aNodeArg) const { return makeNode(_aNodeArg).isValueNode(); }
-
- SetNode toSetNode (configuration::NodeRef const& _aNodeArg) const
- { return SetNode (makeNode(_aNodeArg)); }
-
- GroupNode toGroupNode(configuration::NodeRef const& _aNodeArg) const
- { return GroupNode(makeNode(_aNodeArg)); }
-
- ValueNode toValueNode(configuration::NodeRef const& _aNodeArg) const
- { return ValueNode(makeNode(_aNodeArg)); }
-
- SetNode getSetNodeAt (unsigned int _aNodeArg) const
- { return SetNode (makeNode(_aNodeArg)); }
-
- GroupNode getGroupNodeAt(unsigned int _aNodeArg) const
- { return GroupNode(makeNode(_aNodeArg)); }
-
- ValueNode getValueNodeAt(unsigned int _aNodeArg) const
- { return ValueNode(makeNode(_aNodeArg)); }
- // node attributes
- public:
- /// retrieve the name of the node
- rtl::OUString getName(configuration::NodeRef const& _aNode) const
- { return m_xStrategy->getName(makeNode(_aNode)); }
-
- /// retrieve the attributes of the node
- node::Attributes getAttributes(configuration::NodeRef const& _aNode) const
- { return m_xStrategy->getAttributes(makeNode(_aNode)); }
-
- /// retrieve the name of the tree root
- rtl::OUString getRootName() const
- { return m_xStrategy->getName( getRootNode(m_tree) ); }
-
- /// retrieve the attributes of the tree root
- node::Attributes getRootAttributes() const
- { return m_xStrategy->getAttributes( getRootNode(m_tree) ); }
-
- // tracking pending changes
- public:
- void collectChanges(configuration::NodeChanges& rChanges) const
- { m_xStrategy->collectChanges(m_tree,rChanges); }
-
- bool hasChanges() const
- { return m_xStrategy->hasChanges(m_tree); }
-
- bool hasChanges(configuration::NodeRef const& _aNode) const
- { return m_xStrategy->hasChanges(makeNode(_aNode)); }
-
- void markChanged(configuration::NodeRef const& _aNode)
- { m_xStrategy->markChanged(makeNode(_aNode)); }
-
- // commit protocol
- public:
- std::auto_ptr<SubtreeChange> preCommitChanges(std::vector< rtl::Reference<configuration::ElementTree> >& _rRemovedElements)
- { return m_xStrategy->preCommitChanges(m_tree,_rRemovedElements); }
-
- void finishCommit(SubtreeChange& rRootChange)
- { m_xStrategy->finishCommit(m_tree,rRootChange); }
-
- void revertCommit(SubtreeChange& rRootChange)
- { m_xStrategy->revertCommit(m_tree,rRootChange); }
-
- void recoverFailedCommit(SubtreeChange& rRootChange)
- { m_xStrategy->recoverFailedCommit(m_tree,rRootChange); }
-
- // notification protocol
- public:
- /// Adjust the internal representation after external changes to the original data - build NodeChangeInformation objects for notification
- void adjustToChanges(configuration::NodeChangesInformation& rLocalChanges, configuration::NodeRef const& _aNode, SubtreeChange const& aExternalChange)
- { m_xStrategy->adjustToChanges(rLocalChanges,makeNode(_aNode), aExternalChange); }
-
- // visitor dispatch
- public:
- configuration::GroupMemberVisitor::Result dispatchToValues(GroupNode const& _aNode, configuration::GroupMemberVisitor& _aVisitor) const
- { return m_xStrategy->dispatchToValues(_aNode,_aVisitor); }
-
- /// Call <code>aVisitor.visit(aElement)</code> for each element in this set until SetNodeVisitor::DONE is returned.
- configuration::SetNodeVisitor::Result dispatchToElements(SetNode const& _aNode, configuration::SetNodeVisitor& _aVisitor) const
- { return m_xStrategy->dispatchToElements(_aNode,_aVisitor); }
-
- // value (element) node specific operations
- public:
- /// Does this node assume its default value
- /// retrieve the current value of this node
- com::sun::star::uno::Any getValue(ValueNode const& _aNode) const
- { return m_xStrategy->getValue(_aNode); }
-#if OSL_DEBUG_LEVEL > 0
- /// get the type of this value
- com::sun::star::uno::Type getValueType(ValueNode const& _aNode) const
- { return m_xStrategy->getValueType(_aNode); }
-#endif
-
- // group node specific operations
- public:
- /// does this hold a child value of the given name
- bool hasValue(GroupNode const& _aNode, rtl::OUString const& _aName) const
- { return m_xStrategy->hasValue(_aNode,_aName); }
-
- /// does this hold a child value
- bool hasValue(GroupNode const& _aNode) const
- { return m_xStrategy->hasValue(_aNode); }
-
- /// are defaults for this node available ?
- bool areValueDefaultsAvailable(GroupNode const& _aNode) const
- { return m_xStrategy->areValueDefaultsAvailable(_aNode); }
-
- /// retrieve data for the child value of the given name
- configuration::ValueMemberNode getValue(GroupNode const& _aNode, rtl::OUString const& _aName) const
- { return m_xStrategy->getValue(_aNode,_aName); }
-
- /// retrieve data for updating the child value of the given name
- configuration::ValueMemberUpdate getValueForUpdate(GroupNode const & _aNode, rtl::OUString const& _aName) const
- { return m_xStrategy->getValueForUpdate(_aNode,_aName); }
-
- // set node specific operations
- public:
- /// does this set contain any elements (loads elements if needed)
- bool isEmpty(SetNode const& _aNode) const
- { return m_xStrategy->isEmpty(_aNode); }
-
- /// does this set contain an element named <var>aName</var> (loads elements if needed)
- configuration::SetEntry findElement(SetNode const& _aNode, rtl::OUString const& aName) const
- { return m_xStrategy->findElement(_aNode,aName); }
-
- /// does this set contain an element named <var>aName</var> (and is that element loaded ?)
- configuration::SetEntry findAvailableElement(SetNode const& _aNode, rtl::OUString const& aName) const
- { return m_xStrategy->findAvailableElement(_aNode,aName); }
-
- /// insert a new entry into this set
- void insertElement(SetNode const& _aNode, rtl::OUString const& aName, configuration::SetEntry const& aNewEntry)
- { m_xStrategy->insertElement(_aNode,aName,aNewEntry); }
-
- /// remove an existing entry into this set
- void removeElement(SetNode const& _aNode, rtl::OUString const& aName)
- { m_xStrategy->removeElement(_aNode,aName); }
-
- /** Create a Subtree change as 'diff' which allows transforming the set to its default state
- (given that <var>_rDefaultTree</var> points to a default instance of this set)
- <p>Ownership of added trees should be transferred to the SubtreeChange.</p>
- */
- std::auto_ptr<SubtreeChange> differenceToDefaultState(SetNode const& _aNode, ISubtree& _rDefaultTree)
- { return m_xStrategy->differenceToDefaultState(_aNode,_rDefaultTree); }
-
- /// Get the template that describes elements of this set
- rtl::Reference<configuration::Template> getElementTemplate(SetNode const& _aNode) const
- { return m_xStrategy->getElementTemplate(_aNode); }
-
- /// Get a template provider that can create new elements for this set
- configuration::TemplateProvider getTemplateProvider(SetNode const& _aNode) const
- { return m_xStrategy->getTemplateProvider(_aNode); }
-
- // changing state/strategy
- public:
- // replace m_xStrategy by a direct ViewStrategy (commiting changes to the data), if possible
- // void makeDirect ();
-
- };
- }
-}
-
-#endif // CONFIGMGR_VIEWACCESS_HXX_
diff --git a/configmgr/source/treemgr/viewfactory.hxx b/configmgr/source/treemgr/viewfactory.hxx
deleted file mode 100644
index 79d618a2ee..0000000000
--- a/configmgr/source/treemgr/viewfactory.hxx
+++ /dev/null
@@ -1,53 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_VIEWBEHAVIORFACTORY_HXX_
-#define CONFIGMGR_VIEWBEHAVIORFACTORY_HXX_
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace data { class TreeSegment; }
-
- namespace view
- {
- // Different standard (static) strategies
- //---------------------------------------------------------------------
- /// provides a factory for read-only node implementations
- rtl::Reference<ViewStrategy> createReadOnlyStrategy();
- /// provides a factory for nodes that cache changes temporarily
- rtl::Reference<ViewStrategy> createDeferredChangeStrategy();
- /// provides a factory for immediately commiting node implementations
- rtl::Reference<ViewStrategy> createDirectAccessStrategy(rtl::Reference< data::TreeSegment > const & _aTreeSegment);
- //---------------------------------------------------------------------
- }
-
-//-----------------------------------------------------------------------------
-
-}
-
-#endif // CONFIGMGR_VIEWBEHAVIORFACTORY_HXX_
diff --git a/configmgr/source/treemgr/viewnode.cxx b/configmgr/source/treemgr/viewnode.cxx
deleted file mode 100644
index c77ae58ea9..0000000000
--- a/configmgr/source/treemgr/viewnode.cxx
+++ /dev/null
@@ -1,105 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "viewnode.hxx"
-#include "setnodeimpl.hxx"
-#include "groupnodeimpl.hxx"
-#include "valuenodeimpl.hxx"
-#include "tree.hxx"
-#include "viewstrategy.hxx"
-
-//-----------------------------------------------------------------------------
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace view
- {
-//-----------------------------------------------------------------------------
- rtl::Reference< view::ViewStrategy > getViewBehavior(configuration::Tree * _aTree)
- {
- return _aTree->getViewBehavior();
- }
-
-//-----------------------------------------------------------------------------
- static inline Node makeNode_(configuration::Tree * _aTree, unsigned int nOffset)
- {
- return Node(_aTree, _aTree->nodeData(nOffset));
- }
-//-----------------------------------------------------------------------------
- Node Node::getParent() const
- {
- configuration::Tree * pTreeData = this->tree();
- return makeNode_(tree(), pTreeData->parent_(this->get_offset()));
- }
-
-//-----------------------------------------------------------------------------
- Node GroupNode::findChild(rtl::OUString const& _aName) const
- {
- configuration::Tree * pTreeData = this->tree();
- return makeNode_(tree(), pTreeData->findChild_(node().get_offset(), _aName));
- }
-
-//-----------------------------------------------------------------------------
- Node GroupNode::getFirstChild() const
- {
- configuration::Tree * pTreeData = this->tree();
- return makeNode_(tree(), pTreeData->firstChild_(node().get_offset()));
- }
-
-//-----------------------------------------------------------------------------
- Node GroupNode::getNextChild(Node const& _aAfterNode) const
- {
- configuration::Tree * pTreeData = this->tree();
- OSL_ASSERT(pTreeData->parent_(_aAfterNode.get_offset()) == this->node().get_offset());
- return makeNode_(tree(), pTreeData->findNextChild_(node().get_offset(),_aAfterNode.get_offset()));
- }
-
-//-----------------------------------------------------------------------------
- sharable::Node * Node::getAccessRef() const
- {
- return get_impl()->getOriginalNodeAccess();
- }
-
-//-----------------------------------------------------------------------------
- sharable::GroupNode * GroupNode::getAccess() const
- {
- return get_impl()->getDataAccess();
- }
-
-//-----------------------------------------------------------------------------
- sharable::SetNode * SetNode::getAccess() const
- {
- return get_impl()->getDataAccess();
- }
-
-//-----------------------------------------------------------------------------
- }
-}
-
diff --git a/configmgr/source/treemgr/viewnode.hxx b/configmgr/source/treemgr/viewnode.hxx
deleted file mode 100644
index 90cb14e513..0000000000
--- a/configmgr/source/treemgr/viewnode.hxx
+++ /dev/null
@@ -1,200 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_VIEWNODE_HXX_
-#define CONFIGMGR_VIEWNODE_HXX_
-
-#include "tree.hxx"
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace configuration
- {
- struct ElementTreeData;
- }
- namespace sharable { struct GroupNode; }
-//-----------------------------------------------------------------------------
- namespace view
- {
- //-------------------------------------------------------------------------
- struct Node
- {
- Node(configuration::Tree * _tree, configuration::NodeData* _addr)
- : m_tree(_tree), m_addr(_addr)
- {}
-
- Node(configuration::Tree * _tree, unsigned int _offs)
- : m_tree(_tree), m_addr( _tree->nodeData(_offs))
- {}
-
- bool is() const { return m_addr != 0; }
-
- Node getParent() const;
-
- bool isSetNode() const { return is() && data().isSetNode(); }
- bool isGroupNode() const { return is() && data().isGroupNode(); }
- bool isValueNode() const { return is() && data().isValueElementNode(); }
-
- // low-level access
-// configuration::NodeImpl * operator->() const { return &data().nodeImpl(); }
-
- configuration::NodeData& data() const { return *m_addr; }
-
- configuration::NodeImpl * get_impl() const
- { return is() ? &data().nodeImpl() : NULL; }
-
- unsigned int get_offset() const
- { return is() ? m_tree->nodeOffset( this->data() ) : 0; }
-
- configuration::Tree * tree() const // has a tree
- { return m_tree; }
-
- sharable::Node * getAccessRef() const; // has a Node
-
- private:
- configuration::Tree * m_tree; // has a Tree + Accessor
- configuration::NodeData* m_addr; // has a configuration::NodeImpl *
- };
- //-------------------------------------------------------------------------
- struct ValueNode // has/is a Node
- {
- Node m_node;
-
- explicit
- ValueNode(Node const& _node)
- : m_node(_node)
- {}
-
- bool is() const { return m_node.isValueNode(); }
-
- // low-level access
- // configuration::ValueElementNodeImpl* operator->() const { return &m_node.data().valueElementImpl(); }
-
- configuration::ValueElementNodeImpl* get_impl() const
- { return is() ? &m_node.data().valueElementImpl() : NULL; }
-
- Node node() const // has a Node
- { return m_node; }
-
- configuration::Tree * tree() const // has a tree
- { return m_node.tree(); }
- };
- //-------------------------------------------------------------------------
- struct GroupNode // has/is a Node
- {
- Node m_node;
-
- explicit
- GroupNode(Node const& _node)
- : m_node(_node)
- {}
-
- bool is() const { return m_node.isGroupNode(); }
-
- Node findChild(rtl::OUString const& _aName) const;
- Node getFirstChild() const;
- Node getNextChild(Node const& _aAfterNode) const;
-
-// configuration::GroupNodeImpl* operator->() const { return &m_node.data().groupImpl(); }
-
- configuration::GroupNodeImpl* get_impl() const
- { return is() ? &m_node.data().groupImpl() : NULL; }
-
- Node node() const // has a Node
- { return m_node; }
-
- configuration::Tree * tree() const // has a tree
- { return m_node.tree(); }
-
- sharable::GroupNode * getAccess() const; // has a GroupNode
- };
- //-------------------------------------------------------------------------
- struct SetNode // has/is a Node
- {
- Node m_node;
-
- explicit
- SetNode(Node const& _node)
- : m_node(_node)
- {}
-
- bool is() const { return m_node.isSetNode(); }
-
- // configuration::SetNodeImpl* operator->() const { return &m_node.data().setImpl(); }
-
- configuration::SetNodeImpl* get_impl() const
- { return is() ? &m_node.data().setImpl() : 0; }
-
- Node node() const // has a Node
- { return m_node; }
-
- configuration::Tree * tree() const // has a tree
- { return m_node.tree(); }
-
- sharable::SetNode * getAccess() const; // has a SetNode
- };
- //-------------------------------------------------------------------------
- inline
- Node getRootNode(configuration::Tree * _aTree)
- {
- return Node(_aTree,_aTree->nodeData(configuration::Tree::ROOT));
- }
-
- //-------------------------------------------------------------------------
- inline
- rtl::OUString getSimpleRootName(configuration::Tree * _aTree)
- {
- return _aTree->getSimpleRootName();
- }
-
- //-------------------------------------------------------------------------
- inline
- bool isValidNode(Node const & _aNode)
- {
- configuration::Tree* pTreeData = _aNode.tree();
- return pTreeData->isValidNode(_aNode.get_offset());
- }
-
- //-------------------------------------------------------------------------
- inline
- rtl::OUString getSimpleNodeName(Node const & _aNode)
- {
- configuration::Tree* pTreeData = _aNode.tree();
- return pTreeData->getSimpleNodeName(_aNode.get_offset());
- }
-
- //-------------------------------------------------------------------------
- extern
- rtl::Reference< view::ViewStrategy > getViewBehavior(configuration::Tree * _aTree);
- //-------------------------------------------------------------------------
- }
-//-----------------------------------------------------------------------------
-}
-//-----------------------------------------------------------------------------
-
-#endif // CONFIGMGR_VIEWNODE_HXX_
diff --git a/configmgr/source/treemgr/viewstrategy.cxx b/configmgr/source/treemgr/viewstrategy.cxx
deleted file mode 100644
index 2678a750f5..0000000000
--- a/configmgr/source/treemgr/viewstrategy.cxx
+++ /dev/null
@@ -1,620 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "viewstrategy.hxx"
-#include "valuenodeimpl.hxx"
-#include "groupnodeimpl.hxx"
-#include "setnodeimpl.hxx"
-#include "change.hxx"
-#include "nodevisitor.hxx"
-#include "nodechange.hxx"
-#include "nodechangeimpl.hxx"
-#include "nodeconverter.hxx"
-//-----------------------------------------------------------------------------
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace view
- {
-//-----------------------------------------------------------------------------
- static
- inline
- sharable::ValueNode * getMemberValueAccess( GroupNode const & _aGroupNode, rtl::OUString const & _aName )
- {
- configuration::GroupNodeImpl* pGroupData = _aGroupNode.get_impl();
- return pGroupData->getOriginalValueNode(_aName);
- }
-
-//-----------------------------------------------------------------------------
- void ViewStrategy::checkInstance(configuration::Tree * tree) const
- {
- (void) tree; // avoid warnings
- OSL_ENSURE( getViewBehavior(tree).get() == this,
- "Tree operation dispatched to wrong strategy instance");
- }
-//-----------------------------------------------------------------------------
- void ViewStrategy::collectChanges(configuration::Tree * tree, configuration::NodeChanges& rChanges) const
- {
- checkInstance(tree);
- doCollectChanges( getRootNode(tree), rChanges );
- }
-
- bool ViewStrategy::hasChanges(configuration::Tree * tree) const
- {
- checkInstance(tree);
- return hasChanges( getRootNode(tree) );
- }
-
- // mark the given node and all its ancestors (we can stop when we hit a node that already is marked)
- void ViewStrategy::markChanged(Node const& _aNode)
- {
- configuration::Tree * tree = _aNode.tree();
- checkInstance(tree);
-
- Node aNode = _aNode;
- if (aNode.is())
- {
- do
- {
- this->doMarkChanged(aNode);
-
- aNode = aNode.getParent();
- }
- while (aNode.is() && !this->hasChanges( aNode ));
- }
-
- if (!aNode.is()) // just marked the root
- {
- configuration::Tree* pContext = tree->getContextTree();
- unsigned int nContext = tree->getContextNode();
- if (pContext)
- {
- OSL_ASSERT(pContext->isValidNode(nContext));
-
- view::Node aContextNode(pContext,nContext);
- pContext->getViewBehavior()->markChanged(aContextNode);
- }
- }
- }
-
-//-----------------------------------------------------------------------------
- std::auto_ptr<SubtreeChange> ViewStrategy::preCommitChanges(configuration::Tree * tree, std::vector< rtl::Reference<configuration::ElementTree> >& _rRemovedElements)
- {
- checkInstance(tree);
- return doPreCommitChanges( tree, _rRemovedElements);
- }
-
- void ViewStrategy::finishCommit(configuration::Tree * tree, SubtreeChange& rRootChange)
- {
- checkInstance(tree);
- doFinishCommit(tree, rRootChange);
- }
-
- void ViewStrategy::revertCommit(configuration::Tree * tree, SubtreeChange& rRootChange)
- {
- checkInstance(tree);
- doRevertCommit(tree, rRootChange);
- }
-
- void ViewStrategy::recoverFailedCommit(configuration::Tree * tree, SubtreeChange& rRootChange)
- {
- checkInstance(tree);
- doFailedCommit(tree, rRootChange);
- }
-
-//-----------------------------------------------------------------------------
- void ViewStrategy::adjustToChanges(configuration::NodeChangesInformation& rLocalChanges, Node const& _aNode, SubtreeChange const& aExternalChange)
- {
- OSL_PRECOND( isValidNode(_aNode), "ERROR: Valid node required for adjusting to changes" );
- OSL_PRECOND( getSimpleNodeName(_aNode) == aExternalChange.getNodeName(), "name of change does not match actual node" );
-
- checkInstance(_aNode.tree());
-
- configuration::Tree * pTreeData = _aNode.tree();
-
- if (_aNode.isSetNode())
- {
- OSL_ENSURE(aExternalChange.isSetNodeChange(),"ERROR: Change type GROUP does not match set");
-
- unsigned int nDepth = pTreeData->getRemainingDepth(_aNode.get_offset());
-
- implAdjustToElementChanges( rLocalChanges, SetNode(_aNode), aExternalChange, nDepth);
- }
- else if (_aNode.isGroupNode())
- {
- OSL_ENSURE(!aExternalChange.isSetNodeChange(),"ERROR: Change type SET does not match group");
-
- GroupNode aGroupNode(_aNode);
-
- implAdjustToValueChanges(rLocalChanges, aGroupNode, aExternalChange);
- implAdjustToSubChanges( rLocalChanges, aGroupNode, aExternalChange);
- }
- else // might occur on external change (?)
- {
- OSL_ENSURE(_aNode.isValueNode(), "Tree: Unknown node type to adjust to changes");
-
- OSL_ENSURE(_aNode.get_offset() == configuration::Tree::ROOT, "Tree: Unexpected node type - non-root value element");
-
- OSL_ENSURE(false,"ERROR: Change type does not match node: Trying to apply subtree change to value element.");
- }
- }
-
-//-----------------------------------------------------------------------------
-
- void ViewStrategy::addLocalChangeHelper( configuration::NodeChangesInformation& rLocalChanges_, configuration::NodeChange const& aChange_)
- {
- aChange_.getChangeInfos(rLocalChanges_);
- }
-
-//-----------------------------------------------------------------------------
- // TO DO: create CommitAction class, which is returned by precommit (if applicable)
-
- std::auto_ptr<SubtreeChange> ViewStrategy::doPreCommitChanges(configuration::Tree * tree, std::vector< rtl::Reference<configuration::ElementTree> >& )
- {
- (void) tree; // avoid warnings
- OSL_ENSURE(!hasChanges(getRootNode(tree)),"Unexpected changes in View");
- return std::auto_ptr<SubtreeChange>();
- }
-
- void ViewStrategy::doFinishCommit(configuration::Tree * tree, SubtreeChange& )
- {
- (void) tree; // avoid warnings
- OSL_ENSURE(!hasChanges(getRootNode(tree)),"Unexpected changes in View");
- OSL_ENSURE(false,"ERROR: Cannot finish commit for unexpected changes");
- }
-
- void ViewStrategy::doRevertCommit(configuration::Tree * tree, SubtreeChange& )
- {
- (void) tree; // avoid warnings
- OSL_ENSURE(!hasChanges(getRootNode(tree)),"Unexpected changes in View");
- OSL_ENSURE(false,"ERROR: Cannot revert commit for unexpected changes");
- }
-
- void ViewStrategy::doFailedCommit(configuration::Tree * tree, SubtreeChange& )
- {
- (void) tree; // avoid warnings
- OSL_ENSURE(!hasChanges(getRootNode(tree)),"Unexpected changes in View");
- OSL_ENSURE(false,"ERROR: Cannot recover commit for unexpected changes");
- }
-
-//-----------------------------------------------------------------------------
- void ViewStrategy::implAdjustToElementChange(configuration::NodeChangesInformation& rLocalChanges, SetNode const& _aSetNode, Change const& rElementChange, unsigned int nDepth)
- {
- configuration::SetNodeImpl * pSetData = _aSetNode.get_impl();
-
- OSL_ENSURE( pSetData->implHasLoadedElements() , "Unexpected call: Processing element change in uninitialized set");
-
- rtl::OUString aName( rElementChange.getNodeName() );
-
- configuration::SetElementChangeImpl* pThisChange = 0;
- if (AddNode const * addNode = dynamic_cast< AddNode const *>(&rElementChange))
- {
- configuration::ElementTreeData aNewElement = pSetData->makeAdditionalElement(this, *addNode, nDepth);
-
- pThisChange = pSetData->doAdjustToAddedElement(aName, *addNode, aNewElement);
- }
- else if (RemoveNode const * removeNode = dynamic_cast< RemoveNode const * >(&rElementChange))
- {
- pThisChange = pSetData->doAdjustToRemovedElement(aName, *removeNode);
- }
- else
- {
- if (nDepth > 0 || (NULL != pSetData->doFindElement(aName)) )// found even beyond nDepth ?
- {
- pThisChange = pSetData->doAdjustChangedElement(rLocalChanges,aName, rElementChange);
- }
- }
-
- if (pThisChange)
- {
- addLocalChangeHelper( rLocalChanges, configuration::NodeChange(pThisChange) );
- }
- }
-
- void ViewStrategy::implAdjustToElementChanges(configuration::NodeChangesInformation& rLocalChanges, SetNode const& _aSetNode, SubtreeChange const& rExternalChanges, unsigned int nDepth)
- {
-
- if (nDepth > 0)
- {
- configuration::SetNodeImpl * pSetData = _aSetNode.get_impl();
-
- OSL_ENSURE( pSetData->getTemplateProvider().isValid(), "Cannot adjust SetNode to changes - node was never initialized" );
-
- if (pSetData->implHasLoadedElements())
- {
- unsigned int const nElementDepth = configuration::childDepth(nDepth);
- for (SubtreeChange::ChildIterator it = rExternalChanges.begin(); it != rExternalChanges.end(); ++it)
- {
- this->implAdjustToElementChange(rLocalChanges, _aSetNode, *it, nElementDepth);
- }
- }
- else
- {
- OSL_ENSURE( !hasChanges(_aSetNode.node()),"Cannot have changes to consider when no elements are loaded");
-
- pSetData->convertChanges( rLocalChanges, rExternalChanges, nDepth);
- }
- }
- }
-
- configuration::ValueChangeImpl* ViewStrategy::doAdjustToValueChange(GroupNode const& _aGroupNode, rtl::OUString const& _aName, ValueChange const& _rExternalChange)
- {
- configuration::ValueChangeImpl* pChangeImpl = NULL;
-
- sharable::ValueNode * localNode = getMemberValueAccess(_aGroupNode,_aName);
- if (localNode != 0)
- {
- switch( _rExternalChange. getMode() )
- {
- case ValueChange::wasDefault:
- case ValueChange::changeValue:
- pChangeImpl = new configuration::ValueReplaceImpl( _rExternalChange.getNewValue(), _rExternalChange.getOldValue() );
- break;
-
- case ValueChange::setToDefault:
- pChangeImpl = new configuration::ValueResetImpl( _rExternalChange.getNewValue(), _rExternalChange.getOldValue() );
- break;
-
- default: OSL_ENSURE(false, "Unknown change mode");
- // fall thru to next case for somewhat meaningful return value
- case ValueChange::changeDefault:
- {
- com::sun::star::uno::Any aLocalValue = localNode->getValue();
-
- pChangeImpl = new configuration::ValueReplaceImpl( aLocalValue, aLocalValue );
- }
- break;
- }
- OSL_ASSERT( pChangeImpl );
- }
- else
- {
- OSL_ENSURE(false, "ERROR: Notification tries to change nonexistent value within group");
- }
-
- return pChangeImpl;
- }
-
- void ViewStrategy::implAdjustToValueChanges(configuration::NodeChangesInformation& rLocalChanges, GroupNode const& _aGroupNode, SubtreeChange const& rExternalChanges)
- {
- for (SubtreeChange::ChildIterator it = rExternalChanges.begin(); it != rExternalChanges.end(); ++it)
- {
- if (ValueChange const * valueChange = dynamic_cast< ValueChange const * >(&*it))
- {
- rtl::OUString aValueName( valueChange->getNodeName() );
-
- if (configuration::ValueChangeImpl* pThisChange = doAdjustToValueChange(_aGroupNode, aValueName, *valueChange))
- {
- pThisChange->setTarget(_aGroupNode,aValueName);
- addLocalChangeHelper(rLocalChanges, configuration::NodeChange(pThisChange));
- }
- else
- OSL_TRACE("WARNING: Configuration: derived class hides an external value member change from listeners");
- }
- else
- OSL_ENSURE(dynamic_cast< SubtreeChange const * >(&*it) != 0, "Unexpected change type within group");
- }
- }
-
- void ViewStrategy::implAdjustToSubChanges(configuration::NodeChangesInformation& rLocalChanges, GroupNode const& _aGroupNode, SubtreeChange const& rExternalChanges)
- {
-#if (OSL_DEBUG_LEVEL > 0)
- configuration::Tree * pTreeData = _aGroupNode.tree();
-#endif
- for(SubtreeChange::ChildIterator it = rExternalChanges.begin(); it != rExternalChanges.end(); ++it)
- {
- if (SubtreeChange const * subtreeChange = dynamic_cast< SubtreeChange const * >(&*it))
- {
- Node aSubNode = _aGroupNode.findChild( it->getNodeName() );
- OSL_ENSURE( aSubNode.is() || pTreeData->depthTo(_aGroupNode.node().get_offset()) >= pTreeData->getAvailableDepth(), "Changed node not found in tree");
-
- if (aSubNode.is())
- {
- OSL_ENSURE( pTreeData->getRemainingDepth(_aGroupNode.node().get_offset()) > 0, "Depth is smaller than expected for tree");
- this->adjustToChanges(rLocalChanges, aSubNode, *subtreeChange);
- }
- }
- else
- {
- OSL_ENSURE(dynamic_cast< ValueChange const * >(&*it) != 0, "Unexpected change type for child of group node; change is ignored");
- OSL_ENSURE( !_aGroupNode.findChild(it->getNodeName()).is(),
- "Found sub(tree) node where a value was expected");
- }
- }
- }
-//-----------------------------------------------------------------------------
- void ViewStrategy::doCollectChanges(Node const& _aNode, configuration::NodeChanges& ) const
- {
- { (void)_aNode; }
- // no-op: there are no changes to collect
- OSL_ENSURE(!hasChanges(_aNode),"Unexpected changes in View");
- }
-
-
-//-----------------------------------------------------------------------------
- com::sun::star::uno::Any ViewStrategy::getValue(ValueNode const& _aNode) const
- {
- checkInstance(_aNode.tree());
- return _aNode.get_impl()->getValue();
- }
-#if OSL_DEBUG_LEVEL > 0
- com::sun::star::uno::Type ViewStrategy::getValueType(ValueNode const& _aNode) const
- {
- checkInstance(_aNode.tree());
- return _aNode.get_impl()->getValueType();
- }
-#endif
-//-----------------------------------------------------------------------------
-// group member access
-
-//-----------------------------------------------------------------------------
- namespace { // helpers
- struct GroupMemberDispatch : data::NodeVisitor
- {
- GroupMemberDispatch(ViewStrategy& _rStrategy, GroupNode const& _aGroup, configuration::GroupMemberVisitor& rVisitor)
- : m_rStrategy(_rStrategy)
- , m_aGroup(_aGroup)
- , m_rVisitor(rVisitor)
- {}
-
- static bool mapResult(configuration::GroupMemberVisitor::Result _aResult)
- {
- return _aResult == configuration::GroupMemberVisitor::DONE;
- }
-
- static configuration::GroupMemberVisitor::Result unmapResult(bool done)
- {
- return done
- ? configuration::GroupMemberVisitor::DONE
- : configuration::GroupMemberVisitor::CONTINUE;
- }
-
- using NodeVisitor::handle;
- virtual bool handle(sharable::Node * node);
- virtual bool handle(sharable::ValueNode * node);
-#if (OSL_DEBUG_LEVEL > 0)
- bool test_value(sharable::Node * node) const;
-#endif
- ViewStrategy& m_rStrategy;
- GroupNode m_aGroup;
- configuration::GroupMemberVisitor& m_rVisitor;
-
- configuration::GroupMemberVisitor::Result m_aResult;
- };
-
-#if (OSL_DEBUG_LEVEL > 0)
- bool GroupMemberDispatch::test_value(sharable::Node * node) const
- {
- return m_rStrategy.hasValue(m_aGroup, node->getName());
- }
-#endif
-
- bool GroupMemberDispatch::handle(sharable::ValueNode * node)
- {
- OSL_ENSURE( test_value(sharable::node(node)), "ERROR: Group MemberDispatch:Did not find a ValueMember for a value child.");
-
- rtl::OUString aValueName = node->info.getName();
-
- return mapResult( m_rVisitor.visit( m_rStrategy.getValue(m_aGroup,aValueName) ) );
- }
-
- bool GroupMemberDispatch::handle(sharable::Node * node)
- {
- (void) node; // avoid warnings
- OSL_ENSURE( !test_value(node), "ERROR: Group MemberDispatch:Found a ValueMember for a subtree child.");
-
- return false;
- }
- }
-//-----------------------------------------------------------------------------
- configuration::ValueMemberNode ViewStrategy::doGetValueMember(GroupNode const& _aNode, rtl::OUString const& _aName, bool ) const
- {
- sharable::ValueNode * valueData = getMemberValueAccess(_aNode,_aName);
- return _aNode.get_impl()->makeValueMember(valueData);
- }
-
- bool ViewStrategy::hasValue(GroupNode const& _aNode, rtl::OUString const& _aName) const
- {
- checkInstance(_aNode.tree());
- return getMemberValueAccess(_aNode,_aName) != 0;
- }
-
- bool ViewStrategy::hasValue(GroupNode const& _aNode) const
- {
- checkInstance(_aNode.tree());
- configuration::GroupNodeImpl* pGroupNode=_aNode.get_impl();
- sharable::GroupNode * group = pGroupNode->getDataAccess();
- return group->numDescendants > 0;
- }
-
-
- bool ViewStrategy::areValueDefaultsAvailable(GroupNode const& _aNode) const
- {
- checkInstance(_aNode.tree());
-
- return _aNode.get_impl()->areValueDefaultsAvailable();
- }
-
- configuration::ValueMemberNode ViewStrategy::getValue(GroupNode const& _aNode, rtl::OUString const& _aName) const
- {
- checkInstance(_aNode.tree());
- return doGetValueMember(_aNode,_aName,false);
- }
-
- configuration::ValueMemberUpdate ViewStrategy::getValueForUpdate(GroupNode const & _aNode, rtl::OUString const& _aName)
- {
- checkInstance(_aNode.tree());
- return configuration::ValueMemberUpdate( doGetValueMember(_aNode,_aName,true), *this );
- }
-
- configuration::GroupMemberVisitor::Result ViewStrategy::dispatchToValues(GroupNode const& _aNode, configuration::GroupMemberVisitor& _aVisitor)
- {
- checkInstance(_aNode.tree());
-
- GroupMemberDispatch aDispatch(*this,_aNode,_aVisitor);
-
- bool done = aDispatch.visitChildren( _aNode.getAccess() );
-
- return aDispatch.unmapResult(done);
- }
-
-//-----------------------------------------------------------------------------
- configuration::ElementTreeData ViewStrategy::implMakeElement(SetNode const& _aNode, configuration::SetEntry const& anEntry) const
- {
- configuration::SetNodeImpl * pNodeData = _aNode.get_impl();
- return pNodeData->implValidateElement(pNodeData->entryToElement(anEntry));
- }
-//-----------------------------------------------------------------------------
- configuration::SetEntry ViewStrategy::implFindElement(SetNode const& _aNode, rtl::OUString const& aName) const
- {
- configuration::SetNodeImpl * pNodeData = _aNode.get_impl();
-
- OSL_ENSURE(pNodeData->implHasLoadedElements(),"Cannot find elements in set that is not loaded");
- configuration::ElementTree * pElement = pNodeData->doFindElement(aName);
-
- return configuration::SetEntry(pElement);
- }
-
- configuration::SetEntry ViewStrategy::findElement(SetNode const& _aNode, rtl::OUString const& aName) const
- {
- checkInstance(_aNode.tree());
- _aNode.get_impl()->implEnsureElementsLoaded();
- return implFindElement(_aNode,aName);
- }
-
- configuration::SetEntry ViewStrategy::findAvailableElement(SetNode const& _aNode, rtl::OUString const& aName) const
- {
- checkInstance(_aNode.tree());
- if (_aNode.get_impl()->implHasLoadedElements())
- return implFindElement(_aNode,aName);
- else
- return configuration::SetEntry(0);
- }
-
- static
- inline
- std::auto_ptr<SubtreeChange> makeChangeToDefault(sharable::SetNode * setNode)
- {
- return std::auto_ptr<SubtreeChange>(
- new SubtreeChange(
- setNode->info.getName(),
- setNode->getElementTemplateName(),
- setNode->getElementTemplateModule(),
- sharable::node(setNode)->getAttributes(),
- true // to default
- ) );
- }
-
- std::auto_ptr<SubtreeChange> ViewStrategy::differenceToDefaultState(SetNode const& _aNode, ISubtree& _rDefaultTree) const
- {
- checkInstance(_aNode.tree());
- std::auto_ptr<SubtreeChange> aResult;
-
- sharable::SetNode * originalSetNode = _aNode.getAccess();
- OSL_ASSERT(originalSetNode != 0);
- if (!originalSetNode->info.isDefault())
- {
- aResult = makeChangeToDefault(originalSetNode);
-
- configuration::SetNodeImpl * pNodeData = _aNode.get_impl();
- if (this->hasChanges(_aNode.node()))
- {
- OSL_ENSURE(pNodeData->implHasLoadedElements(),"Unexpected: Found set with changes but elements are not loaded");
- pNodeData->doDifferenceToDefaultState(*aResult,_rDefaultTree);
- }
- else
- pNodeData->implDifferenceToDefaultState(*aResult,_rDefaultTree);
- }
- return aResult;
- }
-
- rtl::Reference<configuration::Template> ViewStrategy::getElementTemplate(SetNode const& _aNode) const
- {
- checkInstance(_aNode.tree());
- return _aNode.get_impl()->getElementTemplate();
- }
-
- configuration::TemplateProvider ViewStrategy::getTemplateProvider(SetNode const& _aNode) const
- {
- checkInstance(_aNode.tree());
- return _aNode.get_impl()->getTemplateProvider();
- }
-
- node::Attributes ViewStrategy::getNodeAttributes(Node const& _aNode) const
- {
- checkInstance(_aNode.tree());
- return _aNode.getAccessRef()->getAttributes();
- }
-
-//-----------------------------------------------------------------------------
- configuration::SetNodeVisitor::Result ViewStrategy::dispatchToElements(SetNode const& _aNode, configuration::SetNodeVisitor& _aVisitor)
- {
- checkInstance(_aNode.tree());
-
- configuration::SetNodeImpl * pNodeData = _aNode.get_impl();
-
- if (pNodeData->implLoadElements())
- return pNodeData->doDispatchToElements(_aVisitor);
-
- else
- return configuration::SetNodeVisitor::CONTINUE;
- }
-
- bool ViewStrategy::isEmpty(SetNode const& _aNode) const
- {
- checkInstance(_aNode.tree());
-
- configuration::SetNodeImpl * pNodeData = _aNode.get_impl();
-
- return !pNodeData->implLoadElements() || pNodeData->doIsEmpty();
- }
-//-----------------------------------------------------------------------------
-
- void ViewStrategy::insertElement(SetNode const& _aNode, rtl::OUString const& _aName, configuration::SetEntry const& _aNewEntry)
- {
- // cannot insert, if we cannot check for collisions
- checkInstance(_aNode.tree());
- _aNode.get_impl()->implEnsureElementsLoaded();
- doInsertElement(_aNode,_aName,_aNewEntry);
- }
-
- void ViewStrategy::removeElement(SetNode const& _aNode, rtl::OUString const& _aName)
- {
- // cannot remove, if we cannot check for existance
- checkInstance(_aNode.tree());
- _aNode.get_impl()->implEnsureElementsLoaded();
- doRemoveElement(_aNode,_aName);
- }
-
-//-----------------------------------------------------------------------------
- }
-//-----------------------------------------------------------------------------
-}
-
diff --git a/configmgr/source/treemgr/viewstrategy.hxx b/configmgr/source/treemgr/viewstrategy.hxx
deleted file mode 100644
index ad3b5ef7a2..0000000000
--- a/configmgr/source/treemgr/viewstrategy.hxx
+++ /dev/null
@@ -1,228 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_VIEWBEHAVIOR_HXX_
-#define CONFIGMGR_VIEWBEHAVIOR_HXX_
-
-#include "viewnode.hxx"
-#include "groupnodeimpl.hxx"
-#include "setnodeimpl.hxx"
-#include "utility.hxx"
-#include <rtl/ref.hxx>
-#include <salhelper/simplereferenceobject.hxx>
-
-namespace configmgr
-{
-//-----------------------------------------------------------------------------
- namespace configuration
- {
- class SetElementChangeImpl;
- class ValueChangeImpl;
- }
-//-----------------------------------------------------------------------------
- namespace view
- {
-//-----------------------------------------------------------------------------
- struct NodeFactory;
-//-----------------------------------------------------------------------------
- class ViewStrategy : public salhelper::SimpleReferenceObject
- {
- // node attributes
- public:
- /// retrieve the attributes of the node
- rtl::OUString getName(Node const& _aNode) const;
-
- /// retrieve the attributes of the node
- node::Attributes getAttributes(Node const& _aNode) const;
-
- // tracking pending changes
- public:
- void collectChanges(configuration::Tree * tree, configuration::NodeChanges& rChanges) const;
-
- bool hasChanges(configuration::Tree * tree) const;
-
- bool hasChanges(Node const& _aNode) const;
-
- void markChanged(Node const& _aNode);
-
- // commit protocol
- public:
- std::auto_ptr<SubtreeChange> preCommitChanges(configuration::Tree * tree, std::vector< rtl::Reference<configuration::ElementTree> >& _rRemovedElements);
-
- void finishCommit(configuration::Tree * tree, SubtreeChange& rRootChange);
-
- void revertCommit(configuration::Tree * tree, SubtreeChange& rRootChange);
-
- void recoverFailedCommit(configuration::Tree * tree, SubtreeChange& rRootChange);
-
- // notification protocol
- public:
- /// Adjust the internal representation after external changes to the original data - build NodeChangeInformation objects for notification
- void adjustToChanges(configuration::NodeChangesInformation& rLocalChanges, Node const & _aNode, SubtreeChange const& aExternalChange);
-
- // visitor dispatch
- public:
- configuration::GroupMemberVisitor::Result dispatchToValues(GroupNode const& _aNode, configuration::GroupMemberVisitor& _aVisitor);
-
- /// Call <code>aVisitor.visit(aElement)</code> for each element in this set until SetNodeVisitor::DONE is returned.
- configuration::SetNodeVisitor::Result dispatchToElements(SetNode const& _aNode, configuration::SetNodeVisitor& _aVisitor);
-
- // value (element) node specific operations
- public:
- /// Does this node assume its default value
- /// retrieve the current value of this node
- com::sun::star::uno::Any getValue(ValueNode const& _aNode) const;
-#if OSL_DEBUG_LEVEL > 0
- /// get the type of this value
- com::sun::star::uno::Type getValueType(ValueNode const& _aNode) const;
-#endif
-
- // group node specific operations
- public:
- /// does this hold a child value of the given name
- bool hasValue(GroupNode const& _aNode, rtl::OUString const& _aName) const;
-
- /// does this hold a child value
- bool hasValue(GroupNode const& _aNode) const;
-
- /// are defaults for this node available ?
- bool areValueDefaultsAvailable(GroupNode const& _aNode) const;
-
- /// retrieve data for the child value of the given name
- configuration::ValueMemberNode getValue(GroupNode const& _aNode, rtl::OUString const& _aName) const;
-
- /// retrieve data for updating the child value of the given name
- configuration::ValueMemberUpdate getValueForUpdate(GroupNode const & _aNode, rtl::OUString const& _aName);
-
- // set node specific operations
- public:
- /// does this set contain any elements (loads elements if needed)
- bool isEmpty(SetNode const& _aNode) const;
-
- /// does this set contain an element named <var>aName</var> (loads elements if needed)
- configuration::SetEntry findElement(SetNode const& _aNode, rtl::OUString const& aName) const;
-
- /// does this set contain an element named <var>aName</var> (and is that element loaded ?)
- configuration::SetEntry findAvailableElement(SetNode const& _aNode, rtl::OUString const& aName) const;
-
- /// insert a new entry into this set
- void insertElement(SetNode const& _aNode, rtl::OUString const& aName, configuration::SetEntry const& aNewEntry);
-
- /// remove an existing entry into this set
- void removeElement(SetNode const& _aNode, rtl::OUString const& aName);
-
- /** Create a Subtree change as 'diff' which allows transforming the set to its default state
- (given that <var>_rDefaultTree</var> points to a default instance of this set)
- <p>Ownership of added trees should be transferred to the SubtreeChange.</p>
- */
- std::auto_ptr<SubtreeChange> differenceToDefaultState(SetNode const& _aNode, ISubtree& _rDefaultTree) const;
-
- /// Get the template that describes elements of this set
- rtl::Reference<configuration::Template> getElementTemplate(SetNode const& _aNode) const;
-
- /// Get a template provider that can create new elements for this set
- configuration::TemplateProvider getTemplateProvider(SetNode const& _aNode) const;
-
- // create a configuration::Tree * from a configuration::SetEntry
- configuration::Tree * extractTree(configuration::SetEntry const& _anEntry);
-
- // creating/changing state/strategy
- public:
- NodeFactory& getNodeFactory();
-
- // access to node innards
- protected:
- /// provide access to the address of the underlying node
- sharable::Node * getNodeAddress(Node const& _aNode) const;
-
- /// retrieve the attributes of the underlying node
- node::Attributes getNodeAttributes(Node const& _aNode) const;
-
- protected:
- //helper for migration to new (info based) model for adjusting to changes
- static void addLocalChangeHelper( configuration::NodeChangesInformation& rLocalChanges, configuration::NodeChange const& aChange);
-
- private:
- void implAdjustToValueChanges(configuration::NodeChangesInformation& rLocalChanges, GroupNode const& _aGroupNode, SubtreeChange const& rExternalChanges);
- void implAdjustToSubChanges(configuration::NodeChangesInformation& rLocalChanges, GroupNode const & _aGroupNode, SubtreeChange const& rExternalChanges);
- void implAdjustToElementChanges(configuration::NodeChangesInformation& rLocalChanges, SetNode const& _aNode, SubtreeChange const& rExternalChanges, unsigned int nDepth);
- void implAdjustToElementChange (configuration::NodeChangesInformation& rLocalChanges, SetNode const& _aNode, Change const& rElementChange, unsigned int nElementDepth);
- void implCommitDirectIn(sharable::TreeFragment * placeHolder, Node const& _aNode);
-
- protected:
- void checkInstance(configuration::Tree * tree) const;
- configuration::SetEntry implFindElement(SetNode const& _aNode, rtl::OUString const& aName) const;
- configuration::ElementTreeData implMakeElement(SetNode const& _aNode, configuration::SetEntry const& anEntry) const;
-
- // virtual interface - these functions must be provided
- private:
- // change handling
- virtual bool doHasChanges(Node const& _aNode) const = 0;
- virtual void doMarkChanged(Node const& _aNode) = 0;
-
- virtual NodeFactory& doGetNodeFactory() = 0;
-
- // virtual interface - these functions all have default implementations without support for pending changes
- protected:
- // change handling
- virtual void doCollectChanges(Node const& _aNode, configuration::NodeChanges& rChanges) const;
-
- // commit protocol
- virtual std::auto_ptr<SubtreeChange> doPreCommitChanges(configuration::Tree * tree, std::vector< rtl::Reference<configuration::ElementTree> >& _rRemovedElements);
- virtual void doFailedCommit(configuration::Tree * tree, SubtreeChange& rChanges);
- virtual void doFinishCommit(configuration::Tree * tree, SubtreeChange& rChanges);
- virtual void doRevertCommit(configuration::Tree * tree, SubtreeChange& rChanges);
-
- // notification protocol
- virtual configuration::ValueChangeImpl* doAdjustToValueChange(GroupNode const& _aGroupNode, rtl::OUString const& aName, ValueChange const& rExternalChange);
-
- // common attributes
- virtual node::Attributes doAdjustAttributes(node::Attributes const& _aAttributes) const = 0;
-
- // group member access
- virtual configuration::ValueMemberNode doGetValueMember(GroupNode const& _aNode, rtl::OUString const& _aName, bool _bForUpdate) const = 0;
-
- // set element access
- virtual void doInsertElement(SetNode const& _aNode, rtl::OUString const& aName, configuration::SetEntry const& aNewEntry) = 0;
- virtual void doRemoveElement(SetNode const& _aNode, rtl::OUString const& aName) = 0;
- };
-
- inline node::Attributes ViewStrategy::getAttributes(Node const& _aNode) const
- { return doAdjustAttributes(getNodeAttributes(_aNode)); }
-
- inline bool ViewStrategy::hasChanges(Node const& _aNode) const
- { return doHasChanges(_aNode); }
-
- inline NodeFactory& ViewStrategy::getNodeFactory()
- { return doGetNodeFactory(); }
-
-//-----------------------------------------------------------------------------
- }
-//-----------------------------------------------------------------------------
-}
-
-#endif // CONFIGMGR_CONFIGNODEBEHAVIOR_HXX_
diff --git a/configmgr/source/type.cxx b/configmgr/source/type.cxx
new file mode 100644
index 0000000000..e1b8a95859
--- /dev/null
+++ b/configmgr/source/type.cxx
@@ -0,0 +1,187 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "com/sun/star/uno/Type.hxx"
+#include "com/sun/star/uno/TypeClass.hpp"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "cppu/unotype.hxx"
+#include "osl/diagnose.h"
+#include "rtl/string.h"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+
+#include "type.hxx"
+
+namespace configmgr {
+
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
+bool isListType(Type type) {
+ return type >= TYPE_BOOLEAN_LIST;
+}
+
+Type elementType(Type type) {
+ switch (type) {
+ case TYPE_BOOLEAN_LIST:
+ return TYPE_BOOLEAN;
+ case TYPE_SHORT_LIST:
+ return TYPE_SHORT;
+ case TYPE_INT_LIST:
+ return TYPE_INT;
+ case TYPE_LONG_LIST:
+ return TYPE_LONG;
+ case TYPE_DOUBLE_LIST:
+ return TYPE_DOUBLE;
+ case TYPE_STRING_LIST:
+ return TYPE_STRING;
+ case TYPE_HEXBINARY_LIST:
+ return TYPE_HEXBINARY;
+ default:
+ OSL_ASSERT(false);
+ throw css::uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("this cannot happen")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+}
+
+css::uno::Type mapType(Type type) {
+ switch (type) {
+ case TYPE_ANY:
+ return cppu::UnoType< css::uno::Any >::get();
+ case TYPE_BOOLEAN:
+ return cppu::UnoType< sal_Bool >::get();
+ case TYPE_SHORT:
+ return cppu::UnoType< sal_Int16 >::get();
+ case TYPE_INT:
+ return cppu::UnoType< sal_Int32 >::get();
+ case TYPE_LONG:
+ return cppu::UnoType< sal_Int64 >::get();
+ case TYPE_DOUBLE:
+ return cppu::UnoType< double >::get();
+ case TYPE_STRING:
+ return cppu::UnoType< rtl::OUString >::get();
+ case TYPE_HEXBINARY:
+ return cppu::UnoType< css::uno::Sequence< sal_Int8 > >::get();
+ case TYPE_BOOLEAN_LIST:
+ return cppu::UnoType< css::uno::Sequence< sal_Bool > >::get();
+ case TYPE_SHORT_LIST:
+ return cppu::UnoType< css::uno::Sequence< sal_Int16 > >::get();
+ case TYPE_INT_LIST:
+ return cppu::UnoType< css::uno::Sequence< sal_Int32 > >::get();
+ case TYPE_LONG_LIST:
+ return cppu::UnoType< css::uno::Sequence< sal_Int64 > >::get();
+ case TYPE_DOUBLE_LIST:
+ return cppu::UnoType< css::uno::Sequence< double > >::get();
+ case TYPE_STRING_LIST:
+ return cppu::UnoType< css::uno::Sequence< rtl::OUString > >::get();
+ case TYPE_HEXBINARY_LIST:
+ return cppu::UnoType<
+ css::uno::Sequence< css::uno::Sequence< sal_Int8 > > >::get();
+ default:
+ OSL_ASSERT(false);
+ throw css::uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("this cannot happen")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+}
+
+Type getDynamicType(css::uno::Any const & value) {
+ switch (value.getValueType().getTypeClass()) {
+ case css::uno::TypeClass_VOID:
+ return TYPE_NIL;
+ case css::uno::TypeClass_BOOLEAN:
+ return TYPE_BOOLEAN;
+ case css::uno::TypeClass_BYTE:
+ return TYPE_SHORT;
+ case css::uno::TypeClass_SHORT:
+ return TYPE_SHORT;
+ case css::uno::TypeClass_UNSIGNED_SHORT:
+ return value.has< sal_Int16 >() ? TYPE_SHORT : TYPE_INT;
+ case css::uno::TypeClass_LONG:
+ return TYPE_INT;
+ case css::uno::TypeClass_UNSIGNED_LONG:
+ return value.has< sal_Int32 >() ? TYPE_INT : TYPE_LONG;
+ case css::uno::TypeClass_HYPER:
+ return TYPE_LONG;
+ case css::uno::TypeClass_UNSIGNED_HYPER:
+ return value.has< sal_Int64 >() ? TYPE_LONG : TYPE_ERROR;
+ case css::uno::TypeClass_FLOAT:
+ case css::uno::TypeClass_DOUBLE:
+ return TYPE_DOUBLE;
+ case css::uno::TypeClass_STRING:
+ return TYPE_STRING;
+ case css::uno::TypeClass_SEQUENCE: //TODO
+ {
+ rtl::OUString name(value.getValueType().getTypeName());
+ if (name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("[]byte"))) {
+ return TYPE_HEXBINARY;
+ } else if (name.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("[]boolean")))
+ {
+ return TYPE_BOOLEAN_LIST;
+ } else if (name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("[]short")))
+ {
+ return TYPE_SHORT_LIST;
+ } else if (name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("[]long")))
+ {
+ return TYPE_INT_LIST;
+ } else if (name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("[]hyper")))
+ {
+ return TYPE_LONG_LIST;
+ } else if (name.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("[]double")))
+ {
+ return TYPE_DOUBLE_LIST;
+ } else if (name.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("[]string")))
+ {
+ return TYPE_STRING_LIST;
+ } else if (name.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("[][]byte")))
+ {
+ return TYPE_HEXBINARY_LIST;
+ }
+ }
+ // fall through
+ default:
+ return TYPE_ERROR;
+ }
+}
+
+}
diff --git a/configmgr/source/type.hxx b/configmgr/source/type.hxx
new file mode 100644
index 0000000000..85edc9b5e9
--- /dev/null
+++ b/configmgr/source/type.hxx
@@ -0,0 +1,56 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_TYPE_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_TYPE_HXX
+
+#include "sal/config.h"
+
+namespace com { namespace sun { namespace star { namespace uno {
+ class Any;
+ class Type;
+} } } }
+
+namespace configmgr {
+
+enum Type {
+ TYPE_ERROR, TYPE_NIL, TYPE_ANY, TYPE_BOOLEAN, TYPE_SHORT, TYPE_INT,
+ TYPE_LONG, TYPE_DOUBLE, TYPE_STRING, TYPE_HEXBINARY, TYPE_BOOLEAN_LIST,
+ TYPE_SHORT_LIST, TYPE_INT_LIST, TYPE_LONG_LIST, TYPE_DOUBLE_LIST,
+ TYPE_STRING_LIST, TYPE_HEXBINARY_LIST };
+
+bool isListType(Type type);
+
+Type elementType(Type type);
+
+com::sun::star::uno::Type mapType(Type type);
+
+Type getDynamicType(com::sun::star::uno::Any const & value);
+
+}
+
+#endif
diff --git a/configmgr/source/update.cxx b/configmgr/source/update.cxx
new file mode 100644
index 0000000000..ab711c3bec
--- /dev/null
+++ b/configmgr/source/update.cxx
@@ -0,0 +1,66 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include "configmgr/update.hxx"
+#include "osl/mutex.hxx"
+#include "rtl/ref.hxx"
+#include "rtl/ustring.hxx"
+
+#include "broadcaster.hxx"
+#include "components.hxx"
+#include "lock.hxx"
+#include "modifications.hxx"
+#include "rootaccess.hxx"
+
+namespace configmgr {
+
+namespace update {
+
+void insertExtensionXcsFile(bool shared, rtl::OUString const & fileUri) {
+ osl::MutexGuard g(lock);
+ Components::getSingleton().insertExtensionXcsFile(shared, fileUri);
+}
+
+void insertExtensionXcuFile(bool shared, rtl::OUString const & fileUri) {
+ Broadcaster bc;
+ {
+ osl::MutexGuard g(lock);
+ Modifications mods;
+ Components::getSingleton().insertExtensionXcuFile(
+ shared, fileUri, &mods);
+ Components::getSingleton().initGlobalBroadcaster(
+ mods, rtl::Reference< RootAccess >(), &bc);
+ }
+ bc.send();
+}
+
+}
+
+}
diff --git a/configmgr/source/valueparser.cxx b/configmgr/source/valueparser.cxx
new file mode 100644
index 0000000000..f951aac5ca
--- /dev/null
+++ b/configmgr/source/valueparser.cxx
@@ -0,0 +1,476 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "comphelper/sequenceasvector.hxx"
+#include "osl/diagnose.h"
+#include "rtl/string.h"
+#include "rtl/string.hxx"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+
+#include "localizedvaluenode.hxx"
+#include "node.hxx"
+#include "nodemap.hxx"
+#include "propertynode.hxx"
+#include "span.hxx"
+#include "type.hxx"
+#include "valueparser.hxx"
+#include "xmldata.hxx"
+#include "xmlreader.hxx"
+
+namespace configmgr {
+
+namespace {
+
+namespace css = com::sun::star;
+
+bool parseHexDigit(char c, int * value) {
+ OSL_ASSERT(value != 0);
+ if (c >= '0' && c <= '9') {
+ *value = c - '0';
+ return true;
+ }
+ if (c >= 'A' && c <= 'F') {
+ *value = c - 'A' + 10;
+ return true;
+ }
+ if (c >= 'a' && c <= 'f') {
+ *value = c - 'a' + 10;
+ return true;
+ }
+ return false;
+}
+
+bool parseValue(Span const & text, sal_Bool * value) {
+ OSL_ASSERT(text.is() && value != 0);
+ if (text.equals(RTL_CONSTASCII_STRINGPARAM("true")) ||
+ text.equals(RTL_CONSTASCII_STRINGPARAM("1")))
+ {
+ *value = true;
+ return true;
+ }
+ if (text.equals(RTL_CONSTASCII_STRINGPARAM("false")) ||
+ text.equals(RTL_CONSTASCII_STRINGPARAM("0")))
+ {
+ *value = false;
+ return true;
+ }
+ return false;
+}
+
+bool parseValue(Span const & text, sal_Int16 * value) {
+ OSL_ASSERT(text.is() && value != 0);
+ // For backwards compatibility, support hexadecimal values:
+ sal_Int32 n =
+ rtl_str_shortenedCompareIgnoreAsciiCase_WithLength(
+ text.begin, text.length, RTL_CONSTASCII_STRINGPARAM("0X"),
+ RTL_CONSTASCII_LENGTH("0X")) == 0 ?
+ rtl::OString(
+ text.begin + RTL_CONSTASCII_LENGTH("0X"),
+ text.length - RTL_CONSTASCII_LENGTH("0X")).toInt32(16) :
+ rtl::OString(text.begin, text.length).toInt32();
+ //TODO: check valid lexical representation
+ if (n >= SAL_MIN_INT16 && n <= SAL_MAX_INT16) {
+ *value = static_cast< sal_Int16 >(n);
+ return true;
+ }
+ return false;
+}
+
+bool parseValue(Span const & text, sal_Int32 * value) {
+ OSL_ASSERT(text.is() && value != 0);
+ // For backwards compatibility, support hexadecimal values:
+ *value =
+ rtl_str_shortenedCompareIgnoreAsciiCase_WithLength(
+ text.begin, text.length, RTL_CONSTASCII_STRINGPARAM("0X"),
+ RTL_CONSTASCII_LENGTH("0X")) == 0 ?
+ rtl::OString(
+ text.begin + RTL_CONSTASCII_LENGTH("0X"),
+ text.length - RTL_CONSTASCII_LENGTH("0X")).toInt32(16) :
+ rtl::OString(text.begin, text.length).toInt32();
+ //TODO: check valid lexical representation
+ return true;
+}
+
+bool parseValue(Span const & text, sal_Int64 * value) {
+ OSL_ASSERT(text.is() && value != 0);
+ // For backwards compatibility, support hexadecimal values:
+ *value =
+ rtl_str_shortenedCompareIgnoreAsciiCase_WithLength(
+ text.begin, text.length, RTL_CONSTASCII_STRINGPARAM("0X"),
+ RTL_CONSTASCII_LENGTH("0X")) == 0 ?
+ rtl::OString(
+ text.begin + RTL_CONSTASCII_LENGTH("0X"),
+ text.length - RTL_CONSTASCII_LENGTH("0X")).toInt64(16) :
+ rtl::OString(text.begin, text.length).toInt64();
+ //TODO: check valid lexical representation
+ return true;
+}
+
+bool parseValue(Span const & text, double * value) {
+ OSL_ASSERT(text.is() && value != 0);
+ *value = rtl::OString(text.begin, text.length).toDouble();
+ //TODO: check valid lexical representation
+ return true;
+}
+
+bool parseValue(Span const & text, rtl::OUString * value) {
+ OSL_ASSERT(text.is() && value != 0);
+ *value = xmldata::convertFromUtf8(text);
+ return true;
+}
+
+bool parseValue(Span const & text, css::uno::Sequence< sal_Int8 > * value) {
+ OSL_ASSERT(text.is() && value != 0);
+ if ((text.length & 1) != 0) {
+ return false;
+ }
+ comphelper::SequenceAsVector< sal_Int8 > seq;
+ for (sal_Int32 i = 0; i != text.length;) {
+ int n1;
+ int n2;
+ if (!parseHexDigit(text.begin[i++], &n1) ||
+ !parseHexDigit(text.begin[i++], &n2))
+ {
+ return false;
+ }
+ seq.push_back(static_cast< sal_Int8 >((n1 << 4) | n2));
+ }
+ *value = seq.getAsConstList();
+ return true;
+}
+
+template< typename T > css::uno::Any parseSingleValue(Span const & text) {
+ T val;
+ if (!parseValue(text, &val)) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("invalid value")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ return css::uno::makeAny(val);
+}
+
+template< typename T > css::uno::Any parseListValue(
+ rtl::OString const & separator, Span const & text)
+{
+ comphelper::SequenceAsVector< T > seq;
+ Span sep;
+ if (separator.getLength() == 0) {
+ sep = Span(RTL_CONSTASCII_STRINGPARAM(" "));
+ } else {
+ sep = Span(separator.getStr(), separator.getLength());
+ }
+ if (text.length != 0) {
+ for (Span t(text);;) {
+ sal_Int32 i = rtl_str_indexOfStr_WithLength(
+ t.begin, t.length, sep.begin, sep.length);
+ T val;
+ if (!parseValue(Span(t.begin, i == -1 ? t.length : i), &val)) {
+ throw css::uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("invalid value")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ seq.push_back(val);
+ if (i < 0) {
+ break;
+ }
+ t.begin += i + sep.length;
+ t.length -= i + sep.length;
+ }
+ }
+ return css::uno::makeAny(seq.getAsConstList());
+}
+
+css::uno::Any parseValue(
+ rtl::OString const & separator, Span const & text, Type type)
+{
+ switch (type) {
+ case TYPE_ANY:
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("invalid value of type any")),
+ css::uno::Reference< css::uno::XInterface >());
+ case TYPE_BOOLEAN:
+ return parseSingleValue< sal_Bool >(text);
+ case TYPE_SHORT:
+ return parseSingleValue< sal_Int16 >(text);
+ case TYPE_INT:
+ return parseSingleValue< sal_Int32 >(text);
+ case TYPE_LONG:
+ return parseSingleValue< sal_Int64 >(text);
+ case TYPE_DOUBLE:
+ return parseSingleValue< double >(text);
+ case TYPE_STRING:
+ return parseSingleValue< rtl::OUString >(text);
+ case TYPE_HEXBINARY:
+ return parseSingleValue< css::uno::Sequence< sal_Int8 > >(text);
+ case TYPE_BOOLEAN_LIST:
+ return parseListValue< sal_Bool >(separator, text);
+ case TYPE_SHORT_LIST:
+ return parseListValue< sal_Int16 >(separator, text);
+ case TYPE_INT_LIST:
+ return parseListValue< sal_Int32 >(separator, text);
+ case TYPE_LONG_LIST:
+ return parseListValue< sal_Int64 >(separator, text);
+ case TYPE_DOUBLE_LIST:
+ return parseListValue< double >(separator, text);
+ case TYPE_STRING_LIST:
+ return parseListValue< rtl::OUString >(separator, text);
+ case TYPE_HEXBINARY_LIST:
+ return parseListValue< css::uno::Sequence< sal_Int8 > >(
+ separator, text);
+ default:
+ OSL_ASSERT(false);
+ throw css::uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("this cannot happen")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+}
+
+}
+
+ValueParser::ValueParser(int layer): layer_(layer) {}
+
+ValueParser::~ValueParser() {}
+
+XmlReader::Text ValueParser::getTextMode() const {
+ if (node_.is()) {
+ switch (state_) {
+ case STATE_TEXT:
+ case STATE_IT:
+ return
+ (type_ == TYPE_STRING || type_ == TYPE_STRING_LIST ||
+ separator_.getLength() != 0)
+ ? XmlReader::TEXT_RAW : XmlReader::TEXT_NORMALIZED;
+ default:
+ break;
+ }
+ }
+ return XmlReader::TEXT_NONE;
+}
+
+bool ValueParser::startElement(
+ XmlReader & reader, XmlReader::Namespace ns, Span const & name)
+{
+ if (!node_.is()) {
+ return false;
+ }
+ switch (state_) {
+ case STATE_TEXT:
+ if (ns == XmlReader::NAMESPACE_NONE &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("it")) &&
+ isListType(type_) && separator_.getLength() == 0)
+ {
+ checkEmptyPad(reader);
+ state_ = STATE_IT;
+ return true;
+ }
+ // fall through
+ case STATE_IT:
+ if (ns == XmlReader::NAMESPACE_NONE &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("unicode")) &&
+ (type_ == TYPE_STRING || type_ == TYPE_STRING_LIST))
+ {
+ sal_Int32 scalar = -1;
+ for (;;) {
+ XmlReader::Namespace attrNs;
+ Span attrLn;
+ if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ break;
+ }
+ if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("scalar")))
+ {
+ if (!parseValue(reader.getAttributeValue(true), &scalar)) {
+ scalar = -1;
+ }
+ break;
+ }
+ }
+ if (scalar >= 0 && scalar < 0x20 && scalar != 0x09 &&
+ scalar != 0x0A && scalar != 0x0D)
+ {
+ char c = static_cast< char >(scalar);
+ pad_.add(&c, 1);
+ } else if (scalar == 0xFFFE) {
+ pad_.add(RTL_CONSTASCII_STRINGPARAM("\xEF\xBF\xBE"));
+ } else if (scalar == 0xFFFF) {
+ pad_.add(RTL_CONSTASCII_STRINGPARAM("\xEF\xBF\xBF"));
+ } else {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "bad unicode scalar attribute in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ state_ = State(state_ + 1);
+ return true;
+ }
+ break;
+ default:
+ break;
+ }
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad member <")) +
+ xmldata::convertFromUtf8(name) +
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+}
+
+bool ValueParser::endElement(XmlReader const & reader) {
+ if (!node_.is()) {
+ return false;
+ }
+ switch (state_) {
+ case STATE_TEXT:
+ {
+ css::uno::Any value;
+ if (items_.empty()) {
+ value = parseValue(separator_, pad_.get(), type_);
+ pad_.clear();
+ } else {
+ checkEmptyPad(reader);
+ switch (type_) {
+ case TYPE_BOOLEAN_LIST:
+ value = convertItems< sal_Bool >();
+ break;
+ case TYPE_SHORT_LIST:
+ value = convertItems< sal_Int16 >();
+ break;
+ case TYPE_INT_LIST:
+ value = convertItems< sal_Int32 >();
+ break;
+ case TYPE_LONG_LIST:
+ value = convertItems< sal_Int64 >();
+ break;
+ case TYPE_DOUBLE_LIST:
+ value = convertItems< double >();
+ break;
+ case TYPE_STRING_LIST:
+ value = convertItems< rtl::OUString >();
+ break;
+ case TYPE_HEXBINARY_LIST:
+ value = convertItems< css::uno::Sequence< sal_Int8 > >();
+ break;
+ default:
+ OSL_ASSERT(false); // this cannot happen
+ break;
+ }
+ items_.clear();
+ }
+ switch (node_->kind()) {
+ case Node::KIND_PROPERTY:
+ dynamic_cast< PropertyNode * >(node_.get())->setValue(
+ layer_, value);
+ break;
+ case Node::KIND_LOCALIZED_PROPERTY:
+ {
+ NodeMap::iterator i(
+ node_->getMembers().find(localizedName_));
+ if (i == node_->getMembers().end()) {
+ node_->getMembers().insert(
+ NodeMap::value_type(
+ localizedName_,
+ new LocalizedValueNode(layer_, value)));
+ } else {
+ dynamic_cast< LocalizedValueNode * >(i->second.get())->
+ setValue(layer_, value);
+ }
+ }
+ break;
+ default:
+ OSL_ASSERT(false); // this cannot happen
+ break;
+ }
+ separator_ = rtl::OString();
+ node_.clear();
+ }
+ break;
+ case STATE_TEXT_UNICODE:
+ case STATE_IT_UNICODE:
+ state_ = State(state_ - 1);
+ break;
+ case STATE_IT:
+ items_.push_back(
+ parseValue(rtl::OString(), pad_.get(), elementType(type_)));
+ pad_.clear();
+ state_ = STATE_TEXT;
+ break;
+ }
+ return true;
+}
+
+void ValueParser::characters(Span const & text) {
+ if (node_.is()) {
+ OSL_ASSERT(state_ == STATE_TEXT || state_ == STATE_IT);
+ pad_.add(text.begin, text.length);
+ }
+}
+
+void ValueParser::start(
+ rtl::Reference< Node > const & node, rtl::OUString const & localizedName)
+{
+ OSL_ASSERT(node.is() && !node_.is());
+ node_ = node;
+ localizedName_ = localizedName;
+ state_ = STATE_TEXT;
+}
+
+int ValueParser::getLayer() const {
+ return layer_;
+}
+
+void ValueParser::checkEmptyPad(XmlReader const & reader) const {
+ if (pad_.is()) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "mixed text and <it> elements in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+}
+
+template< typename T > css::uno::Any ValueParser::convertItems() {
+ css::uno::Sequence< T > seq(items_.size());
+ for (sal_Int32 i = 0; i < seq.getLength(); ++i) {
+ OSL_VERIFY(items_[i] >>= seq[i]);
+ }
+ return css::uno::makeAny(seq);
+}
+
+}
diff --git a/configmgr/source/valueparser.hxx b/configmgr/source/valueparser.hxx
new file mode 100644
index 0000000000..c328fe7edd
--- /dev/null
+++ b/configmgr/source/valueparser.hxx
@@ -0,0 +1,94 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_VALUEPARSER_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_VALUEPARSER_HXX
+
+#include "sal/config.h"
+
+#include <vector>
+
+#include "boost/noncopyable.hpp"
+#include "rtl/ref.hxx"
+#include "rtl/string.hxx"
+#include "rtl/ustring.hxx"
+
+#include "pad.hxx"
+#include "type.hxx"
+#include "xmlreader.hxx"
+
+namespace com { namespace sun { namespace star { namespace uno {
+ class Any;
+} } } }
+
+namespace configmgr {
+
+class Node;
+struct Span;
+
+class ValueParser: private boost::noncopyable {
+public:
+ ValueParser(int layer);
+
+ ~ValueParser();
+
+ XmlReader::Text getTextMode() const;
+
+ bool startElement(
+ XmlReader & reader, XmlReader::Namespace ns, Span const & name);
+
+ bool endElement(XmlReader const & reader);
+
+ void characters(Span const & text);
+
+ void start(
+ rtl::Reference< Node > const & property,
+ rtl::OUString const & localizedName = rtl::OUString());
+
+ int getLayer() const;
+
+ Type type_;
+ rtl::OString separator_;
+
+private:
+ void checkEmptyPad(XmlReader const & reader) const;
+
+ template< typename T > com::sun::star::uno::Any convertItems();
+
+ enum State { STATE_TEXT, STATE_TEXT_UNICODE, STATE_IT, STATE_IT_UNICODE };
+
+ int layer_;
+ rtl::Reference< Node > node_;
+ rtl::OUString localizedName_;
+ State state_;
+ Pad pad_;
+ std::vector< com::sun::star::uno::Any > items_;
+};
+
+}
+
+#endif
diff --git a/configmgr/source/writemodfile.cxx b/configmgr/source/writemodfile.cxx
new file mode 100644
index 0000000000..a8e0f77cbd
--- /dev/null
+++ b/configmgr/source/writemodfile.cxx
@@ -0,0 +1,631 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "osl/diagnose.h"
+#include "osl/file.h"
+#include "osl/file.hxx"
+#include "rtl/string.h"
+#include "rtl/string.hxx"
+#include "rtl/textcvt.h"
+#include "rtl/textenc.h"
+#include "rtl/ustrbuf.hxx"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+
+#include "data.hxx"
+#include "groupnode.hxx"
+#include "localizedpropertynode.hxx"
+#include "localizedvaluenode.hxx"
+#include "modifications.hxx"
+#include "node.hxx"
+#include "nodemap.hxx"
+#include "propertynode.hxx"
+#include "span.hxx"
+#include "type.hxx"
+#include "writemodfile.hxx"
+
+namespace configmgr {
+
+class Components;
+
+namespace {
+
+namespace css = com::sun::star;
+
+rtl::OString convertToUtf8(
+ rtl::OUString const & text, sal_Int32 offset, sal_Int32 length)
+{
+ OSL_ASSERT(
+ offset <= text.getLength() && text.getLength() - offset >= length);
+ rtl::OString s;
+ if (!rtl_convertUStringToString(
+ &s.pData, text.pData->buffer + offset, length,
+ RTL_TEXTENCODING_UTF8,
+ (RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR |
+ RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR)))
+ {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("cannot convert to UTF-8")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ return s;
+}
+
+struct TempFile: public boost::noncopyable {
+ rtl::OUString url;
+ oslFileHandle handle;
+ bool closed;
+
+ TempFile(): handle(0), closed(false) {}
+
+ ~TempFile();
+};
+
+TempFile::~TempFile() {
+ if (handle != 0) {
+ if (!closed) {
+ oslFileError e = osl_closeFile(handle);
+ if (e != osl_File_E_None) {
+ OSL_TRACE(
+ "osl_closeFile failed with %ld", static_cast< long >(e));
+ }
+ }
+ osl::FileBase::RC e = osl::File::remove(url);
+ if (e != osl::FileBase::E_None) {
+ OSL_TRACE("osl_removeFile failed with %ld", static_cast< long >(e));
+ }
+ }
+}
+
+void writeData(oslFileHandle handle, char const * begin, sal_Int32 length) {
+ OSL_ASSERT(length >= 0);
+ sal_uInt64 n;
+ if ((osl_writeFile(handle, begin, static_cast< sal_uInt32 >(length), &n) !=
+ osl_File_E_None) ||
+ n != static_cast< sal_uInt32 >(length))
+ {
+ throw css::uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("write failure")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+}
+
+void writeData(oslFileHandle handle, rtl::OString const & text) {
+ writeData(handle, text.getStr(), text.getLength());
+}
+
+void writeAttributeValue(oslFileHandle handle, rtl::OUString const & value) {
+ sal_Int32 i = 0;
+ sal_Int32 j = i;
+ for (; j < value.getLength(); ++j) {
+ OSL_ASSERT(
+ value[j] == 0x0009 || value[j] == 0x000A || value[j] == 0x000D ||
+ (value[j] >= 0x0020 && value[j] != 0xFFFE && value[j] != 0xFFFF));
+ switch(value[j]) {
+ case '\x09':
+ writeData(handle, convertToUtf8(value, i, j - i));
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("&#9;"));
+ i = j + 1;
+ break;
+ case '\x0A':
+ writeData(handle, convertToUtf8(value, i, j - i));
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("&#xA;"));
+ i = j + 1;
+ break;
+ case '\x0D':
+ writeData(handle, convertToUtf8(value, i, j - i));
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("&#xD;"));
+ i = j + 1;
+ break;
+ case '"':
+ writeData(handle, convertToUtf8(value, i, j - i));
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("&quot;"));
+ i = j + 1;
+ break;
+ case '&':
+ writeData(handle, convertToUtf8(value, i, j - i));
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("&amp;"));
+ i = j + 1;
+ break;
+ case '<':
+ writeData(handle, convertToUtf8(value, i, j - i));
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("&lt;"));
+ i = j + 1;
+ break;
+ default:
+ break;
+ }
+ }
+ writeData(handle, convertToUtf8(value, i, j - i));
+}
+
+void writeValueContent(oslFileHandle handle, sal_Bool value) {
+ if (value) {
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("true"));
+ } else {
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("false"));
+ }
+}
+
+void writeValueContent(oslFileHandle handle, sal_Int16 value) {
+ writeData(handle, rtl::OString::valueOf(static_cast< sal_Int32 >(value)));
+}
+
+void writeValueContent(oslFileHandle handle, sal_Int32 value) {
+ writeData(handle, rtl::OString::valueOf(value));
+}
+
+void writeValueContent(oslFileHandle handle, sal_Int64 value) {
+ writeData(handle, rtl::OString::valueOf(value));
+}
+
+void writeValueContent(oslFileHandle handle, double value) {
+ writeData(handle, rtl::OString::valueOf(value));
+}
+
+void writeValueContent(oslFileHandle handle, rtl::OUString const & value) {
+ sal_Int32 i = 0;
+ sal_Int32 j = i;
+ for (; j < value.getLength(); ++j) {
+ sal_Unicode c = value[j];
+ if ((c < 0x0020 && c != 0x0009 && c != 0x000A && c != 0x000D) ||
+ c == 0xFFFE || c == 0xFFFF)
+ {
+ writeData(handle, convertToUtf8(value, i, j - i));
+ writeData(
+ handle, RTL_CONSTASCII_STRINGPARAM("<unicode oor:scalar=\""));
+ writeData(
+ handle, rtl::OString::valueOf(static_cast< sal_Int32 >(c)));
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("\"/>"));
+ i = j + 1;
+ } else if (c == '\x0D') {
+ writeData(handle, convertToUtf8(value, i, j - i));
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("&#xD;"));
+ i = j + 1;
+ } else if (c == '&') {
+ writeData(handle, convertToUtf8(value, i, j - i));
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("&amp;"));
+ i = j + 1;
+ } else if (c == '<') {
+ writeData(handle, convertToUtf8(value, i, j - i));
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("&lt;"));
+ i = j + 1;
+ } else if (c == '>') {
+ // "MUST, for compatibility, be escaped [...] when it appears in the
+ // string ']]>'":
+ writeData(handle, convertToUtf8(value, i, j - i));
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("&gt;"));
+ i = j + 1;
+ }
+ }
+ writeData(handle, convertToUtf8(value, i, j - i));
+}
+
+void writeValueContent(
+ oslFileHandle handle, css::uno::Sequence< sal_Int8 > const & value)
+{
+ for (sal_Int32 i = 0; i < value.getLength(); ++i) {
+ static char const hexDigit[16] = {
+ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C',
+ 'D', 'E', 'F' };
+ writeData(handle, hexDigit + ((value[i] >> 4) & 0xF), 1);
+ writeData(handle, hexDigit + (value[i] & 0xF), 1);
+ }
+}
+
+template< typename T > void writeSingleValue(
+ oslFileHandle handle, css::uno::Any const & value)
+{
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM(">"));
+ T val = T();
+ value >>= val;
+ writeValueContent(handle, val);
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("</value>"));
+}
+
+template< typename T > void writeListValue(
+ oslFileHandle handle, css::uno::Any const & value)
+{
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM(">"));
+ css::uno::Sequence< T > val;
+ value >>= val;
+ for (sal_Int32 i = 0; i < val.getLength(); ++i) {
+ if (i != 0) {
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM(" "));
+ }
+ writeValueContent(handle, val[i]);
+ }
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("</value>"));
+}
+
+template< typename T > void writeItemListValue(
+ oslFileHandle handle, css::uno::Any const & value)
+{
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM(">"));
+ css::uno::Sequence< T > val;
+ value >>= val;
+ for (sal_Int32 i = 0; i < val.getLength(); ++i) {
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("<it>"));
+ writeValueContent(handle, val[i]);
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("</it>"));
+ }
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("</value>"));
+}
+
+void writeValue(oslFileHandle handle, Type type, css::uno::Any const & value) {
+ switch (type) {
+ case TYPE_BOOLEAN:
+ writeSingleValue< sal_Bool >(handle, value);
+ break;
+ case TYPE_SHORT:
+ writeSingleValue< sal_Int16 >(handle, value);
+ break;
+ case TYPE_INT:
+ writeSingleValue< sal_Int32 >(handle, value);
+ break;
+ case TYPE_LONG:
+ writeSingleValue< sal_Int64 >(handle, value);
+ break;
+ case TYPE_DOUBLE:
+ writeSingleValue< double >(handle, value);
+ break;
+ case TYPE_STRING:
+ writeSingleValue< rtl::OUString >(handle, value);
+ break;
+ case TYPE_HEXBINARY:
+ writeSingleValue< css::uno::Sequence< sal_Int8 > >(handle, value);
+ break;
+ case TYPE_BOOLEAN_LIST:
+ writeListValue< sal_Bool >(handle, value);
+ break;
+ case TYPE_SHORT_LIST:
+ writeListValue< sal_Int16 >(handle, value);
+ break;
+ case TYPE_INT_LIST:
+ writeListValue< sal_Int32 >(handle, value);
+ break;
+ case TYPE_LONG_LIST:
+ writeListValue< sal_Int64 >(handle, value);
+ break;
+ case TYPE_DOUBLE_LIST:
+ writeListValue< double >(handle, value);
+ break;
+ case TYPE_STRING_LIST:
+ writeItemListValue< rtl::OUString >(handle, value);
+ break;
+ case TYPE_HEXBINARY_LIST:
+ writeItemListValue< css::uno::Sequence< sal_Int8 > >(handle, value);
+ break;
+ default: // TYPE_ERROR, TYPE_NIL, TYPE_ANY
+ OSL_ASSERT(false); // this cannot happen
+ }
+}
+
+void writeNode(
+ Components & components, oslFileHandle handle,
+ rtl::Reference< Node > const & parent, rtl::OUString const & name,
+ rtl::Reference< Node > const & node)
+{
+ static Span const typeNames[] = {
+ Span(), Span(), Span(), // TYPE_ERROR, TYPE_NIL, TYPE_ANY
+ Span(RTL_CONSTASCII_STRINGPARAM("xs:boolean")),
+ Span(RTL_CONSTASCII_STRINGPARAM("xs:short")),
+ Span(RTL_CONSTASCII_STRINGPARAM("xs:int")),
+ Span(RTL_CONSTASCII_STRINGPARAM("xs:long")),
+ Span(RTL_CONSTASCII_STRINGPARAM("xs:double")),
+ Span(RTL_CONSTASCII_STRINGPARAM("xs:string")),
+ Span(RTL_CONSTASCII_STRINGPARAM("xs:hexBinary")),
+ Span(RTL_CONSTASCII_STRINGPARAM("oor:boolean-list")),
+ Span(RTL_CONSTASCII_STRINGPARAM("oor:short-list")),
+ Span(RTL_CONSTASCII_STRINGPARAM("oor:int-list")),
+ Span(RTL_CONSTASCII_STRINGPARAM("oor:long-list")),
+ Span(RTL_CONSTASCII_STRINGPARAM("oor:double-list")),
+ Span(RTL_CONSTASCII_STRINGPARAM("oor:string-list")),
+ Span(RTL_CONSTASCII_STRINGPARAM("oor:hexBinary-list")) };
+ switch (node->kind()) {
+ case Node::KIND_PROPERTY:
+ {
+ PropertyNode * prop = dynamic_cast< PropertyNode * >(node.get());
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("<prop oor:name=\""));
+ writeAttributeValue(handle, name);
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("\" oor:op=\"fuse\""));
+ Type type = prop->getStaticType();
+ Type dynType = getDynamicType(prop->getValue(components));
+ OSL_ASSERT(dynType != TYPE_ERROR);
+ if (type == TYPE_ANY) {
+ type = dynType;
+ if (type != TYPE_NIL) {
+ writeData(
+ handle, RTL_CONSTASCII_STRINGPARAM(" oor:type=\""));
+ writeData(
+ handle, typeNames[type].begin, typeNames[type].length);
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("\""));
+ }
+ }
+ writeData(handle, "><value");
+ if (dynType == TYPE_NIL) {
+ writeData(
+ handle, RTL_CONSTASCII_STRINGPARAM(" xsi:nil=\"true\"/>"));
+ } else {
+ writeValue(handle, type, prop->getValue(components));
+ }
+ writeData(handle, "</prop>");
+ }
+ break;
+ case Node::KIND_LOCALIZED_PROPERTY:
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("<prop oor:name=\""));
+ writeAttributeValue(handle, name);
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("\" oor:op=\"fuse\">"));
+ for (NodeMap::iterator i(node->getMembers().begin());
+ i != node->getMembers().end(); ++i)
+ {
+ writeNode(components, handle, node, i->first, i->second);
+ }
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("</prop>"));
+ break;
+ case Node::KIND_LOCALIZED_VALUE:
+ {
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("<value"));
+ if (name.getLength() != 0) {
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM(" xml:lang=\""));
+ writeAttributeValue(handle, name);
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("\""));
+ }
+ Type type = dynamic_cast< LocalizedPropertyNode * >(parent.get())->
+ getStaticType();
+ css::uno::Any value(
+ dynamic_cast< LocalizedValueNode * >(node.get())->getValue());
+ Type dynType = getDynamicType(value);
+ OSL_ASSERT(dynType != TYPE_ERROR);
+ if (type == TYPE_ANY) {
+ type = dynType;
+ if (type != TYPE_NIL) {
+ writeData(
+ handle, RTL_CONSTASCII_STRINGPARAM(" oor:type=\""));
+ writeData(
+ handle, typeNames[type].begin, typeNames[type].length);
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("\""));
+ }
+ }
+ if (dynType == TYPE_NIL) {
+ writeData(
+ handle, RTL_CONSTASCII_STRINGPARAM(" xsi:nil=\"true\"/>"));
+ } else {
+ writeValue(handle, type, value);
+ }
+ }
+ break;
+ case Node::KIND_GROUP:
+ case Node::KIND_SET:
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("<node oor:name=\""));
+ writeAttributeValue(handle, name);
+ if (node->getTemplateName().getLength() != 0) { // set member
+ writeData(
+ handle, RTL_CONSTASCII_STRINGPARAM("\" oor:op=\"replace"));
+ }
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("\">"));
+ for (NodeMap::iterator i(node->getMembers().begin());
+ i != node->getMembers().end(); ++i)
+ {
+ writeNode(components, handle, node, i->first, i->second);
+ }
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("</node>"));
+ break;
+ }
+}
+
+void writeModifications(
+ Components & components, oslFileHandle handle,
+ rtl::OUString const & grandparentPathRepresentation,
+ rtl::OUString const & parentName, rtl::Reference< Node > const & parent,
+ rtl::OUString const & nodeName, rtl::Reference< Node > const & node,
+ Modifications::Node const & modifications)
+{
+ // It is never necessary to write oor:finalized or oor:mandatory attributes,
+ // as they cannot be set via the UNO API.
+ if (modifications.children.empty()) {
+ OSL_ASSERT(parent.is());
+ // components themselves have no parent but must have children
+ if (node.is()) {
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("<item oor:path=\""));
+ writeAttributeValue(
+ handle,
+ (grandparentPathRepresentation +
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) +
+ Data::createSegment(parent->getTemplateName(), parentName)));
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("\">"));
+ writeNode(components, handle, parent, nodeName, node);
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("</item>"));
+ } else {
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("<item oor:path=\""));
+ switch (parent->kind()) {
+ case Node::KIND_LOCALIZED_PROPERTY:
+ writeAttributeValue(handle, grandparentPathRepresentation);
+ writeData(
+ handle, RTL_CONSTASCII_STRINGPARAM("\"><prop oor:name=\""));
+ writeAttributeValue(handle, parentName);
+ writeData(
+ handle,
+ RTL_CONSTASCII_STRINGPARAM("\" oor:op=\"fuse\"><value"));
+ if (nodeName.getLength() != 0) {
+ writeData(
+ handle, RTL_CONSTASCII_STRINGPARAM(" xml:lang=\""));
+ writeAttributeValue(handle, nodeName);
+ writeData(handle, RTL_CONSTASCII_STRINGPARAM("\""));
+ }
+ writeData(
+ handle,
+ RTL_CONSTASCII_STRINGPARAM(
+ " oor:op=\"remove\"/></prop></item>"));
+ break;
+ case Node::KIND_GROUP:
+ OSL_ASSERT(
+ dynamic_cast< GroupNode * >(parent.get())->isExtensible());
+ writeAttributeValue(
+ handle,
+ (grandparentPathRepresentation +
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) +
+ Data::createSegment(
+ parent->getTemplateName(), parentName)));
+ writeData(
+ handle, RTL_CONSTASCII_STRINGPARAM("\"><prop oor:name=\""));
+ writeAttributeValue(handle, nodeName);
+ writeData(
+ handle,
+ RTL_CONSTASCII_STRINGPARAM(
+ "\" oor:op=\"remove\"/></item>"));
+ break;
+ case Node::KIND_SET:
+ writeAttributeValue(
+ handle,
+ (grandparentPathRepresentation +
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) +
+ Data::createSegment(
+ parent->getTemplateName(), parentName)));
+ writeData(
+ handle, RTL_CONSTASCII_STRINGPARAM("\"><node oor:name=\""));
+ writeAttributeValue(handle, nodeName);
+ writeData(
+ handle,
+ RTL_CONSTASCII_STRINGPARAM(
+ "\" oor:op=\"remove\"/></item>"));
+ break;
+ default:
+ OSL_ASSERT(false); // this cannot happen
+ break;
+ }
+ }
+ } else {
+ rtl::OUString parentPathRep;
+ if (parent.is()) { // components themselves have no parent
+ parentPathRep = grandparentPathRepresentation +
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) +
+ Data::createSegment(parent->getTemplateName(), parentName);
+ }
+ OSL_ASSERT(node.is());
+ for (Modifications::Node::Children::const_iterator i(
+ modifications.children.begin());
+ i != modifications.children.end(); ++i)
+ {
+ writeModifications(
+ components, handle, parentPathRep, nodeName, node, i->first,
+ node->getMember(i->first), i->second);
+ }
+ }
+}
+
+}
+
+void writeModFile(
+ Components & components, rtl::OUString const & url, Data const & data)
+{
+ sal_Int32 i = url.lastIndexOf('/');
+ OSL_ASSERT(i != -1);
+ rtl::OUString dir(url.copy(0, i));
+ switch (osl::Directory::createPath(dir)) {
+ case osl::FileBase::E_None:
+ case osl::FileBase::E_EXIST:
+ break;
+ case osl::FileBase::E_ACCES:
+ OSL_TRACE(
+ "cannot create registrymodifications.xcu path (E_ACCES); changes"
+ " will be lost");
+ return;
+ default:
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("cannot create directory ")) +
+ dir),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ TempFile tmp;
+ switch (osl::FileBase::createTempFile(&dir, &tmp.handle, &tmp.url)) {
+ case osl::FileBase::E_None:
+ break;
+ case osl::FileBase::E_ACCES:
+ OSL_TRACE(
+ "cannot create temp registrymodifications.xcu (E_ACCES); changes"
+ " will be lost");
+ return;
+ default:
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "cannot create temporary file in ")) +
+ dir),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ writeData(
+ tmp.handle,
+ RTL_CONSTASCII_STRINGPARAM(
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?><oor:items"
+ " xmlns:oor=\"http://openoffice.org/2001/registry\""
+ " xmlns:xs=\"http://www.w3.org/2001/XMLSchema\""
+ " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">"));
+ //TODO: Do not write back information about those removed items that did not
+ // come from the .xcs/.xcu files, anyway (but had been added dynamically
+ // instead):
+ for (Modifications::Node::Children::const_iterator j(
+ data.modifications.getRoot().children.begin());
+ j != data.modifications.getRoot().children.end(); ++j)
+ {
+ writeModifications(
+ components, tmp.handle, rtl::OUString(), rtl::OUString(),
+ rtl::Reference< Node >(), j->first,
+ Data::findNode(Data::NO_LAYER, data.components, j->first),
+ j->second);
+ }
+ writeData(tmp.handle, RTL_CONSTASCII_STRINGPARAM("</oor:items>"));
+ oslFileError e = osl_closeFile(tmp.handle);
+ tmp.closed = true;
+ if (e != osl_File_E_None) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("cannot close ")) +
+ tmp.url),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ if (osl::File::move(tmp.url, url) != osl::FileBase::E_None) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("cannot move ")) +
+ tmp.url),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ tmp.handle = 0;
+}
+
+}
diff --git a/configmgr/source/writemodfile.hxx b/configmgr/source/writemodfile.hxx
new file mode 100644
index 0000000000..250edfd095
--- /dev/null
+++ b/configmgr/source/writemodfile.hxx
@@ -0,0 +1,45 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_WRITEMODFILE_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_WRITEMODFILE_HXX
+
+#include "sal/config.h"
+
+namespace rtl { class OUString; }
+
+namespace configmgr {
+
+class Components;
+struct Data;
+
+void writeModFile(
+ Components & components, rtl::OUString const & url, Data const & data);
+
+}
+
+#endif
diff --git a/configmgr/source/xcdparser.cxx b/configmgr/source/xcdparser.cxx
new file mode 100644
index 0000000000..8306c692c3
--- /dev/null
+++ b/configmgr/source/xcdparser.cxx
@@ -0,0 +1,183 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include <climits>
+
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "osl/diagnose.hxx"
+#include "rtl/string.h"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+
+#include "span.hxx"
+#include "xcdparser.hxx"
+#include "xcsparser.hxx"
+#include "xcuparser.hxx"
+#include "xmldata.hxx"
+#include "xmlreader.hxx"
+
+namespace configmgr {
+
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
+XcdParser::XcdParser(int layer, Dependencies const & dependencies, Data * data):
+ layer_(layer), dependencies_(dependencies), data_(data), state_(STATE_START)
+{}
+
+XcdParser::~XcdParser() {}
+
+XmlReader::Text XcdParser::getTextMode() {
+ return nestedParser_.is()
+ ? nestedParser_->getTextMode() : XmlReader::TEXT_NONE;
+}
+
+bool XcdParser::startElement(
+ XmlReader & reader, XmlReader::Namespace ns, Span const & name)
+{
+ if (nestedParser_.is()) {
+ OSL_ASSERT(nesting_ != LONG_MAX);
+ ++nesting_;
+ return nestedParser_->startElement(reader, ns, name);
+ }
+ switch (state_) {
+ case STATE_START:
+ if (ns == XmlReader::NAMESPACE_OOR &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("data")))
+ {
+ state_ = STATE_DEPENDENCIES;
+ return true;
+ }
+ break;
+ case STATE_DEPENDENCIES:
+ if (ns == XmlReader::NAMESPACE_NONE &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("dependency")))
+ {
+ if (dependency_.getLength() == 0) {
+ Span attrFile;
+ for (;;) {
+ XmlReader::Namespace attrNs;
+ Span attrLn;
+ if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ break;
+ }
+ if (attrNs == XmlReader::NAMESPACE_NONE && //TODO: _OOR
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("file")))
+ {
+ attrFile = reader.getAttributeValue(false);
+ }
+ }
+ if (!attrFile.is()) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "no dependency file attribute in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ dependency_ = xmldata::convertFromUtf8(attrFile);
+ if (dependency_.getLength() == 0) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "bad dependency file attribute in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ }
+ if (dependencies_.find(dependency_) == dependencies_.end()) {
+ return false;
+ }
+ state_ = STATE_DEPENDENCY;
+ dependency_ = rtl::OUString();
+ return true;
+ }
+ state_ = STATE_COMPONENTS;
+ // fall through
+ case STATE_COMPONENTS:
+ if (ns == XmlReader::NAMESPACE_OOR &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("component-schema")))
+ {
+ nestedParser_ = new XcsParser(layer_, data_);
+ nesting_ = 1;
+ return nestedParser_->startElement(reader, ns, name);
+ }
+ if (ns == XmlReader::NAMESPACE_OOR &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("component-data")))
+ {
+ nestedParser_ = new XcuParser(layer_ + 1, data_, 0);
+ nesting_ = 1;
+ return nestedParser_->startElement(reader, ns, name);
+ }
+ break;
+ default: // STATE_DEPENDENCY
+ OSL_ASSERT(false); // this cannot happen
+ break;
+ }
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad member <")) +
+ xmldata::convertFromUtf8(name) +
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+}
+
+void XcdParser::endElement(XmlReader const & reader) {
+ if (nestedParser_.is()) {
+ nestedParser_->endElement(reader);
+ if (--nesting_ == 0) {
+ nestedParser_.clear();
+ }
+ } else {
+ switch (state_) {
+ case STATE_DEPENDENCY:
+ state_ = STATE_DEPENDENCIES;
+ break;
+ case STATE_DEPENDENCIES:
+ case STATE_COMPONENTS:
+ break;
+ default:
+ OSL_ASSERT(false); // this cannot happen
+ break;
+ }
+ }
+}
+
+void XcdParser::characters(Span const & text) {
+ if (nestedParser_.is()) {
+ nestedParser_->characters(text);
+ }
+}
+
+}
diff --git a/configmgr/source/xcdparser.hxx b/configmgr/source/xcdparser.hxx
new file mode 100644
index 0000000000..2e35b3686e
--- /dev/null
+++ b/configmgr/source/xcdparser.hxx
@@ -0,0 +1,78 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_XCDPARSER_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_XCDPARSER_HXX
+
+#include "sal/config.h"
+
+#include <set>
+
+#include "rtl/ref.hxx"
+#include "rtl/ustring.hxx"
+
+#include "parser.hxx"
+#include "xmlreader.hxx"
+
+namespace configmgr {
+
+struct Data;
+struct Span;
+
+class XcdParser: public Parser {
+public:
+ typedef std::set< rtl::OUString > Dependencies;
+
+ XcdParser(int layer, Dependencies const & dependencies, Data * data);
+
+private:
+ virtual ~XcdParser();
+
+ virtual XmlReader::Text getTextMode();
+
+ virtual bool startElement(
+ XmlReader & reader, XmlReader::Namespace ns, Span const & name);
+
+ virtual void endElement(XmlReader const & reader);
+
+ virtual void characters(Span const & text);
+
+ enum State {
+ STATE_START, STATE_DEPENDENCIES, STATE_DEPENDENCY, STATE_COMPONENTS };
+
+ int layer_;
+ Dependencies const & dependencies_;
+ Data * data_;
+ State state_;
+ rtl::OUString dependency_;
+ rtl::Reference< Parser > nestedParser_;
+ long nesting_;
+};
+
+}
+
+#endif
diff --git a/configmgr/source/xcsparser.cxx b/configmgr/source/xcsparser.cxx
new file mode 100644
index 0000000000..15141844a2
--- /dev/null
+++ b/configmgr/source/xcsparser.cxx
@@ -0,0 +1,598 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include <cstddef>
+
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "osl/diagnose.h"
+#include "rtl/ref.hxx"
+#include "rtl/strbuf.hxx"
+#include "rtl/string.h"
+#include "rtl/string.hxx"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+
+#include "data.hxx"
+#include "localizedpropertynode.hxx"
+#include "groupnode.hxx"
+#include "node.hxx"
+#include "nodemap.hxx"
+#include "propertynode.hxx"
+#include "setnode.hxx"
+#include "span.hxx"
+#include "xcsparser.hxx"
+#include "xmldata.hxx"
+#include "xmlreader.hxx"
+
+namespace configmgr {
+
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
+XcsParser::XcsParser(int layer, Data * data):
+ valueParser_(layer), data_(data), state_(STATE_START)
+{}
+
+XcsParser::~XcsParser() {}
+
+XmlReader::Text XcsParser::getTextMode() {
+ return valueParser_.getTextMode();
+}
+
+bool XcsParser::startElement(
+ XmlReader & reader, XmlReader::Namespace ns, Span const & name)
+{
+ if (valueParser_.startElement(reader, ns, name)) {
+ return true;
+ }
+ if (state_ == STATE_START) {
+ if (ns == XmlReader::NAMESPACE_OOR &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("component-schema"))) {
+ handleComponentSchema(reader);
+ state_ = STATE_COMPONENT_SCHEMA;
+ ignoring_ = 0;
+ return true;
+ }
+ } else {
+ //TODO: ignoring component-schema import, component-schema uses, and
+ // prop constraints; accepting all four at illegal places (and with
+ // illegal content):
+ if (ignoring_ > 0 ||
+ (ns == XmlReader::NAMESPACE_NONE &&
+ (name.equals(RTL_CONSTASCII_STRINGPARAM("info")) ||
+ name.equals(RTL_CONSTASCII_STRINGPARAM("import")) ||
+ name.equals(RTL_CONSTASCII_STRINGPARAM("uses")) ||
+ name.equals(RTL_CONSTASCII_STRINGPARAM("constraints")))))
+ {
+ OSL_ASSERT(ignoring_ < LONG_MAX);
+ ++ignoring_;
+ return true;
+ }
+ switch (state_) {
+ case STATE_COMPONENT_SCHEMA:
+ if (ns == XmlReader::NAMESPACE_NONE &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("templates")))
+ {
+ state_ = STATE_TEMPLATES;
+ return true;
+ }
+ // fall through
+ case STATE_TEMPLATES_DONE:
+ if (ns == XmlReader::NAMESPACE_NONE &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("component")))
+ {
+ state_ = STATE_COMPONENT;
+ OSL_ASSERT(elements_.empty());
+ elements_.push(
+ Element(
+ new GroupNode(
+ valueParser_.getLayer(), false, rtl::OUString()),
+ componentName_));
+ return true;
+ }
+ break;
+ case STATE_TEMPLATES:
+ if (elements_.empty()) {
+ if (ns == XmlReader::NAMESPACE_NONE &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("group")))
+ {
+ handleGroup(reader, true);
+ return true;
+ }
+ if (ns == XmlReader::NAMESPACE_NONE &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("set")))
+ {
+ handleSet(reader, true);
+ return true;
+ }
+ break;
+ }
+ // fall through
+ case STATE_COMPONENT:
+ OSL_ASSERT(!elements_.empty());
+ switch (elements_.top().node->kind()) {
+ case Node::KIND_PROPERTY:
+ case Node::KIND_LOCALIZED_PROPERTY:
+ if (ns == XmlReader::NAMESPACE_NONE &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("value")))
+ {
+ handlePropValue(reader, elements_.top().node);
+ return true;
+ }
+ break;
+ case Node::KIND_GROUP:
+ if (ns == XmlReader::NAMESPACE_NONE &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("prop")))
+ {
+ handleProp(reader);
+ return true;
+ }
+ if (ns == XmlReader::NAMESPACE_NONE &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("node-ref")))
+ {
+ handleNodeRef(reader);
+ return true;
+ }
+ if (ns == XmlReader::NAMESPACE_NONE &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("group")))
+ {
+ handleGroup(reader, false);
+ return true;
+ }
+ if (ns == XmlReader::NAMESPACE_NONE &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("set")))
+ {
+ handleSet(reader, false);
+ return true;
+ }
+ break;
+ case Node::KIND_SET:
+ if (ns == XmlReader::NAMESPACE_NONE &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("item")))
+ {
+ handleSetItem(
+ reader,
+ dynamic_cast< SetNode * >(elements_.top().node.get()));
+ return true;
+ }
+ break;
+ default: // Node::KIND_LOCALIZED_VALUE
+ OSL_ASSERT(false); // this cannot happen
+ break;
+ }
+ break;
+ case STATE_COMPONENT_DONE:
+ break;
+ default: // STATE_START
+ OSL_ASSERT(false); // this cannot happen
+ break;
+ }
+ }
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad member <")) +
+ xmldata::convertFromUtf8(name) +
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+}
+
+void XcsParser::endElement(XmlReader const & reader) {
+ if (valueParser_.endElement(reader)) {
+ return;
+ }
+ if (ignoring_ > 0) {
+ --ignoring_;
+ } else if (!elements_.empty()) {
+ Element top(elements_.top());
+ elements_.pop();
+ if (top.node.is()) {
+ NodeMap * map;
+ if (elements_.empty()) {
+ switch (state_) {
+ case STATE_TEMPLATES:
+ map = &data_->templates;
+ break;
+ case STATE_COMPONENT:
+ map = &data_->components;
+ state_ = STATE_COMPONENT_DONE;
+ break;
+ default:
+ OSL_ASSERT(false);
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("this cannot happen")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ } else {
+ map = &elements_.top().node->getMembers();
+ }
+ if (!map->insert(NodeMap::value_type(top.name, top.node)).second) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("duplicate ")) +
+ top.name +
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ }
+ } else {
+ switch (state_) {
+ case STATE_COMPONENT_SCHEMA:
+ case STATE_TEMPLATES_DONE:
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("no component element in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ case STATE_TEMPLATES:
+ state_ = STATE_TEMPLATES_DONE;
+ break;
+ case STATE_COMPONENT_DONE:
+ break;
+ default:
+ OSL_ASSERT(false); // this cannot happen
+ }
+ }
+}
+
+void XcsParser::characters(Span const & text) {
+ valueParser_.characters(text);
+}
+
+void XcsParser::handleComponentSchema(XmlReader & reader) {
+ //TODO: oor:version, xml:lang attributes
+ rtl::OStringBuffer buf;
+ buf.append('.');
+ bool hasPackage = false;
+ bool hasName = false;
+ for (;;) {
+ XmlReader::Namespace attrNs;
+ Span attrLn;
+ if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ break;
+ }
+ if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("package")))
+ {
+ if (hasPackage) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "multiple component-schema package attributes"
+ " in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ hasPackage = true;
+ Span s(reader.getAttributeValue(false));
+ buf.insert(0, s.begin, s.length);
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
+ {
+ if (hasName) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "multiple component-schema name attributes in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ hasName = true;
+ Span s(reader.getAttributeValue(false));
+ buf.append(s.begin, s.length);
+ }
+ }
+ if (!hasPackage) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "no component-schema package attribute in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ if (!hasName) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "no component-schema name attribute in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ componentName_ = xmldata::convertFromUtf8(
+ Span(buf.getStr(), buf.getLength()));
+}
+
+void XcsParser::handleNodeRef(XmlReader & reader) {
+ bool hasName = false;
+ rtl::OUString name;
+ rtl::OUString component(componentName_);
+ bool hasNodeType = false;
+ rtl::OUString nodeType;
+ for (;;) {
+ XmlReader::Namespace attrNs;
+ Span attrLn;
+ if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ break;
+ }
+ if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
+ {
+ hasName = true;
+ name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("component")))
+ {
+ component = xmldata::convertFromUtf8(
+ reader.getAttributeValue(false));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("node-type")))
+ {
+ hasNodeType = true;
+ nodeType = xmldata::convertFromUtf8(
+ reader.getAttributeValue(false));
+ }
+ }
+ if (!hasName) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("no node-ref name attribute in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ rtl::Reference< Node > tmpl(
+ data_->getTemplate(
+ valueParser_.getLayer(),
+ xmldata::parseTemplateReference(
+ component, hasNodeType, nodeType, 0)));
+ if (!tmpl.is()) {
+ //TODO: this can erroneously happen as long as import/uses attributes
+ // are not correctly processed
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("unknown node-ref ")) +
+ name + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ rtl::Reference< Node > node(tmpl->clone());
+ node->setLayer(valueParser_.getLayer());
+ elements_.push(Element(node, name));
+}
+
+void XcsParser::handleProp(XmlReader & reader) {
+ bool hasName = false;
+ rtl::OUString name;
+ valueParser_.type_ = TYPE_ERROR;
+ bool localized = false;
+ bool nillable = true;
+ for (;;) {
+ XmlReader::Namespace attrNs;
+ Span attrLn;
+ if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ break;
+ }
+ if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
+ {
+ hasName = true;
+ name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("type")))
+ {
+ valueParser_.type_ = xmldata::parseType(
+ reader, reader.getAttributeValue(true));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("localized")))
+ {
+ localized = xmldata::parseBoolean(reader.getAttributeValue(true));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("nillable")))
+ {
+ nillable = xmldata::parseBoolean(reader.getAttributeValue(true));
+ }
+ }
+ if (!hasName) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("no prop name attribute in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ if (valueParser_.type_ == TYPE_ERROR) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("no prop type attribute in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ elements_.push(
+ Element(
+ (localized
+ ? rtl::Reference< Node >(
+ new LocalizedPropertyNode(
+ valueParser_.getLayer(), valueParser_.type_, nillable))
+ : rtl::Reference< Node >(
+ new PropertyNode(
+ valueParser_.getLayer(), valueParser_.type_, nillable,
+ css::uno::Any(), false))),
+ name));
+}
+
+void XcsParser::handlePropValue(
+ XmlReader & reader, rtl::Reference< Node > const & property)
+{
+ Span attrSeparator;
+ for (;;) {
+ XmlReader::Namespace attrNs;
+ Span attrLn;
+ if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ break;
+ }
+ if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("separator")))
+ {
+ attrSeparator = reader.getAttributeValue(false);
+ if (attrSeparator.length == 0) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "bad oor:separator attribute in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ }
+ }
+ valueParser_.separator_ = rtl::OString(
+ attrSeparator.begin, attrSeparator.length);
+ valueParser_.start(property);
+}
+
+void XcsParser::handleGroup(XmlReader & reader, bool isTemplate) {
+ bool hasName = false;
+ rtl::OUString name;
+ bool extensible = false;
+ for (;;) {
+ XmlReader::Namespace attrNs;
+ Span attrLn;
+ if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ break;
+ }
+ if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
+ {
+ hasName = true;
+ name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("extensible")))
+ {
+ extensible = xmldata::parseBoolean(reader.getAttributeValue(true));
+ }
+ }
+ if (!hasName) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("no group name attribute in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ if (isTemplate) {
+ name = Data::fullTemplateName(componentName_, name);
+ }
+ elements_.push(
+ Element(
+ new GroupNode(
+ valueParser_.getLayer(), extensible,
+ isTemplate ? name : rtl::OUString()),
+ name));
+}
+
+void XcsParser::handleSet(XmlReader & reader, bool isTemplate) {
+ bool hasName = false;
+ rtl::OUString name;
+ rtl::OUString component(componentName_);
+ bool hasNodeType = false;
+ rtl::OUString nodeType;
+ for (;;) {
+ XmlReader::Namespace attrNs;
+ Span attrLn;
+ if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ break;
+ }
+ if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
+ {
+ hasName = true;
+ name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("component")))
+ {
+ component = xmldata::convertFromUtf8(
+ reader.getAttributeValue(false));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("node-type")))
+ {
+ hasNodeType = true;
+ nodeType = xmldata::convertFromUtf8(
+ reader.getAttributeValue(false));
+ }
+ }
+ if (!hasName) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("no set name attribute in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ if (isTemplate) {
+ name = Data::fullTemplateName(componentName_, name);
+ }
+ elements_.push(
+ Element(
+ new SetNode(
+ valueParser_.getLayer(),
+ xmldata::parseTemplateReference(
+ component, hasNodeType, nodeType, 0),
+ isTemplate ? name : rtl::OUString()),
+ name));
+}
+
+void XcsParser::handleSetItem(XmlReader & reader, SetNode * set) {
+ rtl::OUString component(componentName_);
+ bool hasNodeType = false;
+ rtl::OUString nodeType;
+ for (;;) {
+ XmlReader::Namespace attrNs;
+ Span attrLn;
+ if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ break;
+ }
+ if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("component")))
+ {
+ component = xmldata::convertFromUtf8(
+ reader.getAttributeValue(false));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("node-type")))
+ {
+ hasNodeType = true;
+ nodeType = xmldata::convertFromUtf8(
+ reader.getAttributeValue(false));
+ }
+ }
+ set->getAdditionalTemplateNames().push_back(
+ xmldata::parseTemplateReference(component, hasNodeType, nodeType, 0));
+ elements_.push(Element(rtl::Reference< Node >(), rtl::OUString()));
+}
+
+}
diff --git a/configmgr/source/xcsparser.hxx b/configmgr/source/xcsparser.hxx
new file mode 100644
index 0000000000..21a124945a
--- /dev/null
+++ b/configmgr/source/xcsparser.hxx
@@ -0,0 +1,106 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_XCSPARSER_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_XCSPARSER_HXX
+
+#include "sal/config.h"
+
+#include <stack>
+
+#include "rtl/ref.hxx"
+#include "rtl/ustring.hxx"
+
+#include "node.hxx"
+#include "parser.hxx"
+#include "valueparser.hxx"
+#include "xmlreader.hxx"
+
+namespace configmgr {
+
+class SetNode;
+struct Data;
+struct Span;
+
+class XcsParser: public Parser {
+public:
+ XcsParser(int layer, Data * data);
+
+private:
+ virtual ~XcsParser();
+
+ virtual XmlReader::Text getTextMode();
+
+ virtual bool startElement(
+ XmlReader & reader, XmlReader::Namespace ns, Span const & name);
+
+ virtual void endElement(XmlReader const & reader);
+
+ virtual void characters(Span const & text);
+
+ void handleComponentSchema(XmlReader & reader);
+
+ void handleNodeRef(XmlReader & reader);
+
+ void handleProp(XmlReader & reader);
+
+ void handlePropValue(
+ XmlReader & reader, rtl::Reference< Node > const & property);
+
+ void handleGroup(XmlReader & reader, bool isTemplate);
+
+ void handleSet(XmlReader & reader, bool isTemplate);
+
+ void handleSetItem(XmlReader & reader, SetNode * set);
+
+ enum State {
+ STATE_START, STATE_COMPONENT_SCHEMA, STATE_TEMPLATES,
+ STATE_TEMPLATES_DONE, STATE_COMPONENT, STATE_COMPONENT_DONE };
+
+ struct Element {
+ rtl::Reference< Node > node;
+ rtl::OUString name;
+
+ inline Element(
+ rtl::Reference< Node > const & theNode,
+ rtl::OUString const & theName):
+ node(theNode), name(theName) {}
+ };
+
+ typedef std::stack< Element > ElementStack;
+
+ ValueParser valueParser_;
+ Data * data_;
+ rtl::OUString componentName_;
+ State state_;
+ long ignoring_;
+ ElementStack elements_;
+};
+
+}
+
+#endif
diff --git a/configmgr/source/xcuparser.cxx b/configmgr/source/xcuparser.cxx
new file mode 100644
index 0000000000..220168c627
--- /dev/null
+++ b/configmgr/source/xcuparser.cxx
@@ -0,0 +1,1077 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include <algorithm>
+
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "osl/diagnose.h"
+#include "rtl/ref.hxx"
+#include "rtl/strbuf.hxx"
+#include "rtl/string.h"
+#include "rtl/string.hxx"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+
+#include "data.hxx"
+#include "localizedpropertynode.hxx"
+#include "localizedvaluenode.hxx"
+#include "groupnode.hxx"
+#include "modifications.hxx"
+#include "node.hxx"
+#include "nodemap.hxx"
+#include "path.hxx"
+#include "propertynode.hxx"
+#include "setnode.hxx"
+#include "span.hxx"
+#include "xcuparser.hxx"
+#include "xmldata.hxx"
+#include "xmlreader.hxx"
+
+namespace configmgr {
+
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
+XcuParser::XcuParser(int layer, Data * data, Modifications * modifications):
+ valueParser_(layer), data_(data), modifications_(modifications)
+{
+ if (layer == Data::NO_LAYER) {
+ OSL_ASSERT(modifications_ == 0);
+ modifications_ = &data_->modifications;
+ }
+}
+
+XcuParser::~XcuParser() {}
+
+XmlReader::Text XcuParser::getTextMode() {
+ return valueParser_.getTextMode();
+}
+
+bool XcuParser::startElement(
+ XmlReader & reader, XmlReader::Namespace ns, Span const & name)
+{
+ if (valueParser_.startElement(reader, ns, name)) {
+ return true;
+ }
+ if (state_.empty()) {
+ if (ns == XmlReader::NAMESPACE_OOR &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("component-data")))
+ {
+ handleComponentData(reader);
+ } else if (ns == XmlReader::NAMESPACE_OOR &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("items")))
+ {
+ state_.push(State(rtl::Reference< Node >(), false));
+ } else {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("bad root element <")) +
+ xmldata::convertFromUtf8(name) +
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ } else if (state_.top().ignore) {
+ state_.push(state_.top());
+ } else if (!state_.top().node.is()) {
+ if (ns == XmlReader::NAMESPACE_NONE &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("item")))
+ {
+ handleItem(reader);
+ } else {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("bad items node member <")) +
+ xmldata::convertFromUtf8(name) +
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ } else {
+ switch (state_.top().node->kind()) {
+ case Node::KIND_PROPERTY:
+ if (ns == XmlReader::NAMESPACE_NONE &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("value")))
+ {
+ handlePropValue(
+ reader,
+ dynamic_cast< PropertyNode * >(state_.top().node.get()));
+ } else {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "bad property node member <")) +
+ xmldata::convertFromUtf8(name) +
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ break;
+ case Node::KIND_LOCALIZED_PROPERTY:
+ if (ns == XmlReader::NAMESPACE_NONE &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("value")))
+ {
+ handleLocpropValue(
+ reader,
+ dynamic_cast< LocalizedPropertyNode * >(
+ state_.top().node.get()));
+ } else {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "bad localized property node member <")) +
+ xmldata::convertFromUtf8(name) +
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ break;
+ case Node::KIND_LOCALIZED_VALUE:
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad member <")) +
+ xmldata::convertFromUtf8(name) +
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ case Node::KIND_GROUP:
+ if (ns == XmlReader::NAMESPACE_NONE &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("prop")))
+ {
+ handleGroupProp(
+ reader,
+ dynamic_cast< GroupNode * >(state_.top().node.get()));
+ } else if (ns == XmlReader::NAMESPACE_NONE &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("node")))
+ {
+ handleGroupNode(reader, state_.top().node);
+ } else {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "bad group node member <")) +
+ xmldata::convertFromUtf8(name) +
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ break;
+ case Node::KIND_SET:
+ if (ns == XmlReader::NAMESPACE_NONE &&
+ name.equals(RTL_CONSTASCII_STRINGPARAM("node")))
+ {
+ handleSetNode(
+ reader, dynamic_cast< SetNode * >(state_.top().node.get()));
+ } else {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("bad set node member <")) +
+ xmldata::convertFromUtf8(name) +
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ break;
+ }
+ }
+ return true;
+}
+
+void XcuParser::endElement(XmlReader const & reader) {
+ if (valueParser_.endElement(reader)) {
+ return;
+ }
+ OSL_ASSERT(!state_.empty());
+ bool ignore = state_.top().ignore;
+ rtl::Reference< Node > insert;
+ rtl::OUString name;
+ if (state_.top().insert) {
+ insert = state_.top().node;
+ OSL_ASSERT(insert.is());
+ name = state_.top().name;
+ }
+ state_.pop();
+ if (insert.is()) {
+ OSL_ASSERT(!state_.empty() && state_.top().node.is());
+ state_.top().node->getMembers()[name] = insert;
+ }
+ if (!ignore && !modificationPath_.empty()) {
+ modificationPath_.pop_back();
+ // </item> will pop less than <item> pushed, but that is harmless,
+ // as the next <item> will reset modificationPath_
+ }
+}
+
+void XcuParser::characters(Span const & text) {
+ valueParser_.characters(text);
+}
+
+XcuParser::Operation XcuParser::parseOperation(Span const & text) {
+ OSL_ASSERT(text.is());
+ if (text.equals(RTL_CONSTASCII_STRINGPARAM("modify"))) {
+ return OPERATION_MODIFY;
+ }
+ if (text.equals(RTL_CONSTASCII_STRINGPARAM("replace"))) {
+ return OPERATION_REPLACE;
+ }
+ if (text.equals(RTL_CONSTASCII_STRINGPARAM("fuse"))) {
+ return OPERATION_FUSE;
+ }
+ if (text.equals(RTL_CONSTASCII_STRINGPARAM("remove"))) {
+ return OPERATION_REMOVE;
+ }
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("invalid op ")) +
+ xmldata::convertFromUtf8(text)),
+ css::uno::Reference< css::uno::XInterface >());
+}
+
+void XcuParser::handleComponentData(XmlReader & reader) {
+ rtl::OStringBuffer buf;
+ buf.append('.');
+ bool hasPackage = false;
+ bool hasName = false;
+ Operation op = OPERATION_MODIFY;
+ bool finalized = false;
+ for (;;) {
+ XmlReader::Namespace attrNs;
+ Span attrLn;
+ if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ break;
+ }
+ if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("package")))
+ {
+ if (hasPackage) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "multiple component-update package attributes"
+ " in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ hasPackage = true;
+ Span s(reader.getAttributeValue(false));
+ buf.insert(0, s.begin, s.length);
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
+ {
+ if (hasName) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "multiple component-update name attributes in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ hasName = true;
+ Span s(reader.getAttributeValue(false));
+ buf.append(s.begin, s.length);
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op")))
+ {
+ op = parseOperation(reader.getAttributeValue(true));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("finalized")))
+ {
+ finalized = xmldata::parseBoolean(reader.getAttributeValue(true));
+ }
+ }
+ if (!hasPackage) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "no component-data package attribute in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ if (!hasName) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "no component-data name attribute in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ componentName_ = xmldata::convertFromUtf8(
+ Span(buf.getStr(), buf.getLength()));
+ rtl::Reference< Node > node(
+ Data::findNode(
+ valueParser_.getLayer(), data_->components, componentName_));
+ if (!node.is()) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("unknown component ")) +
+ componentName_ +
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ switch (op) {
+ case OPERATION_MODIFY:
+ case OPERATION_FUSE:
+ break;
+ default:
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "invalid operation on root node in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ int finalizedLayer = std::min(
+ finalized ? valueParser_.getLayer() : Data::NO_LAYER,
+ node->getFinalized());
+ node->setFinalized(finalizedLayer);
+ state_.push(State(node, finalizedLayer < valueParser_.getLayer()));
+ if (modifications_ != 0) {
+ OSL_ASSERT(modificationPath_.empty());
+ modificationPath_.push_back(componentName_);
+ }
+}
+
+void XcuParser::handleItem(XmlReader & reader) {
+ Span attrPath;
+ for (;;) {
+ XmlReader::Namespace attrNs;
+ Span attrLn;
+ if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ break;
+ }
+ if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("path")))
+ {
+ attrPath = reader.getAttributeValue(false);
+ }
+ }
+ if (!attrPath.is()) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("missing path attribute in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ rtl::OUString path(xmldata::convertFromUtf8(attrPath));
+ int finalizedLayer;
+ rtl::Reference< Node > node(
+ data_->resolvePathRepresentation(
+ path, &modificationPath_, &finalizedLayer));
+ if (!node.is()) {
+ //TODO: Within Components::parseModificationLayer (but only there) it
+ // can rightly happen that data is read that does not match a schema
+ // (that no schema exists, or that the schema specifies a different
+ // type), namely if the schema was brought along by an extension that
+ // has been removed or replaced; instead of taking care of that at all
+ // the relevant places, as a hack, only "top-level" <item>s (that only
+ // appear in modification layer data) with unknown path are filtered out
+ // here.
+ OSL_TRACE(
+ "configmgr unknown <item path=\"%s\">",
+ rtl::OUStringToOString(path, RTL_TEXTENCODING_UTF8).getStr());
+ state_.push(State()); // ignored
+ return;
+ }
+ OSL_ASSERT(!modificationPath_.empty());
+ componentName_ = modificationPath_.front();
+ if (modifications_ == 0) {
+ modificationPath_.clear();
+ }
+ state_.push(State(node, finalizedLayer < valueParser_.getLayer()));
+}
+
+void XcuParser::handlePropValue(XmlReader & reader, PropertyNode * prop) {
+ bool nil = false;
+ rtl::OString separator;
+ rtl::OUString external;
+ for (;;) {
+ XmlReader::Namespace attrNs;
+ Span attrLn;
+ if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ break;
+ }
+ if (attrNs == XmlReader::NAMESPACE_XSI &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("nil")))
+ {
+ nil = xmldata::parseBoolean(reader.getAttributeValue(true));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("type")))
+ {
+ Type type = xmldata::parseType(
+ reader, reader.getAttributeValue(true));
+ if (valueParser_.type_ != TYPE_ANY && type != valueParser_.type_) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("invalid value type in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ valueParser_.type_ = type;
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("separator")))
+ {
+ Span s(reader.getAttributeValue(false));
+ if (s.length == 0) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "bad oor:separator attribute in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ separator = rtl::OString(s.begin, s.length);
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("external")))
+ {
+ external = xmldata::convertFromUtf8(reader.getAttributeValue(true));
+ if (external.getLength() == 0) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "bad oor:external attribute value in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ }
+ }
+ if (nil) {
+ if (!prop->isNillable()) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "xsi:nil attribute for non-nillable prop in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ if (external.getLength() != 0) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "xsi:nil and oor:external attributes for prop in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ prop->setValue(valueParser_.getLayer(), css::uno::Any());
+ state_.push(State());
+ } else if (external.getLength() == 0) {
+ valueParser_.separator_ = separator;
+ valueParser_.start(prop);
+ } else {
+ prop->setExternal(valueParser_.getLayer(), external);
+ state_.push(State());
+ }
+}
+
+void XcuParser::handleLocpropValue(
+ XmlReader & reader, LocalizedPropertyNode * locprop)
+{
+ rtl::OUString name;
+ bool nil = false;
+ rtl::OString separator;
+ Operation op = OPERATION_FUSE;
+ for (;;) {
+ XmlReader::Namespace attrNs;
+ Span attrLn;
+ if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ break;
+ }
+ if (attrNs == XmlReader::NAMESPACE_XML &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("lang")))
+ {
+ name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
+ } else if (attrNs == XmlReader::NAMESPACE_XSI &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("nil")))
+ {
+ nil = xmldata::parseBoolean(reader.getAttributeValue(true));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("type")))
+ {
+ Type type = xmldata::parseType(
+ reader, reader.getAttributeValue(true));
+ if (valueParser_.type_ != TYPE_ANY && type != valueParser_.type_) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("invalid value type in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ valueParser_.type_ = type;
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("separator")))
+ {
+ Span s(reader.getAttributeValue(false));
+ if (s.length == 0) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "bad oor:separator attribute in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ separator = rtl::OString(s.begin, s.length);
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op")))
+ {
+ op = parseOperation(reader.getAttributeValue(true));
+ }
+ }
+ NodeMap::iterator i(locprop->getMembers().find(name));
+ if (i != locprop->getMembers().end() &&
+ i->second->getLayer() > valueParser_.getLayer())
+ {
+ state_.push(State()); // ignored
+ return;
+ }
+ if (nil && !locprop->isNillable()) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "xsi:nil attribute for non-nillable prop in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ switch (op) {
+ case OPERATION_FUSE:
+ if (nil) {
+ if (i == locprop->getMembers().end()) {
+ locprop->getMembers()[name] = new LocalizedValueNode(
+ valueParser_.getLayer(), css::uno::Any());
+ } else {
+ dynamic_cast< LocalizedValueNode * >(i->second.get())->setValue(
+ valueParser_.getLayer(), css::uno::Any());
+ }
+ state_.push(State());
+ } else {
+ valueParser_.separator_ = separator;
+ valueParser_.start(locprop, name);
+ }
+ if (modifications_ != 0) {
+ modificationPath_.push_back(name);
+ modifications_->add(modificationPath_);
+ modificationPath_.pop_back();
+ }
+ break;
+ case OPERATION_REMOVE:
+ //TODO: only allow if parent.op == OPERATION_FUSE
+ //TODO: disallow removing when e.g. lang=""?
+ if (i != locprop->getMembers().end()) {
+ locprop->getMembers().erase(i);
+ }
+ state_.push(State());
+ if (modifications_ != 0) {
+ modificationPath_.push_back(name);
+ modifications_->add(modificationPath_);
+ modificationPath_.pop_back();
+ }
+ break;
+ default:
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "bad op attribute for value element in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+}
+
+void XcuParser::handleGroupProp(XmlReader & reader, GroupNode * group) {
+ bool hasName = false;
+ rtl::OUString name;
+ Type type = TYPE_ERROR;
+ Operation op = OPERATION_MODIFY;
+ bool finalized = false;
+ for (;;) {
+ XmlReader::Namespace attrNs;
+ Span attrLn;
+ if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ break;
+ }
+ if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
+ {
+ hasName = true;
+ name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("type")))
+ {
+ type = xmldata::parseType(reader, reader.getAttributeValue(true));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op")))
+ {
+ op = parseOperation(reader.getAttributeValue(true));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("finalized")))
+ {
+ finalized = xmldata::parseBoolean(reader.getAttributeValue(true));
+ }
+ }
+ if (!hasName) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("no prop name attribute in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ NodeMap::iterator i(group->getMembers().find(name));
+ if (i == group->getMembers().end()) {
+ handleUnknownGroupProp(reader, group, name, type, op, finalized);
+ } else {
+ switch (i->second->kind()) {
+ case Node::KIND_PROPERTY:
+ handlePlainGroupProp(reader, group, i, name, type, op, finalized);
+ break;
+ case Node::KIND_LOCALIZED_PROPERTY:
+ handleLocalizedGroupProp(
+ reader,
+ dynamic_cast< LocalizedPropertyNode * >(i->second.get()), name,
+ type, op, finalized);
+ break;
+ default:
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("inappropriate prop ")) +
+ name + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ }
+}
+
+void XcuParser::handleUnknownGroupProp(
+ XmlReader const & reader, GroupNode * group, rtl::OUString const & name,
+ Type type, Operation operation, bool finalized)
+{
+ if (!group->isExtensible()) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("unknown prop ")) +
+ name + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ switch (operation) {
+ case OPERATION_REPLACE:
+ case OPERATION_FUSE:
+ {
+ if (type == TYPE_ERROR) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "missing type attribute for prop ")) +
+ name + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ valueParser_.type_ = type;
+ rtl::Reference< Node > prop(
+ new PropertyNode(
+ valueParser_.getLayer(), TYPE_ANY, true, css::uno::Any(),
+ true));
+ if (finalized) {
+ prop->setFinalized(valueParser_.getLayer());
+ }
+ state_.push(State(prop, name, state_.top().locked));
+ if (modifications_ != 0) {
+ modificationPath_.push_back(name);
+ modifications_->add(modificationPath_);
+ }
+ }
+ break;
+ default:
+ OSL_TRACE(
+ "ignoring modify or remove of unknown (presumably extension)"
+ " property");
+ state_.push(State());
+ break;
+ }
+}
+
+void XcuParser::handlePlainGroupProp(
+ XmlReader const & reader, GroupNode * group,
+ NodeMap::iterator const & propertyIndex, rtl::OUString const & name,
+ Type type, Operation operation, bool finalized)
+{
+ PropertyNode * property = dynamic_cast< PropertyNode * >(
+ propertyIndex->second.get());
+ if (property->getLayer() > valueParser_.getLayer()) {
+ state_.push(State()); // ignored
+ return;
+ }
+ int finalizedLayer = std::min(
+ finalized ? valueParser_.getLayer() : Data::NO_LAYER,
+ property->getFinalized());
+ property->setFinalized(finalizedLayer);
+ if (type != TYPE_ERROR && property->getStaticType() != TYPE_ANY &&
+ type != property->getStaticType())
+ {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("invalid type for prop ")) +
+ name + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ valueParser_.type_ = type == TYPE_ERROR ? property->getStaticType() : type;
+ switch (operation) {
+ case OPERATION_MODIFY:
+ case OPERATION_REPLACE:
+ case OPERATION_FUSE:
+ state_.push(
+ State(
+ property,
+ (state_.top().locked ||
+ finalizedLayer < valueParser_.getLayer())));
+ if (modifications_ != 0) {
+ modificationPath_.push_back(name);
+ modifications_->add(modificationPath_);
+ }
+ break;
+ case OPERATION_REMOVE:
+ if (!property->isExtension()) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "invalid remove of non-extension prop ")) +
+ name + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ group->getMembers().erase(propertyIndex);
+ state_.push(State()); // ignore children
+ if (modifications_ != 0) {
+ modificationPath_.push_back(name);
+ modifications_->add(modificationPath_);
+ modificationPath_.pop_back();
+ }
+ break;
+ }
+}
+
+void XcuParser::handleLocalizedGroupProp(
+ XmlReader const & reader, LocalizedPropertyNode * property,
+ rtl::OUString const & name, Type type, Operation operation, bool finalized)
+{
+ if (property->getLayer() > valueParser_.getLayer()) {
+ state_.push(State()); // ignored
+ return;
+ }
+ int finalizedLayer = std::min(
+ finalized ? valueParser_.getLayer() : Data::NO_LAYER,
+ property->getFinalized());
+ property->setFinalized(finalizedLayer);
+ if (type != TYPE_ERROR && property->getStaticType() != TYPE_ANY &&
+ type != property->getStaticType())
+ {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("invalid type for prop ")) +
+ name + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ valueParser_.type_ = type == TYPE_ERROR ? property->getStaticType() : type;
+ switch (operation) {
+ case OPERATION_MODIFY:
+ case OPERATION_FUSE:
+ state_.push(
+ State(
+ property,
+ (state_.top().locked ||
+ finalizedLayer < valueParser_.getLayer())));
+ if (modifications_ != 0) {
+ modificationPath_.push_back(name);
+ }
+ break;
+ case OPERATION_REPLACE:
+ {
+ rtl::Reference< Node > replacement(
+ new LocalizedPropertyNode(
+ valueParser_.getLayer(), property->getStaticType(),
+ property->isNillable()));
+ replacement->setFinalized(property->getFinalized());
+ state_.push(
+ State(
+ replacement, name,
+ (state_.top().locked ||
+ finalizedLayer < valueParser_.getLayer())));
+ if (modifications_ != 0) {
+ modificationPath_.push_back(name);
+ modifications_->add(modificationPath_);
+ }
+ }
+ break;
+ case OPERATION_REMOVE:
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "invalid remove of non-extension prop ")) +
+ name + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+}
+
+void XcuParser::handleGroupNode(
+ XmlReader & reader, rtl::Reference< Node > const & group)
+{
+ bool hasName = false;
+ rtl::OUString name;
+ Operation op = OPERATION_MODIFY;
+ bool finalized = false;
+ for (;;) {
+ XmlReader::Namespace attrNs;
+ Span attrLn;
+ if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ break;
+ }
+ if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
+ {
+ hasName = true;
+ name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op")))
+ {
+ op = parseOperation(reader.getAttributeValue(true));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("finalized")))
+ {
+ finalized = xmldata::parseBoolean(reader.getAttributeValue(true));
+ }
+ }
+ if (!hasName) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("no node name attribute in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ rtl::Reference< Node > child(
+ Data::findNode(valueParser_.getLayer(), group->getMembers(), name));
+ if (!child.is()) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("unknown node ")) +
+ name + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ if (op != OPERATION_MODIFY && op != OPERATION_FUSE) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "invalid operation on group node in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ int finalizedLayer = std::min(
+ finalized ? valueParser_.getLayer() : Data::NO_LAYER,
+ child->getFinalized());
+ child->setFinalized(finalizedLayer);
+ state_.push(
+ State(
+ child,
+ state_.top().locked || finalizedLayer < valueParser_.getLayer()));
+ if (modifications_ != 0) {
+ modificationPath_.push_back(name);
+ }
+}
+
+void XcuParser::handleSetNode(XmlReader & reader, SetNode * set) {
+ bool hasName = false;
+ rtl::OUString name;
+ rtl::OUString component(componentName_);
+ bool hasNodeType = false;
+ rtl::OUString nodeType;
+ Operation op = OPERATION_MODIFY;
+ bool finalized = false;
+ bool mandatory = false;
+ for (;;) {
+ XmlReader::Namespace attrNs;
+ Span attrLn;
+ if (!reader.nextAttribute(&attrNs, &attrLn)) {
+ break;
+ }
+ if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name")))
+ {
+ hasName = true;
+ name = xmldata::convertFromUtf8(reader.getAttributeValue(false));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("component")))
+ {
+ component = xmldata::convertFromUtf8(
+ reader.getAttributeValue(false));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("node-type")))
+ {
+ hasNodeType = true;
+ nodeType = xmldata::convertFromUtf8(
+ reader.getAttributeValue(false));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op")))
+ {
+ op = parseOperation(reader.getAttributeValue(true));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("finalized")))
+ {
+ finalized = xmldata::parseBoolean(reader.getAttributeValue(true));
+ } else if (attrNs == XmlReader::NAMESPACE_OOR &&
+ attrLn.equals(RTL_CONSTASCII_STRINGPARAM("mandatory")))
+ {
+ mandatory = xmldata::parseBoolean(reader.getAttributeValue(true));
+ }
+ }
+ if (!hasName) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("no node name attribute in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ rtl::OUString templateName(
+ xmldata::parseTemplateReference(
+ component, hasNodeType, nodeType, &set->getDefaultTemplateName()));
+ if (!set->isValidTemplate(templateName)) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("set member node ")) +
+ name +
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(" references invalid template ")) +
+ templateName + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ rtl::Reference< Node > tmpl(
+ data_->getTemplate(valueParser_.getLayer(), templateName));
+ if (!tmpl.is()) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("set member node ")) +
+ name +
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ " references undefined template ")) +
+ templateName + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" in ")) +
+ reader.getUrl()),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ int finalizedLayer = finalized ? valueParser_.getLayer() : Data::NO_LAYER;
+ int mandatoryLayer = mandatory ? valueParser_.getLayer() : Data::NO_LAYER;
+ NodeMap::iterator i(set->getMembers().find(name));
+ if (i != set->getMembers().end()) {
+ finalizedLayer = std::min(finalizedLayer, i->second->getFinalized());
+ i->second->setFinalized(finalizedLayer);
+ mandatoryLayer = std::min(mandatoryLayer, i->second->getMandatory());
+ i->second->setMandatory(mandatoryLayer);
+ if (i->second->getLayer() > valueParser_.getLayer()) {
+ state_.push(State()); // ignored
+ return;
+ }
+ }
+ switch (op) {
+ case OPERATION_MODIFY:
+ if (i == set->getMembers().end()) {
+ OSL_TRACE("ignoring modify of unknown set member node");
+ state_.push(State());
+ } else {
+ state_.push(
+ State(
+ i->second,
+ (state_.top().locked ||
+ finalizedLayer < valueParser_.getLayer())));
+ if (modifications_ != 0) {
+ modificationPath_.push_back(name);
+ }
+ }
+ break;
+ case OPERATION_REPLACE:
+ if (state_.top().locked || finalizedLayer < valueParser_.getLayer()) {
+ state_.push(State()); // ignored
+ } else {
+ rtl::Reference< Node > member(tmpl->clone());
+ member->setLayer(valueParser_.getLayer());
+ member->setFinalized(finalizedLayer);
+ member->setMandatory(mandatoryLayer);
+ state_.push(State(member, name, false));
+ if (modifications_ != 0) {
+ modificationPath_.push_back(name);
+ modifications_->add(modificationPath_);
+ }
+ }
+ break;
+ case OPERATION_FUSE:
+ if (i == set->getMembers().end()) {
+ if (state_.top().locked || finalizedLayer < valueParser_.getLayer())
+ {
+ state_.push(State()); // ignored
+ } else {
+ rtl::Reference< Node > member(tmpl->clone());
+ member->setLayer(valueParser_.getLayer());
+ member->setFinalized(finalizedLayer);
+ member->setMandatory(mandatoryLayer);
+ state_.push(State(member, name, false));
+ if (modifications_ != 0) {
+ modificationPath_.push_back(name);
+ modifications_->add(modificationPath_);
+ }
+ }
+ } else {
+ state_.push(
+ State(
+ i->second,
+ (state_.top().locked ||
+ finalizedLayer < valueParser_.getLayer())));
+ if (modifications_ != 0) {
+ modificationPath_.push_back(name);
+ }
+ }
+ break;
+ case OPERATION_REMOVE:
+ // Ignore removal of unknown members, members finalized in a lower
+ // layer, and members made mandatory in this or a lower layer:
+ if (i != set->getMembers().end() && !state_.top().locked &&
+ finalizedLayer >= valueParser_.getLayer() &&
+ mandatoryLayer > valueParser_.getLayer())
+ {
+ set->getMembers().erase(i);
+ }
+ state_.push(State());
+ if (modifications_ != 0) {
+ modificationPath_.push_back(name);
+ modifications_->add(modificationPath_);
+ modificationPath_.pop_back();
+ }
+ break;
+ }
+}
+
+}
diff --git a/configmgr/source/xcuparser.hxx b/configmgr/source/xcuparser.hxx
new file mode 100644
index 0000000000..21806edebe
--- /dev/null
+++ b/configmgr/source/xcuparser.hxx
@@ -0,0 +1,142 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_XCUPARSER_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_XCUPARSER_HXX
+
+#include "sal/config.h"
+
+#include <stack>
+
+#include "rtl/ref.hxx"
+#include "rtl/ustring.hxx"
+
+#include "node.hxx"
+#include "nodemap.hxx"
+#include "parser.hxx"
+#include "path.hxx"
+#include "type.hxx"
+#include "valueparser.hxx"
+#include "xmldata.hxx"
+#include "xmlreader.hxx"
+
+namespace configmgr {
+
+class GroupNode;
+class LocalizedPropertyNode;
+class Modifications;
+class PropertyNode;
+class SetNode;
+struct Data;
+struct Span;
+
+class XcuParser: public Parser {
+public:
+ XcuParser(int layer, Data * data, Modifications * modifications);
+
+private:
+ virtual ~XcuParser();
+
+ virtual XmlReader::Text getTextMode();
+
+ virtual bool startElement(
+ XmlReader & reader, XmlReader::Namespace ns, Span const & name);
+
+ virtual void endElement(XmlReader const & reader);
+
+ virtual void characters(Span const & span);
+
+ enum Operation {
+ OPERATION_MODIFY, OPERATION_REPLACE, OPERATION_FUSE, OPERATION_REMOVE };
+
+ static Operation parseOperation(Span const & text);
+
+ void handleComponentData(XmlReader & reader);
+
+ void handleItem(XmlReader & reader);
+
+ void handlePropValue(XmlReader & reader, PropertyNode * prop);
+
+ void handleLocpropValue(
+ XmlReader & reader, LocalizedPropertyNode * locprop);
+
+ void handleGroupProp(XmlReader & reader, GroupNode * group);
+
+ void handleUnknownGroupProp(
+ XmlReader const & reader, GroupNode * group, rtl::OUString const & name,
+ Type type, Operation operation, bool finalized);
+
+ void handlePlainGroupProp(
+ XmlReader const & reader, GroupNode * group,
+ NodeMap::iterator const & propertyIndex, rtl::OUString const & name,
+ Type type, Operation operation, bool finalized);
+
+ void handleLocalizedGroupProp(
+ XmlReader const & reader, LocalizedPropertyNode * property,
+ rtl::OUString const & name, Type type, Operation operation,
+ bool finalized);
+
+ void handleGroupNode(
+ XmlReader & reader, rtl::Reference< Node > const & group);
+
+ void handleSetNode(XmlReader & reader, SetNode * set);
+
+ struct State {
+ rtl::Reference< Node > node; // empty iff ignore or <items>
+ rtl::OUString name; // empty and ignored if !insert
+ bool ignore;
+ bool insert;
+ bool locked;
+
+ inline State(): ignore(true), insert(false), locked(false) {}
+
+ inline State(rtl::Reference< Node > const & theNode, bool theLocked):
+ node(theNode), ignore(false), insert(false), locked(theLocked)
+ {}
+
+ inline State(
+ rtl::Reference< Node > const & theNode,
+ rtl::OUString const & theName, bool theLocked):
+ node(theNode), name(theName), ignore(false), insert(true),
+ locked(theLocked)
+ {}
+ };
+
+ typedef std::stack< State > StateStack;
+
+ ValueParser valueParser_;
+ Data * data_;
+ Modifications * modifications_;
+ rtl::OUString componentName_;
+ StateStack state_;
+ Path modificationPath_;
+ rtl::OUString path_;
+};
+
+}
+
+#endif
diff --git a/configmgr/source/xml/basicparser.cxx b/configmgr/source/xml/basicparser.cxx
deleted file mode 100644
index 522f84f0e1..0000000000
--- a/configmgr/source/xml/basicparser.cxx
+++ /dev/null
@@ -1,533 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "basicparser.hxx"
-#include <com/sun/star/xml/sax/SAXException.hpp>
-#include "valuetypeconverter.hxx"
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace xml
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace sax = ::com::sun::star::xml::sax;
-// -----------------------------------------------------------------------------
-
-namespace
-{
- static inline
- uno::Reference< script::XTypeConverter > createTCV(uno::Reference< uno::XComponentContext > const & _xContext)
- {
- OSL_ENSURE(_xContext.is(),"Cannot create Parser without a Context");
-
- static const rtl::OUString k_sTCVService(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.Converter"));
-
- uno::Reference< lang::XMultiComponentFactory > xSvcFactory = _xContext->getServiceManager();
- return uno::Reference< script::XTypeConverter >::query(xSvcFactory->createInstanceWithContext(k_sTCVService,_xContext));
- }
-}
-// -----------------------------------------------------------------------------
-
-struct BasicParser::ValueData : ValueConverter
-{
- rtl::OUString content;
- rtl::OUString locale;
- bool isLocalized;
-
- ValueData(uno::Type const& _aType, uno::Reference< script::XTypeConverter > const & _xTCV)
- : ValueConverter(_aType, _xTCV)
- , content()
- , locale()
- , isLocalized(false)
- {
- }
-
- uno::Any convertToAny() const
- {
- return ValueConverter::convertToAny(this->content);
- }
-
- rtl::OUString toString() const
- {
- return this->content;
- }
-
- uno::Sequence<rtl::OUString> toStringList() const
- {
- return ValueConverter::splitStringList(this->content);
- }
-
- void setLocalized(rtl::OUString const & _aLocale)
- {
- isLocalized = true;
- locale = _aLocale;
- }
-};
-// -----------------------------------------------------------------------------
-
-BasicParser::BasicParser(uno::Reference< uno::XComponentContext > const & _xContext)
-: m_xTypeConverter( createTCV(_xContext) )
-, m_xLocator(NULL)
-, m_aDataParser(Logger(_xContext))
-, m_aNodes()
-, m_aValueType()
-, m_pValueData(NULL)
-, m_nSkipLevels(0)
-, m_bEmpty(true)
-, m_bInProperty(false)
-{
- if (!m_xTypeConverter.is())
- throw uno::RuntimeException();
-
- OSL_DEBUG_ONLY( dbgUpdateLocation() );
-}
-// -----------------------------------------------------------------------------
-
-BasicParser::~BasicParser()
-{
- delete m_pValueData;
-}
-// -----------------------------------------------------------------------------
-
-#if OSL_DEBUG_LEVEL > 0
-void BasicParser::dbgUpdateLocation()
-{
-#ifndef DBG_UTIL
- rtl::OUString dbgPublicId, dbgSystemId;
- sal_Int32 dbgLineNo, dbgColumnNo;
-#endif // OSL_DEBUG_LEVEL
-
- if (m_xLocator.is())
- {
- dbgPublicId = m_xLocator->getPublicId();
- dbgSystemId = m_xLocator->getSystemId();
- dbgLineNo = m_xLocator->getLineNumber();
- dbgColumnNo = m_xLocator->getColumnNumber();
- }
- else
- {
- dbgPublicId = dbgSystemId = rtl::OUString::createFromAscii("<<<unknown>>>");
- dbgLineNo = dbgColumnNo = -1;
- }
-}
-#endif
-// -----------------------------------------------------------------------------
-void SAL_CALL BasicParser::startDocument( )
- throw (sax::SAXException, uno::RuntimeException)
-{
- m_aDataParser.reset();
- m_aValueType = uno::Type();
- m_bInProperty = false;
- m_nSkipLevels = 0;
-
- delete m_pValueData, m_pValueData = NULL;
-
- while (!m_aNodes.empty()) m_aNodes.pop();
-
- m_bEmpty = true;
-
- OSL_DEBUG_ONLY( dbgUpdateLocation() );
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL BasicParser::endDocument( ) throw (sax::SAXException, uno::RuntimeException)
-{
- OSL_DEBUG_ONLY( dbgUpdateLocation() );
-
- if (!m_aNodes.empty() || isSkipping() || isInValueData())
- raiseParseException( "Configuration XML Parser - Invalid XML: Unexpected end of document" );
-
- m_xLocator.clear();
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL BasicParser::characters( const rtl::OUString& aChars )
- throw (sax::SAXException, uno::RuntimeException)
-{
- OSL_DEBUG_ONLY( dbgUpdateLocation() );
-
- if (isInValueData())
- {
- m_pValueData->content += aChars;
- }
-#ifdef CONFIG_XMLPARSER_VALIDATE_WHITESPACE
- else
- OSL_ENSURE( isSkipping() || aChars.trim().getLength() == 0, "Unexpected text content in configuration XML");
-#endif
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL BasicParser::ignorableWhitespace( const rtl::OUString& aWhitespaces )
- throw (sax::SAXException, uno::RuntimeException)
-{
- OSL_DEBUG_ONLY( dbgUpdateLocation() );
- if (isInValueData())
- {
- OSL_ENSURE(false, "Configuration XML: Unexpected ignorable (!) whitespace instruction in value data");
- if (!m_pValueData->isNull())
- m_pValueData->content += aWhitespaces;
- }
-#ifdef CONFIG_XMLPARSER_VALIDATE_WHITESPACE
- else
- OSL_ENSURE( aChars.trim().getLength() == 0, "Unexpected non-space content in ignorable whitespace");
-#endif
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL BasicParser::processingInstruction( const rtl::OUString& /*aTarget*/, const rtl::OUString& /*aData*/ )
- throw (sax::SAXException, uno::RuntimeException)
-{
- OSL_DEBUG_ONLY( dbgUpdateLocation() );
- OSL_ENSURE(false, "Unexpected processing instruction in Configuration XML");
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL BasicParser::setDocumentLocator( const uno::Reference< sax::XLocator >& xLocator )
- throw (sax::SAXException, uno::RuntimeException)
-{
- m_xLocator = xLocator;
- OSL_DEBUG_ONLY( dbgUpdateLocation() );
-}
-// -----------------------------------------------------------------------------
-
-void BasicParser::startNode( ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& /*xAttribs*/ )
-{
- { (void)aInfo; }
- OSL_DEBUG_ONLY( dbgUpdateLocation() );
-
- OSL_ENSURE( !isSkipping(), "While skipping, call startSkipping() instead of startNode()");
- OSL_ENSURE( aInfo.type != ElementType::property, "For properties, call startProperty() instead of startNode()");
-
- if (isInProperty())
- raiseParseException( "Configuration XML Parser - Invalid Data: Cannot have a node nested in a property" );
-
- m_aNodes.push(aInfo);
- m_bEmpty = (aInfo.flags != 0) || (aInfo.op > Operation::modify);
-
- OSL_POSTCOND( isInNode(), "Could not start a node ");
-}
-// -----------------------------------------------------------------------------
-
-void BasicParser::endNode( )
-{
- OSL_DEBUG_ONLY( dbgUpdateLocation() );
-
- OSL_ENSURE( !isSkipping(), "While skipping, honor wasSkipping() instead of calling endNode()");
- OSL_ENSURE( !isInProperty(), "For properties, call endProperty() instead of endNode()" );
-
- ensureInNode();
-
- m_aNodes.pop();
- m_bEmpty = false;
-}
-// -----------------------------------------------------------------------------
-
-void BasicParser::ensureInNode( )
-{
- if (!isInNode())
- raiseParseException("Unexpected endElement without matching startElement");
-}
-// -----------------------------------------------------------------------------
-
-bool BasicParser::isInNode( )
-{
- return ! m_aNodes.empty();
-}
-// -----------------------------------------------------------------------------
-
-bool BasicParser::isEmptyNode( )
-{
- return m_bEmpty;
-}
-// -----------------------------------------------------------------------------
-
-ElementInfo const & BasicParser::getActiveNodeInfo( )
-{
- ensureInNode();
-
- return m_aNodes.top();
-}
-// -----------------------------------------------------------------------------
-
-void BasicParser::startProperty( ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& xAttribs )
-{
- OSL_DEBUG_ONLY( dbgUpdateLocation() );
-
- OSL_ENSURE( !isSkipping(), "While skipping, call startSkipping() instead of startProperty()");
- OSL_ENSURE( aInfo.type == ElementType::property, "For non-property nodes, call startNode() instead of startProperty()");
-
- if (isInProperty())
- raiseParseException( "Configuration XML Parser - Invalid Data: Properties may not nest" );
-
- try
- {
- m_aValueType = getDataParser().getPropertyValueType(xAttribs);
- }
- catch (ElementParser::BadValueType & error)
- {
- raiseParseException(error.message());
- }
-
- m_bInProperty = true;
-
- m_aNodes.push(aInfo);
- m_bEmpty = true;
-
- OSL_POSTCOND( isInProperty(), "Could not get data to start a property" );
- OSL_POSTCOND( isInUnhandledProperty(), "Could not mark property as unhandled");
-}
-// -----------------------------------------------------------------------------
-
-void BasicParser::endProperty( )
-{
- OSL_DEBUG_ONLY( dbgUpdateLocation() );
-
- OSL_ENSURE( !isSkipping(), "While skipping, honor wasSkipping() instead of calling endProperty()");
- OSL_ENSURE( isInProperty(), "For non-property nodes, call endNode() instead of endProperty()" );
-
- ensureInNode();
-
- m_aNodes.pop();
- m_bEmpty = false;
-
- m_aValueType = uno::Type();
- m_bInProperty = false;
-
- OSL_POSTCOND( !isInProperty(), "Could not get mark end of property" );
-}
-// -----------------------------------------------------------------------------
-
-uno::Type BasicParser::getActivePropertyType()
-{
- return m_aValueType;
-}
-// -----------------------------------------------------------------------------
-
-bool BasicParser::isInProperty()
-{
- return m_bInProperty;
-}
-// -----------------------------------------------------------------------------
-
-bool BasicParser::isInUnhandledProperty()
-{
- return m_bEmpty && m_bInProperty;
-}
-// -----------------------------------------------------------------------------
-
-void BasicParser::startValueData(const uno::Reference< sax::XAttributeList >& xAttribs)
-{
- OSL_DEBUG_ONLY( dbgUpdateLocation() );
-
- if (!isInProperty())
- raiseParseException( "Configuration XML Parser - Invalid Data: A value may occur only within a property" );
-
- if (m_aValueType.getTypeClass() == uno::TypeClass_ANY)
- raiseParseException( "Configuration XML Parser - Invalid Data: Cannot have values for properties of type 'Any'" );
-
- if (isInValueData())
- raiseParseException( "Configuration XML Parser - Invalid Data: Unexpected element while parsing value data" );
-
- m_pValueData = new ValueData(m_aValueType, m_xTypeConverter);
-
- m_pValueData->setIsNull( getDataParser().isNull(xAttribs) );
-
- m_pValueData->setSeparator( getDataParser().getSeparator(xAttribs) );
-
- OSL_ENSURE( !m_pValueData->hasSeparator() ||
- !m_pValueData->isTypeSet() ||
- m_pValueData->isList(),
- "Warning: Spurious oor:separator on value that is not a list");
- OSL_ENSURE( !m_pValueData->hasSeparator() ||
- !m_pValueData->isNull(),
- "Warning: Spurious oor:separator on value that is not a list");
-
- rtl::OUString aLocale;
- if ( getDataParser().getLanguage(xAttribs,aLocale) )
- m_pValueData->setLocalized( aLocale );
-}
-// -----------------------------------------------------------------------------
-
-bool BasicParser::isInValueData()
-{
- return m_pValueData != NULL;
-}
-// -----------------------------------------------------------------------------
-
-bool BasicParser::isValueDataLocalized()
-{
- OSL_ENSURE(isInValueData(), "There is no value data that could be localized");
-
- return m_pValueData && m_pValueData->isLocalized;
-}
-// -----------------------------------------------------------------------------
-
-rtl::OUString BasicParser::getValueDataLocale()
-{
- OSL_ENSURE(isValueDataLocalized(), "There is no value data or it is not localized");
-
- return m_pValueData->locale;
-}
-// -----------------------------------------------------------------------------
-
-uno::Any BasicParser::getCurrentValue()
-{
- OSL_DEBUG_ONLY( dbgUpdateLocation() );
-
- OSL_ASSERT( isInValueData() );
-
- uno::Any aResult;
-
- if (m_pValueData->isTypeSet())
- try
- {
- aResult = m_pValueData->convertToAny();
- }
- catch (script::CannotConvertException & e)
- {
- this->raiseParseException(uno::makeAny(e),"Configuration XML Parser - Invalid Data: Cannot convert value to type of property" );
- }
- else if (m_pValueData->isNull())
- {
- // nothing to do
- }
- else if (m_pValueData->hasSeparator() || m_pValueData->isList())
- {
- aResult <<= m_pValueData->toStringList();
- }
- else
- {
- aResult <<= m_pValueData->toString();
- }
- return aResult;
-}
-// -----------------------------------------------------------------------------
-
-/// end collecting data for a value
-void BasicParser::endValueData()
-{
- OSL_DEBUG_ONLY( dbgUpdateLocation() );
-
- OSL_ASSERT( isInValueData() );
-
- delete m_pValueData, m_pValueData = NULL;
- m_bEmpty = false;
-
- OSL_POSTCOND( !isInValueData(), "Could not end value data tag" );
- OSL_POSTCOND( !isInUnhandledProperty(), "Could not mark property as handled" );
-}
-// -----------------------------------------------------------------------------
-
-void BasicParser::startSkipping( const rtl::OUString& aName, const uno::Reference< sax::XAttributeList >& /*xAttribs*/ )
-{
- OSL_DEBUG_ONLY( dbgUpdateLocation() );
-
- m_aNodes.push( ElementInfo(aName) );
- ++m_nSkipLevels;
-}
-// -----------------------------------------------------------------------------
-
-bool BasicParser::wasSkipping( const rtl::OUString& aName )
-{
- OSL_DEBUG_ONLY( dbgUpdateLocation() );
-
- if (m_nSkipLevels == 0) return false;
-
- if (m_aNodes.empty())
- raiseParseException( "Configuration XML Parser - Invalid XML: Unexpected end of element (while skipping data)" );
-
- if (aName != m_aNodes.top().name)
- raiseParseException( "Configuration XML Parser - Invalid XML: End tag does not match start tag (while skipping data)" );
-
- --m_nSkipLevels;
- m_aNodes.pop();
-
- return true;
-}
-// -----------------------------------------------------------------------------
-
-bool BasicParser::isSkipping( )
-{
- return m_nSkipLevels != 0;
-}
-// -----------------------------------------------------------------------------
-
-void BasicParser::raiseParseException( uno::Any const & _aTargetException, sal_Char const * _pMsg )
- SAL_THROW((sax::SAXException, uno::RuntimeException))
-{
- OSL_DEBUG_ONLY( dbgUpdateLocation() );
-
- if (_pMsg == 0) _pMsg = "Configuration XML Parser: Invalid Data: ";
-
- rtl::OUString sMessage = rtl::OUString::createFromAscii(_pMsg);
-
- uno::Exception aEx;
- if (_aTargetException >>= aEx)
- sMessage += aEx.Message;
-
- getLogger().error(sMessage,"parse","configuration::xml::BasicParser");
- throw sax::SAXException( sMessage, *this, _aTargetException );
-}
-// -----------------------------------------------------------------------------
-
-void BasicParser::raiseParseException( sal_Char const * _pMsg )
- SAL_THROW((sax::SAXException, uno::RuntimeException))
-{
- OSL_DEBUG_ONLY( dbgUpdateLocation() );
-
- if (_pMsg == 0) _pMsg = "Configuration XML Parser: Invalid XML";
-
- rtl::OUString const sMessage = rtl::OUString::createFromAscii(_pMsg);
-
- getLogger().error(sMessage,"parse","configuration::xml::BasicParser");
- throw sax::SAXException( sMessage, *this, uno::Any() );
-}
-// -----------------------------------------------------------------------------
-
-void BasicParser::raiseParseException( rtl::OUString const & sMessage )
- SAL_THROW((sax::SAXException, uno::RuntimeException))
-{
- OSL_DEBUG_ONLY( dbgUpdateLocation() );
-
- if (sMessage.getLength() == 0) raiseParseException(NULL);
-
- getLogger().error(sMessage,"parse","configuration::xml::BasicParser");
- throw sax::SAXException( sMessage, *this, uno::Any() );
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace
-
-// -----------------------------------------------------------------------------
-} // namespace
-
diff --git a/configmgr/source/xml/basicparser.hxx b/configmgr/source/xml/basicparser.hxx
deleted file mode 100644
index f3e10f3532..0000000000
--- a/configmgr/source/xml/basicparser.hxx
+++ /dev/null
@@ -1,175 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_XML_BASICPARSER_HXX
-#define CONFIGMGR_XML_BASICPARSER_HXX
-
-#include "elementparser.hxx"
-#include "utility.hxx"
-#include "stack.hxx"
-#ifndef CONFIGMGR_LOGGER_HXX_
-#include "logger.hxx"
-#endif
-#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
-#include <cppuhelper/implbase1.hxx>
-
-namespace com { namespace sun { namespace star { namespace script {
- class XTypeConverter;
-} } } }
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace xml
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
-
- namespace sax = ::com::sun::star::xml::sax;
-// -----------------------------------------------------------------------------
-
- class BasicParser
- : public cppu::WeakImplHelper1<sax::XDocumentHandler>
- {
- struct ValueData;
-
- uno::Reference< com::sun::star::script::XTypeConverter >
- m_xTypeConverter;
- uno::Reference< sax::XLocator > m_xLocator;
- ElementParser m_aDataParser;
- Stack< ElementInfo > m_aNodes;
- uno::Type m_aValueType;
- ValueData * m_pValueData;
- sal_uInt16 m_nSkipLevels;
- bool m_bEmpty;
- bool m_bInProperty;
-
-#if OSL_DEBUG_LEVEL > 0
-#ifdef DBG_UTIL
- rtl::OUString dbgPublicId, dbgSystemId;
- sal_Int32 dbgLineNo, dbgColumnNo;
-#endif // DBG_UTIL
- void dbgUpdateLocation();
-#endif // OSL_DEBUG_LEVEL
-
- public:
- explicit BasicParser(uno::Reference< uno::XComponentContext > const & _xContext);
- virtual ~BasicParser();
-
- // XDocumentHandler
- public:
- virtual void SAL_CALL
- startDocument( )
- throw (sax::SAXException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endDocument( ) throw (sax::SAXException, uno::RuntimeException);
-
- virtual void SAL_CALL
- characters( const rtl::OUString& aChars )
- throw (sax::SAXException, uno::RuntimeException);
-
- virtual void SAL_CALL
- ignorableWhitespace( const rtl::OUString& aWhitespaces )
- throw (sax::SAXException, uno::RuntimeException);
-
- virtual void SAL_CALL
- processingInstruction( const rtl::OUString& aTarget, const rtl::OUString& aData )
- throw (sax::SAXException, uno::RuntimeException);
-
- virtual void SAL_CALL
- setDocumentLocator( const uno::Reference< sax::XLocator >& xLocator )
- throw (sax::SAXException, uno::RuntimeException);
-
- protected:
- ElementParser const & getDataParser() const { return m_aDataParser; }
-
- Logger const & getLogger() { return m_aDataParser.logger(); }
-
- /// start an node
- void startNode( ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& xAttribs );
- /// are we in the content of a node ?
- bool isInNode();
- /// are we in the content of node for which no content was started yet ?
- bool isEmptyNode();
- /// make sure we are in the content of a node ?
- void ensureInNode();
- /// get the info about of the node currently being processed
- ElementInfo const & getActiveNodeInfo();
- /// end a node
- void endNode();
-
- /// start a property
- void startProperty( ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& xAttribs );
- /// are we in the content of a property node ?
- bool isInProperty();
- /// are we in the content of a property node (and there has been no value for that property) ?
- bool isInUnhandledProperty();
- /// get the data type of the active property ?
- uno::Type getActivePropertyType();
- /// end a property
- void endProperty();
-
- /// start collecting data for a value - returns the locale of the value (property must have been started)
- void startValueData(const uno::Reference< sax::XAttributeList >& xAttribs);
- /// are we in the content of a property node ?
- bool isInValueData();
- /// check if the current value data has a locale set
- bool isValueDataLocalized();
- /// get the locale of the current value data, if localized
- rtl::OUString getValueDataLocale();
- /// return the collected value
- uno::Any getCurrentValue();
- /// end collecting data for a value
- void endValueData();
-
- /// start a node to be skipped
- void startSkipping( const rtl::OUString& aTag, const uno::Reference< sax::XAttributeList >& xAttribs );
- /// are we inside a skipped node ?
- bool isSkipping( );
- /// ending a node: was this skipped ?
- bool wasSkipping( const rtl::OUString& aTag );
-
- protected:
- void raiseParseException( uno::Any const & _aTargetException, sal_Char const * _pMsg = NULL)
- SAL_THROW((sax::SAXException, uno::RuntimeException));
- void raiseParseException( sal_Char const * _pMsg )
- SAL_THROW((sax::SAXException, uno::RuntimeException));
- void raiseParseException( rtl::OUString const & aMsg )
- SAL_THROW((sax::SAXException, uno::RuntimeException));
- };
-// -----------------------------------------------------------------------------
- } // namespace xml
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/xml/elementformatter.cxx b/configmgr/source/xml/elementformatter.cxx
deleted file mode 100644
index 8807e72568..0000000000
--- a/configmgr/source/xml/elementformatter.cxx
+++ /dev/null
@@ -1,321 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "elementformatter.hxx"
-#include "xmlstrings.hxx"
-#include "typeconverter.hxx"
-
-#include <comphelper/attributelist.hxx>
-
-#include <rtl/ustrbuf.hxx>
-
-#include <com/sun/star/configuration/backend/SchemaAttribute.hpp>
-#include <com/sun/star/configuration/backend/NodeAttribute.hpp>
-
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace xml
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace sax = ::com::sun::star::xml::sax;
-// -----------------------------------------------------------------------------
-
-ElementFormatter::ElementFormatter()
-: m_aElementType(ElementType::unknown)
-, m_xAttributes()
-{
-}
-// -----------------------------------------------------------------------------
-
-ElementFormatter::~ElementFormatter()
-{
-}
-// -----------------------------------------------------------------------------
-
-void ElementFormatter::reset()
-{
- m_aElementType = ElementType::unknown;
- m_xAttributes.clear();
-}
-// -----------------------------------------------------------------------------
-
-void ElementFormatter::addAttribute(rtl::OUString const & _anAttributeName, rtl::OUString const & _aValue)
-{
- OSL_PRECOND(m_xAttributes.is(),"Trying to add an attribute to a non-existing list");
-
- m_xAttributes->AddAttribute(_anAttributeName,
- XML_ATTRTYPE_CDATA,
- _aValue);
-}
-// -----------------------------------------------------------------------------
-
-void ElementFormatter::addAttribute(rtl::OUString const & _anAttributeName, bool _bValue)
-{
- OSL_PRECOND(m_xAttributes.is(),"Trying to add an attribute to a non-existing list");
-
- m_xAttributes->AddAttribute(_anAttributeName,
- XML_ATTRTYPE_CDATA,
- _bValue ? ATTR_VALUE_TRUE : ATTR_VALUE_FALSE);
-}
-// -----------------------------------------------------------------------------
-
-void ElementFormatter::addNamespaces()
-{
- static rtl::OUString const sNamespaceDecl( RTL_CONSTASCII_USTRINGPARAM("xmlns:") );
-
- addAttribute( sNamespaceDecl.concat(NS_PREFIX_OOR), static_cast<rtl::OUString const &>(NS_URI_OOR));
- addAttribute( sNamespaceDecl.concat(NS_PREFIX_XS ), static_cast<rtl::OUString const &>(NS_URI_XS ));
-}
-// -----------------------------------------------------------------------------
-
-void ElementFormatter::prepareElement(ElementInfo const& _aInfo)
-{
- if (!m_xAttributes.is())
- {
- m_xAttributes.set( new ::comphelper::AttributeList() );
- addNamespaces();
- }
- else
- m_xAttributes->Clear();
-
- m_aElementType = _aInfo.type;
-
- addName(_aInfo.name);
- addNodeFlags(_aInfo.flags);
- addOperation(_aInfo.op);
-}
-// -----------------------------------------------------------------------------
-
-void ElementFormatter::prepareSimpleElement(ElementType::Enum _eType)
-{
- if (!m_xAttributes.is())
- {
- m_xAttributes.set( new ::comphelper::AttributeList() );
- addNamespaces();
- }
- else
- m_xAttributes->Clear();
-
- m_aElementType = _eType;
-}
-// -----------------------------------------------------------------------------
-
-void ElementFormatter::addName(rtl::OUString const & _aName)
-{
- if (_aName.getLength())
- {
- switch( m_aElementType )
- {
- case ElementType::schema:
- case ElementType::layer:
- {
- sal_Int32 nIndex = _aName.lastIndexOf('.');
-
- rtl::OUString aNodeName = _aName.copy(nIndex + 1);
- addAttribute(ATTR_NAME, aNodeName);
-
- OSL_ENSURE(nIndex > 0,"Found component root element without a package part in its name");
- if (nIndex > 0)
- {
- rtl::OUString aPackage = _aName.copy(0, nIndex);
- addAttribute(ATTR_PACKAGE, aPackage);
- }
- }
- break;
-
- default:
- addAttribute(ATTR_NAME, _aName);
- break;
- }
- }
-}
-// -----------------------------------------------------------------------------
-
-inline
-void ElementFormatter::maybeAddFlag(sal_Int16 _eFlags, sal_Int16 _eSelect, rtl::OUString const & _anAttributeName, bool _bValue)
-{
- if (_eFlags & _eSelect) addAttribute(_anAttributeName,_bValue);
-}
-// -----------------------------------------------------------------------------
-
-void ElementFormatter::addNodeFlags(sal_Int16 _eFlags)
-{
- maybeAddFlag(_eFlags,com::sun::star::configuration::backend::SchemaAttribute::REQUIRED, ATTR_FLAG_NULLABLE, false);
- maybeAddFlag(_eFlags,com::sun::star::configuration::backend::SchemaAttribute::LOCALIZED, ATTR_FLAG_LOCALIZED);
- maybeAddFlag(_eFlags,com::sun::star::configuration::backend::SchemaAttribute::EXTENSIBLE, ATTR_FLAG_EXTENSIBLE);
-
- maybeAddFlag(_eFlags,com::sun::star::configuration::backend::NodeAttribute::FINALIZED, ATTR_FLAG_FINALIZED);
- maybeAddFlag(_eFlags,com::sun::star::configuration::backend::NodeAttribute::MANDATORY, ATTR_FLAG_MANDATORY);
- maybeAddFlag(_eFlags,com::sun::star::configuration::backend::NodeAttribute::READONLY, ATTR_FLAG_READONLY);
-}
-// -----------------------------------------------------------------------------
-
-void ElementFormatter::addOperation(Operation::Enum _eOp)
-{
- switch (_eOp)
- {
- case Operation::none: break;
- case Operation::modify: break ; //addAttribute(ATTR_OPERATION, static_cast<rtl::OUString const &>(OPERATION_MODIFY)); break;
- case Operation::clear: OSL_ENSURE(false,"'clear' operation is not yet supported"); break ;
- //addAttribute(ATTR_OPERATION, static_cast<rtl::OUString const &>(OPERATION_CLEAR)); break;
- case Operation::replace: addAttribute(ATTR_OPERATION, static_cast<rtl::OUString const &>(OPERATION_REPLACE)); break;
- case Operation::fuse: addAttribute(ATTR_OPERATION, static_cast<rtl::OUString const &>(OPERATION_FUSE)); break;
- case Operation::remove: addAttribute(ATTR_OPERATION, static_cast<rtl::OUString const &>(OPERATION_REMOVE)); break;
-
- case Operation::unknown:
- OSL_ENSURE(false, "ElementFormatter: Trying to add attribute for 'unknown' operation");
- break;
- default:
- OSL_ENSURE(false, "ElementFormatter: Trying to add attribute for invalid operation");
- break;
- }
-}
-// -----------------------------------------------------------------------------
-
-void ElementFormatter::addInstanceType(rtl::OUString const & /*_aElementType*/, rtl::OUString const & /*_aElementTypeModule*/)
-{
-}
-// -----------------------------------------------------------------------------
-
-static ::rtl::OUString toXmlTypeName(const uno::TypeClass& _rTypeClass)
-{
- ::rtl::OUString aRet;
- switch(_rTypeClass)
- {
- case uno::TypeClass_BOOLEAN: aRet = VALUETYPE_BOOLEAN; break;
- case uno::TypeClass_SHORT: aRet = VALUETYPE_SHORT; break;
- case uno::TypeClass_LONG: aRet = VALUETYPE_INT; break;
- case uno::TypeClass_HYPER: aRet = VALUETYPE_LONG; break;
- case uno::TypeClass_DOUBLE: aRet = VALUETYPE_DOUBLE; break;
- case uno::TypeClass_STRING: aRet = VALUETYPE_STRING; break;
- case uno::TypeClass_SEQUENCE: aRet = VALUETYPE_BINARY; break;
- case uno::TypeClass_ANY: aRet = VALUETYPE_ANY; break;
- default:
- OSL_ENSURE(false,"Cannot get type name: unknown typeclass");
- break;
- }
- return aRet;
-}
-// -----------------------------------------------------------------------------
-
-void ElementFormatter::addPropertyValueType(uno::Type const& _aType)
-{
- if (_aType == uno::Type()) return;
-
- bool bList = false;
- uno::Type aSimpleType = getBasicType(_aType, bList);
- uno::TypeClass aSimpleTypeClass = aSimpleType.getTypeClass();
- rtl::OUString aSimpleTypeName = toXmlTypeName(aSimpleTypeClass);
-
- rtl::OUString sNsPrefix = (bList || aSimpleTypeClass == uno::TypeClass_ANY) ?
- rtl::OUString( NS_PREFIX_OOR ) : rtl::OUString( NS_PREFIX_XS );
-
- rtl::OUStringBuffer aTypeNameBuf(sNsPrefix);
-
- if (sNsPrefix.getLength())
- aTypeNameBuf. append(k_NS_SEPARATOR);
-
- aTypeNameBuf. append(aSimpleTypeName);
-
- if (bList)
- aTypeNameBuf. append(VALUETYPE_LIST_SUFFIX);
-
- addAttribute( ATTR_VALUETYPE, aTypeNameBuf.makeStringAndClear());
-}
-// -----------------------------------------------------------------------------
-
-void ElementFormatter::addLanguage(rtl::OUString const & _sLanguage)
-{
- OSL_ENSURE(_sLanguage.getLength(), "ElementFormatter: Trying to add empty language attribute");
- addAttribute(EXT_ATTR_LANGUAGE, _sLanguage);
-}
-// -----------------------------------------------------------------------------
-
-void ElementFormatter::addIsNull(bool _bIsNull)
-{
- addAttribute( EXT_ATTR_NULL, _bIsNull);
-}
-// -----------------------------------------------------------------------------
-
-void ElementFormatter::addSeparator(rtl::OUString const& _sSeparator)
-{
- addAttribute( ATTR_VALUESEPARATOR, _sSeparator);
-}
-// -----------------------------------------------------------------------------
-
-rtl::OUString ElementFormatter::getElementTag() const
-{
- switch (m_aElementType)
- {
- case ElementType::schema: return rtl::OUString( TAG_SCHEMA );
- case ElementType::layer: return rtl::OUString( TAG_LAYER );
-
- case ElementType::component: return rtl::OUString( TAG_COMPONENT );
- case ElementType::templates: return rtl::OUString( TAG_TEMPLATES );
-
- case ElementType::property: return rtl::OUString( TAG_PROP );
- case ElementType::node: return rtl::OUString( TAG_NODE );
- case ElementType::group: return rtl::OUString( TAG_GROUP );
- case ElementType::set: return rtl::OUString( TAG_SET );
-
- case ElementType::import: return rtl::OUString( TAG_IMPORT );
- case ElementType::instance: return rtl::OUString( TAG_INSTANCE );
- case ElementType::item_type: return rtl::OUString( TAG_ITEMTYPE );
- case ElementType::value: return rtl::OUString( TAG_VALUE );
- case ElementType::uses: return rtl::OUString( TAG_USES );
-
- case ElementType::unknown:
- OSL_ENSURE(false, "ElementFormatter: Trying to get Tag for 'unknown' element type");
- break;
- case ElementType::other:
- OSL_ENSURE(false, "ElementFormatter: Trying to get Tag for 'other' element type");
- break;
- default:
- OSL_ENSURE(false, "ElementFormatter: Trying to get Tag for invalid element type");
- break;
- }
- return rtl::OUString();
-}
-// -----------------------------------------------------------------------------
-
-uno::Reference< sax::XAttributeList > ElementFormatter::getElementAttributes() const
-{
- return m_xAttributes.get();
-}
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-} // namespace
-} // namespace
-
diff --git a/configmgr/source/xml/elementformatter.hxx b/configmgr/source/xml/elementformatter.hxx
deleted file mode 100644
index c66f0ff7e5..0000000000
--- a/configmgr/source/xml/elementformatter.hxx
+++ /dev/null
@@ -1,115 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_XML_ELEMENTFORMATTER_HXX
-#define CONFIGMGR_XML_ELEMENTFORMATTER_HXX
-
-#include "elementinfo.hxx"
-#include <com/sun/star/xml/sax/XAttributeList.hpp>
-
-#include <rtl/ref.hxx>
-
-namespace comphelper {
- class AttributeList;
-}
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace xml
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace sax = ::com::sun::star::xml::sax;
-
-// -----------------------------------------------------------------------------
- class ElementFormatter
- {
- public:
- ElementFormatter();
- ~ElementFormatter();
-
- /// reset the formatter for a new document
- void reset();
-
- /// resets the formatter for a new element type
- void prepareElement(ElementInfo const& _aInfo);
-
- /// resets the formatter for a new element type
- void prepareSimpleElement(ElementType::Enum _eType);
-
- /// sets the instantiated type of a set item,
- void addInstanceType(rtl::OUString const & _aElementType, rtl::OUString const & _aElementTypeModule);
-
- /// retrieve element type and associated module name of a set,
- void addPropertyValueType(uno::Type const& _aType);
-
- /// add a language for the current element
- void addLanguage(rtl::OUString const & _sLanguage);
-
- /// adds a value attribute to the attribute list
- void addIsNull(bool _bIsNull = true);
-
- /// adds a value attribute to the attribute list
- void addSeparator(rtl::OUString const& _sSeparator);
-
- /// retrieve the tag to use for the current element
- rtl::OUString getElementTag() const;
-
- /// retrieve the attributes to use for the current element
- uno::Reference< sax::XAttributeList > getElementAttributes() const;
-
- /// retrieve the attributes to use for an element with associated component
- private:
- void addNamespaces();
- /// sets an attributes for a node
- void addName(rtl::OUString const & _aName);
- /// sets attributes for nodes from the flags
- void addNodeFlags(sal_Int16 _eFlags);
- /// sets attributes for nodes from the flags
- void addOperation(Operation::Enum _eOp);
- /// sets attributes for nodes from the flags
- void maybeAddFlag(sal_Int16 _eFlags, sal_Int16 _eSelect,
- rtl::OUString const & _anAttributeName, bool _bValue = true);
-
- /// sets attributes for nodes
- void addAttribute(rtl::OUString const & _anAttributeName, rtl::OUString const & _aValue);
- void addAttribute(rtl::OUString const & _anAttributeName, bool _bValue);
-
- private:
- ElementType::Enum m_aElementType;
- rtl::Reference< ::comphelper::AttributeList> m_xAttributes;
- };
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
- } // namespace xml
-// -----------------------------------------------------------------------------
-} // namespace configmgr
-
-#endif
-
diff --git a/configmgr/source/xml/elementinfo.hxx b/configmgr/source/xml/elementinfo.hxx
deleted file mode 100644
index 3147c712af..0000000000
--- a/configmgr/source/xml/elementinfo.hxx
+++ /dev/null
@@ -1,116 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-/* PLEASE DON'T DELETE ANY COMMENT LINES, ALSO IT'S UNNECESSARY. */
-
-#ifndef CONFIGMGR_XML_ELEMENTINFO_HXX
-#define CONFIGMGR_XML_ELEMENTINFO_HXX
-
-#include <sal/types.h>
-#include <rtl/ustring.hxx>
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace xml
- {
-// -----------------------------------------------------------------------------
- namespace ElementType
- {
- enum Enum
- {
- unknown,
-
- schema,
- layer,
-
- component,
- templates,
-
- property,
- node,
- group,
- set,
-
- import,
- instance,
- item_type,
- value,
- uses,
-
- other
- };
- }
-// -----------------------------------------------------------------------------
- namespace Operation
- {
- enum Enum
- {
- none,
-
- modify,
- clear,
-
- replace,
- fuse,
- remove,
-
- unknown
- };
- }
-// -----------------------------------------------------------------------------
- struct ElementInfo
- {
- explicit
- ElementInfo(ElementType::Enum _type = ElementType::unknown)
- : name()
- , type(_type)
- , op(Operation::none)
- , flags()
- {}
-
- explicit
- ElementInfo(rtl::OUString const & _name, ElementType::Enum _type = ElementType::unknown)
- : name(_name)
- , type(_type)
- , op(Operation::none)
- , flags()
- {}
-
-
- rtl::OUString name;
- ElementType::Enum type;
- Operation::Enum op;
- sal_Int16 flags;
- };
-// -----------------------------------------------------------------------------
- } // namespace xml
-// -----------------------------------------------------------------------------
-} // namespace configmgr
-
-#endif
-
diff --git a/configmgr/source/xml/elementparser.cxx b/configmgr/source/xml/elementparser.cxx
deleted file mode 100644
index e7a416aaa8..0000000000
--- a/configmgr/source/xml/elementparser.cxx
+++ /dev/null
@@ -1,582 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "elementparser.hxx"
-#include "xmlstrings.hxx"
-#include "typeconverter.hxx"
-
-#include <com/sun/star/configuration/backend/SchemaAttribute.hpp>
-#include <com/sun/star/configuration/backend/NodeAttribute.hpp>
-
-#include <rtl/ustrbuf.hxx>
-
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace xml
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace sax = ::com::sun::star::xml::sax;
-// -----------------------------------------------------------------------------
-
-static
-inline
-sal_Int16 impl_getIndexByName(uno::Reference< sax::XAttributeList > const& xAttribs, rtl::OUString const& aAttributeName)
-{
- OSL_PRECOND( xAttribs.is(), "ERROR: NULL Attribute list");
-
- sal_Int16 nIndex = xAttribs->getLength();
-
- while (--nIndex >= 0)
- {
- if (xAttribs->getNameByIndex(nIndex).equals(aAttributeName))
- break;
- }
- // nIndex == -1 if not found
-
- return nIndex;
-}
-// -----------------------------------------------------------------------------
-static
-inline
-bool impl_maybeGetAttribute(uno::Reference< sax::XAttributeList > const& xAttribs, rtl::OUString const& aAttributeName, /* OUT */ rtl::OUString& rAttributeValue)
-{
- OSL_PRECOND( xAttribs.is(), "ERROR: NULL Attribute list");
-
- rtl::OUString aValue = xAttribs->getValueByName(aAttributeName);
- if( aValue.getLength()!=0)
- {
- rAttributeValue = aValue;
- return true;
- }
- return false;
-}
-// -----------------------------------------------------------------------------
-
-/// retrieve the (almost) complete information for an element
-ElementInfo ElementParser::parseElementInfo(rtl::OUString const& _sTag, uno::Reference< sax::XAttributeList > const& _xAttribs) const
-{
- ElementType::Enum aType = this->getNodeType(_sTag,_xAttribs);
-
- ElementInfo aInfo( this->getName(_sTag,_xAttribs,aType), aType );
-
- aInfo.op = this->getOperation(_xAttribs,aType);
- aInfo.flags = this->getNodeFlags(_xAttribs,aType);
-
- return aInfo;
-}
-// -----------------------------------------------------------------------------
-
-ElementType::Enum ElementParser::getNodeType(rtl::OUString const& _sElementName, uno::Reference< sax::XAttributeList > const& _xAttribs) const
-{
- { (void)_xAttribs; }
- OSL_PRECOND( _xAttribs.is(), "ERROR: NULL Attribute list");
-
- // todo: make this use a table, if necessary
- ElementType::Enum eResult = ElementType::unknown;
- if (_sElementName.equals(TAG_VALUE))
- eResult = ElementType::value;
-
- else if (_sElementName.equals(TAG_PROP))
- eResult = ElementType::property;
-
- else if (_sElementName.equals(TAG_NODE))
- eResult = ElementType::node;
-
- else if (_sElementName.equals(TAG_GROUP))
- eResult = ElementType::group;
-
- else if (_sElementName.equals(TAG_SET))
- eResult = ElementType::set;
-
- else if (_sElementName.equals(TAG_INSTANCE))
- eResult = ElementType::instance;
-
- else if (_sElementName.equals(TAG_ITEMTYPE))
- eResult = ElementType::item_type;
-
- else if (_sElementName.equals(TAG_IMPORT))
- eResult = ElementType::import;
-
- else if (_sElementName.equals(TAG_LAYER))
- eResult = ElementType::layer;
-
- else if (_sElementName.equals(TAG_SCHEMA))
- eResult = ElementType::schema;
-
- else if (_sElementName.equals(TAG_COMPONENT))
- eResult = ElementType::component;
-
- else if (_sElementName.equals(TAG_TEMPLATES))
- eResult = ElementType::templates;
-
- else if (_sElementName.equals(TAG_USES))
- eResult = ElementType::uses;
-
- // #109668# maintain support for old tag on load
- else if (_sElementName.equals(DEPRECATED_TAG_LAYER))
- {
- logger().warning("Layer starts with invalid root tag \"oor:node\". Use \"oor:component-data\" instead.",
- "getNodeType()","configmgr::xml::ElementParser");
- eResult = ElementType::layer;
- }
-
- else
- eResult = ElementType::other;
-
- return eResult;
-}
-// -----------------------------------------------------------------------------
-
-/// takes the node name from either an attribute or the element name
-rtl::OUString ElementParser::getName(rtl::OUString const& _sElementName, uno::Reference< sax::XAttributeList > const& _xAttribs, ElementType::Enum _eType) const
-{
- rtl::OUString aName;
- rtl::OUString aPackage;
-
- bool bNameFound = this->maybeGetAttribute(_xAttribs, ATTR_NAME, aName);
- bool bPackage = false;
-
- switch (_eType)
- {
- case ElementType::schema:
- bPackage = this->maybeGetAttribute(_xAttribs,ATTR_PACKAGE,aPackage);
- OSL_ENSURE(bPackage, "configmgr::xml::ElementParser: Found schema without package.");
- break;
-
- case ElementType::layer:
- bPackage = this->maybeGetAttribute(_xAttribs,ATTR_PACKAGE,aPackage);
-
- if (!bPackage) // for compatibility we still support 'oor:context'
- {
- bPackage = this->maybeGetAttribute(_xAttribs,ATTR_CONTEXT,aPackage);
-
- if (bPackage)
- {
- // TODO: log this
- OSL_TRACE("configmgr::xml::ElementParser: Found obsolete layer attribute "
- "oor:context=\"%s\" in component \"%s\".\n",
- rtl::OUStringToOString(aPackage,RTL_TEXTENCODING_ASCII_US).getStr(),
- rtl::OUStringToOString(aName,RTL_TEXTENCODING_ASCII_US).getStr());
- }
- }
-
- OSL_ENSURE(bPackage, "configmgr::xml::ElementParser: Found layer without package.");
- break;
-
- case ElementType::node:
- case ElementType::set:
- case ElementType::group:
- case ElementType::instance:
- case ElementType::property:
- break;
-
- // these have no name to speak of
- case ElementType::value:
- case ElementType::item_type:
- case ElementType::import:
- case ElementType::uses:
- case ElementType::templates:
- case ElementType::component:
- OSL_ENSURE(!bNameFound, "Configuration Parser: Unexpected name attribute is ignored\n");
- return _sElementName;
-
- // for unknown prefer name to
- case ElementType::unknown:
- if (!bNameFound) return _sElementName;
-
- bPackage = this->maybeGetAttribute(_xAttribs,ATTR_PACKAGE,aPackage);
- break;
-
- default:
- if (!bNameFound) return _sElementName;
- break;
- }
-
- OSL_ENSURE(aName.getLength(),"Found empty name tag on element");
-
- if (bPackage)
- {
- static const sal_Unicode chPackageSep = '.';
-
- aName = aPackage.concat(rtl::OUString(&chPackageSep,1)).concat(aName);
- }
- else
- {
- OSL_ENSURE(!this->maybeGetAttribute(_xAttribs,ATTR_PACKAGE,aPackage),
- "configmgr::xml::ElementParser: Found unexpected 'oor:package' on inner or unknown node." );
- }
-
- return aName;
-}
-// -----------------------------------------------------------------------------
-
-Operation::Enum ElementParser::getOperation(uno::Reference< sax::XAttributeList > const& xAttribs,ElementType::Enum _eType) const
-{
- rtl::OUString sOpName;
- if ((_eType != ElementType::property) && (_eType !=ElementType::node))
- {
- return Operation::none;
- }
-
- if ( !this->maybeGetAttribute(xAttribs,ATTR_OPERATION, sOpName) )
- return Operation::none;
-
- if (sOpName.equals(OPERATION_MODIFY))
- return Operation::modify;
-
- else if (sOpName.equals(OPERATION_REPLACE))
- return Operation::replace;
- else if (sOpName.equals(OPERATION_FUSE))
- return Operation::fuse;
-
- else if (sOpName.equals(OPERATION_REMOVE))
- return Operation::remove;
-#if 0
- else if (sOpName.equals(OPERATION_CLEAR))
- return Operation::clear;
-#endif
- else
- return Operation::unknown;
-}
-// -----------------------------------------------------------------------------
-
-
-/// retrieve the locale stored in the attribute list
-bool ElementParser::getLanguage(uno::Reference< sax::XAttributeList > const& xAttribs, rtl::OUString& _rsLanguage) const
-{
- return this->maybeGetAttribute(xAttribs, EXT_ATTR_LANGUAGE, _rsLanguage);
-}
-// -----------------------------------------------------------------------------
-
-/// reads attributes for nodes from the attribute list
-sal_Int16 ElementParser::getNodeFlags(uno::Reference< sax::XAttributeList > const& xAttribs,ElementType::Enum _eType) const
-{
- namespace NodeAttribute = ::com::sun::star::configuration::backend::NodeAttribute;
- namespace SchemaAttribute = ::com::sun::star::configuration::backend::SchemaAttribute;
-
- bool bValue;
-
- sal_Int16 aResult = 0;
-
- switch(_eType)
- {
- case ElementType::property :
- if (this->maybeGetAttribute(xAttribs, ATTR_FLAG_NULLABLE, bValue) && ! bValue)
- aResult |= SchemaAttribute::REQUIRED;
- if (this->maybeGetAttribute(xAttribs, ATTR_FLAG_LOCALIZED, bValue) && bValue)
- aResult |= SchemaAttribute::LOCALIZED;
- if (this->maybeGetAttribute(xAttribs, ATTR_FLAG_READONLY, bValue) && bValue)
- aResult |= NodeAttribute::READONLY;
- if (this->maybeGetAttribute(xAttribs, ATTR_FLAG_FINALIZED, bValue) && bValue)
- aResult |= NodeAttribute::FINALIZED;
- break;
-
- case ElementType::node:
- if (this->maybeGetAttribute(xAttribs, ATTR_FLAG_FINALIZED, bValue) && bValue)
- aResult |= NodeAttribute::FINALIZED;
- if (this->maybeGetAttribute(xAttribs, ATTR_FLAG_MANDATORY, bValue) && bValue)
- aResult |= NodeAttribute::MANDATORY;
- if (this->maybeGetAttribute(xAttribs, ATTR_FLAG_READONLY, bValue) && bValue)
- aResult |= NodeAttribute::READONLY;
- break;
-
- case ElementType::group:
- case ElementType::set:
- if (this->maybeGetAttribute(xAttribs, ATTR_FLAG_EXTENSIBLE, bValue) && bValue)
- aResult |= SchemaAttribute::EXTENSIBLE;
- break;
-
- case ElementType::layer:
- if (this->maybeGetAttribute(xAttribs, ATTR_FLAG_READONLY, bValue) && bValue)
- aResult |= NodeAttribute::READONLY;
- if (this->maybeGetAttribute(xAttribs, ATTR_FLAG_FINALIZED, bValue) && bValue)
- aResult |= NodeAttribute::FINALIZED;
- break;
-
- default:
- break;
-
- }
- return aResult;
-}
-// -----------------------------------------------------------------------------
-static
-void badValueType(Logger const & logger, sal_Char const * _pMsg, rtl::OUString const & _sType)
-{
- rtl::OUStringBuffer sMessageBuf;
- sMessageBuf.appendAscii( "Configuration XML parser: Bad value type attribute: " );
- if (_pMsg) sMessageBuf.appendAscii(_pMsg);
-
- const sal_Unicode kQuote = '"';
- sMessageBuf.append(kQuote).append(_sType).append(kQuote);
-
- rtl::OUString const sMessage = sMessageBuf.makeStringAndClear();
- logger.error(sMessage);
- throw ElementParser::BadValueType(sMessage);
-}
-// -----------------------------------------------------------------------------
-static
-inline
-sal_Bool matchNsPrefix(rtl::OUString const & _sString, rtl::OUString const & _sPrefix)
-{
- return _sString.match(_sPrefix) &&
- _sString.getStr()[_sPrefix.getLength()] == k_NS_SEPARATOR;
-}
-// -----------------------------------------------------------------------------
-static
-inline
-sal_Bool matchSuffix(rtl::OUString const & _sString, rtl::OUString const & _sSuffix)
-{
- sal_Int32 nSuffixStart = _sString.getLength() - _sSuffix.getLength();
- if (nSuffixStart < 0)
- return false;
-
- return _sString.match(_sSuffix,nSuffixStart);
-}
-// -----------------------------------------------------------------------------
-static
-inline
-rtl::OUString stripNsPrefix(rtl::OUString const & _sString, rtl::OUString const & _sPrefix)
-{
- OSL_ASSERT( matchNsPrefix(_sString,_sPrefix) );
-
- return _sString.copy(_sPrefix.getLength() + 1);
-}
-// -----------------------------------------------------------------------------
-static
-inline
-rtl::OUString stripSuffix(rtl::OUString const & _sString, rtl::OUString const & _sSuffix)
-{
- OSL_ASSERT( matchSuffix(_sString,_sSuffix) );
-
- sal_Int32 nSuffixStart = _sString.getLength() - _sSuffix.getLength();
-
- return _sString.copy(0,nSuffixStart);
-}
-// -----------------------------------------------------------------------------
-static
-inline
-rtl::OUString stripTypeName(Logger const & logger, rtl::OUString const & _sString, rtl::OUString const & _sPrefix)
-{
- if ( matchNsPrefix(_sString,_sPrefix))
- return stripNsPrefix(_sString, _sPrefix);
-
- badValueType(logger, "Missing expected namespace prefix on type name: ", _sString);
-
- return _sString;
-}
-// -----------------------------------------------------------------------------
-static
-uno::Type xmlToScalarType(const rtl::OUString& _rType)
-{
- uno::Type aRet;
-
- if (_rType.equalsIgnoreAsciiCaseAscii(VALUETYPE_BOOLEAN))
- aRet = ::getBooleanCppuType();
-
- else if(_rType.equalsIgnoreAsciiCaseAscii(VALUETYPE_SHORT))
- aRet = ::getCppuType(static_cast<sal_Int16 const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCaseAscii(VALUETYPE_INT))
- aRet = ::getCppuType(static_cast<sal_Int32 const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCaseAscii(VALUETYPE_LONG))
- aRet = ::getCppuType(static_cast<sal_Int64 const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCaseAscii(VALUETYPE_DOUBLE))
- aRet = ::getCppuType(static_cast< double const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCaseAscii(VALUETYPE_STRING))
- aRet = ::getCppuType(static_cast<rtl::OUString const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCaseAscii(VALUETYPE_BINARY))
- aRet = ::getCppuType(static_cast<uno::Sequence<sal_Int8> const*>(0));
-
- else if(_rType.equalsIgnoreAsciiCaseAscii(VALUETYPE_ANY))
- aRet = ::getCppuType(static_cast<uno::Any const*>(0));
-
- else
- OSL_ENSURE(false,"Cannot parse: Unknown value type");
-
- return aRet;
-}
-// -----------------------------------------------------------------------------
-uno::Type xmlToListType(const rtl::OUString& _aElementType)
-{
- uno::Type aRet;
-
- if (_aElementType.equalsIgnoreAsciiCaseAscii(VALUETYPE_BOOLEAN))
- aRet = ::getCppuType(static_cast<uno::Sequence<sal_Bool> const*>(0));
-
- else if(_aElementType.equalsIgnoreAsciiCaseAscii(VALUETYPE_SHORT))
- aRet = ::getCppuType(static_cast<uno::Sequence<sal_Int16> const*>(0));
-
- else if(_aElementType.equalsIgnoreAsciiCaseAscii(VALUETYPE_INT))
- aRet = ::getCppuType(static_cast<uno::Sequence<sal_Int32> const*>(0));
-
- else if(_aElementType.equalsIgnoreAsciiCaseAscii(VALUETYPE_LONG))
- aRet = ::getCppuType(static_cast<uno::Sequence<sal_Int64> const*>(0));
-
- else if(_aElementType.equalsIgnoreAsciiCaseAscii(VALUETYPE_DOUBLE))
- aRet = ::getCppuType(static_cast<uno::Sequence<double> const*>(0));
-
- else if(_aElementType.equalsIgnoreAsciiCaseAscii(VALUETYPE_STRING))
- aRet = ::getCppuType(static_cast<uno::Sequence<rtl::OUString> const*>(0));
-
- else if(_aElementType.equalsIgnoreAsciiCaseAscii(VALUETYPE_BINARY))
- aRet = ::getCppuType(static_cast<uno::Sequence<uno::Sequence<sal_Int8> > const*>(0));
-
- else
- OSL_ENSURE(false,"Cannot parse: Unknown list value type");
-
- return aRet;
-}
-// -----------------------------------------------------------------------------
-/// retrieve data type of a property,
-uno::Type ElementParser::getPropertyValueType(uno::Reference< sax::XAttributeList > const& xAttribs) const
-{
- rtl::OUString sTypeName;
- if (!this->maybeGetAttribute(xAttribs, ATTR_VALUETYPE, sTypeName))
- return uno::Type(); // => VOID
-
- uno::Type aType;
-
- // valuetype names are either 'xs:<type>' or 'oor:<type>' or 'oor:<type>-list'
- if (matchSuffix(sTypeName,VALUETYPE_LIST_SUFFIX))
- {
- rtl::OUString sBasicName = stripTypeName( mLogger, stripSuffix(sTypeName,VALUETYPE_LIST_SUFFIX), NS_PREFIX_OOR );
-
- aType = xmlToListType(sBasicName);
- }
- else
- {
- rtl::OUString sPrefix = matchNsPrefix(sTypeName,NS_PREFIX_OOR) ? rtl::OUString( NS_PREFIX_OOR ) : rtl::OUString( NS_PREFIX_XS );
-
- rtl::OUString sBasicName = stripTypeName( mLogger, sTypeName, sPrefix );
-
- aType = xmlToScalarType(sBasicName);
- }
-
- if (aType == uno::Type())
- badValueType(mLogger,"Unknown type name: ", sTypeName);
-
- return aType;
-}
-// -----------------------------------------------------------------------------
-
-/// retrieve element type and associated module name of a set,
-bool ElementParser::getSetElementType(uno::Reference< sax::XAttributeList > const& xAttribs, rtl::OUString& aElementType, rtl::OUString& aElementTypeModule) const
-{
- if (!this->maybeGetAttribute(xAttribs, ATTR_ITEMTYPE, aElementType))
- return false;
-
- maybeGetAttribute(xAttribs, ATTR_ITEMTYPECOMPONENT, aElementTypeModule);
-
- return true;
-}
-// -----------------------------------------------------------------------------
-
-/// retrieve instance type and associated module name of a set,
-bool ElementParser::getInstanceType(uno::Reference< sax::XAttributeList > const& xAttribs, rtl::OUString& aElementType, rtl::OUString& aElementTypeModule) const
-{
- if (!this->maybeGetAttribute(xAttribs, ATTR_ITEMTYPE, aElementType))
- return false;
-
- maybeGetAttribute(xAttribs, ATTR_ITEMTYPECOMPONENT, aElementTypeModule);
-
- return true;
-}
-// -----------------------------------------------------------------------------
-
-/// retrieve the component for an import or uses element,
-bool ElementParser::getImportComponent(uno::Reference< sax::XAttributeList > const& xAttribs, rtl::OUString& _rsComponent) const
-{
- return this->maybeGetAttribute(xAttribs, ATTR_COMPONENT, _rsComponent);
-}
-// -----------------------------------------------------------------------------
-
-/// reads attributes for values from the attribute list
-bool ElementParser::isNull(uno::Reference< sax::XAttributeList > const& _xAttribs) const
-{
- bool bNull;
- return maybeGetAttribute(_xAttribs, EXT_ATTR_NULL, bNull) && bNull;
-}
-// -----------------------------------------------------------------------------
-
-/// reads attributes for values from the attribute list
-rtl::OUString ElementParser::getSeparator(uno::Reference< sax::XAttributeList > const& _xAttribs) const
-{
- rtl::OUString aSeparator;
- maybeGetAttribute(_xAttribs, ATTR_VALUESEPARATOR, aSeparator);
- return aSeparator;
-}
-// -----------------------------------------------------------------------------
-
-// low-level internal methods
-/// checks for presence of a boolean attribute and assigns its value if it exists (and is a bool)
-bool ElementParser::maybeGetAttribute(uno::Reference< sax::XAttributeList > const& xAttribs, rtl::OUString const& aAttributeName, bool& rAttributeValue) const
-{
- rtl::OUString sAttribute;
-
- if ( !this->maybeGetAttribute(xAttribs, aAttributeName, sAttribute) )
- {
- return false;
- }
-
- else if (sAttribute.equals(ATTR_VALUE_TRUE))
- rAttributeValue = true; // will return true
-
- else if (sAttribute.equals(ATTR_VALUE_FALSE))
- rAttributeValue = false; // will return true
-
- else
- {
- OSL_ENSURE(sAttribute.getLength() == 0, "Invalid text found in boolean attribute");
- return false;
- }
-
- return true;
-}
-// -----------------------------------------------------------------------------
-
-/// checks for presence of an attribute and assigns its value if it exists
-bool ElementParser::maybeGetAttribute(uno::Reference< sax::XAttributeList > const& xAttribs, rtl::OUString const& aAttributeName, rtl::OUString& rAttributeValue) const
-{
- return xAttribs.is() && impl_maybeGetAttribute(xAttribs, aAttributeName, rAttributeValue);
-}
-
-// -----------------------------------------------------------------------------
-} // namespace
-} // namespace
-
diff --git a/configmgr/source/xml/elementparser.hxx b/configmgr/source/xml/elementparser.hxx
deleted file mode 100644
index 02a918e88a..0000000000
--- a/configmgr/source/xml/elementparser.hxx
+++ /dev/null
@@ -1,122 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_XML_ELEMENTPARSER_HXX
-#define CONFIGMGR_XML_ELEMENTPARSER_HXX
-
-#include "elementinfo.hxx"
-#include "logger.hxx"
-#include <com/sun/star/xml/sax/XAttributeList.hpp>
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace xml
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace sax = ::com::sun::star::xml::sax;
-
-// -----------------------------------------------------------------------------
- class ElementParser
- {
- Logger mLogger;
- public:
- class BadValueType
- {
- rtl::OUString mMessage;
- public:
- BadValueType(rtl::OUString const & aMessage) : mMessage(aMessage) {}
-
- rtl::OUString message() const { return mMessage.getStr(); }
- };
- public:
- explicit
- ElementParser(Logger const & xLogger)
- : mLogger(xLogger)
- {}
-
- Logger const & logger() const { return mLogger; }
-
- /// reset the parser for a new document
- void reset()
- {}
-
- /// retrieve the (almost) complete information for an element
- ElementInfo parseElementInfo(rtl::OUString const& _sTag, uno::Reference< sax::XAttributeList > const& _xAttribs) const;
-
- /// retrieve the node name for an element
- ElementType::Enum getNodeType(rtl::OUString const& _sTag, uno::Reference< sax::XAttributeList > const& xAttribs) const;
-
- /// retrieve the node name for an element
- rtl::OUString getName(rtl::OUString const& _sTag, uno::Reference< sax::XAttributeList > const& xAttribs, ElementType::Enum eType = ElementType::unknown) const;
-
- /// query whether the node has an operation
- Operation::Enum getOperation(uno::Reference< sax::XAttributeList > const& xAttribs, ElementType::Enum _eType) const;
-
- /// retrieve the language (if any) stored in the attribute list
- bool getLanguage(uno::Reference< sax::XAttributeList > const& xAttribs, rtl::OUString & _rsLanguage) const;
-
- /// reads attributes for nodes from the attribute list
- sal_Int16 getNodeFlags(uno::Reference< sax::XAttributeList > const& xAttribs, ElementType::Enum _eType) const;
-
- /// retrieve element type and associated module name of a set,
- bool getSetElementType(uno::Reference< sax::XAttributeList > const& _xAttribs, rtl::OUString& _rsElementType, rtl::OUString& _rsElementTypeModule) const;
-
- /// retrieve the instance type and associated module name of a instance,
- bool getInstanceType(uno::Reference< sax::XAttributeList > const& _xAttribs, rtl::OUString& _rsElementType, rtl::OUString& _rsElementTypeModule) const;
-
- /// retrieve the component for an import or uses element,
- bool getImportComponent(uno::Reference< sax::XAttributeList > const& _xAttribs, rtl::OUString& _rsComponent) const;
-
- /// retrieve element type and associated module name of a set,
- uno::Type getPropertyValueType(uno::Reference< sax::XAttributeList > const& _xAttribs) const;
- // throw( BadValueType )
-
- /// reads a value attribute from the attribute list
- bool isNull(uno::Reference< sax::XAttributeList > const& _xAttribs) const;
-
- /// reads a value attribute from the attribute list
- rtl::OUString getSeparator(uno::Reference< sax::XAttributeList > const& _xAttribs) const;
-
- // low-level internal methods
-
- /// checks for presence of a boolean attribute and assigns its value if it exists (and is a bool)
- bool maybeGetAttribute(uno::Reference< sax::XAttributeList > const& _xAttribs, rtl::OUString const& _aAttributeName, bool& _rbAttributeValue) const;
-
- /// checks for presence of an attribute and assigns its value if it exists
- bool maybeGetAttribute(uno::Reference< sax::XAttributeList > const& _xAttribs, rtl::OUString const& _aAttributeName, rtl::OUString& _rsAttributeValue) const;
- };
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
- } // namespace xml
-// -----------------------------------------------------------------------------
-} // namespace configmgr
-
-#endif
-
diff --git a/configmgr/source/xml/layerparser.cxx b/configmgr/source/xml/layerparser.cxx
deleted file mode 100644
index a29bc593f7..0000000000
--- a/configmgr/source/xml/layerparser.cxx
+++ /dev/null
@@ -1,368 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "com/sun/star/configuration/backend/NodeAttribute.hpp"
-#include "layerparser.hxx"
-
-// -----------------------------------------------------------------------------
-#include "wrapexception.hxx"
-
-#define WRAP_PARSE_EXCEPTIONS() \
- PASS_EXCEPTION(sax::SAXException) \
- PASS_EXCEPTION(uno::RuntimeException) \
- WRAP_CONFIGDATA_EXCEPTIONS( raiseParseException ) \
- WRAP_OTHER_EXCEPTIONS( raiseParseException )
-
-#define WRAP_PARSE_EXCEPTIONS_MSG( msg ) \
- PASS_EXCEPTION(sax::SAXException) \
- PASS_EXCEPTION(uno::RuntimeException) \
- WRAP_CONFIGDATA_EXCEPTIONS1( raiseParseException, msg ) \
- WRAP_OTHER_EXCEPTIONS1( raiseParseException, msg )
-
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace xml
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace sax = ::com::sun::star::xml::sax;
-// -----------------------------------------------------------------------------
-
-LayerParser::LayerParser(uno::Reference< uno::XComponentContext > const & _xContext, uno::Reference< backenduno::XLayerHandler > const & _xHandler)
-: BasicParser(_xContext)
-, m_xHandler(_xHandler)
-, m_bRemoved(false)
-, m_bNewProp(false)
-{
- if (!m_xHandler.is())
- {
- rtl::OUString sMessage(RTL_CONSTASCII_USTRINGPARAM("Cannot create LayerParser: Unexpected NULL Handler"));
- throw uno::RuntimeException(sMessage, NULL);
- }
-}
-// -----------------------------------------------------------------------------
-
-LayerParser::~LayerParser()
-{
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerParser::startDocument( )
- throw (sax::SAXException, uno::RuntimeException)
-{
- BasicParser::startDocument();
-
- try
- {
- OSL_ENSURE(isEmptyNode(), "BasicParser does not mark new document as empty");
-
- m_xHandler->startLayer();
- m_bRemoved = false;
- m_bNewProp = false;
- }
- WRAP_PARSE_EXCEPTIONS_MSG("LayerParser - Starting layer")
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerParser::endDocument( ) throw (sax::SAXException, uno::RuntimeException)
-{
- if (isEmptyNode()) OSL_TRACE("Configuration Parser: XML layer document ended without any data");
-
- BasicParser::endDocument();
-
- try
- {
- m_xHandler->endLayer();
- }
- WRAP_PARSE_EXCEPTIONS_MSG("LayerParser - Ending layer")
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerParser::startElement( const rtl::OUString& aName, const uno::Reference< sax::XAttributeList >& xAttribs )
- throw (sax::SAXException, uno::RuntimeException)
-{
- if ( this->isSkipping() )
- {
- this->startSkipping( aName, xAttribs );
- return;
- }
-
- ElementInfo aInfo = getDataParser().parseElementInfo(aName,xAttribs);
-
- try
- {
- switch (aInfo.type)
- {
- case ElementType::group: case ElementType::set:
- OSL_ENSURE( false, "Layer XML parser - Unexpected: found group/set element (should be 'node')\n");
- // fall thru
- case ElementType::layer:
- case ElementType::node:
- this->startNode(aInfo,xAttribs);
- OSL_ASSERT( this->isInNode() && !this->isInProperty() );
- break;
-
- case ElementType::property:
- this->startProperty(aInfo,xAttribs);
- OSL_ASSERT( this->isInUnhandledProperty() );
- break;
-
- case ElementType::value:
- this->startValueData(xAttribs);
- OSL_ASSERT( this->isInValueData() );
- break;
-
- default: // skip unknown elements
- OSL_ENSURE( aInfo.type >= ElementType::other, "Layer XML parser - Unexpected: found schema element in layer data\n");
- OSL_ENSURE( aInfo.type < ElementType::other, "Layer XML parser - Warning: ignoring unknown element tag\n");
- this->startSkipping( aName, xAttribs );
- return;
- }
- }
- WRAP_PARSE_EXCEPTIONS_MSG("LayerParser - Starting Element")
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL LayerParser::endElement( const rtl::OUString& aName )
- throw (sax::SAXException, uno::RuntimeException)
-{
- if ( this->wasSkipping(aName) )
- return;
-
- try
- {
- if ( this->isInValueData())
- this->endValueData();
-
- else if (this->isInProperty())
- this->endProperty();
-
- else if (this->isInNode())
- this->endNode();
-
- else {
- this->raiseParseException("Layer parser: Invalid XML: endElement without matching startElement");
- }
- }
- WRAP_PARSE_EXCEPTIONS_MSG("LayerParser - Ending Element")
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-void LayerParser::startNode( ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& xAttribs )
-{
- this->checkNotRemoved();
-
- BasicParser::startNode(aInfo,xAttribs);
-
- switch (aInfo.op)
- {
- case Operation::none:
- case Operation::modify:
- m_xHandler->overrideNode(aInfo.name,aInfo.flags,false);
- break;
-
- case Operation::clear:
- m_xHandler->overrideNode(aInfo.name,aInfo.flags,true);
- break;
-
- case Operation::replace:
- case Operation::fuse:
- {
- backenduno::TemplateIdentifier aTemplate;
- sal_Int16 flags = aInfo.flags;
- if (aInfo.op == Operation::fuse) {
- flags |=
- com::sun::star::configuration::backend::NodeAttribute::FUSE;
- }
- if (getDataParser().getInstanceType(xAttribs,aTemplate.Name,aTemplate.Component))
- m_xHandler->addOrReplaceNodeFromTemplate(aInfo.name,aTemplate,flags);
- else
- m_xHandler->addOrReplaceNode(aInfo.name,flags);
- }
- break;
-
- case Operation::remove:
- m_xHandler->dropNode(aInfo.name);
- m_bRemoved = true;
- break;
-
- default: OSL_ASSERT(false);
- case Operation::unknown:
- this->raiseParseException("Layer parser: Invalid Data: unknown operation");
- }
-}
-// -----------------------------------------------------------------------------
-
-void LayerParser::endNode()
-{
- if (!this->isInRemoved())
- m_xHandler->endNode();
- else
- m_bRemoved = false;
-
- BasicParser::endNode();
-}
-// -----------------------------------------------------------------------------
-
-void LayerParser::startProperty( ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& xAttribs )
-{
- this->checkNotRemoved();
-
- BasicParser::startProperty(aInfo,xAttribs);
-
- switch (aInfo.op)
- {
- case Operation::none:
- case Operation::modify:
- m_xHandler->overrideProperty(aInfo.name,aInfo.flags,getActivePropertyType(),false);
- OSL_ASSERT(!m_bNewProp);
- break;
-
- case Operation::clear:
- m_xHandler->overrideProperty(aInfo.name,aInfo.flags,getActivePropertyType(),true);
- OSL_ASSERT(!m_bNewProp);
- break;
-
- case Operation::replace:
- // defer to later
- m_bNewProp = true;
- break;
-
- case Operation::fuse:
- this->raiseParseException("Layer parser: Invalid Data: operation 'fuse' is not permitted for properties");
-
- case Operation::remove:
- this->raiseParseException("Layer parser: Invalid Data: operation 'remove' is not permitted for properties");
-
- default: OSL_ASSERT(false);
- case Operation::unknown:
- this->raiseParseException("Layer parser: Invalid Data: unknown operation");
- }
- OSL_POSTCOND(this->isInUnhandledProperty(),"Error: Property not reckognized as unhandled");
-}
-// -----------------------------------------------------------------------------
-
-void LayerParser::addOrReplaceCurrentProperty(const uno::Any& aValue)
-{
- const ElementInfo& currentInfo = getActiveNodeInfo() ;
-
- OSL_ASSERT(currentInfo.op == Operation::replace) ;
-
- if (aValue.hasValue())
- {
- m_xHandler->addPropertyWithValue(currentInfo.name,
- currentInfo.flags, aValue) ;
- }
- else
- {
- m_xHandler->addProperty(currentInfo.name, currentInfo.flags,
- getActivePropertyType()) ;
- }
-}
-// -----------------------------------------------------------------------------
-
-void LayerParser::endProperty()
-{
- OSL_ASSERT(!this->isInRemoved());
-
- if (m_bNewProp)
- {
- OSL_ASSERT(getActiveNodeInfo().op == Operation::replace);
- if (this->isInUnhandledProperty())
- {
- // No value tag is treated as NULL
- addOrReplaceCurrentProperty( uno::Any() ) ;
- }
- m_bNewProp = false;
- }
- else
- {
- OSL_ASSERT(getActiveNodeInfo().op != Operation::replace);
- m_xHandler->endProperty();
- }
-
- BasicParser::endProperty();
-}
-// -----------------------------------------------------------------------------
-
-void LayerParser::startValueData(const uno::Reference< sax::XAttributeList >& xAttribs)
-{
- this->checkNotRemoved();
-
- BasicParser::startValueData(xAttribs);
-}
-// -----------------------------------------------------------------------------
-
-void LayerParser::endValueData()
-{
- uno::Any aValue = this->getCurrentValue();
-
- if (m_bNewProp)
- {
- if (this->isValueDataLocalized())
- getLogger().warning("Language attribute ignored for value of added property.",
- "endValueData()","configuration::xml::SchemaParser");
-
- addOrReplaceCurrentProperty(aValue) ;
- }
- else if (this->isValueDataLocalized())
- {
- rtl::OUString aLocale = this->getValueDataLocale();
-
- m_xHandler->setPropertyValueForLocale(aValue,aLocale);
- }
- else
- {
- m_xHandler->setPropertyValue(aValue);
- }
-
- BasicParser::endValueData();
-
- OSL_POSTCOND(!this->isInUnhandledProperty(),"Error: Property not reckognized as unhandled");
-}
-// -----------------------------------------------------------------------------
-
-void LayerParser::checkNotRemoved()
-{
- if (m_bRemoved)
- raiseParseException("Layer parser: Invalid Data: Data inside removed node.");
-}
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
- } // namespace
-
-// -----------------------------------------------------------------------------
-} // namespace
-
diff --git a/configmgr/source/xml/layerparser.hxx b/configmgr/source/xml/layerparser.hxx
deleted file mode 100644
index 8143041399..0000000000
--- a/configmgr/source/xml/layerparser.hxx
+++ /dev/null
@@ -1,116 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_XML_LAYERPARSER_HXX
-#define CONFIGMGR_XML_LAYERPARSER_HXX
-
-#include "basicparser.hxx"
-
-#include <com/sun/star/configuration/backend/XLayerHandler.hpp>
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace xml
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
-
- namespace sax = ::com::sun::star::xml::sax;
- namespace backenduno = ::com::sun::star::configuration::backend;
-
-// -----------------------------------------------------------------------------
-
-
- class LayerParser : public BasicParser
- {
- public:
- LayerParser(uno::Reference< uno::XComponentContext > const & _xContext, uno::Reference< backenduno::XLayerHandler > const & _xHandler);
- virtual ~LayerParser();
-
- // XDocumentHandler
- public:
- virtual void SAL_CALL
- startDocument( )
- throw (sax::SAXException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endDocument( ) throw (sax::SAXException, uno::RuntimeException);
-
- virtual void SAL_CALL
- startElement( const rtl::OUString& aName, const uno::Reference< sax::XAttributeList >& xAttribs )
- throw (sax::SAXException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endElement( const rtl::OUString& aName )
- throw (sax::SAXException, uno::RuntimeException);
-
- private:
- /// start an node
- void startNode( ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& xAttribs );
- /// end a node
- void endNode();
-
- /// start a property
- void startProperty( ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& xAttribs );
- /// end a property
- void endProperty();
-
- /// start collecting data for a value - returns the locale of the value (property must have been started)
- void startValueData(const uno::Reference< sax::XAttributeList >& xAttribs);
- /// end collecting data for a value - returns the collected value
- void endValueData();
-
- /**
- Forces the addition or replacement of a property.
- As it is possible to "replace" an existing property,
- even though this amounts to a modify, this method
- first tries to add a new property and failing that,
- to replace the value of an existing one.
-
- @param aValue value to be set for the property
- */
- void addOrReplaceCurrentProperty(const uno::Any& aValue) ;
-
- bool isInRemoved() const { return m_bRemoved; }
- void checkNotRemoved();
- private:
- uno::Reference< backenduno::XLayerHandler > m_xHandler;
- bool m_bRemoved;
- bool m_bNewProp;
- };
-// -----------------------------------------------------------------------------
- } // namespace xml
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/xml/layerwriter.cxx b/configmgr/source/xml/layerwriter.cxx
deleted file mode 100644
index 4dea7982d7..0000000000
--- a/configmgr/source/xml/layerwriter.cxx
+++ /dev/null
@@ -1,541 +0,0 @@
-/*************************************************************************
-*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
-************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "layerwriter.hxx"
-
-#ifndef CONFIGMGR_API_FACTORY_HXX_
-#include "confapifactory.hxx"
-#endif
-#include "valueformatter.hxx"
-#include <com/sun/star/beans/IllegalTypeException.hpp>
-#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
-#include <com/sun/star/configuration/backend/ConnectionLostException.hpp>
-#include <com/sun/star/configuration/backend/NodeAttribute.hpp>
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
- namespace xml
- {
- // -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace io = ::com::sun::star::io;
- namespace sax = ::com::sun::star::xml::sax;
- // -----------------------------------------------------------------------------
-
- uno::Reference< uno::XInterface > SAL_CALL instantiateLayerWriter
- ( uno::Reference< uno::XComponentContext > const& xContext )
- {
- return * new LayerWriter(xContext);
- }
- // -----------------------------------------------------------------------------
-
- namespace
- {
- static inline
- uno::Reference< script::XTypeConverter > createTCV(uno::Reference< lang::XMultiServiceFactory > const & _xSvcFactory)
- {
- OSL_ENSURE(_xSvcFactory.is(),"Cannot create Write Formatter without a ServiceManager");
-
- static const rtl::OUString k_sTCVService(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.Converter"));
-
- return uno::Reference< script::XTypeConverter >::query(_xSvcFactory->createInstance(k_sTCVService));
- }
- // -----------------------------------------------------------------------------
- static
- void translateSAXException( sax::SAXException & aSAXException,
- backenduno::XLayerHandler * context)
- {
- rtl::OUString sMessage = aSAXException.Message;
-
- uno::Any const & aWrappedException = aSAXException.WrappedException;
- if (aWrappedException.hasValue())
- {
- if (aWrappedException.getValueTypeClass() != uno::TypeClass_EXCEPTION)
- OSL_ENSURE(false, "ERROR: WrappedException is not an exception");
-
- else if (sMessage.getLength() == 0)
- sMessage = static_cast<uno::Exception const *>(aWrappedException.getValue())->Message;
-
- // assume that a SAXException with WrappedException indicates a storage access error
- throw backenduno::BackendAccessException(sMessage,context,aWrappedException);
- }
- else
- {
- // assume that a SAXException without WrappedException indicates non-well-formed data
- throw backenduno::MalformedDataException(sMessage,context,uno::makeAny(aSAXException));
- }
- }
- // -----------------------------------------------------------------------------
- static inline uno::Type getIOExceptionType()
- {
- io::IOException const * const ioexception = 0;
- return ::getCppuType(ioexception);
- }
- static inline uno::Type getNotConnectedExceptionType()
- {
- io::NotConnectedException const * const ncexception = 0;
- return ::getCppuType(ncexception);
- }
- static
- void translateIOException(uno::Any const & anIOException,
- backenduno::XLayerHandler * context)
- {
- OSL_ASSERT(anIOException.isExtractableTo(getIOExceptionType()));
- io::IOException const * pException = static_cast<io::IOException const *>(anIOException.getValue());
- rtl::OUString sMessage = pException->Message;
-
- if (anIOException.isExtractableTo(getNotConnectedExceptionType()))
- {
- throw backenduno::ConnectionLostException(sMessage,context,anIOException);
- }
- else
- {
- throw backenduno::BackendAccessException(sMessage,context,anIOException);
- }
- }
- // -----------------------------------------------------------------------------
- }
- // -----------------------------------------------------------------------------
-
- LayerWriter::LayerWriter(uno::Reference< uno::XComponentContext > const & _xContext)
- : WriterService< ::com::sun::star::configuration::backend::XLayerHandler >(_xContext)
- , m_xTCV( createTCV( WriterService< ::com::sun::star::configuration::backend::XLayerHandler >::getServiceFactory() ) )
- , m_bInProperty(false)
- , m_bStartedDocument(false)
- {
- }
- // -----------------------------------------------------------------------------
-
- LayerWriter::~LayerWriter()
- {
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerWriter::startLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException)
- {
- m_aFormatter.reset();
- m_bInProperty = false;
- m_bStartedDocument = false;
-
- checkInElement(false);
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerWriter::endLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException)
- {
- checkInElement(false);
- try
- {
- if (!m_bStartedDocument)
- {
- uno::Reference< io::XOutputStream > aStream = this->getOutputStream( );
- aStream->closeOutput();
- }
- else
- {
- getWriteHandler()->endDocument();
- m_aFormatter.reset();
- m_bStartedDocument = false;
- }
- }
- catch (sax::SAXException & xe) { translateSAXException(xe,this); }
- catch (io::NotConnectedException & ioe) { translateIOException(uno::makeAny(ioe),this); }
- catch (io::BufferSizeExceededException & ioe) { translateIOException(uno::makeAny(ioe),this); }
- catch (io::IOException & ioe) { translateIOException(uno::makeAny(ioe),this); }
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerWriter::overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException)
- {
- try
- {
- if (!m_bStartedDocument)
- {
- getWriteHandler()->startDocument();
- m_bStartedDocument = true;
- }
- ElementInfo aInfo(aName, this->isInElement() ? ElementType::node : ElementType::layer);
- aInfo.flags = aAttributes;
- aInfo.op = bClear ? Operation::clear : Operation::modify;
-
- m_aFormatter.prepareElement(aInfo);
-
- this->startNode();
- }
- catch (sax::SAXException & xe)
- {
- translateSAXException(xe,this);
- }
- }
- // -----------------------------------------------------------------------------
-
- void LayerWriter::prepareAddOrReplaceElement(
- rtl::OUString const & name, sal_Int16 attributes)
- {
- ElementInfo info(name, ElementType::node);
- info.flags = attributes &
- ~com::sun::star::configuration::backend::NodeAttribute::FUSE;
- info.op =
- (attributes &
- com::sun::star::configuration::backend::NodeAttribute::FUSE)
- == 0
- ? Operation::replace : Operation::fuse;
- m_aFormatter.prepareElement(info);
- }
-
- void SAL_CALL LayerWriter::addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException)
- {
- checkInElement(true);
-
- try
- {
- prepareAddOrReplaceElement(aName, aAttributes);
-
- this->startNode();
- }
- catch (sax::SAXException & xe)
- {
- translateSAXException(xe,this);
- }
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerWriter::addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException)
- {
- checkInElement(true);
-
- try
- {
- prepareAddOrReplaceElement(aName, aAttributes);
- m_aFormatter.addInstanceType(aTemplate.Name,aTemplate.Component);
-
- this->startNode();
- }
- catch (sax::SAXException & xe)
- {
- translateSAXException(xe,this);
- }
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerWriter::endNode( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException)
- {
- checkInElement(true);
- try
- {
- this->endElement();
- }
- catch (sax::SAXException & xe)
- {
- translateSAXException(xe,this);
- }
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerWriter::dropNode( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException)
- {
- checkInElement(true);
-
- try
- {
- ElementInfo aInfo(aName, ElementType::node);
- aInfo.flags = 0;
- aInfo.op = Operation::remove;
-
- m_aFormatter.prepareElement(aInfo);
-
- this->startNode();
- this->endElement();
- }
- catch (sax::SAXException & xe)
- {
- translateSAXException(xe,this);
- }
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerWriter::addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException)
- {
- checkInElement(true);
-
- try
- {
- ElementInfo aInfo(aName, ElementType::property);
- aInfo.flags = aAttributes;
- aInfo.op = Operation::replace;
-
- m_aFormatter.prepareElement(aInfo);
-
- this->startProp(aType, true);
- this->writeValue(uno::Any());
- this->endElement();
- }
- catch (sax::SAXException & xe)
- {
- translateSAXException(xe,this);
- }
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerWriter::addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException)
- {
- checkInElement(true);
-
- try
- {
- ElementInfo aInfo(aName, ElementType::property);
- aInfo.flags = aAttributes;
- aInfo.op = Operation::replace;
-
- m_aFormatter.prepareElement(aInfo);
-
- this->startProp(aValue.getValueType(), true);
- this->writeValue(aValue);
- this->endElement();
- }
- catch (sax::SAXException & xe)
- {
- translateSAXException(xe,this);
- }
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerWriter::overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException)
- {
- checkInElement(true);
-
- try
- {
- ElementInfo aInfo(aName, ElementType::property);
- aInfo.flags = aAttributes;
- aInfo.op = bClear ? Operation::modify : Operation::modify;
-
- m_aFormatter.prepareElement(aInfo);
-
- this->startProp(aType, aType.getTypeClass() != uno::TypeClass_VOID);
- }
- catch (sax::SAXException & xe)
- {
- translateSAXException(xe,this);
- }
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerWriter::endProperty( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException)
- {
- try
- {
- checkInElement(true,true);
- this->endElement();
- }
- catch (sax::SAXException & xe)
- {
- translateSAXException(xe,this);
- }
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerWriter::setPropertyValue( const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException)
- {
- try
- {
- checkInElement(true,true);
- this->writeValue(aValue);
- }
- catch (sax::SAXException & xe)
- {
- translateSAXException(xe,this);
- }
- }
- // -----------------------------------------------------------------------------
-
- void SAL_CALL LayerWriter::setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString& aLocale )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException)
- {
- try
- {
- checkInElement(true,true);
- this->writeValue(aValue,aLocale);
- }
- catch (sax::SAXException & xe)
- {
- translateSAXException(xe,this);
- }
- }
- // -----------------------------------------------------------------------------
-
- void LayerWriter::raiseMalformedDataException(sal_Char const * pMsg)
- {
- OSL_ASSERT(pMsg);
- rtl::OUString sMsg = rtl::OUString::createFromAscii(pMsg);
-
- throw backenduno::MalformedDataException( sMsg, *this, uno::Any() );
- }
- // -----------------------------------------------------------------------------
-
- void LayerWriter::raiseIllegalTypeException(sal_Char const * pMsg)
- {
- OSL_ASSERT(pMsg);
- rtl::OUString sMsg = rtl::OUString::createFromAscii(pMsg);
-
- com::sun::star::beans::IllegalTypeException e( sMsg, *this );
- throw backenduno::MalformedDataException( sMsg, *this, uno::makeAny(e) );
- }
- // -----------------------------------------------------------------------------
-
- bool LayerWriter::isInElement() const
- {
- return !m_aTagStack.empty();
- }
- // -----------------------------------------------------------------------------
-
- void LayerWriter::checkInElement(bool bInElement, bool bInProperty)
- {
- if (bInElement != this->isInElement())
- {
- sal_Char const * pMsg = bInElement ?
- "LayerWriter: Illegal Data: Operation requires a started node" :
- "LayerWriter: Illegal Data: There is a started node already" ;
- raiseMalformedDataException(pMsg);
- }
-
- if (bInProperty != m_bInProperty)
- {
- sal_Char const * pMsg = bInProperty ?
- "LayerWriter: Illegal Data: Operation requires a started property" :
- "LayerWriter: Illegal Data: There is a started property already" ;
- raiseMalformedDataException(pMsg);
- }
- }
- // -----------------------------------------------------------------------------
-
- void LayerWriter::startNode()
- {
- rtl::OUString sTag = m_aFormatter.getElementTag();
- getWriteHandler()->startElement(sTag,m_aFormatter.getElementAttributes());
- getWriteHandler()->ignorableWhitespace(rtl::OUString());
- m_aTagStack.push(sTag);
- }
- // -----------------------------------------------------------------------------
-
- void LayerWriter::startProp(uno::Type const & _aType, bool bNeedType)
- {
- if (bNeedType && _aType == uno::Type())
- raiseIllegalTypeException("LayerWriter: Illegal Data: Cannot add VOID property");
-
- m_aFormatter.addPropertyValueType(_aType);
-
- startNode();
-
- m_aPropertyType = _aType;
- m_bInProperty = true;
- }
- // -----------------------------------------------------------------------------
-
- void LayerWriter::endElement()
- {
- OSL_ASSERT(!m_aTagStack.empty()); // checks done elsewhere
-
- getWriteHandler()->endElement(m_aTagStack.top());
- getWriteHandler()->ignorableWhitespace(rtl::OUString());
-
- m_aTagStack.pop();
- m_bInProperty = false;
- }
- // -----------------------------------------------------------------------------
-
- void LayerWriter::writeValue(uno::Any const & _aValue)
- {
- m_aFormatter.prepareSimpleElement( ElementType::value );
- outputValue(_aValue);
- }
- // -----------------------------------------------------------------------------
-
- void LayerWriter::writeValue(uno::Any const & _aValue, rtl::OUString const & _aLocale)
- {
- m_aFormatter.prepareSimpleElement( ElementType::value );
- m_aFormatter.addLanguage(_aLocale);
- outputValue(_aValue);
- }
- // -----------------------------------------------------------------------------
-
- void LayerWriter::outputValue(uno::Any const & _aValue)
- {
- ValueFormatter aValueFormatter(_aValue);
-
- aValueFormatter.addValueAttributes(m_aFormatter);
-
- rtl::OUString sTag = m_aFormatter.getElementTag();
- rtl::OUString sContent = aValueFormatter.getContent( this->m_xTCV );
-
- uno::Reference< sax::XDocumentHandler > xOut = getWriteHandler();
- xOut->startElement(sTag, m_aFormatter.getElementAttributes());
-
- if (sContent.getLength()) xOut->characters(sContent);
-
- xOut->endElement(sTag);
- xOut->ignorableWhitespace(rtl::OUString());
- }
- // -----------------------------------------------------------------------------
-
- // -----------------------------------------------------------------------------
- // -----------------------------------------------------------------------------
- } // namespace
-
- // -----------------------------------------------------------------------------
-} // namespace
-
diff --git a/configmgr/source/xml/layerwriter.hxx b/configmgr/source/xml/layerwriter.hxx
deleted file mode 100644
index f2c75f0b74..0000000000
--- a/configmgr/source/xml/layerwriter.hxx
+++ /dev/null
@@ -1,166 +0,0 @@
-/*************************************************************************
-*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
-************************************************************************/
-
-#ifndef CONFIGMGR_XML_LAYERWRITER_HXX
-#define CONFIGMGR_XML_LAYERWRITER_HXX
-
-#include "writersvc.hxx"
-#include "elementformatter.hxx"
-#include "stack.hxx"
-#include <com/sun/star/configuration/backend/XLayerHandler.hpp>
-
-namespace com { namespace sun { namespace star { namespace script {
- class XTypeConverter;
-} } } }
-
-namespace configmgr
-{
- // -----------------------------------------------------------------------------
- namespace xml
- {
- // -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
-
- namespace sax = ::com::sun::star::xml::sax;
- namespace backenduno = ::com::sun::star::configuration::backend;
-
- // -----------------------------------------------------------------------------
-
-
- class LayerWriter : public WriterService< ::com::sun::star::configuration::backend::XLayerHandler >
- {
- public:
- explicit
- LayerWriter(uno::Reference< uno::XComponentContext > const & _xContext);
- virtual ~LayerWriter();
-
- // XLayerHandler
- public:
- virtual void SAL_CALL
- startLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException);
-
- virtual void SAL_CALL
- endLayer( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException);
-
- virtual void SAL_CALL
- overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException);
-
- virtual void SAL_CALL
- addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException);
-
- virtual void SAL_CALL
- addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException);
-
- virtual void SAL_CALL
- endNode( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException);
-
- virtual void SAL_CALL
- dropNode( const rtl::OUString& aName )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException);
-
- virtual void SAL_CALL
- overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException);
-
- virtual void SAL_CALL
- addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException);
-
- virtual void SAL_CALL
- addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException);
-
- virtual void SAL_CALL
- endProperty( )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException);
-
- virtual void SAL_CALL
- setPropertyValue( const uno::Any& aValue )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException);
-
- virtual void SAL_CALL
- setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString& aLocale )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- uno::RuntimeException);
-
- private:
- bool isInElement() const;
- void checkInElement(bool bInElement, bool bInProperty = false);
-
- void startNode();
- void startProp(uno::Type const & _aType, bool bNeedType);
-
- void endElement();
-
- void writeValue(uno::Any const & _aValue);
- void writeValue(uno::Any const & _aValue, rtl::OUString const & _aLocale);
-
- void outputValue(uno::Any const & _aValue);
-
- void raiseMalformedDataException(sal_Char const * pMsg);
- void raiseIllegalTypeException(sal_Char const * pMsg);
-
- void prepareAddOrReplaceElement(
- rtl::OUString const & name, sal_Int16 attributes);
-
- private:
- uno::Reference< com::sun::star::script::XTypeConverter > m_xTCV;
- Stack< rtl::OUString > m_aTagStack;
- ElementFormatter m_aFormatter;
- uno::Type m_aPropertyType;
- bool m_bInProperty;
- bool m_bStartedDocument;
- };
- // -----------------------------------------------------------------------------
- } // namespace xml
- // -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/xml/makefile.mk b/configmgr/source/xml/makefile.mk
deleted file mode 100644
index 3f8633ed9a..0000000000
--- a/configmgr/source/xml/makefile.mk
+++ /dev/null
@@ -1,66 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJINC=$(PRJ)$/source
-PRJNAME=configmgr
-TARGET=xml
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings ---
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/makefile.pmk
-
-.IF "$(OS)"=="SOLARIS" && "$(COM)"!="GCC"
-CFLAGSCXX+=-instances=static
-.ENDIF
-
-# --- Files ---
-
-
-SLOFILES=\
- $(SLO)$/matchlocale.obj \
- $(SLO)$/typeconverter.obj \
- $(SLO)$/simpletypehelper.obj \
- $(SLO)$/valueconverter.obj \
- $(SLO)$/elementparser.obj \
- $(SLO)$/elementformatter.obj \
- $(SLO)$/basicparser.obj \
- $(SLO)$/layerparser.obj \
- $(SLO)$/schemaparser.obj \
- $(SLO)$/parsersvc.obj \
- $(SLO)$/writersvc.obj \
- $(SLO)$/layerwriter.obj \
- $(SLO)$/valueformatter.obj \
- $(SLO)$/xmlstrings.obj \
-
-# --- Targets ---
-
-.INCLUDE : target.mk
-
diff --git a/configmgr/source/xml/matchlocale.cxx b/configmgr/source/xml/matchlocale.cxx
deleted file mode 100644
index 506baf3345..0000000000
--- a/configmgr/source/xml/matchlocale.cxx
+++ /dev/null
@@ -1,384 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include "matchlocale.hxx"
-
-#include <rtl/ustrbuf.hxx>
-
-#include <algorithm>
-#include <iterator>
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace localehelper
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
-
-#define ARRAYSIZE( arr ) (sizeof(arr) / sizeof 0[arr] )
-// -----------------------------------------------------------------------------
- struct StaticLocale
- {
- char const * aLanguage;
- char const * aCountry;
- };
-
- char const * const c_sAnyLanguage = "*"; // exported !
- char const * const c_sDefLanguage = "x-default"; // exported !
-
- char const * const c_sNoCountry = "";
-
- char const * const c_sLanguageEnglish = "en";
- char const * const c_sCountryUS = "US";
-
- StaticLocale const c_aFallbackLocales[] =
- {
- { c_sLanguageEnglish, c_sCountryUS }, // english [cannot make 'en' better than 'en-US' :-(]
- { c_sAnyLanguage, c_sNoCountry } // just take the first you find
- };
- std::vector< com::sun::star::lang::Locale >::size_type const c_nFallbackLocales = ARRAYSIZE(c_aFallbackLocales);
-
-// -----------------------------------------------------------------------------
- bool isAnyLanguage(rtl::OUString const & _sLanguage)
- {
- return !!_sLanguage.equalsAscii(c_sAnyLanguage);
- }
-
-// -----------------------------------------------------------------------------
- bool isDefaultLanguage(rtl::OUString const & _sLanguage)
- {
- return !!_sLanguage.equalsAscii(c_sDefLanguage);
- }
-
-// -----------------------------------------------------------------------------
- rtl::OUString getAnyLanguage()
- {
- return rtl::OUString::createFromAscii( c_sAnyLanguage );
- }
-
-// -----------------------------------------------------------------------------
- rtl::OUString getDefaultLanguage()
- {
- return rtl::OUString::createFromAscii( c_sDefLanguage );
- }
-
-// -----------------------------------------------------------------------------
- com::sun::star::lang::Locale getAnyLocale()
- {
- return com::sun::star::lang::Locale( getAnyLanguage(), rtl::OUString(), rtl::OUString() );
- }
-
-// -----------------------------------------------------------------------------
- com::sun::star::lang::Locale getDefaultLocale()
- {
- return com::sun::star::lang::Locale( getDefaultLanguage(), rtl::OUString(), rtl::OUString() );
- }
-
-// -----------------------------------------------------------------------------
- static inline sal_Int32 countrySeparatorPos(rtl::OUString const& aLocaleName_)
- {
- sal_Int32 pos = aLocaleName_.indexOf('-');
- if (pos == 1) // allow for x-LL or i-LL
- pos = aLocaleName_.indexOf('-',pos+1);
-
- if (pos < 0)
- pos = aLocaleName_.indexOf('_');
-
- return pos;
- }
- // -------------------------------------------------------------------------
- static inline sal_Int32 countryLength(rtl::OUString const& aLocaleName_, sal_Int32 nCountryPos)
- {
- sal_Int32 pos1 = aLocaleName_.indexOf('.',nCountryPos);
- sal_Int32 pos2 = aLocaleName_.indexOf('_',nCountryPos);
-
- if (pos1 < 0) pos1 = aLocaleName_.getLength();
-
- if (pos2 < 0 || pos1 < pos2)
- return pos1 - nCountryPos;
-
- else
- return pos2 - nCountryPos;
- }
- // -------------------------------------------------------------------------
- static inline void splitLocaleString(rtl::OUString const& aLocaleName_, rtl::OUString& rLanguage_, rtl::OUString& rCountry_)
- {
- sal_Int32 nCountryPos = countrySeparatorPos(aLocaleName_);
- if (nCountryPos >= 0)
- {
- rLanguage_ = aLocaleName_.copy(0,nCountryPos).toAsciiLowerCase();
-
- ++nCountryPos; // advance past separator
- sal_Int32 nCountryLength = countryLength(aLocaleName_, nCountryPos);
-
- rCountry_ = aLocaleName_.copy(nCountryPos,nCountryLength).toAsciiUpperCase();
- }
- else
- {
- rLanguage_ = aLocaleName_.toAsciiLowerCase();
- rCountry_ = rtl::OUString();
- }
- }
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-// conversion helpers
-com::sun::star::lang::Locale makeLocale(rtl::OUString const& sLocaleName_)
-{
- com::sun::star::lang::Locale aResult;
- splitLocaleString(sLocaleName_, aResult.Language, aResult.Country);
- return aResult;
-}
-rtl::OUString makeIsoLocale(com::sun::star::lang::Locale const& aUnoLocale_)
-{
- rtl::OUStringBuffer aResult(aUnoLocale_.Language.toAsciiLowerCase());
- if (aUnoLocale_.Country.getLength())
- {
- aResult.append( sal_Unicode('-') ).append(aUnoLocale_.Country.toAsciiUpperCase());
- }
- return aResult.makeStringAndClear();
-}
-static
-com::sun::star::lang::Locale makeLocale(StaticLocale const& aConstLocale_)
-{
- com::sun::star::lang::Locale aResult;
- aResult.Language = rtl::OUString::createFromAscii(aConstLocale_.aLanguage);
- aResult.Country = rtl::OUString::createFromAscii(aConstLocale_.aCountry);
- return aResult;
-}
-// -----------------------------------------------------------------------------
-template <class T>
-inline
-void addLocaleSeq_impl(T const* first, T const* last, std::vector< com::sun::star::lang::Locale >& rSeq)
-{
- com::sun::star::lang::Locale (* const xlate)(T const&) = &makeLocale;
-
- std::transform(first, last, std::back_inserter(rSeq), xlate);
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-template <class T>
-inline
-std::vector< com::sun::star::lang::Locale > makeLocaleSeq_impl(uno::Sequence< T > const& aLocales_)
-{
- sal_Int32 const nLocaleCount = aLocales_.getLength();
-
- T const* pLocaleBegin = aLocales_.getConstArray();
-
- std::vector< com::sun::star::lang::Locale > aResult;
- aResult.reserve( nLocaleCount + c_nFallbackLocales ); // make room for fallback stuff as well
-
- addLocaleSeq_impl(pLocaleBegin, pLocaleBegin + nLocaleCount, aResult);
-
- return aResult;
-}
-// -----------------------------------------------------------------------------
-
-void addFallbackLocales(std::vector< com::sun::star::lang::Locale >& aTargetList_)
-{
- addLocaleSeq_impl(c_aFallbackLocales, c_aFallbackLocales + c_nFallbackLocales, aTargetList_);
-}
-// -----------------------------------------------------------------------------
-
-std::vector< com::sun::star::lang::Locale > makeLocaleSequence(uno::Sequence<rtl::OUString> const& sLocaleNames_)
-{
- return makeLocaleSeq_impl(sLocaleNames_);
-}
-// -----------------------------------------------------------------------------
-
-uno::Sequence<rtl::OUString> makeIsoSequence(std::vector< com::sun::star::lang::Locale > const& aLocales_)
-{
- std::vector< com::sun::star::lang::Locale >::size_type const nLocaleCount = aLocales_.size();
- sal_Int32 const nSeqSize = sal_Int32(nLocaleCount);
- OSL_ASSERT( nSeqSize >= 0 && sal_uInt32(nSeqSize) == nLocaleCount );
-
- uno::Sequence<rtl::OUString> aResult(nSeqSize);
- std::transform(aLocales_.begin(), aLocales_.end(), aResult.getArray(), &makeIsoLocale);
-
- return aResult;
-}
-// -----------------------------------------------------------------------------
-bool designatesAllLocales(com::sun::star::lang::Locale const& aLocale_)
-{
- return aLocale_.Language.equalsAscii(c_sAnyLanguage);
-}
-bool designatesAllLocales(std::vector< com::sun::star::lang::Locale > const& aLocales_)
-{
- return aLocales_.size() <= 1 &&
- (aLocales_.size() == 0 || designatesAllLocales(aLocales_));
-}
-// -----------------------------------------------------------------------------
-
-MatchQuality match(com::sun::star::lang::Locale const& aLocale_, com::sun::star::lang::Locale const& aTarget_)
-{
- // check language
- if (!aLocale_.Language.equals(aTarget_.Language))
- {
- // can we accept any language
- if (aTarget_.Language.equalsAscii(c_sAnyLanguage))
- return MATCH_LANGUAGE;
-
- return MISMATCH;
- }
-
- // check for exact match
- else if (aLocale_.Country.equals(aTarget_.Country))
- return MATCH_LOCALE;
-
- // check for plain language
- else if (aLocale_.Country.getLength() == 0)
- return MATCH_LANGUAGE_PLAIN;
-
- // so we are left with the wrong country
- else
- return MATCH_LANGUAGE;
-}
-
-// -----------------------------------------------------------------------------
-
-/// check the given position and quality, if they are an improvement
-bool MatchResult::improve(std::vector< com::sun::star::lang::Locale >::size_type nPos_, MatchQuality eQuality_)
-{
- // is this a match at all ?
- if (eQuality_ == MISMATCH)
- return false;
-
- // is the position worse ?
- if (nPos_ > m_nPos )
- return false;
-
- // is this just a non-positive quality change ?
- if (nPos_ == m_nPos && eQuality_ <= m_eQuality)
- return false;
-
- // Improvement found
- m_nPos = nPos_;
- m_eQuality = eQuality_;
-
- return true;
-}
-
-// -----------------------------------------------------------------------------
-
-bool isMatch(com::sun::star::lang::Locale const& aLocale_, std::vector< com::sun::star::lang::Locale > const& aTarget_, MatchQuality eRequiredQuality_)
-{
- std::vector< com::sun::star::lang::Locale >::size_type const nEnd = aTarget_.size();
-
- for (std::vector< com::sun::star::lang::Locale >::size_type nPos = 0; nPos < nEnd; ++nPos)
- {
- MatchQuality eQuality = match(aLocale_, aTarget_[nPos]);
- if (eQuality >= eRequiredQuality_)
- {
- return true;
- }
- }
- return false;
-}
-// -----------------------------------------------------------------------------
-
-static
-inline
-std::vector< com::sun::star::lang::Locale >::size_type getSearchLimitPosition(MatchResult const& aPrevMatch_,std::vector< com::sun::star::lang::Locale > const& aTarget_)
-{
- std::vector< com::sun::star::lang::Locale >::size_type nSize = aTarget_.size();
-
- if (aPrevMatch_.isMatch())
- {
- std::vector< com::sun::star::lang::Locale >::size_type nMatchPos = aPrevMatch_.position();
-
- OSL_ENSURE(nMatchPos < nSize,"localehelper::getSearchLimitPosition: ERROR - previous position is out-of-bounds");
-
- if (nMatchPos < nSize)
- {
- return nMatchPos + 1;
- }
- }
- return nSize;
-}
-// -----------------------------------------------------------------------------
-
-bool improveMatch(MatchResult& rMatch_, com::sun::star::lang::Locale const& aLocale_, std::vector< com::sun::star::lang::Locale > const& aTarget_)
-{
- std::vector< com::sun::star::lang::Locale >::size_type const nEnd = getSearchLimitPosition(rMatch_,aTarget_);
-
- for (std::vector< com::sun::star::lang::Locale >::size_type nPos = 0; nPos < nEnd; ++nPos)
- {
- if (rMatch_.improve(nPos, match(aLocale_, aTarget_[nPos])))
- {
- return true;
- }
- }
- return false;
-}
-// -----------------------------------------------------------------------------
-
-
-// -----------------------------------------------------------------------------
-// class FindBestLocale
-// -----------------------------------------------------------------------------
-
-inline
-void FindBestLocale::implSetTarget(std::vector< com::sun::star::lang::Locale > const& aTarget_)
-{
- m_aTarget = aTarget_;
- addFallbackLocales(m_aTarget);
-}
-// -----------------------------------------------------------------------------
-
-FindBestLocale::FindBestLocale(com::sun::star::lang::Locale const& aTarget_)
-{
- std::vector< com::sun::star::lang::Locale > aSeq(1,aTarget_);
- implSetTarget( aSeq );
-}
-// -----------------------------------------------------------------------------
-
-bool FindBestLocale::accept(com::sun::star::lang::Locale const& aLocale_)
-{
- return improveMatch(m_aResult, aLocale_, m_aTarget);
-}
-// -----------------------------------------------------------------------------
-
-void FindBestLocale::reset(bool bNeedLocale_)
-{
- if (bNeedLocale_)
- m_aResult.reset();
-
- else // mark as best match already (no improvement possible)
- m_aResult = m_aResult.best();
-}
-// -----------------------------------------------------------------------------
-
- } // namespace locale helper
-// -----------------------------------------------------------------------------
-
-} // namespace
-
-
diff --git a/configmgr/source/xml/parsersvc.cxx b/configmgr/source/xml/parsersvc.cxx
deleted file mode 100644
index ef29f9c93a..0000000000
--- a/configmgr/source/xml/parsersvc.cxx
+++ /dev/null
@@ -1,382 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "parsersvc.hxx"
-
-#ifndef CONFIGMGR_API_FACTORY_HXX_
-#include "confapifactory.hxx"
-#endif
-#include "schemaparser.hxx"
-#include "layerparser.hxx"
-#include <rtl/ustrbuf.hxx>
-#include <cppuhelper/exc_hlp.hxx>
-#include <com/sun/star/configuration/backend/XSchema.hpp>
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-#include <com/sun/star/lang/WrappedTargetException.hpp>
-#include <com/sun/star/lang/IllegalArgumentException.hpp>
-#include <com/sun/star/configuration/backend/MalformedDataException.hpp>
-#include <com/sun/star/xml/sax/XParser.hpp>
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace xml
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace io = ::com::sun::star::io;
- namespace sax = ::com::sun::star::xml::sax;
- namespace backenduno = ::com::sun::star::configuration::backend;
-// -----------------------------------------------------------------------------
-
-template <class BackendInterface>
-struct ParserServiceTraits;
-// -----------------------------------------------------------------------------
-static inline void clear(rtl::OUString & _rs) { _rs = rtl::OUString(); }
-
-// -----------------------------------------------------------------------------
-template <class BackendInterface>
-ParserService<BackendInterface>::ParserService(uno::Reference< uno::XComponentContext > const & _xContext)
-: m_xContext(_xContext)
-, m_aInputSource()
-{
- if (!m_xContext.is())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration Parser: NULL Context"));
- throw uno::RuntimeException(sMessage,NULL);
- }
-}
-// -----------------------------------------------------------------------------
-
-// XInitialization
-template <class BackendInterface>
-void SAL_CALL
- ParserService<BackendInterface>::initialize( const uno::Sequence< uno::Any >& aArguments )
- throw (uno::Exception, uno::RuntimeException)
-{
- switch(aArguments.getLength())
- {
- case 0:
- break;
-
- case 1:
- if (aArguments[0] >>= m_aInputSource)
- break;
-
- if (aArguments[0] >>= m_aInputSource.aInputStream)
- break;
-
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Cannot use argument to initialize a Configuration Parser"
- "- InputSource or XInputStream expected"));
- throw lang::IllegalArgumentException(sMessage,*this,1);
- }
- default:
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Too many arguments to initialize a Configuration Parser"));
- throw lang::IllegalArgumentException(sMessage,*this,0);
- }
- }
-}
-// -----------------------------------------------------------------------------
-
-template <class BackendInterface>
-inline
-ServiceInfoHelper ParserService<BackendInterface>::getServiceInfo()
-{
- return ParserServiceTraits<BackendInterface>::getServiceInfo();
-}
-// -----------------------------------------------------------------------------
-
-// XServiceInfo
-template <class BackendInterface>
-::rtl::OUString SAL_CALL
- ParserService<BackendInterface>::getImplementationName( )
- throw (uno::RuntimeException)
-{
- return getServiceInfo().getImplementationName();
-}
-// -----------------------------------------------------------------------------
-
-template <class BackendInterface>
-sal_Bool SAL_CALL
- ParserService<BackendInterface>::supportsService( const ::rtl::OUString& ServiceName )
- throw (uno::RuntimeException)
-{
- return getServiceInfo().supportsService( ServiceName );
-}
-// -----------------------------------------------------------------------------
-
-template <class BackendInterface>
-uno::Sequence< ::rtl::OUString > SAL_CALL
- ParserService<BackendInterface>::getSupportedServiceNames( )
- throw (uno::RuntimeException)
-{
- return getServiceInfo().getSupportedServiceNames( );
-}
-// -----------------------------------------------------------------------------
-
-template <class BackendInterface>
-void SAL_CALL
- ParserService<BackendInterface>::setInputStream( const uno::Reference< io::XInputStream >& aStream )
- throw (uno::RuntimeException)
-{
- clear( m_aInputSource.sEncoding );
- clear( m_aInputSource.sSystemId );
- // clear( m_aInputSource.sPublicId );
- m_aInputSource.aInputStream = aStream;
-}
-// -----------------------------------------------------------------------------
-
-template <class BackendInterface>
-uno::Reference< io::XInputStream > SAL_CALL
- ParserService<BackendInterface>::getInputStream( )
- throw (uno::RuntimeException)
-{
- return m_aInputSource.aInputStream;
-}
-// -----------------------------------------------------------------------------
-
-template <class BackendInterface>
-void ParserService<BackendInterface>::parse(uno::Reference< sax::XDocumentHandler > const & _xHandler)
-// throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException)
-{
- OSL_PRECOND( _xHandler.is(), "ParserService: No SAX handler to parse to");
-
- rtl::OUString const k_sSaxParserService( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Parser"));
-
- uno::Reference< lang::XMultiComponentFactory > xServiceFactory = m_xContext->getServiceManager();
-
- uno::Reference< sax::XParser > xParser = uno::Reference< sax::XParser >::query( xServiceFactory->createInstanceWithContext(k_sSaxParserService,m_xContext) );
-
- if (!xParser.is())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration Parser: Cannot create SAX Parser"));
- throw uno::RuntimeException(sMessage,*this);
- }
-
- try
- {
- xParser->setDocumentHandler(_xHandler);
-
- sax::InputSource aInputSourceCopy = m_aInputSource;
- //Set the sax input stream to null, an input stream can only be parsed once
- m_aInputSource.aInputStream = NULL;
- xParser->parseStream( aInputSourceCopy );
- }
- catch (sax::SAXException & e)
- {
- uno::Any aWrapped = e.WrappedException.hasValue() ? e.WrappedException : uno::makeAny( e );
- rtl::OUString sSAXMessage = e.Message;
-
- // Expatwrap SAX service doubly wraps its errors ??
- sax::SAXException eInner;
- if (aWrapped >>= eInner)
- {
- if (eInner.WrappedException.hasValue()) aWrapped = eInner.WrappedException;
-
- rtl::OUStringBuffer sMsgBuf(eInner.Message);
- sMsgBuf.appendAscii("- {Parser Error: ").append(sSAXMessage).appendAscii(" }.");
- sSAXMessage = sMsgBuf.makeStringAndClear();
- }
-
- static backenduno::MalformedDataException const * const forDataError = 0;
- static lang::WrappedTargetException const * const forWrappedError = 0;
- if (aWrapped.isExtractableTo(getCppuType(forDataError)) ||
- aWrapped.isExtractableTo(getCppuType(forWrappedError)))
- {
- cppu::throwException(aWrapped);
-
- OSL_ASSERT(!"not reached");
- }
-
- rtl::OUStringBuffer sMessageBuf;
- sMessageBuf.appendAscii("Configuration Parser: a ").append( aWrapped.getValueTypeName() );
- sMessageBuf.appendAscii(" occurred while parsing: ");
- sMessageBuf.append(sSAXMessage);
-
- throw lang::WrappedTargetException(sMessageBuf.makeStringAndClear(),*this,aWrapped);
- }
-}
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-sal_Char const * const aSchemaParserServices[] =
-{
- "com.sun.star.configuration.backend.xml.SchemaParser",
- 0
-};
-const ServiceImplementationInfo aSchemaParserSI =
-{
- "com.sun.star.comp.configuration.backend.xml.SchemaParser",
- aSchemaParserServices,
- 0
-};
-// -----------------------------------------------------------------------------
-sal_Char const * const aLayerParserServices[] =
-{
- "com.sun.star.configuration.backend.xml.LayerParser",
- 0
-};
-const ServiceImplementationInfo aLayerParserSI =
-{
- "com.sun.star.comp.configuration.backend.xml.LayerParser",
- aLayerParserServices,
- 0
-};
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-template <>
-struct ParserServiceTraits< backenduno::XSchema >
-{
- static ServiceImplementationInfo const * getServiceInfo()
- { return & aSchemaParserSI; }
-};
-// -----------------------------------------------------------------------------
-template <>
-struct ParserServiceTraits< backenduno::XLayer >
-{
- static ServiceImplementationInfo const * getServiceInfo()
- { return & aLayerParserSI; }
-};
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-class SchemaParserService : public ParserService< backenduno::XSchema >
-{
-public:
- SchemaParserService(uno::Reference< uno::XComponentContext > const & _xContext)
- : ParserService< backenduno::XSchema >(_xContext)
- {
- }
-
- virtual void SAL_CALL readSchema( uno::Reference< backenduno::XSchemaHandler > const & aHandler )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- lang::NullPointerException, uno::RuntimeException);
-
- virtual void SAL_CALL readComponent( uno::Reference< backenduno::XSchemaHandler > const & aHandler )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- lang::NullPointerException, uno::RuntimeException);
-
- virtual void SAL_CALL readTemplates( uno::Reference< backenduno::XSchemaHandler > const & aHandler )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- lang::NullPointerException, uno::RuntimeException);
-};
-// -----------------------------------------------------------------------------
-
-class LayerParserService : public ParserService< backenduno::XLayer >
-{
-public:
- LayerParserService(uno::Reference< uno::XComponentContext > const & _xContext)
- : ParserService< backenduno::XLayer >(_xContext)
- {
- }
-
- virtual void SAL_CALL readData( uno::Reference< backenduno::XLayerHandler > const & aHandler )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- lang::NullPointerException, uno::RuntimeException);
-};
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-uno::Reference< uno::XInterface > SAL_CALL instantiateSchemaParser( uno::Reference< uno::XComponentContext > const& xContext )
-{
- return * new SchemaParserService(xContext);
-}
-uno::Reference< uno::XInterface > SAL_CALL instantiateLayerParser( uno::Reference< uno::XComponentContext > const& xContext )
-{
- return * new LayerParserService(xContext);
-}
-// -----------------------------------------------------------------------------
-const ServiceRegistrationInfo* getSchemaParserServiceInfo()
-{ return getRegistrationInfo(& aSchemaParserSI); }
-const ServiceRegistrationInfo* getLayerParserServiceInfo()
-{ return getRegistrationInfo(& aLayerParserSI); }
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-static rtl::OUString nullHandlerMessage(char const * where)
-{
- OSL_ASSERT(where);
- rtl::OUString msg = rtl::OUString::createFromAscii(where);
- return msg.concat(rtl::OUString::createFromAscii(": Error - NULL handler passed."));
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL SchemaParserService::readSchema( uno::Reference< backenduno::XSchemaHandler > const & aHandler )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- lang::NullPointerException, uno::RuntimeException)
-{
- if (!aHandler.is())
- throw lang::NullPointerException(nullHandlerMessage("SchemaParserService::readSchema"),*this);
-
- uno::Reference< sax::XDocumentHandler > xHandler = new SchemaParser(this->getContext(),aHandler, SchemaParser::selectAll);
- this->parse( xHandler );
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL SchemaParserService::readComponent( uno::Reference< backenduno::XSchemaHandler > const & aHandler )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- lang::NullPointerException, uno::RuntimeException)
-{
- if (!aHandler.is())
- throw lang::NullPointerException(nullHandlerMessage("SchemaParserService::readComponent"),*this);
-
- uno::Reference< sax::XDocumentHandler > xHandler = new SchemaParser(this->getContext(),aHandler, SchemaParser::selectComponent);
- this->parse( xHandler );
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL SchemaParserService::readTemplates( uno::Reference< backenduno::XSchemaHandler > const & aHandler )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- lang::NullPointerException, uno::RuntimeException)
-{
- if (!aHandler.is())
- throw lang::NullPointerException(nullHandlerMessage("SchemaParserService::readTemplates"),*this);
-
- uno::Reference< sax::XDocumentHandler > xHandler = new SchemaParser(this->getContext(),aHandler, SchemaParser::selectTemplates);
- this->parse( xHandler );
-}
-// -----------------------------------------------------------------------------
-void SAL_CALL LayerParserService::readData( uno::Reference< backenduno::XLayerHandler > const & aHandler )
- throw (backenduno::MalformedDataException, lang::WrappedTargetException,
- lang::NullPointerException, uno::RuntimeException)
-{
- if (!aHandler.is())
- throw lang::NullPointerException(nullHandlerMessage("LayerParserService::readData"),*this);
-
- uno::Reference< sax::XDocumentHandler > xHandler = new LayerParser(this->getContext(),aHandler);
- this->parse( xHandler );
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace
-
-// -----------------------------------------------------------------------------
-} // namespace
-
diff --git a/configmgr/source/xml/parsersvc.hxx b/configmgr/source/xml/parsersvc.hxx
deleted file mode 100644
index bbca720bdf..0000000000
--- a/configmgr/source/xml/parsersvc.hxx
+++ /dev/null
@@ -1,114 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_XML_PARSERSVC_HXX
-#define CONFIGMGR_XML_PARSERSVC_HXX
-
-#include "serviceinfohelper.hxx"
-#include <cppuhelper/implbase4.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/io/XActiveDataSink.hpp>
-#include <com/sun/star/xml/sax/InputSource.hpp>
-#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace xml
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace io = ::com::sun::star::io;
- namespace sax = ::com::sun::star::xml::sax;
-// -----------------------------------------------------------------------------
-
- template <class BackendInterface>
- class ParserService : public ::cppu::WeakImplHelper4<
- lang::XInitialization,
- lang::XServiceInfo,
- io::XActiveDataSink,
- BackendInterface
- >
- {
- public:
- explicit
- ParserService(uno::Reference< uno::XComponentContext > const & _xContext);
-
- // XInitialization
- virtual void SAL_CALL
- initialize( const uno::Sequence< uno::Any >& aArguments )
- throw (uno::Exception, uno::RuntimeException);
-
- // XServiceInfo
- virtual ::rtl::OUString SAL_CALL
- getImplementationName( )
- throw (uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- supportsService( const ::rtl::OUString& ServiceName )
- throw (uno::RuntimeException);
-
- virtual uno::Sequence< ::rtl::OUString > SAL_CALL
- getSupportedServiceNames( )
- throw (uno::RuntimeException);
-
- // XActiveDataSink
- virtual void SAL_CALL
- setInputStream( const uno::Reference< io::XInputStream >& aStream )
- throw (uno::RuntimeException);
-
- virtual uno::Reference< io::XInputStream > SAL_CALL
- getInputStream( )
- throw (uno::RuntimeException);
-
- protected:
- uno::Reference< uno::XComponentContext > getContext() const
- { return m_xContext; }
-
- void parse(uno::Reference< sax::XDocumentHandler > const & _xHandler);
- // throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException);
-
- private:
- uno::Reference< uno::XComponentContext > m_xContext;
- sax::InputSource m_aInputSource;
-
- static ServiceInfoHelper getServiceInfo();
- };
-
-// -----------------------------------------------------------------------------
- } // namespace xml
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/xml/schemaparser.cxx b/configmgr/source/xml/schemaparser.cxx
deleted file mode 100644
index 9c99ba1b4a..0000000000
--- a/configmgr/source/xml/schemaparser.cxx
+++ /dev/null
@@ -1,406 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "schemaparser.hxx"
-
-// -----------------------------------------------------------------------------
-#include "wrapexception.hxx"
-
-#define WRAP_PARSE_EXCEPTIONS() \
- PASS_EXCEPTION(sax::SAXException) \
- PASS_EXCEPTION(uno::RuntimeException) \
- WRAP_CONFIGDATA_EXCEPTIONS( raiseParseException ) \
- WRAP_OTHER_EXCEPTIONS( raiseParseException )
-
-#define WRAP_PARSE_EXCEPTIONS_MSG( msg ) \
- PASS_EXCEPTION(sax::SAXException) \
- PASS_EXCEPTION(uno::RuntimeException) \
- WRAP_CONFIGDATA_EXCEPTIONS1( raiseParseException, msg ) \
- WRAP_OTHER_EXCEPTIONS1( raiseParseException, msg )
-
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace xml
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace sax = ::com::sun::star::xml::sax;
-// -----------------------------------------------------------------------------
-
-SchemaParser::SchemaParser(uno::Reference< uno::XComponentContext > const & _xContext, uno::Reference< backenduno::XSchemaHandler > const & _xHandler, Select _selector)
-: BasicParser(_xContext)
-, m_xHandler(_xHandler)
-, m_sComponent()
-, m_selector(_selector)
-, m_selected(selectNone)
-{
- if (!m_xHandler.is())
- {
- rtl::OUString sMessage(RTL_CONSTASCII_USTRINGPARAM("Cannot create SchemaParser: Unexpected NULL Handler"));
- throw uno::RuntimeException(sMessage, *this);
- }
- OSL_ENSURE(m_selector != selectNone, "Warning: Schema handler will handle no part of the schema");
-}
-// -----------------------------------------------------------------------------
-
-SchemaParser::~SchemaParser()
-{
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL SchemaParser::startDocument( )
- throw (sax::SAXException, uno::RuntimeException)
-{
- BasicParser::startDocument();
-
- OSL_ENSURE(isEmptyNode(), "BasicParser does not mark new document as empty");
-
- m_sComponent = rtl::OUString();
- m_selected = selectNone;
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL SchemaParser::endDocument( ) throw (sax::SAXException, uno::RuntimeException)
-{
- if (isSelected())
- raiseParseException("Schema XML Parser: Invalid XML: Document ends while section is open");
-
- if (isEmptyNode()) OSL_TRACE("Configuration Parser: XML schema document ended without any data");
-
- BasicParser::endDocument();
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL SchemaParser::startElement( const rtl::OUString& aName, const uno::Reference< sax::XAttributeList >& xAttribs )
- throw (sax::SAXException, uno::RuntimeException)
-{
- if ( this->isSkipping() )
- {
- this->startSkipping( aName, xAttribs );
- return;
- }
-
- ElementInfo aInfo = getDataParser().parseElementInfo(aName,xAttribs);
-
- try
- {
- switch (aInfo.type)
- {
- case ElementType::schema:
- this->startSchema(aInfo,xAttribs);
- break;
-
- case ElementType::component:
- this->startSection(selectComponent, aInfo, xAttribs);
- break;
-
- case ElementType::templates:
- this->startSection(selectTemplates, aInfo, xAttribs);
- break;
-
- case ElementType::import:
- this->handleImport(aInfo,xAttribs);
- this->startSkipping( aName, xAttribs );
- break;
-
- case ElementType::uses:
- this->startSkipping( aName, xAttribs );
- break;
-
- case ElementType::instance:
- this->handleInstance(aInfo,xAttribs);
- this->startSkipping( aName, xAttribs );
- break;
-
- case ElementType::item_type:
- this->handleItemType(aInfo,xAttribs);
- this->startSkipping( aName, xAttribs );
- break;
-
- case ElementType::layer:
- case ElementType::node:
- raiseParseException( "Schema XML parser - Invalid data: found unspecified 'node' element.\n");
- // fall thru
- case ElementType::group: case ElementType::set:
- this->startNode(aInfo,xAttribs);
- OSL_ASSERT( this->isInNode() );
- break;
-
- case ElementType::property:
- this->startProperty(aInfo,xAttribs);
- OSL_ASSERT( this->isInUnhandledProperty() );
- break;
-
- case ElementType::value:
- this->startValueData(xAttribs);
- OSL_ASSERT( this->isInValueData() );
- break;
-
- default: // skip unknown elements
- OSL_ENSURE( aInfo.type <= ElementType::other, "Schema XML parser - Error: invalid element type value\n");
- OSL_ENSURE( aInfo.type >= ElementType::other, "Schema XML parser - Unexpected: found layer element in schema data\n");
- // accept (and skip) unknown (ElementType::other) tags in schema to allow documentation and constraints to pass without assertion
- //OSL_ENSURE( aInfo.type < ElementType::other, "Schema XML parser - Warning: ignoring unknown element tag\n");
-
- this->startSkipping( aName, xAttribs );
- OSL_ASSERT( this->isSkipping() );
- return;
- }
- }
- WRAP_PARSE_EXCEPTIONS_MSG("LayerParser - Starting Element")
-
- OSL_ENSURE(aInfo.op == Operation::none || this->isSkipping(),
- "Schema Parser: The 'op' attribute is not supported in a schema");
-}
-// -----------------------------------------------------------------------------
-
-void SAL_CALL SchemaParser::endElement( const rtl::OUString& aName )
- throw (sax::SAXException, uno::RuntimeException)
-{
- if ( this->wasSkipping(aName) )
- return;
-
- try
- {
- if ( this->isInValueData())
- this->endValueData();
-
- else if (this->isInProperty())
- this->endProperty();
-
- else if (this->isInNode())
- this->endNode();
-
- else if (this->isSelected())
- this->endSection();
-
- else
- this->endSchema();
- }
- WRAP_PARSE_EXCEPTIONS_MSG("LayerParser - Ending Element")
-}
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-void SchemaParser::startSchema( ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& /*xAttribs*/ )
-{
- m_sComponent = aInfo.name;
- m_xHandler->startSchema();
-}
-// -----------------------------------------------------------------------------
-
-void SchemaParser::endSchema( )
-{
- m_xHandler->endSchema();
- m_sComponent = rtl::OUString();
-}
-// -----------------------------------------------------------------------------
-
-bool SchemaParser::select(Select _select)
-{
- if (isSelected())
- raiseParseException("Schema XML parser - Invalid data: found start of section while a section is still open.\n");
-
- m_selected = static_cast<Select>(m_selector & _select);
-
- return m_selected != 0;
-}
-// -----------------------------------------------------------------------------
-
-void SchemaParser::startSection( Select _select, ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& xAttribs )
-{
- if (this->select(_select))
- {
- if (_select == selectComponent)
- {
- m_xHandler->startComponent(m_sComponent);
- }
- }
- else
- startSkipping(aInfo.name,xAttribs);
-}
-// -----------------------------------------------------------------------------
-
-void SchemaParser::endSection( )
-{
- if (m_selected == selectComponent)
- {
- m_xHandler->endComponent();
- }
- m_selected = selectNone;
-}
-// -----------------------------------------------------------------------------
-
-void SchemaParser::handleImport( ElementInfo const & /*aInfo*/, const uno::Reference< sax::XAttributeList >& xAttribs )
-{
- rtl::OUString aComponent;
- if (getDataParser().getImportComponent(xAttribs,aComponent))
- m_xHandler->importComponent(aComponent);
-
- else
- raiseParseException("Schema XML parser - Invalid data: Missing component attribute for import directive.\n");
-}
-// -----------------------------------------------------------------------------
-
-void SchemaParser::handleInstance( ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& xAttribs )
-{
- backenduno::TemplateIdentifier aTemplate;
- if (getDataParser().getInstanceType(xAttribs, aTemplate.Name, aTemplate.Component))
- m_xHandler->addInstance(aInfo.name, aTemplate);
-
- else
- raiseParseException("Schema XML parser - Invalid data: Missing type information for instantiation directive.\n");
-}
-// -----------------------------------------------------------------------------
-
-void SchemaParser::handleItemType( ElementInfo const & /*aInfo*/, const uno::Reference< sax::XAttributeList >& xAttribs )
-{
- backenduno::TemplateIdentifier aTemplate;
- if (getDataParser().getInstanceType(xAttribs, aTemplate.Name, aTemplate.Component))
- m_xHandler->addItemType(aTemplate);
-
- else
- raiseParseException("Schema XML parser - Invalid data: Missing type information for instantiation directive.\n");
-}
-// -----------------------------------------------------------------------------
-
-void SchemaParser::startNode( ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& xAttribs )
-{
- bool bStartTemplate = ( !isInNode() && m_selected == selectTemplates );
-
- BasicParser::startNode(aInfo,xAttribs);
-
- OSL_ASSERT(aInfo.type == ElementType::set || aInfo.type == ElementType::group);
-
- if (aInfo.type == ElementType::group)
- {
- if (bStartTemplate)
- m_xHandler->startGroupTemplate( backenduno::TemplateIdentifier(aInfo.name,m_sComponent), aInfo.flags );
-
- else
- m_xHandler->startGroup( aInfo.name, aInfo.flags );
- }
- else
- {
- backenduno::TemplateIdentifier aItemType;
-
- if (!getDataParser().getSetElementType(xAttribs, aItemType.Name, aItemType.Component))
- raiseParseException("Schema XML parser - Invalid data: Missing item-type information for set node.\n");
-
- if (bStartTemplate)
- m_xHandler->startSetTemplate( backenduno::TemplateIdentifier(aInfo.name,m_sComponent), aInfo.flags, aItemType );
-
- else
- m_xHandler->startSet( aInfo.name, aInfo.flags, aItemType );
- }
-}
-// -----------------------------------------------------------------------------
-
-void SchemaParser::endNode()
-{
- BasicParser::endNode();
-
- bool bEndedTemplate = ( !isInNode() && m_selected == selectTemplates );
-
- if (bEndedTemplate)
- m_xHandler->endTemplate();
-
- else
- m_xHandler->endNode();
-}
-// -----------------------------------------------------------------------------
-
-void SchemaParser::startProperty( ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& xAttribs )
-{
- BasicParser::startProperty(aInfo,xAttribs);
-
- OSL_ENSURE( isInUnhandledProperty(), "Property not recognizable as unhandled");
-}
-// -----------------------------------------------------------------------------
-
-void SchemaParser::endProperty()
-{
- if (isInUnhandledProperty())
- {
- ElementInfo const & aInfo = this->getActiveNodeInfo();
-
- m_xHandler->addProperty(aInfo.name,
- aInfo.flags,
- getActivePropertyType());
- }
-
- BasicParser::endProperty();
-}
-// -----------------------------------------------------------------------------
-
-void SchemaParser::startValueData(const uno::Reference< sax::XAttributeList >& xAttribs)
-{
- OSL_ENSURE( this->isInUnhandledProperty(),"Schema XML parser - multiple values in property are not permitted in the schema.\n");
-
- BasicParser::startValueData(xAttribs);
-
- if (this->isValueDataLocalized())
- getLogger().warning("Language attributes on values are ignored in the schema.",
- "endValueData()","configuration::xml::SchemaParser");
-}
-// -----------------------------------------------------------------------------
-
-void SchemaParser::endValueData()
-{
- uno::Any aValue = this->getCurrentValue();
-
- ElementInfo const & aInfo = this->getActiveNodeInfo();
-
- if (aValue.hasValue())
- {
- m_xHandler->addPropertyWithDefault(aInfo.name,aInfo.flags,aValue);
- }
- else
- {
- getLogger().warning("Found deprecated explicit NIL value in schema data.",
- "endValueData()","configuration::xml::SchemaParser");
- m_xHandler->addProperty(aInfo.name,aInfo.flags,getActivePropertyType());
- }
-
- BasicParser::endValueData();
-
- OSL_ENSURE( !isInUnhandledProperty(), "Property not recognizable as handled");
-}
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
- } // namespace
-
-// -----------------------------------------------------------------------------
-} // namespace
-
diff --git a/configmgr/source/xml/schemaparser.hxx b/configmgr/source/xml/schemaparser.hxx
deleted file mode 100644
index 81dcce5d02..0000000000
--- a/configmgr/source/xml/schemaparser.hxx
+++ /dev/null
@@ -1,132 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_XML_SCHEMAPARSER_HXX
-#define CONFIGMGR_XML_SCHEMAPARSER_HXX
-
-#include "basicparser.hxx"
-
-#include <com/sun/star/configuration/backend/XSchemaHandler.hpp>
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace xml
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
-
- namespace sax = ::com::sun::star::xml::sax;
- namespace backenduno = ::com::sun::star::configuration::backend;
-
-// -----------------------------------------------------------------------------
-
-
- class SchemaParser : public BasicParser
- {
- public:
- enum Select {
- selectNone = 0,
- selectComponent = 0x01,
- selectTemplates = 0x02,
- selectAll = 0x03
- };
-
- public:
- SchemaParser(uno::Reference< uno::XComponentContext > const & _xContext, uno::Reference< backenduno::XSchemaHandler > const & _xHandler, Select _selector);
- virtual ~SchemaParser();
-
- // XDocumentHandler
- public:
- virtual void SAL_CALL
- startDocument( )
- throw (sax::SAXException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endDocument( ) throw (sax::SAXException, uno::RuntimeException);
-
- virtual void SAL_CALL
- startElement( const rtl::OUString& aName, const uno::Reference< sax::XAttributeList >& xAttribs )
- throw (sax::SAXException, uno::RuntimeException);
-
- virtual void SAL_CALL
- endElement( const rtl::OUString& aName )
- throw (sax::SAXException, uno::RuntimeException);
-
- private:
- /// start the schema
- void startSchema( ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& xAttribs );
- /// end the schema
- void endSchema();
-
- /// start a section (components or templates)
- void startSection( Select _select, ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& xAttribs );
- /// end the current section
- void endSection();
-
- /// handle a import directive element
- void handleImport( ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& xAttribs );
-
- /// start an node
- void startNode( ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& xAttribs );
- /// end a node
- void endNode();
-
- /// start a property
- void startProperty( ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& xAttribs );
- /// end a property
- void endProperty();
-
- /// start collecting data for a value - returns the locale of the value (property must have been started)
- void startValueData(const uno::Reference< sax::XAttributeList >& xAttribs);
- /// end collecting data for a value - returns the collected value
- void endValueData();
-
- /// handle a instance ref element
- void handleInstance( ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& xAttribs );
- /// handle a item-type declaration element
- void handleItemType( ElementInfo const & aInfo, const uno::Reference< sax::XAttributeList >& xAttribs );
-
- bool isSelected() const { return m_selected != selectNone; }
- bool select(Select _select);
- private:
- uno::Reference< backenduno::XSchemaHandler > m_xHandler;
- rtl::OUString m_sComponent;
- Select m_selector;
- Select m_selected;
- };
-// -----------------------------------------------------------------------------
- } // namespace xml
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/xml/simpletypehelper.cxx b/configmgr/source/xml/simpletypehelper.cxx
deleted file mode 100644
index b1caca38b9..0000000000
--- a/configmgr/source/xml/simpletypehelper.cxx
+++ /dev/null
@@ -1,54 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "simpletypehelper.hxx"
-#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/uno/Any.hxx>
-
-namespace configmgr
-{
- namespace uno = com::sun::star::uno;
- namespace SimpleTypeHelper
- {
-
- uno::Type getBooleanType() { return ::getBooleanCppuType(); }
-
- uno::Type getShortType() { return ::getCppuType(static_cast<sal_Int16 const*>(0)); }
- uno::Type getIntType() { return ::getCppuType(static_cast<sal_Int32 const*>(0)); }
- uno::Type getLongType() { return ::getCppuType(static_cast<sal_Int64 const*>(0)); }
-
- uno::Type getDoubleType() { return ::getCppuType(static_cast<double const*>(0)); }
-
- uno::Type getStringType() { return ::getCppuType(static_cast<rtl::OUString const*>(0)); }
-
- uno::Type getBinaryType() { return ::getCppuType(static_cast<uno::Sequence<sal_Int8> const*>(0)); }
- uno::Type getAnyType() { return ::getCppuType(static_cast<uno::Any const*>(0)); }
- }
-}
diff --git a/configmgr/source/xml/typeconverter.cxx b/configmgr/source/xml/typeconverter.cxx
deleted file mode 100644
index 01d4702143..0000000000
--- a/configmgr/source/xml/typeconverter.cxx
+++ /dev/null
@@ -1,351 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include "typeconverter.hxx"
-#include "utility.hxx"
-#include "simpletypehelper.hxx"
-#include <com/sun/star/script/XTypeConverter.hpp>
-#include <com/sun/star/script/FailReason.hpp>
-#include <com/sun/star/uno/Type.hxx>
-#include <strdecl.hxx>
-#include <typelib/typedescription.hxx>
-
-
-#include <rtl/ustring.hxx>
-#include <osl/diagnose.h>
-
-namespace uno = ::com::sun::star::uno;
-namespace script = ::com::sun::star::script;
-namespace lang = ::com::sun::star::lang;
-
-namespace configmgr
-{
-
-//--------------------------------------------------------------------------------------------------
- rtl::OUString toString(const uno::Reference< script::XTypeConverter >& xTypeConverter, const uno::Any& rValue)
- SAL_THROW((script::CannotConvertException , com::sun::star::uno::RuntimeException))
- {
- rtl::OUString aRes;
- uno::TypeClass aDestinationClass = rValue.getValueType().getTypeClass();
-
- switch (aDestinationClass)
- {
- case uno::TypeClass_BOOLEAN:
- case uno::TypeClass_CHAR:
- case uno::TypeClass_BYTE:
- case uno::TypeClass_SHORT:
- case uno::TypeClass_LONG:
- case uno::TypeClass_HYPER:
- case uno::TypeClass_FLOAT:
- case uno::TypeClass_DOUBLE:
- if (!xTypeConverter.is())
- {
- throw script::CannotConvertException(
- ::rtl::OUString::createFromAscii("Missing Converter Service!"),
- uno::Reference< uno::XInterface > (),
- aDestinationClass,
- script::FailReason::UNKNOWN, 0
- );
- }
- xTypeConverter->convertToSimpleType(rValue, uno::TypeClass_STRING) >>= aRes;
- break;
-
- case ::uno::TypeClass_STRING:
- rValue >>= aRes;
- break;
-
- default:
- throw script::CannotConvertException(
- ::rtl::OUString::createFromAscii("Unsupported type: ") + rValue.getValueType().getTypeName(),
- uno::Reference< uno::XInterface > (),
- aDestinationClass,
- script::FailReason::TYPE_NOT_SUPPORTED, 0
- );
-
- }
- return aRes;
- }
-
- uno::Any toAny(const uno::Reference< script::XTypeConverter >& xTypeConverter, const ::rtl::OUString& _rValue,const uno::TypeClass& _rTypeClass)
- SAL_THROW((script::CannotConvertException , com::sun::star::uno::RuntimeException))
- {
- uno::Any aRes;
-
- if (uno::TypeClass_STRING == _rTypeClass)
- {
- aRes <<= _rValue;
- }
- else if (!xTypeConverter.is())
- {
- throw script::CannotConvertException(
- ::rtl::OUString::createFromAscii("Missing Converter Service!"),
- uno::Reference< uno::XInterface > (),
- _rTypeClass,
- script::FailReason::UNKNOWN, 0
- );
- }
- else try
- {
- aRes = xTypeConverter->convertToSimpleType(uno::makeAny(_rValue), _rTypeClass);
- }
- catch (script::CannotConvertException& )
- {
- // ok, next try with trim()
- ::rtl::OUString const sTrimmed = _rValue.trim();
- if (sTrimmed.getLength() != 0)
- {
- try
- {
- aRes = xTypeConverter->convertToSimpleType(uno::makeAny(sTrimmed), _rTypeClass);
-
- OSL_ENSURE(aRes.hasValue(),"Converted non-empty string to NULL\n");
- }
- catch (script::CannotConvertException&)
- {
- OSL_ASSERT(!aRes.hasValue());
- }
- catch (uno::Exception&)
- {
- OSL_ENSURE(false,"Unexpected exception from XTypeConverter::convertToSimpleType()\n");
- OSL_ASSERT(!aRes.hasValue());
- }
-
- if (!aRes.hasValue()) throw;
- }
- }
- catch (lang::IllegalArgumentException& iae)
- {
- OSL_ENSURE(sal_False, "Illegal argument for typeconverter. Maybe invalid typeclass ?");
- throw script::CannotConvertException(
- ::rtl::OUString::createFromAscii("Invalid Converter Argument:") + iae.Message,
- uno::Reference< uno::XInterface > (),
- _rTypeClass,
- script::FailReason::UNKNOWN, 0
- );
- }
- catch (uno::Exception& e)
- {
- OSL_ENSURE(false,"Unexpected exception from XTypeConverter::convertToSimpleType()\n");
- throw script::CannotConvertException(
- ::rtl::OUString::createFromAscii("Unexpected TypeConverter Failure:") + e.Message,
- uno::Reference< uno::XInterface > (),
- _rTypeClass,
- script::FailReason::UNKNOWN, 0
- );
- }
- return aRes;
- }
-
- ::rtl::OUString toTypeName(const uno::TypeClass& _rTypeClass)
- {
- ::rtl::OUString aRet;
- switch(_rTypeClass)
- {
- case uno::TypeClass_BOOLEAN: aRet = TYPE_BOOLEAN; break;
- case uno::TypeClass_SHORT: aRet = TYPE_SHORT; break;
- case uno::TypeClass_LONG: aRet = TYPE_INT; break;
- case uno::TypeClass_HYPER: aRet = TYPE_LONG; break;
- case uno::TypeClass_DOUBLE: aRet = TYPE_DOUBLE; break;
- case uno::TypeClass_STRING: aRet = TYPE_STRING; break;
- case uno::TypeClass_SEQUENCE: aRet = TYPE_BINARY; break;
- case uno::TypeClass_ANY: aRet = TYPE_ANY; break;
- default:
- {
- ::rtl::OString aStr("Wrong typeclass! ");
- aStr += ::rtl::OString::valueOf((sal_Int32)_rTypeClass);
- OSL_ENSURE(0,aStr.getStr());
- }
- }
- return aRet;
- }
-
-// *************************************************************************
- uno::Type toType(const ::rtl::OUString& _rType)
- {
- uno::Type aRet;
-
- if (_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("boolean"))) aRet = SimpleTypeHelper::getBooleanType();
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("short"))) aRet = SimpleTypeHelper::getShortType();
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("int"))) aRet = SimpleTypeHelper::getIntType();
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("integer"))) aRet = SimpleTypeHelper::getIntType();
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("long"))) aRet = SimpleTypeHelper::getLongType();
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("double"))) aRet = SimpleTypeHelper::getDoubleType();
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("string"))) aRet = SimpleTypeHelper::getStringType();
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("binary"))) aRet = SimpleTypeHelper::getBinaryType();
-// else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("sequence"))) aRet = uno::TypeClass_SEQUENCE;
-
- else if(_rType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("any"))) aRet = SimpleTypeHelper::getAnyType();
- else
- {
- ::rtl::OString aStr("Unknown type! ");
- aStr += rtl::OUStringToOString(_rType,RTL_TEXTENCODING_ASCII_US);
- OSL_ENSURE(0,aStr.getStr());
- }
-
- return aRet;
- }
- uno::Type toListType(const ::rtl::OUString& _rsElementType)
- {
- uno::Type aRet;
-
- if (_rsElementType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("boolean")))
- aRet = ::getCppuType(static_cast<uno::Sequence<sal_Bool> const*>(0));
-
- else if(_rsElementType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("short")))
- aRet = ::getCppuType(static_cast<uno::Sequence<sal_Int16> const*>(0));
-
- else if(_rsElementType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("int")))
- aRet = ::getCppuType(static_cast<uno::Sequence<sal_Int32> const*>(0));
- else if(_rsElementType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("integer")))
- aRet = ::getCppuType(static_cast<uno::Sequence<sal_Int32> const*>(0));
-
- else if(_rsElementType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("long")))
- aRet = ::getCppuType(static_cast<uno::Sequence<sal_Int64> const*>(0));
-
- else if(_rsElementType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("double")))
- aRet = ::getCppuType(static_cast<uno::Sequence<double> const*>(0));
-
- else if(_rsElementType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("string")))
- aRet = ::getCppuType(static_cast<uno::Sequence<rtl::OUString> const*>(0));
-
- else if(_rsElementType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("binary")))
- aRet = ::getCppuType(static_cast<uno::Sequence<uno::Sequence<sal_Int8> > const*>(0));
-
-// else if(_rsElementType.equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("sequence"))) aRet = uno::TypeClass_SEQUENCE;
- else
- {
- ::rtl::OString aStr("Unknown type! ");
- aStr += rtl::OUStringToOString(_rsElementType,RTL_TEXTENCODING_ASCII_US);
- OSL_ENSURE(0,aStr.getStr());
- }
-
- return aRet;
- }
-
- uno::Type getSequenceElementType(uno::Type const& rSequenceType)
- {
- OSL_ENSURE(rSequenceType.getTypeClass() == uno::TypeClass_SEQUENCE,
- "getSequenceElementType() must be called with a sequence type");
-
- if (!(rSequenceType.getTypeClass() == uno::TypeClass_SEQUENCE))
- return uno::Type();
-
- uno::TypeDescription aTD(rSequenceType);
- typelib_IndirectTypeDescription* pSequenceTD =
- reinterpret_cast< typelib_IndirectTypeDescription* >(aTD.get());
-
- OSL_ASSERT(pSequenceTD);
- OSL_ASSERT(pSequenceTD->pType);
-
- if ( pSequenceTD && pSequenceTD->pType )
- {
- return uno::Type(pSequenceTD->pType);
- } //if
-
- return uno::Type();
- }
- uno::Type getBasicType(uno::Type const& rType, bool& bSequence)
- {
- bSequence = rType.getTypeClass() == uno::TypeClass_SEQUENCE &&
- rType != SimpleTypeHelper::getBinaryType();
-
- if (!bSequence)
- return rType;
-
- return getSequenceElementType(rType);
- }
-
-
- // template names
-// *************************************************************************
- ::rtl::OUString toTemplateName(const uno::Type& _rType)
- {
- bool bList;
- uno::Type aBaseType = getBasicType(_rType,bList);
- return toTemplateName(aBaseType.getTypeClass(), bList);
- }
-
- ::rtl::OUString toTemplateName(const uno::TypeClass& _rBasicType, bool bList)
- {
- return toTemplateName(toTypeName(_rBasicType), bList);
- }
-
-// *************************************************************************
- uno::Type parseTemplateName(::rtl::OUString const& sTypeName)
- {
- uno::Type aRet;
-
- ::rtl::OUString sBasicTypeName;
- bool bList;
- if (parseTemplateName(sTypeName, sBasicTypeName,bList))
- aRet = toType(sBasicTypeName,bList);
- // else leave as void
-
- return aRet;
- }
-
-// *************************************************************************
- ::rtl::OUString toTemplateName(const ::rtl::OUString& _rBasicTypeName, bool bList)
- {
- ::rtl::OUString sName = TEMPLATE_MODULE_NATIVE_PREFIX + _rBasicTypeName;
- if (bList)
- sName += TEMPLATE_LIST_SUFFIX;
-
-
- return sName;
- }
-
- bool parseTemplateName(::rtl::OUString const& sTypeName, ::rtl::OUString& _rBasicName, bool& bList)
- {
- ::rtl::OUString const sSuffix( TEMPLATE_LIST_SUFFIX );
-
- sal_Int32 nIndex = sTypeName.lastIndexOf(sSuffix);
- if (nIndex >= 0 && nIndex + sSuffix.getLength() == sTypeName.getLength())
- {
- bList = true;
- _rBasicName = sTypeName.copy(0,nIndex);
- }
- else
- {
- bList = false;
- _rBasicName = sTypeName;
- }
- // erase the default prefix 'cfg:'
- if (_rBasicName.indexOf(TEMPLATE_MODULE_NATIVE_PREFIX) == 0)
- _rBasicName = _rBasicName.copy(TEMPLATE_MODULE_NATIVE_PREFIX.m_nLen);
-
- return true;
-
- }
-// *************************************************************************
-
-} // namespace configmgr
diff --git a/configmgr/source/xml/valueconverter.cxx b/configmgr/source/xml/valueconverter.cxx
deleted file mode 100644
index 9ecda7ee5b..0000000000
--- a/configmgr/source/xml/valueconverter.cxx
+++ /dev/null
@@ -1,501 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "valuetypeconverter.hxx"
-#include "typeconverter.hxx"
-
-inline sal_Bool rtl_ascii_isWhitespace( sal_Unicode ch )
-{
- return ch <= 0x20 && ch;
-}
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
-static
-void throwConversionError(sal_Char const* pErrorMsg) SAL_THROW((script::CannotConvertException))
-{
- OSL_ENSURE(false, pErrorMsg);
-
- script::CannotConvertException error;
- error.Message = rtl::OUString::createFromAscii(pErrorMsg);
- throw error;
-}
-// -----------------------------------------------------------------------------
-template <class Char>
-inline
-bool charInRange(Char ch, char from, char to) throw()
-{
- return Char(from) <= ch && ch <= Char(to);
-}
-
-// -----------------------------------------------------------------------------
-static
-inline
-unsigned makeHexNibble(unsigned char ch) SAL_THROW((script::CannotConvertException))
-{
- unsigned nRet = 0;
-
- if (charInRange(ch, '0', '9')) nRet = ch - unsigned('0');
-
- else if (charInRange(ch, 'a', 'f')) nRet = ch - unsigned('a' - 10u);
-
- else if (charInRange(ch, 'A', 'F')) nRet = ch - unsigned('A' - 10u);
-
- else throwConversionError("Invalid Hex Character in binary value");
-
- return nRet;
-}
-
-// -----------------------------------------------------------------------------
-static
-inline
-unsigned readHexNibble(sal_Unicode ch) SAL_THROW((script::CannotConvertException))
-{
- if (!charInRange(ch, 0, 127)) throwConversionError("Non-Ascii Character in binary value");
-
- return makeHexNibble(static_cast<unsigned char>(ch));
-}
-
-// -----------------------------------------------------------------------------
-static
-inline
-unsigned int readHexByte(sal_Unicode const*& pStr) SAL_THROW((script::CannotConvertException))
-{
- register unsigned int nHigh = readHexNibble(*pStr++);
- register unsigned int nLow = readHexNibble(*pStr++);
- return (nHigh << 4) | nLow;
-}
-
-// -----------------------------------------------------------------------------
-static
-void parseHexBinary(rtl::OUString const& aHexString_, uno::Sequence<sal_Int8>& rBinarySeq_)
- SAL_THROW((script::CannotConvertException , com::sun::star::uno::RuntimeException))
-{
- // PRE: aBinaryString with HexCode
- // POST: rBinarySeq with the to Hex converted String
-
- sal_uInt32 nCount = aHexString_.getLength();
- sal_Unicode const * pHex = aHexString_.getStr();
-
- if (nCount % 2) throwConversionError("Hex string has odd number of characters");
- nCount /= 2;
-
- rBinarySeq_.realloc(nCount);
- sal_Int8 * pBinary = rBinarySeq_.getArray();
-
- while (nCount--)
- {
- *pBinary++ = static_cast<sal_Int8>(readHexByte(pHex));
- }
-}
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-uno::Sequence<sal_Int8> ValueConverter::parseBinary(rtl::OUString const& aBinaryString_) const
- SAL_THROW((script::CannotConvertException, com::sun::star::uno::RuntimeException))
-{
- uno::Sequence<sal_Int8> aResultSeq;
-
- parseHexBinary(aBinaryString_,aResultSeq);
-
- return aResultSeq;
-}
-
-// -----------------------------------------------------------------------------
-static inline
-uno::Type getBinaryType()
-{
- uno::Sequence<sal_Int8> const * const for_binary = 0;
- return ::getCppuType(for_binary);
-}
-
-// -----------------------------------------------------------------------------
-bool ValueConverter::isList() const
-{
- return m_aType.getTypeClass() == uno::TypeClass_SEQUENCE &&
- m_aType != getBinaryType();
-}
-
-// -----------------------------------------------------------------------------
-uno::Any ValueConverter::convertToAny(rtl::OUString const& aContent) const
- SAL_THROW((script::CannotConvertException, com::sun::star::uno::RuntimeException))
-{
- uno::Any aValue;
-
- if (this->isNull())
- {
- OSL_ENSURE(aContent.trim().getLength() == 0, "ValueConverter: Non-empty Null Value - ignoring content");
- OSL_ASSERT(!aValue.hasValue());
- }
-
- else if (this->isList())
- {
- std::vector< rtl::OUString > aContentList;
- splitListData(aContent, aContentList);
- convertListToAny(aContentList, aValue);
- }
-
- else
- {
- convertScalarToAny(aContent, aValue);
- }
-
- return aValue;
-}
-
-// -----------------------------------------------------------------------------
-bool ValueConverter::convertScalarToAny(rtl::OUString const& aContent, uno::Any& rValue) const
- SAL_THROW((script::CannotConvertException , com::sun::star::uno::RuntimeException))
-{
- OSL_PRECOND(!this->isNull(),"ValueConverter::convertScalarToAny - check for NULL before calling");
- OSL_ENSURE(m_aType.getTypeClass() != uno::TypeClass_ANY,"'Any' values must be NULL");
-
- // check for Binary
- if (m_aType == getBinaryType())
- {
- com::sun::star::uno::Sequence<sal_Int8> aBinarySeq = parseBinary(aContent);
- rValue <<= aBinarySeq;
- }
-
- else
- {
- rValue = toAny(m_xTypeConverter, aContent, m_aType.getTypeClass());
- }
-
- return !! rValue.hasValue();
-}
-
-// -----------------------------------------------------------------------------
-template <class T>
-bool convertListToSequence(std::vector< rtl::OUString > const& aStringList, uno::Sequence< T >& rSequence, uno::TypeClass aElementTypeClass, ValueConverter const& rConverter)
- SAL_THROW((script::CannotConvertException , com::sun::star::uno::RuntimeException))
-{
- OSL_ASSERT(aElementTypeClass == ::getCppuType(static_cast<T const*>(0)).getTypeClass());
-
- rSequence.realloc(aStringList.size());
-
- sal_uInt32 nPos = 0;
-
- for(std::vector< rtl::OUString >::const_iterator it = aStringList.begin();
- it != aStringList.end();
- ++it)
- {
- uno::Any aValueAny = toAny(rConverter.getTypeConverter(), *it, aElementTypeClass);
-
- if (aValueAny >>= rSequence[nPos])
- ++nPos;
-
- else if (!aValueAny.hasValue())
- OSL_ENSURE(false,"UNEXPECTED: Found NULL value in List - ignoring value !");
-
- else
- OSL_ENSURE(false,"ERROR: Cannot extract converted value into List - skipping value !");
- }
-
- bool bOK = (nPos == aStringList.size());
-
- if (!bOK)
- {
- OSL_ASSERT(nPos < aStringList.size());
- rSequence.realloc(nPos);
- }
- return bOK;
-}
-
-// -----------------------------------------------------------------------------
-// special conversion for string sequence
-
-static
-inline
-void stringListToSequence(uno::Sequence< rtl::OUString > & rSequence, std::vector< rtl::OUString > const & aStringList)
-{
- rSequence .realloc( aStringList.size() );
-
- std::copy( aStringList.begin(), aStringList.end(), rSequence.getArray() );
-}
-// -----------------------------------------------------------------------------
-
-static
-inline
-std::vector< rtl::OUString > sequenceToStringList(uno::Sequence< rtl::OUString > const & aSequence)
-{
- rtl::OUString const * const pBegin = aSequence.getConstArray();
- rtl::OUString const * const pEnd = pBegin + aSequence.getLength();
-
- return std::vector< rtl::OUString >(pBegin,pEnd);
-}
-// -----------------------------------------------------------------------------
-
-uno::Sequence< rtl::OUString > ValueConverter::splitStringList(rtl::OUString const& aContent) const
-{
- std::vector< rtl::OUString > aList;
- splitListData(aContent, aList);
-
- uno::Sequence< rtl::OUString > aResult;
- stringListToSequence(aResult,aList);
-
- return aResult;
-}
-// -----------------------------------------------------------------------------
-
-uno::Any ValueConverter::convertListToAny(uno::Sequence< rtl::OUString > const& aContentList) const
- SAL_THROW((script::CannotConvertException , com::sun::star::uno::RuntimeException))
-{
- uno::Any aResult;
- std::vector< rtl::OUString > const aStringList = sequenceToStringList(aContentList);
- convertListToAny(aStringList,aResult);
- return aResult;
-}
-// -----------------------------------------------------------------------------
-// special overload for binary sequence
-
-// template<> // use an explicit specialization
-bool convertListToSequence(std::vector< rtl::OUString > const& aStringList, uno::Sequence< uno::Sequence<sal_Int8> >& rSequence, uno::TypeClass aElementTypeClass, ValueConverter const& rParser )
- SAL_THROW((script::CannotConvertException , com::sun::star::uno::RuntimeException))
-{
- { (void)aElementTypeClass; }
- OSL_ASSERT(aElementTypeClass == uno::TypeClass_SEQUENCE);
-
- rSequence.realloc(aStringList.size());
-
- sal_uInt32 nPos = 0;
-
- for(std::vector< rtl::OUString >::const_iterator it = aStringList.begin();
- it != aStringList.end();
- ++it)
- {
- rSequence[nPos++] = rParser.parseBinary(*it);
- }
- return true;
-}
-
-// -----------------------------------------------------------------------------
-// special overload for string sequence
-
-// template<> // use an explicit specialization
-bool convertListToSequence(std::vector< rtl::OUString > const& aStringList, uno::Sequence< rtl::OUString >& rSequence, uno::TypeClass aElementTypeClass, ValueConverter const& /*rParser*/ )
- SAL_THROW((script::CannotConvertException , com::sun::star::uno::RuntimeException))
-{
- { (void)aElementTypeClass; }
- OSL_ASSERT(aElementTypeClass == uno::TypeClass_STRING);
-
- stringListToSequence(rSequence, aStringList);
-
- return true;
-}
-
-// -----------------------------------------------------------------------------
-
-#define MAYBE_EXTRACT_SEQUENCE( type ) \
- if (aElementType == ::getCppuType( (type const *)0)) \
- { \
- com::sun::star::uno::Sequence< type > aSequence; \
- convertListToSequence(aContentList,aSequence,aElementTypeClass, *this); \
- rValue <<= aSequence; \
- }
-
-bool ValueConverter::convertListToAny(std::vector< rtl::OUString > const& aContentList, uno::Any& rValue) const
- SAL_THROW((script::CannotConvertException , com::sun::star::uno::RuntimeException))
-{
- OSL_PRECOND(!this->isNull(),"ValueConverter::convertListToAny - check for NULL before calling");
- OSL_ENSURE(m_aType.getTypeClass() == uno::TypeClass_SEQUENCE,"'Any' not allowed for lists");
-
- uno::Type aElementType = getSequenceElementType(m_aType);
- uno::TypeClass aElementTypeClass = aElementType.getTypeClass();
-
- OSL_ENSURE(aElementTypeClass != uno::TypeClass_ANY,"'Any' not allowed for list elements");
-
- MAYBE_EXTRACT_SEQUENCE( rtl::OUString )
- else
- MAYBE_EXTRACT_SEQUENCE( sal_Bool )
- else
- MAYBE_EXTRACT_SEQUENCE( sal_Int16 )
- else
- MAYBE_EXTRACT_SEQUENCE( sal_Int32 )
- else
- MAYBE_EXTRACT_SEQUENCE( sal_Int64 )
- else
- MAYBE_EXTRACT_SEQUENCE( double )
- else
- MAYBE_EXTRACT_SEQUENCE( com::sun::star::uno::Sequence<sal_Int8> )
- else
- {
- OSL_ENSURE(false, "Unknown element type in list");
- throwConversionError("Invalid value-type found in list value");
- }
-
- return !! rValue.hasValue();
-}
-#undef MAYBE_EXTRACT_SEQUENCE
-
-// -----------------------------------------------------------------------------
-namespace
-{
- sal_Int32 const NO_MORE_TOKENS = -1;
- struct OTokenizeByWhitespace
- {
-
- static inline bool isWhitespace(sal_Unicode ch)
- {
- // note: for definition of whitescape see also
- // canUseWhitespace(rtl::OUString const&)
- // in xmlformater.cxx
- // -----------------------------------------------------------------------------
- return rtl_ascii_isWhitespace(ch) ? true : false;
- }
-
- sal_Int32 findFirstTokenStart(rtl::OUString const& sText) const SAL_THROW(())
- {
- return findNextTokenStart(sText,0);
- }
-
- sal_Int32 findNextTokenStart(rtl::OUString const& sText, sal_Int32 nPrevTokenEnd) const SAL_THROW(())
- {
- sal_Int32 const nEnd = sText.getLength();
- sal_Int32 nPos = nPrevTokenEnd;
-
- OSL_PRECOND( nPos == 0 || (0 < nPos && nPos < nEnd && isWhitespace(sText[nPos])) || nPos == nEnd,
- "Invalid nPrevTokenEnd");
-
- while (nPos < nEnd && isWhitespace(sText[nPos]))
- {
- ++nPos;
- }
-
- if (nPos < nEnd)
- return nPos;
- else
- return NO_MORE_TOKENS;
- }
-
- sal_Int32 findTokenEnd(rtl::OUString const& sText, sal_Int32 nTokenStart) const SAL_THROW(())
- {
- sal_Int32 const nEnd = sText.getLength();
- sal_Int32 nPos = nTokenStart;
-
- OSL_PRECOND( 0 <= nPos && nPos < nEnd && !isWhitespace(sText[nPos]),
- "Invalid nTokenStart");
-
- while (nPos < nEnd && !isWhitespace(sText[nPos]))
- {
- ++nPos;
- }
-
- return nPos;
- }
- };
-// -----------------------------------------------------------------------------
- struct OTokenizeBySeparator
- {
- rtl::OUString const sSeparator;
- OTokenizeBySeparator(rtl::OUString const& _sSeparator) SAL_THROW(())
- : sSeparator(_sSeparator)
- {
- OSL_PRECOND(sSeparator.trim().getLength() > 0, "Invalid empty separator string");
- }
-
- sal_Int32 findFirstTokenStart(rtl::OUString const& /*sText*/) const SAL_THROW(())
- {
- return 0;
- }
- sal_Int32 findNextTokenStart(rtl::OUString const& sText, sal_Int32 nPrevTokenEnd) const SAL_THROW(())
- {
- sal_Int32 const nEnd = sText.getLength();
- sal_Int32 nPos = nPrevTokenEnd;
- OSL_PRECOND( nPos == nEnd || (0 <= nPos && nPos < nEnd && sText.indexOf(sSeparator, nPos) == nPos),
- "Invalid nPrevTokenEnd");
-
- if (nPos < nEnd)
- return nPos + sSeparator.getLength();
- else
- return NO_MORE_TOKENS;
- }
- sal_Int32 findTokenEnd(rtl::OUString const& sText, sal_Int32 nTokenStart) const SAL_THROW(())
- {
- sal_Int32 const nEnd = sText.getLength();
- OSL_PRECOND( 0 <= nTokenStart && nTokenStart <= nEnd ,
- "Invalid nTokenStart");
-
- sal_Int32 nPos = sText.indexOf(sSeparator,nTokenStart);
-
- if (nPos >= 0)
- return nPos;
- else
- return nEnd;
- }
- };
-// -----------------------------------------------------------------------------
- template <class Tokenizer>
- void tokenizeListData(Tokenizer const& aTokenizer, rtl::OUString const& aContent, std::vector< rtl::OUString >& rContentList)
- SAL_THROW(())
- {
- sal_Int32 nTokenPos = aTokenizer.findFirstTokenStart(aContent);
-
- while(nTokenPos != NO_MORE_TOKENS)
- {
- sal_Int32 nTokenEnd = aTokenizer.findTokenEnd(aContent, nTokenPos);
-
- // this is what the tokenizer must provide
- OSL_ASSERT(0 <= nTokenPos && nTokenPos <= nTokenEnd && nTokenEnd <= aContent.getLength());
-
- rContentList.push_back( aContent.copy(nTokenPos, nTokenEnd-nTokenPos) );
-
- nTokenPos= aTokenizer.findNextTokenStart(aContent, nTokenEnd);
- }
- }
-// -----------------------------------------------------------------------------
-}
-// -----------------------------------------------------------------------------
-void ValueConverter::splitListData(rtl::OUString const& aContent, std::vector< rtl::OUString >& rContentList) const
- SAL_THROW(())
-{
- rtl::OUString sSeparator = m_sSeparator;
-
- bool bSeparateByWhitespace = (sSeparator.trim().getLength() == 0);
-
- if (bSeparateByWhitespace)
- {
- OSL_ENSURE( sSeparator.getLength()==0 || sSeparator.equalsAscii(" "),
- "Unexpected whitespace-only separator");
-
- tokenizeListData( OTokenizeByWhitespace(), aContent, rContentList );
- }
- else
- {
- OSL_ENSURE( sSeparator.trim()==sSeparator,
- "Unexpected whitespace in separator");
-
- tokenizeListData( OTokenizeBySeparator(sSeparator), aContent, rContentList );
- }
-}
-// -----------------------------------------------------------------------------
-
-} // namespace
diff --git a/configmgr/source/xml/valueformatter.cxx b/configmgr/source/xml/valueformatter.cxx
deleted file mode 100644
index 770899a3ae..0000000000
--- a/configmgr/source/xml/valueformatter.cxx
+++ /dev/null
@@ -1,495 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "valueformatter.hxx"
-#include "elementformatter.hxx"
-#include "xmlstrings.hxx"
-#include "typeconverter.hxx"
-#include "simpletypehelper.hxx"
-#include <rtl/ustrbuf.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-
-#ifndef INCLUDED_ALGORITHM
-#include <algorithm>
-#define INCLUDED_ALGORITHM
-#endif
-
-namespace configmgr
-{
- namespace uno = com::sun::star::uno;
-
- namespace xml
- {
-
-//==========================================================================
-//= Helper
-//==========================================================================
-
-// -----------------------------------------------------------------------------
-namespace
-{
-// -----------------------------------------------------------------------------
-
-static
-inline
-bool isWhitespaceCharacter( sal_Unicode ch )
-{
- return ch <= 0x20 && ch;
-}
-// -----------------------------------------------------------------------------
-
-static
-inline
-bool isWhitespaceString(rtl::OUString const & aStr)
-{
- sal_Unicode const * const pBegin = aStr.getStr();
- sal_Unicode const * const pEnd = pBegin + aStr.getLength();
-
- // BACK: true, if any whitespace in string or string is empty
- if (pBegin == pEnd)
- return true;
-
- sal_Unicode const * const pSpace = std::find_if(pBegin,pEnd,isWhitespaceCharacter);
-
- return pSpace != pEnd;
-}
-// -----------------------------------------------------------------------------
-
-static
-bool hasWhitespaceString( uno::Sequence< rtl::OUString > const & aSeq)
-{
- // BACK: true, if whitespace Separator is ok, (no whitespace in Strings, no empty strings)
- rtl::OUString const * const pBegin = aSeq.getConstArray();
- rtl::OUString const * const pEnd = pBegin + aSeq.getLength();
-
- rtl::OUString const * const pSpace = std::find_if(pBegin,pEnd,isWhitespaceString);
-
- return pSpace != pEnd;
-}
-// -----------------------------------------------------------------------------
-
-struct HasSubString
-{
- HasSubString(rtl::OUString const & _aSubStr)
- : m_aSubStr(_aSubStr)
- {}
-
- bool operator()(rtl::OUString const & _aStr)
- { return _aStr.indexOf(m_aSubStr) >= 0; }
-
- rtl::OUString const m_aSubStr;
-};
-// -----------------------------------------------------------------------------
-
-static
-bool hasStringWithSubstring(const uno::Sequence< rtl::OUString > &aSeq, rtl::OUString const & _aSubStr)
-{
- rtl::OUString const * const pBegin = aSeq.getConstArray();
- rtl::OUString const * const pEnd = pBegin + aSeq.getLength();
-
- rtl::OUString const * const pSpace = std::find_if(pBegin,pEnd,HasSubString(_aSubStr));
-
- return pSpace != pEnd;
-}
-// -----------------------------------------------------------------------------
-
-
-template <class Element_>
-struct IsEmptySequence
-{
- bool operator()(uno::Sequence<Element_> const & aSeq) const
- {
- return aSeq.getLength() == 0;
- }
-};
-// -----------------------------------------------------------------------------
-
-template <class Element_>
-bool hasEmptySequence(uno::Sequence< uno::Sequence<Element_> > const & aSeqSeq)
-{
- // BACK: true, if whitespace Separator is ok, (no whitespace in Strings, no empty strings)
- uno::Sequence<Element_> const * const pBegin = aSeqSeq.getConstArray();
- uno::Sequence<Element_> const * const pEnd = pBegin + aSeqSeq.getLength();
-
- uno::Sequence<Element_> const * const pEmpty = std::find_if(pBegin, pEnd, IsEmptySequence<Element_>() );
-
- return pEmpty != pEnd;
-}
-// -----------------------------------------------------------------------------
-
-inline
-bool canUseSeparator(uno::Sequence< rtl::OUString > const & aSeq, rtl::OUString const & aSeparator)
-{
- return ! hasStringWithSubstring(aSeq,aSeparator);
-}
-// -----------------------------------------------------------------------------
-
-inline
-bool canUseWhitespaceSeparator(uno::Sequence< rtl::OUString > const & aSeq)
-{
- return ! hasWhitespaceString(aSeq);
-}
-// -----------------------------------------------------------------------------
-
-template <class Element_>
-inline
-bool canUseWhitespaceSeparator(const uno::Sequence< uno::Sequence<Element_> > &aSeq)
-{
- return ! hasEmptySequence(aSeq);
-}
-// -----------------------------------------------------------------------------
-
-class Separator
-{
- rtl::OUString m_sValue;
-public:
- // -----------------------------------------------------------------------------
- Separator() : m_sValue() {}
- // -----------------------------------------------------------------------------
- bool isDefault() const { return m_sValue.getLength() == 0; }
- // -----------------------------------------------------------------------------
- rtl::OUString value() const { return isDefault() ? static_cast<rtl::OUString>(SEPARATOR_WHITESPACE) : m_sValue; }
- // -----------------------------------------------------------------------------
-
- bool check(const uno::Sequence<rtl::OUString> &aSeq) const
- {
- return isDefault() ? canUseWhitespaceSeparator(aSeq) : canUseSeparator(aSeq, m_sValue);
- }
-
- // -----------------------------------------------------------------------------
- bool trySeparator(rtl::OUString const& sSep, const uno::Sequence<rtl::OUString> & aSeq)
- {
- OSL_ENSURE( ! isWhitespaceString(sSep), "There should be no spaces in non-default separators");
- // BACK: true, if Separator is ok, not in Strings
- if (!canUseSeparator(aSeq, sSep))
- return false;
- this->setSeparator(sSep);
- return true;
- }
- // -----------------------------------------------------------------------------
- void setSeparator(rtl::OUString const& sSep)
- {
- m_sValue = sSep;
- }
- // -----------------------------------------------------------------------------
-};
-// -----------------------------------------------------------------------------
-#define ASCII( STRING_LIT_ ) ( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( STRING_LIT_ ) ) )
-// -----------------------------------------------------------------------------
-static
-Separator createSeparator(const uno::Any& aAny)
-{
- Separator aResult;
-
- // create a Separator which isn't in any value
- if (aAny.getValueTypeClass() == uno::TypeClass_SEQUENCE)
- {
- uno::Type aElementType = configmgr::getSequenceElementType(aAny.getValueType());
- if (aElementType.getTypeClass() == uno::TypeClass_STRING)
- {
- // only in strings we need to search a separator
- uno::Sequence<rtl::OUString> aSeq;
-
- OSL_VERIFY (aAny >>= aSeq);
-
- bool bValidSeparator =
- canUseWhitespaceSeparator(aSeq) ||
- aResult.trySeparator(ASCII(","), aSeq) ||
- aResult.trySeparator(ASCII(";"), aSeq) ||
- aResult.trySeparator(ASCII(":"), aSeq) ||
- aResult.trySeparator(ASCII("|"), aSeq) ||
- aResult.trySeparator(ASCII("#"), aSeq) ||
- aResult.trySeparator(ASCII("-#*=+#-"), aSeq);
-
- if (!bValidSeparator)
- {
- OSL_TRACE("ERROR: configuration formatter: Could not create Separator for string list");
- OSL_ENSURE(false, "ERROR: Could not create Separator for string list");
- }
- else
- {
- // maybe the whitespace test was invalid ?
- OSL_ENSURE(aResult.check(aSeq), "Found Separator does not pass check ?!");
- }
- }
- else if (aElementType == SimpleTypeHelper::getBinaryType())
- {
- // only in strings we need to search a separator
- uno::Sequence< uno::Sequence<sal_Int8> > aSeq;
- OSL_VERIFY(aAny >>= aSeq);
-
- if (!canUseWhitespaceSeparator(aSeq))
- {
- aResult.setSeparator( ASCII(":") );
- }
- }
- }
-
- // DefaultSeparator
- return aResult;
-}
-#undef ASCII
-// -----------------------------------------------------------------------------
-static
-inline
-sal_Unicode hexNibble(sal_uInt8 _nNibble)
-{
- OSL_ASSERT(_nNibble <= 0x0F);
-
- const sal_uInt8 cDecOffset = sal_uInt8('0');
- const sal_uInt8 cHexOffset = sal_uInt8('a') - 10;
-
- return _nNibble + (_nNibble<10 ? cDecOffset : cHexOffset);
-}
-
-// -----------------------------------------------------------------------------
-static
-inline
-void appendHex(rtl::OUStringBuffer& rBuff, sal_uInt8 _nByte)
-{
- rBuff.append( hexNibble(_nByte >> 4) );
- rBuff.append( hexNibble(_nByte & 0x0f) );
-}
-
-// -----------------------------------------------------------------------------
-static
-rtl::OUString binaryToHex(const uno::Sequence<sal_Int8>& _aBinarySeq)
-{
- sal_Int32 const nLength = _aBinarySeq.getLength();
-
- rtl::OUStringBuffer sHex(2*nLength);
-
- for (sal_Int32 nPos = 0;nPos < nLength; ++nPos)
- {
- appendHex( sHex, _aBinarySeq[nPos] );
- }
-
- OSL_ASSERT(sHex.getLength() == 2*nLength);
- return sHex.makeStringAndClear();;
-}
-// -----------------------------------------------------------------------------
-rtl::OUString formatSimpleValue(uno::Any const & _aValue, uno::Reference< script::XTypeConverter > const & _xTCV)
-{
- rtl::OUString sResult;
-
- if (_aValue.hasValue())
- {
- if (_aValue .getValueType() == SimpleTypeHelper::getBinaryType())
- {
- uno::Sequence<sal_Int8> aBinarySeq;
-
- OSL_VERIFY(_aValue >>= aBinarySeq);
-
- sResult = binaryToHex(aBinarySeq);
- }
- else
- {
- // cannot have nested any
- OSL_ASSERT(_aValue.getValueTypeClass() != uno::TypeClass_ANY);
-
- sResult = toString(_xTCV, _aValue);
- }
- }
- return sResult;
-}
-
-// -----------------------------------------------------------------------------
-template <class Element_>
-rtl::OUString formatSequence(uno::Sequence< Element_ > const& aSequence, rtl::OUString const& sSeparator, uno::Reference< script::XTypeConverter > const & _xTCV)
-{
- rtl::OUStringBuffer aResult;
-
- if (sal_Int32 const nLength = aSequence.getLength())
- {
- Element_ const * pSeq = aSequence.getConstArray();
-
- aResult = formatSimpleValue( uno::makeAny(pSeq[0]),_xTCV);
-
- for(sal_Int32 i=1; i<nLength; ++i)
- {
- aResult.append( sSeparator );
- aResult.append( formatSimpleValue(uno::makeAny(pSeq[i]),_xTCV) );
- }
- }
-
- return aResult.makeStringAndClear();
-}
-// -----------------------------------------------------------------------------
-// template <> // optimized overload for String
-rtl::OUString formatSequence(uno::Sequence< rtl::OUString > const& aSequence, rtl::OUString const& sSeparator, uno::Reference< script::XTypeConverter > const & )
-{
- rtl::OUStringBuffer aResult;
-
- if (sal_Int32 const nLength = aSequence.getLength())
- {
- rtl::OUString const * pSeq = aSequence.getConstArray();
-
- aResult = pSeq[0];
-
- for(sal_Int32 i=1; i<nLength; ++i)
- {
- aResult.append( sSeparator ).append( pSeq[i] );
- }
- }
-
- return aResult.makeStringAndClear();
-}
-
-// -----------------------------------------------------------------------------
-
-#define CASE_WRITE_SEQUENCE(TYPE_CLASS, DATA_TYPE) \
- case TYPE_CLASS: \
- { \
- uno::Sequence< DATA_TYPE > aData; \
- OSL_ENSURE( ::getCppuType(static_cast< DATA_TYPE const*>(0)).getTypeClass() == (TYPE_CLASS), \
- "Usage Error for CASE_WRITE_SEQUENCE: Type extracted does not match type class"); \
- OSL_VERIFY( _aValue >>= aData ); \
- aResult = formatSequence(aData,sSeparator,xTCV); \
- } break \
-
-rtl::OUString formatSequenceValue(uno::Any const& _aValue, rtl::OUString const& sSeparator, uno::Reference< script::XTypeConverter > const & xTCV)
-{
- rtl::OUString aResult;
-
- uno::Type aElementType = getSequenceElementType( _aValue.getValueType() );
-
- switch(aElementType.getTypeClass())
- {
- CASE_WRITE_SEQUENCE( uno::TypeClass_BOOLEAN, sal_Bool );
-
- CASE_WRITE_SEQUENCE( uno::TypeClass_SHORT, sal_Int16 );
-
- CASE_WRITE_SEQUENCE( uno::TypeClass_LONG, sal_Int32 );
-
- CASE_WRITE_SEQUENCE( uno::TypeClass_HYPER, sal_Int64 );
-
- CASE_WRITE_SEQUENCE( uno::TypeClass_DOUBLE, double );
-
- CASE_WRITE_SEQUENCE( uno::TypeClass_STRING, rtl::OUString );
-
- CASE_WRITE_SEQUENCE( uno::TypeClass_SEQUENCE, uno::Sequence<sal_Int8> );
-
- default:
- OSL_ENSURE(false, "Unexpected typeclass for sequence elements");
- break;
- }
-
- return aResult;
-}
-
-#undef CASE_WRITE_SEQUENCE
-// -----------------------------------------------------------------------------
-} // anonymous namspace
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-static inline bool isListVal(uno::Any const & _aValue)
-{
- bool bList = false;
- if (_aValue.hasValue())
- {
- getBasicType(_aValue.getValueType(),bList);
- }
- return bList;
-}
-// -----------------------------------------------------------------------------
-void ValueFormatter::makeSeparator()
-{
- if (isListVal(m_aValue))
- {
- Separator aSeparator = createSeparator(m_aValue);
-
- m_sSeparator = aSeparator.value();
- m_bUseSeparator = !aSeparator.isDefault();
-
- OSL_POSTCOND( this->isList() , "ValueFormatter: Could not mark as list");
- }
- else
- {
- m_sSeparator = rtl::OUString();
- m_bUseSeparator = false;
-
- OSL_POSTCOND( !this->isList(), "ValueFormatter: Could not mark as non-list");
- }
-}
-// -----------------------------------------------------------------------------
-
-rtl::OUString ValueFormatter::getContent(uno::Reference< script::XTypeConverter > const & _xTCV) const
-{
- rtl::OUString aResult;
- try
- {
- if (this->isList())
- {
- aResult = formatSequenceValue(m_aValue, m_sSeparator, _xTCV);
- }
- else
- {
- aResult = formatSimpleValue(m_aValue, _xTCV);
- }
- }
- catch (script::CannotConvertException& cce)
- {
- rtl::OUString const sMessage(RTL_CONSTASCII_USTRINGPARAM("Configuration: Could not convert value to XML representation: "));
- throw uno::RuntimeException(sMessage + cce.Message, cce.Context);
- }
-
- return aResult;
-}
-// -----------------------------------------------------------------------------
-
-bool ValueFormatter::addValueAttributes(ElementFormatter & _rFormatter) const
-{
- // do we have a NULL value
- if (!m_aValue.hasValue())
- {
- _rFormatter.addIsNull();
- return false;
- }
-
- // create a sequence separator
- if (m_bUseSeparator)
- {
- OSL_ASSERT(this->isList());
- _rFormatter.addSeparator(m_sSeparator);
- }
-
- return true;
-}
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-} // namespace xml
-
-// -----------------------------------------------------------------------------
-} // namespace configmgr
-
-
diff --git a/configmgr/source/xml/valueformatter.hxx b/configmgr/source/xml/valueformatter.hxx
deleted file mode 100644
index 8994455807..0000000000
--- a/configmgr/source/xml/valueformatter.hxx
+++ /dev/null
@@ -1,81 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_XML_VALUEFORMATTER_HXX
-#define CONFIGMGR_XML_VALUEFORMATTER_HXX
-
-#include <com/sun/star/script/XTypeConverter.hpp>
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace xml
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace script= ::com::sun::star::script;
-// -----------------------------------------------------------------------------
- class ElementFormatter;
-// -----------------------------------------------------------------------------
-
- // Value to XML (String) conversions
- class ValueFormatter
- {
- public:
- explicit
- ValueFormatter(uno::Any const & _aValue)
- : m_aValue(_aValue)
- {
- makeSeparator();
- }
-
- void reset(uno::Any const & _aValue)
- { m_aValue = _aValue; makeSeparator(); }
-
- bool addValueAttributes(ElementFormatter & _rFormatter) const;
-
- bool hasContent() const;
-
- rtl::OUString getContent(uno::Reference< script::XTypeConverter > const & _xTCV) const;
-
- private:
- bool isList() const { return m_sSeparator.getLength() != 0; }
- void makeSeparator();
-
- uno::Any m_aValue;
- rtl::OUString m_sSeparator;
- bool m_bUseSeparator;
- };
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
- }
-// -----------------------------------------------------------------------------
-} // namespace
-
-#endif
diff --git a/configmgr/source/xml/writersvc.cxx b/configmgr/source/xml/writersvc.cxx
deleted file mode 100644
index 0fb0030ce5..0000000000
--- a/configmgr/source/xml/writersvc.cxx
+++ /dev/null
@@ -1,258 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "writersvc.hxx"
-
-#ifndef CONFIGMGR_API_FACTORY_HXX_
-#include "confapifactory.hxx"
-#endif
-#include <com/sun/star/configuration/backend/XLayerHandler.hpp>
-#include <com/sun/star/lang/WrappedTargetException.hpp>
-#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
-#include <com/sun/star/lang/IllegalArgumentException.hpp>
-
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace xml
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace io = ::com::sun::star::io;
- namespace sax = ::com::sun::star::xml::sax;
- namespace backenduno = ::com::sun::star::configuration::backend;
-// -----------------------------------------------------------------------------
-
-template <class BackendInterface>
-struct WriterServiceTraits;
-// -----------------------------------------------------------------------------
-static inline void clear(rtl::OUString & _rs) { _rs = rtl::OUString(); }
-
-// -----------------------------------------------------------------------------
-template <class BackendInterface>
-WriterService<BackendInterface>::WriterService(uno::Reference< uno::XComponentContext > const & _xContext)
-: m_xServiceFactory(_xContext->getServiceManager(), uno::UNO_QUERY)
-, m_xWriter()
-{
- if (!m_xServiceFactory.is())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration XML Writer: Context has no service manager"));
- throw uno::RuntimeException(sMessage,NULL);
- }
-}
-// -----------------------------------------------------------------------------
-
-// XInitialization
-template <class BackendInterface>
-void SAL_CALL
- WriterService<BackendInterface>::initialize( const uno::Sequence< uno::Any >& aArguments )
- throw (uno::Exception, uno::RuntimeException)
-{
- switch(aArguments.getLength())
- {
- case 0:
- {
- break;
- }
-
- case 1:
- {
- if (aArguments[0] >>= m_xWriter)
- break;
-
- uno::Reference< io::XOutputStream > xStream;
-
- if (aArguments[0] >>= xStream)
- {
- this->setOutputStream(xStream);
- break;
- }
-
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Cannot use argument to initialize a Configuration XML Writer"
- "- SAX XDocumentHandler or XOutputStream expected"));
- throw lang::IllegalArgumentException(sMessage,*this,1);
- }
- default:
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Too many arguments to initialize a Configuration Parser"));
- throw lang::IllegalArgumentException(sMessage,*this,0);
- }
- }
-}
-// -----------------------------------------------------------------------------
-
-template <class BackendInterface>
-inline
-ServiceInfoHelper WriterService<BackendInterface>::getServiceInfo()
-{
- return WriterServiceTraits<BackendInterface>::getServiceInfo();
-}
-// -----------------------------------------------------------------------------
-
-// XServiceInfo
-template <class BackendInterface>
-::rtl::OUString SAL_CALL
- WriterService<BackendInterface>::getImplementationName( )
- throw (uno::RuntimeException)
-{
- return getServiceInfo().getImplementationName( );
-}
-// -----------------------------------------------------------------------------
-
-template <class BackendInterface>
-sal_Bool SAL_CALL
- WriterService<BackendInterface>::supportsService( const ::rtl::OUString& ServiceName )
- throw (uno::RuntimeException)
-{
- return getServiceInfo().supportsService( ServiceName );
-}
-// -----------------------------------------------------------------------------
-
-template <class BackendInterface>
-uno::Sequence< ::rtl::OUString > SAL_CALL
- WriterService<BackendInterface>::getSupportedServiceNames( )
- throw (uno::RuntimeException)
-{
- return getServiceInfo().getSupportedServiceNames( );
-}
-// -----------------------------------------------------------------------------
-
-template <class BackendInterface>
-void SAL_CALL
- WriterService<BackendInterface>::setOutputStream( const uno::Reference< io::XOutputStream >& aStream )
- throw (uno::RuntimeException)
-{
- uno::Reference< io::XActiveDataSource > xDS( m_xWriter, uno::UNO_QUERY );
-
- if (xDS.is())
- {
- xDS->setOutputStream(aStream);
- }
- else
- {
- uno::Reference< sax::XDocumentHandler > xNewHandler = this->createHandler();
-
- xDS.set( xNewHandler, uno::UNO_QUERY );
- if (!xDS.is())
- {
- rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration XML Writer: Cannot set output stream to sax.Writer - missing interface XActiveDataSource."));
- throw uno::RuntimeException(sMessage,*this);
- }
- xDS->setOutputStream(aStream);
-
- m_xWriter = xNewHandler;
- }
-}
-// -----------------------------------------------------------------------------
-
-template <class BackendInterface>
-uno::Reference< io::XOutputStream > SAL_CALL
- WriterService<BackendInterface>::getOutputStream( )
- throw (uno::RuntimeException)
-{
- uno::Reference< io::XActiveDataSource > xDS( m_xWriter, uno::UNO_QUERY );
-
- return xDS.is()? xDS->getOutputStream() : uno::Reference< io::XOutputStream >();
-}
-// -----------------------------------------------------------------------------
-
-template <class BackendInterface>
-uno::Reference< sax::XDocumentHandler > WriterService<BackendInterface>::getWriteHandler()
- throw (uno::RuntimeException)
-{
- if (!m_xWriter.is())
- m_xWriter = this->createHandler();
-
- return m_xWriter;
-}
-
-// -----------------------------------------------------------------------------
-
-template <class BackendInterface>
-uno::Reference< sax::XDocumentHandler > WriterService<BackendInterface>::createHandler() const
- throw (uno::RuntimeException)
-{
- try
- {
- static rtl::OUString const k_sSaxWriterSvc( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Writer") );
-
- return uno::Reference< sax::XDocumentHandler >::query( getServiceFactory()->createInstance(k_sSaxWriterSvc) );
- }
- catch (uno::RuntimeException& ) { throw; }
- catch (uno::Exception& e)
- {
- lang::XInitialization * const pThis = const_cast<WriterService *>(this);
- throw lang::WrappedTargetRuntimeException(e.Message, pThis, uno::makeAny(e));
- }
-}
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-sal_Char const * const aLayerWriterServices[] =
-{
- "com.sun.star.configuration.backend.xml.LayerWriter",
- 0
-};
-extern // needed by SunCC 5.2, if used from template
-const ServiceImplementationInfo aLayerWriterSI =
-{
- "com.sun.star.comp.configuration.backend.xml.LayerWriter",
- aLayerWriterServices,
- 0
-};
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-template <>
-struct WriterServiceTraits< backenduno::XLayerHandler >
-{
- static ServiceImplementationInfo const * getServiceInfo()
- { return & aLayerWriterSI; }
-};
-// -----------------------------------------------------------------------------
-
-const ServiceRegistrationInfo* getLayerWriterServiceInfo()
-{ return getRegistrationInfo(& aLayerWriterSI); }
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-// instantiate here !
-template class WriterService< backenduno::XLayerHandler >;
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
- } // namespace
-
-// -----------------------------------------------------------------------------
-} // namespace
-
diff --git a/configmgr/source/xml/writersvc.hxx b/configmgr/source/xml/writersvc.hxx
deleted file mode 100644
index 949c36ee9a..0000000000
--- a/configmgr/source/xml/writersvc.hxx
+++ /dev/null
@@ -1,121 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONFIGMGR_XML_WRITERSVC_HXX
-#define CONFIGMGR_XML_WRITERSVC_HXX
-
-#include "serviceinfohelper.hxx"
-#include <cppuhelper/implbase4.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/io/XActiveDataSource.hpp>
-#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
-
-// -----------------------------------------------------------------------------
-
-namespace com { namespace sun { namespace star { namespace configuration { namespace backend {
- class XLayerHandler;
-} } } } }
-
-// -----------------------------------------------------------------------------
-
-namespace configmgr
-{
-// -----------------------------------------------------------------------------
- namespace xml
- {
-// -----------------------------------------------------------------------------
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
- namespace io = ::com::sun::star::io;
- namespace sax = ::com::sun::star::xml::sax;
-// -----------------------------------------------------------------------------
-
- template <class BackendInterface>
- class WriterService : public ::cppu::WeakImplHelper4<
- lang::XInitialization,
- lang::XServiceInfo,
- io::XActiveDataSource,
- BackendInterface
- >
- {
- public:
- explicit
- WriterService(uno::Reference< uno::XComponentContext > const & _xContext);
-
- // XInitialization
- virtual void SAL_CALL
- initialize( const uno::Sequence< uno::Any >& aArguments )
- throw (uno::Exception, uno::RuntimeException);
-
- // XServiceInfo
- virtual ::rtl::OUString SAL_CALL
- getImplementationName( )
- throw (uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL
- supportsService( const ::rtl::OUString& ServiceName )
- throw (uno::RuntimeException);
-
- virtual uno::Sequence< ::rtl::OUString > SAL_CALL
- getSupportedServiceNames( )
- throw (uno::RuntimeException);
-
- // XActiveDataSink
- virtual void SAL_CALL
- setOutputStream( const uno::Reference< io::XOutputStream >& aStream )
- throw (uno::RuntimeException);
-
- virtual uno::Reference< io::XOutputStream > SAL_CALL
- getOutputStream( )
- throw (uno::RuntimeException);
-
- protected:
- uno::Reference< lang::XMultiServiceFactory > getServiceFactory() const
- { return m_xServiceFactory; }
-
- uno::Reference< sax::XDocumentHandler > getWriteHandler() throw (uno::RuntimeException);
- private:
- uno::Reference< lang::XMultiServiceFactory > m_xServiceFactory;
- uno::Reference< sax::XDocumentHandler > m_xWriter;
-
- uno::Reference< sax::XDocumentHandler > createHandler() const throw (uno::RuntimeException);
-
- static ServiceInfoHelper getServiceInfo();
- };
-
-// -----------------------------------------------------------------------------
- } // namespace xml
-// -----------------------------------------------------------------------------
-
-} // namespace configmgr
-#endif
-
-
-
-
diff --git a/configmgr/source/xml/xmlstrings.cxx b/configmgr/source/xml/xmlstrings.cxx
deleted file mode 100644
index e5727c7222..0000000000
--- a/configmgr/source/xml/xmlstrings.cxx
+++ /dev/null
@@ -1,137 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "xmlstrings.hxx"
-
-//.........................................................................
-namespace configmgr
-{
-//.........................................................................
-
- namespace xml
- {
-//----------------------------------------------------------------------------
-// For now: Include the fixed OOR prefix into (most) attribute names
-#define OOR_PREFIX_ "oor:"
-// ... but not into (most) tag names
-#define OOR_TAG_PREFIX_
-// ... but into root tag names
-#define OOR_ROOTTAG_PREFIX_ OOR_PREFIX_
-//----------------------------------------------------------------------------
- // extern declaration for strings used in the XML format
- // namespace prefixes
- IMPLEMENT_CONSTASCII_USTRING(NS_PREFIX_OOR, "oor");
- IMPLEMENT_CONSTASCII_USTRING(NS_PREFIX_XS, "xs");
-
- // namespace urls
- IMPLEMENT_CONSTASCII_USTRING(NS_URI_OOR,"http://openoffice.org/2001/registry");
- IMPLEMENT_CONSTASCII_USTRING(NS_URI_XS, "http://www.w3.org/2001/XMLSchema");
-
- // tag names
- IMPLEMENT_CONSTASCII_USTRING(TAG_SCHEMA, OOR_ROOTTAG_PREFIX_"component-schema");
- IMPLEMENT_CONSTASCII_USTRING(TAG_LAYER, OOR_ROOTTAG_PREFIX_"component-data");
- IMPLEMENT_CONSTASCII_USTRING(DEPRECATED_TAG_LAYER, OOR_ROOTTAG_PREFIX_"node");
-
- IMPLEMENT_CONSTASCII_USTRING(TAG_COMPONENT, OOR_TAG_PREFIX_"component");
- IMPLEMENT_CONSTASCII_USTRING(TAG_TEMPLATES, OOR_TAG_PREFIX_"templates");
-
- IMPLEMENT_CONSTASCII_USTRING(TAG_NODE, OOR_TAG_PREFIX_"node");
- IMPLEMENT_CONSTASCII_USTRING(TAG_GROUP, OOR_TAG_PREFIX_"group");
- IMPLEMENT_CONSTASCII_USTRING(TAG_SET, OOR_TAG_PREFIX_"set");
- IMPLEMENT_CONSTASCII_USTRING(TAG_PROP, OOR_TAG_PREFIX_"prop");
-
- IMPLEMENT_CONSTASCII_USTRING(TAG_VALUE, OOR_TAG_PREFIX_"value");
- IMPLEMENT_CONSTASCII_USTRING(TAG_IMPORT, OOR_TAG_PREFIX_"import");
- IMPLEMENT_CONSTASCII_USTRING(TAG_INSTANCE, OOR_TAG_PREFIX_"node-ref");
- IMPLEMENT_CONSTASCII_USTRING(TAG_ITEMTYPE, OOR_TAG_PREFIX_"item");
- IMPLEMENT_CONSTASCII_USTRING(TAG_USES, OOR_TAG_PREFIX_"uses");
-
- // attribute names
- IMPLEMENT_CONSTASCII_USTRING(ATTR_NAME, OOR_PREFIX_"name");
- IMPLEMENT_CONSTASCII_USTRING(ATTR_CONTEXT, OOR_PREFIX_"context");
- IMPLEMENT_CONSTASCII_USTRING(ATTR_PACKAGE, OOR_PREFIX_"package");
- IMPLEMENT_CONSTASCII_USTRING(ATTR_COMPONENT,OOR_PREFIX_"component");
-
- IMPLEMENT_CONSTASCII_USTRING(ATTR_ITEMTYPE, OOR_PREFIX_"node-type");
- IMPLEMENT_CONSTASCII_USTRING(ATTR_ITEMTYPECOMPONENT,OOR_PREFIX_"component");
-
- IMPLEMENT_CONSTASCII_USTRING(ATTR_VALUETYPE, OOR_PREFIX_"type");
- IMPLEMENT_CONSTASCII_USTRING(ATTR_VALUESEPARATOR, OOR_PREFIX_"separator");
-
- IMPLEMENT_CONSTASCII_USTRING(ATTR_FLAG_EXTENSIBLE, OOR_PREFIX_"extensible");
- IMPLEMENT_CONSTASCII_USTRING(ATTR_FLAG_FINALIZED, OOR_PREFIX_"finalized");
- IMPLEMENT_CONSTASCII_USTRING(ATTR_FLAG_READONLY, OOR_PREFIX_"readonly");
- IMPLEMENT_CONSTASCII_USTRING(ATTR_FLAG_MANDATORY, OOR_PREFIX_"mandatory");
- IMPLEMENT_CONSTASCII_USTRING(ATTR_FLAG_NULLABLE, OOR_PREFIX_"nillable");
- IMPLEMENT_CONSTASCII_USTRING(ATTR_FLAG_LOCALIZED, OOR_PREFIX_"localized");
-
- IMPLEMENT_CONSTASCII_USTRING(ATTR_OPERATION, OOR_PREFIX_"op");
-
- // attributes defined elsewhere
- IMPLEMENT_CONSTASCII_USTRING(EXT_ATTR_LANGUAGE, "xml:lang");
- IMPLEMENT_CONSTASCII_USTRING(EXT_ATTR_NULL, "xsi:nil");
-
- // attribute contents
- // boolean constants
- IMPLEMENT_CONSTASCII_USTRING(ATTR_VALUE_TRUE, "true");
- IMPLEMENT_CONSTASCII_USTRING(ATTR_VALUE_FALSE, "false");
-
- // simple types names
- IMPLEMENT_CONSTASCII_USTRING(VALUETYPE_BOOLEAN, "boolean");
- IMPLEMENT_CONSTASCII_USTRING(VALUETYPE_SHORT, "short");
- IMPLEMENT_CONSTASCII_USTRING(VALUETYPE_INT, "int");
- IMPLEMENT_CONSTASCII_USTRING(VALUETYPE_LONG, "long");
- IMPLEMENT_CONSTASCII_USTRING(VALUETYPE_DOUBLE, "double");
- IMPLEMENT_CONSTASCII_USTRING(VALUETYPE_STRING, "string");
- // Type: Sequence<bytes>
- IMPLEMENT_CONSTASCII_USTRING(VALUETYPE_BINARY, "hexBinary");
- // Universal type: Any
- IMPLEMENT_CONSTASCII_USTRING(VALUETYPE_ANY, "any");
-
- // modifier suffix for list types
- IMPLEMENT_CONSTASCII_USTRING(VALUETYPE_LIST_SUFFIX, "-list");
-
- // States for update actions
- IMPLEMENT_CONSTASCII_USTRING(OPERATION_MODIFY, "modify");
- IMPLEMENT_CONSTASCII_USTRING(OPERATION_REPLACE, "replace");
- IMPLEMENT_CONSTASCII_USTRING(OPERATION_FUSE, "fuse");
- IMPLEMENT_CONSTASCII_USTRING(OPERATION_REMOVE, "remove");
-
- // the default separator for strings
- IMPLEMENT_CONSTASCII_USTRING(SEPARATOR_WHITESPACE, " ");
-
- // Needed for building attribute lists
- IMPLEMENT_CONSTASCII_USTRING(XML_ATTRTYPE_CDATA, "CDATA");
-
- } // namespace xml
-
-} // namespace configmgr
-
-
diff --git a/configmgr/source/xml/xmlstrings.hxx b/configmgr/source/xml/xmlstrings.hxx
deleted file mode 100644
index 5b6de2e4f1..0000000000
--- a/configmgr/source/xml/xmlstrings.hxx
+++ /dev/null
@@ -1,131 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONFIGMGR_XML_STRINGS_HXX_
-#define CONFIGMGR_XML_STRINGS_HXX_
-
-#include "strings.hxx"
-
-//.........................................................................
-namespace configmgr
-{
-//.........................................................................
-
- namespace xml
- {
- // extern declaration for strings used in the XML format
- // namespace prefixes
- DECLARE_CONSTASCII_USTRING(NS_PREFIX_OOR);
- DECLARE_CONSTASCII_USTRING(NS_PREFIX_XS);
-
- const sal_Unicode k_NS_SEPARATOR(':');
-
- // namespace urls
- DECLARE_CONSTASCII_USTRING(NS_URI_OOR);
- DECLARE_CONSTASCII_USTRING(NS_URI_XS);
- DECLARE_CONSTASCII_USTRING(NS_URI_XSI);
-
- // tag names
- DECLARE_CONSTASCII_USTRING(TAG_SCHEMA);
- DECLARE_CONSTASCII_USTRING(TAG_LAYER);
- DECLARE_CONSTASCII_USTRING(DEPRECATED_TAG_LAYER);
-
- DECLARE_CONSTASCII_USTRING(TAG_COMPONENT);
- DECLARE_CONSTASCII_USTRING(TAG_TEMPLATES);
-
- DECLARE_CONSTASCII_USTRING(TAG_NODE);
- DECLARE_CONSTASCII_USTRING(TAG_GROUP);
- DECLARE_CONSTASCII_USTRING(TAG_SET);
- DECLARE_CONSTASCII_USTRING(TAG_PROP);
-
- DECLARE_CONSTASCII_USTRING(TAG_IMPORT);
- DECLARE_CONSTASCII_USTRING(TAG_INSTANCE);
- DECLARE_CONSTASCII_USTRING(TAG_ITEMTYPE);
- DECLARE_CONSTASCII_USTRING(TAG_VALUE);
- DECLARE_CONSTASCII_USTRING(TAG_USES);
-
- // attribute names
- DECLARE_CONSTASCII_USTRING(ATTR_NAME);
- DECLARE_CONSTASCII_USTRING(ATTR_CONTEXT);
- DECLARE_CONSTASCII_USTRING(ATTR_PACKAGE);
- DECLARE_CONSTASCII_USTRING(ATTR_COMPONENT);
-
- DECLARE_CONSTASCII_USTRING(ATTR_ITEMTYPE);
- DECLARE_CONSTASCII_USTRING(ATTR_ITEMTYPECOMPONENT);
-
- DECLARE_CONSTASCII_USTRING(ATTR_VALUETYPE);
- DECLARE_CONSTASCII_USTRING(ATTR_VALUESEPARATOR);
-
- DECLARE_CONSTASCII_USTRING(ATTR_FLAG_EXTENSIBLE);
- DECLARE_CONSTASCII_USTRING(ATTR_FLAG_FINALIZED);
- DECLARE_CONSTASCII_USTRING(ATTR_FLAG_READONLY);
- DECLARE_CONSTASCII_USTRING(ATTR_FLAG_MANDATORY);
- DECLARE_CONSTASCII_USTRING(ATTR_FLAG_NULLABLE);
- DECLARE_CONSTASCII_USTRING(ATTR_FLAG_LOCALIZED);
-
- DECLARE_CONSTASCII_USTRING(ATTR_OPERATION);
-
- // attributes defined elsewhere
- DECLARE_CONSTASCII_USTRING(EXT_ATTR_LANGUAGE);
- DECLARE_CONSTASCII_USTRING(EXT_ATTR_NULL);
-
- // attribute contents
- // boolean constants
- DECLARE_CONSTASCII_USTRING(ATTR_VALUE_TRUE);
- DECLARE_CONSTASCII_USTRING(ATTR_VALUE_FALSE);
-
- // simple types names
- DECLARE_CONSTASCII_USTRING(VALUETYPE_BOOLEAN);
- DECLARE_CONSTASCII_USTRING(VALUETYPE_SHORT);
- DECLARE_CONSTASCII_USTRING(VALUETYPE_INT);
- DECLARE_CONSTASCII_USTRING(VALUETYPE_LONG);
- DECLARE_CONSTASCII_USTRING(VALUETYPE_DOUBLE);
- DECLARE_CONSTASCII_USTRING(VALUETYPE_STRING);
- // Type: Sequence<bytes>
- DECLARE_CONSTASCII_USTRING(VALUETYPE_BINARY);
- // Universal type: Any
- DECLARE_CONSTASCII_USTRING(VALUETYPE_ANY);
-
- // modifier suffix for list types
- DECLARE_CONSTASCII_USTRING(VALUETYPE_LIST_SUFFIX);
-
- // States for update actions
- DECLARE_CONSTASCII_USTRING(OPERATION_MODIFY);
- DECLARE_CONSTASCII_USTRING(OPERATION_REPLACE);
- DECLARE_CONSTASCII_USTRING(OPERATION_FUSE);
- DECLARE_CONSTASCII_USTRING(OPERATION_REMOVE);
-
- // the default separator for strings
- DECLARE_CONSTASCII_USTRING(SEPARATOR_WHITESPACE);
-
- // Needed for building attribute lists
- DECLARE_CONSTASCII_USTRING(XML_ATTRTYPE_CDATA);
-
- } // namespace xml
-
-} // namespace configmgr
-#endif
-
diff --git a/configmgr/source/xmldata.cxx b/configmgr/source/xmldata.cxx
new file mode 100644
index 0000000000..07ad4d17a3
--- /dev/null
+++ b/configmgr/source/xmldata.cxx
@@ -0,0 +1,204 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include <climits>
+#include <stack>
+
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "osl/diagnose.h"
+#include "osl/file.hxx"
+#include "rtl/ref.hxx"
+#include "rtl/strbuf.hxx"
+#include "rtl/string.h"
+#include "rtl/textcvt.h"
+#include "rtl/textenc.h"
+#include "rtl/ustrbuf.hxx"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+
+#include "data.hxx"
+#include "groupnode.hxx"
+#include "localizedpropertynode.hxx"
+#include "localizedvaluenode.hxx"
+#include "node.hxx"
+#include "nodemap.hxx"
+#include "parsemanager.hxx"
+#include "parser.hxx"
+#include "propertynode.hxx"
+#include "setnode.hxx"
+#include "span.hxx"
+#include "type.hxx"
+#include "xmlreader.hxx"
+
+namespace configmgr {
+
+namespace xmldata {
+
+namespace {
+
+namespace css = com::sun::star;
+
+}
+
+rtl::OUString convertFromUtf8(Span const & text) {
+ OSL_ASSERT(text.is());
+ rtl_uString * s = 0;
+ if (!rtl_convertStringToUString(
+ &s, text.begin, text.length, RTL_TEXTENCODING_UTF8,
+ (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR |
+ RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR |
+ RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR)))
+ {
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("cannot convert from UTF-8")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ return rtl::OUString(s, SAL_NO_ACQUIRE);
+}
+
+Type parseType(XmlReader const & reader, Span const & text) {
+ OSL_ASSERT(text.is());
+ sal_Int32 i = rtl_str_indexOfChar_WithLength(text.begin, text.length, ':');
+ if (i >= 0) {
+ switch (reader.getNamespace(Span(text.begin, i))) {
+ case XmlReader::NAMESPACE_OOR:
+ if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
+ RTL_CONSTASCII_STRINGPARAM("any")))
+ {
+ return TYPE_ANY;
+ } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
+ RTL_CONSTASCII_STRINGPARAM("boolean-list")))
+ {
+ return TYPE_BOOLEAN_LIST;
+ } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
+ RTL_CONSTASCII_STRINGPARAM("short-list")))
+ {
+ return TYPE_SHORT_LIST;
+ } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
+ RTL_CONSTASCII_STRINGPARAM("int-list")))
+ {
+ return TYPE_INT_LIST;
+ } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
+ RTL_CONSTASCII_STRINGPARAM("long-list")))
+ {
+ return TYPE_LONG_LIST;
+ } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
+ RTL_CONSTASCII_STRINGPARAM("double-list")))
+ {
+ return TYPE_DOUBLE_LIST;
+ } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
+ RTL_CONSTASCII_STRINGPARAM("string-list")))
+ {
+ return TYPE_STRING_LIST;
+ } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
+ RTL_CONSTASCII_STRINGPARAM("hexBinary-list")))
+ {
+ return TYPE_HEXBINARY_LIST;
+ }
+ break;
+ case XmlReader::NAMESPACE_XS:
+ if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
+ RTL_CONSTASCII_STRINGPARAM("boolean")))
+ {
+ return TYPE_BOOLEAN;
+ } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
+ RTL_CONSTASCII_STRINGPARAM("short")))
+ {
+ return TYPE_SHORT;
+ } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
+ RTL_CONSTASCII_STRINGPARAM("int")))
+ {
+ return TYPE_INT;
+ } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
+ RTL_CONSTASCII_STRINGPARAM("long")))
+ {
+ return TYPE_LONG;
+ } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
+ RTL_CONSTASCII_STRINGPARAM("double")))
+ {
+ return TYPE_DOUBLE;
+ } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
+ RTL_CONSTASCII_STRINGPARAM("string")))
+ {
+ return TYPE_STRING;
+ } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals(
+ RTL_CONSTASCII_STRINGPARAM("hexBinary")))
+ {
+ return TYPE_HEXBINARY;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("invalid type ")) +
+ convertFromUtf8(text)),
+ css::uno::Reference< css::uno::XInterface >());
+}
+
+bool parseBoolean(Span const & text) {
+ OSL_ASSERT(text.is());
+ if (text.equals(RTL_CONSTASCII_STRINGPARAM("true"))) {
+ return true;
+ }
+ if (text.equals(RTL_CONSTASCII_STRINGPARAM("false"))) {
+ return false;
+ }
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("invalid boolean ")) +
+ convertFromUtf8(text)),
+ css::uno::Reference< css::uno::XInterface >());
+}
+
+rtl::OUString parseTemplateReference(
+ rtl::OUString const & component, bool hasNodeType,
+ rtl::OUString const & nodeType, rtl::OUString const * defaultTemplateName)
+{
+ if (!hasNodeType) {
+ if (defaultTemplateName != 0) {
+ return *defaultTemplateName;
+ }
+ throw css::uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("missing node-type attribute")),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ return Data::fullTemplateName(component, nodeType);
+}
+
+}
+
+}
diff --git a/configmgr/source/xmldata.hxx b/configmgr/source/xmldata.hxx
new file mode 100644
index 0000000000..15a0a36336
--- /dev/null
+++ b/configmgr/source/xmldata.hxx
@@ -0,0 +1,58 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_XMLDATA_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_XMLDATA_HXX
+
+#include "sal/config.h"
+
+#include "type.hxx"
+
+namespace rtl { class OUString; }
+
+namespace configmgr {
+
+class XmlReader;
+struct Span;
+
+namespace xmldata {
+
+rtl::OUString convertFromUtf8(Span const & text);
+
+Type parseType(XmlReader const & reader, Span const & text);
+
+bool parseBoolean(Span const & text);
+
+rtl::OUString parseTemplateReference(
+ rtl::OUString const & component, bool hasNodeType,
+ rtl::OUString const & nodeType, rtl::OUString const * defaultTemplateName);
+
+}
+
+}
+
+#endif
diff --git a/configmgr/source/xmlreader.cxx b/configmgr/source/xmlreader.cxx
new file mode 100644
index 0000000000..ac6a08d186
--- /dev/null
+++ b/configmgr/source/xmlreader.cxx
@@ -0,0 +1,1054 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_configmgr.hxx"
+#include "sal/config.h"
+
+#include <cstddef>
+
+#include "com/sun/star/container/NoSuchElementException.hpp"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "osl/diagnose.h"
+#include "osl/file.h"
+#include "rtl/string.h"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+
+#include "pad.hxx"
+#include "span.hxx"
+#include "xmlreader.hxx"
+
+namespace configmgr {
+
+namespace {
+
+namespace css = com::sun::star;
+
+bool isSpace(char c) {
+ switch (c) {
+ case '\x09':
+ case '\x0A':
+ case '\x0D':
+ case ' ':
+ return true;
+ default:
+ return false;
+ }
+}
+
+}
+
+XmlReader::XmlReader(rtl::OUString const & fileUrl)
+ SAL_THROW((
+ css::container::NoSuchElementException, css::uno::RuntimeException)):
+ fileUrl_(fileUrl)
+{
+ switch (osl_openFile(fileUrl_.pData, &fileHandle_, osl_File_OpenFlag_Read))
+ {
+ case osl_File_E_None:
+ break;
+ case osl_File_E_NOENT:
+ throw css::container::NoSuchElementException(
+ fileUrl_, css::uno::Reference< css::uno::XInterface >());
+ default:
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("cannot open ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ oslFileError e = osl_getFileSize(fileHandle_, &fileSize_);
+ if (e == osl_File_E_None) {
+ e = osl_mapFile(
+ fileHandle_, &fileAddress_, fileSize_, 0,
+ osl_File_MapFlag_WillNeed);
+ }
+ if (e != osl_File_E_None) {
+ e = osl_closeFile(fileHandle_);
+ if (e != osl_File_E_None) {
+ OSL_TRACE("osl_closeFile failed with %ld", static_cast< long >(e));
+ }
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("cannot mmap ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ namespaces_.push_back(
+ NamespaceData(Span(RTL_CONSTASCII_STRINGPARAM("xml")), NAMESPACE_XML));
+ namespaces_.push_back(
+ NamespaceData(Span(RTL_CONSTASCII_STRINGPARAM("xsi")), NAMESPACE_XSI));
+ // old user layer .xcu files used the xsi namespace prefix without
+ // declaring a corresponding namespace binding, see issue 77174; reading
+ // those files during migration would fail without this hack that can be
+ // removed once migration is no longer relevant (see
+ // Components::parseModificationLayer)
+ pos_ = static_cast< char * >(fileAddress_);
+ end_ = pos_ + fileSize_;
+ state_ = STATE_CONTENT;
+}
+
+XmlReader::~XmlReader() {
+ oslFileError e = osl_unmapFile(fileAddress_, fileSize_);
+ if (e != osl_File_E_None) {
+ OSL_TRACE("osl_unmapFile failed with %ld", static_cast< long >(e));
+ }
+ e = osl_closeFile(fileHandle_);
+ if (e != osl_File_E_None) {
+ OSL_TRACE("osl_closeFile failed with %ld", static_cast< long >(e));
+ }
+}
+
+XmlReader::Result XmlReader::nextItem(
+ Text reportText, Span * data, Namespace * ns)
+{
+ switch (state_) {
+ case STATE_CONTENT:
+ switch (reportText) {
+ case TEXT_NONE:
+ return handleSkippedText(data, ns);
+ case TEXT_RAW:
+ return handleRawText(data);
+ case TEXT_NORMALIZED:
+ return handleNormalizedText(data);
+ }
+ case STATE_START_TAG:
+ return handleStartTag(ns, data);
+ case STATE_END_TAG:
+ return handleEndTag();
+ case STATE_EMPTY_ELEMENT_TAG:
+ handleElementEnd();
+ return RESULT_END;
+ default: // STATE_DONE
+ return RESULT_DONE;
+ }
+}
+
+bool XmlReader::nextAttribute(Namespace * ns, Span * localName) {
+ OSL_ASSERT(ns != 0 && localName != 0);
+ if (firstAttribute_) {
+ currentAttribute_ = attributes_.begin();
+ firstAttribute_ = false;
+ } else {
+ ++currentAttribute_;
+ }
+ if (currentAttribute_ == attributes_.end()) {
+ return false;
+ }
+ if (currentAttribute_->nameColon == 0) {
+ *ns = NAMESPACE_NONE;
+ *localName = Span(
+ currentAttribute_->nameBegin,
+ currentAttribute_->nameEnd - currentAttribute_->nameBegin);
+ } else {
+ *ns = getNamespace(
+ Span(
+ currentAttribute_->nameBegin,
+ currentAttribute_->nameColon - currentAttribute_->nameBegin));
+ *localName = Span(
+ currentAttribute_->nameColon + 1,
+ currentAttribute_->nameEnd - (currentAttribute_->nameColon + 1));
+ }
+ return true;
+}
+
+Span XmlReader::getAttributeValue(bool fullyNormalize) {
+ return handleAttributeValue(
+ currentAttribute_->valueBegin, currentAttribute_->valueEnd,
+ fullyNormalize);
+}
+
+XmlReader::Namespace XmlReader::getNamespace(Span const & prefix) const {
+ for (NamespaceList::const_reverse_iterator i(namespaces_.rbegin());
+ i != namespaces_.rend(); ++i)
+ {
+ if (prefix.equals(i->prefix)) {
+ return i->ns;
+ }
+ }
+ return NAMESPACE_OTHER;
+}
+
+rtl::OUString XmlReader::getUrl() const {
+ return fileUrl_;
+}
+
+void XmlReader::normalizeLineEnds(Span const & text) {
+ char const * p = text.begin;
+ sal_Int32 n = text.length;
+ for (;;) {
+ sal_Int32 i = rtl_str_indexOfChar_WithLength(p, n, '\x0D');
+ if (i < 0) {
+ break;
+ }
+ pad_.add(p, i);
+ p += i + 1;
+ n -= i + 1;
+ if (n == 0 || *p != '\x0A') {
+ pad_.add(RTL_CONSTASCII_STRINGPARAM("\x0A"));
+ }
+ }
+ pad_.add(p, n);
+}
+
+void XmlReader::skipSpace() {
+ while (isSpace(peek())) {
+ ++pos_;
+ }
+}
+
+bool XmlReader::skipComment() {
+ if (rtl_str_shortenedCompare_WithLength(
+ pos_, end_ - pos_, RTL_CONSTASCII_STRINGPARAM("--"),
+ RTL_CONSTASCII_LENGTH("--")) !=
+ 0)
+ {
+ return false;
+ }
+ pos_ += RTL_CONSTASCII_LENGTH("--");
+ sal_Int32 i = rtl_str_indexOfStr_WithLength(
+ pos_, end_ - pos_, RTL_CONSTASCII_STRINGPARAM("--"));
+ if (i < 0) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "premature end (within comment) of ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ pos_ += i + RTL_CONSTASCII_LENGTH("--");
+ if (read() != '>') {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "illegal \"--\" within comment in ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ return true;
+}
+
+void XmlReader::skipProcessingInstruction() {
+ sal_Int32 i = rtl_str_indexOfStr_WithLength(
+ pos_, end_ - pos_, RTL_CONSTASCII_STRINGPARAM("?>"));
+ if (i < 0) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad '<?' in ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ pos_ += i + RTL_CONSTASCII_LENGTH("?>");
+}
+
+void XmlReader::skipDocumentTypeDeclaration() {
+ // Neither is it checked that the doctypedecl is at the correct position in
+ // the document, nor that it is well-formed:
+ for (;;) {
+ char c = read();
+ switch (c) {
+ case '\0': // i.e., EOF
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "premature end (within DTD) of ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ case '"':
+ case '\'':
+ {
+ sal_Int32 i = rtl_str_indexOfChar_WithLength(
+ pos_, end_ - pos_, c);
+ if (i < 0) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "premature end (within DTD) of ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ pos_ += i + 1;
+ }
+ break;
+ case '>':
+ return;
+ case '[':
+ for (;;) {
+ c = read();
+ switch (c) {
+ case '\0': // i.e., EOF
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "premature end (within DTD) of ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ case '"':
+ case '\'':
+ {
+ sal_Int32 i = rtl_str_indexOfChar_WithLength(
+ pos_, end_ - pos_, c);
+ if (i < 0) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "premature end (within DTD) of ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ pos_ += i + 1;
+ }
+ break;
+ case '<':
+ switch (read()) {
+ case '\0': // i.e., EOF
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "premature end (within DTD) of ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ case '!':
+ skipComment();
+ break;
+ case '?':
+ skipProcessingInstruction();
+ break;
+ default:
+ break;
+ }
+ break;
+ case ']':
+ skipSpace();
+ if (read() != '>') {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "missing \">\" of DTD in ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ return;
+ default:
+ break;
+ }
+ }
+ default:
+ break;
+ }
+ }
+}
+
+Span XmlReader::scanCdataSection() {
+ if (rtl_str_shortenedCompare_WithLength(
+ pos_, end_ - pos_, RTL_CONSTASCII_STRINGPARAM("[CDATA["),
+ RTL_CONSTASCII_LENGTH("[CDATA[")) !=
+ 0)
+ {
+ return Span();
+ }
+ pos_ += RTL_CONSTASCII_LENGTH("[CDATA[");
+ char const * begin = pos_;
+ sal_Int32 i = rtl_str_indexOfStr_WithLength(
+ pos_, end_ - pos_, RTL_CONSTASCII_STRINGPARAM("]]>"));
+ if (i < 0) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "premature end (within CDATA section) of ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ pos_ += i + RTL_CONSTASCII_LENGTH("]]>");
+ return Span(begin, i);
+}
+
+bool XmlReader::scanName(char const ** nameColon) {
+ OSL_ASSERT(nameColon != 0 && *nameColon == 0);
+ for (char const * begin = pos_;; ++pos_) {
+ switch (peek()) {
+ case '\0': // i.e., EOF
+ case '\x09':
+ case '\x0A':
+ case '\x0D':
+ case ' ':
+ case '/':
+ case '=':
+ case '>':
+ return pos_ != begin;
+ case ':':
+ *nameColon = pos_;
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+XmlReader::Namespace XmlReader::scanNamespaceIri(
+ char const * begin, char const * end)
+{
+ OSL_ASSERT(begin != 0 && begin <= end);
+ Span iri(handleAttributeValue(begin, end, false));
+ struct Iri {
+ char const * begin;
+ sal_Int32 length;
+ XmlReader::Namespace ns;
+ };
+ static Iri const iris[] = {
+ { RTL_CONSTASCII_STRINGPARAM("http://openoffice.org/2001/registry"),
+ XmlReader::NAMESPACE_OOR },
+ { RTL_CONSTASCII_STRINGPARAM("http://www.w3.org/2001/XMLSchema"),
+ XmlReader::NAMESPACE_XS },
+ { RTL_CONSTASCII_STRINGPARAM(
+ "http://www.w3.org/2001/XMLSchema-instance"),
+ XmlReader::NAMESPACE_XSI },
+ { RTL_CONSTASCII_STRINGPARAM("http://www.w3.org/XML/1998/namespace"),
+ XmlReader::NAMESPACE_XML } };
+ for (std::size_t i = 0; i < sizeof iris / sizeof iris[0]; ++i) {
+ if (rtl_str_compare_WithLength(
+ iri.begin, iri.length, iris[i].begin, iris[i].length) ==
+ 0)
+ {
+ return iris[i].ns;
+ }
+ }
+ return XmlReader::NAMESPACE_OTHER;
+}
+
+char const * XmlReader::handleReference(char const * position, char const * end)
+{
+ OSL_ASSERT(position != 0 && *position == '&' && position < end);
+ ++position;
+ if (*position == '#') {
+ ++position;
+ sal_Int32 val = 0;
+ char const * p;
+ if (*position == 'x') {
+ ++position;
+ p = position;
+ for (;; ++position) {
+ char c = *position;
+ if (c >= '0' && c <= '9') {
+ val = 16 * val + (c - '0');
+ } else if (c >= 'A' && c <= 'F') {
+ val = 16 * val + (c - 'A') + 10;
+ } else if (c >= 'a' && c <= 'f') {
+ val = 16 * val + (c - 'a') + 10;
+ } else {
+ break;
+ }
+ if (val > 0x10FFFF) { // avoid overflow
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "'&#x...' too large in ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ }
+ } else {
+ p = position;
+ for (;; ++position) {
+ char c = *position;
+ if (c >= '0' && c <= '9') {
+ val = 10 * val + (c - '0');
+ } else {
+ break;
+ }
+ if (val > 0x10FFFF) { // avoid overflow
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "'&#...' too large in ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ }
+ }
+ if (position == p || *position++ != ';') {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("'&#...' missing ';' in ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ OSL_ASSERT(val >= 0 && val <= 0x10FFFF);
+ if ((val < 0x20 && val != 0x9 && val != 0xA && val != 0xD) ||
+ (val >= 0xD800 && val <= 0xDFFF) || val == 0xFFFE || val == 0xFFFF)
+ {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "character reference denoting invalid character in ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ char buf[4];
+ sal_Int32 len;
+ if (val < 0x80) {
+ buf[0] = static_cast< char >(val);
+ len = 1;
+ } else if (val < 0x800) {
+ buf[0] = static_cast< char >((val >> 6) | 0xC0);
+ buf[1] = static_cast< char >((val & 0x3F) | 0x80);
+ len = 2;
+ } else if (val < 0x10000) {
+ buf[0] = static_cast< char >((val >> 12) | 0xE0);
+ buf[1] = static_cast< char >(((val >> 6) & 0x3F) | 0x80);
+ buf[2] = static_cast< char >((val & 0x3F) | 0x80);
+ len = 3;
+ } else {
+ buf[0] = static_cast< char >((val >> 18) | 0xF0);
+ buf[1] = static_cast< char >(((val >> 12) & 0x3F) | 0x80);
+ buf[2] = static_cast< char >(((val >> 6) & 0x3F) | 0x80);
+ buf[3] = static_cast< char >((val & 0x3F) | 0x80);
+ len = 4;
+ }
+ pad_.addEphemeral(buf, len);
+ return position;
+ } else {
+ struct EntityRef {
+ char const * inBegin;
+ sal_Int32 inLength;
+ char const * outBegin;
+ sal_Int32 outLength;
+ };
+ static EntityRef const refs[] = {
+ { RTL_CONSTASCII_STRINGPARAM("amp;"),
+ RTL_CONSTASCII_STRINGPARAM("&") },
+ { RTL_CONSTASCII_STRINGPARAM("lt;"),
+ RTL_CONSTASCII_STRINGPARAM("<") },
+ { RTL_CONSTASCII_STRINGPARAM("gt;"),
+ RTL_CONSTASCII_STRINGPARAM(">") },
+ { RTL_CONSTASCII_STRINGPARAM("apos;"),
+ RTL_CONSTASCII_STRINGPARAM("'") },
+ { RTL_CONSTASCII_STRINGPARAM("quot;"),
+ RTL_CONSTASCII_STRINGPARAM("\"") } };
+ for (std::size_t i = 0; i < sizeof refs / sizeof refs[0]; ++i) {
+ if (rtl_str_shortenedCompare_WithLength(
+ position, end - position, refs[i].inBegin, refs[i].inLength,
+ refs[i].inLength) ==
+ 0)
+ {
+ position += refs[i].inLength;
+ pad_.add(refs[i].outBegin, refs[i].outLength);
+ return position;
+ }
+ }
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("unknown entity reference in ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+}
+
+Span XmlReader::handleAttributeValue(
+ char const * begin, char const * end, bool fullyNormalize)
+{
+ pad_.clear();
+ if (fullyNormalize) {
+ while (begin != end && isSpace(*begin)) {
+ ++begin;
+ }
+ while (end != begin && isSpace(end[-1])) {
+ --end;
+ }
+ char const * p = begin;
+ enum Space { SPACE_NONE, SPACE_SPAN, SPACE_BREAK };
+ // a single true space character can go into the current span,
+ // everything else breaks the span
+ Space space = SPACE_NONE;
+ while (p != end) {
+ switch (*p) {
+ case '\x09':
+ case '\x0A':
+ case '\x0D':
+ switch (space) {
+ case SPACE_NONE:
+ pad_.add(begin, p - begin);
+ pad_.add(RTL_CONSTASCII_STRINGPARAM(" "));
+ space = SPACE_BREAK;
+ break;
+ case SPACE_SPAN:
+ pad_.add(begin, p - begin);
+ space = SPACE_BREAK;
+ break;
+ case SPACE_BREAK:
+ break;
+ }
+ begin = ++p;
+ break;
+ case ' ':
+ switch (space) {
+ case SPACE_NONE:
+ ++p;
+ space = SPACE_SPAN;
+ break;
+ case SPACE_SPAN:
+ pad_.add(begin, p - begin);
+ begin = ++p;
+ space = SPACE_BREAK;
+ break;
+ case SPACE_BREAK:
+ begin = ++p;
+ break;
+ }
+ break;
+ case '&':
+ pad_.add(begin, p - begin);
+ p = handleReference(p, end);
+ begin = p;
+ space = SPACE_NONE;
+ break;
+ default:
+ ++p;
+ space = SPACE_NONE;
+ break;
+ }
+ }
+ pad_.add(begin, p - begin);
+ } else {
+ char const * p = begin;
+ while (p != end) {
+ switch (*p) {
+ case '\x09':
+ case '\x0A':
+ pad_.add(begin, p - begin);
+ begin = ++p;
+ pad_.add(RTL_CONSTASCII_STRINGPARAM(" "));
+ break;
+ case '\x0D':
+ pad_.add(begin, p - begin);
+ ++p;
+ if (peek() == '\x0A') {
+ ++p;
+ }
+ begin = p;
+ pad_.add(RTL_CONSTASCII_STRINGPARAM(" "));
+ break;
+ case '&':
+ pad_.add(begin, p - begin);
+ p = handleReference(p, end);
+ begin = p;
+ break;
+ default:
+ ++p;
+ break;
+ }
+ }
+ pad_.add(begin, p - begin);
+ }
+ return pad_.get();
+}
+
+XmlReader::Result XmlReader::handleStartTag(Namespace * ns, Span * localName) {
+ OSL_ASSERT(ns != 0 && localName);
+ char const * nameBegin = pos_;
+ char const * nameColon = 0;
+ if (!scanName(&nameColon)) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad tag name in ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ char const * nameEnd = pos_;
+ NamespaceList::size_type inheritedNamespaces = namespaces_.size();
+ bool hasDefaultNs = false;
+ Namespace defaultNs = NAMESPACE_NONE;
+ attributes_.clear();
+ for (;;) {
+ char const * p = pos_;
+ skipSpace();
+ if (peek() == '/' || peek() == '>') {
+ break;
+ }
+ if (pos_ == p) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "missing whitespace before attribute in ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ char const * attrNameBegin = pos_;
+ char const * attrNameColon = 0;
+ if (!scanName(&attrNameColon)) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("bad attribute name in ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ char const * attrNameEnd = pos_;
+ skipSpace();
+ if (read() != '=') {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("missing '=' in ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ skipSpace();
+ char del = read();
+ if (del != '\'' && del != '"') {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("bad attribute value in ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ char const * valueBegin = pos_;
+ sal_Int32 i = rtl_str_indexOfChar_WithLength(pos_, end_ - pos_, del);
+ if (i < 0) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "unterminated attribute value in ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ char const * valueEnd = pos_ + i;
+ pos_ += i + 1;
+ if (attrNameColon == 0 &&
+ Span(attrNameBegin, attrNameEnd - attrNameBegin).equals(
+ RTL_CONSTASCII_STRINGPARAM("xmlns")))
+ {
+ hasDefaultNs = true;
+ defaultNs = scanNamespaceIri(valueBegin, valueEnd);
+ } else if (attrNameColon != 0 &&
+ Span(attrNameBegin, attrNameColon - attrNameBegin).equals(
+ RTL_CONSTASCII_STRINGPARAM("xmlns")))
+ {
+ namespaces_.push_back(
+ NamespaceData(
+ Span(attrNameColon + 1, attrNameEnd - (attrNameColon + 1)),
+ scanNamespaceIri(valueBegin, valueEnd)));
+ } else {
+ attributes_.push_back(
+ AttributeData(
+ attrNameBegin, attrNameEnd, attrNameColon, valueBegin,
+ valueEnd));
+ }
+ }
+ if (!hasDefaultNs && !elements_.empty()) {
+ defaultNs = elements_.top().defaultNamespace;
+ }
+ firstAttribute_ = true;
+ if (peek() == '/') {
+ state_ = STATE_EMPTY_ELEMENT_TAG;
+ ++pos_;
+ } else {
+ state_ = STATE_CONTENT;
+ }
+ if (peek() != '>') {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("missing '>' in ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ ++pos_;
+ elements_.push(
+ ElementData(
+ Span(nameBegin, nameEnd - nameBegin), inheritedNamespaces,
+ defaultNs));
+ if (nameColon == 0) {
+ *ns = defaultNs;
+ *localName = Span(nameBegin, nameEnd - nameBegin);
+ } else {
+ *ns = getNamespace(Span(nameBegin, nameColon - nameBegin));
+ *localName = Span(nameColon + 1, nameEnd - (nameColon + 1));
+ }
+ return RESULT_BEGIN;
+}
+
+XmlReader::Result XmlReader::handleEndTag() {
+ if (elements_.empty()) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("spurious end tag in ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ char const * nameBegin = pos_;
+ char const * nameColon = 0;
+ if (!scanName(&nameColon) ||
+ !elements_.top().name.equals(nameBegin, pos_ - nameBegin))
+ {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("tag mismatch in ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ handleElementEnd();
+ skipSpace();
+ if (peek() != '>') {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("missing '>' in ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ ++pos_;
+ return RESULT_END;
+}
+
+void XmlReader::handleElementEnd() {
+ OSL_ASSERT(!elements_.empty());
+ namespaces_.resize(elements_.top().inheritedNamespaces);
+ elements_.pop();
+ state_ = elements_.empty() ? STATE_DONE : STATE_CONTENT;
+}
+
+XmlReader::Result XmlReader::handleSkippedText(Span * data, Namespace * ns) {
+ for (;;) {
+ sal_Int32 i = rtl_str_indexOfChar_WithLength(pos_, end_ - pos_, '<');
+ if (i < 0) {
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("premature end of ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ }
+ pos_ += i + 1;
+ switch (peek()) {
+ case '!':
+ ++pos_;
+ if (!skipComment() && !scanCdataSection().is()) {
+ skipDocumentTypeDeclaration();
+ }
+ break;
+ case '/':
+ ++pos_;
+ return handleEndTag();
+ case '?':
+ ++pos_;
+ skipProcessingInstruction();
+ break;
+ default:
+ return handleStartTag(ns, data);
+ }
+ }
+}
+
+XmlReader::Result XmlReader::handleRawText(Span * text) {
+ pad_.clear();
+ for (char const * begin = pos_;;) {
+ switch (peek()) {
+ case '\0': // i.e., EOF
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("premature end of ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ case '\x0D':
+ pad_.add(begin, pos_ - begin);
+ ++pos_;
+ if (peek() != '\x0A') {
+ pad_.add(RTL_CONSTASCII_STRINGPARAM("\x0A"));
+ }
+ begin = pos_;
+ break;
+ case '&':
+ pad_.add(begin, pos_ - begin);
+ pos_ = handleReference(pos_, end_);
+ begin = pos_;
+ break;
+ case '<':
+ pad_.add(begin, pos_ - begin);
+ ++pos_;
+ switch (peek()) {
+ case '!':
+ ++pos_;
+ if (!skipComment()) {
+ Span cdata(scanCdataSection());
+ if (cdata.is()) {
+ normalizeLineEnds(cdata);
+ } else {
+ skipDocumentTypeDeclaration();
+ }
+ }
+ begin = pos_;
+ break;
+ case '/':
+ *text = pad_.get();
+ ++pos_;
+ state_ = STATE_END_TAG;
+ return RESULT_TEXT;
+ case '?':
+ ++pos_;
+ skipProcessingInstruction();
+ begin = pos_;
+ break;
+ default:
+ *text = pad_.get();
+ state_ = STATE_START_TAG;
+ return RESULT_TEXT;
+ }
+ break;
+ default:
+ ++pos_;
+ break;
+ }
+ }
+}
+
+XmlReader::Result XmlReader::handleNormalizedText(Span * text) {
+ pad_.clear();
+ char const * flowBegin = pos_;
+ char const * flowEnd = pos_;
+ enum Space { SPACE_START, SPACE_NONE, SPACE_SPAN, SPACE_BREAK };
+ // a single true space character can go into the current flow,
+ // everything else breaks the flow
+ Space space = SPACE_START;
+ for (;;) {
+ switch (peek()) {
+ case '\0': // i.e., EOF
+ throw css::uno::RuntimeException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("premature end of ")) +
+ fileUrl_),
+ css::uno::Reference< css::uno::XInterface >());
+ case '\x09':
+ case '\x0A':
+ case '\x0D':
+ switch (space) {
+ case SPACE_START:
+ case SPACE_BREAK:
+ break;
+ case SPACE_NONE:
+ case SPACE_SPAN:
+ space = SPACE_BREAK;
+ break;
+ }
+ ++pos_;
+ break;
+ case ' ':
+ switch (space) {
+ case SPACE_START:
+ case SPACE_BREAK:
+ break;
+ case SPACE_NONE:
+ space = SPACE_SPAN;
+ break;
+ case SPACE_SPAN:
+ space = SPACE_BREAK;
+ break;
+ }
+ ++pos_;
+ break;
+ case '&':
+ switch (space) {
+ case SPACE_START:
+ break;
+ case SPACE_NONE:
+ case SPACE_SPAN:
+ pad_.add(flowBegin, pos_ - flowBegin);
+ break;
+ case SPACE_BREAK:
+ pad_.add(flowBegin, flowEnd - flowBegin);
+ pad_.add(RTL_CONSTASCII_STRINGPARAM(" "));
+ break;
+ }
+ pos_ = handleReference(pos_, end_);
+ flowBegin = pos_;
+ flowEnd = pos_;
+ space = SPACE_NONE;
+ break;
+ case '<':
+ ++pos_;
+ switch (peek()) {
+ case '!':
+ ++pos_;
+ if (skipComment()) {
+ space = SPACE_BREAK;
+ } else {
+ Span cdata(scanCdataSection());
+ if (cdata.is()) {
+ // CDATA is not normalized (similar to character
+ // references; it keeps the code simple), but it might
+ // arguably be better to normalize it:
+ switch (space) {
+ case SPACE_START:
+ break;
+ case SPACE_NONE:
+ case SPACE_SPAN:
+ pad_.add(flowBegin, pos_ - flowBegin);
+ break;
+ case SPACE_BREAK:
+ pad_.add(flowBegin, flowEnd - flowBegin);
+ pad_.add(RTL_CONSTASCII_STRINGPARAM(" "));
+ break;
+ }
+ normalizeLineEnds(cdata);
+ flowBegin = pos_;
+ flowEnd = pos_;
+ space = SPACE_NONE;
+ } else {
+ skipDocumentTypeDeclaration();
+ }
+ }
+ break;
+ case '/':
+ ++pos_;
+ pad_.add(flowBegin, flowEnd - flowBegin);
+ *text = pad_.get();
+ state_ = STATE_END_TAG;
+ return RESULT_TEXT;
+ case '?':
+ ++pos_;
+ skipProcessingInstruction();
+ space = SPACE_BREAK;
+ break;
+ default:
+ pad_.add(flowBegin, flowEnd - flowBegin);
+ *text = pad_.get();
+ state_ = STATE_START_TAG;
+ return RESULT_TEXT;
+ }
+ break;
+ default:
+ switch (space) {
+ case SPACE_START:
+ flowBegin = pos_;
+ break;
+ case SPACE_NONE:
+ case SPACE_SPAN:
+ break;
+ case SPACE_BREAK:
+ pad_.add(flowBegin, flowEnd - flowBegin);
+ pad_.add(RTL_CONSTASCII_STRINGPARAM(" "));
+ flowBegin = pos_;
+ break;
+ }
+ flowEnd = ++pos_;
+ space = SPACE_NONE;
+ break;
+ }
+ }
+}
+
+}
diff --git a/configmgr/source/xmlreader.hxx b/configmgr/source/xmlreader.hxx
new file mode 100644
index 0000000000..83ccac148c
--- /dev/null
+++ b/configmgr/source/xmlreader.hxx
@@ -0,0 +1,186 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_CONFIGMGR_SOURCE_XMLREADER_HXX
+#define INCLUDED_CONFIGMGR_SOURCE_XMLREADER_HXX
+
+#include "sal/config.h"
+
+#include <stack>
+#include <vector>
+
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/container/NoSuchElementException.hpp"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "osl/file.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+
+#include "pad.hxx"
+#include "span.hxx"
+
+namespace configmgr {
+
+class XmlReader: private boost::noncopyable {
+public:
+ explicit XmlReader(rtl::OUString const & fileUrl)
+ SAL_THROW((
+ com::sun::star::container::NoSuchElementException,
+ com::sun::star::uno::RuntimeException));
+
+ ~XmlReader();
+
+ enum Namespace {
+ NAMESPACE_NONE, NAMESPACE_XML, NAMESPACE_OOR, NAMESPACE_XS,
+ NAMESPACE_XSI, NAMESPACE_OTHER };
+
+ enum Text { TEXT_NONE, TEXT_RAW, TEXT_NORMALIZED };
+
+ enum Result { RESULT_BEGIN, RESULT_END, RESULT_TEXT, RESULT_DONE };
+
+ // RESULT_BEGIN: data = localName, ns = ns
+ // RESULT_END: data, ns unused
+ // RESULT_TEXT: data = text, ns unused
+ Result nextItem(Text reportText, Span * data, Namespace * ns);
+
+ bool nextAttribute(Namespace * ns, Span * localName);
+
+ // the span returned by getAttributeValue is only valid until the next call
+ // to nextItem or getAttributeValue
+ Span getAttributeValue(bool fullyNormalize);
+
+ Namespace getNamespace(Span const & prefix) const;
+
+ rtl::OUString getUrl() const;
+
+private:
+ inline char read() { return pos_ == end_ ? '\0' : *pos_++; }
+
+ inline char peek() { return pos_ == end_ ? '\0' : *pos_; }
+
+ void normalizeLineEnds(Span const & text);
+
+ void skipSpace();
+
+ bool skipComment();
+
+ void skipProcessingInstruction();
+
+ void skipDocumentTypeDeclaration();
+
+ Span scanCdataSection();
+
+ bool scanName(char const ** nameColon);
+
+ Namespace scanNamespaceIri(char const * begin, char const * end);
+
+ char const * handleReference(char const * position, char const * end);
+
+ Span handleAttributeValue(
+ char const * begin, char const * end, bool fullyNormalize);
+
+ Result handleStartTag(Namespace * ns, Span * localName);
+
+ Result handleEndTag();
+
+ void handleElementEnd();
+
+ Result handleSkippedText(Span * data, Namespace * ns);
+
+ Result handleRawText(Span * text);
+
+ Result handleNormalizedText(Span * text);
+
+ struct NamespaceData {
+ Span prefix;
+ Namespace ns;
+
+ NamespaceData() {}
+
+ NamespaceData(Span const & thePrefix, Namespace theNs):
+ prefix(thePrefix), ns(theNs) {}
+ };
+
+ typedef std::vector< NamespaceData > NamespaceList;
+
+ struct ElementData {
+ Span name;
+ NamespaceList::size_type inheritedNamespaces;
+ Namespace defaultNamespace;
+
+ ElementData(
+ Span const & theName,
+ NamespaceList::size_type theInheritedNamespaces,
+ Namespace theDefaultNamespace):
+ name(theName), inheritedNamespaces(theInheritedNamespaces),
+ defaultNamespace(theDefaultNamespace)
+ {}
+ };
+
+ typedef std::stack< ElementData > ElementStack;
+
+ struct AttributeData {
+ char const * nameBegin;
+ char const * nameEnd;
+ char const * nameColon;
+ char const * valueBegin;
+ char const * valueEnd;
+
+ AttributeData(
+ char const * theNameBegin, char const * theNameEnd,
+ char const * theNameColon, char const * theValueBegin,
+ char const * theValueEnd):
+ nameBegin(theNameBegin), nameEnd(theNameEnd),
+ nameColon(theNameColon), valueBegin(theValueBegin),
+ valueEnd(theValueEnd)
+ {}
+ };
+
+ typedef std::vector< AttributeData > Attributes;
+
+ enum State {
+ STATE_CONTENT, STATE_START_TAG, STATE_END_TAG, STATE_EMPTY_ELEMENT_TAG,
+ STATE_DONE };
+
+ rtl::OUString fileUrl_;
+ oslFileHandle fileHandle_;
+ sal_uInt64 fileSize_;
+ void * fileAddress_;
+ NamespaceList namespaces_;
+ ElementStack elements_;
+ char const * pos_;
+ char const * end_;
+ State state_;
+ Attributes attributes_;
+ Attributes::iterator currentAttribute_;
+ bool firstAttribute_;
+ Pad pad_;
+};
+
+}
+
+#endif
diff --git a/configmgr/util/cfgmgr.mxp.map b/configmgr/util/cfgmgr.mxp.map
deleted file mode 100644
index 2bf8e6c7f9..0000000000
--- a/configmgr/util/cfgmgr.mxp.map
+++ /dev/null
@@ -1,4 +0,0 @@
-# Global symbols
-_component_getImplementationEnvironment
-_component_writeInfo
-_component_getFactory
diff --git a/configmgr/util/configmgr.map b/configmgr/util/configmgr.map
deleted file mode 100644
index ad92fbe03e..0000000000
--- a/configmgr/util/configmgr.map
+++ /dev/null
@@ -1,8 +0,0 @@
-CFGMGR_2_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/configmgr/util/configmgr2.uno.xml b/configmgr/util/configmgr2.uno.xml
deleted file mode 100644
index 489c134d37..0000000000
--- a/configmgr/util/configmgr2.uno.xml
+++ /dev/null
@@ -1,582 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd">
-<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
- <module-name>configmgr2</module-name>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.ConfigurationProvider</name>
- <description>
-The configuration service provides access to a hierarchical database of configuration and preference data.</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.ConfigurationProvider </supported-service>
- <service-dependency> com.sun.star.script.Converter </service-dependency>
- <service-dependency> com.sun.star.io.DataOutputStream </service-dependency>
- <type> com.sun.star.configuration.MissingBootstrapFileException </type>
- <type> com.sun.star.configuration.InvalidBootstrapFileException </type>
- <type> com.sun.star.configuration.InstallationIncompleteException </type>
- <type> com.sun.star.beans.PropertyValue </type>
- <type> com.sun.star.beans.NamedValue </type>
- <type> com.sun.star.lang.Locale </type>
- <type> com.sun.star.lang.XUnoTunnel </type>
- <type> com.sun.star.lang.ServiceNotRegisteredException </type>
- <type> com.sun.star.lang.DisposedException </type>
- <type> com.sun.star.script.XTypeConverter </type>
- <type> com.sun.star.util.XCancellable </type>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.AdministrationProvider</name>
- <description>
-The configuration service provides access to a hierarchical database of configuration and preference data.</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.AdministrationProvider </supported-service>
- <supported-service> com.sun.star.configuration.ConfigurationProvider </supported-service>
- <service-dependency> com.sun.star.configuration.ConfigurationUpdateAccess </service-dependency>
- <service-dependency> com.sun.star.configuration.ConfigurationAccess </service-dependency>
- <service-dependency> com.sun.star.script.Converter </service-dependency>
- <type> com.sun.star.configuration.MissingBootstrapFileException </type>
- <type> com.sun.star.configuration.InvalidBootstrapFileException </type>
- <type> com.sun.star.configuration.InstallationIncompleteException </type>
- <type> com.sun.star.beans.PropertyValue </type>
- <type> com.sun.star.beans.NamedValue </type>
- <type> com.sun.star.lang.Locale </type>
- <type> com.sun.star.lang.XUnoTunnel </type>
- <type> com.sun.star.lang.ServiceNotRegisteredException </type>
- <type> com.sun.star.lang.DisposedException </type>
- <type> com.sun.star.script.XTypeConverter </type>
- <type> com.sun.star.util.XCancellable </type>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.ConfigurationProviderWrapper</name>
- <description>
-Is a configuration provider that forwards its requests to a DefaultProvider.</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.ConfigurationProvider </supported-service>
- <service-dependency> com.sun.star.configuration.DefaultProvider </service-dependency>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.ORootElementGroupInfoAccess</name>
- <description>
-</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.ConfigurationAccess </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyAccess </supported-service>
- <supported-service> com.sun.star.configuration.GroupAccess </supported-service>
- <supported-service> com.sun.star.configuration.PropertyHierarchy </supported-service>
- <supported-service> com.sun.star.configuration.AccessRootElement </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyElement </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.ORootElementGroupUpdateAccess</name>
- <description>
-</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.ConfigurationUpdateAccess </supported-service>
- <supported-service> com.sun.star.configuration.ConfigurationAccess </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyAccess </supported-service>
- <supported-service> com.sun.star.configuration.GroupUpdate </supported-service>
- <supported-service> com.sun.star.configuration.GroupAccess </supported-service>
- <supported-service> com.sun.star.configuration.PropertyHierarchy </supported-service>
- <supported-service> com.sun.star.configuration.UpdateRootElement </supported-service>
- <supported-service> com.sun.star.configuration.AccessRootElement </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyElement </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.ORootElementSetInfoAccess</name>
- <description>
-</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.ConfigurationAccess </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyAccess </supported-service>
- <supported-service> com.sun.star.configuration.SetAccess </supported-service>
- <supported-service> com.sun.star.configuration.SimpleSetAccess </supported-service>
- <supported-service> com.sun.star.configuration.AccessRootElement </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyElement </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.ORootElementTreeSetUpdateAccess</name>
- <description>
-</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.ConfigurationUpdateAccess </supported-service>
- <supported-service> com.sun.star.configuration.ConfigurationAccess </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyAccess </supported-service>
- <supported-service> com.sun.star.configuration.SetUpdate </supported-service>
- <supported-service> com.sun.star.configuration.SetAccess </supported-service>
- <supported-service> com.sun.star.configuration.SimpleSetUpdate </supported-service>
- <supported-service> com.sun.star.configuration.SimpleSetAccess </supported-service>
- <supported-service> com.sun.star.configuration.UpdateRootElement </supported-service>
- <supported-service> com.sun.star.configuration.AccessRootElement </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyElement </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.ORootElementValueSetUpdateAccess</name>
- <description>
-</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.ConfigurationUpdateAccess </supported-service>
- <supported-service> com.sun.star.configuration.ConfigurationAccess </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyAccess </supported-service>
- <supported-service> com.sun.star.configuration.SetUpdate </supported-service>
- <supported-service> com.sun.star.configuration.SetAccess </supported-service>
- <supported-service> com.sun.star.configuration.SimpleSetUpdate </supported-service>
- <supported-service> com.sun.star.configuration.SimpleSetAccess </supported-service>
- <supported-service> com.sun.star.configuration.UpdateRootElement </supported-service>
- <supported-service> com.sun.star.configuration.AccessRootElement </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyElement </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.OSetElementGroupInfoAccess</name>
- <description>
-</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.ConfigurationAccess </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyAccess </supported-service>
- <supported-service> com.sun.star.configuration.GroupAccess </supported-service>
- <supported-service> com.sun.star.configuration.PropertyHierarchy </supported-service>
- <supported-service> com.sun.star.configuration.SetElement </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyElement </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.OSetElementGroupUpdateAccess</name>
- <description>
-</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.ConfigurationUpdateAccess </supported-service>
- <supported-service> com.sun.star.configuration.ConfigurationAccess </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyAccess </supported-service>
- <supported-service> com.sun.star.configuration.GroupUpdate </supported-service>
- <supported-service> com.sun.star.configuration.GroupAccess </supported-service>
- <supported-service> com.sun.star.configuration.PropertyHierarchy </supported-service>
- <supported-service> com.sun.star.configuration.SetElement </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyElement </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.OSetElementSetInfoAccess</name>
- <description>
-</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.ConfigurationAccess </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyAccess </supported-service>
- <supported-service> com.sun.star.configuration.SetAccess </supported-service>
- <supported-service> com.sun.star.configuration.SimpleSetAccess </supported-service>
- <supported-service> com.sun.star.configuration.SetElement </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyElement </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.OSetElementTreeSetUpdateAccess</name>
- <description>
-</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.ConfigurationUpdateAccess </supported-service>
- <supported-service> com.sun.star.configuration.ConfigurationAccess </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyAccess </supported-service>
- <supported-service> com.sun.star.configuration.SetUpdate </supported-service>
- <supported-service> com.sun.star.configuration.SetAccess </supported-service>
- <supported-service> com.sun.star.configuration.SimpleSetUpdate </supported-service>
- <supported-service> com.sun.star.configuration.SimpleSetAccess </supported-service>
- <supported-service> com.sun.star.configuration.SetElement </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyElement </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.OSetElementValueSetUpdateAccess</name>
- <description>
-</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.ConfigurationUpdateAccess </supported-service>
- <supported-service> com.sun.star.configuration.ConfigurationAccess </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyAccess </supported-service>
- <supported-service> com.sun.star.configuration.SetUpdate </supported-service>
- <supported-service> com.sun.star.configuration.SetAccess </supported-service>
- <supported-service> com.sun.star.configuration.SimpleSetUpdate </supported-service>
- <supported-service> com.sun.star.configuration.SimpleSetAccess </supported-service>
- <supported-service> com.sun.star.configuration.SetElement </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyElement </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.OInnerGroupInfoAccess</name>
- <description>
-</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.ConfigurationAccess </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyAccess </supported-service>
- <supported-service> com.sun.star.configuration.GroupAccess </supported-service>
- <supported-service> com.sun.star.configuration.PropertyHierarchy </supported-service>
- <supported-service> com.sun.star.configuration.GroupElement </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyElement </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.OInnerGroupUpdateAccess</name>
- <description>
-</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.ConfigurationUpdateAccess </supported-service>
- <supported-service> com.sun.star.configuration.ConfigurationAccess </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyAccess </supported-service>
- <supported-service> com.sun.star.configuration.GroupUpdate </supported-service>
- <supported-service> com.sun.star.configuration.GroupAccess </supported-service>
- <supported-service> com.sun.star.configuration.PropertyHierarchy </supported-service>
- <supported-service> com.sun.star.configuration.GroupElement </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyElement </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.OInnerSetInfoAccess</name>
- <description>
-</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.ConfigurationAccess </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyAccess </supported-service>
- <supported-service> com.sun.star.configuration.SetAccess </supported-service>
- <supported-service> com.sun.star.configuration.SimpleSetAccess </supported-service>
- <supported-service> com.sun.star.configuration.GroupElement </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyElement </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.OInnerTreeSetUpdateAccess</name>
- <description>
-</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.ConfigurationUpdateAccess </supported-service>
- <supported-service> com.sun.star.configuration.ConfigurationAccess </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyAccess </supported-service>
- <supported-service> com.sun.star.configuration.SetUpdate </supported-service>
- <supported-service> com.sun.star.configuration.SetAccess </supported-service>
- <supported-service> com.sun.star.configuration.SimpleSetUpdate </supported-service>
- <supported-service> com.sun.star.configuration.SimpleSetAccess </supported-service>
- <supported-service> com.sun.star.configuration.GroupElement </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyElement </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.OInnerValueSetUpdateAccess</name>
- <description>
-</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.ConfigurationUpdateAccess </supported-service>
- <supported-service> com.sun.star.configuration.ConfigurationAccess </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyAccess </supported-service>
- <supported-service> com.sun.star.configuration.SetUpdate </supported-service>
- <supported-service> com.sun.star.configuration.SetAccess </supported-service>
- <supported-service> com.sun.star.configuration.SimpleSetUpdate </supported-service>
- <supported-service> com.sun.star.configuration.SimpleSetAccess </supported-service>
- <supported-service> com.sun.star.configuration.GroupElement </supported-service>
- <supported-service> com.sun.star.configuration.HierarchyElement </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.bootstrap.BootstrapContext</name>
- <description>Context containing configuration bootstrap data merged with environment settings.</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.bootstrap.BootstrapContext </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.backend.SingleBackendAdapter</name>
- <description>Backend using a SingleBackend for data access.</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.backend.SingleBackendAdapter </supported-service>
- <supported-service> com.sun.star.configuration.backend.OnlineBackend </supported-service>
- <supported-service> com.sun.star.configuration.backend.Backend </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.backend.LayerUpdateMerger</name>
- <description>Merges updates into layer data.</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.backend.LayerUpdateMerger </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.backend.MergeImporter</name>
- <description>Importer for layer data.</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.backend.MergeImporter </supported-service>
- <supported-service> com.sun.star.configuration.backend.Importer </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.backend.CopyImporter</name>
- <description>Importer for layer data.</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.backend.CopyImporter </supported-service>
- <supported-service> com.sun.star.configuration.backend.Importer </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.backend.xml.SchemaParser</name>
- <description>Parser for OOR Schema XML.</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.backend.xml.SchemaParser </supported-service>
- <service-dependency> com.sun.star.xml.sax.Parser </service-dependency>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.backend.xml.LayerParser</name>
- <description>Parser for OOR Layer/Update XML.</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.backend.xml.LayerParser </supported-service>
- <service-dependency> com.sun.star.xml.sax.Parser </service-dependency>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.backend.xml.LayerWriter</name>
- <description>Service for writing layer data to the OOR Layer/Update XML format.</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.backend.xml.LayerWriter </supported-service>
- <service-dependency> com.sun.star.xml.sax.Writer </service-dependency>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.backend.LocalSingleBackend</name>
- <description>SingleBackend for accessing locally stored configuration data.</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.backend.LocalSingleBackend </supported-service>
- <supported-service> com.sun.star.configuration.backend.SingleBackend </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.backend.LocalDataImporter</name>
- <description>Component for importing layer data from local files.</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.backend.LocalDataImporter </supported-service>
- <supported-service> com.sun.star.configuration.backend.DataImporter </supported-service>
- </component-description>
- <component-description>
- <author>Joerg Barfurth</author>
- <name> com.sun.star.comp.configuration.backend.LocalHierarchyBrowser</name>
- <description>Component for retrieving available componets from a local configuration data repository.</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.backend.LocalHierarchyBrowser </supported-service>
- <supported-service> com.sun.star.configuration.backend.HierarchyBrowser </supported-service>
- </component-description>
- <component-description>
- <author>Sarah Smith</author>
- <name> com.sun.star.comp.configuration.backend.LocalSchemaSupplier</name>
- <description>Component for accessing locally stored schema files</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.backend.LocalSchemaSupplier </supported-service>
- <supported-service> com.sun.star.configuration.backend.SchemaSupplier </supported-service>
- </component-description>
- <component-description>
- <author>Sarah Smith</author>
- <name> com.sun.star.comp.configuration.backend.LocalSingleStratum</name>
- <description>Component for accessing locally stored configuration data</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.backend.LocalSingleStratum </supported-service>
- <supported-service> com.sun.star.configuration.backend.SingleLayerStratum </supported-service>
- </component-description>
- <component-description>
- <author>Sarah Smith</author>
- <name> com.sun.star.comp.configuration.backend.MultiStratumBackend</name>
- <description>Component for co-ordinating access to multiple storage backends</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service> com.sun.star.configuration.backend.MultiStratumBackend </supported-service>
- <supported-service> com.sun.star.configuration.backend.Backend </supported-service>
- </component-description>
- <component-description>
- <author>Frank Schoenheit</author>
- <name> com.sun.star.comp.configuration.OConfigurationRegistry</name>
- <description>
-The configuration registry service is an adapter, that provides a SimpleRegistry interface to the configuration service.</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="final"/>
- <supported-service>com.sun.star.configuration.ConfigurationRegistry</supported-service>
- <supported-service>com.sun.star.registry.SimpleRegistry</supported-service>
- <service-dependency>com.sun.star.configuration.ConfigurationProvider</service-dependency>
- <type>com.sun.star.registry.XRegistryKey</type>
- <type>com.sun.star.registry.XSimpleRegistry</type>
- <type> com.sun.star.lang.ServiceNotRegisteredException </type>
- <type> com.sun.star.util.XFlushable </type>
- </component-description>
- <type>com.sun.star.uno.XAggregation</type>
- <type>com.sun.star.uno.XCurrentContext</type>
- <type>com.sun.star.uno.XWeak</type>
- <type>com.sun.star.uno.TypeClass</type>
- <type>com.sun.star.beans.XExactName</type>
- <type>com.sun.star.beans.XHierarchicalPropertySet</type>
- <type>com.sun.star.beans.XFastPropertySet</type>
- <type>com.sun.star.beans.XMultiHierarchicalPropertySet</type>
- <type>com.sun.star.beans.XMultiPropertySet</type>
- <type>com.sun.star.beans.XProperty</type>
- <type>com.sun.star.beans.XPropertyWithState</type>
- <type>com.sun.star.beans.XPropertyState</type>
- <type>com.sun.star.beans.XMultiPropertyStates</type>
- <type>com.sun.star.beans.XPropertySet</type>
- <type>com.sun.star.beans.PropertyValue</type>
- <type>com.sun.star.beans.Property</type>
- <type>com.sun.star.beans.PropertyAttribute</type>
- <type>com.sun.star.configuration.XTemplateContainer</type>
- <type>com.sun.star.configuration.XTemplateInstance</type>
- <type>com.sun.star.configuration.backend.TemplateIdentifier</type>
- <type>com.sun.star.configuration.backend.SchemaAttribute</type>
- <type>com.sun.star.configuration.backend.NodeAttribute</type>
- <type>com.sun.star.configuration.backend.XSchemaHandler</type>
- <type>com.sun.star.configuration.backend.XLayerHandler</type>
- <type>com.sun.star.configuration.backend.XUpdateHandler</type>
- <type>com.sun.star.configuration.backend.XUpdatableLayer</type>
- <type>com.sun.star.configuration.backend.XCompositeLayer</type>
- <type>com.sun.star.configuration.backend.XLayerImporter</type>
- <type>com.sun.star.configuration.backend.XBackend</type>
- <type>com.sun.star.configuration.backend.XBackendEntities</type>
- <type>com.sun.star.configuration.backend.XSingleLayerStratum</type>
- <type>com.sun.star.configuration.backend.XMultiLayerStratum</type>
- <type>com.sun.star.configuration.backend.XSchemaSupplier</type>
- <type>com.sun.star.configuration.backend.XSchema</type>
- <type>com.sun.star.configuration.backend.XLayer</type>
- <type>com.sun.star.configuration.backend.MalformedDataException</type>
- <type>com.sun.star.configuration.backend.BackendAccessException</type>
- <type>com.sun.star.configuration.backend.BackendSetupException</type>
- <type>com.sun.star.configuration.backend.AuthenticationFailedException</type>
- <type>com.sun.star.configuration.backend.InvalidAuthenticationMechanismException</type>
- <type>com.sun.star.configuration.backend.CannotConnectException</type>
- <type>com.sun.star.configuration.backend.InsufficientAccessRightsException</type>
- <type>com.sun.star.configuration.backend.ConnectionLostException</type>
- <type>com.sun.star.configuration.MissingBootstrapFileException</type>
- <type>com.sun.star.configuration.InvalidBootstrapFileException</type>
- <type>com.sun.star.configuration.InstallationIncompleteException</type>
- <type>com.sun.star.container.XNamed</type>
- <type>com.sun.star.container.XHierarchicalName</type>
- <type>com.sun.star.container.XChild</type>
- <type>com.sun.star.container.XNameAccess</type>
- <type>com.sun.star.container.XNameReplace</type>
- <type>com.sun.star.container.XNameContainer</type>
- <type>com.sun.star.container.XHierarchicalNameAccess</type>
- <type>com.sun.star.container.XElementAccess</type>
- <type>com.sun.star.container.XContainer</type>
- <type>com.sun.star.container.NoSuchElementException</type>
- <type>com.sun.star.io.XActiveDataSink</type>
- <type>com.sun.star.io.XActiveDataSource</type>
- <type>com.sun.star.io.XInputStream</type>
- <type>com.sun.star.io.XOutputStream</type>
- <type>com.sun.star.io.XDataInputStream</type>
- <type>com.sun.star.io.XDataOutputStream</type>
- <type>com.sun.star.io.UnexpectedEOFException</type>
- <type>com.sun.star.io.WrongFormatException</type>
- <type>com.sun.star.lang.XComponent</type>
- <type>com.sun.star.lang.XEventListener</type>
- <type>com.sun.star.lang.XInitialization</type>
- <type>com.sun.star.lang.XLocalizable</type>
- <type>com.sun.star.lang.XMultiComponentFactory</type>
- <type>com.sun.star.lang.XMultiServiceFactory</type>
- <type>com.sun.star.lang.XSingleComponentFactory</type>
- <type>com.sun.star.lang.XSingleServiceFactory</type>
- <type>com.sun.star.lang.XServiceInfo</type>
- <type>com.sun.star.lang.XTypeProvider</type>
- <type>com.sun.star.lang.XUnoTunnel</type>
- <type>com.sun.star.lang.EventObject</type>
- <type>com.sun.star.lang.ServiceNotRegisteredException</type>
- <type>com.sun.star.lang.IllegalArgumentException</type>
- <type>com.sun.star.lang.WrappedTargetException</type>
- <type>com.sun.star.lang.WrappedTargetRuntimeException</type>
- <type>com.sun.star.lang.DisposedException</type>
- <type>com.sun.star.script.XTypeConverter</type>
- <type>com.sun.star.script.FailReason</type>
- <type>com.sun.star.task.XJob</type>
- <type>com.sun.star.util.XCancellable</type>
- <type>com.sun.star.util.XChangesBatch</type>
- <type>com.sun.star.util.XChangesListener</type>
- <type>com.sun.star.util.XChangesNotifier</type>
- <type>com.sun.star.util.XFlushable</type>
- <type>com.sun.star.util.XStringEscape</type>
- <type>com.sun.star.util.XTimeStamped</type>
- <type>com.sun.star.util.Date</type>
- <type>com.sun.star.util.Time</type>
- <type>com.sun.star.util.DateTime</type>
- <type>com.sun.star.xml.sax.XAttributeList</type>
- <type>com.sun.star.xml.sax.XDocumentHandler</type>
- <type>com.sun.star.xml.sax.XExtendedDocumentHandler</type>
- <type>com.sun.star.xml.sax.XParser</type>
- <type>com.sun.star.xml.sax.SAXParseException</type>
- <project-build-dependency> comphelper </project-build-dependency>
- <project-build-dependency> vos </project-build-dependency>
- <project-build-dependency> cppuhelper </project-build-dependency>
- <project-build-dependency> salhelper </project-build-dependency>
- <project-build-dependency> cppu </project-build-dependency>
- <project-build-dependency> sal </project-build-dependency>
- <runtime-module-dependency> comphelp2$(COM) </runtime-module-dependency>
- <runtime-module-dependency> vos2$(COM) </runtime-module-dependency>
- <runtime-module-dependency> cppuhelper3$(COM) </runtime-module-dependency>
- <runtime-module-dependency> salhelper3$(COM) </runtime-module-dependency>
- <runtime-module-dependency> cppu3 </runtime-module-dependency>
- <runtime-module-dependency> sal3 </runtime-module-dependency>
-</module-description>
diff --git a/configmgr/util/configmgrl.map b/configmgr/util/configmgrl.map
deleted file mode 100644
index ad92fbe03e..0000000000
--- a/configmgr/util/configmgrl.map
+++ /dev/null
@@ -1,8 +0,0 @@
-CFGMGR_2_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/configmgr/util/exports.dxp b/configmgr/util/exports.dxp
deleted file mode 100644
index 9630d7e067..0000000000
--- a/configmgr/util/exports.dxp
+++ /dev/null
@@ -1,3 +0,0 @@
-component_getImplementationEnvironment
-component_writeInfo
-component_getFactory
diff --git a/configmgr/util/makefile.mk b/configmgr/util/makefile.mk
deleted file mode 100644
index 056e033934..0000000000
--- a/configmgr/util/makefile.mk
+++ /dev/null
@@ -1,78 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..
-PRJNAME=configmgr
-TARGET=configmgr
-
-ENABLE_EXCEPTIONS=TRUE
-
-.INCLUDE : settings.mk
-.IF "$(L10N_framework)"==""
-.INCLUDE : $(PRJ)$/makefile.pmk
-.INCLUDE : $(PRJ)$/version.mk
-DLLPRE =
-
-# --- Library -----------------------------------
-
-SHL1TARGET= $(CFGMGR_TARGET)$(CFGMGR_MAJOR).uno
-SHL1VERSIONMAP= $(TARGET).map
-
-SHL1OBJS=$(SLOFILES)
-SHL1STDLIBS=\
- $(COMPHELPERLIB) \
- $(CPPULIB) \
- $(CPPUHELPERLIB) \
- $(VOSLIB) \
- $(SALHELPERLIB) \
- $(SALLIB) \
- $(TOOLSLIB)
-
-SHL1DEPN=
-SHL1IMPLIB= i$(SHL1TARGET)
-SHL1LIBS= $(SLB)$/registry.lib \
- $(SLB)$/treecache.lib \
- $(SLB)$/misc.lib \
- $(SLB)$/backend.lib \
- $(SLB)$/localbe.lib \
- $(SLB)$/xml.lib \
- $(SLB)$/treemgr.lib \
- $(SLB)$/api2.lib \
- $(SLB)$/api.lib \
- $(SLB)$/data.lib \
- $(SLB)$/cm.lib
-
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-
-DEF1NAME= $(SHL1TARGET)
-DEF1EXPORTFILE= exports.dxp
-
-# --- Targets ----------------------------------
-.ENDIF # L10N_framework
-
-.INCLUDE : target.mk
-
diff --git a/configmgr/workben/apitest/cfgadduser.cxx b/configmgr/workben/apitest/cfgadduser.cxx
deleted file mode 100644
index 39dfb76566..0000000000
--- a/configmgr/workben/apitest/cfgadduser.cxx
+++ /dev/null
@@ -1,355 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <stdio.h>
-#include <string.h>
-#include <comphelper/stl_types.hxx>
-#include <cppuhelper/extract.hxx>
-#include <com/sun/star/uno/Type.hxx>
-#include <com/sun/star/uno/TypeClass.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/util/XChangesBatch.hpp>
-#include <com/sun/star/container/XNameContainer.hpp>
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
-#include <cppuhelper/servicefactory.hxx>
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::container;
-
-#define ASCII_STRING(rtlOUString) ::rtl::OString((rtlOUString).getStr(), (rtlOUString).getLength(), RTL_TEXTENCODING_ASCII_US).getStr()
-
-//=============================================================================
-void explain(sal_Bool _bVerbose)
-{
- cout << "cfgadduser - adding users to a registry server\n";
- cout << "\nusage :\n";
- cout << "cfgadduser [-s <server> -p <port>] [-portal] [-r <registry>] [-a <sysaccount>]";
- cout << " [-h <homedirbase>] [-pwd] <user> [<user>]*\n";
- cout << "\nparameters\n";
- cout << " <server> - machine where the registry server is running\n";
- cout << " <port> - port the registry server is listening at\n";
- cout << " <registry> - registry file to use to instantiate services. Defaulted to\n";
- cout << " applicat.rdb\n";
- cout << " <sysaccount> - system account to use for the newly created user(s)\n";
- cout << " <homedirbase> - home directory base. The concret home dir of a user will\n";
- cout << " be built by appending the the user name to the base dir.\n";
- cout << " <user> - user name to add\n";
- cout << " -portal - specify that the program should connect to a running portal,\n";
- cout << " not directly to the registry server (you need a ";
-#ifdef WIN32
- cout << "portal.dll\n";
-#else
- cout << "libportal.so\n";
-#endif
- cout << " for this)\n";
- cout << " In this case, <server> and <port> specify the location where\n";
- cout << " StarPortal is running\n";
- cout << "\n";
- cout << "If no server is specified, the configuration proxy will try to bootstrap from\n";
- cout << "the initialization file (";
-#ifdef WIN32
- cout << "sregistry.ini";
-#else
- cout << "sregistryrc";
-#endif
- cout << ")\n\n";
- cout.flush();
-}
-
-//=============================================================================
-#if (defined UNX) || (defined OS2)
-int main( int argc, char * argv[] )
-#else
-int _cdecl main( int argc, char * argv[] )
-#endif
-{
- sal_Char* pPort = NULL;
- sal_Char* pServer = NULL;
- sal_Char* pRegistry = NULL;
- sal_Char* pSysAccount = NULL;
- sal_Char* pHomeDirBase = NULL;
- sal_Bool bPortal = sal_False;
-
- ::std::vector< sal_Char* > aUsers;
-
- // collect some parameters
- sal_Char** pArgs = argv + 1;
- for (sal_Int32 i=1; i<argc; ++i, ++pArgs)
- {
- sal_Char* pCurArg = *pArgs;
- sal_Int32 nLen = strlen(pCurArg);
- sal_Bool bInvalidArg = sal_True;
- if (nLen && ('-' == *pCurArg))
- { // it's a switch
- sal_Char* pSwitch = pCurArg + 1;
- switch (nLen)
- {
- case 2:
- switch (*pSwitch)
- {
- case '?':
- explain(sal_True);
- return 1;
- case 'h':
- pHomeDirBase = *++pArgs;
- ++i;
- bInvalidArg = sal_False;
- break;
- case 'a':
- pSysAccount = *++pArgs;
- ++i;
- bInvalidArg = sal_False;
- break;
- case 'p':
- pPort = *++pArgs;
- ++i;
- bInvalidArg = sal_False;
- break;
- case 's':
- pServer = *++pArgs;
- ++i;
- bInvalidArg = sal_False;
- break;
- case 'r':
- pRegistry = *++pArgs;
- ++i;
- bInvalidArg = sal_False;
- break;
- }
- break;
- case 7:
- if (0 == strncmp(pSwitch, "portal", 6))
- {
- bInvalidArg = sal_False;
- bPortal = sal_True;
- }
- break;
- }
- }
- else
- {
- if ((1 == nLen) && ('?' == *pCurArg))
- {
- explain(sal_True);
- return 1;
- }
- else
- {
- bInvalidArg = sal_False;
- aUsers.push_back(pCurArg);
- }
- }
- if (bInvalidArg)
- {
- explain(sal_False);
- return 1;
- }
- }
-
- if ((!pServer && pPort) || (!pPort && pServer))
- {
- explain(sal_False);
- return 1;
- }
-
- if (0 == aUsers.size())
- {
- explain(sal_False);
- return 1;
- }
-
- // refine some params
- ::rtl::OUString sHomeDirBase, sSystemAccountName;
- if (pHomeDirBase)
- {
- sHomeDirBase = ::rtl::OUString::createFromAscii(pHomeDirBase);
- if (!sHomeDirBase.getLength() || ('/' != sHomeDirBase.getStr()[sHomeDirBase.getLength() - 1]))
- sHomeDirBase += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- }
- if (pSysAccount)
- sSystemAccountName = ::rtl::OUString::createFromAscii(pSysAccount);
-
- try
- {
- ::rtl::OUString const sServiceRegistry = ::rtl::OUString::createFromAscii( pRegistry ? pRegistry : "applicat.rdb" );
- Reference< XMultiServiceFactory > xORB = ::cppu::createRegistryServiceFactory(
- sServiceRegistry,
- ::rtl::OUString()
- );
- if (!xORB.is())
- {
- cerr << "Could not create the service factory !\n\n";
- return 1;
- }
-
- // collect the params for the config provider
- Sequence< Any > aProviderArgs(3 + (pServer ? 2 : 0));
- aProviderArgs[0] = makeAny(PropertyValue(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("servertype")),
- 0,
- makeAny(::rtl::OUString::createFromAscii(bPortal ? "portal" : "remote")),
- PropertyState_DIRECT_VALUE
- ));
- aProviderArgs[1] = makeAny(PropertyValue(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("user")),
- 0,
- makeAny(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Administrator"))),
- PropertyState_DIRECT_VALUE
- ));
- aProviderArgs[2] = makeAny(PropertyValue(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("password")),
- 0,
- makeAny(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("unused"))),
- PropertyState_DIRECT_VALUE
- ));
- if (pServer)
- {
- aProviderArgs[3] = makeAny(PropertyValue(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("server")),
- 0,
- makeAny(::rtl::OUString::createFromAscii(pServer)),
- PropertyState_DIRECT_VALUE
- ));
-
- sal_Int32 nPort = ::rtl::OUString::createFromAscii(pPort).toInt32();
- aProviderArgs[4] = makeAny(PropertyValue(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("port")),
- 0,
- makeAny(nPort),
- PropertyState_DIRECT_VALUE
- ));
- }
-
- Reference< XMultiServiceFactory > xCfgProvider(
- xORB->createInstanceWithArguments(::rtl::OUString::createFromAscii("com.sun.star.configuration.ConfigurationProvider"),
- aProviderArgs),
- UNO_QUERY);
- if (!xCfgProvider.is())
- {
- cerr << "Could not create the configuration provider !\n\n";
- return 3;
- }
-
- Reference< XInterface > xIFace = xCfgProvider->createInstance(
- ::rtl::OUString::createFromAscii("com.sun.star.configuration.UserAdministration"));
- if (!xIFace.is())
- {
- cerr << "Could not create the configuration provider !\n\n";
- return 4;
- }
-
- Reference< XChangesBatch > xUserChanges(xIFace, UNO_QUERY);
- Reference< XNameContainer > xUserContainer(xIFace, UNO_QUERY);
- Reference< XSingleServiceFactory> xUserFactory(xIFace, UNO_QUERY);
- if (!xUserChanges.is() || !xUserContainer.is() || !xUserFactory.is())
- {
- cerr << "the user admin access does not provide the necessary interfaces !\n\n";
- return 5;
- }
-
- cout << "going to add the users ..." << endl << endl;
- for ( ::std::vector< sal_Char* >::const_iterator aUserLoop = aUsers.begin();
- aUserLoop != aUsers.end();
- ++aUserLoop
- )
- {
- cout << *aUserLoop << " ... ";
- sal_Bool bHadLinebreak = sal_False;
- try
- {
- Reference< XInterface > xNewUser = xUserFactory->createInstance();
-
- // the user name as unicode string use more than once)
- ::rtl::OUString sUserName = ::rtl::OUString::createFromAscii(*aUserLoop);
-
- // the XNameContainer access to the Security node in the user profile data
- Reference< XNameReplace > xSecurityDataAccess;
- Reference< XNameAccess > xUserDataAccess(xNewUser, UNO_QUERY);
- if (xUserDataAccess.is())
- {
- Any aSecurity = xUserDataAccess->getByName(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Security")));
- ::cppu::extractInterface(xSecurityDataAccess, aSecurity);
- }
-
- if (!xSecurityDataAccess.is())
- throw Exception(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("The user administration service did not provide a valid user template.")), NULL);
-
- // set the home directory
- if (sHomeDirBase.getLength())
- {
- ::rtl::OUString sHomeDir(sHomeDirBase);
- sHomeDir += sUserName;
- xSecurityDataAccess->replaceByName(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HomeDirectory")), makeAny(sHomeDir));
- cout << "\n\thome dir : " << ASCII_STRING(sHomeDir) << " ... ";
- cout.flush();
- bHadLinebreak = sal_True;
- }
-
- if (sSystemAccountName.getLength())
- {
- xSecurityDataAccess->replaceByName(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SystemAccount")), makeAny(sSystemAccountName));
- cout << "\n\tsystem account: " << ASCII_STRING(sSystemAccountName) << " ... ";
- cout.flush();
- bHadLinebreak = sal_True;
- }
-
- xUserContainer->insertByName(sUserName, makeAny(xNewUser));
- xUserChanges->commitChanges();
- if (bHadLinebreak)
- cout << "\n";
- cout << "done.\n";
- cout.flush();
- }
- catch(Exception& e)
- {
- cout << "\n";
- if (!bHadLinebreak)
- cout << "\t";
- cerr << "unable to add the user named " << *aUserLoop << endl;
- if (!bHadLinebreak)
- cout << "\t";
- cerr << "(exception message: " << ::rtl::OString(e.Message.getStr(), e.Message.getLength(), RTL_TEXTENCODING_ASCII_US).getStr() << ")" << endl;
- }
- cout << "\n";
- }
- }
- catch(Exception& e)
- {
- cerr << "Caught exception: " << ASCII_STRING(e.Message) << endl;
- return 2;
- }
-
- return 0;
-}
diff --git a/configmgr/workben/apitest/cfgadmin.cxx b/configmgr/workben/apitest/cfgadmin.cxx
deleted file mode 100644
index e8bfaea92d..0000000000
--- a/configmgr/workben/apitest/cfgadmin.cxx
+++ /dev/null
@@ -1,517 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#define _PRIVATE_TEST_
-
-#include <iostream>
-using namespace std;
-
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/uno/Type.hxx>
-#include <com/sun/star/uno/TypeClass.hpp>
-#include <com/sun/star/beans/XHierarchicalPropertySet.hpp>
-
-#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/container/XNameContainer.hpp>
-#include <com/sun/star/container/XHierarchicalName.hpp>
-#include <com/sun/star/container/XNamed.hpp>
-#include <com/sun/star/container/XNameReplace.hpp>
-#include <com/sun/star/container/XChild.hpp>
-#include <com/sun/star/beans/XExactName.hpp>
-#include <com/sun/star/util/XChangesBatch.hpp>
-
-
-#include <rtl/ustring.hxx>
-#include <rtl/string.hxx>
-#include <cppuhelper/servicefactory.hxx>
-#include <com/sun/star/uno/Sequence.h>
-#include <com/sun/star/uno/Any.h>
-
-#include "createpropertyvalue.hxx"
-
-#include "typeconverter.hxx"
-#include <osl/time.h>
-
-// #include <com/sun/star/configuration/XConfigurationSync.hpp>
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::beans;
-//using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::util;
-
-using ::rtl::OUString;
-using ::rtl::OString;
-//using namespace ::configmgr;
-
-using namespace ::cppu;
-
-#define ASCII(x) ::rtl::OUString::createFromAscii(x)
-
-ostream& operator << (ostream& out, rtl::OUString const& aStr)
-{
- sal_Unicode const* const pStr = aStr.getStr();
- sal_Unicode const* const pEnd = pStr + aStr.getLength();
- for (sal_Unicode const* p = pStr; p < pEnd; ++p)
- if (0 < *p && *p < 127) // ASCII
- out << char(*p);
- else
- out << "[\\u" << hex << *p << "]";
- return out;
-}
-
-void showSequence(const Sequence<OUString> &aSeq)
-{
- OUString aArray;
- const OUString *pStr = aSeq.getConstArray();
- for (int i=0;i<aSeq.getLength();i++)
- {
- OUString aStr = pStr[i];
- // aArray += aStr + ASCII(", ");
- cout << aStr << endl;
- }
- volatile int dummy = 0;
-}
-
-//=============================================================================
-//=============================================================================
-void test_read_access(Reference< XInterface >& xIface, Reference< XMultiServiceFactory > &xMSF);
-//=============================================================================
-struct prompt_and_wait
-{
- char const* myText;
- prompt_and_wait(char const* text = "") : myText(text) {}
- ~prompt_and_wait()
- {
- cout << myText << ">" << endl;
- int const mx = int( (+0u - +1u) >> 1);
-
- char c=0;
- if (cin.get(c) && c != '\n')
- cin.ignore(mx,'\n');
- }
-};
-static prompt_and_wait exit_prompt("Quitting\nQ");
-
-
-// -----------------------------------------------------------------------------
-Sequence<Any> createSequence(const OUString &sUser, const OUString &sPasswd)
-{
- Sequence< Any > aCPArgs;
-
- if (sUser.getLength() > 0)
- {
- aCPArgs.realloc(1);
- aCPArgs[0] <<= configmgr::createPropertyValue(ASCII("user"), sUser);
- }
- if (sPasswd.getLength() > 0)
- {
- aCPArgs.realloc(2);
- aCPArgs[1] <<= configmgr::createPropertyValue(ASCII("password"), sPasswd);
- }
- return aCPArgs;
-}
-
-//=============================================================================
-#include <string.h>
-#if (defined UNX) || (defined OS2)
-#else
-#include <conio.h>
-#endif
-
-OString input(const char* pDefaultText, char cEcho)
-{
- // PRE: a Default Text would be shown, cEcho is a Value which will show if a key is pressed.
- const int MAX_INPUT_LEN = 500;
- char aBuffer[MAX_INPUT_LEN];
-
- strcpy(aBuffer, pDefaultText);
- int nLen = strlen(aBuffer);
-
-#ifdef WNT
- char ch = '\0';
-
- cout << aBuffer;
- cout.flush();
-
- while(ch != 13)
- {
- ch = getch();
- if (ch == 8)
- {
- if (nLen > 0)
- {
- cout << "\b \b";
- cout.flush();
- --nLen;
- aBuffer[nLen] = '\0';
- }
- else
- {
- cout << "\a";
- cout.flush();
- }
- }
- else if (ch != 13)
- {
- if (nLen < MAX_INPUT_LEN)
- {
- if (cEcho == 0)
- {
- cout << ch;
- }
- else
- {
- cout << cEcho;
- }
- cout.flush();
- aBuffer[nLen++] = ch;
- aBuffer[nLen] = '\0';
- }
- else
- {
- cout << "\a";
- cout.flush();
- }
- }
- }
-#else
- if (!cin.getline(aBuffer,sizeof aBuffer))
- return OString();
-#endif
- return OString(aBuffer);
-}
-
-// -----------------------------------------------------------------------------
-rtl::OUString enterValue(const char* _aStr, const char* _aDefault, bool _bIsAPassword)
-{
- cout << _aStr;
- cout.flush();
- OString aTxt = input(_aDefault, _bIsAPassword ? '*' : 0);
-
- OUString sValue = OUString::createFromAscii(aTxt);
- return sValue;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////
-void write(Reference<XNameAccess >& xAccess)
-{
- if (xAccess.is())
- {
- Sequence<OUString> aNames( xAccess->getElementNames() );
-
- cout << "Element Names: (" << aNames.getLength() << ")";
- for (int i = 0; i < aNames.getLength(); ++i)
- cout << "\n[" << i << "] -\t" << aNames[i];
- cout << endl;
- }
- else
- cout << "BUG: XNameAccess not available";
- cout << endl;
-}
-// -----------------------------------------------------------------------------
-void write(Reference< XChild >& xChild)
-{
- if (xChild.is())
- cout << "\n[ P ] -\tParent";
- else
- cout << "BUG: Parent not available (no XChild)";
- cout << endl;
-}
-
-// -----------------------------------------------------------------------------
-void displayTree(Reference< XNameAccess > xIFace){
-
- write(Reference< XNameAccess >(xIFace));
-}
-
-
-// -----------------------------------------------------------------------------
-void displayGroups(Reference< XNameAccess > xGroupAccess)
-{
-
- cout << "Currently available groups !\n---------------------------------------------------------------" << endl;
- write(xGroupAccess);
-}
-
-// -----------------------------------------------------------------------------
-OUString insertGroup(Reference< XNameAccess > xGroupAccess)
-{
- OUString sGroup = enterValue(" Enter a new group to create: ", "", true);
-
- Reference< XSingleServiceFactory > xFactory(xGroupAccess, UNO_QUERY);
- Reference< XNameAccess > xNewGroup(xFactory->createInstance(), UNO_QUERY);
-
- cout << "Group data: !\n---------------------------------------------------------------" << endl;
- write(xNewGroup);
- Any aGroup;
- aGroup <<= xNewGroup;
- Reference< XNameContainer >(xGroupAccess, UNO_QUERY)->insertByName(sGroup, aGroup);
- return sGroup;
-}
-
-// -----------------------------------------------------------------------------
-void deleteGroup(Reference< XNameAccess > xGroupAccess, OUString sGroup)
-{
- if (!sGroup.getLength())
- sGroup = enterValue(" Enter a group to delete: ", "", true);
- cout << "deleting group !\n---------------------------------------------------------------" << endl;
- Reference< XNameContainer >(xGroupAccess, UNO_QUERY)->removeByName(sGroup);
-}
-
-// -----------------------------------------------------------------------------
-void displayUsers(Reference< XNameAccess > xUserAccess)
-{
- cout << "Currently available users !\n---------------------------------------------------------------" << endl;
- write(xUserAccess);
-}
-
-// -----------------------------------------------------------------------------
-OUString insertUser(Reference< XNameAccess > xUserAccess, OUString aGroup)
-{
- OUString sUser = enterValue(" Enter a new User to create: ", "", true);
- Reference< XSingleServiceFactory > xFactory(xUserAccess, UNO_QUERY);
-
- Sequence< Any > aArgs(1);
- aArgs[0] <<= configmgr::createPropertyValue(ASCII("group"), aGroup);
- Reference< XNameAccess > xNewUser(xFactory->createInstanceWithArguments(aArgs), UNO_QUERY);
-
- cout << "User data: !\n---------------------------------------------------------------" << endl;
- write(xNewUser);
-
- Any aValue;
- aValue <<= ASCII("MyCompany");
-
- // now do some updates for the user
- Reference< XHierarchicalPropertySet > xUpdate(xNewUser, UNO_QUERY);
- xUpdate->setHierarchicalPropertyValue(ASCII("Data/Company"),aValue);
-
- Any aUser;
- aUser <<= xNewUser;
- Reference< XNameContainer >(xUserAccess, UNO_QUERY)->insertByName(sUser, aUser);
-
- return sUser;
-}
-
-// -----------------------------------------------------------------------------
-void deleteUser(Reference< XNameAccess > xUserAccess, OUString sUser)
-{
- if (!sUser.getLength())
- sUser = enterValue(" Enter a User to delete: ", "", true);
- cout << "deleting User !\n---------------------------------------------------------------" << endl;
- Reference< XNameContainer >(xUserAccess, UNO_QUERY)->removeByName(sUser);
-}
-
-// -----------------------------------------------------------------------------
-Reference< XNameAccess > beginChanges(Reference< XMultiServiceFactory > xFactory, OUString sPath, OUString& sUser)
-{
- if (!sUser.getLength())
- sUser = enterValue(" Enter a User: ", "", true);
-
- Sequence< Any > aArgs(2);
- aArgs[0] <<= configmgr::createPropertyValue(ASCII("user"), sUser);
- aArgs[1] <<= configmgr::createPropertyValue(ASCII("nodepath"),sPath);
-
- cout << "starting update for node:" << sPath << endl;
-
- Reference< XNameAccess > xTree(xFactory->createInstanceWithArguments(OUString::createFromAscii("com.sun.star.configuration.ConfigurationUpdateAccess"),
- aArgs), UNO_QUERY);
-
- return xTree;
-}
-
-template <class Type>
-// -----------------------------------------------------------------------------
-void update(Reference< XInterface > xIFace, OUString sRelPath, Type sValue)
-{
- Reference< XHierarchicalPropertySet > xTree(xIFace, UNO_QUERY);
- Any aValue;
- aValue <<= sValue;
-
- cout << "updating node:" << sRelPath << endl;
- xTree->setHierarchicalPropertyValue(sRelPath, aValue);
-}
-
-// -----------------------------------------------------------------------------
-Reference< XHierarchicalPropertySet > insertTree(Reference< XInterface > xIFace, OUString aName)
-{
- if (!aName.getLength())
- aName = enterValue("/nEnter a Tree to insert: ", "", false);
-
- Reference< XSingleServiceFactory > xFactory(xIFace, UNO_QUERY);
- Reference< XHierarchicalPropertySet > xNewElement(xFactory->createInstance(), UNO_QUERY);
-
- cout << "inserting new tree element:" << aName << endl;
-
- Any aTree;
- aTree <<= xNewElement;
- Reference< XNameContainer >(xFactory, UNO_QUERY)->insertByName(aName, aTree);
-
- return xNewElement;
-}
-
-// -----------------------------------------------------------------------------
-void removeTree(Reference< XInterface > xIFace, OUString aName)
-{
- if (!aName.getLength())
- aName = enterValue("/nEnter a Tree to remove: ", "", false);
-
- cout << "removing new tree element:" << aName << endl;
-
- Reference< XNameContainer >(xIFace, UNO_QUERY)->removeByName(aName);
-}
-
-// -----------------------------------------------------------------------------
-void commitChanges(Reference< XInterface > xIFace)
-{
- cout << "committing changes:" << endl;
-
- Reference< XChangesBatch > xChangesBatch(xIFace, UNO_QUERY);
- xChangesBatch->commitChanges();
-}
-
-// -----------------------------------------------------------------------------
-// ---------------------------------- M A I N ----------------------------------
-// -----------------------------------------------------------------------------
-
-#if (defined UNX) || (defined OS2)
-int main( int argc, char * argv[] )
-#else
-int _cdecl main( int argc, char * argv[] )
-#endif
-{
- TimeValue aTimeout;
- aTimeout.Seconds = 5;
- aTimeout.Nanosec = 0;
-
- // cout << " Please insert Text: ";
- // cout.flush();
- // OString aTxt = input("Der Text", 0);
- // cout << endl << "You inserted: " << aTxt.getStr() << endl;
- //
- // cout << "Please insert Password: ";
- // cout.flush();
- // OString aPasswd = input("", '*');
- // cout << endl << "You inserted: " << aPasswd.getStr() << endl;
-
- try
- {
- OUString const sServiceRegistry = OUString::createFromAscii( argc > 1 ? argv[1] : "applicat.rdb" );
- Reference< XMultiServiceFactory > xORB = createRegistryServiceFactory(
- sServiceRegistry,
- ::rtl::OUString()
- );
- if (!xORB.is())
- {
- ::flush(cout);
- cerr << "Could not create the service factory !\n\n";
- return 1;
- }
- cout << "Service factory created !\n---------------------------------------------------------------" << endl;
-
- Sequence< Any > aCPArgs = createSequence(OUString::createFromAscii("Administrator"), OUString());
-
- Reference< XMultiServiceFactory > xCfgProvider(
- xORB->createInstanceWithArguments(
- ::rtl::OUString::createFromAscii("com.sun.star.configuration.AdministrationProvider"),
- aCPArgs),
- UNO_QUERY);
-
- if (!xCfgProvider.is())
- {
- ::flush(cout);
- cerr << "Could not create the configuration provider !\n\n";
- return 3;
- }
-
- cout << "Configuration Provider created !\n---------------------------------------------------------------" << endl;
-
- Reference< XNameAccess > xUpdateAccess;
- Reference< XNameAccess > xGroupAccess(xCfgProvider->createInstance(OUString::createFromAscii("com.sun.star.configuration.GroupAccess")),UNO_QUERY);
- Reference< XNameAccess > xUserAccess(xCfgProvider->createInstance(OUString::createFromAscii("com.sun.star.configuration.UserAccess")),UNO_QUERY);
-
- displayGroups(xGroupAccess);
- displayUsers(xUserAccess);
-
-// create a group
- OUString sGroupName = insertGroup(xGroupAccess);
-// create a user
- OUString sUserName;
- sUserName = insertUser(xUserAccess, sGroupName);
-
-// now do updates for the user
- xUpdateAccess = beginChanges(xCfgProvider, OUString::createFromAscii("org.openoffice.Inet"), sUserName);
-
- update(xUpdateAccess, OUString::createFromAscii("Proxy/FTP/Port"), sal_Int32(12));
- update(xUpdateAccess, OUString::createFromAscii("Proxy/FTP/Name"), OUString::createFromAscii("demo"));
- update(xUpdateAccess, OUString::createFromAscii("DNS/IP_Address"), OUString::createFromAscii("demo1"));
-
- xUpdateAccess = beginChanges(xCfgProvider, OUString::createFromAscii("org.openoffice.Office.Common"), sUserName);
- update(xUpdateAccess, OUString::createFromAscii("_3D_Engine/Dithering"), sal_Bool(sal_False));
- commitChanges(xUpdateAccess);
-
-// now do updates with inserting and removing of nodes
-
- xUpdateAccess = beginChanges(xCfgProvider, OUString::createFromAscii("org.openoffice.Security/MountPoints"), sUserName);
- displayTree(xUpdateAccess);
-
- Reference< XHierarchicalPropertySet > xTree = insertTree(xUpdateAccess, OUString());
- update(xUpdateAccess, OUString::createFromAscii("InstallationDirectory/Directory"), OUString::createFromAscii("Test1"));
- removeTree(xUpdateAccess, OUString());
- commitChanges(xUpdateAccess);
-
-
-/* deleteUser(xUserAccess, sUserName);
- deleteGroup(xGroupAccess, sGroupName); */
-
- displayGroups(xGroupAccess);
- displayUsers(xUserAccess);
- }
- catch (Exception& e)
- {
- ::flush(cout);
- cerr << "Caught exception: " << e.Message << endl;
- return 1;
- }
-/*
- catch (...)
- {
- flush(cout);
- cerr << "BUG: Caught UNKNOWN exception (?) " << endl;
- }
-*/
- return 0;
-}
-
-
-
-
diff --git a/configmgr/workben/apitest/cfgapi.cxx b/configmgr/workben/apitest/cfgapi.cxx
deleted file mode 100644
index 373ac440bb..0000000000
--- a/configmgr/workben/apitest/cfgapi.cxx
+++ /dev/null
@@ -1,865 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#define _PRIVATE_TEST_
-
-#include <iostream>
-using namespace std;
-
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/uno/Type.hxx>
-#include <com/sun/star/uno/TypeClass.hpp>
-
-#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/container/XHierarchicalName.hpp>
-#include <com/sun/star/container/XNamed.hpp>
-#include <com/sun/star/container/XNameReplace.hpp>
-#include <com/sun/star/container/XChild.hpp>
-#include <com/sun/star/beans/XExactName.hpp>
-#include <com/sun/star/util/XChangesBatch.hpp>
-
-
-#include <rtl/ustring.hxx>
-#include <rtl/string.hxx>
-#include <cppuhelper/servicefactory.hxx>
-#include <com/sun/star/uno/Sequence.h>
-#include <com/sun/star/uno/Any.h>
-#include <osl/profile.hxx>
-#include <osl/process.h>
-#include <osl/file.h>
-
-#include "createpropertyvalue.hxx"
-
-#include "typeconverter.hxx"
-
-// #include <com/sun/star/configuration/XConfigurationSync.hpp>
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::beans;
-//using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::util;
-
-using ::rtl::OUString;
-using ::rtl::OString;
-//using namespace ::configmgr;
-
-using namespace ::cppu;
-
-#define ASCII(x) ::rtl::OUString::createFromAscii(x)
-
-ostream& operator << (ostream& out, rtl::OUString const& aStr)
-{
- sal_Unicode const* const pStr = aStr.getStr();
- sal_Unicode const* const pEnd = pStr + aStr.getLength();
- for (sal_Unicode const* p = pStr; p < pEnd; ++p)
- if (0 < *p && *p < 127) // ASCII
- out << char(*p);
- else
- out << "[\\u" << hex << *p << "]";
- return out;
-}
-
-void showSequence(const Sequence<OUString> &aSeq)
-{
- OUString aArray;
- const OUString *pStr = aSeq.getConstArray();
- for (int i=0;i<aSeq.getLength();i++)
- {
- OUString aStr = pStr[i];
- // aArray += aStr + ASCII(", ");
- cout << aStr << endl;
- }
- volatile int dummy = 0;
-}
-
-//=============================================================================
-
-inline void operator <<= (::rtl::OUString& _rUnicodeString, const sal_Char* _pAsciiString)
-{
- _rUnicodeString = ::rtl::OUString::createFromAscii(_pAsciiString);
-}
-
-inline void operator <<= (::rtl::OUString& _rUnicodeString, const ::rtl::OString& _rAsciiString)
-{
- _rUnicodeString <<= _rAsciiString.getStr();
-}
-
-inline void operator <<= (Any& _rUnoValue, const sal_Char* _pAsciiString)
-{
- _rUnoValue <<= ::rtl::OUString::createFromAscii(_pAsciiString);
-}
-
-inline void operator <<= (Any& _rUnoValue, const ::rtl::OString& _rAsciiString)
-{
- _rUnoValue <<= _rAsciiString.getStr();
-}
-
-//=============================================================================
-void test_read_access(Reference< XInterface >& xIface, Reference< XMultiServiceFactory > &xMSF);
-//=============================================================================
-struct prompt_and_wait
-{
- char const* myText;
- prompt_and_wait(char const* text = "") : myText(text) {}
- ~prompt_and_wait()
- {
- cout << myText << ">" << endl;
- int const mx = int( (+0u - +1u) >> 1);
-
- char c=0;
- if (cin.get(c) && c != '\n')
- cin.ignore(mx,'\n');
- }
-};
-static prompt_and_wait exit_prompt("Quitting\nQ");
-
-
-Reference< XChangesBatch > xChangesBatch = NULL;
-void commit()
-{
- if (xChangesBatch.is())
- {
- xChangesBatch->commitChanges();
- }
-}
-
-// -----------------------------------------------------------------------------
-static sal_Bool s_bInitialized = sal_False;
-#ifdef LLA_PRIVAT_DEBUG
-static const sal_Char* s_pSourcePath = "l:/src625/configmgr/workben/local_io/share";
-static const sal_Char* s_pUpdatePath = "l:/src625/configmgr/workben/local_io/user";
-static const sal_Char* s_pRootNode = "org.openoffice.ucb.Hierarchy"; // "org.openoffice.test";
-static const sal_Char* s_pServerType = "local";
-static const sal_Char* s_pLocale = "de-DE";
-static const sal_Char* s_pServer = "";
-static const sal_Char* s_pUser = "";
-static const sal_Char* s_pPassword = "";
-#else
-static const sal_Char* s_pSourcePath = "g:/src/configmgr/workben/local_io/share";
-static const sal_Char* s_pUpdatePath = "g:/src/configmgr/workben/local_io/user";
-static const sal_Char* s_pRootNode = "org.openoffice.Office.TypeDetection";
-static const sal_Char* s_pServerType = "setup";
-static const sal_Char* s_pLocale = "de-DE";
-static const sal_Char* s_pServer = "lautrec-3108:19205";
-static const sal_Char* s_pUser = "lars";
-static const sal_Char* s_pPassword = "";
-#endif
-
-
-// -----------------------------------------------------------------------------
-static void loadDefaults()
-{
- if (s_bInitialized)
- return;
-
- s_bInitialized = sal_True;
-
- try
- {
- // the executable file name
- ::rtl::OUString sExecutable;
- osl_getExecutableFile(&sExecutable.pData);
- // cut the name, add a cfgapi.ini to the path
- sal_Int32 nLastSep = sExecutable.lastIndexOf('/');
- if (-1 != nLastSep)
- sExecutable = sExecutable.copy(0, nLastSep + 1);
-#ifdef UNX
- sExecutable += ::rtl::OUString::createFromAscii("cfgapirc");
-#else
- sExecutable += ::rtl::OUString::createFromAscii("cfgapi.ini");
-#endif
- ::rtl::OUString sNormalized;
- sNormalized = sExecutable;
- if (1)
- {
- ::osl::Profile aProfile(sNormalized);
-
- static ::rtl::OString sSection("defaults");
- static ::rtl::OString sSourcePath("sourcepath");
- static ::rtl::OString sUpdatePath("updatepath");
- static ::rtl::OString sRootNode("rootnode");
- static ::rtl::OString sServerType("servertype");
- static ::rtl::OString sLocale("Locale");
- static ::rtl::OString sServer("Server");
- static ::rtl::OString sUser("User");
- static ::rtl::OString sPassword("Password");
-
- // read some strings.
- // Do this static because we want to redirect the global static character pointers to the buffers.
- static ::rtl::OString s_sSourcePath = aProfile.readString(sSection, sSourcePath, s_pSourcePath);
- static ::rtl::OString s_sUpdatePath = aProfile.readString(sSection, sUpdatePath, s_pUpdatePath);
- static ::rtl::OString s_sRootNode = aProfile.readString(sSection, sRootNode, s_pRootNode);
- static ::rtl::OString s_sServerType = aProfile.readString(sSection, sServerType, s_pServerType);
- static ::rtl::OString s_sLocale = aProfile.readString(sSection, sLocale, s_pLocale);
- static ::rtl::OString s_sServer = aProfile.readString(sSection, sServer, s_pServer);
- static ::rtl::OString s_sUser = aProfile.readString(sSection, sUser, s_pUser);
- static ::rtl::OString s_sPassword = aProfile.readString(sSection, sPassword, s_pPassword);
-
- // do this redirection
- s_pSourcePath = s_sSourcePath.getStr();
- s_pUpdatePath = s_sUpdatePath.getStr();
- s_pRootNode = s_sRootNode.getStr();
- s_pServerType = s_sServerType.getStr();
- s_pLocale = s_sLocale.getStr();
- s_pServer = s_sServer.getStr();
- s_pUser = s_sUser.getStr();
- s_pPassword = s_sPassword.getStr();
- }
- }
- catch(std::exception& e)
- {
- e.what(); // silence warnings
- }
-}
-
-// -----------------------------------------------------------------------------
-Sequence<Any> createSequence(const OUString &sUser, const OUString &sPasswd)
-{
- Sequence< Any > aCPArgs;
-
- if (sUser.getLength() > 0)
- {
- aCPArgs.realloc(1);
- aCPArgs[0] <<= configmgr::createPropertyValue(ASCII("user"), sUser);
- }
- if (sPasswd.getLength() > 0)
- {
- aCPArgs.realloc(2);
- aCPArgs[1] <<= configmgr::createPropertyValue(ASCII("password"), sPasswd);
- }
- return aCPArgs;
-}
-
-//=============================================================================
-#include <string.h>
-#if (defined UNX) || (defined OS2)
-#else
-#include <conio.h>
-#endif
-
-OString input(const char* pDefaultText, char cEcho)
-{
- // PRE: a Default Text would be shown, cEcho is a Value which will show if a key is pressed.
- const int MAX_INPUT_LEN = 500;
- char aBuffer[MAX_INPUT_LEN];
-
- strcpy(aBuffer, pDefaultText);
- int nLen = strlen(aBuffer);
-
-#ifdef WNT
- char ch = '\0';
-
- cout << aBuffer;
- cout.flush();
-
- while(ch != 13)
- {
- ch = getch();
- if (ch == 8)
- {
- if (nLen > 0)
- {
- cout << "\b \b";
- cout.flush();
- --nLen;
- aBuffer[nLen] = '\0';
- }
- else
- {
- cout << "\a";
- cout.flush();
- }
- }
- else if (ch != 13)
- {
- if (nLen < MAX_INPUT_LEN)
- {
- if (cEcho == 0)
- {
- cout << ch;
- }
- else
- {
- cout << cEcho;
- }
- cout.flush();
- aBuffer[nLen++] = ch;
- aBuffer[nLen] = '\0';
- }
- else
- {
- cout << "\a";
- cout.flush();
- }
- }
- }
-#else
- if (!cin.getline(aBuffer,sizeof aBuffer))
- return OString();
-#endif
- return OString(aBuffer);
-}
-
-// -----------------------------------------------------------------------------
-rtl::OUString enterValue(const char* _aStr, const char* _aDefault, bool _bIsAPassword)
-{
- cout << _aStr;
- cout.flush();
-
- OUString sValue;
- sValue <<= input(_aDefault, _bIsAPassword ? '*' : 0);
- return sValue;
-}
-
-
-
-// -----------------------------------------------------------------------------
-// ---------------------------------- M A I N ----------------------------------
-// -----------------------------------------------------------------------------
-
-#if (defined UNX) || (defined OS2)
-int main( int argc, char * argv[] )
-#else
-int _cdecl main( int argc, char * argv[] )
-#endif
-{
- TimeValue aTimeout;
- aTimeout.Seconds = 5;
- aTimeout.Nanosec = 0;
-
- // cout << " Please insert Text: ";
- // cout.flush();
- // OString aTxt = input("Der Text", 0);
- // cout << endl << "You inserted: " << aTxt.getStr() << endl;
- //
- // cout << "Please insert Password: ";
- // cout.flush();
- // OString aPasswd = input("", '*');
- // cout << endl << "You inserted: " << aPasswd.getStr() << endl;
-
- loadDefaults();
-
- try
- {
- OUString const sServiceRegistry = OUString::createFromAscii( argc > 1 ? argv[1] : "applicat.rdb" );
- Reference< XMultiServiceFactory > xORB = createRegistryServiceFactory(
- sServiceRegistry,
- ::rtl::OUString()
- );
- if (!xORB.is())
- {
- ::flush(cout);
- cerr << "Could not create the service factory !\n\n";
- return 1;
- }
- cout << "Service factory created !\n---------------------------------------------------------------" << endl;
-
- Sequence< Any > aCPArgs;
-
- OUString sServerType = enterValue("servertype: ", s_pServerType, false);
- cout << endl;
-
-
- rtl::OUString sUser;
-
- bool bLocal = sServerType.equalsIgnoreAsciiCase(ASCII("local")) || sServerType.equalsIgnoreAsciiCase(ASCII("setup"));
- if (!bLocal)
- {
- rtl::OUString sServer;
- sServer = enterValue("server : ", s_pServer,false);
- cout << endl;
-
- sUser = enterValue("user : ", s_pUser, false);
- cout << endl;
-
- OUString sPasswd = enterValue("password: ", s_pPassword, true);
- cout << endl;
-
- aCPArgs = createSequence(sUser, sPasswd);
-
- aCPArgs.realloc(aCPArgs.getLength() + 1);
- aCPArgs[aCPArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("server"), sServer);
-
- OUString sTimeout = ASCII("10000");
- aCPArgs.realloc(aCPArgs.getLength() + 1);
- aCPArgs[aCPArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("timeout"), sTimeout);
-
- }
- else
- {
- rtl::OUString sSharePath, sUserPath;
- sSharePath = enterValue("share path: ", s_pSourcePath, false);
- cout << endl;
- sUserPath = enterValue("user path : ", s_pUpdatePath, false);
- cout << endl;
-
- aCPArgs.realloc(aCPArgs.getLength() + 1);
- sal_Int32 nCount = aCPArgs.getLength() - 1;
- Any *pAny = &aCPArgs[nCount];
- *pAny <<= configmgr::createPropertyValue(ASCII("sourcepath"), sSharePath);
- aCPArgs.realloc(aCPArgs.getLength() + 1);
- aCPArgs[aCPArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("updatepath"), sUserPath);
- }
-
- aCPArgs.realloc(aCPArgs.getLength() + 1);
- aCPArgs[aCPArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("servertype"), sServerType);
-
- Reference< XMultiServiceFactory > xCfgProvider(
- xORB->createInstanceWithArguments(
- ::rtl::OUString::createFromAscii("com.sun.star.configuration.ConfigurationProvider"),
- aCPArgs),
- UNO_QUERY);
- if (!xCfgProvider.is())
- {
- ::flush(cout);
- cerr << "Could not create the configuration provider !\n\n";
- return 3;
- }
-
-
-
-
- char aPath[300] = "/";
- int nStart = sizeof( "/" ) - 1;
-
- cout << "---------------------------------------------------------------\n Configuration Provider created !\n---------------------------------------------------------------" << endl;
-
- Sequence< Any > aArgs;
- aArgs = createSequence(sUser, ASCII(""));
-
- OUString sPath = enterValue("nodepath: ", s_pRootNode, false);
- cout << endl;
-
- aArgs.realloc(aArgs.getLength() + 1);
- aArgs[aArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("nodepath"), sPath);
-
- if (!bLocal)
- {
- OUString sLocale = enterValue("locale : ", s_pLocale, false);
- cout << endl;
- aArgs.realloc(aArgs.getLength() + 1);
- aArgs[aArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("locale"), sLocale);
- }
-/*
-#else
- OUString aStr = ASCII("String");
- sal_Int32 nDepth = 10;
- Sequence< Any > aArgs(2);
-
- aArgs[0] <<= aStr;
- aArgs[1] <<= nDepth;
-#endif
-*/
- Reference< XInterface > xIFace = xCfgProvider->createInstanceWithArguments(
- OUString::createFromAscii("com.sun.star.configuration.ConfigurationUpdateAccess"),
- aArgs);
- cout << "---------------------------------------------------------------\n Configuration Read/Write Access created !\n---------------------------------------------------------------" << endl;
-
- xChangesBatch = Reference< XChangesBatch >(xIFace, UNO_QUERY);
-
- Sequence<OUString> aSeq = xCfgProvider->getAvailableServiceNames();
- showSequence(aSeq);
-
- test_read_access(xIFace, xCfgProvider);
- }
- catch (Exception& e)
- {
- ::flush(cout);
- cerr << "Caught exception: " << e.Message << endl;
- }
-/*
- catch (...)
- {
- flush(cout);
- cerr << "BUG: Caught UNKNOWN exception (?) " << endl;
- }
-*/
- return 0;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////
-void test(Reference< XHierarchicalName >& xAccessName)
-{
- if (xAccessName.is())
- cout << "Accessing Node: " << xAccessName->getHierarchicalName();
- else
- cout << "BUG: XHierarchicalName not available";
- cout << endl;
-}
-void test(Reference< XNamed >& xAccess)
-{
- if (xAccess.is())
- cout << "Node is named: " << xAccess->getName();
- else
- cout << "BUG: XNamed not available";
- cout << endl;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////
-void write(Reference<XNameAccess >& xAccess)
-{
- if (xAccess.is())
- {
- Sequence<OUString> aNames( xAccess->getElementNames() );
-
- cout << "Element Names: (" << aNames.getLength() << ")";
- for (int i = 0; i < aNames.getLength(); ++i)
- cout << "\n[" << i << "] -\t" << aNames[i];
- cout << endl;
- }
- else
- cout << "BUG: XNameAccess not available";
- cout << endl;
-}
-void write(Reference< XChild >& xChild)
-{
- if (xChild.is())
- cout << "\n[ P ] -\tParent";
- else
- cout << "BUG: Parent not available (no XChild)";
- cout << endl;
-}
-///////////////////////////////////////////////////////////////////////////////////////////
-
-bool ask(Reference< XInterface >& xIface, Reference<XMultiServiceFactory> &);
-
-void test_read_access(Reference< XInterface >& xIface, Reference< XMultiServiceFactory > &xMSF)
-{
- using com::sun::star::uno::UNO_QUERY;
- do
- {
- cout << "\n\n---------------------------------------------------------------" << endl;
- Reference< XNameAccess > xAccess(xIface, UNO_QUERY);
- Reference< XChild > xChild(xIface, UNO_QUERY);
- Reference< XHierarchicalName > xAccessPath(xIface,UNO_QUERY);
- Reference< XNamed > xAccessName(xIface,UNO_QUERY);
-// Reference< XHierarchicalNameAccess >& xAccess(xIface, UNO_QUERY);
-
- test(xAccessPath);
- test(xAccessName);
- write(xAccess);
- write(xChild);
- }
- while (ask(xIface, xMSF));
-}
-
-bool ask(Reference< XInterface >& xIface, Reference< XMultiServiceFactory > &xMSF)
-{
- cout << "\n[ Q ] -> <Quit>";
- cout << "\n[ S ] -> <SetValue> ";
- cout << endl;
-
- cout << "\n:> " << flush;
- char buf[200] = {0};
- try
- {
- bool bHandled = false;
- bool bInserted = false;
-
- if (cin.getline(buf,sizeof buf))
- {
- Reference< XInterface > xNext;
- if ((buf[0] == 'q' || buf[0] == 'Q') && (0 == buf[1]))
- {
- return false;
- }
- else if (buf[0] == 0)
- {
- return true;
- }
- else if((buf[0] == 0 || buf[0] == 'o' || buf[0] == 'O') && (0 == buf[1]))
- {
-/*
- cout << "work Offline" << endl;
- Reference<com::sun::star::configuration::XConfigurationSync> xSync(xMSF, UNO_QUERY);
-
- Sequence< Any > aArgs2(5);
- sal_Int32 n=0;
- aArgs2[n++] <<= configmgr::createPropertyValue(ASCII("path"), ASCII("org.openoffice.Setup"));
- // aArgs2[n++] <<= configmgr::createPropertyValue(ASCII("path"), ASCII("org.openoffice.Office.Common"));
- // aArgs2[n++] <<= configmgr::createPropertyValue(ASCII("path"), ASCII("org.openoffice.Office.Java"));
- // aArgs2[n++] <<= configmgr::createPropertyValue(ASCII("path"), ASCII("org.openoffice.Office.Writer"));
- // aArgs2[n++] <<= configmgr::createPropertyValue(ASCII("path"), ASCII("org.openoffice.Office.ucb.Hierarchy"));
- xSync->offline(aArgs2);
- bHandled = true;
-*/
- }
- else if((buf[0] == 0 || buf[0] == 's' || buf[0] == 'S') && (0 == buf[1]))
- {
- // Replace a Value
- Reference< XNameAccess > xAccess(xIface, UNO_QUERY);
-
- cout << "SetMode, insert a Number" << endl;
- cin.getline(buf,sizeof buf);
- bInserted = true;
- }
-
- else if ((buf[0] == 'p' || buf[0] == 'P') && (0 == buf[1]))
- {
- Reference< XChild > xChild(xIface, UNO_QUERY);
- if (xChild.is())
- xNext = xChild->getParent();
- bHandled = true;
- }
-
- if (bHandled == false)
- {
- Reference< XNameAccess > xAccess(xIface, UNO_QUERY);
- Reference< XHierarchicalNameAccess > xDeepAccess(xIface, UNO_QUERY);
- Reference< XExactName > xExactName(xIface, UNO_QUERY);
-
- if (xAccess.is() || xDeepAccess.is())
- {
- OUString aName;
- OUString aInput = OUString::createFromAscii(buf);
-
- if (xExactName.is())
- {
- ::rtl::OUString sTemp = xExactName->getExactName(aInput);
- if (sTemp.getLength())
- aInput = sTemp;
- }
-
- if (xAccess.is() && xAccess->hasByName(aInput))
- {
- aName = aInput;
- }
- else if (xDeepAccess.is() && xDeepAccess->hasByHierarchicalName(aInput))
- {
- aName = aInput;
- }
- else if ('0' <= buf[0] && buf[0] <= '9' && xAccess.is())
- {
- unsigned int n = unsigned(atoi(buf));
- Sequence<OUString> aNames = xAccess->getElementNames();
- if (n < aNames.getLength())
- aName = aNames[n];
- }
-
- if (aName.getLength())
- {
- bool bNest = aInput.indexOf(sal_Unicode('/')) >= 0;
-
- Any aElement = bNest ? ( xDeepAccess.is() ? xDeepAccess->getByHierarchicalName(aName) : Any())
- : ( xAccess. is() ? xAccess-> getByName(aName) : Any() );
-
- while (aElement.getValueTypeClass() == TypeClass_ANY)
- {
- Any aWrap(aElement);
- aWrap >>= aElement;
- }
- sal_Bool bValue = true;
- sal_Bool bValueOk = false;
-
- switch (aElement.getValueTypeClass() )
- {
- case TypeClass_INTERFACE: bValue = false; break;
- case TypeClass_BOOLEAN:
- {
- sal_Bool* pVal = (sal_Bool*)aElement.getValue();
- bValueOk = (pVal != 0);
-
- cout << "VALUE '" << aName << "' is a BOOLEAN = ";
- if (!bValueOk)
- cout << "NULL (error!!)";
- else if (*pVal)
- cout << "'TRUE'";
- else
- cout << "'FALSE'";
-
- cout << endl;
- }
- break;
- case TypeClass_SHORT:
- {
- sal_Int16 aValue;
- cout << "VALUE '" << aName << "' is a SHORT (16 bit) = ";
- if (bValueOk = (aElement >>= aValue))
- cout << aValue;
- else
- cout << "ERROR RETRIEVING VALUE";
- cout << endl;
- }
- break;
- case TypeClass_LONG:
- {
-
- sal_Int32 aValue;
- cout << "VALUE '" << aName << "' is a INT (32 bit) = ";
- if (bValueOk = (aElement >>= aValue))
- cout << aValue;
- else
- cout << "ERROR RETRIEVING VALUE";
- cout << endl;
- }
- break;
- case TypeClass_HYPER:
- {
- sal_Int64 aValue;
- cout << "VALUE '" << aName << "' is a LONG (64 bit) = ";
- if (bValueOk = (aElement >>= aValue))
- cout << double(aValue);
- else
- cout << "ERROR RETRIEVING VALUE";
- cout << endl;
- }
- break;
- case TypeClass_DOUBLE:
- {
- double aValue;
- cout << "VALUE '" << aName << "' is a DOUBLE = ";
- if (bValueOk = (aElement >>= aValue))
- cout << aValue;
- else
- cout << "ERROR RETRIEVING VALUE";
- cout << endl;
- }
- break;
- case TypeClass_STRING:
- {
- OUString aValue;
- cout << "VALUE '" << aName << "' is a STRING = ";
- if (bValueOk = (aElement >>= aValue))
- cout << "\"" << aValue << "\"";
- else
- cout << "ERROR RETRIEVING VALUE";
- cout << endl;
- }
- break;
- case TypeClass_SEQUENCE:
- {
- cout << "VALUE '" << aName << "' is a SEQUENCE or BINARY" << endl;
-
- Type aTypeS = configmgr::getSequenceElementType(aElement.getValueType());
- OUString sType = configmgr::toTypeName(aTypeS.getTypeClass());
- cout << "Real type is Sequence<" << sType << ">" << endl;
- bValueOk = true;
- }
- break;
- case TypeClass_VOID:
- cout << "ELEMENT '" << aName << "' is NULL and VOID " << endl;
- bValueOk = true;
- break;
- default:
- cout << "Error: ELEMENT '" << aName << "' is of unknown or unrecognized type" << endl;
- break;
- }
- if (bValue)
- {
- if (bInserted)
- {
- if (aElement.getValueTypeClass() == TypeClass_BOOLEAN ||
- aElement.getValueTypeClass() == TypeClass_VOID)
- {
- cout << "Set Value (Type=BOOL) to :";
- cout.flush();
- cin.getline(buf,sizeof buf);
- OUString aInput = OUString::createFromAscii(buf);
- sal_Bool bValue = false;
- if (aInput.equalsIgnoreAsciiCase(ASCII("true")))
- bValue = true;
-
- OUString aStr = ASCII("false");
- Any aValueAny;
- aValueAny <<= bValue;
-
- Reference< XNameReplace > xNameReplace(xAccess, UNO_QUERY);
- if (xNameReplace.is())
- {
- xNameReplace->replaceByName(aName, aValueAny);
- commit();
- }
- bInserted = false;
- }
- else if (aElement.getValueTypeClass() == TypeClass_STRING)
- {
- cout << "set value (type = string) to : ";
- cout.flush();
- cin.getline(buf,sizeof buf);
- Any aValue;
- aValue <<= buf;
-
- Reference< XNameReplace > xNameReplace(xAccess, UNO_QUERY);
- if (xNameReplace.is())
- {
- xNameReplace->replaceByName(aName, aValue);
- commit();
- }
- bInserted = false;
- }
- else
- {
- cout << "Sorry, only BOOLEAN Values can changed today." << endl;
- }
- }
- prompt_and_wait();
- return bValueOk ? true : false;
- }
-
- if (aElement >>= xNext)
- cout << "Got an Interface for '" << aName << "'" << endl;
- else
- cout << "Error: Cannot get an Interface for '" << aName << "'" << endl;
- }
- else
- {
- cout << "Error: No element \"" << aInput << "\" found." <<endl;
- }
- }
-
- }
- if (xNext.is())
- {
- xIface = xNext;
- return true;
- }
- cout << "Error: could not obtain the requested Object " << endl;
- }
- else
- {
- cout << "Input Error " << endl;
- return true;
- }
- }
- catch (Exception& e)
- {
- cout << "An Exception occurred: " << e.Message << endl;
-
- }
- catch (...)
- {
- cout << "An UNKNOWN Exception occurred !" << endl;
- }
-
- prompt_and_wait();
- return true;
-}
diff --git a/configmgr/workben/apitest/cfgapi_timetest.cxx b/configmgr/workben/apitest/cfgapi_timetest.cxx
deleted file mode 100644
index 0775413431..0000000000
--- a/configmgr/workben/apitest/cfgapi_timetest.cxx
+++ /dev/null
@@ -1,957 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#define _PRIVATE_TEST_
-
-#include <iostream>
-using namespace std;
-
-#include <vector>
-
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/uno/Type.hxx>
-#include <com/sun/star/uno/TypeClass.hpp>
-
-#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/container/XHierarchicalName.hpp>
-#include <com/sun/star/container/XNamed.hpp>
-#include <com/sun/star/container/XNameReplace.hpp>
-#include <com/sun/star/container/XChild.hpp>
-#include <com/sun/star/beans/XExactName.hpp>
-#include <com/sun/star/util/XChangesBatch.hpp>
-
-
-#include <rtl/ustring.hxx>
-#include <rtl/string.hxx>
-#include <cppuhelper/servicefactory.hxx>
-#include <com/sun/star/uno/Sequence.h>
-#include <com/sun/star/uno/Any.h>
-#include <osl/profile.hxx>
-#include <osl/process.h>
-#include <osl/file.h>
-
-#include "createpropertyvalue.hxx"
-
-#include "typeconverter.hxx"
-
-// #include <com/sun/star/configuration/XConfigurationSync.hpp>
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::beans;
-//using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::util;
-
-using ::rtl::OUString;
-using ::rtl::OString;
-//using namespace ::configmgr;
-
-using namespace ::cppu;
-
-#define ASCII(x) ::rtl::OUString::createFromAscii(x)
-
-bool m_bInteractive = false;
-
-#define COUT if(m_bInteractive) cout
-
-ostream& operator << (ostream& out, rtl::OUString const& aStr)
-{
- sal_Unicode const* const pStr = aStr.getStr();
- sal_Unicode const* const pEnd = pStr + aStr.getLength();
- for (sal_Unicode const* p = pStr; p < pEnd; ++p)
- if (0 < *p && *p < 127) // ASCII
- out << char(*p);
- else
- out << "[\\u" << hex << *p << "]";
- return out;
-}
-
-void showSequence(const Sequence<OUString> &aSeq)
-{
- OUString aArray;
- const OUString *pStr = aSeq.getConstArray();
- for (int i=0;i<aSeq.getLength();i++)
- {
- OUString aStr = pStr[i];
- // aArray += aStr + ASCII(", ");
- COUT << aStr << endl;
- }
- volatile int dummy = 0;
-}
-
-//=============================================================================
-
-inline void operator <<= (::rtl::OUString& _rUnicodeString, const sal_Char* _pAsciiString)
-{
- _rUnicodeString = ::rtl::OUString::createFromAscii(_pAsciiString);
-}
-
-inline void operator <<= (::rtl::OUString& _rUnicodeString, const ::rtl::OString& _rAsciiString)
-{
- _rUnicodeString <<= _rAsciiString.getStr();
-}
-
-inline void operator <<= (Any& _rUnoValue, const sal_Char* _pAsciiString)
-{
- _rUnoValue <<= ::rtl::OUString::createFromAscii(_pAsciiString);
-}
-
-inline void operator <<= (Any& _rUnoValue, const ::rtl::OString& _rAsciiString)
-{
- _rUnoValue <<= _rAsciiString.getStr();
-}
-
-//=============================================================================
-void test_read_access(Reference< XInterface >& xIface, const Reference< XMultiServiceFactory > &xMSF);
-//=============================================================================
-
-// -----------------------------------------------------------------------------
-struct prompt_and_wait
-{
- char const* myText;
- prompt_and_wait(char const* text = "") : myText(text) {}
- ~prompt_and_wait()
- {
- if (m_bInteractive)
- {
- COUT << myText << ">" << endl;
- int const mx = int( (+0u - +1u) >> 1);
-
- char c=0;
- if (cin.get(c) && c != '\n')
- cin.ignore(mx,'\n');
- }
- }
-};
-static prompt_and_wait exit_prompt("Quitting\nQ");
-
-
-Reference< XChangesBatch > xChangesBatch = NULL;
-void commit()
-{
- if (xChangesBatch.is())
- {
- xChangesBatch->commitChanges();
- }
-}
-
-// -----------------------------------------------------------------------------
-static sal_Bool s_bInitialized = sal_False;
-static const sal_Char* s_pSourcePath = "f:/office60_623/share/config/registry";
-static const sal_Char* s_pUpdatePath = "f:/office60_623/user/config/registry";
-static const sal_Char* s_pRootNode = "org.openoffice.Office.Common";
-static const sal_Char* s_pServerType = "local";
-static const sal_Char* s_pLocale = "de-DE";
-static const sal_Char* s_pServer = "lautrec-3108:19205";
-static const sal_Char* s_pUser = "lars";
-static const sal_Char* s_pPassword = "";
-
-std::vector<rtl::OString> m_sNodes;
-
-// -----------------------------------------------------------------------------
-static void loadDefaults()
-{
- if (s_bInitialized)
- return;
-
- s_bInitialized = sal_True;
-
- try
- {
- // the executable file name
- ::rtl::OUString sExecutable;
- osl_getExecutableFile(&sExecutable.pData);
- // cut the name, add a cfgapi.ini to the path
- sal_Int32 nLastSep = sExecutable.lastIndexOf('/');
- if (-1 != nLastSep)
- sExecutable = sExecutable.copy(0, nLastSep + 1);
-#ifdef UNX
- sExecutable += ::rtl::OUString::createFromAscii("cfgapirc");
-#else
- sExecutable += ::rtl::OUString::createFromAscii("cfgapi.ini");
-#endif
- ::rtl::OUString sSystem;
- if (osl_File_E_None == osl_getSystemPathFromFileURL(sExecutable.pData, &sSystem.pData))
- {
- ::osl::Profile aProfile(sExecutable);
-
- static ::rtl::OString sSection("defaults");
- static ::rtl::OString sSourcePath("sourcepath");
- static ::rtl::OString sUpdatePath("updatepath");
- static ::rtl::OString sRootNode("rootnode");
- static ::rtl::OString sServerType("servertype");
- static ::rtl::OString sLocale("Locale");
- static ::rtl::OString sServer("Server");
- static ::rtl::OString sUser("User");
- static ::rtl::OString sPassword("Password");
-
- // read some strings.
- // Do this static because we want to redirect the global static character pointers to the buffers.
- static ::rtl::OString s_sSourcePath = aProfile.readString(sSection, sSourcePath, s_pSourcePath);
- static ::rtl::OString s_sUpdatePath = aProfile.readString(sSection, sUpdatePath, s_pUpdatePath);
- static ::rtl::OString s_sRootNode = aProfile.readString(sSection, sRootNode, s_pRootNode);
- static ::rtl::OString s_sServerType = aProfile.readString(sSection, sServerType, s_pServerType);
- static ::rtl::OString s_sLocale = aProfile.readString(sSection, sLocale, s_pLocale);
- static ::rtl::OString s_sServer = aProfile.readString(sSection, sServer, s_pServer);
- static ::rtl::OString s_sUser = aProfile.readString(sSection, sUser, s_pUser);
- static ::rtl::OString s_sPassword = aProfile.readString(sSection, sPassword, s_pPassword);
-
- // do this redirection
- s_pSourcePath = s_sSourcePath.getStr();
- s_pUpdatePath = s_sUpdatePath.getStr();
- s_pRootNode = s_sRootNode.getStr();
- s_pServerType = s_sServerType.getStr();
- s_pLocale = s_sLocale.getStr();
- s_pServer = s_sServer.getStr();
- s_pUser = s_sUser.getStr();
- s_pPassword = s_sPassword.getStr();
-
- static ::rtl::OString sNodeSection("nodes");
- static ::rtl::OString sCount("count");
- rtl::OUString sCountValue;
- sCountValue <<= aProfile.readString(sNodeSection, sCount, "0");
- sal_Int32 nCount = sCountValue.toInt32();
- for (sal_Int32 i=0;i<nCount;i++)
- {
- ::rtl::OString sNodeName("node");
- sNodeName += OString::valueOf(i);
- ::rtl::OString sNode = aProfile.readString(sNodeSection, sNodeName, "");
- m_sNodes.push_back(sNode);
- }
- }
- }
- catch(std::exception& e)
- {
- e.what(); // silence warnings
- }
-}
-
-// -----------------------------------------------------------------------------
-Sequence<Any> createSequence(const OUString &sUser, const OUString &sPasswd)
-{
- Sequence< Any > aCPArgs;
-
- if (sUser.getLength() > 0)
- {
- aCPArgs.realloc(1);
- aCPArgs[0] <<= configmgr::createPropertyValue(ASCII("user"), sUser);
- }
- if (sPasswd.getLength() > 0)
- {
- aCPArgs.realloc(2);
- aCPArgs[1] <<= configmgr::createPropertyValue(ASCII("password"), sPasswd);
- }
- return aCPArgs;
-}
-
-//=============================================================================
-#include <string.h>
-#if (defined UNX) || (defined OS2)
-#else
-#include <conio.h>
-#endif
-
-OString input(const char* pDefaultText, char cEcho)
-{
- // PRE: a Default Text would be shown, cEcho is a Value which will show if a key is pressed.
- const int MAX_INPUT_LEN = 500;
- char aBuffer[MAX_INPUT_LEN];
-
- strcpy(aBuffer, pDefaultText);
- int nLen = strlen(aBuffer);
-
-#ifdef WNT
- char ch = '\0';
-
- COUT << aBuffer;
- cout.flush();
-
- while(ch != 13)
- {
- ch = getch();
- if (ch == 8)
- {
- if (nLen > 0)
- {
- COUT << "\b \b";
- cout.flush();
- --nLen;
- aBuffer[nLen] = '\0';
- }
- else
- {
- COUT << "\a";
- cout.flush();
- }
- }
- else if (ch != 13)
- {
- if (nLen < MAX_INPUT_LEN)
- {
- if (cEcho == 0)
- {
- COUT << ch;
- }
- else
- {
- COUT << cEcho;
- }
- cout.flush();
- aBuffer[nLen++] = ch;
- aBuffer[nLen] = '\0';
- }
- else
- {
- COUT << "\a";
- cout.flush();
- }
- }
- }
-#else
- if (!cin.getline(aBuffer,sizeof aBuffer))
- return OString();
-#endif
- return OString(aBuffer);
-}
-
-
-// -----------------------------------------------------------------------------
-rtl::OUString enterValue(const char* _aStr, const char* _aDefault, bool _bIsAPassword)
-{
- COUT << _aStr;
- cout.flush();
-
- OUString sValue;
- if (m_bInteractive)
- {
- sValue <<= input(_aDefault, _bIsAPassword ? '*' : 0);
- }
- else
- {
- sValue <<= _aDefault;
- }
- return sValue;
-}
-
-
-
-void ask_for_a_node_and_test_it(const Reference< XMultiServiceFactory > &xCfgProvider,
- const OUString& sUser, const OUString &sPasswd,
- const OUString& sPath, bool bLocal, const OUString &sLocale);
-
-// -----------------------------------------------------------------------------
-// ---------------------------------- M A I N ----------------------------------
-// -----------------------------------------------------------------------------
-
-#if (defined UNX) || (defined OS2)
-int main( int argc, char * argv[] )
-#else
-int _cdecl main( int argc, char * argv[] )
-#endif
-{
- TimeValue aTimeout;
- aTimeout.Seconds = 5;
- aTimeout.Nanosec = 0;
-
- // COUT << " Please insert Text: ";
- // cout.flush();
- // OString aTxt = input("Der Text", 0);
- // COUT << endl << "You inserted: " << aTxt.getStr() << endl;
- //
- // COUT << "Please insert Password: ";
- // cout.flush();
- // OString aPasswd = input("", '*');
- // COUT << endl << "You inserted: " << aPasswd.getStr() << endl;
-
- loadDefaults();
-
- m_bInteractive = false;
- //if (argc > 1)
- //{
- // OString aParam(argv[1]);
- // if (aParam.equals("ask"))
- // {
- // m_bInteractive = true;
- // }
- //}
-
- try
- {
- OUString const sServiceRegistry = OUString::createFromAscii( argc > 1 ? argv[1] : "applicat.rdb" );
- Reference< XMultiServiceFactory > xORB = createRegistryServiceFactory(
- sServiceRegistry,
- ::rtl::OUString()
- );
- if (!xORB.is())
- {
- ::flush(cout);
- cerr << "Could not create the service factory !\n\n";
- return 1;
- }
- COUT << "Service factory created !\n---------------------------------------------------------------" << endl;
-
- Sequence< Any > aCPArgs;
-
- OUString sServerType = enterValue("servertype: ", s_pServerType, false);
- COUT << endl;
-
-
- rtl::OUString sUser, sPasswd;
-
- bool bLocal = sServerType.equalsIgnoreAsciiCase(ASCII("local")) || sServerType.equalsIgnoreAsciiCase(ASCII("setup"));
- if (!bLocal)
- {
- rtl::OUString sServer;
- sServer = enterValue("server : ", s_pServer,false);
- COUT << endl;
-
- sUser = enterValue("user : ", s_pUser, false);
- COUT << endl;
-
- sPasswd = enterValue("password: ", s_pPassword, true);
- COUT << endl;
-
- aCPArgs = createSequence(sUser, sPasswd);
-
- aCPArgs.realloc(aCPArgs.getLength() + 1);
- aCPArgs[aCPArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("server"), sServer);
-
- long nTimeout = 10000;
- aCPArgs.realloc(aCPArgs.getLength() + 1);
- aCPArgs[aCPArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("timeout"), nTimeout);
-
- long nPort = 9205;
- aCPArgs.realloc(aCPArgs.getLength() + 1);
- aCPArgs[aCPArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("port"), nPort);
- }
- else
- {
- rtl::OUString sSharePath, sUserPath;
- sSharePath = enterValue("share path: ", s_pSourcePath, false);
- COUT << endl;
- sUserPath = enterValue("user path : ", s_pUpdatePath, false);
- COUT << endl;
-
- aCPArgs.realloc(aCPArgs.getLength() + 1);
- Any* pAny;
- pAny = &aCPArgs[aCPArgs.getLength() - 1];
- *pAny <<= configmgr::createPropertyValue(ASCII("sourcepath"), sSharePath);
- aCPArgs.realloc(aCPArgs.getLength() + 1);
- aCPArgs[aCPArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("updatepath"), sUserPath);
- }
-
- aCPArgs.realloc(aCPArgs.getLength() + 1);
- aCPArgs[aCPArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("servertype"), sServerType);
-
- Reference< XMultiServiceFactory > xCfgProvider(
- xORB->createInstanceWithArguments(
- ::rtl::OUString::createFromAscii("com.sun.star.configuration.ConfigurationProvider"),
- aCPArgs),
- UNO_QUERY);
- if (!xCfgProvider.is())
- {
- ::flush(cout);
- cerr << "Could not create the configuration provider !\n\n";
- return 3;
- }
-
- cout << "---------------------------------------------------------------\n Configuration Provider created !\n---------------------------------------------------------------" << endl;
-
- OUString sPath;
- sPath <<= s_pRootNode;
- OUString sLocale;
- sLocale <<= s_pLocale;
-
- if (m_bInteractive)
- {
- sPath = enterValue("nodepath: ", s_pRootNode, false);
- COUT << endl;
- if (bLocal)
- {
- sLocale = enterValue("locale : ", s_pLocale, false);
- COUT << endl;
- }
- ask_for_a_node_and_test_it(xCfgProvider, sUser, sPasswd, sPath, bLocal, sLocale);
- }
- else
- {
- sUser <<= "";
- for(std::vector<OString>::const_iterator it = m_sNodes.begin();
- it != m_sNodes.end();
- ++it)
- {
- OUString sPath;
- sPath <<= *it;
- if (sPath.getLength() > 0)
- ask_for_a_node_and_test_it(xCfgProvider, sUser, sPasswd, sPath, bLocal, sLocale);
- }
- }
- }
- catch (Exception& e)
- {
- ::flush(cout);
- cerr << "Caught exception: " << e.Message << endl;
- return 1;
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-void ask_for_a_node_and_test_it(const Reference< XMultiServiceFactory > &xCfgProvider,
- const OUString& sUser, const OUString &sPasswd,
- const OUString& sPath, bool bLocal, const OUString &sLocale)
-{
- try
- {
- Sequence< Any > aArgs;
- aArgs = createSequence(sUser, sPasswd);
-
- aArgs.realloc(aArgs.getLength() + 1);
- aArgs[aArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("nodepath"), sPath);
-
- if (!bLocal)
- {
- aArgs.realloc(aArgs.getLength() + 1);
- aArgs[aArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("locale"), sLocale);
- }
-
- Reference< XInterface > xIFace = xCfgProvider->createInstanceWithArguments(
- OUString::createFromAscii("com.sun.star.configuration.ConfigurationUpdateAccess"),
- aArgs);
- cout << "Configuration Read/Write Access created for :" << sPath << endl;
-
- xChangesBatch = Reference< XChangesBatch >(xIFace, UNO_QUERY);
-
- Sequence<OUString> aSeq = xCfgProvider->getAvailableServiceNames();
- showSequence(aSeq);
-
- test_read_access(xIFace, xCfgProvider);
- }
- catch (Exception& e)
- {
- ::flush(cout);
- cerr << "Caught exception: " << e.Message << endl;
- }
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////
-void test(Reference< XHierarchicalName >& xAccessName)
-{
- if (xAccessName.is())
- {
- COUT << "Accessing Node: " << xAccessName->getHierarchicalName() << endl;
- }
- else
- {
- cerr << "BUG: XHierarchicalName not available" << endl;
- }
-}
-// -----------------------------------------------------------------------------
-void test(Reference< XNamed >& xAccess)
-{
- if (xAccess.is())
- {
- COUT << "Node is named: " << xAccess->getName() << endl;
- }
- else
- cerr << "BUG: XNamed not available" << endl;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////
-void write(Reference<XNameAccess >& xAccess)
-{
- if (xAccess.is())
- {
- Sequence<OUString> aNames( xAccess->getElementNames() );
-
- COUT << "Element Names: (" << aNames.getLength() << ")";
- for (int i = 0; i < aNames.getLength(); ++i)
- {
- COUT << "\n[" << i << "] -\t" << aNames[i];
- }
- COUT << endl;
- }
- else
- cerr << "BUG: XNameAccess not available" << endl;
-}
-// -----------------------------------------------------------------------------
-void write(Reference< XChild >& xChild)
-{
- if (xChild.is())
- {
- COUT << "\n[ P ] -\tParent" << endl;
- }
- else
- cerr << "BUG: Parent not available (no XChild)" << endl;
-}
-///////////////////////////////////////////////////////////////////////////////////////////
-
-bool ask(Reference< XInterface >& xIface, const Reference<XMultiServiceFactory> &);
-
-void test_read_access(Reference< XInterface >& xIface, const Reference< XMultiServiceFactory > &xMSF)
-{
- using com::sun::star::uno::UNO_QUERY;
- do
- {
- COUT << "\n\n---------------------------------------------------------------" << endl;
- Reference< XNameAccess > xAccess(xIface, UNO_QUERY);
- Reference< XChild > xChild(xIface, UNO_QUERY);
- Reference< XHierarchicalName > xAccessPath(xIface,UNO_QUERY);
- Reference< XNamed > xAccessName(xIface,UNO_QUERY);
-// Reference< XHierarchicalNameAccess >& xAccess(xIface, UNO_QUERY);
-
- test(xAccessPath);
- test(xAccessName);
- write(xAccess);
- write(xChild);
-
- if (!m_bInteractive) break;
- }
- while (ask(xIface, xMSF));
-}
-
-bool ask(Reference< XInterface >& xIface, const Reference< XMultiServiceFactory > &xMSF)
-{
- COUT << "\n[ Q ] -> <Quit>";
- COUT << "\n[ S ] -> <SetValue> ";
- COUT << endl;
-
- COUT << "\n:> " << flush;
- char buf[200] = {0};
- try
- {
- bool bHandled = false;
- bool bInserted = false;
-
- if (cin.getline(buf,sizeof buf))
- {
- Reference< XInterface > xNext;
- if ((buf[0] == 'q' || buf[0] == 'Q') && (0 == buf[1]))
- {
- return false;
- }
- else if (buf[0] == 0)
- {
- return true;
- }
- else if((buf[0] == 0 || buf[0] == 'o' || buf[0] == 'O') && (0 == buf[1]))
- {
-/*
- COUT << "work Offline" << endl;
- Reference<com::sun::star::configuration::XConfigurationSync> xSync(xMSF, UNO_QUERY);
-
- Sequence< Any > aArgs2(5);
- sal_Int32 n=0;
- aArgs2[n++] <<= configmgr::createPropertyValue(ASCII("path"), ASCII("org.openoffice.Setup"));
- // aArgs2[n++] <<= configmgr::createPropertyValue(ASCII("path"), ASCII("org.openoffice.Office.Common"));
- // aArgs2[n++] <<= configmgr::createPropertyValue(ASCII("path"), ASCII("org.openoffice.Office.Java"));
- // aArgs2[n++] <<= configmgr::createPropertyValue(ASCII("path"), ASCII("org.openoffice.Office.Writer"));
- // aArgs2[n++] <<= configmgr::createPropertyValue(ASCII("path"), ASCII("org.openoffice.Office.ucb.Hierarchy"));
- xSync->offline(aArgs2);
- bHandled = true;
-*/
- }
- else if((buf[0] == 0 || buf[0] == 's' || buf[0] == 'S') && (0 == buf[1]))
- {
- // Replace a Value
- Reference< XNameAccess > xAccess(xIface, UNO_QUERY);
-
- COUT << "SetMode, insert a Number" << endl;
- cin.getline(buf,sizeof buf);
- bInserted = true;
- }
-
- else if ((buf[0] == 'p' || buf[0] == 'P') && (0 == buf[1]))
- {
- Reference< XChild > xChild(xIface, UNO_QUERY);
- if (xChild.is())
- xNext = xChild->getParent();
- bHandled = true;
- }
-
- if (bHandled == false)
- {
- Reference< XNameAccess > xAccess(xIface, UNO_QUERY);
- Reference< XHierarchicalNameAccess > xDeepAccess(xIface, UNO_QUERY);
- Reference< XExactName > xExactName(xIface, UNO_QUERY);
-
- if (xAccess.is() || xDeepAccess.is())
- {
- OUString aName;
- OUString aInput = OUString::createFromAscii(buf);
-
- if (xExactName.is())
- {
- ::rtl::OUString sTemp = xExactName->getExactName(aInput);
- if (sTemp.getLength())
- aInput = sTemp;
- }
-
- if (xAccess.is() && xAccess->hasByName(aInput))
- {
- aName = aInput;
- }
- else if (xDeepAccess.is() && xDeepAccess->hasByHierarchicalName(aInput))
- {
- aName = aInput;
- }
- else if ('0' <= buf[0] && buf[0] <= '9' && xAccess.is())
- {
- unsigned int n = unsigned(atoi(buf));
- Sequence<OUString> aNames = xAccess->getElementNames();
- if (n < aNames.getLength())
- aName = aNames[n];
- }
-
- if (aName.getLength())
- {
- bool bNest = aInput.indexOf(sal_Unicode('/')) >= 0;
-
- Any aElement = bNest ? ( xDeepAccess.is() ? xDeepAccess->getByHierarchicalName(aName) : Any())
- : ( xAccess. is() ? xAccess-> getByName(aName) : Any() );
-
- while (aElement.getValueTypeClass() == TypeClass_ANY)
- {
- Any aWrap(aElement);
- aWrap >>= aElement;
- }
- sal_Bool bValue = true;
- sal_Bool bValueOk = false;
-
- switch (aElement.getValueTypeClass() )
- {
- case TypeClass_INTERFACE: bValue = false; break;
- case TypeClass_BOOLEAN:
- {
- sal_Bool* pVal = (sal_Bool*)aElement.getValue();
- bValueOk = (pVal != 0);
-
- COUT << "VALUE '" << aName << "' is a BOOLEAN = ";
- if (!bValueOk)
- {
- COUT << "NULL (error!!)";
- }
- else if (*pVal)
- {
- COUT << "'TRUE'";
- }
- else
- {
- COUT << "'FALSE'";
- }
- COUT << endl;
- }
- break;
- case TypeClass_SHORT:
- {
- sal_Int16 aValue;
- COUT << "VALUE '" << aName << "' is a SHORT (16 bit) = ";
- if (bValueOk = (aElement >>= aValue))
- {
- COUT << aValue;
- }
- else
- cerr << "ERROR RETRIEVING VALUE";
- COUT << endl;
- }
- break;
- case TypeClass_LONG:
- {
-
- sal_Int32 aValue;
- COUT << "VALUE '" << aName << "' is a INT (32 bit) = ";
- if (bValueOk = (aElement >>= aValue))
- {
- COUT << aValue;
- }
- else
- cerr << "ERROR RETRIEVING VALUE";
- COUT << endl;
- }
- break;
- case TypeClass_HYPER:
- {
- sal_Int64 aValue;
- COUT << "VALUE '" << aName << "' is a LONG (64 bit) = ";
- if (bValueOk = (aElement >>= aValue))
- {
- COUT << double(aValue);
- }
- else
- cerr << "ERROR RETRIEVING VALUE";
- COUT << endl;
- }
- break;
- case TypeClass_DOUBLE:
- {
- double aValue;
- COUT << "VALUE '" << aName << "' is a DOUBLE = ";
- if (bValueOk = (aElement >>= aValue))
- {
- COUT << aValue;
- }
- else
- cerr << "ERROR RETRIEVING VALUE";
- COUT << endl;
- }
- break;
- case TypeClass_STRING:
- {
- OUString aValue;
- COUT << "VALUE '" << aName << "' is a STRING = ";
- if (bValueOk = (aElement >>= aValue))
- {
- COUT << "\"" << aValue << "\"";
- }
- else
- cerr << "ERROR RETRIEVING VALUE";
- COUT << endl;
- }
- break;
- case TypeClass_SEQUENCE:
- {
- COUT << "VALUE '" << aName << "' is a SEQUENCE or BINARY" << endl;
-
- Type aTypeS = configmgr::getSequenceElementType(aElement.getValueType());
- OUString sType = configmgr::toTypeName(aTypeS.getTypeClass());
- COUT << "Real type is Sequence<" << sType << ">" << endl;
- bValueOk = true;
- }
- break;
- case TypeClass_VOID:
- COUT << "ELEMENT '" << aName << "' is NULL and VOID " << endl;
- bValueOk = true;
- break;
- default:
- cerr << "Error: ELEMENT '" << aName << "' is of unknown or unrecognized type" << endl;
- break;
- }
- if (bValue)
- {
- if (bInserted)
- {
- if (aElement.getValueTypeClass() == TypeClass_BOOLEAN ||
- aElement.getValueTypeClass() == TypeClass_VOID)
- {
- COUT << "Set Value (Type=BOOL) to :";
- cout.flush();
- cin.getline(buf,sizeof buf);
- OUString aInput = OUString::createFromAscii(buf);
- sal_Bool bValue = false;
-
- Any aValueAny;
- if (aInput.equalsIgnoreAsciiCase(ASCII("true")))
- {
- bValue = true;
- aValueAny <<= bValue;
- }
- else if (aInput.equalsIgnoreAsciiCase(ASCII("false")))
- {
- bValue = false;
- aValueAny <<= bValue;
- }
- else if (aInput.equalsIgnoreAsciiCase(ASCII("null")))
- {
- }
-
- Reference< XNameReplace > xNameReplace(xAccess, UNO_QUERY);
- if (xNameReplace.is())
- {
- xNameReplace->replaceByName(aName, aValueAny);
- commit();
- }
- bInserted = false;
- }
- else if (aElement.getValueTypeClass() == TypeClass_STRING)
- {
- COUT << "set value (type = string) to : ";
- cout.flush();
- cin.getline(buf,sizeof buf);
- Any aValue;
- aValue <<= buf;
-
- Reference< XNameReplace > xNameReplace(xAccess, UNO_QUERY);
- if (xNameReplace.is())
- {
- xNameReplace->replaceByName(aName, aValue);
- commit();
- }
- bInserted = false;
- }
- else
- {
- cerr << "Sorry, only BOOLEAN Values can changed today." << endl;
- }
- }
- prompt_and_wait();
- return bValueOk ? true : false;
- }
-
- if (aElement >>= xNext)
- {
- COUT << "Got an Interface for '" << aName << "'" << endl;
- }
- else
- cerr << "Error: Cannot get an Interface for '" << aName << "'" << endl;
- }
- else
- {
- cerr << "Error: No element \"" << aInput << "\" found." <<endl;
- }
- }
-
- }
- if (xNext.is())
- {
- xIface = xNext;
- return true;
- }
- cerr << "Error: could not obtain the requested Object " << endl;
- }
- else
- {
- COUT << "Input Error " << endl;
- return true;
- }
- }
- catch (Exception& e)
- {
- cerr << "An Exception occurred: " << e.Message << endl;
-
- }
- catch (...)
- {
- cerr << "An UNKNOWN Exception occurred !" << endl;
- }
-
- prompt_and_wait();
- return true;
-}
diff --git a/configmgr/workben/apitest/cfgregistry.cxx b/configmgr/workben/apitest/cfgregistry.cxx
deleted file mode 100644
index 2bd7d5475b..0000000000
--- a/configmgr/workben/apitest/cfgregistry.cxx
+++ /dev/null
@@ -1,169 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <memory.h>
-#include <stdio.h>
-#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
-#include <com/sun/star/container/XNameReplace.hpp>
-#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
-#include <com/sun/star/container/XChild.hpp>
-#include <com/sun/star/util/XChangesBatch.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/registry/XSimpleRegistry.hpp>
-#include <com/sun/star/util/XFlushable.hpp>
-#include <cppuhelper/servicefactory.hxx>
-#include <cppuhelper/implbase1.hxx>
-#ifndef _CPPUHELPER_EXTRACT_HXX_
-#include <cppuhelper/extract.hxx>
-#endif
-#include <vos/conditn.hxx>
-#include <osl/diagnose.h>
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::xml;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::registry;
-using namespace ::vos;
-using namespace ::cppu;
-//using namespace ::configmgr;
-
-//=============================================================================
-//= a dirty littly class for printing ascii characters
-//=============================================================================
-class OAsciiOutput
-{
-protected:
- sal_Char* m_pCharacters;
-
-public:
- OAsciiOutput(const ::rtl::OUString& _rUnicodeChars);
- ~OAsciiOutput() { delete m_pCharacters; }
-
- const sal_Char* getCharacters() const { return m_pCharacters; }
-};
-
-//-----------------------------------------------------------------------------
-OAsciiOutput::OAsciiOutput(const ::rtl::OUString& _rUnicodeChars)
-{
- sal_Int32 nLen = _rUnicodeChars.getLength();
- m_pCharacters = new sal_Char[nLen + 1];
- sal_Char* pFillPtr = m_pCharacters;
- const sal_Unicode* pSourcePtr = _rUnicodeChars.getStr();
-#if OSL_DEBUG_LEVEL > 1
- sal_Bool bAsserted = sal_False;
-#endif
- for (sal_Int32 i=0; i<nLen; ++i, ++pFillPtr, ++pSourcePtr)
- {
- OSL_ENSURE(bAsserted || !(bAsserted = (*pSourcePtr >= 0x80)),
- "OAsciiOutput::OAsciiOutput : non-ascii character found !");
- *pFillPtr = *reinterpret_cast<const sal_Char*>(pSourcePtr);
- }
- *pFillPtr = 0;
-}
-
-#define ASCII_STRING(rtlOUString) OAsciiOutput(rtlOUString).getCharacters()
-#define UNI_STRING(asciiString) ::rtl::OUString::createFromAscii(asciiString)
-
-//=============================================================================
-//=============================================================================
-
-#if (defined UNX) || (defined OS2)
-void main( int argc, char * argv[] )
-#else
-void _cdecl main( int argc, char * argv[] )
-#endif
-{
- TimeValue aTimeout;
- aTimeout.Seconds = 5;
- aTimeout.Nanosec = 0;
-
- Reference< XMultiServiceFactory > xORB = createRegistryServiceFactory(
- ::rtl::OUString::createFromAscii("l:\\bin.a\\applicat.rdb"),
- ::rtl::OUString()
- );
- if (!xORB.is())
- {
- fprintf(stdout, "could not create the service factory !\n\n");
- return;
- }
-
- try
- {
- Reference< XSimpleRegistry > xConfigurationRegistry;
- printf("instantiating the configuration registry access\n\r");
- xConfigurationRegistry = xConfigurationRegistry.query(
- xORB->createInstance(::rtl::OUString::createFromAscii("com.sun.star.configuration.ConfigurationRegistry"))
- );
-
- const sal_Char* pLayoutNode = "com.sun.star.Inet";
- printf("opening the registry access to %s\n\r", pLayoutNode);
- xConfigurationRegistry->open(UNI_STRING(pLayoutNode), sal_False, sal_False);
-
- printf("retrieving the root key, enumerating elements\n\r");
- Reference< XRegistryKey > xRoot = xConfigurationRegistry->getRootKey();
- Sequence< ::rtl::OUString > aKeyNames = xRoot->getKeyNames();
- const ::rtl::OUString* pKeyNames = aKeyNames.getConstArray();
- for (sal_Int32 i=0; i<aKeyNames.getLength(); ++i, ++pKeyNames)
- printf("\t%i\t%s\n\r", i, ASCII_STRING(*pKeyNames));
-
- const sal_Char* pUpdateKey = "Proxy/NoProxy";
- printf("retrieving the key for %s\n\r", pUpdateKey);
- Reference< XRegistryKey > xTabStopsKey = xRoot->openKey(UNI_STRING(pUpdateKey));
-
-/* xTabStopsKey->createKey(UNI_STRING("blupp"));
-
- Sequence< ::rtl::OUString > sLanguages = xTabStopsKey->getStringListValue();
- sLanguages.realloc(sLanguages.getLength() + 1);
- sLanguages[sLanguages.getLength() - 1] = UNI_STRING("ru");
- xTabStopsKey->setStringListValue(sLanguages);
-*/
-
- ::rtl::OUString sTest = xTabStopsKey->getStringValue();
- xTabStopsKey->setStringValue(UNI_STRING("blimp"));
-
- printf("flushing the changes\n\r");
- Reference< XFlushable > xCommit(xConfigurationRegistry, UNO_QUERY);
- xCommit->flush();
- }
- catch(RuntimeException& e)
- {
- printf("\n\r\n\rcaught an RuntimeException :\n\r");
- printf(" exception message : %s\n\r", ASCII_STRING(e.Message));
- return;
- }
- catch(Exception& e)
- {
- printf("\n\r\n\rcaught an Exception :\n\r");
- printf(" exception message : %s\n\r", ASCII_STRING(e.Message));
- return;
- }
-}
diff --git a/configmgr/workben/apitest/cfgupdate.cxx b/configmgr/workben/apitest/cfgupdate.cxx
deleted file mode 100644
index c71a1bb28f..0000000000
--- a/configmgr/workben/apitest/cfgupdate.cxx
+++ /dev/null
@@ -1,432 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#define _PRIVATE_TEST_
-
-#include <iostream>
-using namespace std;
-
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/uno/Type.hxx>
-#include <com/sun/star/uno/TypeClass.hpp>
-
-#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/container/XNameContainer.hpp>
-#include <com/sun/star/container/XHierarchicalName.hpp>
-#include <com/sun/star/container/XNamed.hpp>
-#include <com/sun/star/container/XNameReplace.hpp>
-#include <com/sun/star/container/XChild.hpp>
-#include <com/sun/star/beans/XExactName.hpp>
-#include <com/sun/star/util/XChangesBatch.hpp>
-#include <com/sun/star/beans/XHierarchicalPropertySet.hpp>
-
-
-#include <rtl/ustring.hxx>
-#include <rtl/string.hxx>
-#include <osl/time.h>
-#include <cppuhelper/servicefactory.hxx>
-#include <com/sun/star/uno/Sequence.h>
-#include <com/sun/star/uno/Any.h>
-
-#include "createpropertyvalue.hxx"
-
-#include "typeconverter.hxx"
-
-// #include <com/sun/star/configuration/XConfigurationSync.hpp>
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::beans;
-//using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::util;
-
-using ::rtl::OUString;
-using ::rtl::OString;
-//using namespace ::configmgr;
-
-using namespace ::cppu;
-
-#define ASCII(x) ::rtl::OUString::createFromAscii(x)
-
-ostream& operator << (ostream& out, rtl::OUString const& aStr)
-{
- sal_Unicode const* const pStr = aStr.getStr();
- sal_Unicode const* const pEnd = pStr + aStr.getLength();
- for (sal_Unicode const* p = pStr; p < pEnd; ++p)
- if (0 < *p && *p < 127) // ASCII
- out << char(*p);
- else
- out << "[\\u" << hex << *p << "]";
- return out;
-}
-
-void showSequence(const Sequence<OUString> &aSeq)
-{
- OUString aArray;
- const OUString *pStr = aSeq.getConstArray();
- for (int i=0;i<aSeq.getLength();i++)
- {
- OUString aStr = pStr[i];
- // aArray += aStr + ASCII(", ");
- cout << aStr << endl;
- }
- volatile int dummy = 0;
-}
-
-//=============================================================================
-//=============================================================================
-void test_read_access(Reference< XInterface >& xIface, Reference< XMultiServiceFactory > &xMSF);
-//=============================================================================
-struct prompt_and_wait
-{
- char const* myText;
- prompt_and_wait(char const* text = "") : myText(text) {}
- ~prompt_and_wait()
- {
- cout << myText << ">" << endl;
- int const mx = int( (+0u - +1u) >> 1);
-
- char c=0;
- if (cin.get(c) && c != '\n')
- cin.ignore(mx,'\n');
- }
-};
-static prompt_and_wait exit_prompt("Quitting\nQ");
-
-
-// -----------------------------------------------------------------------------
-Sequence<Any> createSequence(const OUString &sUser, const OUString &sPasswd)
-{
- Sequence< Any > aCPArgs;
-
- if (sUser.getLength() > 0)
- {
- aCPArgs.realloc(1);
- aCPArgs[0] <<= configmgr::createPropertyValue(ASCII("user"), sUser);
- }
- if (sPasswd.getLength() > 0)
- {
- aCPArgs.realloc(2);
- aCPArgs[1] <<= configmgr::createPropertyValue(ASCII("password"), sPasswd);
- }
- return aCPArgs;
-}
-
-//=============================================================================
-#include <string.h>
-#if (defined UNX) || (defined OS2)
-#else
-#include <conio.h>
-#endif
-
-OString input(const char* pDefaultText, char cEcho)
-{
- // PRE: a Default Text would be shown, cEcho is a Value which will show if a key is pressed.
- const int MAX_INPUT_LEN = 500;
- char aBuffer[MAX_INPUT_LEN];
-
- strcpy(aBuffer, pDefaultText);
- int nLen = strlen(aBuffer);
-
-#ifdef WNT
- char ch = '\0';
-
- cout << aBuffer;
- cout.flush();
-
- while(ch != 13)
- {
- ch = getch();
- if (ch == 8)
- {
- if (nLen > 0)
- {
- cout << "\b \b";
- cout.flush();
- --nLen;
- aBuffer[nLen] = '\0';
- }
- else
- {
- cout << "\a";
- cout.flush();
- }
- }
- else if (ch != 13)
- {
- if (nLen < MAX_INPUT_LEN)
- {
- if (cEcho == 0)
- {
- cout << ch;
- }
- else
- {
- cout << cEcho;
- }
- cout.flush();
- aBuffer[nLen++] = ch;
- aBuffer[nLen] = '\0';
- }
- else
- {
- cout << "\a";
- cout.flush();
- }
- }
- }
-#else
- if (!cin.getline(aBuffer,sizeof aBuffer))
- return OString();
-#endif
- return OString(aBuffer);
-}
-
-// -----------------------------------------------------------------------------
-rtl::OUString enterValue(const char* _aStr, const char* _aDefault, bool _bIsAPassword)
-{
- cout << _aStr;
- cout.flush();
- OString aTxt = input(_aDefault, _bIsAPassword ? '*' : 0);
-
- OUString sValue = OUString::createFromAscii(aTxt);
- return sValue;
-}
-
-// -----------------------------------------------------------------------------
-Reference< XNameAccess > beginChanges(Reference< XMultiServiceFactory > xFactory, OUString sPath)
-{
- Sequence< Any > aArgs(1);
- aArgs[0] <<= configmgr::createPropertyValue(ASCII("nodepath"),sPath);
-
- cout << "starting update for node:" << sPath << endl;
-
- Reference< XNameAccess > xTree(xFactory->createInstanceWithArguments(OUString::createFromAscii("com.sun.star.configuration.ConfigurationUpdateAccess"),
- aArgs), UNO_QUERY);
-
- return xTree;
-}
-
-template <class Type>
-// -----------------------------------------------------------------------------
-void update(Reference< XInterface > xIFace, OUString sRelPath, Type sValue)
-{
- Reference< XHierarchicalPropertySet > xTree(xIFace, UNO_QUERY);
- Any aValue;
- aValue <<= sValue;
-
- cout << "updating node:" << sRelPath << endl;
- xTree->setHierarchicalPropertyValue(sRelPath, aValue);
-}
-
-// -----------------------------------------------------------------------------
-Reference< XHierarchicalPropertySet > insertTree(Reference< XInterface > xIFace, OUString aName)
-{
- if (!aName.getLength())
- aName = enterValue("/nEnter a Tree to insert: ", "", false);
-
- Reference< XSingleServiceFactory > xFactory(xIFace, UNO_QUERY);
- Reference< XHierarchicalPropertySet > xNewElement(xFactory->createInstance(), UNO_QUERY);
-
- cout << "inserting new tree element:" << aName << endl;
-
- Any aTree;
- aTree <<= xNewElement;
- Reference< XNameContainer >(xFactory, UNO_QUERY)->insertByName(aName, aTree);
-
- return xNewElement;
-}
-
-// -----------------------------------------------------------------------------
-void removeTree(Reference< XInterface > xIFace, OUString aName)
-{
- if (!aName.getLength())
- aName = enterValue("/nEnter a Tree to remove: ", "", false);
-
- cout << "removing new tree element:" << aName << endl;
-
- Reference< XNameContainer >(xIFace, UNO_QUERY)->removeByName(aName);
-}
-
-// -----------------------------------------------------------------------------
-void commitChanges(Reference< XInterface > xIFace)
-{
- cout << "committing changes:" << endl;
-
- Reference< XChangesBatch > xChangesBatch(xIFace, UNO_QUERY);
- xChangesBatch->commitChanges();
-}
-
-// -----------------------------------------------------------------------------
-void displayTree(Reference< XNameAccess > xIFace, sal_Int32 nLevel)
-{
- const char* pTab = " ";
- Sequence<OUString> aNames( xIFace->getElementNames() );
- for (int i = 0; i < aNames.getLength(); ++i)
- {
- Any aElement = xIFace->getByName(aNames[i]);
- Reference< XNameAccess > xAccess;
- Reference< XSingleServiceFactory > xFactory;
- aElement >>= xFactory;
- aElement >>= xAccess;
-
- cout << endl;
- for (int j = 0; j < nLevel; j++)
- cout << " ";
-
- if (xAccess.is())
- {
- OUString sType;
- if (xFactory.is())
- sType = OUString::createFromAscii(" type = 'set' " );
-
- cout << "<" << aNames[i] << sType << ">";
- displayTree(xAccess, nLevel + 1);
- cout << endl << "</" << aNames[i] << ">";
- }
- else
- cout << "<" << aNames[i] << "/>";
-
- }
- ::flush(cout);
-}
-
-// -----------------------------------------------------------------------------
-// ---------------------------------- M A I N ----------------------------------
-// -----------------------------------------------------------------------------
-
-#if (defined UNX) || (defined OS2)
-int main( int argc, char * argv[] )
-#else
-int _cdecl main( int argc, char * argv[] )
-#endif
-{
- TimeValue aTimeout;
- aTimeout.Seconds = 5;
- aTimeout.Nanosec = 0;
-
- // cout << " Please insert Text: ";
- // cout.flush();
- // OString aTxt = input("Der Text", 0);
- // cout << endl << "You inserted: " << aTxt.getStr() << endl;
- //
- // cout << "Please insert Password: ";
- // cout.flush();
- // OString aPasswd = input("", '*');
- // cout << endl << "You inserted: " << aPasswd.getStr() << endl;
-
- try
- {
- OUString const sServiceRegistry = OUString::createFromAscii( argc > 1 ? argv[1] : "applicat.rdb" );
- Reference< XMultiServiceFactory > xORB = createRegistryServiceFactory(
- sServiceRegistry,
- ::rtl::OUString()
- );
- if (!xORB.is())
- {
- ::flush(cout);
- cerr << "Could not create the service factory !\n\n";
- return 1;
- }
- cout << "Service factory created !\n---------------------------------------------------------------" << endl;
-
- Sequence< Any > aCPArgs;
-
- /*OUString sServerType = enterValue("Enter Servertype: ", "remote", false);
- cout << endl;*/
-
-
- rtl::OUString sFilePath;
- rtl::OUString sPort;
- rtl::OUString sUser;
-
- sUser = enterValue("Enter User: ", "user1", false);
- cout << endl;
-
- OUString sPasswd;// = enterValue("Enter Password: ", "", true);
- cout << endl;
-
- aCPArgs = createSequence(sUser, sPasswd);
-
- Reference< XMultiServiceFactory > xCfgProvider(
- xORB->createInstanceWithArguments(
- ::rtl::OUString::createFromAscii("com.sun.star.configuration.ConfigurationProvider"),
- aCPArgs),
- UNO_QUERY);
- if (!xCfgProvider.is())
- {
- ::flush(cout);
- cerr << "Could not create the configuration provider !\n\n";
- return 3;
- }
-
- Reference< XNameAccess > xUpdateAccess;
-
-// now do updates for the user
- xUpdateAccess = beginChanges(xCfgProvider, OUString::createFromAscii("org.openoffice.Security"));
- displayTree(xUpdateAccess, 0);
-
- update(xUpdateAccess, OUString::createFromAscii("_3D_Engine/Dithering"), sal_Bool(sal_False));
-
-/* xUpdateAccess = beginChanges(xCfgProvider, OUString::createFromAscii("org.openoffice.Inet"));
-
- update(xUpdateAccess, OUString::createFromAscii("Proxy/FTP/Port"), sal_Int32(11));
- update(xUpdateAccess, OUString::createFromAscii("Proxy/FTP/Name"), OUString::createFromAscii("Test3"));
- update(xUpdateAccess, OUString::createFromAscii("DNS/IP_Address"), OUString::createFromAscii("Test4"));
-*/
- commitChanges(xUpdateAccess);
-
-// now do updates with inserting and removing of nodes
-
- xUpdateAccess = beginChanges(xCfgProvider, OUString::createFromAscii("org.openoffice.Security/MountPoints"));
- displayTree(xUpdateAccess, 0);
-
- Reference< XHierarchicalPropertySet > xTree = insertTree(xUpdateAccess, OUString());
- update(xUpdateAccess, OUString::createFromAscii("InstallationDirectory/Directory"), OUString::createFromAscii("Test1"));
- removeTree(xUpdateAccess, OUString());
- commitChanges(xUpdateAccess);
- }
- catch (Exception& e)
- {
- ::flush(cout);
- cerr << "Caught exception: " << e.Message << endl;
- }
-/*
- catch (...)
- {
- ::flush(cout);
- cerr << "BUG: Caught UNKNOWN exception (?) " << endl;
- }
-*/
- return 0;
-}
-
diff --git a/configmgr/workben/apitest/makefile.mk b/configmgr/workben/apitest/makefile.mk
deleted file mode 100644
index fb14df415c..0000000000
--- a/configmgr/workben/apitest/makefile.mk
+++ /dev/null
@@ -1,124 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJINC=$(PRJ)$/source
-
-PRJNAME=configmgr
-
-TARGET=cfgapi
-TARGET2=cfgreg
-TARGET3=cfgadduser
-TARGET4=cfgadmin
-TARGET5=cfgupdate
-TARGET6=cfgapi_timetest
-TARGETTYPE=CUI
-LIBTARGET=NO
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-.INCLUDE : settings.mk
-
-# --- Files --------------------------------------------------------
-
-# ... common for all test executables ..............................
-APPSTDLIBS=\
- $(SALLIB) \
- $(VOSLIB) \
- $(CPPULIB) \
- $(CPPUHELPERLIB)
-
-# ... cfgapi ..............................
-APP1STDLIBS = $(APPSTDLIBS)
-
-APP1STDLIBS+=$(STDLIBCPP)
-
-APP1TARGET= $(TARGET)
-APP1OBJS= \
- $(SLO)$/cfgapi.obj \
- $(SLO)$/strimpl.obj \
- $(SLO)$/typeconverter.obj \
- $(SLO)$/simpletypehelper.obj \
-
-# ... cfgapi_timetest ..............................
-APP6STDLIBS = $(APPSTDLIBS)
-
-APP6STDLIBS+=$(STDLIBCPP)
-
-APP6TARGET= $(TARGET6)
-APP6OBJS= \
- $(SLO)$/cfgapi_timetest.obj \
- $(SLO)$/strimpl.obj \
- $(SLO)$/typeconverter.obj \
- $(SLO)$/simpletypehelper.obj \
-
-# ... cfgreg ..............................
-APP2STDLIBS = $(APPSTDLIBS)
-
-APP2STDLIBS+=$(STDLIBCPP)
-
-APP2TARGET= $(TARGET2)
-APP2OBJS= \
- $(SLO)$/cfgregistry.obj \
-
-# ... cfgadduser ..............................
-APP3STDLIBS = $(APPSTDLIBS)
-
-APP3STDLIBS+=$(STDLIBCPP)
-
-APP3TARGET= $(TARGET3)
-APP3OBJS= \
- $(SLO)$/cfgadduser.obj \
-
-# ... cfgadmin ..............................
-APP4STDLIBS = $(APPSTDLIBS)
-
-APP4STDLIBS+=$(STDLIBCPP)
-
-APP4TARGET= $(TARGET4)
-APP4OBJS= \
- $(SLO)$/cfgadmin.obj \
- $(SLO)$/strimpl.obj \
- $(SLO)$/typeconverter.obj \
- $(SLO)$/simpletypehelper.obj \
-
-# ... cfgupdate ..............................
-APP5STDLIBS = $(APPSTDLIBS)
-
-APP5STDLIBS+=$(STDLIBCPP)
-
-APP5TARGET= $(TARGET5)
-APP5OBJS= \
- $(SLO)$/cfgupdate.obj \
- $(SLO)$/strimpl.obj \
- $(SLO)$/typeconverter.obj \
- $(SLO)$/simpletypehelper.obj \
-
-.INCLUDE : target.mk
-
-
diff --git a/configmgr/workben/apitest/sregistry b/configmgr/workben/apitest/sregistry
deleted file mode 100644
index f4f353181f..0000000000
--- a/configmgr/workben/apitest/sregistry
+++ /dev/null
@@ -1,8 +0,0 @@
-[configuration]
-servertype=remote
-[RemoteRegistry]
-Server=munch-11072:100
-Timeout=2500
-[LocalRegistry]
-rootpath="G:\Configuration"
-
diff --git a/configmgr/workben/local_io/cfgfile.cxx b/configmgr/workben/local_io/cfgfile.cxx
deleted file mode 100644
index 818c0c6044..0000000000
--- a/configmgr/workben/local_io/cfgfile.cxx
+++ /dev/null
@@ -1,94 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-
-// -----------------------------------------------------------------------------
-// ------------------------------------ main ------------------------------------
-// -----------------------------------------------------------------------------
-
-/*
- OUString operator+(const OUString &a, const OUString &b)
- {
- OUString c = a;
- c += b;
- return c;
- }
-*/
-
-namespace configmgr
-{
- void simpleMappingTest();
-
- void importTest();
- void exportTest();
-
- void hierarchyTest();
- //void simpleTest();
- void speedTest();
- void stringTest();
- void classTest();
- void hash_test();
- void testRefs();
- void ConfigName();
-
- void oslTest();
-}
-
-
-
-#if (defined UNX) || (defined OS2)
-int main( int argc, char * argv[] )
-#else
- int _cdecl main( int argc, char * argv[] )
-#endif
-{
-
-// configmgr::hierarchyTest();
-
-
-// configmgr::importTest();
-// configmgr::exportTest();
-// configmgr::speedTest();
-// configmgr::simpleTest();
-
-// configmgr::simpleMappingTest();
-// configmgr::stringTest();
-// configmgr::classTest();
-
-// configmgr::hash_test();
-
- // configmgr::testRefs();
- // configmgr::ConfigName();
-
- configmgr::oslTest();
- return 0;
-}
-
-
diff --git a/configmgr/workben/local_io/cfglocal.cxx b/configmgr/workben/local_io/cfglocal.cxx
deleted file mode 100644
index ee9e71319a..0000000000
--- a/configmgr/workben/local_io/cfglocal.cxx
+++ /dev/null
@@ -1,620 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#define _PRIVATE_TEST_
-
-#include <memory.h>
-#include <string.h>
-#include <stdio.h>
-#include <vos/socket.hxx>
-#include "attributes.hxx"
-
-#ifndef _CONFIGMGR_SESSION_REMOTESESSION_HXX_
-#include "remotesession.hxx"
-#endif
-#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
-#include <cppuhelper/servicefactory.hxx>
-#include <cppuhelper/implbase1.hxx>
-#include <vos/conditn.hxx>
-
-#include <osl/time.h>
-
-#include "localsession.hxx"
-#include "confname.hxx"
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::xml;
-using namespace ::vos;
-using namespace ::cppu;
-using namespace ::configmgr;
-using namespace rtl;
-
-// #define USE_LAYOUT_NODE
-
-//=============================================================================
-//= a dirty littly class for printing ascii characters
-//=============================================================================
-class OAsciiOutput
-{
-protected:
- sal_Char* m_pCharacters;
-
-public:
- OAsciiOutput(const ::rtl::OUString& _rUnicodeChars);
- ~OAsciiOutput() { delete m_pCharacters; }
-
- const sal_Char* getCharacters() const { return m_pCharacters; }
-};
-
-//-----------------------------------------------------------------------------
-OAsciiOutput::OAsciiOutput(const ::rtl::OUString& _rUnicodeChars)
-{
- sal_Int32 nLen = _rUnicodeChars.getLength();
- m_pCharacters = new sal_Char[nLen + 1];
- sal_Char* pFillPtr = m_pCharacters;
- const sal_Unicode* pSourcePtr = _rUnicodeChars.getStr();
-#ifdef DBG_UTIL
- sal_Bool bAsserted = sal_False;
-#endif
- for (sal_Int32 i=0; i<nLen; ++i, ++pFillPtr, ++pSourcePtr)
- {
- OSL_ENSURE(bAsserted || !(bAsserted = (*pSourcePtr >= 0x80)),
- "OAsciiOutput::OAsciiOutput : non-ascii character found !");
- *pFillPtr = *reinterpret_cast<const sal_Char*>(pSourcePtr);
- }
- *pFillPtr = 0;
-}
-
-#define ASCII_STRING(rtlOUString) OAsciiOutput(rtlOUString).getCharacters()
-#define UNI_STRING(salCharPtr) ::rtl::OUString::createFromAscii(salCharPtr)
-
-//=============================================================================
-//= OOpenNodeCallback
-//=============================================================================
-typedef ::cppu::WeakImplHelper1< sax::XDocumentHandler > OOpenNodeCallback_Base;
-class OOpenNodeCallback : public IOpenObjectCallback, public OOpenNodeCallback_Base
-{
-protected:
- OUString m_sNodeId;
- ::vos::OCondition& m_rFinishCondition;
-
- enum ACTION { STARTELEMENT, CHARACTERS, ENDELEMENT };
- ACTION m_eLastAction;
- sal_Int32 m_nLevel;
- sal_Bool m_bCloseStartTag;
-
-protected:
- ~OOpenNodeCallback()
- {
- }
-
-public:
- OOpenNodeCallback(::vos::OCondition& _rFinishCond) : m_rFinishCondition(_rFinishCond), m_nLevel(0), m_eLastAction(ENDELEMENT), m_bCloseStartTag(sal_False) { }
-
- OUString getNodeId() const { return m_sNodeId; }
-
- // IOpenObjectCallback
- virtual void gotObjectId(const OUString &aName);
-
- // IDataRequestCallback
- virtual Reference< sax::XDocumentHandler > getDataReader() { return static_cast< sax::XDocumentHandler* >(this); }
-
- // IRequestCallback
- virtual void acknowledged(sal_Int32 _nTransId);
- virtual void failed(sal_Int32 _nErrorCode);
- virtual void done(const StatusInfo& _rStatus);
-
- // IInterface
- virtual void SAL_CALL acquire( ) throw (::com::sun::star::uno::RuntimeException) { OOpenNodeCallback_Base::acquire(); }
- virtual void SAL_CALL release( ) throw (::com::sun::star::uno::RuntimeException) { OOpenNodeCallback_Base::release(); }
-
- // XDocumentHandler
- virtual void SAL_CALL startDocument( ) throw(sax::SAXException, RuntimeException) { }
- virtual void SAL_CALL endDocument( ) throw(sax::SAXException, RuntimeException) { }
- virtual void SAL_CALL startElement( const ::rtl::OUString& aName, const Reference< sax::XAttributeList >& xAttribs ) throw(sax::SAXException, RuntimeException);
- virtual void SAL_CALL endElement( const ::rtl::OUString& aName ) throw(sax::SAXException, RuntimeException);
- virtual void SAL_CALL characters( const ::rtl::OUString& aChars ) throw(sax::SAXException, RuntimeException);
- virtual void SAL_CALL ignorableWhitespace( const ::rtl::OUString& aWhitespaces ) throw(sax::SAXException, RuntimeException) { }
- virtual void SAL_CALL processingInstruction( const ::rtl::OUString& aTarget, const ::rtl::OUString& aData ) throw(sax::SAXException, RuntimeException) { }
- virtual void SAL_CALL setDocumentLocator( const Reference< sax::XLocator >& xLocator ) throw(sax::SAXException, RuntimeException) { }
-};
-
-//.............................................................................
-inline void linefeed()
-{
- // printf("\n");
-}
-
-//.............................................................................
-void printTabs(sal_Int32 _nCount)
-{
- sal_Char* pBuffer = new sal_Char[2 * _nCount + 1];
- memset(pBuffer, ' ', 2 * _nCount);
- pBuffer[2 * _nCount] = 0;
- // printf(pBuffer);
-}
-
-//-----------------------------------------------------------------------------
-void SAL_CALL OOpenNodeCallback::startElement( const ::rtl::OUString& _rName, const Reference< sax::XAttributeList >& xAttribs ) throw(sax::SAXException, RuntimeException)
-{
- switch (m_eLastAction)
- {
- case STARTELEMENT:
- if (m_bCloseStartTag)
- {
- // printf(">");
- }
-
- m_bCloseStartTag = sal_False;
- // no break
- case CHARACTERS:
- case ENDELEMENT:
- linefeed();
- printTabs(m_nLevel);
- break;
- }
- m_eLastAction = STARTELEMENT;
- ++m_nLevel;
- // printf("<%s", ASCII_STRING(_rName));
- m_bCloseStartTag = sal_True;
-}
-
-//-----------------------------------------------------------------------------
-void SAL_CALL OOpenNodeCallback::endElement( const ::rtl::OUString& _rName ) throw(sax::SAXException, RuntimeException)
-{
- --m_nLevel;
- switch (m_eLastAction)
- {
- case STARTELEMENT:
- if (m_bCloseStartTag)
- {
- // printf("/>");
- }
-
- m_bCloseStartTag = sal_False;
- break;
- case ENDELEMENT:
- linefeed();
- printTabs(m_nLevel);
- // dont break
- case CHARACTERS:
- // printf("</%s>", ASCII_STRING(_rName));
- break;
- }
- m_eLastAction = ENDELEMENT;
-}
-
-//-----------------------------------------------------------------------------
-void SAL_CALL OOpenNodeCallback::characters( const ::rtl::OUString& _rChars ) throw(sax::SAXException, RuntimeException)
-{
- if (STARTELEMENT == m_eLastAction)
- {
- if (m_bCloseStartTag && _rChars.trim().getLength())
- {
- // printf(">");
- m_bCloseStartTag = sal_False;
- }
- }
- if (_rChars.trim().getLength() != 0)
- {
- // printf("%s", ASCII_STRING(_rChars));
- m_eLastAction = CHARACTERS;
- }
-}
-
-//-----------------------------------------------------------------------------
-void OOpenNodeCallback::gotObjectId(const OUString &_nId)
-{
- m_sNodeId = _nId;
- // printf("object id %i\n", m_nNodeId);
-}
-
-//-----------------------------------------------------------------------------
-void OOpenNodeCallback::acknowledged(sal_Int32 _nTransId)
-{
- // printf("acknowledged, transaction id : %i\n", _nTransId);
-}
-
-//-----------------------------------------------------------------------------
-void OOpenNodeCallback::failed(sal_Int32 _nErrorCode)
-{
- // printf("failed because of a connection error (%i)\n", _nErrorCode);
- m_rFinishCondition.set();
-}
-
-//-----------------------------------------------------------------------------
-void OOpenNodeCallback::done(const StatusInfo& _rStatus)
-{
- if (_rStatus.nCode)
- {
- printf("\n\ndone, but had an error : %s\n", ASCII_STRING(_rStatus.sMessage));
- }
- else
- {
- // printf("\n\nsuccessfully done\n", ASCII_STRING(_rStatus.sMessage));
- }
-
- m_rFinishCondition.set();
-}
-
-//=============================================================================
-//= ONodeUpdater
-//=============================================================================
-class ONodeUpdater : public IDOMNodeDataProvider
-{
- sal_Bool m_bWriterLevel;
- sal_Bool m_bAdd;
-public:
- ONodeUpdater(sal_Bool _bStartAtWriterLevel, sal_Bool bAdd) : m_bWriterLevel(_bStartAtWriterLevel), m_bAdd(bAdd) { }
-
- virtual void writeNodeData(const Reference< sax::XDocumentHandler >& _rHandler);
-};
-
-//-----------------------------------------------------------------------------
-void ONodeUpdater::writeNodeData(const Reference< sax::XDocumentHandler >& _rHandler)
-{
- AttributeListImpl *pAttr = new AttributeListImpl;
- Reference< sax::XAttributeList > xEmptyAttrList = pAttr;
-
- pAttr = new AttributeListImpl;
- pAttr->addAttribute(UNI_STRING("type"),UNI_STRING("CDATA"),UNI_STRING("string"));
- Reference< sax::XAttributeList > xStringAttrList = pAttr;
-
- if (m_bWriterLevel)
- _rHandler->startElement(UNI_STRING("Writer"), xEmptyAttrList);
-#ifdef USE_LAYOUT_NODE
- _rHandler->startElement(UNI_STRING("Layout"), xEmptyAttrList);
- _rHandler->startElement(UNI_STRING("TabStops"), xEmptyAttrList);
- if (m_bAdd)
- _rHandler->characters(UNI_STRING("0.90"));
- else
- _rHandler->characters(UNI_STRING("99.99"));
-
- _rHandler->endElement(UNI_STRING("TabStops"));
- _rHandler->endElement(UNI_STRING("Layout"));
-#else
- // _rHandler->startElement(UNI_STRING("com.sun.star.office.Setup"), xEmptyAttrList);
- _rHandler->startElement(UNI_STRING("Modules"), xEmptyAttrList);
- _rHandler->startElement(UNI_STRING("StandFonts"), xEmptyAttrList);
- _rHandler->startElement(UNI_STRING("Standard"), xStringAttrList);
- _rHandler->startElement(UNI_STRING("value"), xEmptyAttrList);
- if (m_bAdd)
- _rHandler->characters(UNI_STRING("Arial"));
- else
- _rHandler->characters(UNI_STRING("Courier"));
-
- _rHandler->endElement(UNI_STRING("value"));
- _rHandler->endElement(UNI_STRING("Standard"));
- _rHandler->endElement(UNI_STRING("StandFonts"));
- _rHandler->endElement(UNI_STRING("Modules"));
- // _rHandler->endElement(UNI_STRING("com.sun.star.office.Setup"));
-
- _rHandler->ignorableWhitespace(OUString());
-#endif
- if (m_bWriterLevel)
- _rHandler->endElement(UNI_STRING("Writer"));
-}
-
-//=============================================================================
-//= OSessionListener
-//=============================================================================
-class OSessionListener : public ISessionListener
-{
-protected:
- oslInterlockedCount m_refCount;
-
-public:
- // ISessionListener
- virtual void nodeUpdated(const ::rtl::OUString& _rNodePath);
- virtual void nodeDeleted(const ::rtl::OUString& _rNodePath);
- virtual void nodeAdded(const ::rtl::OUString& _rNodePath);
-
- // IInterface
- virtual void SAL_CALL acquire( ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL release( ) throw (::com::sun::star::uno::RuntimeException);
-};
-
-//-----------------------------------------------------------------------------
-void OSessionListener::nodeUpdated(const ::rtl::OUString& _rNodePath)
-{
- // printf("[listener] : a node was updated, node path : %s\n", ASCII_STRING(_rNodePath));
-}
-
-//-----------------------------------------------------------------------------
-void OSessionListener::nodeDeleted(const ::rtl::OUString& _rNodePath)
-{
- // printf("[listener] : a node was deleted, node path : %s\n", ASCII_STRING(_rNodePath));
-}
-
-//-----------------------------------------------------------------------------
-void OSessionListener::nodeAdded(const ::rtl::OUString& _rNodePath)
-{
- // printf("\n[listener] : a node was added, node path : %s", ASCII_STRING(_rNodePath));
-}
-
-//-----------------------------------------------------------------------------
-void SAL_CALL OSessionListener::acquire( ) throw (::com::sun::star::uno::RuntimeException)
-{
- osl_incrementInterlockedCount(&m_refCount);
-}
-
-//-----------------------------------------------------------------------------
-void SAL_CALL OSessionListener::release( ) throw (::com::sun::star::uno::RuntimeException)
-{
- if (!osl_decrementInterlockedCount(&m_refCount))
- delete this;
-}
-
-//=============================================================================
-//=============================================================================
-
-//=============================================================================
-static ::rtl::OUString sHost;
-static sal_Int32 nPort;
-static ::rtl::OUString sRegistry = ::rtl::OUString::createFromAscii("applicat.rdb");
-
-//=============================================================================
-sal_Bool collectArgs(int argc, char * argv[])
-{
- if (argc > 1)
- {
- sal_Char* pConnectTo = argv[1];
- sal_Char* pSeparator = strchr(pConnectTo, ':');
- if (pSeparator && (0 != *(pSeparator + 1)))
- {
- sHost = ::rtl::OUString(pConnectTo, pSeparator - pConnectTo, RTL_TEXTENCODING_ASCII_US);
- nPort = ::rtl::OUString::createFromAscii(pSeparator + 1).toInt32();
-
- if (argc > 2)
- sRegistry = ::rtl::OUString::createFromAscii(argv[2]);
- return sal_True;
- }
- }
-
- printf("cfgclient - registry server client test ...\n\r\n\r");
- printf("usage :\n\r");
- printf(" cfgclient <server>:<port> [<registry file>]\n\r\n\r");
- printf(" <server> : machine to connect to\n\r");
- printf(" <port> : port to connect to\n\r");
- printf(" <registry file> : (optional) registry to bootstrap from. defaulted to \"applicat.rdb\"\n\r\n\r");
- return sal_False;
-}
-
-//=============================================================================
-
-#if (defined UNX) || (defined OS2)
-void main( int argc, char * argv[] )
-#else
-void _cdecl main( int argc, char * argv[] )
-#endif
-{
- Reference< XMultiServiceFactory > xORB;
- try
- {
- xORB = createRegistryServiceFactory(sRegistry, ::rtl::OUString());
- }
- catch (Exception& e)
- {
- printf("could not bootstrap the services from %s\n\r", ASCII_STRING(sRegistry));
- printf(" (error message : %s)", ASCII_STRING(e.Message));
- }
-
- if (!xORB.is())
- {
- fprintf(stdout, "could not create the service factory !");
- return;
- }
-
- ORef< OSessionListener > xListener = new OSessionListener;
- {
-/*
- ORemoteSession aSession(xORB);
- // --------- connect ----------
- sal_Bool bSuccess = aSession.connect(sHost, nPort, &aTimeout);
- if (!bSuccess)
- {
- printf("could not connect to the server (error : %i) ...", aSession.getConnectionError());
- return;
- }
-*/
-
- void testSession(const Reference< XMultiServiceFactory > &xORB, bool bPrint);
-
- for (int i=0;i<100;i++)
- {
- TimeValue aStartTime, aEndTime;
- osl_getSystemTime(&aStartTime);
- testSession(xORB, false);
- osl_getSystemTime(&aEndTime);
-
- sal_Int32 nSeconds = aEndTime.Seconds - aStartTime.Seconds;
- sal_Int32 nNanoSec = aEndTime.Nanosec - aStartTime.Nanosec;
- if (nNanoSec < 0)
- {
- nNanoSec = 1000000000 - nNanoSec;
- nSeconds++;
- }
-
- cout << "Time: " << nSeconds << ". " << nNanoSec << endl;
- }
- }
-}
-
-void testSession(const Reference< XMultiServiceFactory > &xORB, bool bPrint)
-{
- TimeValue aTimeout;
- aTimeout.Seconds = 5;
- aTimeout.Nanosec = 0;
-
-
- // create it .. and connect
- LocalSession aSession(xORB);
-
- // --------- openSession ----------
-
- OUString aRootPath = OUString::createFromAscii("f:/local/SRC598/configmgr/workben/local_io");
- // f:/local/SRC595/configmgr/workben/local_io);
- aSession.open(aRootPath);
-
- if (aSession.isOpen())
- {
- if (bPrint) printf("\nopened the session ...");
- }
- else
- {
- printf("\ncould not open the session ... exiting\n\n");
- return;
- }
-
- // aSession.setListener(xListener.getBodyPtr());
-
- OCondition aWaitForSomething;
- aWaitForSomething.reset();
-
- // --------- openNode ----------
- char* pWriterNode = "com.sun.star.Setup/Modules";
- if (bPrint) printf("\nsending an openNode request for %s ...\n", pWriterNode);
- ORef< OOpenNodeCallback > xOpenCallback = new OOpenNodeCallback(aWaitForSomething);
- aSession.openNode(UNI_STRING(pWriterNode), 2, xOpenCallback.getBodyPtr());
-
- aTimeout.Seconds = 30;
- switch (aWaitForSomething.wait(&aTimeout))
- {
- case ICondition::result_error:
- printf("error while waiting for the callback ... exiting\n\n");
- return;
- case ICondition::result_timeout:
- if (bPrint) printf("timed out ... exiting\n\n");
- return;
- }
-
- OUString sOpenedNode = xOpenCallback->getNodeId();
-
-// aSession.getNode(UNI_STRING("com.sun.star.Spreadsheet"), NULL);
-//
-// // --------- getNode (1) ----------
-//#ifdef USE_LAYOUT_NODE
-// char* pLayoutNode = "com.sun.star.office.Setup/Modules";
-//#else
- char* pLayoutNode = "com.sun.star.Setup/Modules";
-//#endif
-// printf("\nsending an getNode request for %s ...\n", pLayoutNode);
-// aWaitForSomething.reset();
-// aSession.getNode(UNI_STRING(pLayoutNode), new OOpenNodeCallback(aWaitForSomething));
-//
-// switch (aWaitForSomething.wait(&aTimeout))
-// {
-// case ICondition::result_error:
-// printf("error while waiting for the callback ... exiting\n\n");
-// return;
-// case ICondition::result_timeout:
-// printf("timed out ... exiting\n\n");
-// return;
-// }
-
- // --------- addNode ----------
- if (bPrint) printf("\n\naddNode ....");
- ONodeUpdater aAddTabstops(sal_False, true); // true = WRITER LEVEL
- aWaitForSomething.reset();
- aSession.addNode(sOpenedNode, UNI_STRING(pLayoutNode), &aAddTabstops, new OOpenNodeCallback(aWaitForSomething));
- switch (aWaitForSomething.wait(&aTimeout))
- {
- case ICondition::result_error:
- printf("error while waiting for the callback ... exiting\n\n");
- return;
- case ICondition::result_timeout:
- if (bPrint) printf("timed out ... exiting\n\n");
- return;
- }
-
- // --------- updateNode ----------
- if (bPrint) printf("\n\nokay, let's try an update ....\n");
-
- ONodeUpdater aUpdateWriter(sal_False, false);
- aWaitForSomething.reset();
- aSession.updateNode(sOpenedNode, UNI_STRING(pLayoutNode), &aUpdateWriter, new OOpenNodeCallback(aWaitForSomething));
-
- switch (aWaitForSomething.wait(&aTimeout))
- {
- case ICondition::result_error:
- printf("error while waiting for the callback ... exiting\n\n");
- return;
- case ICondition::result_timeout:
- if (bPrint) printf("timed out ... exiting\n\n");
- return;
- }
-
- // --------- deleteNode ----------
- char* pLayoutNode2 = "com.sun.star.Setup/Modules/StandFonts";
-
- if (bPrint) printf("\n\ndeleteNode ....");
- aWaitForSomething.reset();
- aSession.deleteNode(sOpenedNode, UNI_STRING(pLayoutNode2), new OOpenNodeCallback(aWaitForSomething));
- switch (aWaitForSomething.wait(&aTimeout))
- {
- case ICondition::result_error:
- printf("error while waiting for the callback ... exiting\n\n");
- return;
- case ICondition::result_timeout:
- if (bPrint) printf("timed out ... exiting\n\n");
- return;
- }
-
-/*
- // --------- startListening ----------
- printf("\n\nadding a listener for the Layout node\n");
- Sequence< ::rtl::OUString > aNodesToListen(1);
- aNodesToListen[0] = UNI_STRING(pLayoutNode);
- aSession.startListening(aNodesToListen, NULL);
-
- printf("waiting 10 seconds ....\n\n");
- aWaitForSomething.reset();
- aTimeout.Seconds = 10;
- aWaitForSomething.wait(&aTimeout);
-*/
- // --------- getNode (2) ----------
-// printf("\ndoing a new getNode for the Layout node ...\n");
-// aWaitForSomething.reset();
-// aSession.getNode(UNI_STRING(pLayoutNode), new OOpenNodeCallback(aWaitForSomething));
-// switch (aWaitForSomething.wait(&aTimeout))
-// {
-// case ICondition::result_error:
-// printf("error while waiting for the callback ... exiting\n\n");
-// return;
-// case ICondition::result_timeout:
-// printf("timed out ... exiting\n\n");
-// return;
-// }
-
- aSession.closeNode(sOpenedNode, NULL);
- aSession.close(NULL);
-
-}
-
diff --git a/configmgr/workben/local_io/com.sun.star.office.Setup.xml b/configmgr/workben/local_io/com.sun.star.office.Setup.xml
deleted file mode 100644
index 4018ab3b8d..0000000000
--- a/configmgr/workben/local_io/com.sun.star.office.Setup.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<com.sun.star.office.Setup>
- <Language>
- <Language_ID Type="string"><value>1033</value></Language_ID>
- </Language>
- <Modules>
- <SCalc Type="boolean">
- <value>true</value>
- </SCalc>
- <SChart Type="boolean">
- <value>true</value>
- </SChart>
- <SDraw Type="boolean">
- <value>true</value>
- </SDraw>
- <SImage Type="boolean">
- <value>true</value>
- </SImage>
- <SImpress Type="boolean">
- <value>true</value>
- </SImpress>
- <SMath Type="boolean">
- <value>true</value>
- </SMath>
- <SWriter Type="boolean">
- <value>true</value>
- </SWriter>
- </Modules>
-</com.sun.star.office.Setup> \ No newline at end of file
diff --git a/configmgr/workben/local_io/filetest.cxx b/configmgr/workben/local_io/filetest.cxx
deleted file mode 100644
index ab2b0223eb..0000000000
--- a/configmgr/workben/local_io/filetest.cxx
+++ /dev/null
@@ -1,90 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <iostream>
-#include<osl/file.hxx>
-
-#include <rtl/ustring.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-
-// -----------------------------------------------------------------------------
-// --------------------------------- namespaces ---------------------------------
-// -----------------------------------------------------------------------------
-using namespace com::sun::star::uno;
-
-using ::rtl::OUString;
-using ::osl::File;
-// -----------------------------------------------------------------------------
-// ---------------------------------- defines ----------------------------------
-// -----------------------------------------------------------------------------
-#define ASCII(x) OUString::createFromAscii(x)
-
-
-// -----------------------------------------------------------------------------
-// ------------------------------------ main ------------------------------------
-// -----------------------------------------------------------------------------
-
-/*
-OUString operator+(const OUString &a, const OUString &b)
-{
- OUString c = a;
- c += b;
- return c;
-}
-*/
-
-#if (defined UNX) || (defined OS2)
-int main( int argc, char * argv[] )
-#else
-int _cdecl main( int argc, char * argv[] )
-#endif
-{
- OUString aPath = ASCII("f:/local/SRC598/configmgr/workben/local_io");
- OUString aFilename = ASCII("com.sun.star.office.Setup");
- OUString aExtension = ASCII("xml");
-
- OUString aFullname = aPath + ASCII("/") + aFilename + ASCII(".") + aExtension;
-
- // Filename convertieren
- OUString aURL;
- File aConvert(ASCII(""));
- aConvert.normalizePath(aFullname, aURL);
-
- // File oeffnen
- File aFile(aURL);
- aFile.open(osl_File_OpenFlag_Read);
-
- sal_uInt64 nBytesRead;
- Sequence< sal_Int8 > aBufferSeq(2000);
- sal_Int8 *pBuff = aBufferSeq.getArray();
- aFile.read(pBuff, 2000, nBytesRead);
-
- aFile.close();
- return 0;
-}
diff --git a/configmgr/workben/local_io/makefile.mk b/configmgr/workben/local_io/makefile.mk
deleted file mode 100644
index 4e3e2f7d2f..0000000000
--- a/configmgr/workben/local_io/makefile.mk
+++ /dev/null
@@ -1,110 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJINC=$(PRJ)$/source
-
-PRJNAME=configmgr
-
-TARGET=cfgfile
-TARGETTYPE=CUI
-LIBTARGET=NO
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-.INCLUDE : settings.mk
-
-# --- Files --------------------------------------------------------
-
-# ... common for all test executables ..............................
-APPSTDLIBS=\
- $(SALLIB) \
- $(VOSLIB) \
- $(CPPULIB) \
- $(UNOTOOLSLIB) \
- $(CPPUHELPERLIB) \
-
-
-# ... FileTests .....................................................
-APP1STDLIBS = $(APPSTDLIBS) \
- $(STDLIBCPP) \
-
-APP1STDLIBS+=$(STDLIBCPP)
-
-APP1TARGET= $(TARGET)
-
-APP1OBJS= \
- $(SLO)$/cfgfile.obj \
- $(SLO)$/oslstream.obj \
- $(SLO)$/filehelper.obj \
- $(SLO)$/simpletest.obj \
- $(SLO)$/strimpl.obj \
- $(SLO)$/confname.obj \
-
-# $(SLO)$/xmlexport.obj \
-# $(SLO)$/xmlimport.obj \
-
-# $(SLO)$/xmltreebuilder.obj \
-# $(SLO)$/cmtree.obj \
-# $(SLO)$/cmtreemodel.obj \
-# $(SLO)$/typeconverter.obj \
-# $(SLO)$/changes.obj \
-# $(SLO)$/xmlformater.obj \
-# $(SLO)$/attributes.obj \
-# $(SLO)$/tracer.obj \
-
-
-# ... common for all test executables ..............................
-# APP2STDLIBS = $(APPSTDLIBS)
-#
-# APP2STDLIBS+=$(STDLIBCPP)
-#
-# APP2TARGET= cfglocal
-# APP2OBJS= \
-# $(SLO)$/cfglocal.obj \
-# $(SLO)$/receivethread.obj \
-# $(SLO)$/redirector.obj \
-# $(SLO)$/socketstream.obj \
-# $(SLO)$/attributes.obj \
-# $(SLO)$/localsession.obj \
-# $(SLO)$/saxtools.obj \
-# $(SLO)$/mergeupdates.obj \
-# $(SLO)$/oslstream.obj \
-# $(SLO)$/configsession.obj \
-# $(SLO)$/confname.obj \
-# $(SLO)$/sessionstream.obj \
-# $(SLO)$/filehelper.obj \
-# $(SLO)$/tracer.obj \
-# $(SLO)$/updatedom.obj \
-# $(SLO)$/strconverter.obj \
-# $(SLO)$/strimpl.obj \
-#
-
-.INCLUDE : target.mk
-
-
diff --git a/configmgr/workben/local_io/org.openoffice.test.xml b/configmgr/workben/local_io/org.openoffice.test.xml
deleted file mode 100644
index b0c76cbf86..0000000000
--- a/configmgr/workben/local_io/org.openoffice.test.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-
-<org.openoffice.test
-xmlns="http://openoffice.org/2000/registry/components/org.openoffice.Inet"
-xmlns:cfg="http://openoffice.org/2000/registry/instance"
-xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xml:lang="en-US">
-
-<!-- long -->
- <Long cfg:type="long">100000000000000</Long>
- <LongList cfg:type="long" cfg:derivedBy="list">1 2 3
-
- 4 5
-
-
-
-
- 6 7 8 9</LongList>
- <LongList2 cfg:type="long" cfg:derivedBy="list" cfg:separator=".">1.2.3.4.5.6.7.8.9</LongList2>
-
-<!-- double -->
- <DoubleWithDot cfg:type="double">.787564</DoubleWithDot>
- <EuroDM cfg:type="double">1.95583</EuroDM>
- <ZeroDotZeroZeroOne cfg:type="double">0.001</ZeroDotZeroZeroOne>
- <ZeroDotOne cfg:type="double">0.1</ZeroDotOne>
- <NZeroDotOne cfg:type="double">-0.1</NZeroDotOne>
-
-<!-- binary -->
- <Binary cfg:type="binary" cfg:nullable="true" xsi:null="true"/>
- <Binary2 cfg:type="binary" xsi:null="true"/>
- <Binary3 cfg:type="binary" >010203040506070809</Binary3>
- <Binary4 cfg:type="binary" cfg:nullable="true">000102030405060708090a</Binary4>
-
-<!-- Strings -->
- <NullString cfg:type="string" xsi:null="true"/>
- <String cfg:type="string">Identifier</String>
- <StringList cfg:type="string" cfg:derivedBy="list">file:/ private:explorer private:help private:newmenu private:schedule private:searchfolder private:user</StringList>
- <List cfg:type="string" cfg:derivedBy="list">NULL</List>
- <PathAutoCorrect cfg:type="string" cfg:separator=":" cfg:derivedBy="list">$(inst)/share/autocorr:$(user)/autocorr</PathAutoCorrect>
- <List2 cfg:type="string" cfg:derivedBy="list" cfg:separator="stupid" >NULLstupidFIRSTstupidSECONDstupid</List2>
- <SeparatorKiller cfg:type="string" cfg:derivedBy="list" cfg:separator="." > .,.;.:.#.|.a._.!.$.%./.(.)=.?.+.*.#.~.'.\.{.}._</SeparatorKiller>
-
-<!-- localized -->
- <LocaleString cfg:type="string" cfg:localized="true">
- <cfg:value xml:lang="en-US">This is a string</cfg:value>
- <cfg:value xml:lang="de-DE">Dies ist ein String</cfg:value>
- </LocaleString>
-
-<!-- boolean -->
- <BoolFalse cfg:type="boolean">false</BoolFalse>
- <BoolTrue cfg:type="boolean">true</BoolTrue>
- <BoolList cfg:type="boolean" cfg:derivedBy="list">true true false</BoolList>
- <BoolNULL cfg:type="boolean" xsi:null="true"/>
-
-<!-- int -->
- <Integer cfg:type="int">3</Integer>
- <IntegerNullWithXsi cfg:type="int" xsi:null="true">10</IntegerNullWithXsi>
- <IntegerNull cfg:type="int"/>
-
- <IntList cfg:type="int" cfg:derivedBy="list">1 2 3 4 5 6 7 8 224 226 222 223 5</IntList>
-
-<!-- short -->
- <Short cfg:type="short">100</Short>
-
- <Inner>
- <Inner2>
- <IntList cfg:type="int" cfg:derivedBy="list">224 226 222 223 5</IntList>
- </Inner2>
- </Inner>
-
-</org.openoffice.test>
diff --git a/configmgr/workben/local_io/simpletest.cxx b/configmgr/workben/local_io/simpletest.cxx
deleted file mode 100644
index 7e8d3ea966..0000000000
--- a/configmgr/workben/local_io/simpletest.cxx
+++ /dev/null
@@ -1,758 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <memory>
-#include <vector>
-#include <stack>
-#include<osl/file.hxx>
-
-#include <rtl/ustring.hxx>
-#include <rtl/string.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <cppuhelper/implbase1.hxx>
-#include <cppuhelper/implbase2.hxx>
-#include <cppuhelper/servicefactory.hxx>
-
-#ifndef _COM_SUN_STAR_LANG_XCOMPONENT_HDL_
-#include <com/sun/star/lang/XComponent.hpp>
-#endif
-#ifndef _COM_SUN_STAR_IO_XACTIVEDATASOURCE_HDL_
-#include <com/sun/star/io/XActiveDataSource.hpp>
-#endif
-#ifndef _COM_SUN_STAR_IO_XACTIVEDATASINK_HDL_
-#include <com/sun/star/io/XActiveDataSink.hpp>
-#endif
-#ifndef _COM_SUN_STAR_IO_XACTIVEDATACONTROL_HDL_
-#include <com/sun/star/io/XActiveDataControl.hpp>
-#endif
-#ifndef _COM_SUN_STAR_IO_XDATATRANSFEREVENTLISTENER_HDL_
-#include <com/sun/star/io/XDataTransferEventListener.hpp>
-#endif
-#ifndef _COM_SUN_STAR_IO_XDATAIMPORTER_HDL_
-#include <com/sun/star/io/XDataImporter.hpp>
-#endif
-
-#ifndef _COM_SUN_STAR_IO_XINPUTSTREAM_HDL_
-#include <com/sun/star/io/XInputStream.hpp>
-#endif
-#include <com/sun/star/xml/sax/XParser.hpp>
-#include <com/sun/star/xml/sax/SAXParseException.hpp>
-#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
-
-#include <com/sun/star/xml/sax/InputSource.hpp>
-#include <vos/thread.hxx>
-
-#include <vos/pipe.hxx>
-#include <osl/diagnose.h>
-#include "oslstream.hxx"
-#include <com/sun/star/xml/sax/XAttributeList.hpp>
-
-#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/container/XHierarchicalName.hpp>
-
-#include <com/sun/star/container/XNameReplace.hpp>
-#include <com/sun/star/util/XChangesBatch.hpp>
-#include <com/sun/star/script/XTypeConverter.hpp>
-#include <com/sun/star/container/XNameContainer.hpp>
-#include <osl/conditn.hxx>
-
-#include "xmltreebuilder.hxx"
-
-#include "dataimport.hxx"
-
-#include "createpropertyvalue.hxx"
-#include "strdecl.hxx"
-
-#include "confname.hxx"
-
-#include "FileHelper.hxx"
-
-// -----------------------------------------------------------------------------
-// --------------------------------- namespaces ---------------------------------
-// -----------------------------------------------------------------------------
-namespace uno = com::sun::star::uno;
-namespace lang = com::sun::star::lang;
-namespace io = com::sun::star::io;
-namespace sax = com::sun::star::xml::sax;
-namespace script = com::sun::star::script;
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::xml::sax;
-using namespace ::com::sun::star::io;
-using namespace rtl;
-using namespace osl;
-
-// -----------------------------------------------------------------------------
-// ---------------------------------- defines ----------------------------------
-// -----------------------------------------------------------------------------
-#ifndef ASCII
-#define ASCII(x) OUString::createFromAscii(x)
-#endif
-
-ostream& operator << (ostream& out, rtl::OUString const& aStr)
-{
- sal_Unicode const* const pStr = aStr.getStr();
- sal_Unicode const* const pEnd = pStr + aStr.getLength();
- for (sal_Unicode const* p = pStr; p < pEnd; ++p)
- if (0 < *p && *p < 127) // ASCII
- out << char(*p);
- else
- out << "[\\u" << hex << *p << "]";
- return out;
-}
-
-
-// -----------------------------------------------------------------------------
-// ---------------------------------- a Class ----------------------------------
-// -----------------------------------------------------------------------------
-// <Name a="xyz" b="bar">
-
-//==========================================================================
-//= Visitors
-//==========================================================================
-
-
-namespace configmgr
-{
-
- class XMLSimpleDocHandler : public ::cppu::WeakImplHelper1<sax::XDocumentHandler>
- {
- // uno::Reference< sax::XDocumentHandler > m_xWriter; // the service object for writing XML code
-
- sal_Int32 m_nElementDepth;
- sal_Int32 m_nIgnoreLevel;
- public:
- XMLSimpleDocHandler::XMLSimpleDocHandler()
- {}
-
-
- // DECLARE_UNO3_DEFAULTS(XMLReadFilter, CmDocumentHandler_BASE);
-
- // XDocumentHandler
- virtual void SAL_CALL startDocument(void)
- throw (sax::SAXException, uno::RuntimeException)
- {
- }
-
- virtual void SAL_CALL endDocument(void)
- throw(sax::SAXException, uno::RuntimeException)
- {
- }
-
- virtual void SAL_CALL startElement(const rtl::OUString& aName,
- const uno::Reference< sax::XAttributeList > &_xAttrList)
- throw(sax::SAXException, uno::RuntimeException)
- {
- sal_Int16 nAttrCount = _xAttrList.is() ? _xAttrList->getLength() : 0;
- for( sal_Int16 i=0; i < nAttrCount; i++ )
- {
- OUString aParamName( _xAttrList->getNameByIndex( i ) );
- OUString aParamValue( _xAttrList->getValueByIndex( i ) );
- volatile int dummy = 0;
- }
- }
-
- virtual void SAL_CALL endElement(const rtl::OUString& aName)
- throw(sax::SAXException, uno::RuntimeException)
- {
- }
-
- virtual void SAL_CALL characters(const rtl::OUString& aChars)
- throw(sax::SAXException, uno::RuntimeException)
- {}
-
-
- virtual void SAL_CALL ignorableWhitespace(const rtl::OUString& aWhitespaces)
- throw(sax::SAXException, uno::RuntimeException)
- {}
-
-
- virtual void SAL_CALL processingInstruction(const rtl::OUString& aTarget,
- const rtl::OUString& aData)
- throw(sax::SAXException, uno::RuntimeException)
- {}
-
- virtual void SAL_CALL setDocumentLocator(const uno::Reference< sax::XLocator > &xLocator)
- throw(sax::SAXException, uno::RuntimeException)
- {}
- };
-
-// -----------------------------------------------------------------------------
-// ------------------------------------ Test ------------------------------------
-// -----------------------------------------------------------------------------
-#define ASCII_STRING(rtlOUString) rtl::OUStringToOString(rtlOUString, RTL_TEXTENCODING_ASCII_US).getStr()
- static ::rtl::OUString sRegistry = ::rtl::OUString::createFromAscii("applicat.rdb");
-
- void simpleTest()
- {
- uno::Reference< lang::XMultiServiceFactory > xMSF;
- try
- {
- xMSF = cppu::createRegistryServiceFactory(sRegistry, ::rtl::OUString());
- }
- catch (uno::Exception& e)
- {
- cout << "could not bootstrap the services from " << ASCII_STRING(sRegistry) << endl ;
- cout << " (error message : " << ASCII_STRING(e.Message) << ")" << endl;
- }
-
- if (!xMSF.is())
- {
- cerr << "could not create the service factory !" << endl;
- return;
- }
-
- OUString aPath = ASCII("e:/temp/Test");
- OUString aFilename = ASCII("calc");
- OUString aExtension = ASCII("xml");
-
- OUString aFullname = aPath + ASCII("/") + aFilename + ASCII(".") + aExtension;
-
- // Filename convertieren
- OUString aURL;
- File aConvert(ASCII(""));
- aConvert.normalizePath(aFullname, aURL);
-
- // File oeffnen
- File aFile(aURL);
- aFile.open(osl_File_OpenFlag_Read);
-
- uno::Reference<io::XInputStream> xInputStream =
- new configmgr::OSLInputStreamWrapper(aFile);
-
- // connect stream to input stream to the parser
- InputSource aInputSource;
- Reference<XInputStream> xPipeInput( xInputStream, UNO_QUERY );
- aInputSource.aInputStream = xPipeInput;
-
- Reference< sax::XParser > xParser;
- xParser = Reference< sax::XParser > (
- xMSF->createInstance(
- ::rtl::OUString::createFromAscii("com.sun.star.xml.sax.Parser")), UNO_QUERY);
-
- XMLSimpleDocHandler *pTest = new XMLSimpleDocHandler();
-
- // get filter
- Reference<XDocumentHandler> xFilter = pTest;
-
- // connect parser and filter
- xParser->setDocumentHandler( xFilter );
-
- // parse
- sal_Int16 nRet = 0;
- OUString sError;
- try
- {
- xParser->parseStream( aInputSource );
- }
- catch( SAXParseException &e )
- {
- OUString sLine = OUString::valueOf(e.LineNumber);
- OUString aStr = ASCII("SAXParseException occured in ");
- sError = aStr + ASCII(" Line: (") + sLine + ASCII(")");
-
- OSL_ENSURE(0, rtl::OUStringToOString(sError,RTL_TEXTENCODING_ASCII_US).getStr());
- nRet = 3;
- }
- catch( SAXException &e )
- {
- sError = e.Message;
- OSL_ENSURE(0, rtl::OUStringToOString(sError,RTL_TEXTENCODING_ASCII_US).getStr());
- nRet = 4;
- }
- catch( IOException &e )
- {
- sError = e.Message;
- OSL_ENSURE(0, rtl::OUStringToOString(sError,RTL_TEXTENCODING_ASCII_US).getStr());
- nRet = 5;
- }
- }
-
-
-#include <osl/time.h>
-#include <rtl/string.hxx>
-
-class TimeTest
-{
- TimeValue m_aStartTime, m_aEndTime;
- bool m_bStarted;
-public:
- TimeTest()
- :m_bStarted(false)
- {
- }
-
- void start()
- {
- m_bStarted = true;
- osl_getSystemTime(&m_aStartTime);
- }
- void stop()
- {
- osl_getSystemTime(&m_aEndTime);
- OSL_ENSURE(m_bStarted, "Not Started.");
- m_bStarted = false;
- }
- void showTime(const rtl::OString & aWhatStr)
- {
- OSL_ENSURE(!m_bStarted, "Not Stopped.");
-
- sal_Int32 nSeconds = m_aEndTime.Seconds - m_aStartTime.Seconds;
- sal_Int32 nNanoSec = m_aEndTime.Nanosec - m_aStartTime.Nanosec;
- if (nNanoSec < 0)
- {
- nNanoSec = 1000000000 - nNanoSec;
- nSeconds++;
- }
- rtl::OString aStr = "Time for ";
- aStr += aWhatStr;
- aStr += " : ";
- aStr += rtl::OString::valueOf(nSeconds);
- aStr += ".";
- aStr += rtl::OString::valueOf(nNanoSec);
-
- cout << aStr.getStr() << endl;
- }
-
-};
-
-// -----------------------------------------------------------------------------
-// -------------------------------- Mapping Test --------------------------------
-// -----------------------------------------------------------------------------
-// Simple Map created with a stl::vector
-
-typedef ::std::pair< rtl::OUString, rtl::OUString > Assoc;
-// typedef ::std::set<Assoc, ltNode> MappingTable;
-typedef std::vector<Assoc> MappingTable;
-
-rtl::OUString mapTo(const rtl::OUString& aFrom, bool bToNew)
-{
- static MappingTable aMap;
- if (aMap.empty())
- {
- // Fill Map old, new
-
- aMap.push_back(Assoc(ASCII("value"), TAG_VALUE));
- aMap.push_back(Assoc(ASCII("type"), ATTR_TYPE));
- aMap.push_back(Assoc(ASCII("instance"), ATTR_INSTANCE));
- }
- if (bToNew)
- {
- // check, if we should convert first to second
- for (std::vector<Assoc>::const_iterator it = aMap.begin();it != aMap.end();++it)
- {
- if ((*it).first.equals(aFrom))
- return (*it).second;
- }
- }
- else
- {
- // check if we should convert second to first
- for (std::vector<Assoc>::const_iterator it = aMap.begin();it != aMap.end();++it)
- {
- if ((*it).second.equals(aFrom))
- return (*it).first;
- }
- }
-
- // do nothing!
- return aFrom;
-}
-// -----------------------------------------------------------------------------
-void simpleMappingTest()
-{
- OUString aValue = ASCII("value");
- OUString aNew;
-
- aNew = mapTo(aValue, true); // true for ToNew
- aNew = mapTo(aNew, false);
- aNew = mapTo(aNew, false);
-
- volatile int dummy = 0;
-}
-
-// -----------------------------------------------------------------------------
- void speedTest()
- {
- // check speed of:
- // ASCII("value")
- // TAG_VALUE
- // ...
-
- sal_Int32 nCount = 1000 * 1000 * 100;
- sal_Int32 n;
-
- cout << "Starting Timetest" << endl;
- TimeTest tt;
- tt.start();
- for(n=0;n<nCount;n++)
- {
- }
- tt.stop();
- tt.showTime("Leere Schleife: ");
-
-
- nCount = 1000 * 1000 * 5;
- rtl::OUString aStr;
-
- tt.start();
- for(n=0;n<nCount;n++)
- {
- aStr = ASCII("value");
- }
- tt.stop();
- tt.showTime("ASCII() ");
-
-
- OUString aValue = ASCII("value");
- tt.start();
- for(n=0;n<nCount;n++)
- {
- aStr = TAG_VALUE;
- }
- tt.stop();
- tt.showTime("TAG_VALUE: ");
-
- }
-
-OUString changeToComSunStarPath(const OUString &aPath)
-{
- static OUString aOO = ASCII("org.OpenOffice");
- static OUString aCSS = ASCII("com.sun.star");
- OUString aNewPath;
-
- // compare
- if (aPath.compareTo( aOO, aOO.getLength() ) == 0)
- {
- aNewPath = aCSS;
- aNewPath += aPath.copy(aOO.getLength());
- return aNewPath;
- }
- return aPath;
-}
-
-void stringTest2()
-{
- OUString aPath = ASCII("org.OpenOffice.Setup/blah/blub");
-
- OUString aNewPath = changeToComSunStarPath(aPath);
- volatile int dummy = 0;
-}
-
-/*
-
-class A
-{
-public:
- static void run() {
- cout << "This is A::run();" << endl;
- }
-
-};
-
-class B : public A
-{
-public:
-
- static void run() {
- cout << "This is B::run();" << endl;
- }
-};
-
-void classTest()
-{
- A a;
- B b;
- B::run();
-}
-*/
-
-// -----------------------------------------------------------------------------
-// ------------------------------------ Map ------------------------------------
-// -----------------------------------------------------------------------------
-struct ltstr
-{
- bool operator()(const rtl::OUString &s1, const rtl::OUString &s2) const
- {
- return s1.compareTo(s2) < 0 ? true : false;
- }
-};
-
-void stringTest()
-{
- map<const OUString, int, ltstr> months;
-
- months[ASCII("january")] = 31;
- months[ASCII("february")] = 28;
- months[ASCII("march")] = 31;
- months[ASCII("april")] = 30;
- months[ASCII("may")] = 31;
- months[ASCII("june")] = 30;
- months[ASCII("july")] = 31;
- months[ASCII("august")] = 31;
- months[ASCII("september")] = 30;
- months[ASCII("october")] = 31;
- months[ASCII("november")] = 30;
- months[ASCII("december")] = 31;
-
- cout << "june -> " << months[ASCII("june")] << endl;
- map<const OUString, int, ltstr>::iterator cur = months.find(ASCII("april"));
- // map<const OUString, int, ltstr>::iterator prev = cur;
- map<const OUString, int, ltstr>::iterator next = cur;
- // ++next;
- // --prev;
- // cout << "Previous (in alphabetical order) is " << (*prev).first << endl;
- for(int i=0;i<12;i++)
- {
- cout << "Next (in alphabetical order) is " << (*next).first << " days " << (*next).second << endl;
- ++next;
- }
-}
-
-// -----------------------------------------------------------------------------
-// ---------------------------------- HashMap ----------------------------------
-// -----------------------------------------------------------------------------
-#include <hash_map>
-
-
-namespace test {
-
-struct eqstr
-{
- bool operator()(const rtl::OUString &s1, const rtl::OUString &s2) const
- {
- return s1.equals(s2) == sal_True ? true : false;
- }
-};
-
-struct hash_oustring
-{
- // This hash funktion is a copy of hash<char*> from SGI-STL
- size_t operator()(const rtl::OUString &_s) const
- {
- sal_Int64 nStrLen = _s.getLength();
- const sal_Unicode *pStr = _s.getStr();
- unsigned long h = 0;
- for (sal_Int64 i=0;i<nStrLen; ++i)
- h = 5*h + *pStr++;
-
- return size_t(h);
- }
-};
-
-void hash_test()
-{
- hash_map<const rtl::OUString, rtl::OUString, hash_oustring, eqstr> months;
-
- rtl::OUString sJanuary = ASCII("january");
- months[sJanuary] = ASCII("31");
- months[ASCII("february")] = ASCII("28");
- months[ASCII("march")] = ASCII("31");
- months[ASCII("april")] = ASCII("30");
- months[ASCII("may")] = ASCII("31");
- months[ASCII("june")] = ASCII("30");
- months[ASCII("july")] = ASCII("31");
- months[ASCII("august")] = ASCII("31");
- months[ASCII("september")] = ASCII("30");
- months[ASCII("october")] = ASCII("31");
- months[ASCII("november")] = ASCII("30");
- months[ASCII("december")] = ASCII("31");
-
- cout << "september -> " << months[ASCII("september")] << endl;
- cout << "april -> " << months[ASCII("april")] << endl;
- cout << "june -> " << months[ASCII("june")] << endl;
- cout << "november -> " << months[ASCII("november")] << endl;
-}
-}
-
-
-// -----------------------------------------------------------------------------
-// Fri Nov 10 15:10:45 2000
-// -----------------------------------------------------------------------------
-
-#include <vos/ref.hxx>
-
-class Options : public vos::OReference
-{
- int m_aValue;
-public:
- int getValue() {return m_aValue;}
- void setValue(int _aValue) {m_aValue = _aValue;}
-
-
-};
-
-class A
-{
- vos::ORef<Options> m_aOptions;
-public:
-
- vos::ORef<Options> getOptions() {return m_aOptions;}
- void setOptions(vos::ORef<Options>& _aOptions) {
- m_aOptions = _aOptions;
- }
-};
-
-void testRefs()
-{
- vos::ORef<Options> aO = new Options;
- aO->setValue(10);
-
- A a,b;
- a.setOptions(aO);
- b.setOptions(aO);
- cout << "Options from a : " << a.getOptions()->getValue() << endl;
- cout << "Options from b : " << b.getOptions()->getValue() << endl;
-
- aO->setValue(20);
- cout << "Options from a : " << a.getOptions()->getValue() << endl;
- cout << "Options from b : " << b.getOptions()->getValue() << endl;
-}
-
-
-
-void ConfigName()
-{
- // OUString aSubtreePath = ASCII("/org.openoffice.office.common/path/blah/blub");
- OUString aSubtreePath = ASCII("/org.openoffice.office.common");
- ConfigurationName aName(aSubtreePath);
- OUString a = aName.localName();
- OUString b = aName.fullName();
- OUString c = aName.moduleName();
- ConfigurationName aParentName(aName.getParentName());
- OUString d = aParentName.fullName();
-
-
- {
- ConfigurationName aName( ASCII("/" ));
-
- std::stack< rtl::OUString, std::vector<rtl::OUString> > m_aStringStack;
-
- if (aName.localName().getLength() != 0)
- {
- for (ConfigurationName::Iterator it = aName.begin();
- it != aName.end();
- ++it)
- {
- rtl::OUString aName = *it;
- m_aStringStack.push(aName);
- // m_xHandler->startElement(*it, rList);
- volatile int dummy = 0;
- }
- }
-
- // bBack = writeChanges();
-
- while(!m_aStringStack.empty())
- {
- OUString aName = m_aStringStack.top();
- m_aStringStack.pop();
- }
- }
-}
-
-void ConfigName2()
-{
- OUString aSubtreePath = ASCII("/org.openoffice.office.common/path/blah/blub");
- ConfigurationName aName(aSubtreePath);
- ConfigurationName aParent = aName.getParentName();
-
- for (ConfigurationName::Iterator it = aName.begin();
- it != aName.end();
- ++it)
- {
- rtl::OUString aName = *it;
- volatile int dummy = 0;
- }
-}
-
-// -----------------------------------------------------------------------------
-inline void operator <<= (rtl::OUString& _rUnicodeString, const sal_Char* _pAsciiString)
-{
- _rUnicodeString = ::rtl::OUString::createFromAscii(_pAsciiString);
-}
-
-inline void operator <<= (rtl::OUString& _rUnicodeString, const rtl::OString& _rAsciiString)
-{
- _rUnicodeString <<= _rAsciiString.getStr();
-}
-
-inline void operator <<= (rtl::OString& _rAsciiString, const rtl::OUString& _rUnicodeString)
-{
- _rAsciiString = rtl::OUStringToOString(_rUnicodeString,RTL_TEXTENCODING_ASCII_US);
-}
-
-// -----------------------------------------------------------------------------
-bool isBTimeGreaterATime(TimeValue const& A, TimeValue const& B)
-{
- if (B.Seconds > A.Seconds) return true;
- if (B.Nanosec > A.Nanosec) return true;
-
- // lower or equal
- return false;
-}
-
-// -----------------------------------------------------------------------------
-
-void oslTest()
-{
-
- OUString aDirectory(FileHelper::convertFilenameToFileURL(ASCII("c:/temp/file.out.1")));
- TimeValue a = FileHelper::getFileModificationStamp(aDirectory);
-
- OUString aDirectory2(FileHelper::convertFilenameToFileURL(ASCII("c:/temp/file.out.2")));
- TimeValue b = FileHelper::getFileModificationStamp(aDirectory2);
-
- if (isBTimeGreaterATime(a,b))
- {
- OSL_ENSURE(false, "FileB ist neuer als FileA");
- }
-
-
-/*
- OUString aDirectory(FileHelper::convertFilenameToFileURL(ASCII("c:/temp/dies")));
- osl::FileBase::RC eError = osl::Directory::create(aDirectory);
- if (eError != osl::FileBase::E_None)
- {
- OUString aUStr = FileHelper::createOSLErrorString(eError);
- OString aStr;
- aStr <<= aUStr;
- OSL_ENSURE(false, aStr.getStr());
- }
-*/
-}
-
-} // namespace configmgr
diff --git a/configmgr/workben/local_io/xmlexport.cxx b/configmgr/workben/local_io/xmlexport.cxx
deleted file mode 100644
index 346a06da05..0000000000
--- a/configmgr/workben/local_io/xmlexport.cxx
+++ /dev/null
@@ -1,236 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include<iostream>
-#include<osl/file.hxx>
-
-#include <rtl/ustring.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <cppuhelper/implbase1.hxx>
-#include <cppuhelper/implbase2.hxx>
-#include <cppuhelper/servicefactory.hxx>
-/*
-#include <cppuhelper/implbase1.hxx>
-*/
-#ifndef _COM_SUN_STAR_LANG_XCOMPONENT_HDL_
-#include <com/sun/star/lang/XComponent.hpp>
-#endif
-#ifndef _COM_SUN_STAR_IO_XDATATRANSFEREVENTLISTENER_HDL_
-#include <com/sun/star/io/XDataTransferEventListener.hpp>
-#endif
-#ifndef _COM_SUN_STAR_IO_XDATAIMPORTER_HDL_
-#include <com/sun/star/io/XDataExporter.hpp>
-#endif
-#ifndef _COM_SUN_STAR_IO_XINPUTSTREAM_HDL_
-#include <com/sun/star/io/XOutputStream.hpp>
-#endif
-#include <com/sun/star/io/XActiveDataSource.hpp>
-#include <com/sun/star/xml/sax/SAXParseException.hpp>
-#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
-#include <osl/diagnose.h>
-#include <com/sun/star/xml/sax/XAttributeList.hpp>
-
-#include "oslstream.hxx"
-#include "attributes.hxx"
-#include "typeconverter.hxx"
-#include "xmlformater.hxx"
-#include "filehelper.hxx"
-
-
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/lang/IllegalArgumentException.hpp>
-
-#include "createpropertyvalue.hxx"
-// -----------------------------------------------------------------------------
-// --------------------------------- namespaces ---------------------------------
-// -----------------------------------------------------------------------------
-namespace configmgr
-{
-
- namespace uno = com::sun::star::uno;
- namespace lang = com::sun::star::lang;
- namespace io = com::sun::star::io;
- namespace sax = com::sun::star::xml::sax;
- namespace beans = com::sun::star::beans;
-
- using ::rtl::OUString;
- using ::osl::File;
-
- using namespace ::com::sun::star::uno;
- using namespace ::com::sun::star::lang;
- using namespace ::com::sun::star::container;
-
-// -----------------------------------------------------------------------------
-// ---------------------------------- defines ----------------------------------
-// -----------------------------------------------------------------------------
-#define ASCII(x) OUString::createFromAscii(x)
-
-// -----------------------------------------------------------------------------
- class Listener : public ::cppu::WeakImplHelper1<io::XDataTransferEventListener>
- {
- virtual void SAL_CALL disposing( const lang::EventObject& Source )
- throw(::com::sun::star::uno::RuntimeException)
- {
- OSL_ENSURE(0, "disposing");
- }
-
-
- virtual void SAL_CALL finished( const io::DataTransferEvent& aEvent )
- throw(uno::RuntimeException)
- {
- OSL_ENSURE(0, "finished");
- }
-
- virtual void SAL_CALL cancelled( const io::DataTransferEvent& aEvent )
- throw(uno::RuntimeException)
- {
- OSL_ENSURE(0, "cancelled");
- }
- };
-
- class Component: public ::cppu::WeakImplHelper1<lang::XComponent>
- {
- virtual void SAL_CALL dispose( )
- throw(uno::RuntimeException)
- {
- OSL_ENSURE(0, "dispose");
-
- }
- virtual void SAL_CALL addEventListener( const uno::Reference< lang::XEventListener >& xListener )
- throw(uno::RuntimeException)
- {
- OSL_ENSURE(0, "addEventListener");
- }
- virtual void SAL_CALL removeEventListener( const uno::Reference< lang::XEventListener >& aListener )
- throw(uno::RuntimeException)
- {
- OSL_ENSURE(0, "removeEventListener");
- }
- };
-
-
-
-
-
-#define ASCII_STRING(rtlOUString) rtl::OUStringToOString(rtlOUString, RTL_TEXTENCODING_ASCII_US).getStr()
- static ::rtl::OUString sRegistry = ::rtl::OUString::createFromAscii("applicat.rdb");
-
-
-
-
-
-
-
-
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
- void exportTest()
- {
- uno::Reference< lang::XMultiServiceFactory > xMSF;
- try
- {
- xMSF = cppu::createRegistryServiceFactory(sRegistry, ::rtl::OUString());
- }
- catch (uno::Exception& e)
- {
- cout << "could not bootstrap the services from " << ASCII_STRING(sRegistry) << endl ;
- cout << " (error message : " << ASCII_STRING(e.Message) << ")" << endl;
- }
-
- if (!xMSF.is())
- {
- cerr << "could not create the service factory !" << endl;
- return;
- }
-
- OUString aPath = ASCII("l:/SRC601/configmgr/workben/local_io");
- OUString sFilename = ASCII("exported_config");
- OUString aExtension = ASCII("xml");
-
- OUString aFullname = aPath + ASCII("/") + sFilename + ASCII(".") + aExtension;
-
- // Filename convertieren
- OUString aURL;
- File aConvert(ASCII(""));
- aConvert.normalizePath(aFullname, aURL);
-
- FileHelper::tryToRemoveFile(aURL);
-
- rtl::OUString sError;
-
- // File oeffnen
- File aFile(aURL);
- osl::FileBase::RC eError = aFile.open(OpenFlag_Write | OpenFlag_Create);
-
- if (eError != osl_File_E_None)
- {
- sError = ASCII("XMLExportTest:");
- rtl::OString aStr = rtl::OUStringToOString(sError,RTL_TEXTENCODING_ASCII_US);
- OSL_ENSURE(0, aStr.getStr());
- return;
- }
-
- // create an outputstream
- uno::Reference<io::XOutputStream> xOutputStream = new configmgr::OSLOutputStreamWrapper(aFile);
-
- // Listener & Component
- uno::Reference<io::XDataTransferEventListener> rListener = new Listener();
- uno::Reference<lang::XComponent> rComponent = new Component();
-
-
- OUString sPath = ASCII("com.sun.star.ucb.Hierarchy");
-
- // Create a TypeConverter
- uno::Reference<script::XTypeConverter> aConverter;
- aConverter = aConverter.query(xMSF->createInstance(ASCII( "com.sun.star.script.Converter" )) );
-
- // prepare parameters for DataExport
- Sequence< uno::Any > aArgs(4);
- aArgs[0] <<= createPropertyValue(ASCII("PackageName"), sFilename);
- aArgs[1] <<= createPropertyValue(ASCII("Path"), sPath); // multiple occur possible
- aArgs[2] <<= createPropertyValue(ASCII("TypeConverter"), aConverter); // optional
- aArgs[3] <<= createPropertyValue(ASCII("Path"), ASCII("com.sun.star.office.Setup")); // multiple occur possible
-
- // important: createInstanceWithArguments will throw an IllegalArgumentException() if
- // parameters are wrong...
- Reference< XInterface > xDataExport = xMSF->createInstanceWithArguments(
- OUString::createFromAscii("com.sun.star.configuration.DataExport"),
- aArgs);
-
- uno::Reference<io::XDataExporter> rExporter(xDataExport, UNO_QUERY);
-
- // Export Data
- rExporter->exportData(xOutputStream, rComponent, rListener);
- }
-
-} // namespace configmgr
diff --git a/configmgr/workben/local_io/xmlimport.cxx b/configmgr/workben/local_io/xmlimport.cxx
deleted file mode 100644
index cab2dbc014..0000000000
--- a/configmgr/workben/local_io/xmlimport.cxx
+++ /dev/null
@@ -1,469 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <memory>
-#include <vector>
-#include <stack>
-#include<osl/file.hxx>
-
-#include <rtl/ustring.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <cppuhelper/implbase1.hxx>
-#include <cppuhelper/implbase2.hxx>
-#include <cppuhelper/servicefactory.hxx>
-
-#ifndef _COM_SUN_STAR_LANG_XCOMPONENT_HDL_
-#include <com/sun/star/lang/XComponent.hpp>
-#endif
-#ifndef _COM_SUN_STAR_IO_XACTIVEDATASOURCE_HDL_
-#include <com/sun/star/io/XActiveDataSource.hpp>
-#endif
-#ifndef _COM_SUN_STAR_IO_XACTIVEDATASINK_HDL_
-#include <com/sun/star/io/XActiveDataSink.hpp>
-#endif
-#ifndef _COM_SUN_STAR_IO_XACTIVEDATACONTROL_HDL_
-#include <com/sun/star/io/XActiveDataControl.hpp>
-#endif
-#ifndef _COM_SUN_STAR_IO_XDATATRANSFEREVENTLISTENER_HDL_
-#include <com/sun/star/io/XDataTransferEventListener.hpp>
-#endif
-#ifndef _COM_SUN_STAR_IO_XDATAIMPORTER_HDL_
-#include <com/sun/star/io/XDataImporter.hpp>
-#endif
-
-#ifndef _COM_SUN_STAR_IO_XINPUTSTREAM_HDL_
-#include <com/sun/star/io/XInputStream.hpp>
-#endif
-#include <com/sun/star/xml/sax/XParser.hpp>
-#include <com/sun/star/xml/sax/SAXParseException.hpp>
-#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
-
-#include <com/sun/star/xml/sax/InputSource.hpp>
-#include <vos/thread.hxx>
-
-#include <vos/pipe.hxx>
-#include <osl/diagnose.h>
-#include "oslstream.hxx"
-#include <com/sun/star/xml/sax/XAttributeList.hpp>
-
-#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/container/XHierarchicalName.hpp>
-
-#include <com/sun/star/container/XNameReplace.hpp>
-#include <com/sun/star/util/XChangesBatch.hpp>
-#include <com/sun/star/script/XTypeConverter.hpp>
-#include <com/sun/star/container/XNameContainer.hpp>
-#include <osl/conditn.hxx>
-
-#include "xmltreebuilder.hxx"
-
-#include "dataimport.hxx"
-
-#include "createpropertyvalue.hxx"
-// -----------------------------------------------------------------------------
-// --------------------------------- namespaces ---------------------------------
-// -----------------------------------------------------------------------------
-namespace uno = com::sun::star::uno;
-namespace lang = com::sun::star::lang;
-namespace io = com::sun::star::io;
-namespace sax = com::sun::star::xml::sax;
-namespace script = com::sun::star::script;
-
-using ::rtl::OUString;
-using ::osl::File;
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::util;
-
-// -----------------------------------------------------------------------------
-// ---------------------------------- defines ----------------------------------
-// -----------------------------------------------------------------------------
-#ifndef ASCII
-#define ASCII(x) OUString::createFromAscii(x)
-#endif
-
-
-// -----------------------------------------------------------------------------
-// ---------------------------------- a Class ----------------------------------
-// -----------------------------------------------------------------------------
-// <Name a="xyz" b="bar">
-
-//==========================================================================
-//= Visitors
-//==========================================================================
-
-
-// -----------------------------------------------------------------------------
-class Listener : public ::cppu::WeakImplHelper1<io::XDataTransferEventListener>
-{
- osl::Condition m_aCondition;
-public:
- Listener()
- {
- m_aCondition.reset(); // will block
- }
-
- virtual void SAL_CALL disposing( const lang::EventObject& Source )
- throw(::com::sun::star::uno::RuntimeException)
- {
- OSL_ENSURE(0, "disposing");
- m_aCondition.set(); // will not block
- }
-
- virtual void SAL_CALL finished( const io::DataTransferEvent& aEvent )
- throw(uno::RuntimeException)
- {
- OSL_ENSURE(0, "finished");
- m_aCondition.set(); // will not block
- }
-
- virtual void SAL_CALL cancelled( const io::DataTransferEvent& aEvent )
- throw(uno::RuntimeException)
- {
- OSL_ENSURE(0, "cancelled");
- m_aCondition.set(); // will not block
- }
-public:
- void wait()
- {
- m_aCondition.wait();
- }
-};
-
-class Component: public ::cppu::WeakImplHelper1<lang::XComponent>
-{
- virtual void SAL_CALL dispose( )
- throw(uno::RuntimeException)
- {
- OSL_ENSURE(0, "dispose");
-
- }
- virtual void SAL_CALL addEventListener( const uno::Reference< lang::XEventListener >& xListener )
- throw(uno::RuntimeException)
- {
- OSL_ENSURE(0, "addEventListener");
- }
- virtual void SAL_CALL removeEventListener( const uno::Reference< lang::XEventListener >& aListener )
- throw(uno::RuntimeException)
- {
- OSL_ENSURE(0, "removeEventListener");
- }
-};
-
-
-
-namespace configmgr
-{
-
-// -----------------------------------------------------------------------------
-// ------------------------------------ Test ------------------------------------
-// -----------------------------------------------------------------------------
-#define ASCII_STRING(rtlOUString) rtl::OUStringToOString(rtlOUString, RTL_TEXTENCODING_ASCII_US).getStr()
- static ::rtl::OUString sRegistry = ::rtl::OUString::createFromAscii("applicat.rdb");
-
- void importTest()
- {
- uno::Reference< lang::XMultiServiceFactory > xMSF;
- try
- {
- xMSF = cppu::createRegistryServiceFactory(sRegistry, ::rtl::OUString());
- }
- catch (uno::Exception& e)
- {
- cout << "could not bootstrap the services from " << ASCII_STRING(sRegistry) << endl ;
- cout << " (error message : " << ASCII_STRING(e.Message) << ")" << endl;
- }
-
- if (!xMSF.is())
- {
- cerr << "could not create the service factory !" << endl;
- return;
- }
-
- OUString aPath = ASCII("l:/SRC601/configmgr/workben/local_io");
- OUString aFilename = ASCII("hierarchy");
- OUString aExtension = ASCII("xml");
-
- OUString aFullname = aPath + ASCII("/") + aFilename + ASCII(".") + aExtension;
-
- // Filename convertieren
- OUString aURL;
- File aConvert(ASCII(""));
- aConvert.normalizePath(aFullname, aURL);
-
- // File oeffnen
- File aFile(aURL);
- aFile.open(osl_File_OpenFlag_Read);
-
- // sal_uInt64 nBytesRead;
- // uno::Sequence< sal_Int8 > aBufferSeq(2000);
- // sal_Int8 *pBuff = aBufferSeq.getArray();
- // aFile.read(pBuff, 2000, nBytesRead);
- //
- // aFile.close();
-
- uno::Reference<io::XInputStream> xInputStream = new configmgr::OSLInputStreamWrapper(aFile);
-
- uno::Reference <uno::XInterface> xPump = xMSF->createInstance( L"com.sun.star.io.Pump" );
- OSL_ENSURE(xPump.is(), "there is no pump");
-
- uno::Reference<io::XActiveDataSink> xPumpSink(xPump, uno::UNO_QUERY);
- xPumpSink->setInputStream(xInputStream);
-
- uno::Reference<io::XActiveDataSource> xPumpSource(xPump, uno::UNO_QUERY);
-
- Listener *pListener = new Listener();
- uno::Reference<io::XDataTransferEventListener> rListener = pListener;
- uno::Reference<lang::XComponent> rComponent = new Component();
-
- // Create a TypeConverter
- uno::Reference<script::XTypeConverter> aConverter;
- aConverter = aConverter.query(xMSF->createInstance(ASCII( "com.sun.star.script.Converter" )) );
-
- Sequence< uno::Any > aArgs(1); // optional arg.
- aArgs[0] <<= configmgr::createPropertyValue(ASCII("TypeConverter"), aConverter);
-
- Reference< XInterface > xDataImport = xMSF->createInstanceWithArguments(
- OUString::createFromAscii("com.sun.star.configuration.DataImport"),
- aArgs);
-
- if (xDataImport.is())
- {
- uno::Reference<io::XDataImporter> rImporter(xDataImport, UNO_QUERY);
-
- // Import Data
- rImporter->importData(xPumpSource, rComponent, rListener);
-
- // lets pump
- uno::Reference<io::XActiveDataControl> xControl(xPump, uno::UNO_QUERY);
- xControl->start();
-
- // TEST:
- // rImporter->cancel();
-
- // pImporter->wait();
- // Wait until the listener send ready
- pListener->wait();
- }
- return;
- }
-
-// -----------------------------------------------------------------------------
-// -------------------------------- Import Test --------------------------------
-// -----------------------------------------------------------------------------
-
- // ----------- TEST ReadAccess -----------
- void showSequence(const Sequence<OUString> &aSeq);
-
-void hierarchyTest()
-{
-
- uno::Reference< lang::XMultiServiceFactory > xMSF;
- try
- {
- xMSF = cppu::createRegistryServiceFactory(sRegistry, ::rtl::OUString());
- }
- catch (uno::Exception& e)
- {
- cout << "could not bootstrap the services from " << ASCII_STRING(sRegistry) << endl ;
- cout << " (error message : " << ASCII_STRING(e.Message) << ")" << endl;
- }
-
- if (!xMSF.is())
- {
- cerr << "could not create the service factory !" << endl;
- return;
- }
-
-
- Reference< XMultiServiceFactory > xCfgProvider( xMSF->createInstance(
- ::rtl::OUString::createFromAscii("com.sun.star.configuration.ConfigurationProvider")),
- UNO_QUERY);
-
- if (!xCfgProvider.is())
- {
- OSL_ENSURE(0, "No Configuration Provider");
- }
-
- OUString sPath = ASCII("com.sun.star.ucb.Hierarchy");
-
- Sequence< Any > aArgs(1);
- aArgs[0] <<= sPath;
-
- Reference< XInterface > xCfgUpdt = xCfgProvider->createInstanceWithArguments(
- OUString::createFromAscii("com.sun.star.configuration.ConfigurationUpdateAccess"),
- aArgs);
-
- Reference< XNameAccess > xNameAccess(xCfgUpdt, UNO_QUERY);
-
- // which Names are exist?
- showSequence(xNameAccess->getElementNames());
-
- OUString aNamePath = ASCII("Root");
- if (xNameAccess->hasByName(aNamePath))
- {
- Any aAny;
- aAny = xNameAccess->getByName(aNamePath);
- TypeClass aTypeClass = aAny.getValueTypeClass();
- if (aAny.getValueTypeClass() == TypeClass_INTERFACE)
- {
- Reference< XInterface > xInterface;
- aAny >>= xInterface;
- Reference< XNameAccess > xNameAccess2(xInterface, UNO_QUERY);
- if (xNameAccess.is())
- {
- Sequence<OUString> aSeq = xNameAccess2->getElementNames();
- showSequence(aSeq);
-
- // insert a new set
-/*
- Reference<XHierarchicalName> xHierarchical(xNameAccess, UNO_QUERY);
- OUString aHierachicalName = xHierarchical->getHierarchicalName();
-
- Sequence< Any > aArgs(2);
- aArgs[0] <<= aHierachicalName;
- sal_Int32 nLevels=1;
- aArgs[1] <<= nLevels;
-
- Reference< XInterface > xCfgNewUpdt = xCfgProvider->createInstanceWithArguments(
- OUString::createFromAscii("com.sun.star.configuration.ConfigurationUpdateAccess"),
- aArgs);
-*/
- Reference< lang::XSingleServiceFactory > xChildFactory(xNameAccess2, UNO_QUERY);
- if (xChildFactory.is())
- {
- Reference< XInterface > xChild = xChildFactory->createInstance();
- if (xChild.is())
- {
- Reference<XNameAccess> xObjectOnTheMedow(xChild, UNO_QUERY);
-
-
-
-
- // which Names are exist?
- showSequence(xObjectOnTheMedow->getElementNames());
-
- OUString aChildren = ASCII("Children");
- if (xObjectOnTheMedow->hasByName(aChildren))
- {
- Any aAny;
- aAny = xObjectOnTheMedow->getByName(aChildren);
- TypeClass aTypeClass = aAny.getValueTypeClass();
- if (aAny.getValueTypeClass() == TypeClass_INTERFACE)
- {
- Reference< XInterface > xInterface;
- aAny >>= xInterface;
- Reference< XNameAccess > xChildFromOOM(xInterface, UNO_QUERY);
-
- if (xChildFromOOM.is())
- {
- // insert a new Object in the new Object
-
- Reference< lang::XSingleServiceFactory > xChildFactory(xChildFromOOM, UNO_QUERY);
- if (xChildFactory.is())
- {
- Reference< XInterface > xChild = xChildFactory->createInstance();
- if (xChild.is())
- {
- Reference<XNameContainer> xNameContainer(xChildFromOOM, UNO_QUERY);
- if (xNameContainer.is())
- {
- xNameContainer->insertByName(ASCII("Test2"), makeAny(xChild));
- }
- }
- }
- }
- }
- }
-
-
- Reference<XNameContainer> xNameContainer(xNameAccess2, UNO_QUERY);
- if (xNameContainer.is())
- {
- xNameContainer->insertByName(ASCII("Test"), makeAny(xObjectOnTheMedow));
- }
- }
-
- // commit changes
- Reference< XChangesBatch > xChangesBatch(xCfgUpdt, UNO_QUERY);
- if (xChangesBatch.is())
- {
- xChangesBatch->commitChanges();
- }
- }
-
- Sequence<OUString> aSeq2 = xNameAccess2->getElementNames();
- showSequence(aSeq2);
-
-/*
- OUString *pStr = aSeq.getArray();
- for (int i=0;i<aSeq.getLength();i++)
- {
- OUString aStr = pStr[i];
- Any aAny;
- aAny = xNameAccess->getByName(aStr);
- TypeClass aTypeClass = aAny.getValueTypeClass();
-
- Reference< XNameReplace > xNameReplace(xNameAccess, UNO_QUERY);
-
- Any aNewAny;
- sal_Bool bValue = false;
- aNewAny <<= bValue;
- xNameReplace->replaceByName(aStr, aNewAny);
-
- volatile int dummy = 0;
- }
-*/
- }
- }
- volatile int dummy = 0;
- }
-}
-
-// ------------------------------ Helperfunctions ------------------------------
-
- void showSequence(const Sequence<OUString> &aSeq)
- {
- OUString aArray;
- const OUString *pStr = aSeq.getConstArray();
- for (int i=0;i<aSeq.getLength();i++)
- {
- OUString aStr = pStr[i];
- aArray += aStr + ASCII(", ");
- }
- volatile int dummy = 0;
- }
-
-} // namespace configmgr
diff --git a/configmgr/workben/logger/exports.dxp b/configmgr/workben/logger/exports.dxp
deleted file mode 100644
index 9630d7e067..0000000000
--- a/configmgr/workben/logger/exports.dxp
+++ /dev/null
@@ -1,3 +0,0 @@
-component_getImplementationEnvironment
-component_writeInfo
-component_getFactory
diff --git a/configmgr/workben/logger/loggerdfn.cxx b/configmgr/workben/logger/loggerdfn.cxx
deleted file mode 100644
index 4b5a17579d..0000000000
--- a/configmgr/workben/logger/loggerdfn.cxx
+++ /dev/null
@@ -1,151 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "simplelogger.hxx"
-#include <com/sun/star/registry/XRegistryKey.hpp>
-#ifndef _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_
-#include <cppuhelper/implementationentry.hxx>
-#endif
-#include <rtl/ustrbuf.hxx>
-
-namespace cssuno = com::sun::star::uno;
-using rtl::OUString;
-using rtl::OUStringBuffer;
-
-//==============================================================================
-
-static cssuno::Reference<cssuno::XInterface> SAL_CALL
- createSimpleLogger( const cssuno::Reference<cssuno::XComponentContext>& aContext)
-{
- return * new logger::SimpleLogger(aContext,"configuration.log") ;
-}
-//==============================================================================
-
-// adapted from the corresponding cppuhelper function
-static sal_Bool component_writeInfoHelper_withSingleton(
- void *pServiceManager, void *pRegistryKey ,
- const cppu::ImplementationEntry entries[],
- char const * const singletons[])
-{
- using namespace com::sun::star::registry;
- using rtl::OUString;
-
- sal_Bool bRet = sal_False;
- try
- {
- if( pRegistryKey )
- {
- for( sal_Int32 i = 0; entries[i].create ; i ++ )
- {
- rtl::OUStringBuffer buf( 124 );
- buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("/") );
- buf.append( entries[i].getImplementationName() );
- buf.appendAscii(RTL_CONSTASCII_STRINGPARAM( "/UNO/SERVICES" ) );
- cssuno::Reference< XRegistryKey > xNewKey(
- static_cast< XRegistryKey * >( pRegistryKey )->createKey( buf.makeStringAndClear() ) );
-
- cssuno::Sequence< OUString > const seq = entries[i].getSupportedServiceNames();
- for ( sal_Int32 nPos = 0 ; nPos < seq.getLength(); nPos ++ )
- xNewKey->createKey( seq[nPos] );
-
- if (singletons[i])
- {
- rtl::OUStringBuffer buf( 124 );
- buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("/") );
- buf.append( entries[i].getImplementationName() );
- buf.appendAscii(RTL_CONSTASCII_STRINGPARAM( "/UNO/SINGLETONS/" ) );
- buf.appendAscii(singletons[i]);
- cssuno::Reference< XRegistryKey > xNewKey(
- static_cast< XRegistryKey * >( pRegistryKey )->createKey( buf.makeStringAndClear() ) );
-
- xNewKey->setStringValue(entries[i].getImplementationName());
- }
- }
- bRet = sal_True;
- }
- }
- catch ( InvalidRegistryException & )
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- catch ( cssuno::Exception & )
- {
- OSL_ENSURE( sal_False, "### Unexpected UNO Exception!" );
- }
- return bRet;
-}
-
-//------------------------------------------------------------------------------
-
-static const cppu::ImplementationEntry kImplementations_entries[] =
-{
- {
- createSimpleLogger,
- logger::SimpleLogger::getImplementationName_static,
- logger::SimpleLogger::getSupportedServiceNames_static,
- cppu::createSingleComponentFactory,
- NULL,
- 0
- },
- { NULL }
-} ;
-static const char * const kSingleton_names[] =
-{
- "com.sun.star.configuration.theLogger",
- NULL
-};
-
-//------------------------------------------------------------------------------
-
-extern "C" void SAL_CALL component_getImplementationEnvironment(
- const sal_Char **aEnvTypeName,
- uno_Environment **aEnvironment) {
- *aEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ;
-}
-//------------------------------------------------------------------------------
-
-extern "C" sal_Bool SAL_CALL component_writeInfo(void *aServiceManager,
- void *aRegistryKey) {
- return component_writeInfoHelper_withSingleton( aServiceManager,
- aRegistryKey,
- kImplementations_entries,
- kSingleton_names) ;
-}
-//------------------------------------------------------------------------------
-
-extern "C" void *component_getFactory(const sal_Char *aImplementationName,
- void *aServiceManager,
- void *aRegistryKey) {
- return cppu::component_getFactoryHelper(aImplementationName,
- aServiceManager,
- aRegistryKey,
- kImplementations_entries) ;
-}
-//------------------------------------------------------------------------------
diff --git a/configmgr/workben/logger/makefile.mk b/configmgr/workben/logger/makefile.mk
deleted file mode 100644
index 569326914b..0000000000
--- a/configmgr/workben/logger/makefile.mk
+++ /dev/null
@@ -1,69 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJINC=$(PRJ)$/source
-PRJNAME=configmgr
-TARGET=simplelogger
-ENABLE_EXCEPTIONS=TRUE
-
-# Version
-SYSMGR_MAJOR=1
-
-# --- Settings ---
-
-.INCLUDE : settings.mk
-DLLPRE =
-
-# --- Files ---
-
-
-SLOFILES=\
- $(SLO)$/simplelogger.obj \
- $(SLO)$/loggerdfn.obj
-
-LIB1TARGET=$(SLB)$/_$(TARGET).lib
-LIB1OBJFILES=$(SLOFILES)
-
-SHL1TARGET=$(TARGET)$(SYSMGR_MAJOR).uno
-SHL1DEF=$(MISC)$/$(SHL1TARGET).def
-SHL1LIBS=$(LIB1TARGET)
-SHL1IMPLIB=i$(SHL1TARGET)
-SHL1STDLIBS= \
- $(CPPUHELPERLIB) \
- $(CPPULIB) \
- $(SALLIB)
-
-DEF1NAME=$(SHL1TARGET)
-DEF1EXPORTFILE=exports.dxp
-DEF1DES=Configuration: Simple Logger
-
-# --- Targets ---
-
-.INCLUDE : target.mk
-
diff --git a/configmgr/workben/logger/simplelogger.cxx b/configmgr/workben/logger/simplelogger.cxx
deleted file mode 100644
index 632f48e0fb..0000000000
--- a/configmgr/workben/logger/simplelogger.cxx
+++ /dev/null
@@ -1,174 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "simplelogger.hxx"
-#include <com/sun/star/util/logging/LogLevel.hpp>
-
-#include <osl/thread.h>
-#include <stdlib.h> // for getenv
-
-namespace logger
-{
-
- namespace LogLevel = com::sun::star::util::logging::LogLevel;
-
-//==============================================================================
-static rtl::OString level2str(sal_Int32 nLevel)
-{
- return rtl::OString::valueOf(nLevel);
-}
-
-sal_Int32 str2level(rtl::OString const & str)
-{
- return str.toInt32();
-}
-
-//------------------------------------------------------------------------------
-SimpleLogger::SimpleLogger( const uno::Reference<uno::XComponentContext>& xContext, char const * name)
-: mContext(xContext)
-, mName( OUString::createFromAscii(name) )
-, mOutput(stderr)
-, mLevel(LogLevel::INFO)
-{
- if (char const * fname = getenv("CFG_LOGFILE"))
- {
- mOutput = fopen(fname,"a+");
- OSL_ENSURE(mOutput,"ERROR: could not open logfile\n");
- }
-
- if (char const * level = getenv("CFG_LOGLEVEL"))
- {
- mLevel = str2level(level);
- }
-}
-//------------------------------------------------------------------------------
-SimpleLogger::~SimpleLogger()
-{
-}
-//------------------------------------------------------------------------------
-uno::Reference< logging::XLogger > SAL_CALL
- SimpleLogger::getLogger( const OUString& name )
- throw (uno::RuntimeException)
-{
- if (name == mName) return this;
-
- // try whatever
- uno::Reference< logging::XLogger > xNamedLogger;
- if (mContext.is())
- {
- OUString const singleton(RTL_CONSTASCII_USTRINGPARAM("/singletons/"));
- mContext->getValueByName(singleton.concat(name)) >>= xNamedLogger;
- }
- return xNamedLogger;
-}
-
-//------------------------------------------------------------------------------
-sal_Int32 SAL_CALL SimpleLogger::getLevel( ) throw (uno::RuntimeException)
-{
- return mLevel;
-}
-
-//------------------------------------------------------------------------------
-OUString SAL_CALL SimpleLogger::getName( ) throw (uno::RuntimeException)
-{
- return mName;
-}
-
-//------------------------------------------------------------------------------
-sal_Bool SAL_CALL SimpleLogger::isLoggable( sal_Int32 level ) throw (uno::RuntimeException)
-{
- return mOutput && level >= mLevel;
-}
-
-//------------------------------------------------------------------------------
-#define OU2OUT( ustr ) ( rtl::OUStringToOString( ustr, enc ).getStr() )
-
-void SAL_CALL SimpleLogger::logp( sal_Int32 level, const OUString& sourceClass, const OUString& sourceMethod, const OUString& msg )
- throw (uno::RuntimeException)
-{
- rtl_TextEncoding enc = osl_getThreadTextEncoding();
- if (mOutput && level > mLevel)
- {
- fprintf( mOutput, "%s {%s.%s}: [%s] %s\n", OU2OUT(mName),
- OU2OUT(sourceClass) , OU2OUT(sourceMethod),
- level2str(level).getStr(), OU2OUT(msg) );
- }
-}
-
-//------------------------------------------------------------------------------
-
-OUString SAL_CALL SimpleLogger::getImplementationName_static()
-{
- static const char kImplementationName[] = "com.sun.star.comp.configmgr.logging.SimpleLogger";
-
- return OUString(RTL_CONSTASCII_USTRINGPARAM(kImplementationName)) ;
-}
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL SimpleLogger::getImplementationName()
- throw (uno::RuntimeException)
-{
- return getImplementationName_static() ;
-}
-//------------------------------------------------------------------------------
-
-uno::Sequence<rtl::OUString> SAL_CALL SimpleLogger::getSupportedServiceNames_static()
-{
- uno::Sequence<rtl::OUString> aServices(2) ;
- aServices[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.logging.SimpleLogger")) ;
- aServices[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.logging.Logger")) ;
-
- return aServices ;
-}
-//------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL SimpleLogger::supportsService(
- const rtl::OUString& aServiceName)
- throw (uno::RuntimeException)
-{
- uno::Sequence< rtl::OUString > const svc = getSupportedServiceNames_static();
-
- for(sal_Int32 i = 0; i < svc.getLength(); ++i )
- if(svc[i] == aServiceName)
- return true;
- return false;
-}
-//------------------------------------------------------------------------------
-
-uno::Sequence<rtl::OUString>
-SAL_CALL SimpleLogger::getSupportedServiceNames()
- throw (uno::RuntimeException)
-{
- return getSupportedServiceNames_static() ;
-}
-//------------------------------------------------------------------------------
-
-
-} // namespace logger
diff --git a/configmgr/workben/logger/simplelogger.hxx b/configmgr/workben/logger/simplelogger.hxx
deleted file mode 100644
index aa711a8d68..0000000000
--- a/configmgr/workben/logger/simplelogger.hxx
+++ /dev/null
@@ -1,86 +0,0 @@
-#ifndef CONFIGMGR_SIMPLELOGGER_HXX_
-#define CONFIGMGR_SIMPLELOGGER_HXX_
-
-#include "simplelogger.hxx"
-#include <com/sun/star/util/logging/XLogger.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <cppuhelper/implbase2.hxx>
-
-#include <stdio.h>
-
-namespace logger {
-
-namespace uno = com::sun::star::uno ;
-namespace lang = com::sun::star::lang ;
-namespace logging = com::sun::star::util::logging ;
-using rtl::OUString;
-
-typedef cppu::WeakImplHelper2< logging::XLogger,
- lang::XServiceInfo> LoggerBase ;
-
-
-/**
- Class implementing the Logger service
- */
-class SimpleLogger : public LoggerBase
-{
-public :
- /**
- Service constructor from a service factory.
-
- @param xContext component context
- */
- explicit
- SimpleLogger( const uno::Reference<uno::XComponentContext>& xContext, char const * name) ;
-
- /** Destructor */
- ~SimpleLogger() ;
-
- // XLogger
- virtual uno::Reference< logging::XLogger > SAL_CALL
- getLogger( const OUString& name )
- throw (uno::RuntimeException);
-
- virtual sal_Int32 SAL_CALL getLevel( ) throw (uno::RuntimeException);
- virtual OUString SAL_CALL getName( ) throw (uno::RuntimeException);
- virtual sal_Bool SAL_CALL isLoggable( sal_Int32 level ) throw (uno::RuntimeException);
-
- virtual void SAL_CALL
- logp( sal_Int32 level, const OUString& sourceClass, const OUString& sourceMethod, const OUString& msg )
- throw (uno::RuntimeException);
-
- // XServiceInfo
- virtual OUString SAL_CALL getImplementationName()
- throw (uno::RuntimeException) ;
-
- virtual sal_Bool SAL_CALL supportsService( const OUString& aServiceName)
- throw (uno::RuntimeException) ;
-
- virtual uno::Sequence<OUString> SAL_CALL
- getSupportedServiceNames(void) throw (uno::RuntimeException) ;
-
- /**
- Provides the implementation name.
-
- @return implementation name
- */
- static OUString SAL_CALL getImplementationName_static() ;
- /**
- Provides the list of supported services.
-
- @return list of service names
- */
- static uno::Sequence<OUString> SAL_CALL getSupportedServiceNames_static() ;
-
-private:
- /** Component Context */
- uno::Reference<uno::XComponentContext> mContext ;
- OUString mName;
- FILE * mOutput;
- sal_Int32 mLevel;
-} ;
-
-} // namespace logger
-
-#endif
diff --git a/configmgr/workben/memory/logmechanism.hxx b/configmgr/workben/memory/logmechanism.hxx
deleted file mode 100644
index 9afa2546ca..0000000000
--- a/configmgr/workben/memory/logmechanism.hxx
+++ /dev/null
@@ -1,102 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef __FRAMEWORK_MACROS_DEBUG_LOGMECHANISM_HXX_
-#define __FRAMEWORK_MACROS_DEBUG_LOGMECHANISM_HXX_
-
-//*****************************************************************************************************************
-// generic macros for logging
-//*****************************************************************************************************************
-
-#ifdef ENABLE_LOGMECHANISM
-
- //_____________________________________________________________________________________________________________
- // includes
- //_____________________________________________________________________________________________________________
-
- #ifndef _RTL_STRING_HXX_
- #include <rtl/string.hxx>
- #endif
-
- #include <stdio.h>
-
- /*_____________________________________________________________________________________________________________
- WRITE_LOGFILE( SFILENAME, STEXT )
-
- Log any information in file. We append any information at file and don't clear it anymore.
- ( Use new scope in macro to declare pFile more then on time in same "parentscope"!
- Don't control pFile before access! What will you doing if its not valid? Log an error ...
- An error and an error is an error ... )
-
- Attention: You must use "%s" and STEXT as parameter ... because otherwise encoded strings (they include e.g. %...)
- are handled wrong.
- _____________________________________________________________________________________________________________*/
-
- #define WRITE_LOGFILE( SFILENAME, STEXT ) \
- { \
- ::rtl::OString _swriteLogfileFileName ( SFILENAME ); \
- ::rtl::OString _swriteLogfileText ( STEXT ); \
- FILE* pFile = fopen( _swriteLogfileFileName.getStr(), "a" ); \
- fprintf( pFile, "%s", _swriteLogfileText.getStr() ); \
- fclose ( pFile ); \
- }
-
- /*_____________________________________________________________________________________________________________
- LOGTYPE
-
- For other debug macros we need information about the output mode. If user forget to set this information we
- do it for him. Valid values are: LOGTYPE_FILECONTINUE
- LOGTYPE_FILEEXIT
- LOGTYPE_MESSAGEBOX
- The normal case is LOGTYPE_MESSAGEBOX to show assertions in normal manner!
- _____________________________________________________________________________________________________________*/
-
- #define LOGTYPE_MESSAGEBOX 1
- #define LOGTYPE_FILECONTINUE 2
- #define LOGTYPE_FILEEXIT 3
-
- #ifndef LOGTYPE
- #define LOGTYPE \
- LOGTYPE_MESSAGEBOX
- #endif
-
-#else // #ifdef ENABLE_LOGMECHANISM
-
- /*_____________________________________________________________________________________________________________
- If right testmode is'nt set - implements these macro empty!
- _____________________________________________________________________________________________________________*/
-
- #define WRITE_LOGFILE( SFILENAME, STEXT )
- #undef LOGTYPE
-
-#endif // #ifdef ENABLE_LOGMECHANISM
-
-//*****************************************************************************************************************
-// end of file
-//*****************************************************************************************************************
-
-#endif // #ifndef __FRAMEWORK_MACROS_DEBUG_LOGMECHANISM_HXX_
diff --git a/configmgr/workben/memory/main.cxx b/configmgr/workben/memory/main.cxx
deleted file mode 100644
index 10d8f6d462..0000000000
--- a/configmgr/workben/memory/main.cxx
+++ /dev/null
@@ -1,77 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <iostream>
-using namespace std;
-
-#define ENABLE_MEMORYMEASURE
-#define ENABLE_LOGMECHANISM
-
-// If you wish to enable this memory measure macros ... you need "windows.h"
-// But it's not agood idea to include it in your header!!! Because it's not compatible to VCL header .-(
-// So you must include it here ... in cxx, where you whish to use it.
-#ifdef ENABLE_MEMORYMEASURE
- #define VCL_NEED_BASETSD
- #include <tools/presys.h>
- #include <windows.h>
- #include <tools/postsys.h>
- #undef VCL_NEED_BASETSD
-#endif
-#include "memorymeasure.hxx"
-
-#include "logmechanism.hxx"
-// -----------------------------------------------------------------------------
-// ---------------------------------- M A I N ----------------------------------
-// -----------------------------------------------------------------------------
-
-#if (defined UNX) || (defined OS2)
-int main( int argc, char * argv[] )
-#else
-int _cdecl main( int argc, char * argv[] )
-#endif
-{
-
- START_MEMORYMEASURE( aMemoryInfo );
-
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "first start" );
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "1" );
-
- sal_Char* pTest = new sal_Char[1000 * 1000 * 50];
- sal_Char* pTest1 = new sal_Char[1000 * 1000 * 50];
- sal_Char* pTest2 = new sal_Char[1000 * 1000 * 50];
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "2" );
-
- LOG_MEMORYMEASURE( "FirstTest_of_memusage", "Values of memory access for standard filters.", aMemoryInfo );
-
- return 0;
-}
-
diff --git a/configmgr/workben/memory/makefile.mk b/configmgr/workben/memory/makefile.mk
deleted file mode 100644
index c93193121d..0000000000
--- a/configmgr/workben/memory/makefile.mk
+++ /dev/null
@@ -1,255 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-PRJINC=$(PRJ)$/source
-
-PRJNAME=configmgr
-
-TARGET=memorytest
-TARGET2=memorytesthack
-TARGETTYPE=CUI
-LIBTARGET=NO
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-.INCLUDE : settings.mk
-
-# --- Files --------------------------------------------------------
-
-# ... common for all test executables ..............................
-APPSTDLIBS=\
- $(SALLIB) \
- $(VOSLIB) \
- $(CPPULIB) \
- $(CPPUHELPERLIB) \
- $(COMPHELPERLIB) \
-
-# ... cfgapi ..............................
-# APP1STDLIBS = $(APPSTDLIBS)
-#
-# APP1STDLIBS+=$(STDLIBCPP)
-#
-# APP1TARGET= $(TARGET)
-# APP1OBJS= \
-# $(SLO)$/cfgapi2.obj \
-# $(SLO)$/strimpl.obj \
-# $(SLO)$/typeconverter.obj \
-# $(SLO)$/simpletypehelper.obj \
-# $(SLO)$/memory.obj \
-
-# ... cfgapi ..............................
-APP2STDLIBS = $(APPSTDLIBS)
-
-APP2STDLIBS+= $(STDLIBCPP)
-
-# CFLAGS+=-DWITHOUTAPI
-
-APP2TARGET= $(TARGET2)
-APP2OBJS= \
- $(SLO)$/memorytests.obj \
- $(SLO)$/testmodules.obj \
- $(SLO)$/treeload.obj \
- $(SLO)$/accessimpl.obj \
- $(SLO)$/adminproviderimpl.obj \
- $(SLO)$/apiaccessobj.obj \
- $(SLO)$/apifactory.obj \
- $(SLO)$/apifactoryimpl.obj \
- $(SLO)$/apinodeaccess.obj \
- $(SLO)$/apinodeupdate.obj \
- $(SLO)$/apinotifierimpl.obj \
- $(SLO)$/apiserviceinfo.obj \
- $(SLO)$/apitreeaccess.obj \
- $(SLO)$/apitreeimplobj.obj \
- $(SLO)$/attributelist.obj \
- $(SLO)$/attributeparser.obj \
- $(SLO)$/binarybasereader.obj \
- $(SLO)$/binarydecide.obj \
- $(SLO)$/binaryreader.obj \
- $(SLO)$/binarywritehandler.obj \
- $(SLO)$/binarywriter.obj \
- $(SLO)$/bootstrap.obj \
- $(SLO)$/broadcaster.obj \
- $(SLO)$/cachewritescheduler.obj \
- $(SLO)$/changes.obj \
- $(SLO)$/cmtree.obj \
- $(SLO)$/cmtreemodel.obj \
- $(SLO)$/collectchanges.obj \
- $(SLO)$/committer.obj \
- $(SLO)$/confeventhelpers.obj \
- $(SLO)$/confevents.obj \
- $(SLO)$/configexcept.obj \
- $(SLO)$/configgroup.obj \
- $(SLO)$/confignotifier.obj \
- $(SLO)$/configpath.obj \
- $(SLO)$/configsession.obj \
- $(SLO)$/configset.obj \
- $(SLO)$/confname.obj \
- $(SLO)$/confprovider2.obj \
- $(SLO)$/confproviderimpl2.obj \
- $(SLO)$/confsvccomponent.obj \
- $(SLO)$/disposetimer.obj \
- $(SLO)$/elementaccess.obj \
- $(SLO)$/elementimpl.obj \
- $(SLO)$/encodename.obj \
- $(SLO)$/filehelper.obj \
- $(SLO)$/generatecache.obj \
- $(SLO)$/groupaccess.obj \
- $(SLO)$/groupimpl.obj \
- $(SLO)$/groupobjects.obj \
- $(SLO)$/groupupdate.obj \
- $(SLO)$/invalidatetree.obj \
- $(SLO)$/listenercontainer.obj \
- $(SLO)$/loader.obj \
- $(SLO)$/localizednodebuilder.obj \
- $(SLO)$/localizedtreeactions.obj \
- $(SLO)$/localsession.obj \
- $(SLO)$/matchlocale.obj \
- $(SLO)$/mergechange.obj \
- $(SLO)$/namehelper.obj \
- $(SLO)$/nodechange.obj \
- $(SLO)$/nodechangeimpl.obj \
- $(SLO)$/nodechangeinfo.obj \
- $(SLO)$/nodefactory.obj \
- $(SLO)$/nodeimpl.obj \
- $(SLO)$/nodeimplobj.obj \
- $(SLO)$/noderef.obj \
- $(SLO)$/notifycallback.obj \
- $(SLO)$/oslstream.obj \
- $(SLO)$/pathhelper.obj \
- $(SLO)$/portalstream.obj \
- $(SLO)$/propertiesfilterednotifier.obj \
- $(SLO)$/propertyinfohelper.obj \
- $(SLO)$/propertysetaccess.obj \
- $(SLO)$/propsetaccessimpl.obj \
- $(SLO)$/provider.obj \
- $(SLO)$/providerfactory.obj \
- $(SLO)$/providerimpl.obj \
- $(SLO)$/receivethread.obj \
- $(SLO)$/redirector.obj \
- $(SLO)$/remotesession.obj \
- $(SLO)$/roottree.obj \
- $(SLO)$/saxadapter.obj \
- $(SLO)$/saxtools.obj \
- $(SLO)$/sessionfactory.obj \
- $(SLO)$/sessionstream.obj \
- $(SLO)$/setaccess.obj \
- $(SLO)$/setnodeimpl.obj \
- $(SLO)$/setobjects.obj \
- $(SLO)$/setupdate.obj \
- $(SLO)$/simpletypehelper.obj \
- $(SLO)$/socketstream.obj \
- $(SLO)$/strimpl.obj \
- $(SLO)$/synchronize.obj \
- $(SLO)$/template.obj \
- $(SLO)$/templateimpl.obj \
- $(SLO)$/timestamp.obj \
- $(SLO)$/tracer.obj \
- $(SLO)$/translatechanges.obj \
- $(SLO)$/treeactions.obj \
- $(SLO)$/treebuildercallback.obj \
- $(SLO)$/treecache.obj \
- $(SLO)$/treedata.obj \
- $(SLO)$/treeimpl.obj \
- $(SLO)$/treeiterators.obj \
- $(SLO)$/treenodefactory.obj \
- $(SLO)$/trivialbufferedfile.obj \
- $(SLO)$/typeconverter.obj \
- $(SLO)$/updatehandler.obj \
- $(SLO)$/updateimpl.obj \
- $(SLO)$/updatetree.obj \
- $(SLO)$/userimpl.obj \
- $(SLO)$/valueconverter.obj \
- $(SLO)$/valuehandler.obj \
- $(SLO)$/valuenodebuilder.obj \
- $(SLO)$/writesubtreeasbinaryhandler.obj \
- $(SLO)$/xmlformater.obj \
- $(SLO)$/xmltreebuilder.obj \
- $(SLO)$/valuemembernode.obj \
- $(SLO)$/anypair.obj \
-
-# $(SLO)$/memory.obj \
-
-
-# $(SLO)$/strimpl.obj \
-# $(SLO)$/typeconverter.obj \
-# $(SLO)$/simpletypehelper.obj \
-# $(SLO)$/memory.obj \
-# $(SLO)$/loadwithtreemanager.obj \
-# $(SLO)$/localsession.obj \
-# $(SLO)$/configsession.obj \
-# $(SLO)$/confname.obj \
-# $(SLO)$/tracer.obj \
-# $(SLO)$/generatecache.obj \
-# $(SLO)$/treeactions.obj \
-# $(SLO)$/cmtreemodel.obj \
-# $(SLO)$/cmtree.obj \
-# $(SLO)$/xmltreebuilder.obj \
-# $(SLO)$/xmlformater.obj \
-# $(SLO)$/binaryreader.obj \
-# $(SLO)$/binarybasereader.obj \
-# $(SLO)$/binarywriter.obj \
-# $(SLO)$/binarywritehandler.obj \
-# $(SLO)$/binarydecide.obj \
-# $(SLO)$/writesubtreeasbinaryhandler.obj \
-# $(SLO)$/oslstream.obj \
-# $(SLO)$/pathhelper.obj \
-# $(SLO)$/treecache.obj \
-# $(SLO)$/updatetree.obj \
-# $(SLO)$/attributeparser.obj \
-# $(SLO)$/updatehandler.obj \
-# $(SLO)$/synchronize.obj \
-# $(SLO)$/filehelper.obj \
-# $(SLO)$/mergechange.obj \
-# $(SLO)$/providerimpl.obj \
-# $(SLO)$/bootstrap.obj \
-# $(SLO)$/matchlocale.obj \
-# $(SLO)$/changes.obj \
-# $(SLO)$/configexcept.obj \
-# $(SLO)$/valuehandler.obj \
-# $(SLO)$/treenodefactory.obj \
-# $(SLO)$/attributelist.obj \
-# $(SLO)$/namehelper.obj \
-# $(SLO)$/localizedtreeactions.obj \
-# $(SLO)$/trivialbufferedfile.obj \
-# $(SLO)$/cachewritescheduler.obj \
-# $(SLO)$/disposetimer.obj \
-# $(SLO)$/noderef.obj \
-# $(SLO)$/treedata.obj \
-# $(SLO)$/confevents.obj \
-# $(SLO)$/treebuildercallback.obj \
-# $(SLO)$/loader.obj \
-# $(SLO)$/apifactoryimpl.obj \
-# $(SLO)$/apitreeimplobj.obj \
-
-# $(SLO)$/.obj \
-
-
-.INCLUDE : target.mk
-
-
diff --git a/configmgr/workben/memory/memorymeasure.hxx b/configmgr/workben/memory/memorymeasure.hxx
deleted file mode 100644
index ca4f18e36c..0000000000
--- a/configmgr/workben/memory/memorymeasure.hxx
+++ /dev/null
@@ -1,225 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef __FRAMEWORK_MACROS_DEBUG_MEMORYMEASURE_HXX_
-#define __FRAMEWORK_MACROS_DEBUG_MEMORYMEASURE_HXX_
-
-// *************************************************************************************************************
-// special macros for time measures
-// 1) LOGFILE_MEMORYMEASURE used it to define log file for this operations (default will be set automaticly)
-// 2) MAKE_MEMORY_SNAPSHOT make snapshot of currently set memory informations of OS
-// 3) LOG_MEMORYMEASURE write measured time to logfile
-// *************************************************************************************************************
-
-#ifdef ENABLE_MEMORYMEASURE
-
-#if !defined( WIN ) && !defined( WNT )
-#error "Macros to measure memory access not available under platforms different from windows!"
-#endif
-
-//_________________________________________________________________________________________________________________
-// includes
-//_________________________________________________________________________________________________________________
-
-#include <rtl/strbuf.hxx>
-
-#ifndef __SGI_STL_VECTOR
-#include <vector>
-#endif
-
-/*_____________________________________________________________________________________________________________
- LOGFILE_MEMORYMEASURE
-
- For follow macros we need a special log file. If user forget to specify anyone, we must do it for him!
- _____________________________________________________________________________________________________________*/
-
-#ifndef LOGFILE_MEMORYMEASURE
-#define LOGFILE_MEMORYMEASURE "memorymeasure.log"
-#endif
-
-/*_____________________________________________________________________________________________________________
- class MemoryMeasure
-
- We use this baseclass to collect all snapshots in one object and analyze this information at one point.
- Macros of this file are used to enable using of this class by special compile-parameter only!
- _____________________________________________________________________________________________________________*/
-
-class _DBGMemoryMeasure
-{
- //---------------------------------------------------------------------------------------------------------
-private:
- struct _MemoryInfo
- {
- MEMORYSTATUS aStatus ;
- ::rtl::OString sComment ;
- };
-
- //---------------------------------------------------------------------------------------------------------
-public:
- //_____________________________________________________________________________________________________
- inline _DBGMemoryMeasure()
- {
- makeSnapshot("Initializing Data");
- }
- //_____________________________________________________________________________________________________
- inline _DBGMemoryMeasure(const ::rtl::OString& sComment)
- {
- makeSnapshot(sComment);
- }
-
- //_____________________________________________________________________________________________________
- // clear used container!
- inline ~_DBGMemoryMeasure()
- {
- ::std::vector< _MemoryInfo >().swap( m_lSnapshots );
- }
-
- //_____________________________________________________________________________________________________
- inline void makeSnapshot( const ::rtl::OString& sComment )
- {
- _MemoryInfo aInfo;
- aInfo.sComment = sComment;
- GlobalMemoryStatus ( &(aInfo.aStatus) );
- m_lSnapshots.push_back( aInfo );
- }
-
- //_____________________________________________________________________________________________________
- inline ::rtl::OString getLog()
- {
- ::rtl::OStringBuffer sBuffer( 10000 );
-
- if( m_lSnapshots.size() > 0 )
- {
- // Write informations to return buffer
- ::std::vector< _MemoryInfo >::const_iterator pItem1;
- ::std::vector< _MemoryInfo >::const_iterator pItem2;
-
- pItem1 = m_lSnapshots.begin();
- pItem2 = pItem1;
- ++pItem2;
-
- while( pItem1!=m_lSnapshots.end() )
- {
- sBuffer.append( "snap [ " );
- sBuffer.append( pItem1->sComment );
- sBuffer.append( " ]\n\tavail phys\t=\t" );
- sBuffer.append( (sal_Int32)pItem1->aStatus.dwAvailPhys );
- sBuffer.append( "\n\tavail page\t=\t" );
- sBuffer.append( (sal_Int32)pItem1->aStatus.dwAvailPageFile );
- sBuffer.append( "\n\tavail virt\t=\t" );
- sBuffer.append( (sal_Int32)pItem1->aStatus.dwAvailVirtual );
-
- if( pItem1 == m_lSnapshots.begin() )
- {
- sBuffer.append( "\n\t[initial values]\n\n" );
- }
- else if( pItem2 != m_lSnapshots.end() )
- {
- sBuffer.append( "\n\tdifference\t=\t[ " );
- sBuffer.append( (sal_Int32)(pItem2->aStatus.dwAvailPhys - pItem1->aStatus.dwAvailPhys ) );
- sBuffer.append( ", " );
- sBuffer.append( (sal_Int32)(pItem2->aStatus.dwAvailPageFile - pItem1->aStatus.dwAvailPageFile ) );
- sBuffer.append( ", " );
- sBuffer.append( (sal_Int32)(pItem2->aStatus.dwAvailVirtual - pItem1->aStatus.dwAvailVirtual ) );
- sBuffer.append( " ]\n\n" );
- }
- else
- {
- sBuffer.append( "\n\t[final values]\n\n" );
- }
- if( pItem1!=m_lSnapshots.end() ) ++pItem1;
- if( pItem2!=m_lSnapshots.end() ) ++pItem2;
- }
- // clear current list ... make it empty for further snapshots!
- ::std::vector< _MemoryInfo >().swap( m_lSnapshots );
- }
-
- return sBuffer.makeStringAndClear();
- }
-
- //---------------------------------------------------------------------------------------------------------
-private:
- ::std::vector< _MemoryInfo > m_lSnapshots;
-};
-
-/*_____________________________________________________________________________________________________________
- START_MEMORY_MEASURE
-
- Create new object to measure memory access.
- _____________________________________________________________________________________________________________*/
-
-#define START_MEMORYMEASURE( AOBJECT ) \
- _DBGMemoryMeasure AOBJECT;
-
-#define START_MEMORYMEASURE_FOR( AOBJECT, SCOMMENT ) \
- _DBGMemoryMeasure AOBJECT( SCOMMENT );
-
- /*_____________________________________________________________________________________________________________
- MAKE_MEMORY_SNAPSHOT
-
- Make snapshot of currently set memory informations of OS.
- see _DBGMemoryMeasure for further informations
- _____________________________________________________________________________________________________________*/
-
-#define MAKE_MEMORY_SNAPSHOT( AOBJECT, SCOMMENT ) \
- AOBJECT.makeSnapshot( SCOMMENT );
-
- /*_____________________________________________________________________________________________________________
- LOG_MEMORYMEASURE( SOPERATION, SCOMMENT, AOBJECT )
-
- Write measured values to logfile.
- _____________________________________________________________________________________________________________*/
-
-#define LOG_MEMORYMEASURE( SOPERATION, SCOMMENT, AOBJECT ) \
- { \
- ::rtl::OStringBuffer _sBuffer( 256 ); \
- _sBuffer.append( SOPERATION ); \
- _sBuffer.append( "\n" ); \
- _sBuffer.append( SCOMMENT ); \
- _sBuffer.append( "\n\n" ); \
- _sBuffer.append( AOBJECT.getLog() ); \
- WRITE_LOGFILE( LOGFILE_MEMORYMEASURE, _sBuffer.makeStringAndClear() ) \
- }
-
-#else // #ifdef ENABLE_MEMORYMEASURE
-
-/*_____________________________________________________________________________________________________________
- If right testmode is'nt set - implements these macros empty!
- _____________________________________________________________________________________________________________*/
-
-#undef LOGFILE_MEMORYMEASURE
-#define START_MEMORYMEASURE( AOBJECT )
-#define MAKE_MEMORY_SNAPSHOT( AOBJECT, SCOMMENT )
-#define LOG_MEMORYMEASURE( SOPERATION, SCOMMENT, AOBJECT )
-
-#endif // #ifdef ENABLE_MEMORYMEASURE
-
-//*****************************************************************************************************************
-// end of file
-//*****************************************************************************************************************
-
-#endif // #ifndef __FRAMEWORK_MACROS_DEBUG_MEMORYMEASURE_HXX_
diff --git a/configmgr/workben/memory/memorytests.cxx b/configmgr/workben/memory/memorytests.cxx
deleted file mode 100644
index 5adb804210..0000000000
--- a/configmgr/workben/memory/memorytests.cxx
+++ /dev/null
@@ -1,1241 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#define _PRIVATE_TEST_
-
-#include <iostream>
-#include <vector>
-#include "treeload.hxx"
-
-#include <fstream>
-
-#define ENABLE_MEMORYMEASURE
-#define ENABLE_LOGMECHANISM
-
-// If you wish to enable this memory measure macros ... you need "windows.h"
-// But it's not agood idea to include it in your header!!! Because it's not compatible to VCL header .-(
-// So you must include it here ... in cxx, where you whish to use it.
-#ifdef ENABLE_MEMORYMEASURE
- #define VCL_NEED_BASETSD
- #include <tools/presys.h>
- #include <windows.h>
- #include <tools/postsys.h>
- #undef VCL_NEED_BASETSD
-#endif
-#include "memorymeasure.hxx"
-
-#include "logmechanism.hxx"
-
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/uno/Type.hxx>
-#include <com/sun/star/uno/TypeClass.hpp>
-
-#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/container/XHierarchicalName.hpp>
-#include <com/sun/star/container/XNamed.hpp>
-#include <com/sun/star/container/XNameReplace.hpp>
-#include <com/sun/star/container/XChild.hpp>
-#include <com/sun/star/beans/XExactName.hpp>
-#include <com/sun/star/util/XChangesBatch.hpp>
-#include <com/sun/star/lang/XComponent.hpp>
-
-#include <rtl/ustring.hxx>
-#include <rtl/string.hxx>
-#include <cppuhelper/servicefactory.hxx>
-#include <com/sun/star/uno/Sequence.h>
-#include <com/sun/star/uno/Any.h>
-#include <osl/profile.hxx>
-#include <osl/process.h>
-#include <osl/file.h>
-
-#include <conio.h>
-
-#include "createpropertyvalue.hxx"
-
-#include "typeconverter.hxx"
-
-#include "testmodules.hxx"
-
-#include "valuenode.hxx"
-
-namespace configmgr
-{
-
-using namespace std;
-
-namespace css = com::sun::star;
-namespace uno = css::uno;
-namespace lang = css::lang;
-
-using namespace uno;
-using namespace lang;
-
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::util;
-
-using ::rtl::OUString;
-using ::rtl::OString;
-
-using namespace ::cppu;
-
-#define ASCII(x) ::rtl::OUString::createFromAscii(x)
-
-ostream& operator << (ostream& out, rtl::OUString const& aStr)
-{
- sal_Unicode const* const pStr = aStr.getStr();
- sal_Unicode const* const pEnd = pStr + aStr.getLength();
- for (sal_Unicode const* p = pStr; p < pEnd; ++p)
- if (0 < *p && *p < 127) // ASCII
- out << char(*p);
- else
- out << "[\\u" << hex << *p << "]";
- return out;
-}
-
-void showSequence(const Sequence<OUString> &aSeq)
-{
- OUString aArray;
- const OUString *pStr = aSeq.getConstArray();
- for (int i=0;i<aSeq.getLength();i++)
- {
- OUString aStr = pStr[i];
- // aArray += aStr + ASCII(", ");
- cout << aStr << endl;
- }
- volatile int dummy = 0;
-}
-
-//=============================================================================
-
-inline void operator <<= (::rtl::OUString& _rUnicodeString, const sal_Char* _pAsciiString)
-{
- _rUnicodeString = ::rtl::OUString::createFromAscii(_pAsciiString);
-}
-
-inline void operator <<= (::rtl::OUString& _rUnicodeString, const ::rtl::OString& _rAsciiString)
-{
- _rUnicodeString <<= _rAsciiString.getStr();
-}
-
-inline void operator <<= (Any& _rUnoValue, const sal_Char* _pAsciiString)
-{
- _rUnoValue <<= ::rtl::OUString::createFromAscii(_pAsciiString);
-}
-
-inline void operator <<= (Any& _rUnoValue, const ::rtl::OString& _rAsciiString)
-{
- _rUnoValue <<= _rAsciiString.getStr();
-}
-
-inline void operator <<= (::rtl::OString& _rAsciiString, ::rtl::OUString const& _rUnicodeString )
-{
- _rAsciiString = rtl::OUStringToOString(_rUnicodeString, RTL_TEXTENCODING_ASCII_US).getStr();
-}
-
-// -----------------------------------------------------------------------------
-
-rtl::OString input(const char* pDefaultText, char cEcho)
-{
- // PRE: a Default Text would be shown, cEcho is a Value which will show if a key is pressed.
- const int MAX_INPUT_LEN = 500;
- char aBuffer[MAX_INPUT_LEN];
-
- strcpy(aBuffer, pDefaultText);
- int nLen = strlen(aBuffer);
-
-#ifdef WNT
- char ch = '\0';
-
- cout << aBuffer;
- cout.flush();
-
- while(ch != 13)
- {
- ch = getch();
- if (ch == 8)
- {
- if (nLen > 0)
- {
- cout << "\b \b";
- cout.flush();
- --nLen;
- aBuffer[nLen] = '\0';
- }
- else
- {
- cout << "\a";
- cout.flush();
- }
- }
- else if (ch != 13)
- {
- if (nLen < MAX_INPUT_LEN)
- {
- if (cEcho == 0)
- {
- cout << ch;
- }
- else
- {
- cout << cEcho;
- }
- cout.flush();
- aBuffer[nLen++] = ch;
- aBuffer[nLen] = '\0';
- }
- else
- {
- cout << "\a";
- cout.flush();
- }
- }
- }
-#else
- if (!cin.getline(aBuffer,sizeof aBuffer))
- return OString();
-#endif
- return rtl::OString(aBuffer);
-}
-
-// -----------------------------------------------------------------------------
-rtl::OUString enterValue(const char* _aStr, const char* _aDefault, bool _bIsAPassword)
-{
- cout << _aStr;
- cout.flush();
-
- rtl::OUString sValue;
- sValue <<= input(_aDefault, _bIsAPassword ? '*' : 0);
- return sValue;
-}
-//=============================================================================
-
-uno::Reference< lang::XMultiServiceFactory > getORB();
-// -----------------------------------------------------------------------------
-
-
-Reference< XChangesBatch > xChangesBatch = NULL;
-void commit()
-{
- if (xChangesBatch.is())
- {
- xChangesBatch->commitChanges();
- }
-}
-
-// -----------------------------------------------------------------------------
-static sal_Bool s_bInitialized = sal_False;
-#ifdef LLA_PRIVAT_DEBUG
-// static const sal_Char* s_pSourcePath = "//./l|/src632/configmgr/workben/local_io/share";
-// static const sal_Char* s_pUpdatePath = "//./l|/src632/configmgr/workben/local_io/user";
-static const sal_Char* s_pSourcePath = "file:///f:/office60_633/share/config/registry";
-static const sal_Char* s_pUpdatePath = "file:///f:/office60_633/user/config/registry";
-static const sal_Char* s_pRootNode = "org.openoffice.test";
-static const sal_Char* s_pServerType = "local";
-static const sal_Char* s_pLocale = "de-DE";
-static const sal_Char* s_pServer = "";
-static const sal_Char* s_pUser = "";
-static const sal_Char* s_pPassword = "";
-#else
-static const sal_Char* s_pSourcePath = "file:///g:/src/configmgr/workben/local_io/share";
-static const sal_Char* s_pUpdatePath = "file:///g:/src/configmgr/workben/local_io/user";
-static const sal_Char* s_pRootNode = "org.openoffice.test";
-static const sal_Char* s_pServerType = "local";
-static const sal_Char* s_pLocale = "de-DE";
-static const sal_Char* s_pServer = "lautrec-3108:19205";
-static const sal_Char* s_pUser = "lars";
-static const sal_Char* s_pPassword = "";
-#endif
-
-static bool m_bChange = false;
-// -----------------------------------------------------------------------------
-static void loadDefaults()
-{
- if (s_bInitialized)
- return;
-
- s_bInitialized = sal_True;
-
- try
- {
- // the executable file name
- ::rtl::OUString sExecutable;
- osl_getExecutableFile(&sExecutable.pData);
- // cut the name, add a cfgapi.ini to the path
- sal_Int32 nLastSep = sExecutable.lastIndexOf('/');
- if (-1 != nLastSep)
- sExecutable = sExecutable.copy(0, nLastSep + 1);
-#ifdef UNX
- sExecutable += ::rtl::OUString::createFromAscii("cfgapirc");
-#else
- sExecutable += ::rtl::OUString::createFromAscii("cfgapi.ini");
-#endif
- ::rtl::OUString sNormalized;
- sNormalized = sExecutable;
- if (1) // osl_File_E_None == osl_normalizePath(sExecutable.pData, &sNormalized.pData))
- {
- ::osl::Profile aProfile(sNormalized);
-
- static ::rtl::OString sSection("defaults");
- static ::rtl::OString sSourcePath("sourcepath");
- static ::rtl::OString sUpdatePath("updatepath");
- static ::rtl::OString sRootNode("rootnode");
- static ::rtl::OString sServerType("servertype");
- static ::rtl::OString sLocale("Locale");
- static ::rtl::OString sServer("Server");
- static ::rtl::OString sUser("User");
- static ::rtl::OString sPassword("Password");
-
- // read some strings.
- // Do this static because we want to redirect the global static character pointers to the buffers.
- static ::rtl::OString s_sSourcePath = aProfile.readString(sSection, sSourcePath, s_pSourcePath);
- static ::rtl::OString s_sUpdatePath = aProfile.readString(sSection, sUpdatePath, s_pUpdatePath);
- static ::rtl::OString s_sRootNode = aProfile.readString(sSection, sRootNode, s_pRootNode);
- static ::rtl::OString s_sServerType = aProfile.readString(sSection, sServerType, s_pServerType);
- static ::rtl::OString s_sLocale = aProfile.readString(sSection, sLocale, s_pLocale);
- static ::rtl::OString s_sServer = aProfile.readString(sSection, sServer, s_pServer);
- static ::rtl::OString s_sUser = aProfile.readString(sSection, sUser, s_pUser);
- static ::rtl::OString s_sPassword = aProfile.readString(sSection, sPassword, s_pPassword);
-
- // do this redirection
- s_pSourcePath = s_sSourcePath.getStr();
- s_pUpdatePath = s_sUpdatePath.getStr();
- s_pRootNode = s_sRootNode.getStr();
- s_pServerType = s_sServerType.getStr();
- s_pLocale = s_sLocale.getStr();
- s_pServer = s_sServer.getStr();
- s_pUser = s_sUser.getStr();
- s_pPassword = s_sPassword.getStr();
- }
- }
- catch(std::exception& e)
- {
- e.what(); // silence warnings
- }
-}
-
-// -----------------------------------------------------------------------------
-Sequence<Any> createSequence(const OUString &sUser, const OUString &sPasswd)
-{
- Sequence< Any > aCPArgs;
-
- if (sUser.getLength() > 0)
- {
- aCPArgs.realloc(1);
- aCPArgs[0] <<= configmgr::createPropertyValue(ASCII("user"), sUser);
- }
- if (sPasswd.getLength() > 0)
- {
- aCPArgs.realloc(2);
- aCPArgs[1] <<= configmgr::createPropertyValue(ASCII("password"), sPasswd);
- }
- return aCPArgs;
-}
-
-//=============================================================================
-#include <string.h>
-#if (defined UNX) || (defined OS2)
-#else
-#include <conio.h>
-#endif
-
-// -----------------------------------------------------------------------------
-
-void test_configuration_provider(uno::Reference<lang::XMultiServiceFactory> _xCfgProvider,
- rtl::OUString const& _sUser, bool _bLocal, sal_Int32 _nCount);
-
-
-// -----------------------------------------------------------------------------
-
-uno::Reference<lang::XMultiServiceFactory>
-getProvider(
- uno::Reference< lang::XMultiServiceFactory > _xServiceRegistry,
- rtl::OUString const& _sServerType,
- rtl::OUString const& _sSharePath, rtl::OUString const& _sUserPath,
- bool &_bLocal)
-{
- try
- {
- Sequence< Any > aCPArgs;
-
- OUString sServerType = _sServerType; // enterValue("servertype: ", s_pServerType, false);
-
- rtl::OUString sUser;
-
- _bLocal = sServerType.equalsIgnoreAsciiCase(ASCII("local")) || sServerType.equalsIgnoreAsciiCase(ASCII("setup"));
- if (!_bLocal)
- {
- rtl::OUString sServer;
- sServer = enterValue("server : ", s_pServer,false);
- cout << endl;
-
- sUser = enterValue("user : ", s_pUser, false);
- cout << endl;
-
- OUString sPasswd = enterValue("password: ", s_pPassword, true);
- cout << endl;
-
- aCPArgs = createSequence(sUser, sPasswd);
-
- aCPArgs.realloc(aCPArgs.getLength() + 1);
- aCPArgs[aCPArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("server"), sServer);
-
- OUString sTimeout = ASCII("10000");
- aCPArgs.realloc(aCPArgs.getLength() + 1);
- aCPArgs[aCPArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("timeout"), sTimeout);
-
- }
- else
- {
- rtl::OUString sSharePath, sUserPath;
- sSharePath = _sSharePath;// enterValue("share path: ", s_pSourcePath, false);
- // cout << endl;
- sUserPath = _sUserPath; // enterValue("user path : ", s_pUpdatePath, false);
- // cout << endl;
-
- aCPArgs.realloc(aCPArgs.getLength() + 1);
- sal_Int32 nCount = aCPArgs.getLength() - 1;
- Any *pAny = &aCPArgs[nCount];
- *pAny <<= configmgr::createPropertyValue(ASCII("sourcepath"), sSharePath);
- aCPArgs.realloc(aCPArgs.getLength() + 1);
- aCPArgs[aCPArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("updatepath"), sUserPath);
- }
-
- aCPArgs.realloc(aCPArgs.getLength() + 1);
- aCPArgs[aCPArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("servertype"), sServerType);
-
- Reference< XMultiServiceFactory > xCfgProvider(
- _xServiceRegistry->createInstanceWithArguments(
- ::rtl::OUString::createFromAscii("com.sun.star.configuration.ConfigurationProvider"),
- aCPArgs),
- UNO_QUERY);
- if (!xCfgProvider.is())
- {
- ::flush(cout);
- cerr << "Could not create the configuration provider !\n\n";
- return 0;
- }
-// -----------------------------------------------------------------------------
- return xCfgProvider;
- }
- catch (Exception& e)
- {
- ::flush(cout);
- cerr << "Caught exception: " << e.Message << endl;
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-sal_Int32 m_nCount = 0;
-
-void test(uno::Reference<lang::XMultiServiceFactory> _xORB, rtl::OUString const& _sSharePath,
- rtl::OUString const& _sUserPath)
-{
-
- rtl::OUString sUser;
- bool bLocal;
- cout << ++m_nCount << ". start test with new provider\n";
- {
- START_MEMORYMEASURE_FOR( aMemoryInfo, "*** API Test Execution ***" );
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "initialisierungs-check" );
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "- Erzeuge Provider" );
-
- uno::Reference<lang::XMultiServiceFactory>xCfgProvider =
- getProvider(_xORB, ASCII("local"), _sSharePath, _sUserPath,
- bLocal);
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "- Habe Provider, starte Test" );
-
- test_configuration_provider(xCfgProvider, sUser, bLocal, 0); // xml
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "- Test gelaufen, starte erneut" );
-
- test_configuration_provider(xCfgProvider, sUser, bLocal, 0); // xml
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "- Test gelaufen, entsorge Provider" );
-
- uno::Reference<lang::XComponent>xComponent(xCfgProvider,UNO_QUERY);
- xComponent->dispose();
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "- Provider disposed" );
-
- LOG_MEMORYMEASURE( "---------------- API Memory Test 2-----------------------------", "- Test memory traces.", aMemoryInfo );
- }
-
- cout << "finish provider test\n";
-
- // Test Version 1 and 3, it MUST be equal
-}
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-static rtl::OUString makeFileURL(OUString const& sMaybeURL)
-{
- rtl::OUString const fileURLStart(RTL_CONSTASCII_USTRINGPARAM("file:/"));
-
- if ( 0 != fileURLStart.compareTo(sMaybeURL, fileURLStart.getLength()) )
- {
- OUString sURL;
- if (!osl_getFileURLFromSystemPath(sMaybeURL.pData, &sURL.pData))
- return sURL;
- }
-
- return sMaybeURL;
-}
-// -----------------------------------------------------------------------------
-static rtl::OUString makeSystemPath(OUString const& sMaybeURL)
-{
- rtl::OUString const fileURLStart(RTL_CONSTASCII_USTRINGPARAM("file:/"));
-
- if ( 0 == fileURLStart.compareTo(sMaybeURL, fileURLStart.getLength()) )
- {
- OUString sSysPath;
- if (!osl_getSystemPathFromFileURL(sMaybeURL.pData, &sSysPath.pData))
- return sSysPath;
- }
-
- return sMaybeURL;
-}
-// -----------------------------------------------------------------------------
-// ---------------------------------- M A I N ----------------------------------
-// -----------------------------------------------------------------------------
-
-int main( int argc, char * argv[] )
-{
- TimeValue aTimeout;
- aTimeout.Seconds = 5;
- aTimeout.Nanosec = 0;
-
- sal_Int32 nSizeISubtree = sizeof(ISubtree);
- sal_Int32 nSizeINode = sizeof(INode);
- sal_Int32 nSizeIValueNode = sizeof(ValueNode);
- {
- loadDefaults();
-
- Reference< XMultiServiceFactory > xORB = getORB();
-
- rtl::OUString sSharePath = makeSystemPath(enterValue("share path: ", s_pSourcePath, false));
- cout << endl;
- rtl::OUString sUserPath = makeSystemPath(enterValue("user path : ", s_pUpdatePath, false));
- cout << endl;
-
- // test(xORB, sSharePath, sUserPath, ASCII("org.openoffice.test"));
-
- // char* pMem = new char[1000 * 1000 * 10];
- // showMemoryStatistic();
-
-// test(xORB, sSharePath, sUserPath, ASCII("org.openoffice.Office.Views"));
-
- START_MEMORYMEASURE_FOR( aMemoryInfo, "*** API Test Main ***" );
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "initialisierungs-check" );
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "starte test !" );
-
- test(xORB, sSharePath, sUserPath);
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "tests beendet !" );
-
- // stop the programm clear.
- Reference< XComponent > xComponent(xORB, UNO_QUERY);
- xComponent->dispose();
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "ORB disposed." );
-
- LOG_MEMORYMEASURE( "---------------- API Memory Test-------------------------------", "Outer memory traces.", aMemoryInfo );
- }
- return 0;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////
-void test(Reference< XHierarchicalName >& xAccessName)
-{
- if (xAccessName.is())
- {
- // cout << "Accessing Node: " << xAccessName->getHierarchicalName();
- }
- else
- {
- // cout << "BUG: XHierarchicalName not available";
- }
- // cout << endl;
-}
-void test(Reference< XNamed >& xAccess)
-{
- if (xAccess.is())
- {
- // cout << "Node is named: " << xAccess->getName();
- }
- else
- {
- // cout << "BUG: XNamed not available";
- }
- // cout << endl;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////
-void fillAllNames(Reference<XNameAccess >& xAccess, Sequence<OUString>& _aSeq)
-{
- if (xAccess.is())
- {
- _aSeq = Sequence <OUString>(xAccess->getElementNames());
-
- // cout << "Element Names: (" << _aSeq.getLength() << ")";
- // for (int i = 0; i < _aSeq.getLength(); ++i)
- // cout << "\n[" << i << "] -\t" << _aSeq[i];
- //cout << endl;
- }
- else
- {
- // cout << "BUG: XNameAccess not available";
- }
- // cout << endl;
-}
-void write(Reference< XChild >& xChild)
-{
- if (xChild.is())
- {
- // cout << "\n[ P ] -\tParent";
- }
- else
- {
- // cout << "BUG: Parent not available (no XChild)";
- }
- // cout << endl;
-}
-///////////////////////////////////////////////////////////////////////////////////////////
-
-// -----------------------------------------------------------------------------
-Reference< XInterface > readaccess(uno::Reference< lang::XMultiServiceFactory > &xMSF,
- uno::Reference< uno::XInterface > const& xIface,
- rtl::OString const& buf,
- ostream& outStream)
-{
- Reference< XInterface > xNext;
- try
- {
- Reference< XNameAccess > xAccess(xIface, UNO_QUERY);
- Reference< XHierarchicalNameAccess > xDeepAccess(xIface, UNO_QUERY);
- Reference< XExactName > xExactName(xIface, UNO_QUERY);
-
- if (xAccess.is() || xDeepAccess.is())
- {
- OUString aName;
- OUString aInput = OUString::createFromAscii(buf);
-
- if (xExactName.is())
- {
- ::rtl::OUString sTemp = xExactName->getExactName(aInput);
- if (sTemp.getLength())
- aInput = sTemp;
- }
-
- if (xAccess.is() && xAccess->hasByName(aInput))
- {
- aName = aInput;
- }
- else if (xDeepAccess.is() && xDeepAccess->hasByHierarchicalName(aInput))
- {
- aName = aInput;
- }
- else if ('0' <= buf[0] && buf[0] <= '9' && xAccess.is())
- {
- int n = atoi(buf);
- Sequence<OUString> aNames = xAccess->getElementNames();
- if (0 <= n && n < aNames.getLength())
- aName = aNames[n];
- }
-
- if (aName.getLength())
- {
- bool bNest = aInput.indexOf(sal_Unicode('/')) >= 0;
-
- Any aElement = bNest ?
- ( xDeepAccess.is() ?
- xDeepAccess->getByHierarchicalName(aName) : Any()
- ) :
- ( xAccess.is() ?
- xAccess->getByName(aName) : Any()
- );
-
- while (aElement.getValueTypeClass() == TypeClass_ANY)
- {
- Any aWrap(aElement);
- aWrap >>= aElement;
- }
- sal_Bool bValue = true;
- sal_Bool bValueOk = false;
-
- switch (aElement.getValueTypeClass() )
- {
- case TypeClass_INTERFACE:
- bValue = false;
- if (aElement >>= xNext)
- {
- outStream << "Group: " << aName << endl;
- }
- else
- {
- outStream << "ERROR: can't get the interface" << endl;
- }
- break;
- case TypeClass_BOOLEAN:
- {
- sal_Bool* pVal = (sal_Bool*)aElement.getValue();
- bValueOk = (pVal != 0);
-
- outStream << "VALUE '" << aName << "' is a BOOLEAN = ";
- if (!bValueOk)
- outStream << "NULL (error!!)";
- else if (*pVal)
- outStream << "'TRUE'";
- else
- outStream << "'FALSE'";
-
- outStream << endl;
-
- // tryToChange(xAccess, aName, pVal);
- break;
- }
- case TypeClass_SHORT:
- {
- sal_Int16 aValue;
- outStream << "VALUE '" << aName << "' is a SHORT (16 bit) = ";
- if (bValueOk = (aElement >>= aValue))
- {
- outStream << aValue;
- // tryToChange(xAccess, aName, aValue);
- }
- else
- {
- outStream << "ERROR RETRIEVING VALUE";
- }
- outStream << endl;
-
- break;
- }
- case TypeClass_LONG:
- {
-
- sal_Int32 aValue;
- outStream << "VALUE '" << aName << "' is a INT (32 bit) = ";
- if (bValueOk = (aElement >>= aValue))
- {
- outStream << aValue;
- // tryToChange(xAccess, aName, aValue);
- }
- else
- {
- outStream << "ERROR RETRIEVING VALUE";
- }
- outStream << endl;
- break;
- }
- case TypeClass_HYPER:
- {
- sal_Int64 aValue;
- outStream << "VALUE '" << aName << "' is a LONG (64 bit) = ";
- if (bValueOk = (aElement >>= aValue))
- {
- outStream << double(aValue);
- // tryToChange(xAccess, aName, aValue);
- }
- else
- {
- outStream << "ERROR RETRIEVING VALUE";
- }
- outStream << endl;
- break;
- }
- case TypeClass_DOUBLE:
- {
- double aValue;
- outStream << "VALUE '" << aName << "' is a DOUBLE = ";
- if (bValueOk = (aElement >>= aValue))
- {
- outStream << aValue;
- }
- else
- {
- outStream << "ERROR RETRIEVING VALUE";
- }
- outStream << endl;
- break;
- }
- case TypeClass_STRING:
- {
- OUString aValue;
- outStream << "VALUE '" << aName << "' is a STRING = ";
- if (bValueOk = (aElement >>= aValue))
- {
- outStream << "\"" << aValue << "\"";
- // tryToChange(xAccess, aName, aValue);
- }
- else
- {
- outStream << "ERROR RETRIEVING VALUE";
- }
- outStream << endl;
- break;
- }
- case TypeClass_SEQUENCE:
- {
- outStream << "VALUE '" << aName << "' is a SEQUENCE or BINARY" << endl;
-
- Type aTypeS = configmgr::getSequenceElementType(aElement.getValueType());
- OUString sType = configmgr::toTypeName(aTypeS.getTypeClass());
- outStream << "UNO type is " << aElement.getValueType().getTypeName() << endl;
- outStream << "Real type is Sequence<" << sType << ">" << endl;
- // outSequence(aElement, aTypeS, outStream);
- bValueOk = true;
- break;
- }
- case TypeClass_VOID:
- outStream << "ELEMENT '" << aName << "' is NULL and VOID " << endl;
- bValueOk = true;
- break;
- default:
- outStream << "Error: ELEMENT '" << aName << "' is of unknown or unrecognized type" << endl;
- break;
- }
-
- }
- else
- {
- outStream << "Error: No element \"" << aInput << "\" found." <<endl;
- }
- }
- }
- catch (Exception& e)
- {
- outStream << "An Exception occurred: " << e.Message << endl;
- }
- catch (...)
- {
- outStream << "An UNKNOWN Exception occurred !" << endl;
- }
-
- return xNext;
-}
-
-
-
-
-// -----------------------------------------------------------------------------
-void test_read_access( uno::Reference< lang::XMultiServiceFactory > &xMSF,
- uno::Reference< uno::XInterface >& xIface,
- ofstream & out)
-{
- Sequence<OUString> aAllNames;
-
- using com::sun::star::uno::UNO_QUERY;
-
- // cout << "\n\n---------------------------------------------------------------" << endl;
- Reference< XNameAccess > xAccess(xIface, UNO_QUERY);
- Reference< XChild > xChild(xIface, UNO_QUERY);
- Reference< XHierarchicalName > xAccessPath(xIface,UNO_QUERY);
- Reference< XNamed > xAccessName(xIface,UNO_QUERY);
-// Reference< XHierarchicalNameAccess >& xAccess(xIface, UNO_QUERY);
-
- test(xAccessPath);
- test(xAccessName);
- fillAllNames(xAccess, aAllNames);
- write(xChild);
-
- for (sal_Int32 i=0;i<aAllNames.getLength();i++)
- {
- OString aValue;
- aValue <<= aAllNames[i];
- uno::Reference<uno::XInterface> xFace = readaccess(xMSF, xIface, aValue, out);
- if (xFace.is())
- {
- test_read_access(xMSF, xFace, out);
- }
- }
-}
-
-// -----------------------------------------------------------------------------
-void test_read_access( uno::Reference< lang::XMultiServiceFactory > &xMSF,
- uno::Reference< uno::XInterface >& xIface,
- rtl::OString aFilename)
-{
- ofstream out(aFilename.getStr());
- test_read_access(xMSF, xIface, out);
-}
-
-// -----------------------------------------------------------------------------
-void test_configuration_provider(uno::Reference<lang::XMultiServiceFactory> _xCfgProvider,
- rtl::OUString const& _sUser, bool _bLocal,
- sal_Int32 _nCount)
-{
- START_MEMORYMEASURE_FOR( aMemoryInfo, "*** Configuration Provider Loop Test ***" );
- START_MEMORYMEASURE_FOR( aInnerMemoryInfo, "*** Configuration Provider Module Details ***" );
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "initialisierungs-check" );
- MAKE_MEMORY_SNAPSHOT( aInnerMemoryInfo, "initialisierungs-check" );
-
- std::vector< Reference< XInterface > > aLoadedModules;
- aLoadedModules.reserve(configtest::s_nTestModules);
-
- Sequence< Any > aArgs;
- aArgs = createSequence(_sUser, ASCII(""));
-
- if (!_bLocal)
- {
- OUString sLocale = enterValue("locale : ", s_pLocale, false);
- cout << endl;
- aArgs.realloc(aArgs.getLength() + 1);
- aArgs[aArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("locale"), sLocale);
- }
-
-#if 0
- sal_Bool bLazyWrite = true;
- aArgs.realloc(aArgs.getLength() + 1);
- aArgs[aArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("lazywrite"), bLazyWrite);
-#else
- sal_Bool bNoCache = true;
- aArgs.realloc(aArgs.getLength() + 1);
- aArgs[aArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("nocache"), bNoCache);
-#endif
-
- sal_Int32 nPathIdx = aArgs.getLength();
- aArgs.realloc(nPathIdx + 1);
-
- const OString sInnerInfoText("- - - Loading module: ");
- MAKE_MEMORY_SNAPSHOT( aInnerMemoryInfo, "- - - Before Loading Modules" );
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "- - Prepared Arguments - Lade Module" );
-
- for (char const * const * ppTestModule = configtest::s_aTestModules; *ppTestModule; ++ppTestModule)
- {
- OUString sPath = OUString::createFromAscii(*ppTestModule);
- cout << "\t" << ++_nCount << ". test with node: " << sPath << endl;
-
- aArgs[nPathIdx] <<= configmgr::createPropertyValue(ASCII("nodepath"), sPath);
-
- MAKE_MEMORY_SNAPSHOT( aInnerMemoryInfo, sInnerInfoText.concat(*ppTestModule) );
- Reference< XInterface > xIFace = _xCfgProvider->createInstanceWithArguments(
- /* OUString::createFromAscii("com.sun.star.configuration.ConfigurationUpdateAccess"), */
- OUString::createFromAscii("com.sun.star.configuration.ConfigurationAccess"),
- aArgs);
- // cout << "---------------------------------------------------------------\n Configuration Read/Write Access created !\n---------------------------------------------------------------" << endl;
-
- aLoadedModules.push_back(xIFace);
- /*
- xChangesBatch = Reference< XChangesBatch >(xIFace, UNO_QUERY);
-
- Sequence<OUString> aSeq = _xCfgProvider->getAvailableServiceNames();
-
- OString sPath;
- sPath <<= _sPath;
-
- OString aFilename = "c:\\temp\\fileout_";
- aFilename += sPath;
- aFilename += OString::valueOf(_nCount);
- aFilename += ".txt";
- test_read_access(_xCfgProvider, xIFace, aFilename);
- */
- }
- MAKE_MEMORY_SNAPSHOT( aInnerMemoryInfo, "- - - Done Loading modules" );
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "- - Alle Module geladen" );
-
- aLoadedModules.clear();
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "- - Module released" );
-
- LOG_MEMORYMEASURE( "---------------- API Memory Test 3 -----------------------------", "- - Provider memory traces.", aMemoryInfo );
- LOG_MEMORYMEASURE( "---------------- API Memory Test 4 -----------------------------", "- - - Module memory traces.", aInnerMemoryInfo );
-
-}
-
-
-// -----------------------------------------------------------------------------
-// ----------------------------------- Main 2 -----------------------------------
-// -----------------------------------------------------------------------------
-
-int requestTest( int argc, char * argv[] )
-{
- TimeValue aTimeout;
- aTimeout.Seconds = 5;
- aTimeout.Nanosec = 0;
-
- sal_Int32 nSizeISubtree = sizeof(ISubtree);
- sal_Int32 nSizeINode = sizeof(INode);
- sal_Int32 nSizeIValueNode = sizeof(ValueNode);
- {
- loadDefaults();
-
- Reference< XMultiServiceFactory > xORB = getORB();
-
- rtl::OUString sSharePath = makeFileURL(enterValue("share path: ", s_pSourcePath, false));
- cout << endl;
- rtl::OUString sUserPath = makeFileURL(enterValue("user path : ", s_pUpdatePath, false));
- cout << endl;
-
- START_MEMORYMEASURE_FOR( aMemoryInfo, "*** Request Tree Test ***" );
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "initialisierungs-check" );
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "create tree manager" );
-
- OTreeLoad aTreeLoad(xORB, sSharePath, sUserPath);
- sal_Int32 nIdx = 0;
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "created tree manager" );
-
- OString const sInnerInfoText("- Loading module: ");
-
- START_MEMORYMEASURE_FOR( aInnerMemoryInfo, "*** Request Tree Test Details ***" );
- MAKE_MEMORY_SNAPSHOT( aInnerMemoryInfo, "initialisierungs-check" );
-
- MAKE_MEMORY_SNAPSHOT( aInnerMemoryInfo, "- before loading modules" );
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "request subtrees" );
-
- for (char const * const * ppRequestModule = configtest::s_aTestModules; *ppRequestModule; ++ppRequestModule)
- {
- MAKE_MEMORY_SNAPSHOT( aInnerMemoryInfo, sInnerInfoText.concat(*ppRequestModule) );
- aTreeLoad.requestSubtree( OUString::createFromAscii(*ppRequestModule));
- }
-
- MAKE_MEMORY_SNAPSHOT( aInnerMemoryInfo, "- loaded all modules" );
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "release subtrees" );
-
- for (char const * const * ppReleaseModule = configtest::s_aTestModules; *ppReleaseModule; ++ppReleaseModule)
- aTreeLoad.releaseSubtree( OUString::createFromAscii(*ppReleaseModule));
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "ich habe fertig." );
- LOG_MEMORYMEASURE( "---------------- Request Memory Test ---------------------------", "Direct Cache Access memory traces.", aMemoryInfo );
- LOG_MEMORYMEASURE( "---------------- Request Memory Detail -------------------------", "Module request memory traces.", aInnerMemoryInfo );
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-// --------------------------------- Trust Test ---------------------------------
-// -----------------------------------------------------------------------------
-
-int trust( int argc, char * argv[] )
-{
- Reference< XMultiServiceFactory > xORB = getORB();
-
- std::vector<char*> aMemHolder;
- aMemHolder.reserve(1024);
-
- START_MEMORYMEASURE_FOR( aMemoryInfo, "Allocator check" );
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "initialisierungs-check" );
-
- sal_Int32 const total_alloc = 8 * 1024 * 1024;
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "get 8 MB" );
-
- char* pChar = new char[total_alloc];
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "free 8 MB" );
-
- delete [] pChar;
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "deleted 8 MB" );
-
- sal_Int32 const chunk = 8 * 1024;
- sal_Int32 const alloc_count = total_alloc/chunk;
-
- sal_Int32 const msg_count = 16;
- sal_Int32 const loop_count = alloc_count/msg_count;
- sal_Int32 const loop_allocation = loop_count * chunk;
-
- OString const sPieces = OString::valueOf(alloc_count).concat(" pieces");
- OString const sInnerMessage = OString("Allocating ").concat(OString::valueOf(loop_count))
- .concat(" chunks [").concat(OString::valueOf(loop_allocation)).concat(" Bytes].");
-
- START_MEMORYMEASURE( aInnerMemoryInfo );
- MAKE_MEMORY_SNAPSHOT( aInnerMemoryInfo, "initialisierungs-check" );
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, OString("get 8 MB as ").concat(sPieces) );
-
- for (sal_Int32 i=0;i<alloc_count/loop_count;i++)
- {
- MAKE_MEMORY_SNAPSHOT( aInnerMemoryInfo, sInnerMessage );
- for (sal_Int32 j=0;j<loop_count;j++)
- {
-
- pChar = new char[8 * 1024];
- aMemHolder.push_back(pChar);
- }
- }
- MAKE_MEMORY_SNAPSHOT( aInnerMemoryInfo, "last allocation done" );
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "free pieces" );
-
- pChar = NULL;
- for (std::vector<char*>::iterator it = aMemHolder.begin();
- it != aMemHolder.end();
- it++)
- {
- pChar = *it;
- delete []pChar;
- }
- aMemHolder.clear();
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, OString("get another 8 MB as ").concat(sPieces) );
-
-
- for (sal_Int32 j=0;j<alloc_count;j++)
- {
- pChar = new char[8 * 1024];
- aMemHolder.push_back(pChar);
- }
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "free second set of pieces" );
-
- pChar = NULL;
- for (std::vector<char*>::iterator jt = aMemHolder.begin();
- jt != aMemHolder.end();
- jt++)
- {
- pChar = *jt;
- delete []pChar;
- }
- aMemHolder.clear();
-
- MAKE_MEMORY_SNAPSHOT( aMemoryInfo, "ich habe fertig." );
- LOG_MEMORYMEASURE( "---------------- Trust Memory Test ----------------------------", "Cross-checked memory traces.", aMemoryInfo );
- LOG_MEMORYMEASURE( "---------------- Small Allocation Loop ------------------------", "Allocation Loop Detail memory traces.", aInnerMemoryInfo );
-
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-static uno::Reference< lang::XMultiServiceFactory > g_xORB;
-static void createORB(char const* pRegistry)
-{
- if (!g_xORB.is())
- try
- {
- rtl::OUString const sServiceRegistry = OUString::createFromAscii(pRegistry);
-
- g_xORB = createRegistryServiceFactory( sServiceRegistry, ::rtl::OUString() );
-
- }
- catch (uno::Exception &e)
- {
- cerr << "Exception creating the service factory: " << e.Message << "\n";
- }
- else
- cerr << "Trying to recreate the service factory\n";
-
- if (!g_xORB.is())
- {
- ::flush(cout);
- cerr << "Could not create the service factory '" << pRegistry << "' !\n";
- exit(-2);
- }
-}
-uno::Reference< lang::XMultiServiceFactory > getORB()
-{
- if (!g_xORB.is())
- {
- createORB( "applicat.rdb" );
- }
- return g_xORB;
-}
-// -----------------------------------------------------------------------------
-
-
-} // namespace configmgr
-// -----------------------------------------------------------------------------
-void usage()
-{
- cerr << "Wrong or missing parameters.\nUsage:\n"
- "\tmemorytest [-r <registry.rdb>] (all | trust | request | api)+ [clear] [(+<module>|-<module>)+]\n";
-
- exit(-1);
-}
-
-// -----------------------------------------------------------------------------
-// ------------------------------------ Main ------------------------------------
-// -----------------------------------------------------------------------------
-#if (defined UNX) || (defined OS2)
-int main( int argc, char * argv[] )
-#else
-int _cdecl main( int argc, char * argv[] )
-#endif
-{
- if (argc > 1 && !::rtl_str_compare(argv[1], "-r" ) )
- {
- if (!argv[2]) usage();
-
- configmgr::createORB(argv[2]);
-
- argv += 2;
- argc -= 2;
- }
- configmgr::getORB(); // ensures there is one
-
- enum TestSelect { TEST_TRUST = 01, TEST_REQUEST = 02, TEST_API = 04, TEST_ALL = 07 };
-
- unsigned nSelect = 0;
- while (argc >= 1 && argv[1] != NULL)
- {
- if ( !::rtl_str_compareIgnoreAsciiCase(argv[1], "trust" ) ) nSelect |= TEST_TRUST;
- else if ( !::rtl_str_compareIgnoreAsciiCase(argv[1], "request") ) nSelect |= TEST_REQUEST;
- else if ( !::rtl_str_compareIgnoreAsciiCase(argv[1], "api" ) ) nSelect |= TEST_API;
- else if ( !::rtl_str_compareIgnoreAsciiCase(argv[1], "all" ) ) nSelect |= TEST_ALL;
- else break;
-
- // here we found a known selector, so look on
- ++argv;
- --argc;
- }
-
- if (nSelect == 0) usage();
-
-//--------------------
-#define DO_TEST( test, func ) \
- if (nSelect & TEST_##test) \
- { \
- char const * const test_name = #test; \
- if (int nRet = func(argc, argv)) \
- cerr << "Test: " << test_name << " returned with error code " << nRet << endl; \
- else \
- cerr << "Test: " << test_name << " finished without error !\n" ; \
- } else // to allow a semicolon
-//--------------------
-
- DO_TEST( TRUST , configmgr::trust );
- DO_TEST( REQUEST , configmgr::requestTest );
- DO_TEST( API , configmgr::main );
-
- return 0;
-}
-
diff --git a/configmgr/workben/memory/testmodules.cxx b/configmgr/workben/memory/testmodules.cxx
deleted file mode 100644
index 6e738df430..0000000000
--- a/configmgr/workben/memory/testmodules.cxx
+++ /dev/null
@@ -1,84 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include "testmodules.hxx"
-
-
-namespace configtest
-{
- #if 0 // more modules
- +"org.openoffice.Office.Common",
- +"org.openoffice.Office.Linguistic",
- x"org.openoffice.Office.TypeDetection",
- x"org.openoffice.Setup",
- -"org.openoffice.UserProfile",
- +"org.openoffice.Inet",
- -"org.openoffice.Office.Calc",
- -"org.openoffice.Office.Chart",
- -"org.openoffice.Office.DataAccess",
- -"org.openoffice.Office.Draw",
- -"org.openoffice.Office.Impress",
- -"org.openoffice.Office.Java",
- -"org.openoffice.Office.Labels",
- -"org.openoffice.Office.Math",
- +"org.openoffice.Office.Views",
- +"org.openoffice.Office.Writer",
- +"org.openoffice.Office.WriterWeb",
- +"org.openoffice.ucb.Configuration",
- -"org.openoffice.ucb.Hierarchy",
- x"org.openoffice.ucb.Store",
- #endif
-
- char const * const s_aTestModules[] =
- {
- "org.openoffice.Office.Common",
- "org.openoffice.Setup/CJK/Enable",
- "org.openoffice.Setup/Office/Modules",
- "org.openoffice.Inet",
- "org.openoffice.Office.Views",
- "org.openoffice.Setup/Product",
- "org.openoffice.ucb.Configuration",
- "org.openoffice.ucb.Store/ContentProperties",
- "org.openoffice.Office.TypeDetection",
- "org.openoffice.Office.Writer",
- "org.openoffice.Office.WriterWeb",
- "org.openoffice.Office.Linguistic",
- NULL // end marker
- };
- unsigned int const s_nTestModules = sizeof s_aTestModules/sizeof 0[s_aTestModules];
-
- std::vector<char const *> listTestModules(int argc, char* argv[])
- {
- std::vector<char const *> aModuleList( s_aTestModules, s_aTestModules + s_nTestModules);
- return aModuleList;
- }
-}
-
-
diff --git a/configmgr/workben/memory/testmodules.hxx b/configmgr/workben/memory/testmodules.hxx
deleted file mode 100644
index dff033b5cf..0000000000
--- a/configmgr/workben/memory/testmodules.hxx
+++ /dev/null
@@ -1,38 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public 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_WORKBEN_TESTMODULES_
-#include <vector>
-
-namespace configtest
-{
- extern char const * const s_aTestModules[];
- extern unsigned int const s_nTestModules;
- extern std::vector<char const *> listTestModules(int argc, char* argv[]);
-}
-#endif // CONFIGMGR_WORKBEN_TESTMODULES_
-
diff --git a/configmgr/workben/memory/treeload.cxx b/configmgr/workben/memory/treeload.cxx
deleted file mode 100644
index ade330b60c..0000000000
--- a/configmgr/workben/memory/treeload.cxx
+++ /dev/null
@@ -1,81 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <localsession.hxx>
-#include <treecache.hxx>
-#include <options.hxx>
-#include <rtl/ustring.hxx>
-#include "treeload.hxx"
-
-// -----------------------------------------------------------------------------
-namespace configmgr
-{
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
-
-#define ASCII(x) ::rtl::OUString::createFromAscii(x)
-
-// -----------------------------------------------------------------------------
-// ------------------------- requestSubtree without API -------------------------
-// -----------------------------------------------------------------------------
-
- OTreeLoad::OTreeLoad(uno::Reference<lang::XMultiServiceFactory> const& _xServiceProvider,
- rtl::OUString const& _sSourceDirectory, rtl::OUString const& _sUpdateDirectory) throw (uno::Exception)
- :m_xServiceProvider(_xServiceProvider)
-{
- // Create a TypeConverter
- uno::Reference<script::XTypeConverter> xConverter;
- xConverter = xConverter.query(m_xServiceProvider->createInstance(ASCII( "com.sun.star.script.Converter" )) );
-
- m_xDefaultOptions = new OOptions(xConverter);
- m_xDefaultOptions->setNoCache(true);
-
- // create it .. and connect
- std::auto_ptr<LocalSession> pLocal( new LocalSession(m_xServiceProvider) );
- sal_Bool bOpen = pLocal->open(_sSourceDirectory, _sUpdateDirectory);
-
- IConfigSession* pConfigSession = pLocal.release();
-
- m_pTreeMgr = new TreeManager(pConfigSession, m_xDefaultOptions);
-}
-// -----------------------------------------------------------------------------
-ISubtree* OTreeLoad::requestSubtree( OUString const& aSubtreePath) throw (uno::Exception)
-{
- return m_pTreeMgr->requestSubtree(aSubtreePath, m_xDefaultOptions, /* MinLevel */ -1);
-}
-// -----------------------------------------------------------------------------
-void OTreeLoad::releaseSubtree( OUString const& aSubtreePath) throw (uno::Exception)
-{
- m_pTreeMgr->releaseSubtree(aSubtreePath, m_xDefaultOptions);
-}
-
-// -----------------------------------------------------------------------------
-} // namespace
diff --git a/configmgr/workben/memory/treeload.hxx b/configmgr/workben/memory/treeload.hxx
deleted file mode 100644
index 7889bd80f0..0000000000
--- a/configmgr/workben/memory/treeload.hxx
+++ /dev/null
@@ -1,41 +0,0 @@
-#ifndef CONFIGMGR_TREELOAD_HXX
-#define CONFIGMGR_TREELOAD_HXX
-
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-
-#ifndef _CONFIGMGR_LOCAL_LOCAL_HXX_
-#include <localsession.hxx>
-#endif
-
-#ifndef _CONFIGMGR_TREECACHE_HXX_
-#include <treecache.hxx>
-#endif
-#include <options.hxx>
-#include <rtl/ustring.hxx>
-
-// -----------------------------------------------------------------------------
-namespace configmgr
-{
- namespace uno = ::com::sun::star::uno;
- namespace lang = ::com::sun::star::lang;
-
-// -----------------------------------------------------------------------------
-class OTreeLoad
-{
- // LocalSession* m_pLocalSession; // in TreeMgr
- TreeManager* m_pTreeMgr;
- ::vos::ORef<OOptions> m_xDefaultOptions;
- uno::Reference<lang::XMultiServiceFactory> m_xServiceProvider;
-
-public:
-
- OTreeLoad(uno::Reference<lang::XMultiServiceFactory> const& _xServiceProvider,
- rtl::OUString const& _sSourceDirectory, rtl::OUString const& _sUpdateDirectory);
-
- ISubtree* requestSubtree(rtl::OUString const& aSubtreePath);
- void releaseSubtree(rtl::OUString const& aSubtreePath);
-};
-
-} // namespace
-
-#endif
diff --git a/connectivity/com/sun/star/sdbcx/comp/hsqldb/makefile.mk b/connectivity/com/sun/star/sdbcx/comp/hsqldb/makefile.mk
index 4976a7d607..ce9581b934 100644
--- a/connectivity/com/sun/star/sdbcx/comp/hsqldb/makefile.mk
+++ b/connectivity/com/sun/star/sdbcx/comp/hsqldb/makefile.mk
@@ -38,10 +38,9 @@ SECONDARY_PACKAGE = org$/hsqldb$/lib
.IF "$(SYSTEM_HSQLDB)" == "YES"
-XCLASSPATH!:=$(XCLASSPATH)$(PATH_SEPERATOR)$(HSQLDB_JAR)
-JARFILES+= $(HSQLDB_JAR)
+EXTRAJARFILES = $(HSQLDB_JAR)
.ELSE
-JARFILES+= hsqldb.jar
+JARFILES = hsqldb.jar
.ENDIF
JAVAFILES =\
@@ -60,7 +59,7 @@ JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class
JARCOMPRESS = TRUE
JARCLASSDIRS = $(PACKAGE) $(SECONDARY_PACKAGE)
JARTARGET = $(TARGET).jar
-JARCLASSPATH = $(JARFILES) ..
+JARCLASSPATH = $(JARFILES) $(EXTRAJARFILES) ..
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
diff --git a/connectivity/inc/connectivity/TTableHelper.hxx b/connectivity/inc/connectivity/TTableHelper.hxx
index a896d0a0ce..db220ffe1a 100644
--- a/connectivity/inc/connectivity/TTableHelper.hxx
+++ b/connectivity/inc/connectivity/TTableHelper.hxx
@@ -33,6 +33,10 @@
#include "connectivity/sdbcx/VKey.hxx"
#include "connectivity/StdTypeDefs.hxx"
#include <comphelper/stl_types.hxx>
+#include <com/sun/star/sdb/tools/XTableRename.hpp>
+#include <com/sun/star/sdb/tools/XTableAlteration.hpp>
+#include <com/sun/star/sdb/tools/XKeyAlteration.hpp>
+#include <com/sun/star/sdb/tools/XIndexAlteration.hpp>
namespace connectivity
{
@@ -155,6 +159,11 @@ namespace connectivity
void addKey(const ::rtl::OUString& _sName,const sdbcx::TKeyProperties& _aKeyProperties);
virtual ::rtl::OUString getTypeCreatePattern() const;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdb::tools::XTableRename> getRenameService() const;
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdb::tools::XTableAlteration> getAlterService() const;
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdb::tools::XKeyAlteration> getKeyService() const;
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdb::tools::XIndexAlteration> getIndexService() const;
};
}
#endif // CONNECTIVITY_TABLEHELPER_HXX
diff --git a/connectivity/inc/connectivity/dbtools.hxx b/connectivity/inc/connectivity/dbtools.hxx
index 27d788653b..829a0ff774 100644
--- a/connectivity/inc/connectivity/dbtools.hxx
+++ b/connectivity/inc/connectivity/dbtools.hxx
@@ -350,6 +350,33 @@ namespace dbtools
,const ::rtl::OUString& _sProperty,
sal_Bool _bDefault = sal_False);
+ /** retrieves a particular indirect data source setting
+
+ @param _rxDataSource
+ a data source component
+ @param _pAsciiSettingsName
+ the ASCII name of the setting to obtain
+ @param _rSettingsValue
+ the value of the setting, upon successfull return
+
+ @return
+ <FALSE/> if the setting is not present in the <member scope="com::sun::star::sdb">DataSource::Info</member>
+ member of the data source
+ <TRUE/> otherwise
+ */
+ OOO_DLLPUBLIC_DBTOOLS
+ bool getDataSourceSetting(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxDataSource,
+ const sal_Char* _pAsciiSettingsName,
+ ::com::sun::star::uno::Any& /* [out] */ _rSettingsValue
+ );
+ OOO_DLLPUBLIC_DBTOOLS
+ bool getDataSourceSetting(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxDataSource,
+ const ::rtl::OUString& _sSettingsName,
+ ::com::sun::star::uno::Any& /* [out] */ _rSettingsValue
+ );
+
OOO_DLLPUBLIC_DBTOOLS ::rtl::OUString getDefaultReportEngineServiceName(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory);
/** quote the given name with the given quote string.
diff --git a/connectivity/inc/connectivity/formattedcolumnvalue.hxx b/connectivity/inc/connectivity/formattedcolumnvalue.hxx
index f131141eba..0d146f953c 100644
--- a/connectivity/inc/connectivity/formattedcolumnvalue.hxx
+++ b/connectivity/inc/connectivity/formattedcolumnvalue.hxx
@@ -33,6 +33,7 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/sdb/XColumn.hpp>
#include <com/sun/star/sdb/XColumnUpdate.hpp>
+#include <com/sun/star/util/XNumberFormatter.hpp>
/** === end UNO includes === **/
#include <boost/noncopyable.hpp>
@@ -74,6 +75,19 @@ namespace dbtools
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxColumn
);
+ /** constructs an instance
+
+ The format key for the string value exchange is taken from the given column object.
+ If it has a non-<NULL/> property value <code>FormatKey</code>, this key is taken.
+ Otherwise, a default format matching the column type is determined.
+
+ The locale of this fallback format is the current system locale.
+ */
+ FormattedColumnValue(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& i_rNumberFormatter,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& i_rColumn
+ );
+
// note that all methods of this class need to be virtual, since it's
// used in a load-on-demand context in module SVX
diff --git a/connectivity/prj/d.lst b/connectivity/prj/d.lst
index 8b5aaa1c60..e116ee5740 100644
--- a/connectivity/prj/d.lst
+++ b/connectivity/prj/d.lst
@@ -28,6 +28,6 @@ mkdir: %_DEST%\xml%_EXT%\registry\spool\DataAccess
..\%__SRC%\inc\sqlbison.hxx %_DEST%\inc%_EXT%\connectivity\sqlbison.hxx
..\inc\connectivity\sdbcx\*.hxx %_DEST%\inc%_EXT%\connectivity\sdbcx\*.hxx
#..\version.mk %_DEST%\inc%_EXT%\connectivity\version.mk
-..\%__SRC%\misc\lang\*.xcu %_DEST%\xml%_EXT%\registry\spool\DataAccess\*.xcu
+..\%__SRC%\misc\registry\data\org\openoffice\Office\DataAccess\*.xcu %_DEST%\xml%_EXT%\registry\spool\DataAccess\*.xcu
..\%COMMON_OUTDIR%\bin\fcfg_drivers_*.zip %_DEST%\pck%_EXT%\fcfg_drivers_*.zip
..\%__SRC%\bin\fcfg_drivers_*.zip %_DEST%\pck%_EXT%\fcfg_drivers_*.zip
diff --git a/connectivity/source/commontools/TIndexes.cxx b/connectivity/source/commontools/TIndexes.cxx
index 73d242bb1d..e979262e8c 100644
--- a/connectivity/source/commontools/TIndexes.cxx
+++ b/connectivity/source/commontools/TIndexes.cxx
@@ -140,73 +140,80 @@ sdbcx::ObjectType OIndexesHelper::appendObject( const ::rtl::OUString& _rForName
if ( m_pTable->isNew() )
return cloneDescriptor( descriptor );
- ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
- ::rtl::OUStringBuffer aSql( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CREATE ")));
- ::rtl::OUString aQuote = m_pTable->getMetaData()->getIdentifierQuoteString( );
- ::rtl::OUString aDot = ::rtl::OUString::createFromAscii(".");
+ if ( m_pTable->getIndexService().is() )
+ {
+ m_pTable->getIndexService()->addIndex(m_pTable,descriptor);
+ }
+ else
+ {
+ ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
+ ::rtl::OUStringBuffer aSql( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CREATE ")));
+ ::rtl::OUString aQuote = m_pTable->getMetaData()->getIdentifierQuoteString( );
+ ::rtl::OUString aDot = ::rtl::OUString::createFromAscii(".");
- if(comphelper::getBOOL(descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_ISUNIQUE))))
- aSql.appendAscii("UNIQUE ");
- aSql.appendAscii("INDEX ");
+ if(comphelper::getBOOL(descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_ISUNIQUE))))
+ aSql.appendAscii("UNIQUE ");
+ aSql.appendAscii("INDEX ");
-
- ::rtl::OUString aCatalog,aSchema,aTable;
- dbtools::qualifiedNameComponents(m_pTable->getMetaData(),m_pTable->getName(),aCatalog,aSchema,aTable,::dbtools::eInDataManipulation);
- ::rtl::OUString aComposedName;
-
- aComposedName = dbtools::composeTableName(m_pTable->getMetaData(),aCatalog,aSchema,aTable,sal_True,::dbtools::eInIndexDefinitions);
- if ( _rForName.getLength() )
- {
- aSql.append( ::dbtools::quoteName( aQuote, _rForName ) );
- aSql.appendAscii(" ON ");
- aSql.append(aComposedName);
- aSql.appendAscii(" ( ");
-
- Reference<XColumnsSupplier> xColumnSup(descriptor,UNO_QUERY);
- Reference<XIndexAccess> xColumns(xColumnSup->getColumns(),UNO_QUERY);
- Reference< XPropertySet > xColProp;
- sal_Bool bAddIndexAppendix = ::dbtools::getBooleanDataSourceSetting( m_pTable->getConnection(), "AddIndexAppendix" );
- sal_Int32 nCount = xColumns->getCount();
- for(sal_Int32 i = 0 ; i < nCount; ++i)
+
+ ::rtl::OUString aCatalog,aSchema,aTable;
+ dbtools::qualifiedNameComponents(m_pTable->getMetaData(),m_pTable->getName(),aCatalog,aSchema,aTable,::dbtools::eInDataManipulation);
+ ::rtl::OUString aComposedName;
+
+ aComposedName = dbtools::composeTableName(m_pTable->getMetaData(),aCatalog,aSchema,aTable,sal_True,::dbtools::eInIndexDefinitions);
+ if ( _rForName.getLength() )
{
- xColProp.set(xColumns->getByIndex(i),UNO_QUERY);
- aSql.append(::dbtools::quoteName( aQuote,comphelper::getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)))));
-
- if ( bAddIndexAppendix )
- {
-
- aSql.appendAscii(any2bool(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_ISASCENDING)))
- ?
- " ASC"
- :
- " DESC");
+ aSql.append( ::dbtools::quoteName( aQuote, _rForName ) );
+ aSql.appendAscii(" ON ");
+ aSql.append(aComposedName);
+ aSql.appendAscii(" ( ");
+
+ Reference<XColumnsSupplier> xColumnSup(descriptor,UNO_QUERY);
+ Reference<XIndexAccess> xColumns(xColumnSup->getColumns(),UNO_QUERY);
+ Reference< XPropertySet > xColProp;
+ sal_Bool bAddIndexAppendix = ::dbtools::getBooleanDataSourceSetting( m_pTable->getConnection(), "AddIndexAppendix" );
+ sal_Int32 nCount = xColumns->getCount();
+ for(sal_Int32 i = 0 ; i < nCount; ++i)
+ {
+ xColProp.set(xColumns->getByIndex(i),UNO_QUERY);
+ aSql.append(::dbtools::quoteName( aQuote,comphelper::getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)))));
+
+ if ( bAddIndexAppendix )
+ {
+
+ aSql.appendAscii(any2bool(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_ISASCENDING)))
+ ?
+ " ASC"
+ :
+ " DESC");
+ }
+ aSql.appendAscii(",");
}
- aSql.appendAscii(",");
+ aSql.setCharAt(aSql.getLength()-1,')');
}
- aSql.setCharAt(aSql.getLength()-1,')');
- }
- else
- {
- aSql.append(aComposedName);
+ else
+ {
+ aSql.append(aComposedName);
- Reference<XColumnsSupplier> xColumnSup(descriptor,UNO_QUERY);
- Reference<XIndexAccess> xColumns(xColumnSup->getColumns(),UNO_QUERY);
- Reference< XPropertySet > xColProp;
- if(xColumns->getCount() != 1)
- throw SQLException();
+ Reference<XColumnsSupplier> xColumnSup(descriptor,UNO_QUERY);
+ Reference<XIndexAccess> xColumns(xColumnSup->getColumns(),UNO_QUERY);
+ Reference< XPropertySet > xColProp;
+ if(xColumns->getCount() != 1)
+ throw SQLException();
- xColumns->getByIndex(0) >>= xColProp;
+ xColumns->getByIndex(0) >>= xColProp;
- aSql.append(aDot);
- aSql.append(::dbtools::quoteName( aQuote,comphelper::getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)))));
- }
+ aSql.append(aDot);
+ aSql.append(::dbtools::quoteName( aQuote,comphelper::getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)))));
+ }
- Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( );
- if ( xStmt.is() )
- {
- ::rtl::OUString sSql = aSql.makeStringAndClear();
- xStmt->execute(sSql);
- ::comphelper::disposeComponent(xStmt);
+ Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( );
+ if ( xStmt.is() )
+ {
+ ::rtl::OUString sSql = aSql.makeStringAndClear();
+ xStmt->execute(sSql);
+ ::comphelper::disposeComponent(xStmt);
+ }
}
return createObject( _rForName );
@@ -218,27 +225,34 @@ void OIndexesHelper::dropObject(sal_Int32 /*_nPos*/,const ::rtl::OUString _sElem
Reference< XConnection> xConnection = m_pTable->getConnection();
if( xConnection.is() && !m_pTable->isNew())
{
- ::rtl::OUString aName,aSchema;
- sal_Int32 nLen = _sElementName.indexOf('.');
- if(nLen != -1)
- aSchema = _sElementName.copy(0,nLen);
- aName = _sElementName.copy(nLen+1);
+ if ( m_pTable->getIndexService().is() )
+ {
+ m_pTable->getIndexService()->dropIndex(m_pTable,_sElementName);
+ }
+ else
+ {
+ ::rtl::OUString aName,aSchema;
+ sal_Int32 nLen = _sElementName.indexOf('.');
+ if(nLen != -1)
+ aSchema = _sElementName.copy(0,nLen);
+ aName = _sElementName.copy(nLen+1);
- ::rtl::OUString aSql = ::rtl::OUString::createFromAscii("DROP INDEX ");
+ ::rtl::OUString aSql = ::rtl::OUString::createFromAscii("DROP INDEX ");
- ::rtl::OUString aComposedName = dbtools::composeTableName( m_pTable->getMetaData(), m_pTable, ::dbtools::eInIndexDefinitions, false, false, true );
- ::rtl::OUString sIndexName,sTemp;
- sIndexName = dbtools::composeTableName( m_pTable->getMetaData(), sTemp, aSchema, aName, sal_True, ::dbtools::eInIndexDefinitions );
+ ::rtl::OUString aComposedName = dbtools::composeTableName( m_pTable->getMetaData(), m_pTable, ::dbtools::eInIndexDefinitions, false, false, true );
+ ::rtl::OUString sIndexName,sTemp;
+ sIndexName = dbtools::composeTableName( m_pTable->getMetaData(), sTemp, aSchema, aName, sal_True, ::dbtools::eInIndexDefinitions );
- aSql += sIndexName
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ON "))
- + aComposedName;
+ aSql += sIndexName
+ + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ON "))
+ + aComposedName;
- Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( );
- if ( xStmt.is() )
- {
- xStmt->execute(aSql);
- ::comphelper::disposeComponent(xStmt);
+ Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( );
+ if ( xStmt.is() )
+ {
+ xStmt->execute(aSql);
+ ::comphelper::disposeComponent(xStmt);
+ }
}
}
}
diff --git a/connectivity/source/commontools/TKeys.cxx b/connectivity/source/commontools/TKeys.cxx
index dc16a51cff..865e51ae03 100644
--- a/connectivity/source/commontools/TKeys.cxx
+++ b/connectivity/source/commontools/TKeys.cxx
@@ -147,69 +147,80 @@ sdbcx::ObjectType OKeysHelper::appendObject( const ::rtl::OUString& _rForName, c
return xNewDescriptor;
}
- // if we're here, we belong to a table which is not new, i.e. already exists in the database.
- // In this case, really append the new index.
-
const ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
sal_Int32 nKeyType = getINT32(descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_TYPE)));
+ sal_Int32 nUpdateRule = 0, nDeleteRule = 0;
+ ::rtl::OUString sReferencedName;
- ::rtl::OUString aSql = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ALTER TABLE "));
- ::rtl::OUString aQuote = m_pTable->getConnection()->getMetaData()->getIdentifierQuoteString( );
- ::rtl::OUString aDot = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("."));
-
- aSql += composeTableName( m_pTable->getConnection()->getMetaData(), m_pTable, ::dbtools::eInTableDefinitions, false, false, true );
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ADD "));
-
- if ( nKeyType == KeyType::PRIMARY )
+ if ( nKeyType == KeyType::FOREIGN )
{
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" PRIMARY KEY ("));
+ descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_REFERENCEDTABLE)) >>= sReferencedName;
+ descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_UPDATERULE)) >>= nUpdateRule;
+ descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_DELETERULE)) >>= nDeleteRule;
}
- else if ( nKeyType == KeyType::FOREIGN )
+
+ if ( m_pTable->getKeyService().is() )
{
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" FOREIGN KEY ("));
+ m_pTable->getKeyService()->addKey(m_pTable,descriptor);
}
else
- throw SQLException();
-
- Reference<XColumnsSupplier> xColumnSup(descriptor,UNO_QUERY);
- Reference<XIndexAccess> xColumns(xColumnSup->getColumns(),UNO_QUERY);
- Reference< XPropertySet > xColProp;
- for(sal_Int32 i=0;i<xColumns->getCount();++i)
{
- ::cppu::extractInterface(xColProp,xColumns->getByIndex(i));
- aSql += ::dbtools::quoteName( aQuote,getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME))))
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(","));
- }
- aSql = aSql.replaceAt(aSql.getLength()-1,1,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")")));
+ // if we're here, we belong to a table which is not new, i.e. already exists in the database.
+ // In this case, really append the new index.
+ ::rtl::OUStringBuffer aSql;
+ aSql.appendAscii("ALTER TABLE ");
+ ::rtl::OUString aQuote = m_pTable->getConnection()->getMetaData()->getIdentifierQuoteString( );
+ ::rtl::OUString aDot = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("."));
- sal_Int32 nUpdateRule = 0, nDeleteRule = 0;
- ::rtl::OUString sReferencedName;
+ aSql.append(composeTableName( m_pTable->getConnection()->getMetaData(), m_pTable, ::dbtools::eInTableDefinitions, false, false, true ));
+ aSql.appendAscii(" ADD ");
- if ( nKeyType == KeyType::FOREIGN )
- {
- descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_REFERENCEDTABLE)) >>= sReferencedName;
-
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" REFERENCES "))
- + ::dbtools::quoteTableName(m_pTable->getConnection()->getMetaData(),sReferencedName,::dbtools::eInTableDefinitions);
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ("));
+ if ( nKeyType == KeyType::PRIMARY )
+ {
+ aSql.appendAscii(" PRIMARY KEY (");
+ }
+ else if ( nKeyType == KeyType::FOREIGN )
+ {
+ aSql.appendAscii(" FOREIGN KEY (");
+ }
+ else
+ throw SQLException();
- for(sal_Int32 i=0;i<xColumns->getCount();++i)
+ Reference<XColumnsSupplier> xColumnSup(descriptor,UNO_QUERY);
+ Reference<XIndexAccess> xColumns(xColumnSup->getColumns(),UNO_QUERY);
+ Reference< XPropertySet > xColProp;
+ for(sal_Int32 i = 0 ; i < xColumns->getCount() ; ++i)
{
- xColumns->getByIndex(i) >>= xColProp;
- aSql += ::dbtools::quoteName( aQuote,getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_RELATEDCOLUMN))))
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(","));
+ if ( i > 0 )
+ aSql.appendAscii(",");
+ ::cppu::extractInterface(xColProp,xColumns->getByIndex(i));
+ aSql.append( ::dbtools::quoteName( aQuote,getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)))) );
+
}
- aSql = aSql.replaceAt(aSql.getLength()-1,1,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")")));
+ aSql.appendAscii(")");
- descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_UPDATERULE)) >>= nUpdateRule;
- descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_DELETERULE)) >>= nDeleteRule;
+ if ( nKeyType == KeyType::FOREIGN )
+ {
+ aSql.appendAscii(" REFERENCES ");
+ aSql.append(::dbtools::quoteTableName(m_pTable->getConnection()->getMetaData(),sReferencedName,::dbtools::eInTableDefinitions));
+ aSql.appendAscii(" (");
- aSql += getKeyRuleString(sal_True ,nUpdateRule);
- aSql += getKeyRuleString(sal_False ,nDeleteRule);
- }
+ for(sal_Int32 i=0;i<xColumns->getCount();++i)
+ {
+ if ( i > 0 )
+ aSql.appendAscii(",");
+ xColumns->getByIndex(i) >>= xColProp;
+ aSql.append(::dbtools::quoteName( aQuote,getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_RELATEDCOLUMN)))));
+
+ }
+ aSql.appendAscii(")");
+ aSql.append(getKeyRuleString(sal_True ,nUpdateRule));
+ aSql.append(getKeyRuleString(sal_False ,nDeleteRule));
+ }
- Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( );
- xStmt->execute(aSql);
+ Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( );
+ xStmt->execute(aSql.makeStringAndClear());
+ }
// find the name which the database gave the new key
::rtl::OUString sNewName( _rForName );
try
@@ -266,34 +277,41 @@ void OKeysHelper::dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName
Reference< XConnection> xConnection = m_pTable->getConnection();
if ( xConnection.is() && !m_pTable->isNew() )
{
- ::rtl::OUString aSql = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ALTER TABLE "));
-
- aSql += composeTableName( m_pTable->getConnection()->getMetaData(), m_pTable,::dbtools::eInTableDefinitions, false, false, true );
-
Reference<XPropertySet> xKey(getObject(_nPos),UNO_QUERY);
-
- sal_Int32 nKeyType = KeyType::PRIMARY;
- if ( xKey.is() )
+ if ( m_pTable->getKeyService().is() )
{
- ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
- xKey->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_TYPE)) >>= nKeyType;
- }
- if ( KeyType::PRIMARY == nKeyType )
- {
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" DROP PRIMARY KEY"));
+ m_pTable->getKeyService()->dropKey(m_pTable,xKey);
}
else
{
- aSql += getDropForeignKey();
- const ::rtl::OUString aQuote = m_pTable->getConnection()->getMetaData()->getIdentifierQuoteString();
- aSql += ::dbtools::quoteName( aQuote,_sElementName);
- }
+ ::rtl::OUStringBuffer aSql;
+ aSql.appendAscii("ALTER TABLE ");
- Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( );
- if ( xStmt.is() )
- {
- xStmt->execute(aSql);
- ::comphelper::disposeComponent(xStmt);
+ aSql.append( composeTableName( m_pTable->getConnection()->getMetaData(), m_pTable,::dbtools::eInTableDefinitions, false, false, true ));
+
+ sal_Int32 nKeyType = KeyType::PRIMARY;
+ if ( xKey.is() )
+ {
+ ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
+ xKey->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_TYPE)) >>= nKeyType;
+ }
+ if ( KeyType::PRIMARY == nKeyType )
+ {
+ aSql.appendAscii(" DROP PRIMARY KEY");
+ }
+ else
+ {
+ aSql.append(getDropForeignKey());
+ const ::rtl::OUString aQuote = m_pTable->getConnection()->getMetaData()->getIdentifierQuoteString();
+ aSql.append( ::dbtools::quoteName( aQuote,_sElementName) );
+ }
+
+ Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( );
+ if ( xStmt.is() )
+ {
+ xStmt->execute(aSql.makeStringAndClear());
+ ::comphelper::disposeComponent(xStmt);
+ }
}
}
}
diff --git a/connectivity/source/commontools/TTableHelper.cxx b/connectivity/source/commontools/TTableHelper.cxx
index b8e19073d4..0be2c930a2 100644
--- a/connectivity/source/commontools/TTableHelper.cxx
+++ b/connectivity/source/commontools/TTableHelper.cxx
@@ -95,14 +95,53 @@ public:
}
namespace connectivity
{
+ ::rtl::OUString lcl_getServiceNameForSetting(const Reference< ::com::sun::star::sdbc::XConnection >& _xConnection,const ::rtl::OUString& i_sSetting)
+ {
+ ::rtl::OUString sSupportService;
+ Any aValue;
+ if ( ::dbtools::getDataSourceSetting(_xConnection,i_sSetting,aValue) )
+ {
+ aValue >>= sSupportService;
+ }
+ return sSupportService;
+ }
struct OTableHelperImpl
{
TKeyMap m_aKeys;
- Reference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData;
+ // helper services which can be provided by extensions
+ Reference< ::com::sun::star::sdb::tools::XTableRename> m_xRename;
+ Reference< ::com::sun::star::sdb::tools::XTableAlteration> m_xAlter;
+ Reference< ::com::sun::star::sdb::tools::XKeyAlteration> m_xKeyAlter;
+ Reference< ::com::sun::star::sdb::tools::XIndexAlteration> m_xIndexAlter;
+
+ Reference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData;
Reference< ::com::sun::star::sdbc::XConnection > m_xConnection;
::comphelper::ImplementationReference< OTableContainerListener,XContainerListener>
m_xTablePropertyListener;
::std::vector< ColumnDesc > m_aColumnDesc;
+ OTableHelperImpl(const Reference< ::com::sun::star::sdbc::XConnection >& _xConnection)
+ : m_xConnection(_xConnection)
+ {
+ try
+ {
+ m_xMetaData = m_xConnection->getMetaData();
+ Reference<XMultiServiceFactory> xFac(_xConnection,UNO_QUERY);
+ if ( xFac.is() )
+ {
+ static const ::rtl::OUString s_sTableRename(RTL_CONSTASCII_USTRINGPARAM("TableRenameServiceName"));
+ m_xRename.set(xFac->createInstance(lcl_getServiceNameForSetting(m_xConnection,s_sTableRename)),UNO_QUERY);
+ static const ::rtl::OUString s_sTableAlteration(RTL_CONSTASCII_USTRINGPARAM("TableAlterationServiceName"));
+ m_xAlter.set(xFac->createInstance(lcl_getServiceNameForSetting(m_xConnection,s_sTableAlteration)),UNO_QUERY);
+ static const ::rtl::OUString s_sKeyAlteration(RTL_CONSTASCII_USTRINGPARAM("KeyAlterationServiceName"));
+ m_xKeyAlter.set(xFac->createInstance(lcl_getServiceNameForSetting(m_xConnection,s_sKeyAlteration)),UNO_QUERY);
+ static const ::rtl::OUString s_sIndexAlteration(RTL_CONSTASCII_USTRINGPARAM("IndexAlterationServiceName"));
+ m_xIndexAlter.set(xFac->createInstance(lcl_getServiceNameForSetting(m_xConnection,s_sIndexAlteration)),UNO_QUERY);
+ }
+ }
+ catch(const Exception&)
+ {
+ }
+ }
};
}
@@ -110,16 +149,8 @@ OTableHelper::OTableHelper( sdbcx::OCollection* _pTables,
const Reference< XConnection >& _xConnection,
sal_Bool _bCase)
:OTable_TYPEDEF(_pTables,_bCase)
- ,m_pImpl(new OTableHelperImpl)
-{
- try
- {
- m_pImpl->m_xConnection = _xConnection;
- m_pImpl->m_xMetaData = m_pImpl->m_xConnection->getMetaData();
- }
- catch(const Exception&)
- {
- }
+ ,m_pImpl(new OTableHelperImpl(_xConnection))
+{
}
// -------------------------------------------------------------------------
OTableHelper::OTableHelper( sdbcx::OCollection* _pTables,
@@ -137,16 +168,8 @@ OTableHelper::OTableHelper( sdbcx::OCollection* _pTables,
_Description,
_SchemaName,
_CatalogName)
- ,m_pImpl(new OTableHelperImpl)
+ ,m_pImpl(new OTableHelperImpl(_xConnection))
{
- try
- {
- m_pImpl->m_xConnection = _xConnection;
- m_pImpl->m_xMetaData = m_pImpl->m_xConnection->getMetaData();
- }
- catch(const Exception&)
- {
- }
}
// -----------------------------------------------------------------------------
OTableHelper::~OTableHelper()
@@ -480,24 +503,31 @@ void SAL_CALL OTableHelper::rename( const ::rtl::OUString& newName ) throw(SQLEx
if(!isNew())
{
- ::rtl::OUString sSql = getRenameStart();
- ::rtl::OUString sQuote = getMetaData()->getIdentifierQuoteString( );
+ if ( m_pImpl->m_xRename.is() )
+ {
+ m_pImpl->m_xRename->rename(this,newName);
+ }
+ else
+ {
+ ::rtl::OUString sSql = getRenameStart();
+ ::rtl::OUString sQuote = getMetaData()->getIdentifierQuoteString( );
- ::rtl::OUString sCatalog,sSchema,sTable;
- ::dbtools::qualifiedNameComponents(getMetaData(),newName,sCatalog,sSchema,sTable,::dbtools::eInDataManipulation);
+ ::rtl::OUString sCatalog,sSchema,sTable;
+ ::dbtools::qualifiedNameComponents(getMetaData(),newName,sCatalog,sSchema,sTable,::dbtools::eInDataManipulation);
- ::rtl::OUString sComposedName;
- sComposedName = ::dbtools::composeTableName(getMetaData(),m_CatalogName,m_SchemaName,m_Name,sal_True,::dbtools::eInDataManipulation);
- sSql += sComposedName
- + ::rtl::OUString::createFromAscii(" TO ");
- sComposedName = ::dbtools::composeTableName(getMetaData(),sCatalog,sSchema,sTable,sal_True,::dbtools::eInDataManipulation);
- sSql += sComposedName;
+ ::rtl::OUString sComposedName;
+ sComposedName = ::dbtools::composeTableName(getMetaData(),m_CatalogName,m_SchemaName,m_Name,sal_True,::dbtools::eInDataManipulation);
+ sSql += sComposedName
+ + ::rtl::OUString::createFromAscii(" TO ");
+ sComposedName = ::dbtools::composeTableName(getMetaData(),sCatalog,sSchema,sTable,sal_True,::dbtools::eInDataManipulation);
+ sSql += sComposedName;
- Reference< XStatement > xStmt = m_pImpl->m_xConnection->createStatement( );
- if ( xStmt.is() )
- {
- xStmt->execute(sSql);
- ::comphelper::disposeComponent(xStmt);
+ Reference< XStatement > xStmt = m_pImpl->m_xConnection->createStatement( );
+ if ( xStmt.is() )
+ {
+ xStmt->execute(sSql);
+ ::comphelper::disposeComponent(xStmt);
+ }
}
OTable_TYPEDEF::rename(newName);
@@ -576,3 +606,24 @@ Reference< XConnection> OTableHelper::getConnection() const
{
return m_pImpl->m_xConnection;
}
+// -----------------------------------------------------------------------------
+Reference< ::com::sun::star::sdb::tools::XTableRename> OTableHelper::getRenameService() const
+{
+ return m_pImpl->m_xRename;
+}
+// -----------------------------------------------------------------------------
+Reference< ::com::sun::star::sdb::tools::XTableAlteration> OTableHelper::getAlterService() const
+{
+ return m_pImpl->m_xAlter;
+}
+// -----------------------------------------------------------------------------
+Reference< ::com::sun::star::sdb::tools::XKeyAlteration> OTableHelper::getKeyService() const
+{
+ return m_pImpl->m_xKeyAlter;
+}
+// -----------------------------------------------------------------------------
+Reference< ::com::sun::star::sdb::tools::XIndexAlteration> OTableHelper::getIndexService() const
+{
+ return m_pImpl->m_xIndexAlter;
+}
+// -----------------------------------------------------------------------------
diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx
index ba926613d9..7011665ab3 100644
--- a/connectivity/source/commontools/dbtools.cxx
+++ b/connectivity/source/commontools/dbtools.cxx
@@ -318,8 +318,8 @@ Reference< XConnection > getConnection_allowException(
Reference<XCompletedConnection> xConnectionCompletion(xProp, UNO_QUERY);
if (xConnectionCompletion.is())
{ // instantiate the default SDB interaction handler
- Reference< XInteractionHandler > xHandler(_rxFactory->createInstance(::rtl::OUString::createFromAscii("com.sun.star.sdb.InteractionHandler")), UNO_QUERY);
- OSL_ENSURE(xHandler.is(), "dbtools::getConnection service com.sun.star.sdb.InteractionHandler not available!");
+ Reference< XInteractionHandler > xHandler(_rxFactory->createInstance(::rtl::OUString::createFromAscii("com.sun.star.task.InteractionHandler")), UNO_QUERY);
+ OSL_ENSURE(xHandler.is(), "dbtools::getConnection service com.sun.star.task.InteractionHandler not available!");
if (xHandler.is())
{
xConnection = xConnectionCompletion->connectWithCompletion(xHandler);
diff --git a/connectivity/source/commontools/dbtools2.cxx b/connectivity/source/commontools/dbtools2.cxx
index 5e6a1063cf..3a9f97f0d0 100644
--- a/connectivity/source/commontools/dbtools2.cxx
+++ b/connectivity/source/commontools/dbtools2.cxx
@@ -593,7 +593,39 @@ bool getBooleanDataSourceSetting( const Reference< XConnection >& _rxConnection,
}
return bValue;
}
+// -------------------------------------------------------------------------
+bool getDataSourceSetting( const Reference< XInterface >& _xChild, const ::rtl::OUString& _sAsciiSettingsName,
+ Any& /* [out] */ _rSettingsValue )
+{
+ bool bIsPresent = false;
+ try
+ {
+ const Reference< XPropertySet> xDataSourceProperties( findDataSource( _xChild ), UNO_QUERY );
+ OSL_ENSURE( xDataSourceProperties.is(), "getDataSourceSetting: invalid data source object!" );
+ if ( !xDataSourceProperties.is() )
+ return false;
+
+ const Reference< XPropertySet > xSettings(
+ xDataSourceProperties->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Settings") ) ),
+ UNO_QUERY_THROW
+ );
+ _rSettingsValue = xSettings->getPropertyValue( _sAsciiSettingsName );
+ bIsPresent = true;
+ }
+ catch( const Exception& )
+ {
+ bIsPresent = false;
+ }
+ return bIsPresent;
+}
+// -------------------------------------------------------------------------
+bool getDataSourceSetting( const Reference< XInterface >& _rxDataSource, const sal_Char* _pAsciiSettingsName,
+ Any& /* [out] */ _rSettingsValue )
+{
+ ::rtl::OUString sAsciiSettingsName = ::rtl::OUString::createFromAscii(_pAsciiSettingsName);
+ return getDataSourceSetting( _rxDataSource, sAsciiSettingsName,_rSettingsValue );
+}
// -----------------------------------------------------------------------------
sal_Bool isDataSourcePropertyEnabled(const Reference<XInterface>& _xProp,const ::rtl::OUString& _sProperty,sal_Bool _bDefault)
{
diff --git a/connectivity/source/commontools/formattedcolumnvalue.cxx b/connectivity/source/commontools/formattedcolumnvalue.cxx
index ac965e1037..90bb97ac1d 100644
--- a/connectivity/source/commontools/formattedcolumnvalue.cxx
+++ b/connectivity/source/commontools/formattedcolumnvalue.cxx
@@ -42,13 +42,11 @@
/** === end UNO includes === **/
//#include <unotools/syslocale.hxx>
-
#include <tools/diagnose_ex.h>
-
#include <i18npool/mslangid.hxx>
-
#include <comphelper/numbers.hxx>
#include <comphelper/componentcontext.hxx>
+#include <unotools/sharedunocomponent.hxx>
//........................................................................
namespace dbtools
@@ -59,6 +57,7 @@ namespace dbtools
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::UNO_QUERY;
using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
using ::com::sun::star::uno::Exception;
using ::com::sun::star::uno::RuntimeException;
using ::com::sun::star::uno::Any;
@@ -113,21 +112,7 @@ namespace dbtools
//................................................................
void lcl_clear_nothrow( FormattedColumnValue_Data& _rData )
{
- if ( _rData.m_xFormatter.is() )
- {
- try
- {
- Reference< XComponent > xFormatterComp( _rData.m_xFormatter, UNO_QUERY );
- if ( xFormatterComp.is() )
- xFormatterComp->dispose();
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- _rData.m_xFormatter.clear();
- }
-
+ _rData.m_xFormatter.clear();
_rData.m_nFormatKey = 0;
_rData.m_nFieldType = DataType::OTHER;
_rData.m_nKeyType = NumberFormat::UNDEFINED;
@@ -138,21 +123,24 @@ namespace dbtools
}
//................................................................
- void lcl_initColumnDataValue_nothrow( const ::comphelper::ComponentContext& _rContext, FormattedColumnValue_Data& _rData,
- const Reference< XRowSet >& _rxRowSet, const Reference< XPropertySet >& _rxColumn )
+ void lcl_initColumnDataValue_nothrow( FormattedColumnValue_Data& _rData,
+ const Reference< XNumberFormatter >& i_rNumberFormatter, const Reference< XPropertySet >& _rxColumn )
{
lcl_clear_nothrow( _rData );
- OSL_PRECOND( _rxRowSet.is(), "lcl_initColumnDataValue_nothrow: no row set!" );
- OSL_PRECOND( _rxColumn.is(), "lcl_initColumnDataValue_nothrow: no column!" );
- if ( !_rxRowSet.is() || !_rxColumn.is() )
+ OSL_PRECOND( i_rNumberFormatter.is(), "lcl_initColumnDataValue_nothrow: no number formats -> no formatted values!" );
+ if ( !i_rNumberFormatter.is() )
return;
try
{
+ Reference< XNumberFormatsSupplier > xNumberFormatsSupp( i_rNumberFormatter->getNumberFormatsSupplier(), UNO_SET_THROW );
+
+ // remember the column
_rData.m_xColumn.set( _rxColumn, UNO_QUERY_THROW );
_rData.m_xColumnUpdate.set( _rxColumn, UNO_QUERY );
+ // determine the field type, and whether it's a numeric field
OSL_VERIFY( _rxColumn->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Type" ) ) ) >>= _rData.m_nFieldType );
switch ( _rData.m_nFieldType )
@@ -177,10 +165,6 @@ namespace dbtools
break;
}
- // get the number formats supplier of the connection of the form
- Reference< XConnection > xConnection( getConnection( _rxRowSet ), UNO_QUERY_THROW );
- Reference< XNumberFormatsSupplier > xSupplier( getNumberFormats( xConnection, sal_False, _rContext.getLegacyServiceFactory() ), UNO_QUERY_THROW );
-
// get the format key of our bound field
Reference< XPropertySetInfo > xPSI( _rxColumn->getPropertySetInfo(), UNO_QUERY_THROW );
bool bHaveFieldFormat = false;
@@ -194,23 +178,49 @@ namespace dbtools
// fall back to a format key as indicated by the field type
Locale aSystemLocale;
MsLangId::convertLanguageToLocale( MsLangId::getSystemLanguage(), aSystemLocale );
- Reference< XNumberFormatTypes > xNumTypes( xSupplier->getNumberFormats(), UNO_QUERY_THROW );
+ Reference< XNumberFormatTypes > xNumTypes( xNumberFormatsSupp->getNumberFormats(), UNO_QUERY_THROW );
_rData.m_nFormatKey = getDefaultNumberFormat( _rxColumn, xNumTypes, aSystemLocale );
}
// some more formatter settings
- _rData.m_nKeyType = ::comphelper::getNumberFormatType( xSupplier->getNumberFormats(), _rData.m_nFormatKey );
- Reference< XPropertySet > xFormatSettings( xSupplier->getNumberFormatSettings(), UNO_QUERY_THROW );
+ _rData.m_nKeyType = ::comphelper::getNumberFormatType( xNumberFormatsSupp->getNumberFormats(), _rData.m_nFormatKey );
+ Reference< XPropertySet > xFormatSettings( xNumberFormatsSupp->getNumberFormatSettings(), UNO_QUERY_THROW );
OSL_VERIFY( xFormatSettings->getPropertyValue( ::rtl::OUString::createFromAscii( "NullDate" ) ) >>= _rData.m_aNullDate );
- // create a formatter working with the connection's number format supplier
- _rData.m_xFormatter.set( _rContext.createComponent( "com.sun.star.util.NumberFormatter" ), UNO_QUERY_THROW );
- _rData.m_xFormatter->attachNumberFormatsSupplier( xSupplier );
+ // remember the formatter
+ _rData.m_xFormatter = i_rNumberFormatter;
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+ //................................................................
+ void lcl_initColumnDataValue_nothrow( const ::comphelper::ComponentContext& i_rContext, FormattedColumnValue_Data& i_rData,
+ const Reference< XRowSet >& i_rRowSet, const Reference< XPropertySet >& i_rColumn )
+ {
+ OSL_PRECOND( i_rRowSet.is(), "lcl_initColumnDataValue_nothrow: no row set!" );
+ if ( !i_rRowSet.is() )
+ return;
+
+ Reference< XNumberFormatter > xNumberFormatter;
+ try
+ {
+ // get the number formats supplier of the connection of the form
+ Reference< XConnection > xConnection( getConnection( i_rRowSet ), UNO_QUERY_THROW );
+ Reference< XNumberFormatsSupplier > xSupplier( getNumberFormats( xConnection, sal_True, i_rContext.getLegacyServiceFactory() ), UNO_SET_THROW );
+
+ // create a number formatter for it
+ xNumberFormatter.set( i_rContext.createComponent( "com.sun.star.util.NumberFormatter" ), UNO_QUERY_THROW );
+ xNumberFormatter->attachNumberFormatsSupplier( xSupplier );
}
catch( const Exception& )
{
DBG_UNHANDLED_EXCEPTION();
}
+
+ lcl_initColumnDataValue_nothrow( i_rData, xNumberFormatter, i_rColumn );
}
}
@@ -218,11 +228,19 @@ namespace dbtools
//= FormattedColumnValue
//====================================================================
//--------------------------------------------------------------------
- FormattedColumnValue::FormattedColumnValue( const ::comphelper::ComponentContext& _rContext,
- const Reference< XRowSet >& _rxRowSet, const Reference< XPropertySet >& _rxColumn )
+ FormattedColumnValue::FormattedColumnValue( const ::comphelper::ComponentContext& i_rContext,
+ const Reference< XRowSet >& _rxRowSet, const Reference< XPropertySet >& i_rColumn )
+ :m_pData( new FormattedColumnValue_Data )
+ {
+ lcl_initColumnDataValue_nothrow( i_rContext, *m_pData, _rxRowSet, i_rColumn );
+ }
+
+ //--------------------------------------------------------------------
+ FormattedColumnValue::FormattedColumnValue( const Reference< XNumberFormatter >& i_rNumberFormatter,
+ const Reference< XPropertySet >& _rxColumn )
:m_pData( new FormattedColumnValue_Data )
{
- lcl_initColumnDataValue_nothrow( _rContext, *m_pData, _rxRowSet, _rxColumn );
+ lcl_initColumnDataValue_nothrow( *m_pData, i_rNumberFormatter, _rxColumn );
}
//--------------------------------------------------------------------
diff --git a/connectivity/source/cpool/dbpool.map b/connectivity/source/cpool/dbpool.map
deleted file mode 100644
index 7202c9d71b..0000000000
--- a/connectivity/source/cpool/dbpool.map
+++ /dev/null
@@ -1,8 +0,0 @@
-DBPOOL_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/cpool/makefile.mk b/connectivity/source/cpool/makefile.mk
index 124e7b574d..1f6e49c6cb 100644
--- a/connectivity/source/cpool/makefile.mk
+++ b/connectivity/source/cpool/makefile.mk
@@ -55,7 +55,7 @@ SLOFILES=\
SHL1TARGET= $(DBPOOL_TARGET)$(DBPOOL_MAJOR)
-SHL1VERSIONMAP=$(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1OBJS=$(SLOFILES)
SHL1STDLIBS=\
diff --git a/connectivity/source/dbtools/dbt.map b/connectivity/source/dbtools/dbt.map
deleted file mode 100644
index c3eaaa5a25..0000000000
--- a/connectivity/source/dbtools/dbt.map
+++ /dev/null
@@ -1,8 +0,0 @@
-DBTOOLS_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/adabas/adabas.map b/connectivity/source/drivers/adabas/adabas.map
deleted file mode 100644
index 7ce4c703e6..0000000000
--- a/connectivity/source/drivers/adabas/adabas.map
+++ /dev/null
@@ -1,8 +0,0 @@
-ADABAS_2_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/adabas/makefile.mk b/connectivity/source/drivers/adabas/makefile.mk
index e3e9d76ac2..9268f02a3b 100644
--- a/connectivity/source/drivers/adabas/makefile.mk
+++ b/connectivity/source/drivers/adabas/makefile.mk
@@ -71,7 +71,7 @@ SLOFILES=\
$(SLO)$/BResultSetMetaData.obj \
$(SLO)$/BResultSet.obj
-SHL1VERSIONMAP=$(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
# --- Library -----------------------------------
diff --git a/connectivity/source/drivers/ado/ado.xcu b/connectivity/source/drivers/ado/ado.xcu
index a1207a1c90..63da80f5ef 100755
--- a/connectivity/source/drivers/ado/ado.xcu
+++ b/connectivity/source/drivers/ado/ado.xcu
@@ -154,6 +154,11 @@
<value>3</value>
</prop>
</node>
+ <node oor:name="ColumnAliasInOrderBy" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ </node>
</node>
<node oor:name="Features">
<node oor:name="UseSQL92NamingConstraints" oor:op="replace">
diff --git a/connectivity/source/drivers/calc/calc.map b/connectivity/source/drivers/calc/calc.map
deleted file mode 100644
index bcab8e6c91..0000000000
--- a/connectivity/source/drivers/calc/calc.map
+++ /dev/null
@@ -1,8 +0,0 @@
-CALC_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/calc/makefile.mk b/connectivity/source/drivers/calc/makefile.mk
index 452e9a92b3..8e193524aa 100644
--- a/connectivity/source/drivers/calc/makefile.mk
+++ b/connectivity/source/drivers/calc/makefile.mk
@@ -57,7 +57,7 @@ SLOFILES=\
$(SLO)$/Cservices.obj \
$(SLO)$/CDriver.obj
-SHL1VERSIONMAP= $(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
# --- Library -----------------------------------
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx
index c8fadc05e6..ab6fc6d580 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -1527,6 +1527,7 @@ BOOL ODbaseTable::InsertRow(OValueRefVector& rRow, BOOL bFlush,const Reference<X
// Buffer mit Leerzeichen fuellen
AllocBuffer();
memset(m_pBuffer, 0, m_aHeader.db_slng);
+ m_pBuffer[0] = ' ';
// Gesamte neue Row uebernehmen:
// ... und am Ende als neuen Record hinzufuegen:
diff --git a/connectivity/source/drivers/dbase/dbase.map b/connectivity/source/drivers/dbase/dbase.map
deleted file mode 100644
index 2c620b4f36..0000000000
--- a/connectivity/source/drivers/dbase/dbase.map
+++ /dev/null
@@ -1,10 +0,0 @@
-DBASE_2_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
-
-
diff --git a/connectivity/source/drivers/dbase/makefile.mk b/connectivity/source/drivers/dbase/makefile.mk
index dded9086bc..f855cf1f45 100644
--- a/connectivity/source/drivers/dbase/makefile.mk
+++ b/connectivity/source/drivers/dbase/makefile.mk
@@ -89,7 +89,7 @@ EXCEPTIONSFILES +=\
.ENDIF
-SHL1VERSIONMAP=$(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
# --- Library -----------------------------------
diff --git a/connectivity/source/drivers/evoab/evoab.map b/connectivity/source/drivers/evoab/evoab.map
deleted file mode 100644
index 00cf7191f1..0000000000
--- a/connectivity/source/drivers/evoab/evoab.map
+++ /dev/null
@@ -1,8 +0,0 @@
-EVOAB_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/evoab/makefile.mk b/connectivity/source/drivers/evoab/makefile.mk
index 31d654fd26..c1dbc21cdf 100644
--- a/connectivity/source/drivers/evoab/makefile.mk
+++ b/connectivity/source/drivers/evoab/makefile.mk
@@ -65,7 +65,7 @@ SLOFILES=\
$(SLO)$/LDebug.obj
-SHL1VERSIONMAP=$(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
# --- Library -----------------------------------
diff --git a/connectivity/source/drivers/evoab2/evoab2.map b/connectivity/source/drivers/evoab2/evoab2.map
deleted file mode 100644
index 00cf7191f1..0000000000
--- a/connectivity/source/drivers/evoab2/evoab2.map
+++ /dev/null
@@ -1,8 +0,0 @@
-EVOAB_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/evoab2/makefile.mk b/connectivity/source/drivers/evoab2/makefile.mk
index 43600a379f..e8a1cf96cd 100644
--- a/connectivity/source/drivers/evoab2/makefile.mk
+++ b/connectivity/source/drivers/evoab2/makefile.mk
@@ -65,7 +65,7 @@ SLOFILES=\
$(SLO)$/EApi.obj \
$(SLO)$/NDebug.obj
-SHL1VERSIONMAP=$(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
# --- Library -----------------------------------
diff --git a/connectivity/source/drivers/flat/flat.map b/connectivity/source/drivers/flat/flat.map
deleted file mode 100644
index bf26bd0fa0..0000000000
--- a/connectivity/source/drivers/flat/flat.map
+++ /dev/null
@@ -1,8 +0,0 @@
-FLAT_2_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/flat/makefile.mk b/connectivity/source/drivers/flat/makefile.mk
index 312e6d6c94..2d1f99f759 100644
--- a/connectivity/source/drivers/flat/makefile.mk
+++ b/connectivity/source/drivers/flat/makefile.mk
@@ -70,7 +70,7 @@ EXCEPTIONSFILES=\
$(SLO)$/EDriver.obj
-SHL1VERSIONMAP=$(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
# --- Library -----------------------------------
SHL1TARGET=$(TARGET)$(DLLPOSTFIX)
diff --git a/connectivity/source/drivers/hsqldb/HTable.cxx b/connectivity/source/drivers/hsqldb/HTable.cxx
index da622e5c0f..0229841889 100644
--- a/connectivity/source/drivers/hsqldb/HTable.cxx
+++ b/connectivity/source/drivers/hsqldb/HTable.cxx
@@ -211,7 +211,7 @@ void SAL_CALL OHSQLTable::alterColumnByName( const ::rtl::OUString& colName, con
// now we should look if the name of the column changed
::rtl::OUString sNewColumnName;
descriptor->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_NAME)) >>= sNewColumnName;
- if ( !sNewColumnName.equalsIgnoreAsciiCase(colName) )
+ if ( !sNewColumnName.equals(colName) )
{
const ::rtl::OUString sQuote = getMetaData()->getIdentifierQuoteString( );
diff --git a/connectivity/source/drivers/jdbc/JStatement.cxx b/connectivity/source/drivers/jdbc/JStatement.cxx
index a247df0958..a94fa523d0 100644
--- a/connectivity/source/drivers/jdbc/JStatement.cxx
+++ b/connectivity/source/drivers/jdbc/JStatement.cxx
@@ -709,38 +709,44 @@ void java_sql_Statement_Base::getFastPropertyValue(
) const
{
java_sql_Statement_Base* THIS = const_cast<java_sql_Statement_Base*>(this);
- switch(nHandle)
+ try
+ {
+ switch(nHandle)
+ {
+ case PROPERTY_ID_QUERYTIMEOUT:
+ rValue <<= THIS->getQueryTimeOut();
+ break;
+ case PROPERTY_ID_MAXFIELDSIZE:
+ rValue <<= THIS->getMaxFieldSize();
+ break;
+ case PROPERTY_ID_MAXROWS:
+ rValue <<= THIS->getMaxRows();
+ break;
+ case PROPERTY_ID_CURSORNAME:
+ rValue <<= THIS->getCursorName();
+ break;
+ case PROPERTY_ID_RESULTSETCONCURRENCY:
+ rValue <<= THIS->getResultSetConcurrency();
+ break;
+ case PROPERTY_ID_RESULTSETTYPE:
+ rValue <<= THIS->getResultSetType();
+ break;
+ case PROPERTY_ID_FETCHDIRECTION:
+ rValue <<= THIS->getFetchDirection();
+ break;
+ case PROPERTY_ID_FETCHSIZE:
+ rValue <<= THIS->getFetchSize();
+ break;
+ case PROPERTY_ID_ESCAPEPROCESSING:
+ rValue <<= (sal_Bool)m_bEscapeProcessing;
+ break;
+ case PROPERTY_ID_USEBOOKMARKS:
+ default:
+ ;
+ }
+ }
+ catch(const Exception&)
{
- case PROPERTY_ID_QUERYTIMEOUT:
- rValue <<= THIS->getQueryTimeOut();
- break;
- case PROPERTY_ID_MAXFIELDSIZE:
- rValue <<= THIS->getMaxFieldSize();
- break;
- case PROPERTY_ID_MAXROWS:
- rValue <<= THIS->getMaxRows();
- break;
- case PROPERTY_ID_CURSORNAME:
- rValue <<= THIS->getCursorName();
- break;
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- rValue <<= THIS->getResultSetConcurrency();
- break;
- case PROPERTY_ID_RESULTSETTYPE:
- rValue <<= THIS->getResultSetType();
- break;
- case PROPERTY_ID_FETCHDIRECTION:
- rValue <<= THIS->getFetchDirection();
- break;
- case PROPERTY_ID_FETCHSIZE:
- rValue <<= THIS->getFetchSize();
- break;
- case PROPERTY_ID_ESCAPEPROCESSING:
- rValue <<= (sal_Bool)m_bEscapeProcessing;
- break;
- case PROPERTY_ID_USEBOOKMARKS:
- default:
- ;
}
}
// -------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/jdbc/jdbc.map b/connectivity/source/drivers/jdbc/jdbc.map
deleted file mode 100644
index 23369ec764..0000000000
--- a/connectivity/source/drivers/jdbc/jdbc.map
+++ /dev/null
@@ -1,8 +0,0 @@
-JDBC_2_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/jdbc/makefile.mk b/connectivity/source/drivers/jdbc/makefile.mk
index 2de63f2c03..4661995216 100644
--- a/connectivity/source/drivers/jdbc/makefile.mk
+++ b/connectivity/source/drivers/jdbc/makefile.mk
@@ -78,7 +78,7 @@ SLOFILES=\
$(SLO)$/tools.obj \
$(SLO)$/ContextClassLoader.obj
-SHL1VERSIONMAP=$(JDBC_TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
# --- Library -----------------------------------
diff --git a/connectivity/source/drivers/kab/kab.map b/connectivity/source/drivers/kab/kab.map
deleted file mode 100644
index 6b7216de8c..0000000000
--- a/connectivity/source/drivers/kab/kab.map
+++ /dev/null
@@ -1,8 +0,0 @@
-KAB_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/kab/kabdrv.map b/connectivity/source/drivers/kab/kabdrv.map
index c32084ddd4..5de866f2e5 100644
--- a/connectivity/source/drivers/kab/kabdrv.map
+++ b/connectivity/source/drivers/kab/kabdrv.map
@@ -1,4 +1,4 @@
-KAB_1_0 {
+UDK_3_0_0 {
global:
createKabConnection;
initKApplication;
diff --git a/connectivity/source/drivers/kab/makefile.mk b/connectivity/source/drivers/kab/makefile.mk
index 98148a29e9..2a0dc5cd89 100644
--- a/connectivity/source/drivers/kab/makefile.mk
+++ b/connectivity/source/drivers/kab/makefile.mk
@@ -61,7 +61,7 @@ DEPOBJFILES= \
# --- Library -----------------------------------
-SHL1VERSIONMAP=$(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1TARGET= $(TARGET)$(KAB_MAJOR)
SHL1OBJS=$(SLOFILES)
diff --git a/connectivity/source/drivers/macab/MacabConnection.cxx b/connectivity/source/drivers/macab/MacabConnection.cxx
index 0762879506..c9155adba2 100755
--- a/connectivity/source/drivers/macab/MacabConnection.cxx
+++ b/connectivity/source/drivers/macab/MacabConnection.cxx
@@ -314,10 +314,11 @@ MacabAddressBook* MacabConnection::getAddressBook() const
return m_pAddressBook;
}
// -----------------------------------------------------------------------------
-extern "C" void* SAL_CALL createMacabConnection( void* _pDriver )
+extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL createMacabConnection( void* _pDriver )
{
MacabConnection* pConnection = new MacabConnection( static_cast< MacabDriver* >( _pDriver ) );
// by definition, the pointer crossing library boundaries as void ptr is acquired once
pConnection->acquire();
return pConnection;
}
+
diff --git a/connectivity/source/drivers/macab/MacabServices.cxx b/connectivity/source/drivers/macab/MacabServices.cxx
index 84bba28bb9..6fc29f4736 100755
--- a/connectivity/source/drivers/macab/MacabServices.cxx
+++ b/connectivity/source/drivers/macab/MacabServices.cxx
@@ -114,7 +114,7 @@ struct ProviderRequest
//---------------------------------------------------------------------------------------
-extern "C" void SAL_CALL component_getImplementationEnvironment(
+extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
const sal_Char **ppEnvTypeName,
uno_Environment **
)
@@ -123,7 +123,7 @@ extern "C" void SAL_CALL component_getImplementationEnvironment(
}
//---------------------------------------------------------------------------------------
-extern "C" sal_Bool SAL_CALL component_writeInfo(
+extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
void*,
void* pRegistryKey
)
@@ -148,7 +148,7 @@ extern "C" sal_Bool SAL_CALL component_writeInfo(
}
//---------------------------------------------------------------------------------------
-extern "C" void* SAL_CALL component_getFactory(
+extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
const sal_Char* pImplementationName,
void* pServiceManager,
void*)
diff --git a/connectivity/source/drivers/macab/macab.map b/connectivity/source/drivers/macab/macab.map
deleted file mode 100755
index fe2d1ac905..0000000000
--- a/connectivity/source/drivers/macab/macab.map
+++ /dev/null
@@ -1,8 +0,0 @@
-MACAB_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/macab/macab.xcu b/connectivity/source/drivers/macab/macab.xcu
index 2418698c3d..cbb9d0b6b0 100755
--- a/connectivity/source/drivers/macab/macab.xcu
+++ b/connectivity/source/drivers/macab/macab.xcu
@@ -27,7 +27,7 @@
************************************************************************ -->
<oor:component-data oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<node oor:name="Installed">
- <node oor:name="sdbc:address:macab:*" oor:op="replace">
+ <node oor:name="sdbc:address:macab" oor:op="replace">
<prop oor:name="Driver">
<value>com.sun.star.comp.sdbc.macab.Driver</value>
</prop>
diff --git a/connectivity/source/drivers/macab/macabdrv.map b/connectivity/source/drivers/macab/macabdrv.map
deleted file mode 100755
index d953690f6b..0000000000
--- a/connectivity/source/drivers/macab/macabdrv.map
+++ /dev/null
@@ -1,6 +0,0 @@
-MACAB_1_0 {
- global:
- createMacabConnection;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/macab/makefile.mk b/connectivity/source/drivers/macab/makefile.mk
index 811f1fabb1..35532b15ec 100755
--- a/connectivity/source/drivers/macab/makefile.mk
+++ b/connectivity/source/drivers/macab/makefile.mk
@@ -54,8 +54,6 @@ DEPOBJFILES= \
# --- Library -----------------------------------
-SHL1VERSIONMAP=$(TARGET).map
-
SHL1TARGET= $(TARGET)$(MACAB_MAJOR)
SHL1OBJS=$(SLOFILES)
SHL1STDLIBS=\
@@ -98,8 +96,6 @@ MACAB_LIB=-framework Carbon -framework AddressBook
# --- Library -----------------------------------
-SHL2VERSIONMAP=$(TARGET2).map
-
SHL2TARGET= $(TARGET2)$(MACAB_MAJOR)
SHL2OBJS=$(SLO2FILES)
SHL2STDLIBS=\
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx
index 5e89ceec66..7c1deacce2 100644
--- a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx
+++ b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx
@@ -30,12 +30,6 @@
#include <MNSINIParser.hxx>
#include <rtl/byteseq.hxx>
-ini_Section * IniParser::getSection(OUString const & secName)
-{
- if (mAllSection.find(secName) != mAllSection.end())
- return &mAllSection[secName];
- return NULL;
-}
IniParser::IniParser(OUString const & rIniName) throw(com::sun::star::io::IOException )
{
OUString iniUrl;
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx
index 7b35aeec4a..7c2c5b88af 100644
--- a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx
+++ b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx
@@ -72,7 +72,6 @@ class IniParser
IniSectionMap mAllSection;
public:
IniSectionMap * getAllSection(){return &mAllSection;};
- ini_Section * getSection(OUString const & secName);
IniParser(OUString const & rIniName) throw(com::sun::star::io::IOException );
#if OSL_DEBUG_LEVEL > 0
void Dump();
diff --git a/connectivity/source/drivers/mozab/bootstrap/makefile.mk b/connectivity/source/drivers/mozab/bootstrap/makefile.mk
index 78c1e39578..6a4172da20 100644
--- a/connectivity/source/drivers/mozab/bootstrap/makefile.mk
+++ b/connectivity/source/drivers/mozab/bootstrap/makefile.mk
@@ -67,7 +67,7 @@ SLOFILES += \
CDEFS+=-DMINIMAL_PROFILEDISCOVER
SHL1TARGET=$(TARGET)
-SHL1VERSIONMAP= $(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1OBJS=$(SLOFILES)
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
diff --git a/connectivity/source/drivers/mozab/bootstrap/mozbootstrap.map b/connectivity/source/drivers/mozab/bootstrap/mozbootstrap.map
deleted file mode 100644
index 750db5d4af..0000000000
--- a/connectivity/source/drivers/mozab/bootstrap/mozbootstrap.map
+++ /dev/null
@@ -1,8 +0,0 @@
-MOZBOOTSTRAP_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/mozab/makefile.mk b/connectivity/source/drivers/mozab/makefile.mk
index ffcc41af75..b1e12fde6f 100644
--- a/connectivity/source/drivers/mozab/makefile.mk
+++ b/connectivity/source/drivers/mozab/makefile.mk
@@ -85,7 +85,7 @@ SLOFILES=\
# --- MOZAB BASE Library -----------------------------------
-SHL1VERSIONMAP= $(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1TARGET= $(TARGET)$(DLLPOSTFIX)
SHL1OBJS=$(SLOFILES)
SHL1STDLIBS=\
diff --git a/connectivity/source/drivers/mozab/mozab.map b/connectivity/source/drivers/mozab/mozab.map
deleted file mode 100644
index 9f3a1f27d0..0000000000
--- a/connectivity/source/drivers/mozab/mozab.map
+++ /dev/null
@@ -1,8 +0,0 @@
-MOZAB_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/mozab/mozabdrv.map b/connectivity/source/drivers/mozab/mozabdrv.map
index 918cb530e1..a431a07377 100644
--- a/connectivity/source/drivers/mozab/mozabdrv.map
+++ b/connectivity/source/drivers/mozab/mozabdrv.map
@@ -1,4 +1,4 @@
-MOZABDRV_1_0 {
+UDK_3_0_0 {
global:
OMozabConnection_CreateInstance;
OMozillaBootstrap_CreateInstance;
diff --git a/connectivity/source/drivers/mysql/YTable.cxx b/connectivity/source/drivers/mysql/YTable.cxx
index d89d502068..8b91207002 100644
--- a/connectivity/source/drivers/mysql/YTable.cxx
+++ b/connectivity/source/drivers/mysql/YTable.cxx
@@ -281,7 +281,7 @@ void SAL_CALL OMySQLTable::alterColumnByName( const ::rtl::OUString& colName, co
const ::rtl::OUString sQuote = getMetaData()->getIdentifierQuoteString( );
sSql += ::dbtools::quoteName(sQuote,colName);
sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" "));
- sSql += ::dbtools::createStandardColumnPart(descriptor,getConnection(),getTypeCreatePattern());
+ sSql += OTables::adjustSQL(::dbtools::createStandardColumnPart(descriptor,getConnection(),getTypeCreatePattern()));
executeStatement(sSql);
}
m_pColumns->refresh();
@@ -310,7 +310,7 @@ void OMySQLTable::alterColumnType(sal_Int32 nNewType,const ::rtl::OUString& _rCo
::comphelper::copyProperties(_xDescriptor,xProp);
xProp->setPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE),makeAny(nNewType));
- sSql += ::dbtools::createStandardColumnPart(xProp,getConnection(),getTypeCreatePattern());
+ sSql += OTables::adjustSQL(::dbtools::createStandardColumnPart(xProp,getConnection(),getTypeCreatePattern()));
executeStatement(sSql);
}
// -----------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/mysql/YTables.cxx b/connectivity/source/drivers/mysql/YTables.cxx
index 9cb1a1a688..d147a66793 100644
--- a/connectivity/source/drivers/mysql/YTables.cxx
+++ b/connectivity/source/drivers/mysql/YTables.cxx
@@ -184,12 +184,27 @@ void OTables::dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName)
}
}
// -------------------------------------------------------------------------
+::rtl::OUString OTables::adjustSQL(const ::rtl::OUString& _sSql)
+{
+ ::rtl::OUString sSQL = _sSql;
+ static const ::rtl::OUString s_sUNSIGNED(RTL_CONSTASCII_USTRINGPARAM("UNSIGNED"));
+ sal_Int32 nIndex = sSQL.indexOf(s_sUNSIGNED);
+ while(nIndex != -1 )
+ {
+ sal_Int32 nParen = sSQL.indexOf(')',nIndex);
+ sal_Int32 nPos = nIndex + s_sUNSIGNED.getLength();
+ ::rtl::OUString sNewUnsigned( sSQL.copy(nPos,nParen - nPos + 1));
+ sSQL = sSQL.replaceAt(nIndex,s_sUNSIGNED.getLength()+sNewUnsigned.getLength(),sNewUnsigned + s_sUNSIGNED);
+ nIndex = sSQL.indexOf(s_sUNSIGNED,nIndex + s_sUNSIGNED.getLength()+sNewUnsigned.getLength());
+ }
+ return sSQL;
+}
+// -------------------------------------------------------------------------
void OTables::createTable( const Reference< XPropertySet >& descriptor )
{
const Reference< XConnection > xConnection = static_cast<OMySQLCatalog&>(m_rParent).getConnection();
static const ::rtl::OUString s_sCreatePattern(RTL_CONSTASCII_USTRINGPARAM("(M,D)"));
- const ::rtl::OUString aSql = ::dbtools::createSqlCreateTableStatement(descriptor,xConnection,s_sCreatePattern);
-
+ const ::rtl::OUString aSql = adjustSQL(::dbtools::createSqlCreateTableStatement(descriptor,xConnection,s_sCreatePattern));
Reference< XStatement > xStmt = xConnection->createStatement( );
if ( xStmt.is() )
{
diff --git a/connectivity/source/drivers/mysql/makefile.mk b/connectivity/source/drivers/mysql/makefile.mk
index af486c2938..fbb68321cb 100644
--- a/connectivity/source/drivers/mysql/makefile.mk
+++ b/connectivity/source/drivers/mysql/makefile.mk
@@ -55,7 +55,7 @@ SLOFILES=\
$(SLO)$/YUsers.obj \
$(SLO)$/Yservices.obj
-SHL1VERSIONMAP=$(MYSQL_TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
# --- Library -----------------------------------
diff --git a/connectivity/source/drivers/mysql/mysql.map b/connectivity/source/drivers/mysql/mysql.map
deleted file mode 100644
index 834658431a..0000000000
--- a/connectivity/source/drivers/mysql/mysql.map
+++ /dev/null
@@ -1,8 +0,0 @@
-MYSQL_2_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/odbc/makefile.mk b/connectivity/source/drivers/odbc/makefile.mk
index 09052f9d77..508cbfb6df 100644
--- a/connectivity/source/drivers/odbc/makefile.mk
+++ b/connectivity/source/drivers/odbc/makefile.mk
@@ -71,7 +71,7 @@ SHL1IMPLIB= i$(ODBC_TARGET)
SHL1DEF= $(MISC)$/$(SHL1TARGET).def
DEF1NAME= $(SHL1TARGET)
-SHL1VERSIONMAP=odbc.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
# --- Targets ----------------------------------
diff --git a/connectivity/source/drivers/odbc/odbc.map b/connectivity/source/drivers/odbc/odbc.map
deleted file mode 100644
index 14e4b7110c..0000000000
--- a/connectivity/source/drivers/odbc/odbc.map
+++ /dev/null
@@ -1,8 +0,0 @@
-ODBC_3_0_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/odbcbase/OResultSet.cxx b/connectivity/source/drivers/odbcbase/OResultSet.cxx
index 09f32dc342..84d57eae9a 100644
--- a/connectivity/source/drivers/odbcbase/OResultSet.cxx
+++ b/connectivity/source/drivers/odbcbase/OResultSet.cxx
@@ -466,11 +466,9 @@ Sequence< sal_Int8 > SAL_CALL OResultSet::getBytes( sal_Int32 columnIndex ) thro
return nRet;
}
- ::std::map<sal_Int32,SWORD>::iterator aFind = m_aODBCColumnTypes.find(columnIndex);
- if ( aFind == m_aODBCColumnTypes.end() )
- aFind = m_aODBCColumnTypes.insert(::std::map<sal_Int32,SWORD>::value_type(columnIndex,OResultSetMetaData::getColumnODBCType(m_pStatement->getOwnConnection(),m_aStatementHandle,*this,columnIndex))).first;
+ const SWORD nColumnType = impl_getColumnType_nothrow(columnIndex);
- switch(aFind->second)
+ switch(nColumnType)
{
case SQL_WVARCHAR:
case SQL_WCHAR:
@@ -479,7 +477,7 @@ Sequence< sal_Int8 > SAL_CALL OResultSet::getBytes( sal_Int32 columnIndex ) thro
case SQL_CHAR:
case SQL_LONGVARCHAR:
{
- ::rtl::OUString aRet = OTools::getStringValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,aFind->second,m_bWasNull,**this,m_nTextEncoding);
+ ::rtl::OUString aRet = OTools::getStringValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,nColumnType,m_bWasNull,**this,m_nTextEncoding);
return Sequence<sal_Int8>(reinterpret_cast<const sal_Int8*>(aRet.getStr()),sizeof(sal_Unicode)*aRet.getLength());
}
default:
@@ -624,10 +622,8 @@ sal_Int16 SAL_CALL OResultSet::getShort( sal_Int32 columnIndex ) throw(SQLExcept
else
{
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
- ::std::map<sal_Int32,SWORD>::iterator aFind = m_aODBCColumnTypes.find(columnIndex);
- if ( aFind == m_aODBCColumnTypes.end() )
- aFind = m_aODBCColumnTypes.insert(::std::map<sal_Int32,SWORD>::value_type(columnIndex,OResultSetMetaData::getColumnODBCType(m_pStatement->getOwnConnection(),m_aStatementHandle,*this,columnIndex))).first;
- nRet = OTools::getStringValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,aFind->second,m_bWasNull,**this,m_nTextEncoding);
+ const SWORD nColumnType = impl_getColumnType_nothrow(columnIndex);
+ nRet = OTools::getStringValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,nColumnType,m_bWasNull,**this,m_nTextEncoding);
}
return nRet;
}
@@ -1502,10 +1498,8 @@ void OResultSet::fillRow(sal_Int32 _nToColumn)
case DataType::LONGVARCHAR:
case DataType::CLOB:
{
- ::std::map<sal_Int32,SWORD>::iterator aFind = m_aODBCColumnTypes.find(nColumn);
- if ( aFind == m_aODBCColumnTypes.end() )
- aFind = m_aODBCColumnTypes.insert(::std::map<sal_Int32,SWORD>::value_type(nColumn,OResultSetMetaData::getColumnODBCType(m_pStatement->getOwnConnection(),m_aStatementHandle,*this,nColumn))).first;
- *pColumn = OTools::getStringValue(m_pStatement->getOwnConnection(),m_aStatementHandle,nColumn,aFind->second,m_bWasNull,**this,m_nTextEncoding);
+ const SWORD nColumnType = impl_getColumnType_nothrow(nColumn);
+ *pColumn = OTools::getStringValue(m_pStatement->getOwnConnection(),m_aStatementHandle,nColumn,nColumnType,m_bWasNull,**this,m_nTextEncoding);
}
break;
case DataType::BIGINT:
@@ -1750,4 +1744,12 @@ void OResultSet::fillNeededData(SQLRETURN _nRet)
while (nRet == SQL_NEED_DATA);
}
}
+// -----------------------------------------------------------------------------
+SWORD OResultSet::impl_getColumnType_nothrow(sal_Int32 columnIndex)
+{
+ ::std::map<sal_Int32,SWORD>::iterator aFind = m_aODBCColumnTypes.find(columnIndex);
+ if ( aFind == m_aODBCColumnTypes.end() )
+ aFind = m_aODBCColumnTypes.insert(::std::map<sal_Int32,SWORD>::value_type(columnIndex,OResultSetMetaData::getColumnODBCType(m_pStatement->getOwnConnection(),m_aStatementHandle,*this,columnIndex))).first;
+ return aFind->second;
+}
diff --git a/connectivity/source/inc/mysql/YTables.hxx b/connectivity/source/inc/mysql/YTables.hxx
index 7900039aad..93c05658b0 100644
--- a/connectivity/source/inc/mysql/YTables.hxx
+++ b/connectivity/source/inc/mysql/YTables.hxx
@@ -71,6 +71,11 @@ namespace connectivity
can contain () which have to filled with values
*/
static ::rtl::OUString getTypeString(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxColProp);
+
+ /** convert the sql statement to fit MySQL notation
+ @param _sSql in/out
+ */
+ static ::rtl::OUString adjustSQL(const ::rtl::OUString& _sSql);
};
}
}
diff --git a/connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx b/connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx
index b6e53c22d5..7dddc9af81 100644
--- a/connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx
+++ b/connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx
@@ -97,7 +97,7 @@ namespace connectivity
sal_Int32 getFetchDirection() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
sal_Int32 getFetchSize() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
::rtl::OUString getCursorName() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- SWORD impl_getColumnType_nothrow(sal_Int32 column);
+ SWORD impl_getColumnType_nothrow(sal_Int32 columnIndex);
sal_Int32 mapColumn (sal_Int32 column);
diff --git a/connectivity/source/inc/odbc/OResultSet.hxx b/connectivity/source/inc/odbc/OResultSet.hxx
index 6fcf4a8263..a2b01c802e 100644
--- a/connectivity/source/inc/odbc/OResultSet.hxx
+++ b/connectivity/source/inc/odbc/OResultSet.hxx
@@ -173,6 +173,7 @@ namespace connectivity
sal_Bool moveImpl(IResultSetHelper::Movement _eCursorPosition, sal_Int32 _nOffset, sal_Bool _bRetrieveData);
TVoidPtr allocBindColumn(sal_Int32 _nType,sal_Int32 _nColumnIndex);
SQLRETURN unbind(sal_Bool _bUnbindHandle = sal_True);
+ SWORD impl_getColumnType_nothrow(sal_Int32 columnIndex);
// OPropertyArrayUsageHelper
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
diff --git a/connectivity/source/manager/makefile.mk b/connectivity/source/manager/makefile.mk
index e72dfc78bc..52ec191ec8 100644
--- a/connectivity/source/manager/makefile.mk
+++ b/connectivity/source/manager/makefile.mk
@@ -52,7 +52,7 @@ SLOFILES=\
SHL1TARGET= $(SDBC_TARGET)$(SDBC_MAJOR)
-SHL1VERSIONMAP=$(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1OBJS=$(SLOFILES)
SHL1STDLIBS=\
diff --git a/connectivity/source/manager/mdrivermanager.cxx b/connectivity/source/manager/mdrivermanager.cxx
index bd678ee210..353605e478 100644
--- a/connectivity/source/manager/mdrivermanager.cxx
+++ b/connectivity/source/manager/mdrivermanager.cxx
@@ -717,7 +717,7 @@ Reference< XDriver > OSDBCDriverManager::implGetDriverForURL(const ::rtl::OUStri
}
// found something?
- if ( m_aDriversBS.end() != aFind )
+ if ( m_aDriversBS.end() != aFind && aFind->xDriver.is() && aFind->xDriver->acceptsURL(_rURL) )
xReturn = aFind->xDriver;
}
diff --git a/connectivity/source/manager/sdbc.map b/connectivity/source/manager/sdbc.map
deleted file mode 100644
index 2d8534b22e..0000000000
--- a/connectivity/source/manager/sdbc.map
+++ /dev/null
@@ -1,8 +0,0 @@
-SDBC_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/parse/sqlflex.l b/connectivity/source/parse/sqlflex.l
index 77544ece30..275bd5b346 100644
--- a/connectivity/source/parse/sqlflex.l
+++ b/connectivity/source/parse/sqlflex.l
@@ -396,7 +396,7 @@ VAR_SAMP {SQL_NEW_KEYWORD(SQL_TOKEN_VAR_S
<SQL>\" { return gatherString('\"',0); }
<SQL>` { return gatherString('`' ,0); }
-<PREDICATE_GER,PREDICATE_ENG,DATE>"[" { return gatherString(']' ,0);}
+<PREDICATE_GER,PREDICATE_ENG,DATE,SQL>"[" { return gatherString(']' ,0);}
\' { return gatherString('\'',1); }
diff --git a/connectivity/util/langfilter.xsl b/connectivity/util/langfilter.xsl
deleted file mode 100755
index 76cfcff20a..0000000000
--- a/connectivity/util/langfilter.xsl
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version='1.0' encoding="UTF-8"?>
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:oor="http://openoffice.org/2001/registry">
-<xsl:output method="xml" indent="yes" omit-xml-declaration="no" version="1.0" encoding="UTF-8"/>
-<xsl:param name="lang"/>
-<xsl:template match="*">
- <xsl:if test="count(.//*[@xml:lang=$lang])&gt;0">
- <xsl:copy>
- <xsl:apply-templates select="*|@*"/>
- </xsl:copy>
- </xsl:if>
-</xsl:template>
-
-<xsl:template match="@*">
- <xsl:copy>
- <xsl:apply-templates select="*|@*"/>
- </xsl:copy>
-</xsl:template>
-
-<xsl:template match="value">
- <xsl:if test="@xml:lang=$lang">
- <xsl:copy>
- <xsl:apply-templates select="@*|text()"/>
- </xsl:copy>
- </xsl:if>
-</xsl:template>
-
-<xsl:template match="text()">
- <xsl:if test="../@xml:lang=$lang">
- <xsl:copy>
- <xsl:apply-templates select="@*|text()"/>
- </xsl:copy>
- </xsl:if>
-</xsl:template>
-
-
-</xsl:stylesheet>
-
diff --git a/connectivity/util/makefile.mk b/connectivity/util/makefile.mk
index 45d80fc049..d92fe00bba 100755
--- a/connectivity/util/makefile.mk
+++ b/connectivity/util/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -23,75 +23,40 @@
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
-#*************************************************************************
+#***********************************************************************/
-PRJ = ..
-TARGET = connectivity
+PRJ = ..
PRJNAME = connectivity
+TARGET = connectivity
-# -----------------------------------------------------------------------------
-# include global settings
-# -----------------------------------------------------------------------------
-
-.INCLUDE : settings.mk
-
-DIR_FILTERCFGOUT := $(MISC)$/drivers
-DIR_LANGPACK := $(DIR_FILTERCFGOUT)
-.IF "$(WITH_LANG)"!=""
-DIR_LANG_SOURCE := $(MISC)$/merge
-.ELSE
-DIR_LANG_SOURCE := $(MISC)$/registry$/data
-.ENDIF
-DRIVER_MERGE_XCU := $(shell -@$(FIND) $(DIR_LANG_SOURCE)$/org$/openoffice$/Office$/DataAccess -name "*.xcu")
-DRIVER_MERGE_DEST = $(MISC)/lang/{$(DRIVER_MERGE_XCU:f)}
-REALFILTERPACKAGES_FILTERS_UI_LANGPACKS = \
- $(foreach,i,$(alllangiso) $(foreach,j,$(DRIVER_MERGE_XCU) $(DIR_LANGPACK)$/$i$/org$/openoffice$/Office$/DataAccess$/$(j:f)))
-
-.INCLUDE: target.mk
+.INCLUDE : settings.mk
+.INCLUDE : target.mk
-PACKLANG := $(XSLTPROC) --nonet
-PACKLANG_IN :=
-PACKLANG_PARAM := --stringparam
-PACKLANG_XSL :=
-
-$(REALFILTERPACKAGES_FILTERS_UI_LANGPACKS) :
- @echo ===================================================================
- @echo Building language package for driver $(@:b:s/Filter_//)
- @echo ===================================================================
- +-$(MKDIRHIER) $(@:d)
- $(PACKLANG) $(PACKLANG_PARAM) lang $(@:d:d:d:d:d:d:d:d:d:d:b) $(PACKLANG_XSL) langfilter.xsl $(PACKLANG_IN) $(DIR_LANG_SOURCE)$/org$/openoffice$/Office$/DataAccess$/$(@:f) > $@
+# For any given platform, for each driver .xcu (in $(MY_XCUS)) built on that
+# platform (in $(MISC)/registry/data/org/openoffice/Office/DataAccess) there are
+# corresponding language-specific .xcu files (in
+# $(MISC)/registry/res/%/org/openoffice/Office/DataAccess). For each language,
+# all language-specific .xcu files for that language are assembled into
+# $(BIN)$/fcfg_drivers_%.zip. To meet the requirements of dmake percent rules,
+# the first item from $(MY_XCUS) is arbitrarily taken to be the main
+# prerequisite while all the items from $(MY_XCUS) are made into indirect
+# prerequisites (harmlessly doubling the first item).
-$(MISC)$/$(TARGET)_delzip :
- -$(RM) $(BIN)$/fcfg_drivers_{$(alllangiso)}.zip
+MY_XCUS := \
+ $(shell cd $(MISC)/registry/data/org/openoffice/Office/DataAccess && \
+ ls *.xcu)
-$(BIN)$/fcfg_drivers_{$(alllangiso)}.zip : $(REALFILTERPACKAGES_FILTERS_UI_LANGPACKS)
- cd $(DIR_FILTERCFGOUT)$/$(@:b:s/fcfg_drivers_//) && zip -ru ..$/..$/..$/bin$/fcfg_drivers_$(@:b:s/fcfg_drivers_//).zip org/*
-.IF "$(USE_SHELL)"!="4nt"
- $(PERL) -w $(SOLARENV)$/bin$/cleanzip.pl $@
-.ENDIF # "$(USE_SHELL)"!="4nt"
+.IF "$(MY_XCUS)" != ""
-ALLTAR: \
- $(MISC)$/$(TARGET)_delzip \
- $(BIN)$/fcfg_drivers_{$(alllangiso)}.zip \
- $(MISC)/lastlang.mk
+ALLTAR : $(BIN)/fcfg_drivers_{$(alllangiso)}.zip
-.IF "$(DRIVER_MERGE_DEST)"!=""
-.INCLUDE .IGNORE : $(MISC)/lastlang.mk
+$(BIN)/fcfg_drivers_{$(alllangiso)}.zip : \
+ $(MISC)/registry/res/$$(@:b:s/fcfg_drivers_//)/org/openoffice/Office/DataAccess/{$(MY_XCUS)}
-ALLTAR : \
- $(DRIVER_MERGE_DEST)
-
-.IF "$(LAST_LANGS)"!="$(WITH_LANG)"
-DO_PHONY=.PHONY
-.ENDIF # "$(LAST_LANG)"!="$(WITH_LANG)"
-
-$(MISC)/lang/%.xcu $(DO_PHONY) : $(DIR_LANG_SOURCE)$/org$/openoffice$/Office$/DataAccess/%.xcu
- @@-$(MKDIRHIER) $(@:d:d)
- $(COPY) $< $@
-
-.ENDIF # "$(DRIVER_MERGE_DEST)"!=""
-
-$(MISC)/lastlang.mk $(DO_PHONY) :
- $(RM) $@
- echo LAST_LANGS=$(WITH_LANG) > $@
+$(BIN)/fcfg_drivers_%.zip : \
+ $(MISC)/registry/res/%/org/openoffice/Office/DataAccess/$(MY_XCUS:1)
+ zip -j $@ \
+ $(foreach,i,$(MY_XCUS) \
+ $(MISC)/registry/res/$*/org/openoffice/Office/DataAccess/$i)
+.ENDIF
diff --git a/desktop/prj/build.lst b/desktop/prj/build.lst
index d9213aed12..9253b4e82b 100644
--- a/desktop/prj/build.lst
+++ b/desktop/prj/build.lst
@@ -1,4 +1,4 @@
-dt desktop : l10n sfx2 stoc BERKELEYDB:berkeleydb sysui SO:sysui_so BOOST:boost svx xmlhelp sal unoil officecfg NULL
+dt desktop : l10n sfx2 stoc BERKELEYDB:berkeleydb sysui SO:sysui_so BOOST:boost svx xmlhelp sal unoil officecfg configmgr NULL
dt desktop usr1 - all dt_mkout NULL
dt desktop\inc nmake - all dt_inc NULL
dt desktop\prj get - all dt_prj NULL
diff --git a/desktop/prj/d.lst b/desktop/prj/d.lst
index 5ec84bca7d..92a4853c2b 100644
--- a/desktop/prj/d.lst
+++ b/desktop/prj/d.lst
@@ -59,8 +59,8 @@ mkdir: %_DEST%\bin%_EXT%\odf4ms
..\%__SRC%\lib\liboffacc*.so %_DEST%\lib%_EXT%\liboffacc*.so
..\%__SRC%\lib\liboffacc*.dylib %_DEST%\lib%_EXT%\liboffacc*.dylib
..\%__SRC%\bin\migratio*.dll %_DEST%\bin%_EXT%\migratio*.dll
-..\%__SRC%\lib\migrationoo2.uno.so %_DEST%\lib%_EXT%\migrationoo2.uno.so
-..\%__SRC%\lib\migrationoo2.uno.dylib %_DEST%\lib%_EXT%\migrationoo2.uno.dylib
+..\%__SRC%\lib\migratio*.uno.so %_DEST%\lib%_EXT%\migratio*.uno.so
+..\%__SRC%\lib\migratio*.uno.dylib %_DEST%\lib%_EXT%\migratio*.uno.dylib
..\%__SRC%\bin\sweb %_DEST%\bin%_EXT%\sweb.bin
diff --git a/desktop/qa/deployment_misc/makefile.mk b/desktop/qa/deployment_misc/makefile.mk
index 556df1a623..15faef0dc4 100644
--- a/desktop/qa/deployment_misc/makefile.mk
+++ b/desktop/qa/deployment_misc/makefile.mk
@@ -34,6 +34,7 @@ ENABLE_EXCEPTIONS := TRUE
.INCLUDE: settings.mk
.INCLUDE: $(PRJ)$/source$/deployment$/inc$/dp_misc.mk
+CFLAGSCXX += $(CPPUNIT_CFLAGS)
DLLPRE = # no leading "lib" on .so files
SHL1TARGET = $(TARGET)
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 5d7e2c72ef..c716a10d1a 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1149,16 +1149,6 @@ USHORT Desktop::Exception(USHORT nError)
switch( nError & EXC_MAJORTYPE )
{
-/*
- case EXC_USER:
- if( nError == EXC_OUTOFMEMORY )
- {
- // not possible without a special NewHandler!
- String aMemExceptionString;
- Application::Abort( aMemExceptionString );
- }
- break;
-*/
case EXC_RSCNOTLOADED:
{
String aResExceptionString;
@@ -1175,23 +1165,14 @@ USHORT Desktop::Exception(USHORT nError)
default:
{
- if ( pArgs->IsNoRestore() ) {
- if (m_pLockfile != NULL) {
- m_pLockfile->clean();
- }
- _exit( ExitHelper::E_LOCKFILE );
+ if (m_pLockfile != NULL) {
+ m_pLockfile->clean();
}
-
if( bRestart )
{
OfficeIPCThread::DisableOfficeIPCThread();
if( pSignalHandler )
DELETEZ( pSignalHandler );
-
- if (m_pLockfile != NULL) {
- m_pLockfile->clean();
- }
-
#ifdef MACOSX
DoRestart();
#endif
@@ -1199,17 +1180,15 @@ USHORT Desktop::Exception(USHORT nError)
}
else
{
- bInException = sal_False;
- _exit( ExitHelper::E_CRASH );
+ Application::Abort( String() );
}
break;
}
}
+ OSL_ASSERT(false); // unreachable
return 0;
-
- // ConfigManager is disposed, so no way to continue
}
void Desktop::AppEvent( const ApplicationEvent& rAppEvent )
@@ -1579,7 +1558,8 @@ void Desktop::Main()
// SetSplashScreenProgress(80);
- if ( !bTerminateRequested && !pCmdLineArgs->IsInvisible() )
+ if ( !bTerminateRequested && !pCmdLineArgs->IsInvisible() &&
+ !pCmdLineArgs->IsNoQuickstart() )
InitializeQuickstartMode( xSMgr );
RTL_LOGFILE_CONTEXT( aLog2, "desktop (cd100003) createInstance com.sun.star.frame.Desktop" );
@@ -1666,7 +1646,11 @@ void Desktop::Main()
// remove temp directory
RemoveTemporaryDirectory();
+ // The acceptors in the AcceptorMap must be released (in DeregisterServices)
+ // with the solar mutex unlocked, to avoid deadlock:
+ nAcquireCount = Application::ReleaseSolarMutex();
DeregisterServices();
+ Application::AcquireSolarMutex(nAcquireCount);
tools::DeInitTestToolLib();
diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx
index c15ef44a4f..25798d913f 100644
--- a/desktop/source/app/appinit.cxx
+++ b/desktop/source/app/appinit.cxx
@@ -311,7 +311,6 @@ void Desktop::RegisterServices( Reference< XMultiServiceFactory >& xSMgr )
namespace
{
struct acceptorMap : public rtl::Static< AcceptorMap, acceptorMap > {};
- struct mtxAccMap : public rtl::Static< osl::Mutex, mtxAccMap > {};
struct CurrentTempURL : public rtl::Static< String, CurrentTempURL > {};
}
@@ -319,8 +318,6 @@ static sal_Bool bAccept = sal_False;
void Desktop::createAcceptor(const OUString& aAcceptString)
{
- // make sure nobody adds an acceptor whle we create one...
- osl::MutexGuard aGuard(mtxAccMap::get());
// check whether the requested acceptor already exists
AcceptorMap &rMap = acceptorMap::get();
AcceptorMap::const_iterator pIter = rMap.find(aAcceptString);
@@ -367,7 +364,6 @@ class enable
void Desktop::enableAcceptors()
{
RTL_LOGFILE_CONTEXT(aLog, "desktop (lo119109) Desktop::enableAcceptors");
- osl::MutexGuard aGuard(mtxAccMap::get());
if (!bAccept)
{
// from now on, all new acceptors are enabled
@@ -381,7 +377,6 @@ void Desktop::enableAcceptors()
void Desktop::destroyAcceptor(const OUString& aAcceptString)
{
- osl::MutexGuard aGuard(mtxAccMap::get());
// special case stop all acceptors
AcceptorMap &rMap = acceptorMap::get();
if (aAcceptString.compareToAscii("all") == 0) {
diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx
index 758d797fd4..c142c5f96a 100644
--- a/desktop/source/app/cmdlineargs.cxx
+++ b/desktop/source/app/cmdlineargs.cxx
@@ -227,7 +227,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
bViewEvent = sal_False;
bStartEvent = sal_False;
bDisplaySpec = sal_False;
- }
+ }
else if ( aArgStr.EqualsIgnoreCaseAscii( "-view" ))
{
// open in viewmode
@@ -239,31 +239,43 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
bViewEvent = sal_True;
bStartEvent = sal_False;
bDisplaySpec = sal_False;
- }
+ }
else if ( aArgStr.EqualsIgnoreCaseAscii( "-show" ))
{
- // open in viewmode
- bOpenEvent = sal_False;
- bViewEvent = sal_False;
- bStartEvent = sal_True;
- bPrintEvent = sal_False;
- bPrintToEvent = sal_False;
- bForceNewEvent = sal_False;
- bForceOpenEvent = sal_False;
- bDisplaySpec = sal_False;
+ // open in viewmode
+ bOpenEvent = sal_False;
+ bViewEvent = sal_False;
+ bStartEvent = sal_True;
+ bPrintEvent = sal_False;
+ bPrintToEvent = sal_False;
+ bForceNewEvent = sal_False;
+ bForceOpenEvent = sal_False;
+ bDisplaySpec = sal_False;
}
else if ( aArgStr.EqualsIgnoreCaseAscii( "-display" ))
{
- // open in viewmode
- bOpenEvent = sal_False;
- bPrintEvent = sal_False;
- bForceOpenEvent = sal_False;
- bPrintToEvent = sal_False;
- bForceNewEvent = sal_False;
- bViewEvent = sal_False;
- bStartEvent = sal_False;
- bDisplaySpec = sal_True;
+ // set display
+ bOpenEvent = sal_False;
+ bPrintEvent = sal_False;
+ bForceOpenEvent = sal_False;
+ bPrintToEvent = sal_False;
+ bForceNewEvent = sal_False;
+ bViewEvent = sal_False;
+ bStartEvent = sal_False;
+ bDisplaySpec = sal_True;
+ }
+ else if ( aArgStr.EqualsIgnoreCaseAscii( "-language" ))
+ {
+ bOpenEvent = sal_False;
+ bPrintEvent = sal_False;
+ bForceOpenEvent = sal_False;
+ bPrintToEvent = sal_False;
+ bForceNewEvent = sal_False;
+ bViewEvent = sal_False;
+ bStartEvent = sal_False;
+ bDisplaySpec = sal_False;
}
+
#ifdef MACOSX
/* #i84053# ignore -psn on Mac
Platform dependent #ifdef here is ugly, however this is currently
@@ -272,15 +284,15 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
*/
else if ( aArgStr.CompareToAscii( "-psn", 4 ) == COMPARE_EQUAL )
{
- // finder argument from MacOSX
- bOpenEvent = sal_False;
- bPrintEvent = sal_False;
- bForceOpenEvent = sal_False;
- bPrintToEvent = sal_False;
- bForceNewEvent = sal_False;
- bViewEvent = sal_False;
- bStartEvent = sal_False;
- bDisplaySpec = sal_False;
+ // finder argument from MacOSX
+ bOpenEvent = sal_False;
+ bPrintEvent = sal_False;
+ bForceOpenEvent = sal_False;
+ bPrintToEvent = sal_False;
+ bForceNewEvent = sal_False;
+ bViewEvent = sal_False;
+ bStartEvent = sal_False;
+ bDisplaySpec = sal_False;
}
#endif
}
@@ -387,6 +399,13 @@ sal_Bool CommandLineArgs::InterpretCommandLineParameter( const ::rtl::OUString&
#if defined(WNT) || defined(OS2) || defined(QUARTZ)
SetBoolParam_Impl( CMD_BOOLPARAM_QUICKSTART, sal_True );
#endif
+ SetBoolParam_Impl( CMD_BOOLPARAM_NOQUICKSTART, sal_False );
+ return sal_True;
+ }
+ else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-quickstart=no" )))
+ {
+ SetBoolParam_Impl( CMD_BOOLPARAM_NOQUICKSTART, sal_True );
+ SetBoolParam_Impl( CMD_BOOLPARAM_QUICKSTART, sal_False );
return sal_True;
}
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-terminate_after_init" )) == sal_True )
@@ -502,7 +521,12 @@ sal_Bool CommandLineArgs::InterpretCommandLineParameter( const ::rtl::OUString&
}
else if ( aArgStr.Copy(0, 9).EqualsIgnoreCaseAscii( "-version=" ))
{
- AddStringListParam_Impl( CMD_STRINGPARAM_VERSION, aArgStr.Copy( 15 ) );
+ AddStringListParam_Impl( CMD_STRINGPARAM_VERSION, aArgStr.Copy( 9 ) );
+ return sal_True;
+ }
+ else if ( aArgStr.Copy(0, 10).EqualsIgnoreCaseAscii( "-language=" ))
+ {
+ AddStringListParam_Impl( CMD_STRINGPARAM_LANGUAGE, aArgStr.Copy( 10 ) );
return sal_True;
}
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-writer" )) == sal_True )
@@ -645,6 +669,12 @@ sal_Bool CommandLineArgs::IsQuickstart() const
return m_aBoolParams[ CMD_BOOLPARAM_QUICKSTART ];
}
+sal_Bool CommandLineArgs::IsNoQuickstart() const
+{
+ osl::MutexGuard aMutexGuard( m_aMutex );
+ return m_aBoolParams[ CMD_BOOLPARAM_NOQUICKSTART ];
+}
+
sal_Bool CommandLineArgs::IsTerminateAfterInit() const
{
osl::MutexGuard aMutexGuard( m_aMutex );
@@ -845,6 +875,13 @@ sal_Bool CommandLineArgs::GetPrinterName( ::rtl::OUString& rPara ) const
return m_aStrSetParams[ CMD_STRINGPARAM_PRINTERNAME ];
}
+sal_Bool CommandLineArgs::GetLanguage( ::rtl::OUString& rPara ) const
+{
+ osl::MutexGuard aMutexGuard( m_aMutex );
+ rPara = m_aStrParams[ CMD_STRINGPARAM_LANGUAGE ];
+ return m_aStrSetParams[ CMD_STRINGPARAM_LANGUAGE ];
+}
+
sal_Bool CommandLineArgs::IsEmpty() const
{
osl::MutexGuard aMutexGuard( m_aMutex );
diff --git a/desktop/source/app/cmdlineargs.hxx b/desktop/source/app/cmdlineargs.hxx
index fda4ab77cb..569dd5ccbc 100644
--- a/desktop/source/app/cmdlineargs.hxx
+++ b/desktop/source/app/cmdlineargs.hxx
@@ -48,6 +48,7 @@ class CommandLineArgs
CMD_BOOLPARAM_SERVER,
CMD_BOOLPARAM_HEADLESS,
CMD_BOOLPARAM_QUICKSTART,
+ CMD_BOOLPARAM_NOQUICKSTART,
CMD_BOOLPARAM_TERMINATEAFTERINIT,
CMD_BOOLPARAM_NOFIRSTSTARTWIZARD,
CMD_BOOLPARAM_NOLOGO,
@@ -90,6 +91,7 @@ class CommandLineArgs
CMD_STRINGPARAM_PRINTTOLIST,
CMD_STRINGPARAM_PRINTERNAME,
CMD_STRINGPARAM_DISPLAY,
+ CMD_STRINGPARAM_LANGUAGE,
CMD_STRINGPARAM_COUNT // must be last element!
};
@@ -131,6 +133,7 @@ class CommandLineArgs
sal_Bool IsServer() const;
sal_Bool IsHeadless() const;
sal_Bool IsQuickstart() const;
+ sal_Bool IsNoQuickstart() const;
sal_Bool IsTerminateAfterInit() const;
sal_Bool IsNoFirstStartWizard() const;
sal_Bool IsNoLogo() const;
@@ -165,6 +168,7 @@ class CommandLineArgs
sal_Bool GetPrintList( ::rtl::OUString& rPara) const;
sal_Bool GetPrintToList( ::rtl::OUString& rPara ) const;
sal_Bool GetPrinterName( ::rtl::OUString& rPara ) const;
+ sal_Bool GetLanguage( ::rtl::OUString& rPara ) const;
// Special analyzed states (does not match directly to a command line parameter!)
sal_Bool IsPrinting() const;
diff --git a/desktop/source/app/copyright_ascii_ooo.c b/desktop/source/app/copyright_ascii_ooo.c
index 8d9d821e19..4224419e99 100644
--- a/desktop/source/app/copyright_ascii_ooo.c
+++ b/desktop/source/app/copyright_ascii_ooo.c
@@ -5,12 +5,6 @@
*/
extern const char copyright_text_1[];
-extern const char copyright_text_2[];
-extern const char copyright_text_21[];
-extern const char copyright_text_22[];
-const char copyright_text_1[] = "Copyright © 2010 Sun Microsystems, Inc., All rights reserved.";
-const char copyright_text_2[] = "Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product that is described in this document. In particular, and without limitation, these intellectual property rights may include one or more of the U.S. patents listed at http://www.sun.com/patents and one or more additional patents or pending patent applications in the U.S. and in other countries.";
-const char copyright_text_21[] = "Copyright © 2010 Sun Microsystems, Tous droits réservés.";
-const char copyright_text_22[] = "Sun Microsystems, Inc. a les droits de propriété intellectuels relatants à la technologie incorporée dans ce produit. En particulier, et sans la limitation, ces droits de propriété intellectuels peuvent inclure un ou plus des brevets américains énumérés à http://www.sun.com/patents et un ou les brevets plus supplémentaires ou les applications de brevet en attente dans les États - Unis et les autres pays.";
+const char copyright_text_1[] = "Copyright © 2000, 2010 Oracle and/or its affiliates, All rights reserved.";
diff --git a/desktop/source/app/copyright_ascii_sun.c b/desktop/source/app/copyright_ascii_sun.c
index 3d437af856..f9950118e8 100644
--- a/desktop/source/app/copyright_ascii_sun.c
+++ b/desktop/source/app/copyright_ascii_sun.c
@@ -4,17 +4,5 @@
*
*/
-const char copyright_text_1[] = "Copyright © 2010 Sun Microsystems, Inc., All rights reserved.";
-const char copyright_text_2[] = "Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product that is described in this document. In particular, and without limitation, these intellectual property rights may include one or more of the U.S. patents listed at http://www.sun.com/patents and one or more additional patents or pending patent applications in the U.S. and in other countries.";
-const char copyright_text_3[] = "U.S. Government Rights - Commercial software. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements. Use is subject to license terms.";
-const char copyright_text_4[] = "This distribution may include materials developed by third parties.Sun, Sun Microsystems, the Sun logo, Java, Solaris and StarOffice are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the U.S. and other countries.";
-const char copyright_text_5[] = "UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open Company, Ltd.";
-const char copyright_text_21[] = "Copyright © 2010 Sun Microsystems, Tous droits réservés.";
-const char copyright_text_22[] = "Sun Microsystems, Inc. a les droits de propriété intellectuels relatants à la technologie incorporée dans ce produit. En particulier, et sans la limitation, ces droits de propriété intellectuels peuvent inclure un ou plus des brevets américains énumérés à http://www.sun.com/patents et un ou les brevets plus supplémentaires ou les applications de brevet en attente dans les États - Unis et les autres pays.";
-const char copyright_text_23[] = "Ce produit ou document est protégé par un copyright et distribué avec des licences qui en restreignent l'utilisation, la copie, la distribution, et la décompilation. Aucune partie de ce produit ou document ne peut être reproduite sous aucune forme, par quelque moyen que ce soit, sans l'autorisation préalable et écrite de Sun et de ses bailleurs de licence, s'il y ena.";
-const char copyright_text_24[] = "L'utilisation est soumise aux termes du contrat de licence.";
-const char copyright_text_25[] = "Cette distribution peut comprendre des composants développés par des tierces parties.";
-const char copyright_text_26[] = "Sun, Sun Microsystems, le logo Sun, Java, Solaris et StarOffice sont des marques de fabrique ou des marques déposées de Sun Microsystems, Inc. aux Etats-Unis et dans d'autres pay";
-const char copyright_text_27[] = "Toutes les marques SPARC sont utilisées sous licence et sont des marques de fabrique ou des marques déposées de SPARC International, Inc. aux Etats-Unis et dans d'autres pay";
-const char copyright_text_28[] = "UNIX est une marque déposée aux Etats-Unis et dans d'autres pays et licenciée exlusivement par X/Open Company, Ltd.";
+const char copyright_text_1[] = "Copyright © 2000, 2010 Oracle and/or its affiliates, All rights reserved.";
diff --git a/desktop/source/app/desktop.src b/desktop/source/app/desktop.src
index f172efb309..e333c44181 100644
--- a/desktop/source/app/desktop.src
+++ b/desktop/source/app/desktop.src
@@ -209,7 +209,7 @@ InfoBox INFOBOX_EXPIRED
{
Buttons = WB_OK ;
DefButton = WB_DEF_OK ;
- Message [ en-US ] = "This Evaluation Version has expired. To find out more about %PRODUCTNAME,\nvisit www.sun.com/%PRODUCTNAME.";
+ Message [ en-US ] = "This Evaluation Version has expired. To find out more about %PRODUCTNAME,\nvisit http://www.oracle.com/us/products/applications/open-office.";
};
String STR_TITLE_EXPIRED
diff --git a/desktop/source/app/langselect.cxx b/desktop/source/app/langselect.cxx
index 62b3c89922..f5cdc3e307 100644
--- a/desktop/source/app/langselect.cxx
+++ b/desktop/source/app/langselect.cxx
@@ -30,15 +30,14 @@
#include "app.hxx"
#include "langselect.hxx"
+#include "cmdlineargs.hxx"
#include <stdio.h>
-#ifndef _RTL_STRING_HXX
#include <rtl/string.hxx>
-#endif
-#ifndef _SVTOOLS_PATHOPTIONS_HXX
+#include <rtl/bootstrap.hxx>
#include <unotools/pathoptions.hxx>
-#endif
#include <tools/resid.hxx>
+#include <tools/config.hxx>
#include <i18npool/mslangid.hxx>
#include <comphelper/processfactory.hxx>
#include <com/sun/star/container/XNameAccess.hpp>
@@ -52,6 +51,7 @@
#include <rtl/locale.hxx>
#include <rtl/instance.hxx>
#include <osl/process.h>
+#include <osl/file.hxx>
using namespace rtl;
using namespace com::sun::star::uno;
@@ -62,10 +62,54 @@ using namespace com::sun::star::util;
namespace desktop {
+static char const SOFFICE_BOOTSTRAP[] = "Bootstrap";
+static char const SOFFICE_STARTLANG[] = "STARTLANG";
sal_Bool LanguageSelection::bFoundLanguage = sal_False;
OUString LanguageSelection::aFoundLanguage;
const OUString LanguageSelection::usFallbackLanguage = OUString::createFromAscii("en-US");
+
+static sal_Bool existsURL( OUString const& sURL )
+{
+ using namespace osl;
+ DirectoryItem aDirItem;
+
+ if (sURL.getLength() != 0)
+ return ( DirectoryItem::get( sURL, aDirItem ) == DirectoryItem::E_None );
+
+ return sal_False;
+}
+
+// locate soffice.ini/.rc file
+static OUString locateSofficeIniFile()
+{
+ OUString aUserDataPath;
+ OUString aSofficeIniFileURL;
+
+ // Retrieve the default file URL for the soffice.ini/rc
+ rtl::Bootstrap().getIniName( aSofficeIniFileURL );
+
+ if ( utl::Bootstrap::locateUserData( aUserDataPath ) == utl::Bootstrap::PATH_EXISTS )
+ {
+ const char CONFIG_DIR[] = "/config";
+
+ sal_Int32 nIndex = aSofficeIniFileURL.lastIndexOf( '/');
+ if ( nIndex > 0 )
+ {
+ OUString aUserSofficeIniFileURL;
+ OUStringBuffer aBuffer( aUserDataPath );
+ aBuffer.appendAscii( CONFIG_DIR );
+ aBuffer.append( aSofficeIniFileURL.copy( nIndex ));
+ aUserSofficeIniFileURL = aBuffer.makeStringAndClear();
+
+ if ( existsURL( aUserSofficeIniFileURL ))
+ return aUserSofficeIniFileURL;
+ }
+ }
+ // Fallback try to use the soffice.ini/rc from program folder
+ return aSofficeIniFileURL;
+}
+
Locale LanguageSelection::IsoStringToLocale(const OUString& str)
{
Locale l;
@@ -119,8 +163,51 @@ bool LanguageSelection::prepareLanguage()
catch (Exception&)
{
}
+
// get the selected UI language as string
- OUString aLocaleString = getLanguageString();
+ bool bCmdLanguage( false );
+ bool bIniLanguage( false );
+ OUString aEmpty;
+ OUString aLocaleString = getUserUILanguage();
+
+ if ( aLocaleString.getLength() == 0 )
+ {
+ CommandLineArgs* pCmdLineArgs = Desktop::GetCommandLineArgs();
+ if ( pCmdLineArgs )
+ {
+ pCmdLineArgs->GetLanguage(aLocaleString);
+ if (isInstalledLanguage(aLocaleString, sal_False))
+ {
+ bCmdLanguage = true;
+ bFoundLanguage = true;
+ aFoundLanguage = aLocaleString;
+ }
+ else
+ aLocaleString = aEmpty;
+ }
+
+ if ( !bCmdLanguage )
+ {
+ OUString aSOfficeIniURL = locateSofficeIniFile();
+ Config aConfig(aSOfficeIniURL);
+ aConfig.SetGroup( SOFFICE_BOOTSTRAP );
+ OString sLang = aConfig.ReadKey( SOFFICE_STARTLANG );
+ aLocaleString = OUString( sLang.getStr(), sLang.getLength(), RTL_TEXTENCODING_ASCII_US );
+ if (isInstalledLanguage(aLocaleString, sal_False))
+ {
+ bIniLanguage = true;
+ bFoundLanguage = true;
+ aFoundLanguage = aLocaleString;
+ }
+ else
+ aLocaleString = aEmpty;
+ }
+ }
+
+ // user further fallbacks for the UI language
+ if ( aLocaleString.getLength() == 0 )
+ aLocaleString = getLanguageString();
+
if ( aLocaleString.getLength() > 0 )
{
try
@@ -137,9 +224,21 @@ bool LanguageSelection::prepareLanguage()
theConfigProvider->setLocale(loc);
Reference< XPropertySet > xProp(getConfigAccess("org.openoffice.Setup/L10N/", sal_True), UNO_QUERY_THROW);
- xProp->setPropertyValue(OUString::createFromAscii("ooLocale"), makeAny(aLocaleString));
- Reference< XChangesBatch >(xProp, UNO_QUERY_THROW)->commitChanges();
-
+ if ( !bCmdLanguage )
+ {
+ // Store language only
+ xProp->setPropertyValue(OUString::createFromAscii("ooLocale"), makeAny(aLocaleString));
+ Reference< XChangesBatch >(xProp, UNO_QUERY_THROW)->commitChanges();
+ }
+
+ if ( bIniLanguage )
+ {
+ // Store language only
+ Reference< XPropertySet > xProp2(getConfigAccess("org.openoffice.Office.Linguistic/General/", sal_True), UNO_QUERY_THROW);
+ xProp2->setPropertyValue(OUString::createFromAscii("UILocale"), makeAny(aLocaleString));
+ Reference< XChangesBatch >(xProp2, UNO_QUERY_THROW)->commitChanges();
+ }
+
MsLangId::setConfiguredSystemUILanguage( MsLangId::convertLocaleToLanguage(loc) );
OUString sLocale;
@@ -165,7 +264,7 @@ bool LanguageSelection::prepareLanguage()
}
}
-
+
// #i32939# setting of default document locale
// #i32939# this should not be based on the UI language
setDefaultLanguage(aLocaleString);
@@ -197,11 +296,8 @@ void LanguageSelection::setDefaultLanguage(const OUString& sLocale)
}
}
-OUString LanguageSelection::getLanguageString()
+OUString LanguageSelection::getUserUILanguage()
{
- // did we already find a language?
- if (bFoundLanguage)
- return aFoundLanguage;
// check whether the user has selected a specific language
OUString aUserLanguage = getUserLanguage();
if (aUserLanguage.getLength() > 0 )
@@ -219,6 +315,21 @@ OUString LanguageSelection::getLanguageString()
resetUserLanguage();
}
}
+
+ return aUserLanguage;
+}
+
+OUString LanguageSelection::getLanguageString()
+{
+ // did we already find a language?
+ if (bFoundLanguage)
+ return aFoundLanguage;
+
+ // check whether the user has selected a specific language
+ OUString aUserLanguage = getUserUILanguage();
+ if (aUserLanguage.getLength() > 0 )
+ return aUserLanguage ;
+
// try to use system default
aUserLanguage = getSystemLanguage();
if (aUserLanguage.getLength() > 0 )
diff --git a/desktop/source/app/langselect.hxx b/desktop/source/app/langselect.hxx
index 8d94b28b32..536bff8928 100644
--- a/desktop/source/app/langselect.hxx
+++ b/desktop/source/app/langselect.hxx
@@ -50,6 +50,7 @@ private:
static com::sun::star::uno::Sequence< rtl::OUString > getInstalledLanguages();
static sal_Bool isInstalledLanguage(rtl::OUString& usLocale, sal_Bool bExact=sal_False);
static rtl::OUString getFirstInstalledLanguage();
+ static rtl::OUString getUserUILanguage();
static rtl::OUString getUserLanguage();
static rtl::OUString getSystemLanguage();
static void resetUserLanguage();
diff --git a/desktop/source/app/userinstall.cxx b/desktop/source/app/userinstall.cxx
index 1aa2b7fa36..f72d13834e 100644
--- a/desktop/source/app/userinstall.cxx
+++ b/desktop/source/app/userinstall.cxx
@@ -243,7 +243,7 @@ namespace desktop {
return UserInstall::E_InvalidBaseinstall;
// create the user directory
- FileBase::RC rc = Directory::create(aUserPath);
+ FileBase::RC rc = Directory::createPath(aUserPath);
if ((rc != FileBase::E_None) && (rc != FileBase::E_EXIST)) return UserInstall::E_Creation;
// copy data from shared data directory of base installation
diff --git a/desktop/source/app/version.map b/desktop/source/app/version.map
index e2d9026465..ad52c57cc1 100644
--- a/desktop/source/app/version.map
+++ b/desktop/source/app/version.map
@@ -25,7 +25,7 @@
#
#*************************************************************************
-soffice.3 {
+UDK_3_0_0 {
global:
soffice_main;
diff --git a/desktop/source/deployment/deployment.map b/desktop/source/deployment/deployment.map
deleted file mode 100644
index 563b3d86a5..0000000000
--- a/desktop/source/deployment/deployment.map
+++ /dev/null
@@ -1,8 +0,0 @@
-UDK_3_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
index 8f79fc5820..2a0cef61b8 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
@@ -90,8 +90,7 @@ using ::rtl::OUString;
namespace dp_gui {
-#define ICON_OFFSET 50
-#define TOP_OFFSET 3
+#define TOP_OFFSET 5
#define LINE_SIZE 4
#define PROGRESS_WIDTH 60
#define PROGRESS_HEIGHT 14
diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
index 2852e67e7d..e974d7ab21 100644
--- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -520,10 +520,10 @@ void ExtensionBox_Impl::DrawRow( const Rectangle& rRect, const TEntry_Impl pEntr
else
aImage = isHCMode() ? pEntry->m_aIconHC : pEntry->m_aIcon;
Size aImageSize = aImage.GetSizePixel();
- if ( ( aImageSize.Width() <= ICON_HEIGHT ) && ( aImageSize.Height() <= ICON_HEIGHT ) )
- DrawImage( Point( aPos.X()+((ICON_HEIGHT-aImageSize.Width())/2), aPos.Y()+((ICON_HEIGHT-aImageSize.Height())/2) ), aImage );
+ if ( ( aImageSize.Width() <= ICON_WIDTH ) && ( aImageSize.Height() <= ICON_HEIGHT ) )
+ DrawImage( Point( aPos.X()+((ICON_WIDTH-aImageSize.Width())/2), aPos.Y()+((ICON_HEIGHT-aImageSize.Height())/2) ), aImage );
else
- DrawImage( aPos, Size( ICON_HEIGHT, ICON_HEIGHT ), aImage );
+ DrawImage( aPos, Size( ICON_WIDTH, ICON_HEIGHT ), aImage );
// Setup fonts
Font aStdFont( GetFont() );
diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.hxx b/desktop/source/deployment/gui/dp_gui_extlistbox.hxx
index 2749db99ce..18f9844349 100644
--- a/desktop/source/deployment/gui/dp_gui_extlistbox.hxx
+++ b/desktop/source/deployment/gui/dp_gui_extlistbox.hxx
@@ -45,9 +45,10 @@
namespace dp_gui {
#define SMALL_ICON_SIZE 16
-#define TOP_OFFSET 3
+#define TOP_OFFSET 5
#define ICON_HEIGHT 42
-#define ICON_OFFSET 50
+#define ICON_WIDTH 47
+#define ICON_OFFSET 72
#define RIGHT_ICON_OFFSET 5
#define SPACE_BETWEEN 3
diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
index aa1f0654c7..6a98aed677 100644
--- a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
+++ b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
@@ -67,14 +67,6 @@ TheExtensionManager::TheExtensionManager( Window *pParent,
m_pExtMgrDialog( NULL ),
m_pUpdReqDialog( NULL )
{
- if ( dp_misc::office_is_running() )
- {
- m_xDesktop.set( xContext->getServiceManager()->createInstanceWithContext(
- OUSTR("com.sun.star.frame.Desktop"), xContext ), uno::UNO_QUERY );
- if ( m_xDesktop.is() )
- m_xDesktop->addTerminateListener( this );
- }
-
m_sPackageManagers.realloc(2);
m_sPackageManagers[0] = deployment::thePackageManagerFactory::get( m_xContext )->getPackageManager( OUSTR("user") );
m_sPackageManagers[1] = deployment::thePackageManagerFactory::get( m_xContext )->getPackageManager( OUSTR("shared") );;
@@ -110,6 +102,16 @@ TheExtensionManager::TheExtensionManager( Window *pParent,
}
catch ( uno::Exception& )
{}
+
+ if ( dp_misc::office_is_running() )
+ {
+ // the registration should be done after the construction has been ended
+ // otherwise an exception prevents object creation, but it is registered as a listener
+ m_xDesktop.set( xContext->getServiceManager()->createInstanceWithContext(
+ OUSTR("com.sun.star.frame.Desktop"), xContext ), uno::UNO_QUERY );
+ if ( m_xDesktop.is() )
+ m_xDesktop->addTerminateListener( this );
+ }
}
//------------------------------------------------------------------------------
diff --git a/desktop/source/deployment/gui/makefile.mk b/desktop/source/deployment/gui/makefile.mk
index b55ad49421..6a9c7b6bbb 100644
--- a/desktop/source/deployment/gui/makefile.mk
+++ b/desktop/source/deployment/gui/makefile.mk
@@ -60,7 +60,7 @@ SLOFILES = \
$(SLO)$/descedit.obj
SHL1TARGET = $(TARGET)$(DLLPOSTFIX).uno
-SHL1VERSIONMAP = ..$/deployment.map
+SHL1VERSIONMAP = $(SOLARENV)/src/component.map
SHL1STDLIBS = \
$(SALLIB) \
diff --git a/desktop/source/deployment/inc/dp_descriptioninfoset.hxx b/desktop/source/deployment/inc/dp_descriptioninfoset.hxx
index cd964761da..80c46df937 100644
--- a/desktop/source/deployment/inc/dp_descriptioninfoset.hxx
+++ b/desktop/source/deployment/inc/dp_descriptioninfoset.hxx
@@ -53,6 +53,15 @@ namespace rtl { class OUString; }
namespace dp_misc {
+struct DESKTOP_DEPLOYMENTMISC_DLLPUBLIC SimpleLicenseAttributes
+{
+ ::rtl::OUString acceptBy;
+ //Attribute suppress-on-update. Default is false.
+ bool suppressOnUpdate;
+ //Attribute suppress-if-required. Default is false.
+ bool suppressIfRequired;
+};
+
/**
Access to the content of an XML <code>description</code> element.
@@ -132,6 +141,13 @@ public:
*/
::rtl::OUString getLocalizedLicenseURL() const;
+ /** returns the attributes of the simple-license element
+
+ As long as there is a simple-license element, the function will return
+ the structure. If it does not exist, then the optional object is uninitialized.
+ */
+ ::boost::optional<SimpleLicenseAttributes> getSimpleLicenseAttributes() const;
+
/** returns the localized display name of the extensions.
In case there is no localized display-name then an empty string is returned.
diff --git a/desktop/source/deployment/makefile.mk b/desktop/source/deployment/makefile.mk
index 412535e00e..7eda0f582e 100644
--- a/desktop/source/deployment/makefile.mk
+++ b/desktop/source/deployment/makefile.mk
@@ -49,7 +49,7 @@ INCPRE += inc
DLLPRE =
SHL1TARGET = $(TARGET)$(DLLPOSTFIX).uno
-SHL1VERSIONMAP = deployment.map
+SHL1VERSIONMAP = $(SOLARENV)/src/component.map
SHL1LIBS = \
$(SLB)$/deployment_manager.lib \
@@ -80,7 +80,8 @@ SHL1STDLIBS = \
$(SVLLIB) \
$(UNOTOOLSLIB) \
$(DEPLOYMENTMISCLIB) \
- $(HELPLINKERLIB)
+ $(HELPLINKERLIB) \
+ $(CONFIGMGRLIB)
SHL1DEPN =
SHL1IMPLIB = i$(TARGET)
diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx
index 1f36256308..6418e5c32c 100644
--- a/desktop/source/deployment/manager/dp_manager.cxx
+++ b/desktop/source/deployment/manager/dp_manager.cxx
@@ -310,19 +310,7 @@ Reference<deployment::XPackageManager> PackageManagerImpl::create(
that->m_readOnly = true;
}
}
-
- //Workaround. See issue http://www.openoffice.org/issues/show_bug.cgi?id=99257
- //This prevents the copying of the common.rdbf and native rdbs. It disables the
- //feature to add shared extensions in a running office.
- if (!that->m_readOnly && context.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("shared") ))
- {
- OUString sNoRdb;
- ::rtl::Bootstrap::get(OUSTR("NORDBCOPY"), sNoRdb);
- if (sNoRdb.equalsIgnoreAsciiCase(OUSTR("true"))
- && dp_misc::office_is_running())
- that->m_readOnly = true;
- }
-
+
if (!that->m_readOnly && logFile.getLength() > 0)
{
const Any any_logFile(logFile);
diff --git a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx
index 1ecb757d07..73df2b0168 100644
--- a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx
+++ b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx
@@ -370,6 +370,50 @@ css::uno::Sequence< ::rtl::OUString > DescriptionInfoset::getUrls(
}
+::boost::optional<SimpleLicenseAttributes>
+DescriptionInfoset::getSimpleLicenseAttributes() const
+{
+ //Check if the node exist
+ css::uno::Reference< css::xml::dom::XNode > n;
+ if (m_element.is()) {
+ try {
+ n = m_xpath->selectSingleNode(m_element,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "/desc:description/desc:registration/desc:simple-license/@accept-by")));
+ } catch (css::xml::xpath::XPathException &) {
+ // ignore
+ }
+ if (n.is())
+ {
+ SimpleLicenseAttributes attributes;
+ attributes.acceptBy =
+ getNodeValueFromExpression(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "/desc:description/desc:registration/desc:simple-license/@accept-by")));
+
+ ::boost::optional< ::rtl::OUString > suppressOnUpdate = getOptionalValue(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "/desc:description/desc:registration/desc:simple-license/@suppress-on-update")));
+ if (suppressOnUpdate)
+ attributes.suppressOnUpdate = (*suppressOnUpdate).trim().equalsIgnoreAsciiCase(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("true")));
+ else
+ attributes.suppressOnUpdate = false;
+
+ ::boost::optional< ::rtl::OUString > suppressIfRequired = getOptionalValue(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "/desc:description/desc:registration/desc:simple-license/@suppress-if-required")));
+ if (suppressIfRequired)
+ attributes.suppressIfRequired = (*suppressIfRequired).trim().equalsIgnoreAsciiCase(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("true")));
+ else
+ attributes.suppressIfRequired = false;
+
+ return ::boost::optional<SimpleLicenseAttributes>(attributes);
+ }
+ }
+ return ::boost::optional<SimpleLicenseAttributes>();
+}
+
::rtl::OUString DescriptionInfoset::getLocalizedDescriptionURL() const
{
return getLocalizedHREFAttrFromChild(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
diff --git a/desktop/source/deployment/registry/component/dp_component.cxx b/desktop/source/deployment/registry/component/dp_component.cxx
index ef2de2c280..a143a88096 100644
--- a/desktop/source/deployment/registry/component/dp_component.cxx
+++ b/desktop/source/deployment/registry/component/dp_component.cxx
@@ -122,7 +122,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
Reference<XComponentContext> m_xRemoteContext;
enum reg {
- REG_UNINIT, REG_VOID, REG_REGISTERED, REG_NOT_REGISTERED
+ REG_UNINIT, REG_VOID, REG_REGISTERED, REG_NOT_REGISTERED, REG_MAYBE_REGISTERED
} m_registered;
Reference<loader::XImplementationLoader> getComponentInfo(
@@ -144,6 +144,10 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
const Reference<registry::XSimpleRegistry> getRDB() const;
+ //Provides the read-only registry (e.g. not the one based on the duplicated
+ //rdb files
+ const Reference<registry::XSimpleRegistry> getRDB_RO() const;
+
public:
inline ComponentPackageImpl(
::rtl::Reference<PackageRegistryBackend> const & myBackend,
@@ -221,8 +225,21 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
OUString m_commonRDB;
OUString m_nativeRDB;
+
+ //URLs of the read-only rdbs (e.g. not the ones of the duplicated files)
+ OUString m_commonRDB_RO;
+ OUString m_nativeRDB_RO;
+
+ //These rdbs are for writing new service entries. The rdb files are copies
+ //which are created when services are added or removed.
Reference<registry::XSimpleRegistry> m_xCommonRDB;
Reference<registry::XSimpleRegistry> m_xNativeRDB;
+
+ //These rdbs are created on the read-only rdbs which are already used
+ //by UNO since the startup of the current session.
+ Reference<registry::XSimpleRegistry> m_xCommonRDB_RO;
+ Reference<registry::XSimpleRegistry> m_xNativeRDB_RO;
+
void unorc_verify_init( Reference<XCommandEnvironment> const & xCmdEnv );
void unorc_flush( Reference<XCommandEnvironment> const & xCmdEnv );
@@ -252,6 +269,9 @@ public:
//Will be called from ComponentPackageImpl
void initServiceRdbFiles();
+
+ //Creates the READ ONLY registries (m_xCommonRDB_RO,m_xNativeRDB_RO)
+ void initServiceRdbFiles_RO();
};
//______________________________________________________________________________
@@ -259,12 +279,12 @@ const Reference<registry::XSimpleRegistry>
BackendImpl::ComponentPackageImpl::getRDB() const
{
BackendImpl * that = getMyBackend();
+
//Late "initialization" of the services rdb files
//This is to prevent problems when running several
//instances of OOo with root rights in parallel. This
//would otherwise cause problems when copying the rdbs.
- //Now this code is only performed if isRegistered or processPackage
- //is called.
+ //See http://qa.openoffice.org/issues/show_bug.cgi?id=99257
{
const ::osl::MutexGuard guard( getMutex() );
if (!that->bSwitchedRdbFiles)
@@ -273,7 +293,6 @@ BackendImpl::ComponentPackageImpl::getRDB() const
that->initServiceRdbFiles();
}
}
-
if (m_loader.equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM("com.sun.star.loader.SharedLibrary") ))
return that->m_xNativeRDB;
@@ -281,6 +300,19 @@ BackendImpl::ComponentPackageImpl::getRDB() const
return that->m_xCommonRDB;
}
+//Returns the read only RDB.
+const Reference<registry::XSimpleRegistry>
+BackendImpl::ComponentPackageImpl::getRDB_RO() const
+{
+ BackendImpl * that = getMyBackend();
+
+ if (m_loader.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("com.sun.star.loader.SharedLibrary") ))
+ return that->m_xNativeRDB_RO;
+ else
+ return that->m_xCommonRDB_RO;
+}
+
BackendImpl * BackendImpl::ComponentPackageImpl::getMyBackend() const
{
BackendImpl * pBackend = static_cast<BackendImpl *>(m_myBackend.get());
@@ -342,20 +374,22 @@ void BackendImpl::disposing()
void BackendImpl::initServiceRdbFiles()
{
const Reference<XCommandEnvironment> xCmdEnv;
- if (! m_readOnly) {
+ if (! m_readOnly)
+ {
::ucbhelper::Content cacheDir( getCachePath(), xCmdEnv );
::ucbhelper::Content oldRDB;
// switch common rdb:
- if (m_commonRDB.getLength() > 0)
+ if (m_commonRDB_RO.getLength() > 0)
+ {
create_ucb_content(
- &oldRDB, makeURL( getCachePath(), m_commonRDB ),
- xCmdEnv, false /* no throw */ );
- m_commonRDB = m_commonRDB.equalsAsciiL(
+ &oldRDB, makeURL( getCachePath(), m_commonRDB_RO),
+ xCmdEnv, false /* no throw */ );
+ }
+ m_commonRDB = m_commonRDB_RO.equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM("common.rdb") )
- ? OUSTR("common_.rdb") : OUSTR("common.rdb");
+ ? OUSTR("common_.rdb") : OUSTR("common.rdb");
if (oldRDB.get().is())
{
-
if (! cacheDir.transferContent(
oldRDB, ::ucbhelper::InsertOperation_COPY,
m_commonRDB, NameClash::OVERWRITE ))
@@ -367,13 +401,15 @@ void BackendImpl::initServiceRdbFiles()
oldRDB = ::ucbhelper::Content();
}
// switch native rdb:
- if (m_nativeRDB.getLength() > 0)
+ if (m_nativeRDB_RO.getLength() > 0)
+ {
create_ucb_content(
- &oldRDB, makeURL( getCachePath(), m_nativeRDB ),
- xCmdEnv, false /* no throw */ );
+ &oldRDB, makeURL(getCachePath(), m_nativeRDB_RO),
+ xCmdEnv, false /* no throw */ );
+ }
const OUString plt_rdb( getPlatformString() + OUSTR(".rdb") );
const OUString plt_rdb_( getPlatformString() + OUSTR("_.rdb") );
- m_nativeRDB = m_nativeRDB.equals( plt_rdb ) ? plt_rdb_ : plt_rdb;
+ m_nativeRDB = m_nativeRDB_RO.equals( plt_rdb ) ? plt_rdb_ : plt_rdb;
if (oldRDB.get().is())
{
if (! cacheDir.transferContent(
@@ -411,6 +447,37 @@ void BackendImpl::initServiceRdbFiles()
}
}
+void BackendImpl::initServiceRdbFiles_RO()
+{
+ const Reference<XCommandEnvironment> xCmdEnv;
+
+ // common rdb for java, native rdb for shared lib components
+ if (m_commonRDB_RO.getLength() > 0)
+ {
+ m_xCommonRDB_RO.set(
+ m_xComponentContext->getServiceManager()
+ ->createInstanceWithContext(
+ OUSTR("com.sun.star.registry.SimpleRegistry"),
+ m_xComponentContext), UNO_QUERY_THROW);
+ m_xCommonRDB_RO->open(
+ makeURL(expandUnoRcUrl(getCachePath()), m_commonRDB_RO),
+ sal_True, //read-only
+ sal_True); // create data source if necessary
+ }
+ if (m_nativeRDB_RO.getLength() > 0)
+ {
+ m_xNativeRDB_RO.set(
+ m_xComponentContext->getServiceManager()
+ ->createInstanceWithContext(
+ OUSTR("com.sun.star.registry.SimpleRegistry"),
+ m_xComponentContext), UNO_QUERY_THROW);
+ m_xNativeRDB_RO->open(
+ makeURL(expandUnoRcUrl(getCachePath()), m_nativeRDB_RO),
+ sal_True, //read-only
+ sal_True); // create data source if necessary
+ }
+}
+
//______________________________________________________________________________
BackendImpl::BackendImpl(
Sequence<Any> const & args,
@@ -489,7 +556,12 @@ BackendImpl::BackendImpl(
}
else
{
+ //do this before initServiceRdbFiles_RO, because it determines
+ //m_commonRDB and m_nativeRDB
unorc_verify_init( xCmdEnv );
+
+ initServiceRdbFiles_RO();
+
}
}
@@ -684,7 +756,7 @@ void BackendImpl::unorc_verify_init(
sal_Int32 start = sizeof ("UNO_SERVICES=?$ORIGIN/") - 1;
sal_Int32 sep = line.indexOf( ' ', start );
OSL_ASSERT( sep > 0 );
- m_commonRDB = line.copy( start, sep - start );
+ m_commonRDB_RO = line.copy( start, sep - start );
}
// native rc:
@@ -694,7 +766,7 @@ void BackendImpl::unorc_verify_init(
xCmdEnv, false /* no throw */ )) {
if (readLine( &line, OUSTR("UNO_SERVICES="), ucb_content,
RTL_TEXTENCODING_UTF8 )) {
- m_nativeRDB = line.copy(
+ m_nativeRDB_RO = line.copy(
sizeof ("UNO_SERVICES=?$ORIGIN/") - 1 );
}
}
@@ -760,12 +832,19 @@ void BackendImpl::unorc_flush( Reference<XCommandEnvironment> const & xCmdEnv )
}
buf.append(LF);
}
- if (m_commonRDB.getLength() > 0 || m_nativeRDB.getLength() > 0)
+
+ // If we duplicated the common or native rdb then we must use those urls
+ //otherwise we use those of the original files. That is, m_commonRDB_RO and
+ //m_nativeRDB_RO;
+ OUString sCommonRDB(m_commonRDB.getLength() > 0 ? m_commonRDB : m_commonRDB_RO);
+ OUString sNativeRDB(m_nativeRDB.getLength() > 0 ? m_nativeRDB : m_nativeRDB_RO);
+
+ if (sCommonRDB.getLength() > 0 || sNativeRDB.getLength() > 0)
{
buf.append( RTL_CONSTASCII_STRINGPARAM("UNO_SERVICES=?$ORIGIN/") );
buf.append( ::rtl::OUStringToOString(
- m_commonRDB, RTL_TEXTENCODING_ASCII_US ) );
- if (m_nativeRDB.getLength() > 0)
+ sCommonRDB, RTL_TEXTENCODING_ASCII_US ) );
+ if (sNativeRDB.getLength() > 0)
{
buf.append( RTL_CONSTASCII_STRINGPARAM(
" ${$ORIGIN/${_OS}_${_ARCH}rc:UNO_SERVICES}") );
@@ -775,7 +854,7 @@ void BackendImpl::unorc_flush( Reference<XCommandEnvironment> const & xCmdEnv )
::rtl::OStringBuffer buf2;
buf2.append( RTL_CONSTASCII_STRINGPARAM("UNO_SERVICES=?$ORIGIN/") );
buf2.append( ::rtl::OUStringToOString(
- m_nativeRDB, RTL_TEXTENCODING_ASCII_US ) );
+ sNativeRDB, RTL_TEXTENCODING_ASCII_US ) );
buf2.append(LF);
const Reference<io::XInputStream> xData(
@@ -1023,7 +1102,8 @@ BackendImpl::ComponentPackageImpl::isRegistered_(
if (m_registered == REG_UNINIT)
{
m_registered = REG_NOT_REGISTERED;
- const Reference<registry::XSimpleRegistry> xRDB( getRDB() );
+ bool bAmbiguousComponentName = false;
+ const Reference<registry::XSimpleRegistry> xRDB( getRDB_RO() );
if (xRDB.is())
{
// lookup rdb for location URL:
@@ -1043,21 +1123,51 @@ BackendImpl::ComponentPackageImpl::isRegistered_(
pImplNames[ pos ] + OUSTR("/UNO/LOCATION") );
const Reference<registry::XRegistryKey> xKey(
xRootKey->openKey(key) );
- if (xKey.is() && xKey->isValid()) {
+ if (xKey.is() && xKey->isValid())
+ {
const OUString location( xKey->getAsciiValue() );
if (location.equalsIgnoreAsciiCase( getURL() ))
+ {
break;
+ }
+ else
+ {
+ //try to match only the file name
+ OUString thisUrl(getURL());
+ OUString thisFileName(thisUrl.copy(thisUrl.lastIndexOf('/')));
+
+ OUString locationFileName(location.copy(location.lastIndexOf('/')));
+ if (locationFileName.equalsIgnoreAsciiCase(thisFileName))
+ bAmbiguousComponentName = true;
+ }
}
}
if (pos >= 0)
m_registered = REG_REGISTERED;
+ else if (bAmbiguousComponentName)
+ m_registered = REG_MAYBE_REGISTERED;
}
}
+
+ //Different extensions can use the same service implementations. Then the extensions
+ //which was installed last will overwrite the one from the other extension. That is
+ //the registry will contain the path (the location) of the library or jar of the
+ //second extension. In this case isRegistered called for the lib of the first extension
+ //would return "not registered". That would mean that during uninstallation
+ //XPackage::registerPackage is not called, because it just was not registered. This is,
+ //however, necessary for jar files. Registering and unregistering update
+ //uno_packages/cache/registry/com.sun.star.comp.deployment.component.PackageRegistryBackend/unorc
+ //Therefore, we will return always "is ambiguous" if the path of this component cannot
+ //be found in the registry and if there is another path and both have the same file name (but
+ //the rest of the path is different).
+ //If the caller cannot precisely determine that this package was registered, then it must
+ //call registerPackage.
+ sal_Bool bAmbiguous = m_registered == REG_VOID // REG_VOID == we are in the progress of unregistration
+ || m_registered == REG_MAYBE_REGISTERED;
return beans::Optional< beans::Ambiguous<sal_Bool> >(
true /* IsPresent */,
beans::Ambiguous<sal_Bool>(
- m_registered == REG_REGISTERED,
- m_registered == REG_VOID /* IsAmbiguous */ ) );
+ m_registered == REG_REGISTERED, bAmbiguous) );
}
//______________________________________________________________________________
@@ -1068,6 +1178,8 @@ void BackendImpl::ComponentPackageImpl::processPackage_(
Reference<XCommandEnvironment> const & xCmdEnv )
{
BackendImpl * that = getMyBackend();
+
+
const bool java = m_loader.equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM("com.sun.star.loader.Java2") );
const OUString url( getURL() );
@@ -1075,10 +1187,7 @@ void BackendImpl::ComponentPackageImpl::processPackage_(
!jarManifestHeaderPresent( url, OUSTR("UNO-Type-Path"), xCmdEnv );
if (doRegisterPackage)
- {
- if (isJavaTypelib)
- that->addToUnoRc( java, url, xCmdEnv );
-
+ {
if (! m_xRemoteContext.is()) {
m_xRemoteContext.set(
that->getObject( url ), UNO_QUERY );
@@ -1096,8 +1205,13 @@ void BackendImpl::ComponentPackageImpl::processPackage_(
m_xRemoteContext->getServiceManager()->createInstanceWithContext(
OUSTR("com.sun.star.registry.ImplementationRegistration"),
m_xRemoteContext ), UNO_QUERY_THROW );
+
xImplReg->registerImplementation( m_loader, url, xServicesRDB );
-
+ //only write to unorc if registration was successful.
+ //It may fail if there is no suitable java.
+ if (isJavaTypelib)
+ that->addToUnoRc( java, url, xCmdEnv );
+
t_stringlist implNames;
t_stringpairvec singletons;
const Reference<loader::XImplementationLoader> xLoader(
diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx
index bed2e6e58a..cef5d488f6 100644
--- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx
+++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx
@@ -28,6 +28,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_desktop.hxx"
+//TODO: Large parts of this file were copied from dp_component.cxx; those parts
+// should be consolidated.
+
#include "dp_configuration.hrc"
#include "dp_backend.h"
#include "dp_persmap.h"
@@ -38,16 +41,18 @@
#include "rtl/uri.hxx"
#include "rtl/memory.h"
#include "osl/file.hxx"
+#include "cppuhelper/exc_hlp.hxx"
#include "ucbhelper/content.hxx"
#include "comphelper/anytostring.hxx"
#include "comphelper/servicedecl.hxx"
+#include "configmgr/update.hxx"
#include "xmlscript/xml_helper.hxx"
#include "svl/inettype.hxx"
#include "com/sun/star/ucb/NameClash.hpp"
#include "com/sun/star/io/XActiveDataSink.hpp"
#include "com/sun/star/lang/WrappedTargetRuntimeException.hpp"
#include "com/sun/star/util/XRefreshable.hpp"
-#include "com/sun/star/configuration/backend/XLayerImporter.hpp"
+#include <list>
#include <memory>
@@ -62,6 +67,8 @@ namespace backend {
namespace configuration {
namespace {
+typedef ::std::list<OUString> t_stringlist;
+
//==============================================================================
class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
{
@@ -95,27 +102,39 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
};
friend class PackageImpl;
- Reference< ::com::sun::star::configuration::backend::XLayerImporter >
- m_xMergeImporter;
- OUString m_configLayer;
+ t_stringlist m_xcs_files;
+ t_stringlist m_xcu_files;
+ t_stringlist & getFiles( bool xcs ) {
+ return xcs ? m_xcs_files : m_xcu_files;
+ }
+
+ bool m_configmgrini_inited;
+ bool m_configmgrini_modified;
// PackageRegistryBackend
virtual Reference<deployment::XPackage> bindPackage_(
OUString const & url, OUString const & mediaType,
Reference<XCommandEnvironment> const & xCmdEnv );
- void xcu_merge_in( OUString const & url,
- Reference< XCommandEnvironment > const & xCmdEnv );
- void xcs_merge_in( OUString const & url,
- Reference< XCommandEnvironment > const & xCmdEnv );
::std::auto_ptr<PersistentMap> m_registeredPackages;
- OUString const & getConfigLayer();
- Reference<util::XRefreshable> m_defaultProvider;
+ // for backwards compatibility
+ virtual void SAL_CALL disposing();
+
const Reference<deployment::XPackageTypeInfo> m_xConfDataTypeInfo;
const Reference<deployment::XPackageTypeInfo> m_xConfSchemaTypeInfo;
Sequence< Reference<deployment::XPackageTypeInfo> > m_typeInfos;
+ void configmgrini_verify_init(
+ Reference<XCommandEnvironment> const & xCmdEnv );
+ void configmgrini_flush( Reference<XCommandEnvironment> const & xCmdEnv );
+
+ bool addToConfigmgrIni( bool isSchema, OUString const & url,
+ Reference<XCommandEnvironment> const & xCmdEnv );
+ bool removeFromConfigmgrIni( bool isSchema, OUString const & url,
+ Reference<XCommandEnvironment> const & xCmdEnv );
+ bool hasInConfigmgrIni( bool isSchema, OUString const & url );
+
public:
BackendImpl( Sequence<Any> const & args,
Reference<XComponentContext> const & xComponentContext );
@@ -123,17 +142,36 @@ public:
// XPackageRegistry
virtual Sequence< Reference<deployment::XPackageTypeInfo> > SAL_CALL
getSupportedPackageTypes() throw (RuntimeException);
+
+ using PackageRegistryBackend::disposing;
};
//______________________________________________________________________________
+void BackendImpl::disposing()
+{
+ try {
+ configmgrini_flush( Reference<XCommandEnvironment>() );
+
+ PackageRegistryBackend::disposing();
+ }
+ catch (RuntimeException &) {
+ throw;
+ }
+ catch (Exception &) {
+ Any exc( ::cppu::getCaughtException() );
+ throw lang::WrappedTargetRuntimeException(
+ OUSTR("caught unexpected exception while disposing..."),
+ static_cast<OWeakObject *>(this), exc );
+ }
+}
+
+//______________________________________________________________________________
BackendImpl::BackendImpl(
Sequence<Any> const & args,
Reference<XComponentContext> const & xComponentContext )
: PackageRegistryBackend( args, xComponentContext ),
- m_defaultProvider( xComponentContext->getValueByName(
- OUSTR("/singletons/com.sun.star."
- "configuration.theDefaultProvider") ),
- UNO_QUERY ),
+ m_configmgrini_inited( false ),
+ m_configmgrini_modified( false ),
m_xConfDataTypeInfo( new Package::TypeInfo(
OUSTR("application/"
"vnd.sun.star.configuration-data"),
@@ -151,19 +189,17 @@ BackendImpl::BackendImpl(
m_typeInfos[ 0 ] = m_xConfDataTypeInfo;
m_typeInfos[ 1 ] = m_xConfSchemaTypeInfo;
- OSL_ASSERT( m_defaultProvider.is() );
+ const Reference<XCommandEnvironment> xCmdEnv;
if (transientMode()) {
- m_registeredPackages.reset( new PersistentMap );
+ //TODO
}
else {
+ configmgrini_verify_init( xCmdEnv );
m_registeredPackages.reset(
new PersistentMap(
makeURL( getCachePath(), OUSTR("registered_packages.db") ),
m_readOnly ) );
- if (! m_readOnly)
- create_folder( 0, getConfigLayer(),
- Reference<XCommandEnvironment>() );
}
}
@@ -236,103 +272,253 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
static_cast<sal_Int16>(-1) );
}
+//##############################################################################
+
//______________________________________________________________________________
-OUString const & BackendImpl::getConfigLayer()
+void BackendImpl::configmgrini_verify_init(
+ Reference<XCommandEnvironment> const & xCmdEnv )
{
- if (m_configLayer.getLength() == 0)
+ if (transientMode())
+ return;
+ const ::osl::MutexGuard guard( getMutex() );
+ if (! m_configmgrini_inited)
{
- OUString path(
- makeURL( expandUnoRcUrl( getCachePath() ), OUSTR("registry") ) );
- ::osl::FileBase::RC rc = ::osl::File::getAbsoluteFileURL(
- OUString(), path, m_configLayer );
- if (rc != ::osl::FileBase::E_None)
- throw RuntimeException(
- OUSTR("making file URL absolute failed: ") + path,
- static_cast<OWeakObject *>(this) );
+ // common rc:
+ ::ucbhelper::Content ucb_content;
+ if (create_ucb_content(
+ &ucb_content,
+ makeURL( getCachePath(), OUSTR("configmgr.ini") ),
+ xCmdEnv, false /* no throw */ ))
+ {
+ OUString line;
+ if (readLine( &line, OUSTR("SCHEMA="), ucb_content,
+ RTL_TEXTENCODING_UTF8 ))
+ {
+ sal_Int32 index = sizeof ("SCHEMA=") - 1;
+ do {
+ OUString token( line.getToken( 0, ' ', index ).trim() );
+ if (token.getLength() > 0) {
+ // cleanup, check if existing:
+ if (create_ucb_content(
+ 0, expandUnoRcTerm(token), xCmdEnv,
+ false /* no throw */ )) {
+ m_xcs_files.push_back( token );
+ }
+ else
+ OSL_ENSURE(
+ 0, "### invalid SCHEMA entry!" );
+ }
+ }
+ while (index >= 0);
+ }
+ if (readLine( &line, OUSTR("DATA="), ucb_content,
+ RTL_TEXTENCODING_UTF8 )) {
+ sal_Int32 index = sizeof ("DATA=") - 1;
+ do {
+ OUString token( line.getToken( 0, ' ', index ).trim() );
+ if (token.getLength() > 0) {
+ if (token[ 0 ] == '?')
+ token = token.copy( 1 );
+ // cleanup, check if existing:
+ if (create_ucb_content(
+ 0, expandUnoRcTerm(token),
+ xCmdEnv, false /* no throw */ )) {
+ m_xcu_files.push_back( token );
+ }
+ else
+ OSL_ENSURE( 0, "### invalid DATA entry!" );
+ }
+ }
+ while (index >= 0);
+ }
+ }
+ m_configmgrini_modified = false;
+ m_configmgrini_inited = true;
}
- return m_configLayer;
}
-//==============================================================================
-class SchemaFileRoot : public ::dp_misc::XmlRootElement
+//______________________________________________________________________________
+void BackendImpl::configmgrini_flush(
+ Reference<XCommandEnvironment> const & xCmdEnv )
{
-public:
- OUString m_name;
- OUString m_package;
+ if (transientMode())
+ return;
+ if (!m_configmgrini_inited || !m_configmgrini_modified)
+ return;
- inline SchemaFileRoot()
- : XmlRootElement( OUSTR("http://openoffice.org/2001/registry"),
- OUSTR("component-schema") )
- {}
+ ::rtl::OStringBuffer buf;
+ // UNO_USER_PACKAGES_CACHE, UNO_SHARED_PACKAGES_CACHE have to be resolved
+ // locally:
+ if (m_eContext == CONTEXT_USER) {
+ buf.append( RTL_CONSTASCII_STRINGPARAM(
+ "UNO_USER_PACKAGES_CACHE=$ORIGIN/../..") );
+ }
+ else if (m_eContext == CONTEXT_SHARED) {
+ buf.append( RTL_CONSTASCII_STRINGPARAM(
+ "UNO_SHARED_PACKAGES_CACHE=$ORIGIN/../..") );
+ }
+ else
+ OSL_ASSERT(0);
+ buf.append(LF);
- // XRoot
- virtual Reference< xml::input::XElement > SAL_CALL startRootElement(
- sal_Int32 uid, OUString const & localname,
- Reference< xml::input::XAttributes > const & xAttributes )
- throw (xml::sax::SAXException, RuntimeException);
-};
+ if (! m_xcs_files.empty())
+ {
+ t_stringlist::const_iterator iPos( m_xcs_files.begin() );
+ t_stringlist::const_iterator const iEnd( m_xcs_files.end() );
+ buf.append( RTL_CONSTASCII_STRINGPARAM("SCHEMA=") );
+ while (iPos != iEnd) {
+ // encoded ASCII file-urls:
+ const ::rtl::OString item(
+ ::rtl::OUStringToOString( *iPos, RTL_TEXTENCODING_ASCII_US ) );
+ buf.append( item );
+ ++iPos;
+ if (iPos != iEnd)
+ buf.append( ' ' );
+ }
+ buf.append(LF);
+ }
+ if (! m_xcu_files.empty())
+ {
+ t_stringlist::const_iterator iPos( m_xcu_files.begin() );
+ t_stringlist::const_iterator const iEnd( m_xcu_files.end() );
+ buf.append( RTL_CONSTASCII_STRINGPARAM("DATA=") );
+ while (iPos != iEnd) {
+ // encoded ASCII file-urls:
+ const ::rtl::OString item(
+ ::rtl::OUStringToOString( *iPos, RTL_TEXTENCODING_ASCII_US ) );
+ buf.append( item );
+ ++iPos;
+ if (iPos != iEnd)
+ buf.append( ' ' );
+ }
+ buf.append(LF);
+ }
+
+ // write configmgr.ini:
+ const Reference<io::XInputStream> xData(
+ ::xmlscript::createInputStream(
+ ::rtl::ByteSequence(
+ reinterpret_cast<sal_Int8 const *>(buf.getStr()),
+ buf.getLength() ) ) );
+ ::ucbhelper::Content ucb_content(
+ makeURL( getCachePath(), OUSTR("configmgr.ini") ), xCmdEnv );
+ ucb_content.writeStream( xData, true /* replace existing */ );
+
+ m_configmgrini_modified = false;
+}
+
+//------------------------------------------------------------------------------
+inline OUString makeRcTerm( OUString const & url )
+{
+ OSL_ASSERT( url.matchAsciiL( RTL_CONSTASCII_STRINGPARAM(
+ "vnd.sun.star.expand:") ) );
+ if (url.matchAsciiL( RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.expand:") )) {
+ // cut protocol:
+ OUString rcterm( url.copy( sizeof ("vnd.sun.star.expand:") - 1 ) );
+ // decode uric class chars:
+ rcterm = ::rtl::Uri::decode(
+ rcterm, rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 );
+ return rcterm;
+ }
+ else
+ return url;
+}
//______________________________________________________________________________
-Reference< xml::input::XElement > SchemaFileRoot::startRootElement(
- sal_Int32 uid, OUString const & localname,
- Reference< xml::input::XAttributes > const & xAttributes )
- throw (xml::sax::SAXException, RuntimeException)
+bool BackendImpl::addToConfigmgrIni( bool isSchema, OUString const & url_,
+ Reference<XCommandEnvironment> const & xCmdEnv )
{
- // check root element:
- XmlRootElement::startRootElement( uid, localname, xAttributes );
-
- // "name" attribute
- m_name = xAttributes->getValueByUidName( getUid(), OUSTR("name") );
- if (m_name.getLength() == 0)
- throw xml::sax::SAXException(
- OUSTR("missing schema name attribute!"),
- static_cast< OWeakObject * >(this), Any() );
-
- // "package" attribute
- m_package = xAttributes->getValueByUidName( getUid(), OUSTR("package") );
- if (m_package.getLength() == 0)
- throw xml::sax::SAXException(
- OUSTR("missing schema package attribute!"),
- static_cast<OWeakObject *>(this), Any() );
-
- // don't go deeper...
- return Reference<xml::input::XElement>();
+ const OUString rcterm( makeRcTerm(url_) );
+ const ::osl::MutexGuard guard( getMutex() );
+ configmgrini_verify_init( xCmdEnv );
+ t_stringlist & rSet = getFiles(isSchema);
+ if (::std::find( rSet.begin(), rSet.end(), rcterm ) == rSet.end()) {
+ rSet.push_front( rcterm ); // prepend to list, thus overriding
+ // write immediately:
+ m_configmgrini_modified = true;
+ configmgrini_flush( xCmdEnv );
+ return true;
+ }
+ else
+ return false;
}
//______________________________________________________________________________
-void BackendImpl::xcs_merge_in(
- OUString const & url,
+bool BackendImpl::removeFromConfigmgrIni(
+ bool isSchema, OUString const & url_,
Reference<XCommandEnvironment> const & xCmdEnv )
{
- // parse out schema package:
- SchemaFileRoot * root = new SchemaFileRoot;
- Reference<xml::input::XRoot> xRoot( root );
- ::ucbhelper::Content ucb_content( url, xCmdEnv );
- xml_parse( xRoot, ucb_content, getComponentContext() );
-
- OUString dest_folder(
- makeURL( getConfigLayer(), OUSTR("schema/") + ::rtl::Uri::encode(
- root->m_package, rtl_UriCharClassPchar,
- rtl_UriEncodeIgnoreEscapes,
- RTL_TEXTENCODING_UTF8 ).replace( '.', '/' ) ) );
- OUString title( root->m_name + OUSTR(".xcs") );
- OUString dest_url( makeURL( dest_folder, ::rtl::Uri::encode(
- title, rtl_UriCharClassPchar,
- rtl_UriEncodeIgnoreEscapes,
- RTL_TEXTENCODING_UTF8 ) ) );
- // assure dest folder is existing:
- ::ucbhelper::Content ucb_dest_folder;
- create_folder( &ucb_dest_folder, dest_folder, xCmdEnv );
- if (! ucb_dest_folder.transferContent(
- ::ucbhelper::Content( url, xCmdEnv ),
- ::ucbhelper::InsertOperation_COPY,
- title, NameClash::OVERWRITE ))
- throw RuntimeException(
- OUSTR("::ucb::Content::transferContent() failed!"), 0 );
+ const OUString rcterm( makeRcTerm(url_) );
+ const ::osl::MutexGuard guard( getMutex() );
+ configmgrini_verify_init( xCmdEnv );
+ t_stringlist & rSet = getFiles(isSchema);
+ t_stringlist::iterator i(std::find(rSet.begin(), rSet.end(), rcterm));
+ if (i == rSet.end() && !isSchema) { //TODO: see replaceOrigin()
+ i = std::find(
+ rSet.begin(), rSet.end(),
+ rcterm + OUString(RTL_CONSTASCII_USTRINGPARAM(".mod")));
+ }
+ if (i == rSet.end()) {
+ return false;
+ }
+ rSet.erase(i);
+ // write immediately:
+ m_configmgrini_modified = true;
+ configmgrini_flush( xCmdEnv );
+ return true;
+}
+
+//______________________________________________________________________________
+bool BackendImpl::hasInConfigmgrIni(
+ bool isSchema, OUString const & url_ )
+{
+ const OUString rcterm( makeRcTerm(url_) );
+ const ::osl::MutexGuard guard( getMutex() );
+ t_stringlist const & rSet = getFiles(isSchema);
+ return ::std::find( rSet.begin(), rSet.end(), rcterm ) != rSet.end()
+ || (!isSchema && //TODO: see replaceOrigin()
+ ::std::find(
+ rSet.begin(), rSet.end(),
+ rcterm + OUString(RTL_CONSTASCII_USTRINGPARAM(".mod"))) !=
+ rSet.end());
}
//##############################################################################
+// Package
+//______________________________________________________________________________
+BackendImpl * BackendImpl::PackageImpl::getMyBackend() const
+{
+ BackendImpl * pBackend = static_cast<BackendImpl *>(m_myBackend.get());
+ if (NULL == pBackend)
+ {
+ //May throw a DisposedException
+ check();
+ //We should never get here...
+ throw RuntimeException(
+ OUSTR("Failed to get the BackendImpl"),
+ static_cast<OWeakObject*>(const_cast<PackageImpl *>(this)));
+ }
+ return pBackend;
+}
+
+beans::Optional< beans::Ambiguous<sal_Bool> >
+BackendImpl::PackageImpl::isRegistered_(
+ ::osl::ResettableMutexGuard &,
+ ::rtl::Reference<AbortChannel> const &,
+ Reference<XCommandEnvironment> const & )
+{
+ BackendImpl * that = getMyBackend();
+ rtl::OUString url(getURL());
+ return beans::Optional< beans::Ambiguous<sal_Bool> >(
+ true /* IsPresent */,
+ beans::Ambiguous<sal_Bool>(
+ that->hasInConfigmgrIni( m_isSchema, url ) ||
+ that->m_registeredPackages->has(
+ rtl::OUStringToOString( url, RTL_TEXTENCODING_UTF8 ) ),
+ false /* IsAmbiguous */ ) );
+}
+
//------------------------------------------------------------------------------
OUString encodeForXml( OUString const & text )
{
@@ -367,7 +553,7 @@ OUString encodeForXml( OUString const & text )
}
//______________________________________________________________________________
-void BackendImpl::xcu_merge_in(
+OUString replaceOrigin(
OUString const & url, Reference< XCommandEnvironment > const & xCmdEnv )
{
// looking for %origin%:
@@ -434,199 +620,70 @@ void BackendImpl::xcu_merge_in(
rtl_copyMemory( filtered.getArray() + write_pos, pAdd, nAdd );
write_pos += nAdd;
}
- if (use_filtered && write_pos < filtered.getLength())
+ if (!use_filtered)
+ return url;
+ if (write_pos < filtered.getLength())
filtered.realloc( write_pos );
-
- Reference<XComponentContext> const & xContext = getComponentContext();
- if (! m_xMergeImporter.is()) {
- m_xMergeImporter.set(
- xContext->getServiceManager()->createInstanceWithContext(
- OUSTR("com.sun.star.configuration.backend.MergeImporter"),
- xContext ), UNO_QUERY_THROW );
- }
-
- Reference< ::com::sun::star::configuration::backend::XLayer > xLayer(
- xContext->getServiceManager()->createInstanceWithContext(
- OUSTR("com.sun.star.configuration.backend.xml.LayerParser"),
- xContext ), UNO_QUERY_THROW );
-
- Reference< io::XActiveDataSink > xActiveDataSink( xLayer, UNO_QUERY_THROW );
- if (use_filtered)
- xActiveDataSink->setInputStream( ::xmlscript::createInputStream(
- filtered ) );
- else
- ucb_content.openStream( xActiveDataSink );
-
- if (transientMode())
- m_xMergeImporter->importLayer( xLayer );
- else
- m_xMergeImporter->importLayerForEntity( xLayer, getConfigLayer() );
-}
-
-//##############################################################################
-
-// Package
-//______________________________________________________________________________
-BackendImpl * BackendImpl::PackageImpl::getMyBackend() const
-{
- BackendImpl * pBackend = static_cast<BackendImpl *>(m_myBackend.get());
- if (NULL == pBackend)
- {
- //May throw a DisposedException
- check();
- //We should never get here...
- throw RuntimeException(
- OUSTR("Failed to get the BackendImpl"),
- static_cast<OWeakObject*>(const_cast<PackageImpl *>(this)));
- }
- return pBackend;
-}
-
-beans::Optional< beans::Ambiguous<sal_Bool> >
-BackendImpl::PackageImpl::isRegistered_(
- ::osl::ResettableMutexGuard &,
- ::rtl::Reference<AbortChannel> const &,
- Reference<XCommandEnvironment> const & )
-{
- BackendImpl * that = getMyBackend();
- return beans::Optional< beans::Ambiguous<sal_Bool> >(
- true /* IsPresent */,
- beans::Ambiguous<sal_Bool>(
- that->m_registeredPackages->has(
- rtl::OUStringToOString( m_url, RTL_TEXTENCODING_UTF8 ) ),
- false /* IsAmbiguous */ ) );
+ rtl::OUString newUrl(url + OUString(RTL_CONSTASCII_USTRINGPARAM(".mod")));
+ //TODO: unique name
+ ucbhelper::Content(newUrl, xCmdEnv).writeStream(
+ xmlscript::createInputStream(filtered), true);
+ return newUrl;
}
//______________________________________________________________________________
void BackendImpl::PackageImpl::processPackage_(
::osl::ResettableMutexGuard &,
bool doRegisterPackage,
- ::rtl::Reference<AbortChannel> const & abortChannel,
+ ::rtl::Reference<AbortChannel> const &,
Reference<XCommandEnvironment> const & xCmdEnv )
{
BackendImpl * that = getMyBackend();
+ OUString url( getURL() );
+
if (doRegisterPackage)
{
if (m_isSchema)
{
- OSL_ENSURE( ! that->transientMode(),
- "### schema cannot be deployed transiently!" );
- if (! that->transientMode()) {
- that->xcs_merge_in( m_url, xCmdEnv );
- that->m_registeredPackages->put(
- rtl::OUStringToOString( m_url, RTL_TEXTENCODING_UTF8),
- rtl::OString(
- RTL_CONSTASCII_STRINGPARAM(
- "vnd.sun.star.configuration-schema" ) ) );
- }
+ configmgr::update::insertExtensionXcsFile(
+ that->m_eContext == CONTEXT_SHARED, expandUnoRcUrl(url));
}
else
{
- that->xcu_merge_in( m_url, xCmdEnv );
- that->m_registeredPackages->put(
- rtl::OUStringToOString( m_url, RTL_TEXTENCODING_UTF8 ),
- rtl::OString(
- RTL_CONSTASCII_STRINGPARAM(
- "vnd.sun.star.configuration-data" ) ) );
+ url = replaceOrigin(url, xCmdEnv);
+ configmgr::update::insertExtensionXcuFile(
+ that->m_eContext == CONTEXT_SHARED, expandUnoRcUrl(url));
}
+
+ that->addToConfigmgrIni( m_isSchema, url, xCmdEnv );
}
else // revoke
{
- OSL_ASSERT(
- that->m_registeredPackages->has(
- rtl::OUStringToOString( m_url, RTL_TEXTENCODING_UTF8 ) ) );
- t_string2string_map entries( that->m_registeredPackages->getEntries() );
- t_string2string_map::const_iterator iPos( entries.begin() );
- t_string2string_map::const_iterator const iEnd( entries.end() );
-
- if (m_isSchema)
- {
- if (! that->transientMode())
+ if (!that->removeFromConfigmgrIni(m_isSchema, url, xCmdEnv)) {
+ t_string2string_map entries(
+ that->m_registeredPackages->getEntries());
+ for (t_string2string_map::iterator i(entries.begin());
+ i != entries.end(); ++i)
{
- ::ucbhelper::Content ucbSaveLayer(
- makeURL( that->getConfigLayer(), OUSTR("schema") ),
- xCmdEnv );
- ucbSaveLayer.setPropertyValue(
- StrTitle::get(), Any( OUSTR("schema.bak") ) );
- try {
- for ( ; iPos != iEnd; ++iPos )
- {
- checkAborted( abortChannel );
- if (iPos->second == "vnd.sun.star.configuration-schema")
- {
- OUString url(
- rtl::OStringToOUString(
- iPos->first, RTL_TEXTENCODING_UTF8 ) );
- if (!url.equals( m_url )) {
- that->xcs_merge_in( url, xCmdEnv );
- }
- }
+ rtl::OUString url2(
+ rtl::OStringToOUString(i->first, RTL_TEXTENCODING_UTF8));
+ if (url2 != url) {
+ bool schema = i->second.equalsIgnoreAsciiCase(
+ "vnd.sun.star.configuration-schema");
+ if (!schema) {
+ url2 = replaceOrigin(url2, xCmdEnv);
}
+ that->addToConfigmgrIni(schema, url2, xCmdEnv);
}
- catch (RuntimeException &) {
- throw;
- }
- catch (Exception &) {
- ucbSaveLayer.setPropertyValue(
- StrTitle::get(), Any( OUSTR("schema") ) );
- throw;
- }
- that->m_registeredPackages->erase(
- rtl::OUStringToOString( m_url, RTL_TEXTENCODING_UTF8 ) );
- ucbSaveLayer.executeCommand(
- OUSTR("delete"), Any( true /* delete physically */ ) );
+ that->m_registeredPackages->erase(i->first);
}
- }
- else // data
- {
- if (! that->transientMode())
- {
- ::ucbhelper::Content ucbSaveLayer(
- makeURL( that->getConfigLayer(), OUSTR("data") ),
- xCmdEnv );
- ucbSaveLayer.setPropertyValue(
- StrTitle::get(), Any( OUSTR("data.bak") ) );
- try {
- for ( ; iPos != iEnd; ++iPos )
- {
- checkAborted( abortChannel );
- if (iPos->second == "vnd.sun.star.configuration-data") {
- OUString url(
- rtl::OStringToOUString(
- iPos->first, RTL_TEXTENCODING_UTF8 ) );
- if (!url.equals( m_url )) {
- that->xcu_merge_in( url, xCmdEnv );
- }
- }
- }
- }
- catch (RuntimeException &) {
- throw;
- }
- catch (Exception &) {
- ucbSaveLayer.setPropertyValue(
- StrTitle::get(), Any( OUSTR("data") ) );
- throw;
- }
- that->m_registeredPackages->erase(
- rtl::OUStringToOString( m_url, RTL_TEXTENCODING_UTF8 ) );
- ucbSaveLayer.executeCommand(
+ ::ucbhelper::Content(
+ makeURL( that->getCachePath(), OUSTR("registry") ),
+ xCmdEnv ).executeCommand(
OUSTR("delete"), Any( true /* delete physically */ ) );
- }
- }
- }
-
- if (!m_isSchema && getMyBackend()->m_defaultProvider.is()) {
- // temp workaround for config bug:
- try {
- getMyBackend()->m_defaultProvider->refresh();
- }
- catch (lang::WrappedTargetRuntimeException & exc) {
- (void) exc;
- OSL_ENSURE( 0, ::rtl::OUStringToOString(
- ::comphelper::anyToString(exc.TargetException),
- RTL_TEXTENCODING_UTF8 ).getStr() );
}
+
+ //TODO: revoking at runtime, possible, sensible?
}
}
diff --git a/desktop/source/deployment/registry/dp_backend.cxx b/desktop/source/deployment/registry/dp_backend.cxx
index ac5095133b..8771fc6c7f 100644
--- a/desktop/source/deployment/registry/dp_backend.cxx
+++ b/desktop/source/deployment/registry/dp_backend.cxx
@@ -134,7 +134,7 @@ Reference<deployment::XPackage> PackageRegistryBackend::bindPackage(
{
::osl::ResettableMutexGuard guard( getMutex() );
check();
- t_string2weakref::const_iterator const iFind( m_bound.find( url ) );
+ t_string2ref::const_iterator const iFind( m_bound.find( url ) );
if (iFind != m_bound.end()) {
Reference<deployment::XPackage> xPackage( iFind->second );
if (xPackage.is())
@@ -166,8 +166,8 @@ Reference<deployment::XPackage> PackageRegistryBackend::bindPackage(
}
guard.reset();
- ::std::pair< t_string2weakref::iterator, bool > insertion(
- m_bound.insert( t_string2weakref::value_type( url, xNewPackage ) ) );
+ ::std::pair< t_string2ref::iterator, bool > insertion(
+ m_bound.insert( t_string2ref::value_type( url, xNewPackage ) ) );
if (insertion.second)
{ // first insertion
OSL_ASSERT( Reference<XInterface>(insertion.first->second)
diff --git a/desktop/source/deployment/registry/inc/dp_backend.h b/desktop/source/deployment/registry/inc/dp_backend.h
index d16ef07a51..9395922676 100644
--- a/desktop/source/deployment/registry/inc/dp_backend.h
+++ b/desktop/source/deployment/registry/inc/dp_backend.h
@@ -244,11 +244,17 @@ class PackageRegistryBackend
: protected ::dp_misc::MutexHolder, public t_BackendBase
{
::rtl::OUString m_cachePath;
-
+ //The map held originally WeakReferences. The map entries are removed in the disposing
+ //function, which is called when the XPackages are destructed or they are
+ //explicitely disposed. The latter happens, for example, when a extension is
+ //removed (see dp_manager.cxx). However, because of how the help systems work, now
+ // XPackageManager::getDeployedPackages is called often. This results in a lot
+ //of bindPackage calls which are costly. Therefore we keep hard references in
+ //the map now.
typedef ::std::hash_map<
- ::rtl::OUString, css::uno::WeakReference<css::deployment::XPackage>,
- ::rtl::OUStringHash > t_string2weakref;
- t_string2weakref m_bound;
+ ::rtl::OUString, css::uno::Reference<css::deployment::XPackage>,
+ ::rtl::OUStringHash > t_string2ref;
+ t_string2ref m_bound;
protected:
css::uno::Reference<css::uno::XComponentContext> m_xComponentContext;
diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx
index 1370b5ce5b..8a61eb026f 100644
--- a/desktop/source/deployment/registry/package/dp_package.cxx
+++ b/desktop/source/deployment/registry/package/dp_package.cxx
@@ -70,7 +70,7 @@
#include "com/sun/star/xml/dom/XDocumentBuilder.hpp"
#include "com/sun/star/xml/xpath/XXPathAPI.hpp"
#include "com/sun/star/deployment/XPackageManager.hpp"
-
+#include "boost/optional.hpp"
#include <vector>
#include <stdio.h>
@@ -443,12 +443,19 @@ BackendImpl::PackageImpl::isRegistered_(
AbortChannel::Chain chain( abortChannel, xSubAbortChannel );
beans::Optional< beans::Ambiguous<sal_Bool> > option(
xPackage->isRegistered( xSubAbortChannel, xCmdEnv ) );
+
+ //present = true if at least one bundle item has this value.
+ //reg = true if all bundle items have an option value (option.IsPresent == 1)
+ //and all have value of true (option.Value.Value == true)
+ //If not, then the bundle has the status of not registered and ambiguous.
if (option.IsPresent)
{
beans::Ambiguous<sal_Bool> const & status = option.Value;
if (present)
{
+ //we never come here in the first iteration
if (reg != (status.Value != sal_False)) {
+
ambig = true;
reg = false;
break;
@@ -456,6 +463,7 @@ BackendImpl::PackageImpl::isRegistered_(
}
else
{
+ //we always come here in the first iteration
reg = status.Value;
present = true;
}
@@ -575,21 +583,12 @@ bool BackendImpl::PackageImpl::checkDependencies(
{
try
{
- css::uno::Reference<css::xml::dom::XNode> xRoot = desc.getRootElement();
- css::uno::Reference<css::xml::xpath::XXPathAPI> xPath =
- getDescriptionInfoset().getXpath();
-
- css::uno::Reference<css::xml::dom::XNode> nodeSimpleLic;
- try {
- nodeSimpleLic = xPath->selectSingleNode(xRoot,
- OUSTR("/desc:description/desc:registration/desc:simple-license"));
- } catch (css::xml::xpath::XPathException &) {
- // ignore
- }
-
- if (!nodeSimpleLic.is())
+ DescriptionInfoset info = getDescriptionInfoset();
+ ::boost::optional<SimpleLicenseAttributes> simplLicAttr
+ = info.getSimpleLicenseAttributes();
+ if (! simplLicAttr)
return true;
- OUString sLic = getDescriptionInfoset().getLocalizedLicenseURL();
+ OUString sLic = info.getLocalizedLicenseURL();
//If we do not get a localized licence then there is an error in the description.xml
//This should be handled by using a validating parser. Therefore we assume that no
//license is available.
@@ -598,23 +597,20 @@ bool BackendImpl::PackageImpl::checkDependencies(
OUSTR("Could not obtain path to license. Possible error in description.xml"), 0, Any());
OUString sHref = desc.getExtensionRootUrl() + OUSTR("/") + sLic;
OUString sLicense = getTextFromURL(xCmdEnv, sHref);
- //determine who has to agree to the license
- css::uno::Reference<css::xml::xpath::XXPathObject> nodeAttribWho3 =
- xPath->eval(nodeSimpleLic,
- OUSTR("@accept-by"));
- OUString sAccept = nodeAttribWho3->getString().trim();
+ ////determine who has to agree to the license
//check correct value for attribute
- if ( ! (sAccept.equals(OUSTR("user")) || sAccept.equals(OUSTR("admin"))))
+ if ( ! (simplLicAttr->acceptBy.equals(OUSTR("user")) || simplLicAttr->acceptBy.equals(OUSTR("admin"))))
throw css::deployment::DeploymentException(
OUSTR("Could not obtain attribute simple-lincense@accept-by or it has no valid value"), 0, Any());
//If if @accept-by="user" then every user needs to accept the license before it can be installed.
- //Therefore we must prevent the installation as shared extension.
+ //Therefore we must prevent the installation as shared extension unless suppress-if-required="true"
OSL_ASSERT(aContextName.getLength());
- if (sAccept.equals(OUSTR("user")) && aContextName.equals(OUSTR("shared")))
+ if (simplLicAttr->acceptBy.equals(OUSTR("user")) && aContextName.equals(OUSTR("shared")))
{
- css::deployment::LicenseIndividualAgreementException exc =
- css::deployment::LicenseIndividualAgreementException(OUString(), 0, m_name);
+ css::deployment::LicenseIndividualAgreementException
+ exc = css::deployment::LicenseIndividualAgreementException(
+ OUString(), 0, m_name, simplLicAttr->suppressIfRequired);
bool approve = false;
bool abort = false;
@@ -624,32 +620,24 @@ bool BackendImpl::PackageImpl::checkDependencies(
OUSTR("Could not interact with user."), 0, Any());
if (abort == true)
return false;
- //We should always prevent installation
- OSL_ASSERT(0);
- }
-
- //determine optional attribute simple-license@suppressOnUpdate
- css::uno::Reference<css::xml::dom::XElement> elemSimpleLic(nodeSimpleLic, css::uno::UNO_QUERY_THROW);
- sal_Bool bSuppress = sal_False;
- if (elemSimpleLic->hasAttribute(OUSTR("suppress-on-update")))
- {
- if (elemSimpleLic->getAttribute(OUSTR("suppress-on-update")).equals(OUSTR("true")))
- bSuppress = sal_True;
+
+ //If the unopkg --suppress-license was used and simplLicAttr->suppressIfRequired == true,
+ //then the user implicitely accepts the license
}
//Only use interaction if there is no version of this extension already installed
//and the suppress-on-update flag is not set for the new extension
- // bInstalled | bSuppress | show license
+ // bInstalled | bSuppressOnUpdate | show license
//----------------------------------------
- // 0 | 0 | 1
- // 0 | 1 | 1
- // 1 | 0 | 1
- // 1 | 1 | 0
+ // 0 | 0 | 1
+ // 0 | 1 | 1
+ // 1 | 0 | 1
+ // 1 | 1 | 0
- if ( !(bInstalled && bSuppress))
+ if ( !(bInstalled && simplLicAttr->suppressOnUpdate))
{
- css::deployment::LicenseException licExc =
- css::deployment::LicenseException(OUString(), 0, m_name, sLicense);
+ css::deployment::LicenseException licExc(
+ OUString(), 0, m_name, sLicense, simplLicAttr->suppressIfRequired);
bool approve = false;
bool abort = false;
if (! interactContinuation(
diff --git a/desktop/source/inc/exithelper.hxx b/desktop/source/inc/exithelper.hxx
index 112d4848f0..682410c6b7 100644
--- a/desktop/source/inc/exithelper.hxx
+++ b/desktop/source/inc/exithelper.hxx
@@ -56,12 +56,8 @@ class ExitHelper
E_SECOND_OFFICE = 1,
/// an uno exception was catched during startup
E_FATAL_ERROR = 333, // Only the low 8 bits are significant 333 % 256 = 77
- /// crash during runtime
- E_CRASH = 78,
/// user force automatic restart after crash
E_CRASH_WITH_RESTART = 79,
- /// ???
- E_LOCKFILE = 80
};
};
diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx
index 3de12d3b2c..ede233edd2 100644
--- a/desktop/source/migration/migration.cxx
+++ b/desktop/source/migration/migration.cxx
@@ -34,6 +34,7 @@
#include <unotools/textsearch.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/sequence.hxx>
#include <unotools/bootstrap.hxx>
#include <rtl/bootstrap.hxx>
#include <tools/config.hxx>
@@ -91,7 +92,6 @@ static void releaseImpl()
}
}
-
// static main entry point for the migration process
void Migration::doMigration()
{
@@ -140,11 +140,11 @@ sal_Bool MigrationImpl::checkMigration()
MigrationImpl::MigrationImpl(const uno::Reference< XMultiServiceFactory >& xFactory)
: m_vrVersions(new strings_v)
, m_xFactory(xFactory)
- , m_vrMigrations(readMigrationSteps())
- , m_aInfo(findInstallation())
- , m_vrFileList(compileFileList())
- , m_vrServiceList(compileServiceList())
{
+ readAvailableMigrations(m_vMigrationsAvailable);
+ sal_Int32 nIndex = findPreferedMigrationProcess(m_vMigrationsAvailable);
+ if ( nIndex >= 0 )
+ m_vrMigrations = readMigrationSteps(m_vMigrationsAvailable[nIndex].name);
}
MigrationImpl::~MigrationImpl()
@@ -154,6 +154,10 @@ MigrationImpl::~MigrationImpl()
sal_Bool MigrationImpl::doMigration()
{
+ // compile file and service list for migration
+ m_vrFileList = compileFileList();
+ m_vrServiceList = compileServiceList();
+
sal_Bool result = sal_False;
try{
copyFiles();
@@ -218,20 +222,61 @@ sal_Bool MigrationImpl::checkMigrationCompleted()
return bMigrationCompleted;
}
-
-migrations_vr MigrationImpl::readMigrationSteps()
+static void insertSorted(migrations_available& rAvailableMigrations, supported_migration& aSupportedMigration)
{
+ bool bInserted( false );
+ migrations_available::iterator pIter = rAvailableMigrations.begin();
+ while ( !bInserted && pIter != rAvailableMigrations.end())
+ {
+ if ( pIter->nPriority < aSupportedMigration.nPriority )
+ {
+ rAvailableMigrations.insert(pIter, aSupportedMigration );
+ bInserted = true;
+ }
+ ++pIter;
+ }
+ if ( !bInserted )
+ rAvailableMigrations.push_back( aSupportedMigration );
+}
+bool MigrationImpl::readAvailableMigrations(migrations_available& rAvailableMigrations)
+{
// get supported version names
- uno::Reference< XNameAccess > aMigrationAccess(getConfigAccess("org.openoffice.Setup/Migration"), uno::UNO_QUERY_THROW);
- uno::Sequence< OUString > seqVersions;
- aMigrationAccess->getByName(OUString::createFromAscii("SupportedVersions")) >>= seqVersions;
- for (sal_Int32 i=0; i<seqVersions.getLength(); i++)
- m_vrVersions->push_back(seqVersions[i].trim());
+ uno::Reference< XNameAccess > aMigrationAccess(getConfigAccess("org.openoffice.Setup/Migration/SupportedVersions"), uno::UNO_QUERY_THROW);
+ uno::Sequence< OUString > seqSupportedVersions = aMigrationAccess->getElementNames();
+
+ const OUString aVersionIdentifiers( RTL_CONSTASCII_USTRINGPARAM( "VersionIdentifiers" ));
+ const OUString aPriorityIdentifier( RTL_CONSTASCII_USTRINGPARAM( "Priority" ));
+ for (sal_Int32 i=0; i<seqSupportedVersions.getLength(); i++)
+ {
+ sal_Int32 nPriority( 0 );
+ uno::Sequence< OUString > seqVersions;
+ uno::Reference< XNameAccess > xMigrationData( aMigrationAccess->getByName(seqSupportedVersions[i]), uno::UNO_QUERY_THROW );
+ xMigrationData->getByName( aVersionIdentifiers ) >>= seqVersions;
+ xMigrationData->getByName( aPriorityIdentifier ) >>= nPriority;
+
+ supported_migration aSupportedMigration;
+ aSupportedMigration.name = seqSupportedVersions[i];
+ aSupportedMigration.nPriority = nPriority;
+ for (sal_Int32 j=0; j<seqVersions.getLength(); j++)
+ aSupportedMigration.supported_versions.push_back(seqVersions[j].trim());
+ insertSorted( rAvailableMigrations, aSupportedMigration );
+ }
+
+ return true;
+}
+
+migrations_vr MigrationImpl::readMigrationSteps(const ::rtl::OUString& rMigrationName)
+{
+ // get migration access
+ uno::Reference< XNameAccess > aMigrationAccess(getConfigAccess("org.openoffice.Setup/Migration/SupportedVersions"), uno::UNO_QUERY_THROW);
+ uno::Reference< XNameAccess > xMigrationData( aMigrationAccess->getByName(rMigrationName), uno::UNO_QUERY_THROW );
+
// get migration description from from org.openoffice.Setup/Migration
// and build vector of migration steps
- uno::Reference< XNameAccess > theNameAccess(getConfigAccess("org.openoffice.Setup/Migration/MigrationSteps"), uno::UNO_QUERY_THROW);
+ OUString aMigrationSteps( RTL_CONSTASCII_USTRINGPARAM( "MigrationSteps" ));
+ uno::Reference< XNameAccess > theNameAccess(xMigrationData->getByName(aMigrationSteps), uno::UNO_QUERY_THROW);
uno::Sequence< OUString > seqMigrations = theNameAccess->getElementNames();
uno::Reference< XNameAccess > tmpAccess;
uno::Reference< XNameAccess > tmpAccess2;
@@ -273,6 +318,20 @@ migrations_vr MigrationImpl::readMigrationSteps()
tmpStep.excludeConfig.push_back(tmpSeq[j]);
}
+ // included extensions...
+ if (tmpAccess->getByName(OUString::createFromAscii("IncludedExtensions")) >>= tmpSeq)
+ {
+ for (sal_Int32 j=0; j<tmpSeq.getLength(); j++)
+ tmpStep.includeExtensions.push_back(tmpSeq[j]);
+ }
+
+ // excluded extensions...
+ if (tmpAccess->getByName(OUString::createFromAscii("ExcludedExtensions")) >>= tmpSeq)
+ {
+ for (sal_Int32 j=0; j<tmpSeq.getLength(); j++)
+ tmpStep.excludeExtensions.push_back(tmpSeq[j]);
+ }
+
// config components
if (tmpAccess->getByName(OUString::createFromAscii("ServiceConfigComponents")) >>= tmpSeq)
{
@@ -280,7 +339,6 @@ migrations_vr MigrationImpl::readMigrationSteps()
tmpStep.configComponents.push_back(tmpSeq[j]);
}
-
// generic service
tmpAccess->getByName(OUString::createFromAscii("MigrationService")) >>= tmpStep.service;
@@ -302,7 +360,7 @@ static FileBase::RC _checkAndCreateDirectory(INetURLObject& dirURL)
return result;
}
-install_info MigrationImpl::findInstallation()
+install_info MigrationImpl::findInstallation(const strings_v& rVersions)
{
rtl::OUString aProductName;
uno::Any aRet = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME );
@@ -310,9 +368,9 @@ install_info MigrationImpl::findInstallation()
aProductName = aProductName.toAsciiLowerCase();
install_info aInfo;
- strings_v::const_iterator i_ver = m_vrVersions->begin();
+ strings_v::const_iterator i_ver = rVersions.begin();
uno::Reference < util::XStringSubstitution > xSubst( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.util.PathSubstitution")), uno::UNO_QUERY );
- while (i_ver != m_vrVersions->end())
+ while (i_ver != rVersions.end())
{
::rtl::OUString aVersion, aProfileName;
sal_Int32 nSeparatorIndex = (*i_ver).indexOf('=');
@@ -330,7 +388,7 @@ install_info MigrationImpl::findInstallation()
osl::Security().getConfigDir( aUserInst );
if ( aUserInst.getLength() && aUserInst[ aUserInst.getLength()-1 ] != '/' )
aUserInst += ::rtl::OUString::createFromAscii("/");
-#ifdef UNX
+#if defined UNX && ! defined MACOSX
// tribute to whoever had the "great" idea to use different names on Windows and Unix
aUserInst += ::rtl::OUString::createFromAscii(".");
#endif
@@ -345,12 +403,34 @@ install_info MigrationImpl::findInstallation()
}
catch( uno::Exception& ){}
}
- i_ver++;
+ ++i_ver;
}
return aInfo;
}
+sal_Int32 MigrationImpl::findPreferedMigrationProcess(const migrations_available& rAvailableMigrations)
+{
+ sal_Int32 nIndex( -1 );
+ sal_Int32 i( 0 );
+
+ migrations_available::const_iterator rIter = rAvailableMigrations.begin();
+ while ( rIter != rAvailableMigrations.end() )
+ {
+ install_info aInstallInfo = findInstallation(rIter->supported_versions);
+ if (aInstallInfo.productname.getLength() > 0 )
+ {
+ m_aInfo = aInstallInfo;
+ nIndex = i;
+ break;
+ }
+ ++i;
+ ++rIter;
+ }
+
+ return nIndex;
+}
+
strings_vr MigrationImpl::applyPatterns(const strings_v& vSet, const strings_v& vPatterns) const
{
using namespace utl;
@@ -517,8 +597,6 @@ void MigrationImpl::copyConfig()
aMsg += OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US);
OSL_ENSURE(sal_False, aMsg.getStr());
}
-
-
}
// removes elements of vector 2 in vector 1
@@ -626,7 +704,6 @@ void MigrationImpl::copyFiles()
void MigrationImpl::runServices()
{
-
//create stratum for old user layer
OUString aOldLayerURL = m_aInfo.userdata;
aOldLayerURL += OUString::createFromAscii("/user/registry");
@@ -637,7 +714,7 @@ void MigrationImpl::runServices()
aStratumSvc, stratumArgs), uno::UNO_QUERY);
// Build argument array
- uno::Sequence< uno::Any > seqArguments(3);
+ uno::Sequence< uno::Any > seqArguments(4);
seqArguments[0] = uno::makeAny(NamedValue(
OUString::createFromAscii("Productname"),
uno::makeAny(m_aInfo.productname)));
@@ -673,10 +750,21 @@ void MigrationImpl::runServices()
i_comp++;
i++;
}
+
// set old config argument
seqArguments[2] = uno::makeAny(NamedValue(
OUString::createFromAscii("OldConfiguration"),
uno::makeAny(seqComponents)));
+
+ // set black list for extension migration
+ uno::Sequence< rtl::OUString > seqExtBlackList;
+ sal_uInt32 nSize = i_mig->excludeExtensions.size();
+ if ( nSize > 0 )
+ seqExtBlackList = comphelper::arrayToSequence< ::rtl::OUString >(
+ &i_mig->excludeExtensions[0], nSize );
+ seqArguments[3] = uno::makeAny(NamedValue(
+ OUString::createFromAscii("ExtensionBlackList"),
+ uno::makeAny( seqExtBlackList )));
xMigrationJob = uno::Reference< XJob >(m_xFactory->createInstanceWithArguments(
i_mig->service, seqArguments), uno::UNO_QUERY_THROW);
diff --git a/desktop/source/migration/migration_impl.hxx b/desktop/source/migration/migration_impl.hxx
index 0de88d4dbc..a1533212ed 100644
--- a/desktop/source/migration/migration_impl.hxx
+++ b/desktop/source/migration/migration_impl.hxx
@@ -65,11 +65,21 @@ struct migration_step
strings_v includeConfig;
strings_v excludeConfig;
strings_v configComponents;
+ strings_v includeExtensions;
+ strings_v excludeExtensions;
rtl::OUString service;
};
+struct supported_migration
+{
+ rtl::OUString name;
+ sal_Int32 nPriority;
+ strings_v supported_versions;
+};
+
typedef std::vector< migration_step > migrations_v;
typedef std::auto_ptr< migrations_v > migrations_vr;
+typedef std::vector< supported_migration > migrations_available;
class MigrationImpl
{
@@ -77,18 +87,22 @@ class MigrationImpl
private:
strings_vr m_vrVersions;
NS_UNO::Reference< NS_CSS::lang::XMultiServiceFactory > m_xFactory;
- migrations_vr m_vrMigrations; // list of all migration specs from config
- install_info m_aInfo; // info about the version being migrated
- strings_vr m_vrFileList; // final list of files to be copied
- strings_vr m_vrConfigList; // final list of nodes to be copied
- strings_vr m_vrServiceList; // final list of services to be called
-
- // initializer functions...
- migrations_vr readMigrationSteps();
- install_info findInstallation();
- strings_vr compileFileList();
- strings_vr compileConfigList();
- strings_vr compileServiceList();
+
+ migrations_available m_vMigrationsAvailable; // list of all available migrations
+ migrations_vr m_vrMigrations; // list of all migration specs from config
+ install_info m_aInfo; // info about the version being migrated
+ strings_vr m_vrFileList; // final list of files to be copied
+ strings_vr m_vrConfigList; // final list of nodes to be copied
+ strings_vr m_vrServiceList; // final list of services to be called
+
+ // functions to control the migration process
+ bool readAvailableMigrations(migrations_available&);
+ migrations_vr readMigrationSteps(const ::rtl::OUString& rMigrationName);
+ sal_Int32 findPreferedMigrationProcess(const migrations_available&);
+ install_info findInstallation(const strings_v& rVersions);
+ strings_vr compileFileList();
+ strings_vr compileConfigList();
+ strings_vr compileServiceList();
// helpers
void substract(strings_v& va, const strings_v& vb_c) const;
diff --git a/desktop/source/migration/pages.cxx b/desktop/source/migration/pages.cxx
index c70707bde8..64a1fd54a0 100644
--- a/desktop/source/migration/pages.cxx
+++ b/desktop/source/migration/pages.cxx
@@ -55,6 +55,7 @@
#include <rtl/bootstrap.hxx>
#include <rtl/ustrbuf.hxx>
#include <osl/file.hxx>
+#include <osl/thread.hxx>
#include <unotools/bootstrap.hxx>
#include <tools/config.hxx>
@@ -62,6 +63,7 @@ using namespace rtl;
using namespace osl;
using namespace utl;
using namespace svt;
+using namespace com::sun::star;
using namespace com::sun::star::frame;
using namespace com::sun::star::lang;
using namespace com::sun::star::util;
@@ -305,12 +307,46 @@ void LicenseView::Notify( SfxBroadcaster&, const SfxHint& rHint )
// -------------------------------------------------------------------
-MigrationPage::MigrationPage( svt::OWizardMachine* parent, const ResId& resid)
+class MigrationThread : public ::osl::Thread
+{
+ public:
+ MigrationThread();
+
+ virtual void SAL_CALL run();
+ virtual void SAL_CALL onTerminated();
+};
+
+MigrationThread::MigrationThread()
+{
+}
+
+void MigrationThread::run()
+{
+ try
+ {
+ Migration::doMigration();
+ }
+ catch ( uno::Exception& )
+ {
+ }
+}
+
+void MigrationThread::onTerminated()
+{
+}
+
+// -------------------------------------------------------------------
+
+MigrationPage::MigrationPage(
+ svt::OWizardMachine* parent,
+ const ResId& resid,
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XThrobber > xThrobber)
: OWizardPage(parent, resid)
, m_ftHead(this, WizardResId(FT_MIGRATION_HEADER))
, m_ftBody(this, WizardResId(FT_MIGRATION_BODY))
, m_cbMigration(this, WizardResId(CB_MIGRATION))
, m_bMigrationDone(sal_False)
+ , m_xThrobber(xThrobber)
{
FreeResource();
_setBold(m_ftHead);
@@ -325,9 +361,28 @@ sal_Bool MigrationPage::commitPage( CommitPageReason _eReason )
{
if (_eReason == eTravelForward && m_cbMigration.IsChecked() && !m_bMigrationDone)
{
- EnterWait();
- Migration::doMigration();
- LeaveWait();
+ GetParent()->EnterWait();
+ FirstStartWizard* pWizard = dynamic_cast< FirstStartWizard* >( GetParent() );
+ if ( pWizard )
+ pWizard->DisableButtonsWhileMigration();
+
+ uno::Reference< awt::XWindow > xWin( m_xThrobber, uno::UNO_QUERY );
+ xWin->setVisible( true );
+ m_xThrobber->start();
+ MigrationThread* pMigThread = new MigrationThread();
+ pMigThread->create();
+
+ while ( pMigThread->isRunning() )
+ {
+ Application::Reschedule();
+ }
+
+ m_xThrobber->stop();
+ GetParent()->LeaveWait();
+ // Next state will enable buttons - so no EnableButtons necessary!
+ xWin->setVisible( false );
+ pMigThread->join();
+ delete pMigThread;
m_bMigrationDone = sal_True;
}
else
diff --git a/desktop/source/migration/pages.hxx b/desktop/source/migration/pages.hxx
index 57a3d57f7d..478782d266 100644
--- a/desktop/source/migration/pages.hxx
+++ b/desktop/source/migration/pages.hxx
@@ -38,6 +38,8 @@
#include <svl/lstner.hxx>
#include <svtools/xtextedt.hxx>
+#include <com/sun/star/awt/XThrobber.hpp>
+
namespace desktop
{
class WelcomePage : public svt::OWizardPage
@@ -120,8 +122,9 @@ private:
FixedText m_ftBody;
CheckBox m_cbMigration;
sal_Bool m_bMigrationDone;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XThrobber > m_xThrobber;
public:
- MigrationPage( svt::OWizardMachine* parent, const ResId& resid);
+ MigrationPage( svt::OWizardMachine* parent, const ResId& resid, ::com::sun::star::uno::Reference< ::com::sun::star::awt::XThrobber > xThrobber );
virtual sal_Bool commitPage( CommitPageReason _eReason );
protected:
diff --git a/configmgr/source/treemgr/viewaccess.cxx b/desktop/source/migration/services/cexportsoo3.cxx
index 5b2eeb811a..b33d78966f 100644..100755
--- a/configmgr/source/treemgr/viewaccess.cxx
+++ b/desktop/source/migration/services/cexportsoo3.cxx
@@ -2,10 +2,13 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2000, 2010 Oracle and/or its affiliates.
+ * Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
*
+ * $RCSfile: cexports.cxx,v $
+ * $Revision: 1.9 $
+ *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -26,31 +29,43 @@
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
+#include "precompiled_desktop.hxx"
+
+#include "cppuhelper/implementationentry.hxx"
+#include "oo3extensionmigration.hxx"
-#include "viewaccess.hxx"
-#include "tree.hxx"
-#include "noderef.hxx"
+extern "C"
+{
-//-----------------------------------------------------------------------------
-namespace configmgr
+::cppu::ImplementationEntry entries [] =
{
-//-----------------------------------------------------------------------------
- namespace view
{
-//-----------------------------------------------------------------------------
-configuration::NodeData* ViewTreeAccess::nodeData(configuration::NodeRef const& _aNodeArg) const
+ migration::OO3ExtensionMigration_create, migration::OO3ExtensionMigration_getImplementationName,
+ migration::OO3ExtensionMigration_getSupportedServiceNames, ::cppu::createSingleComponentFactory,
+ 0, 0
+ },
+ { 0, 0, 0, 0, 0, 0 }
+};
+
+
+void SAL_CALL component_getImplementationEnvironment(
+ const sal_Char ** ppEnvTypeName, uno_Environment ** )
{
- return this->nodeData(_aNodeArg.getOffset());
+ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-//-----------------------------------------------------------------------------
-configuration::NodeData* ViewTreeAccess::nodeData(unsigned int _aNodePos) const
+sal_Bool SAL_CALL component_writeInfo(
+ void * pServiceManager, void * pRegistryKey )
{
- return m_tree->nodeData(_aNodePos);
+ return ::cppu::component_writeInfoHelper(
+ pServiceManager, pRegistryKey, entries );
}
-//-----------------------------------------------------------------------------
- }
+void * SAL_CALL component_getFactory(
+ const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
+{
+ return ::cppu::component_getFactoryHelper(
+ pImplName, pServiceManager, pRegistryKey, entries );
}
+}
diff --git a/desktop/source/migration/services/makefile.mk b/desktop/source/migration/services/makefile.mk
index 323b823fe3..55ecff6bc0 100644
--- a/desktop/source/migration/services/makefile.mk
+++ b/desktop/source/migration/services/makefile.mk
@@ -31,6 +31,7 @@ PRJNAME=desktop
TARGET = migrationoo2.uno
ENABLE_EXCEPTIONS=TRUE
COMP1TYPELIST = migrationoo2
+LIBTARGET=NO
# --- Settings -----------------------------------------------------
.INCLUDE : ..$/..$/deployment/inc/dp_misc.mk
@@ -50,10 +51,21 @@ SLOFILES= \
$(SLO)$/cexports.obj \
$(SLO)$/basicmigration.obj \
$(SLO)$/wordbookmigration.obj \
- $(SLO)$/extensionmigration.obj
+ $(SLO)$/extensionmigration.obj \
+ $(SLO)$/autocorrmigration.obj \
+ $(SLO)$/oo3extensionmigration.obj \
+ $(SLO)$/cexportsoo3.obj
+
+SHL1OBJS= \
+ $(SLO)$/jvmfwk.obj \
+ $(SLO)$/cexports.obj \
+ $(SLO)$/basicmigration.obj \
+ $(SLO)$/wordbookmigration.obj \
+ $(SLO)$/extensionmigration.obj \
+ $(SLO)$/autocorrmigration.obj
SHL1TARGET=$(TARGET)
-SHL1VERSIONMAP = migrationoo2.map
+SHL1VERSIONMAP = $(SOLARENV)/src/component.map
SHL1STDLIBS= \
$(DEPLOYMENTMISCLIB) \
@@ -67,16 +79,42 @@ SHL1STDLIBS= \
$(JVMFWKLIB) \
$(XMLSCRIPTLIB) \
$(BERKELEYLIB)
-
-
SHL1DEPN=
-SHL1IMPLIB=i$(TARGET)
-SHL1LIBS=$(SLB)$/$(TARGET).lib
+SHL1IMPLIB=imigrationoo2
+#SHL1LIBS=$(SLB)$/$(TARGET).lib
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
+COMP2TYPELIST = migrationoo3
+SHL2TARGET=migrationoo3.uno
+SHL2VERSIONMAP = migrationoo3.map
+
+SHL2OBJS= \
+ $(SLO)$/cexportsoo3.obj \
+ $(SLO)$/oo3extensionmigration.obj
+
+SHL2STDLIBS= \
+ $(DEPLOYMENTMISCLIB) \
+ $(CPPULIB) \
+ $(CPPUHELPERLIB) \
+ $(SALLIB) \
+ $(UCBHELPERLIB) \
+ $(UNOTOOLSLIB) \
+ $(TOOLSLIB) \
+ $(I18NISOLANGLIB) \
+ $(JVMFWKLIB) \
+ $(XMLSCRIPTLIB) \
+ $(BERKELEYLIB)
+
+SHL2DEPN=
+SHL2IMPLIB=imigrationoo3
+#SHL2LIBS=$(SLB)$/$(SHL2TARGET).lib
+SHL2DEF=$(MISC)$/$(SHL2TARGET).def
+
+DEF2NAME=$(SHL2TARGET)
+
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
diff --git a/desktop/source/migration/services/migrationoo2.map b/desktop/source/migration/services/migrationoo3.map
index ac2c3750bf..ac2c3750bf 100644..100755
--- a/desktop/source/migration/services/migrationoo2.map
+++ b/desktop/source/migration/services/migrationoo3.map
diff --git a/desktop/source/migration/services/oo3extensionmigration.cxx b/desktop/source/migration/services/oo3extensionmigration.cxx
new file mode 100755
index 0000000000..07e971b033
--- /dev/null
+++ b/desktop/source/migration/services/oo3extensionmigration.cxx
@@ -0,0 +1,656 @@
+/*************************************************************************
+ *
+ * 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: extensionmigration.cxx,v $
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_desktop.hxx"
+
+#include "oo3extensionmigration.hxx"
+#include <rtl/instance.hxx>
+#include <osl/file.hxx>
+#include <osl/thread.h>
+#include <tools/urlobj.hxx>
+#include <unotools/bootstrap.hxx>
+#include <unotools/ucbstreamhelper.hxx>
+#include <unotools/textsearch.hxx>
+#include <comphelper/sequence.hxx>
+#include <comphelper/processfactory.hxx>
+#include <ucbhelper/content.hxx>
+
+#include <com/sun/star/deployment/thePackageManagerFactory.hpp>
+#include <com/sun/star/deployment/XPackageManagerFactory.hpp>
+#include <com/sun/star/task/XInteractionApprove.hpp>
+#include <com/sun/star/task/XInteractionAbort.hpp>
+#include <com/sun/star/ucb/XCommandInfo.hpp>
+#include <com/sun/star/ucb/TransferInfo.hpp>
+#include <com/sun/star/ucb/NameClash.hpp>
+#include <com/sun/star/ucb/XCommandEnvironment.hpp>
+#include <com/sun/star/xml/xpath/XXPathAPI.hpp>
+
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+
+namespace migration
+{
+
+static ::rtl::OUString sExtensionSubDir = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/user/uno_packages/" ) );
+static ::rtl::OUString sSubDirName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "cache" ) );
+static ::rtl::OUString sConfigDir = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/user/registry/data" ) );
+static ::rtl::OUString sOrgDir = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/user/registry/data/org" ) );
+static ::rtl::OUString sExcludeDir1 = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/user/registry/data/org" ) );
+static ::rtl::OUString sExcludeDir2 = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/user/registry/data/org/openoffice" ) );
+static ::rtl::OUString sDescriptionXmlFile = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/description.xml" ) );
+static ::rtl::OUString sExtensionRootSubDirName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/uno_packages" ) );
+
+static ::rtl::OUString sConfigurationDataType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("application/vnd.sun.star.configuration-data"));
+static ::rtl::OUString sConfigurationSchemaType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("application/vnd.sun.star.configuration-schema"));
+
+// =============================================================================
+// component operations
+// =============================================================================
+
+::rtl::OUString OO3ExtensionMigration_getImplementationName()
+{
+ static ::rtl::OUString* pImplName = 0;
+ if ( !pImplName )
+ {
+ ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
+ if ( !pImplName )
+ {
+ static ::rtl::OUString aImplName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.desktop.migration.OOo3Extensions" ) );
+ pImplName = &aImplName;
+ }
+ }
+ return *pImplName;
+}
+
+// -----------------------------------------------------------------------------
+
+Sequence< ::rtl::OUString > OO3ExtensionMigration_getSupportedServiceNames()
+{
+ static Sequence< ::rtl::OUString >* pNames = 0;
+ if ( !pNames )
+ {
+ ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
+ if ( !pNames )
+ {
+ static Sequence< ::rtl::OUString > aNames(1);
+ aNames.getArray()[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.migration.Extensions" ) );
+ pNames = &aNames;
+ }
+ }
+ return *pNames;
+}
+
+// =============================================================================
+// ExtensionMigration
+// =============================================================================
+
+OO3ExtensionMigration::OO3ExtensionMigration(Reference< XComponentContext > const & ctx) :
+m_ctx(ctx)
+{
+}
+
+// -----------------------------------------------------------------------------
+
+OO3ExtensionMigration::~OO3ExtensionMigration()
+{
+}
+
+::osl::FileBase::RC OO3ExtensionMigration::checkAndCreateDirectory( INetURLObject& rDirURL )
+{
+ ::osl::FileBase::RC aResult = ::osl::Directory::create( rDirURL.GetMainURL( INetURLObject::DECODE_TO_IURI ) );
+ if ( aResult == ::osl::FileBase::E_NOENT )
+ {
+ INetURLObject aBaseURL( rDirURL );
+ aBaseURL.removeSegment();
+ checkAndCreateDirectory( aBaseURL );
+ return ::osl::Directory::create( rDirURL.GetMainURL( INetURLObject::DECODE_TO_IURI ) );
+ }
+ else
+ {
+ return aResult;
+ }
+}
+
+void OO3ExtensionMigration::registerConfigurationPackage( const uno::Reference< deployment::XPackage > & xPkg)
+{
+ const ::rtl::OUString sMediaType = xPkg->getPackageType()->getMediaType();
+ if ( (sMediaType.equals(sConfigurationDataType) || sMediaType.equals(sConfigurationSchemaType) ) )
+ {
+ xPkg->revokePackage(uno::Reference< task::XAbortChannel >(), uno::Reference< ucb::XCommandEnvironment> ());
+ xPkg->registerPackage(uno::Reference< task::XAbortChannel >(), uno::Reference< ucb::XCommandEnvironment> ());
+ }
+}
+
+ void OO3ExtensionMigration::scanUserExtensions( const ::rtl::OUString& sSourceDir, TStringVector& aMigrateExtensions )
+{
+ osl::Directory aScanRootDir( sSourceDir );
+ osl::FileStatus fs(FileStatusMask_Type | FileStatusMask_FileURL);
+ osl::FileBase::RC nRetCode = aScanRootDir.open();
+ if ( nRetCode == osl::Directory::E_None )
+ {
+ sal_uInt32 nHint( 0 );
+ osl::DirectoryItem aItem;
+ while ( aScanRootDir.getNextItem( aItem, nHint ) == osl::Directory::E_None )
+ {
+ if (( aItem.getFileStatus(fs) == osl::FileBase::E_None ) &&
+ ( fs.getFileType() == osl::FileStatus::Directory ))
+ {
+ //Check next folder as the "real" extension folder is below a temp folder!
+ ::rtl::OUString sExtensionFolderURL = fs.getFileURL();
+
+ osl::DirectoryItem aExtDirItem;
+ osl::Directory aExtensionRootDir( sExtensionFolderURL );
+
+ nRetCode = aExtensionRootDir.open();
+ if (( nRetCode == osl::Directory::E_None ) &&
+ ( aExtensionRootDir.getNextItem( aExtDirItem, nHint ) == osl::Directory::E_None ))
+ {
+ bool bFileStatus = aExtDirItem.getFileStatus(fs) == osl::FileBase::E_None;
+ bool bIsDir = fs.getFileType() == osl::FileStatus::Directory;
+
+ if ( bFileStatus && bIsDir )
+ {
+ sExtensionFolderURL = fs.getFileURL();
+ ScanResult eResult = scanExtensionFolder( sExtensionFolderURL );
+ if ( eResult == SCANRESULT_MIGRATE_EXTENSION )
+ aMigrateExtensions.push_back( sExtensionFolderURL );
+ }
+ }
+ }
+ }
+ }
+}
+
+OO3ExtensionMigration::ScanResult OO3ExtensionMigration::scanExtensionFolder( const ::rtl::OUString& sExtFolder )
+{
+ ScanResult aResult = SCANRESULT_NOTFOUND;
+ osl::Directory aDir(sExtFolder);
+
+ // get sub dirs
+ if (aDir.open() == osl::FileBase::E_None)
+ {
+ // work through directory contents...
+ osl::DirectoryItem item;
+ osl::FileStatus fs(FileStatusMask_Type | FileStatusMask_FileURL);
+ TStringVector aDirectories;
+ while ((aDir.getNextItem(item) == osl::FileBase::E_None ) &&
+ ( aResult == SCANRESULT_NOTFOUND ))
+ {
+ if (item.getFileStatus(fs) == osl::FileBase::E_None)
+ {
+ ::rtl::OUString aDirEntryURL;
+ if (fs.getFileType() == osl::FileStatus::Directory)
+ aDirectories.push_back( fs.getFileURL() );
+ else
+ {
+ aDirEntryURL = fs.getFileURL();
+ if ( aDirEntryURL.indexOf( sDescriptionXmlFile ) > 0 )
+ aResult = scanDescriptionXml( aDirEntryURL ) ? SCANRESULT_MIGRATE_EXTENSION : SCANRESULT_DONTMIGRATE_EXTENSION;
+ }
+ }
+ }
+
+ TStringVector::const_iterator pIter = aDirectories.begin();
+ while ( pIter != aDirectories.end() && aResult == SCANRESULT_NOTFOUND )
+ {
+ aResult = scanExtensionFolder( *pIter );
+ ++pIter;
+ }
+ }
+ return aResult;
+}
+
+bool OO3ExtensionMigration::scanDescriptionXml( const ::rtl::OUString& sDescriptionXmlURL )
+{
+ if ( !m_xDocBuilder.is() )
+ {
+ m_xDocBuilder = uno::Reference< xml::dom::XDocumentBuilder >(
+ m_ctx->getServiceManager()->createInstanceWithContext(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.dom.DocumentBuilder")),
+ m_ctx ), uno::UNO_QUERY );
+ }
+
+ if ( !m_xSimpleFileAccess.is() )
+ {
+ m_xSimpleFileAccess = uno::Reference< ucb::XSimpleFileAccess >(
+ m_ctx->getServiceManager()->createInstanceWithContext(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess")),
+ m_ctx ), uno::UNO_QUERY );
+ }
+
+ ::rtl::OUString aExtIdentifier;
+ if ( m_xDocBuilder.is() && m_xSimpleFileAccess.is() )
+ {
+ try
+ {
+ uno::Reference< io::XInputStream > xIn =
+ m_xSimpleFileAccess->openFileRead( sDescriptionXmlURL );
+
+ if ( xIn.is() )
+ {
+ uno::Reference< xml::dom::XDocument > xDoc = m_xDocBuilder->parse( xIn );
+ if ( xDoc.is() )
+ {
+ uno::Reference< xml::dom::XElement > xRoot = xDoc->getDocumentElement();
+ if ( xRoot.is() &&
+ xRoot->getTagName().equals(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("description"))) )
+ {
+ uno::Reference< xml::xpath::XXPathAPI > xPath(
+ m_ctx->getServiceManager()->createInstanceWithContext(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.xpath.XPathAPI")),
+ m_ctx),
+ uno::UNO_QUERY);
+
+ xPath->registerNS(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("desc")),
+ xRoot->getNamespaceURI());
+ xPath->registerNS(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("xlink")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("http://www.w3.org/1999/xlink")));
+
+ try
+ {
+ uno::Reference< xml::dom::XNode > xRootNode( xRoot, uno::UNO_QUERY );
+ uno::Reference< xml::dom::XNode > xNode(
+ xPath->selectSingleNode(
+ xRootNode,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("desc:identifier/@value")) ));
+ if ( xNode.is() )
+ aExtIdentifier = xNode->getNodeValue();
+ }
+ catch ( xml::xpath::XPathException& )
+ {
+ }
+ catch ( xml::dom::DOMException& )
+ {
+ }
+ }
+ }
+ }
+
+ if ( aExtIdentifier.getLength() > 0 )
+ {
+ // scan extension identifier and try to match with our black list entries
+ for ( sal_uInt32 i = 0; i < m_aBlackList.size(); i++ )
+ {
+ utl::SearchParam param(m_aBlackList[i], utl::SearchParam::SRCH_REGEXP);
+ utl::TextSearch ts(param, LANGUAGE_DONTKNOW);
+
+ xub_StrLen start = 0;
+ xub_StrLen end = static_cast<USHORT>(aExtIdentifier.getLength());
+ if (ts.SearchFrwrd(aExtIdentifier, &start, &end))
+ return false;
+ }
+ }
+ }
+ catch ( ucb::CommandAbortedException& )
+ {
+ }
+ catch ( uno::RuntimeException& )
+ {
+ }
+
+ if ( aExtIdentifier.getLength() == 0 )
+ {
+ // Fallback:
+ // Try to use the folder name to match our black list
+ // as some extensions don't provide an identifier in the
+ // description.xml!
+ for ( sal_uInt32 i = 0; i < m_aBlackList.size(); i++ )
+ {
+ utl::SearchParam param(m_aBlackList[i], utl::SearchParam::SRCH_REGEXP);
+ utl::TextSearch ts(param, LANGUAGE_DONTKNOW);
+
+ xub_StrLen start = 0;
+ xub_StrLen end = static_cast<USHORT>(sDescriptionXmlURL.getLength());
+ if (ts.SearchFrwrd(sDescriptionXmlURL, &start, &end))
+ return false;
+ }
+ }
+ }
+
+ return true;
+}
+
+bool OO3ExtensionMigration::migrateExtension( const ::rtl::OUString& sSourceDir )
+{
+ if ( !m_xPackageManager.is() )
+ {
+ try
+ {
+ m_xPackageManager = deployment::thePackageManagerFactory::get( m_ctx )->getPackageManager(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "user" )) );
+ }
+ catch ( ucb::CommandFailedException & ){}
+ catch ( uno::RuntimeException & ) {}
+ }
+
+ if ( m_xPackageManager.is() )
+ {
+ try
+ {
+ TmpRepositoryCommandEnv* pCmdEnv = new TmpRepositoryCommandEnv();
+
+ uno::Reference< ucb::XCommandEnvironment > xCmdEnv(
+ static_cast< cppu::OWeakObject* >( pCmdEnv ), uno::UNO_QUERY );
+ uno::Reference< task::XAbortChannel > xAbortChannel;
+ uno::Reference< deployment::XPackage > xPackage =
+ m_xPackageManager->addPackage( sSourceDir, ::rtl::OUString(), xAbortChannel, xCmdEnv );
+
+ if ( xPackage.is() )
+ return true;
+ }
+ catch ( ucb::CommandFailedException& )
+ {
+ }
+ catch ( ucb::CommandAbortedException& )
+ {
+ }
+ catch ( lang::IllegalArgumentException& )
+ {
+ }
+ }
+
+ return false;
+}
+
+bool OO3ExtensionMigration::copy( const ::rtl::OUString& sSourceDir, const ::rtl::OUString& sTargetDir )
+{
+ bool bRet = false;
+
+ INetURLObject aSourceObj( sSourceDir );
+ INetURLObject aDestObj( sTargetDir );
+ String aName = aDestObj.getName();
+ aDestObj.removeSegment();
+ aDestObj.setFinalSlash();
+
+ try
+ {
+ ::ucbhelper::Content aDestPath( aDestObj.GetMainURL( INetURLObject::NO_DECODE ), uno::Reference< ucb::XCommandEnvironment > () );
+ uno::Reference< ucb::XCommandInfo > xInfo = aDestPath.getCommands();
+ ::rtl::OUString aTransferName = ::rtl::OUString::createFromAscii( "transfer" );
+ if ( xInfo->hasCommandByName( aTransferName ) )
+ {
+ aDestPath.executeCommand( aTransferName, uno::makeAny(
+ ucb::TransferInfo( sal_False, aSourceObj.GetMainURL( INetURLObject::NO_DECODE ), aName, ucb::NameClash::OVERWRITE ) ) );
+ bRet = true;
+ }
+ }
+ catch( uno::Exception& )
+ {
+ }
+
+ return bRet;
+}
+
+
+// -----------------------------------------------------------------------------
+// XServiceInfo
+// -----------------------------------------------------------------------------
+
+::rtl::OUString OO3ExtensionMigration::getImplementationName() throw (RuntimeException)
+{
+ return OO3ExtensionMigration_getImplementationName();
+}
+
+// -----------------------------------------------------------------------------
+
+sal_Bool OO3ExtensionMigration::supportsService( const ::rtl::OUString& rServiceName ) throw (RuntimeException)
+{
+ Sequence< ::rtl::OUString > aNames( getSupportedServiceNames() );
+ const ::rtl::OUString* pNames = aNames.getConstArray();
+ const ::rtl::OUString* pEnd = pNames + aNames.getLength();
+ for ( ; pNames != pEnd && !pNames->equals( rServiceName ); ++pNames )
+ ;
+
+ return pNames != pEnd;
+}
+
+// -----------------------------------------------------------------------------
+
+Sequence< ::rtl::OUString > OO3ExtensionMigration::getSupportedServiceNames() throw (RuntimeException)
+{
+ return OO3ExtensionMigration_getSupportedServiceNames();
+}
+
+// -----------------------------------------------------------------------------
+// XInitialization
+// -----------------------------------------------------------------------------
+
+void OO3ExtensionMigration::initialize( const Sequence< Any >& aArguments ) throw (Exception, RuntimeException)
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ const Any* pIter = aArguments.getConstArray();
+ const Any* pEnd = pIter + aArguments.getLength();
+ for ( ; pIter != pEnd ; ++pIter )
+ {
+ beans::NamedValue aValue;
+ *pIter >>= aValue;
+ if ( aValue.Name.equalsAscii( "UserData" ) )
+ {
+ if ( !(aValue.Value >>= m_sSourceDir) )
+ {
+ OSL_ENSURE( false, "ExtensionMigration::initialize: argument UserData has wrong type!" );
+ }
+ }
+ else if ( aValue.Name.equalsAscii( "ExtensionBlackList" ) )
+ {
+ Sequence< ::rtl::OUString > aBlackList;
+ if ( (aValue.Value >>= aBlackList ) && ( aBlackList.getLength() > 0 ))
+ {
+ m_aBlackList.resize( aBlackList.getLength() );
+ ::comphelper::sequenceToArray< ::rtl::OUString >( &m_aBlackList[0], aBlackList );
+ }
+ }
+ }
+}
+
+// -----------------------------------------------------------------------------
+
+TStringVectorPtr getContent( const ::rtl::OUString& rBaseURL )
+{
+ TStringVectorPtr aResult( new TStringVector );
+ ::osl::Directory aDir( rBaseURL);
+ if ( aDir.open() == ::osl::FileBase::E_None )
+ {
+ // iterate over directory content
+ TStringVector aSubDirs;
+ ::osl::DirectoryItem aItem;
+ while ( aDir.getNextItem( aItem ) == ::osl::FileBase::E_None )
+ {
+ ::osl::FileStatus aFileStatus( FileStatusMask_Type | FileStatusMask_FileURL );
+ if ( aItem.getFileStatus( aFileStatus ) == ::osl::FileBase::E_None )
+ aResult->push_back( aFileStatus.getFileURL() );
+ }
+ }
+
+ return aResult;
+}
+
+// -----------------------------------------------------------------------------
+// XJob
+// -----------------------------------------------------------------------------
+
+void OO3ExtensionMigration::copyConfig( const ::rtl::OUString& sSourceDir, const ::rtl::OUString& sTargetDir )
+{
+ ::rtl::OUString sEx1( m_sSourceDir );
+ sEx1 += sExcludeDir1;
+ ::rtl::OUString sEx2( m_sSourceDir );
+ sEx2 += sExcludeDir2;
+
+ TStringVectorPtr aList = getContent( sSourceDir );
+ TStringVector::const_iterator aI = aList->begin();
+ while ( aI != aList->end() )
+ {
+ ::rtl::OUString sSourceLocalName = aI->copy( sSourceDir.getLength() );
+ ::rtl::OUString aTemp = aI->copy( m_sSourceDir.getLength() );
+ if ( aTemp != sExcludeDir1 && aTemp != sExcludeDir2 )
+ {
+ ::rtl::OUString sTargetName = sTargetDir + sSourceLocalName;
+ copy( (*aI), sTargetName );
+ }
+ ++aI;
+ }
+}
+
+Any OO3ExtensionMigration::execute( const Sequence< beans::NamedValue >& )
+ throw (lang::IllegalArgumentException, Exception, RuntimeException)
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ ::utl::Bootstrap::PathStatus aStatus = ::utl::Bootstrap::locateUserInstallation( m_sTargetDir );
+ if ( aStatus == ::utl::Bootstrap::PATH_EXISTS )
+ {
+ // copy all extensions
+ ::rtl::OUString sSourceDir( m_sSourceDir );
+ sSourceDir += sExtensionSubDir;
+ sSourceDir += sSubDirName;
+ sSourceDir += sExtensionRootSubDirName;
+ TStringVector aExtensionToMigrate;
+ scanUserExtensions( sSourceDir, aExtensionToMigrate );
+ if ( aExtensionToMigrate.size() > 0 )
+ {
+ TStringVector::iterator pIter = aExtensionToMigrate.begin();
+ while ( pIter != aExtensionToMigrate.end() )
+ {
+ migrateExtension( *pIter );
+ ++pIter;
+ }
+ }
+ }
+
+ return Any();
+}
+
+// -----------------------------------------------------------------------------
+// TmpRepositoryCommandEnv
+// -----------------------------------------------------------------------------
+
+TmpRepositoryCommandEnv::TmpRepositoryCommandEnv()
+{
+}
+
+TmpRepositoryCommandEnv::TmpRepositoryCommandEnv(
+ uno::Reference< task::XInteractionHandler> const & handler)
+ : m_forwardHandler(handler)
+{
+}
+
+TmpRepositoryCommandEnv::~TmpRepositoryCommandEnv()
+{
+}
+// XCommandEnvironment
+//______________________________________________________________________________
+uno::Reference< task::XInteractionHandler > TmpRepositoryCommandEnv::getInteractionHandler()
+throw ( uno::RuntimeException )
+{
+ return this;
+}
+
+//______________________________________________________________________________
+uno::Reference< ucb::XProgressHandler > TmpRepositoryCommandEnv::getProgressHandler()
+throw ( uno::RuntimeException )
+{
+ return this;
+}
+
+// XInteractionHandler
+void TmpRepositoryCommandEnv::handle(
+ uno::Reference< task::XInteractionRequest> const & xRequest )
+ throw ( uno::RuntimeException )
+{
+ uno::Any request( xRequest->getRequest() );
+ OSL_ASSERT( request.getValueTypeClass() == uno::TypeClass_EXCEPTION );
+
+ bool approve = true;
+ bool abort = false;
+
+ // select:
+ uno::Sequence< Reference< task::XInteractionContinuation > > conts(
+ xRequest->getContinuations() );
+ Reference< task::XInteractionContinuation > const * pConts =
+ conts.getConstArray();
+ sal_Int32 len = conts.getLength();
+ for ( sal_Int32 pos = 0; pos < len; ++pos )
+ {
+ if (approve) {
+ uno::Reference< task::XInteractionApprove > xInteractionApprove(
+ pConts[ pos ], uno::UNO_QUERY );
+ if (xInteractionApprove.is()) {
+ xInteractionApprove->select();
+ // don't query again for ongoing continuations:
+ approve = false;
+ }
+ }
+ else if (abort) {
+ uno::Reference< task::XInteractionAbort > xInteractionAbort(
+ pConts[ pos ], uno::UNO_QUERY );
+ if (xInteractionAbort.is()) {
+ xInteractionAbort->select();
+ // don't query again for ongoing continuations:
+ abort = false;
+ }
+ }
+ }
+}
+
+// XProgressHandler
+void TmpRepositoryCommandEnv::push( uno::Any const & /*Status*/ )
+throw (uno::RuntimeException)
+{
+}
+
+
+void TmpRepositoryCommandEnv::update( uno::Any const & /*Status */)
+throw (uno::RuntimeException)
+{
+}
+
+void TmpRepositoryCommandEnv::pop() throw (uno::RuntimeException)
+{
+}
+
+// =============================================================================
+// component operations
+// =============================================================================
+
+Reference< XInterface > SAL_CALL OO3ExtensionMigration_create(
+ Reference< XComponentContext > const & ctx )
+ SAL_THROW( () )
+{
+ return static_cast< lang::XTypeProvider * >( new OO3ExtensionMigration(
+ ctx) );
+}
+
+// -----------------------------------------------------------------------------
+
+} // namespace migration
diff --git a/desktop/source/migration/services/oo3extensionmigration.hxx b/desktop/source/migration/services/oo3extensionmigration.hxx
new file mode 100755
index 0000000000..4a2b389310
--- /dev/null
+++ b/desktop/source/migration/services/oo3extensionmigration.hxx
@@ -0,0 +1,171 @@
+/*************************************************************************
+ *
+ * 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: extensionmigration.hxx,v $
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _DESKTOP_OO3EXTENSIONMIGRATION_HXX_
+#define _DESKTOP_OO3EXTENSIONMIGRATION_HXX_
+
+#include "misc.hxx"
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/task/XJob.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/xml/dom/XDocumentBuilder.hpp>
+#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
+#include <com/sun/star/deployment/XPackageManager.hpp>
+
+#include <osl/mutex.hxx>
+#include <osl/file.hxx>
+#include <cppuhelper/implbase3.hxx>
+#include <cppuhelper/compbase3.hxx>
+#include <ucbhelper/content.hxx>
+#include <xmlscript/xmllib_imexp.hxx>
+
+namespace com { namespace sun { namespace star {
+ namespace uno {
+ class XComponentContext;
+ }
+ namespace deployment {
+ class XPackage;
+ }
+}}}
+
+class INetURLObject;
+
+
+namespace migration
+{
+
+ ::rtl::OUString SAL_CALL OO3ExtensionMigration_getImplementationName();
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL OO3ExtensionMigration_getSupportedServiceNames();
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL OO3ExtensionMigration_create(
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext )
+ SAL_THROW( (::com::sun::star::uno::Exception) );
+
+
+ // =============================================================================
+ // class ExtensionMigration
+ // =============================================================================
+
+ typedef ::cppu::WeakImplHelper3<
+ ::com::sun::star::lang::XServiceInfo,
+ ::com::sun::star::lang::XInitialization,
+ ::com::sun::star::task::XJob > ExtensionMigration_BASE;
+
+ class OO3ExtensionMigration : public ExtensionMigration_BASE
+ {
+ private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_ctx;
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::dom::XDocumentBuilder > m_xDocBuilder;
+ ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess > m_xSimpleFileAccess;
+ ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > m_xPackageManager;
+ ::osl::Mutex m_aMutex;
+ ::rtl::OUString m_sSourceDir;
+ ::rtl::OUString m_sTargetDir;
+ TStringVector m_aBlackList;
+
+ enum ScanResult
+ {
+ SCANRESULT_NOTFOUND,
+ SCANRESULT_MIGRATE_EXTENSION,
+ SCANRESULT_DONTMIGRATE_EXTENSION
+ };
+
+ ::osl::FileBase::RC checkAndCreateDirectory( INetURLObject& rDirURL );
+ void copyConfig( const ::rtl::OUString& sSourceDir, const ::rtl::OUString& sTargetDir );
+ bool copy( const ::rtl::OUString& sSourceDir, const ::rtl::OUString& sTargetDir );
+ ScanResult scanExtensionFolder( const ::rtl::OUString& sExtFolder );
+ void scanUserExtensions( const ::rtl::OUString& sSourceDir, TStringVector& aMigrateExtensions );
+ bool scanDescriptionXml( const ::rtl::OUString& sDescriptionXmlFilePath );
+ bool migrateExtension( const ::rtl::OUString& sSourceDir );
+ /* fills m_scriptElements and m_dialogElements
+ */
+ void registerConfigurationPackage(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > & xPkg);
+
+ public:
+ OO3ExtensionMigration(::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext > const & ctx);
+ virtual ~OO3ExtensionMigration();
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName()
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& rServiceName )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
+ throw (::com::sun::star::uno::RuntimeException);
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
+ throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+ // XJob
+ virtual ::com::sun::star::uno::Any SAL_CALL execute(
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& Arguments )
+ throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::Exception,
+ ::com::sun::star::uno::RuntimeException);
+ };
+
+ class TmpRepositoryCommandEnv
+ : public ::cppu::WeakImplHelper3< ::com::sun::star::ucb::XCommandEnvironment,
+ ::com::sun::star::task::XInteractionHandler,
+ ::com::sun::star::ucb::XProgressHandler >
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+ ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler> m_forwardHandler;
+ public:
+ virtual ~TmpRepositoryCommandEnv();
+ TmpRepositoryCommandEnv();
+ TmpRepositoryCommandEnv(
+ ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler> const & handler);
+
+ // XCommandEnvironment
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler > SAL_CALL
+ getInteractionHandler() throw ( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XProgressHandler >
+ SAL_CALL getProgressHandler() throw ( ::com::sun::star::uno::RuntimeException );
+
+ // XInteractionHandler
+ virtual void SAL_CALL handle(
+ ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionRequest > const & xRequest )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ // XProgressHandler
+ virtual void SAL_CALL push( ::com::sun::star::uno::Any const & Status )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL update( ::com::sun::star::uno::Any const & Status )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL pop() throw (::com::sun::star::uno::RuntimeException);
+ };
+
+//.........................................................................
+} // namespace migration
+//.........................................................................
+
+#endif // _DESKTOP_OO3EXTENSIONMIGRATION_HXX_
diff --git a/desktop/source/migration/wizard.cxx b/desktop/source/migration/wizard.cxx
index ae40a73278..64b135d87f 100644
--- a/desktop/source/migration/wizard.cxx
+++ b/desktop/source/migration/wizard.cxx
@@ -61,11 +61,14 @@
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/util/XChangesBatch.hpp>
#include <com/sun/star/container/XNameReplace.hpp>
+#include <com/sun/star/awt/WindowDescriptor.hpp>
+#include <com/sun/star/awt/WindowAttribute.hpp>
using namespace svt;
using namespace rtl;
using namespace osl;
using namespace utl;
+using namespace com::sun::star;
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
using namespace com::sun::star::beans;
@@ -77,13 +80,38 @@ using namespace com::sun::star::container;
namespace desktop
{
-const FirstStartWizard::WizardState FirstStartWizard::STATE_WELCOME = 0;
-const FirstStartWizard::WizardState FirstStartWizard::STATE_LICENSE = 1;
-const FirstStartWizard::WizardState FirstStartWizard::STATE_MIGRATION = 2;
-const FirstStartWizard::WizardState FirstStartWizard::STATE_USER = 3;
+const FirstStartWizard::WizardState FirstStartWizard::STATE_WELCOME = 0;
+const FirstStartWizard::WizardState FirstStartWizard::STATE_LICENSE = 1;
+const FirstStartWizard::WizardState FirstStartWizard::STATE_MIGRATION = 2;
+const FirstStartWizard::WizardState FirstStartWizard::STATE_USER = 3;
const FirstStartWizard::WizardState FirstStartWizard::STATE_UPDATE_CHECK = 4;
const FirstStartWizard::WizardState FirstStartWizard::STATE_REGISTRATION = 5;
+static uno::Reference< uno::XComponentContext > getComponentContext( const uno::Reference< lang::XMultiServiceFactory >& rFactory )
+{
+ uno::Reference< uno::XComponentContext > rContext;
+ uno::Reference< beans::XPropertySet > rPropSet( rFactory, uno::UNO_QUERY );
+ uno::Any a = rPropSet->getPropertyValue(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ) );
+ a >>= rContext;
+ return rContext;
+}
+
+static sal_Int32 getBuildId()
+{
+ ::rtl::OUString aDefault;
+ ::rtl::OUString aBuildIdData = utl::Bootstrap::getBuildIdData( aDefault );
+ sal_Int32 nBuildId( 0 );
+ sal_Int32 nIndex1 = aBuildIdData.indexOf(':');
+ sal_Int32 nIndex2 = aBuildIdData.indexOf(')');
+ if (( nIndex1 > 0 ) && ( nIndex2 > 0 ) && ( nIndex2-1 > nIndex1+1 ))
+ {
+ ::rtl::OUString aBuildId = aBuildIdData.copy( nIndex1+1, nIndex2-nIndex1-1 );
+ nBuildId = aBuildId.toInt32();
+ }
+ return nBuildId;
+}
+
WizardResId::WizardResId( USHORT nId ) :
ResId( nId, *FirstStartWizard::GetResManager() )
{
@@ -118,7 +146,47 @@ FirstStartWizard::FirstStartWizard( Window* pParent, sal_Bool bLicenseNeedsAccep
// enableState(STATE_USER, sal_False);
// enableState(STATE_REGISTRATION, sal_False);
- ShowButtonFixedLine(sal_True);
+ try
+ {
+ Point pos(5, 210 );
+ Size size(11, 11 );
+
+ pos = LogicToPixel( pos, MAP_APPFONT );
+ size = LogicToPixel( size, MAP_APPFONT );
+
+ uno::Reference< lang::XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory();
+ uno::Reference< awt::XToolkit > xToolkit(
+ uno::Reference< lang::XMultiComponentFactory >(
+ xFactory, uno::UNO_QUERY_THROW)->
+ createInstanceWithContext(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.Toolkit")),
+ getComponentContext(xFactory)),
+ uno::UNO_QUERY_THROW);
+
+ m_xThrobber = uno::Reference< awt::XThrobber >(
+ xToolkit->createWindow(
+ awt::WindowDescriptor(
+ awt::WindowClass_SIMPLE,
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Throbber")),
+ GetComponentInterface(), 0,
+ awt::Rectangle(
+ pos.X(), pos.Y(), size.Width(), size.Height()),
+ awt::WindowAttribute::SHOW)),
+ uno::UNO_QUERY_THROW);
+ }
+ catch (uno::RuntimeException &)
+ {
+ throw;
+ }
+ catch (Exception& )
+ {
+ }
+
+ uno::Reference< awt::XWindow > xThrobberWin( m_xThrobber, uno::UNO_QUERY );
+ if ( xThrobberWin.is() )
+ xThrobberWin->setVisible( false );
+
Size aTPSize(TP_WIDTH, TP_HEIGHT);
SetPageSizePixel(LogicToPixel(aTPSize, MAP_APPFONT));
@@ -151,6 +219,16 @@ FirstStartWizard::FirstStartWizard( Window* pParent, sal_Bool bLicenseNeedsAccep
defaultButton(WZB_NEXT);
}
+void FirstStartWizard::EnableButtonsWhileMigration()
+{
+ enableButtons(0xff, sal_True);
+}
+
+void FirstStartWizard::DisableButtonsWhileMigration()
+{
+ enableButtons(0xff, sal_False);
+}
+
::svt::RoadmapWizardTypes::PathId FirstStartWizard::defineWizardPagesDependingFromContext()
{
::svt::RoadmapWizardTypes::PathId aDefaultPath = 0;
@@ -280,7 +358,7 @@ TabPage* FirstStartWizard::createPage(WizardState _nState)
pTabPage = new LicensePage(this, WizardResId(TP_LICENSE), m_aLicensePath);
break;
case STATE_MIGRATION:
- pTabPage = new MigrationPage(this, WizardResId(TP_MIGRATION));
+ pTabPage = new MigrationPage(this, WizardResId(TP_MIGRATION), m_xThrobber );
break;
case STATE_USER:
pTabPage = new UserPage(this, WizardResId(TP_USER));
@@ -343,13 +421,21 @@ sal_Bool FirstStartWizard::prepareLeaveCurrentState( CommitPageReason _eReason )
storeAcceptDate();
m_bLicenseWasAccepted = sal_True;
- }
+ }
return svt::RoadmapWizard::prepareLeaveCurrentState(_eReason);
}
sal_Bool FirstStartWizard::leaveState(WizardState)
{
+ if (( getCurrentState() == STATE_MIGRATION ) && m_bLicenseWasAccepted )
+ {
+ // Store accept date and patch level now as it has been
+ // overwritten by the migration process!
+ storeAcceptDate();
+ setPatchLevel();
+ }
+
return sal_True;
}
@@ -436,6 +522,30 @@ void FirstStartWizard::storeAcceptDate()
}
+void FirstStartWizard::setPatchLevel()
+{
+ try {
+ Reference < XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory();
+ // get configuration provider
+ Reference< XMultiServiceFactory > theConfigProvider = Reference< XMultiServiceFactory >(
+ xFactory->createInstance(sConfigSrvc), UNO_QUERY_THROW);
+ Sequence< Any > theArgs(1);
+ NamedValue v(OUString::createFromAscii("NodePath"),
+ makeAny(OUString::createFromAscii("org.openoffice.Office.Common/Help/Registration")));
+ theArgs[0] <<= v;
+ Reference< XPropertySet > pset = Reference< XPropertySet >(
+ theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs), UNO_QUERY_THROW);
+ Any result = pset->getPropertyValue(OUString::createFromAscii("ReminderDate"));
+
+ OUString aPatchLevel( RTL_CONSTASCII_USTRINGPARAM( "Patch" ));
+ aPatchLevel += OUString::valueOf( getBuildId(), 10 );
+ pset->setPropertyValue(OUString::createFromAscii("ReminderDate"), makeAny(aPatchLevel));
+ Reference< XChangesBatch >(pset, UNO_QUERY_THROW)->commitChanges();
+ } catch (const Exception&)
+ {
+ }
+}
+
#ifdef WNT
typedef int ( __stdcall * CleanCurUserRegProc ) ( wchar_t* );
#endif
diff --git a/desktop/source/migration/wizard.hrc b/desktop/source/migration/wizard.hrc
index 7ef461f1ee..7e83748e90 100644
--- a/desktop/source/migration/wizard.hrc
+++ b/desktop/source/migration/wizard.hrc
@@ -78,6 +78,7 @@
#define ED_USER_LAST 17
#define ED_USER_FATHER 18
#define ED_USER_INITIALS 19
+#define TR_WAITING 20
// global strings
#define STR_STATE_WELCOME RID_FIRSTSTSTART_START+100
diff --git a/desktop/source/migration/wizard.hxx b/desktop/source/migration/wizard.hxx
index a994ec8274..9f26a8b4f2 100644
--- a/desktop/source/migration/wizard.hxx
+++ b/desktop/source/migration/wizard.hxx
@@ -32,6 +32,7 @@
#include <svtools/roadmapwizard.hxx>
#include <vcl/window.hxx>
#include <tools/resid.hxx>
+#include <com/sun/star/awt/XThrobber.hpp>
namespace desktop
{
@@ -61,6 +62,9 @@ public:
virtual short Execute();
virtual long PreNotify( NotifyEvent& rNEvt );
+ void EnableButtonsWhileMigration();
+ void DisableButtonsWhileMigration();
+
private:
sal_Bool m_bOverride;
WizardState _currentState;
@@ -73,10 +77,12 @@ private:
sal_Bool m_bLicenseWasAccepted;
sal_Bool m_bAutomaticUpdChk;
Link m_lnkCancel;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XThrobber > m_xThrobber;
rtl::OUString m_aLicensePath;
void storeAcceptDate();
+ void setPatchLevel();
void disableWizard();
void enableQuickstart();
diff --git a/desktop/source/offacc/exports.map b/desktop/source/offacc/exports.map
deleted file mode 100644
index ba501f9ae0..0000000000
--- a/desktop/source/offacc/exports.map
+++ /dev/null
@@ -1,10 +0,0 @@
-UDK_3_0_0 {
- global:
- GetVersionInfo;
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/desktop/source/offacc/makefile.mk b/desktop/source/offacc/makefile.mk
index fb5cb9ab93..c2d53930b5 100644
--- a/desktop/source/offacc/makefile.mk
+++ b/desktop/source/offacc/makefile.mk
@@ -47,7 +47,7 @@ SHL1OBJS= $(SLOFILES)
SHL1TARGET= $(TARGET)$(DLLPOSTFIX)
SHL1IMPLIB= i$(TARGET)
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
diff --git a/desktop/source/pagein/makefile.mk b/desktop/source/pagein/makefile.mk
index c50dc43fe5..01452a858e 100644
--- a/desktop/source/pagein/makefile.mk
+++ b/desktop/source/pagein/makefile.mk
@@ -119,7 +119,7 @@ $(MISC)$/$(TARGET)-common : makefile.mk
@-echo $(DLLPRE)package2$(DLLPOST) >> $@
@-echo $(DLLPRE)ucpfile1$(DLLPOST) >> $@
@-echo $(DLLPRE)ucb1$(DLLPOST) >> $@
- @-echo configmgr2$(UNODLLPOST) >> $@
+ @-echo $(DLLPRE)configmgr$(DLLPOST) >> $@
#
@-echo $(DLLPRE)dtrans$(DLLPOST) >> $@
@-echo $(DLLPRE)vclplug_gen$(DFTDLLPOST) >> $@
diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
index 6b49ed0f48..dc976718dc 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
@@ -82,6 +82,8 @@ const char s_usingText [] =
" -V, --version version information\n"
" -v, --verbose verbose output to stdout\n"
" -f, --force force overwriting existing extensions\n"
+" -s, --suppress-license prevents showing the license provided that\n"
+" the extension allows it\n"
" --log-file <file> custom log file; default: <cache-dir>/log.txt\n"
" --shared expert feature: operate on shared installation\n"
" deployment context;\n"
@@ -103,6 +105,7 @@ const OptionInfo s_option_infos [] = {
{ RTL_CONSTASCII_STRINGPARAM("shared"), '\0', false },
{ RTL_CONSTASCII_STRINGPARAM("deployment-context"), '\0', true },
{ RTL_CONSTASCII_STRINGPARAM("bundled"), '\0', false},
+ { RTL_CONSTASCII_STRINGPARAM("suppress-license"), 's', false},
{ 0, 0, '\0', false }
};
@@ -207,6 +210,7 @@ extern "C" int unopkg_main()
bool option_force = false;
bool option_verbose = false;
bool option_bundled = false;
+ bool option_suppressLicense = false;
bool subcmd_add = false;
bool subcmd_gui = false;
OUString logFile;
@@ -230,6 +234,9 @@ extern "C" int unopkg_main()
s_option_infos, OUSTR("version") );
OptionInfo const * info_bundled = getOptionInfo(
s_option_infos, OUSTR("bundled") );
+ OptionInfo const * info_suppressLicense = getOptionInfo(
+ s_option_infos, OUSTR("suppress-license") );
+
Reference<XComponentContext> xComponentContext;
Reference<XComponentContext> xLocalComponentContext;
@@ -271,6 +278,7 @@ extern "C" int unopkg_main()
!readOption( &option_shared, info_shared, &nPos ) &&
!readOption( &option_force, info_force, &nPos ) &&
!readOption( &option_bundled, info_bundled, &nPos ) &&
+ !readOption( &option_suppressLicense, info_suppressLicense, &nPos ) &&
!readArgument( &deploymentContext, info_context, &nPos ) &&
!isBootstrapVariable(&nPos))
{
@@ -342,7 +350,8 @@ extern "C" int unopkg_main()
Reference< ::com::sun::star::ucb::XCommandEnvironment > xCmdEnv(
createCmdEnv( xComponentContext, logFile,
- option_force, option_verbose, option_bundled) );
+ option_force, option_verbose, option_bundled,
+ option_suppressLicense) );
if (subcmd_add ||
subCommand.equalsAsciiL(
diff --git a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx
index 68eb11f91b..808f30712f 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx
@@ -86,6 +86,7 @@ class CommandEnvironmentImpl
bool m_option_force_overwrite;
bool m_option_verbose;
bool m_option_bundled;
+ bool m_option_suppressLicense;
Reference< XComponentContext > m_xComponentContext;
Reference< XProgressHandler > m_xLogFile;
@@ -99,7 +100,8 @@ public:
OUString const & log_file,
bool option_force_overwrite,
bool option_verbose,
- bool option_bundled);
+ bool option_bundled,
+ bool option_suppressLicense);
// XCommandEnvironment
virtual Reference< task::XInteractionHandler > SAL_CALL
@@ -124,11 +126,13 @@ CommandEnvironmentImpl::CommandEnvironmentImpl(
OUString const & log_file,
bool option_force_overwrite,
bool option_verbose,
- bool option_bundled)
+ bool option_bundled,
+ bool option_suppressLicense)
: m_logLevel(0),
m_option_force_overwrite( option_force_overwrite ),
m_option_verbose( option_verbose ),
m_option_bundled( option_bundled),
+ m_option_suppressLicense( option_suppressLicense),
m_xComponentContext(xComponentContext)
{
if (log_file.getLength() > 0) {
@@ -279,15 +283,25 @@ void CommandEnvironmentImpl::handle(
}
else if (request >>= licAgreementExc)
{
- String sResMsg( ResId( RID_STR_UNOPKG_NO_SHARED_ALLOWED, *DeploymentResMgr::get() ) );
- sResMsg.SearchAndReplaceAllAscii( "%NAME", licAgreementExc.ExtensionName );
- dp_misc::writeConsole(OUSTR("\n") + sResMsg + OUSTR("\n\n"));
- abort = true;
+ if (m_option_suppressLicense && licAgreementExc.SuppressIfRequired)
+ {
+ approve = true;
+ }
+ else
+ {
+ String sResMsg( ResId( RID_STR_UNOPKG_NO_SHARED_ALLOWED, *DeploymentResMgr::get() ) );
+ sResMsg.SearchAndReplaceAllAscii( "%NAME", licAgreementExc.ExtensionName );
+ dp_misc::writeConsole(OUSTR("\n") + sResMsg + OUSTR("\n\n"));
+ abort = true;
+ }
}
else if (request >>= licExc)
{
bLicenseException = true;
- printLicense(licExc.Text, approve, abort);
+ if (m_option_suppressLicense && licExc.SuppressIfRequired)
+ approve = true;
+ else
+ printLicense(licExc.Text, approve, abort);
}
else if (request >>= instExc)
{
@@ -432,10 +446,12 @@ Reference< XCommandEnvironment > createCmdEnv(
OUString const & logFile,
bool option_force_overwrite,
bool option_verbose,
- bool option_bundled)
+ bool option_bundled,
+ bool option_suppressLicense)
{
return new CommandEnvironmentImpl(
- xContext, logFile, option_force_overwrite, option_verbose, option_bundled);
+ xContext, logFile, option_force_overwrite, option_verbose, option_bundled,
+ option_suppressLicense);
}
} // unopkg
diff --git a/desktop/source/pkgchk/unopkg/unopkg_shared.h b/desktop/source/pkgchk/unopkg/unopkg_shared.h
index 397c57c6a3..07a30abfb3 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_shared.h
+++ b/desktop/source/pkgchk/unopkg/unopkg_shared.h
@@ -163,7 +163,8 @@ css::uno::Reference<css::ucb::XCommandEnvironment> createCmdEnv(
::rtl::OUString const & logFile,
bool option_force_overwrite,
bool option_verbose,
- bool option_bundled);
+ bool option_bundled,
+ bool option_suppressLicense);
//==============================================================================
void printf_packages(
diff --git a/desktop/source/pkgchk/unopkg/version.map b/desktop/source/pkgchk/unopkg/version.map
index b729ec6eb6..8591bb3b58 100644
--- a/desktop/source/pkgchk/unopkg/version.map
+++ b/desktop/source/pkgchk/unopkg/version.map
@@ -25,7 +25,7 @@
#
#*************************************************************************
-unopkg.3 {
+UDK_3_0_0 {
global:
unopkg_main;
diff --git a/desktop/source/so_comp/exports.map b/desktop/source/so_comp/exports.map
deleted file mode 100644
index ba501f9ae0..0000000000
--- a/desktop/source/so_comp/exports.map
+++ /dev/null
@@ -1,10 +0,0 @@
-UDK_3_0_0 {
- global:
- GetVersionInfo;
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/desktop/source/so_comp/makefile.mk b/desktop/source/so_comp/makefile.mk
index b16ae7a009..590f99518c 100644
--- a/desktop/source/so_comp/makefile.mk
+++ b/desktop/source/so_comp/makefile.mk
@@ -55,7 +55,7 @@ SHL1OBJS= $(SLOFILES)
SHL1TARGET= $(TARGET)
SHL1IMPLIB= i$(TARGET)
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
diff --git a/desktop/source/splash/exports.map b/desktop/source/splash/exports.map
deleted file mode 100644
index ba501f9ae0..0000000000
--- a/desktop/source/splash/exports.map
+++ /dev/null
@@ -1,10 +0,0 @@
-UDK_3_0_0 {
- global:
- GetVersionInfo;
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/desktop/source/splash/makefile.mk b/desktop/source/splash/makefile.mk
index 518ccc11ad..8960968743 100644
--- a/desktop/source/splash/makefile.mk
+++ b/desktop/source/splash/makefile.mk
@@ -54,7 +54,7 @@ SHL1OBJS= $(SLOFILES) \
SHL1TARGET=$(TARGET)$(DLLPOSTFIX)
SHL1IMPLIB=i$(TARGET)
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
diff --git a/desktop/source/splash/splash.cxx b/desktop/source/splash/splash.cxx
index 623799cbcb..7e2313b5eb 100644
--- a/desktop/source/splash/splash.cxx
+++ b/desktop/source/splash/splash.cxx
@@ -44,6 +44,8 @@
#include <rtl/logfile.hxx>
#include <rtl/ustrbuf.hxx>
#include <rtl/math.hxx>
+#include <vcl/graph.hxx>
+#include <svtools/filter.hxx>
#define NOT_LOADED ((long)-1)
@@ -58,6 +60,7 @@ SplashScreen::SplashScreen(const Reference< XMultiServiceFactory >& rSMgr)
, _vdev(*((IntroWindow*)this))
, _cProgressFrameColor(sal::static_int_cast< ColorData >(NOT_LOADED))
, _cProgressBarColor(sal::static_int_cast< ColorData >(NOT_LOADED))
+ , _bNativeProgress(true)
, _iMax(100)
, _iProgress(0)
, _eBitmapMode(BM_DEFAULTMODE)
@@ -295,6 +298,9 @@ void SplashScreen::loadConfig()
OUString( RTL_CONSTASCII_USTRINGPARAM( "ProgressPosition" ) ) );
OUString sFullScreenSplash = implReadBootstrapKey(
OUString( RTL_CONSTASCII_USTRINGPARAM( "FullScreenSplash" ) ) );
+ OUString sNativeProgress = implReadBootstrapKey(
+ OUString( RTL_CONSTASCII_USTRINGPARAM( "NativeProgress" ) ) );
+
// Determine full screen splash mode
_bFullScreenSplash = (( sFullScreenSplash.getLength() > 0 ) &&
@@ -344,6 +350,11 @@ void SplashScreen::loadConfig()
_cProgressBarColor = Color( nRed, nGreen, nBlue );
}
}
+
+ if( sNativeProgress.getLength() )
+ {
+ _bNativeProgress = sNativeProgress.toBoolean();
+ }
if ( sSize.getLength() )
{
@@ -418,9 +429,15 @@ bool SplashScreen::loadBitmap(
SvFileStream aStrm( aObj.PathToFileName(), STREAM_STD_READ );
if ( !aStrm.GetError() )
{
+ // Use graphic class to also support more graphic formats (bmp,png,...)
+ Graphic aGraphic;
+
+ GraphicFilter* pGF = GraphicFilter::GetGraphicFilter();
+ pGF->ImportGraphic( aGraphic, String(), aStrm, GRFILTER_FORMAT_DONTKNOW );
+
// Default case, we load the intro bitmap from a seperate file
// (e.g. staroffice_intro.bmp or starsuite_intro.bmp)
- aStrm >> _aIntroBmp;
+ _aIntroBmp = aGraphic.GetBitmapEx();
return true;
}
@@ -438,8 +455,14 @@ bool SplashScreen::findBitmap(rtl::OUString const & path) {
haveBitmap = findAppBitmap(path);
}
if ( !haveBitmap )
+ {
haveBitmap = loadBitmap(
- path, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("intro.bmp")));
+ path, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("intro.png")));
+ if ( !haveBitmap )
+ haveBitmap = loadBitmap(
+ path, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("intro.bmp")));
+ }
+
return haveBitmap;
}
@@ -469,21 +492,34 @@ bool SplashScreen::findScreenBitmap(rtl::OUString const & path)
aStrBuf.append( OUString::valueOf( nWidth ));
aStrBuf.appendAscii( "x" );
aStrBuf.append( OUString::valueOf( nHeight ));
- aStrBuf.appendAscii( ".bmp" );
- OUString aBmpFileName = aStrBuf.makeStringAndClear();
+
+ OUString aRootIntroFileName = aStrBuf.makeStringAndClear();
+ OUString aBmpFileName = aRootIntroFileName + OUString::createFromAscii(".png");
bool haveBitmap = loadBitmap( path, aBmpFileName );
if ( !haveBitmap )
{
+ aBmpFileName = aRootIntroFileName + OUString::createFromAscii(".bmp");
+ haveBitmap = loadBitmap( path, aBmpFileName );
+ }
+
+ if ( !haveBitmap )
+ {
aStrBuf.appendAscii( "intro_" );
aStrBuf.appendAscii( "_" );
aStrBuf.append( OUString::valueOf( nWidth ));
aStrBuf.appendAscii( "x" );
aStrBuf.append( OUString::valueOf( nHeight ));
- aStrBuf.appendAscii( ".bmp" );
- aBmpFileName = aStrBuf.makeStringAndClear();
+
+ aRootIntroFileName = aStrBuf.makeStringAndClear();
+ aBmpFileName = aRootIntroFileName + OUString::createFromAscii(".png");
haveBitmap = loadBitmap( path, aBmpFileName );
+ if ( !haveBitmap )
+ {
+ aBmpFileName = aRootIntroFileName + OUString::createFromAscii(".bmp");
+ haveBitmap = loadBitmap( path, aBmpFileName );
+ }
}
return haveBitmap;
}
@@ -498,9 +534,16 @@ bool SplashScreen::findAppBitmap(rtl::OUString const & path)
aStrBuf.appendAscii( "intro_" );
aStrBuf.appendAscii( "_" );
aStrBuf.append( _sAppName );
- aStrBuf.appendAscii( ".bmp" );
- OUString aBmpFileName = aStrBuf.makeStringAndClear();
+
+ OUString aRootIntroFileName = aStrBuf.makeStringAndClear();
+
+ OUString aBmpFileName = aRootIntroFileName + OUString::createFromAscii( ".png" );
haveBitmap = loadBitmap( path, aBmpFileName );
+ if ( !haveBitmap )
+ {
+ aBmpFileName = aRootIntroFileName + OUString::createFromAscii( ".bmp" );
+ haveBitmap = loadBitmap( path, aBmpFileName );
+ }
}
return haveBitmap;
}
@@ -584,9 +627,9 @@ void SplashScreen::Paint( const Rectangle&)
BOOL bNativeOK = FALSE;
// in case of native controls we need to draw directly to the window
- if( IsNativeControlSupported( CTRL_INTROPROGRESS, PART_ENTIRE_CONTROL ) )
+ if( _bNativeProgress && IsNativeControlSupported( CTRL_INTROPROGRESS, PART_ENTIRE_CONTROL ) )
{
- DrawBitmap( Point(), _aIntroBmp );
+ DrawBitmapEx( Point(), _aIntroBmp );
ImplControlValue aValue( _iProgress * _barwidth / _iMax);
Rectangle aDrawRect( Point(_tlx, _tly), Size( _barwidth, _barheight ) );
@@ -612,7 +655,7 @@ void SplashScreen::Paint( const Rectangle&)
//non native drawing
// draw bitmap
if (_bPaintBitmap)
- _vdev.DrawBitmap( Point(), _aIntroBmp );
+ _vdev.DrawBitmapEx( Point(), _aIntroBmp );
if (_bPaintProgress) {
// draw progress...
diff --git a/desktop/source/splash/splash.hxx b/desktop/source/splash/splash.hxx
index 77f34be5ce..8d1bfb7dbe 100644
--- a/desktop/source/splash/splash.hxx
+++ b/desktop/source/splash/splash.hxx
@@ -34,7 +34,7 @@
#include <cppuhelper/implbase2.hxx>
#include <cppuhelper/interfacecontainer.h>
#include <vcl/introwin.hxx>
-#include <vcl/bitmap.hxx>
+#include <vcl/bitmapex.hxx>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <osl/mutex.hxx>
#include <vcl/virdev.hxx>
@@ -86,9 +86,10 @@ private:
Reference< XMultiServiceFactory > _rFactory;
VirtualDevice _vdev;
- Bitmap _aIntroBmp;
+ BitmapEx _aIntroBmp;
Color _cProgressFrameColor;
Color _cProgressBarColor;
+ bool _bNativeProgress;
OUString _sAppName;
std::vector< FullScreenProgressRatioValue > _sFullScreenProgressRatioValues;
diff --git a/desktop/test/deployment/simple_license/suppress_license.oxt b/desktop/test/deployment/simple_license/suppress_license.oxt
new file mode 100755
index 0000000000..2bacd6aa37
--- /dev/null
+++ b/desktop/test/deployment/simple_license/suppress_license.oxt
Binary files differ
diff --git a/desktop/test/deployment/simple_license/tests_simple_license.odt b/desktop/test/deployment/simple_license/tests_simple_license.odt
index b0f5410d99..b0c86e11c6 100644
--- a/desktop/test/deployment/simple_license/tests_simple_license.odt
+++ b/desktop/test/deployment/simple_license/tests_simple_license.odt
Binary files differ
diff --git a/desktop/util/ooverinfo.rc b/desktop/util/ooverinfo.rc
index 7a80adcad6..6d92e2a995 100644
--- a/desktop/util/ooverinfo.rc
+++ b/desktop/util/ooverinfo.rc
@@ -69,7 +69,7 @@ VS_VERSION_INFO versioninfo
value "ProductVersion", PPS(VER_LEVEL) "\0"
value "OriginalFilename", "SOFFICE.EXE\0"
value "InternalName", "SOFFICE\0"
- value "LegalCopyright", S_CRIGHT " Sun Microsystems, Inc.\0"
+ value "LegalCopyright", S_CRIGHT " Oracle, Inc.\0"
}
#else
block "040904E4"
@@ -81,7 +81,7 @@ VS_VERSION_INFO versioninfo
value "ProductVersion", PPS(VER_LEVEL) "\0"
value "OriginalFilename", "SOFFICE.EXE\0"
value "InternalName", "SOFFICE\0"
- value "LegalCopyright", S_CRIGHT " Sun Microsystems, Inc.\0"
+ value "LegalCopyright", S_CRIGHT " Oracle, Inc.\0"
}
#endif
}
@@ -96,44 +96,43 @@ VS_VERSION_INFO versioninfo
}
}
-
-2 ICON "icons\\ooo3_writer_doc.ico"
-3 ICON "icons\\ooo3_writer_tem.ico"
-4 ICON "icons\\ooo3_calc_doc.ico"
-5 ICON "icons\\ooo3_calc_tem.ico"
-6 ICON "icons\\ooo3_draw_doc.ico"
-7 ICON "icons\\ooo3_draw_tem.ico"
-8 ICON "icons\\ooo3_impress_doc.ico"
-9 ICON "icons\\ooo3_impress_tem.ico"
-10 ICON "icons\\ooo3_impress_doc.ico"
-11 ICON "icons\\ooo3_global_doc.ico"
-12 ICON "icons\\ooo3_html_doc.ico"
-13 ICON "icons\\ooo3_chart_doc.ico"
-14 ICON "icons\\ooo3_base_doc.ico"
-15 ICON "icons\\ooo3_math_doc.ico"
-16 ICON "icons\\ooo3_empty_tem.ico"
-17 ICON "icons\\ooo3_macro_doc.ico"
+2 ICON "icons\\oasis-text.ico"
+3 ICON "icons\\oasis-text-template.ico"
+4 ICON "icons\\oasis-spreadsheet.ico"
+5 ICON "icons\\oasis-spreadsheet-template.ico"
+6 ICON "icons\\oasis-drawing.ico"
+7 ICON "icons\\oasis-drawing-template.ico"
+8 ICON "icons\\oasis-presentation.ico"
+9 ICON "icons\\oasis-presentation-template.ico"
+10 ICON "icons\\oasis-presentation-template.ico"
+11 ICON "icons\\oasis-master-document.ico"
+12 ICON "icons\\oasis-web-template.ico"
+13 ICON "icons\\oasis-empty-document.ico"
+14 ICON "icons\\oasis-database.ico"
+15 ICON "icons\\oasis-formula.ico"
+16 ICON "icons\\oasis-web-template.ico"
+17 ICON "icons\\empty-document.ico"
18 ICON "icons\\ooo-configuration.ico"
-19 ICON "icons\\ooo-open.ico"
-20 ICON "icons\\ooo-image-doc.ico"
+19 ICON "icons\\ooo3_open.ico"
+20 ICON "icons\\empty-document.ico"
21 ICON "icons\\ooo3_writer_app.ico"
22 ICON "icons\\ooo3_calc_app.ico"
23 ICON "icons\\ooo3_draw_app.ico"
24 ICON "icons\\ooo3_impress_app.ico"
25 ICON "icons\\ooo3_math_app.ico"
26 ICON "icons\\ooo3_base_app.ico"
-27 ICON "icons\\ooo3_empty_doc.ico"
-28 ICON "icons\\ooo11-writer-doc.ico"
-29 ICON "icons\\ooo11-writer-tem.ico"
-30 ICON "icons\\ooo11-calc-doc.ico"
-31 ICON "icons\\ooo11-calc-tem.ico"
-32 ICON "icons\\ooo11-draw-doc.ico"
-33 ICON "icons\\ooo11-draw-tem.ico"
-34 ICON "icons\\ooo11-impress-doc.ico"
-35 ICON "icons\\ooo11-impress-tem.ico"
-36 ICON "icons\\ooo11-master-doc.ico"
-37 ICON "icons\\ooo11-chart-doc.ico"
-38 ICON "icons\\ooo11-base-doc.ico"
-39 ICON "icons\\ooo11-math-doc.ico"
+27 ICON "icons\\oasis-empty-document.ico"
+28 ICON "icons\\text.ico"
+29 ICON "icons\\text-template.ico"
+30 ICON "icons\\spreadsheet.ico"
+31 ICON "icons\\spreadsheet-template.ico"
+32 ICON "icons\\drawing.ico"
+33 ICON "icons\\drawing-template.ico"
+34 ICON "icons\\presentation.ico"
+35 ICON "icons\\presentation-template.ico"
+36 ICON "icons\\master-document.ico"
+37 ICON "icons\\empty-document.ico"
+38 ICON "icons\\database.ico"
+39 ICON "icons\\formula.ico"
40 ICON "icons\\oxt-extension.ico"
diff --git a/desktop/util/ooverinfo2.rc b/desktop/util/ooverinfo2.rc
index adf7aac708..f149ec6474 100644
--- a/desktop/util/ooverinfo2.rc
+++ b/desktop/util/ooverinfo2.rc
@@ -48,42 +48,43 @@
// -----------------------------------------------------------------------
-ICON 2 "icons/ooo-writer-doc.ico"
-ICON 3 "icons/ooo-writer-tem.ico"
-ICON 4 "icons/ooo-calc-doc.ico"
-ICON 5 "icons/ooo-calc-tem.ico"
-ICON 6 "icons/ooo-draw-doc.ico"
-ICON 7 "icons/ooo-draw-tem.ico"
-ICON 8 "icons/ooo-impress-doc.ico"
-ICON 9 "icons/ooo-impress-tem.ico"
-ICON 10 "icons/ooo-impress-doc.ico"
-//ICON 11 "icons/ooo-global-doc.ico"
-//ICON 12 "icons/ooo-html-doc.ico"
-ICON 13 "icons/ooo-chart-doc.ico"
-ICON 14 "icons/ooo-base-doc.ico"
-ICON 15 "icons/ooo-math-doc.ico"
-ICON 16 "icons/ooo-empty-tem.ico"
-ICON 17 "icons/ooo-macro-doc.ico"
+ICON 2 "icons/oasis-text.ico"
+ICON 3 "icons/oasis-text-template.ico"
+ICON 4 "icons/oasis-spreadsheet.ico"
+ICON 5 "icons/oasis-spreadsheet-template.ico"
+ICON 6 "icons/oasis-drawing.ico"
+ICON 7 "icons/oasis-drawing-template.ico"
+ICON 8 "icons/oasis-presentation.ico"
+ICON 9 "icons/oasis-presentation-template.ico"
+ICON 10 "icons/oasis-presentation-template.ico"
+// ICON 11 "icons/oasis-master-document.ico"
+// ICON 12 "icons/oasis-web-template.ico"
+ICON 13 "icons/oasis-empty-document.ico"
+ICON 14 "icons/oasis-database.ico"
+ICON 15 "icons/oasis-formula.ico"
+ICON 16 "icons/oasis-web-template.ico"
+ICON 17 "icons/empty-document.ico"
ICON 18 "icons/ooo-configuration.ico"
ICON 19 "icons/ooo-open.ico"
-ICON 20 "icons/ooo-image-doc.ico"
+ICON 20 "icons/empty-document.ico"
ICON 21 "icons/ooo-writer-app.ico"
ICON 22 "icons/ooo-calc-app.ico"
ICON 23 "icons/ooo-draw-app.ico"
ICON 24 "icons/ooo-impress-app.ico"
ICON 25 "icons/ooo-math-app.ico"
ICON 26 "icons/ooo-base-app.ico"
-ICON 27 "icons/ooo-empty-doc.ico"
-ICON 28 "icons/ooo11-writer-doc.ico"
-ICON 29 "icons/ooo11-writer-tem.ico"
-ICON 30 "icons/ooo11-calc-doc.ico"
-ICON 31 "icons/ooo11-calc-tem.ico"
-ICON 32 "icons/ooo11-draw-doc.ico"
-ICON 33 "icons/ooo11-draw-tem.ico"
-ICON 34 "icons/ooo11-impress-doc.ico"
-ICON 35 "icons/ooo11-impress-tem.ico"
-ICON 36 "icons/ooo11-master-doc.ico"
-ICON 37 "icons/ooo11-chart-doc.ico"
-ICON 38 "icons/ooo11-base-doc.ico"
-ICON 39 "icons/ooo11-math-doc.ico"
+ICON 27 "icons/oasis-empty-document.ico"
+ICON 28 "icons/text.ico"
+ICON 29 "icons/text-template.ico"
+ICON 30 "icons/spreadsheet.ico"
+ICON 31 "icons/spreadsheet-template.ico"
+ICON 32 "icons/drawing.ico"
+ICON 33 "icons/drawing-template.ico"
+ICON 34 "icons/presentation.ico"
+ICON 35 "icons/presentation-template.ico"
+ICON 36 "icons/master-document.ico"
+ICON 37 "icons/empty-document.ico"
+ICON 38 "icons/database.ico"
+ICON 39 "icons/formula.ico"
+ICON 40 "icons/oxt-extension.ico"
diff --git a/desktop/util/verinfo.rc b/desktop/util/verinfo.rc
index a9f3dcd3f4..038953f2aa 100644
--- a/desktop/util/verinfo.rc
+++ b/desktop/util/verinfo.rc
@@ -68,25 +68,25 @@ VS_VERSION_INFO versioninfo
block "040704E4"
{
// German StringTable
- value "CompanyName", "Sun Microsystems, Inc.\0"
+ value "CompanyName", "Oracle, Inc.\0"
value "FileDescription", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\0"
value "FileVersion", PPS(VER_LEVEL) "\0"
value "ProductVersion", PPS(VER_LEVEL) "\0"
value "OriginalFilename", "SOFFICE.EXE\0"
value "InternalName", "SOFFICE\0"
- value "LegalCopyright", S_CRIGHT " Sun Microsystems, Inc.\0"
+ value "LegalCopyright", S_CRIGHT " Oracle, Inc.\0"
}
#else
block "040904E4"
{
// International StringTable
- value "CompanyName", "Sun Microsystems, Inc.\0"
+ value "CompanyName", "Oracle, Inc.\0"
value "FileDescription", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\0"
value "FileVersion", PPS(VER_LEVEL) "\0"
value "ProductVersion", PPS(VER_LEVEL) "\0"
value "OriginalFilename", "SOFFICE.EXE\0"
value "InternalName", "SOFFICE\0"
- value "LegalCopyright", S_CRIGHT " Sun Microsystems, Inc.\0"
+ value "LegalCopyright", S_CRIGHT " Oracle, Inc.\0"
}
#endif
}
@@ -115,10 +115,10 @@ VS_VERSION_INFO versioninfo
13 ICON "icons\\oasis-empty-document.ico"
14 ICON "icons\\oasis-database.ico"
15 ICON "icons\\oasis-formula.ico"
-16 ICON "icons\\empty-template.ico"
+16 ICON "icons\\oasis-web-template.ico"
17 ICON "icons\\empty-document.ico"
18 ICON "icons\\so8-configuration.ico"
-19 ICON "icons\\so8-open.ico"
+19 ICON "icons\\so9_open.ico"
20 ICON "icons\\empty-document.ico"
21 ICON "icons\\so9_writer_app.ico"
22 ICON "icons\\so9_calc_app.ico"
diff --git a/desktop/win32/source/applauncher/makefile.mk b/desktop/win32/source/applauncher/makefile.mk
index 4285476475..f0f5743f38 100644
--- a/desktop/win32/source/applauncher/makefile.mk
+++ b/desktop/win32/source/applauncher/makefile.mk
@@ -129,7 +129,7 @@ APP6PRODUCTDEF+=-DRES_APP_NAME=smath
APP7TARGET=so$/sweb
APP7NOSAL=TRUE
APP7LINKRES=$(MISC)$/$(TARGET)7.res
-APP7ICON=$(SOLARRESDIR)$/icons/so9_html_doc.ico
+APP7ICON=$(SOLARRESDIR)$/icons/so9_writer_app.ico
APP7OBJS = \
$(OBJ)$/launcher.obj\
$(OBJ)$/sweb.obj
diff --git a/desktop/win32/source/applauncher/ooo/makefile.mk b/desktop/win32/source/applauncher/ooo/makefile.mk
index 9c60ad1b48..02f240cce9 100644
--- a/desktop/win32/source/applauncher/ooo/makefile.mk
+++ b/desktop/win32/source/applauncher/ooo/makefile.mk
@@ -116,7 +116,7 @@ APP7DEPN=verinfo.rc
APP7VERINFO=verinfo.rc
APP7NOSAL=TRUE
APP7LINKRES=$(MISC)$/$(TARGET)7.res
-APP7ICON=$(SOLARRESDIR)$/icons/ooo3_html_doc.ico
+APP7ICON=$(SOLARRESDIR)$/icons/ooo3_writer_app.ico
APP7OBJS = \
$(OBJ)$/launcher.obj\
$(OBJ)$/sweb.obj
diff --git a/desktop/zipintro/makefile.mk b/desktop/zipintro/makefile.mk
index 6a1ff592d6..fef106d1e0 100644
--- a/desktop/zipintro/makefile.mk
+++ b/desktop/zipintro/makefile.mk
@@ -36,29 +36,29 @@ TARGET=zipintro
DEFAULT_FLAVOURS=dev dev_nologo nologo broffice dev_broffice nologo_broffice nologo_dev_broffice intro
ZIP1LIST= \
- $(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/dev$/introabout$/intro.bmp $(INTRO_BITMAPS)) \
- $(null,$(ABOUT_BITMAPS) $(MISC)$/$(RSCDEFIMG)$/introabout$/about.bmp $(ABOUT_BITMAPS))
+ $(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/dev$/introabout$/intro.png $(INTRO_BITMAPS)) \
+ $(null,$(ABOUT_BITMAPS) $(MISC)$/$(RSCDEFIMG)$/introabout$/about.png $(ABOUT_BITMAPS))
ZIP2LIST= \
- $(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/dev_nologo$/introabout$/intro.bmp $(INTRO_BITMAPS)) \
- $(null,$(ABOUT_BITMAPS) $(MISC)$/$(RSCDEFIMG)$/introabout$/about.bmp $(ABOUT_BITMAPS))
+ $(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/dev_nologo$/introabout$/intro.png $(INTRO_BITMAPS)) \
+ $(null,$(ABOUT_BITMAPS) $(MISC)$/$(RSCDEFIMG)$/introabout$/about.png $(ABOUT_BITMAPS))
ZIP3LIST= \
- $(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/nologo$/introabout$/intro.bmp $(INTRO_BITMAPS)) \
- $(null,$(ABOUT_BITMAPS) $(MISC)$/$(RSCDEFIMG)$/introabout$/about.bmp $(ABOUT_BITMAPS))
+ $(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/nologo$/introabout$/intro.png $(INTRO_BITMAPS)) \
+ $(null,$(ABOUT_BITMAPS) $(MISC)$/$(RSCDEFIMG)$/introabout$/about.png $(ABOUT_BITMAPS))
ZIP4LIST= \
- $(null,$(INTRO_BITMAPS) $(MISC)$/$(RSCDEFIMG)$/introabout$/intro.bmp $(INTRO_BITMAPS)) \
- $(null,$(ABOUT_BITMAPS) $(MISC)$/$(RSCDEFIMG)$/introabout$/about.bmp $(ABOUT_BITMAPS))
+ $(null,$(INTRO_BITMAPS) $(MISC)$/$(RSCDEFIMG)$/introabout$/intro.png $(INTRO_BITMAPS)) \
+ $(null,$(ABOUT_BITMAPS) $(MISC)$/$(RSCDEFIMG)$/introabout$/about.png $(ABOUT_BITMAPS))
ZIP5LIST= \
- $(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/dev_broffice$/introabout$/intro.bmp $(INTRO_BITMAPS)) \
- $(null,$(ABOUT_BITMAPS) $(MISC)$/ooo_custom_images$/broffice$/introabout$/about.bmp $(ABOUT_BITMAPS))
+ $(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/dev_broffice$/introabout$/intro.png $(INTRO_BITMAPS)) \
+ $(null,$(ABOUT_BITMAPS) $(MISC)$/ooo_custom_images$/broffice$/introabout$/about.png $(ABOUT_BITMAPS))
ZIP6LIST= \
- $(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/broffice$/introabout$/intro.bmp $(INTRO_BITMAPS)) \
- $(null,$(ABOUT_BITMAPS) $(MISC)$/ooo_custom_images$/broffice$/introabout$/about.bmp $(ABOUT_BITMAPS))
+ $(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/broffice$/introabout$/intro.png $(INTRO_BITMAPS)) \
+ $(null,$(ABOUT_BITMAPS) $(MISC)$/ooo_custom_images$/broffice$/introabout$/about.png $(ABOUT_BITMAPS))
ZIP7LIST= \
- $(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/nologo_broffice$/introabout$/intro.bmp $(INTRO_BITMAPS)) \
- $(null,$(ABOUT_BITMAPS) $(MISC)$/ooo_custom_images$/broffice$/introabout$/about.bmp $(ABOUT_BITMAPS))
+ $(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/nologo_broffice$/introabout$/intro.png $(INTRO_BITMAPS)) \
+ $(null,$(ABOUT_BITMAPS) $(MISC)$/ooo_custom_images$/broffice$/introabout$/about.png $(ABOUT_BITMAPS))
ZIP8LIST= \
- $(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/dev_nologo_broffice$/introabout$/intro.bmp $(INTRO_BITMAPS)) \
- $(null,$(ABOUT_BITMAPS) $(MISC)$/ooo_custom_images$/broffice$/introabout$/about.bmp $(ABOUT_BITMAPS))
+ $(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/dev_nologo_broffice$/introabout$/intro.png $(INTRO_BITMAPS)) \
+ $(null,$(ABOUT_BITMAPS) $(MISC)$/ooo_custom_images$/broffice$/introabout$/about.png $(ABOUT_BITMAPS))
ZIP1TARGET=dev_intro
ZIP1DEPS=$(ZIP1LIST)
@@ -129,3 +129,6 @@ $(MISC)$/%.bmp : $(SOLARSRC)$/%.bmp
@@-$(MKDIRHIER) $(@:d)
$(COPY) $< $@
+$(MISC)$/%.png : $(SOLARSRC)$/%.png
+ @@-$(MKDIRHIER) $(@:d)
+ $(COPY) $< $@
diff --git a/drawinglayer/inc/drawinglayer/attribute/fillattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/fillattribute.hxx
deleted file mode 100644
index 8782c58691..0000000000
--- a/drawinglayer/inc/drawinglayer/attribute/fillattribute.hxx
+++ /dev/null
@@ -1,130 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLATTRIBUTE_HXX
-#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLATTRIBUTE_HXX
-
-#include <basegfx/color/bcolor.hxx>
-
-//////////////////////////////////////////////////////////////////////////////
-// predefines
-class XHatch;
-
-namespace drawinglayer
-{
- namespace attribute
- {
- enum GradientStyle
- {
- GRADIENTSTYLE_LINEAR,
- GRADIENTSTYLE_AXIAL,
- GRADIENTSTYLE_RADIAL,
- GRADIENTSTYLE_ELLIPTICAL,
- GRADIENTSTYLE_SQUARE,
- GRADIENTSTYLE_RECT
- };
-
- enum HatchStyle
- {
- HATCHSTYLE_SINGLE,
- HATCHSTYLE_DOUBLE,
- HATCHSTYLE_TRIPLE
- };
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- class FillGradientAttribute
- {
- basegfx::BColor maStartColor;
- basegfx::BColor maEndColor;
- double mfBorder;
- double mfOffsetX;
- double mfOffsetY;
- double mfAngle;
- GradientStyle meStyle;
- sal_uInt16 mnSteps;
-
- public:
- FillGradientAttribute(
- GradientStyle eStyle, double fBorder, double fOffsetX, double fOffsetY, double fAngle,
- const basegfx::BColor& rStartColor, const basegfx::BColor& rEndColor, sal_uInt16 nSteps);
- bool operator==(const FillGradientAttribute& rCandidate) const;
-
- // data access
- const basegfx::BColor& getStartColor() const { return maStartColor; }
- const basegfx::BColor& getEndColor() const { return maEndColor; }
- double getBorder() const { return mfBorder; }
- double getOffsetX() const { return mfOffsetX; }
- double getOffsetY() const { return mfOffsetY; }
- double getAngle() const { return mfAngle; }
- GradientStyle getStyle() const { return meStyle; }
- sal_uInt16 getSteps() const { return mnSteps; }
- };
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- class FillHatchAttribute
- {
- double mfDistance;
- double mfAngle;
- basegfx::BColor maColor;
- HatchStyle meStyle;
-
- // bitfield
- unsigned mbFillBackground : 1;
-
- public:
- FillHatchAttribute(HatchStyle eStyle, double fDistance, double fAngle, const basegfx::BColor& rColor, bool bFillBackground);
- bool operator==(const FillHatchAttribute& rCandidate) const;
-
- // data access
- double getDistance() const { return mfDistance; }
- double getAngle() const { return mfAngle; }
- const basegfx::BColor& getColor() const { return maColor; }
- HatchStyle getStyle() const { return meStyle; }
- bool isFillBackground() const { return mbFillBackground; }
- };
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLATTRIBUTE_HXX
-
-// eof
diff --git a/drawinglayer/inc/drawinglayer/attribute/fillbitmapattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/fillbitmapattribute.hxx
index 3f34a938ef..bd3bfd018a 100644
--- a/drawinglayer/inc/drawinglayer/attribute/fillbitmapattribute.hxx
+++ b/drawinglayer/inc/drawinglayer/attribute/fillbitmapattribute.hxx
@@ -28,18 +28,22 @@
#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLBITMAPATTRIBUTE_HXX
#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLBITMAPATTRIBUTE_HXX
-#include <vcl/bitmapex.hxx>
-#include <basegfx/point/b2dpoint.hxx>
-#include <basegfx/vector/b2dvector.hxx>
+#include <sal/types.h>
//////////////////////////////////////////////////////////////////////////////
// predefines
+class BitmapEx;
+
namespace basegfx {
- class B2DRange;
- class BColor;
+ class B2DPoint;
+ class B2DVector;
}
+namespace drawinglayer { namespace attribute {
+ class ImpFillBitmapAttribute;
+}}
+
//////////////////////////////////////////////////////////////////////////////
namespace drawinglayer
@@ -48,26 +52,32 @@ namespace drawinglayer
{
class FillBitmapAttribute
{
- BitmapEx maBitmapEx;
- basegfx::B2DPoint maTopLeft;
- basegfx::B2DVector maSize;
-
- // bitfield
- unsigned mbTiling : 1;
+ private:
+ ImpFillBitmapAttribute* mpFillBitmapAttribute;
public:
+ /// constructors/assignmentoperator/destructor
FillBitmapAttribute(
const BitmapEx& rBitmapEx,
const basegfx::B2DPoint& rTopLeft,
const basegfx::B2DVector& rSize,
bool bTiling);
+ FillBitmapAttribute();
+ FillBitmapAttribute(const FillBitmapAttribute& rCandidate);
+ FillBitmapAttribute& operator=(const FillBitmapAttribute& rCandidate);
+ ~FillBitmapAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
bool operator==(const FillBitmapAttribute& rCandidate) const;
- // data access
- const BitmapEx& getBitmapEx() const { return maBitmapEx; }
- const basegfx::B2DPoint& getTopLeft() const { return maTopLeft; }
- const basegfx::B2DVector& getSize() const { return maSize; }
- bool getTiling() const { return mbTiling; }
+ // data read access
+ const BitmapEx& getBitmapEx() const;
+ const basegfx::B2DPoint& getTopLeft() const;
+ const basegfx::B2DVector& getSize() const;
+ bool getTiling() const;
};
} // end of namespace attribute
} // end of namespace drawinglayer
diff --git a/drawinglayer/inc/drawinglayer/attribute/fillgradientattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/fillgradientattribute.hxx
new file mode 100644
index 0000000000..7b1faf3da8
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/attribute/fillgradientattribute.hxx
@@ -0,0 +1,121 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: fillattribute.hxx,v $
+ *
+ * $Revision: 1.3 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:16 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLGRADIENTATTRIBUTE_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLGRADIENTATTRIBUTE_HXX
+
+#include <sal/types.h>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace basegfx {
+ class BColor;
+}
+
+namespace drawinglayer { namespace attribute {
+ class ImpFillGradientAttribute;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+// declarations
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ enum GradientStyle
+ {
+ GRADIENTSTYLE_LINEAR,
+ GRADIENTSTYLE_AXIAL,
+ GRADIENTSTYLE_RADIAL,
+ GRADIENTSTYLE_ELLIPTICAL,
+ GRADIENTSTYLE_SQUARE,
+ GRADIENTSTYLE_RECT
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class FillGradientAttribute
+ {
+ private:
+ ImpFillGradientAttribute* mpFillGradientAttribute;
+
+ public:
+ /// constructors/assignmentoperator/destructor
+ FillGradientAttribute(
+ GradientStyle eStyle,
+ double fBorder,
+ double fOffsetX,
+ double fOffsetY,
+ double fAngle,
+ const basegfx::BColor& rStartColor,
+ const basegfx::BColor& rEndColor,
+ sal_uInt16 nSteps);
+ FillGradientAttribute();
+ FillGradientAttribute(const FillGradientAttribute& rCandidate);
+ FillGradientAttribute& operator=(const FillGradientAttribute& rCandidate);
+ ~FillGradientAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const FillGradientAttribute& rCandidate) const;
+
+ // data read access
+ GradientStyle getStyle() const;
+ double getBorder() const;
+ double getOffsetX() const;
+ double getOffsetY() const;
+ double getAngle() const;
+ const basegfx::BColor& getStartColor() const;
+ const basegfx::BColor& getEndColor() const;
+ sal_uInt16 getSteps() const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLGRADIENTATTRIBUTE_HXX
+
+// eof
diff --git a/drawinglayer/inc/drawinglayer/attribute/fillhatchattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/fillhatchattribute.hxx
new file mode 100644
index 0000000000..7356092ca2
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/attribute/fillhatchattribute.hxx
@@ -0,0 +1,112 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: fillattribute.hxx,v $
+ *
+ * $Revision: 1.3 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:16 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLHATCHATTRIBUTE_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLHATCHATTRIBUTE_HXX
+
+#include <sal/types.h>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace basegfx {
+ class BColor;
+}
+
+namespace drawinglayer { namespace attribute {
+ class ImpFillHatchAttribute;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+// declarations
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ enum HatchStyle
+ {
+ HATCHSTYLE_SINGLE,
+ HATCHSTYLE_DOUBLE,
+ HATCHSTYLE_TRIPLE
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class FillHatchAttribute
+ {
+ private:
+ ImpFillHatchAttribute* mpFillHatchAttribute;
+
+ public:
+ /// constructors/assignmentoperator/destructor
+ FillHatchAttribute(
+ HatchStyle eStyle,
+ double fDistance,
+ double fAngle,
+ const basegfx::BColor& rColor,
+ bool bFillBackground);
+ FillHatchAttribute();
+ FillHatchAttribute(const FillHatchAttribute& rCandidate);
+ FillHatchAttribute& operator=(const FillHatchAttribute& rCandidate);
+ ~FillHatchAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const FillHatchAttribute& rCandidate) const;
+
+ // data read access
+ HatchStyle getStyle() const;
+ double getDistance() const;
+ double getAngle() const;
+ const basegfx::BColor& getColor() const;
+ bool isFillBackground() const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_FILLHATCHATTRIBUTE_HXX
+
+// eof
diff --git a/drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx
index 329e3f268c..79e67b966a 100644
--- a/drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx
+++ b/drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx
@@ -28,9 +28,16 @@
#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_FONTATTRIBUTE_HXX
#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_FONTATTRIBUTE_HXX
-#include <sal/config.h>
#include <sal/types.h>
-#include <tools/string.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+class String;
+
+namespace drawinglayer { namespace attribute {
+ class ImpFontAttribute;
+}}
//////////////////////////////////////////////////////////////////////////////
@@ -46,22 +53,11 @@ namespace drawinglayer
class FontAttribute
{
private:
- /// core data
- String maFamilyName; // Font Family Name
- String maStyleName; // Font Style Name
- sal_uInt16 mnWeight; // Font weight
-
- /// bitfield
- unsigned mbSymbol : 1; // Symbol Font Flag
- unsigned mbVertical : 1; // Vertical Text Flag
- unsigned mbItalic : 1; // Italic Flag
- unsigned mbOutline : 1; // Outline Flag
- unsigned mbRTL : 1; // RTL Flag
- unsigned mbBiDiStrong : 1; // BiDi Flag
- // TODO: pair kerning and CJK kerning
+ ImpFontAttribute* mpFontAttribute;
public:
- /// constructor
+ /// constructors/assignmentoperator/destructor
+ /// TODO: pair kerning and CJK kerning
FontAttribute(
const String& rFamilyName,
const String& rStyleName,
@@ -71,45 +67,28 @@ namespace drawinglayer
bool bItalic = false,
bool bOutline = false,
bool bRTL = false,
- bool bBiDiStrong = false)
- : maFamilyName(rFamilyName),
- maStyleName(rStyleName),
- mnWeight(nWeight),
- mbSymbol(bSymbol),
- mbVertical(bVertical),
- mbItalic(bItalic),
- mbOutline(bOutline),
- mbRTL(bRTL),
- mbBiDiStrong(bBiDiStrong)
- {
- }
+ bool bBiDiStrong = false);
+ FontAttribute();
+ FontAttribute(const FontAttribute& rCandidate);
+ FontAttribute& operator=(const FontAttribute& rCandidate);
+ ~FontAttribute();
- FontAttribute()
- : maFamilyName(),
- maStyleName(),
- mnWeight(0),
- mbSymbol(false),
- mbVertical(false),
- mbItalic(false),
- mbOutline(false),
- mbRTL(false),
- mbBiDiStrong(false)
- {
- }
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
- /// compare operator
- bool operator==(const FontAttribute& rCompare) const;
+ // compare operator
+ bool operator==(const FontAttribute& rCandidate) const;
/// data read access
- const String& getFamilyName() const { return maFamilyName; }
- const String& getStyleName() const { return maStyleName; }
- sal_uInt16 getWeight() const { return mnWeight; }
- bool getSymbol() const { return mbSymbol; }
- bool getVertical() const { return mbVertical; }
- bool getItalic() const { return mbItalic; }
- bool getOutline() const { return mbOutline; }
- bool getRTL() const { return mbRTL; }
- bool getBiDiStrong() const { return mbBiDiStrong; }
+ const String& getFamilyName() const;
+ const String& getStyleName() const;
+ sal_uInt16 getWeight() const;
+ bool getSymbol() const;
+ bool getVertical() const;
+ bool getItalic() const;
+ bool getOutline() const;
+ bool getRTL() const;
+ bool getBiDiStrong() const;
};
} // end of namespace attribute
} // end of namespace drawinglayer
diff --git a/drawinglayer/inc/drawinglayer/attribute/lineattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/lineattribute.hxx
index cc2eca5438..84306ebb12 100644
--- a/drawinglayer/inc/drawinglayer/attribute/lineattribute.hxx
+++ b/drawinglayer/inc/drawinglayer/attribute/lineattribute.hxx
@@ -28,13 +28,19 @@
#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_LINEATTRIBUTE_HXX
#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_LINEATTRIBUTE_HXX
-#include <basegfx/polygon/b2dlinegeometry.hxx>
-#include <basegfx/color/bcolor.hxx>
-#include <vector>
+#include <basegfx/vector/b2enums.hxx>
//////////////////////////////////////////////////////////////////////////////
// predefines
+namespace basegfx {
+ class BColor;
+}
+
+namespace drawinglayer { namespace attribute {
+ class ImpLineAttribute;
+}}
+
//////////////////////////////////////////////////////////////////////////////
namespace drawinglayer
@@ -44,50 +50,29 @@ namespace drawinglayer
class LineAttribute
{
private:
- basegfx::BColor maColor; // color
- double mfWidth; // absolute line width
- basegfx::B2DLineJoin meLineJoin; // type of LineJoin
+ ImpLineAttribute* mpLineAttribute;
public:
+ /// constructors/assignmentoperator/destructor
LineAttribute(
const basegfx::BColor& rColor,
double fWidth = 0.0,
- basegfx::B2DLineJoin aB2DLineJoin = basegfx::B2DLINEJOIN_ROUND)
- : maColor(rColor),
- mfWidth(fWidth),
- meLineJoin(aB2DLineJoin)
- {
- }
-
- LineAttribute(const LineAttribute& rCandidate)
- {
- *this = rCandidate;
- }
-
- LineAttribute& operator=(const LineAttribute& rCandidate)
- {
- maColor = rCandidate.maColor;
- mfWidth = rCandidate.mfWidth;
- meLineJoin = rCandidate.meLineJoin;
- return *this;
- }
+ basegfx::B2DLineJoin aB2DLineJoin = basegfx::B2DLINEJOIN_ROUND);
+ LineAttribute();
+ LineAttribute(const LineAttribute& rCandidate);
+ LineAttribute& operator=(const LineAttribute& rCandidate);
+ ~LineAttribute();
- ~LineAttribute()
- {
- }
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
// compare operator
- bool operator==(const LineAttribute& rCandidate) const
- {
- return (maColor == rCandidate.maColor
- && mfWidth == rCandidate.mfWidth
- && meLineJoin == rCandidate.meLineJoin);
- }
+ bool operator==(const LineAttribute& rCandidate) const;
- // data access
- const basegfx::BColor& getColor() const { return maColor; }
- double getWidth() const { return mfWidth; }
- basegfx::B2DLineJoin getLineJoin() const { return meLineJoin; }
+ // data read access
+ const basegfx::BColor& getColor() const;
+ double getWidth() const;
+ basegfx::B2DLineJoin getLineJoin() const;
};
} // end of namespace attribute
} // end of namespace drawinglayer
diff --git a/drawinglayer/inc/drawinglayer/attribute/linestartendattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/linestartendattribute.hxx
index f992abb8b3..60edce4f1a 100644
--- a/drawinglayer/inc/drawinglayer/attribute/linestartendattribute.hxx
+++ b/drawinglayer/inc/drawinglayer/attribute/linestartendattribute.hxx
@@ -28,12 +28,19 @@
#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_LINESTARTENDATTRIBUTE_HXX
#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_LINESTARTENDATTRIBUTE_HXX
-#include <basegfx/polygon/b2dpolypolygon.hxx>
-#include <basegfx/numeric/ftools.hxx>
+#include <sal/types.h>
//////////////////////////////////////////////////////////////////////////////
// predefines
+namespace basegfx {
+ class B2DPolyPolygon;
+}
+
+namespace drawinglayer { namespace attribute {
+ class ImpLineStartEndAttribute;
+}}
+
//////////////////////////////////////////////////////////////////////////////
namespace drawinglayer
@@ -43,35 +50,29 @@ namespace drawinglayer
class LineStartEndAttribute
{
private:
- double mfWidth; // absolute line StartEndGeometry base width
- basegfx::B2DPolyPolygon maPolyPolygon; // the StartEndGeometry PolyPolygon
-
- // bitfield
- unsigned mbCentered : 1; // use centered to ineStart/End point?
+ ImpLineStartEndAttribute* mpLineStartEndAttribute;
public:
+ /// constructors/assignmentoperator/destructor
LineStartEndAttribute(
double fWidth,
const basegfx::B2DPolyPolygon& rPolyPolygon,
- bool bCentered)
- : mfWidth(fWidth),
- maPolyPolygon(rPolyPolygon),
- mbCentered(bCentered)
- {
- }
+ bool bCentered);
+ LineStartEndAttribute();
+ LineStartEndAttribute(const LineStartEndAttribute& rCandidate);
+ LineStartEndAttribute& operator=(const LineStartEndAttribute& rCandidate);
+ ~LineStartEndAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
// compare operator
- bool operator==(const LineStartEndAttribute& rCandidate) const
- {
- return (basegfx::fTools::equal(mfWidth, rCandidate.mfWidth)
- && maPolyPolygon == rCandidate.maPolyPolygon
- && mbCentered == rCandidate.mbCentered);
- }
+ bool operator==(const LineStartEndAttribute& rCandidate) const;
- // data access
- double getWidth() const { return mfWidth; }
- const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; }
- bool isCentered() const { return mbCentered; }
+ // data read access
+ double getWidth() const;
+ const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const;
+ bool isCentered() const;
bool isActive() const;
};
} // end of namespace attribute
diff --git a/drawinglayer/inc/drawinglayer/attribute/materialattribute3d.hxx b/drawinglayer/inc/drawinglayer/attribute/materialattribute3d.hxx
index 4e5b742993..bd99b29bf8 100644
--- a/drawinglayer/inc/drawinglayer/attribute/materialattribute3d.hxx
+++ b/drawinglayer/inc/drawinglayer/attribute/materialattribute3d.hxx
@@ -54,7 +54,11 @@ namespace drawinglayer
public:
// constructors/destructor
- MaterialAttribute3D(const basegfx::BColor& rColor, const basegfx::BColor& rSpecular, const basegfx::BColor& rEmission, sal_uInt16 nSpecularIntensity);
+ MaterialAttribute3D(
+ const basegfx::BColor& rColor,
+ const basegfx::BColor& rSpecular,
+ const basegfx::BColor& rEmission,
+ sal_uInt16 nSpecularIntensity);
MaterialAttribute3D(const basegfx::BColor& rColor);
MaterialAttribute3D();
MaterialAttribute3D(const MaterialAttribute3D& rCandidate);
@@ -63,11 +67,13 @@ namespace drawinglayer
// assignment operator
MaterialAttribute3D& operator=(const MaterialAttribute3D& rCandidate);
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
// compare operator
bool operator==(const MaterialAttribute3D& rCandidate) const;
- bool operator!=(const MaterialAttribute3D& rCandidate) const { return !operator==(rCandidate); }
- // data access
+ // data read access
const basegfx::BColor& getColor() const;
const basegfx::BColor& getSpecular() const;
const basegfx::BColor& getEmission() const;
diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrallattribute3d.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrallattribute3d.hxx
index 7eae0f4d8d..da860f4a5e 100644
--- a/drawinglayer/inc/drawinglayer/attribute/sdrallattribute3d.hxx
+++ b/drawinglayer/inc/drawinglayer/attribute/sdrallattribute3d.hxx
@@ -28,57 +28,53 @@
#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRALLATTRIBUTE3D_HXX
#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRALLATTRIBUTE3D_HXX
+#include <sal/types.h>
+#include <drawinglayer/attribute/sdrlineattribute.hxx>
+#include <drawinglayer/attribute/sdrfillattribute.hxx>
+#include <drawinglayer/attribute/sdrlinestartendattribute.hxx>
+#include <drawinglayer/attribute/sdrshadowattribute.hxx>
+#include <drawinglayer/attribute/fillgradientattribute.hxx>
+
//////////////////////////////////////////////////////////////////////////////
// predefines
-namespace drawinglayer { namespace attribute {
- class SdrLineAttribute;
- class SdrFillAttribute;
- class SdrLineStartEndAttribute;
- class SdrShadowAttribute;
- class FillGradientAttribute;
-}}
-
//////////////////////////////////////////////////////////////////////////////
namespace drawinglayer
{
namespace attribute
{
- class SdrLineFillShadowAttribute
+ class SdrLineFillShadowAttribute3D
{
- // shadow, line, lineStartEnd, fill, transGradient and compound3D attributes
- SdrShadowAttribute* mpShadow; // shadow attributes (if used)
- SdrLineAttribute* mpLine; // line attributes (if used)
- SdrLineStartEndAttribute* mpLineStartEnd; // line start end (if used)
- SdrFillAttribute* mpFill; // fill attributes (if used)
- FillGradientAttribute* mpFillFloatTransGradient; // fill float transparence gradient (if used)
+ private:
+ const SdrLineAttribute maLine;
+ const SdrFillAttribute maFill;
+ const SdrLineStartEndAttribute maLineStartEnd;
+ const SdrShadowAttribute maShadow;
+ const FillGradientAttribute maFillFloatTransGradient;
public:
- SdrLineFillShadowAttribute(
- SdrLineAttribute* pLine = 0,
- SdrFillAttribute* pFill = 0,
- SdrLineStartEndAttribute* pLineStartEnd = 0,
- SdrShadowAttribute* pShadow = 0,
- FillGradientAttribute* pFillFloatTransGradient = 0);
- ~SdrLineFillShadowAttribute();
+ /// constructors/assignmentoperator/destructor
+ SdrLineFillShadowAttribute3D(
+ const SdrLineAttribute& rLine,
+ const SdrFillAttribute& rFill,
+ const SdrLineStartEndAttribute& rLineStartEnd,
+ const SdrShadowAttribute& rShadow,
+ const FillGradientAttribute& rFillFloatTransGradient);
+ SdrLineFillShadowAttribute3D();
- // copy constructor and assigment operator
- SdrLineFillShadowAttribute(const SdrLineFillShadowAttribute& rCandidate);
- SdrLineFillShadowAttribute& operator=(const SdrLineFillShadowAttribute& rCandidate);
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
// compare operator
- bool operator==(const SdrLineFillShadowAttribute& rCandidate) const;
-
- // bool access
- bool isVisible() const { return (mpFill || mpLine); }
+ bool operator==(const SdrLineFillShadowAttribute3D& rCandidate) const;
- // data access
- const SdrShadowAttribute* getShadow() const { return mpShadow; }
- const SdrLineAttribute* getLine() const { return mpLine; }
- const SdrLineStartEndAttribute* getLineStartEnd() const { return mpLineStartEnd; }
- const SdrFillAttribute* getFill() const { return mpFill; }
- const FillGradientAttribute* getFillFloatTransGradient() const { return mpFillFloatTransGradient; }
+ // data read access
+ const SdrLineAttribute& getLine() const { return maLine; }
+ const SdrFillAttribute& getFill() const { return maFill; }
+ const SdrLineStartEndAttribute& getLineStartEnd() const { return maLineStartEnd; }
+ const SdrShadowAttribute& getShadow() const { return maShadow; }
+ const FillGradientAttribute& getFillFloatTransGradient() const { return maFillFloatTransGradient; }
};
} // end of namespace overlay
} // end of namespace drawinglayer
diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrattribute.hxx
deleted file mode 100644
index d77b20dfec..0000000000
--- a/drawinglayer/inc/drawinglayer/attribute/sdrattribute.hxx
+++ /dev/null
@@ -1,215 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE_HXX
-#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE_HXX
-
-#include <basegfx/polygon/b2dlinegeometry.hxx>
-#include <basegfx/color/bcolor.hxx>
-#include <vector>
-#include <basegfx/vector/b2dvector.hxx>
-
-//////////////////////////////////////////////////////////////////////////////
-// predefines
-class SdrTextObj;
-
-namespace drawinglayer { namespace attribute {
- class SdrFillBitmapAttribute;
- class FillHatchAttribute;
- class FillGradientAttribute;
-}}
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- class SdrLineAttribute
- {
- // line definitions
- basegfx::B2DLineJoin meJoin; // B2DLINEJOIN_* defines
- double mfWidth; // 1/100th mm, 0.0==hair
- double mfTransparence; // [0.0 .. 1.0], 0.0==no transp.
- basegfx::BColor maColor; // color of line
- ::std::vector< double > maDotDashArray; // array of double which defines the dot-dash pattern
- double mfFullDotDashLen; // sum of maDotDashArray (for convenience)
-
- public:
- SdrLineAttribute(
- basegfx::B2DLineJoin eJoin, double fWidth, double fTransparence, const basegfx::BColor& rColor,
- const ::std::vector< double >& rDotDashArray, double fFullDotDashLen);
- ~SdrLineAttribute();
-
- // constructor to create a line attribute for a colored hairline
- SdrLineAttribute(const basegfx::BColor& rColor);
-
- // compare operator
- bool operator==(const SdrLineAttribute& rCandidate) const;
-
- // bool access
- bool isVisible() const { return (1.0 != mfTransparence); }
- bool isDashed() const { return (0L != maDotDashArray.size()); }
-
- // data access
- basegfx::B2DLineJoin getJoin() const { return meJoin; }
- double getWidth() const { return mfWidth; }
- double getTransparence() const { return mfTransparence; }
- const basegfx::BColor& getColor() const { return maColor; }
- const ::std::vector< double >& getDotDashArray() const { return maDotDashArray; }
- double getFullDotDashLen() const { return mfFullDotDashLen; }
- };
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- class SdrLineStartEndAttribute
- {
- // line arrow definitions
- basegfx::B2DPolyPolygon maStartPolyPolygon; // start Line PolyPolygon
- basegfx::B2DPolyPolygon maEndPolyPolygon; // end Line PolyPolygon
- double mfStartWidth; // 1/100th mm
- double mfEndWidth; // 1/100th mm
-
- // bitfield
- unsigned mbStartActive : 1L; // start of Line is active
- unsigned mbEndActive : 1L; // end of Line is active
- unsigned mbStartCentered : 1L; // Line is centered on line start point
- unsigned mbEndCentered : 1L; // Line is centered on line end point
-
- public:
- SdrLineStartEndAttribute(
- const basegfx::B2DPolyPolygon& rStartPolyPolygon, const basegfx::B2DPolyPolygon& rEndPolyPolygon,
- double fStartWidth, double fEndWidth, bool bStartActive, bool bEndActive, bool bStartCentered, bool bEndCentered);
- ~SdrLineStartEndAttribute();
-
- // compare operator
- bool operator==(const SdrLineStartEndAttribute& rCandidate) const;
-
- // bool access
- bool isStartActive() const { return mbStartActive; }
- bool isEndActive() const { return mbEndActive; }
- bool isStartCentered() const { return mbStartCentered; }
- bool isEndCentered() const { return mbEndCentered; }
- bool isVisible() const { return (isStartActive() || isEndActive()); }
-
- // data access
- const basegfx::B2DPolyPolygon& getStartPolyPolygon() const { return maStartPolyPolygon; }
- const basegfx::B2DPolyPolygon& getEndPolyPolygon() const { return maEndPolyPolygon; }
- double getStartWidth() const { return mfStartWidth; }
- double getEndWidth() const { return mfEndWidth; }
- };
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- class SdrShadowAttribute
- {
- // shadow definitions
- basegfx::B2DVector maOffset; // shadow offset 1/100th mm
- double mfTransparence; // [0.0 .. 1.0], 0.0==no transp.
- basegfx::BColor maColor; // color of shadow
-
- public:
- SdrShadowAttribute(
- const basegfx::B2DVector& rOffset, double fTransparence, const basegfx::BColor& rColor);
- ~SdrShadowAttribute();
-
- // compare operator
- bool operator==(const SdrShadowAttribute& rCandidate) const;
-
- // bool access
- bool isVisible() const { return (1.0 != mfTransparence); }
-
- // data access
- const basegfx::B2DVector& getOffset() const { return maOffset; }
- double getTransparence() const { return mfTransparence; }
- const basegfx::BColor& getColor() const { return maColor; }
- };
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- class SdrFillAttribute
- {
- // fill definitions
- double mfTransparence; // [0.0 .. 1.0], 0.0==no transp.
- basegfx::BColor maColor; // fill color
- FillGradientAttribute* mpGradient; // fill gradient (if used)
- FillHatchAttribute* mpHatch; // fill hatch (if used)
- SdrFillBitmapAttribute* mpBitmap; // fill bitmap (if used)
-
- public:
- SdrFillAttribute(
- double fTransparence, const basegfx::BColor& rColor, FillGradientAttribute* pGradient = 0L,
- FillHatchAttribute* pHatch = 0L, SdrFillBitmapAttribute* pBitmap = 0L);
- ~SdrFillAttribute();
-
- // copy constructor and assigment operator
- SdrFillAttribute(const SdrFillAttribute& rCandidate);
- SdrFillAttribute& operator=(const SdrFillAttribute& rCandidate);
-
- // compare operator
- bool operator==(const SdrFillAttribute& rCandidate) const;
-
- // bool access
- bool isGradient() const { return (0L != mpGradient); }
- bool isHatch() const { return (0L != mpHatch); }
- bool isBitmap() const { return (0L != mpBitmap); }
- bool isColor() const { return (!mpGradient && !mpHatch && !mpBitmap); }
- bool isVisible() const { return (1.0 != mfTransparence); }
-
- // data access
- double getTransparence() const { return mfTransparence; }
- const basegfx::BColor& getColor() const { return maColor; }
- const FillGradientAttribute* getGradient() const { return mpGradient; }
- const FillHatchAttribute* getHatch() const { return mpHatch; }
- const SdrFillBitmapAttribute* getBitmap() const { return mpBitmap; }
- };
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE_HXX
-
-// eof
diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrattribute3d.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrattribute3d.hxx
deleted file mode 100644
index 5bdb9b07ff..0000000000
--- a/drawinglayer/inc/drawinglayer/attribute/sdrattribute3d.hxx
+++ /dev/null
@@ -1,209 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE3D_HXX
-#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE3D_HXX
-
-#include <basegfx/vector/b2dvector.hxx>
-#include <com/sun/star/drawing/NormalsKind.hpp>
-#include <com/sun/star/drawing/TextureProjectionMode.hpp>
-#include <com/sun/star/drawing/ProjectionMode.hpp>
-#include <com/sun/star/drawing/TextureKind2.hpp>
-#include <com/sun/star/drawing/TextureMode.hpp>
-#include <basegfx/vector/b3dvector.hxx>
-#include <com/sun/star/drawing/ShadeMode.hpp>
-#include <basegfx/color/bcolor.hxx>
-#include <drawinglayer/attribute/materialattribute3d.hxx>
-#include <vector>
-
-//////////////////////////////////////////////////////////////////////////////
-// predefines
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- class Sdr3DObjectAttribute
- {
- // 3D object attribute definitions
- ::com::sun::star::drawing::NormalsKind maNormalsKind; // normals type (0..2)
- ::com::sun::star::drawing::TextureProjectionMode maTextureProjectionX; // texture projection type X (0..2)
- ::com::sun::star::drawing::TextureProjectionMode maTextureProjectionY; // texture projection type Y (0..2)
- ::com::sun::star::drawing::TextureKind2 maTextureKind; // texture kind (see uno API)
- ::com::sun::star::drawing::TextureMode maTextureMode; // texture kind (see uno API)
- MaterialAttribute3D maMaterial; // object, specular and emissive colors, SpecularIntensity
-
- // bitfield
- unsigned mbNormalsInvert : 1; // invert normals
- unsigned mbDoubleSided : 1; // surfaces are double sided
- unsigned mbShadow3D : 1; // display shadow in 3D (if on), params for that are at scene
- unsigned mbTextureFilter : 1; // filter texture to make more smooth
- unsigned mbReducedLineGeometry : 1; // use reduced line geometry (object specific)
-
- public:
- Sdr3DObjectAttribute(
- ::com::sun::star::drawing::NormalsKind aNormalsKind,
- ::com::sun::star::drawing::TextureProjectionMode aTextureProjectionX,
- ::com::sun::star::drawing::TextureProjectionMode aTextureProjectionY,
- ::com::sun::star::drawing::TextureKind2 aTextureKind,
- ::com::sun::star::drawing::TextureMode aTextureMode,
- const MaterialAttribute3D& rMaterial,
- bool bNormalsInvert,
- bool bDoubleSided,
- bool bShadow3D,
- bool bTextureFilter,
- bool bReducedLineGeometry);
-
- // compare operator
- bool operator==(const Sdr3DObjectAttribute& rCandidate) const;
-
- // data access
- ::com::sun::star::drawing::NormalsKind getNormalsKind() const { return maNormalsKind; }
- ::com::sun::star::drawing::TextureProjectionMode getTextureProjectionX() const { return maTextureProjectionX; }
- ::com::sun::star::drawing::TextureProjectionMode getTextureProjectionY() const { return maTextureProjectionY; }
- ::com::sun::star::drawing::TextureKind2 getTextureKind() const { return maTextureKind; }
- ::com::sun::star::drawing::TextureMode getTextureMode() const { return maTextureMode; }
- const MaterialAttribute3D& getMaterial() const { return maMaterial; }
- bool getNormalsInvert() const { return mbNormalsInvert; }
- bool getDoubleSided() const { return mbDoubleSided; }
- bool getShadow3D() const { return mbShadow3D; }
- bool getTextureFilter() const { return mbTextureFilter; }
- bool getReducedLineGeometry() const { return mbReducedLineGeometry; }
- };
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- class Sdr3DLightAttribute
- {
- // 3D light attribute definitions
- basegfx::BColor maColor;
- basegfx::B3DVector maDirection;
-
- // bitfield
- unsigned mbSpecular : 1;
-
- public:
- Sdr3DLightAttribute(
- const basegfx::BColor& rColor,
- const basegfx::B3DVector& rDirection,
- bool bSpecular);
-
- // compare operator
- bool operator==(const Sdr3DLightAttribute& rCandidate) const;
-
- // data access
- const basegfx::BColor& getColor() const { return maColor; }
- const basegfx::B3DVector& getDirection() const { return maDirection; }
- bool getSpecular() const { return mbSpecular; }
- };
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- class SdrLightingAttribute
- {
- // 3D light attribute definitions
- basegfx::BColor maAmbientLight;
- ::std::vector< Sdr3DLightAttribute > maLightVector;
-
- public:
- SdrLightingAttribute(
- const basegfx::BColor& rAmbientLight,
- const ::std::vector< Sdr3DLightAttribute >& rLightVector);
-
- // compare operator
- bool operator==(const SdrLightingAttribute& rCandidate) const;
-
- // data access
- const basegfx::BColor& getAmbientLight() const { return maAmbientLight; }
- const ::std::vector< Sdr3DLightAttribute >& getLightVector() const { return maLightVector; }
-
- // color model solver
- basegfx::BColor solveColorModel(
- const basegfx::B3DVector& rNormalInEyeCoordinates,
- const basegfx::BColor& rColor, const basegfx::BColor& rSpecular,
- const basegfx::BColor& rEmission, sal_uInt16 nSpecularIntensity) const;
- };
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- class SdrSceneAttribute
- {
- // 3D scene attribute definitions
- double mfDistance;
- double mfShadowSlant;
- ::com::sun::star::drawing::ProjectionMode maProjectionMode;
- ::com::sun::star::drawing::ShadeMode maShadeMode;
-
- // bitfield
- unsigned mbTwoSidedLighting : 1;
-
- public:
- SdrSceneAttribute(
- double fDistance,
- double fShadowSlant,
- ::com::sun::star::drawing::ProjectionMode aProjectionMode,
- ::com::sun::star::drawing::ShadeMode aShadeMode,
- bool bTwoSidedLighting);
-
- // compare operator
- bool operator==(const SdrSceneAttribute& rCandidate) const;
-
- // data access
- double getDistance() const { return mfDistance; }
- double getShadowSlant() const { return mfShadowSlant; }
- ::com::sun::star::drawing::ProjectionMode getProjectionMode() const { return maProjectionMode; }
- ::com::sun::star::drawing::ShadeMode getShadeMode() const { return maShadeMode; }
- bool getTwoSidedLighting() const { return mbTwoSidedLighting; }
- };
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRATTRIBUTE3D_HXX
-
-// eof
diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrfillattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrfillattribute.hxx
new file mode 100644
index 0000000000..c0eef0e57e
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/attribute/sdrfillattribute.hxx
@@ -0,0 +1,99 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrattribute.hxx,v $
+ *
+ * $Revision: 1.4 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:16 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRFILLATTRIBUTE_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRFILLATTRIBUTE_HXX
+
+#include <sal/types.h>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace basegfx {
+ class BColor;
+}
+
+namespace drawinglayer { namespace attribute {
+ class ImpSdrFillAttribute;
+ class FillGradientAttribute;
+ class FillHatchAttribute;
+ class SdrFillBitmapAttribute;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class SdrFillAttribute
+ {
+ private:
+ ImpSdrFillAttribute* mpSdrFillAttribute;
+
+ public:
+ /// constructors/assignmentoperator/destructor
+ SdrFillAttribute(
+ double fTransparence,
+ const basegfx::BColor& rColor,
+ const FillGradientAttribute& rGradient,
+ const FillHatchAttribute& rHatch,
+ const SdrFillBitmapAttribute& rBitmap);
+ SdrFillAttribute();
+ SdrFillAttribute(const SdrFillAttribute& rCandidate);
+ SdrFillAttribute& operator=(const SdrFillAttribute& rCandidate);
+ ~SdrFillAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const SdrFillAttribute& rCandidate) const;
+
+ // data read access
+ double getTransparence() const;
+ const basegfx::BColor& getColor() const;
+ const FillGradientAttribute& getGradient() const;
+ const FillHatchAttribute& getHatch() const;
+ const SdrFillBitmapAttribute& getBitmap() const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRFILLATTRIBUTE_HXX
+
+// eof
diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrfillbitmapattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrfillbitmapattribute.hxx
index 4e0b728c4a..dc18a346db 100644
--- a/drawinglayer/inc/drawinglayer/attribute/sdrfillbitmapattribute.hxx
+++ b/drawinglayer/inc/drawinglayer/attribute/sdrfillbitmapattribute.hxx
@@ -28,21 +28,23 @@
#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRFILLBITMAPATTRIBUTE_HXX
#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRFILLBITMAPATTRIBUTE_HXX
-#include <vcl/bitmap.hxx>
-#include <basegfx/vector/b2dvector.hxx>
+#include <sal/types.h>
//////////////////////////////////////////////////////////////////////////////
// predefines
-class SfxItemSet;
-namespace drawinglayer { namespace attribute {
- class FillBitmapAttribute;
-}}
+class Bitmap;
namespace basegfx {
class B2DRange;
+ class B2DVector;
}
+namespace drawinglayer { namespace attribute {
+ class FillBitmapAttribute;
+ class ImpSdrFillBitmapAttribute;
+}}
+
//////////////////////////////////////////////////////////////////////////////
namespace drawinglayer
@@ -51,27 +53,42 @@ namespace drawinglayer
{
class SdrFillBitmapAttribute
{
- Bitmap maBitmap;
- basegfx::B2DVector maSize;
- basegfx::B2DVector maOffset;
- basegfx::B2DVector maOffsetPosition;
- basegfx::B2DVector maRectPoint;
-
- // bitfield
- unsigned mbTiling : 1;
- unsigned mbStretch : 1;
- unsigned mbLogSize : 1;
+ private:
+ ImpSdrFillBitmapAttribute* mpSdrFillBitmapAttribute;
public:
+ /// constructors/assignmentoperator/destructor
SdrFillBitmapAttribute(
- const Bitmap& rBitmap, const basegfx::B2DVector& rSize, const basegfx::B2DVector& rOffset,
- const basegfx::B2DVector& rOffsetPosition, const basegfx::B2DVector& rRectPoint,
- bool bTiling, bool bStretch, bool bLogSize);
+ const Bitmap& rBitmap,
+ const basegfx::B2DVector& rSize,
+ const basegfx::B2DVector& rOffset,
+ const basegfx::B2DVector& rOffsetPosition,
+ const basegfx::B2DVector& rRectPoint,
+ bool bTiling,
+ bool bStretch,
+ bool bLogSize);
+ SdrFillBitmapAttribute();
+ SdrFillBitmapAttribute(const SdrFillBitmapAttribute& rCandidate);
+ SdrFillBitmapAttribute& operator=(const SdrFillBitmapAttribute& rCandidate);
+ ~SdrFillBitmapAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
bool operator==(const SdrFillBitmapAttribute& rCandidate) const;
- // data access
- const Bitmap& getBitmap() const { return maBitmap; }
- bool getTiling() const { return mbTiling; }
+ // data read access
+ const Bitmap& getBitmap() const;
+ const basegfx::B2DVector& getSize() const;
+ const basegfx::B2DVector& getOffset() const;
+ const basegfx::B2DVector& getOffsetPosition() const;
+ const basegfx::B2DVector& getRectPoint() const;
+ bool getTiling() const;
+ bool getStretch() const;
+ bool getLogSize() const;
+
+ // FillBitmapAttribute generator
FillBitmapAttribute getFillBitmapAttribute(const basegfx::B2DRange& rRange) const;
};
} // end of namespace attribute
diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrlightattribute3d.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrlightattribute3d.hxx
new file mode 100644
index 0000000000..8fc5ff961d
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/attribute/sdrlightattribute3d.hxx
@@ -0,0 +1,96 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrattribute3d.hxx,v $
+ *
+ * $Revision: 1.4 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:16 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRLIGHTATTRIBUTE3D_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRLIGHTATTRIBUTE3D_HXX
+
+#include <sal/types.h>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace basegfx {
+ class BColor;
+ class B3DVector;
+}
+
+namespace drawinglayer { namespace attribute {
+ class ImpSdr3DLightAttribute;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class Sdr3DLightAttribute
+ {
+ private:
+ ImpSdr3DLightAttribute* mpSdr3DLightAttribute;
+
+ public:
+ // constructors/destructor
+ Sdr3DLightAttribute(
+ const basegfx::BColor& rColor,
+ const basegfx::B3DVector& rDirection,
+ bool bSpecular);
+ Sdr3DLightAttribute(const basegfx::BColor& rColor);
+ Sdr3DLightAttribute();
+ Sdr3DLightAttribute(const Sdr3DLightAttribute& rCandidate);
+ ~Sdr3DLightAttribute();
+
+ // assignment operator
+ Sdr3DLightAttribute& operator=(const Sdr3DLightAttribute& rCandidate);
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const Sdr3DLightAttribute& rCandidate) const;
+
+ // data read access
+ const basegfx::BColor& getColor() const;
+ const basegfx::B3DVector& getDirection() const;
+ bool getSpecular() const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRLIGHTATTRIBUTE3D_HXX
+
+// eof
diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrlightingattribute3d.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrlightingattribute3d.hxx
new file mode 100644
index 0000000000..5c6ebb4cf5
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/attribute/sdrlightingattribute3d.hxx
@@ -0,0 +1,99 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrattribute3d.hxx,v $
+ *
+ * $Revision: 1.4 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:16 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRLIGHTINGATTRIBUTE3D_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRLIGHTINGATTRIBUTE3D_HXX
+
+#include <sal/types.h>
+#include <vector>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace basegfx {
+ class BColor;
+ class B3DVector;
+}
+
+namespace drawinglayer { namespace attribute {
+ class ImpSdrLightingAttribute;
+ class Sdr3DLightAttribute;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class SdrLightingAttribute
+ {
+ private:
+ ImpSdrLightingAttribute* mpSdrLightingAttribute;
+
+ public:
+ /// constructors/assignmentoperator/destructor
+ SdrLightingAttribute(
+ const basegfx::BColor& rAmbientLight,
+ const ::std::vector< Sdr3DLightAttribute >& rLightVector);
+ SdrLightingAttribute();
+ SdrLightingAttribute(const SdrLightingAttribute& rCandidate);
+ SdrLightingAttribute& operator=(const SdrLightingAttribute& rCandidate);
+ ~SdrLightingAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const SdrLightingAttribute& rCandidate) const;
+
+ // data read access
+ const basegfx::BColor& getAmbientLight() const;
+ const ::std::vector< Sdr3DLightAttribute >& getLightVector() const;
+
+ // color model solver
+ basegfx::BColor solveColorModel(
+ const basegfx::B3DVector& rNormalInEyeCoordinates,
+ const basegfx::BColor& rColor, const basegfx::BColor& rSpecular,
+ const basegfx::BColor& rEmission, sal_uInt16 nSpecularIntensity) const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRLIGHTINGATTRIBUTE3D_HXX
+
+// eof
diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrlineattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrlineattribute.hxx
new file mode 100644
index 0000000000..aa21bf75ca
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/attribute/sdrlineattribute.hxx
@@ -0,0 +1,104 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrattribute.hxx,v $
+ *
+ * $Revision: 1.4 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:16 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRLINEATTRIBUTE_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRLINEATTRIBUTE_HXX
+
+#include <sal/types.h>
+#include <basegfx/vector/b2enums.hxx>
+#include <vector>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace basegfx {
+ class BColor;
+}
+
+namespace drawinglayer { namespace attribute {
+ class ImpSdrLineAttribute;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class SdrLineAttribute
+ {
+ private:
+ ImpSdrLineAttribute* mpSdrLineAttribute;
+
+ public:
+ /// constructors/assignmentoperator/destructor
+ SdrLineAttribute(
+ basegfx::B2DLineJoin eJoin,
+ double fWidth,
+ double fTransparence,
+ const basegfx::BColor& rColor,
+ const ::std::vector< double >& rDotDashArray,
+ double fFullDotDashLen);
+ SdrLineAttribute(const basegfx::BColor& rColor);
+ SdrLineAttribute();
+ SdrLineAttribute(const SdrLineAttribute& rCandidate);
+ SdrLineAttribute& operator=(const SdrLineAttribute& rCandidate);
+ ~SdrLineAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const SdrLineAttribute& rCandidate) const;
+
+ // data access
+ basegfx::B2DLineJoin getJoin() const;
+ double getWidth() const;
+ double getTransparence() const;
+ const basegfx::BColor& getColor() const;
+ const ::std::vector< double >& getDotDashArray() const;
+ double getFullDotDashLen() const;
+
+ // bool access
+ bool isDashed() const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRLINEATTRIBUTE_HXX
+
+// eof
diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrlinestartendattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrlinestartendattribute.hxx
new file mode 100644
index 0000000000..93b5046a44
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/attribute/sdrlinestartendattribute.hxx
@@ -0,0 +1,102 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrattribute.hxx,v $
+ *
+ * $Revision: 1.4 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:16 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRLINESTARTENDATTRIBUTE_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRLINESTARTENDATTRIBUTE_HXX
+
+#include <sal/types.h>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace basegfx {
+ class B2DPolyPolygon;
+}
+
+namespace drawinglayer { namespace attribute {
+ class ImpSdrLineStartEndAttribute;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class SdrLineStartEndAttribute
+ {
+ private:
+ ImpSdrLineStartEndAttribute* mpSdrLineStartEndAttribute;
+
+ public:
+ /// constructors/assignmentoperator/destructor
+ SdrLineStartEndAttribute(
+ const basegfx::B2DPolyPolygon& rStartPolyPolygon,
+ const basegfx::B2DPolyPolygon& rEndPolyPolygon,
+ double fStartWidth,
+ double fEndWidth,
+ bool bStartActive,
+ bool bEndActive,
+ bool bStartCentered,
+ bool bEndCentered);
+ SdrLineStartEndAttribute();
+ SdrLineStartEndAttribute(const SdrLineStartEndAttribute& rCandidate);
+ SdrLineStartEndAttribute& operator=(const SdrLineStartEndAttribute& rCandidate);
+ ~SdrLineStartEndAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const SdrLineStartEndAttribute& rCandidate) const;
+
+ // data read access
+ const basegfx::B2DPolyPolygon& getStartPolyPolygon() const;
+ const basegfx::B2DPolyPolygon& getEndPolyPolygon() const;
+ double getStartWidth() const;
+ double getEndWidth() const;
+ bool isStartActive() const;
+ bool isEndActive() const;
+ bool isStartCentered() const;
+ bool isEndCentered() const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRLINESTARTENDATTRIBUTE_HXX
+
+// eof
diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrobjectattribute3d.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrobjectattribute3d.hxx
new file mode 100644
index 0000000000..0e89198b9b
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/attribute/sdrobjectattribute3d.hxx
@@ -0,0 +1,111 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrattribute3d.hxx,v $
+ *
+ * $Revision: 1.4 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:16 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDROBJECTATTRIBUTE3D_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDROBJECTATTRIBUTE3D_HXX
+
+#include <sal/types.h>
+#include <com/sun/star/drawing/NormalsKind.hpp>
+#include <com/sun/star/drawing/TextureProjectionMode.hpp>
+#include <com/sun/star/drawing/TextureKind2.hpp>
+#include <com/sun/star/drawing/TextureMode.hpp>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace drawinglayer { namespace attribute {
+ class ImpSdr3DObjectAttribute;
+ class MaterialAttribute3D;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class Sdr3DObjectAttribute
+ {
+ private:
+ ImpSdr3DObjectAttribute* mpSdr3DObjectAttribute;
+
+ public:
+ // constructors/destructor
+ Sdr3DObjectAttribute(
+ ::com::sun::star::drawing::NormalsKind aNormalsKind,
+ ::com::sun::star::drawing::TextureProjectionMode aTextureProjectionX,
+ ::com::sun::star::drawing::TextureProjectionMode aTextureProjectionY,
+ ::com::sun::star::drawing::TextureKind2 aTextureKind,
+ ::com::sun::star::drawing::TextureMode aTextureMode,
+ const MaterialAttribute3D& rMaterial,
+ bool bNormalsInvert,
+ bool bDoubleSided,
+ bool bShadow3D,
+ bool bTextureFilter,
+ bool bReducedLineGeometry);
+ Sdr3DObjectAttribute();
+ Sdr3DObjectAttribute(const Sdr3DObjectAttribute& rCandidate);
+ ~Sdr3DObjectAttribute();
+
+ // assignment operator
+ Sdr3DObjectAttribute& operator=(const Sdr3DObjectAttribute& rCandidate);
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const Sdr3DObjectAttribute& rCandidate) const;
+
+ // data read access
+ ::com::sun::star::drawing::NormalsKind getNormalsKind() const;
+ ::com::sun::star::drawing::TextureProjectionMode getTextureProjectionX() const;
+ ::com::sun::star::drawing::TextureProjectionMode getTextureProjectionY() const;
+ ::com::sun::star::drawing::TextureKind2 getTextureKind() const;
+ ::com::sun::star::drawing::TextureMode getTextureMode() const;
+ const MaterialAttribute3D& getMaterial() const;
+ bool getNormalsInvert() const;
+ bool getDoubleSided() const;
+ bool getShadow3D() const;
+ bool getTextureFilter() const;
+ bool getReducedLineGeometry() const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDROBJECTATTRIBUTE3D_HXX
+
+// eof
diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrsceneattribute3d.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrsceneattribute3d.hxx
new file mode 100644
index 0000000000..7b25b6c486
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/attribute/sdrsceneattribute3d.hxx
@@ -0,0 +1,94 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrattribute3d.hxx,v $
+ *
+ * $Revision: 1.4 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:16 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRSCENEATTRIBUTE3D_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRSCENEATTRIBUTE3D_HXX
+
+#include <sal/types.h>
+#include <com/sun/star/drawing/ProjectionMode.hpp>
+#include <com/sun/star/drawing/ShadeMode.hpp>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace drawinglayer { namespace attribute {
+ class ImpSdrSceneAttribute;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class SdrSceneAttribute
+ {
+ private:
+ ImpSdrSceneAttribute* mpSdrSceneAttribute;
+
+ public:
+ /// constructors/assignmentoperator/destructor
+ SdrSceneAttribute(
+ double fDistance,
+ double fShadowSlant,
+ ::com::sun::star::drawing::ProjectionMode aProjectionMode,
+ ::com::sun::star::drawing::ShadeMode aShadeMode,
+ bool bTwoSidedLighting);
+ SdrSceneAttribute();
+ SdrSceneAttribute(const SdrSceneAttribute& rCandidate);
+ SdrSceneAttribute& operator=(const SdrSceneAttribute& rCandidate);
+ ~SdrSceneAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const SdrSceneAttribute& rCandidate) const;
+
+ // data read access
+ double getDistance() const;
+ double getShadowSlant() const;
+ ::com::sun::star::drawing::ProjectionMode getProjectionMode() const;
+ ::com::sun::star::drawing::ShadeMode getShadeMode() const;
+ bool getTwoSidedLighting() const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRSCENEATTRIBUTE3D_HXX
+
+// eof
diff --git a/drawinglayer/inc/drawinglayer/attribute/sdrshadowattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/sdrshadowattribute.hxx
new file mode 100644
index 0000000000..65f4fefb30
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/attribute/sdrshadowattribute.hxx
@@ -0,0 +1,93 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrattribute.hxx,v $
+ *
+ * $Revision: 1.4 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:16 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRSHADOWATTRIBUTE_HXX
+#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRSHADOWATTRIBUTE_HXX
+
+#include <sal/types.h>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace basegfx {
+ class BColor;
+ class B2DVector;
+}
+
+namespace drawinglayer { namespace attribute {
+ class ImpSdrShadowAttribute;
+}}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class SdrShadowAttribute
+ {
+ private:
+ ImpSdrShadowAttribute* mpSdrShadowAttribute;
+
+ public:
+ /// constructors/assignmentoperator/destructor
+ SdrShadowAttribute(
+ const basegfx::B2DVector& rOffset,
+ double fTransparence,
+ const basegfx::BColor& rColor);
+ SdrShadowAttribute();
+ SdrShadowAttribute(const SdrShadowAttribute& rCandidate);
+ SdrShadowAttribute& operator=(const SdrShadowAttribute& rCandidate);
+ ~SdrShadowAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const SdrShadowAttribute& rCandidate) const;
+
+ // data access
+ const basegfx::B2DVector& getOffset() const;
+ double getTransparence() const;
+ const basegfx::BColor& getColor() const;
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRSHADOWATTRIBUTE_HXX
+
+// eof
diff --git a/drawinglayer/inc/drawinglayer/attribute/strokeattribute.hxx b/drawinglayer/inc/drawinglayer/attribute/strokeattribute.hxx
index b2353df4ee..3e3f522f05 100644
--- a/drawinglayer/inc/drawinglayer/attribute/strokeattribute.hxx
+++ b/drawinglayer/inc/drawinglayer/attribute/strokeattribute.hxx
@@ -28,13 +28,16 @@
#ifndef INCLUDED_DRAWINGLAYER_ATTRIBUTE_STROKEATTRIBUTE_HXX
#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_STROKEATTRIBUTE_HXX
-#include <basegfx/polygon/b2dlinegeometry.hxx>
-#include <basegfx/color/bcolor.hxx>
+#include <sal/types.h>
#include <vector>
//////////////////////////////////////////////////////////////////////////////
// predefines
+namespace drawinglayer { namespace attribute {
+ class ImpStrokeAttribute;
+}}
+
//////////////////////////////////////////////////////////////////////////////
namespace drawinglayer
@@ -44,49 +47,26 @@ namespace drawinglayer
class StrokeAttribute
{
private:
- ::std::vector< double > maDotDashArray; // array of double which defines the dot-dash pattern
- double mfFullDotDashLen; // sum of maDotDashArray (for convenience)
+ ImpStrokeAttribute* mpStrokeAttribute;
public:
+ /// constructors/assignmentoperator/destructor
StrokeAttribute(
const ::std::vector< double >& rDotDashArray,
- double fFullDotDashLen = 0.0)
- : maDotDashArray(rDotDashArray),
- mfFullDotDashLen(fFullDotDashLen)
- {
- }
-
- StrokeAttribute()
- : maDotDashArray(),
- mfFullDotDashLen(0.0)
- {
- }
-
- StrokeAttribute(const StrokeAttribute& rCandidate)
- {
- *this = rCandidate;
- }
-
- StrokeAttribute& operator=(const StrokeAttribute& rCandidate)
- {
- maDotDashArray = rCandidate.maDotDashArray;
- mfFullDotDashLen = rCandidate.mfFullDotDashLen;
- return *this;
- }
+ double fFullDotDashLen = 0.0);
+ StrokeAttribute();
+ StrokeAttribute(const StrokeAttribute& rCandidate);
+ StrokeAttribute& operator=(const StrokeAttribute& rCandidate);
+ ~StrokeAttribute();
- ~StrokeAttribute()
- {
- }
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
// compare operator
- bool operator==(const StrokeAttribute& rCandidate) const
- {
- return (mfFullDotDashLen == rCandidate.mfFullDotDashLen
- && maDotDashArray == rCandidate.maDotDashArray);
- }
+ bool operator==(const StrokeAttribute& rCandidate) const;
- // data access
- const ::std::vector< double >& getDotDashArray() const { return maDotDashArray; }
+ // data read access
+ const ::std::vector< double >& getDotDashArray() const;
double getFullDotDashLen() const;
};
} // end of namespace attribute
diff --git a/drawinglayer/inc/drawinglayer/geometry/viewinformation2d.hxx b/drawinglayer/inc/drawinglayer/geometry/viewinformation2d.hxx
index 5b70617b43..72fb9f027b 100644
--- a/drawinglayer/inc/drawinglayer/geometry/viewinformation2d.hxx
+++ b/drawinglayer/inc/drawinglayer/geometry/viewinformation2d.hxx
@@ -114,12 +114,18 @@ namespace drawinglayer
*/
ViewInformation2D(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rViewParameters);
+ /// default (empty) constructor
+ ViewInformation2D();
+
/// copy constructor
ViewInformation2D(const ViewInformation2D& rCandidate);
/// destructor
~ViewInformation2D();
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
/// assignment operator
ViewInformation2D& operator=(const ViewInformation2D& rCandidate);
diff --git a/drawinglayer/inc/drawinglayer/geometry/viewinformation3d.hxx b/drawinglayer/inc/drawinglayer/geometry/viewinformation3d.hxx
index 688c65903e..4ea2d4064d 100644
--- a/drawinglayer/inc/drawinglayer/geometry/viewinformation3d.hxx
+++ b/drawinglayer/inc/drawinglayer/geometry/viewinformation3d.hxx
@@ -119,12 +119,18 @@ namespace drawinglayer
*/
ViewInformation3D(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rViewParameters);
+ /// default (empty) constructor
+ ViewInformation3D();
+
/// copy constructor
ViewInformation3D(const ViewInformation3D& rCandidate);
/// destructor
~ViewInformation3D();
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
/// assignment operator
ViewInformation3D& operator=(const ViewInformation3D& rCandidate);
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/alphaprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/alphaprimitive2d.hxx
deleted file mode 100644
index a395efa699..0000000000
--- a/drawinglayer/inc/drawinglayer/primitive2d/alphaprimitive2d.hxx
+++ /dev/null
@@ -1,95 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_ALPHAPRIMITIVE2D_HXX
-#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_ALPHAPRIMITIVE2D_HXX
-
-#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace primitive2d
- {
- /** AlphaPrimitive2D class
-
- This is the basic primitive for applying freely defined transparence
- to freely defined content. The basic idea is to associate a content
- which is defined as a sequence of primitives and hold as child content
- in the GroupPrimitive2D with an alpha channel also defined as a sequence
- of primitives and hold in the Alpha member.
-
- The basic definition is to use the Alpha content as Alpha-Mask by
- interpreting the Alpha-content not as RGB, but as Luminance alpha mask
- using the common RGB_to_luminance definition as e.g. used by VCL.
-
- The defining geometry is the Range of the child primitive sequence,
- this means the renderers will/shall use this geometric information for
- rendering, not the alpha one. The alpha one should/will be clipped
- accordingly.
- */
- class AlphaPrimitive2D : public GroupPrimitive2D
- {
- private:
- /// The Alpha-Mask who's RGB-Values are interpreted as Luminance
- Primitive2DSequence maAlpha;
-
- public:
- /** constructor
-
- @param rChildren
- The content which is defined to have a transparency. The
- range of this primitive is defined by this content
-
- @param rAlpha
- The definition of the Alpha-channel for this primitive. It
- will be interpreted as mask by interpreting as gray values
- using the common RGB_to_luminance definitions
- */
- AlphaPrimitive2D(
- const Primitive2DSequence& rChildren,
- const Primitive2DSequence& rAlpha);
-
- /// data read access
- const Primitive2DSequence& getAlpha() const { return maAlpha; }
-
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
- /// provide unique ID
- DeclPrimitrive2DIDBlock()
- };
- } // end of namespace primitive2d
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_ALPHAPRIMITIVE2D_HXX
-
-//////////////////////////////////////////////////////////////////////////////
-// eof
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx
index 40cc4ac5f0..dbeb14eae9 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/baseprimitive2d.hxx
@@ -102,14 +102,16 @@ namespace drawinglayer
Current Basic 2D Primitives are:
- - BitmapPrimitive2D (bitmap data, evtl. with alpha)
- - MetafilePrimitive2D (VCL Metafile, currently no decomposition, but planned, so may vanish)
+ - BitmapPrimitive2D (bitmap data, evtl. with transparence)
- PointArrayPrimitive2D (single points)
- PolygonHairlinePrimitive2D (hairline curves/polygons)
- PolyPolygonColorPrimitive2D (colored polygons)
+ UPDATE: MetafilePrimitive2D (VCL Metafile) is taken off this list since
+ it is implemented with the integration of CWS aw078 into DV300m69.
+
All other implemented primitives have a defined decomposition and can thus be
- decomposed downt to this small set.
+ decomposed down to this small set.
A renderer implementing support for this minimal set of primitives can completely
render primitive-based visualisations. Of course, he also has to take states into account
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx
index a926b282cf..ac450ed4ac 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx
@@ -40,7 +40,7 @@
//////////////////////////////////////////////////////////////////////////////
// local primitives
-#define PRIMITIVE2D_ID_ALPHAPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 0)
+#define PRIMITIVE2D_ID_TRANSPARENCEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 0)
#define PRIMITIVE2D_ID_ANIMATEDSWITCHPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 1)
#define PRIMITIVE2D_ID_ANIMATEDBLINKPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 2)
#define PRIMITIVE2D_ID_ANIMATEDINTERPOLATEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 3)
@@ -75,7 +75,7 @@
#define PRIMITIVE2D_ID_TEXTSIMPLEPORTIONPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 32)
#define PRIMITIVE2D_ID_TEXTDECORATEDPORTIONPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 33)
#define PRIMITIVE2D_ID_TRANSFORMPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 34)
-#define PRIMITIVE2D_ID_UNIFIEDALPHAPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 35)
+#define PRIMITIVE2D_ID_UNIFIEDTRANSPARENCEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 35)
#define PRIMITIVE2D_ID_POINTARRAYPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 36)
#define PRIMITIVE2D_ID_TEXTHIERARCHYFIELDPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 37)
#define PRIMITIVE2D_ID_TEXTHIERARCHYLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 38)
@@ -93,14 +93,14 @@
#define PRIMITIVE2D_ID_STRUCTURETAGRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 50)
#define PRIMITIVE2D_ID_BORDERLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 51)
#define PRIMITIVE2D_ID_POLYPOLYGONMARKERPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 52)
-#define PRIMITIVE2D_ID_HITTESTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 53)
-#define PRIMITIVE2D_ID_INVERTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 54)
-#define PRIMITIVE2D_ID_DISCRETEBITMAPPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 55)
-#define PRIMITIVE2D_ID_WALLPAPERBITMAPPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 56)
-#define PRIMITIVE2D_ID_TEXTLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 57)
-#define PRIMITIVE2D_ID_TEXTCHARACTERSTRIKEOUTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 58)
-#define PRIMITIVE2D_ID_TEXTGEOMETRYSTRIKEOUTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 59)
-#define PRIMITIVE2D_ID_EPSPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 60)
+#define PRIMITIVE2D_ID_INVERTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 53)
+#define PRIMITIVE2D_ID_DISCRETEBITMAPPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 54)
+#define PRIMITIVE2D_ID_WALLPAPERBITMAPPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 55)
+#define PRIMITIVE2D_ID_TEXTLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 56)
+#define PRIMITIVE2D_ID_TEXTCHARACTERSTRIKEOUTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 57)
+#define PRIMITIVE2D_ID_TEXTGEOMETRYSTRIKEOUTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 58)
+#define PRIMITIVE2D_ID_EPSPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 59)
+#define PRIMITIVE2D_ID_HIDDENGEOMETRYPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 60)
//////////////////////////////////////////////////////////////////////////////
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx
index 05c798481f..457051b570 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/fillgradientprimitive2d.hxx
@@ -29,7 +29,7 @@
#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLGRADIENTPRIMITIVE2D_HXX
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
-#include <drawinglayer/attribute/fillattribute.hxx>
+#include <drawinglayer/attribute/fillgradientattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
// predefines
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx
index 86ede1ea78..fc712c591a 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/fillhatchprimitive2d.hxx
@@ -29,7 +29,8 @@
#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_FILLHATCHPRIMITIVE2D_HXX
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
-#include <drawinglayer/attribute/fillattribute.hxx>
+#include <drawinglayer/attribute/fillhatchattribute.hxx>
+#include <basegfx/color/bcolor.hxx>
//////////////////////////////////////////////////////////////////////////////
// FillHatchPrimitive2D class
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/gridprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/gridprimitive2d.hxx
index b09cee8b09..f8930e4075 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/gridprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/gridprimitive2d.hxx
@@ -66,7 +66,7 @@ namespace drawinglayer
/// Grid color for single-pixel grid points
basegfx::BColor maBColor;
- /// The Bitmap (with alpha) for grid cross points
+ /// The Bitmap (with transparence) for grid cross points
BitmapEx maCrossMarker;
/** the last used object to view transformtion and the last Viewport,
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/groupprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/groupprimitive2d.hxx
index d4cb971c37..366906ed9b 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/groupprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/groupprimitive2d.hxx
@@ -63,7 +63,7 @@ namespace drawinglayer
Current Basic 2D StatePrimitives are:
- - AlphaPrimitive2D (objects with freely defined transparence)
+ - TransparencePrimitive2D (objects with freely defined transparence)
- InvertPrimitive2D (for XOR)
- MaskPrimitive2D (for masking)
- ModifiedColorPrimitive2D (for a stack of color modifications)
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx
new file mode 100644
index 0000000000..0a2cef926d
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx
@@ -0,0 +1,79 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: hittestprimitive3d.hxx,v $
+ *
+ * $Revision: 1.1.2.1 $
+ *
+ * last change: $Author: aw $ $Date: 2008/09/24 14:27:39 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_HIDDENGEOMETRYPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_HIDDENGEOMETRYPRIMITIVE2D_HXX
+
+#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ // This primitive is used to represent geometry for non-visible objects,
+ // e.g. a PresObj's outline. To still be able to use primitives for HitTest
+ // functionality, the 2d decompositions will produce an as much as possible
+ // simplified line geometry encapsulated in this primtive when there is no
+ // line geometry. In a further enchanced version this may change to 'if neither
+ // filled nor lines' creation criteria. The whole primitive decomposes to nothing,
+ // so no one not knowing it will be influenced. Only helper processors for hit test
+ // (and maybe BoundRect extractors) will use it and it's children subcontent.
+ class HiddenGeometryPrimitive2D : public GroupPrimitive2D
+ {
+ public:
+ HiddenGeometryPrimitive2D(const Primitive2DSequence& rChildren);
+
+ // despite returning an empty decomposition since it's no visualisation data,
+ // range calculation is intended to use hidden geometry, so
+ // the local implementation will return the children's range
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// local decomposition. Implementation will return empty Primitive2DSequence
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ // provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_HIDDENGEOMETRYPRIMITIVE2D_HXX
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/hittestprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/hittestprimitive2d.hxx
deleted file mode 100644
index fbe74e0740..0000000000
--- a/drawinglayer/inc/drawinglayer/primitive2d/hittestprimitive2d.hxx
+++ /dev/null
@@ -1,78 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_HITTESTPRIMITIVE2D_HXX
-#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_HITTESTPRIMITIVE2D_HXX
-
-#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace primitive2d
- {
- /** HitTestPrimitive2D class
-
- This primitive is used to represent geometry for non-visible objects,
- e.g. a PresObj's outline. To still be able to use primitives for HitTest
- functionality, the 2d decompositions will produce an as much as possible
- simplified line geometry encapsulated in this primtive when there is no
- line geometry. In a further enchanced version this may change to 'if neither
- filled nor lines' creation criteria. The whole primitive decomposes to nothing,
- so no one not knowing it will be influenced. Only helper processors for hit test
- (and maybe BoundRect extractors) will use it and it's children subcontent.
- */
- class HitTestPrimitive2D : public GroupPrimitive2D
- {
- public:
- /// constructor
- HitTestPrimitive2D(const Primitive2DSequence& rChildren);
-
- /** despite returning an empty decomposition since it's no visualisation data,
- range calculation is intended to use invisible replacement geometry, so
- the local implementation will return the children's range
- */
- virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
-
- /** local decomposition. Implementation will return empty Primitive2DSequence
- since this is no visualisation data
- */
- virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
-
- /// provide unique ID
- DeclPrimitrive2DIDBlock()
- };
- } // end of namespace primitive2d
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_HITTESTPRIMITIVE2D_HXX
-
-//////////////////////////////////////////////////////////////////////////////
-// eof
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/markerarrayprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/markerarrayprimitive2d.hxx
index 9853141b31..f049888ee7 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/markerarrayprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/markerarrayprimitive2d.hxx
@@ -47,7 +47,7 @@ namespace drawinglayer
invariant, so that the bitmap is always visualized unscaled and
unrotated.
It is used e.g. for grid position visualisation. The given Bitmap
- (with alpha) is defined to be visible centered at each of the given
+ (with transparence) is defined to be visible centered at each of the given
positions.
It decomposes to the needed number of BitmapPrimitive2D's, so it would
be efficient to handle it directly in a renderer.
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/metafileprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/metafileprimitive2d.hxx
index 70197fa0ad..9a5f90f6ea 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/metafileprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/metafileprimitive2d.hxx
@@ -39,7 +39,7 @@ namespace drawinglayer
{
namespace primitive2d
{
- /** MediaPrimitive2D class
+ /** MetafilePrimitive2D class
This is the MetaFile representing primitive. It's geometry is defined
by MetaFileTransform. The content (defined by MetaFile) will be scaled
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx
index e94e7ad2de..1e7b060e47 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx
@@ -33,6 +33,8 @@
#include <drawinglayer/attribute/strokeattribute.hxx>
#include <drawinglayer/attribute/linestartendattribute.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/color/bcolor.hxx>
//////////////////////////////////////////////////////////////////////////////
// PolygonHairlinePrimitive2D class
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx
index b4ee009f9a..e0afa585e2 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx
@@ -29,12 +29,14 @@
#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_POLYPOLYGONPRIMITIVE2D_HXX
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
-#include <drawinglayer/attribute/fillattribute.hxx>
#include <drawinglayer/attribute/fillbitmapattribute.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <drawinglayer/attribute/lineattribute.hxx>
#include <drawinglayer/attribute/strokeattribute.hxx>
#include <drawinglayer/attribute/linestartendattribute.hxx>
+#include <drawinglayer/attribute/fillgradientattribute.hxx>
+#include <drawinglayer/attribute/fillhatchattribute.hxx>
+#include <basegfx/color/bcolor.hxx>
//////////////////////////////////////////////////////////////////////////////
// PolyPolygonHairlinePrimitive2D class
@@ -401,7 +403,7 @@ namespace drawinglayer
/** PolyPolygonBitmapPrimitive2D class
This primitive defines a PolyPolygon filled with bitmap data
- (including alpha). The decomosition will create a MaskPrimitive2D
+ (including transparence). The decomosition will create a MaskPrimitive2D
containing a FillBitmapPrimitive2D.
*/
class PolyPolygonBitmapPrimitive2D : public BufferedDecompositionPrimitive2D
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx
index e86c28f8c9..22bf70eefd 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx
@@ -30,10 +30,12 @@
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
#include <drawinglayer/primitive3d/baseprimitive3d.hxx>
-#include <drawinglayer/attribute/sdrattribute3d.hxx>
#include <drawinglayer/geometry/viewinformation3d.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <vcl/bitmapex.hxx>
+#include <drawinglayer/attribute/sdrsceneattribute3d.hxx>
+#include <drawinglayer/attribute/sdrlightingattribute3d.hxx>
+#include <drawinglayer/attribute/sdrlightattribute3d.hxx>
//////////////////////////////////////////////////////////////////////////////
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/sdrdecompositiontools2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/sdrdecompositiontools2d.hxx
new file mode 100644
index 0000000000..a9aa6cb5b5
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/primitive2d/sdrdecompositiontools2d.hxx
@@ -0,0 +1,85 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrdecompositiontools3d.hxx,v $
+ *
+ * $Revision: 1.5 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:18 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_SDRDECOMPOSITIONTOOLS2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_SDRDECOMPOSITIONTOOLS2D_HXX
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace basegfx {
+ class B2DPolyPolygon;
+ class B2DHomMatrix;
+}
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ // helpers to create HitTestPrimitives Line
+ Primitive2DReference createHiddenGeometryPrimitives2D(
+ bool bFilled,
+ const basegfx::B2DHomMatrix& rMatrix);
+
+ Primitive2DReference createHiddenGeometryPrimitives2D(
+ bool bFilled,
+ const basegfx::B2DPolyPolygon& rPolygon);
+
+ Primitive2DReference createHiddenGeometryPrimitives2D(
+ bool bFilled,
+ const basegfx::B2DRange& rRange);
+
+ Primitive2DReference createHiddenGeometryPrimitives2D(
+ bool bFilled,
+ const basegfx::B2DRange& rRange,
+ const basegfx::B2DHomMatrix& rMatrix);
+
+ Primitive2DReference createHiddenGeometryPrimitives2D(
+ bool bFilled,
+ const basegfx::B2DPolyPolygon& rPolygon,
+ const basegfx::B2DHomMatrix& rMatrix);
+
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_SDRDECOMPOSITIONTOOLS2D_HXX
+
+// eof
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx b/drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx
index cc3b1e76e6..1a7337b3aa 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/textlayoutdevice.hxx
@@ -93,20 +93,20 @@ namespace drawinglayer
double getTextWidth(
const String& rText,
- xub_StrLen nIndex,
- xub_StrLen nLength) const;
+ sal_uInt32 nIndex,
+ sal_uInt32 nLength) const;
bool getTextOutlines(
basegfx::B2DPolyPolygonVector&,
const String& rText,
- xub_StrLen nIndex,
- xub_StrLen nLength,
- const ::std::vector< double >& rDXArray);
+ sal_uInt32 nIndex,
+ sal_uInt32 nLength,
+ const ::std::vector< double >& rDXArray) const;
basegfx::B2DRange getTextBoundRect(
const String& rText,
- xub_StrLen nIndex,
- xub_StrLen nLength) const;
+ sal_uInt32 nIndex,
+ sal_uInt32 nLength) const;
double getFontAscent() const;
double getFontDescent() const;
@@ -115,7 +115,12 @@ namespace drawinglayer
const Rectangle& rRectangle,
const String& rText,
sal_uInt16 nStyle,
- GDIMetaFile& rGDIMetaFile);
+ GDIMetaFile& rGDIMetaFile) const;
+
+ ::std::vector< double > getTextArray(
+ const String& rText,
+ sal_uInt32 nIndex,
+ sal_uInt32 nLength) const;
};
} // end of namespace primitive2d
} // end of namespace drawinglayer
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/transparenceprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/transparenceprimitive2d.hxx
new file mode 100644
index 0000000000..e78bd64186
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/primitive2d/transparenceprimitive2d.hxx
@@ -0,0 +1,103 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: alphaprimitive2d.hxx,v $
+ *
+ * $Revision: 1.3 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:16 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TRANSPARENCEPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TRANSPARENCEPRIMITIVE2D_HXX
+
+#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** TransparencePrimitive2D class
+
+ This is the basic primitive for applying freely defined transparence
+ to freely defined content. The basic idea is to associate a content
+ which is defined as a sequence of primitives and hold as child content
+ in the GroupPrimitive2D with a transparence channel also defined as a sequence
+ of primitives and hold in the transparence member.
+
+ The basic definition is to use the transparence content as transparence-Mask by
+ interpreting the transparence-content not as RGB, but as Luminance transparence mask
+ using the common RGB_to_luminance definition as e.g. used by VCL.
+
+ The defining geometry is the Range of the child primitive sequence,
+ this means the renderers will/shall use this geometric information for
+ rendering, not the transparent one. The transparent one should/will be clipped
+ accordingly.
+ */
+ class TransparencePrimitive2D : public GroupPrimitive2D
+ {
+ private:
+ /// The transparence-Mask who's RGB-Values are interpreted as Luminance
+ Primitive2DSequence maTransparence;
+
+ public:
+ /** constructor
+
+ @param rChildren
+ The content which is defined to have a transparency. The
+ range of this primitive is defined by this content
+
+ @param rTransparence
+ The definition of the Transparence-channel for this primitive. It
+ will be interpreted as mask by interpreting as gray values
+ using the common RGB_to_luminance definitions
+ */
+ TransparencePrimitive2D(
+ const Primitive2DSequence& rChildren,
+ const Primitive2DSequence& rTransparence);
+
+ /// data read access
+ const Primitive2DSequence& getTransparence() const { return maTransparence; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TRANSPARENCEPRIMITIVE2D_HXX
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx
deleted file mode 100644
index aec49ff7c9..0000000000
--- a/drawinglayer/inc/drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx
+++ /dev/null
@@ -1,80 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_UNIFIEDALPHAPRIMITIVE2D_HXX
-#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_UNIFIEDALPHAPRIMITIVE2D_HXX
-
-#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace primitive2d
- {
- /** UnifiedAlphaPrimitive2D class
-
- This primitive encapsualtes a child hierarchy and defines
- that it shall be visualized with the given transparency. That
- transparency is unique for all contained geometry, so that
- e.g. overlapping polygons in the child geometry will not show
- regions of combined transparency, but be all rendered with the
- defined, single transparency.
- */
- class UnifiedAlphaPrimitive2D : public GroupPrimitive2D
- {
- private:
- /// the unified alpha transparence
- double mfAlpha;
-
- public:
- /// constructor
- UnifiedAlphaPrimitive2D(
- const Primitive2DSequence& rChildren,
- double fAlpha);
-
- /// data read access
- double getAlpha() const { return mfAlpha; }
-
- /// compare operator
- virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
-
- /// create decomposition
- virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
-
- /// provide unique ID
- DeclPrimitrive2DIDBlock()
- };
- } // end of namespace primitive2d
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_UNIFIEDALPHAPRIMITIVE2D_HXX
-
-//////////////////////////////////////////////////////////////////////////////
-// eof
diff --git a/drawinglayer/inc/drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx
new file mode 100644
index 0000000000..aee4042c6a
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx
@@ -0,0 +1,91 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: UnifiedTransparencePrimitive2D.hxx,v $
+ *
+ * $Revision: 1.3 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:17 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_UNIFIEDTRANSPARENCEPRIMITIVE2D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_UNIFIEDTRANSPARENCEPRIMITIVE2D_HXX
+
+#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ /** UnifiedTransparencePrimitive2D class
+
+ This primitive encapsualtes a child hierarchy and defines
+ that it shall be visualized with the given transparency. That
+ transparency is unique for all contained geometry, so that
+ e.g. overlapping polygons in the child geometry will not show
+ regions of combined transparency, but be all rendered with the
+ defined, single transparency.
+ */
+ class UnifiedTransparencePrimitive2D : public GroupPrimitive2D
+ {
+ private:
+ /// the unified transparence
+ double mfTransparence;
+
+ public:
+ /// constructor
+ UnifiedTransparencePrimitive2D(
+ const Primitive2DSequence& rChildren,
+ double fTransparence);
+
+ /// data read access
+ double getTransparence() const { return mfTransparence; }
+
+ /// compare operator
+ virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
+
+ /// own getB2DRange implementation to include transparent geometries to BoundRect calculations
+ virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// create decomposition
+ virtual Primitive2DSequence get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
+
+ /// provide unique ID
+ DeclPrimitrive2DIDBlock()
+ };
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_UNIFIEDTRANSPARENCEPRIMITIVE2D_HXX
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx
index d969812c4d..a104543d2e 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx
@@ -37,25 +37,25 @@
//////////////////////////////////////////////////////////////////////////////
// local primitives
-#define PRIMITIVE3D_ID_GROUPPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 0)
-#define PRIMITIVE3D_ID_HATCHTEXTUREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 1)
-#define PRIMITIVE3D_ID_MODIFIEDCOLORPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 2)
-#define PRIMITIVE3D_ID_POLYGONHAIRLINEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 3)
-#define PRIMITIVE3D_ID_POLYGONSTROKEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 4)
-#define PRIMITIVE3D_ID_POLYGONTUBEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 5)
-#define PRIMITIVE3D_ID_POLYPOLYGONMATERIALPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 6)
-#define PRIMITIVE3D_ID_SDRCUBEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 7)
-#define PRIMITIVE3D_ID_SDREXTRUDEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 8)
-#define PRIMITIVE3D_ID_SDRLATHEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 9)
-#define PRIMITIVE3D_ID_SDRPOLYPOLYGONPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 10)
-#define PRIMITIVE3D_ID_SDRSPHEREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 11)
-#define PRIMITIVE3D_ID_SHADOWPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 12)
-#define PRIMITIVE3D_ID_UNIFIEDALPHATEXTUREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 13)
-#define PRIMITIVE3D_ID_GRADIENTTEXTUREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 14)
-#define PRIMITIVE3D_ID_BITMAPTEXTUREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 15)
-#define PRIMITIVE3D_ID_ALPHATEXTUREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 16)
-#define PRIMITIVE3D_ID_TRANSFORMPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 17)
-#define PRIMITIVE3D_ID_HITTESTPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 18)
+#define PRIMITIVE3D_ID_GROUPPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 0)
+#define PRIMITIVE3D_ID_HATCHTEXTUREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 1)
+#define PRIMITIVE3D_ID_MODIFIEDCOLORPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 2)
+#define PRIMITIVE3D_ID_POLYGONHAIRLINEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 3)
+#define PRIMITIVE3D_ID_POLYGONSTROKEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 4)
+#define PRIMITIVE3D_ID_POLYGONTUBEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 5)
+#define PRIMITIVE3D_ID_POLYPOLYGONMATERIALPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 6)
+#define PRIMITIVE3D_ID_SDRCUBEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 7)
+#define PRIMITIVE3D_ID_SDREXTRUDEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 8)
+#define PRIMITIVE3D_ID_SDRLATHEPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 9)
+#define PRIMITIVE3D_ID_SDRPOLYPOLYGONPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 10)
+#define PRIMITIVE3D_ID_SDRSPHEREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 11)
+#define PRIMITIVE3D_ID_SHADOWPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 12)
+#define PRIMITIVE3D_ID_UNIFIEDTRANSPARENCETEXTUREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 13)
+#define PRIMITIVE3D_ID_GRADIENTTEXTUREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 14)
+#define PRIMITIVE3D_ID_BITMAPTEXTUREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 15)
+#define PRIMITIVE3D_ID_TRANSPARENCETEXTUREPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 16)
+#define PRIMITIVE3D_ID_TRANSFORMPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 17)
+#define PRIMITIVE3D_ID_HIDDENGEOMETRYPRIMITIVE3D (PRIMITIVE3D_ID_RANGE_DRAWINGLAYER| 18)
//////////////////////////////////////////////////////////////////////////////
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/groupprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/groupprimitive3d.hxx
index 7679d45ac0..911ad35764 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/groupprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/groupprimitive3d.hxx
@@ -51,7 +51,7 @@ namespace drawinglayer
- TexturePrimitive3D (with the following variations)
- GradientTexturePrimitive3D (for 3D gradient fill)
- BitmapTexturePrimitive3D (for 3D Bitmap fill)
- - AlphaTexturePrimitive3D (for 3D transparence)
+ - TransparenceTexturePrimitive3D (for 3D transparence)
- HatchTexturePrimitive3D (for 3D hatch fill)
- TransformPrimitive3D (for a transformation stack)
*/
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx
index 37c02aba50..3bfa1c4461 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/hatchtextureprimitive3d.hxx
@@ -29,6 +29,7 @@
#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_HATCHTEXTUREPRIMITIVE3D_HXX
#include <drawinglayer/primitive3d/textureprimitive3d.hxx>
+#include <drawinglayer/attribute/fillhatchattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/hiddengeometryprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/hiddengeometryprimitive3d.hxx
new file mode 100644
index 0000000000..593242e764
--- /dev/null
+++ b/drawinglayer/inc/drawinglayer/primitive3d/hiddengeometryprimitive3d.hxx
@@ -0,0 +1,81 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: hittestprimitive3d.hxx,v $
+ *
+ * $Revision: 1.1.2.1 $
+ *
+ * last change: $Author: aw $ $Date: 2008/09/24 14:27:39 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_HIDDENGEOMETRYPRIMITIVE3D_HXX
+#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_HIDDENGEOMETRYPRIMITIVE3D_HXX
+
+#include <drawinglayer/primitive3d/groupprimitive3d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive3d
+ {
+ // This primitive is used to represent geometry for non-visible objects,
+ // e.g. a 3D cube without fill attributes. To still be able to use
+ // primitives for HitTest functionality, the 3d decompositions produce
+ // an as much as possible simplified fill geometry encapsulated in this
+ // primtive when there is no fill geometry. Currently, the 3d hit test
+ // uses only areas, so maybe in a further enchanced version this will change
+ // to 'if neither filled nor lines' creation criteria. The whole primitive
+ // decomposes to nothing, so no one not knowing it will be influenced. Only
+ // helper processors for hit test (and maybe BoundRect extractors) will
+ // use it and it's children subcontent.
+ class HiddenGeometryPrimitive3D : public GroupPrimitive3D
+ {
+ public:
+ HiddenGeometryPrimitive3D(const Primitive3DSequence& rChildren);
+
+ // despite returning an empty decomposition since it's no visualisation data,
+ // range calculation is intended to use hidden geometry, so
+ // the local implementation will return the children's range
+ virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
+
+ /// The default implementation returns an empty sequence
+ virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
+
+ // provide unique ID
+ DeclPrimitrive3DIDBlock()
+ };
+ } // end of namespace primitive3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_HIDDENGEOMETRYPRIMITIVE3D_HXX
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/hittestprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/hittestprimitive3d.hxx
deleted file mode 100644
index 5fa7a26de6..0000000000
--- a/drawinglayer/inc/drawinglayer/primitive3d/hittestprimitive3d.hxx
+++ /dev/null
@@ -1,80 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE3D_HITTESTPRIMITIVE3D_HXX
-#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_HITTESTPRIMITIVE3D_HXX
-
-#include <drawinglayer/primitive3d/groupprimitive3d.hxx>
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace primitive3d
- {
- /** HitTestPrimitive3D class
-
- This primitive is used to represent geometry for non-visible objects,
- e.g. a 3D cube without fill attributes. To still be able to use
- primitives for HitTest functionality, the 3d decompositions produce
- an as much as possible simplified fill geometry encapsulated in this
- primtive when there is no fill geometry. Currently, the 3d hit test
- uses only areas, so maybe in a further enchanced version this will change
- to 'if neither filled nor lines' creation criteria. The whole primitive
- decomposes to nothing, so no one not knowing it will be influenced. Only
- helper processors for hit test (and maybe BoundRect extractors) will
- use it and it's children subcontent.
- */
- class HitTestPrimitive3D : public GroupPrimitive3D
- {
- public:
- /// constructor
- HitTestPrimitive3D(const Primitive3DSequence& rChildren);
-
- /** despite returning an empty decomposition since it's no visualisation data,
- range calculation is intended to use invisible replacement geometry, so
- the local implementation will return the children's range
- */
- virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
-
- /** local decomposition. Implementation will return empty Primitive3DSequence
- since this is no visualisation data
- */
- virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
-
- /// provide unique ID
- DeclPrimitrive3DIDBlock()
- };
- } // end of namespace primitive3d
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-#endif //INCLUDED_DRAWINGLAYER_PRIMITIVE3D_HITTESTPRIMITIVE3D_HXX
-
-//////////////////////////////////////////////////////////////////////////////
-// eof
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx
index 32417c5962..46b6a85b5e 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrcubeprimitive3d.hxx
@@ -53,7 +53,7 @@ namespace drawinglayer
SdrCubePrimitive3D(
const basegfx::B3DHomMatrix& rTransform,
const basegfx::B2DVector& rTextureSize,
- const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute,
+ const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute,
const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute);
/// compare operator
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrdecompositiontools3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrdecompositiontools3d.hxx
index 851149b434..c54d2c16b2 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/sdrdecompositiontools3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrdecompositiontools3d.hxx
@@ -81,13 +81,20 @@ namespace drawinglayer
const basegfx::B2DVector& rTextureSize,
const attribute::Sdr3DObjectAttribute& aSdr3DObjectAttribute,
const attribute::SdrFillAttribute& rFill,
- const attribute::FillGradientAttribute* pFillGradient = 0L);
+ const attribute::FillGradientAttribute& rFillGradient);
Primitive3DSequence createShadowPrimitive3D(
const Primitive3DSequence& rSource,
const attribute::SdrShadowAttribute& rShadow,
bool bShadow3D);
- } // end of namespace overlay
+
+ Primitive3DSequence createHiddenGeometryPrimitives3D(
+ const ::std::vector< basegfx::B3DPolyPolygon >& r3DPolyPolygonVector,
+ const basegfx::B3DHomMatrix& rObjectTransform,
+ const basegfx::B2DVector& rTextureSize,
+ const attribute::Sdr3DObjectAttribute& aSdr3DObjectAttribute);
+
+ } // end of namespace primitive3d
} // end of namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx
index aae1167ef5..4395cfb062 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx
@@ -87,7 +87,7 @@ namespace drawinglayer
SdrExtrudePrimitive3D(
const basegfx::B3DHomMatrix& rTransform,
const basegfx::B2DVector& rTextureSize,
- const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute,
+ const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute,
const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute,
const basegfx::B2DPolyPolygon& rPolyPolygon,
double fDepth,
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx
index ecc936d6c7..23e2df9379 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrlatheprimitive3d.hxx
@@ -101,7 +101,7 @@ namespace drawinglayer
SdrLathePrimitive3D(
const basegfx::B3DHomMatrix& rTransform,
const basegfx::B2DVector& rTextureSize,
- const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute,
+ const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute,
const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute,
const basegfx::B2DPolyPolygon& rPolyPolygon,
sal_uInt32 nHorizontalSegments,
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx
index 840bb0e88e..1375aa1994 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx
@@ -62,7 +62,7 @@ namespace drawinglayer
const basegfx::B3DPolyPolygon& rPolyPolygon3D,
const basegfx::B3DHomMatrix& rTransform,
const basegfx::B2DVector& rTextureSize,
- const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute,
+ const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute,
const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute);
/// data access
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrprimitive3d.hxx
index c298d8272f..0b0aebdb75 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/sdrprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrprimitive3d.hxx
@@ -32,8 +32,8 @@
#include <basegfx/matrix/b3dhommatrix.hxx>
#include <basegfx/vector/b2dvector.hxx>
#include <drawinglayer/attribute/sdrallattribute3d.hxx>
-#include <drawinglayer/attribute/sdrattribute3d.hxx>
#include <drawinglayer/primitive3d/sdrextrudelathetools3d.hxx>
+#include <drawinglayer/attribute/sdrobjectattribute3d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -53,7 +53,7 @@ namespace drawinglayer
/// object surface attributes
basegfx::B3DHomMatrix maTransform;
basegfx::B2DVector maTextureSize;
- attribute::SdrLineFillShadowAttribute maSdrLFSAttribute;
+ attribute::SdrLineFillShadowAttribute3D maSdrLFSAttribute;
attribute::Sdr3DObjectAttribute maSdr3DObjectAttribute;
protected:
@@ -72,13 +72,13 @@ namespace drawinglayer
SdrPrimitive3D(
const basegfx::B3DHomMatrix& rTransform,
const basegfx::B2DVector& rTextureSize,
- const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute,
+ const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute,
const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute);
/// data read access
const basegfx::B3DHomMatrix& getTransform() const { return maTransform; }
const basegfx::B2DVector& getTextureSize() const { return maTextureSize; }
- const attribute::SdrLineFillShadowAttribute& getSdrLFSAttribute() const { return maSdrLFSAttribute; }
+ const attribute::SdrLineFillShadowAttribute3D& getSdrLFSAttribute() const { return maSdrLFSAttribute; }
const attribute::Sdr3DObjectAttribute getSdr3DObjectAttribute() const { return maSdr3DObjectAttribute; }
/// compare operator
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx
index 9e46a8181c..7a5e176813 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/sdrsphereprimitive3d.hxx
@@ -58,7 +58,7 @@ namespace drawinglayer
SdrSpherePrimitive3D(
const basegfx::B3DHomMatrix& rTransform,
const basegfx::B2DVector& rTextureSize,
- const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute,
+ const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute,
const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute,
sal_uInt32 nHorizontalSegments,
sal_uInt32 nVerticalSegments);
diff --git a/drawinglayer/inc/drawinglayer/primitive3d/textureprimitive3d.hxx b/drawinglayer/inc/drawinglayer/primitive3d/textureprimitive3d.hxx
index db8f4354ec..1a1ef53214 100644
--- a/drawinglayer/inc/drawinglayer/primitive3d/textureprimitive3d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive3d/textureprimitive3d.hxx
@@ -29,9 +29,10 @@
#define INCLUDED_DRAWINGLAYER_PRIMITIVE3D_TEXTUREPRIMITIVE3D_HXX
#include <drawinglayer/primitive3d/groupprimitive3d.hxx>
-#include <drawinglayer/attribute/fillattribute.hxx>
#include <drawinglayer/attribute/fillbitmapattribute.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/vector/b2dvector.hxx>
+#include <drawinglayer/attribute/fillgradientattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -83,13 +84,13 @@ namespace drawinglayer
{
namespace primitive3d
{
- /** UnifiedAlphaTexturePrimitive3D class
+ /** UnifiedTransparenceTexturePrimitive3D class
This 3D primitive expands TexturePrimitive3D to a unified
- alpha (transparence) texture definition. All 3D primitives
+ transparence texture definition. All 3D primitives
embedded here will be shown with the given transparency.
*/
- class UnifiedAlphaTexturePrimitive3D : public TexturePrimitive3D
+ class UnifiedTransparenceTexturePrimitive3D : public TexturePrimitive3D
{
private:
/// transparency definition
@@ -97,7 +98,7 @@ namespace drawinglayer
public:
/// constructor
- UnifiedAlphaTexturePrimitive3D(
+ UnifiedTransparenceTexturePrimitive3D(
double fTransparence,
const Primitive3DSequence& rChildren);
@@ -107,6 +108,9 @@ namespace drawinglayer
/// compare operator
virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
+ /// own getB3DRange implementation to include transparent geometries to BoundRect calculations
+ virtual basegfx::B3DRange getB3DRange(const geometry::ViewInformation3D& rViewInformation) const;
+
/// local decomposition.
virtual Primitive3DSequence get3DDecomposition(const geometry::ViewInformation3D& rViewInformation) const;
@@ -200,18 +204,18 @@ namespace drawinglayer
{
namespace primitive3d
{
- /** AlphaTexturePrimitive3D class
+ /** TransparenceTexturePrimitive3D class
- This 3D primitive expands TexturePrimitive3D to a alpha texture
- definition. For alpha definition, a gradient is used. The values in
- that gradient will be interpreted as luminance Alpha-Values. All 3D
+ This 3D primitive expands TexturePrimitive3D to a transparence texture
+ definition. For transparence definition, a gradient is used. The values in
+ that gradient will be interpreted as luminance Transparence-Values. All 3D
primitives embedded here will be shown with the defined transparence.
*/
- class AlphaTexturePrimitive3D : public GradientTexturePrimitive3D
+ class TransparenceTexturePrimitive3D : public GradientTexturePrimitive3D
{
public:
/// constructor
- AlphaTexturePrimitive3D(
+ TransparenceTexturePrimitive3D(
const attribute::FillGradientAttribute& rGradient,
const Primitive3DSequence& rChildren,
const basegfx::B2DVector& rTextureSize);
diff --git a/drawinglayer/inc/drawinglayer/processor2d/baseprocessor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/baseprocessor2d.hxx
index 1606ad4d89..5421fdc221 100644
--- a/drawinglayer/inc/drawinglayer/processor2d/baseprocessor2d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor2d/baseprocessor2d.hxx
@@ -37,30 +37,159 @@ namespace drawinglayer
{
namespace processor2d
{
+ /** BaseProcessor2D class
+
+ Baseclass for all C++ implementations of instances which process
+ primitives.
+
+ Instances which process primitives can be renderers, but also stuff
+ for HitTests, BoundRect calculations and/or animation processing. The
+ main usage are renderers, but they are supposed to handle any primitive
+ processing.
+
+ The base implementation is constructed with a ViewInformation2D which
+ is accessible throughout the processor implementations. The idea is
+ to construct any processor with a given ViewInformation2D. To be able
+ to handle primitives which need to change the current transformation
+ (as e.g. TransformPrimitive2D) it is allowed for the processor implementation
+ to change tis local value using updateViewInformation.
+
+ The basic processing method is process(..) which gets handed over the
+ sequence of primitives to process. For convenience of the C++ implementations,
+ the default implementation of process(..) maps all accesses to primitives to
+ single calls to processBasePrimitive2D(..) where the primitive in question is
+ already casted to the C++ implementation class.
+
+ The process(..) implementation makes a complete iteration over the given
+ sequence of primitives. If the Primitive is not derived from BasePrimitive2D
+ and thus not part of the C++ implementations, it converts ViewInformation2D
+ to the corresponding API implementation (an uno::Sequence< beans::PropertyValue >)
+ and recursively calls the method process(..) at the primitive with the decomposition
+ derived from that primitive. This is the preparation to handle unknown implementations
+ of the com::sun::star::graphic::XPrimitive2D interface in the future.
+
+ So, to implement a basic processor, it is necessary to overload and implement the
+ processBasePrimitive2D(..) method. A minimal renderer has to support the
+ Basic Primitives (see baseprimitive2d.hxx) and the Grouping Primitives (see
+ groupprimitive2d.hxx). These are (currently):
+
+ Basic Primitives:
+
+ - BitmapPrimitive2D (bitmap data, evtl. with transparence)
+ - PointArrayPrimitive2D (single points)
+ - PolygonHairlinePrimitive2D (hairline curves/polygons)
+ - PolyPolygonColorPrimitive2D (colored polygons)
+
+ Grouping Primitives:
+
+ - TransparencePrimitive2D (objects with freely defined transparence)
+ - InvertPrimitive2D (for XOR)
+ - MaskPrimitive2D (for masking)
+ - ModifiedColorPrimitive2D (for a stack of color modifications)
+ - TransformPrimitive2D (for a transformation stack)
+
+ A processor doing so is a minimal processor. Of course a processor may
+ handle any higher-level prmitive (that has a decomposition implementation)
+ for more direct data access or performance reasons, too.
+
+ The main part of a processBasePrimitive2D implementation is a switch..case
+ construct, looking like the following:
+
+ void foo::processBasePrimitive2D(const BasePrimitive2D& rCandidate)
+ {
+ switch(rCandidate.getPrimitive2DID())
+ {
+ case PRIMITIVE2D_ID_??? :
+ {
+ // process PRIMITIVE2D_ID_??? here...
+
+ ...
+
+ break;
+ }
+
+ ...
+
+ default :
+ {
+ // process recursively
+ process(rCandidate.get2DDecomposition(getViewInformation2D()));
+ break;
+ }
+ }
+ }
+
+ The default case makes the processor work with all complex primitives
+ by recursively using their decomposition.
+
+ You can also add a case for ignoring primitives by using:
+
+ case PRIMITIVE2D_ID_...IGNORE.A.. :
+ case PRIMITIVE2D_ID_...IGNORE.B.. :
+ case PRIMITIVE2D_ID_...IGNORE.C.. :
+ {
+ // ignore these primitives by neither processing nor
+ // recursively processing their decomposition
+ break;
+ }
+
+ Another useful case is embedding the processing of a complex primitive by
+ bracketing it with some actions:
+
+ case PRIMITIVE2D_ID_SOME_TEXT :
+ {
+ // encapsulate e.g. with changing local varibles, e.g.
+ // sometimes it's good to know if a basic primitive is
+ // part of a text, especially when not handling the text
+ // self but by purpose want to handle the decomposed
+ // geometries in the processor
+ startText();
+ process(rCandidate.get2DDecomposition(getViewInformation2D()));
+ endText();
+ break;
+ }
+
+ As an example a processor collecting the outlines of a sequence of primitives
+ only needs to handle some Basic Primitives and create outline and collect
+ outline polygons e.g. for primitives with area like BitmapPrimitive2D (a
+ rectangle) and PolyPolygonColorPrimitive2D. When also handling the Grouping
+ Primitives MaskPrimitive2D (e.g. ignoring it's content, using the mask polyPolygon)
+ and TransformPrimitive2D (to have the correct local transformation), a processor
+ creating the outline can be written using just four (4) primitives. As a tipp, it can
+ be helpful to add many for the purpose not interesting higher level primitives
+ to not force their decomposition to be created and/or parsed.
+ */
class BaseProcessor2D
{
private:
+ /// The ViewInformation2D itself. It's private to isolate accesses to it
geometry::ViewInformation2D maViewInformation2D;
protected:
+ /* access method to allow the implementations to change the current
+ ViewInformation2D if needed. This allows isolating these accesses
+ later if needed
+ */
void updateViewInformation(const geometry::ViewInformation2D& rViewInformation2D)
{
maViewInformation2D = rViewInformation2D;
}
- // as tooling, the process() implementation takes over API handling and calls this
- // virtual render method when the primitive implementation is BasePrimitive2D-based.
- // Default implementation does nothing
+ /* as tooling, the process() implementation takes over API handling and calls this
+ virtual render method when the primitive implementation is BasePrimitive2D-based.
+ Default implementation does nothing
+ */
virtual void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
public:
+ /// constructor/destructor
BaseProcessor2D(const geometry::ViewInformation2D& rViewInformation);
virtual ~BaseProcessor2D();
- // the central processing method
+ /// the central processing method
virtual void process(const primitive2d::Primitive2DSequence& rSource);
- // data access
+ /// data read access
const geometry::ViewInformation2D& getViewInformation2D() const { return maViewInformation2D; }
};
} // end of namespace processor2d
@@ -68,6 +197,44 @@ namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
+namespace drawinglayer
+{
+ namespace processor2d
+ {
+ /** CollectingProcessor2D class
+
+ A processor which just collects all primitives given to it in
+ process(..) calls to maPrimitive2DSequence. This can e.g. be used to
+ hand around as instance over various methods where every called
+ method can add graphic content to it.
+ */
+ class CollectingProcessor2D : public BaseProcessor2D
+ {
+ private:
+ primitive2d::Primitive2DSequence maPrimitive2DSequence;
+
+ public:
+ CollectingProcessor2D(const geometry::ViewInformation2D& rViewInformation);
+ virtual ~CollectingProcessor2D();
+
+ /// the central processing method
+ virtual void process(const primitive2d::Primitive2DSequence& rSource);
+
+ /// helpers for adding to local sequence
+ void appendPrimitive2DReference(const primitive2d::Primitive2DReference& rSource)
+ {
+ primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(maPrimitive2DSequence, rSource);
+ }
+
+ /// data access and reset
+ const primitive2d::Primitive2DSequence& getPrimitive2DSequence() const { return maPrimitive2DSequence; }
+ void reset() { maPrimitive2DSequence = primitive2d::Primitive2DSequence(); }
+ };
+ } // end of namespace processor2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
#endif //INCLUDED_DRAWINGLAYER_PROCESSOR2D_BASEPROCESSOR2D_HXX
// eof
diff --git a/drawinglayer/inc/drawinglayer/processor2d/canvasprocessor.hxx b/drawinglayer/inc/drawinglayer/processor2d/canvasprocessor.hxx
index 7d1d45e281..8a66fbc35c 100644
--- a/drawinglayer/inc/drawinglayer/processor2d/canvasprocessor.hxx
+++ b/drawinglayer/inc/drawinglayer/processor2d/canvasprocessor.hxx
@@ -56,10 +56,10 @@ namespace drawinglayer { namespace primitive2d {
class MetafilePrimitive2D;
class TextSimplePortionPrimitive2D;
class BitmapPrimitive2D;
- class AlphaPrimitive2D;
+ class TransparencePrimitive2D;
class PolygonStrokePrimitive2D;
class FillBitmapPrimitive2D;
- class UnifiedAlphaPrimitive2D;
+ class UnifiedTransparencePrimitive2D;
}}
//////////////////////////////////////////////////////////////////////////////
@@ -68,6 +68,11 @@ namespace drawinglayer
{
namespace processor2d
{
+ /** canvasProcessor2D class
+
+ A basic implementation of a renderer for com::sun::star::rendering::XCanvas
+ as a target
+ */
class canvasProcessor2D : public BaseProcessor2D
{
private:
@@ -103,10 +108,10 @@ namespace drawinglayer
void impRenderMetafilePrimitive2D(const primitive2d::MetafilePrimitive2D& rMetaCandidate);
void impRenderTextSimplePortionPrimitive2D(const primitive2d::TextSimplePortionPrimitive2D& rTextCandidate);
void impRenderBitmapPrimitive2D(const primitive2d::BitmapPrimitive2D& rBitmapCandidate);
- void impRenderAlphaPrimitive2D(const primitive2d::AlphaPrimitive2D& rAlphaCandidate);
+ void impRenderTransparencePrimitive2D(const primitive2d::TransparencePrimitive2D& rTransparenceCandidate);
void impRenderPolygonStrokePrimitive2D(const primitive2d::PolygonStrokePrimitive2D& rPolygonStrokePrimitive);
void impRenderFillBitmapPrimitive2D(const primitive2d::FillBitmapPrimitive2D& rFillBitmapPrimitive2D);
- void impRenderUnifiedAlphaPrimitive2D(const primitive2d::UnifiedAlphaPrimitive2D& rUniAlphaCandidate);
+ void impRenderUnifiedTransparencePrimitive2D(const primitive2d::UnifiedTransparencePrimitive2D& rUniTransparenceCandidate);
public:
canvasProcessor2D(
diff --git a/drawinglayer/inc/drawinglayer/processor2d/contourextractor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/contourextractor2d.hxx
index 4995d02a49..42986c6597 100644
--- a/drawinglayer/inc/drawinglayer/processor2d/contourextractor2d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor2d/contourextractor2d.hxx
@@ -38,13 +38,18 @@ namespace drawinglayer
{
namespace processor2d
{
+ /** ContourExtractor2D class
+
+ A processor who extracts the contour of the primtives feeded to it
+ in the single local PolyPolygon
+ */
class ContourExtractor2D : public BaseProcessor2D
{
private:
- // the extracted contour
+ /// the extracted contour
std::vector< basegfx::B2DPolyPolygon > maExtractedContour;
- // tooling methods
+ /// tooling methods
void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
public:
diff --git a/drawinglayer/inc/drawinglayer/processor2d/hittestprocessor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/hittestprocessor2d.hxx
index 021946229e..1225c95de0 100644
--- a/drawinglayer/inc/drawinglayer/processor2d/hittestprocessor2d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor2d/hittestprocessor2d.hxx
@@ -43,29 +43,36 @@ namespace drawinglayer
{
namespace processor2d
{
+ /** HitTestProcessor2D class
+
+ This processor implements a HitTest with the feeded primitives,
+ given tolerance and extras
+ */
class HitTestProcessor2D : public BaseProcessor2D
{
private:
- // discrete HitTest position
+ /// discrete HitTest position
basegfx::B2DPoint maDiscreteHitPosition;
- // discrete HitTolerance
+ /// discrete HitTolerance
double mfDiscreteHitTolerance;
- // bitfield
+ /// bitfield
unsigned mbHit : 1;
unsigned mbHitToleranceUsed : 1;
- // this flag decides if primitives of type HitTestPrimitive2D
- // will be taken into account for HitTesting or not. Those primitives
- // are created for objects which are else completely invisible and normally
- // their content exists of hairline primitives describing the object's contour
- unsigned mbUseHitTestPrimitiveContent : 1;
+ /* this flag decides if primitives which are embedded to an
+ UnifiedTransparencePrimitive2D and are invisible will be taken into account for
+ HitTesting or not. Those primitives are created for objects which are else
+ completely invisible and normally their content exists of hairline
+ primitives describing the object's contour
+ */
+ unsigned mbUseInvisiblePrimitiveContent : 1;
- // flag to concentraze on text hits only
+ /// flag to concentraze on text hits only
unsigned mbHitTextOnly : 1;
- // tooling methods
+ /// tooling methods
void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
bool checkHairlineHitWithTolerance(
const basegfx::B2DPolygon& rPolygon,
@@ -83,18 +90,18 @@ namespace drawinglayer
bool bHitTextOnly);
virtual ~HitTestProcessor2D();
- // data write access
- void setUseHitTestPrimitiveContent(bool bNew)
+ /// data write access
+ void setUseInvisiblePrimitiveContent(bool bNew)
{
- if((bool)mbUseHitTestPrimitiveContent != bNew) mbUseHitTestPrimitiveContent = bNew;
+ if((bool)mbUseInvisiblePrimitiveContent != bNew) mbUseInvisiblePrimitiveContent = bNew;
}
- // data read access
+ /// data read access
const basegfx::B2DPoint& getDiscreteHitPosition() const { return maDiscreteHitPosition; }
double getDiscreteHitTolerance() const { return mfDiscreteHitTolerance; }
bool getHit() const { return mbHit; }
bool getHitToleranceUsed() const { return mbHitToleranceUsed; }
- bool getUseHitTestPrimitiveContent() const { return mbUseHitTestPrimitiveContent;}
+ bool getUseInvisiblePrimitiveContent() const { return mbUseInvisiblePrimitiveContent;}
bool getHitTextOnly() const { return mbHitTextOnly; }
};
} // end of namespace processor2d
diff --git a/drawinglayer/inc/drawinglayer/processor2d/linegeometryextractor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/linegeometryextractor2d.hxx
index e63f361fb9..767521f41c 100644
--- a/drawinglayer/inc/drawinglayer/processor2d/linegeometryextractor2d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor2d/linegeometryextractor2d.hxx
@@ -37,16 +37,21 @@ namespace drawinglayer
{
namespace processor2d
{
+ /** LineGeometryExtractor2D class
+
+ This processor can extract the line geometry from feeded primpitives. The
+ hairlines and the fille geometry from fat lines are separated.
+ */
class LineGeometryExtractor2D : public BaseProcessor2D
{
private:
std::vector< basegfx::B2DPolygon > maExtractedHairlines;
std::vector< basegfx::B2DPolyPolygon > maExtractedLineFills;
- // bitfield
+ /// bitfield
unsigned mbInLineGeometry : 1;
- // tooling methods
+ /// tooling methods
void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
public:
diff --git a/drawinglayer/inc/drawinglayer/processor2d/textaspolygonextractor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/textaspolygonextractor2d.hxx
index 4649004c43..09df70f731 100644
--- a/drawinglayer/inc/drawinglayer/processor2d/textaspolygonextractor2d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor2d/textaspolygonextractor2d.hxx
@@ -40,7 +40,7 @@ namespace drawinglayer
{
namespace processor2d
{
- // helper data structure for returning the result
+ /// helper data structure for returning the result
struct TextAsPolygonDataNode
{
private:
@@ -65,9 +65,13 @@ namespace drawinglayer
bool getIsFilled() const { return mbIsFilled; }
};
- // typedef for a vector of that helper data
+ /// typedef for a vector of that helper data
typedef ::std::vector< TextAsPolygonDataNode > TextAsPolygonDataNodeVector;
+ /** TextAsPolygonExtractor2D class
+
+ This processor extracts text in the feeded primitives to filled polygons
+ */
class TextAsPolygonExtractor2D : public BaseProcessor2D
{
private:
diff --git a/drawinglayer/inc/drawinglayer/processor2d/vclmetafileprocessor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/vclmetafileprocessor2d.hxx
index 04b6fc0b00..a1dfc21a8b 100644
--- a/drawinglayer/inc/drawinglayer/processor2d/vclmetafileprocessor2d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor2d/vclmetafileprocessor2d.hxx
@@ -39,6 +39,7 @@
//////////////////////////////////////////////////////////////////////////////
// predefines
+
class GDIMetaFile;
class Rectangle;
class Gradient;
@@ -62,10 +63,22 @@ namespace drawinglayer
{
namespace processor2d
{
+ /** VclMetafileProcessor2D class
+
+ This processor derived from VclProcessor2D is the base class for rendering
+ all feeded primitives to a classical VCL-Metafile, including all over the
+ time grown extra data in comments and PDF exception data creations. Also
+ printing needs some exception stuff.
+
+ All in all it is needed to emulate the old ::paint output from the old
+ Drawinglayer as long as exporters and/or filters still use the Metafile
+ and the extra-data added to it (which can be seen mostly as 'extensions'
+ or simply as 'hacks').
+ */
class VclMetafileProcessor2D : public VclProcessor2D
{
private:
- // local helper(s)
+ /// local helper(s)
Rectangle impDumpToMetaFile(
const primitive2d::Primitive2DSequence& rContent,
GDIMetaFile& o_rContentMetafile);
@@ -85,42 +98,47 @@ namespace drawinglayer
void impStartSvtGraphicStroke(SvtGraphicStroke* pSvtGraphicStroke);
void impEndSvtGraphicStroke(SvtGraphicStroke* pSvtGraphicStroke);
- // the current clipping PolyPolygon from MaskPrimitive2D
+ /// the current clipping PolyPolygon from MaskPrimitive2D
basegfx::B2DPolyPolygon maClipPolyPolygon;
- // the target MetaFile
+ /// the target MetaFile
GDIMetaFile* mpMetaFile;
- // do not allow embedding SvtGraphicFills into each other,
- // use a counter to prevent that
+ /* do not allow embedding SvtGraphicFills into each other,
+ use a counter to prevent that
+ */
sal_uInt32 mnSvtGraphicFillCount;
- // same for SvtGraphicStroke
+ /// same for SvtGraphicStroke
sal_uInt32 mnSvtGraphicStrokeCount;
- // hold the last unified transparence value to have it handy
- // on SvtGraphicStroke creation
+ /* hold the last unified transparence value to have it handy
+ on SvtGraphicStroke creation
+ */
double mfCurrentUnifiedTransparence;
- // break iterator support
- // made static so it only needs to be fetched once, even with many single
- // constructed VclMetafileProcessor2D. It's still incarnated on demand,
- // but exists for OOo runtime now by purpose.
+ /* break iterator support
+ made static so it only needs to be fetched once, even with many single
+ constructed VclMetafileProcessor2D. It's still incarnated on demand,
+ but exists for OOo runtime now by purpose.
+ */
static ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator > mxBreakIterator;
- // vcl::PDFExtOutDevData support
- // For the first step, some extra actions at vcl::PDFExtOutDevData need to
- // be emulated with the VclMetafileProcessor2D. These are potentially temporarily
- // since PDF export may use PrimitiveSequences one day directly.
+ /* vcl::PDFExtOutDevData support
+ For the first step, some extra actions at vcl::PDFExtOutDevData need to
+ be emulated with the VclMetafileProcessor2D. These are potentially temporarily
+ since PDF export may use PrimitiveSequences one day directly.
+ */
vcl::PDFExtOutDevData* mpPDFExtOutDevData;
protected:
- // the local processor for BasePrinitive2D-Implementation based primitives,
- // called from the common process()-implementation
+ /* the local processor for BasePrinitive2D-Implementation based primitives,
+ called from the common process()-implementation
+ */
virtual void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
public:
- // constructor/destructor
+ /// constructor/destructor
VclMetafileProcessor2D(
const geometry::ViewInformation2D& rViewInformation,
OutputDevice& rOutDev);
diff --git a/drawinglayer/inc/drawinglayer/processor2d/vclpixelprocessor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/vclpixelprocessor2d.hxx
index c57a04a4fb..722c747c18 100644
--- a/drawinglayer/inc/drawinglayer/processor2d/vclpixelprocessor2d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor2d/vclpixelprocessor2d.hxx
@@ -32,34 +32,39 @@
#include <vcl/outdev.hxx>
//////////////////////////////////////////////////////////////////////////////
-// predefines
-
-//////////////////////////////////////////////////////////////////////////////
namespace drawinglayer
{
namespace processor2d
{
+ /** VclPixelProcessor2D class
+
+ This processor derived from VclProcessor2D is the base class for rendering
+ all feeded primitives to a VCL Window. It is the currently used renderer
+ for all VCL editing output from the DrawingLayer.
+ */
class VclPixelProcessor2D : public VclProcessor2D
{
private:
- // The Pixel renderer resets the original MapMode from the OutputDevice.
- // For some situations it is necessary to get it again, so it is rescued here
+ /* The Pixel renderer resets the original MapMode from the OutputDevice.
+ For some situations it is necessary to get it again, so it is rescued here
+ */
MapMode maOriginalMapMode;
protected:
- // the local processor for BasePrinitive2D-Implementation based primitives,
- // called from the common process()-implementation
+ /* the local processor for BasePrinitive2D-Implementation based primitives,
+ called from the common process()-implementation
+ */
virtual void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate);
public:
- // constructor/destructor
+ /// constructor/destructor
VclPixelProcessor2D(
const geometry::ViewInformation2D& rViewInformation,
OutputDevice& rOutDev);
virtual ~VclPixelProcessor2D();
- // data access
+ /// data read access
const MapMode& getOriginalMapMode() const { return maOriginalMapMode; }
};
} // end of namespace processor2d
diff --git a/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx b/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx
index b8679292d5..aad727e863 100644
--- a/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor2d/vclprocessor2d.hxx
@@ -47,8 +47,8 @@ namespace drawinglayer { namespace primitive2d {
class PolyPolygonColorPrimitive2D;
class MetafilePrimitive2D;
class MaskPrimitive2D;
- class UnifiedAlphaPrimitive2D;
- class AlphaPrimitive2D;
+ class UnifiedTransparencePrimitive2D;
+ class TransparencePrimitive2D;
class TransformPrimitive2D;
class MarkerArrayPrimitive2D;
class PointArrayPrimitive2D;
@@ -65,6 +65,11 @@ namespace drawinglayer
{
namespace processor2d
{
+ /** VclProcessor2D class
+
+ This processor is the base class for VCL-Based processors. It has no
+ processBasePrimitive2D implementation and thus is not usable directly.
+ */
class VclProcessor2D : public BaseProcessor2D
{
protected:
@@ -99,8 +104,8 @@ namespace drawinglayer
void RenderMetafilePrimitive2D(const primitive2d::MetafilePrimitive2D& rPolygonCandidate);
void RenderMaskPrimitive2DPixel(const primitive2d::MaskPrimitive2D& rMaskCandidate);
void RenderModifiedColorPrimitive2D(const primitive2d::ModifiedColorPrimitive2D& rModifiedCandidate);
- void RenderUnifiedAlphaPrimitive2D(const primitive2d::UnifiedAlphaPrimitive2D& rTransCandidate);
- void RenderAlphaPrimitive2D(const primitive2d::AlphaPrimitive2D& rTransCandidate);
+ void RenderUnifiedTransparencePrimitive2D(const primitive2d::UnifiedTransparencePrimitive2D& rTransCandidate);
+ void RenderTransparencePrimitive2D(const primitive2d::TransparencePrimitive2D& rTransCandidate);
void RenderTransformPrimitive2D(const primitive2d::TransformPrimitive2D& rTransformCandidate);
void RenderPagePreviewPrimitive2D(const primitive2d::PagePreviewPrimitive2D& rPagePreviewCandidate);
void RenderMarkerArrayPrimitive2D(const primitive2d::MarkerArrayPrimitive2D& rMarkerArrayCandidate);
diff --git a/drawinglayer/inc/drawinglayer/processor3d/baseprocessor3d.hxx b/drawinglayer/inc/drawinglayer/processor3d/baseprocessor3d.hxx
index 52b81329d3..063d0a78da 100644
--- a/drawinglayer/inc/drawinglayer/processor3d/baseprocessor3d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor3d/baseprocessor3d.hxx
@@ -37,6 +37,13 @@ namespace drawinglayer
{
namespace processor3d
{
+ /** BaseProcessor3D class
+
+ Baseclass for all C++ implementations of instances which process
+ primitives.
+
+ Please have a look at baseprocessor2d.hxx for more comments.
+ */
class BaseProcessor3D
{
private:
@@ -48,9 +55,10 @@ namespace drawinglayer
maViewInformation3D = rViewInformation3D;
}
- // as tooling, the process() implementation takes over API handling and calls this
- // virtual render method when the primitive implementation is BasePrimitive3D-based.
- // Default implementation does nothing
+ /* as tooling, the process() implementation takes over API handling and calls this
+ virtual render method when the primitive implementation is BasePrimitive3D-based.
+ Default implementation does nothing
+ */
virtual void processBasePrimitive3D(const primitive3d::BasePrimitive3D& rCandidate);
public:
@@ -72,6 +80,13 @@ namespace drawinglayer
{
namespace processor3d
{
+ /** CollectingProcessor3D class
+
+ A processor which just collects all primitives given to it in
+ process(..) calls to maPrimitive3DSequence. This can e.g. be used to
+ hand around as instance over various methods where every called
+ method can add graphic content to it.
+ */
class CollectingProcessor3D : public BaseProcessor3D
{
private:
@@ -81,16 +96,16 @@ namespace drawinglayer
CollectingProcessor3D(const geometry::ViewInformation3D& rViewInformation);
virtual ~CollectingProcessor3D();
- // the central processing method
+ /// the central processing method
virtual void process(const primitive3d::Primitive3DSequence& rSource);
- // helpers for adding to local sequence
+ /// helpers for adding to local sequence
void appendPrimitive3DReference(const primitive3d::Primitive3DReference& rSource)
{
primitive3d::appendPrimitive3DReferenceToPrimitive3DSequence(maPrimitive3DSequence, rSource);
}
- // data access and reset
+ /// data access and reset
const primitive3d::Primitive3DSequence& getPrimitive3DSequence() const { return maPrimitive3DSequence; }
void reset() { maPrimitive3DSequence = primitive3d::Primitive3DSequence(); }
};
diff --git a/drawinglayer/inc/drawinglayer/processor3d/cutfindprocessor3d.hxx b/drawinglayer/inc/drawinglayer/processor3d/cutfindprocessor3d.hxx
index 0afabb2346..99bd3f9f68 100644
--- a/drawinglayer/inc/drawinglayer/processor3d/cutfindprocessor3d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor3d/cutfindprocessor3d.hxx
@@ -36,26 +36,38 @@ namespace drawinglayer
{
namespace processor3d
{
+ /** CutFindProcessor class
+
+ This processor extracts all cuts of 3D plane geometries in the feeded primitives
+ with the given cut vector, based on the ViewInformation3D given.
+ */
class CutFindProcessor : public BaseProcessor3D
{
private:
- // the start and stop point for the cut vector
+ /// the start and stop point for the cut vector
basegfx::B3DPoint maFront;
basegfx::B3DPoint maBack;
- // the found cut points
+ /// the found cut points
::std::vector< basegfx::B3DPoint > maResult;
- // #i102956# the transformation change from TransformPrimitive3D processings
- // needs to be remembered to be able to transform found cuts to the
- // basic coordinate system the processor starts with
+ /* #i102956# the transformation change from TransformPrimitive3D processings
+ needs to be remembered to be able to transform found cuts to the
+ basic coordinate system the processor starts with
+ */
basegfx::B3DHomMatrix maCombinedTransform;
- // bitfield
+ /// bitfield
bool mbAnyHit : 1;
- // as tooling, the process() implementation takes over API handling and calls this
- // virtual render method when the primitive implementation is BasePrimitive3D-based.
+ /* this flag decides if primitives which are invisible will be taken into account for
+ HitTesting or not.
+ */
+ bool mbUseInvisiblePrimitiveContent : 1;
+
+ /* as tooling, the process() implementation takes over API handling and calls this
+ virtual render method when the primitive implementation is BasePrimitive3D-based.
+ */
virtual void processBasePrimitive3D(const primitive3d::BasePrimitive3D& rCandidate);
public:
@@ -64,9 +76,16 @@ namespace drawinglayer
const basegfx::B3DPoint& rBack,
bool bAnyHit);
- // data access
+ /// data write access
+ void setUseInvisiblePrimitiveContent(bool bNew)
+ {
+ if((bool)mbUseInvisiblePrimitiveContent != bNew) mbUseInvisiblePrimitiveContent = bNew;
+ }
+
+ /// data read access
const ::std::vector< basegfx::B3DPoint >& getCutPoints() const { return maResult; }
bool getAnyHit() const { return mbAnyHit; }
+ bool getUseInvisiblePrimitiveContent() const { return mbUseInvisiblePrimitiveContent;}
};
} // end of namespace processor3d
} // end of namespace drawinglayer
diff --git a/drawinglayer/inc/drawinglayer/processor3d/defaultprocessor3d.hxx b/drawinglayer/inc/drawinglayer/processor3d/defaultprocessor3d.hxx
index 147db4f85b..b38b42e9bc 100644
--- a/drawinglayer/inc/drawinglayer/processor3d/defaultprocessor3d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor3d/defaultprocessor3d.hxx
@@ -33,9 +33,11 @@
#include <basegfx/range/b2drange.hxx>
#include <basegfx/color/bcolormodifier.hxx>
#include <svtools/optionsdrawinglayer.hxx>
+#include <boost/shared_ptr.hpp>
//////////////////////////////////////////////////////////////////////////////
// predefines
+
namespace basegfx {
class BZPixelRaster;
class B3DPolygon;
@@ -68,35 +70,49 @@ namespace drawinglayer
{
namespace processor3d
{
+ /** DefaultProcessor3D class
+
+ This processor renders all feeded primitives to a 2D raster where for all
+ primitives the two basic methods rasterconvertB3DPolygon for hairlines and
+ rasterconvertB3DPolyPolygon for filled geometry is called. It is a beseclass to
+ e.g. base a Z-Buffer supported renderer on the 3D primitive processing.
+ */
class DefaultProcessor3D : public BaseProcessor3D
{
protected:
- // render information
- const attribute::SdrSceneAttribute& mrSdrSceneAttribute; // read-only scene infos (normal handling, etc...)
- const attribute::SdrLightingAttribute& mrSdrLightingAttribute; // read-only light infos (lights, etc...)
+ /// read-only scene infos (normal handling, etc...)
+ const attribute::SdrSceneAttribute& mrSdrSceneAttribute;
+
+ /// read-only light infos (lights, etc...)
+ const attribute::SdrLightingAttribute& mrSdrLightingAttribute;
- // renderer range. Need to be correctly set by the derived implementations
- basegfx::B2DRange maRasterRange; // the (0, 0, W, H) range from mpBZPixelRaster
+ /// renderer range. Need to be correctly set by the derived implementations
+ /// normally the (0, 0, W, H) range from mpBZPixelRaster
+ basegfx::B2DRange maRasterRange;
- // the modifiedColorPrimitive stack
+ /// the modifiedColorPrimitive stack
basegfx::BColorModifierStack maBColorModifierStack;
- // the current active texture
- texture::GeoTexSvx* mpGeoTexSvx;
+ /// the current active texture
+ boost::shared_ptr< texture::GeoTexSvx > mpGeoTexSvx;
- // the current active transparence texture
- texture::GeoTexSvx* mpTransparenceGeoTexSvx;
+ /// the current active transparence texture
+ boost::shared_ptr< texture::GeoTexSvx > mpTransparenceGeoTexSvx;
- // SvtOptionsDrawinglayer incarnation to react on diverse settings
+ /// SvtOptionsDrawinglayer incarnation to react on diverse settings
const SvtOptionsDrawinglayer maDrawinglayerOpt;
- // bitfield
+ /// counter for entered transparence textures
+ sal_uInt32 mnTransparenceCounter;
+
+ /// bitfield
unsigned mbModulate : 1;
unsigned mbFilter : 1;
unsigned mbSimpleTextureActive : 1;
//////////////////////////////////////////////////////////////////////////////
// rendering support
+
void impRenderGradientTexturePrimitive3D(const primitive3d::GradientTexturePrimitive3D& rPrimitive, bool bTransparence);
void impRenderHatchTexturePrimitive3D(const primitive3d::HatchTexturePrimitive3D& rPrimitive);
void impRenderBitmapTexturePrimitive3D(const primitive3d::BitmapTexturePrimitive3D& rPrimitive);
@@ -108,6 +124,7 @@ namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
// rasterconversions for filled and non-filled polygons. These NEED to be
// implemented from derivations
+
virtual void rasterconvertB3DPolygon(const attribute::MaterialAttribute3D& rMaterial, const basegfx::B3DPolygon& rHairline) const = 0;
virtual void rasterconvertB3DPolyPolygon(const attribute::MaterialAttribute3D& rMaterial, const basegfx::B3DPolyPolygon& rFill) const = 0;
@@ -121,19 +138,20 @@ namespace drawinglayer
const attribute::SdrLightingAttribute& rSdrLightingAttribute);
virtual ~DefaultProcessor3D();
- // data read access
+ /// data read access
const attribute::SdrSceneAttribute& getSdrSceneAttribute() const { return mrSdrSceneAttribute; }
const attribute::SdrLightingAttribute& getSdrLightingAttribute() const { return mrSdrLightingAttribute; }
- // data read access renderer stuff
+ /// data read access renderer stuff
const basegfx::BColorModifierStack& getBColorModifierStack() const { return maBColorModifierStack; }
- const texture::GeoTexSvx* getGeoTexSvx() const { return mpGeoTexSvx; }
- const texture::GeoTexSvx* getTransparenceGeoTexSvx() const { return mpTransparenceGeoTexSvx; }
+ const boost::shared_ptr< texture::GeoTexSvx >& getGeoTexSvx() const { return mpGeoTexSvx; }
+ const boost::shared_ptr< texture::GeoTexSvx >& getTransparenceGeoTexSvx() const { return mpTransparenceGeoTexSvx; }
+ sal_uInt32 getTransparenceCounter() const { return mnTransparenceCounter; }
bool getModulate() const { return mbModulate; }
bool getFilter() const { return mbFilter; }
bool getSimpleTextureActive() const { return mbSimpleTextureActive; }
- // access to Drawinglayer configuration options
+ /// access to Drawinglayer configuration options
const SvtOptionsDrawinglayer& getOptionsDrawinglayer() const { return maDrawinglayerOpt; }
};
} // end of namespace processor3d
diff --git a/drawinglayer/inc/drawinglayer/processor3d/geometry2dextractor.hxx b/drawinglayer/inc/drawinglayer/processor3d/geometry2dextractor.hxx
index ec4c48893c..598aa99219 100644
--- a/drawinglayer/inc/drawinglayer/processor3d/geometry2dextractor.hxx
+++ b/drawinglayer/inc/drawinglayer/processor3d/geometry2dextractor.hxx
@@ -40,20 +40,27 @@ namespace drawinglayer
{
namespace processor3d
{
+ /** Geometry2DExtractingProcessor class
+
+ This processor extracts the 2D geometry (projected geometry) of all feeded primitives.
+ It is e.g. used as sub-processor for contour extraction where 3D geometry is only
+ useful as 2D projected geometry.
+ */
class Geometry2DExtractingProcessor : public BaseProcessor3D
{
private:
- // result holding vector (2D)
+ /// result holding vector (2D)
primitive2d::Primitive2DSequence maPrimitive2DSequence;
- // object transformation for scene for 2d definition
+ /// object transformation for scene for 2d definition
basegfx::B2DHomMatrix maObjectTransformation;
- // the modifiedColorPrimitive stack
+ /// the modifiedColorPrimitive stack
basegfx::BColorModifierStack maBColorModifierStack;
- // as tooling, the process() implementation takes over API handling and calls this
- // virtual render method when the primitive implementation is BasePrimitive3D-based.
+ /* as tooling, the process() implementation takes over API handling and calls this
+ virtual render method when the primitive implementation is BasePrimitive3D-based.
+ */
virtual void processBasePrimitive3D(const primitive3d::BasePrimitive3D& rCandidate);
public:
@@ -61,7 +68,7 @@ namespace drawinglayer
const geometry::ViewInformation3D& rViewInformation,
const basegfx::B2DHomMatrix& rObjectTransformation);
- // data access
+ // data read access
const primitive2d::Primitive2DSequence& getPrimitive2DSequence() const { return maPrimitive2DSequence; }
const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; }
const basegfx::BColorModifierStack& getBColorModifierStack() const { return maBColorModifierStack; }
diff --git a/drawinglayer/inc/drawinglayer/processor3d/shadow3dextractor.hxx b/drawinglayer/inc/drawinglayer/processor3d/shadow3dextractor.hxx
index 4f8caaf5a2..a6290b21a9 100644
--- a/drawinglayer/inc/drawinglayer/processor3d/shadow3dextractor.hxx
+++ b/drawinglayer/inc/drawinglayer/processor3d/shadow3dextractor.hxx
@@ -44,17 +44,24 @@ namespace drawinglayer
{
namespace processor3d
{
+ /** Shadow3DExtractingProcessor class
+
+ This processor extracts the 2D shadow geometry (projected geometry) of all feeded primitives.
+ It is used to create the shadow of 3D objects which consists of 2D geometry. It needs quite
+ some data to do so since we do not only offer flat projected 2D shadow, but also projections
+ dependent on the light source
+ */
class Shadow3DExtractingProcessor : public BaseProcessor3D
{
private:
- // result holding vector (2D) and target vector for stacking (inited to &maPrimitive2DSequence)
+ /// result holding vector (2D) and target vector for stacking (inited to &maPrimitive2DSequence)
primitive2d::Primitive2DSequence maPrimitive2DSequence;
primitive2d::Primitive2DSequence* mpPrimitive2DSequence;
- // object transformation for scene for 2d definition
+ /// object transformation for scene for 2d definition
basegfx::B2DHomMatrix maObjectTransformation;
- // prepared data (transformations) for 2D/3D shadow calculations
+ /// prepared data (transformations) for 2D/3D shadow calculations
basegfx::B3DHomMatrix maWorldToEye;
basegfx::B3DHomMatrix maEyeToView;
basegfx::B3DVector maLightNormal;
@@ -62,26 +69,28 @@ namespace drawinglayer
basegfx::B3DPoint maPlanePoint;
double mfLightPlaneScalar;
- // the shadow color used for sub-primitives. Can stay at black since
- // the encapsulating 2d shadow primitive will contain the color
+ /* the shadow color used for sub-primitives. Can stay at black since
+ the encapsulating 2d shadow primitive will contain the color
+ */
basegfx::BColor maPrimitiveColor;
- // bitfield
- // flag if shadow plane projection preparation leaded to valid results
+ /// bitfield
+ /// flag if shadow plane projection preparation leaded to valid results
unsigned mbShadowProjectionIsValid : 1;
- // flag if conversion is switched on
+ /// flag if conversion is switched on
unsigned mbConvert : 1;
- // flag if conversion shall use projection
+ /// flag if conversion shall use projection
unsigned mbUseProjection : 1;
- // helpers
+ /// local helpers
basegfx::B2DPolygon impDoShadowProjection(const basegfx::B3DPolygon& rSource);
basegfx::B2DPolyPolygon impDoShadowProjection(const basegfx::B3DPolyPolygon& rSource);
- // as tooling, the process() implementation takes over API handling and calls this
- // virtual render method when the primitive implementation is BasePrimitive3D-based.
+ /* as tooling, the process() implementation takes over API handling and calls this
+ virtual render method when the primitive implementation is BasePrimitive3D-based.
+ */
virtual void processBasePrimitive3D(const primitive3d::BasePrimitive3D& rCandidate);
public:
@@ -92,7 +101,7 @@ namespace drawinglayer
double fShadowSlant,
const basegfx::B3DRange& rContained3DRange);
- // data access
+ /// data read access
const primitive2d::Primitive2DSequence& getPrimitive2DSequence() const { return maPrimitive2DSequence; }
const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; }
const basegfx::B3DHomMatrix& getWorldToEye() const { return maWorldToEye; }
diff --git a/drawinglayer/inc/drawinglayer/processor3d/zbufferprocessor3d.hxx b/drawinglayer/inc/drawinglayer/processor3d/zbufferprocessor3d.hxx
index 27b415bad6..a94296532a 100644
--- a/drawinglayer/inc/drawinglayer/processor3d/zbufferprocessor3d.hxx
+++ b/drawinglayer/inc/drawinglayer/processor3d/zbufferprocessor3d.hxx
@@ -50,6 +50,7 @@ namespace drawinglayer {
}
class ZBufferRasterConverter3D;
+class RasterPrimitive3D;
//////////////////////////////////////////////////////////////////////////////
@@ -57,37 +58,40 @@ namespace drawinglayer
{
namespace processor3d
{
+ /** ZBufferProcessor3D class
+
+ This 3D renderer derived from DefaultProcessor3D renders all feeded primitives to a 2D
+ raster bitmap using a Z-Buffer based approach. It is able to supersample and to handle
+ transparent content.
+ */
class ZBufferProcessor3D : public DefaultProcessor3D
{
private:
- // the raster target, a Z-Buffer
+ /// the raster target, a Z-Buffer
basegfx::BZPixelRaster* mpBZPixelRaster;
- // inverse of EyeToView for rasterconversion with evtl. Phong shading
+ /// inverse of EyeToView for rasterconversion with evtl. Phong shading
basegfx::B3DHomMatrix maInvEyeToView;
- // The raster converter for Z-Buffer
+ /// The raster converter for Z-Buffer
ZBufferRasterConverter3D* mpZBufferRasterConverter3D;
- // AA value. Defines how many oversámples will be used in X and Y. Values 0, 1
- // will switch it off while e.g. 2 will use 2x2 pixels for each pixel to create
+ /* AA value. Defines how many oversámples will be used in X and Y. Values 0, 1
+ will switch it off while e.g. 2 will use 2x2 pixels for each pixel to create
+ */
sal_uInt16 mnAntiAlialize;
- // bitfield
- // a combination of bools to allow two-pass rendering to render
- // the transparent parts in the 2nd run (if any) as needed for Z-Buffer
- unsigned mbProcessTransparent : 1;
- unsigned mbContainsTransparent : 1;
-
+ /* remembered RasterPrimitive3D's which need to be painted back to front
+ for transparent 3D parts
+ */
+ std::vector< RasterPrimitive3D >* mpRasterPrimitive3Ds;
//////////////////////////////////////////////////////////////////////////////
// rasterconversions for filled and non-filled polygons
+
virtual void rasterconvertB3DPolygon(const attribute::MaterialAttribute3D& rMaterial, const basegfx::B3DPolygon& rHairline) const;
virtual void rasterconvertB3DPolyPolygon(const attribute::MaterialAttribute3D& rMaterial, const basegfx::B3DPolyPolygon& rFill) const;
- // the processing method for a single, known primitive
- virtual void processBasePrimitive3D(const primitive3d::BasePrimitive3D& rBasePrimitive);
-
public:
ZBufferProcessor3D(
const geometry::ViewInformation3D& rViewInformation3D,
@@ -100,14 +104,9 @@ namespace drawinglayer
sal_uInt16 nAntiAlialize);
virtual ~ZBufferProcessor3D();
- // helpers for drawing transparent parts in 2nd run. To use this
- // processor, call processNonTransparent and then processTransparent
- // with the same primitives. The 2nd call will only do something,
- // when transparent parts are contained
- void processNonTransparent(const primitive3d::Primitive3DSequence& rSource);
- void processTransparent(const primitive3d::Primitive3DSequence& rSource);
+ void finish();
- // get the result as bitmapEx
+ /// get the result as bitmapEx
BitmapEx getBitmapEx() const;
};
} // end of namespace processor3d
diff --git a/drawinglayer/prj/d.lst b/drawinglayer/prj/d.lst
index ee5b96d98a..7ae13f8ebe 100644
--- a/drawinglayer/prj/d.lst
+++ b/drawinglayer/prj/d.lst
@@ -8,7 +8,7 @@ mkdir: %_DEST%\inc%_EXT%\drawinglayer
mkdir: %_DEST%\inc%_EXT%\drawinglayer\primitive2d
..\inc\drawinglayer\primitive2d\drawinglayer_primitivetypes2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\drawinglayer_primitivetypes2d.hxx
-..\inc\drawinglayer\primitive2d\alphaprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\alphaprimitive2d.hxx
+..\inc\drawinglayer\primitive2d\transparenceprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\transparenceprimitive2d.hxx
..\inc\drawinglayer\primitive2d\animatedprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\animatedprimitive2d.hxx
..\inc\drawinglayer\primitive2d\backgroundcolorprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\backgroundcolorprimitive2d.hxx
..\inc\drawinglayer\primitive2d\baseprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\baseprimitive2d.hxx
@@ -24,7 +24,7 @@ mkdir: %_DEST%\inc%_EXT%\drawinglayer\primitive2d
..\inc\drawinglayer\primitive2d\gridprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\gridprimitive2d.hxx
..\inc\drawinglayer\primitive2d\groupprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\groupprimitive2d.hxx
..\inc\drawinglayer\primitive2d\helplineprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\helplineprimitive2d.hxx
-..\inc\drawinglayer\primitive2d\hittestprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\hittestprimitive2d.hxx
+..\inc\drawinglayer\primitive2d\hiddengeometryprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\hiddengeometryprimitive2d.hxx
..\inc\drawinglayer\primitive2d\invertprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\invertprimitive2d.hxx
..\inc\drawinglayer\primitive2d\markerarrayprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\markerarrayprimitive2d.hxx
..\inc\drawinglayer\primitive2d\maskprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\maskprimitive2d.hxx
@@ -36,6 +36,7 @@ mkdir: %_DEST%\inc%_EXT%\drawinglayer\primitive2d
..\inc\drawinglayer\primitive2d\polygonprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\polygonprimitive2d.hxx
..\inc\drawinglayer\primitive2d\polypolygonprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\polypolygonprimitive2d.hxx
..\inc\drawinglayer\primitive2d\primitivetools2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\primitivetools2d.hxx
+..\inc\drawinglayer\primitive2d\sdrdecompositiontools2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\sdrdecompositiontools2d.hxx
..\inc\drawinglayer\primitive2d\sceneprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\sceneprimitive2d.hxx
..\inc\drawinglayer\primitive2d\shadowprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\shadowprimitive2d.hxx
..\inc\drawinglayer\primitive2d\structuretagprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\structuretagprimitive2d.hxx
@@ -46,7 +47,7 @@ mkdir: %_DEST%\inc%_EXT%\drawinglayer\primitive2d
..\inc\drawinglayer\primitive2d\textdecoratedprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\textdecoratedprimitive2d.hxx
..\inc\drawinglayer\primitive2d\texthierarchyprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\texthierarchyprimitive2d.hxx
..\inc\drawinglayer\primitive2d\transformprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\transformprimitive2d.hxx
-..\inc\drawinglayer\primitive2d\unifiedalphaprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\unifiedalphaprimitive2d.hxx
+..\inc\drawinglayer\primitive2d\unifiedtransparenceprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\unifiedtransparenceprimitive2d.hxx
..\inc\drawinglayer\primitive2d\wrongspellprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\wrongspellprimitive2d.hxx
mkdir: %_DEST%\inc%_EXT%\drawinglayer\primitive3d
@@ -54,7 +55,7 @@ mkdir: %_DEST%\inc%_EXT%\drawinglayer\primitive3d
..\inc\drawinglayer\primitive3d\baseprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\baseprimitive3d.hxx
..\inc\drawinglayer\primitive3d\groupprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\groupprimitive3d.hxx
..\inc\drawinglayer\primitive3d\hatchtextureprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\hatchtextureprimitive3d.hxx
-..\inc\drawinglayer\primitive3d\hittestprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\hittestprimitive3d.hxx
+..\inc\drawinglayer\primitive2d\hiddengeometryprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\hiddengeometryprimitive3d.hxx
..\inc\drawinglayer\primitive3d\modifiedcolorprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\modifiedcolorprimitive3d.hxx
..\inc\drawinglayer\primitive3d\polygonprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\polygonprimitive3d.hxx
..\inc\drawinglayer\primitive3d\polygontubeprimitive3d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive3d\polygontubeprimitive3d.hxx
@@ -97,13 +98,20 @@ mkdir: %_DEST%\inc%_EXT%\drawinglayer\processor3d
..\inc\drawinglayer\processor3d\tbufferprocessor3d.hxx %_DEST%\inc%_EXT%\drawinglayer\processor3d\tbufferprocessor3d.hxx
mkdir: %_DEST%\inc%_EXT%\drawinglayer\attribute
-..\inc\drawinglayer\attribute\fillattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\fillattribute.hxx
+..\inc\drawinglayer\attribute\fillgradientattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\fillgradientattribute.hxx
+..\inc\drawinglayer\attribute\fillhatchattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\fillhatchattribute.hxx
..\inc\drawinglayer\attribute\fillbitmapattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\fillbitmapattribute.hxx
..\inc\drawinglayer\attribute\fontattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\fontattribute.hxx
..\inc\drawinglayer\attribute\materialattribute3d.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\materialattribute3d.hxx
..\inc\drawinglayer\attribute\sdrallattribute3d.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\sdrallattribute3d.hxx
-..\inc\drawinglayer\attribute\sdrattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\sdrattribute.hxx
-..\inc\drawinglayer\attribute\sdrattribute3d.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\sdrattribute3d.hxx
+..\inc\drawinglayer\attribute\sdrlineattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\sdrlineattribute.hxx
+..\inc\drawinglayer\attribute\sdrlinestartendattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\sdrlinestartendattribute.hxx
+..\inc\drawinglayer\attribute\sdrshadowattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\sdrshadowattribute.hxx
+..\inc\drawinglayer\attribute\sdrfillattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\sdrfillattribute.hxx
+..\inc\drawinglayer\attribute\sdrobjectattribute3d.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\sdrobjectattribute3d.hxx
+..\inc\drawinglayer\attribute\sdrlightattribute3d.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\sdrlightattribute3d.hxx
+..\inc\drawinglayer\attribute\sdrlightingattribute3d.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\sdrlightingattribute3d.hxx
+..\inc\drawinglayer\attribute\sdrsceneattribute3d.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\sdrsceneattribute3d.hxx
..\inc\drawinglayer\attribute\sdrfillbitmapattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\sdrfillbitmapattribute.hxx
..\inc\drawinglayer\attribute\strokeattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\strokeattribute.hxx
..\inc\drawinglayer\attribute\lineattribute.hxx %_DEST%\inc%_EXT%\drawinglayer\attribute\lineattribute.hxx
diff --git a/drawinglayer/source/attribute/fillattribute.cxx b/drawinglayer/source/attribute/fillattribute.cxx
deleted file mode 100644
index 431ee7b127..0000000000
--- a/drawinglayer/source/attribute/fillattribute.cxx
+++ /dev/null
@@ -1,94 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_drawinglayer.hxx"
-
-#include <drawinglayer/attribute/fillattribute.hxx>
-#include <basegfx/numeric/ftools.hxx>
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- FillGradientAttribute::FillGradientAttribute(GradientStyle eStyle, double fBorder, double fOffsetX, double fOffsetY, double fAngle,
- const basegfx::BColor& rStartColor, const basegfx::BColor& rEndColor, sal_uInt16 nSteps)
- : maStartColor(rStartColor),
- maEndColor(rEndColor),
- mfBorder(fBorder),
- mfOffsetX(fOffsetX),
- mfOffsetY(fOffsetY),
- mfAngle(fAngle),
- meStyle(eStyle),
- mnSteps(nSteps)
- {
- }
-
- bool FillGradientAttribute::operator==(const FillGradientAttribute& rCandidate) const
- {
- return (meStyle == rCandidate.meStyle
- && maStartColor == rCandidate.maStartColor
- && maEndColor == rCandidate.maEndColor
- && mfBorder == rCandidate.mfBorder
- && mfOffsetX == rCandidate.mfOffsetX
- && mfOffsetY == rCandidate.mfOffsetY
- && mfAngle == rCandidate.mfAngle
- && mnSteps == rCandidate.mnSteps);
- }
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- FillHatchAttribute::FillHatchAttribute(HatchStyle eStyle, double fDistance, double fAngle, const basegfx::BColor& rColor, bool bFillBackground)
- : mfDistance(fDistance),
- mfAngle(fAngle),
- maColor(rColor),
- meStyle(eStyle),
- mbFillBackground(bFillBackground)
- {
- }
-
- bool FillHatchAttribute::operator==(const FillHatchAttribute& rCandidate) const
- {
- return (meStyle == rCandidate.meStyle
- && mfDistance == rCandidate.mfDistance
- && mfAngle == rCandidate.mfAngle
- && maColor == rCandidate.maColor
- && mbFillBackground == rCandidate.mbFillBackground);
- }
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-// eof
diff --git a/drawinglayer/source/attribute/fillbitmapattribute.cxx b/drawinglayer/source/attribute/fillbitmapattribute.cxx
index 6d39298335..a34e529e29 100644
--- a/drawinglayer/source/attribute/fillbitmapattribute.cxx
+++ b/drawinglayer/source/attribute/fillbitmapattribute.cxx
@@ -29,6 +29,7 @@
#include "precompiled_drawinglayer.hxx"
#include <drawinglayer/attribute/fillbitmapattribute.hxx>
+#include <vcl/bitmapex.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -36,25 +37,161 @@ namespace drawinglayer
{
namespace attribute
{
+ class ImpFillBitmapAttribute
+ {
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ // data definitions
+ BitmapEx maBitmapEx;
+ basegfx::B2DPoint maTopLeft;
+ basegfx::B2DVector maSize;
+
+ // bitfield
+ unsigned mbTiling : 1;
+
+ ImpFillBitmapAttribute(
+ const BitmapEx& rBitmapEx,
+ const basegfx::B2DPoint& rTopLeft,
+ const basegfx::B2DVector& rSize,
+ bool bTiling)
+ : mnRefCount(0),
+ maBitmapEx(rBitmapEx),
+ maTopLeft(rTopLeft),
+ maSize(rSize),
+ mbTiling(bTiling)
+ {
+ }
+
+ bool operator==(const ImpFillBitmapAttribute& rCandidate) const
+ {
+ return (maBitmapEx == rCandidate.maBitmapEx
+ && maTopLeft == rCandidate.maTopLeft
+ && maSize == rCandidate.maSize
+ && mbTiling == rCandidate.mbTiling);
+ }
+
+ // data read access
+ const BitmapEx& getBitmapEx() const { return maBitmapEx; }
+ const basegfx::B2DPoint& getTopLeft() const { return maTopLeft; }
+ const basegfx::B2DVector& getSize() const { return maSize; }
+ bool getTiling() const { return mbTiling; }
+
+ static ImpFillBitmapAttribute* get_global_default()
+ {
+ static ImpFillBitmapAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpFillBitmapAttribute(
+ BitmapEx(),
+ basegfx::B2DPoint(),
+ basegfx::B2DVector(),
+ false);
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
+ };
+
FillBitmapAttribute::FillBitmapAttribute(
const BitmapEx& rBitmapEx,
const basegfx::B2DPoint& rTopLeft,
const basegfx::B2DVector& rSize,
bool bTiling)
- : maBitmapEx(rBitmapEx),
- maTopLeft(rTopLeft),
- maSize(rSize),
- mbTiling(bTiling)
+ : mpFillBitmapAttribute(new ImpFillBitmapAttribute(
+ rBitmapEx, rTopLeft, rSize, bTiling))
+ {
+ }
+
+ FillBitmapAttribute::FillBitmapAttribute()
+ : mpFillBitmapAttribute(ImpFillBitmapAttribute::get_global_default())
+ {
+ mpFillBitmapAttribute->mnRefCount++;
+ }
+
+ FillBitmapAttribute::FillBitmapAttribute(const FillBitmapAttribute& rCandidate)
+ : mpFillBitmapAttribute(rCandidate.mpFillBitmapAttribute)
+ {
+ mpFillBitmapAttribute->mnRefCount++;
+ }
+
+ FillBitmapAttribute::~FillBitmapAttribute()
+ {
+ if(mpFillBitmapAttribute->mnRefCount)
+ {
+ mpFillBitmapAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpFillBitmapAttribute;
+ }
+ }
+
+ bool FillBitmapAttribute::isDefault() const
+ {
+ return mpFillBitmapAttribute == ImpFillBitmapAttribute::get_global_default();
+ }
+
+ FillBitmapAttribute& FillBitmapAttribute::operator=(const FillBitmapAttribute& rCandidate)
{
+ if(rCandidate.mpFillBitmapAttribute != mpFillBitmapAttribute)
+ {
+ if(mpFillBitmapAttribute->mnRefCount)
+ {
+ mpFillBitmapAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpFillBitmapAttribute;
+ }
+
+ mpFillBitmapAttribute = rCandidate.mpFillBitmapAttribute;
+ mpFillBitmapAttribute->mnRefCount++;
+ }
+
+ return *this;
}
bool FillBitmapAttribute::operator==(const FillBitmapAttribute& rCandidate) const
{
- return (getBitmapEx() == rCandidate.getBitmapEx()
- && getTopLeft() == rCandidate.getTopLeft()
- && getSize() == rCandidate.getSize()
- && getTiling() == rCandidate.getTiling());
+ if(rCandidate.mpFillBitmapAttribute == mpFillBitmapAttribute)
+ {
+ return true;
+ }
+
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
+ return (*rCandidate.mpFillBitmapAttribute == *mpFillBitmapAttribute);
}
+
+ const BitmapEx& FillBitmapAttribute::getBitmapEx() const
+ {
+ return mpFillBitmapAttribute->getBitmapEx();
+ }
+
+ const basegfx::B2DPoint& FillBitmapAttribute::getTopLeft() const
+ {
+ return mpFillBitmapAttribute->getTopLeft();
+ }
+
+ const basegfx::B2DVector& FillBitmapAttribute::getSize() const
+ {
+ return mpFillBitmapAttribute->getSize();
+ }
+
+ bool FillBitmapAttribute::getTiling() const
+ {
+ return mpFillBitmapAttribute->getTiling();
+ }
+
} // end of namespace attribute
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/attribute/fillgradientattribute.cxx b/drawinglayer/source/attribute/fillgradientattribute.cxx
new file mode 100644
index 0000000000..0d38b27c91
--- /dev/null
+++ b/drawinglayer/source/attribute/fillgradientattribute.cxx
@@ -0,0 +1,250 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: fillattribute.cxx,v $
+ *
+ * $Revision: 1.4 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:19 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_drawinglayer.hxx"
+
+#include <drawinglayer/attribute/fillgradientattribute.hxx>
+#include <basegfx/color/bcolor.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class ImpFillGradientAttribute
+ {
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ // data definitions
+ GradientStyle meStyle;
+ double mfBorder;
+ double mfOffsetX;
+ double mfOffsetY;
+ double mfAngle;
+ basegfx::BColor maStartColor;
+ basegfx::BColor maEndColor;
+ sal_uInt16 mnSteps;
+
+ ImpFillGradientAttribute(
+ GradientStyle eStyle,
+ double fBorder,
+ double fOffsetX,
+ double fOffsetY,
+ double fAngle,
+ const basegfx::BColor& rStartColor,
+ const basegfx::BColor& rEndColor,
+ sal_uInt16 nSteps)
+ : mnRefCount(0),
+ meStyle(eStyle),
+ mfBorder(fBorder),
+ mfOffsetX(fOffsetX),
+ mfOffsetY(fOffsetY),
+ mfAngle(fAngle),
+ maStartColor(rStartColor),
+ maEndColor(rEndColor),
+ mnSteps(nSteps)
+ {
+ }
+
+ // data read access
+ GradientStyle getStyle() const { return meStyle; }
+ double getBorder() const { return mfBorder; }
+ double getOffsetX() const { return mfOffsetX; }
+ double getOffsetY() const { return mfOffsetY; }
+ double getAngle() const { return mfAngle; }
+ const basegfx::BColor& getStartColor() const { return maStartColor; }
+ const basegfx::BColor& getEndColor() const { return maEndColor; }
+ sal_uInt16 getSteps() const { return mnSteps; }
+
+ bool operator==(const ImpFillGradientAttribute& rCandidate) const
+ {
+ return (getStyle() == rCandidate.getStyle()
+ && getBorder() == rCandidate.getBorder()
+ && getOffsetX() == rCandidate.getOffsetX()
+ && getOffsetY() == rCandidate.getOffsetY()
+ && getAngle() == rCandidate.getAngle()
+ && getStartColor() == rCandidate.getStartColor()
+ && getEndColor() == rCandidate.getEndColor()
+ && getSteps() == rCandidate.getSteps());
+ }
+
+ static ImpFillGradientAttribute* get_global_default()
+ {
+ static ImpFillGradientAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpFillGradientAttribute(
+ GRADIENTSTYLE_LINEAR,
+ 0.0, 0.0, 0.0, 0.0,
+ basegfx::BColor(),
+ basegfx::BColor(),
+ 0);
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
+ };
+
+ FillGradientAttribute::FillGradientAttribute(
+ GradientStyle eStyle,
+ double fBorder,
+ double fOffsetX,
+ double fOffsetY,
+ double fAngle,
+ const basegfx::BColor& rStartColor,
+ const basegfx::BColor& rEndColor,
+ sal_uInt16 nSteps)
+ : mpFillGradientAttribute(new ImpFillGradientAttribute(
+ eStyle, fBorder, fOffsetX, fOffsetY, fAngle, rStartColor, rEndColor, nSteps))
+ {
+ }
+
+ FillGradientAttribute::FillGradientAttribute()
+ : mpFillGradientAttribute(ImpFillGradientAttribute::get_global_default())
+ {
+ mpFillGradientAttribute->mnRefCount++;
+ }
+
+ FillGradientAttribute::FillGradientAttribute(const FillGradientAttribute& rCandidate)
+ : mpFillGradientAttribute(rCandidate.mpFillGradientAttribute)
+ {
+ mpFillGradientAttribute->mnRefCount++;
+ }
+
+ FillGradientAttribute::~FillGradientAttribute()
+ {
+ if(mpFillGradientAttribute->mnRefCount)
+ {
+ mpFillGradientAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpFillGradientAttribute;
+ }
+ }
+
+ bool FillGradientAttribute::isDefault() const
+ {
+ return mpFillGradientAttribute == ImpFillGradientAttribute::get_global_default();
+ }
+
+ FillGradientAttribute& FillGradientAttribute::operator=(const FillGradientAttribute& rCandidate)
+ {
+ if(rCandidate.mpFillGradientAttribute != mpFillGradientAttribute)
+ {
+ if(mpFillGradientAttribute->mnRefCount)
+ {
+ mpFillGradientAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpFillGradientAttribute;
+ }
+
+ mpFillGradientAttribute = rCandidate.mpFillGradientAttribute;
+ mpFillGradientAttribute->mnRefCount++;
+ }
+
+ return *this;
+ }
+
+ bool FillGradientAttribute::operator==(const FillGradientAttribute& rCandidate) const
+ {
+ if(rCandidate.mpFillGradientAttribute == mpFillGradientAttribute)
+ {
+ return true;
+ }
+
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
+ return (*rCandidate.mpFillGradientAttribute == *mpFillGradientAttribute);
+ }
+
+ const basegfx::BColor& FillGradientAttribute::getStartColor() const
+ {
+ return mpFillGradientAttribute->getStartColor();
+ }
+
+ const basegfx::BColor& FillGradientAttribute::getEndColor() const
+ {
+ return mpFillGradientAttribute->getEndColor();
+ }
+
+ double FillGradientAttribute::getBorder() const
+ {
+ return mpFillGradientAttribute->getBorder();
+ }
+
+ double FillGradientAttribute::getOffsetX() const
+ {
+ return mpFillGradientAttribute->getOffsetX();
+ }
+
+ double FillGradientAttribute::getOffsetY() const
+ {
+ return mpFillGradientAttribute->getOffsetY();
+ }
+
+ double FillGradientAttribute::getAngle() const
+ {
+ return mpFillGradientAttribute->getAngle();
+ }
+
+ GradientStyle FillGradientAttribute::getStyle() const
+ {
+ return mpFillGradientAttribute->getStyle();
+ }
+
+ sal_uInt16 FillGradientAttribute::getSteps() const
+ {
+ return mpFillGradientAttribute->getSteps();
+ }
+
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/attribute/fillhatchattribute.cxx b/drawinglayer/source/attribute/fillhatchattribute.cxx
new file mode 100644
index 0000000000..cc8b19edf0
--- /dev/null
+++ b/drawinglayer/source/attribute/fillhatchattribute.cxx
@@ -0,0 +1,219 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: fillattribute.cxx,v $
+ *
+ * $Revision: 1.4 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:19 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_drawinglayer.hxx"
+
+#include <drawinglayer/attribute/fillhatchattribute.hxx>
+#include <basegfx/color/bcolor.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class ImpFillHatchAttribute
+ {
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ // data definitions
+ HatchStyle meStyle;
+ double mfDistance;
+ double mfAngle;
+ basegfx::BColor maColor;
+
+ // bitfield
+ unsigned mbFillBackground : 1;
+
+ ImpFillHatchAttribute(
+ HatchStyle eStyle,
+ double fDistance,
+ double fAngle,
+ const basegfx::BColor& rColor,
+ bool bFillBackground)
+ : mnRefCount(0),
+ meStyle(eStyle),
+ mfDistance(fDistance),
+ mfAngle(fAngle),
+ maColor(rColor),
+ mbFillBackground(bFillBackground)
+ {
+ }
+
+ // data read access
+ HatchStyle getStyle() const { return meStyle; }
+ double getDistance() const { return mfDistance; }
+ double getAngle() const { return mfAngle; }
+ const basegfx::BColor& getColor() const { return maColor; }
+ bool isFillBackground() const { return mbFillBackground; }
+
+ bool operator==(const ImpFillHatchAttribute& rCandidate) const
+ {
+ return (getStyle() == rCandidate.getStyle()
+ && getDistance() == rCandidate.getDistance()
+ && getAngle() == rCandidate.getAngle()
+ && getColor() == rCandidate.getColor()
+ && isFillBackground() == rCandidate.isFillBackground());
+ }
+
+ static ImpFillHatchAttribute* get_global_default()
+ {
+ static ImpFillHatchAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpFillHatchAttribute(
+ HATCHSTYLE_SINGLE,
+ 0.0, 0.0,
+ basegfx::BColor(),
+ false);
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
+ };
+
+ FillHatchAttribute::FillHatchAttribute(
+ HatchStyle eStyle,
+ double fDistance,
+ double fAngle,
+ const basegfx::BColor& rColor,
+ bool bFillBackground)
+ : mpFillHatchAttribute(new ImpFillHatchAttribute(
+ eStyle, fDistance, fAngle, rColor, bFillBackground))
+ {
+ }
+
+ FillHatchAttribute::FillHatchAttribute()
+ : mpFillHatchAttribute(ImpFillHatchAttribute::get_global_default())
+ {
+ mpFillHatchAttribute->mnRefCount++;
+ }
+
+ FillHatchAttribute::FillHatchAttribute(const FillHatchAttribute& rCandidate)
+ : mpFillHatchAttribute(rCandidate.mpFillHatchAttribute)
+ {
+ mpFillHatchAttribute->mnRefCount++;
+ }
+
+ FillHatchAttribute::~FillHatchAttribute()
+ {
+ if(mpFillHatchAttribute->mnRefCount)
+ {
+ mpFillHatchAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpFillHatchAttribute;
+ }
+ }
+
+ bool FillHatchAttribute::isDefault() const
+ {
+ return mpFillHatchAttribute == ImpFillHatchAttribute::get_global_default();
+ }
+
+ FillHatchAttribute& FillHatchAttribute::operator=(const FillHatchAttribute& rCandidate)
+ {
+ if(rCandidate.mpFillHatchAttribute != mpFillHatchAttribute)
+ {
+ if(mpFillHatchAttribute->mnRefCount)
+ {
+ mpFillHatchAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpFillHatchAttribute;
+ }
+
+ mpFillHatchAttribute = rCandidate.mpFillHatchAttribute;
+ mpFillHatchAttribute->mnRefCount++;
+ }
+
+ return *this;
+ }
+
+ bool FillHatchAttribute::operator==(const FillHatchAttribute& rCandidate) const
+ {
+ if(rCandidate.mpFillHatchAttribute == mpFillHatchAttribute)
+ {
+ return true;
+ }
+
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
+ return (*rCandidate.mpFillHatchAttribute == *mpFillHatchAttribute);
+ }
+
+ // data read access
+ HatchStyle FillHatchAttribute::getStyle() const
+ {
+ return mpFillHatchAttribute->getStyle();
+ }
+
+ double FillHatchAttribute::getDistance() const
+ {
+ return mpFillHatchAttribute->getDistance();
+ }
+
+ double FillHatchAttribute::getAngle() const
+ {
+ return mpFillHatchAttribute->getAngle();
+ }
+
+ const basegfx::BColor& FillHatchAttribute::getColor() const
+ {
+ return mpFillHatchAttribute->getColor();
+ }
+
+ bool FillHatchAttribute::isFillBackground() const
+ {
+ return mpFillHatchAttribute->isFillBackground();
+ }
+
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/attribute/fontattribute.cxx b/drawinglayer/source/attribute/fontattribute.cxx
index 9a85110e56..46ec067fec 100644
--- a/drawinglayer/source/attribute/fontattribute.cxx
+++ b/drawinglayer/source/attribute/fontattribute.cxx
@@ -29,6 +29,7 @@
#include "precompiled_drawinglayer.hxx"
#include <drawinglayer/attribute/fontattribute.hxx>
+#include <tools/string.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -36,18 +37,215 @@ namespace drawinglayer
{
namespace attribute
{
- bool FontAttribute::operator==(const FontAttribute& rCompare) const
- {
- return (getFamilyName() == rCompare.getFamilyName()
- && getStyleName() == rCompare.getStyleName()
- && getWeight() == rCompare.getWeight()
- && getSymbol() == rCompare.getSymbol()
- && getVertical() == rCompare.getVertical()
- && getItalic() == rCompare.getItalic()
- && getOutline() == rCompare.getOutline()
- && getRTL() == rCompare.getRTL()
- && getBiDiStrong() == rCompare.getBiDiStrong());
+ class ImpFontAttribute
+ {
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ /// core data
+ String maFamilyName; // Font Family Name
+ String maStyleName; // Font Style Name
+ sal_uInt16 mnWeight; // Font weight
+
+ /// bitfield
+ unsigned mbSymbol : 1; // Symbol Font Flag
+ unsigned mbVertical : 1; // Vertical Text Flag
+ unsigned mbItalic : 1; // Italic Flag
+ unsigned mbOutline : 1; // Outline Flag
+ unsigned mbRTL : 1; // RTL Flag
+ unsigned mbBiDiStrong : 1; // BiDi Flag
+
+ ImpFontAttribute(
+ const String& rFamilyName,
+ const String& rStyleName,
+ sal_uInt16 nWeight,
+ bool bSymbol,
+ bool bVertical,
+ bool bItalic,
+ bool bOutline,
+ bool bRTL,
+ bool bBiDiStrong)
+ : mnRefCount(0),
+ maFamilyName(rFamilyName),
+ maStyleName(rStyleName),
+ mnWeight(nWeight),
+ mbSymbol(bSymbol),
+ mbVertical(bVertical),
+ mbItalic(bItalic),
+ mbOutline(bOutline),
+ mbRTL(bRTL),
+ mbBiDiStrong(bBiDiStrong)
+ {
+ }
+
+ // data read access
+ const String& getFamilyName() const { return maFamilyName; }
+ const String& getStyleName() const { return maStyleName; }
+ sal_uInt16 getWeight() const { return mnWeight; }
+ bool getSymbol() const { return mbSymbol; }
+ bool getVertical() const { return mbVertical; }
+ bool getItalic() const { return mbItalic; }
+ bool getOutline() const { return mbOutline; }
+ bool getRTL() const { return mbRTL; }
+ bool getBiDiStrong() const { return mbBiDiStrong; }
+
+ bool operator==(const ImpFontAttribute& rCompare) const
+ {
+ return (getFamilyName() == rCompare.getFamilyName()
+ && getStyleName() == rCompare.getStyleName()
+ && getWeight() == rCompare.getWeight()
+ && getSymbol() == rCompare.getSymbol()
+ && getVertical() == rCompare.getVertical()
+ && getItalic() == rCompare.getItalic()
+ && getOutline() == rCompare.getOutline()
+ && getRTL() == rCompare.getRTL()
+ && getBiDiStrong() == rCompare.getBiDiStrong());
+ }
+
+ static ImpFontAttribute* get_global_default()
+ {
+ static ImpFontAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpFontAttribute(
+ String(), String(),
+ 0,
+ false, false, false, false, false, false);
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
+ };
+
+ FontAttribute::FontAttribute(
+ const String& rFamilyName,
+ const String& rStyleName,
+ sal_uInt16 nWeight,
+ bool bSymbol,
+ bool bVertical,
+ bool bItalic,
+ bool bOutline,
+ bool bRTL,
+ bool bBiDiStrong)
+ : mpFontAttribute(new ImpFontAttribute(
+ rFamilyName, rStyleName, nWeight, bSymbol, bVertical, bItalic, bOutline, bRTL, bBiDiStrong))
+ {
+ }
+
+ FontAttribute::FontAttribute()
+ : mpFontAttribute(ImpFontAttribute::get_global_default())
+ {
+ mpFontAttribute->mnRefCount++;
+ }
+
+ FontAttribute::FontAttribute(const FontAttribute& rCandidate)
+ : mpFontAttribute(rCandidate.mpFontAttribute)
+ {
+ mpFontAttribute->mnRefCount++;
+ }
+
+ FontAttribute::~FontAttribute()
+ {
+ if(mpFontAttribute->mnRefCount)
+ {
+ mpFontAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpFontAttribute;
+ }
+ }
+
+ bool FontAttribute::isDefault() const
+ {
+ return mpFontAttribute == ImpFontAttribute::get_global_default();
+ }
+
+ FontAttribute& FontAttribute::operator=(const FontAttribute& rCandidate)
+ {
+ if(rCandidate.mpFontAttribute != mpFontAttribute)
+ {
+ if(mpFontAttribute->mnRefCount)
+ {
+ mpFontAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpFontAttribute;
+ }
+
+ mpFontAttribute = rCandidate.mpFontAttribute;
+ mpFontAttribute->mnRefCount++;
+ }
+
+ return *this;
+ }
+
+ bool FontAttribute::operator==(const FontAttribute& rCandidate) const
+ {
+ if(rCandidate.mpFontAttribute == mpFontAttribute)
+ {
+ return true;
+ }
+
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
+ return (*rCandidate.mpFontAttribute == *mpFontAttribute);
+ }
+
+ const String& FontAttribute::getFamilyName() const
+ {
+ return mpFontAttribute->getFamilyName();
+ }
+
+ const String& FontAttribute::getStyleName() const
+ {
+ return mpFontAttribute->getStyleName();
+ }
+
+ sal_uInt16 FontAttribute::getWeight() const
+ {
+ return mpFontAttribute->getWeight();
}
+
+ bool FontAttribute::getSymbol() const
+ {
+ return mpFontAttribute->getSymbol();
+ }
+
+ bool FontAttribute::getVertical() const
+ {
+ return mpFontAttribute->getVertical();
+ }
+
+ bool FontAttribute::getItalic() const
+ {
+ return mpFontAttribute->getItalic();
+ }
+
+ bool FontAttribute::getOutline() const
+ {
+ return mpFontAttribute->getOutline();
+ }
+
+ bool FontAttribute::getRTL() const
+ {
+ return mpFontAttribute->getRTL();
+ }
+
+ bool FontAttribute::getBiDiStrong() const
+ {
+ return mpFontAttribute->getBiDiStrong();
+ }
+
} // end of namespace attribute
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/attribute/lineattribute.cxx b/drawinglayer/source/attribute/lineattribute.cxx
index 2bf289bdcc..7b4fb98db3 100644
--- a/drawinglayer/source/attribute/lineattribute.cxx
+++ b/drawinglayer/source/attribute/lineattribute.cxx
@@ -29,6 +29,7 @@
#include "precompiled_drawinglayer.hxx"
#include <drawinglayer/attribute/lineattribute.hxx>
+#include <basegfx/color/bcolor.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -36,6 +37,147 @@ namespace drawinglayer
{
namespace attribute
{
+ class ImpLineAttribute
+ {
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ // data definitions
+ basegfx::BColor maColor; // color
+ double mfWidth; // absolute line width
+ basegfx::B2DLineJoin meLineJoin; // type of LineJoin
+
+ ImpLineAttribute(
+ const basegfx::BColor& rColor,
+ double fWidth,
+ basegfx::B2DLineJoin aB2DLineJoin)
+ : mnRefCount(0),
+ maColor(rColor),
+ mfWidth(fWidth),
+ meLineJoin(aB2DLineJoin)
+ {
+ }
+
+ // data read access
+ const basegfx::BColor& getColor() const { return maColor; }
+ double getWidth() const { return mfWidth; }
+ basegfx::B2DLineJoin getLineJoin() const { return meLineJoin; }
+
+ bool operator==(const ImpLineAttribute& rCandidate) const
+ {
+ return (getColor() == rCandidate.getColor()
+ && getWidth() == rCandidate.getWidth()
+ && getLineJoin() == rCandidate.getLineJoin());
+ }
+
+ static ImpLineAttribute* get_global_default()
+ {
+ static ImpLineAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpLineAttribute(
+ basegfx::BColor(),
+ 0.0,
+ basegfx::B2DLINEJOIN_ROUND);
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
+ };
+
+ LineAttribute::LineAttribute(
+ const basegfx::BColor& rColor,
+ double fWidth,
+ basegfx::B2DLineJoin aB2DLineJoin)
+ : mpLineAttribute(new ImpLineAttribute(
+ rColor, fWidth, aB2DLineJoin))
+ {
+ }
+
+ LineAttribute::LineAttribute()
+ : mpLineAttribute(ImpLineAttribute::get_global_default())
+ {
+ mpLineAttribute->mnRefCount++;
+ }
+
+ LineAttribute::LineAttribute(const LineAttribute& rCandidate)
+ : mpLineAttribute(rCandidate.mpLineAttribute)
+ {
+ mpLineAttribute->mnRefCount++;
+ }
+
+ LineAttribute::~LineAttribute()
+ {
+ if(mpLineAttribute->mnRefCount)
+ {
+ mpLineAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpLineAttribute;
+ }
+ }
+
+ bool LineAttribute::isDefault() const
+ {
+ return mpLineAttribute == ImpLineAttribute::get_global_default();
+ }
+
+ LineAttribute& LineAttribute::operator=(const LineAttribute& rCandidate)
+ {
+ if(rCandidate.mpLineAttribute != mpLineAttribute)
+ {
+ if(mpLineAttribute->mnRefCount)
+ {
+ mpLineAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpLineAttribute;
+ }
+
+ mpLineAttribute = rCandidate.mpLineAttribute;
+ mpLineAttribute->mnRefCount++;
+ }
+
+ return *this;
+ }
+
+ bool LineAttribute::operator==(const LineAttribute& rCandidate) const
+ {
+ if(rCandidate.mpLineAttribute == mpLineAttribute)
+ {
+ return true;
+ }
+
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
+ return (*rCandidate.mpLineAttribute == *mpLineAttribute);
+ }
+
+ const basegfx::BColor& LineAttribute::getColor() const
+ {
+ return mpLineAttribute->getColor();
+ }
+
+ double LineAttribute::getWidth() const
+ {
+ return mpLineAttribute->getWidth();
+ }
+
+ basegfx::B2DLineJoin LineAttribute::getLineJoin() const
+ {
+ return mpLineAttribute->getLineJoin();
+ }
+
} // end of namespace attribute
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/attribute/linestartendattribute.cxx b/drawinglayer/source/attribute/linestartendattribute.cxx
index 8609864f5b..0ff284d9a2 100644
--- a/drawinglayer/source/attribute/linestartendattribute.cxx
+++ b/drawinglayer/source/attribute/linestartendattribute.cxx
@@ -30,6 +30,7 @@
#include <drawinglayer/attribute/linestartendattribute.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -37,11 +38,154 @@ namespace drawinglayer
{
namespace attribute
{
+ class ImpLineStartEndAttribute
+ {
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ // data definitions
+ double mfWidth; // absolute line StartEndGeometry base width
+ basegfx::B2DPolyPolygon maPolyPolygon; // the StartEndGeometry PolyPolygon
+
+ // bitfield
+ unsigned mbCentered : 1; // use centered to ineStart/End point?
+
+ ImpLineStartEndAttribute(
+ double fWidth,
+ const basegfx::B2DPolyPolygon& rPolyPolygon,
+ bool bCentered)
+ : mnRefCount(0),
+ mfWidth(fWidth),
+ maPolyPolygon(rPolyPolygon),
+ mbCentered(bCentered)
+ {
+ }
+
+ // data read access
+ double getWidth() const { return mfWidth; }
+ const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; }
+ bool isCentered() const { return mbCentered; }
+
+ bool operator==(const ImpLineStartEndAttribute& rCandidate) const
+ {
+ return (basegfx::fTools::equal(getWidth(), rCandidate.getWidth())
+ && getB2DPolyPolygon() == rCandidate.getB2DPolyPolygon()
+ && isCentered() == rCandidate.isCentered());
+ }
+
+ static ImpLineStartEndAttribute* get_global_default()
+ {
+ static ImpLineStartEndAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpLineStartEndAttribute(
+ 0.0,
+ basegfx::B2DPolyPolygon(),
+ false);
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
+ };
+
+ LineStartEndAttribute::LineStartEndAttribute(
+ double fWidth,
+ const basegfx::B2DPolyPolygon& rPolyPolygon,
+ bool bCentered)
+ : mpLineStartEndAttribute(new ImpLineStartEndAttribute(
+ fWidth, rPolyPolygon, bCentered))
+ {
+ }
+
+ LineStartEndAttribute::LineStartEndAttribute()
+ : mpLineStartEndAttribute(ImpLineStartEndAttribute::get_global_default())
+ {
+ mpLineStartEndAttribute->mnRefCount++;
+ }
+
+ LineStartEndAttribute::LineStartEndAttribute(const LineStartEndAttribute& rCandidate)
+ : mpLineStartEndAttribute(rCandidate.mpLineStartEndAttribute)
+ {
+ mpLineStartEndAttribute->mnRefCount++;
+ }
+
+ LineStartEndAttribute::~LineStartEndAttribute()
+ {
+ if(mpLineStartEndAttribute->mnRefCount)
+ {
+ mpLineStartEndAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpLineStartEndAttribute;
+ }
+ }
+
+ bool LineStartEndAttribute::isDefault() const
+ {
+ return mpLineStartEndAttribute == ImpLineStartEndAttribute::get_global_default();
+ }
+
+ LineStartEndAttribute& LineStartEndAttribute::operator=(const LineStartEndAttribute& rCandidate)
+ {
+ if(rCandidate.mpLineStartEndAttribute != mpLineStartEndAttribute)
+ {
+ if(mpLineStartEndAttribute->mnRefCount)
+ {
+ mpLineStartEndAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpLineStartEndAttribute;
+ }
+
+ mpLineStartEndAttribute = rCandidate.mpLineStartEndAttribute;
+ mpLineStartEndAttribute->mnRefCount++;
+ }
+
+ return *this;
+ }
+
+ bool LineStartEndAttribute::operator==(const LineStartEndAttribute& rCandidate) const
+ {
+ if(rCandidate.mpLineStartEndAttribute == mpLineStartEndAttribute)
+ {
+ return true;
+ }
+
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
+ return (*rCandidate.mpLineStartEndAttribute == *mpLineStartEndAttribute);
+ }
+
+ double LineStartEndAttribute::getWidth() const
+ {
+ return mpLineStartEndAttribute->getWidth();
+ }
+
+ const basegfx::B2DPolyPolygon& LineStartEndAttribute::getB2DPolyPolygon() const
+ {
+ return mpLineStartEndAttribute->getB2DPolyPolygon();
+ }
+
+ bool LineStartEndAttribute::isCentered() const
+ {
+ return mpLineStartEndAttribute->isCentered();
+ }
+
bool LineStartEndAttribute::isActive() const
{
return (0.0 != getWidth()
- && 0.0 != getB2DPolyPolygon().count()
- && 0.0 != getB2DPolyPolygon().getB2DPolygon(0L).count());
+ && 0 != getB2DPolyPolygon().count()
+ && 0 != getB2DPolyPolygon().getB2DPolygon(0).count());
}
} // end of namespace attribute
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/attribute/makefile.mk b/drawinglayer/source/attribute/makefile.mk
index 291cf313a6..32cef7c7b4 100644
--- a/drawinglayer/source/attribute/makefile.mk
+++ b/drawinglayer/source/attribute/makefile.mk
@@ -37,16 +37,23 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files -------------------------------------
SLOFILES= \
- $(SLO)$/fillattribute.obj \
- $(SLO)$/fillbitmapattribute.obj \
- $(SLO)$/fontattribute.obj \
- $(SLO)$/materialattribute3d.obj \
- $(SLO)$/sdrallattribute3d.obj \
- $(SLO)$/sdrattribute.obj \
- $(SLO)$/sdrattribute3d.obj \
- $(SLO)$/sdrfillbitmapattribute.obj \
- $(SLO)$/lineattribute.obj \
- $(SLO)$/linestartendattribute.obj \
+ $(SLO)$/fillgradientattribute.obj \
+ $(SLO)$/fillhatchattribute.obj \
+ $(SLO)$/fillbitmapattribute.obj \
+ $(SLO)$/fontattribute.obj \
+ $(SLO)$/materialattribute3d.obj \
+ $(SLO)$/sdrallattribute3d.obj \
+ $(SLO)$/sdrlineattribute.obj \
+ $(SLO)$/sdrlinestartendattribute.obj \
+ $(SLO)$/sdrshadowattribute.obj \
+ $(SLO)$/sdrfillattribute.obj \
+ $(SLO)$/sdrobjectattribute3d.obj \
+ $(SLO)$/sdrlightattribute3d.obj \
+ $(SLO)$/sdrlightingattribute3d.obj \
+ $(SLO)$/sdrsceneattribute3d.obj \
+ $(SLO)$/sdrfillbitmapattribute.obj \
+ $(SLO)$/lineattribute.obj \
+ $(SLO)$/linestartendattribute.obj \
$(SLO)$/strokeattribute.obj
# --- Targets ----------------------------------
diff --git a/drawinglayer/source/attribute/materialattribute3d.cxx b/drawinglayer/source/attribute/materialattribute3d.cxx
index fefec06829..615a951d67 100644
--- a/drawinglayer/source/attribute/materialattribute3d.cxx
+++ b/drawinglayer/source/attribute/materialattribute3d.cxx
@@ -40,74 +40,87 @@ namespace drawinglayer
class ImpMaterialAttribute3D
{
public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
// materialAttribute3D definitions
basegfx::BColor maColor; // object color
basegfx::BColor maSpecular; // material specular color
basegfx::BColor maEmission; // material emissive color
- sal_uInt16 mnSpecularIntensity; // material specular intensity [0..128]
-
- // refcounter
- sal_uInt32 mnRefCount;
+ sal_uInt16 mnSpecularIntensity; // material specular intensity [0..128]
ImpMaterialAttribute3D(const basegfx::BColor& rColor, const basegfx::BColor& rSpecular, const basegfx::BColor& rEmission, sal_uInt16 nSpecularIntensity)
- : maColor(rColor),
+ : mnRefCount(0),
+ maColor(rColor),
maSpecular(rSpecular),
maEmission(rEmission),
- mnSpecularIntensity(nSpecularIntensity),
- mnRefCount(0L)
+ mnSpecularIntensity(nSpecularIntensity)
{
}
ImpMaterialAttribute3D(const basegfx::BColor& rColor)
- : maColor(rColor),
+ : mnRefCount(0),
+ maColor(rColor),
maSpecular(1.0, 1.0, 1.0),
maEmission(),
- mnSpecularIntensity(15),
- mnRefCount(0L)
+ mnSpecularIntensity(15)
{
}
- ImpMaterialAttribute3D()
- : mnSpecularIntensity(0),
- mnRefCount(0L)
- {
- }
+ // data read access
+ const basegfx::BColor& getColor() const { return maColor; }
+ const basegfx::BColor& getSpecular() const { return maSpecular; }
+ const basegfx::BColor& getEmission() const { return maEmission; }
+ sal_uInt16 getSpecularIntensity() const { return mnSpecularIntensity; }
bool operator==(const ImpMaterialAttribute3D& rCandidate) const
{
- return (maColor == rCandidate.maColor
- && maSpecular == rCandidate.maSpecular
- && maEmission == rCandidate.maEmission
- && mnSpecularIntensity == rCandidate.mnSpecularIntensity);
+ return (getColor() == rCandidate.getColor()
+ && getSpecular() == rCandidate.getSpecular()
+ && getEmission() == rCandidate.getEmission()
+ && getSpecularIntensity() == rCandidate.getSpecularIntensity());
}
- const basegfx::BColor& getColor() const { return maColor; }
- const basegfx::BColor& getSpecular() const { return maSpecular; }
- const basegfx::BColor& getEmission() const { return maEmission; }
- sal_uInt16 getSpecularIntensity() const { return mnSpecularIntensity; }
- };
- } // end of anonymous namespace
-} // end of namespace drawinglayer
+ static ImpMaterialAttribute3D* get_global_default()
+ {
+ static ImpMaterialAttribute3D* pDefault = 0;
-//////////////////////////////////////////////////////////////////////////////
+ if(!pDefault)
+ {
+ pDefault = new ImpMaterialAttribute3D(
+ basegfx::BColor(),
+ basegfx::BColor(),
+ basegfx::BColor(),
+ 0);
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
-namespace drawinglayer
-{
- namespace attribute
- {
- MaterialAttribute3D::MaterialAttribute3D(const basegfx::BColor& rColor, const basegfx::BColor& rSpecular, const basegfx::BColor& rEmission, sal_uInt16 nSpecularIntensity)
- : mpMaterialAttribute3D(new ImpMaterialAttribute3D(rColor, rSpecular, rEmission, nSpecularIntensity))
+ return pDefault;
+ }
+ };
+
+ MaterialAttribute3D::MaterialAttribute3D(
+ const basegfx::BColor& rColor,
+ const basegfx::BColor& rSpecular,
+ const basegfx::BColor& rEmission,
+ sal_uInt16 nSpecularIntensity)
+ : mpMaterialAttribute3D(new ImpMaterialAttribute3D(
+ rColor, rSpecular, rEmission, nSpecularIntensity))
{
}
- MaterialAttribute3D::MaterialAttribute3D(const basegfx::BColor& rColor)
+ MaterialAttribute3D::MaterialAttribute3D(
+ const basegfx::BColor& rColor)
: mpMaterialAttribute3D(new ImpMaterialAttribute3D(rColor))
{
}
MaterialAttribute3D::MaterialAttribute3D()
- : mpMaterialAttribute3D(new ImpMaterialAttribute3D())
+ : mpMaterialAttribute3D(ImpMaterialAttribute3D::get_global_default())
{
+ mpMaterialAttribute3D->mnRefCount++;
}
MaterialAttribute3D::MaterialAttribute3D(const MaterialAttribute3D& rCandidate)
@@ -128,6 +141,11 @@ namespace drawinglayer
}
}
+ bool MaterialAttribute3D::isDefault() const
+ {
+ return mpMaterialAttribute3D == ImpMaterialAttribute3D::get_global_default();
+ }
+
MaterialAttribute3D& MaterialAttribute3D::operator=(const MaterialAttribute3D& rCandidate)
{
if(rCandidate.mpMaterialAttribute3D != mpMaterialAttribute3D)
@@ -155,6 +173,11 @@ namespace drawinglayer
return true;
}
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
return (*rCandidate.mpMaterialAttribute3D == *mpMaterialAttribute3D);
}
diff --git a/drawinglayer/source/attribute/sdrallattribute3d.cxx b/drawinglayer/source/attribute/sdrallattribute3d.cxx
index e7838f2a4b..ca8cb2d679 100644
--- a/drawinglayer/source/attribute/sdrallattribute3d.cxx
+++ b/drawinglayer/source/attribute/sdrallattribute3d.cxx
@@ -29,12 +29,6 @@
#include "precompiled_drawinglayer.hxx"
#include <drawinglayer/attribute/sdrallattribute3d.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
-#include <drawinglayer/attribute/fillattribute.hxx>
-
-//////////////////////////////////////////////////////////////////////////////
-// pointer compare define
-#define pointerOrContentEqual(p, q) ((p == q) || (p && q && *p == *q))
//////////////////////////////////////////////////////////////////////////////
@@ -42,150 +36,47 @@ namespace drawinglayer
{
namespace attribute
{
- SdrLineFillShadowAttribute::SdrLineFillShadowAttribute(
- SdrLineAttribute* pLine,
- SdrFillAttribute* pFill,
- SdrLineStartEndAttribute* pLineStartEnd,
- SdrShadowAttribute* pShadow,
- FillGradientAttribute* pFillFloatTransGradient)
- : mpShadow(pShadow),
- mpLine(pLine),
- mpLineStartEnd(pLineStartEnd),
- mpFill(pFill),
- mpFillFloatTransGradient(pFillFloatTransGradient)
+ SdrLineFillShadowAttribute3D::SdrLineFillShadowAttribute3D(
+ const SdrLineAttribute& rLine,
+ const SdrFillAttribute& rFill,
+ const SdrLineStartEndAttribute& rLineStartEnd,
+ const SdrShadowAttribute& rShadow,
+ const FillGradientAttribute& rFillFloatTransGradient)
+ : maLine(rLine),
+ maFill(rFill),
+ maLineStartEnd(rLineStartEnd),
+ maShadow(rShadow),
+ maFillFloatTransGradient(rFillFloatTransGradient)
{
}
- SdrLineFillShadowAttribute::SdrLineFillShadowAttribute(
- const SdrLineFillShadowAttribute& rCandidate)
- : mpShadow(0),
- mpLine(0),
- mpLineStartEnd(0),
- mpFill(0),
- mpFillFloatTransGradient(0)
+ SdrLineFillShadowAttribute3D::SdrLineFillShadowAttribute3D()
+ : maLine(),
+ maFill(),
+ maLineStartEnd(),
+ maShadow(),
+ maFillFloatTransGradient()
{
- *this = rCandidate;
}
- SdrLineFillShadowAttribute::~SdrLineFillShadowAttribute()
+ bool SdrLineFillShadowAttribute3D::isDefault() const
{
- delete mpShadow;
- delete mpLine;
- delete mpLineStartEnd;
- delete mpFill;
- delete mpFillFloatTransGradient;
+ return(getLine().isDefault()
+ && getFill().isDefault()
+ && getLineStartEnd().isDefault()
+ && getShadow().isDefault()
+ && getFillFloatTransGradient().isDefault());
}
- SdrLineFillShadowAttribute& SdrLineFillShadowAttribute::operator=(const SdrLineFillShadowAttribute& rCandidate)
+ bool SdrLineFillShadowAttribute3D::operator==(const SdrLineFillShadowAttribute3D& rCandidate) const
{
- // handle mpShadow
- {
- // delete local mpShadow if necessary
- if(mpShadow)
- {
- delete mpShadow;
- mpShadow = 0;
- }
-
- // copy mpShadow if necessary
- if(rCandidate.mpShadow)
- {
- mpShadow = new SdrShadowAttribute(*rCandidate.mpShadow);
- }
- }
-
- // handle mpLine
- {
- // delete local mpLine if necessary
- if(mpLine)
- {
- delete mpLine;
- mpLine = 0;
- }
-
- // copy mpLine if necessary
- if(rCandidate.mpLine)
- {
- mpLine = new SdrLineAttribute(*rCandidate.mpLine);
- }
- }
-
- // handle mpLineStartEnd
- {
- // delete local mpLineStartEnd if necessary
- if(mpLineStartEnd)
- {
- delete mpLineStartEnd;
- mpLineStartEnd = 0;
- }
-
- // copy mpLineStartEnd if necessary
- if(rCandidate.mpLineStartEnd)
- {
- mpLineStartEnd = new SdrLineStartEndAttribute(*rCandidate.mpLineStartEnd);
- }
- }
-
- // handle mpFill
- {
- // delete local mpFill if necessary
- if(mpFill)
- {
- delete mpFill;
- mpFill = 0;
- }
-
- // copy mpFill if necessary
- if(rCandidate.mpFill)
- {
- mpFill = new SdrFillAttribute(*rCandidate.mpFill);
- }
- }
-
- // handle mpFillFloatTransGradient
- {
- // delete local mpFillFloatTransGradient if necessary
- if(mpFillFloatTransGradient)
- {
- delete mpFillFloatTransGradient;
- mpFillFloatTransGradient = 0;
- }
-
- // copy mpFillFloatTransGradient if necessary
- if(rCandidate.mpFillFloatTransGradient)
- {
- mpFillFloatTransGradient = new FillGradientAttribute(*rCandidate.mpFillFloatTransGradient);
- }
- }
-
- return *this;
- }
-
- bool SdrLineFillShadowAttribute::operator==(const SdrLineFillShadowAttribute& rCandidate) const
- {
- // handle mpShadow
- if(!pointerOrContentEqual(mpShadow, rCandidate.mpShadow))
- return false;
-
- // handle mpLine
- if(!pointerOrContentEqual(mpLine, rCandidate.mpLine))
- return false;
-
- // handle mpLineStartEnd
- if(!pointerOrContentEqual(mpLineStartEnd, rCandidate.mpLineStartEnd))
- return false;
-
- // handle mpFill
- if(!pointerOrContentEqual(mpFill, rCandidate.mpFill))
- return false;
-
- // handle mpFillFloatTransGradient
- if(!pointerOrContentEqual(mpFillFloatTransGradient, rCandidate.mpFillFloatTransGradient))
- return false;
-
- return true;
+ return(getLine() == rCandidate.getLine()
+ && getFill() == rCandidate.getFill()
+ && getLineStartEnd() == rCandidate.getLineStartEnd()
+ && getShadow() == rCandidate.getShadow()
+ && getFillFloatTransGradient() == rCandidate.getFillFloatTransGradient());
}
- } // end of namespace attribute
+ } // end of namespace overlay
} // end of namespace drawinglayer
//////////////////////////////////////////////////////////////////////////////
diff --git a/drawinglayer/source/attribute/sdrattribute.cxx b/drawinglayer/source/attribute/sdrattribute.cxx
deleted file mode 100644
index b33c8176ca..0000000000
--- a/drawinglayer/source/attribute/sdrattribute.cxx
+++ /dev/null
@@ -1,285 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General 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_drawinglayer.hxx"
-
-#include <drawinglayer/attribute/sdrattribute.hxx>
-#include <drawinglayer/attribute/fillattribute.hxx>
-#include <drawinglayer/attribute/sdrfillbitmapattribute.hxx>
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- SdrLineAttribute::SdrLineAttribute(
- basegfx::B2DLineJoin eJoin, double fWidth, double fTransparence, const basegfx::BColor& rColor,
- const ::std::vector< double >& rDotDashArray, double fFullDotDashLen)
- : meJoin(eJoin),
- mfWidth(fWidth),
- mfTransparence(fTransparence),
- maColor(rColor),
- maDotDashArray(rDotDashArray),
- mfFullDotDashLen(fFullDotDashLen)
- {
- }
-
- SdrLineAttribute::SdrLineAttribute(const basegfx::BColor& rColor)
- : meJoin(basegfx::B2DLINEJOIN_NONE),
- mfWidth(0.0),
- mfTransparence(0.0),
- maColor(rColor),
- maDotDashArray(),
- mfFullDotDashLen(0.0)
- {
- }
-
- SdrLineAttribute::~SdrLineAttribute()
- {
- }
-
- bool SdrLineAttribute::operator==(const SdrLineAttribute& rCandidate) const
- {
- return (meJoin == rCandidate.meJoin
- && mfWidth == rCandidate.mfWidth
- && mfTransparence == rCandidate.mfTransparence
- && maColor == rCandidate.maColor
- && maDotDashArray == rCandidate.maDotDashArray);
- }
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- SdrLineStartEndAttribute::SdrLineStartEndAttribute(
- const basegfx::B2DPolyPolygon& rStartPolyPolygon, const basegfx::B2DPolyPolygon& rEndPolyPolygon,
- double fStartWidth, double fEndWidth, bool bStartActive, bool bEndActive, bool bStartCentered, bool bEndCentered)
- : maStartPolyPolygon(rStartPolyPolygon),
- maEndPolyPolygon(rEndPolyPolygon),
- mfStartWidth(fStartWidth),
- mfEndWidth(fEndWidth),
- mbStartActive(bStartActive),
- mbEndActive(bEndActive),
- mbStartCentered(bStartCentered),
- mbEndCentered(bEndCentered)
- {
- }
-
- SdrLineStartEndAttribute::~SdrLineStartEndAttribute()
- {
- }
-
- bool SdrLineStartEndAttribute::operator==(const SdrLineStartEndAttribute& rCandidate) const
- {
- return (mbStartActive == rCandidate.mbStartActive
- && mbEndActive == rCandidate.mbEndActive
- && mbStartCentered == rCandidate.mbStartCentered
- && mbEndCentered == rCandidate.mbEndCentered
- && mfStartWidth == rCandidate.mfStartWidth
- && mfEndWidth == rCandidate.mfEndWidth
- && maStartPolyPolygon == rCandidate.maStartPolyPolygon
- && maEndPolyPolygon == rCandidate.maEndPolyPolygon);
- }
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- SdrShadowAttribute::SdrShadowAttribute(const basegfx::B2DVector& rOffset, double fTransparence, const basegfx::BColor& rColor)
- : maOffset(rOffset),
- mfTransparence(fTransparence),
- maColor(rColor)
- {
- }
-
- SdrShadowAttribute::~SdrShadowAttribute()
- {
- }
-
- bool SdrShadowAttribute::operator==(const SdrShadowAttribute& rCandidate) const
- {
- return (mfTransparence == rCandidate.mfTransparence
- && maColor == rCandidate.maColor
- && maOffset == rCandidate.maOffset);
- }
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- SdrFillAttribute::SdrFillAttribute(
- double fTransparence,
- const basegfx::BColor& rColor,
- FillGradientAttribute* pGradient,
- FillHatchAttribute* pHatch,
- SdrFillBitmapAttribute* pBitmap)
- : mfTransparence(fTransparence),
- maColor(rColor),
- mpGradient(pGradient),
- mpHatch(pHatch),
- mpBitmap(pBitmap)
- {
- }
-
- SdrFillAttribute::SdrFillAttribute(const SdrFillAttribute& rCandidate)
- : mfTransparence(1.0),
- mpGradient(0L),
- mpHatch(0L),
- mpBitmap(0L)
- {
- if(!(*this == rCandidate))
- {
- *this = rCandidate;
- }
- }
-
- SdrFillAttribute::~SdrFillAttribute()
- {
- delete mpGradient;
- delete mpHatch;
- delete mpBitmap;
- }
-
- SdrFillAttribute& SdrFillAttribute::operator=(const SdrFillAttribute& rCandidate)
- {
- // copy data
- mfTransparence = rCandidate.mfTransparence;
- maColor = rCandidate.maColor;
-
- // handle mpGradient
- {
- // delete local mpGradient if necessary
- if(mpGradient && ((!rCandidate.mpGradient) || (!(*mpGradient == *rCandidate.mpGradient))))
- {
- delete mpGradient;
- mpGradient = 0L;
- }
-
- // copy mpGradient if necessary
- if(!mpGradient && rCandidate.mpGradient)
- {
- mpGradient = new FillGradientAttribute(*rCandidate.mpGradient);
- }
- }
-
- // handle mpHatch
- {
- // delete local mpHatch if necessary
- if(mpHatch && ((!rCandidate.mpHatch) || (!(*mpHatch == *rCandidate.mpHatch))))
- {
- delete mpHatch;
- mpHatch = 0L;
- }
-
- // copy mpHatch if necessary
- if(!mpHatch && rCandidate.mpHatch)
- {
- mpHatch = new FillHatchAttribute(*rCandidate.mpHatch);
- }
- }
-
- // handle mpBitmap
- {
- // delete local mpBitmap if necessary
- if(mpBitmap && ((!rCandidate.mpBitmap) || (!(*mpBitmap == *rCandidate.mpBitmap))))
- {
- delete mpBitmap;
- mpBitmap = 0L;
- }
-
- // copy mpBitmap if necessary
- if(!mpBitmap && rCandidate.mpBitmap)
- {
- mpBitmap = new SdrFillBitmapAttribute(*rCandidate.mpBitmap);
- }
- }
-
- return *this;
- }
-
- bool SdrFillAttribute::operator==(const SdrFillAttribute& rCandidate) const
- {
- if(mfTransparence != rCandidate.mfTransparence)
- return false;
-
- if(mpGradient)
- {
- if(!rCandidate.mpGradient)
- return false;
-
- if(!(*mpGradient == *rCandidate.mpGradient))
- return false;
- }
- else if(mpHatch)
- {
- if(!rCandidate.mpHatch)
- return false;
-
- if(!(*mpHatch == *rCandidate.mpHatch))
- return false;
-
- if(mpHatch->isFillBackground() && !(maColor == rCandidate.maColor))
- return false;
- }
- else if(mpBitmap)
- {
- if(!rCandidate.mpBitmap)
- return false;
-
- if(!(*mpBitmap == *rCandidate.mpBitmap))
- return false;
- }
- else
- {
- if(!rCandidate.isColor())
- return false;
-
- if(!(maColor == rCandidate.maColor))
- return false;
- }
-
- return true;
- }
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-// eof
diff --git a/drawinglayer/source/attribute/sdrattribute3d.cxx b/drawinglayer/source/attribute/sdrattribute3d.cxx
deleted file mode 100644
index f85892c9c0..0000000000
--- a/drawinglayer/source/attribute/sdrattribute3d.cxx
+++ /dev/null
@@ -1,211 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General 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_drawinglayer.hxx"
-
-#include <drawinglayer/attribute/sdrattribute3d.hxx>
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- Sdr3DObjectAttribute::Sdr3DObjectAttribute(
- ::com::sun::star::drawing::NormalsKind aNormalsKind,
- ::com::sun::star::drawing::TextureProjectionMode aTextureProjectionX,
- ::com::sun::star::drawing::TextureProjectionMode aTextureProjectionY,
- ::com::sun::star::drawing::TextureKind2 aTextureKind,
- ::com::sun::star::drawing::TextureMode aTextureMode,
- const MaterialAttribute3D& rMaterial,
- bool bNormalsInvert,
- bool bDoubleSided,
- bool bShadow3D,
- bool bTextureFilter,
- bool bReducedLineGeometry)
- : maNormalsKind(aNormalsKind),
- maTextureProjectionX(aTextureProjectionX),
- maTextureProjectionY(aTextureProjectionY),
- maTextureKind(aTextureKind),
- maTextureMode(aTextureMode),
- maMaterial(rMaterial),
- mbNormalsInvert(bNormalsInvert),
- mbDoubleSided(bDoubleSided),
- mbShadow3D(bShadow3D),
- mbTextureFilter(bTextureFilter),
- mbReducedLineGeometry(bReducedLineGeometry)
- {
- }
-
- bool Sdr3DObjectAttribute::operator==(const Sdr3DObjectAttribute& rCandidate) const
- {
- return (maNormalsKind == rCandidate.maNormalsKind
- && maTextureProjectionX == rCandidate.maTextureProjectionX
- && maTextureProjectionY == rCandidate.maTextureProjectionY
- && maTextureKind == rCandidate.maTextureKind
- && maTextureMode == rCandidate.maTextureMode
- && maMaterial == rCandidate.maMaterial
- && mbNormalsInvert == rCandidate.mbNormalsInvert
- && mbDoubleSided == rCandidate.mbDoubleSided
- && mbShadow3D == rCandidate.mbShadow3D
- && mbTextureFilter == rCandidate.mbTextureFilter
- && mbReducedLineGeometry == rCandidate.mbReducedLineGeometry);
- }
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- Sdr3DLightAttribute::Sdr3DLightAttribute(const basegfx::BColor& rColor, const basegfx::B3DVector& rDirection, bool bSpecular)
- : maColor(rColor),
- maDirection(rDirection),
- mbSpecular(bSpecular)
- {
- }
-
- bool Sdr3DLightAttribute::operator==(const Sdr3DLightAttribute& rCandidate) const
- {
- return (maColor == rCandidate.maColor
- && maDirection == rCandidate.maDirection
- && mbSpecular == rCandidate.mbSpecular);
- }
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- SdrLightingAttribute::SdrLightingAttribute(
- const basegfx::BColor& rAmbientLight,
- const ::std::vector< Sdr3DLightAttribute >& rLightVector)
- : maAmbientLight(rAmbientLight),
- maLightVector(rLightVector)
- {
- }
-
- bool SdrLightingAttribute::operator==(const SdrLightingAttribute& rCandidate) const
- {
- return (maAmbientLight == rCandidate.maAmbientLight
- && maLightVector == rCandidate.maLightVector);
- }
-
- // color model solver
- basegfx::BColor SdrLightingAttribute::solveColorModel(
- const basegfx::B3DVector& rNormalInEyeCoordinates,
- const basegfx::BColor& rColor, const basegfx::BColor& rSpecular,
- const basegfx::BColor& rEmission, sal_uInt16 nSpecularIntensity) const
- {
- // initialize with emissive color
- basegfx::BColor aRetval(rEmission);
-
- // take care of global ambient light
- aRetval += getAmbientLight() * rColor;
-
- // prepare light access. Is there a light?
- const sal_uInt32 nLightCount(maLightVector.size());
-
- if(nLightCount && !rNormalInEyeCoordinates.equalZero())
- {
- // prepare normal
- basegfx::B3DVector aEyeNormal(rNormalInEyeCoordinates);
- aEyeNormal.normalize();
-
- for(sal_uInt32 a(0L); a < nLightCount; a++)
- {
- const Sdr3DLightAttribute& rLight(maLightVector[a]);
- const double fCosFac(rLight.getDirection().scalar(aEyeNormal));
-
- if(basegfx::fTools::more(fCosFac, 0.0))
- {
- aRetval += ((rLight.getColor() * rColor) * fCosFac);
-
- if(rLight.getSpecular())
- {
- // expand by (0.0, 0.0, 1.0) in Z
- basegfx::B3DVector aSpecularNormal(rLight.getDirection().getX(), rLight.getDirection().getY(), rLight.getDirection().getZ() + 1.0);
- aSpecularNormal.normalize();
- double fCosFac2(aSpecularNormal.scalar(aEyeNormal));
-
- if(basegfx::fTools::more(fCosFac2, 0.0))
- {
- fCosFac2 = pow(fCosFac2, (double)nSpecularIntensity);
- aRetval += (rSpecular * fCosFac2);
- }
- }
- }
- }
- }
-
- // clamp to color space before usage
- aRetval.clamp();
-
- return aRetval;
- }
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- SdrSceneAttribute::SdrSceneAttribute(
- double fDistance,
- double fShadowSlant,
- ::com::sun::star::drawing::ProjectionMode aProjectionMode,
- ::com::sun::star::drawing::ShadeMode aShadeMode,
- bool bTwoSidedLighting)
- : mfDistance(fDistance),
- mfShadowSlant(fShadowSlant),
- maProjectionMode(aProjectionMode),
- maShadeMode(aShadeMode),
- mbTwoSidedLighting(bTwoSidedLighting)
- {
- }
-
- bool SdrSceneAttribute::operator==(const SdrSceneAttribute& rCandidate) const
- {
- return (mfDistance == rCandidate.mfDistance
- && mfShadowSlant == rCandidate.mfShadowSlant
- && maProjectionMode == rCandidate.maProjectionMode
- && maShadeMode == rCandidate.maShadeMode
- && mbTwoSidedLighting == rCandidate.mbTwoSidedLighting);
- }
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-// eof
diff --git a/drawinglayer/source/attribute/sdrfillattribute.cxx b/drawinglayer/source/attribute/sdrfillattribute.cxx
new file mode 100644
index 0000000000..1953a1d292
--- /dev/null
+++ b/drawinglayer/source/attribute/sdrfillattribute.cxx
@@ -0,0 +1,221 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrattribute.cxx,v $
+ *
+ * $Revision: 1.5 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:19 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_drawinglayer.hxx"
+
+#include <drawinglayer/attribute/sdrfillattribute.hxx>
+#include <basegfx/color/bcolor.hxx>
+#include <drawinglayer/attribute/sdrfillbitmapattribute.hxx>
+#include <drawinglayer/attribute/fillhatchattribute.hxx>
+#include <drawinglayer/attribute/fillgradientattribute.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class ImpSdrFillAttribute
+ {
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ // fill definitions
+ double mfTransparence; // [0.0 .. 1.0], 0.0==no transp.
+ basegfx::BColor maColor; // fill color
+ FillGradientAttribute maGradient; // fill gradient (if used)
+ FillHatchAttribute maHatch; // fill hatch (if used)
+ SdrFillBitmapAttribute maBitmap; // fill bitmap (if used)
+
+ public:
+ ImpSdrFillAttribute(
+ double fTransparence,
+ const basegfx::BColor& rColor,
+ const FillGradientAttribute& rGradient,
+ const FillHatchAttribute& rHatch,
+ const SdrFillBitmapAttribute& rBitmap)
+ : mnRefCount(0),
+ mfTransparence(fTransparence),
+ maColor(rColor),
+ maGradient(rGradient),
+ maHatch(rHatch),
+ maBitmap(rBitmap)
+ {
+ }
+
+ // data read access
+ double getTransparence() const { return mfTransparence; }
+ const basegfx::BColor& getColor() const { return maColor; }
+ const FillGradientAttribute& getGradient() const { return maGradient; }
+ const FillHatchAttribute& getHatch() const { return maHatch; }
+ const SdrFillBitmapAttribute& getBitmap() const { return maBitmap; }
+
+ // compare operator
+ bool operator==(const ImpSdrFillAttribute& rCandidate) const
+ {
+ return(getTransparence() == rCandidate.getTransparence()
+ && getColor() == rCandidate.getColor()
+ && getGradient() == rCandidate.getGradient()
+ && getHatch() == rCandidate.getHatch()
+ && getBitmap() == rCandidate.getBitmap());
+ }
+
+ static ImpSdrFillAttribute* get_global_default()
+ {
+ static ImpSdrFillAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpSdrFillAttribute(
+ 0.0,
+ basegfx::BColor(),
+ FillGradientAttribute(),
+ FillHatchAttribute(),
+ SdrFillBitmapAttribute());
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
+ };
+
+ SdrFillAttribute::SdrFillAttribute(
+ double fTransparence,
+ const basegfx::BColor& rColor,
+ const FillGradientAttribute& rGradient,
+ const FillHatchAttribute& rHatch,
+ const SdrFillBitmapAttribute& rBitmap)
+ : mpSdrFillAttribute(new ImpSdrFillAttribute(
+ fTransparence, rColor, rGradient, rHatch, rBitmap))
+ {
+ }
+
+ SdrFillAttribute::SdrFillAttribute()
+ : mpSdrFillAttribute(ImpSdrFillAttribute::get_global_default())
+ {
+ mpSdrFillAttribute->mnRefCount++;
+ }
+
+ SdrFillAttribute::SdrFillAttribute(const SdrFillAttribute& rCandidate)
+ : mpSdrFillAttribute(rCandidate.mpSdrFillAttribute)
+ {
+ mpSdrFillAttribute->mnRefCount++;
+ }
+
+ SdrFillAttribute::~SdrFillAttribute()
+ {
+ if(mpSdrFillAttribute->mnRefCount)
+ {
+ mpSdrFillAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrFillAttribute;
+ }
+ }
+
+ bool SdrFillAttribute::isDefault() const
+ {
+ return mpSdrFillAttribute == ImpSdrFillAttribute::get_global_default();
+ }
+
+ SdrFillAttribute& SdrFillAttribute::operator=(const SdrFillAttribute& rCandidate)
+ {
+ if(rCandidate.mpSdrFillAttribute != mpSdrFillAttribute)
+ {
+ if(mpSdrFillAttribute->mnRefCount)
+ {
+ mpSdrFillAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrFillAttribute;
+ }
+
+ mpSdrFillAttribute = rCandidate.mpSdrFillAttribute;
+ mpSdrFillAttribute->mnRefCount++;
+ }
+
+ return *this;
+ }
+
+ bool SdrFillAttribute::operator==(const SdrFillAttribute& rCandidate) const
+ {
+ if(rCandidate.mpSdrFillAttribute == mpSdrFillAttribute)
+ {
+ return true;
+ }
+
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
+ return (*rCandidate.mpSdrFillAttribute == *mpSdrFillAttribute);
+ }
+
+ double SdrFillAttribute::getTransparence() const
+ {
+ return mpSdrFillAttribute->getTransparence();
+ }
+
+ const basegfx::BColor& SdrFillAttribute::getColor() const
+ {
+ return mpSdrFillAttribute->getColor();
+ }
+
+ const FillGradientAttribute& SdrFillAttribute::getGradient() const
+ {
+ return mpSdrFillAttribute->getGradient();
+ }
+
+ const FillHatchAttribute& SdrFillAttribute::getHatch() const
+ {
+ return mpSdrFillAttribute->getHatch();
+ }
+
+ const SdrFillBitmapAttribute& SdrFillAttribute::getBitmap() const
+ {
+ return mpSdrFillAttribute->getBitmap();
+ }
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/attribute/sdrfillbitmapattribute.cxx b/drawinglayer/source/attribute/sdrfillbitmapattribute.cxx
index f177345342..7614e83c12 100644
--- a/drawinglayer/source/attribute/sdrfillbitmapattribute.cxx
+++ b/drawinglayer/source/attribute/sdrfillbitmapattribute.cxx
@@ -30,8 +30,7 @@
#include <drawinglayer/attribute/sdrfillbitmapattribute.hxx>
#include <drawinglayer/attribute/fillbitmapattribute.hxx>
-#include <basegfx/numeric/ftools.hxx>
-#include <basegfx/range/b2drange.hxx>
+#include <vcl/bitmapex.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -39,37 +38,213 @@ namespace drawinglayer
{
namespace attribute
{
+ class ImpSdrFillBitmapAttribute
+ {
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ // data definitions
+ Bitmap maBitmap;
+ basegfx::B2DVector maSize;
+ basegfx::B2DVector maOffset;
+ basegfx::B2DVector maOffsetPosition;
+ basegfx::B2DVector maRectPoint;
+
+ // bitfield
+ unsigned mbTiling : 1;
+ unsigned mbStretch : 1;
+ unsigned mbLogSize : 1;
+
+ ImpSdrFillBitmapAttribute(
+ const Bitmap& rBitmap,
+ const basegfx::B2DVector& rSize,
+ const basegfx::B2DVector& rOffset,
+ const basegfx::B2DVector& rOffsetPosition,
+ const basegfx::B2DVector& rRectPoint,
+ bool bTiling,
+ bool bStretch,
+ bool bLogSize)
+ : mnRefCount(0),
+ maBitmap(rBitmap),
+ maSize(rSize),
+ maOffset(rOffset),
+ maOffsetPosition(rOffsetPosition),
+ maRectPoint(rRectPoint),
+ mbTiling(bTiling),
+ mbStretch(bStretch),
+ mbLogSize(bLogSize)
+ {
+ }
+
+ // data read access
+ const Bitmap& getBitmap() const { return maBitmap; }
+ const basegfx::B2DVector& getSize() const { return maSize; }
+ const basegfx::B2DVector& getOffset() const { return maOffset; }
+ const basegfx::B2DVector& getOffsetPosition() const { return maOffsetPosition; }
+ const basegfx::B2DVector& getRectPoint() const { return maRectPoint; }
+ bool getTiling() const { return mbTiling; }
+ bool getStretch() const { return mbStretch; }
+ bool getLogSize() const { return mbLogSize; }
+
+ bool operator==(const ImpSdrFillBitmapAttribute& rCandidate) const
+ {
+ return (getBitmap() == rCandidate.getBitmap()
+ && getSize() == rCandidate.getSize()
+ && getOffset() == rCandidate.getOffset()
+ && getOffsetPosition() == rCandidate.getOffsetPosition()
+ && getRectPoint() == rCandidate.getRectPoint()
+ && getTiling() == rCandidate.getTiling()
+ && getStretch() == rCandidate.getStretch()
+ && getLogSize() == rCandidate.getLogSize());
+ }
+
+ static ImpSdrFillBitmapAttribute* get_global_default()
+ {
+ static ImpSdrFillBitmapAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpSdrFillBitmapAttribute(
+ Bitmap(),
+ basegfx::B2DVector(),
+ basegfx::B2DVector(),
+ basegfx::B2DVector(),
+ basegfx::B2DVector(),
+ false,
+ false,
+ false);
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
+ };
+
SdrFillBitmapAttribute::SdrFillBitmapAttribute(
- const Bitmap& rBitmap, const basegfx::B2DVector& rSize, const basegfx::B2DVector& rOffset,
- const basegfx::B2DVector& rOffsetPosition, const basegfx::B2DVector& rRectPoint,
- bool bTiling, bool bStretch, bool bLogSize)
- : maBitmap(rBitmap),
- maSize(rSize),
- maOffset(rOffset),
- maOffsetPosition(rOffsetPosition),
- maRectPoint(rRectPoint),
- mbTiling(bTiling),
- mbStretch(bStretch),
- mbLogSize(bLogSize)
+ const Bitmap& rBitmap,
+ const basegfx::B2DVector& rSize,
+ const basegfx::B2DVector& rOffset,
+ const basegfx::B2DVector& rOffsetPosition,
+ const basegfx::B2DVector& rRectPoint,
+ bool bTiling,
+ bool bStretch,
+ bool bLogSize)
+ : mpSdrFillBitmapAttribute(new ImpSdrFillBitmapAttribute(
+ rBitmap, rSize, rOffset, rOffsetPosition, rRectPoint, bTiling, bStretch, bLogSize))
+ {
+ }
+
+ SdrFillBitmapAttribute::SdrFillBitmapAttribute()
+ : mpSdrFillBitmapAttribute(ImpSdrFillBitmapAttribute::get_global_default())
+ {
+ mpSdrFillBitmapAttribute->mnRefCount++;
+ }
+
+ SdrFillBitmapAttribute::SdrFillBitmapAttribute(const SdrFillBitmapAttribute& rCandidate)
+ : mpSdrFillBitmapAttribute(rCandidate.mpSdrFillBitmapAttribute)
+ {
+ mpSdrFillBitmapAttribute->mnRefCount++;
+ }
+
+ SdrFillBitmapAttribute::~SdrFillBitmapAttribute()
+ {
+ if(mpSdrFillBitmapAttribute->mnRefCount)
+ {
+ mpSdrFillBitmapAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrFillBitmapAttribute;
+ }
+ }
+
+ bool SdrFillBitmapAttribute::isDefault() const
{
+ return mpSdrFillBitmapAttribute == ImpSdrFillBitmapAttribute::get_global_default();
+ }
+
+ SdrFillBitmapAttribute& SdrFillBitmapAttribute::operator=(const SdrFillBitmapAttribute& rCandidate)
+ {
+ if(rCandidate.mpSdrFillBitmapAttribute != mpSdrFillBitmapAttribute)
+ {
+ if(mpSdrFillBitmapAttribute->mnRefCount)
+ {
+ mpSdrFillBitmapAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrFillBitmapAttribute;
+ }
+
+ mpSdrFillBitmapAttribute = rCandidate.mpSdrFillBitmapAttribute;
+ mpSdrFillBitmapAttribute->mnRefCount++;
+ }
+
+ return *this;
}
bool SdrFillBitmapAttribute::operator==(const SdrFillBitmapAttribute& rCandidate) const
{
- return (maBitmap == rCandidate.maBitmap
- && maSize == rCandidate.maSize
- && maOffset == rCandidate.maOffset
- && maOffsetPosition == rCandidate.maOffsetPosition
- && maRectPoint == rCandidate.maRectPoint
- && mbTiling == rCandidate.mbTiling
- && mbStretch == rCandidate.mbStretch
- && mbLogSize == rCandidate.mbLogSize);
+ if(rCandidate.mpSdrFillBitmapAttribute == mpSdrFillBitmapAttribute)
+ {
+ return true;
+ }
+
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
+ return (*rCandidate.mpSdrFillBitmapAttribute == *mpSdrFillBitmapAttribute);
+ }
+
+ const Bitmap& SdrFillBitmapAttribute::getBitmap() const
+ {
+ return mpSdrFillBitmapAttribute->getBitmap();
+ }
+
+ const basegfx::B2DVector& SdrFillBitmapAttribute::getSize() const
+ {
+ return mpSdrFillBitmapAttribute->getSize();
+ }
+
+ const basegfx::B2DVector& SdrFillBitmapAttribute::getOffset() const
+ {
+ return mpSdrFillBitmapAttribute->getOffset();
+ }
+
+ const basegfx::B2DVector& SdrFillBitmapAttribute::getOffsetPosition() const
+ {
+ return mpSdrFillBitmapAttribute->getOffsetPosition();
+ }
+
+ const basegfx::B2DVector& SdrFillBitmapAttribute::getRectPoint() const
+ {
+ return mpSdrFillBitmapAttribute->getRectPoint();
+ }
+
+ bool SdrFillBitmapAttribute::getTiling() const
+ {
+ return mpSdrFillBitmapAttribute->getTiling();
+ }
+
+ bool SdrFillBitmapAttribute::getStretch() const
+ {
+ return mpSdrFillBitmapAttribute->getStretch();
+ }
+
+ bool SdrFillBitmapAttribute::getLogSize() const
+ {
+ return mpSdrFillBitmapAttribute->getLogSize();
}
FillBitmapAttribute SdrFillBitmapAttribute::getFillBitmapAttribute(const basegfx::B2DRange& rRange) const
{
// get logical size of bitmap (before expanding eventually)
- Bitmap aBitmap(maBitmap);
+ Bitmap aBitmap(getBitmap());
const basegfx::B2DVector aLogicalSize(aBitmap.GetPrefSize().getWidth(), aBitmap.GetPrefSize().getHeight());
// get hor/ver shiftings and apply them eventually to the bitmap, but only
@@ -77,17 +252,17 @@ namespace drawinglayer
bool bExpandWidth(false);
bool bExpandHeight(false);
- if(mbTiling)
+ if(getTiling())
{
- if(0.0 != maOffset.getX() || 0.0 != maOffset.getY())
+ if(0.0 != getOffset().getX() || 0.0 != getOffset().getY())
{
const sal_uInt32 nWidth(aBitmap.GetSizePixel().getWidth());
const sal_uInt32 nHeight(aBitmap.GetSizePixel().getHeight());
- if(0.0 != maOffset.getX())
+ if(0.0 != getOffset().getX())
{
bExpandHeight = true;
- const sal_uInt32 nOffset(basegfx::fround(((double)nWidth * maOffset.getX()) / 100.0));
+ const sal_uInt32 nOffset(basegfx::fround(((double)nWidth * getOffset().getX()) / 100.0));
aBitmap.Expand(0L, nHeight);
const Size aSizeA(nOffset, nHeight);
@@ -103,7 +278,7 @@ namespace drawinglayer
else
{
bExpandWidth = true;
- const sal_uInt32 nOffset(basegfx::fround(((double)nHeight * maOffset.getY()) / 100.0));
+ const sal_uInt32 nOffset(basegfx::fround(((double)nHeight * getOffset().getY()) / 100.0));
aBitmap.Expand(nWidth, 0L);
const Size aSize(nWidth, nHeight);
@@ -129,7 +304,7 @@ namespace drawinglayer
basegfx::B2DVector aBitmapTopLeft(0.0, 0.0);
// are canges needed?
- if(mbTiling || !mbStretch)
+ if(getTiling() || !getStretch())
{
// init values with range sizes
const double fRangeWidth(0.0 != rRange.getWidth() ? rRange.getWidth() : 1.0);
@@ -137,15 +312,15 @@ namespace drawinglayer
aBitmapSize = basegfx::B2DPoint(fRangeWidth, fRangeHeight);
// size changes
- if(0.0 != maSize.getX())
+ if(0.0 != getSize().getX())
{
- if(maSize.getX() < 0.0)
+ if(getSize().getX() < 0.0)
{
- aBitmapSize.setX(aBitmapSize.getX() * (maSize.getX() * -0.01));
+ aBitmapSize.setX(aBitmapSize.getX() * (getSize().getX() * -0.01));
}
else
{
- aBitmapSize.setX(maSize.getX());
+ aBitmapSize.setX(getSize().getX());
}
}
else
@@ -153,15 +328,15 @@ namespace drawinglayer
aBitmapSize.setX(aLogicalSize.getX());
}
- if(0.0 != maSize.getY())
+ if(0.0 != getSize().getY())
{
- if(maSize.getY() < 0.0)
+ if(getSize().getY() < 0.0)
{
- aBitmapSize.setY(aBitmapSize.getY() * (maSize.getY() * -0.01));
+ aBitmapSize.setY(aBitmapSize.getY() * (getSize().getY() * -0.01));
}
else
{
- aBitmapSize.setY(maSize.getY());
+ aBitmapSize.setY(getSize().getY());
}
}
else
@@ -170,7 +345,7 @@ namespace drawinglayer
}
// get values, force to centered if necessary
- const basegfx::B2DVector aRectPoint(mbTiling ? maRectPoint : basegfx::B2DVector(0.0, 0.0));
+ const basegfx::B2DVector aRectPoint(getTiling() ? getRectPoint() : basegfx::B2DVector(0.0, 0.0));
// position changes X
if(0.0 == aRectPoint.getX())
@@ -182,9 +357,9 @@ namespace drawinglayer
aBitmapTopLeft.setX(fRangeWidth - aBitmapSize.getX());
}
- if(mbTiling && 0.0 != maOffsetPosition.getX())
+ if(getTiling() && 0.0 != getOffsetPosition().getX())
{
- aBitmapTopLeft.setX(aBitmapTopLeft.getX() + (aBitmapSize.getX() * (maOffsetPosition.getX() * 0.01)));
+ aBitmapTopLeft.setX(aBitmapTopLeft.getX() + (aBitmapSize.getX() * (getOffsetPosition().getX() * 0.01)));
}
// position changes Y
@@ -197,9 +372,9 @@ namespace drawinglayer
aBitmapTopLeft.setY(fRangeHeight - aBitmapSize.getY());
}
- if(mbTiling && 0.0 != maOffsetPosition.getY())
+ if(getTiling() && 0.0 != getOffsetPosition().getY())
{
- aBitmapTopLeft.setY(aBitmapTopLeft.getY() + (aBitmapSize.getY() * (maOffsetPosition.getY() * 0.01)));
+ aBitmapTopLeft.setY(aBitmapTopLeft.getY() + (aBitmapSize.getY() * (getOffsetPosition().getY() * 0.01)));
}
// apply expand
@@ -220,7 +395,7 @@ namespace drawinglayer
aBitmapSize.setY(aBitmapSize.getY() / fRangeHeight);
}
- return FillBitmapAttribute(BitmapEx(aBitmap), aBitmapTopLeft, aBitmapSize, mbTiling);
+ return FillBitmapAttribute(BitmapEx(aBitmap), aBitmapTopLeft, aBitmapSize, getTiling());
}
} // end of namespace attribute
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/attribute/sdrlightattribute3d.cxx b/drawinglayer/source/attribute/sdrlightattribute3d.cxx
new file mode 100644
index 0000000000..c54f3490b1
--- /dev/null
+++ b/drawinglayer/source/attribute/sdrlightattribute3d.cxx
@@ -0,0 +1,196 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrattribute3d.cxx,v $
+ *
+ * $Revision: 1.5 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:19 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_drawinglayer.hxx"
+
+#include <drawinglayer/attribute/sdrlightattribute3d.hxx>
+#include <basegfx/color/bcolor.hxx>
+#include <basegfx/vector/b3dvector.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class ImpSdr3DLightAttribute
+ {
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ // 3D light attribute definitions
+ basegfx::BColor maColor;
+ basegfx::B3DVector maDirection;
+
+ // bitfield
+ unsigned mbSpecular : 1;
+
+ ImpSdr3DLightAttribute(
+ const basegfx::BColor& rColor,
+ const basegfx::B3DVector& rDirection,
+ bool bSpecular)
+ : mnRefCount(0),
+ maColor(rColor),
+ maDirection(rDirection),
+ mbSpecular(bSpecular)
+ {
+ }
+
+ // data read access
+ const basegfx::BColor& getColor() const { return maColor; }
+ const basegfx::B3DVector& getDirection() const { return maDirection; }
+ bool getSpecular() const { return mbSpecular; }
+
+ bool operator==(const ImpSdr3DLightAttribute& rCandidate) const
+ {
+ return (getColor() == rCandidate.getColor()
+ && getDirection() == rCandidate.getDirection()
+ && getSpecular() == rCandidate.getSpecular());
+ }
+
+ static ImpSdr3DLightAttribute* get_global_default()
+ {
+ static ImpSdr3DLightAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpSdr3DLightAttribute(
+ basegfx::BColor(),
+ basegfx::B3DVector(),
+ false);
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
+ };
+
+ Sdr3DLightAttribute::Sdr3DLightAttribute(
+ const basegfx::BColor& rColor,
+ const basegfx::B3DVector& rDirection,
+ bool bSpecular)
+ : mpSdr3DLightAttribute(new ImpSdr3DLightAttribute(
+ rColor, rDirection, bSpecular))
+ {
+ }
+
+ Sdr3DLightAttribute::Sdr3DLightAttribute()
+ : mpSdr3DLightAttribute(ImpSdr3DLightAttribute::get_global_default())
+ {
+ mpSdr3DLightAttribute->mnRefCount++;
+ }
+
+ Sdr3DLightAttribute::Sdr3DLightAttribute(const Sdr3DLightAttribute& rCandidate)
+ : mpSdr3DLightAttribute(rCandidate.mpSdr3DLightAttribute)
+ {
+ mpSdr3DLightAttribute->mnRefCount++;
+ }
+
+ Sdr3DLightAttribute::~Sdr3DLightAttribute()
+ {
+ if(mpSdr3DLightAttribute->mnRefCount)
+ {
+ mpSdr3DLightAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdr3DLightAttribute;
+ }
+ }
+
+ bool Sdr3DLightAttribute::isDefault() const
+ {
+ return mpSdr3DLightAttribute == ImpSdr3DLightAttribute::get_global_default();
+ }
+
+ Sdr3DLightAttribute& Sdr3DLightAttribute::operator=(const Sdr3DLightAttribute& rCandidate)
+ {
+ if(rCandidate.mpSdr3DLightAttribute != mpSdr3DLightAttribute)
+ {
+ if(mpSdr3DLightAttribute->mnRefCount)
+ {
+ mpSdr3DLightAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdr3DLightAttribute;
+ }
+
+ mpSdr3DLightAttribute = rCandidate.mpSdr3DLightAttribute;
+ mpSdr3DLightAttribute->mnRefCount++;
+ }
+
+ return *this;
+ }
+
+ bool Sdr3DLightAttribute::operator==(const Sdr3DLightAttribute& rCandidate) const
+ {
+ if(rCandidate.mpSdr3DLightAttribute == mpSdr3DLightAttribute)
+ {
+ return true;
+ }
+
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
+ return (*rCandidate.mpSdr3DLightAttribute == *mpSdr3DLightAttribute);
+ }
+
+ const basegfx::BColor& Sdr3DLightAttribute::getColor() const
+ {
+ return mpSdr3DLightAttribute->getColor();
+ }
+
+ const basegfx::B3DVector& Sdr3DLightAttribute::getDirection() const
+ {
+ return mpSdr3DLightAttribute->getDirection();
+ }
+
+ bool Sdr3DLightAttribute::getSpecular() const
+ {
+ return mpSdr3DLightAttribute->getSpecular();
+ }
+
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/attribute/sdrlightingattribute3d.cxx b/drawinglayer/source/attribute/sdrlightingattribute3d.cxx
new file mode 100644
index 0000000000..e5002fd261
--- /dev/null
+++ b/drawinglayer/source/attribute/sdrlightingattribute3d.cxx
@@ -0,0 +1,235 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrattribute3d.cxx,v $
+ *
+ * $Revision: 1.5 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:19 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_drawinglayer.hxx"
+
+#include <drawinglayer/attribute/sdrlightingattribute3d.hxx>
+#include <basegfx/color/bcolor.hxx>
+#include <basegfx/vector/b3dvector.hxx>
+#include <drawinglayer/attribute/sdrlightattribute3d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class ImpSdrLightingAttribute
+ {
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ // 3D light attribute definitions
+ basegfx::BColor maAmbientLight;
+ ::std::vector< Sdr3DLightAttribute > maLightVector;
+
+ ImpSdrLightingAttribute(
+ const basegfx::BColor& rAmbientLight,
+ const ::std::vector< Sdr3DLightAttribute >& rLightVector)
+ : mnRefCount(0),
+ maAmbientLight(rAmbientLight),
+ maLightVector(rLightVector)
+ {
+ }
+
+ // data read access
+ const basegfx::BColor& getAmbientLight() const { return maAmbientLight; }
+ const ::std::vector< Sdr3DLightAttribute >& getLightVector() const { return maLightVector; }
+
+ bool operator==(const ImpSdrLightingAttribute& rCandidate) const
+ {
+ return (getAmbientLight() == rCandidate.getAmbientLight()
+ && getLightVector() == rCandidate.getLightVector());
+ }
+
+ static ImpSdrLightingAttribute* get_global_default()
+ {
+ static ImpSdrLightingAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpSdrLightingAttribute(
+ basegfx::BColor(),
+ std::vector< Sdr3DLightAttribute >());
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
+ };
+
+ SdrLightingAttribute::SdrLightingAttribute(
+ const basegfx::BColor& rAmbientLight,
+ const ::std::vector< Sdr3DLightAttribute >& rLightVector)
+ : mpSdrLightingAttribute(new ImpSdrLightingAttribute(
+ rAmbientLight, rLightVector))
+ {
+ }
+
+ SdrLightingAttribute::SdrLightingAttribute()
+ : mpSdrLightingAttribute(ImpSdrLightingAttribute::get_global_default())
+ {
+ mpSdrLightingAttribute->mnRefCount++;
+ }
+
+ SdrLightingAttribute::SdrLightingAttribute(const SdrLightingAttribute& rCandidate)
+ : mpSdrLightingAttribute(rCandidate.mpSdrLightingAttribute)
+ {
+ mpSdrLightingAttribute->mnRefCount++;
+ }
+
+ SdrLightingAttribute::~SdrLightingAttribute()
+ {
+ if(mpSdrLightingAttribute->mnRefCount)
+ {
+ mpSdrLightingAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrLightingAttribute;
+ }
+ }
+
+ bool SdrLightingAttribute::isDefault() const
+ {
+ return mpSdrLightingAttribute == ImpSdrLightingAttribute::get_global_default();
+ }
+
+ SdrLightingAttribute& SdrLightingAttribute::operator=(const SdrLightingAttribute& rCandidate)
+ {
+ if(rCandidate.mpSdrLightingAttribute != mpSdrLightingAttribute)
+ {
+ if(mpSdrLightingAttribute->mnRefCount)
+ {
+ mpSdrLightingAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrLightingAttribute;
+ }
+
+ mpSdrLightingAttribute = rCandidate.mpSdrLightingAttribute;
+ mpSdrLightingAttribute->mnRefCount++;
+ }
+
+ return *this;
+ }
+
+ bool SdrLightingAttribute::operator==(const SdrLightingAttribute& rCandidate) const
+ {
+ if(rCandidate.mpSdrLightingAttribute == mpSdrLightingAttribute)
+ {
+ return true;
+ }
+
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
+ return (*rCandidate.mpSdrLightingAttribute == *mpSdrLightingAttribute);
+ }
+
+ const basegfx::BColor& SdrLightingAttribute::getAmbientLight() const
+ {
+ return mpSdrLightingAttribute->getAmbientLight();
+ }
+
+ const ::std::vector< Sdr3DLightAttribute >& SdrLightingAttribute::getLightVector() const
+ {
+ return mpSdrLightingAttribute->getLightVector();
+ }
+
+ // color model solver
+ basegfx::BColor SdrLightingAttribute::solveColorModel(
+ const basegfx::B3DVector& rNormalInEyeCoordinates,
+ const basegfx::BColor& rColor, const basegfx::BColor& rSpecular,
+ const basegfx::BColor& rEmission, sal_uInt16 nSpecularIntensity) const
+ {
+ // initialize with emissive color
+ basegfx::BColor aRetval(rEmission);
+
+ // take care of global ambient light
+ aRetval += mpSdrLightingAttribute->getAmbientLight() * rColor;
+
+ // prepare light access. Is there a light?
+ const sal_uInt32 nLightCount(mpSdrLightingAttribute->getLightVector().size());
+
+ if(nLightCount && !rNormalInEyeCoordinates.equalZero())
+ {
+ // prepare normal
+ basegfx::B3DVector aEyeNormal(rNormalInEyeCoordinates);
+ aEyeNormal.normalize();
+
+ for(sal_uInt32 a(0L); a < nLightCount; a++)
+ {
+ const Sdr3DLightAttribute& rLight(mpSdrLightingAttribute->getLightVector()[a]);
+ const double fCosFac(rLight.getDirection().scalar(aEyeNormal));
+
+ if(basegfx::fTools::more(fCosFac, 0.0))
+ {
+ aRetval += ((rLight.getColor() * rColor) * fCosFac);
+
+ if(rLight.getSpecular())
+ {
+ // expand by (0.0, 0.0, 1.0) in Z
+ basegfx::B3DVector aSpecularNormal(rLight.getDirection().getX(), rLight.getDirection().getY(), rLight.getDirection().getZ() + 1.0);
+ aSpecularNormal.normalize();
+ double fCosFac2(aSpecularNormal.scalar(aEyeNormal));
+
+ if(basegfx::fTools::more(fCosFac2, 0.0))
+ {
+ fCosFac2 = pow(fCosFac2, (double)nSpecularIntensity);
+ aRetval += (rSpecular * fCosFac2);
+ }
+ }
+ }
+ }
+ }
+
+ // clamp to color space before usage
+ aRetval.clamp();
+
+ return aRetval;
+ }
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/attribute/sdrlineattribute.cxx b/drawinglayer/source/attribute/sdrlineattribute.cxx
new file mode 100644
index 0000000000..4490176a3e
--- /dev/null
+++ b/drawinglayer/source/attribute/sdrlineattribute.cxx
@@ -0,0 +1,250 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrattribute.cxx,v $
+ *
+ * $Revision: 1.5 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:19 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_drawinglayer.hxx"
+
+#include <drawinglayer/attribute/sdrlineattribute.hxx>
+#include <basegfx/color/bcolor.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class ImpSdrLineAttribute
+ {
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ // line definitions
+ basegfx::B2DLineJoin meJoin; // B2DLINEJOIN_* defines
+ double mfWidth; // 1/100th mm, 0.0==hair
+ double mfTransparence; // [0.0 .. 1.0], 0.0==no transp.
+ basegfx::BColor maColor; // color of line
+ ::std::vector< double > maDotDashArray; // array of double which defines the dot-dash pattern
+ double mfFullDotDashLen; // sum of maDotDashArray (for convenience)
+
+ ImpSdrLineAttribute(
+ basegfx::B2DLineJoin eJoin,
+ double fWidth,
+ double fTransparence,
+ const basegfx::BColor& rColor,
+ const ::std::vector< double >& rDotDashArray,
+ double fFullDotDashLen)
+ : mnRefCount(0),
+ meJoin(eJoin),
+ mfWidth(fWidth),
+ mfTransparence(fTransparence),
+ maColor(rColor),
+ maDotDashArray(rDotDashArray),
+ mfFullDotDashLen(fFullDotDashLen)
+ {
+ }
+
+ ImpSdrLineAttribute(const basegfx::BColor& rColor)
+ : mnRefCount(0),
+ meJoin(basegfx::B2DLINEJOIN_NONE),
+ mfWidth(0.0),
+ mfTransparence(0.0),
+ maColor(rColor),
+ maDotDashArray(),
+ mfFullDotDashLen(0.0)
+ {
+ }
+
+ // data read access
+ basegfx::B2DLineJoin getJoin() const { return meJoin; }
+ double getWidth() const { return mfWidth; }
+ double getTransparence() const { return mfTransparence; }
+ const basegfx::BColor& getColor() const { return maColor; }
+ const ::std::vector< double >& getDotDashArray() const { return maDotDashArray; }
+ double getFullDotDashLen() const { return mfFullDotDashLen; }
+
+ bool operator==(const ImpSdrLineAttribute& rCandidate) const
+ {
+ return (getJoin() == rCandidate.getJoin()
+ && getWidth() == rCandidate.getWidth()
+ && getTransparence() == rCandidate.getTransparence()
+ && getColor() == rCandidate.getColor()
+ && getDotDashArray() == rCandidate.getDotDashArray());
+ }
+
+ static ImpSdrLineAttribute* get_global_default()
+ {
+ static ImpSdrLineAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpSdrLineAttribute(
+ basegfx::B2DLINEJOIN_ROUND,
+ 0.0,
+ 0.0,
+ basegfx::BColor(),
+ std::vector< double >(),
+ 0.0);
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
+ };
+
+ SdrLineAttribute::SdrLineAttribute(
+ basegfx::B2DLineJoin eJoin,
+ double fWidth,
+ double fTransparence,
+ const basegfx::BColor& rColor,
+ const ::std::vector< double >& rDotDashArray,
+ double fFullDotDashLen)
+ : mpSdrLineAttribute(new ImpSdrLineAttribute(
+ eJoin, fWidth, fTransparence, rColor, rDotDashArray, fFullDotDashLen))
+ {
+ }
+
+ SdrLineAttribute::SdrLineAttribute(
+ const basegfx::BColor& rColor)
+ : mpSdrLineAttribute(new ImpSdrLineAttribute(rColor))
+ {
+ }
+
+ SdrLineAttribute::SdrLineAttribute()
+ : mpSdrLineAttribute(ImpSdrLineAttribute::get_global_default())
+ {
+ mpSdrLineAttribute->mnRefCount++;
+ }
+
+ SdrLineAttribute::SdrLineAttribute(const SdrLineAttribute& rCandidate)
+ : mpSdrLineAttribute(rCandidate.mpSdrLineAttribute)
+ {
+ mpSdrLineAttribute->mnRefCount++;
+ }
+
+ SdrLineAttribute::~SdrLineAttribute()
+ {
+ if(mpSdrLineAttribute->mnRefCount)
+ {
+ mpSdrLineAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrLineAttribute;
+ }
+ }
+
+ bool SdrLineAttribute::isDefault() const
+ {
+ return mpSdrLineAttribute == ImpSdrLineAttribute::get_global_default();
+ }
+
+ SdrLineAttribute& SdrLineAttribute::operator=(const SdrLineAttribute& rCandidate)
+ {
+ if(rCandidate.mpSdrLineAttribute != mpSdrLineAttribute)
+ {
+ if(mpSdrLineAttribute->mnRefCount)
+ {
+ mpSdrLineAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrLineAttribute;
+ }
+
+ mpSdrLineAttribute = rCandidate.mpSdrLineAttribute;
+ mpSdrLineAttribute->mnRefCount++;
+ }
+
+ return *this;
+ }
+
+ bool SdrLineAttribute::operator==(const SdrLineAttribute& rCandidate) const
+ {
+ if(rCandidate.mpSdrLineAttribute == mpSdrLineAttribute)
+ {
+ return true;
+ }
+
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
+ return (*rCandidate.mpSdrLineAttribute == *mpSdrLineAttribute);
+ }
+
+ basegfx::B2DLineJoin SdrLineAttribute::getJoin() const
+ {
+ return mpSdrLineAttribute->getJoin();
+ }
+
+ double SdrLineAttribute::getWidth() const
+ {
+ return mpSdrLineAttribute->getWidth();
+ }
+
+ double SdrLineAttribute::getTransparence() const
+ {
+ return mpSdrLineAttribute->getTransparence();
+ }
+
+ const basegfx::BColor& SdrLineAttribute::getColor() const
+ {
+ return mpSdrLineAttribute->getColor();
+ }
+
+ const ::std::vector< double >& SdrLineAttribute::getDotDashArray() const
+ {
+ return mpSdrLineAttribute->getDotDashArray();
+ }
+
+ double SdrLineAttribute::getFullDotDashLen() const
+ {
+ return mpSdrLineAttribute->getFullDotDashLen();
+ }
+
+ bool SdrLineAttribute::isDashed() const
+ {
+ return (0L != getDotDashArray().size());
+ }
+
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/attribute/sdrlinestartendattribute.cxx b/drawinglayer/source/attribute/sdrlinestartendattribute.cxx
new file mode 100644
index 0000000000..4f73f8654d
--- /dev/null
+++ b/drawinglayer/source/attribute/sdrlinestartendattribute.cxx
@@ -0,0 +1,254 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrattribute.cxx,v $
+ *
+ * $Revision: 1.5 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:19 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_drawinglayer.hxx"
+
+#include <drawinglayer/attribute/sdrlinestartendattribute.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class ImpSdrLineStartEndAttribute
+ {
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ // line arrow definitions
+ basegfx::B2DPolyPolygon maStartPolyPolygon; // start Line PolyPolygon
+ basegfx::B2DPolyPolygon maEndPolyPolygon; // end Line PolyPolygon
+ double mfStartWidth; // 1/100th mm
+ double mfEndWidth; // 1/100th mm
+
+ // bitfield
+ unsigned mbStartActive : 1L; // start of Line is active
+ unsigned mbEndActive : 1L; // end of Line is active
+ unsigned mbStartCentered : 1L; // Line is centered on line start point
+ unsigned mbEndCentered : 1L; // Line is centered on line end point
+
+ ImpSdrLineStartEndAttribute(
+ const basegfx::B2DPolyPolygon& rStartPolyPolygon,
+ const basegfx::B2DPolyPolygon& rEndPolyPolygon,
+ double fStartWidth,
+ double fEndWidth,
+ bool bStartActive,
+ bool bEndActive,
+ bool bStartCentered,
+ bool bEndCentered)
+ : mnRefCount(0),
+ maStartPolyPolygon(rStartPolyPolygon),
+ maEndPolyPolygon(rEndPolyPolygon),
+ mfStartWidth(fStartWidth),
+ mfEndWidth(fEndWidth),
+ mbStartActive(bStartActive),
+ mbEndActive(bEndActive),
+ mbStartCentered(bStartCentered),
+ mbEndCentered(bEndCentered)
+ {
+ }
+
+ // data read access
+ const basegfx::B2DPolyPolygon& getStartPolyPolygon() const { return maStartPolyPolygon; }
+ const basegfx::B2DPolyPolygon& getEndPolyPolygon() const { return maEndPolyPolygon; }
+ double getStartWidth() const { return mfStartWidth; }
+ double getEndWidth() const { return mfEndWidth; }
+ bool isStartActive() const { return mbStartActive; }
+ bool isEndActive() const { return mbEndActive; }
+ bool isStartCentered() const { return mbStartCentered; }
+ bool isEndCentered() const { return mbEndCentered; }
+
+ bool operator==(const ImpSdrLineStartEndAttribute& rCandidate) const
+ {
+ return (getStartPolyPolygon() == rCandidate.getStartPolyPolygon()
+ && getEndPolyPolygon() == rCandidate.getEndPolyPolygon()
+ && getStartWidth() == rCandidate.getStartWidth()
+ && getEndWidth() == rCandidate.getEndWidth()
+ && isStartActive() == rCandidate.isStartActive()
+ && isEndActive() == rCandidate.isEndActive()
+ && isStartCentered() == rCandidate.isStartCentered()
+ && isEndCentered() == rCandidate.isEndCentered());
+ }
+
+ static ImpSdrLineStartEndAttribute* get_global_default()
+ {
+ static ImpSdrLineStartEndAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpSdrLineStartEndAttribute(
+ basegfx::B2DPolyPolygon(),
+ basegfx::B2DPolyPolygon(),
+ 0.0,
+ 0.0,
+ false,
+ false,
+ false,
+ false);
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
+ };
+
+ SdrLineStartEndAttribute::SdrLineStartEndAttribute(
+ const basegfx::B2DPolyPolygon& rStartPolyPolygon,
+ const basegfx::B2DPolyPolygon& rEndPolyPolygon,
+ double fStartWidth,
+ double fEndWidth,
+ bool bStartActive,
+ bool bEndActive,
+ bool bStartCentered,
+ bool bEndCentered)
+ : mpSdrLineStartEndAttribute(new ImpSdrLineStartEndAttribute(
+ rStartPolyPolygon, rEndPolyPolygon, fStartWidth, fEndWidth, bStartActive, bEndActive, bStartCentered, bEndCentered))
+ {
+ }
+
+ SdrLineStartEndAttribute::SdrLineStartEndAttribute()
+ : mpSdrLineStartEndAttribute(ImpSdrLineStartEndAttribute::get_global_default())
+ {
+ mpSdrLineStartEndAttribute->mnRefCount++;
+ }
+
+ SdrLineStartEndAttribute::SdrLineStartEndAttribute(const SdrLineStartEndAttribute& rCandidate)
+ : mpSdrLineStartEndAttribute(rCandidate.mpSdrLineStartEndAttribute)
+ {
+ mpSdrLineStartEndAttribute->mnRefCount++;
+ }
+
+ SdrLineStartEndAttribute::~SdrLineStartEndAttribute()
+ {
+ if(mpSdrLineStartEndAttribute->mnRefCount)
+ {
+ mpSdrLineStartEndAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrLineStartEndAttribute;
+ }
+ }
+
+ bool SdrLineStartEndAttribute::isDefault() const
+ {
+ return mpSdrLineStartEndAttribute == ImpSdrLineStartEndAttribute::get_global_default();
+ }
+
+ SdrLineStartEndAttribute& SdrLineStartEndAttribute::operator=(const SdrLineStartEndAttribute& rCandidate)
+ {
+ if(rCandidate.mpSdrLineStartEndAttribute != mpSdrLineStartEndAttribute)
+ {
+ if(mpSdrLineStartEndAttribute->mnRefCount)
+ {
+ mpSdrLineStartEndAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrLineStartEndAttribute;
+ }
+
+ mpSdrLineStartEndAttribute = rCandidate.mpSdrLineStartEndAttribute;
+ mpSdrLineStartEndAttribute->mnRefCount++;
+ }
+
+ return *this;
+ }
+
+ bool SdrLineStartEndAttribute::operator==(const SdrLineStartEndAttribute& rCandidate) const
+ {
+ if(rCandidate.mpSdrLineStartEndAttribute == mpSdrLineStartEndAttribute)
+ {
+ return true;
+ }
+
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
+ return (*rCandidate.mpSdrLineStartEndAttribute == *mpSdrLineStartEndAttribute);
+ }
+
+ const basegfx::B2DPolyPolygon& SdrLineStartEndAttribute::getStartPolyPolygon() const
+ {
+ return mpSdrLineStartEndAttribute->getStartPolyPolygon();
+ }
+
+ const basegfx::B2DPolyPolygon& SdrLineStartEndAttribute::getEndPolyPolygon() const
+ {
+ return mpSdrLineStartEndAttribute->getEndPolyPolygon();
+ }
+
+ double SdrLineStartEndAttribute::getStartWidth() const
+ {
+ return mpSdrLineStartEndAttribute->getStartWidth();
+ }
+
+ double SdrLineStartEndAttribute::getEndWidth() const
+ {
+ return mpSdrLineStartEndAttribute->getEndWidth();
+ }
+
+ bool SdrLineStartEndAttribute::isStartActive() const
+ {
+ return mpSdrLineStartEndAttribute->isStartActive();
+ }
+
+ bool SdrLineStartEndAttribute::isEndActive() const
+ {
+ return mpSdrLineStartEndAttribute->isEndActive();
+ }
+
+ bool SdrLineStartEndAttribute::isStartCentered() const
+ {
+ return mpSdrLineStartEndAttribute->isStartCentered();
+ }
+
+ bool SdrLineStartEndAttribute::isEndCentered() const
+ {
+ return mpSdrLineStartEndAttribute->isEndCentered();
+ }
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/attribute/sdrobjectattribute3d.cxx b/drawinglayer/source/attribute/sdrobjectattribute3d.cxx
new file mode 100644
index 0000000000..09ec55cb0f
--- /dev/null
+++ b/drawinglayer/source/attribute/sdrobjectattribute3d.cxx
@@ -0,0 +1,292 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrattribute3d.cxx,v $
+ *
+ * $Revision: 1.5 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:19 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_drawinglayer.hxx"
+
+#include <drawinglayer/attribute/sdrobjectattribute3d.hxx>
+#include <drawinglayer/attribute/materialattribute3d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class ImpSdr3DObjectAttribute
+ {
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ // 3D object attribute definitions
+ ::com::sun::star::drawing::NormalsKind maNormalsKind; // normals type (0..2)
+ ::com::sun::star::drawing::TextureProjectionMode maTextureProjectionX; // texture projection type X (0..2)
+ ::com::sun::star::drawing::TextureProjectionMode maTextureProjectionY; // texture projection type Y (0..2)
+ ::com::sun::star::drawing::TextureKind2 maTextureKind; // texture kind (see uno API)
+ ::com::sun::star::drawing::TextureMode maTextureMode; // texture kind (see uno API)
+ MaterialAttribute3D maMaterial; // object, specular and emissive colors, SpecularIntensity
+
+ // bitfield
+ unsigned mbNormalsInvert : 1; // invert normals
+ unsigned mbDoubleSided : 1; // surfaces are double sided
+ unsigned mbShadow3D : 1; // display shadow in 3D (if on), params for that are at scene
+ unsigned mbTextureFilter : 1; // filter texture to make more smooth
+ unsigned mbReducedLineGeometry : 1; // use reduced line geometry (object specific)
+
+ ImpSdr3DObjectAttribute(
+ ::com::sun::star::drawing::NormalsKind aNormalsKind,
+ ::com::sun::star::drawing::TextureProjectionMode aTextureProjectionX,
+ ::com::sun::star::drawing::TextureProjectionMode aTextureProjectionY,
+ ::com::sun::star::drawing::TextureKind2 aTextureKind,
+ ::com::sun::star::drawing::TextureMode aTextureMode,
+ const MaterialAttribute3D& rMaterial,
+ bool bNormalsInvert,
+ bool bDoubleSided,
+ bool bShadow3D,
+ bool bTextureFilter,
+ bool bReducedLineGeometry)
+ : mnRefCount(0),
+ maNormalsKind(aNormalsKind),
+ maTextureProjectionX(aTextureProjectionX),
+ maTextureProjectionY(aTextureProjectionY),
+ maTextureKind(aTextureKind),
+ maTextureMode(aTextureMode),
+ maMaterial(rMaterial),
+ mbNormalsInvert(bNormalsInvert),
+ mbDoubleSided(bDoubleSided),
+ mbShadow3D(bShadow3D),
+ mbTextureFilter(bTextureFilter),
+ mbReducedLineGeometry(bReducedLineGeometry)
+ {
+ }
+
+ // data read access
+ ::com::sun::star::drawing::NormalsKind getNormalsKind() const { return maNormalsKind; }
+ ::com::sun::star::drawing::TextureProjectionMode getTextureProjectionX() const { return maTextureProjectionX; }
+ ::com::sun::star::drawing::TextureProjectionMode getTextureProjectionY() const { return maTextureProjectionY; }
+ ::com::sun::star::drawing::TextureKind2 getTextureKind() const { return maTextureKind; }
+ ::com::sun::star::drawing::TextureMode getTextureMode() const { return maTextureMode; }
+ const MaterialAttribute3D& getMaterial() const { return maMaterial; }
+ bool getNormalsInvert() const { return mbNormalsInvert; }
+ bool getDoubleSided() const { return mbDoubleSided; }
+ bool getShadow3D() const { return mbShadow3D; }
+ bool getTextureFilter() const { return mbTextureFilter; }
+ bool getReducedLineGeometry() const { return mbReducedLineGeometry; }
+
+ bool operator==(const ImpSdr3DObjectAttribute& rCandidate) const
+ {
+ return (getNormalsKind() == rCandidate.getNormalsKind()
+ && getTextureProjectionX() == rCandidate.getTextureProjectionX()
+ && getTextureProjectionY() == rCandidate.getTextureProjectionY()
+ && getTextureKind() == rCandidate.getTextureKind()
+ && getTextureMode() == rCandidate.getTextureMode()
+ && getMaterial() == rCandidate.getMaterial()
+ && getNormalsInvert() == rCandidate.getNormalsInvert()
+ && getDoubleSided() == rCandidate.getDoubleSided()
+ && getShadow3D() == rCandidate.getShadow3D()
+ && getTextureFilter() == rCandidate.getTextureFilter()
+ && getReducedLineGeometry() == rCandidate.getReducedLineGeometry());
+ }
+
+ static ImpSdr3DObjectAttribute* get_global_default()
+ {
+ static ImpSdr3DObjectAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpSdr3DObjectAttribute(
+ ::com::sun::star::drawing::NormalsKind_SPECIFIC,
+ ::com::sun::star::drawing::TextureProjectionMode_OBJECTSPECIFIC,
+ ::com::sun::star::drawing::TextureProjectionMode_OBJECTSPECIFIC,
+ ::com::sun::star::drawing::TextureKind2_LUMINANCE,
+ ::com::sun::star::drawing::TextureMode_REPLACE,
+ MaterialAttribute3D(),
+ false,
+ false,
+ false,
+ false,
+ false);
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
+ };
+
+ Sdr3DObjectAttribute::Sdr3DObjectAttribute(
+ ::com::sun::star::drawing::NormalsKind aNormalsKind,
+ ::com::sun::star::drawing::TextureProjectionMode aTextureProjectionX,
+ ::com::sun::star::drawing::TextureProjectionMode aTextureProjectionY,
+ ::com::sun::star::drawing::TextureKind2 aTextureKind,
+ ::com::sun::star::drawing::TextureMode aTextureMode,
+ const MaterialAttribute3D& rMaterial,
+ bool bNormalsInvert,
+ bool bDoubleSided,
+ bool bShadow3D,
+ bool bTextureFilter,
+ bool bReducedLineGeometry)
+ : mpSdr3DObjectAttribute(new ImpSdr3DObjectAttribute(
+ aNormalsKind, aTextureProjectionX, aTextureProjectionY, aTextureKind, aTextureMode,
+ rMaterial, bNormalsInvert, bDoubleSided, bShadow3D, bTextureFilter, bReducedLineGeometry))
+ {
+ }
+
+ Sdr3DObjectAttribute::Sdr3DObjectAttribute()
+ : mpSdr3DObjectAttribute(ImpSdr3DObjectAttribute::get_global_default())
+ {
+ mpSdr3DObjectAttribute->mnRefCount++;
+ }
+
+ Sdr3DObjectAttribute::Sdr3DObjectAttribute(const Sdr3DObjectAttribute& rCandidate)
+ : mpSdr3DObjectAttribute(rCandidate.mpSdr3DObjectAttribute)
+ {
+ mpSdr3DObjectAttribute->mnRefCount++;
+ }
+
+ Sdr3DObjectAttribute::~Sdr3DObjectAttribute()
+ {
+ if(mpSdr3DObjectAttribute->mnRefCount)
+ {
+ mpSdr3DObjectAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdr3DObjectAttribute;
+ }
+ }
+
+ bool Sdr3DObjectAttribute::isDefault() const
+ {
+ return mpSdr3DObjectAttribute == ImpSdr3DObjectAttribute::get_global_default();
+ }
+
+ Sdr3DObjectAttribute& Sdr3DObjectAttribute::operator=(const Sdr3DObjectAttribute& rCandidate)
+ {
+ if(rCandidate.mpSdr3DObjectAttribute != mpSdr3DObjectAttribute)
+ {
+ if(mpSdr3DObjectAttribute->mnRefCount)
+ {
+ mpSdr3DObjectAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdr3DObjectAttribute;
+ }
+
+ mpSdr3DObjectAttribute = rCandidate.mpSdr3DObjectAttribute;
+ mpSdr3DObjectAttribute->mnRefCount++;
+ }
+
+ return *this;
+ }
+
+ bool Sdr3DObjectAttribute::operator==(const Sdr3DObjectAttribute& rCandidate) const
+ {
+ if(rCandidate.mpSdr3DObjectAttribute == mpSdr3DObjectAttribute)
+ {
+ return true;
+ }
+
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
+ return (*rCandidate.mpSdr3DObjectAttribute == *mpSdr3DObjectAttribute);
+ }
+
+ ::com::sun::star::drawing::NormalsKind Sdr3DObjectAttribute::getNormalsKind() const
+ {
+ return mpSdr3DObjectAttribute->getNormalsKind();
+ }
+
+ ::com::sun::star::drawing::TextureProjectionMode Sdr3DObjectAttribute::getTextureProjectionX() const
+ {
+ return mpSdr3DObjectAttribute->getTextureProjectionX();
+ }
+
+ ::com::sun::star::drawing::TextureProjectionMode Sdr3DObjectAttribute::getTextureProjectionY() const
+ {
+ return mpSdr3DObjectAttribute->getTextureProjectionY();
+ }
+
+ ::com::sun::star::drawing::TextureKind2 Sdr3DObjectAttribute::getTextureKind() const
+ {
+ return mpSdr3DObjectAttribute->getTextureKind();
+ }
+
+ ::com::sun::star::drawing::TextureMode Sdr3DObjectAttribute::getTextureMode() const
+ {
+ return mpSdr3DObjectAttribute->getTextureMode();
+ }
+
+ const MaterialAttribute3D& Sdr3DObjectAttribute::getMaterial() const
+ {
+ return mpSdr3DObjectAttribute->getMaterial();
+ }
+
+ bool Sdr3DObjectAttribute::getNormalsInvert() const
+ {
+ return mpSdr3DObjectAttribute->getNormalsInvert();
+ }
+
+ bool Sdr3DObjectAttribute::getDoubleSided() const
+ {
+ return mpSdr3DObjectAttribute->getDoubleSided();
+ }
+
+ bool Sdr3DObjectAttribute::getShadow3D() const
+ {
+ return mpSdr3DObjectAttribute->getShadow3D();
+ }
+
+ bool Sdr3DObjectAttribute::getTextureFilter() const
+ {
+ return mpSdr3DObjectAttribute->getTextureFilter();
+ }
+
+ bool Sdr3DObjectAttribute::getReducedLineGeometry() const
+ {
+ return mpSdr3DObjectAttribute->getReducedLineGeometry();
+ }
+
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/attribute/sdrsceneattribute3d.cxx b/drawinglayer/source/attribute/sdrsceneattribute3d.cxx
new file mode 100644
index 0000000000..ffd774c89c
--- /dev/null
+++ b/drawinglayer/source/attribute/sdrsceneattribute3d.cxx
@@ -0,0 +1,218 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrattribute3d.cxx,v $
+ *
+ * $Revision: 1.5 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:19 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_drawinglayer.hxx"
+
+#include <drawinglayer/attribute/sdrsceneattribute3d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class ImpSdrSceneAttribute
+ {
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ // 3D scene attribute definitions
+ double mfDistance;
+ double mfShadowSlant;
+ ::com::sun::star::drawing::ProjectionMode maProjectionMode;
+ ::com::sun::star::drawing::ShadeMode maShadeMode;
+
+ // bitfield
+ unsigned mbTwoSidedLighting : 1;
+
+ public:
+ ImpSdrSceneAttribute(
+ double fDistance,
+ double fShadowSlant,
+ ::com::sun::star::drawing::ProjectionMode aProjectionMode,
+ ::com::sun::star::drawing::ShadeMode aShadeMode,
+ bool bTwoSidedLighting)
+ : mnRefCount(0),
+ mfDistance(fDistance),
+ mfShadowSlant(fShadowSlant),
+ maProjectionMode(aProjectionMode),
+ maShadeMode(aShadeMode),
+ mbTwoSidedLighting(bTwoSidedLighting)
+ {
+ }
+
+ // data read access
+ double getDistance() const { return mfDistance; }
+ double getShadowSlant() const { return mfShadowSlant; }
+ ::com::sun::star::drawing::ProjectionMode getProjectionMode() const { return maProjectionMode; }
+ ::com::sun::star::drawing::ShadeMode getShadeMode() const { return maShadeMode; }
+ bool getTwoSidedLighting() const { return mbTwoSidedLighting; }
+
+ bool operator==(const ImpSdrSceneAttribute& rCandidate) const
+ {
+ return (getDistance() == rCandidate.getDistance()
+ && getShadowSlant() == rCandidate.getShadowSlant()
+ && getProjectionMode() == rCandidate.getProjectionMode()
+ && getShadeMode() == rCandidate.getShadeMode()
+ && getTwoSidedLighting() == rCandidate.getTwoSidedLighting());
+ }
+
+ static ImpSdrSceneAttribute* get_global_default()
+ {
+ static ImpSdrSceneAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpSdrSceneAttribute(
+ 0.0, 0.0,
+ ::com::sun::star::drawing::ProjectionMode_PARALLEL,
+ ::com::sun::star::drawing::ShadeMode_FLAT,
+ false);
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
+ };
+
+ SdrSceneAttribute::SdrSceneAttribute(
+ double fDistance,
+ double fShadowSlant,
+ ::com::sun::star::drawing::ProjectionMode aProjectionMode,
+ ::com::sun::star::drawing::ShadeMode aShadeMode,
+ bool bTwoSidedLighting)
+ : mpSdrSceneAttribute(new ImpSdrSceneAttribute(
+ fDistance, fShadowSlant, aProjectionMode, aShadeMode, bTwoSidedLighting))
+ {
+ }
+
+ SdrSceneAttribute::SdrSceneAttribute()
+ : mpSdrSceneAttribute(ImpSdrSceneAttribute::get_global_default())
+ {
+ mpSdrSceneAttribute->mnRefCount++;
+ }
+
+ SdrSceneAttribute::SdrSceneAttribute(const SdrSceneAttribute& rCandidate)
+ : mpSdrSceneAttribute(rCandidate.mpSdrSceneAttribute)
+ {
+ mpSdrSceneAttribute->mnRefCount++;
+ }
+
+ SdrSceneAttribute::~SdrSceneAttribute()
+ {
+ if(mpSdrSceneAttribute->mnRefCount)
+ {
+ mpSdrSceneAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrSceneAttribute;
+ }
+ }
+
+ bool SdrSceneAttribute::isDefault() const
+ {
+ return mpSdrSceneAttribute == ImpSdrSceneAttribute::get_global_default();
+ }
+
+ SdrSceneAttribute& SdrSceneAttribute::operator=(const SdrSceneAttribute& rCandidate)
+ {
+ if(rCandidate.mpSdrSceneAttribute != mpSdrSceneAttribute)
+ {
+ if(mpSdrSceneAttribute->mnRefCount)
+ {
+ mpSdrSceneAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrSceneAttribute;
+ }
+
+ mpSdrSceneAttribute = rCandidate.mpSdrSceneAttribute;
+ mpSdrSceneAttribute->mnRefCount++;
+ }
+
+ return *this;
+ }
+
+ bool SdrSceneAttribute::operator==(const SdrSceneAttribute& rCandidate) const
+ {
+ if(rCandidate.mpSdrSceneAttribute == mpSdrSceneAttribute)
+ {
+ return true;
+ }
+
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
+ return (*rCandidate.mpSdrSceneAttribute == *mpSdrSceneAttribute);
+ }
+
+ double SdrSceneAttribute::getDistance() const
+ {
+ return mpSdrSceneAttribute->getDistance();
+ }
+
+ double SdrSceneAttribute::getShadowSlant() const
+ {
+ return mpSdrSceneAttribute->getShadowSlant();
+ }
+
+ ::com::sun::star::drawing::ProjectionMode SdrSceneAttribute::getProjectionMode() const
+ {
+ return mpSdrSceneAttribute->getProjectionMode();
+ }
+
+ ::com::sun::star::drawing::ShadeMode SdrSceneAttribute::getShadeMode() const
+ {
+ return mpSdrSceneAttribute->getShadeMode();
+ }
+
+ bool SdrSceneAttribute::getTwoSidedLighting() const
+ {
+ return mpSdrSceneAttribute->getTwoSidedLighting();
+ }
+
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/attribute/sdrshadowattribute.cxx b/drawinglayer/source/attribute/sdrshadowattribute.cxx
new file mode 100644
index 0000000000..429d920030
--- /dev/null
+++ b/drawinglayer/source/attribute/sdrshadowattribute.cxx
@@ -0,0 +1,193 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrattribute.cxx,v $
+ *
+ * $Revision: 1.5 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:19 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_drawinglayer.hxx"
+
+#include <drawinglayer/attribute/sdrshadowattribute.hxx>
+#include <basegfx/vector/b2dvector.hxx>
+#include <basegfx/color/bcolor.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class ImpSdrShadowAttribute
+ {
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ // shadow definitions
+ basegfx::B2DVector maOffset; // shadow offset 1/100th mm
+ double mfTransparence; // [0.0 .. 1.0], 0.0==no transp.
+ basegfx::BColor maColor; // color of shadow
+
+ ImpSdrShadowAttribute(
+ const basegfx::B2DVector& rOffset,
+ double fTransparence,
+ const basegfx::BColor& rColor)
+ : mnRefCount(0),
+ maOffset(rOffset),
+ mfTransparence(fTransparence),
+ maColor(rColor)
+ {
+ }
+
+ // data read access
+ const basegfx::B2DVector& getOffset() const { return maOffset; }
+ double getTransparence() const { return mfTransparence; }
+ const basegfx::BColor& getColor() const { return maColor; }
+
+ bool operator==(const ImpSdrShadowAttribute& rCandidate) const
+ {
+ return (getOffset() == rCandidate.getOffset()
+ && getTransparence() == rCandidate.getTransparence()
+ && getColor() == rCandidate.getColor());
+ }
+
+ static ImpSdrShadowAttribute* get_global_default()
+ {
+ static ImpSdrShadowAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpSdrShadowAttribute(
+ basegfx::B2DVector(),
+ 0.0,
+ basegfx::BColor());
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
+ };
+
+ SdrShadowAttribute::SdrShadowAttribute(
+ const basegfx::B2DVector& rOffset,
+ double fTransparence,
+ const basegfx::BColor& rColor)
+ : mpSdrShadowAttribute(new ImpSdrShadowAttribute(
+ rOffset, fTransparence, rColor))
+ {
+ }
+
+ SdrShadowAttribute::SdrShadowAttribute()
+ : mpSdrShadowAttribute(ImpSdrShadowAttribute::get_global_default())
+ {
+ mpSdrShadowAttribute->mnRefCount++;
+ }
+
+ SdrShadowAttribute::SdrShadowAttribute(const SdrShadowAttribute& rCandidate)
+ : mpSdrShadowAttribute(rCandidate.mpSdrShadowAttribute)
+ {
+ mpSdrShadowAttribute->mnRefCount++;
+ }
+
+ SdrShadowAttribute::~SdrShadowAttribute()
+ {
+ if(mpSdrShadowAttribute->mnRefCount)
+ {
+ mpSdrShadowAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrShadowAttribute;
+ }
+ }
+
+ bool SdrShadowAttribute::isDefault() const
+ {
+ return mpSdrShadowAttribute == ImpSdrShadowAttribute::get_global_default();
+ }
+
+ SdrShadowAttribute& SdrShadowAttribute::operator=(const SdrShadowAttribute& rCandidate)
+ {
+ if(rCandidate.mpSdrShadowAttribute != mpSdrShadowAttribute)
+ {
+ if(mpSdrShadowAttribute->mnRefCount)
+ {
+ mpSdrShadowAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrShadowAttribute;
+ }
+
+ mpSdrShadowAttribute = rCandidate.mpSdrShadowAttribute;
+ mpSdrShadowAttribute->mnRefCount++;
+ }
+
+ return *this;
+ }
+
+ bool SdrShadowAttribute::operator==(const SdrShadowAttribute& rCandidate) const
+ {
+ if(rCandidate.mpSdrShadowAttribute == mpSdrShadowAttribute)
+ {
+ return true;
+ }
+
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
+ return (*rCandidate.mpSdrShadowAttribute == *mpSdrShadowAttribute);
+ }
+
+ const basegfx::B2DVector& SdrShadowAttribute::getOffset() const
+ {
+ return mpSdrShadowAttribute->getOffset();
+ }
+
+ double SdrShadowAttribute::getTransparence() const
+ {
+ return mpSdrShadowAttribute->getTransparence();
+ }
+
+ const basegfx::BColor& SdrShadowAttribute::getColor() const
+ {
+ return mpSdrShadowAttribute->getColor();
+ }
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/attribute/strokeattribute.cxx b/drawinglayer/source/attribute/strokeattribute.cxx
index 3f3fd47ab0..67d90e951b 100644
--- a/drawinglayer/source/attribute/strokeattribute.cxx
+++ b/drawinglayer/source/attribute/strokeattribute.cxx
@@ -37,16 +37,143 @@ namespace drawinglayer
{
namespace attribute
{
- double StrokeAttribute::getFullDotDashLen() const
+ class ImpStrokeAttribute
{
- if(0.0 == mfFullDotDashLen && maDotDashArray.size())
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ // data definitions
+ ::std::vector< double > maDotDashArray; // array of double which defines the dot-dash pattern
+ double mfFullDotDashLen; // sum of maDotDashArray (for convenience)
+
+ ImpStrokeAttribute(
+ const ::std::vector< double >& rDotDashArray,
+ double fFullDotDashLen)
+ : mnRefCount(0),
+ maDotDashArray(rDotDashArray),
+ mfFullDotDashLen(fFullDotDashLen)
+ {
+ }
+
+ // data read access
+ const ::std::vector< double >& getDotDashArray() const { return maDotDashArray; }
+ double getFullDotDashLen() const
+ {
+ if(0.0 == mfFullDotDashLen && maDotDashArray.size())
+ {
+ // calculate length on demand
+ const double fAccumulated(::std::accumulate(maDotDashArray.begin(), maDotDashArray.end(), 0.0));
+ const_cast< ImpStrokeAttribute* >(this)->mfFullDotDashLen = fAccumulated;
+ }
+
+ return mfFullDotDashLen;
+ }
+
+ bool operator==(const ImpStrokeAttribute& rCandidate) const
+ {
+ return (getDotDashArray() == rCandidate.getDotDashArray()
+ && getFullDotDashLen() == rCandidate.getFullDotDashLen());
+ }
+
+ static ImpStrokeAttribute* get_global_default()
+ {
+ static ImpStrokeAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpStrokeAttribute(
+ std::vector< double >(),
+ 0.0);
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
+ };
+
+ StrokeAttribute::StrokeAttribute(
+ const ::std::vector< double >& rDotDashArray,
+ double fFullDotDashLen)
+ : mpStrokeAttribute(new ImpStrokeAttribute(
+ rDotDashArray, fFullDotDashLen))
+ {
+ }
+
+ StrokeAttribute::StrokeAttribute()
+ : mpStrokeAttribute(ImpStrokeAttribute::get_global_default())
+ {
+ mpStrokeAttribute->mnRefCount++;
+ }
+
+ StrokeAttribute::StrokeAttribute(const StrokeAttribute& rCandidate)
+ : mpStrokeAttribute(rCandidate.mpStrokeAttribute)
+ {
+ mpStrokeAttribute->mnRefCount++;
+ }
+
+ StrokeAttribute::~StrokeAttribute()
+ {
+ if(mpStrokeAttribute->mnRefCount)
+ {
+ mpStrokeAttribute->mnRefCount--;
+ }
+ else
{
- // calculate length on demand
- const double fAccumulated(::std::accumulate(maDotDashArray.begin(), maDotDashArray.end(), 0.0));
- const_cast< StrokeAttribute* >(this)->mfFullDotDashLen = fAccumulated;
+ delete mpStrokeAttribute;
}
+ }
+
+ bool StrokeAttribute::isDefault() const
+ {
+ return mpStrokeAttribute == ImpStrokeAttribute::get_global_default();
+ }
+
+ StrokeAttribute& StrokeAttribute::operator=(const StrokeAttribute& rCandidate)
+ {
+ if(rCandidate.mpStrokeAttribute != mpStrokeAttribute)
+ {
+ if(mpStrokeAttribute->mnRefCount)
+ {
+ mpStrokeAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpStrokeAttribute;
+ }
+
+ mpStrokeAttribute = rCandidate.mpStrokeAttribute;
+ mpStrokeAttribute->mnRefCount++;
+ }
+
+ return *this;
+ }
+
+ bool StrokeAttribute::operator==(const StrokeAttribute& rCandidate) const
+ {
+ if(rCandidate.mpStrokeAttribute == mpStrokeAttribute)
+ {
+ return true;
+ }
+
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
+ return (*rCandidate.mpStrokeAttribute == *mpStrokeAttribute);
+ }
+
+ const ::std::vector< double >& StrokeAttribute::getDotDashArray() const
+ {
+ return mpStrokeAttribute->getDotDashArray();
+ }
- return mfFullDotDashLen;
+ double StrokeAttribute::getFullDotDashLen() const
+ {
+ return mpStrokeAttribute->getFullDotDashLen();
}
} // end of namespace attribute
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/geometry/viewinformation2d.cxx b/drawinglayer/source/geometry/viewinformation2d.cxx
index 8bcb3ccc14..cb8bcdc143 100644
--- a/drawinglayer/source/geometry/viewinformation2d.cxx
+++ b/drawinglayer/source/geometry/viewinformation2d.cxx
@@ -305,6 +305,22 @@ namespace drawinglayer
impInterpretPropertyValues(rViewParameters);
}
+ ImpViewInformation2D()
+ : mnRefCount(0),
+ maObjectTransformation(),
+ maViewTransformation(),
+ maObjectToViewTransformation(),
+ maInverseObjectToViewTransformation(),
+ maViewport(),
+ maDiscreteViewport(),
+ mxVisualizedPage(),
+ mfViewTime(),
+ mbReducedDisplayQuality(false),
+ mxViewInformation(),
+ mxExtendedInformation()
+ {
+ }
+
const basegfx::B2DHomMatrix& getObjectTransformation() const
{
return maObjectTransformation;
@@ -402,6 +418,21 @@ namespace drawinglayer
&& mfViewTime == rCandidate.mfViewTime
&& mxExtendedInformation == rCandidate.mxExtendedInformation);
}
+
+ static ImpViewInformation2D* get_global_default()
+ {
+ static ImpViewInformation2D* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpViewInformation2D();
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
};
} // end of anonymous namespace
} // end of namespace drawinglayer
@@ -434,6 +465,12 @@ namespace drawinglayer
{
}
+ ViewInformation2D::ViewInformation2D()
+ : mpViewInformation2D(ImpViewInformation2D::get_global_default())
+ {
+ mpViewInformation2D->mnRefCount++;
+ }
+
ViewInformation2D::ViewInformation2D(const ViewInformation2D& rCandidate)
: mpViewInformation2D(rCandidate.mpViewInformation2D)
{
@@ -455,6 +492,11 @@ namespace drawinglayer
}
}
+ bool ViewInformation2D::isDefault() const
+ {
+ return mpViewInformation2D == ImpViewInformation2D::get_global_default();
+ }
+
ViewInformation2D& ViewInformation2D::operator=(const ViewInformation2D& rCandidate)
{
::osl::Mutex m_mutex;
@@ -481,6 +523,11 @@ namespace drawinglayer
return true;
}
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
return (*rCandidate.mpViewInformation2D == *mpViewInformation2D);
}
diff --git a/drawinglayer/source/geometry/viewinformation3d.cxx b/drawinglayer/source/geometry/viewinformation3d.cxx
index b884c359d0..316d2e4d52 100644
--- a/drawinglayer/source/geometry/viewinformation3d.cxx
+++ b/drawinglayer/source/geometry/viewinformation3d.cxx
@@ -387,6 +387,18 @@ namespace drawinglayer
impInterpretPropertyValues(rViewParameters);
}
+ ImpViewInformation3D()
+ : mnRefCount(0),
+ maObjectTransformation(),
+ maOrientation(),
+ maProjection(),
+ maDeviceToView(),
+ mfViewTime(),
+ mxViewInformation(),
+ mxExtendedInformation()
+ {
+ }
+
const basegfx::B3DHomMatrix& getObjectTransformation() const { return maObjectTransformation; }
const basegfx::B3DHomMatrix& getOrientation() const { return maOrientation; }
const basegfx::B3DHomMatrix& getProjection() const { return maProjection; }
@@ -432,6 +444,21 @@ namespace drawinglayer
&& mfViewTime == rCandidate.mfViewTime
&& mxExtendedInformation == rCandidate.mxExtendedInformation);
}
+
+ static ImpViewInformation3D* get_global_default()
+ {
+ static ImpViewInformation3D* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpViewInformation3D();
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
};
} // end of anonymous namespace
} // end of namespace drawinglayer
@@ -449,7 +476,9 @@ namespace drawinglayer
const basegfx::B3DHomMatrix& rDeviceToView,
double fViewTime,
const uno::Sequence< beans::PropertyValue >& rExtendedParameters)
- : mpViewInformation3D(new ImpViewInformation3D(rObjectObjectTransformation, rOrientation, rProjection, rDeviceToView, fViewTime, rExtendedParameters))
+ : mpViewInformation3D(new ImpViewInformation3D(
+ rObjectObjectTransformation, rOrientation, rProjection,
+ rDeviceToView, fViewTime, rExtendedParameters))
{
}
@@ -458,6 +487,12 @@ namespace drawinglayer
{
}
+ ViewInformation3D::ViewInformation3D()
+ : mpViewInformation3D(ImpViewInformation3D::get_global_default())
+ {
+ mpViewInformation3D->mnRefCount++;
+ }
+
ViewInformation3D::ViewInformation3D(const ViewInformation3D& rCandidate)
: mpViewInformation3D(rCandidate.mpViewInformation3D)
{
@@ -479,6 +514,11 @@ namespace drawinglayer
}
}
+ bool ViewInformation3D::isDefault() const
+ {
+ return mpViewInformation3D == ImpViewInformation3D::get_global_default();
+ }
+
ViewInformation3D& ViewInformation3D::operator=(const ViewInformation3D& rCandidate)
{
::osl::Mutex m_mutex;
@@ -505,6 +545,11 @@ namespace drawinglayer
return true;
}
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
return (*rCandidate.mpViewInformation3D == *mpViewInformation3D);
}
diff --git a/drawinglayer/source/primitive2d/fillbitmapprimitive2d.cxx b/drawinglayer/source/primitive2d/fillbitmapprimitive2d.cxx
index 74aa857012..1d40970524 100644
--- a/drawinglayer/source/primitive2d/fillbitmapprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/fillbitmapprimitive2d.cxx
@@ -48,46 +48,54 @@ namespace drawinglayer
{
Primitive2DSequence FillBitmapPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
- const Size aTileSizePixel(getFillBitmap().getBitmapEx().GetSizePixel());
Primitive2DSequence aRetval;
- // is there a tile with some size at all?
- if(aTileSizePixel.getWidth() && aTileSizePixel.getHeight())
+ if(!getFillBitmap().isDefault())
{
- if(getFillBitmap().getTiling())
- {
- // get object range and create tiling matrices
- ::std::vector< basegfx::B2DHomMatrix > aMatrices;
- texture::GeoTexSvxTiled aTiling(getFillBitmap().getTopLeft(), getFillBitmap().getSize());
- aTiling.appendTransformations(aMatrices);
-
- // resize result
- aRetval.realloc(aMatrices.size());
+ const Size aTileSizePixel(getFillBitmap().getBitmapEx().GetSizePixel());
- // create one primitive for each matrix
- for(sal_uInt32 a(0L); a < aMatrices.size(); a++)
+ // is there a tile with some size at all?
+ if(aTileSizePixel.getWidth() && aTileSizePixel.getHeight())
+ {
+ if(getFillBitmap().getTiling())
{
- basegfx::B2DHomMatrix aNewMatrix = aMatrices[a];
- aNewMatrix *= getTransformation();
-
- // create bitmap primitive and add to result
- const Primitive2DReference xRef(new BitmapPrimitive2D(getFillBitmap().getBitmapEx(), aNewMatrix));
- aRetval[a] = xRef;
+ // get object range and create tiling matrices
+ ::std::vector< basegfx::B2DHomMatrix > aMatrices;
+ texture::GeoTexSvxTiled aTiling(getFillBitmap().getTopLeft(), getFillBitmap().getSize());
+ aTiling.appendTransformations(aMatrices);
+
+ // resize result
+ aRetval.realloc(aMatrices.size());
+
+ // create one primitive for each matrix
+ for(sal_uInt32 a(0L); a < aMatrices.size(); a++)
+ {
+ basegfx::B2DHomMatrix aNewMatrix = aMatrices[a];
+ aNewMatrix *= getTransformation();
+
+ // create bitmap primitive and add to result
+ const Primitive2DReference xRef(
+ new BitmapPrimitive2D(getFillBitmap().getBitmapEx(), aNewMatrix));
+
+ aRetval[a] = xRef;
+ }
+ }
+ else
+ {
+ // create new object transform
+ basegfx::B2DHomMatrix aObjectTransform;
+ aObjectTransform.set(0L, 0L, getFillBitmap().getSize().getX());
+ aObjectTransform.set(1L, 1L, getFillBitmap().getSize().getY());
+ aObjectTransform.set(0L, 2L, getFillBitmap().getTopLeft().getX());
+ aObjectTransform.set(1L, 2L, getFillBitmap().getTopLeft().getY());
+ aObjectTransform *= getTransformation();
+
+ // create bitmap primitive and add exclusive to decomposition (hand over ownership)
+ const Primitive2DReference xRef(
+ new BitmapPrimitive2D(getFillBitmap().getBitmapEx(), aObjectTransform));
+
+ aRetval = Primitive2DSequence(&xRef, 1L);
}
- }
- else
- {
- // create new object transform
- basegfx::B2DHomMatrix aObjectTransform;
- aObjectTransform.set(0L, 0L, getFillBitmap().getSize().getX());
- aObjectTransform.set(1L, 1L, getFillBitmap().getSize().getY());
- aObjectTransform.set(0L, 2L, getFillBitmap().getTopLeft().getX());
- aObjectTransform.set(1L, 2L, getFillBitmap().getTopLeft().getY());
- aObjectTransform *= getTransformation();
-
- // create bitmap primitive and add exclusive to decomposition (hand over ownership)
- const Primitive2DReference xRef(new BitmapPrimitive2D(getFillBitmap().getBitmapEx(), aObjectTransform));
- aRetval = Primitive2DSequence(&xRef, 1L);
}
}
@@ -119,7 +127,7 @@ namespace drawinglayer
basegfx::B2DRange FillBitmapPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
// return range of it
- basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ basegfx::B2DPolygon aPolygon(basegfx::tools::createUnitPolygon());
aPolygon.transform(getTransformation());
return basegfx::tools::getRange(aPolygon);
}
diff --git a/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx b/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx
index d985edae7b..d20952a95d 100644
--- a/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx
@@ -54,10 +54,10 @@ namespace drawinglayer
rColors.clear();
// make sure steps is not too high/low
- const basegfx::BColor aStart(maFillGradient.getStartColor());
- const basegfx::BColor aEnd(maFillGradient.getEndColor());
+ const basegfx::BColor aStart(getFillGradient().getStartColor());
+ const basegfx::BColor aEnd(getFillGradient().getEndColor());
const sal_uInt32 nMaxSteps(sal_uInt32((aStart.getMaximumDistance(aEnd) * 127.5) + 0.5));
- sal_uInt32 nSteps(maFillGradient.getSteps());
+ sal_uInt32 nSteps(getFillGradient().getSteps());
if(nSteps == 0)
{
@@ -74,46 +74,46 @@ namespace drawinglayer
nSteps = nMaxSteps;
}
- switch(maFillGradient.getStyle())
+ switch(getFillGradient().getStyle())
{
case attribute::GRADIENTSTYLE_LINEAR:
{
- texture::GeoTexSvxGradientLinear aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), -maFillGradient.getAngle());
+ texture::GeoTexSvxGradientLinear aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), getFillGradient().getAngle());
aGradient.appendTransformations(rMatrices);
aGradient.appendColors(rColors);
break;
}
case attribute::GRADIENTSTYLE_AXIAL:
{
- texture::GeoTexSvxGradientAxial aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), -maFillGradient.getAngle());
+ texture::GeoTexSvxGradientAxial aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), getFillGradient().getAngle());
aGradient.appendTransformations(rMatrices);
aGradient.appendColors(rColors);
break;
}
case attribute::GRADIENTSTYLE_RADIAL:
{
- texture::GeoTexSvxGradientRadial aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), maFillGradient.getOffsetX(), maFillGradient.getOffsetY());
+ texture::GeoTexSvxGradientRadial aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), getFillGradient().getOffsetX(), getFillGradient().getOffsetY());
aGradient.appendTransformations(rMatrices);
aGradient.appendColors(rColors);
break;
}
case attribute::GRADIENTSTYLE_ELLIPTICAL:
{
- texture::GeoTexSvxGradientElliptical aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), maFillGradient.getOffsetX(), maFillGradient.getOffsetY(), -maFillGradient.getAngle());
+ texture::GeoTexSvxGradientElliptical aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), getFillGradient().getOffsetX(), getFillGradient().getOffsetY(), getFillGradient().getAngle());
aGradient.appendTransformations(rMatrices);
aGradient.appendColors(rColors);
break;
}
case attribute::GRADIENTSTYLE_SQUARE:
{
- texture::GeoTexSvxGradientSquare aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), maFillGradient.getOffsetX(), maFillGradient.getOffsetY(), -maFillGradient.getAngle());
+ texture::GeoTexSvxGradientSquare aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), getFillGradient().getOffsetX(), getFillGradient().getOffsetY(), getFillGradient().getAngle());
aGradient.appendTransformations(rMatrices);
aGradient.appendColors(rColors);
break;
}
case attribute::GRADIENTSTYLE_RECT:
{
- texture::GeoTexSvxGradientRect aGradient(getObjectRange(), aStart, aEnd, nSteps, maFillGradient.getBorder(), maFillGradient.getOffsetX(), maFillGradient.getOffsetY(), -maFillGradient.getAngle());
+ texture::GeoTexSvxGradientRect aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), getFillGradient().getOffsetX(), getFillGradient().getOffsetY(), getFillGradient().getAngle());
aGradient.appendTransformations(rMatrices);
aGradient.appendColors(rColors);
break;
@@ -210,15 +210,19 @@ namespace drawinglayer
// prepare shape of the Unit Polygon
basegfx::B2DPolygon aUnitPolygon;
- if(attribute::GRADIENTSTYLE_RADIAL == maFillGradient.getStyle()
- || attribute::GRADIENTSTYLE_ELLIPTICAL == maFillGradient.getStyle())
+ if(attribute::GRADIENTSTYLE_RADIAL == getFillGradient().getStyle()
+ || attribute::GRADIENTSTYLE_ELLIPTICAL == getFillGradient().getStyle())
{
- const basegfx::B2DPoint aCircleCenter(0.5, 0.5);
- aUnitPolygon = basegfx::tools::createPolygonFromEllipse(aCircleCenter, 0.5, 0.5);
+ aUnitPolygon = basegfx::tools::createPolygonFromCircle(
+ basegfx::B2DPoint(0,0), 1);
+ }
+ else if(attribute::GRADIENTSTYLE_LINEAR == maFillGradient.getStyle())
+ {
+ aUnitPolygon = basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0, 0, 1, 1));
}
else
{
- aUnitPolygon = basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0));
+ aUnitPolygon = basegfx::tools::createPolygonFromRect(basegfx::B2DRange(-1, -1, 1, 1));
}
// get the transform matrices and colors (where colors
@@ -245,7 +249,15 @@ namespace drawinglayer
// that the rings will not overlap. This is useful fir the old XOR-paint
// 'trick' of VCL which is recorded in Metafiles; so this version may be
// used from the MetafilePrimitive2D in it's decomposition.
- return createFill(true);
+
+ if(!getFillGradient().isDefault())
+ {
+ return createFill(true);
+ }
+ else
+ {
+ return Primitive2DSequence();
+ }
}
FillGradientPrimitive2D::FillGradientPrimitive2D(
@@ -264,7 +276,7 @@ namespace drawinglayer
const FillGradientPrimitive2D& rCompare = (FillGradientPrimitive2D&)rPrimitive;
return (getObjectRange() == rCompare.getObjectRange()
- && maFillGradient == rCompare.maFillGradient);
+ && getFillGradient() == rCompare.getFillGradient());
}
return false;
diff --git a/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx
index 2bdfbb30e7..2410764b4a 100644
--- a/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx
@@ -49,65 +49,72 @@ namespace drawinglayer
{
Primitive2DSequence FillHatchPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
- // create hatch
- const basegfx::BColor aHatchColor(maFillHatch.getColor());
- const double fAngle(-maFillHatch.getAngle());
- ::std::vector< basegfx::B2DHomMatrix > aMatrices;
-
- // get hatch transformations
- switch(maFillHatch.getStyle())
+ Primitive2DSequence aRetval;
+ if(!getFillHatch().isDefault())
{
- case attribute::HATCHSTYLE_TRIPLE:
- {
- // rotated 45 degrees
- texture::GeoTexSvxHatch aHatch(getObjectRange(), maFillHatch.getDistance(), fAngle + F_PI4);
- aHatch.appendTransformations(aMatrices);
+ // create hatch
+ const basegfx::BColor aHatchColor(getFillHatch().getColor());
+ const double fAngle(getFillHatch().getAngle());
+ ::std::vector< basegfx::B2DHomMatrix > aMatrices;
- // fall-through by purpose
- }
- case attribute::HATCHSTYLE_DOUBLE:
+ // get hatch transformations
+ switch(getFillHatch().getStyle())
{
- // rotated 90 degrees
- texture::GeoTexSvxHatch aHatch(getObjectRange(), maFillHatch.getDistance(), fAngle + F_PI2);
- aHatch.appendTransformations(aMatrices);
-
- // fall-through by purpose
+ case attribute::HATCHSTYLE_TRIPLE:
+ {
+ // rotated 45 degrees
+ texture::GeoTexSvxHatch aHatch(getObjectRange(), getFillHatch().getDistance(), fAngle - F_PI4);
+ aHatch.appendTransformations(aMatrices);
+
+ // fall-through by purpose
+ }
+ case attribute::HATCHSTYLE_DOUBLE:
+ {
+ // rotated 90 degrees
+ texture::GeoTexSvxHatch aHatch(getObjectRange(), getFillHatch().getDistance(), fAngle - F_PI2);
+ aHatch.appendTransformations(aMatrices);
+
+ // fall-through by purpose
+ }
+ case attribute::HATCHSTYLE_SINGLE:
+ {
+ // angle as given
+ texture::GeoTexSvxHatch aHatch(getObjectRange(), getFillHatch().getDistance(), fAngle);
+ aHatch.appendTransformations(aMatrices);
+ }
}
- case attribute::HATCHSTYLE_SINGLE:
- {
- // angle as given
- texture::GeoTexSvxHatch aHatch(getObjectRange(), maFillHatch.getDistance(), fAngle);
- aHatch.appendTransformations(aMatrices);
- }
- }
- // prepare return value
- const bool bFillBackground(maFillHatch.isFillBackground());
- Primitive2DSequence aRetval(bFillBackground ? aMatrices.size() + 1L : aMatrices.size());
+ // prepare return value
+ const bool bFillBackground(getFillHatch().isFillBackground());
+ aRetval.realloc(bFillBackground ? aMatrices.size() + 1L : aMatrices.size());
- // evtl. create filled background
- if(bFillBackground)
- {
- // create primitive for background
- const Primitive2DReference xRef(new PolyPolygonColorPrimitive2D(basegfx::B2DPolyPolygon(basegfx::tools::createPolygonFromRect(getObjectRange())), maBColor));
- aRetval[0L] = xRef;
- }
+ // evtl. create filled background
+ if(bFillBackground)
+ {
+ // create primitive for background
+ const Primitive2DReference xRef(
+ new PolyPolygonColorPrimitive2D(
+ basegfx::B2DPolyPolygon(
+ basegfx::tools::createPolygonFromRect(getObjectRange())), getBColor()));
+ aRetval[0] = xRef;
+ }
- // create primitives
- const basegfx::B2DPoint aStart(0.0, 0.0);
- const basegfx::B2DPoint aEnd(1.0, 0.0);
+ // create primitives
+ const basegfx::B2DPoint aStart(0.0, 0.0);
+ const basegfx::B2DPoint aEnd(1.0, 0.0);
- for(sal_uInt32 a(0L); a < aMatrices.size(); a++)
- {
- const basegfx::B2DHomMatrix& rMatrix = aMatrices[a];
- basegfx::B2DPolygon aNewLine;
+ for(sal_uInt32 a(0L); a < aMatrices.size(); a++)
+ {
+ const basegfx::B2DHomMatrix& rMatrix = aMatrices[a];
+ basegfx::B2DPolygon aNewLine;
- aNewLine.append(rMatrix * aStart);
- aNewLine.append(rMatrix * aEnd);
+ aNewLine.append(rMatrix * aStart);
+ aNewLine.append(rMatrix * aEnd);
- // create hairline
- const Primitive2DReference xRef(new PolygonHairlinePrimitive2D(aNewLine, aHatchColor));
- aRetval[bFillBackground ? (a + 1L) : a] = xRef;
+ // create hairline
+ const Primitive2DReference xRef(new PolygonHairlinePrimitive2D(aNewLine, aHatchColor));
+ aRetval[bFillBackground ? (a + 1) : a] = xRef;
+ }
}
return aRetval;
@@ -131,8 +138,8 @@ namespace drawinglayer
const FillHatchPrimitive2D& rCompare = (FillHatchPrimitive2D&)rPrimitive;
return (getObjectRange() == rCompare.getObjectRange()
- && maFillHatch == rCompare.maFillHatch
- && maBColor == rCompare.maBColor);
+ && getFillHatch() == rCompare.getFillHatch()
+ && getBColor() == rCompare.getBColor());
}
return false;
diff --git a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
index ff5e38af4d..fd4467d449 100644
--- a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
@@ -764,9 +764,7 @@ namespace drawinglayer
{
// clipping needed. Embed to MaskPrimitive2D. Create childs and mask polygon
const primitive2d::Primitive2DSequence aChildContent(&xPrimitive, 1);
- basegfx::B2DPolygon aMaskPolygon(
- basegfx::tools::createPolygonFromRect(
- basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ basegfx::B2DPolygon aMaskPolygon(basegfx::tools::createUnitPolygon());
aMaskPolygon.transform(aTransform);
xPrimitive = Primitive2DReference(
@@ -872,7 +870,7 @@ namespace drawinglayer
else
{
// cropped got bigger, mask it with original object's bounds
- basegfx::B2DPolyPolygon aMaskPolyPolygon(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ basegfx::B2DPolyPolygon aMaskPolyPolygon(basegfx::tools::createUnitPolygon());
aMaskPolyPolygon.transform(getTransform());
// create maskPrimitive with aMaskPolyPolygon and aMaskContentVector
diff --git a/drawinglayer/source/primitive2d/hiddengeometryprimitive2d.cxx b/drawinglayer/source/primitive2d/hiddengeometryprimitive2d.cxx
new file mode 100644
index 0000000000..6e913a07d3
--- /dev/null
+++ b/drawinglayer/source/primitive2d/hiddengeometryprimitive2d.cxx
@@ -0,0 +1,75 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: hittestprimitive3d.cxx,v $
+ *
+ * $Revision: 1.1.2.1 $
+ *
+ * last change: $Author: aw $ $Date: 2008/09/25 17:12:14 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_drawinglayer.hxx"
+
+#include <drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx>
+#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ HiddenGeometryPrimitive2D::HiddenGeometryPrimitive2D(
+ const Primitive2DSequence& rChildren)
+ : GroupPrimitive2D(rChildren)
+ {
+ }
+
+ basegfx::B2DRange HiddenGeometryPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ return getB2DRangeFromPrimitive2DSequence(getChildren(), rViewInformation);
+ }
+
+ Primitive2DSequence HiddenGeometryPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
+ {
+ return Primitive2DSequence();
+ }
+
+ // provide unique ID
+ ImplPrimitrive2DIDBlock(HiddenGeometryPrimitive2D, PRIMITIVE2D_ID_HIDDENGEOMETRYPRIMITIVE2D)
+
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/primitive2d/hittestprimitive2d.cxx b/drawinglayer/source/primitive2d/hittestprimitive2d.cxx
deleted file mode 100644
index b299349c1e..0000000000
--- a/drawinglayer/source/primitive2d/hittestprimitive2d.cxx
+++ /dev/null
@@ -1,68 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_drawinglayer.hxx"
-
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
-#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
-
-//////////////////////////////////////////////////////////////////////////////
-
-using namespace com::sun::star;
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace primitive2d
- {
- HitTestPrimitive2D::HitTestPrimitive2D(
- const Primitive2DSequence& rChildren)
- : GroupPrimitive2D(rChildren)
- {
- }
-
- basegfx::B2DRange HitTestPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
- {
- return getB2DRangeFromPrimitive2DSequence(getChildren(), rViewInformation);
- }
-
- Primitive2DSequence HitTestPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
- {
- // return empty sequence
- return Primitive2DSequence();
- }
-
- // provide unique ID
- ImplPrimitrive2DIDBlock(HitTestPrimitive2D, PRIMITIVE2D_ID_HITTESTPRIMITIVE2D)
-
- } // end of namespace primitive2d
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-// eof
diff --git a/drawinglayer/source/primitive2d/makefile.mk b/drawinglayer/source/primitive2d/makefile.mk
index 87c6c15437..bca5805ae6 100644
--- a/drawinglayer/source/primitive2d/makefile.mk
+++ b/drawinglayer/source/primitive2d/makefile.mk
@@ -37,50 +37,51 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files -------------------------------------
SLOFILES= \
- $(SLO)$/alphaprimitive2d.obj \
- $(SLO)$/animatedprimitive2d.obj \
- $(SLO)$/baseprimitive2d.obj \
- $(SLO)$/backgroundcolorprimitive2d.obj \
- $(SLO)$/bitmapprimitive2d.obj \
- $(SLO)$/borderlineprimitive2d.obj \
- $(SLO)$/chartprimitive2d.obj \
- $(SLO)$/controlprimitive2d.obj \
- $(SLO)$/discretebitmapprimitive2d.obj \
- $(SLO)$/embedded3dprimitive2d.obj \
- $(SLO)$/epsprimitive2d.obj \
- $(SLO)$/fillbitmapprimitive2d.obj \
- $(SLO)$/fillgradientprimitive2d.obj \
- $(SLO)$/fillhatchprimitive2d.obj \
- $(SLO)$/graphicprimitive2d.obj \
- $(SLO)$/gridprimitive2d.obj \
- $(SLO)$/groupprimitive2d.obj \
- $(SLO)$/helplineprimitive2d.obj \
- $(SLO)$/hittestprimitive2d.obj \
- $(SLO)$/invertprimitive2d.obj \
- $(SLO)$/markerarrayprimitive2d.obj \
- $(SLO)$/pointarrayprimitive2d.obj \
- $(SLO)$/maskprimitive2d.obj \
- $(SLO)$/mediaprimitive2d.obj \
- $(SLO)$/metafileprimitive2d.obj \
- $(SLO)$/modifiedcolorprimitive2d.obj \
- $(SLO)$/pagepreviewprimitive2d.obj \
- $(SLO)$/polypolygonprimitive2d.obj \
- $(SLO)$/polygonprimitive2d.obj \
- $(SLO)$/primitivetools2d.obj \
- $(SLO)$/sceneprimitive2d.obj \
- $(SLO)$/shadowprimitive2d.obj \
- $(SLO)$/structuretagprimitive2d.obj \
- $(SLO)$/texteffectprimitive2d.obj \
- $(SLO)$/textenumsprimitive2d.obj \
- $(SLO)$/textlayoutdevice.obj \
- $(SLO)$/textlineprimitive2d.obj \
- $(SLO)$/textprimitive2d.obj \
- $(SLO)$/textstrikeoutprimitive2d.obj \
- $(SLO)$/textdecoratedprimitive2d.obj \
- $(SLO)$/texthierarchyprimitive2d.obj \
- $(SLO)$/transformprimitive2d.obj \
- $(SLO)$/unifiedalphaprimitive2d.obj \
- $(SLO)$/wallpaperprimitive2d.obj \
+ $(SLO)$/transparenceprimitive2d.obj \
+ $(SLO)$/animatedprimitive2d.obj \
+ $(SLO)$/baseprimitive2d.obj \
+ $(SLO)$/backgroundcolorprimitive2d.obj \
+ $(SLO)$/bitmapprimitive2d.obj \
+ $(SLO)$/borderlineprimitive2d.obj \
+ $(SLO)$/chartprimitive2d.obj \
+ $(SLO)$/controlprimitive2d.obj \
+ $(SLO)$/discretebitmapprimitive2d.obj \
+ $(SLO)$/embedded3dprimitive2d.obj \
+ $(SLO)$/epsprimitive2d.obj \
+ $(SLO)$/fillbitmapprimitive2d.obj \
+ $(SLO)$/fillgradientprimitive2d.obj \
+ $(SLO)$/fillhatchprimitive2d.obj \
+ $(SLO)$/graphicprimitive2d.obj \
+ $(SLO)$/gridprimitive2d.obj \
+ $(SLO)$/groupprimitive2d.obj \
+ $(SLO)$/helplineprimitive2d.obj \
+ $(SLO)$/hiddengeometryprimitive2d.obj \
+ $(SLO)$/invertprimitive2d.obj \
+ $(SLO)$/markerarrayprimitive2d.obj \
+ $(SLO)$/pointarrayprimitive2d.obj \
+ $(SLO)$/maskprimitive2d.obj \
+ $(SLO)$/mediaprimitive2d.obj \
+ $(SLO)$/metafileprimitive2d.obj \
+ $(SLO)$/modifiedcolorprimitive2d.obj \
+ $(SLO)$/pagepreviewprimitive2d.obj \
+ $(SLO)$/polypolygonprimitive2d.obj \
+ $(SLO)$/polygonprimitive2d.obj \
+ $(SLO)$/primitivetools2d.obj \
+ $(SLO)$/sceneprimitive2d.obj \
+ $(SLO)$/sdrdecompositiontools2d.obj \
+ $(SLO)$/shadowprimitive2d.obj \
+ $(SLO)$/structuretagprimitive2d.obj \
+ $(SLO)$/texteffectprimitive2d.obj \
+ $(SLO)$/textenumsprimitive2d.obj \
+ $(SLO)$/textlayoutdevice.obj \
+ $(SLO)$/textlineprimitive2d.obj \
+ $(SLO)$/textprimitive2d.obj \
+ $(SLO)$/textstrikeoutprimitive2d.obj \
+ $(SLO)$/textdecoratedprimitive2d.obj \
+ $(SLO)$/texthierarchyprimitive2d.obj \
+ $(SLO)$/transformprimitive2d.obj \
+ $(SLO)$/unifiedtransparenceprimitive2d.obj \
+ $(SLO)$/wallpaperprimitive2d.obj \
$(SLO)$/wrongspellprimitive2d.obj
# --- Targets ----------------------------------
diff --git a/drawinglayer/source/primitive2d/mediaprimitive2d.cxx b/drawinglayer/source/primitive2d/mediaprimitive2d.cxx
index e488aacfa8..2467776ab0 100644
--- a/drawinglayer/source/primitive2d/mediaprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/mediaprimitive2d.cxx
@@ -38,6 +38,7 @@
#include <drawinglayer/geometry/viewinformation2d.hxx>
#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
+#include <drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -50,9 +51,12 @@ namespace drawinglayer
Primitive2DSequence xRetval(1);
// create background object
- basegfx::B2DPolygon aBackgroundPolygon(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ basegfx::B2DPolygon aBackgroundPolygon(basegfx::tools::createUnitPolygon());
aBackgroundPolygon.transform(getTransform());
- const Primitive2DReference xRefBackground(new PolyPolygonColorPrimitive2D(basegfx::B2DPolyPolygon(aBackgroundPolygon), getBackgroundColor()));
+ const Primitive2DReference xRefBackground(
+ new PolyPolygonColorPrimitive2D(
+ basegfx::B2DPolyPolygon(aBackgroundPolygon),
+ getBackgroundColor()));
xRetval[0] = xRefBackground;
// try to get graphic snapshot
@@ -79,10 +83,13 @@ namespace drawinglayer
basegfx::B2DRange aDestRange(aSourceRange);
aDestRange.grow(-0.5 * fDiscreteSize);
- if(::basegfx::fTools::equalZero(aDestRange.getWidth()) || ::basegfx::fTools::equalZero(aDestRange.getHeight()))
+ if(basegfx::fTools::equalZero(aDestRange.getWidth()) || basegfx::fTools::equalZero(aDestRange.getHeight()))
{
- // shrunk primitive has no content (zero size in X or Y), nothing to display, nothing to return
- xRetval = Primitive2DSequence();
+ // shrunk primitive has no content (zero size in X or Y), nothing to display. Still create
+ // invisible content for HitTest and BoundRect
+ const Primitive2DReference xHiddenLines(new HiddenGeometryPrimitive2D(xRetval));
+
+ xRetval = Primitive2DSequence(&xHiddenLines, 1);
}
else
{
diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
index ab78bc3456..9d65643a27 100644
--- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
@@ -45,10 +45,10 @@
#include <drawinglayer/primitive2d/discretebitmapprimitive2d.hxx>
#include <drawinglayer/primitive2d/bitmapprimitive2d.hxx>
#include <vcl/salbtype.hxx>
-#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
#include <drawinglayer/primitive2d/fillgradientprimitive2d.hxx>
#include <vcl/svapp.hxx>
-#include <drawinglayer/primitive2d/alphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/transparenceprimitive2d.hxx>
#include <drawinglayer/primitive2d/fillhatchprimitive2d.hxx>
#include <drawinglayer/primitive2d/maskprimitive2d.hxx>
#include <basegfx/polygon/b2dpolygonclipper.hxx>
@@ -581,7 +581,14 @@ namespace drawinglayer
Primitive2DSequence NonOverlappingFillGradientPrimitive2D::create2DDecomposition(
const geometry::ViewInformation2D& /*rViewInformation*/) const
{
- return createFill(false);
+ if(!getFillGradient().isDefault())
+ {
+ return createFill(false);
+ }
+ else
+ {
+ return Primitive2DSequence();
+ }
}
} // end of namespace primitive2d
} // end of namespace drawinglayer
@@ -833,7 +840,7 @@ namespace
}
/** helper to create a regular BotmapEx from a MaskAction (definitions
- which use a bitmap without alpha but define one of the colors as
+ which use a bitmap without transparence but define one of the colors as
transparent)
*/
BitmapEx createMaskBmpEx(const Bitmap& rBitmap, const Color& rMaskColor)
@@ -966,7 +973,42 @@ namespace
TargetHolders& rTargetHolders,
PropertyHolders& rPropertyHolders)
{
- // process evtl. created primitives which belong to the current region settings
+ const bool bNewActive(pRegion && !pRegion->IsEmpty());
+
+ // #i108636# The handlig of new ClipRegions was not done as good as possible
+ // in the first version of this interpreter; e.g. when a ClipRegion was set
+ // initially and then using a lot of push/pop actions, the pop always leads
+ // to setting a 'new' ClipRegion which indeed is the return to the ClipRegion
+ // of the properties next on the stack.
+ // This ClipRegion is identical to the current one, so there is no need to
+ // create a MaskPrimitive2D containing the up-to-now created primitives, but
+ // this was done before. While this does not lead to wrong primitive
+ // representations of the metafile data, it creates unneccesarily expensive
+ // representations. Just detecting when no really 'new' ClipRegion gets set
+ // solves the problem.
+
+ if(!rPropertyHolders.Current().getRegionActive() && !bNewActive)
+ {
+ // no active region exchanged by no new one, done
+ return;
+ }
+
+ if(rPropertyHolders.Current().getRegionActive() && bNewActive)
+ {
+ // active region and new active region
+ if(rPropertyHolders.Current().getRegion() == *pRegion)
+ {
+ // new region is the same as the old region, done
+ return;
+ }
+ }
+
+ // Here the old region and the new one are definitively different, maybe
+ // old one and/or new one is not active.
+
+ // Handle deletion of old region.The process evtl. created primitives which
+ // belong to this active region. These need to be embedded to a
+ // MaskPrimitive2D accordingly.
if(rPropertyHolders.Current().getRegionActive() && rTargetHolders.size() > 1)
{
drawinglayer::primitive2d::Primitive2DSequence aSubContent;
@@ -986,8 +1028,8 @@ namespace
}
}
- // apply new settings
- const bool bNewActive(pRegion && !pRegion->IsEmpty());
+ // apply new settings to current properties by setting
+ // the new region now
rPropertyHolders.Current().setRegionActive(bNewActive);
if(bNewActive)
@@ -1244,13 +1286,12 @@ namespace
const XubString& rText,
sal_uInt16 nTextStart,
sal_uInt16 nTextLength,
- sal_Int32* pDXArray,
+ const ::std::vector< double >& rDXArray,
TargetHolder& rTarget,
PropertyHolder& rProperty)
{
drawinglayer::primitive2d::BasePrimitive2D* pResult = 0;
const Font& rFont = rProperty.getFont();
- std::vector< double > aDXArray;
basegfx::B2DVector aAlignmentOffset(0.0, 0.0);
if(nTextLength)
@@ -1268,17 +1309,6 @@ namespace
// add TextStartPosition
aTextTransform.translate(rTextStartPosition.X(), rTextStartPosition.Y());
- // preapare DXArray (if used)
- if(pDXArray && nTextLength)
- {
- aDXArray.reserve(nTextLength);
-
- for(xub_StrLen a(0); a < nTextLength; a++)
- {
- aDXArray.push_back((double)(*(pDXArray + a)));
- }
- }
-
// prepare FontColor and Locale
const basegfx::BColor aFontColor(rProperty.getTextColor());
const com::sun::star::lang::Locale aLocale(MsLangId::convertLanguageToLocale(rProperty.getLanguageType()));
@@ -1338,7 +1368,7 @@ namespace
rText,
nTextStart,
nTextLength,
- aDXArray,
+ rDXArray,
aFontAttribute,
aLocale,
aFontColor,
@@ -1365,7 +1395,7 @@ namespace
rText,
nTextStart,
nTextLength,
- aDXArray,
+ rDXArray,
aFontAttribute,
aLocale,
aFontColor);
@@ -1381,13 +1411,13 @@ namespace
// get text width
double fTextWidth(0.0);
- if(aDXArray.empty())
+ if(rDXArray.empty())
{
fTextWidth = aTextLayouterDevice.getTextWidth(rText, nTextStart, nTextLength);
}
else
{
- fTextWidth = aDXArray.back();
+ fTextWidth = rDXArray.back();
}
if(basegfx::fTools::more(fTextWidth, 0.0))
@@ -1942,15 +1972,24 @@ namespace
{
/** CHECKED, WORKS WELL */
const MetaTextAction* pA = (const MetaTextAction*)pAction;
+ sal_uInt32 nTextLength(pA->GetLen());
+ const sal_uInt32 nTextIndex(pA->GetIndex());
+ const sal_uInt32 nStringLength(pA->GetText().Len());
+
+ if(nTextLength + nTextIndex > nStringLength)
+ {
+ nTextLength = nStringLength - nTextIndex;
+ }
- if(pA->GetLen() && rPropertyHolders.Current().getTextColorActive())
+ if(nTextLength && rPropertyHolders.Current().getTextColorActive())
{
+ const std::vector< double > aDXArray;
proccessMetaTextAction(
pA->GetPoint(),
pA->GetText(),
- pA->GetIndex(),
- pA->GetLen(),
- 0,
+ nTextIndex,
+ nTextLength,
+ aDXArray,
rTargetHolders.Current(),
rPropertyHolders.Current());
}
@@ -1961,15 +2000,37 @@ namespace
{
/** CHECKED, WORKS WELL */
const MetaTextArrayAction* pA = (const MetaTextArrayAction*)pAction;
+ sal_uInt32 nTextLength(pA->GetLen());
+ const sal_uInt32 nTextIndex(pA->GetIndex());
+ const sal_uInt32 nStringLength(pA->GetText().Len());
+
+ if(nTextLength + nTextIndex > nStringLength)
+ {
+ nTextLength = nStringLength - nTextIndex;
+ }
- if(pA->GetLen() && rPropertyHolders.Current().getTextColorActive())
+ if(nTextLength && rPropertyHolders.Current().getTextColorActive())
{
+ // preapare DXArray (if used)
+ std::vector< double > aDXArray;
+ sal_Int32* pDXArray = pA->GetDXArray();
+
+ if(pDXArray)
+ {
+ aDXArray.reserve(nTextLength);
+
+ for(sal_uInt32 a(0); a < nTextLength; a++)
+ {
+ aDXArray.push_back((double)(*(pDXArray + a)));
+ }
+ }
+
proccessMetaTextAction(
pA->GetPoint(),
pA->GetText(),
- pA->GetIndex(),
- pA->GetLen(),
- pA->GetDXArray(),
+ nTextIndex,
+ nTextLength,
+ aDXArray,
rTargetHolders.Current(),
rPropertyHolders.Current());
}
@@ -1978,10 +2039,65 @@ namespace
}
case META_STRETCHTEXT_ACTION :
{
- /** NEEDS IMPLEMENTATION */
- OSL_ENSURE(false, "META_STRETCHTEXT_ACTION requested (!)");
- // use OutputDevice::GetTextArray() to map the...
- // const MetaStretchTextAction* pA = (const MetaStretchTextAction*)pAction;
+ // #i108440# StarMath uses MetaStretchTextAction, thus support is needed.
+ // It looks as if it pretty never really uses a width different from
+ // the default text-layout width, but it's not possible to be sure.
+ // Implemented getting the DXArray and checking for scale at all. If
+ // scale is more than 3.5% different, scale the DXArray before usage.
+ // New status:
+
+ /** CHECKED, WORKS WELL */
+ const MetaStretchTextAction* pA = (const MetaStretchTextAction*)pAction;
+ sal_uInt32 nTextLength(pA->GetLen());
+ const sal_uInt32 nTextIndex(pA->GetIndex());
+ const sal_uInt32 nStringLength(pA->GetText().Len());
+
+ if(nTextLength + nTextIndex > nStringLength)
+ {
+ nTextLength = nStringLength - nTextIndex;
+ }
+
+ if(nTextLength && rPropertyHolders.Current().getTextColorActive())
+ {
+ drawinglayer::primitive2d::TextLayouterDevice aTextLayouterDevice;
+ aTextLayouterDevice.setFont(rPropertyHolders.Current().getFont());
+
+ ::std::vector< double > aTextArray(
+ aTextLayouterDevice.getTextArray(
+ pA->GetText(),
+ nTextIndex,
+ nTextLength));
+
+ if(!aTextArray.empty())
+ {
+ const double fTextLength(aTextArray.back());
+
+ if(0.0 != fTextLength && pA->GetWidth())
+ {
+ const double fRelative(pA->GetWidth() / fTextLength);
+
+ if(fabs(fRelative - 1.0) >= 0.035)
+ {
+ // when derivation is more than 3,5% from default text size,
+ // scale the DXArray
+ for(sal_uInt32 a(0); a < aTextArray.size(); a++)
+ {
+ aTextArray[a] *= fRelative;
+ }
+ }
+ }
+ }
+
+ proccessMetaTextAction(
+ pA->GetPoint(),
+ pA->GetText(),
+ nTextIndex,
+ nTextLength,
+ aTextArray,
+ rTargetHolders.Current(),
+ rPropertyHolders.Current());
+ }
+
break;
}
case META_TEXTRECT_ACTION :
@@ -1990,8 +2106,9 @@ namespace
// OSL_ENSURE(false, "META_TEXTRECT_ACTION requested (!)");
const MetaTextRectAction* pA = (const MetaTextRectAction*)pAction;
const Rectangle& rRectangle = pA->GetRect();
+ const sal_uInt32 nStringLength(pA->GetText().Len());
- if(!rRectangle.IsEmpty() && 0 != pA->GetText().Len())
+ if(!rRectangle.IsEmpty() && 0 != nStringLength)
{
// The problem with this action is that it describes unlayouted text
// and the layout capabilities are in EditEngine/Outliner in SVX. The
@@ -2720,7 +2837,7 @@ namespace
if(aSubContent.hasElements())
{
rTargetHolders.Current().append(
- new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D(
+ new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(
aSubContent,
nTransparence * 0.01));
}
@@ -2831,9 +2948,9 @@ namespace
if(aAttribute.getStartColor() == aAttribute.getEndColor())
{
- // not really a gradient; create UnifiedAlphaPrimitive2D
+ // not really a gradient; create UnifiedTransparencePrimitive2D
rTargetHolders.Current().append(
- new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D(
+ new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(
xSubContent,
aAttribute.getStartColor().luminance()));
}
@@ -2845,17 +2962,17 @@ namespace
aTargetRectangle.Right(), aTargetRectangle.Bottom());
aRange.transform(rPropertyHolders.Current().getTransformation());
- // prepare gradient for alpha content
- const drawinglayer::primitive2d::Primitive2DReference xAlpha(
+ // prepare gradient for transparent content
+ const drawinglayer::primitive2d::Primitive2DReference xTransparence(
new drawinglayer::primitive2d::FillGradientPrimitive2D(
aRange,
aAttribute));
- // create alpha primitive
+ // create transparence primitive
rTargetHolders.Current().append(
- new drawinglayer::primitive2d::AlphaPrimitive2D(
+ new drawinglayer::primitive2d::TransparencePrimitive2D(
xSubContent,
- drawinglayer::primitive2d::Primitive2DSequence(&xAlpha, 1)));
+ drawinglayer::primitive2d::Primitive2DSequence(&xTransparence, 1)));
}
}
}
diff --git a/drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx b/drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx
index f5f2b393e3..e7bd3e45b4 100644
--- a/drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx
@@ -69,7 +69,10 @@ namespace drawinglayer
if(!aAllowedContentRange.isInside(aRealContentRange))
{
- const Primitive2DReference xReferenceA(new MaskPrimitive2D(basegfx::B2DPolyPolygon(basegfx::tools::createPolygonFromRect(aAllowedContentRange)), aContent));
+ const Primitive2DReference xReferenceA(
+ new MaskPrimitive2D(
+ basegfx::B2DPolyPolygon(
+ basegfx::tools::createPolygonFromRect(aAllowedContentRange)), aContent));
aContent = Primitive2DSequence(&xReferenceA, 1);
}
diff --git a/drawinglayer/source/primitive2d/polygonprimitive2d.cxx b/drawinglayer/source/primitive2d/polygonprimitive2d.cxx
index ffe14e9738..43adc24a17 100644
--- a/drawinglayer/source/primitive2d/polygonprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/polygonprimitive2d.cxx
@@ -35,6 +35,7 @@
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
#include <drawinglayer/geometry/viewinformation2d.hxx>
+#include <basegfx/polygon/b2dlinegeometry.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -235,7 +236,7 @@ namespace drawinglayer
const basegfx::B2DPolygon aB2DPolygon(basegfx::tools::simplifyCurveSegments(getB2DPolygon()));
basegfx::B2DPolyPolygon aHairLinePolyPolygon;
- if(0.0 == getStrokeAttribute().getFullDotDashLen())
+ if(getStrokeAttribute().isDefault() || 0.0 == getStrokeAttribute().getFullDotDashLen())
{
// no line dashing, just copy
aHairLinePolyPolygon.append(aB2DPolygon);
@@ -243,12 +244,14 @@ namespace drawinglayer
else
{
// apply LineStyle
- basegfx::tools::applyLineDashing(aB2DPolygon, getStrokeAttribute().getDotDashArray(), &aHairLinePolyPolygon, 0, getStrokeAttribute().getFullDotDashLen());
+ basegfx::tools::applyLineDashing(
+ aB2DPolygon, getStrokeAttribute().getDotDashArray(),
+ &aHairLinePolyPolygon, 0, getStrokeAttribute().getFullDotDashLen());
}
const sal_uInt32 nCount(aHairLinePolyPolygon.count());
- if(getLineAttribute().getWidth())
+ if(!getLineAttribute().isDefault() && getLineAttribute().getWidth())
{
// create fat line data
const double fHalfLineWidth(getLineAttribute().getWidth() / 2.0);
@@ -285,7 +288,11 @@ namespace drawinglayer
else
{
// prepare return value
- const Primitive2DReference xRef(new PolyPolygonHairlinePrimitive2D(aHairLinePolyPolygon, getLineAttribute().getColor()));
+ const Primitive2DReference xRef(
+ new PolyPolygonHairlinePrimitive2D(
+ aHairLinePolyPolygon,
+ getLineAttribute().getColor()));
+
return Primitive2DSequence(&xRef, 1);
}
}
@@ -511,7 +518,7 @@ namespace drawinglayer
double fStart(0.0);
double fEnd(0.0);
- if(getStart().isActive())
+ if(!getStart().isDefault() && getStart().isActive())
{
// create start arrow primitive and consume
aArrowA = basegfx::tools::createAreaGeometryForLineStartEnd(
@@ -522,7 +529,7 @@ namespace drawinglayer
fStart *= 0.8;
}
- if(getEnd().isActive())
+ if(!getEnd().isDefault() && getEnd().isActive())
{
// create end arrow primitive and consume
aArrowB = basegfx::tools::createAreaGeometryForLineStartEnd(
@@ -545,18 +552,24 @@ namespace drawinglayer
sal_uInt32 nInd(0L);
// add shaft
- const Primitive2DReference xRefShaft(new PolygonStrokePrimitive2D(aLocalPolygon, getLineAttribute(), getStrokeAttribute()));
+ const Primitive2DReference xRefShaft(new
+ PolygonStrokePrimitive2D(
+ aLocalPolygon, getLineAttribute(), getStrokeAttribute()));
aRetval[nInd++] = xRefShaft;
if(aArrowA.count())
{
- const Primitive2DReference xRefA(new PolyPolygonColorPrimitive2D(aArrowA, getLineAttribute().getColor()));
+ const Primitive2DReference xRefA(
+ new PolyPolygonColorPrimitive2D(
+ aArrowA, getLineAttribute().getColor()));
aRetval[nInd++] = xRefA;
}
if(aArrowB.count())
{
- const Primitive2DReference xRefB(new PolyPolygonColorPrimitive2D(aArrowB, getLineAttribute().getColor()));
+ const Primitive2DReference xRefB(
+ new PolyPolygonColorPrimitive2D(
+ aArrowB, getLineAttribute().getColor()));
aRetval[nInd++] = xRefB;
}
diff --git a/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx b/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx
index accad5c51e..8a2e6dce75 100644
--- a/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx
@@ -188,7 +188,9 @@ namespace drawinglayer
for(sal_uInt32 a(0L); a < nCount; a++)
{
- aRetval[a] = Primitive2DReference(new PolygonStrokePrimitive2D(aPolyPolygon.getB2DPolygon(a), getLineAttribute(), getStrokeAttribute()));
+ aRetval[a] = Primitive2DReference(
+ new PolygonStrokePrimitive2D(
+ aPolyPolygon.getB2DPolygon(a), getLineAttribute(), getStrokeAttribute()));
}
return aRetval;
@@ -276,11 +278,14 @@ namespace drawinglayer
if(aPolygon.isClosed())
{
// no need for PolygonStrokeArrowPrimitive2D when polygon is closed
- aRetval[a] = Primitive2DReference(new PolygonStrokePrimitive2D(aPolygon, getLineAttribute(), getStrokeAttribute()));
+ aRetval[a] = Primitive2DReference(
+ new PolygonStrokePrimitive2D(aPolygon, getLineAttribute(), getStrokeAttribute()));
}
else
{
- aRetval[a] = Primitive2DReference(new PolygonStrokeArrowPrimitive2D(aPolygon, getLineAttribute(), getStrokeAttribute(), getStart(), getEnd()));
+ aRetval[a] = Primitive2DReference(
+ new PolygonStrokeArrowPrimitive2D(aPolygon, getLineAttribute(),
+ getStrokeAttribute(), getStart(), getEnd()));
}
}
@@ -398,16 +403,24 @@ namespace drawinglayer
{
Primitive2DSequence PolyPolygonGradientPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
- // create SubSequence with FillGradientPrimitive2D
- const basegfx::B2DRange aPolyPolygonRange(getB2DPolyPolygon().getB2DRange());
- FillGradientPrimitive2D* pNewGradient = new FillGradientPrimitive2D(aPolyPolygonRange, getFillGradient());
- const Primitive2DReference xSubRef(pNewGradient);
- const Primitive2DSequence aSubSequence(&xSubRef, 1L);
-
- // create mask primitive
- MaskPrimitive2D* pNewMask = new MaskPrimitive2D(getB2DPolyPolygon(), aSubSequence);
- const Primitive2DReference xRef(pNewMask);
- return Primitive2DSequence(&xRef, 1L);
+ if(!getFillGradient().isDefault())
+ {
+ // create SubSequence with FillGradientPrimitive2D
+ const basegfx::B2DRange aPolyPolygonRange(getB2DPolyPolygon().getB2DRange());
+ FillGradientPrimitive2D* pNewGradient = new FillGradientPrimitive2D(aPolyPolygonRange, getFillGradient());
+ const Primitive2DReference xSubRef(pNewGradient);
+ const Primitive2DSequence aSubSequence(&xSubRef, 1L);
+
+ // create mask primitive
+ MaskPrimitive2D* pNewMask = new MaskPrimitive2D(getB2DPolyPolygon(), aSubSequence);
+ const Primitive2DReference xRef(pNewMask);
+
+ return Primitive2DSequence(&xRef, 1);
+ }
+ else
+ {
+ return Primitive2DSequence();
+ }
}
PolyPolygonGradientPrimitive2D::PolyPolygonGradientPrimitive2D(
@@ -445,16 +458,24 @@ namespace drawinglayer
{
Primitive2DSequence PolyPolygonHatchPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
- // create SubSequence with FillHatchPrimitive2D
- const basegfx::B2DRange aPolyPolygonRange(getB2DPolyPolygon().getB2DRange());
- FillHatchPrimitive2D* pNewHatch = new FillHatchPrimitive2D(aPolyPolygonRange, getBackgroundColor(), getFillHatch());
- const Primitive2DReference xSubRef(pNewHatch);
- const Primitive2DSequence aSubSequence(&xSubRef, 1L);
-
- // create mask primitive
- MaskPrimitive2D* pNewMask = new MaskPrimitive2D(getB2DPolyPolygon(), aSubSequence);
- const Primitive2DReference xRef(pNewMask);
- return Primitive2DSequence(&xRef, 1L);
+ if(!getFillHatch().isDefault())
+ {
+ // create SubSequence with FillHatchPrimitive2D
+ const basegfx::B2DRange aPolyPolygonRange(getB2DPolyPolygon().getB2DRange());
+ FillHatchPrimitive2D* pNewHatch = new FillHatchPrimitive2D(aPolyPolygonRange, getBackgroundColor(), getFillHatch());
+ const Primitive2DReference xSubRef(pNewHatch);
+ const Primitive2DSequence aSubSequence(&xSubRef, 1L);
+
+ // create mask primitive
+ MaskPrimitive2D* pNewMask = new MaskPrimitive2D(getB2DPolyPolygon(), aSubSequence);
+ const Primitive2DReference xRef(pNewMask);
+
+ return Primitive2DSequence(&xRef, 1);
+ }
+ else
+ {
+ return Primitive2DSequence();
+ }
}
PolyPolygonHatchPrimitive2D::PolyPolygonHatchPrimitive2D(
@@ -495,21 +516,29 @@ namespace drawinglayer
{
Primitive2DSequence PolyPolygonBitmapPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
- // create SubSequence with FillBitmapPrimitive2D
- const basegfx::B2DRange aPolyPolygonRange(getB2DPolyPolygon().getB2DRange());
- basegfx::B2DHomMatrix aNewObjectTransform;
- aNewObjectTransform.set(0, 0, aPolyPolygonRange.getWidth());
- aNewObjectTransform.set(1, 1, aPolyPolygonRange.getHeight());
- aNewObjectTransform.set(0, 2, aPolyPolygonRange.getMinX());
- aNewObjectTransform.set(1, 2, aPolyPolygonRange.getMinY());
- FillBitmapPrimitive2D* pNewBitmap = new FillBitmapPrimitive2D(aNewObjectTransform, getFillBitmap());
- const Primitive2DReference xSubRef(pNewBitmap);
- const Primitive2DSequence aSubSequence(&xSubRef, 1L);
-
- // create mask primitive
- MaskPrimitive2D* pNewMask = new MaskPrimitive2D(getB2DPolyPolygon(), aSubSequence);
- const Primitive2DReference xRef(pNewMask);
- return Primitive2DSequence(&xRef, 1L);
+ if(!getFillBitmap().isDefault())
+ {
+ // create SubSequence with FillBitmapPrimitive2D
+ const basegfx::B2DRange aPolyPolygonRange(getB2DPolyPolygon().getB2DRange());
+ basegfx::B2DHomMatrix aNewObjectTransform;
+ aNewObjectTransform.set(0, 0, aPolyPolygonRange.getWidth());
+ aNewObjectTransform.set(1, 1, aPolyPolygonRange.getHeight());
+ aNewObjectTransform.set(0, 2, aPolyPolygonRange.getMinX());
+ aNewObjectTransform.set(1, 2, aPolyPolygonRange.getMinY());
+ FillBitmapPrimitive2D* pNewBitmap = new FillBitmapPrimitive2D(aNewObjectTransform, getFillBitmap());
+ const Primitive2DReference xSubRef(pNewBitmap);
+ const Primitive2DSequence aSubSequence(&xSubRef, 1L);
+
+ // create mask primitive
+ MaskPrimitive2D* pNewMask = new MaskPrimitive2D(getB2DPolyPolygon(), aSubSequence);
+ const Primitive2DReference xRef(pNewMask);
+
+ return Primitive2DSequence(&xRef, 1);
+ }
+ else
+ {
+ return Primitive2DSequence();
+ }
}
PolyPolygonBitmapPrimitive2D::PolyPolygonBitmapPrimitive2D(
diff --git a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
index b5305c32ed..f213162b71 100644
--- a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
@@ -148,8 +148,10 @@ namespace drawinglayer
if(impGetShadow3D(rViewInformation))
{
// test visibility
- const basegfx::B2DRange aShadow2DRange(getB2DRangeFromPrimitive2DSequence(maShadowPrimitives, rViewInformation));
- const basegfx::B2DRange aViewRange(rViewInformation.getViewport());
+ const basegfx::B2DRange aShadow2DRange(
+ getB2DRangeFromPrimitive2DSequence(maShadowPrimitives, rViewInformation));
+ const basegfx::B2DRange aViewRange(
+ rViewInformation.getViewport());
if(aViewRange.isEmpty() || aShadow2DRange.overlaps(aViewRange))
{
@@ -162,6 +164,7 @@ namespace drawinglayer
basegfx::B2DRange aDiscreteRange;
basegfx::B2DRange aVisibleDiscreteRange;
basegfx::B2DRange aUnitVisibleRange;
+
calculateDiscreteSizes(rViewInformation, aDiscreteRange, aVisibleDiscreteRange, aUnitVisibleRange);
if(!aVisibleDiscreteRange.isEmpty())
@@ -227,8 +230,9 @@ namespace drawinglayer
aUnitVisibleRange,
nOversampleValue);
- aZBufferProcessor3D.processNonTransparent(getChildren3D());
- aZBufferProcessor3D.processTransparent(getChildren3D());
+ aZBufferProcessor3D.process(getChildren3D());
+ aZBufferProcessor3D.finish();
+
const_cast< ScenePrimitive2D* >(this)->maOldRenderedBitmap = aZBufferProcessor3D.getBitmapEx();
const Size aBitmapSizePixel(maOldRenderedBitmap.GetSizePixel());
@@ -254,7 +258,7 @@ namespace drawinglayer
if(bAddOutlineToCreated3DSceneRepresentation)
{
- basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ basegfx::B2DPolygon aOutline(basegfx::tools::createUnitPolygon());
aOutline.transform(aNew2DTransform);
const Primitive2DReference xRef2(new PolygonHairlinePrimitive2D(aOutline, basegfx::BColor(1.0, 0.0, 0.0)));
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, xRef2);
diff --git a/drawinglayer/source/primitive2d/sdrdecompositiontools2d.cxx b/drawinglayer/source/primitive2d/sdrdecompositiontools2d.cxx
new file mode 100644
index 0000000000..e142deafdb
--- /dev/null
+++ b/drawinglayer/source/primitive2d/sdrdecompositiontools2d.cxx
@@ -0,0 +1,130 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrdecompositiontools3d.cxx,v $
+ *
+ * $Revision: 1.7 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:21 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_drawinglayer.hxx"
+
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
+#include <drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ Primitive2DReference createHiddenGeometryPrimitives2D(
+ bool bFilled,
+ const basegfx::B2DHomMatrix& rMatrix)
+ {
+ const basegfx::B2DPolygon aUnitOutline(basegfx::tools::createUnitPolygon());
+
+ return createHiddenGeometryPrimitives2D(
+ bFilled,
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ rMatrix);
+ }
+
+ Primitive2DReference createHiddenGeometryPrimitives2D(
+ bool bFilled,
+ const basegfx::B2DPolyPolygon& rPolyPolygon)
+ {
+ return createHiddenGeometryPrimitives2D(
+ bFilled,
+ rPolyPolygon,
+ basegfx::B2DHomMatrix());
+ }
+
+ Primitive2DReference createHiddenGeometryPrimitives2D(
+ bool bFilled,
+ const basegfx::B2DRange& rRange)
+ {
+ return createHiddenGeometryPrimitives2D(
+ bFilled,
+ rRange,
+ basegfx::B2DHomMatrix());
+ }
+
+ Primitive2DReference createHiddenGeometryPrimitives2D(
+ bool bFilled,
+ const basegfx::B2DRange& rRange,
+ const basegfx::B2DHomMatrix& rMatrix)
+ {
+ const basegfx::B2DPolyPolygon aOutline(basegfx::tools::createPolygonFromRect(rRange));
+
+ return createHiddenGeometryPrimitives2D(
+ bFilled,
+ aOutline,
+ rMatrix);
+ }
+
+ Primitive2DReference createHiddenGeometryPrimitives2D(
+ bool bFilled,
+ const basegfx::B2DPolyPolygon& rPolyPolygon,
+ const basegfx::B2DHomMatrix& rMatrix)
+ {
+ // create fill or line primitive
+ Primitive2DReference xReference;
+ basegfx::B2DPolyPolygon aScaledOutline(rPolyPolygon);
+ aScaledOutline.transform(rMatrix);
+
+ if(bFilled)
+ {
+ xReference = new PolyPolygonColorPrimitive2D(
+ basegfx::B2DPolyPolygon(aScaledOutline),
+ basegfx::BColor(0.0, 0.0, 0.0));
+ }
+ else
+ {
+ const basegfx::BColor aGrayTone(0xc0 / 255.0, 0xc0 / 255.0, 0xc0 / 255.0);
+
+ xReference = new PolyPolygonHairlinePrimitive2D(
+ aScaledOutline,
+ aGrayTone);
+ }
+
+ // create HiddenGeometryPrimitive2D
+ return Primitive2DReference(
+ new HiddenGeometryPrimitive2D(Primitive2DSequence(&xReference, 1)));
+ }
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/primitive2d/shadowprimitive2d.cxx b/drawinglayer/source/primitive2d/shadowprimitive2d.cxx
index fd537460c6..862f5cc5e3 100644
--- a/drawinglayer/source/primitive2d/shadowprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/shadowprimitive2d.cxx
@@ -33,8 +33,8 @@
#include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx>
#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
#include <basegfx/tools/canvastools.hxx>
-#include <drawinglayer/primitive2d/alphaprimitive2d.hxx>
-#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/transparenceprimitive2d.hxx>
+#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
//////////////////////////////////////////////////////////////////////////////
diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
index 0f5b70e1ee..8d39dd2d55 100644
--- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx
+++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
@@ -215,8 +215,8 @@ namespace drawinglayer
double TextLayouterDevice::getTextWidth(
const String& rText,
- xub_StrLen nIndex,
- xub_StrLen nLength) const
+ sal_uInt32 nIndex,
+ sal_uInt32 nLength) const
{
return mrDevice.GetTextWidth(rText, nIndex, nLength);
}
@@ -224,15 +224,22 @@ namespace drawinglayer
bool TextLayouterDevice::getTextOutlines(
basegfx::B2DPolyPolygonVector& rB2DPolyPolyVector,
const String& rText,
- xub_StrLen nIndex,
- xub_StrLen nLength,
- const ::std::vector< double >& rDXArray)
+ sal_uInt32 nIndex,
+ sal_uInt32 nLength,
+ const ::std::vector< double >& rDXArray) const
{
const sal_uInt32 nDXArrayCount(rDXArray.size());
+ sal_uInt32 nTextLength(nLength);
+ const sal_uInt32 nStringLength(rText.Len());
+
+ if(nTextLength + nIndex > nStringLength)
+ {
+ nTextLength = nStringLength - nIndex;
+ }
if(nDXArrayCount)
{
- OSL_ENSURE(nDXArrayCount == nLength, "DXArray size does not correspond to text portion size (!)");
+ OSL_ENSURE(nDXArrayCount == nTextLength, "DXArray size does not correspond to text portion size (!)");
std::vector< sal_Int32 > aIntegerDXArray(nDXArrayCount);
for(sal_uInt32 a(0); a < nDXArrayCount; a++)
@@ -266,10 +273,18 @@ namespace drawinglayer
basegfx::B2DRange TextLayouterDevice::getTextBoundRect(
const String& rText,
- xub_StrLen nIndex,
- xub_StrLen nLength) const
+ sal_uInt32 nIndex,
+ sal_uInt32 nLength) const
{
- if(nLength)
+ sal_uInt32 nTextLength(nLength);
+ const sal_uInt32 nStringLength(rText.Len());
+
+ if(nTextLength + nIndex > nStringLength)
+ {
+ nTextLength = nStringLength - nIndex;
+ }
+
+ if(nTextLength)
{
Rectangle aRect;
@@ -283,7 +298,9 @@ namespace drawinglayer
// #i104432#, #i102556# take empty results into account
if(!aRect.IsEmpty())
{
- return basegfx::B2DRange(aRect.Left(), aRect.Top(), aRect.Right(), aRect.Bottom());
+ return basegfx::B2DRange(
+ aRect.Left(), aRect.Top(),
+ aRect.Right(), aRect.Bottom());
}
}
@@ -306,11 +323,41 @@ namespace drawinglayer
const Rectangle& rRectangle,
const String& rText,
sal_uInt16 nStyle,
- GDIMetaFile& rGDIMetaFile)
+ GDIMetaFile& rGDIMetaFile) const
{
mrDevice.AddTextRectActions(
rRectangle, rText, nStyle, rGDIMetaFile);
}
+
+ ::std::vector< double > TextLayouterDevice::getTextArray(
+ const String& rText,
+ sal_uInt32 nIndex,
+ sal_uInt32 nLength) const
+ {
+ ::std::vector< double > aRetval;
+ sal_uInt32 nTextLength(nLength);
+ const sal_uInt32 nStringLength(rText.Len());
+
+ if(nTextLength + nIndex > nStringLength)
+ {
+ nTextLength = nStringLength - nIndex;
+ }
+
+ if(nTextLength)
+ {
+ aRetval.reserve(nTextLength);
+ sal_Int32* pArray = new sal_Int32[nTextLength];
+ mrDevice.GetTextArray(rText, pArray, nIndex, nLength);
+
+ for(sal_uInt32 a(0); a < nTextLength; a++)
+ {
+ aRetval.push_back(pArray[a]);
+ }
+ }
+
+ return aRetval;
+ }
+
} // end of namespace primitive2d
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/primitive2d/transparenceprimitive2d.cxx b/drawinglayer/source/primitive2d/transparenceprimitive2d.cxx
new file mode 100644
index 0000000000..0923234e67
--- /dev/null
+++ b/drawinglayer/source/primitive2d/transparenceprimitive2d.cxx
@@ -0,0 +1,78 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: alphaprimitive2d.cxx,v $
+ *
+ * $Revision: 1.5 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:20 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_drawinglayer.hxx"
+
+#include <drawinglayer/primitive2d/transparenceprimitive2d.hxx>
+#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ TransparencePrimitive2D::TransparencePrimitive2D(
+ const Primitive2DSequence& rChildren,
+ const Primitive2DSequence& rTransparence)
+ : GroupPrimitive2D(rChildren),
+ maTransparence(rTransparence)
+ {
+ }
+
+ bool TransparencePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+ {
+ if(GroupPrimitive2D::operator==(rPrimitive))
+ {
+ const TransparencePrimitive2D& rCompare = (TransparencePrimitive2D&)rPrimitive;
+
+ return (getTransparence() == rCompare.getTransparence());
+ }
+
+ return false;
+ }
+
+ // provide unique ID
+ ImplPrimitrive2DIDBlock(TransparencePrimitive2D, PRIMITIVE2D_ID_TRANSPARENCEPRIMITIVE2D)
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/primitive2d/unifiedalphaprimitive2d.cxx b/drawinglayer/source/primitive2d/unifiedalphaprimitive2d.cxx
deleted file mode 100644
index 6417d4a37d..0000000000
--- a/drawinglayer/source/primitive2d/unifiedalphaprimitive2d.cxx
+++ /dev/null
@@ -1,121 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_drawinglayer.hxx"
-
-#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
-#include <basegfx/polygon/b2dpolygon.hxx>
-#include <basegfx/polygon/b2dpolygontools.hxx>
-#include <basegfx/color/bcolor.hxx>
-#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
-#include <drawinglayer/primitive2d/alphaprimitive2d.hxx>
-#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
-#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
-
-//////////////////////////////////////////////////////////////////////////////
-
-using namespace com::sun::star;
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace primitive2d
- {
- UnifiedAlphaPrimitive2D::UnifiedAlphaPrimitive2D(
- const Primitive2DSequence& rChildren,
- double fAlpha)
- : GroupPrimitive2D(rChildren),
- mfAlpha(fAlpha)
- {
- }
-
- bool UnifiedAlphaPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(GroupPrimitive2D::operator==(rPrimitive))
- {
- const UnifiedAlphaPrimitive2D& rCompare = (UnifiedAlphaPrimitive2D&)rPrimitive;
-
- return (getAlpha() == rCompare.getAlpha());
- }
-
- return false;
- }
-
- Primitive2DSequence UnifiedAlphaPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
- {
- if(0.0 == getAlpha())
- {
- // no transparence used, so just use the content
- return getChildren();
- }
- else if(getAlpha() > 0.0 && getAlpha() < 1.0)
- {
- // The idea is to create a AlphaPrimitive2D with alpha content using a fill color
- // corresponding to the alpha value. Problem is that in most systems, the right
- // and bottom pixel array is not filled when filling polygons, thus this would not
- // always produce a complete alpha bitmap. There are some solutions:
- //
- // - Grow the used polygon range by one discrete unit in X and Y. This
- // will make the decomposition view-dependent.
- //
- // - For all filled polygon renderings, dra wthe polygon outline extra. This
- // would lead to unwanted side effects when using concatenated polygons.
- //
- // - At this decomposition, add a filled polygon and a hairline polygon. This
- // solution stays view-independent.
- //
- // I will take the last one here. The small overhead of two primitives will only be
- // used when UnifiedAlphaPrimitive2D is not handled directly.
- const basegfx::B2DRange aPolygonRange(getB2DRangeFromPrimitive2DSequence(getChildren(), rViewInformation));
- const basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(aPolygonRange));
- const basegfx::BColor aGray(getAlpha(), getAlpha(), getAlpha());
- Primitive2DSequence aAlphaContent(2);
-
- aAlphaContent[0] = Primitive2DReference(new PolyPolygonColorPrimitive2D(basegfx::B2DPolyPolygon(aPolygon), aGray));
- aAlphaContent[1] = Primitive2DReference(new PolygonHairlinePrimitive2D(aPolygon, aGray));
-
- // create sub-transparence group with a gray-colored rectangular fill polygon
- const Primitive2DReference xRefB(new AlphaPrimitive2D(getChildren(), aAlphaContent));
- return Primitive2DSequence(&xRefB, 1L);
- }
- else
- {
- // completely transparent or invalid definition, add nothing
- return Primitive2DSequence();
- }
- }
-
- // provide unique ID
- ImplPrimitrive2DIDBlock(UnifiedAlphaPrimitive2D, PRIMITIVE2D_ID_UNIFIEDALPHAPRIMITIVE2D)
-
- } // end of namespace primitive2d
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-// eof
diff --git a/drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx b/drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx
new file mode 100644
index 0000000000..a97a921637
--- /dev/null
+++ b/drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx
@@ -0,0 +1,136 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: UnifiedTransparencePrimitive2D.cxx,v $
+ *
+ * $Revision: 1.5 $
+ *
+ * last change: $Author: aw $ $Date: 2008-05-27 14:11:20 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_drawinglayer.hxx"
+
+#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <basegfx/color/bcolor.hxx>
+#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
+#include <drawinglayer/primitive2d/transparenceprimitive2d.hxx>
+#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
+#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive2d
+ {
+ UnifiedTransparencePrimitive2D::UnifiedTransparencePrimitive2D(
+ const Primitive2DSequence& rChildren,
+ double fTransparence)
+ : GroupPrimitive2D(rChildren),
+ mfTransparence(fTransparence)
+ {
+ }
+
+ bool UnifiedTransparencePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
+ {
+ if(GroupPrimitive2D::operator==(rPrimitive))
+ {
+ const UnifiedTransparencePrimitive2D& rCompare = (UnifiedTransparencePrimitive2D&)rPrimitive;
+
+ return (getTransparence() == rCompare.getTransparence());
+ }
+
+ return false;
+ }
+
+ basegfx::B2DRange UnifiedTransparencePrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ // do not use the fallback to decomposition here since for a correct BoundRect we also
+ // need invisible (1.0 == getTransparence()) geometry; these would be deleted in the decomposition
+ return getB2DRangeFromPrimitive2DSequence(getChildren(), rViewInformation);
+ }
+
+ Primitive2DSequence UnifiedTransparencePrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
+ {
+ if(0.0 == getTransparence())
+ {
+ // no transparence used, so just use the content
+ return getChildren();
+ }
+ else if(getTransparence() > 0.0 && getTransparence() < 1.0)
+ {
+ // The idea is to create a TransparencePrimitive2D with transparent content using a fill color
+ // corresponding to the transparence value. Problem is that in most systems, the right
+ // and bottom pixel array is not filled when filling polygons, thus this would not
+ // always produce a complete transparent bitmap. There are some solutions:
+ //
+ // - Grow the used polygon range by one discrete unit in X and Y. This
+ // will make the decomposition view-dependent.
+ //
+ // - For all filled polygon renderings, dra wthe polygon outline extra. This
+ // would lead to unwanted side effects when using concatenated polygons.
+ //
+ // - At this decomposition, add a filled polygon and a hairline polygon. This
+ // solution stays view-independent.
+ //
+ // I will take the last one here. The small overhead of two primitives will only be
+ // used when UnifiedTransparencePrimitive2D is not handled directly.
+ const basegfx::B2DRange aPolygonRange(getB2DRangeFromPrimitive2DSequence(getChildren(), rViewInformation));
+ const basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(aPolygonRange));
+ const basegfx::BColor aGray(getTransparence(), getTransparence(), getTransparence());
+ Primitive2DSequence aTransparenceContent(2);
+
+ aTransparenceContent[0] = Primitive2DReference(new PolyPolygonColorPrimitive2D(basegfx::B2DPolyPolygon(aPolygon), aGray));
+ aTransparenceContent[1] = Primitive2DReference(new PolygonHairlinePrimitive2D(aPolygon, aGray));
+
+ // create sub-transparence group with a gray-colored rectangular fill polygon
+ const Primitive2DReference xRefB(new TransparencePrimitive2D(getChildren(), aTransparenceContent));
+ return Primitive2DSequence(&xRefB, 1L);
+ }
+ else
+ {
+ // completely transparent or invalid definition, add nothing
+ return Primitive2DSequence();
+ }
+ }
+
+ // provide unique ID
+ ImplPrimitrive2DIDBlock(UnifiedTransparencePrimitive2D, PRIMITIVE2D_ID_UNIFIEDTRANSPARENCEPRIMITIVE2D)
+
+ } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx b/drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx
index 0e416b7993..2461a0496c 100644
--- a/drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/wallpaperprimitive2d.cxx
@@ -215,7 +215,8 @@ namespace drawinglayer
if(bNeedsClipping)
{
// embed to clipping; this is necessary for tiled fills
- const basegfx::B2DPolyPolygon aPolyPolygon(basegfx::tools::createPolygonFromRect(getLocalObjectRange()));
+ const basegfx::B2DPolyPolygon aPolyPolygon(
+ basegfx::tools::createPolygonFromRect(getLocalObjectRange()));
const drawinglayer::primitive2d::Primitive2DReference xClippedFill(
new drawinglayer::primitive2d::MaskPrimitive2D(
aPolyPolygon,
diff --git a/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx b/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx
index e582adfa52..c3ccab34c7 100644
--- a/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx
@@ -147,7 +147,7 @@ namespace drawinglayer
// get 2d range of texture coordinates
const basegfx::B2DRange aOutlineRange(basegfx::tools::getRange(aTexPolyPolygon));
const basegfx::BColor aHatchColor(getHatch().getColor());
- const double fAngle(-getHatch().getAngle());
+ const double fAngle(getHatch().getAngle());
::std::vector< basegfx::B2DHomMatrix > aMatrices;
// get hatch transformations
@@ -156,13 +156,13 @@ namespace drawinglayer
case attribute::HATCHSTYLE_TRIPLE:
{
// rotated 45 degrees
- texture::GeoTexSvxHatch aHatch(aOutlineRange, getHatch().getDistance(), fAngle + F_PI4);
+ texture::GeoTexSvxHatch aHatch(aOutlineRange, getHatch().getDistance(), fAngle - F_PI4);
aHatch.appendTransformations(aMatrices);
}
case attribute::HATCHSTYLE_DOUBLE:
{
// rotated 90 degrees
- texture::GeoTexSvxHatch aHatch(aOutlineRange, getHatch().getDistance(), fAngle + F_PI2);
+ texture::GeoTexSvxHatch aHatch(aOutlineRange, getHatch().getDistance(), fAngle - F_PI2);
aHatch.appendTransformations(aMatrices);
}
case attribute::HATCHSTYLE_SINGLE:
diff --git a/drawinglayer/source/primitive3d/hiddengeometryprimitive3d.cxx b/drawinglayer/source/primitive3d/hiddengeometryprimitive3d.cxx
new file mode 100644
index 0000000000..b0163afbfc
--- /dev/null
+++ b/drawinglayer/source/primitive3d/hiddengeometryprimitive3d.cxx
@@ -0,0 +1,76 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: hittestprimitive3d.cxx,v $
+ *
+ * $Revision: 1.1.2.1 $
+ *
+ * last change: $Author: aw $ $Date: 2008/09/25 17:12:14 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_drawinglayer.hxx"
+
+#include <drawinglayer/primitive3d/hiddengeometryprimitive3d.hxx>
+#include <drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+using namespace com::sun::star;
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace primitive3d
+ {
+ HiddenGeometryPrimitive3D::HiddenGeometryPrimitive3D(
+ const Primitive3DSequence& rChildren)
+ : GroupPrimitive3D(rChildren)
+ {
+ }
+
+ basegfx::B3DRange HiddenGeometryPrimitive3D::getB3DRange(const geometry::ViewInformation3D& rViewInformation) const
+ {
+ return getB3DRangeFromPrimitive3DSequence(getChildren(), rViewInformation);
+ }
+
+ Primitive3DSequence HiddenGeometryPrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const
+ {
+ // return empty sequence
+ return Primitive3DSequence();
+ }
+
+ // provide unique ID
+ ImplPrimitrive3DIDBlock(HiddenGeometryPrimitive3D, PRIMITIVE3D_ID_HIDDENGEOMETRYPRIMITIVE3D)
+
+ } // end of namespace primitive3d
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/drawinglayer/source/primitive3d/makefile.mk b/drawinglayer/source/primitive3d/makefile.mk
index dfae99b810..afad990c0e 100644
--- a/drawinglayer/source/primitive3d/makefile.mk
+++ b/drawinglayer/source/primitive3d/makefile.mk
@@ -40,7 +40,7 @@ SLOFILES= \
$(SLO)$/baseprimitive3d.obj \
$(SLO)$/groupprimitive3d.obj \
$(SLO)$/hatchtextureprimitive3d.obj \
- $(SLO)$/hittestprimitive3d.obj \
+ $(SLO)$/hiddengeometryprimitive3d.obj \
$(SLO)$/modifiedcolorprimitive3d.obj \
$(SLO)$/polypolygonprimitive3d.obj \
$(SLO)$/polygonprimitive3d.obj \
diff --git a/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx b/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx
index b360c8b817..8a2776815a 100644
--- a/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx
@@ -57,7 +57,7 @@ namespace drawinglayer
// may exclusively change static data, use mutex
::osl::Mutex m_mutex;
- if(nSegments != nLineTubeSegments || rMaterial != aLineMaterial)
+ if(nSegments != nLineTubeSegments || !(rMaterial == aLineMaterial))
{
nLineTubeSegments = nSegments;
aLineMaterial = rMaterial;
@@ -118,7 +118,7 @@ namespace drawinglayer
// may exclusively change static data, use mutex
::osl::Mutex m_mutex;
- if(nSegments != nLineCapSegments || rMaterial != aLineMaterial)
+ if(nSegments != nLineCapSegments || !(rMaterial == aLineMaterial))
{
nLineCapSegments = nSegments;
aLineMaterial = rMaterial;
diff --git a/drawinglayer/source/primitive3d/sdrcubeprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrcubeprimitive3d.cxx
index 04306b782c..d7bdb41cda 100644
--- a/drawinglayer/source/primitive3d/sdrcubeprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrcubeprimitive3d.cxx
@@ -35,8 +35,9 @@
#include <drawinglayer/primitive3d/sdrdecompositiontools3d.hxx>
#include <basegfx/tools/canvastools.hxx>
#include <drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx>
-#include <drawinglayer/primitive3d/hittestprimitive3d.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
+#include <drawinglayer/attribute/sdrfillattribute.hxx>
+#include <drawinglayer/attribute/sdrlineattribute.hxx>
+#include <drawinglayer/attribute/sdrshadowattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -55,7 +56,7 @@ namespace drawinglayer
basegfx::B3DPolyPolygon aFill(basegfx::tools::createCubeFillPolyPolygonFromB3DRange(aUnitRange));
// normal creation
- if(getSdrLFSAttribute().getFill())
+ if(!getSdrLFSAttribute().getFill().isDefault())
{
if(::com::sun::star::drawing::NormalsKind_SPECIFIC == getSdr3DObjectAttribute().getNormalsKind()
|| ::com::sun::star::drawing::NormalsKind_SPHERE == getSdr3DObjectAttribute().getNormalsKind())
@@ -73,7 +74,7 @@ namespace drawinglayer
}
// texture coordinates
- if(getSdrLFSAttribute().getFill())
+ if(!getSdrLFSAttribute().getFill().isDefault())
{
// handle texture coordinates X
const bool bParallelX(::com::sun::star::drawing::TextureProjectionMode_PARALLEL == getSdr3DObjectAttribute().getTextureProjectionX());
@@ -145,7 +146,7 @@ namespace drawinglayer
a3DPolyPolygonVector.push_back(basegfx::B3DPolyPolygon(aFill.getB3DPolygon(a)));
}
- if(getSdrLFSAttribute().getFill())
+ if(!getSdrLFSAttribute().getFill().isDefault())
{
// add fill
aRetval = create3DPolyPolygonFillPrimitives(
@@ -153,39 +154,33 @@ namespace drawinglayer
getTransform(),
getTextureSize(),
getSdr3DObjectAttribute(),
- *getSdrLFSAttribute().getFill(),
+ getSdrLFSAttribute().getFill(),
getSdrLFSAttribute().getFillFloatTransGradient());
}
else
{
// create simplified 3d hit test geometry
- const attribute::SdrFillAttribute aSimplifiedFillAttribute(0.0, basegfx::BColor(), 0, 0, 0);
-
- aRetval = create3DPolyPolygonFillPrimitives(
+ aRetval = createHiddenGeometryPrimitives3D(
a3DPolyPolygonVector,
getTransform(),
getTextureSize(),
- getSdr3DObjectAttribute(),
- aSimplifiedFillAttribute,
- 0);
-
- // encapsulate in HitTestPrimitive3D and add
- const Primitive3DReference xRef(new HitTestPrimitive3D(aRetval));
- aRetval = Primitive3DSequence(&xRef, 1L);
+ getSdr3DObjectAttribute());
}
// add line
- if(getSdrLFSAttribute().getLine())
+ if(!getSdrLFSAttribute().getLine().isDefault())
{
basegfx::B3DPolyPolygon aLine(basegfx::tools::createCubePolyPolygonFromB3DRange(aUnitRange));
- const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(aLine, getTransform(), *getSdrLFSAttribute().getLine()));
+ const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(
+ aLine, getTransform(), getSdrLFSAttribute().getLine()));
appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aLines);
}
// add shadow
- if(getSdrLFSAttribute().getShadow() && aRetval.hasElements())
+ if(!getSdrLFSAttribute().getShadow().isDefault() && aRetval.hasElements())
{
- const Primitive3DSequence aShadow(createShadowPrimitive3D(aRetval, *getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D()));
+ const Primitive3DSequence aShadow(createShadowPrimitive3D(
+ aRetval, getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D()));
appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aShadow);
}
@@ -195,7 +190,7 @@ namespace drawinglayer
SdrCubePrimitive3D::SdrCubePrimitive3D(
const basegfx::B3DHomMatrix& rTransform,
const basegfx::B2DVector& rTextureSize,
- const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute,
+ const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute,
const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute)
: SdrPrimitive3D(rTransform, rTextureSize, rSdrLFSAttribute, rSdr3DObjectAttribute)
{
diff --git a/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx b/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx
index e044a47033..9c50f25284 100644
--- a/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx
@@ -31,14 +31,11 @@
#include <drawinglayer/primitive3d/sdrdecompositiontools3d.hxx>
#include <basegfx/polygon/b3dpolygon.hxx>
#include <drawinglayer/attribute/strokeattribute.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
#include <drawinglayer/primitive3d/baseprimitive3d.hxx>
#include <drawinglayer/primitive3d/polygonprimitive3d.hxx>
#include <basegfx/polygon/b3dpolypolygon.hxx>
#include <drawinglayer/primitive3d/polypolygonprimitive3d.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
#include <vcl/vclenum.hxx>
-#include <drawinglayer/attribute/fillattribute.hxx>
#include <drawinglayer/attribute/fillbitmapattribute.hxx>
#include <drawinglayer/attribute/sdrfillbitmapattribute.hxx>
#include <vcl/bmpacc.hxx>
@@ -47,8 +44,12 @@
#include <drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx>
#include <drawinglayer/primitive3d/hatchtextureprimitive3d.hxx>
#include <drawinglayer/primitive3d/shadowprimitive3d.hxx>
-#include <drawinglayer/attribute/sdrattribute3d.hxx>
#include <basegfx/range/b2drange.hxx>
+#include <drawinglayer/attribute/sdrlineattribute.hxx>
+#include <drawinglayer/attribute/sdrobjectattribute3d.hxx>
+#include <drawinglayer/attribute/sdrfillattribute.hxx>
+#include <drawinglayer/attribute/sdrshadowattribute.hxx>
+#include <drawinglayer/primitive3d/hiddengeometryprimitive3d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -167,8 +168,8 @@ namespace drawinglayer
if(0.0 != rLine.getTransparence())
{
- // create UnifiedAlphaTexturePrimitive3D, add created primitives and exchange
- const Primitive3DReference xRef(new UnifiedAlphaTexturePrimitive3D(rLine.getTransparence(), aRetval));
+ // create UnifiedTransparenceTexturePrimitive3D, add created primitives and exchange
+ const Primitive3DReference xRef(new UnifiedTransparenceTexturePrimitive3D(rLine.getTransparence(), aRetval));
aRetval = Primitive3DSequence(&xRef, 1L);
}
@@ -181,7 +182,7 @@ namespace drawinglayer
const basegfx::B2DVector& rTextureSize,
const attribute::Sdr3DObjectAttribute& aSdr3DObjectAttribute,
const attribute::SdrFillAttribute& rFill,
- const attribute::FillGradientAttribute* pFillGradient)
+ const attribute::FillGradientAttribute& rFillGradient)
{
Primitive3DSequence aRetval;
@@ -209,27 +210,45 @@ namespace drawinglayer
}
// look for and evtl. build texture sub-group primitive
- if(rFill.isGradient() || rFill.isHatch() || rFill.isBitmap())
+ if(!rFill.getGradient().isDefault()
+ || !rFill.getHatch().isDefault()
+ || !rFill.getBitmap().isDefault())
{
bool bModulate(::com::sun::star::drawing::TextureMode_MODULATE == aSdr3DObjectAttribute.getTextureMode());
bool bFilter(aSdr3DObjectAttribute.getTextureFilter());
- BasePrimitive3D* pNewTexturePrimitive3D = 0L;
+ BasePrimitive3D* pNewTexturePrimitive3D = 0;
- if(rFill.isGradient())
+ if(!rFill.getGradient().isDefault())
{
// create gradientTexture3D with sublist, add to local aRetval
- pNewTexturePrimitive3D = new GradientTexturePrimitive3D(*rFill.getGradient(), aRetval, rTextureSize, bModulate, bFilter);
+ pNewTexturePrimitive3D = new GradientTexturePrimitive3D(
+ rFill.getGradient(),
+ aRetval,
+ rTextureSize,
+ bModulate,
+ bFilter);
}
- else if(rFill.isHatch())
+ else if(!rFill.getHatch().isDefault())
{
// create hatchTexture3D with sublist, add to local aRetval
- pNewTexturePrimitive3D = new HatchTexturePrimitive3D(*rFill.getHatch(), aRetval, rTextureSize, bModulate, bFilter);
+ pNewTexturePrimitive3D = new HatchTexturePrimitive3D(
+ rFill.getHatch(),
+ aRetval,
+ rTextureSize,
+ bModulate,
+ bFilter);
}
- else // if(rFill.isBitmap())
+ else // if(!rFill.getBitmap().isDefault())
{
// create bitmapTexture3D with sublist, add to local aRetval
basegfx::B2DRange aTexRange(0.0, 0.0, rTextureSize.getX(), rTextureSize.getY());
- pNewTexturePrimitive3D = new BitmapTexturePrimitive3D(rFill.getBitmap()->getFillBitmapAttribute(aTexRange), aRetval, rTextureSize, bModulate, bFilter);
+
+ pNewTexturePrimitive3D = new BitmapTexturePrimitive3D(
+ rFill.getBitmap().getFillBitmapAttribute(aTexRange),
+ aRetval,
+ rTextureSize,
+ bModulate,
+ bFilter);
}
// exchange aRetval content with texture group
@@ -247,14 +266,14 @@ namespace drawinglayer
if(0.0 != rFill.getTransparence())
{
- // create UnifiedAlphaTexturePrimitive3D with sublist and exchange
- const Primitive3DReference xRef(new UnifiedAlphaTexturePrimitive3D(rFill.getTransparence(), aRetval));
+ // create UnifiedTransparenceTexturePrimitive3D with sublist and exchange
+ const Primitive3DReference xRef(new UnifiedTransparenceTexturePrimitive3D(rFill.getTransparence(), aRetval));
aRetval = Primitive3DSequence(&xRef, 1L);
}
- else if(pFillGradient)
+ else if(!rFillGradient.isDefault())
{
- // create AlphaTexturePrimitive3D with sublist and exchange
- const Primitive3DReference xRef(new AlphaTexturePrimitive3D(*pFillGradient, aRetval, rTextureSize));
+ // create TransparenceTexturePrimitive3D with sublist and exchange
+ const Primitive3DReference xRef(new TransparenceTexturePrimitive3D(rFillGradient, aRetval, rTextureSize));
aRetval = Primitive3DSequence(&xRef, 1L);
}
}
@@ -284,6 +303,35 @@ namespace drawinglayer
return Primitive3DSequence();
}
}
+
+ Primitive3DSequence createHiddenGeometryPrimitives3D(
+ const ::std::vector< basegfx::B3DPolyPolygon >& r3DPolyPolygonVector,
+ const basegfx::B3DHomMatrix& rObjectTransform,
+ const basegfx::B2DVector& rTextureSize,
+ const attribute::Sdr3DObjectAttribute& aSdr3DObjectAttribute)
+ {
+ // create hidden sub-geometry which can be used for HitTest
+ // and BoundRect calculations, but will not be visualized
+ const attribute::SdrFillAttribute aSimplifiedFillAttribute(
+ 0.0,
+ basegfx::BColor(),
+ attribute::FillGradientAttribute(),
+ attribute::FillHatchAttribute(),
+ attribute::SdrFillBitmapAttribute());
+
+ const Primitive3DReference aHidden(
+ new HiddenGeometryPrimitive3D(
+ create3DPolyPolygonFillPrimitives(
+ r3DPolyPolygonVector,
+ rObjectTransform,
+ rTextureSize,
+ aSdr3DObjectAttribute,
+ aSimplifiedFillAttribute,
+ attribute::FillGradientAttribute())));
+
+ return Primitive3DSequence(&aHidden, 1);
+ }
+
} // end of namespace primitive3d
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
index e863d60be4..6a5c743b90 100644
--- a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
@@ -36,8 +36,9 @@
#include <basegfx/tools/canvastools.hxx>
#include <drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx>
#include <drawinglayer/geometry/viewinformation3d.hxx>
-#include <drawinglayer/primitive3d/hittestprimitive3d.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
+#include <drawinglayer/attribute/sdrfillattribute.hxx>
+#include <drawinglayer/attribute/sdrlineattribute.hxx>
+#include <drawinglayer/attribute/sdrshadowattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -68,7 +69,7 @@ namespace drawinglayer
double fRelativeTextureWidth(1.0);
basegfx::B2DHomMatrix aTexTransform;
- if(getSdrLFSAttribute().getFill() && (bCreateTextureCoordiantesX || bCreateTextureCoordiantesY))
+ if(!getSdrLFSAttribute().getFill().isDefault() && (bCreateTextureCoordiantesX || bCreateTextureCoordiantesY))
{
const basegfx::B2DPolygon aFirstPolygon(maCorrectedPolyPolygon.getB2DPolygon(0L));
const double fFrontLength(basegfx::tools::getLength(aFirstPolygon));
@@ -98,7 +99,7 @@ namespace drawinglayer
const basegfx::B3DRange aRange(getRangeFrom3DGeometry(aFill));
// normal creation
- if(getSdrLFSAttribute().getFill())
+ if(!getSdrLFSAttribute().getFill().isDefault())
{
if(::com::sun::star::drawing::NormalsKind_SPHERE == eNormalsKind)
{
@@ -116,7 +117,7 @@ namespace drawinglayer
}
// texture coordinates
- if(getSdrLFSAttribute().getFill())
+ if(!getSdrLFSAttribute().getFill().isDefault())
{
applyTextureTo3DGeometry(
getSdr3DObjectAttribute().getTextureProjectionX(),
@@ -126,7 +127,7 @@ namespace drawinglayer
getTextureSize());
}
- if(getSdrLFSAttribute().getFill())
+ if(!getSdrLFSAttribute().getFill().isDefault())
{
// add fill
aRetval = create3DPolyPolygonFillPrimitives(
@@ -134,29 +135,21 @@ namespace drawinglayer
getTransform(),
getTextureSize(),
getSdr3DObjectAttribute(),
- *getSdrLFSAttribute().getFill(),
+ getSdrLFSAttribute().getFill(),
getSdrLFSAttribute().getFillFloatTransGradient());
}
else
{
// create simplified 3d hit test geometry
- const attribute::SdrFillAttribute aSimplifiedFillAttribute(0.0, basegfx::BColor(), 0, 0, 0);
-
- aRetval = create3DPolyPolygonFillPrimitives(
+ aRetval = createHiddenGeometryPrimitives3D(
aFill,
getTransform(),
getTextureSize(),
- getSdr3DObjectAttribute(),
- aSimplifiedFillAttribute,
- 0);
-
- // encapsulate in HitTestPrimitive3D and add
- const Primitive3DReference xRef(new HitTestPrimitive3D(aRetval));
- aRetval = Primitive3DSequence(&xRef, 1L);
+ getSdr3DObjectAttribute());
}
// add line
- if(getSdrLFSAttribute().getLine())
+ if(!getSdrLFSAttribute().getLine().isDefault())
{
if(getSdr3DObjectAttribute().getReducedLineGeometry())
{
@@ -341,7 +334,8 @@ namespace drawinglayer
if(aNewLineGeometry.count())
{
- const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(aNewLineGeometry, getTransform(), *getSdrLFSAttribute().getLine()));
+ const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(
+ aNewLineGeometry, getTransform(), getSdrLFSAttribute().getLine()));
appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aLines);
}
}
@@ -352,19 +346,22 @@ namespace drawinglayer
const basegfx::B3DPolyPolygon aVerLine(extractVerticalLinesFromSlice(rSliceVector));
// add horizontal lines
- const Primitive3DSequence aHorLines(create3DPolyPolygonLinePrimitives(aHorLine, getTransform(), *getSdrLFSAttribute().getLine()));
+ const Primitive3DSequence aHorLines(create3DPolyPolygonLinePrimitives(
+ aHorLine, getTransform(), getSdrLFSAttribute().getLine()));
appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aHorLines);
// add vertical lines
- const Primitive3DSequence aVerLines(create3DPolyPolygonLinePrimitives(aVerLine, getTransform(), *getSdrLFSAttribute().getLine()));
+ const Primitive3DSequence aVerLines(create3DPolyPolygonLinePrimitives(
+ aVerLine, getTransform(), getSdrLFSAttribute().getLine()));
appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aVerLines);
}
}
// add shadow
- if(getSdrLFSAttribute().getShadow() && aRetval.hasElements())
+ if(!getSdrLFSAttribute().getShadow().isDefault() && aRetval.hasElements())
{
- const Primitive3DSequence aShadow(createShadowPrimitive3D(aRetval, *getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D()));
+ const Primitive3DSequence aShadow(createShadowPrimitive3D(
+ aRetval, getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D()));
appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aShadow);
}
}
@@ -401,7 +398,7 @@ namespace drawinglayer
SdrExtrudePrimitive3D::SdrExtrudePrimitive3D(
const basegfx::B3DHomMatrix& rTransform,
const basegfx::B2DVector& rTextureSize,
- const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute,
+ const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute,
const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute,
const basegfx::B2DPolyPolygon& rPolyPolygon,
double fDepth,
diff --git a/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx
index c33fcc96ea..594a0797da 100644
--- a/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx
@@ -36,8 +36,9 @@
#include <basegfx/tools/canvastools.hxx>
#include <drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx>
#include <drawinglayer/geometry/viewinformation3d.hxx>
-#include <drawinglayer/primitive3d/hittestprimitive3d.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
+#include <drawinglayer/attribute/sdrfillattribute.hxx>
+#include <drawinglayer/attribute/sdrlineattribute.hxx>
+#include <drawinglayer/attribute/sdrshadowattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -69,7 +70,8 @@ namespace drawinglayer
const bool bCreateTextureCoordiantesY(::com::sun::star::drawing::TextureProjectionMode_OBJECTSPECIFIC == getSdr3DObjectAttribute().getTextureProjectionY());
basegfx::B2DHomMatrix aTexTransform;
- if(getSdrLFSAttribute().getFill() && (bCreateTextureCoordiantesX || bCreateTextureCoordiantesY))
+ if(!getSdrLFSAttribute().getFill().isDefault()
+ && (bCreateTextureCoordiantesX || bCreateTextureCoordiantesY))
{
aTexTransform.set(0, 0, 0.0);
aTexTransform.set(0, 1, 1.0);
@@ -91,7 +93,7 @@ namespace drawinglayer
const basegfx::B3DRange aRange(getRangeFrom3DGeometry(aFill));
// normal creation
- if(getSdrLFSAttribute().getFill())
+ if(!getSdrLFSAttribute().getFill().isDefault())
{
if(::com::sun::star::drawing::NormalsKind_SPHERE == eNormalsKind)
{
@@ -109,7 +111,7 @@ namespace drawinglayer
}
// texture coordinates
- if(getSdrLFSAttribute().getFill())
+ if(!getSdrLFSAttribute().getFill().isDefault())
{
applyTextureTo3DGeometry(
getSdr3DObjectAttribute().getTextureProjectionX(),
@@ -119,7 +121,7 @@ namespace drawinglayer
getTextureSize());
}
- if(getSdrLFSAttribute().getFill())
+ if(!getSdrLFSAttribute().getFill().isDefault())
{
// add fill
aRetval = create3DPolyPolygonFillPrimitives(
@@ -127,29 +129,21 @@ namespace drawinglayer
getTransform(),
getTextureSize(),
getSdr3DObjectAttribute(),
- *getSdrLFSAttribute().getFill(),
+ getSdrLFSAttribute().getFill(),
getSdrLFSAttribute().getFillFloatTransGradient());
}
else
{
// create simplified 3d hit test geometry
- const attribute::SdrFillAttribute aSimplifiedFillAttribute(0.0, basegfx::BColor(), 0, 0, 0);
-
- aRetval = create3DPolyPolygonFillPrimitives(
+ aRetval = createHiddenGeometryPrimitives3D(
aFill,
getTransform(),
getTextureSize(),
- getSdr3DObjectAttribute(),
- aSimplifiedFillAttribute,
- 0);
-
- // encapsulate in HitTestPrimitive3D and add
- const Primitive3DReference xRef(new HitTestPrimitive3D(aRetval));
- aRetval = Primitive3DSequence(&xRef, 1L);
+ getSdr3DObjectAttribute());
}
// add line
- if(getSdrLFSAttribute().getLine())
+ if(!getSdrLFSAttribute().getLine().isDefault())
{
if(getSdr3DObjectAttribute().getReducedLineGeometry())
{
@@ -183,7 +177,8 @@ namespace drawinglayer
if(aNewLineGeometry.count())
{
- const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(aNewLineGeometry, getTransform(), *getSdrLFSAttribute().getLine()));
+ const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(
+ aNewLineGeometry, getTransform(), getSdrLFSAttribute().getLine()));
appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aLines);
}
}
@@ -194,19 +189,23 @@ namespace drawinglayer
const basegfx::B3DPolyPolygon aVerLine(extractVerticalLinesFromSlice(rSliceVector));
// add horizontal lines
- const Primitive3DSequence aHorLines(create3DPolyPolygonLinePrimitives(aHorLine, getTransform(), *getSdrLFSAttribute().getLine()));
+ const Primitive3DSequence aHorLines(create3DPolyPolygonLinePrimitives(
+ aHorLine, getTransform(), getSdrLFSAttribute().getLine()));
appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aHorLines);
// add vertical lines
- const Primitive3DSequence aVerLines(create3DPolyPolygonLinePrimitives(aVerLine, getTransform(), *getSdrLFSAttribute().getLine()));
+ const Primitive3DSequence aVerLines(create3DPolyPolygonLinePrimitives(
+ aVerLine, getTransform(), getSdrLFSAttribute().getLine()));
appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aVerLines);
}
}
// add shadow
- if(getSdrLFSAttribute().getShadow() && aRetval.hasElements())
+ if(!getSdrLFSAttribute().getShadow().isDefault()
+ && aRetval.hasElements())
{
- const Primitive3DSequence aShadow(createShadowPrimitive3D(aRetval, *getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D()));
+ const Primitive3DSequence aShadow(createShadowPrimitive3D(
+ aRetval, getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D()));
appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aShadow);
}
}
@@ -254,7 +253,7 @@ namespace drawinglayer
SdrLathePrimitive3D::SdrLathePrimitive3D(
const basegfx::B3DHomMatrix& rTransform,
const basegfx::B2DVector& rTextureSize,
- const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute,
+ const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute,
const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute,
const basegfx::B2DPolyPolygon& rPolyPolygon,
sal_uInt32 nHorizontalSegments,
diff --git a/drawinglayer/source/primitive3d/sdrpolypolygonprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrpolypolygonprimitive3d.cxx
index 687ae40835..573d40961e 100644
--- a/drawinglayer/source/primitive3d/sdrpolypolygonprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrpolypolygonprimitive3d.cxx
@@ -32,8 +32,9 @@
#include <drawinglayer/primitive3d/sdrdecompositiontools3d.hxx>
#include <drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx>
#include <basegfx/polygon/b3dpolypolygontools.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
-#include <drawinglayer/primitive3d/hittestprimitive3d.hxx>
+#include <drawinglayer/attribute/sdrfillattribute.hxx>
+#include <drawinglayer/attribute/sdrlineattribute.hxx>
+#include <drawinglayer/attribute/sdrshadowattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -58,7 +59,7 @@ namespace drawinglayer
const basegfx::B3DRange aRange(getRangeFrom3DGeometry(aFill));
// #i98295# normal creation
- if(getSdrLFSAttribute().getFill())
+ if(!getSdrLFSAttribute().getFill().isDefault())
{
if(::com::sun::star::drawing::NormalsKind_SPHERE == getSdr3DObjectAttribute().getNormalsKind())
{
@@ -76,7 +77,7 @@ namespace drawinglayer
}
// #i98314# texture coordinates
- if(getSdrLFSAttribute().getFill())
+ if(!getSdrLFSAttribute().getFill().isDefault())
{
applyTextureTo3DGeometry(
getSdr3DObjectAttribute().getTextureProjectionX(),
@@ -86,7 +87,7 @@ namespace drawinglayer
getTextureSize());
}
- if(getSdrLFSAttribute().getFill())
+ if(!getSdrLFSAttribute().getFill().isDefault())
{
// add fill
aRetval = create3DPolyPolygonFillPrimitives(
@@ -94,41 +95,36 @@ namespace drawinglayer
getTransform(),
getTextureSize(),
getSdr3DObjectAttribute(),
- *getSdrLFSAttribute().getFill(),
+ getSdrLFSAttribute().getFill(),
getSdrLFSAttribute().getFillFloatTransGradient());
}
else
{
// create simplified 3d hit test geometry
- const attribute::SdrFillAttribute aSimplifiedFillAttribute(0.0, basegfx::BColor(), 0, 0, 0);
-
- aRetval = create3DPolyPolygonFillPrimitives(
+ aRetval = createHiddenGeometryPrimitives3D(
aFill,
getTransform(),
getTextureSize(),
- getSdr3DObjectAttribute(),
- aSimplifiedFillAttribute,
- 0);
-
- // encapsulate in HitTestPrimitive3D and add
- const Primitive3DReference xRef(new HitTestPrimitive3D(aRetval));
- aRetval = Primitive3DSequence(&xRef, 1L);
+ getSdr3DObjectAttribute());
}
// add line
- if(getSdrLFSAttribute().getLine())
+ if(!getSdrLFSAttribute().getLine().isDefault())
{
basegfx::B3DPolyPolygon aLine(getPolyPolygon3D());
aLine.clearNormals();
aLine.clearTextureCoordinates();
- const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(aLine, getTransform(), *getSdrLFSAttribute().getLine()));
+ const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(
+ aLine, getTransform(), getSdrLFSAttribute().getLine()));
appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aLines);
}
// add shadow
- if(getSdrLFSAttribute().getShadow() && aRetval.hasElements())
+ if(!getSdrLFSAttribute().getShadow().isDefault()
+ && aRetval.hasElements())
{
- const Primitive3DSequence aShadow(createShadowPrimitive3D(aRetval, *getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D()));
+ const Primitive3DSequence aShadow(createShadowPrimitive3D(
+ aRetval, getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D()));
appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aShadow);
}
}
@@ -140,7 +136,7 @@ namespace drawinglayer
const basegfx::B3DPolyPolygon& rPolyPolygon3D,
const basegfx::B3DHomMatrix& rTransform,
const basegfx::B2DVector& rTextureSize,
- const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute,
+ const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute,
const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute)
: SdrPrimitive3D(rTransform, rTextureSize, rSdrLFSAttribute, rSdr3DObjectAttribute),
maPolyPolygon3D(rPolyPolygon3D)
@@ -173,11 +169,11 @@ namespace drawinglayer
aRetval = basegfx::tools::getRange(getPolyPolygon3D());
aRetval.transform(getTransform());
- if(getSdrLFSAttribute().getLine())
+ if(!getSdrLFSAttribute().getLine().isDefault())
{
- const attribute::SdrLineAttribute& rLine = *getSdrLFSAttribute().getLine();
+ const attribute::SdrLineAttribute& rLine = getSdrLFSAttribute().getLine();
- if(rLine.isVisible() && !basegfx::fTools::equalZero(rLine.getWidth()))
+ if(!rLine.isDefault() && !basegfx::fTools::equalZero(rLine.getWidth()))
{
// expand by half LineWidth as tube radius
aRetval.grow(rLine.getWidth() / 2.0);
diff --git a/drawinglayer/source/primitive3d/sdrprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrprimitive3d.cxx
index df0dd80ebe..cd79c78bed 100644
--- a/drawinglayer/source/primitive3d/sdrprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrprimitive3d.cxx
@@ -29,9 +29,9 @@
#include "precompiled_drawinglayer.hxx"
#include <drawinglayer/primitive3d/sdrprimitive3d.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
#include <basegfx/polygon/b3dpolypolygontools.hxx>
#include <drawinglayer/primitive3d/sdrdecompositiontools3d.hxx>
+#include <drawinglayer/attribute/sdrlineattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -48,11 +48,11 @@ namespace drawinglayer
basegfx::B3DRange aUnitRange(0.0, 0.0, 0.0, 1.0, 1.0, 1.0);
aUnitRange.transform(getTransform());
- if(getSdrLFSAttribute().getLine())
+ if(!getSdrLFSAttribute().getLine().isDefault())
{
- const attribute::SdrLineAttribute& rLine = *getSdrLFSAttribute().getLine();
+ const attribute::SdrLineAttribute& rLine = getSdrLFSAttribute().getLine();
- if(rLine.isVisible() && !basegfx::fTools::equalZero(rLine.getWidth()))
+ if(!rLine.isDefault() && !basegfx::fTools::equalZero(rLine.getWidth()))
{
// expand by hald LineWidth as tube radius
aUnitRange.grow(rLine.getWidth() / 2.0);
@@ -75,11 +75,11 @@ namespace drawinglayer
aRetval.transform(getTransform());
- if(getSdrLFSAttribute().getLine())
+ if(!getSdrLFSAttribute().getLine().isDefault())
{
- const attribute::SdrLineAttribute& rLine = *getSdrLFSAttribute().getLine();
+ const attribute::SdrLineAttribute& rLine = getSdrLFSAttribute().getLine();
- if(rLine.isVisible() && !basegfx::fTools::equalZero(rLine.getWidth()))
+ if(!rLine.isDefault() && !basegfx::fTools::equalZero(rLine.getWidth()))
{
// expand by half LineWidth as tube radius
aRetval.grow(rLine.getWidth() / 2.0);
@@ -93,7 +93,7 @@ namespace drawinglayer
SdrPrimitive3D::SdrPrimitive3D(
const basegfx::B3DHomMatrix& rTransform,
const basegfx::B2DVector& rTextureSize,
- const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute,
+ const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute,
const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute)
: BufferedDecompositionPrimitive3D(),
maTransform(rTransform),
diff --git a/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx
index 06e19603e0..565c258356 100644
--- a/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrsphereprimitive3d.cxx
@@ -35,8 +35,9 @@
#include <drawinglayer/primitive3d/sdrdecompositiontools3d.hxx>
#include <basegfx/tools/canvastools.hxx>
#include <drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx>
-#include <drawinglayer/primitive3d/hittestprimitive3d.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
+#include <drawinglayer/attribute/sdrfillattribute.hxx>
+#include <drawinglayer/attribute/sdrlineattribute.hxx>
+#include <drawinglayer/attribute/sdrshadowattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -60,7 +61,7 @@ namespace drawinglayer
getHorizontalSegments(), getVerticalSegments(), bCreateNormals));
// normal inversion
- if(getSdrLFSAttribute().getFill()
+ if(!getSdrLFSAttribute().getFill().isDefault()
&& bCreateNormals
&& getSdr3DObjectAttribute().getNormalsInvert()
&& aFill.areNormalsUsed())
@@ -70,7 +71,7 @@ namespace drawinglayer
}
// texture coordinates
- if(getSdrLFSAttribute().getFill())
+ if(!getSdrLFSAttribute().getFill().isDefault())
{
// handle texture coordinates X
const bool bParallelX(::com::sun::star::drawing::TextureProjectionMode_PARALLEL == getSdr3DObjectAttribute().getTextureProjectionX());
@@ -134,7 +135,7 @@ namespace drawinglayer
a3DPolyPolygonVector.push_back(basegfx::B3DPolyPolygon(aFill.getB3DPolygon(a)));
}
- if(getSdrLFSAttribute().getFill())
+ if(!getSdrLFSAttribute().getFill().isDefault())
{
// add fill
aRetval = create3DPolyPolygonFillPrimitives(
@@ -142,39 +143,34 @@ namespace drawinglayer
getTransform(),
getTextureSize(),
getSdr3DObjectAttribute(),
- *getSdrLFSAttribute().getFill(),
+ getSdrLFSAttribute().getFill(),
getSdrLFSAttribute().getFillFloatTransGradient());
}
else
{
// create simplified 3d hit test geometry
- const attribute::SdrFillAttribute aSimplifiedFillAttribute(0.0, basegfx::BColor(), 0, 0, 0);
-
- aRetval = create3DPolyPolygonFillPrimitives(
+ aRetval = createHiddenGeometryPrimitives3D(
a3DPolyPolygonVector,
getTransform(),
getTextureSize(),
- getSdr3DObjectAttribute(),
- aSimplifiedFillAttribute,
- 0);
-
- // encapsulate in HitTestPrimitive3D and add
- const Primitive3DReference xRef(new HitTestPrimitive3D(aRetval));
- aRetval = Primitive3DSequence(&xRef, 1L);
+ getSdr3DObjectAttribute());
}
// add line
- if(getSdrLFSAttribute().getLine())
+ if(!getSdrLFSAttribute().getLine().isDefault())
{
basegfx::B3DPolyPolygon aSphere(basegfx::tools::createSpherePolyPolygonFromB3DRange(aUnitRange, getHorizontalSegments(), getVerticalSegments()));
- const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(aSphere, getTransform(), *getSdrLFSAttribute().getLine()));
+ const Primitive3DSequence aLines(create3DPolyPolygonLinePrimitives(
+ aSphere, getTransform(), getSdrLFSAttribute().getLine()));
appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aLines);
}
// add shadow
- if(getSdrLFSAttribute().getShadow() && aRetval.hasElements())
+ if(!getSdrLFSAttribute().getShadow().isDefault()
+ && aRetval.hasElements())
{
- const Primitive3DSequence aShadow(createShadowPrimitive3D(aRetval, *getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D()));
+ const Primitive3DSequence aShadow(createShadowPrimitive3D(
+ aRetval, getSdrLFSAttribute().getShadow(), getSdr3DObjectAttribute().getShadow3D()));
appendPrimitive3DSequenceToPrimitive3DSequence(aRetval, aShadow);
}
@@ -184,7 +180,7 @@ namespace drawinglayer
SdrSpherePrimitive3D::SdrSpherePrimitive3D(
const basegfx::B3DHomMatrix& rTransform,
const basegfx::B2DVector& rTextureSize,
- const attribute::SdrLineFillShadowAttribute& rSdrLFSAttribute,
+ const attribute::SdrLineFillShadowAttribute3D& rSdrLFSAttribute,
const attribute::Sdr3DObjectAttribute& rSdr3DObjectAttribute,
sal_uInt32 nHorizontalSegments,
sal_uInt32 nVerticalSegments)
diff --git a/drawinglayer/source/primitive3d/textureprimitive3d.cxx b/drawinglayer/source/primitive3d/textureprimitive3d.cxx
index e06cd11895..99814a1dcc 100644
--- a/drawinglayer/source/primitive3d/textureprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/textureprimitive3d.cxx
@@ -30,6 +30,7 @@
#include <drawinglayer/primitive3d/textureprimitive3d.hxx>
#include <drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx>
+#include <basegfx/color/bcolor.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -73,7 +74,7 @@ namespace drawinglayer
{
namespace primitive3d
{
- UnifiedAlphaTexturePrimitive3D::UnifiedAlphaTexturePrimitive3D(
+ UnifiedTransparenceTexturePrimitive3D::UnifiedTransparenceTexturePrimitive3D(
double fTransparence,
const Primitive3DSequence& rChildren)
: TexturePrimitive3D(rChildren, basegfx::B2DVector(), false, false),
@@ -81,11 +82,11 @@ namespace drawinglayer
{
}
- bool UnifiedAlphaTexturePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
+ bool UnifiedTransparenceTexturePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
{
if(TexturePrimitive3D::operator==(rPrimitive))
{
- const UnifiedAlphaTexturePrimitive3D& rCompare = (UnifiedAlphaTexturePrimitive3D&)rPrimitive;
+ const UnifiedTransparenceTexturePrimitive3D& rCompare = (UnifiedTransparenceTexturePrimitive3D&)rPrimitive;
return (getTransparence() == rCompare.getTransparence());
}
@@ -93,7 +94,14 @@ namespace drawinglayer
return false;
}
- Primitive3DSequence UnifiedAlphaTexturePrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const
+ basegfx::B3DRange UnifiedTransparenceTexturePrimitive3D::getB3DRange(const geometry::ViewInformation3D& rViewInformation) const
+ {
+ // do not use the fallback to decomposition here since for a correct BoundRect we also
+ // need invisible (1.0 == getTransparence()) geometry; these would be deleted in the decomposition
+ return getB3DRangeFromPrimitive3DSequence(getChildren(), rViewInformation);
+ }
+
+ Primitive3DSequence UnifiedTransparenceTexturePrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const
{
if(0.0 == getTransparence())
{
@@ -102,10 +110,10 @@ namespace drawinglayer
}
else if(getTransparence() > 0.0 && getTransparence() < 1.0)
{
- // create AlphaTexturePrimitive3D with fixed transparence as replacement
+ // create TransparenceTexturePrimitive3D with fixed transparence as replacement
const basegfx::BColor aGray(getTransparence(), getTransparence(), getTransparence());
const attribute::FillGradientAttribute aFillGradient(attribute::GRADIENTSTYLE_LINEAR, 0.0, 0.0, 0.0, 0.0, aGray, aGray, 1);
- const Primitive3DReference xRef(new AlphaTexturePrimitive3D(aFillGradient, getChildren(), getTextureSize()));
+ const Primitive3DReference xRef(new TransparenceTexturePrimitive3D(aFillGradient, getChildren(), getTextureSize()));
return Primitive3DSequence(&xRef, 1L);
}
else
@@ -116,7 +124,7 @@ namespace drawinglayer
}
// provide unique ID
- ImplPrimitrive3DIDBlock(UnifiedAlphaTexturePrimitive3D, PRIMITIVE3D_ID_UNIFIEDALPHATEXTUREPRIMITIVE3D)
+ ImplPrimitrive3DIDBlock(UnifiedTransparenceTexturePrimitive3D, PRIMITIVE3D_ID_UNIFIEDTRANSPARENCETEXTUREPRIMITIVE3D)
} // end of namespace primitive3d
} // end of namespace drawinglayer
@@ -196,7 +204,7 @@ namespace drawinglayer
{
namespace primitive3d
{
- AlphaTexturePrimitive3D::AlphaTexturePrimitive3D(
+ TransparenceTexturePrimitive3D::TransparenceTexturePrimitive3D(
const attribute::FillGradientAttribute& rGradient,
const Primitive3DSequence& rChildren,
const basegfx::B2DVector& rTextureSize)
@@ -204,13 +212,13 @@ namespace drawinglayer
{
}
- bool AlphaTexturePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
+ bool TransparenceTexturePrimitive3D::operator==(const BasePrimitive3D& rPrimitive) const
{
return (GradientTexturePrimitive3D::operator==(rPrimitive));
}
// provide unique ID
- ImplPrimitrive3DIDBlock(AlphaTexturePrimitive3D, PRIMITIVE3D_ID_ALPHATEXTUREPRIMITIVE3D)
+ ImplPrimitrive3DIDBlock(TransparenceTexturePrimitive3D, PRIMITIVE3D_ID_TRANSPARENCETEXTUREPRIMITIVE3D)
} // end of namespace primitive3d
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/processor2d/canvasprocessor.cxx b/drawinglayer/source/processor2d/canvasprocessor.cxx
index 561160b8a7..85a99a7741 100644
--- a/drawinglayer/source/processor2d/canvasprocessor.cxx
+++ b/drawinglayer/source/processor2d/canvasprocessor.cxx
@@ -53,7 +53,7 @@
#include <vclhelperbitmaptransform.hxx>
#include <drawinglayer/primitive2d/bitmapprimitive2d.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
-#include <drawinglayer/primitive2d/alphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/transparenceprimitive2d.hxx>
#include <basegfx/tuple/b2i64tuple.hxx>
#include <basegfx/range/b2irange.hxx>
#include <com/sun/star/rendering/XIntegerReadOnlyBitmap.hpp>
@@ -62,7 +62,7 @@
#include <com/sun/star/rendering/PathJoinType.hpp>
#include <drawinglayer/primitive2d/fillbitmapprimitive2d.hxx>
#include <com/sun/star/rendering/TexturingMode.hpp>
-#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
#include <vclhelperbufferdevice.hxx>
#include <drawinglayer/primitive2d/chartprimitive2d.hxx>
#include <helperchartrenderer.hxx>
@@ -380,7 +380,7 @@ using namespace com::sun::star;
// slightly inside), slightly enlarge the
// gradient:
//
- // y/2 sin(alpha) + x/2 cos(alpha)
+ // y/2 sin(transparence) + x/2 cos(transparence)
//
// (values to change are not actual
// gradient scales, but original bound
@@ -595,8 +595,7 @@ using namespace com::sun::star;
}
else
{
- aUnitPolygon = basegfx::tools::createPolygonFromRect(
- basegfx::B2DRange(0.0, 0.0, 1.0, 1.0));
+ aUnitPolygon = basegfx::tools::createUnitPolygon();
}
// create geometries
@@ -969,10 +968,10 @@ using namespace com::sun::star;
// paint content to it
process(rSubList);
- // TODO(F3): render transparent list to alpha
+ // TODO(F3): render transparent list to transparence
// channel. Note that the OutDev implementation has a
// shortcoming, in that nested transparency groups
- // don't work - alpha is not combined properly.
+ // don't work - transparence is not combined properly.
// process(rTransCandidate.getTransparenceList());
@@ -980,7 +979,7 @@ using namespace com::sun::star;
mxCanvas = xLastCanvas;
setWorldToView(aLastWorldToView);
- // DUMMY: add alpha modulation value to DeviceColor
+ // DUMMY: add transparence modulation value to DeviceColor
// TODO(F3): color management
canvas::tools::setDeviceColor( maRenderState,
1.0, 1.0, 1.0, 0.5 );
@@ -1299,7 +1298,7 @@ namespace drawinglayer
{
// there are principally two methods for implementing the mask primitive. One
// is to set a clip polygon at the canvas, the other is to create and use a
- // alpha-using XBitmap for content and draw the mask as alpha. Both have their
+ // transparence-using XBitmap for content and draw the mask as transparence. Both have their
// advantages and disadvantages, so here are both with a bool allowing simple
// change
if(bUseMaskBitmapMethod)
@@ -1372,8 +1371,8 @@ namespace drawinglayer
if(getOptionsDrawinglayer().IsAntiAliasing())
{
// with AA, use 8bit AlphaMask to get nice borders
- VirtualDevice& rAlpha = aBufferDevice.getAlpha();
- rAlpha.GetCanvas()->fillPolyPolygon(
+ VirtualDevice& rTransparence = aBufferDevice.getTransparence();
+ rTransparence.GetCanvas()->fillPolyPolygon(
basegfx::unotools::xPolyPolygonFromB2DPolyPolygon(mxCanvas->getDevice(), aMask),
maViewState, maRenderState);
}
@@ -1578,7 +1577,7 @@ namespace drawinglayer
{
// replace with color filled polygon
const basegfx::BColor aModifiedColor(maBColorModifierStack.getModifiedColor(basegfx::BColor()));
- const basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ const basegfx::B2DPolygon aPolygon(basegfx::tools::createUnitPolygon());
maRenderState.DeviceColor = aModifiedColor.colorToDoubleSequence(mxCanvas->getDevice());
canvas::tools::setRenderStateTransform(maRenderState,
@@ -1611,12 +1610,12 @@ namespace drawinglayer
}
}
- void canvasProcessor2D::impRenderAlphaPrimitive2D(const primitive2d::AlphaPrimitive2D& rAlphaCandidate)
+ void canvasProcessor2D::impRenderTransparencePrimitive2D(const primitive2d::TransparencePrimitive2D& rTransparenceCandidate)
{
- const primitive2d::Primitive2DSequence& rChildren = rAlphaCandidate.getChildren();
- const primitive2d::Primitive2DSequence& rAlpha = rAlphaCandidate.getAlpha();
+ const primitive2d::Primitive2DSequence& rChildren = rTransparenceCandidate.getChildren();
+ const primitive2d::Primitive2DSequence& rTransparence = rTransparenceCandidate.getTransparence();
- if(rChildren.hasElements() && rAlpha.hasElements())
+ if(rChildren.hasElements() && rTransparence.hasElements())
{
// get logic range of transparent part and clip with ViewRange
basegfx::B2DRange aLogicRange(primitive2d::getB2DRangeFromPrimitive2DSequence(rChildren, getViewInformation2D()));
@@ -1680,16 +1679,16 @@ namespace drawinglayer
process(rChildren);
// set to mask
- mpOutputDevice = &aBufferDevice.getAlpha();
+ mpOutputDevice = &aBufferDevice.getTransparence();
mxCanvas = mpOutputDevice->GetCanvas();
canvas::tools::setViewStateTransform(maViewState, getViewInformation2D().getViewTransformation());
- // when painting alpha masks, reset the color stack
+ // when painting transparence masks, reset the color stack
basegfx::BColorModifierStack aLastBColorModifierStack(maBColorModifierStack);
maBColorModifierStack = basegfx::BColorModifierStack();
- // paint mask to it (always with alpha intensities, evtl. with AA)
- process(rAlpha);
+ // paint mask to it (always with transparence intensities, evtl. with AA)
+ process(rTransparence);
// back to old color stack, OutDev, Canvas and ViewTransform
maBColorModifierStack = aLastBColorModifierStack;
@@ -1793,7 +1792,7 @@ namespace drawinglayer
{
// replace with color filled polygon
const basegfx::BColor aModifiedColor(maBColorModifierStack.getModifiedColor(basegfx::BColor()));
- const basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ const basegfx::B2DPolygon aPolygon(basegfx::tools::createUnitPolygon());
maRenderState.DeviceColor = aModifiedColor.colorToDoubleSequence(mxCanvas->getDevice());
canvas::tools::setRenderStateTransform(maRenderState,
@@ -1824,7 +1823,7 @@ namespace drawinglayer
aTexture.RepeatModeY = rendering::TexturingMode::REPEAT;
// canvas needs a polygon to fill, create unit rectangle polygon
- const basegfx::B2DPolygon aOutlineRectangle(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ const basegfx::B2DPolygon aOutlineRectangle(basegfx::tools::createUnitPolygon());
// set primitive's transformation as render state transform
canvas::tools::setRenderStateTransform(maRenderState,
@@ -1852,52 +1851,60 @@ namespace drawinglayer
}
}
- void canvasProcessor2D::impRenderUnifiedAlphaPrimitive2D(const primitive2d::UnifiedAlphaPrimitive2D& rUniAlphaCandidate)
+ void canvasProcessor2D::impRenderUnifiedTransparencePrimitive2D(const primitive2d::UnifiedTransparencePrimitive2D& rUniTransparenceCandidate)
{
- const primitive2d::Primitive2DSequence rChildren = rUniAlphaCandidate.getChildren();
-
- if(rChildren.hasElements())
+ if(0.0 == rUniTransparenceCandidate.getTransparence())
{
- bool bOutputDone(false);
+ // not transparent at all, directly use content
+ process(rUniTransparenceCandidate.getChildren());
+ }
+ else if(rUniTransparenceCandidate.getTransparence() > 0.0 && rUniTransparenceCandidate.getTransparence() < 1.0)
+ {
+ const primitive2d::Primitive2DSequence rChildren = rUniTransparenceCandidate.getChildren();
- // Detect if a single PolyPolygonColorPrimitive2D is contained; in that case,
- // use the fillPolyPolygon method with correctly set alpha. This is a often used
- // case, so detectiong it is valuable
- if(1 == rChildren.getLength())
+ if(rChildren.hasElements())
{
- const primitive2d::Primitive2DReference xReference(rChildren[0]);
- const primitive2d::PolyPolygonColorPrimitive2D* pPoPoColor = dynamic_cast< const primitive2d::PolyPolygonColorPrimitive2D* >(xReference.get());
+ bool bOutputDone(false);
- if(pPoPoColor && PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D == pPoPoColor->getPrimitive2DID())
+ // Detect if a single PolyPolygonColorPrimitive2D is contained; in that case,
+ // use the fillPolyPolygon method with correctly set transparence. This is a often used
+ // case, so detectiong it is valuable
+ if(1 == rChildren.getLength())
{
- // direct draw of PolyPolygon with color and transparence
- const basegfx::BColor aPolygonColor(maBColorModifierStack.getModifiedColor(pPoPoColor->getBColor()));
-
- // add alpha modulation value to DeviceColor
- uno::Sequence< double > aColor(4);
-
- aColor[0] = aPolygonColor.getRed();
- aColor[1] = aPolygonColor.getGreen();
- aColor[2] = aPolygonColor.getBlue();
- aColor[3] = 1.0 - rUniAlphaCandidate.getAlpha();
- maRenderState.DeviceColor = aColor;
-
- canvas::tools::setRenderStateTransform(maRenderState, getViewInformation2D().getObjectTransformation());
- mxCanvas->fillPolyPolygon(
- basegfx::unotools::xPolyPolygonFromB2DPolyPolygon(mxCanvas->getDevice(), pPoPoColor->getB2DPolyPolygon()),
- maViewState, maRenderState);
- bOutputDone = true;
+ const primitive2d::Primitive2DReference xReference(rChildren[0]);
+ const primitive2d::PolyPolygonColorPrimitive2D* pPoPoColor = dynamic_cast< const primitive2d::PolyPolygonColorPrimitive2D* >(xReference.get());
+
+ if(pPoPoColor && PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D == pPoPoColor->getPrimitive2DID())
+ {
+ // direct draw of PolyPolygon with color and transparence
+ const basegfx::BColor aPolygonColor(maBColorModifierStack.getModifiedColor(pPoPoColor->getBColor()));
+
+ // add transparence modulation value to DeviceColor
+ uno::Sequence< double > aColor(4);
+
+ aColor[0] = aPolygonColor.getRed();
+ aColor[1] = aPolygonColor.getGreen();
+ aColor[2] = aPolygonColor.getBlue();
+ aColor[3] = 1.0 - rUniTransparenceCandidate.getTransparence();
+ maRenderState.DeviceColor = aColor;
+
+ canvas::tools::setRenderStateTransform(maRenderState, getViewInformation2D().getObjectTransformation());
+ mxCanvas->fillPolyPolygon(
+ basegfx::unotools::xPolyPolygonFromB2DPolyPolygon(mxCanvas->getDevice(), pPoPoColor->getB2DPolyPolygon()),
+ maViewState, maRenderState);
+ bOutputDone = true;
+ }
+ }
+
+ if(!bOutputDone)
+ {
+ // process decomposition. This will be decomposed to an TransparencePrimitive2D
+ // with the same child context and a single polygon for transparent context. This could be
+ // directly handled here with known VCL-buffer technology, but would only
+ // make a small difference compared to directly rendering the TransparencePrimitive2D
+ // using impRenderTransparencePrimitive2D above.
+ process(rUniTransparenceCandidate.get2DDecomposition(getViewInformation2D()));
}
- }
-
- if(!bOutputDone)
- {
- // process decomposition. This will be decomposed to an AlphaPrimitive2D
- // with the same child context and a single polygon for alpha context. This could be
- // directly handled here with known VCL-buffer technology, but would only
- // make a small difference compared to directly rendering the AlphaPrimitive2D
- // using impRenderAlphaPrimitive2D above.
- process(rUniAlphaCandidate.get2DDecomposition(getViewInformation2D()));
}
}
}
@@ -2055,10 +2062,10 @@ namespace drawinglayer
break;
}
- case PRIMITIVE2D_ID_ALPHAPRIMITIVE2D :
+ case PRIMITIVE2D_ID_TRANSPARENCEPRIMITIVE2D :
{
- // Alpha primitive
- impRenderAlphaPrimitive2D(static_cast< const primitive2d::AlphaPrimitive2D& >(rCandidate));
+ // Transparence primitive
+ impRenderTransparencePrimitive2D(static_cast< const primitive2d::TransparencePrimitive2D& >(rCandidate));
break;
}
@@ -2076,10 +2083,10 @@ namespace drawinglayer
break;
}
- case PRIMITIVE2D_ID_UNIFIEDALPHAPRIMITIVE2D :
+ case PRIMITIVE2D_ID_UNIFIEDTRANSPARENCEPRIMITIVE2D :
{
- // UnifiedAlphaPrimitive2D
- impRenderUnifiedAlphaPrimitive2D(static_cast< const primitive2d::UnifiedAlphaPrimitive2D& >(rCandidate));
+ // UnifiedTransparencePrimitive2D
+ impRenderUnifiedTransparencePrimitive2D(static_cast< const primitive2d::UnifiedTransparencePrimitive2D& >(rCandidate));
break;
}
diff --git a/drawinglayer/source/processor2d/contourextractor2d.cxx b/drawinglayer/source/processor2d/contourextractor2d.cxx
index 1d104cebf0..12449b374d 100644
--- a/drawinglayer/source/processor2d/contourextractor2d.cxx
+++ b/drawinglayer/source/processor2d/contourextractor2d.cxx
@@ -35,7 +35,7 @@
#include <drawinglayer/primitive2d/bitmapprimitive2d.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <drawinglayer/primitive2d/metafileprimitive2d.hxx>
-#include <drawinglayer/primitive2d/alphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/transparenceprimitive2d.hxx>
#include <drawinglayer/primitive2d/maskprimitive2d.hxx>
#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
#include <drawinglayer/primitive2d/sceneprimitive2d.hxx>
@@ -95,7 +95,7 @@ namespace drawinglayer
// extract BoundRect from bitmaps in world coordinates
const primitive2d::BitmapPrimitive2D& rBitmapCandidate(static_cast< const primitive2d::BitmapPrimitive2D& >(rCandidate));
basegfx::B2DHomMatrix aLocalTransform(getViewInformation2D().getObjectTransformation() * rBitmapCandidate.getTransform());
- basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ basegfx::B2DPolygon aPolygon(basegfx::tools::createUnitPolygon());
aPolygon.transform(aLocalTransform);
maExtractedContour.push_back(basegfx::B2DPolyPolygon(aPolygon));
break;
@@ -105,15 +105,15 @@ namespace drawinglayer
// extract BoundRect from MetaFiles in world coordinates
const primitive2d::MetafilePrimitive2D& rMetaCandidate(static_cast< const primitive2d::MetafilePrimitive2D& >(rCandidate));
basegfx::B2DHomMatrix aLocalTransform(getViewInformation2D().getObjectTransformation() * rMetaCandidate.getTransform());
- basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ basegfx::B2DPolygon aPolygon(basegfx::tools::createUnitPolygon());
aPolygon.transform(aLocalTransform);
maExtractedContour.push_back(basegfx::B2DPolyPolygon(aPolygon));
break;
}
- case PRIMITIVE2D_ID_ALPHAPRIMITIVE2D :
+ case PRIMITIVE2D_ID_TRANSPARENCEPRIMITIVE2D :
{
// sub-transparence group. Look at children
- const primitive2d::AlphaPrimitive2D& rTransCandidate(static_cast< const primitive2d::AlphaPrimitive2D& >(rCandidate));
+ const primitive2d::TransparencePrimitive2D& rTransCandidate(static_cast< const primitive2d::TransparencePrimitive2D& >(rCandidate));
process(rTransCandidate.getChildren());
break;
}
diff --git a/drawinglayer/source/processor2d/hittestprocessor2d.cxx b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
index a8722c6956..9502df95a3 100644
--- a/drawinglayer/source/processor2d/hittestprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/hittestprocessor2d.cxx
@@ -35,13 +35,14 @@
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
-#include <drawinglayer/primitive2d/alphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/transparenceprimitive2d.hxx>
#include <drawinglayer/primitive2d/maskprimitive2d.hxx>
#include <drawinglayer/primitive2d/sceneprimitive2d.hxx>
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
#include <drawinglayer/primitive2d/pointarrayprimitive2d.hxx>
#include <basegfx/matrix/b3dhommatrix.hxx>
#include <drawinglayer/processor3d/cutfindprocessor3d.hxx>
+#include <drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx>
+#include <drawinglayer/primitive2d/bitmapprimitive2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -58,7 +59,7 @@ namespace drawinglayer
mfDiscreteHitTolerance(0.0),
mbHit(false),
mbHitToleranceUsed(false),
- mbUseHitTestPrimitiveContent(true),
+ mbUseInvisiblePrimitiveContent(true),
mbHitTextOnly(bHitTextOnly)
{
// init hit tolerance
@@ -239,7 +240,7 @@ namespace drawinglayer
if(!getHit())
{
// empty 3D scene; Check for border hit
- basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ basegfx::B2DPolygon aOutline(basegfx::tools::createUnitPolygon());
aOutline.transform(rCandidate.getObjectTransformation());
mbHit = checkHairlineHitWithTolerance(aOutline, getDiscreteHitTolerance());
@@ -412,10 +413,10 @@ namespace drawinglayer
break;
}
- case PRIMITIVE2D_ID_ALPHAPRIMITIVE2D :
+ case PRIMITIVE2D_ID_TRANSPARENCEPRIMITIVE2D :
{
// sub-transparence group
- const primitive2d::AlphaPrimitive2D& rTransCandidate(static_cast< const primitive2d::AlphaPrimitive2D& >(rCandidate));
+ const primitive2d::TransparencePrimitive2D& rTransCandidate(static_cast< const primitive2d::TransparencePrimitive2D& >(rCandidate));
// Currently the transparence content is not taken into account; only
// the children are recursively checked for hit. This may be refined for
@@ -479,6 +480,49 @@ namespace drawinglayer
break;
}
case PRIMITIVE2D_ID_BITMAPPRIMITIVE2D :
+ {
+ if(!getHitTextOnly())
+ {
+ // The recently added BitmapEx::GetTransparency() makes it easy to extend
+ // the BitmapPrimitive2D HitTest to take the contained BotmapEx and it's
+ // transparency into account
+ const basegfx::B2DRange aRange(rCandidate.getB2DRange(getViewInformation2D()));
+
+ if(!aRange.isEmpty())
+ {
+ const primitive2d::BitmapPrimitive2D& rBitmapCandidate(static_cast< const primitive2d::BitmapPrimitive2D& >(rCandidate));
+ const BitmapEx& rBitmapEx = rBitmapCandidate.getBitmapEx();
+ const Size& rSizePixel(rBitmapEx.GetSizePixel());
+
+ if(rSizePixel.Width() && rSizePixel.Height())
+ {
+ basegfx::B2DHomMatrix aBackTransform(
+ getViewInformation2D().getObjectToViewTransformation() *
+ rBitmapCandidate.getTransform());
+ aBackTransform.invert();
+
+ const basegfx::B2DPoint aRelativePoint(aBackTransform * getDiscreteHitPosition());
+ const basegfx::B2DRange aUnitRange(0.0, 0.0, 1.0, 1.0);
+
+ if(aUnitRange.isInside(aRelativePoint))
+ {
+ const sal_Int32 nX(basegfx::fround(aRelativePoint.getX() * rSizePixel.Width()));
+ const sal_Int32 nY(basegfx::fround(aRelativePoint.getY() * rSizePixel.Height()));
+
+ mbHit = (0xff != rBitmapEx.GetTransparency(nX, nY));
+ }
+ }
+ else
+ {
+ // fallback to standard HitTest
+ const basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(aRange));
+ mbHit = checkFillHitWithTolerance(basegfx::B2DPolyPolygon(aOutline), getDiscreteHitTolerance());
+ }
+ }
+ }
+
+ break;
+ }
case PRIMITIVE2D_ID_METAFILEPRIMITIVE2D :
case PRIMITIVE2D_ID_CONTROLPRIMITIVE2D :
case PRIMITIVE2D_ID_FILLGRADIENTPRIMITIVE2D :
@@ -491,7 +535,7 @@ namespace drawinglayer
// will be used for HitTest currently.
//
// This may be refined in the future, e.g:
- // - For Bitamps, the mask and/or alpha information may be used
+ // - For Bitamps, the mask and/or transparence information may be used
// - For MetaFiles, the MetaFile content may be used
const basegfx::B2DRange aRange(rCandidate.getB2DRange(getViewInformation2D()));
@@ -504,15 +548,20 @@ namespace drawinglayer
break;
}
- case PRIMITIVE2D_ID_HITTESTPRIMITIVE2D :
+ case PRIMITIVE2D_ID_HIDDENGEOMETRYPRIMITIVE2D :
{
- // HitTest primitive; the default decomposition would return an empty seqence,
+ // HiddenGeometryPrimitive2D; the default decomposition would return an empty seqence,
// so force this primitive to process it's children directly if the switch is set
// (which is the default). Else, ignore invisible content
- if(getUseHitTestPrimitiveContent())
+ const primitive2d::HiddenGeometryPrimitive2D& rHiddenGeometry(static_cast< const primitive2d::HiddenGeometryPrimitive2D& >(rCandidate));
+ const primitive2d::Primitive2DSequence& rChildren = rHiddenGeometry.getChildren();
+
+ if(rChildren.hasElements())
{
- const primitive2d::HitTestPrimitive2D& rHitTestCandidate(static_cast< const primitive2d::HitTestPrimitive2D& >(rCandidate));
- process(rHitTestCandidate.getChildren());
+ if(getUseInvisiblePrimitiveContent())
+ {
+ process(rChildren);
+ }
}
break;
diff --git a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
index 99eb1a401d..da9f2ffe07 100644
--- a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
+++ b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
@@ -115,7 +115,7 @@ namespace drawinglayer
if(bDoSaveForVisualControl)
{
- SvFileStream aNew((const String&)String(ByteString( "c:\\alpha.bmp" ), RTL_TEXTENCODING_UTF8), STREAM_WRITE|STREAM_TRUNC);
+ SvFileStream aNew((const String&)String(ByteString( "c:\\transparence.bmp" ), RTL_TEXTENCODING_UTF8), STREAM_WRITE|STREAM_TRUNC);
aNew << aAlphaMask.GetBitmap();
}
@@ -162,7 +162,7 @@ namespace drawinglayer
return *mpMask;
}
- VirtualDevice& impBufferDevice::getAlpha()
+ VirtualDevice& impBufferDevice::getTransparence()
{
if(!mpAlpha)
{
diff --git a/drawinglayer/source/processor2d/vclhelperbufferdevice.hxx b/drawinglayer/source/processor2d/vclhelperbufferdevice.hxx
index d33e5a40a5..4bea345b43 100644
--- a/drawinglayer/source/processor2d/vclhelperbufferdevice.hxx
+++ b/drawinglayer/source/processor2d/vclhelperbufferdevice.hxx
@@ -59,7 +59,7 @@ namespace drawinglayer
bool isVisible() const { return !maDestPixel.IsEmpty(); }
VirtualDevice& getContent() { return maContent; }
VirtualDevice& getMask();
- VirtualDevice& getAlpha();
+ VirtualDevice& getTransparence();
};
} // end of namespace drawinglayer
diff --git a/drawinglayer/source/processor2d/vclhelpergradient.cxx b/drawinglayer/source/processor2d/vclhelpergradient.cxx
index 049b1a0a60..f48efbeea0 100644
--- a/drawinglayer/source/processor2d/vclhelpergradient.cxx
+++ b/drawinglayer/source/processor2d/vclhelpergradient.cxx
@@ -210,16 +210,6 @@ namespace drawinglayer
::std::vector< basegfx::BColor > aColors;
basegfx::B2DPolygon aUnitPolygon;
- if(attribute::GRADIENTSTYLE_RADIAL == eGradientStyle || attribute::GRADIENTSTYLE_ELLIPTICAL == eGradientStyle)
- {
- const basegfx::B2DPoint aCircleCenter(0.5, 0.5);
- aUnitPolygon = basegfx::tools::createPolygonFromEllipse(aCircleCenter, 0.5, 0.5);
- }
- else
- {
- aUnitPolygon = basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0));
- }
-
// make sure steps is not too high/low
nSteps = impCalcGradientSteps(rOutDev, nSteps, aOutlineRange, sal_uInt32((rStart.getMaximumDistance(rEnd) * 127.5) + 0.5));
@@ -231,6 +221,7 @@ namespace drawinglayer
texture::GeoTexSvxGradientLinear aGradient(aOutlineRange, rStart, rEnd, nSteps, fBorder, fAngle);
aGradient.appendTransformations(aMatrices);
aGradient.appendColors(aColors);
+ aUnitPolygon = basegfx::tools::createUnitPolygon();
break;
}
case attribute::GRADIENTSTYLE_AXIAL:
@@ -238,6 +229,7 @@ namespace drawinglayer
texture::GeoTexSvxGradientAxial aGradient(aOutlineRange, rStart, rEnd, nSteps, fBorder, fAngle);
aGradient.appendTransformations(aMatrices);
aGradient.appendColors(aColors);
+ aUnitPolygon = basegfx::tools::createPolygonFromRect(basegfx::B2DRange(-1, -1, 1, 1));
break;
}
case attribute::GRADIENTSTYLE_RADIAL:
@@ -245,6 +237,7 @@ namespace drawinglayer
texture::GeoTexSvxGradientRadial aGradient(aOutlineRange, rStart, rEnd, nSteps, fBorder, fOffsetX, fOffsetY);
aGradient.appendTransformations(aMatrices);
aGradient.appendColors(aColors);
+ aUnitPolygon = basegfx::tools::createPolygonFromCircle(basegfx::B2DPoint(0,0), 1);
break;
}
case attribute::GRADIENTSTYLE_ELLIPTICAL:
@@ -252,6 +245,7 @@ namespace drawinglayer
texture::GeoTexSvxGradientElliptical aGradient(aOutlineRange, rStart, rEnd, nSteps, fBorder, fOffsetX, fOffsetX, fAngle);
aGradient.appendTransformations(aMatrices);
aGradient.appendColors(aColors);
+ aUnitPolygon = basegfx::tools::createPolygonFromCircle(basegfx::B2DPoint(0,0), 1);
break;
}
case attribute::GRADIENTSTYLE_SQUARE:
@@ -259,6 +253,7 @@ namespace drawinglayer
texture::GeoTexSvxGradientSquare aGradient(aOutlineRange, rStart, rEnd, nSteps, fBorder, fOffsetX, fOffsetX, fAngle);
aGradient.appendTransformations(aMatrices);
aGradient.appendColors(aColors);
+ aUnitPolygon = basegfx::tools::createPolygonFromRect(basegfx::B2DRange(-1, -1, 1, 1));
break;
}
case attribute::GRADIENTSTYLE_RECT:
@@ -266,6 +261,7 @@ namespace drawinglayer
texture::GeoTexSvxGradientRect aGradient(aOutlineRange, rStart, rEnd, nSteps, fBorder, fOffsetX, fOffsetX, fAngle);
aGradient.appendTransformations(aMatrices);
aGradient.appendColors(aColors);
+ aUnitPolygon = basegfx::tools::createPolygonFromRect(basegfx::B2DRange(-1, -1, 1, 1));
break;
}
}
diff --git a/drawinglayer/source/processor2d/vclhelpergradient.hxx b/drawinglayer/source/processor2d/vclhelpergradient.hxx
index b430425c54..81c9f03eb7 100644
--- a/drawinglayer/source/processor2d/vclhelpergradient.hxx
+++ b/drawinglayer/source/processor2d/vclhelpergradient.hxx
@@ -28,7 +28,8 @@
#ifndef INCLUDED_DRAWINGLAYER_PROCESSOR2D_VCLHELPERGRADIENT_HXX
#define INCLUDED_DRAWINGLAYER_PROCESSOR2D_VCLHELPERGRADIENT_HXX
-#include <drawinglayer/attribute/fillattribute.hxx>
+#include <sal/types.h>
+#include <drawinglayer/attribute/fillgradientattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
// predefines
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 2793de9abd..6498ee34f1 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -33,7 +33,6 @@
#include <vcl/virdev.hxx>
#include <vcl/gdimtf.hxx>
#include <vcl/gradient.hxx>
-#include <drawinglayer/attribute/fillattribute.hxx>
#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
#include <drawinglayer/primitive2d/textprimitive2d.hxx>
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
@@ -44,8 +43,8 @@
#include <basegfx/polygon/b2dpolygonclipper.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx>
-#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
-#include <drawinglayer/primitive2d/alphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
+#include <drawinglayer/primitive2d/transparenceprimitive2d.hxx>
#include <drawinglayer/primitive2d/fillgradientprimitive2d.hxx>
#include <drawinglayer/processor2d/vclpixelprocessor2d.hxx>
#include <tools/stream.hxx>
@@ -65,8 +64,8 @@
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <drawinglayer/primitive2d/pagepreviewprimitive2d.hxx>
#include <helperchartrenderer.hxx>
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
#include <drawinglayer/primitive2d/epsprimitive2d.hxx>
+#include <basegfx/polygon/b2dlinegeometry.hxx>
//////////////////////////////////////////////////////////////////////////////
// for PDFExtOutDevData Graphic support
@@ -152,7 +151,7 @@ namespace drawinglayer
{
if(bIsTransparenceGradient)
{
- // it's about alpha channel intensities (black/white), do not use color modifier
+ // it's about transparence channel intensities (black/white), do not use color modifier
o_rVCLGradient.SetStartColor(Color(rFiGrAtt.getStartColor()));
o_rVCLGradient.SetEndColor(Color(rFiGrAtt.getEndColor()));
}
@@ -436,13 +435,13 @@ namespace drawinglayer
fills. Thus, users have the choice to use the SvtGraphicFill info or the created output
actions.
Even for XFillTransparenceItem it is used, thus it may need to be supported in
- UnifiedAlphaPrimitive2D, too, when interpreted as normally filled PolyPolygon.
+ UnifiedTransparencePrimitive2D, too, when interpreted as normally filled PolyPolygon.
Implemented for:
PRIMITIVE2D_ID_POLYPOLYGONBITMAPPRIMITIVE2D,
PRIMITIVE2D_ID_POLYPOLYGONHATCHPRIMITIVE2D,
PRIMITIVE2D_ID_POLYPOLYGONGRADIENTPRIMITIVE2D,
PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D,
- and for PRIMITIVE2D_ID_UNIFIEDALPHAPRIMITIVE2D when detected unified alpha
+ and for PRIMITIVE2D_ID_UNIFIEDTRANSPARENCEPRIMITIVE2D when detected unified transparence
XPATHSTROKE_SEQ_BEGIN, XPATHSTROKE_SEQ_END:
@@ -1475,138 +1474,166 @@ namespace drawinglayer
RenderModifiedColorPrimitive2D(static_cast< const primitive2d::ModifiedColorPrimitive2D& >(rCandidate));
break;
}
- case PRIMITIVE2D_ID_UNIFIEDALPHAPRIMITIVE2D :
+ case PRIMITIVE2D_ID_HIDDENGEOMETRYPRIMITIVE2D :
+ {
+ // HiddenGeometryPrimitive2D; to rebuilt the old MetaFile creation, it is necessary to
+ // not ignore them (as it was thought), but to add a MetaFile entry for them.
+ basegfx::B2DRange aInvisibleRange(rCandidate.getB2DRange(getViewInformation2D()));
+
+ if(!aInvisibleRange.isEmpty())
+ {
+ aInvisibleRange.transform(maCurrentTransformation);
+ const Rectangle aRectLogic(
+ (sal_Int32)floor(aInvisibleRange.getMinX()), (sal_Int32)floor(aInvisibleRange.getMinY()),
+ (sal_Int32)ceil(aInvisibleRange.getMaxX()), (sal_Int32)ceil(aInvisibleRange.getMaxY()));
+
+ mpOutputDevice->SetFillColor();
+ mpOutputDevice->SetLineColor();
+ mpOutputDevice->DrawRect(aRectLogic);
+ }
+
+ break;
+ }
+ case PRIMITIVE2D_ID_UNIFIEDTRANSPARENCEPRIMITIVE2D :
{
// for metafile: Need to examine what the pure vcl version is doing here actually
// - uses DrawTransparent with metafile for content and a gradient
// - uses DrawTransparent for single PolyPoylgons directly. Can be detected by
// checking the content for single PolyPolygonColorPrimitive2D
- const primitive2d::UnifiedAlphaPrimitive2D& rUniAlphaCandidate = static_cast< const primitive2d::UnifiedAlphaPrimitive2D& >(rCandidate);
- const primitive2d::Primitive2DSequence rContent = rUniAlphaCandidate.getChildren();
+ const primitive2d::UnifiedTransparencePrimitive2D& rUniTransparenceCandidate = static_cast< const primitive2d::UnifiedTransparencePrimitive2D& >(rCandidate);
+ const primitive2d::Primitive2DSequence rContent = rUniTransparenceCandidate.getChildren();
if(rContent.hasElements())
{
- // try to identify a single PolyPolygonColorPrimitive2D in the
- // content part of the alpha primitive
- const primitive2d::PolyPolygonColorPrimitive2D* pPoPoColor = 0;
- static bool bForceToMetafile(false);
-
- if(!bForceToMetafile && 1 == rContent.getLength())
+ if(0.0 == rUniTransparenceCandidate.getTransparence())
{
- const primitive2d::Primitive2DReference xReference(rContent[0]);
- pPoPoColor = dynamic_cast< const primitive2d::PolyPolygonColorPrimitive2D* >(xReference.get());
+ // not transparent at all, use content
+ process(rUniTransparenceCandidate.getChildren());
}
-
- // PolyPolygonGradientPrimitive2D, PolyPolygonHatchPrimitive2D and
- // PolyPolygonBitmapPrimitive2D are derived from PolyPolygonColorPrimitive2D.
- // Check also for correct ID to exclude derived implementations
- if(pPoPoColor && PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D == pPoPoColor->getPrimitive2DID())
+ else if(rUniTransparenceCandidate.getTransparence() > 0.0 && rUniTransparenceCandidate.getTransparence() < 1.0)
{
- // single transparent PolyPolygon identified, use directly
- const basegfx::BColor aPolygonColor(maBColorModifierStack.getModifiedColor(pPoPoColor->getBColor()));
- basegfx::B2DPolyPolygon aLocalPolyPolygon(pPoPoColor->getB2DPolyPolygon());
- aLocalPolyPolygon.transform(maCurrentTransformation);
-
- // XPATHFILL_SEQ_BEGIN/XPATHFILL_SEQ_END support
- SvtGraphicFill* pSvtGraphicFill = 0;
+ // try to identify a single PolyPolygonColorPrimitive2D in the
+ // content part of the transparence primitive
+ const primitive2d::PolyPolygonColorPrimitive2D* pPoPoColor = 0;
+ static bool bForceToMetafile(false);
- if(!mnSvtGraphicFillCount && aLocalPolyPolygon.count())
+ if(!bForceToMetafile && 1 == rContent.getLength())
{
- // setup simple color with transparence fill stuff like in impgrfll
- pSvtGraphicFill = new SvtGraphicFill(
- PolyPolygon(aLocalPolyPolygon),
- Color(aPolygonColor),
- rUniAlphaCandidate.getAlpha(),
- SvtGraphicFill::fillEvenOdd,
- SvtGraphicFill::fillSolid,
- SvtGraphicFill::Transform(),
- false,
- SvtGraphicFill::hatchSingle,
- Color(),
- SvtGraphicFill::gradientLinear,
- Color(),
- Color(),
- 0,
- Graphic());
+ const primitive2d::Primitive2DReference xReference(rContent[0]);
+ pPoPoColor = dynamic_cast< const primitive2d::PolyPolygonColorPrimitive2D* >(xReference.get());
}
- // set line and fill color
- const sal_uInt16 nTransPercentVcl((sal_uInt16)basegfx::fround(rUniAlphaCandidate.getAlpha() * 100.0));
- mpOutputDevice->SetFillColor(Color(aPolygonColor));
- mpOutputDevice->SetLineColor();
-
- // call VCL directly; encapsulate with SvtGraphicFill
- impStartSvtGraphicFill(pSvtGraphicFill);
- mpOutputDevice->DrawTransparent(
- PolyPolygon(aLocalPolyPolygon),
- nTransPercentVcl);
- impEndSvtGraphicFill(pSvtGraphicFill);
- }
- else
- {
- // svae old mfCurrentUnifiedTransparence and set new one
- // so that contained SvtGraphicStroke may use the current one
- const double fLastCurrentUnifiedTransparence(mfCurrentUnifiedTransparence);
- // #i105377# paint the content metafile opaque as the transparency gets
- // split of into the gradient below
- // mfCurrentUnifiedTransparence = rUniAlphaCandidate.getAlpha();
- mfCurrentUnifiedTransparence = 0;
+ // PolyPolygonGradientPrimitive2D, PolyPolygonHatchPrimitive2D and
+ // PolyPolygonBitmapPrimitive2D are derived from PolyPolygonColorPrimitive2D.
+ // Check also for correct ID to exclude derived implementations
+ if(pPoPoColor && PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D == pPoPoColor->getPrimitive2DID())
+ {
+ // single transparent PolyPolygon identified, use directly
+ const basegfx::BColor aPolygonColor(maBColorModifierStack.getModifiedColor(pPoPoColor->getBColor()));
+ basegfx::B2DPolyPolygon aLocalPolyPolygon(pPoPoColor->getB2DPolyPolygon());
+ aLocalPolyPolygon.transform(maCurrentTransformation);
- // various content, create content-metafile
- GDIMetaFile aContentMetafile;
- const Rectangle aPrimitiveRectangle(impDumpToMetaFile(rContent, aContentMetafile));
+ // XPATHFILL_SEQ_BEGIN/XPATHFILL_SEQ_END support
+ SvtGraphicFill* pSvtGraphicFill = 0;
- // restore mfCurrentUnifiedTransparence; it may have been used
- // while processing the sub-content in impDumpToMetaFile
- mfCurrentUnifiedTransparence = fLastCurrentUnifiedTransparence;
+ if(!mnSvtGraphicFillCount && aLocalPolyPolygon.count())
+ {
+ // setup simple color with transparence fill stuff like in impgrfll
+ pSvtGraphicFill = new SvtGraphicFill(
+ PolyPolygon(aLocalPolyPolygon),
+ Color(aPolygonColor),
+ rUniTransparenceCandidate.getTransparence(),
+ SvtGraphicFill::fillEvenOdd,
+ SvtGraphicFill::fillSolid,
+ SvtGraphicFill::Transform(),
+ false,
+ SvtGraphicFill::hatchSingle,
+ Color(),
+ SvtGraphicFill::gradientLinear,
+ Color(),
+ Color(),
+ 0,
+ Graphic());
+ }
- // create uniform VCL gradient for uniform transparency
- Gradient aVCLGradient;
- const sal_uInt8 nTransPercentVcl((sal_uInt8)basegfx::fround(rUniAlphaCandidate.getAlpha() * 255.0));
- const Color aTransColor(nTransPercentVcl, nTransPercentVcl, nTransPercentVcl);
-
- aVCLGradient.SetStyle(GRADIENT_LINEAR);
- aVCLGradient.SetStartColor(aTransColor);
- aVCLGradient.SetEndColor(aTransColor);
- aVCLGradient.SetAngle(0);
- aVCLGradient.SetBorder(0);
- aVCLGradient.SetOfsX(0);
- aVCLGradient.SetOfsY(0);
- aVCLGradient.SetStartIntensity(100);
- aVCLGradient.SetEndIntensity(100);
- aVCLGradient.SetSteps(2);
-
- // render it to VCL
- mpOutputDevice->DrawTransparent(
- aContentMetafile, aPrimitiveRectangle.TopLeft(),
- aPrimitiveRectangle.GetSize(), aVCLGradient);
+ // set line and fill color
+ const sal_uInt16 nTransPercentVcl((sal_uInt16)basegfx::fround(rUniTransparenceCandidate.getTransparence() * 100.0));
+ mpOutputDevice->SetFillColor(Color(aPolygonColor));
+ mpOutputDevice->SetLineColor();
+
+ // call VCL directly; encapsulate with SvtGraphicFill
+ impStartSvtGraphicFill(pSvtGraphicFill);
+ mpOutputDevice->DrawTransparent(
+ PolyPolygon(aLocalPolyPolygon),
+ nTransPercentVcl);
+ impEndSvtGraphicFill(pSvtGraphicFill);
+ }
+ else
+ {
+ // svae old mfCurrentUnifiedTransparence and set new one
+ // so that contained SvtGraphicStroke may use the current one
+ const double fLastCurrentUnifiedTransparence(mfCurrentUnifiedTransparence);
+ // #i105377# paint the content metafile opaque as the transparency gets
+ // split of into the gradient below
+ // mfCurrentUnifiedTransparence = rUniTransparenceCandidate.getTransparence();
+ mfCurrentUnifiedTransparence = 0;
+
+ // various content, create content-metafile
+ GDIMetaFile aContentMetafile;
+ const Rectangle aPrimitiveRectangle(impDumpToMetaFile(rContent, aContentMetafile));
+
+ // restore mfCurrentUnifiedTransparence; it may have been used
+ // while processing the sub-content in impDumpToMetaFile
+ mfCurrentUnifiedTransparence = fLastCurrentUnifiedTransparence;
+
+ // create uniform VCL gradient for uniform transparency
+ Gradient aVCLGradient;
+ const sal_uInt8 nTransPercentVcl((sal_uInt8)basegfx::fround(rUniTransparenceCandidate.getTransparence() * 255.0));
+ const Color aTransColor(nTransPercentVcl, nTransPercentVcl, nTransPercentVcl);
+
+ aVCLGradient.SetStyle(GRADIENT_LINEAR);
+ aVCLGradient.SetStartColor(aTransColor);
+ aVCLGradient.SetEndColor(aTransColor);
+ aVCLGradient.SetAngle(0);
+ aVCLGradient.SetBorder(0);
+ aVCLGradient.SetOfsX(0);
+ aVCLGradient.SetOfsY(0);
+ aVCLGradient.SetStartIntensity(100);
+ aVCLGradient.SetEndIntensity(100);
+ aVCLGradient.SetSteps(2);
+
+ // render it to VCL
+ mpOutputDevice->DrawTransparent(
+ aContentMetafile, aPrimitiveRectangle.TopLeft(),
+ aPrimitiveRectangle.GetSize(), aVCLGradient);
+ }
}
}
break;
}
- case PRIMITIVE2D_ID_ALPHAPRIMITIVE2D :
+ case PRIMITIVE2D_ID_TRANSPARENCEPRIMITIVE2D :
{
// for metafile: Need to examine what the pure vcl version is doing here actually
// - uses DrawTransparent with metafile for content and a gradient
// i can detect this here with checking the gradient part for a single
// FillGradientPrimitive2D and reconstruct the gradient.
- // If that detection goes wrong, i have to create an alpha-blended bitmap. Eventually
- // do that in stripes, else RenderAlphaPrimitive2D may just be used
- const primitive2d::AlphaPrimitive2D& rAlphaCandidate = static_cast< const primitive2d::AlphaPrimitive2D& >(rCandidate);
- const primitive2d::Primitive2DSequence rContent = rAlphaCandidate.getChildren();
- const primitive2d::Primitive2DSequence rAlpha = rAlphaCandidate.getAlpha();
+ // If that detection goes wrong, i have to create an transparence-blended bitmap. Eventually
+ // do that in stripes, else RenderTransparencePrimitive2D may just be used
+ const primitive2d::TransparencePrimitive2D& rTransparenceCandidate = static_cast< const primitive2d::TransparencePrimitive2D& >(rCandidate);
+ const primitive2d::Primitive2DSequence rContent = rTransparenceCandidate.getChildren();
+ const primitive2d::Primitive2DSequence rTransparence = rTransparenceCandidate.getTransparence();
- if(rContent.hasElements() && rAlpha.hasElements())
+ if(rContent.hasElements() && rTransparence.hasElements())
{
// try to identify a single FillGradientPrimitive2D in the
- // alpha part of the primitive
+ // transparence part of the primitive
const primitive2d::FillGradientPrimitive2D* pFiGradient = 0;
static bool bForceToBigTransparentVDev(false);
- if(!bForceToBigTransparentVDev && 1 == rAlpha.getLength())
+ if(!bForceToBigTransparentVDev && 1 == rTransparence.getLength())
{
- const primitive2d::Primitive2DReference xReference(rAlpha[0]);
+ const primitive2d::Primitive2DReference xReference(rTransparence[0]);
pFiGradient = dynamic_cast< const primitive2d::FillGradientPrimitive2D* >(xReference.get());
}
@@ -1638,7 +1665,7 @@ namespace drawinglayer
// Okay, basic implementation finished and tested. The DPI stuff was hard
// and not easy to find out that it's needed.
// Since this will not yet happen normally (as long as noone constructs
- // alpha primitives with non-trivial alpha content) i will for now not
+ // transparence primitives with non-trivial transparence content) i will for now not
// refine to tiling here.
basegfx::B2DRange aViewRange(primitive2d::getB2DRangeFromPrimitive2DSequence(rContent, getViewInformation2D()));
@@ -1689,9 +1716,9 @@ namespace drawinglayer
aBufferProcessor.process(rContent);
const Bitmap aBmContent(aBufferDevice.GetBitmap(aEmptyPoint, aSizePixel));
- // draw alpha using pixel renderer
+ // draw transparence using pixel renderer
aBufferDevice.Erase();
- aBufferProcessor.process(rAlpha);
+ aBufferProcessor.process(rTransparence);
const AlphaMask aBmAlpha(aBufferDevice.GetBitmap(aEmptyPoint, aSizePixel));
#ifdef DBG_UTIL
@@ -1777,27 +1804,6 @@ namespace drawinglayer
break;
}
- case PRIMITIVE2D_ID_HITTESTPRIMITIVE2D :
- {
- // #i99123#
- // invisible primitive; to rebuilt the old MetaFile creation, it is necessary to
- // not ignore them (as it was thought), but to add a MetaFile entry for them.
- basegfx::B2DRange aInvisibleRange(rCandidate.getB2DRange(getViewInformation2D()));
-
- if(!aInvisibleRange.isEmpty())
- {
- aInvisibleRange.transform(maCurrentTransformation);
- const Rectangle aRectLogic(
- (sal_Int32)floor(aInvisibleRange.getMinX()), (sal_Int32)floor(aInvisibleRange.getMinY()),
- (sal_Int32)ceil(aInvisibleRange.getMaxX()), (sal_Int32)ceil(aInvisibleRange.getMaxY()));
-
- mpOutputDevice->SetFillColor();
- mpOutputDevice->SetLineColor();
- mpOutputDevice->DrawRect(aRectLogic);
- }
-
- break;
- }
case PRIMITIVE2D_ID_EPSPRIMITIVE2D :
{
RenderEpsPrimitive2D(static_cast< const primitive2d::EpsPrimitive2D& >(rCandidate));
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index e21e0f4d4a..19f415faba 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -39,14 +39,14 @@
#include <drawinglayer/primitive2d/metafileprimitive2d.hxx>
#include <drawinglayer/primitive2d/maskprimitive2d.hxx>
#include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx>
-#include <drawinglayer/primitive2d/alphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/transparenceprimitive2d.hxx>
#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
#include <drawinglayer/primitive2d/markerarrayprimitive2d.hxx>
#include <drawinglayer/primitive2d/pointarrayprimitive2d.hxx>
#include <drawinglayer/primitive2d/wrongspellprimitive2d.hxx>
#include <drawinglayer/primitive2d/controlprimitive2d.hxx>
#include <com/sun/star/awt/XWindow2.hpp>
-#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
#include <drawinglayer/primitive2d/pagepreviewprimitive2d.hxx>
#include <drawinglayer/primitive2d/chartprimitive2d.hxx>
#include <helperchartrenderer.hxx>
@@ -259,50 +259,62 @@ namespace drawinglayer
RenderModifiedColorPrimitive2D(static_cast< const primitive2d::ModifiedColorPrimitive2D& >(rCandidate));
break;
}
- case PRIMITIVE2D_ID_UNIFIEDALPHAPRIMITIVE2D :
+ case PRIMITIVE2D_ID_UNIFIEDTRANSPARENCEPRIMITIVE2D :
{
// Detect if a single PolyPolygonColorPrimitive2D is contained; in that case,
// use the faster OutputDevice::DrawTransparent method
- const primitive2d::UnifiedAlphaPrimitive2D& rUniAlphaCandidate = static_cast< const primitive2d::UnifiedAlphaPrimitive2D& >(rCandidate);
- const primitive2d::Primitive2DSequence rContent = rUniAlphaCandidate.getChildren();
- bool bDrawTransparentUsed(false);
+ const primitive2d::UnifiedTransparencePrimitive2D& rUniTransparenceCandidate = static_cast< const primitive2d::UnifiedTransparencePrimitive2D& >(rCandidate);
+ const primitive2d::Primitive2DSequence rContent = rUniTransparenceCandidate.getChildren();
- // since DEV300 m33 DrawTransparent is supported in VCL (for some targets
- // natively), so i am now enabling this shortcut
- static bool bAllowUsingDrawTransparent(true);
-
- if(bAllowUsingDrawTransparent && rContent.hasElements() && 1 == rContent.getLength())
+ if(rContent.hasElements())
{
- const primitive2d::Primitive2DReference xReference(rContent[0]);
- const primitive2d::PolyPolygonColorPrimitive2D* pPoPoColor = dynamic_cast< const primitive2d::PolyPolygonColorPrimitive2D* >(xReference.get());
-
- if(pPoPoColor && PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D == pPoPoColor->getPrimitive2DID())
+ if(0.0 == rUniTransparenceCandidate.getTransparence())
{
- // single transparent PolyPolygon identified, use directly
- const basegfx::BColor aPolygonColor(maBColorModifierStack.getModifiedColor(pPoPoColor->getBColor()));
- mpOutputDevice->SetFillColor(Color(aPolygonColor));
- mpOutputDevice->SetLineColor();
-
- basegfx::B2DPolyPolygon aLocalPolyPolygon(pPoPoColor->getB2DPolyPolygon());
- aLocalPolyPolygon.transform(maCurrentTransformation);
-
- mpOutputDevice->DrawTransparent(aLocalPolyPolygon, rUniAlphaCandidate.getAlpha());
- bDrawTransparentUsed = true;
+ // not transparent at all, use content
+ process(rUniTransparenceCandidate.getChildren());
}
- }
+ else if(rUniTransparenceCandidate.getTransparence() > 0.0 && rUniTransparenceCandidate.getTransparence() < 1.0)
+ {
+ bool bDrawTransparentUsed(false);
- if(!bDrawTransparentUsed)
- {
- // unified sub-transparence. Draw to VDev first.
- RenderUnifiedAlphaPrimitive2D(rUniAlphaCandidate);
+ // since DEV300 m33 DrawTransparent is supported in VCL (for some targets
+ // natively), so i am now enabling this shortcut
+ static bool bAllowUsingDrawTransparent(true);
+
+ if(bAllowUsingDrawTransparent && 1 == rContent.getLength())
+ {
+ const primitive2d::Primitive2DReference xReference(rContent[0]);
+ const primitive2d::PolyPolygonColorPrimitive2D* pPoPoColor = dynamic_cast< const primitive2d::PolyPolygonColorPrimitive2D* >(xReference.get());
+
+ if(pPoPoColor && PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D == pPoPoColor->getPrimitive2DID())
+ {
+ // single transparent PolyPolygon identified, use directly
+ const basegfx::BColor aPolygonColor(maBColorModifierStack.getModifiedColor(pPoPoColor->getBColor()));
+ mpOutputDevice->SetFillColor(Color(aPolygonColor));
+ mpOutputDevice->SetLineColor();
+
+ basegfx::B2DPolyPolygon aLocalPolyPolygon(pPoPoColor->getB2DPolyPolygon());
+ aLocalPolyPolygon.transform(maCurrentTransformation);
+
+ mpOutputDevice->DrawTransparent(aLocalPolyPolygon, rUniTransparenceCandidate.getTransparence());
+ bDrawTransparentUsed = true;
+ }
+ }
+
+ if(!bDrawTransparentUsed)
+ {
+ // unified sub-transparence. Draw to VDev first.
+ RenderUnifiedTransparencePrimitive2D(rUniTransparenceCandidate);
+ }
+ }
}
break;
}
- case PRIMITIVE2D_ID_ALPHAPRIMITIVE2D :
+ case PRIMITIVE2D_ID_TRANSPARENCEPRIMITIVE2D :
{
// sub-transparence group. Draw to VDev first.
- RenderAlphaPrimitive2D(static_cast< const primitive2d::AlphaPrimitive2D& >(rCandidate));
+ RenderTransparencePrimitive2D(static_cast< const primitive2d::TransparencePrimitive2D& >(rCandidate));
break;
}
case PRIMITIVE2D_ID_TRANSFORMPRIMITIVE2D :
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index 2f1bdc364f..71bb587339 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -40,7 +40,6 @@
#include <vclhelperbitmaprender.hxx>
#include <drawinglayer/attribute/sdrfillbitmapattribute.hxx>
#include <drawinglayer/primitive2d/fillbitmapprimitive2d.hxx>
-#include <drawinglayer/attribute/fillattribute.hxx>
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
#include <vclhelpergradient.hxx>
#include <drawinglayer/primitive2d/metafileprimitive2d.hxx>
@@ -48,8 +47,8 @@
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <vclhelperbufferdevice.hxx>
#include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx>
-#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
-#include <drawinglayer/primitive2d/alphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
+#include <drawinglayer/primitive2d/transparenceprimitive2d.hxx>
#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
#include <drawinglayer/primitive2d/markerarrayprimitive2d.hxx>
#include <drawinglayer/primitive2d/pointarrayprimitive2d.hxx>
@@ -75,6 +74,7 @@
// for test, can be removed again
#include <basegfx/polygon/b2dpolygonclipper.hxx>
+#include <basegfx/polygon/b2dtrapezoid.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -294,17 +294,69 @@ namespace drawinglayer
basegfx::B2DPolygon aLocalPolygon(rPolygonCandidate.getB2DPolygon());
aLocalPolygon.transform(maCurrentTransformation);
- if(bPixelBased && getOptionsDrawinglayer().IsAntiAliasing() && getOptionsDrawinglayer().IsSnapHorVerLinesToDiscrete())
+ static bool bCheckTrapezoidDecomposition(false);
+ static bool bShowOutlinesThere(false);
+ if(bCheckTrapezoidDecomposition)
{
- // #i98289#
- // when a Hairline is painted and AntiAliasing is on the option SnapHorVerLinesToDiscrete
- // allows to suppress AntiAliasing for pure horizontal or vertical lines. This is done since
- // not-AntiAliased such lines look more pleasing to the eye (e.g. 2D chart content). This
- // NEEDS to be done in discrete coordinates, so only useful for pixel based rendering.
- aLocalPolygon = basegfx::tools::snapPointsOfHorizontalOrVerticalEdges(aLocalPolygon);
+ // clip against discrete ViewPort
+ const basegfx::B2DRange& rDiscreteViewport = getViewInformation2D().getDiscreteViewport();
+ basegfx::B2DPolyPolygon aLocalPolyPolygon(basegfx::tools::clipPolygonOnRange(
+ aLocalPolygon, rDiscreteViewport, true, false));
+
+ if(aLocalPolyPolygon.count())
+ {
+ // subdivide
+ aLocalPolyPolygon = basegfx::tools::adaptiveSubdivideByDistance(
+ aLocalPolyPolygon, 0.5);
+
+ // trapezoidize
+ static double fLineWidth(2.0);
+ basegfx::B2DTrapezoidVector aB2DTrapezoidVector;
+ basegfx::tools::createLineTrapezoidFromB2DPolyPolygon(aB2DTrapezoidVector, aLocalPolyPolygon, fLineWidth);
+
+ const sal_uInt32 nCount(aB2DTrapezoidVector.size());
+
+ if(nCount)
+ {
+ basegfx::BColor aInvPolygonColor(aHairlineColor);
+ aInvPolygonColor.invert();
+
+ for(sal_uInt32 a(0); a < nCount; a++)
+ {
+ const basegfx::B2DPolygon aTempPolygon(aB2DTrapezoidVector[a].getB2DPolygon());
+
+ if(bShowOutlinesThere)
+ {
+ mpOutputDevice->SetFillColor(Color(aHairlineColor));
+ mpOutputDevice->SetLineColor();
+ }
+
+ mpOutputDevice->DrawPolygon(aTempPolygon);
+
+ if(bShowOutlinesThere)
+ {
+ mpOutputDevice->SetFillColor();
+ mpOutputDevice->SetLineColor(Color(aInvPolygonColor));
+ mpOutputDevice->DrawPolyLine(aTempPolygon, 0.0);
+ }
+ }
+ }
+ }
}
+ else
+ {
+ if(bPixelBased && getOptionsDrawinglayer().IsAntiAliasing() && getOptionsDrawinglayer().IsSnapHorVerLinesToDiscrete())
+ {
+ // #i98289#
+ // when a Hairline is painted and AntiAliasing is on the option SnapHorVerLinesToDiscrete
+ // allows to suppress AntiAliasing for pure horizontal or vertical lines. This is done since
+ // not-AntiAliased such lines look more pleasing to the eye (e.g. 2D chart content). This
+ // NEEDS to be done in discrete coordinates, so only useful for pixel based rendering.
+ aLocalPolygon = basegfx::tools::snapPointsOfHorizontalOrVerticalEdges(aLocalPolygon);
+ }
- mpOutputDevice->DrawPolyLine(aLocalPolygon, 0.0);
+ mpOutputDevice->DrawPolyLine(aLocalPolygon, 0.0);
+ }
}
// direct draw of transformed BitmapEx primitive
@@ -323,7 +375,7 @@ namespace drawinglayer
{
// color gets completely replaced, get it
const basegfx::BColor aModifiedColor(maBColorModifierStack.getModifiedColor(basegfx::BColor()));
- basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ basegfx::B2DPolygon aPolygon(basegfx::tools::createUnitPolygon());
aPolygon.transform(aLocalTransform);
mpOutputDevice->SetFillColor(Color(aModifiedColor));
@@ -397,7 +449,7 @@ namespace drawinglayer
{
// color gets completely replaced, get it
const basegfx::BColor aModifiedColor(maBColorModifierStack.getModifiedColor(basegfx::BColor()));
- basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ basegfx::B2DPolygon aPolygon(basegfx::tools::createUnitPolygon());
aPolygon.transform(aLocalTransform);
mpOutputDevice->SetFillColor(Color(aModifiedColor));
@@ -529,7 +581,7 @@ namespace drawinglayer
impDrawGradientToOutDev(
*mpOutputDevice, aLocalPolyPolygon, rGradient.getStyle(), rGradient.getSteps(),
aStartColor, aEndColor, rGradient.getBorder(),
- -rGradient.getAngle(), rGradient.getOffsetX(), rGradient.getOffsetY(), false);
+ rGradient.getAngle(), rGradient.getOffsetX(), rGradient.getOffsetY(), false);
}
}
}
@@ -553,7 +605,7 @@ namespace drawinglayer
else
{
// try to catch cases where the bitmap will be color-modified to a single
- // color (e.g. shadow). This would NOT be optimizable with an alpha channel
+ // color (e.g. shadow). This would NOT be optimizable with an transparence channel
// at the Bitmap which we do not have here. When this should change, this
// optimization has to be reworked accordingly.
const sal_uInt32 nBColorModifierStackCount(maBColorModifierStack.count());
@@ -635,53 +687,72 @@ namespace drawinglayer
basegfx::B2DPolyPolygon aLocalPolyPolygon(rPolygonCandidate.getB2DPolyPolygon());
aLocalPolyPolygon.transform(maCurrentTransformation);
- mpOutputDevice->DrawPolyPolygon(aLocalPolyPolygon);
- if(mnPolygonStrokePrimitive2D
- && getOptionsDrawinglayer().IsAntiAliasing()
- && (mpOutputDevice->GetAntialiasing() & ANTIALIASING_ENABLE_B2DDRAW))
+ static bool bCheckTrapezoidDecomposition(false);
+ static bool bShowOutlinesThere(false);
+ if(bCheckTrapezoidDecomposition)
{
- // when AA is on and this filled polygons are the result of stroked line geometry,
- // draw the geometry once extra as lines to avoid AA 'gaps' between partial polygons
- mpOutputDevice->SetFillColor();
- mpOutputDevice->SetLineColor(Color(aPolygonColor));
- const sal_uInt32 nCount(aLocalPolyPolygon.count());
-
- for(sal_uInt32 a(0); a < nCount; a++)
+ // clip against discrete ViewPort
+ const basegfx::B2DRange& rDiscreteViewport = getViewInformation2D().getDiscreteViewport();
+ aLocalPolyPolygon = basegfx::tools::clipPolyPolygonOnRange(
+ aLocalPolyPolygon, rDiscreteViewport, true, false);
+
+ if(aLocalPolyPolygon.count())
{
- mpOutputDevice->DrawPolyLine(aLocalPolyPolygon.getB2DPolygon(a), 0.0);
- }
- }
+ // subdivide
+ aLocalPolyPolygon = basegfx::tools::adaptiveSubdivideByDistance(
+ aLocalPolyPolygon, 0.5);
- static bool bTestPolygonClipping(false);
- if(bTestPolygonClipping)
- {
- static bool bInside(true);
- static bool bFilled(false);
- static bool bLine(false);
+ // trapezoidize
+ basegfx::B2DTrapezoidVector aB2DTrapezoidVector;
+ basegfx::tools::trapezoidSubdivide(aB2DTrapezoidVector, aLocalPolyPolygon);
- basegfx::B2DRange aRange(aLocalPolyPolygon.getB2DRange());
- aRange.grow(aRange.getWidth() * -0.1);
+ const sal_uInt32 nCount(aB2DTrapezoidVector.size());
- if(bFilled)
- {
- basegfx::B2DPolyPolygon aFilledClipped(basegfx::tools::clipPolyPolygonOnRange(aLocalPolyPolygon, aRange, bInside, false));
- basegfx::BColor aRand(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0);
- mpOutputDevice->SetFillColor(Color(aRand));
- mpOutputDevice->SetLineColor();
- mpOutputDevice->DrawPolyPolygon(aFilledClipped);
+ if(nCount)
+ {
+ basegfx::BColor aInvPolygonColor(aPolygonColor);
+ aInvPolygonColor.invert();
+
+ for(sal_uInt32 a(0); a < nCount; a++)
+ {
+ const basegfx::B2DPolygon aTempPolygon(aB2DTrapezoidVector[a].getB2DPolygon());
+
+ if(bShowOutlinesThere)
+ {
+ mpOutputDevice->SetFillColor(Color(aPolygonColor));
+ mpOutputDevice->SetLineColor();
+ }
+
+ mpOutputDevice->DrawPolygon(aTempPolygon);
+
+ if(bShowOutlinesThere)
+ {
+ mpOutputDevice->SetFillColor();
+ mpOutputDevice->SetLineColor(Color(aInvPolygonColor));
+ mpOutputDevice->DrawPolyLine(aTempPolygon, 0.0);
+ }
+ }
+ }
}
+ }
+ else
+ {
+ mpOutputDevice->DrawPolyPolygon(aLocalPolyPolygon);
- if(bLine)
+ if(mnPolygonStrokePrimitive2D
+ && getOptionsDrawinglayer().IsAntiAliasing()
+ && (mpOutputDevice->GetAntialiasing() & ANTIALIASING_ENABLE_B2DDRAW))
{
- basegfx::B2DPolyPolygon aLineClipped(basegfx::tools::clipPolyPolygonOnRange(aLocalPolyPolygon, aRange, bInside, true));
- basegfx::BColor aRand(rand() / 32767.0, rand() / 32767.0, rand() / 32767.0);
+ // when AA is on and this filled polygons are the result of stroked line geometry,
+ // draw the geometry once extra as lines to avoid AA 'gaps' between partial polygons
mpOutputDevice->SetFillColor();
- mpOutputDevice->SetLineColor(Color(aRand));
+ mpOutputDevice->SetLineColor(Color(aPolygonColor));
+ const sal_uInt32 nCount(aLocalPolyPolygon.count());
- for(sal_uInt32 a(0); a < aLineClipped.count(); a++)
+ for(sal_uInt32 a(0); a < nCount; a++)
{
- mpOutputDevice->DrawPolyLine(aLineClipped.getB2DPolygon(a), 0.0);
+ mpOutputDevice->DrawPolyLine(aLocalPolyPolygon.getB2DPolygon(a), 0.0);
}
}
}
@@ -807,10 +878,10 @@ namespace drawinglayer
if(getOptionsDrawinglayer().IsAntiAliasing())
{
// with AA, use 8bit AlphaMask to get nice borders
- VirtualDevice& rAlpha = aBufferDevice.getAlpha();
- rAlpha.SetLineColor();
- rAlpha.SetFillColor(COL_BLACK);
- rAlpha.DrawPolyPolygon(aMask);
+ VirtualDevice& rTransparence = aBufferDevice.getTransparence();
+ rTransparence.SetLineColor();
+ rTransparence.SetFillColor(COL_BLACK);
+ rTransparence.DrawPolyPolygon(aMask);
// dump buffer to outdev
aBufferDevice.paint();
@@ -843,7 +914,7 @@ namespace drawinglayer
}
// unified sub-transparence. Draw to VDev first.
- void VclProcessor2D::RenderUnifiedAlphaPrimitive2D(const primitive2d::UnifiedAlphaPrimitive2D& rTransCandidate)
+ void VclProcessor2D::RenderUnifiedTransparencePrimitive2D(const primitive2d::UnifiedTransparencePrimitive2D& rTransCandidate)
{
static bool bForceToDecomposition(false);
@@ -856,14 +927,14 @@ namespace drawinglayer
}
else
{
- if(0.0 == rTransCandidate.getAlpha())
+ if(0.0 == rTransCandidate.getTransparence())
{
// no transparence used, so just use the content
process(rTransCandidate.getChildren());
}
- else if(rTransCandidate.getAlpha() > 0.0 && rTransCandidate.getAlpha() < 1.0)
+ else if(rTransCandidate.getTransparence() > 0.0 && rTransCandidate.getTransparence() < 1.0)
{
- // alpha is in visible range
+ // transparence is in visible range
basegfx::B2DRange aRange(primitive2d::getB2DRangeFromPrimitive2DSequence(rTransCandidate.getChildren(), getViewInformation2D()));
aRange.transform(maCurrentTransformation);
impBufferDevice aBufferDevice(*mpOutputDevice, aRange, true);
@@ -880,8 +951,8 @@ namespace drawinglayer
// back to old OutDev
mpOutputDevice = pLastOutputDevice;
- // dump buffer to outdev using given alpha
- aBufferDevice.paint(rTransCandidate.getAlpha());
+ // dump buffer to outdev using given transparence
+ aBufferDevice.paint(rTransCandidate.getTransparence());
}
}
}
@@ -889,7 +960,7 @@ namespace drawinglayer
}
// sub-transparence group. Draw to VDev first.
- void VclProcessor2D::RenderAlphaPrimitive2D(const primitive2d::AlphaPrimitive2D& rTransCandidate)
+ void VclProcessor2D::RenderTransparencePrimitive2D(const primitive2d::TransparencePrimitive2D& rTransCandidate)
{
if(rTransCandidate.getChildren().hasElements())
{
@@ -907,14 +978,14 @@ namespace drawinglayer
process(rTransCandidate.getChildren());
// set to mask
- mpOutputDevice = &aBufferDevice.getAlpha();
+ mpOutputDevice = &aBufferDevice.getTransparence();
- // when painting alpha masks, reset the color stack
+ // when painting transparence masks, reset the color stack
basegfx::BColorModifierStack aLastBColorModifierStack(maBColorModifierStack);
maBColorModifierStack = basegfx::BColorModifierStack();
- // paint mask to it (always with alpha intensities, evtl. with AA)
- process(rTransCandidate.getAlpha());
+ // paint mask to it (always with transparence intensities, evtl. with AA)
+ process(rTransCandidate.getTransparence());
// back to old color stack
maBColorModifierStack = aLastBColorModifierStack;
diff --git a/drawinglayer/source/processor3d/cutfindprocessor3d.cxx b/drawinglayer/source/processor3d/cutfindprocessor3d.cxx
index 79a0a31f4f..97e514f5ee 100644
--- a/drawinglayer/source/processor3d/cutfindprocessor3d.cxx
+++ b/drawinglayer/source/processor3d/cutfindprocessor3d.cxx
@@ -32,11 +32,11 @@
#include <drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx>
#include <drawinglayer/primitive3d/transformprimitive3d.hxx>
#include <drawinglayer/primitive3d/hatchtextureprimitive3d.hxx>
-#include <drawinglayer/primitive3d/hittestprimitive3d.hxx>
#include <drawinglayer/primitive3d/polypolygonprimitive3d.hxx>
#include <basegfx/polygon/b3dpolygon.hxx>
#include <basegfx/polygon/b3dpolygontools.hxx>
#include <basegfx/polygon/b3dpolypolygontools.hxx>
+#include <drawinglayer/primitive3d/hiddengeometryprimitive3d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -53,7 +53,8 @@ namespace drawinglayer
maBack(rBack),
maResult(),
maCombinedTransform(),
- mbAnyHit(bAnyHit)
+ mbAnyHit(bAnyHit),
+ mbUseInvisiblePrimitiveContent(true)
{
}
@@ -124,13 +125,46 @@ namespace drawinglayer
process(rPrimitive.getChildren());
break;
}
- case PRIMITIVE3D_ID_HITTESTPRIMITIVE3D :
+ case PRIMITIVE3D_ID_HIDDENGEOMETRYPRIMITIVE3D :
{
- // HitTestPrimitive3D, force usage due to we are doing a hit test and this
- // primitive only gets generated on 3d objects without fill, exactly for this
- // purpose
- const primitive3d::HitTestPrimitive3D& rPrimitive = static_cast< const primitive3d::HitTestPrimitive3D& >(rCandidate);
- process(rPrimitive.getChildren());
+ // HiddenGeometryPrimitive3D; the default decomposition would return an empty seqence,
+ // so force this primitive to process it's children directly if the switch is set
+ // (which is the default). Else, ignore invisible content
+ const primitive3d::HiddenGeometryPrimitive3D& rHiddenGeometry(static_cast< const primitive3d::HiddenGeometryPrimitive3D& >(rCandidate));
+ const primitive3d::Primitive3DSequence& rChildren = rHiddenGeometry.getChildren();
+
+ if(rChildren.hasElements())
+ {
+ if(getUseInvisiblePrimitiveContent())
+ {
+ process(rChildren);
+ }
+ }
+
+ break;
+ }
+ case PRIMITIVE3D_ID_UNIFIEDTRANSPARENCETEXTUREPRIMITIVE3D :
+ {
+ const primitive3d::UnifiedTransparenceTexturePrimitive3D& rPrimitive = static_cast< const primitive3d::UnifiedTransparenceTexturePrimitive3D& >(rCandidate);
+ const primitive3d::Primitive3DSequence rChildren = rPrimitive.getChildren();
+
+ if(rChildren.getLength())
+ {
+ if(1.0 <= rPrimitive.getTransparence())
+ {
+ // not visible, but use for HitTest
+ if(getUseInvisiblePrimitiveContent())
+ {
+ process(rChildren);
+ }
+ }
+ else if(rPrimitive.getTransparence() >= 0.0 && rPrimitive.getTransparence() < 1.0)
+ {
+ // visible; use content
+ process(rChildren);
+ }
+ }
+
break;
}
case PRIMITIVE3D_ID_POLYPOLYGONMATERIALPRIMITIVE3D :
diff --git a/drawinglayer/source/processor3d/defaultprocessor3d.cxx b/drawinglayer/source/processor3d/defaultprocessor3d.cxx
index b76c1b061c..8f2f7c17b9 100644
--- a/drawinglayer/source/processor3d/defaultprocessor3d.cxx
+++ b/drawinglayer/source/processor3d/defaultprocessor3d.cxx
@@ -40,9 +40,11 @@
#include <drawinglayer/primitive3d/polypolygonprimitive3d.hxx>
#include <basegfx/polygon/b3dpolypolygontools.hxx>
#include <com/sun/star/drawing/ShadeMode.hpp>
-#include <drawinglayer/attribute/sdrattribute3d.hxx>
#include <drawinglayer/primitive3d/transformprimitive3d.hxx>
#include <drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx>
+#include <vcl/bitmapex.hxx>
+#include <drawinglayer/attribute/sdrsceneattribute3d.hxx>
+#include <drawinglayer/attribute/sdrlightingattribute3d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -63,8 +65,8 @@ namespace drawinglayer
// rescue values
const bool bOldModulate(getModulate()); mbModulate = rPrimitive.getModulate();
const bool bOldFilter(getFilter()); mbFilter = rPrimitive.getFilter();
- const bool bOldSimpleTextureActive(mbSimpleTextureActive);
- texture::GeoTexSvx* pOldTex = (bTransparence) ? mpTransparenceGeoTexSvx : mpGeoTexSvx;
+ const bool bOldSimpleTextureActive(getSimpleTextureActive());
+ boost::shared_ptr< texture::GeoTexSvx > pOldTex = (bTransparence) ? mpTransparenceGeoTexSvx : mpGeoTexSvx;
// create texture
const attribute::FillGradientAttribute& rFillGradient = rPrimitive.getGradient();
@@ -74,7 +76,7 @@ namespace drawinglayer
const basegfx::BColor aStart(rFillGradient.getStartColor());
const basegfx::BColor aEnd(rFillGradient.getEndColor());
const sal_uInt32 nMaxSteps(sal_uInt32((aStart.getMaximumDistance(aEnd) * 127.5) + 0.5));
- texture::GeoTexSvx* pNewTex = 0L;
+ boost::shared_ptr< texture::GeoTexSvx > pNewTex;
if(nMaxSteps)
{
@@ -98,32 +100,32 @@ namespace drawinglayer
{
case attribute::GRADIENTSTYLE_LINEAR:
{
- pNewTex = new texture::GeoTexSvxGradientLinear(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), -rFillGradient.getAngle());
+ pNewTex.reset(new texture::GeoTexSvxGradientLinear(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getAngle()));
break;
}
case attribute::GRADIENTSTYLE_AXIAL:
{
- pNewTex = new texture::GeoTexSvxGradientAxial(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), -rFillGradient.getAngle());
+ pNewTex.reset(new texture::GeoTexSvxGradientAxial(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getAngle()));
break;
}
case attribute::GRADIENTSTYLE_RADIAL:
{
- pNewTex = new texture::GeoTexSvxGradientRadial(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY());
+ pNewTex.reset(new texture::GeoTexSvxGradientRadial(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY()));
break;
}
case attribute::GRADIENTSTYLE_ELLIPTICAL:
{
- pNewTex = new texture::GeoTexSvxGradientElliptical(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), -rFillGradient.getAngle());
+ pNewTex.reset(new texture::GeoTexSvxGradientElliptical(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), rFillGradient.getAngle()));
break;
}
case attribute::GRADIENTSTYLE_SQUARE:
{
- pNewTex = new texture::GeoTexSvxGradientSquare(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), -rFillGradient.getAngle());
+ pNewTex.reset(new texture::GeoTexSvxGradientSquare(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), rFillGradient.getAngle()));
break;
}
case attribute::GRADIENTSTYLE_RECT:
{
- pNewTex = new texture::GeoTexSvxGradientRect(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), -rFillGradient.getAngle());
+ pNewTex.reset(new texture::GeoTexSvxGradientRect(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), rFillGradient.getAngle()));
break;
}
}
@@ -133,7 +135,7 @@ namespace drawinglayer
else
{
// no color distance -> same color, use simple texture
- pNewTex = new texture::GeoTexSvxMono(aStart, 1.0 - aStart.luminance());
+ pNewTex.reset(new texture::GeoTexSvxMono(aStart, 1.0 - aStart.luminance()));
mbSimpleTextureActive = true;
}
@@ -150,9 +152,6 @@ namespace drawinglayer
// process sub-list
process(rSubSequence);
- // delete texture
- delete pNewTex;
-
// restore values
mbModulate = bOldModulate;
mbFilter = bOldFilter;
@@ -178,7 +177,7 @@ namespace drawinglayer
// rescue values
const bool bOldModulate(getModulate()); mbModulate = rPrimitive.getModulate();
const bool bOldFilter(getFilter()); mbFilter = rPrimitive.getFilter();
- texture::GeoTexSvx* pOldTex = mpGeoTexSvx;
+ boost::shared_ptr< texture::GeoTexSvx > pOldTex = mpGeoTexSvx;
// calculate logic pixel size in object coordinates. Create transformation view
// to object by inverting ObjectToView
@@ -198,15 +197,11 @@ namespace drawinglayer
const double fLogicTexSize(fLogicTexSizeX > fLogicTexSizeY ? fLogicTexSizeX : fLogicTexSizeY);
// create texture and set
- texture::GeoTexSvxMultiHatch* pNewTex = new texture::GeoTexSvxMultiHatch(rPrimitive, fLogicTexSize);
- mpGeoTexSvx = pNewTex;
+ mpGeoTexSvx.reset(new texture::GeoTexSvxMultiHatch(rPrimitive, fLogicTexSize));
// process sub-list
process(rSubSequence);
- // delete texture
- delete mpGeoTexSvx;
-
// restore values
mbModulate = bOldModulate;
mbFilter = bOldFilter;
@@ -223,32 +218,29 @@ namespace drawinglayer
// rescue values
const bool bOldModulate(getModulate()); mbModulate = rPrimitive.getModulate();
const bool bOldFilter(getFilter()); mbFilter = rPrimitive.getFilter();
- texture::GeoTexSvx* pOldTex = mpGeoTexSvx;
+ boost::shared_ptr< texture::GeoTexSvx > pOldTex = mpGeoTexSvx;
// create texture
const attribute::FillBitmapAttribute& rFillBitmapAttribute = rPrimitive.getFillBitmapAttribute();
if(rFillBitmapAttribute.getTiling())
{
- mpGeoTexSvx = new texture::GeoTexSvxBitmapTiled(
+ mpGeoTexSvx.reset(new texture::GeoTexSvxBitmapTiled(
rFillBitmapAttribute.getBitmapEx().GetBitmap(),
rFillBitmapAttribute.getTopLeft() * rPrimitive.getTextureSize(),
- rFillBitmapAttribute.getSize() * rPrimitive.getTextureSize());
+ rFillBitmapAttribute.getSize() * rPrimitive.getTextureSize()));
}
else
{
- mpGeoTexSvx = new texture::GeoTexSvxBitmap(
+ mpGeoTexSvx.reset(new texture::GeoTexSvxBitmap(
rFillBitmapAttribute.getBitmapEx().GetBitmap(),
rFillBitmapAttribute.getTopLeft() * rPrimitive.getTextureSize(),
- rFillBitmapAttribute.getSize() * rPrimitive.getTextureSize());
+ rFillBitmapAttribute.getSize() * rPrimitive.getTextureSize()));
}
// process sub-list
process(rSubSequence);
- // delete texture
- delete mpGeoTexSvx;
-
// restore values
mbModulate = bOldModulate;
mbFilter = bOldFilter;
@@ -312,7 +304,7 @@ namespace drawinglayer
if(bPaintIt)
{
// get rid of texture coordinates if there is no texture
- if(aFill.areTextureCoordinatesUsed() && !getGeoTexSvx() && !getTransparenceGeoTexSvx())
+ if(aFill.areTextureCoordinatesUsed() && !getGeoTexSvx().get() && !getTransparenceGeoTexSvx().get())
{
aFill.clearTextureCoordinates();
}
@@ -495,11 +487,13 @@ namespace drawinglayer
impRenderBitmapTexturePrimitive3D(rPrimitive);
break;
}
- case PRIMITIVE3D_ID_ALPHATEXTUREPRIMITIVE3D :
+ case PRIMITIVE3D_ID_TRANSPARENCETEXTUREPRIMITIVE3D :
{
- // AlphaTexturePrimitive3D
- const primitive3d::AlphaTexturePrimitive3D& rPrimitive = static_cast< const primitive3d::AlphaTexturePrimitive3D& >(rBasePrimitive);
+ // TransparenceTexturePrimitive3D
+ const primitive3d::TransparenceTexturePrimitive3D& rPrimitive = static_cast< const primitive3d::TransparenceTexturePrimitive3D& >(rBasePrimitive);
+ mnTransparenceCounter++;
impRenderGradientTexturePrimitive3D(rPrimitive, true);
+ mnTransparenceCounter--;
break;
}
case PRIMITIVE3D_ID_MODIFIEDCOLORPRIMITIVE3D :
@@ -548,8 +542,10 @@ namespace drawinglayer
mrSdrLightingAttribute(rSdrLightingAttribute),
maRasterRange(),
maBColorModifierStack(),
- mpGeoTexSvx(0),
- mpTransparenceGeoTexSvx(0),
+ mpGeoTexSvx(),
+ mpTransparenceGeoTexSvx(),
+ maDrawinglayerOpt(),
+ mnTransparenceCounter(0),
mbModulate(false),
mbFilter(false),
mbSimpleTextureActive(false)
diff --git a/drawinglayer/source/processor3d/geometry2dextractor.cxx b/drawinglayer/source/processor3d/geometry2dextractor.cxx
index 27eb47eb5f..1950e1ce6d 100644
--- a/drawinglayer/source/processor3d/geometry2dextractor.cxx
+++ b/drawinglayer/source/processor3d/geometry2dextractor.cxx
@@ -127,8 +127,8 @@ namespace drawinglayer
case PRIMITIVE3D_ID_GRADIENTTEXTUREPRIMITIVE3D :
case PRIMITIVE3D_ID_HATCHTEXTUREPRIMITIVE3D :
case PRIMITIVE3D_ID_BITMAPTEXTUREPRIMITIVE3D :
- case PRIMITIVE3D_ID_ALPHATEXTUREPRIMITIVE3D :
- case PRIMITIVE3D_ID_UNIFIEDALPHATEXTUREPRIMITIVE3D :
+ case PRIMITIVE3D_ID_TRANSPARENCETEXTUREPRIMITIVE3D :
+ case PRIMITIVE3D_ID_UNIFIEDTRANSPARENCETEXTUREPRIMITIVE3D :
{
// TexturePrimitive3D: Process children, do not try to decompose
const primitive3d::TexturePrimitive3D& rTexturePrimitive = static_cast< const primitive3d::TexturePrimitive3D& >(rCandidate);
diff --git a/drawinglayer/source/processor3d/shadow3dextractor.cxx b/drawinglayer/source/processor3d/shadow3dextractor.cxx
index 28400678f1..83b2d8e8ac 100644
--- a/drawinglayer/source/processor3d/shadow3dextractor.cxx
+++ b/drawinglayer/source/processor3d/shadow3dextractor.cxx
@@ -31,7 +31,7 @@
#include <drawinglayer/processor3d/shadow3dextractor.hxx>
#include <drawinglayer/primitive3d/shadowprimitive3d.hxx>
#include <drawinglayer/primitive2d/shadowprimitive2d.hxx>
-#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
#include <drawinglayer/primitive3d/transformprimitive3d.hxx>
#include <drawinglayer/primitive3d/polygonprimitive3d.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
@@ -91,7 +91,7 @@ namespace drawinglayer
{
// create simpleTransparencePrimitive, add created primitives
const primitive2d::Primitive2DSequence aNewTransPrimitiveVector(&xRef, 1L);
- const primitive2d::Primitive2DReference xRef2(new primitive2d::UnifiedAlphaPrimitive2D(aNewTransPrimitiveVector, rPrimitive.getShadowTransparence()));
+ const primitive2d::Primitive2DReference xRef2(new primitive2d::UnifiedTransparencePrimitive2D(aNewTransPrimitiveVector, rPrimitive.getShadowTransparence()));
primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(*mpPrimitive2DSequence, xRef2);
}
else
diff --git a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
index 7922e16c69..679e918bda 100644
--- a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
+++ b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
@@ -35,13 +35,14 @@
#include <basegfx/raster/bzpixelraster.hxx>
#include <drawinglayer/attribute/materialattribute3d.hxx>
#include <drawinglayer/texture/texture.hxx>
-#include <drawinglayer/attribute/sdrattribute3d.hxx>
#include <drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx>
#include <drawinglayer/primitive3d/textureprimitive3d.hxx>
#include <drawinglayer/primitive3d/polygonprimitive3d.hxx>
#include <drawinglayer/primitive3d/polypolygonprimitive3d.hxx>
#include <drawinglayer/geometry/viewinformation2d.hxx>
#include <basegfx/polygon/b3dpolygontools.hxx>
+#include <basegfx/polygon/b3dpolypolygontools.hxx>
+#include <drawinglayer/attribute/sdrlightingattribute3d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -225,14 +226,14 @@ private:
basegfx::B2DPoint aTexCoor(0.0, 0.0);
getTextureCoor(aTexCoor);
- if(mrProcessor.getGeoTexSvx())
+ if(mrProcessor.getGeoTexSvx().get())
{
// calc color in spot. This may also set to invisible already when
// e.g. bitmap textures have transparent parts
mrProcessor.getGeoTexSvx()->modifyBColor(aTexCoor, rColor, fOpacity);
}
- if(basegfx::fTools::more(fOpacity, 0.0) && mrProcessor.getTransparenceGeoTexSvx())
+ if(basegfx::fTools::more(fOpacity, 0.0) && mrProcessor.getTransparenceGeoTexSvx().get())
{
// calc opacity. Object has a 2nd texture, a transparence texture
mrProcessor.getTransparenceGeoTexSvx()->modifyOpacity(aTexCoor, fOpacity);
@@ -241,7 +242,7 @@ private:
if(basegfx::fTools::more(fOpacity, 0.0))
{
- if(mrProcessor.getGeoTexSvx())
+ if(mrProcessor.getGeoTexSvx().get())
{
if(mbUseNrm)
{
@@ -309,9 +310,9 @@ private:
mbModifyColor = mrProcessor.getBColorModifierStack().count();
mbHasTexCoor = SCANLINE_EMPTY_INDEX != rA.getTextureIndex() && SCANLINE_EMPTY_INDEX != rB.getTextureIndex();
mbHasInvTexCoor = SCANLINE_EMPTY_INDEX != rA.getInverseTextureIndex() && SCANLINE_EMPTY_INDEX != rB.getInverseTextureIndex();
- const bool bTextureActive(mrProcessor.getGeoTexSvx() || mrProcessor.getTransparenceGeoTexSvx());
+ const bool bTextureActive(mrProcessor.getGeoTexSvx().get() || mrProcessor.getTransparenceGeoTexSvx().get());
mbUseTex = bTextureActive && (mbHasTexCoor || mbHasInvTexCoor || mrProcessor.getSimpleTextureActive());
- const bool bUseColorTex(mbUseTex && mrProcessor.getGeoTexSvx());
+ const bool bUseColorTex(mbUseTex && mrProcessor.getGeoTexSvx().get());
const bool bNeedNrmOrCol(!bUseColorTex || (bUseColorTex && mrProcessor.getModulate()));
mbUseNrm = bNeedNrmOrCol && SCANLINE_EMPTY_INDEX != rA.getNormalIndex() && SCANLINE_EMPTY_INDEX != rB.getNormalIndex();
mbUseCol = !mbUseNrm && bNeedNrmOrCol && SCANLINE_EMPTY_INDEX != rA.getColorIndex() && SCANLINE_EMPTY_INDEX != rB.getColorIndex();
@@ -426,7 +427,7 @@ void ZBufferRasterConverter3D::processLineSpan(const basegfx::RasterConversionLi
if(nOpacity >= 0x00ff)
{
- // full opacity, set z and color
+ // full opacity (not transparent), set z and color
rOldZ = nNewZ;
mrBuffer.getBPixel(nScanlineIndex) = basegfx::BPixel(aNewColor, 0xff);
}
@@ -436,23 +437,23 @@ void ZBufferRasterConverter3D::processLineSpan(const basegfx::RasterConversionLi
if(rDest.getOpacity())
{
- // both transparent, mix color based on front pixel's opacity
- // (the new one)
+ // mix new color by using
+ // color' = color * (1 - opacity) + newcolor * opacity
const sal_uInt16 nTransparence(0x0100 - nOpacity);
rDest.setRed((sal_uInt8)(((rDest.getRed() * nTransparence) + ((sal_uInt16)(255.0 * aNewColor.getRed()) * nOpacity)) >> 8));
rDest.setGreen((sal_uInt8)(((rDest.getGreen() * nTransparence) + ((sal_uInt16)(255.0 * aNewColor.getGreen()) * nOpacity)) >> 8));
rDest.setBlue((sal_uInt8)(((rDest.getBlue() * nTransparence) + ((sal_uInt16)(255.0 * aNewColor.getBlue()) * nOpacity)) >> 8));
-
+
if(0xff != rDest.getOpacity())
{
- // destination is also transparent, mix opacities by weighting
- // old opacity with new pixel's transparence and adding new opacity
- rDest.setOpacity((sal_uInt8)(((rDest.getOpacity() * nTransparence) >> 8) + nOpacity));
+ // both are transparent, mix new opacity by using
+ // opacity = newopacity * (1 - oldopacity) + oldopacity
+ rDest.setOpacity(((sal_uInt8)((nOpacity * (0x0100 - rDest.getOpacity())) >> 8)) + rDest.getOpacity());
}
}
else
{
- // dest is not visible. Set color.
+ // dest is unused, set color
rDest = basegfx::BPixel(aNewColor, (sal_uInt8)nOpacity);
}
}
@@ -470,134 +471,161 @@ void ZBufferRasterConverter3D::processLineSpan(const basegfx::RasterConversionLi
}
//////////////////////////////////////////////////////////////////////////////
+// helper class to buffer output for transparent rasterprimitives (filled areas
+// and lines) until the end of processing. To ensure correct transparent
+// visualisation, ZBuffers require to not set Z and to mix with the transparent
+// color. If transparent rasterprimitives overlap, it gets necessary to
+// paint transparent rasterprimitives from back to front to ensure that the
+// mixing happens from back to front. For that purpose, transparent
+// rasterprimitives are held in this class during the processing run, remember
+// all data and will be rendered
+
+class RasterPrimitive3D
+{
+private:
+ boost::shared_ptr< drawinglayer::texture::GeoTexSvx > mpGeoTexSvx;
+ boost::shared_ptr< drawinglayer::texture::GeoTexSvx > mpTransparenceGeoTexSvx;
+ drawinglayer::attribute::MaterialAttribute3D maMaterial;
+ basegfx::B3DPolyPolygon maPolyPolygon;
+ sal_uInt32 mfCenterZ;
+
+ // bitfield
+ bool mbModulate : 1;
+ bool mbFilter : 1;
+ bool mbSimpleTextureActive : 1;
+ bool mbIsLine : 1;
+
+public:
+ RasterPrimitive3D(
+ const boost::shared_ptr< drawinglayer::texture::GeoTexSvx >& pGeoTexSvx,
+ const boost::shared_ptr< drawinglayer::texture::GeoTexSvx >& pTransparenceGeoTexSvx,
+ const drawinglayer::attribute::MaterialAttribute3D& rMaterial,
+ const basegfx::B3DPolyPolygon& rPolyPolygon,
+ bool bModulate,
+ bool bFilter,
+ bool bSimpleTextureActive,
+ bool bIsLine)
+ : mpGeoTexSvx(pGeoTexSvx),
+ mpTransparenceGeoTexSvx(pTransparenceGeoTexSvx),
+ maMaterial(rMaterial),
+ maPolyPolygon(rPolyPolygon),
+ mfCenterZ(basegfx::tools::getRange(rPolyPolygon).getCenter().getZ()),
+ mbModulate(bModulate),
+ mbFilter(bFilter),
+ mbSimpleTextureActive(bSimpleTextureActive),
+ mbIsLine(bIsLine)
+ {
+ }
+
+ RasterPrimitive3D& operator=(const RasterPrimitive3D& rComp)
+ {
+ mpGeoTexSvx = rComp.mpGeoTexSvx;
+ mpTransparenceGeoTexSvx = rComp.mpTransparenceGeoTexSvx;
+ maMaterial = rComp.maMaterial;
+ maPolyPolygon = rComp.maPolyPolygon;
+ mfCenterZ = rComp.mfCenterZ;
+ mbModulate = rComp.mbModulate;
+ mbFilter = rComp.mbFilter;
+ mbSimpleTextureActive = rComp.mbSimpleTextureActive;
+ mbIsLine = rComp.mbIsLine;
+
+ return *this;
+ }
+
+ bool operator<(const RasterPrimitive3D& rComp) const
+ {
+ return mfCenterZ < rComp.mfCenterZ;
+ }
+
+ const boost::shared_ptr< drawinglayer::texture::GeoTexSvx >& getGeoTexSvx() const { return mpGeoTexSvx; }
+ const boost::shared_ptr< drawinglayer::texture::GeoTexSvx >& getTransparenceGeoTexSvx() const { return mpTransparenceGeoTexSvx; }
+ const drawinglayer::attribute::MaterialAttribute3D& getMaterial() const { return maMaterial; }
+ const basegfx::B3DPolyPolygon& getPolyPolygon() const { return maPolyPolygon; }
+ bool getModulate() const { return mbModulate; }
+ bool getFilter() const { return mbFilter; }
+ bool getSimpleTextureActive() const { return mbSimpleTextureActive; }
+ bool getIsLine() const { return mbIsLine; }
+};
+
+//////////////////////////////////////////////////////////////////////////////
namespace drawinglayer
{
namespace processor3d
{
- // the processing method for a single, known primitive
- void ZBufferProcessor3D::processBasePrimitive3D(const primitive3d::BasePrimitive3D& rBasePrimitive)
+ void ZBufferProcessor3D::rasterconvertB3DPolygon(const attribute::MaterialAttribute3D& rMaterial, const basegfx::B3DPolygon& rHairline) const
{
- // it is a BasePrimitive3D implementation, use getPrimitive3DID() call for switch
- switch(rBasePrimitive.getPrimitive3DID())
+ if(mpBZPixelRaster)
{
- case PRIMITIVE3D_ID_ALPHATEXTUREPRIMITIVE3D :
+ if(getTransparenceCounter())
{
- // AlphaTexturePrimitive3D
- const primitive3d::AlphaTexturePrimitive3D& rPrimitive = static_cast< const primitive3d::AlphaTexturePrimitive3D& >(rBasePrimitive);
-
- if(mbProcessTransparent)
+ // transparent output; record for later sorting and painting from
+ // back to front
+ if(!mpRasterPrimitive3Ds)
{
- impRenderGradientTexturePrimitive3D(rPrimitive, true);
+ const_cast< ZBufferProcessor3D* >(this)->mpRasterPrimitive3Ds = new std::vector< RasterPrimitive3D >;
}
- else
- {
- mbContainsTransparent = true;
- }
- break;
- }
- case PRIMITIVE3D_ID_POLYGONHAIRLINEPRIMITIVE3D :
- {
- // directdraw of PolygonHairlinePrimitive3D
- const primitive3d::PolygonHairlinePrimitive3D& rPrimitive = static_cast< const primitive3d::PolygonHairlinePrimitive3D& >(rBasePrimitive);
- // do something when either not transparent and no transMap, or transparent and a TransMap
- if((bool)mbProcessTransparent == (0 != getTransparenceGeoTexSvx()))
- {
- impRenderPolygonHairlinePrimitive3D(rPrimitive);
- }
- break;
+ mpRasterPrimitive3Ds->push_back(RasterPrimitive3D(
+ getGeoTexSvx(),
+ getTransparenceGeoTexSvx(),
+ rMaterial,
+ basegfx::B3DPolyPolygon(rHairline),
+ getModulate(),
+ getFilter(),
+ getSimpleTextureActive(),
+ true));
}
- case PRIMITIVE3D_ID_POLYPOLYGONMATERIALPRIMITIVE3D :
+ else
{
- // directdraw of PolyPolygonMaterialPrimitive3D
- const primitive3d::PolyPolygonMaterialPrimitive3D& rPrimitive = static_cast< const primitive3d::PolyPolygonMaterialPrimitive3D& >(rBasePrimitive);
+ // do rasterconversion
+ mpZBufferRasterConverter3D->setCurrentMaterial(rMaterial);
- // do something when either not transparent and no transMap, or transparent and a TransMap
- if((bool)mbProcessTransparent == (0 != getTransparenceGeoTexSvx()))
+ if(mnAntiAlialize > 1)
{
- impRenderPolyPolygonMaterialPrimitive3D(rPrimitive);
- }
- break;
- }
- default:
- {
- // use the DefaultProcessor3D::processBasePrimitive3D()
- DefaultProcessor3D::processBasePrimitive3D(rBasePrimitive);
- break;
- }
- }
- }
-
- void ZBufferProcessor3D::processNonTransparent(const primitive3d::Primitive3DSequence& rSource)
- {
- if(mpBZPixelRaster)
- {
- mbProcessTransparent = false;
- mbContainsTransparent = false;
- process(rSource);
- }
- }
-
- void ZBufferProcessor3D::processTransparent(const primitive3d::Primitive3DSequence& rSource)
- {
- if(mpBZPixelRaster && mbContainsTransparent)
- {
- mbProcessTransparent = true;
- process(rSource);
- }
- }
+ const bool bForceLineSnap(getOptionsDrawinglayer().IsAntiAliasing() && getOptionsDrawinglayer().IsSnapHorVerLinesToDiscrete());
- void ZBufferProcessor3D::rasterconvertB3DPolygon(const attribute::MaterialAttribute3D& rMaterial, const basegfx::B3DPolygon& rHairline) const
- {
- if(mpBZPixelRaster)
- {
- mpZBufferRasterConverter3D->setCurrentMaterial(rMaterial);
+ if(bForceLineSnap)
+ {
+ basegfx::B3DHomMatrix aTransform;
+ basegfx::B3DPolygon aSnappedHairline(rHairline);
+ const double fScaleDown(1.0 / mnAntiAlialize);
+ const double fScaleUp(mnAntiAlialize);
- if(mnAntiAlialize > 1)
- {
- const bool bForceLineSnap(getOptionsDrawinglayer().IsAntiAliasing() && getOptionsDrawinglayer().IsSnapHorVerLinesToDiscrete());
+ // take oversampling out
+ aTransform.scale(fScaleDown, fScaleDown, 1.0);
+ aSnappedHairline.transform(aTransform);
- if(bForceLineSnap)
- {
- basegfx::B3DHomMatrix aTransform;
- basegfx::B3DPolygon aSnappedHairline(rHairline);
- const double fScaleDown(1.0 / mnAntiAlialize);
- const double fScaleUp(mnAntiAlialize);
+ // snap to integer
+ aSnappedHairline = basegfx::tools::snapPointsOfHorizontalOrVerticalEdges(aSnappedHairline);
- // take oversampling out
- aTransform.scale(fScaleDown, fScaleDown, 1.0);
- aSnappedHairline.transform(aTransform);
+ // add oversampling again
+ aTransform.identity();
+ aTransform.scale(fScaleUp, fScaleUp, 1.0);
- // snap to integer
- aSnappedHairline = basegfx::tools::snapPointsOfHorizontalOrVerticalEdges(aSnappedHairline);
+ if(false)
+ {
+ // when really want to go to single pixel lines, move to center.
+ // Without this translation, all hor/ver hairlines will be centered exactly
+ // between two pixel lines (which looks best)
+ const double fTranslateToCenter(mnAntiAlialize * 0.5);
+ aTransform.translate(fTranslateToCenter, fTranslateToCenter, 0.0);
+ }
- // add oversampling again
- aTransform.identity();
- aTransform.scale(fScaleUp, fScaleUp, 1.0);
+ aSnappedHairline.transform(aTransform);
- if(false)
+ mpZBufferRasterConverter3D->rasterconvertB3DPolygon(aSnappedHairline, 0, mpBZPixelRaster->getHeight(), mnAntiAlialize);
+ }
+ else
{
- // when really want to go to single pixel lines, move to center.
- // Without this translation, all hor/ver hairlines will be centered exactly
- // between two pixel lines (which looks best)
- const double fTranslateToCenter(mnAntiAlialize * 0.5);
- aTransform.translate(fTranslateToCenter, fTranslateToCenter, 0.0);
+ mpZBufferRasterConverter3D->rasterconvertB3DPolygon(rHairline, 0, mpBZPixelRaster->getHeight(), mnAntiAlialize);
}
-
- aSnappedHairline.transform(aTransform);
-
- mpZBufferRasterConverter3D->rasterconvertB3DPolygon(aSnappedHairline, 0, mpBZPixelRaster->getHeight(), mnAntiAlialize);
}
else
{
- mpZBufferRasterConverter3D->rasterconvertB3DPolygon(rHairline, 0, mpBZPixelRaster->getHeight(), mnAntiAlialize);
+ mpZBufferRasterConverter3D->rasterconvertB3DPolygon(rHairline, 0, mpBZPixelRaster->getHeight(), 1);
}
}
- else
- {
- mpZBufferRasterConverter3D->rasterconvertB3DPolygon(rHairline, 0, mpBZPixelRaster->getHeight(), 1);
- }
}
}
@@ -605,8 +633,30 @@ namespace drawinglayer
{
if(mpBZPixelRaster)
{
- mpZBufferRasterConverter3D->setCurrentMaterial(rMaterial);
- mpZBufferRasterConverter3D->rasterconvertB3DPolyPolygon(rFill, &maInvEyeToView, 0, mpBZPixelRaster->getHeight());
+ if(getTransparenceCounter())
+ {
+ // transparent output; record for later sorting and painting from
+ // back to front
+ if(!mpRasterPrimitive3Ds)
+ {
+ const_cast< ZBufferProcessor3D* >(this)->mpRasterPrimitive3Ds = new std::vector< RasterPrimitive3D >;
+ }
+
+ mpRasterPrimitive3Ds->push_back(RasterPrimitive3D(
+ getGeoTexSvx(),
+ getTransparenceGeoTexSvx(),
+ rMaterial,
+ rFill,
+ getModulate(),
+ getFilter(),
+ getSimpleTextureActive(),
+ false));
+ }
+ else
+ {
+ mpZBufferRasterConverter3D->setCurrentMaterial(rMaterial);
+ mpZBufferRasterConverter3D->rasterconvertB3DPolyPolygon(rFill, &maInvEyeToView, 0, mpBZPixelRaster->getHeight());
+ }
}
}
@@ -624,8 +674,7 @@ namespace drawinglayer
maInvEyeToView(),
mpZBufferRasterConverter3D(0),
mnAntiAlialize(nAntiAlialize),
- mbProcessTransparent(false),
- mbContainsTransparent(false)
+ mpRasterPrimitive3Ds(0)
{
// generate ViewSizes
const double fFullViewSizeX((rViewInformation2D.getObjectToViewTransformation() * basegfx::B2DVector(fSizeX, 0.0)).getLength());
@@ -721,6 +770,58 @@ namespace drawinglayer
delete mpZBufferRasterConverter3D;
delete mpBZPixelRaster;
}
+
+ if(mpRasterPrimitive3Ds)
+ {
+ OSL_ASSERT("ZBufferProcessor3D: destructed, but there are unrendered transparent geometries. Use ZBufferProcessor3D::finish() to render these (!)");
+ delete mpRasterPrimitive3Ds;
+ }
+ }
+
+ void ZBufferProcessor3D::finish()
+ {
+ if(mpRasterPrimitive3Ds)
+ {
+ // there are transparent rasterprimitives
+ const sal_uInt32 nSize(mpRasterPrimitive3Ds->size());
+
+ if(nSize > 1)
+ {
+ // sort them from back to front
+ std::sort(mpRasterPrimitive3Ds->begin(), mpRasterPrimitive3Ds->end());
+ }
+
+ for(sal_uInt32 a(0); a < nSize; a++)
+ {
+ // paint each one by setting the remembered data and calling
+ // the render method
+ const RasterPrimitive3D& rCandidate = (*mpRasterPrimitive3Ds)[a];
+
+ mpGeoTexSvx = rCandidate.getGeoTexSvx();
+ mpTransparenceGeoTexSvx = rCandidate.getTransparenceGeoTexSvx();
+ mbModulate = rCandidate.getModulate();
+ mbFilter = rCandidate.getFilter();
+ mbSimpleTextureActive = rCandidate.getSimpleTextureActive();
+
+ if(rCandidate.getIsLine())
+ {
+ rasterconvertB3DPolygon(
+ rCandidate.getMaterial(),
+ rCandidate.getPolyPolygon().getB3DPolygon(0));
+ }
+ else
+ {
+ rasterconvertB3DPolyPolygon(
+ rCandidate.getMaterial(),
+ rCandidate.getPolyPolygon());
+ }
+ }
+
+ // delete them to signal the destructor that all is done and
+ // to allow asserting there
+ delete mpRasterPrimitive3Ds;
+ mpRasterPrimitive3Ds = 0;
+ }
}
BitmapEx ZBufferProcessor3D::getBitmapEx() const
diff --git a/drawinglayer/source/texture/texture.cxx b/drawinglayer/source/texture/texture.cxx
index 109409357f..fea376384d 100644
--- a/drawinglayer/source/texture/texture.cxx
+++ b/drawinglayer/source/texture/texture.cxx
@@ -158,15 +158,10 @@ namespace drawinglayer
{
if(maGradientInfo.mnSteps)
{
- const double fTop(mfBorder);
- const double fStripeWidth((1.0 - fTop) / maGradientInfo.mnSteps);
-
+ const double fStripeWidth(1.0 / maGradientInfo.mnSteps);
for(sal_uInt32 a(1L); a < maGradientInfo.mnSteps; a++)
{
- const double fOffsetUpper(fStripeWidth * (double)a);
-
- // create matrix
- const basegfx::B2DRange aRect(0.0, fTop + fOffsetUpper, 1.0, 1.0);
+ const basegfx::B2DRange aRect(0.0, fStripeWidth * a, 1.0, 1.0);
impAppendMatrix(rMatrices, aRect);
}
}
@@ -218,17 +213,10 @@ namespace drawinglayer
{
if(maGradientInfo.mnSteps)
{
- const double fHalfBorder(mfBorder * 0.5);
- double fTop(fHalfBorder);
- double fBottom(1.0 - fHalfBorder);
- const double fStripeWidth((fBottom - fTop) / ((maGradientInfo.mnSteps * 2L) - 1L));
-
- for(sal_uInt32 a(1L); a < maGradientInfo.mnSteps; a++)
+ const double fStripeWidth=1.0 / (maGradientInfo.mnSteps - 1L);
+ for(sal_uInt32 a(maGradientInfo.mnSteps-1L); a != 0; a--)
{
- const double fOffset(fStripeWidth * (double)a);
-
- // create matrix
- const basegfx::B2DRange aRect(0.0, fTop + fOffset, 1.0, fBottom - fOffset);
+ const basegfx::B2DRange aRect(0, 0, 1.0, fStripeWidth * a);
impAppendMatrix(rMatrices, aRect);
}
}
@@ -280,34 +268,10 @@ namespace drawinglayer
{
if(maGradientInfo.mnSteps)
{
- const double fHalfBorder((1.0 - mfBorder) * 0.5);
- double fLeft(0.5 - fHalfBorder);
- double fTop(0.5 - fHalfBorder);
- double fRight(0.5 + fHalfBorder);
- double fBottom(0.5 + fHalfBorder);
- double fIncrementX, fIncrementY;
-
- if(maGradientInfo.mfAspectRatio > 1.0)
- {
- fIncrementY = (fBottom - fTop) / (double)(maGradientInfo.mnSteps * 2L);
- fIncrementX = fIncrementY / maGradientInfo.mfAspectRatio;
- }
- else
+ const double fStepSize=1.0 / maGradientInfo.mnSteps;
+ for(sal_uInt32 a(maGradientInfo.mnSteps-1L); a > 0; a--)
{
- fIncrementX = (fRight - fLeft) / (double)(maGradientInfo.mnSteps * 2L);
- fIncrementY = fIncrementX * maGradientInfo.mfAspectRatio;
- }
-
- for(sal_uInt32 a(1L); a < maGradientInfo.mnSteps; a++)
- {
- // next step
- fLeft += fIncrementX;
- fRight -= fIncrementX;
- fTop += fIncrementY;
- fBottom -= fIncrementY;
-
- // create matrix
- const basegfx::B2DRange aRect(fLeft, fTop, fRight, fBottom);
+ const basegfx::B2DRange aRect(0, 0, fStepSize*a, fStepSize*a);
impAppendMatrix(rMatrices, aRect);
}
}
@@ -352,34 +316,29 @@ namespace drawinglayer
{
if(maGradientInfo.mnSteps)
{
- const double fHalfBorder((1.0 - mfBorder) * 0.5);
- double fLeft(0.5 - fHalfBorder);
- double fTop(0.5 - fHalfBorder);
- double fRight(0.5 + fHalfBorder);
- double fBottom(0.5 + fHalfBorder);
+ double fWidth(1);
+ double fHeight(1);
double fIncrementX, fIncrementY;
if(maGradientInfo.mfAspectRatio > 1.0)
{
- fIncrementY = (fBottom - fTop) / (double)(maGradientInfo.mnSteps * 2L);
+ fIncrementY = fHeight / maGradientInfo.mnSteps;
fIncrementX = fIncrementY / maGradientInfo.mfAspectRatio;
}
else
{
- fIncrementX = (fRight - fLeft) / (double)(maGradientInfo.mnSteps * 2L);
+ fIncrementX = fWidth / maGradientInfo.mnSteps;
fIncrementY = fIncrementX * maGradientInfo.mfAspectRatio;
}
for(sal_uInt32 a(1L); a < maGradientInfo.mnSteps; a++)
{
// next step
- fLeft += fIncrementX;
- fRight -= fIncrementX;
- fTop += fIncrementY;
- fBottom -= fIncrementY;
+ fWidth -= fIncrementX;
+ fHeight -= fIncrementY;
// create matrix
- const basegfx::B2DRange aRect(fLeft, fTop, fRight, fBottom);
+ const basegfx::B2DRange aRect(0, 0, fWidth, fHeight);
impAppendMatrix(rMatrices, aRect);
}
}
@@ -424,42 +383,10 @@ namespace drawinglayer
{
if(maGradientInfo.mnSteps)
{
- const double fHalfBorder((1.0 - mfBorder) * 0.5);
- double fLeft(0.5 - fHalfBorder);
- double fTop(0.5 - fHalfBorder);
- double fRight(0.5 + fHalfBorder);
- double fBottom(0.5 + fHalfBorder);
- double fIncrementX, fIncrementY;
-
- if(maGradientInfo.mfAspectRatio > 1.0)
- {
- const double fWidth(fRight - fLeft);
- const double fHalfAspectExpansion(((maGradientInfo.mfAspectRatio - 1.0) * 0.5) * fWidth);
- fTop -= fHalfAspectExpansion;
- fBottom += fHalfAspectExpansion;
- fIncrementX = fWidth / (double)(maGradientInfo.mnSteps * 2L);
- fIncrementY = fIncrementX * maGradientInfo.mfAspectRatio;
- }
- else
+ const double fStepSize=1.0 / maGradientInfo.mnSteps;
+ for(sal_uInt32 a(maGradientInfo.mnSteps-1L); a > 0; a--)
{
- const double fHeight(fBottom - fTop);
- const double fHalfAspectExpansion((((1.0 / maGradientInfo.mfAspectRatio) - 1.0) * 0.5) * fHeight);
- fLeft -= fHalfAspectExpansion;
- fRight += fHalfAspectExpansion;
- fIncrementY = fHeight / (double)(maGradientInfo.mnSteps * 2L);
- fIncrementX = fIncrementY / maGradientInfo.mfAspectRatio;
- }
-
- for(sal_uInt32 a(1L); a < maGradientInfo.mnSteps; a++)
- {
- // next step
- fLeft += fIncrementX;
- fRight -= fIncrementX;
- fTop += fIncrementY;
- fBottom -= fIncrementY;
-
- // create matrix
- const basegfx::B2DRange aRect(fLeft, fTop, fRight, fBottom);
+ const basegfx::B2DRange aRect(0, 0, fStepSize*a, fStepSize*a);
impAppendMatrix(rMatrices, aRect);
}
}
@@ -504,34 +431,29 @@ namespace drawinglayer
{
if(maGradientInfo.mnSteps)
{
- const double fHalfBorder((1.0 - mfBorder) * 0.5);
- double fLeft(0.5 - fHalfBorder);
- double fTop(0.5 - fHalfBorder);
- double fRight(0.5 + fHalfBorder);
- double fBottom(0.5 + fHalfBorder);
+ double fWidth(1);
+ double fHeight(1);
double fIncrementX, fIncrementY;
if(maGradientInfo.mfAspectRatio > 1.0)
{
- fIncrementY = (fBottom - fTop) / (double)(maGradientInfo.mnSteps * 2L);
+ fIncrementY = fHeight / maGradientInfo.mnSteps;
fIncrementX = fIncrementY / maGradientInfo.mfAspectRatio;
}
else
{
- fIncrementX = (fRight - fLeft) / (double)(maGradientInfo.mnSteps * 2L);
+ fIncrementX = fWidth / maGradientInfo.mnSteps;
fIncrementY = fIncrementX * maGradientInfo.mfAspectRatio;
}
for(sal_uInt32 a(1L); a < maGradientInfo.mnSteps; a++)
{
// next step
- fLeft += fIncrementX;
- fRight -= fIncrementX;
- fTop += fIncrementY;
- fBottom -= fIncrementY;
+ fWidth -= fIncrementX;
+ fHeight -= fIncrementY;
// create matrix
- const basegfx::B2DRange aRect(fLeft, fTop, fRight, fBottom);
+ const basegfx::B2DRange aRect(0, 0, fWidth, fHeight);
impAppendMatrix(rMatrices, aRect);
}
}
@@ -567,6 +489,8 @@ namespace drawinglayer
double fTargetOffsetX(rTargetRange.getMinX());
double fTargetOffsetY(rTargetRange.getMinY());
+ fAngle = -fAngle;
+
// add object expansion
if(0.0 != fAngle)
{
diff --git a/drawinglayer/source/texture/texture3d.cxx b/drawinglayer/source/texture/texture3d.cxx
index bc1fce2bfb..cec5083b8e 100644
--- a/drawinglayer/source/texture/texture3d.cxx
+++ b/drawinglayer/source/texture/texture3d.cxx
@@ -30,7 +30,6 @@
#include <drawinglayer/texture/texture3d.hxx>
#include <vcl/bmpacc.hxx>
-#include <drawinglayer/attribute/fillattribute.hxx>
#include <drawinglayer/primitive3d/hatchtextureprimitive3d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -190,7 +189,7 @@ namespace drawinglayer
{
const attribute::FillHatchAttribute& rHatch(rPrimitive.getHatch());
const basegfx::B2DRange aOutlineRange(0.0, 0.0, rPrimitive.getTextureSize().getX(), rPrimitive.getTextureSize().getY());
- const double fAngleA(-rHatch.getAngle());
+ const double fAngleA(rHatch.getAngle());
maColor = rHatch.getColor();
mbFillBackground = rHatch.isFillBackground();
mp0 = new GeoTexSvxHatch(aOutlineRange, rHatch.getDistance(), fAngleA);
diff --git a/editeng/inc/editeng/AccessibleEditableTextPara.hxx b/editeng/inc/editeng/AccessibleEditableTextPara.hxx
index a2173fbb5d..3bf863862a 100644
--- a/editeng/inc/editeng/AccessibleEditableTextPara.hxx
+++ b/editeng/inc/editeng/AccessibleEditableTextPara.hxx
@@ -31,7 +31,7 @@
#include <tools/gen.hxx>
#include <tools/string.hxx>
#include <cppuhelper/weakref.hxx>
-#include <cppuhelper/compbase8.hxx>
+#include <cppuhelper/compbase9.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <cppuhelper/interfacecontainer.hxx>
@@ -42,6 +42,7 @@
#include <com/sun/star/accessibility/XAccessibleComponent.hpp>
#include <com/sun/star/accessibility/XAccessibleEditableText.hpp>
#include <com/sun/star/accessibility/XAccessibleTextAttributes.hpp>
+#include <com/sun/star/accessibility/XAccessibleHypertext.hpp>
#include <com/sun/star/accessibility/XAccessibleMultiLineText.hpp>
#include <comphelper/accessibletexthelper.hxx>
@@ -53,12 +54,13 @@
namespace accessibility
{
- typedef ::cppu::WeakComponentImplHelper8< ::com::sun::star::accessibility::XAccessible,
+ typedef ::cppu::WeakComponentImplHelper9< ::com::sun::star::accessibility::XAccessible,
::com::sun::star::accessibility::XAccessibleContext,
::com::sun::star::accessibility::XAccessibleComponent,
::com::sun::star::accessibility::XAccessibleEditableText,
::com::sun::star::accessibility::XAccessibleEventBroadcaster,
::com::sun::star::accessibility::XAccessibleTextAttributes,
+ ::com::sun::star::accessibility::XAccessibleHypertext,
::com::sun::star::accessibility::XAccessibleMultiLineText,
::com::sun::star::lang::XServiceInfo > AccessibleTextParaInterfaceBase;
@@ -161,6 +163,11 @@ namespace accessibility
// XAccessibleTextAttributes
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getDefaultAttributes( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& RequestedAttributes ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getRunAttributes( ::sal_Int32 Index, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& RequestedAttributes ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+
+ // XAccessibleHypertext
+ virtual ::sal_Int32 SAL_CALL getHyperLinkCount( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleHyperlink > SAL_CALL getHyperLink( ::sal_Int32 nLinkIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getHyperLinkIndex( ::sal_Int32 nCharIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
// XAccessibleMultiLineText
virtual ::sal_Int32 SAL_CALL getLineNumberAtIndex( ::sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
diff --git a/editeng/inc/editeng/unoedprx.hxx b/editeng/inc/editeng/unoedprx.hxx
index 29fbaf8bba..162a75ee95 100644
--- a/editeng/inc/editeng/unoedprx.hxx
+++ b/editeng/inc/editeng/unoedprx.hxx
@@ -49,8 +49,11 @@ public:
virtual void SetParaAttribs( USHORT nPara, const SfxItemSet& rSet );
virtual void RemoveAttribs( const ESelection& rSelection, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich );
virtual void GetPortions( USHORT nPara, SvUShorts& rList ) const;
-
- virtual USHORT GetItemState( const ESelection& rSel, USHORT nWhich ) const;
+
+ virtual sal_Int32 CalcLogicalIndex( USHORT nPara, USHORT nEEIndex );
+ virtual USHORT CalcEditEngineIndex( USHORT nPara, sal_Int32 nLogicalIndex );
+
+ virtual USHORT GetItemState( const ESelection& rSel, USHORT nWhich ) const;
virtual USHORT GetItemState( USHORT nPara, USHORT nWhich ) const;
virtual void QuickInsertText( const String& rText, const ESelection& rSel );
@@ -61,6 +64,8 @@ public:
virtual SfxItemPool* GetPool() const;
virtual XubString CalcFieldValue( const SvxFieldItem& rField, USHORT nPara, USHORT nPos, Color*& rpTxtColor, Color*& rpFldColor );
+ virtual void FieldClicked( const SvxFieldItem& rField, USHORT nPara, xub_StrLen nPos );
+
virtual BOOL IsValid() const;
virtual LanguageType GetLanguage( USHORT, USHORT ) const;
diff --git a/editeng/inc/editeng/unoedsrc.hxx b/editeng/inc/editeng/unoedsrc.hxx
index 7bf2af6872..c7ba241a6b 100644
--- a/editeng/inc/editeng/unoedsrc.hxx
+++ b/editeng/inc/editeng/unoedsrc.hxx
@@ -152,7 +152,7 @@ class EDITENG_DLLPUBLIC SvxTextForwarder
{
public:
virtual ~SvxTextForwarder();
-
+
virtual USHORT GetParagraphCount() const = 0;
virtual USHORT GetTextLen( USHORT nParagraph ) const = 0;
virtual String GetText( const ESelection& rSel ) const = 0;
@@ -161,7 +161,7 @@ public:
virtual void SetParaAttribs( USHORT nPara, const SfxItemSet& rSet ) = 0;
virtual void RemoveAttribs( const ESelection& rSelection, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich ) = 0;
virtual void GetPortions( USHORT nPara, SvUShorts& rList ) const = 0;
-
+
virtual USHORT GetItemState( const ESelection& rSel, USHORT nWhich ) const = 0;
virtual USHORT GetItemState( USHORT nPara, USHORT nWhich ) const = 0;
@@ -171,6 +171,7 @@ public:
virtual void QuickInsertLineBreak( const ESelection& rSel ) = 0;
virtual XubString CalcFieldValue( const SvxFieldItem& rField, USHORT nPara, USHORT nPos, Color*& rpTxtColor, Color*& rpFldColor ) = 0;
+ virtual void FieldClicked( const SvxFieldItem& rField, USHORT nPara, xub_StrLen nPos ) = 0;
virtual SfxItemPool* GetPool() const = 0;
diff --git a/editeng/inc/editeng/unofored.hxx b/editeng/inc/editeng/unofored.hxx
index 59a357c24a..be8d27eb80 100644
--- a/editeng/inc/editeng/unofored.hxx
+++ b/editeng/inc/editeng/unofored.hxx
@@ -51,7 +51,7 @@ public:
virtual void SetParaAttribs( USHORT nPara, const SfxItemSet& rSet );
virtual void RemoveAttribs( const ESelection& rSelection, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich );
virtual void GetPortions( USHORT nPara, SvUShorts& rList ) const;
-
+
virtual USHORT GetItemState( const ESelection& rSel, USHORT nWhich ) const;
virtual USHORT GetItemState( USHORT nPara, USHORT nWhich ) const;
@@ -63,6 +63,7 @@ public:
virtual SfxItemPool* GetPool() const;
virtual XubString CalcFieldValue( const SvxFieldItem& rField, USHORT nPara, USHORT nPos, Color*& rpTxtColor, Color*& rpFldColor );
+ virtual void FieldClicked( const SvxFieldItem& rField, USHORT nPara, xub_StrLen nPos );
virtual BOOL IsValid() const;
virtual LanguageType GetLanguage( USHORT, USHORT ) const;
diff --git a/editeng/inc/editeng/unoforou.hxx b/editeng/inc/editeng/unoforou.hxx
index 8b441656a2..aa0b9ed90c 100644
--- a/editeng/inc/editeng/unoforou.hxx
+++ b/editeng/inc/editeng/unoforou.hxx
@@ -81,6 +81,8 @@ public:
virtual SfxItemPool* GetPool() const;
virtual XubString CalcFieldValue( const SvxFieldItem& rField, USHORT nPara, USHORT nPos, Color*& rpTxtColor, Color*& rpFldColor );
+ virtual void FieldClicked( const SvxFieldItem& rField, USHORT nPara, xub_StrLen nPos );
+
virtual BOOL IsValid() const;
Outliner& GetOutliner() const { return rOutliner; }
diff --git a/editeng/inc/editeng/unotext.hxx b/editeng/inc/editeng/unotext.hxx
index abe3c5a9d6..965a8d5d65 100644
--- a/editeng/inc/editeng/unotext.hxx
+++ b/editeng/inc/editeng/unotext.hxx
@@ -195,7 +195,7 @@ public:
virtual void SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet );
virtual void RemoveAttribs( const ESelection& rSelection, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich );
virtual void GetPortions( sal_uInt16 nPara, SvUShorts& rList ) const;
-
+
sal_uInt16 GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const;
sal_uInt16 GetItemState( sal_uInt16 nPara, sal_uInt16 nWhich ) const;
@@ -207,6 +207,8 @@ public:
virtual void QuickInsertLineBreak( const ESelection& rSel );
virtual XubString CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor );
+ virtual void FieldClicked( const SvxFieldItem& rField, USHORT nPara, xub_StrLen nPos );
+
virtual sal_Bool IsValid() const;
virtual void SetNotifyHdl( const Link& );
diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
index 4175896eb4..89917d77a8 100644
--- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx
+++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
@@ -40,6 +40,7 @@
#include <vos/mutex.hxx>
#include <vcl/window.hxx>
#include <vcl/svapp.hxx>
+#include <editeng/flditem.hxx>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/awt/Point.hpp>
@@ -52,11 +53,8 @@
#include <comphelper/accessibleeventnotifier.hxx>
#include <comphelper/sequenceashashmap.hxx>
#include <unotools/accessiblestatesethelper.hxx>
-
-// --> OD 2006-01-11 #i27138#
#include <unotools/accessiblerelationsethelper.hxx>
#include <com/sun/star/accessibility/AccessibleRelationType.hpp>
-// <--
#include <vcl/unohelp.hxx>
#include <editeng/editeng.hxx>
#include <editeng/unoprnms.hxx>
@@ -70,9 +68,16 @@
//------------------------------------------------------------------------
#include <com/sun/star/beans/PropertyState.hpp>
+
+//!!!#include <svx/unoshape.hxx>
+//!!!#include <svx/dialmgr.hxx>
+//!!!#include "accessibility.hrc"
+
#include <editeng/unolingu.hxx>
#include <editeng/unopracc.hxx>
#include "editeng/AccessibleEditableTextPara.hxx"
+#include "AccessibleHyperlink.hxx"
+
#include <svtools/colorcfg.hxx>
@@ -525,7 +530,9 @@ namespace accessibility
{
uno::Reference< XAccessible > xPara = xParentContext->getAccessibleChild( nIndex );
if( xPara.is() )
+ {
return uno::Reference< XAccessibleText > ( xPara, uno::UNO_QUERY );
+ }
}
}
@@ -811,6 +818,11 @@ namespace accessibility
uno::Reference< XAccessibleEditableText > aAccEditText = this;
aRet <<= aAccEditText;
}
+ else if ( rType == ::getCppuType((uno::Reference< XAccessibleHypertext > *)0) )
+ {
+ uno::Reference< XAccessibleHypertext > aAccHyperText = this;
+ aRet <<= aAccHyperText;
+ }
else
{
aRet = AccessibleTextParaInterfaceBase::queryInterface(rType);
@@ -1434,7 +1446,7 @@ namespace accessibility
::rtl::OUString SAL_CALL AccessibleEditableTextPara::getText() throw (uno::RuntimeException)
{
DBG_CHKTHIS( AccessibleEditableTextPara, NULL );
-
+
::vos::OGuard aGuard( Application::GetSolarMutex() );
DBG_ASSERT(GetParagraphIndex() >= 0 && GetParagraphIndex() <= USHRT_MAX,
@@ -2062,7 +2074,85 @@ namespace accessibility
return aOutSequence;
}
+
+ // XAccessibleHypertext
+ ::sal_Int32 SAL_CALL AccessibleEditableTextPara::getHyperLinkCount( ) throw (::com::sun::star::uno::RuntimeException)
+ {
+ SvxAccessibleTextAdapter& rT = GetTextForwarder();
+ const sal_Int32 nPara = GetParagraphIndex();
+
+ USHORT nHyperLinks = 0;
+ USHORT nFields = rT.GetFieldCount( nPara );
+ for ( USHORT n = 0; n < nFields; n++ )
+ {
+ EFieldInfo aField = rT.GetFieldInfo( nPara, n );
+ if ( aField.pFieldItem->GetField()->ISA( SvxURLField ) )
+ nHyperLinks++;
+ }
+ return nHyperLinks;
+ }
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleHyperlink > SAL_CALL AccessibleEditableTextPara::getHyperLink( ::sal_Int32 nLinkIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException)
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleHyperlink > xRef;
+
+ SvxAccessibleTextAdapter& rT = GetTextForwarder();
+ const sal_Int32 nPara = GetParagraphIndex();
+
+ USHORT nHyperLink = 0;
+ USHORT nFields = rT.GetFieldCount( nPara );
+ for ( USHORT n = 0; n < nFields; n++ )
+ {
+ EFieldInfo aField = rT.GetFieldInfo( nPara, n );
+ if ( aField.pFieldItem->GetField()->ISA( SvxURLField ) )
+ {
+ if ( nHyperLink == nLinkIndex )
+ {
+ USHORT nEEStart = aField.aPosition.nIndex;
+ // Translate EE Index to accessible index
+ USHORT nStart = rT.CalcEditEngineIndex( nPara, nEEStart );
+ USHORT nEnd = nStart + aField.aCurrentText.Len();
+ xRef = new AccessibleHyperlink( rT, new SvxFieldItem( *aField.pFieldItem ), nPara, nEEStart, nStart, nEnd, aField.aCurrentText );
+ break;
+ }
+ nHyperLink++;
+ }
+ }
+
+ return xRef;
+ }
+
+ ::sal_Int32 SAL_CALL AccessibleEditableTextPara::getHyperLinkIndex( ::sal_Int32 nCharIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException)
+ {
+ const sal_Int32 nPara = GetParagraphIndex();
+ SvxAccessibleTextAdapter& rT = GetTextForwarder();
+
+// SvxAccessibleTextIndex aIndex;
+// aIndex.SetIndex(nPara, nCharIndex, rT);
+// const USHORT nEEIndex = aIndex.GetEEIndex();
+
+ const USHORT nEEIndex = rT.CalcEditEngineIndex( nPara, nCharIndex );
+ sal_Int32 nHLIndex = 0;
+ USHORT nHyperLink = 0;
+ USHORT nFields = rT.GetFieldCount( nPara );
+ for ( USHORT n = 0; n < nFields; n++ )
+ {
+ EFieldInfo aField = rT.GetFieldInfo( nPara, n );
+ if ( aField.pFieldItem->GetField()->ISA( SvxURLField ) )
+ {
+ if ( aField.aPosition.nIndex == nEEIndex )
+ {
+ nHLIndex = nHyperLink;
+ break;
+ }
+ nHyperLink++;
+ }
+ }
+
+ return nHLIndex;
+ }
+
// XAccessibleMultiLineText
sal_Int32 SAL_CALL AccessibleEditableTextPara::getLineNumberAtIndex( sal_Int32 nIndex ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
diff --git a/editeng/source/accessibility/AccessibleHyperlink.cxx b/editeng/source/accessibility/AccessibleHyperlink.cxx
new file mode 100644
index 0000000000..8fa1c93ad4
--- /dev/null
+++ b/editeng/source/accessibility/AccessibleHyperlink.cxx
@@ -0,0 +1,146 @@
+/*************************************************************************
+ *
+ * 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: AccessibleEditableTextPara.cxx,v $
+ * $Revision: 1.53 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General 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_editeng.hxx"
+
+#include <com/sun/star/uno/Any.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include <comphelper/accessiblekeybindinghelper.hxx>
+
+#include "AccessibleHyperlink.hxx"
+#include "editeng/unoedprx.hxx"
+#include <editeng/flditem.hxx>
+#include <vcl/keycodes.hxx>
+
+using namespace ::com::sun::star;
+
+
+//------------------------------------------------------------------------
+//
+// AccessibleHyperlink implementation
+//
+//------------------------------------------------------------------------
+
+namespace accessibility
+{
+
+ AccessibleHyperlink::AccessibleHyperlink( SvxAccessibleTextAdapter& r, SvxFieldItem* p, USHORT nP, USHORT nR, sal_Int32 nStt, sal_Int32 nEnd, const ::rtl::OUString& rD )
+ : rTA( r )
+ {
+ pFld = p;
+ nPara = nP;
+ nRealIdx = nR;
+ nStartIdx = nStt;
+ nEndIdx = nEnd;
+ aDescription = rD;
+ }
+
+ AccessibleHyperlink::~AccessibleHyperlink()
+ {
+ delete pFld;
+ }
+
+ // XAccessibleAction
+ sal_Int32 SAL_CALL AccessibleHyperlink::getAccessibleActionCount() throw (uno::RuntimeException)
+ {
+ return isValid() ? 1 : 0;
+ }
+
+ sal_Bool SAL_CALL AccessibleHyperlink::doAccessibleAction( sal_Int32 nIndex ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
+ {
+ sal_Bool bRet = sal_False;
+ if ( isValid() && ( nIndex == 0 ) )
+ {
+ rTA.FieldClicked( *pFld, nPara, nRealIdx );
+ bRet = sal_True;
+ }
+ return bRet;
+ }
+
+ ::rtl::OUString SAL_CALL AccessibleHyperlink::getAccessibleActionDescription( sal_Int32 nIndex ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
+ {
+ ::rtl::OUString aDesc;
+
+ if ( isValid() && ( nIndex == 0 ) )
+ aDesc = aDescription;
+
+ return aDesc;
+ }
+
+ uno::Reference< ::com::sun::star::accessibility::XAccessibleKeyBinding > SAL_CALL AccessibleHyperlink::getAccessibleActionKeyBinding( sal_Int32 nIndex ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
+ {
+ uno::Reference< ::com::sun::star::accessibility::XAccessibleKeyBinding > xKeyBinding;
+
+ if( isValid() && ( nIndex == 0 ) )
+ {
+ ::comphelper::OAccessibleKeyBindingHelper* pKeyBindingHelper = new ::comphelper::OAccessibleKeyBindingHelper();
+ xKeyBinding = pKeyBindingHelper;
+
+ awt::KeyStroke aKeyStroke;
+ aKeyStroke.Modifiers = 0;
+ aKeyStroke.KeyCode = KEY_RETURN;
+ aKeyStroke.KeyChar = 0;
+ aKeyStroke.KeyFunc = 0;
+ pKeyBindingHelper->AddKeyBinding( aKeyStroke );
+ }
+
+ return xKeyBinding;
+ }
+
+ // XAccessibleHyperlink
+ uno::Any SAL_CALL AccessibleHyperlink::getAccessibleActionAnchor( sal_Int32 /*nIndex*/ ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
+ {
+ return uno::Any();
+ }
+
+ uno::Any SAL_CALL AccessibleHyperlink::getAccessibleActionObject( sal_Int32 /*nIndex*/ ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
+ {
+ return uno::Any();
+ }
+
+ sal_Int32 SAL_CALL AccessibleHyperlink::getStartIndex() throw (uno::RuntimeException)
+ {
+ return nStartIdx;
+ }
+
+ sal_Int32 SAL_CALL AccessibleHyperlink::getEndIndex() throw (uno::RuntimeException)
+ {
+ return nEndIdx;
+ }
+
+ sal_Bool SAL_CALL AccessibleHyperlink::isValid( ) throw (uno::RuntimeException)
+ {
+ return rTA.IsValid();
+ }
+
+} // end of namespace accessibility
+
+//------------------------------------------------------------------------
diff --git a/editeng/source/accessibility/AccessibleHyperlink.hxx b/editeng/source/accessibility/AccessibleHyperlink.hxx
new file mode 100644
index 0000000000..e0d607f6f3
--- /dev/null
+++ b/editeng/source/accessibility/AccessibleHyperlink.hxx
@@ -0,0 +1,82 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: AccessibleEditableTextPara.hxx,v $
+ * $Revision: 1.22 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SVX_ACCESSIBLE_HYPERLINK_HXX
+#define _SVX_ACCESSIBLE_HYPERLINK_HXX
+
+#include <cppuhelper/weakref.hxx>
+#include <cppuhelper/compbase1.hxx>
+#include <cppuhelper/typeprovider.hxx>
+#include <cppuhelper/interfacecontainer.hxx>
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/accessibility/XAccessibleHyperlink.hpp>
+
+#include <tools/solar.h>
+
+class SvxFieldItem;
+class SvxAccessibleTextAdapter;
+
+namespace accessibility
+{
+
+ class AccessibleHyperlink : public ::cppu::WeakImplHelper1< ::com::sun::star::accessibility::XAccessibleHyperlink >
+ {
+ private:
+
+ SvxAccessibleTextAdapter& rTA;
+ SvxFieldItem* pFld;
+ USHORT nPara, nRealIdx; // EE values
+ sal_Int32 nStartIdx, nEndIdx; // translated values
+ ::rtl::OUString aDescription;
+
+ public:
+ AccessibleHyperlink( SvxAccessibleTextAdapter& r, SvxFieldItem* p, USHORT nP, USHORT nR, sal_Int32 nStt, sal_Int32 nEnd, const ::rtl::OUString& rD );
+ ~AccessibleHyperlink();
+
+ // XAccessibleAction
+ virtual sal_Int32 SAL_CALL getAccessibleActionCount() throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL doAccessibleAction( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getAccessibleActionDescription( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+
+ // XAccessibleHyperlink
+ virtual ::com::sun::star::uno::Any SAL_CALL getAccessibleActionAnchor( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getAccessibleActionObject( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getStartIndex() throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getEndIndex() throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL isValid() throw (::com::sun::star::uno::RuntimeException);
+ };
+
+} // end of namespace accessibility
+
+#endif
+
diff --git a/editeng/source/accessibility/makefile.mk b/editeng/source/accessibility/makefile.mk
index e29b6477f6..80cb6df746 100755..100644
--- a/editeng/source/accessibility/makefile.mk
+++ b/editeng/source/accessibility/makefile.mk
@@ -50,6 +50,7 @@ SLOFILES = \
$(SLO)$/AccessibleStaticTextBase.obj \
$(SLO)$/AccessibleParaManager.obj \
$(SLO)$/AccessibleEditableTextPara.obj \
+ $(SLO)$/AccessibleHyperlink.obj \
$(SLO)$/AccessibleImageBullet.obj
# --- Tagets -------------------------------------------------------
diff --git a/editeng/source/editeng/editdbg.cxx b/editeng/source/editeng/editdbg.cxx
index 47611286ca..c6035c1bb6 100644
--- a/editeng/source/editeng/editdbg.cxx
+++ b/editeng/source/editeng/editdbg.cxx
@@ -458,7 +458,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, BOOL bInfoBox )
fprintf( fp, "\n\n ================================================================================" );
fprintf( fp, "\n================== EditEngine & Views ======================================" );
fprintf( fp, "\n================================================================================" );
- fprintf( fp, "\nControl: %lx", pEE->GetControlWord() );
+ fprintf( fp, "\nControl: %"SAL_PRIxUINT32, pEE->GetControlWord() );
fprintf( fp, "\nRefMapMode: %i", pEE->pImpEditEngine->pRefDev->GetMapMode().GetMapUnit() );
fprintf( fp, "\nPaperSize: %li x %li", pEE->GetPaperSize().Width(), pEE->GetPaperSize().Height() );
fprintf( fp, "\nMaxAutoPaperSize: %li x %li", pEE->GetMaxAutoPaperSize().Width(), pEE->GetMaxAutoPaperSize().Height() );
diff --git a/editeng/source/uno/unoedprx.cxx b/editeng/source/uno/unoedprx.cxx
index f8cf3068d2..1068049d8a 100644
--- a/editeng/source/uno/unoedprx.cxx
+++ b/editeng/source/uno/unoedprx.cxx
@@ -687,6 +687,33 @@ XubString SvxAccessibleTextAdapter::CalcFieldValue( const SvxFieldItem& rField,
return mrTextForwarder->CalcFieldValue( rField, nPara, nPos, rpTxtColor, rpFldColor );
}
+void SvxAccessibleTextAdapter::FieldClicked( const SvxFieldItem& rField, USHORT nPara, xub_StrLen nPos )
+{
+ DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
+
+ mrTextForwarder->FieldClicked( rField, nPara, nPos );
+}
+
+sal_Int32 SvxAccessibleTextAdapter::CalcLogicalIndex( USHORT nPara, USHORT nEEIndex )
+{
+ DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
+
+ SvxAccessibleTextIndex aIndex;
+ aIndex.SetEEIndex(nPara, nEEIndex, *mrTextForwarder);
+ return aIndex.GetIndex();
+}
+
+USHORT SvxAccessibleTextAdapter::CalcEditEngineIndex( USHORT nPara, sal_Int32 nLogicalIndex )
+{
+ DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
+
+ SvxAccessibleTextIndex aIndex;
+ aIndex.SetIndex(nPara, nLogicalIndex, *mrTextForwarder);
+ return aIndex.GetEEIndex();
+}
+
+
+
BOOL SvxAccessibleTextAdapter::IsValid() const
{
DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
diff --git a/editeng/source/uno/unofored.cxx b/editeng/source/uno/unofored.cxx
index b64855dc87..46c1703655 100644
--- a/editeng/source/uno/unofored.cxx
+++ b/editeng/source/uno/unofored.cxx
@@ -171,6 +171,11 @@ XubString SvxEditEngineForwarder::CalcFieldValue( const SvxFieldItem& rField, US
return rEditEngine.CalcFieldValue( rField, nPara, nPos, rpTxtColor, rpFldColor );
}
+void SvxEditEngineForwarder::FieldClicked( const SvxFieldItem& rField, USHORT nPara, xub_StrLen nPos )
+{
+ rEditEngine.FieldClicked( rField, nPara, nPos );
+}
+
USHORT GetSvxEditEngineItemState( EditEngine& rEditEngine, const ESelection& rSel, USHORT nWhich )
{
EECharAttribArray aAttribs;
diff --git a/editeng/source/uno/unoforou.cxx b/editeng/source/uno/unoforou.cxx
index df31b81e7f..215d2ec552 100644
--- a/editeng/source/uno/unoforou.cxx
+++ b/editeng/source/uno/unoforou.cxx
@@ -241,6 +241,11 @@ XubString SvxOutlinerForwarder::CalcFieldValue( const SvxFieldItem& rField, USHO
return rOutliner.CalcFieldValue( rField, nPara, nPos, rpTxtColor, rpFldColor );
}
+void SvxOutlinerForwarder::FieldClicked( const SvxFieldItem& rField, USHORT nPara, xub_StrLen nPos )
+{
+ rOutliner.FieldClicked( rField, nPara, nPos );
+}
+
BOOL SvxOutlinerForwarder::IsValid() const
{
// cannot reliably query outliner state
diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index f7bb37eac0..9a4a888afa 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -2588,6 +2588,10 @@ XubString SvxDummyTextSource::CalcFieldValue( const SvxFieldItem&, sal_uInt16, s
return XubString();
}
+void SvxDummyTextSource::FieldClicked( const SvxFieldItem&, USHORT, xub_StrLen )
+{
+}
+
sal_Bool SvxDummyTextSource::IsValid() const
{
return sal_False;
diff --git a/embeddedobj/source/commonembedding/embedobj.cxx b/embeddedobj/source/commonembedding/embedobj.cxx
index d2b8b2cc4d..d63e2ea9be 100644
--- a/embeddedobj/source/commonembedding/embedobj.cxx
+++ b/embeddedobj/source/commonembedding/embedobj.cxx
@@ -189,7 +189,7 @@ void OCommonEmbeddedObject::SwitchStateTo_Impl( sal_Int32 nNextState )
if ( !m_xObjectStorage.is() )
throw io::IOException(); //TODO: access denied
- m_pDocHolder->SetComponent( LoadDocumentFromStorage_Impl( m_xObjectStorage ), m_bReadOnly );
+ m_pDocHolder->SetComponent( LoadDocumentFromStorage_Impl(), m_bReadOnly );
}
else
{
diff --git a/embeddedobj/source/commonembedding/miscobj.cxx b/embeddedobj/source/commonembedding/miscobj.cxx
index 24a1fb715e..9991e19a69 100644
--- a/embeddedobj/source/commonembedding/miscobj.cxx
+++ b/embeddedobj/source/commonembedding/miscobj.cxx
@@ -63,6 +63,7 @@ OCommonEmbeddedObject::OCommonEmbeddedObject( const uno::Reference< lang::XMulti
, m_xFactory( xFactory )
, m_nMiscStatus( 0 )
, m_bEmbeddedScriptSupport( sal_True )
+, m_bDocumentRecoverySupport( sal_True )
, m_bWaitSaveCompleted( sal_False )
, m_bIsLink( sal_False )
, m_bLinkHasPassword( sal_False )
@@ -89,6 +90,7 @@ OCommonEmbeddedObject::OCommonEmbeddedObject(
, m_xFactory( xFactory )
, m_nMiscStatus( 0 )
, m_bEmbeddedScriptSupport( sal_True )
+, m_bDocumentRecoverySupport( sal_True )
, m_bWaitSaveCompleted( sal_False )
, m_bIsLink( sal_True )
, m_bLinkHasPassword( sal_False )
@@ -641,7 +643,8 @@ void SAL_CALL OCommonEmbeddedObject::close( sal_Bool bDeliverOwnership )
} catch ( uno::Exception& ) {}
}
- m_xObjectStorage = uno::Reference< embed::XStorage >();
+ m_xObjectStorage.clear();
+ m_xRecoveryStorage.clear();
}
m_bClosed = sal_True; // the closing succeeded
diff --git a/embeddedobj/source/commonembedding/persistence.cxx b/embeddedobj/source/commonembedding/persistence.cxx
index 8290f6eaf7..5cc9c03d8c 100644
--- a/embeddedobj/source/commonembedding/persistence.cxx
+++ b/embeddedobj/source/commonembedding/persistence.cxx
@@ -60,9 +60,12 @@
#include <comphelper/fileformat.h>
#include <comphelper/storagehelper.hxx>
#include <comphelper/mimeconfighelper.hxx>
+#include <comphelper/namedvaluecollection.hxx>
#include <rtl/logfile.hxx>
+#include <tools/diagnose_ex.h>
+
#define USE_STORAGEBASED_DOCUMENT
using namespace ::com::sun::star;
@@ -195,23 +198,34 @@ uno::Reference< io::XInputStream > createTempInpStreamFromStor(
}
//------------------------------------------------------
+static void TransferMediaType( const uno::Reference< embed::XStorage >& i_rSource, const uno::Reference< embed::XStorage >& i_rTarget )
+{
+ try
+ {
+ const uno::Reference< beans::XPropertySet > xSourceProps( i_rSource, uno::UNO_QUERY_THROW );
+ const uno::Reference< beans::XPropertySet > xTargetProps( i_rTarget, uno::UNO_QUERY_THROW );
+ const ::rtl::OUString sMediaTypePropName( RTL_CONSTASCII_USTRINGPARAM( "MediaType" ) );
+ xTargetProps->setPropertyValue( sMediaTypePropName, xSourceProps->getPropertyValue( sMediaTypePropName ) );
+ }
+ catch( const uno::Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+
+//------------------------------------------------------
static uno::Reference< util::XCloseable > CreateDocument( const uno::Reference< lang::XMultiServiceFactory >& _rxFactory,
- const ::rtl::OUString& _rDocumentServiceName, bool _bEmbeddedScriptSupport )
+ const ::rtl::OUString& _rDocumentServiceName, bool _bEmbeddedScriptSupport, const bool i_bDocumentRecoverySupport )
{
- uno::Sequence< uno::Any > aArguments(2);
- aArguments[0] <<= beans::NamedValue(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EmbeddedObject" ) ),
- uno::makeAny( (sal_Bool)sal_True )
- );
- aArguments[1] <<= beans::NamedValue(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EmbeddedScriptSupport" ) ),
- uno::makeAny( (sal_Bool)_bEmbeddedScriptSupport )
- );
+ ::comphelper::NamedValueCollection aArguments;
+ aArguments.put( "EmbeddedObject", (sal_Bool)sal_True );
+ aArguments.put( "EmbeddedScriptSupport", (sal_Bool)_bEmbeddedScriptSupport );
+ aArguments.put( "DocumentRecoverySupport", (sal_Bool)i_bDocumentRecoverySupport );
uno::Reference< uno::XInterface > xDocument;
try
{
- xDocument = _rxFactory->createInstanceWithArguments( _rDocumentServiceName, aArguments );
+ xDocument = _rxFactory->createInstanceWithArguments( _rDocumentServiceName, aArguments.getWrappedPropertyValues() );
}
catch( const uno::Exception& )
{
@@ -273,7 +287,7 @@ void OCommonEmbeddedObject::SwitchOwnPersistence( const uno::Reference< embed::X
{
uno::Reference< document::XStorageBasedDocument > xDoc( m_pDocHolder->GetComponent(), uno::UNO_QUERY );
if ( xDoc.is() )
- xDoc->switchToStorage( m_xObjectStorage );
+ SwitchDocToStorage_Impl( xDoc, m_xObjectStorage );
}
#endif
@@ -302,10 +316,27 @@ void OCommonEmbeddedObject::SwitchOwnPersistence( const uno::Reference< embed::X
}
//------------------------------------------------------
+void OCommonEmbeddedObject::EmbedAndReparentDoc_Impl( const uno::Reference< util::XCloseable >& i_rxDocument ) const
+{
+ SetDocToEmbedded( uno::Reference< frame::XModel >( i_rxDocument, uno::UNO_QUERY ), m_aModuleName );
+
+ try
+ {
+ uno::Reference < container::XChild > xChild( i_rxDocument, uno::UNO_QUERY );
+ if ( xChild.is() )
+ xChild->setParent( m_xParent );
+ }
+ catch( const lang::NoSupportException & )
+ {
+ OSL_ENSURE( false, "OCommonEmbeddedObject::EmbedAndReparentDoc: cannot set parent at document!" );
+ }
+}
+
+//------------------------------------------------------
uno::Reference< util::XCloseable > OCommonEmbeddedObject::InitNewDocument_Impl()
{
uno::Reference< util::XCloseable > xDocument( CreateDocument( m_xFactory, GetDocumentServiceName(),
- m_bEmbeddedScriptSupport ) );
+ m_bEmbeddedScriptSupport, m_bDocumentRecoverySupport ) );
uno::Reference< frame::XModel > xModel( xDocument, uno::UNO_QUERY );
uno::Reference< frame::XLoadable > xLoadable( xModel, uno::UNO_QUERY );
@@ -315,22 +346,31 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::InitNewDocument_Impl()
try
{
// set the document mode to embedded as the first action on document!!!
- SetDocToEmbedded( xModel, m_aModuleName );
+ EmbedAndReparentDoc_Impl( xDocument );
- try
+ // if we have a storage to recover the document from, do not use initNew, but instead load from that storage
+ bool bInitNew = true;
+ if ( m_xRecoveryStorage.is() )
{
- uno::Reference < container::XChild > xChild( xDocument, uno::UNO_QUERY );
- if ( xChild.is() )
- xChild->setParent( m_xParent );
+ uno::Reference< document::XStorageBasedDocument > xDoc( xLoadable, uno::UNO_QUERY );
+ OSL_ENSURE( xDoc.is(), "OCommonEmbeddedObject::InitNewDocument_Impl: cannot recover from a storage when the document is not storage based!" );
+ if ( xDoc.is() )
+ {
+ ::comphelper::NamedValueCollection aLoadArgs;
+ FillDefaultLoadArgs_Impl( m_xRecoveryStorage, aLoadArgs );
+
+ xDoc->loadFromStorage( m_xRecoveryStorage, aLoadArgs.getPropertyValues() );
+ SwitchDocToStorage_Impl( xDoc, m_xObjectStorage );
+ bInitNew = false;
+ }
}
- catch( const lang::NoSupportException & )
+
+ if ( bInitNew )
{
- OSL_ENSURE( false, "Cannot set parent at document" );
+ // init document as a new
+ xLoadable->initNew();
}
-
- // init document as a new
- xLoadable->initNew();
- xModel->attachResource( xModel->getURL(),m_aDocMediaDescriptor);
+ xModel->attachResource( xModel->getURL(), m_aDocMediaDescriptor );
}
catch( uno::Exception& )
{
@@ -356,7 +396,7 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::InitNewDocument_Impl()
uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadLink_Impl()
{
uno::Reference< util::XCloseable > xDocument( CreateDocument( m_xFactory, GetDocumentServiceName(),
- m_bEmbeddedScriptSupport ) );
+ m_bEmbeddedScriptSupport, m_bDocumentRecoverySupport ) );
uno::Reference< frame::XLoadable > xLoadable( xDocument, uno::UNO_QUERY );
if ( !xLoadable.is() )
@@ -385,18 +425,7 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadLink_Impl()
try
{
// the document is not really an embedded one, it is a link
- SetDocToEmbedded( uno::Reference < frame::XModel >( xDocument, uno::UNO_QUERY ), m_aModuleName );
-
- try
- {
- uno::Reference < container::XChild > xChild( xDocument, uno::UNO_QUERY );
- if ( xChild.is() )
- xChild->setParent( m_xParent );
- }
- catch( const lang::NoSupportException & )
- {
- OSL_ENSURE( false, "Cannot set parent at document" );
- }
+ EmbedAndReparentDoc_Impl( xDocument );
// load the document
xLoadable->load( aArgs );
@@ -437,7 +466,7 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadLink_Impl()
}
//------------------------------------------------------
-::rtl::OUString OCommonEmbeddedObject::GetFilterName( sal_Int32 nVersion )
+::rtl::OUString OCommonEmbeddedObject::GetFilterName( sal_Int32 nVersion ) const
{
::rtl::OUString aFilterName = GetPresetFilterName();
if ( !aFilterName.getLength() )
@@ -453,13 +482,30 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadLink_Impl()
}
//------------------------------------------------------
-uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadDocumentFromStorage_Impl(
- const uno::Reference< embed::XStorage >& xStorage )
+void OCommonEmbeddedObject::FillDefaultLoadArgs_Impl( const uno::Reference< embed::XStorage >& i_rxStorage,
+ ::comphelper::NamedValueCollection& o_rLoadArgs ) const
{
- OSL_ENSURE( xStorage.is(), "The storage can not be empty!" );
+ o_rLoadArgs.put( "DocumentBaseURL", GetBaseURL_Impl() );
+ o_rLoadArgs.put( "HierarchicalDocumentName", m_aEntryName );
+ o_rLoadArgs.put( "ReadOnly", m_bReadOnly );
+
+ ::rtl::OUString aFilterName = GetFilterName( ::comphelper::OStorageHelper::GetXStorageFormat( i_rxStorage ) );
+ OSL_ENSURE( aFilterName.getLength(), "OCommonEmbeddedObject::FillDefaultLoadArgs_Impl: Wrong document service name!" );
+ if ( !aFilterName.getLength() )
+ throw io::IOException(); // TODO: error message/code
+
+ o_rLoadArgs.put( "FilterName", aFilterName );
+}
+
+//------------------------------------------------------
+uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadDocumentFromStorage_Impl()
+{
+ ENSURE_OR_THROW( m_xObjectStorage.is(), "no object storage" );
+
+ const uno::Reference< embed::XStorage > xSourceStorage( m_xRecoveryStorage.is() ? m_xRecoveryStorage : m_xObjectStorage );
uno::Reference< util::XCloseable > xDocument( CreateDocument( m_xFactory, GetDocumentServiceName(),
- m_bEmbeddedScriptSupport ) );
+ m_bEmbeddedScriptSupport, m_bDocumentRecoverySupport ) );
//#i103460# ODF: take the size given from the parent frame as default
uno::Reference< chart2::XChartDocument > xChart( xDocument, uno::UNO_QUERY );
@@ -479,28 +525,13 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadDocumentFromStorag
if ( !xDoc.is() && !xLoadable.is() ) ///BUG: This should be || instead of && ?
throw uno::RuntimeException();
- ::rtl::OUString aFilterName = GetFilterName( ::comphelper::OStorageHelper::GetXStorageFormat( xStorage ) );
-
- OSL_ENSURE( aFilterName.getLength(), "Wrong document service name!" );
- if ( !aFilterName.getLength() )
- throw io::IOException();
-
- sal_Int32 nLen = xDoc.is() ? 4 : 6;
- uno::Sequence< beans::PropertyValue > aArgs( nLen );
-
- aArgs[0].Name = ::rtl::OUString::createFromAscii( "DocumentBaseURL" );
- aArgs[0].Value <<= GetBaseURL_Impl();
- aArgs[1].Name = ::rtl::OUString::createFromAscii( "HierarchicalDocumentName" );
- aArgs[1].Value <<= m_aEntryName;
- aArgs[2].Name = ::rtl::OUString::createFromAscii( "ReadOnly" );
- aArgs[2].Value <<= m_bReadOnly;
- aArgs[3].Name = ::rtl::OUString::createFromAscii( "FilterName" );
- aArgs[3].Value <<= aFilterName;
+ ::comphelper::NamedValueCollection aLoadArgs;
+ FillDefaultLoadArgs_Impl( xSourceStorage, aLoadArgs );
uno::Reference< io::XInputStream > xTempInpStream;
if ( !xDoc.is() )
{
- xTempInpStream = createTempInpStreamFromStor( xStorage, m_xFactory );
+ xTempInpStream = createTempInpStreamFromStor( xSourceStorage, m_xFactory );
if ( !xTempInpStream.is() )
throw uno::RuntimeException();
@@ -518,42 +549,27 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadDocumentFromStorag
OSL_ENSURE( aTempFileURL.getLength(), "Coudn't retrieve temporary file URL!\n" );
- aArgs[4].Name = ::rtl::OUString::createFromAscii( "URL" );
- aArgs[4].Value <<= aTempFileURL; // ::rtl::OUString::createFromAscii( "private:stream" );
- aArgs[5].Name = ::rtl::OUString::createFromAscii( "InputStream" );
- aArgs[5].Value <<= xTempInpStream;
+ aLoadArgs.put( "URL", aTempFileURL );
+ aLoadArgs.put( "InputStream", xTempInpStream );
}
- // aArgs[4].Name = ::rtl::OUString::createFromAscii( "AsTemplate" );
- // aArgs[4].Value <<= sal_True;
+ // aLoadArgs.put( "AsTemplate", sal_True );
- aArgs.realloc( m_aDocMediaDescriptor.getLength() + nLen );
- for ( sal_Int32 nInd = 0; nInd < m_aDocMediaDescriptor.getLength(); nInd++ )
- {
- aArgs[nInd+nLen].Name = m_aDocMediaDescriptor[nInd].Name;
- aArgs[nInd+nLen].Value = m_aDocMediaDescriptor[nInd].Value;
- }
+ aLoadArgs.merge( m_aDocMediaDescriptor, true );
try
{
// set the document mode to embedded as the first step!!!
- SetDocToEmbedded( uno::Reference < frame::XModel >( xDocument, uno::UNO_QUERY ), m_aModuleName );
+ EmbedAndReparentDoc_Impl( xDocument );
- try
- {
- uno::Reference < container::XChild > xChild( xDocument, uno::UNO_QUERY );
- if ( xChild.is() )
- xChild->setParent( m_xParent );
- }
- catch( const lang::NoSupportException & )
+ if ( xDoc.is() )
{
- OSL_ENSURE( false, "Cannot set parent at document" );
+ xDoc->loadFromStorage( xSourceStorage, aLoadArgs.getPropertyValues() );
+ if ( xSourceStorage != m_xObjectStorage )
+ SwitchDocToStorage_Impl( xDoc, m_xObjectStorage );
}
-
- if ( xDoc.is() )
- xDoc->loadFromStorage( xStorage, aArgs );
else
- xLoadable->load( aArgs );
+ xLoadable->load( aLoadArgs.getPropertyValues() );
}
catch( uno::Exception& )
{
@@ -566,6 +582,7 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadDocumentFromStorag
}
catch( uno::Exception& )
{
+ DBG_UNHANDLED_EXCEPTION();
}
}
@@ -655,7 +672,7 @@ void OCommonEmbeddedObject::SaveObject_Impl()
}
//------------------------------------------------------
-::rtl::OUString OCommonEmbeddedObject::GetBaseURL_Impl()
+::rtl::OUString OCommonEmbeddedObject::GetBaseURL_Impl() const
{
::rtl::OUString aBaseURL;
sal_Int32 nInd = 0;
@@ -727,6 +744,19 @@ void OCommonEmbeddedObject::SaveObject_Impl()
//------------------------------------------------------
+void OCommonEmbeddedObject::SwitchDocToStorage_Impl( const uno::Reference< document::XStorageBasedDocument >& xDoc, const uno::Reference< embed::XStorage >& xStorage )
+{
+ xDoc->switchToStorage( xStorage );
+
+ uno::Reference< util::XModifiable > xModif( xDoc, uno::UNO_QUERY );
+ if ( xModif.is() )
+ xModif->setModified( sal_False );
+
+ if ( m_xRecoveryStorage.is() )
+ m_xRecoveryStorage.clear();
+}
+
+//------------------------------------------------------
void OCommonEmbeddedObject::StoreDocToStorage_Impl( const uno::Reference< embed::XStorage >& xStorage,
sal_Int32 nStorageFormat,
const ::rtl::OUString& aBaseURL,
@@ -764,12 +794,7 @@ void OCommonEmbeddedObject::StoreDocToStorage_Impl( const uno::Reference< embed:
xDoc->storeToStorage( xStorage, aArgs );
if ( bAttachToTheStorage )
- {
- xDoc->switchToStorage( xStorage );
- uno::Reference< util::XModifiable > xModif( m_pDocHolder->GetComponent(), uno::UNO_QUERY );
- if ( xModif.is() )
- xModif->setModified( sal_False );
- }
+ SwitchDocToStorage_Impl( xDoc, xStorage );
}
else
#endif
@@ -801,7 +826,7 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::CreateDocFromMediaDesc
const uno::Sequence< beans::PropertyValue >& aMedDescr )
{
uno::Reference< util::XCloseable > xDocument( CreateDocument( m_xFactory, GetDocumentServiceName(),
- m_bEmbeddedScriptSupport ) );
+ m_bEmbeddedScriptSupport, m_bDocumentRecoverySupport ) );
uno::Reference< frame::XLoadable > xLoadable( xDocument, uno::UNO_QUERY );
if ( !xLoadable.is() )
@@ -810,18 +835,7 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::CreateDocFromMediaDesc
try
{
// set the document mode to embedded as the first action on the document!!!
- SetDocToEmbedded( uno::Reference < frame::XModel >( xDocument, uno::UNO_QUERY ), m_aModuleName );
-
- try
- {
- uno::Reference < container::XChild > xChild( xDocument, uno::UNO_QUERY );
- if ( xChild.is() )
- xChild->setParent( m_xParent );
- }
- catch( const lang::NoSupportException & )
- {
- OSL_ENSURE( false, "Cannot set parent at document" );
- }
+ EmbedAndReparentDoc_Impl( xDocument );
xLoadable->load( addAsTemplate( aMedDescr ) );
}
@@ -1060,6 +1074,14 @@ void SAL_CALL OCommonEmbeddedObject::setPersistentEntry(
{
OSL_VERIFY( lObjArgs[nObjInd].Value >>= m_bEmbeddedScriptSupport );
}
+ else if ( lObjArgs[nObjInd].Name.equalsAscii( "DocumentRecoverySupport" ) )
+ {
+ OSL_VERIFY( lObjArgs[nObjInd].Value >>= m_bDocumentRecoverySupport );
+ }
+ else if ( lObjArgs[nObjInd].Name.equalsAscii( "RecoveryStorage" ) )
+ {
+ OSL_VERIFY( lObjArgs[nObjInd].Value >>= m_xRecoveryStorage );
+ }
sal_Int32 nStorageMode = m_bReadOnly ? embed::ElementModes::READ : embed::ElementModes::READWRITE;
@@ -1095,6 +1117,9 @@ void SAL_CALL OCommonEmbeddedObject::setPersistentEntry(
}
else if ( nEntryConnectionMode == embed::EntryInitModes::TRUNCATE_INIT )
{
+ if ( m_xRecoveryStorage.is() )
+ TransferMediaType( m_xRecoveryStorage, m_xObjectStorage );
+
// TODO:
m_pDocHolder->SetComponent( InitNewDocument_Impl(), m_bReadOnly );
diff --git a/embeddedobj/source/inc/commonembobj.hxx b/embeddedobj/source/inc/commonembobj.hxx
index 80936d3b1b..1ccf79c660 100644
--- a/embeddedobj/source/inc/commonembobj.hxx
+++ b/embeddedobj/source/inc/commonembobj.hxx
@@ -32,6 +32,7 @@
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/container/XChild.hpp>
+#include <com/sun/star/document/XStorageBasedDocument.hpp>
#include <com/sun/star/embed/XEmbeddedObject.hpp>
#include <com/sun/star/embed/XVisualObject.hpp>
#include <com/sun/star/embed/XEmbedPersist.hpp>
@@ -71,6 +72,10 @@ namespace cppu {
class OMultiTypeInterfaceContainerHelper;
}
+namespace comphelper {
+ class NamedValueCollection;
+}
+
#define NUM_SUPPORTED_STATES 5
// #define NUM_SUPPORTED_VERBS 5
@@ -126,6 +131,7 @@ protected:
::rtl::OUString m_aDefaultParentBaseURL;
::rtl::OUString m_aModuleName;
sal_Bool m_bEmbeddedScriptSupport;
+ sal_Bool m_bDocumentRecoverySupport;
Interceptor* m_pInterceptor;
@@ -146,6 +152,7 @@ protected:
::rtl::OUString m_aEntryName;
::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xParentStorage;
::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xObjectStorage;
+ ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xRecoveryStorage;
// link related stuff
::rtl::OUString m_aLinkURL;
@@ -177,8 +184,8 @@ private:
const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xNewParentStorage,
const ::rtl::OUString& aNewName );
- ::rtl::OUString GetDocumentServiceName() { return m_aDocServiceName; }
- ::rtl::OUString GetPresetFilterName() { return m_aPresetFilterName; }
+ ::rtl::OUString GetDocumentServiceName() const { return m_aDocServiceName; }
+ ::rtl::OUString GetPresetFilterName() const { return m_aPresetFilterName; }
::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
StoreDocumentToTempStream_Impl( sal_Int32 nStorageFormat,
@@ -195,9 +202,8 @@ private:
::com::sun::star::uno::Sequence< sal_Int32 > GetIntermediateStatesSequence_Impl( sal_Int32 nNewState );
- ::rtl::OUString GetFilterName( sal_Int32 nVersion );
- ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > LoadDocumentFromStorage_Impl(
- const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage );
+ ::rtl::OUString GetFilterName( sal_Int32 nVersion ) const;
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > LoadDocumentFromStorage_Impl();
::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > LoadLink_Impl();
@@ -209,12 +215,25 @@ private:
const ::rtl::OUString& aHierarchName,
sal_Bool bAttachToStorage );
+ void SwitchDocToStorage_Impl(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::document::XStorageBasedDocument >& xDoc,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage );
+
+ void FillDefaultLoadArgs_Impl(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& i_rxStorage,
+ ::comphelper::NamedValueCollection& o_rLoadArgs
+ ) const;
+
+ void EmbedAndReparentDoc_Impl(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable >& i_rxDocument
+ ) const;
+
::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > CreateDocFromMediaDescr_Impl(
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aMedDescr );
::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > CreateTempDocFromLink_Impl();
- ::rtl::OUString GetBaseURL_Impl();
+ ::rtl::OUString GetBaseURL_Impl() const;
::rtl::OUString GetBaseURLFrom_Impl(
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments,
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs );
diff --git a/eventattacher/source/exports.map b/eventattacher/source/exports.map
deleted file mode 100644
index ba501f9ae0..0000000000
--- a/eventattacher/source/exports.map
+++ /dev/null
@@ -1,10 +0,0 @@
-UDK_3_0_0 {
- global:
- GetVersionInfo;
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/eventattacher/source/makefile.mk b/eventattacher/source/makefile.mk
index ddab6f7ea3..632a1fa41a 100644
--- a/eventattacher/source/makefile.mk
+++ b/eventattacher/source/makefile.mk
@@ -44,7 +44,7 @@ SLOFILES= \
SHL1TARGET= $(TARGET)
SHL1IMPLIB= i$(TARGET)
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
diff --git a/fileaccess/source/exports.map b/fileaccess/source/exports.map
deleted file mode 100644
index 2dd01358d4..0000000000
--- a/fileaccess/source/exports.map
+++ /dev/null
@@ -1,10 +0,0 @@
-OOO_1.1 {
- global:
- GetVersionInfo;
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/fileaccess/source/makefile.mk b/fileaccess/source/makefile.mk
index 7bd6266f7d..2b78265346 100644
--- a/fileaccess/source/makefile.mk
+++ b/fileaccess/source/makefile.mk
@@ -46,7 +46,7 @@ SLOFILES= \
SHL1TARGET= $(TARGET)
SHL1IMPLIB= i$(TARGET)
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
diff --git a/formula/inc/formula/errorcodes.hxx b/formula/inc/formula/errorcodes.hxx
index d99971788b..f9b04e012f 100644
--- a/formula/inc/formula/errorcodes.hxx
+++ b/formula/inc/formula/errorcodes.hxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -83,9 +83,13 @@ const USHORT NOTAVAILABLE = 0x7fff;
represent an interpreter error code. */
inline double CreateDoubleError( USHORT nErr )
{
- double fVal;
+ union
+ {
+ double fVal;
+ sal_math_Double smVal;
+ };
::rtl::math::setNan( &fVal );
- reinterpret_cast< sal_math_Double * >(&fVal)->nan_parts.fraction_lo = nErr;
+ smVal.nan_parts.fraction_lo = nErr;
return fVal;
}
diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx
index a4784add7d..caa22cd3c0 100644
--- a/formula/source/ui/dlg/formula.cxx
+++ b/formula/source/ui/dlg/formula.cxx
@@ -32,7 +32,6 @@
#include <sfx2/dispatch.hxx>
#include <sfx2/docfile.hxx>
#include <sfx2/viewfrm.hxx>
-#include <sfx2/topfrm.hxx>
#include <vcl/svapp.hxx>
#include <vcl/mnemonic.hxx>
#include <vcl/tabpage.hxx>
diff --git a/formula/util/for.map b/formula/util/for.map
deleted file mode 100644
index b34eff63c4..0000000000
--- a/formula/util/for.map
+++ /dev/null
@@ -1,8 +0,0 @@
-UDK_3_0_0 {
- global:
- component_getFactory;
- component_getImplementationEnvironment;
- component_writeInfo;
- local:
- *;
-};
diff --git a/formula/util/forui.map b/formula/util/forui.map
deleted file mode 100644
index b34eff63c4..0000000000
--- a/formula/util/forui.map
+++ /dev/null
@@ -1,8 +0,0 @@
-UDK_3_0_0 {
- global:
- component_getFactory;
- component_getImplementationEnvironment;
- component_writeInfo;
- local:
- *;
-};
diff --git a/formula/util/makefile.mk b/formula/util/makefile.mk
index 3e8f2301b2..7ae30b007d 100644
--- a/formula/util/makefile.mk
+++ b/formula/util/makefile.mk
@@ -120,7 +120,6 @@ DEFLIB2NAME=$(TARGET2)
.ENDIF
SHL2USE_EXPORTS=name
-# SHL2VERSIONMAP=$(TARGET2).map
# --- .res file ----------------------------------------------------------
diff --git a/fpicker/source/aqua/FilterHelper.cxx b/fpicker/source/aqua/FilterHelper.cxx
index b360260295..e2b4eaca35 100644
--- a/fpicker/source/aqua/FilterHelper.cxx
+++ b/fpicker/source/aqua/FilterHelper.cxx
@@ -391,30 +391,25 @@ sal_Bool FilterHelper::filenameMatchesFilter(NSString* sFilename)
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__);
-// OSL_TRACE("filter event handler called");
-
if (m_aCurrentFilter == NULL) {
OSL_TRACE("filter name is null");
return sal_True;
}
NSFileManager *manager = [NSFileManager defaultManager];
- MacOSBOOL bDir = NO;
- if ([manager fileExistsAtPath:sFilename isDirectory:&bDir] && bDir == YES) {
-// OSL_TRACE(" folder");
- return sal_True;
- }
-
- NSFileWrapper *wrapper = [[NSFileWrapper alloc] initWithPath:sFilename];
- MacOSBOOL bIsLink = [wrapper isSymbolicLink];
- [wrapper release];
- if (bIsLink) {
-// OSL_TRACE(" symboliclink");
- return sal_True;
+ NSDictionary* pAttribs = [manager fileAttributesAtPath: sFilename traverseLink: NO];
+ if( pAttribs )
+ {
+ NSObject* pType = [pAttribs objectForKey: NSFileType];
+ if( pType && [pType isKindOfClass: [NSString class]] )
+ {
+ NSString* pT = (NSString*)pType;
+ if( [pT isEqualToString: NSFileTypeDirectory] ||
+ [pT isEqualToString: NSFileTypeSymbolicLink] )
+ return sal_True;
+ }
}
-// OSL_TRACE(" file");
-
FilterList::iterator filter = ::std::find_if(m_pFilterList->begin(), m_pFilterList->end(), FilterTitleMatch(m_aCurrentFilter));
if (filter == m_pFilterList->end()) {
OSL_TRACE("filter not found in list");
@@ -424,7 +419,6 @@ sal_Bool FilterHelper::filenameMatchesFilter(NSString* sFilename)
OUStringList suffixList = filter->getFilterSuffixList();
{
-// OSL_TRACE(" starting to work");
rtl::OUString aName = [sFilename OUString];
rtl::OUString allMatcher = rtl::OUString::createFromAscii(".*");
for(OUStringList::iterator iter = suffixList.begin(); iter != suffixList.end(); iter++) {
diff --git a/fpicker/source/aqua/exports.map b/fpicker/source/aqua/exports.map
deleted file mode 100644
index f4ed78b9e9..0000000000
--- a/fpicker/source/aqua/exports.map
+++ /dev/null
@@ -1,8 +0,0 @@
-UDK_3_0_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/fpicker/source/aqua/makefile.mk b/fpicker/source/aqua/makefile.mk
index f79d2a0189..10990e22d5 100644
--- a/fpicker/source/aqua/makefile.mk
+++ b/fpicker/source/aqua/makefile.mk
@@ -74,7 +74,7 @@ SHL1STDLIBS=\
$(CPPULIB) \
$(SALLIB)
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1DEF= $(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
diff --git a/fpicker/source/generic/exports.map b/fpicker/source/generic/exports.map
deleted file mode 100644
index f4ed78b9e9..0000000000
--- a/fpicker/source/generic/exports.map
+++ /dev/null
@@ -1,8 +0,0 @@
-UDK_3_0_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/fpicker/source/generic/makefile.mk b/fpicker/source/generic/makefile.mk
index f5d624f8e4..bfbfb65f3d 100644
--- a/fpicker/source/generic/makefile.mk
+++ b/fpicker/source/generic/makefile.mk
@@ -53,7 +53,7 @@ SHL1STDLIBS=\
$(CPPULIB) \
$(SALLIB)
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1DEF= $(MISC)$/$(SHL1TARGET).def
DEF1NAME= $(SHL1TARGET)
diff --git a/fpicker/source/office/OfficeFilePicker.cxx b/fpicker/source/office/OfficeFilePicker.cxx
index 387988e571..980a197703 100644
--- a/fpicker/source/office/OfficeFilePicker.cxx
+++ b/fpicker/source/office/OfficeFilePicker.cxx
@@ -981,8 +981,9 @@ void SAL_CALL SvtFilePicker::appendFilterGroup( const ::rtl::OUString& sGroupTit
// check the names
if ( FilterNameExists( aFilters ) )
- // TODO: a more precise exception message
- throw IllegalArgumentException();
+ throw IllegalArgumentException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("filter name exists")),
+ static_cast< OWeakObject * >(this), 1);
// ensure that we have a filter list
::rtl::OUString sInitialCurrentFilter;
diff --git a/fpicker/source/office/exports.map b/fpicker/source/office/exports.map
deleted file mode 100644
index f4ed78b9e9..0000000000
--- a/fpicker/source/office/exports.map
+++ /dev/null
@@ -1,8 +0,0 @@
-UDK_3_0_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/fpicker/source/office/makefile.mk b/fpicker/source/office/makefile.mk
index c687d8cb33..adc3c30f9a 100644
--- a/fpicker/source/office/makefile.mk
+++ b/fpicker/source/office/makefile.mk
@@ -69,7 +69,7 @@ SHL1STDLIBS=\
$(CPPULIB) \
$(SALLIB)
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1DEF= $(MISC)$/$(SHL1TARGET).def
DEF1NAME= $(SHL1TARGET)
diff --git a/fpicker/source/unx/gnome/exports.map b/fpicker/source/unx/gnome/exports.map
deleted file mode 100644
index f4ed78b9e9..0000000000
--- a/fpicker/source/unx/gnome/exports.map
+++ /dev/null
@@ -1,8 +0,0 @@
-UDK_3_0_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/fpicker/source/unx/gnome/makefile.mk b/fpicker/source/unx/gnome/makefile.mk
index aa1fbc54b7..04c6e650ff 100644
--- a/fpicker/source/unx/gnome/makefile.mk
+++ b/fpicker/source/unx/gnome/makefile.mk
@@ -87,7 +87,7 @@ SHL1STDLIBS=\
LINKFLAGSDEFS=
.ENDIF # "$(OS)"=="SOLARIS"
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
DEF1NAME=$(SHL1TARGET)
.ENDIF # GTK_TWO_FOUR
diff --git a/fpicker/source/unx/kde4/KDE4FilePicker.cxx b/fpicker/source/unx/kde4/KDE4FilePicker.cxx
index 0c0fb21372..c9dfddb1b7 100644
--- a/fpicker/source/unx/kde4/KDE4FilePicker.cxx
+++ b/fpicker/source/unx/kde4/KDE4FilePicker.cxx
@@ -139,8 +139,6 @@ KDE4FilePicker::KDE4FilePicker( const uno::Reference<lang::XMultiServiceFactory>
//default mode
_dialog->setOperationMode(KFileDialog::Opening);
-
- _dialog->setStyleSheet("color: black;");
}
KDE4FilePicker::~KDE4FilePicker()
@@ -185,6 +183,7 @@ sal_Int16 SAL_CALL KDE4FilePicker::execute()
_dialog->clearFilter();
_dialog->setFilter(_filter);
+ _dialog->filterWidget()->setEditable(false);
//block and wait for user input
if (_dialog->exec() == KFileDialog::Accepted)
@@ -236,7 +235,7 @@ uno::Sequence< ::rtl::OUString > SAL_CALL KDE4FilePicker::getFiles()
QCheckBox *cb = dynamic_cast<QCheckBox*> (
_customWidgets[ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION ]);
- if (cb->isChecked())
+ if (cb && cb->isChecked())
{
extension = _dialog->currentFilter(); // assuming filter value is like this *.ext
extension.replace("*","");
@@ -631,13 +630,13 @@ void SAL_CALL KDE4FilePicker::initialize( const uno::Sequence<uno::Any> &args )
case FILESAVE_AUTOEXTENSION:
operationMode = KFileDialog::Saving;
- addCustomControl( ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION );
+ //addCustomControl( ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION );
break;
case FILESAVE_AUTOEXTENSION_PASSWORD:
{
operationMode = KFileDialog::Saving;
- addCustomControl( ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION );
+ //addCustomControl( ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION );
addCustomControl( ExtendedFilePickerElementIds::CHECKBOX_PASSWORD );
break;
}
@@ -688,6 +687,7 @@ void SAL_CALL KDE4FilePicker::initialize( const uno::Sequence<uno::Any> &args )
}
_dialog->setOperationMode(operationMode);
+ _dialog->setConfirmOverwrite(true);
}
void SAL_CALL KDE4FilePicker::cancel()
diff --git a/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx b/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx
index 28d894799a..83cc631a7c 100644
--- a/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx
+++ b/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx
@@ -125,14 +125,14 @@ STDMETHODIMP VistaFilePickerEventHandler::OnFileOk(IFileDialog* /*pDialog*/)
}
//-----------------------------------------------------------------------------------------
-STDMETHODIMP VistaFilePickerEventHandler::OnFolderChanging(IFileDialog* pDialog,
- IShellItem* pFolder)
+STDMETHODIMP VistaFilePickerEventHandler::OnFolderChanging(IFileDialog* /*pDialog*/,
+ IShellItem* /*pFolder*/)
{
return E_NOTIMPL;
}
//-----------------------------------------------------------------------------------------
-STDMETHODIMP VistaFilePickerEventHandler::OnFolderChange(IFileDialog* pDialog)
+STDMETHODIMP VistaFilePickerEventHandler::OnFolderChange(IFileDialog* /*pDialog*/)
{
impl_sendEvent(E_DIRECTORY_CHANGED, 0);
return S_OK;
@@ -250,7 +250,7 @@ void lcl_updateVersionListDirectly(IFileDialog* pDialog)
}
//-----------------------------------------------------------------------------------------
-STDMETHODIMP VistaFilePickerEventHandler::OnSelectionChange(IFileDialog* pDialog)
+STDMETHODIMP VistaFilePickerEventHandler::OnSelectionChange(IFileDialog* /*pDialog*/)
{
impl_sendEvent(E_FILE_SELECTION_CHANGED, 0);
//lcl_updateVersionListDirectly(pDialog);
@@ -258,16 +258,16 @@ STDMETHODIMP VistaFilePickerEventHandler::OnSelectionChange(IFileDialog* pDialog
}
//-----------------------------------------------------------------------------------------
-STDMETHODIMP VistaFilePickerEventHandler::OnShareViolation(IFileDialog* pDialog ,
- IShellItem* pItem ,
- FDE_SHAREVIOLATION_RESPONSE* pResponse)
+STDMETHODIMP VistaFilePickerEventHandler::OnShareViolation(IFileDialog* /*pDialog*/ ,
+ IShellItem* /*pItem*/ ,
+ FDE_SHAREVIOLATION_RESPONSE* /*pResponse*/)
{
impl_sendEvent(E_CONTROL_STATE_CHANGED, css::ui::dialogs::CommonFilePickerElementIds::LISTBOX_FILTER);
return S_OK;
}
//-----------------------------------------------------------------------------------------
-STDMETHODIMP VistaFilePickerEventHandler::OnTypeChange(IFileDialog* pDialog)
+STDMETHODIMP VistaFilePickerEventHandler::OnTypeChange(IFileDialog* /*pDialog*/)
{
/*
IFileDialogCustomize *iCustomize;
@@ -299,32 +299,32 @@ STDMETHODIMP VistaFilePickerEventHandler::OnTypeChange(IFileDialog* pDialog)
}
//-----------------------------------------------------------------------------------------
-STDMETHODIMP VistaFilePickerEventHandler::OnOverwrite(IFileDialog* pDialog ,
- IShellItem* pItem ,
- FDE_OVERWRITE_RESPONSE* pResponse)
+STDMETHODIMP VistaFilePickerEventHandler::OnOverwrite(IFileDialog* /*pDialog*/ ,
+ IShellItem* /*pItem*/ ,
+ FDE_OVERWRITE_RESPONSE* /*pResponse*/)
{
return E_NOTIMPL;
}
//-----------------------------------------------------------------------------------------
-STDMETHODIMP VistaFilePickerEventHandler::OnItemSelected(IFileDialogCustomize* pCustomize,
+STDMETHODIMP VistaFilePickerEventHandler::OnItemSelected(IFileDialogCustomize* /*pCustomize*/,
DWORD nIDCtl ,
- DWORD nIDItem )
+ DWORD /*nIDItem*/ )
{
- impl_sendEvent(E_CONTROL_STATE_CHANGED, nIDCtl);
+ impl_sendEvent(E_CONTROL_STATE_CHANGED, static_cast<sal_Int16>( nIDCtl ));
return S_OK;
}
//-----------------------------------------------------------------------------------------
-STDMETHODIMP VistaFilePickerEventHandler::OnButtonClicked(IFileDialogCustomize* pCustomize,
+STDMETHODIMP VistaFilePickerEventHandler::OnButtonClicked(IFileDialogCustomize* /*pCustomize*/,
DWORD nIDCtl )
{
- impl_sendEvent(E_CONTROL_STATE_CHANGED, nIDCtl);
+ impl_sendEvent(E_CONTROL_STATE_CHANGED, static_cast<sal_Int16>( nIDCtl));
return S_OK;
}
//-----------------------------------------------------------------------------------------
-STDMETHODIMP VistaFilePickerEventHandler::OnCheckButtonToggled(IFileDialogCustomize* pCustomize,
+STDMETHODIMP VistaFilePickerEventHandler::OnCheckButtonToggled(IFileDialogCustomize* /*pCustomize*/,
DWORD nIDCtl ,
BOOL bChecked )
{
@@ -353,15 +353,15 @@ STDMETHODIMP VistaFilePickerEventHandler::OnCheckButtonToggled(IFileDialogCustom
if (nIDCtl == css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION)
m_pInternalNotify->onAutoExtensionChanged(bChecked);
- impl_sendEvent(E_CONTROL_STATE_CHANGED, nIDCtl);
+ impl_sendEvent(E_CONTROL_STATE_CHANGED, static_cast<sal_Int16>( nIDCtl));
return S_OK;
}
//-----------------------------------------------------------------------------------------
-STDMETHODIMP VistaFilePickerEventHandler::OnControlActivating(IFileDialogCustomize* pCustomize,
+STDMETHODIMP VistaFilePickerEventHandler::OnControlActivating(IFileDialogCustomize* /*pCustomize*/,
DWORD nIDCtl )
{
- impl_sendEvent(E_CONTROL_STATE_CHANGED, nIDCtl);
+ impl_sendEvent(E_CONTROL_STATE_CHANGED, static_cast<sal_Int16>( nIDCtl));
return S_OK;
}
diff --git a/fpicker/source/win32/filepicker/makefile.mk b/fpicker/source/win32/filepicker/makefile.mk
index feea7ee803..17e4f26090 100644
--- a/fpicker/source/win32/filepicker/makefile.mk
+++ b/fpicker/source/win32/filepicker/makefile.mk
@@ -43,6 +43,7 @@ CDEFS+=-D_UNICODE
CDEFS+=-DUNICODE
#CDEFS+=-DWIN32_LEAN_AND_MEAN
#CDEFS+=-DWIN32
+CDEFS+=-U_WIN32_WINNT -D_WIN32_WINNT=0x0600
# --- Resources ----------------------------------------------------
diff --git a/framework/inc/classes/checkediterator.hxx b/framework/inc/classes/checkediterator.hxx
index 3aa9036db9..a5b5bda118 100644
--- a/framework/inc/classes/checkediterator.hxx
+++ b/framework/inc/classes/checkediterator.hxx
@@ -138,7 +138,7 @@ class CheckedIterator
if( m_eEndState == E_UNKNOWN )
{
- // Set new container and actualize other member.
+ // Set new container and update other member.
m_pContainer = &rContainer ;
m_eEndState = E_BEFOREEND ;
m_pPosition = m_pContainer->begin();
diff --git a/framework/inc/framework.hrc b/framework/inc/framework.hrc
index 5d52eed36b..bea7dede55 100644
--- a/framework/inc/framework.hrc
+++ b/framework/inc/framework.hrc
@@ -59,14 +59,11 @@
#define BMP_BACKING_FORMULA 11
#define BMP_BACKING_OPENFILE 12
#define BMP_BACKING_OPENTEMPLATE 13
-#define BMP_BACKING_EXT 14
#define STR_BACKING_EXTHELP 15
-#define BMP_BACKING_REG 16
#define STR_BACKING_REGHELP 17
-#define BMP_BACKING_INFO 18
#define STR_BACKING_INFOHELP 19
-#define BMP_BACKING_TPLREP 20
#define STR_BACKING_TPLREP 21
+#define BMP_BACKING_FOLDER 22
#define RES_BACKING_IMAGES (DLG_BACKING+1)
#define RES_BACKING_IMAGES_HC (DLG_BACKING+2)
@@ -76,6 +73,10 @@
#define BMP_BACKING_BACKGROUND_RIGHT 3
#define BMP_BACKING_BACKGROUND_RTL_LEFT 4
#define BMP_BACKING_BACKGROUND_RTL_RIGHT 5
+#define BMP_BACKING_EXT 6
+#define BMP_BACKING_REG 7
+#define BMP_BACKING_INFO 8
+#define BMP_BACKING_TPLREP 9
// Ids of TabWindow
#define WIN_TABWINDOW (RID_FWK_DIALOG_START+101)
diff --git a/framework/inc/interaction/preventduplicateinteraction.hxx b/framework/inc/interaction/preventduplicateinteraction.hxx
index 563e201da0..8ddb09e45a 100644
--- a/framework/inc/interaction/preventduplicateinteraction.hxx
+++ b/framework/inc/interaction/preventduplicateinteraction.hxx
@@ -37,7 +37,7 @@
//_________________________________________________________________________________________________________________
// interface includes
//_________________________________________________________________________________________________________________
-#include <com/sun/star/task/XInteractionHandler.hpp>
+#include <com/sun/star/task/XInteractionHandler2.hpp>
#include <com/sun/star/task/XInteractionRequest.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -83,7 +83,7 @@ struct ThreadHelpBase2
};
class PreventDuplicateInteraction : private ThreadHelpBase2
- ,public ::cppu::WeakImplHelper1< css::task::XInteractionHandler >
+ ,public ::cppu::WeakImplHelper1< css::task::XInteractionHandler2 >
{
//_____________________________________
// structs, types etcp.
@@ -155,6 +155,30 @@ class PreventDuplicateInteraction : private ThreadHelpBase2
virtual void SAL_CALL handle(const css::uno::Reference< css::task::XInteractionRequest >& xRequest)
throw(css::uno::RuntimeException);
+ //_________________________________
+ /**
+ @interface XInteractionHandler2
+ @short called from outside to handle a problem
+ @descr We filter the incoming interactions. some of them
+ will be forwarded to the generic UI interaction handler.
+ So we must not implement it twice. Some other ones
+ will be aborted only.
+
+ @threadsafe yes
+ */
+ virtual ::sal_Bool SAL_CALL handleInteractionRequest( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionRequest >& xRequest )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ //_________________________________
+ /**
+ @interface XInterface
+ @short called to query another interface of the component
+ @descr Will allow to query for XInteractionHandler2 if and only if m_xHandler supports this interface, too.
+
+ @threadsafe yes
+ */
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType )
+ throw (::com::sun::star::uno::RuntimeException);
//_____________________________________
// c++ interface
public:
diff --git a/framework/inc/jobs/jobdata.hxx b/framework/inc/jobs/jobdata.hxx
index c85061afbb..95233ef1eb 100644
--- a/framework/inc/jobs/jobdata.hxx
+++ b/framework/inc/jobs/jobdata.hxx
@@ -230,7 +230,7 @@ class JobData : private ThreadHelpBase
after a job was sucessfully executed (by any outside code using our
informations) it can return a result. This member make it part of this
container too. So it can be used for further things.
- We use it also to actualize our internal state and the configuration
+ We use it also to update our internal state and the configuration
of the job. But note: only the last result will be saved here!
*/
JobResult m_aLastExecutionResult;
diff --git a/framework/inc/services/autorecovery.hxx b/framework/inc/services/autorecovery.hxx
index fe33cb3fa3..e4fb18c648 100644
--- a/framework/inc/services/autorecovery.hxx
+++ b/framework/inc/services/autorecovery.hxx
@@ -167,12 +167,6 @@ class AutoRecovery : public css::lang::XTypeProvider
E_UNKNOWN = 0,
/// modified against the original file
E_MODIFIED = 1,
- /** We differe between the states: "modified in general" and "modified after last AutoSave".
- The first state will be interesting in case the crashed document will be restored. Then we have
- set the right modify state after loading the document. But the second state let us optimize the
- AutoSave itself. see member ListenForModify too ...
- */
- E_MODIFIED_SINCE_LAST_AUTOSAVE = 1024,
/// an active document can be postponed to be saved later.
E_POSTPONED = 2,
/// was already handled during one AutoSave/Recovery session.
@@ -306,10 +300,13 @@ class AutoRecovery : public css::lang::XTypeProvider
::rtl::OUString NewTempURL;
::rtl::OUString AppModule; // e.g. com.sun.star.text.TextDocument - used to identify app module
+ ::rtl::OUString FactoryService; // the service to create a document of the module
::rtl::OUString RealFilter; // real filter, which was used at loading time
::rtl::OUString DefaultFilter; // supports saving of the default format without loosing data
::rtl::OUString Extension; // file extension of the default filter
::rtl::OUString Title; // can be used as "DisplayName" on every recovery UI!
+ ::com::sun::star::uno::Sequence< ::rtl::OUString >
+ ViewNames; // names of the view which were active at emergency-save time
sal_Int32 ID;
};
@@ -605,7 +602,7 @@ class AutoRecovery : public css::lang::XTypeProvider
@threadsafe
*/
- void implts_actualizeTimer();
+ void implts_updateTimer();
//---------------------------------------
/** @short stop the timer.
@@ -673,7 +670,7 @@ class AutoRecovery : public css::lang::XTypeProvider
//---------------------------------------
// TODO document me
- void implts_actualizeModifiedState(const css::uno::Reference< css::frame::XModel >& xDocument);
+ void implts_updateModifiedState(const css::uno::Reference< css::frame::XModel >& xDocument);
//---------------------------------------
// TODO document me
@@ -862,7 +859,17 @@ class AutoRecovery : public css::lang::XTypeProvider
//---------------------------------------
// TODO document me
- void implts_specifyAppModuleAndFactoryURL(AutoRecovery::TDocumentInfo& rInfo);
+ void implts_specifyAppModuleAndFactory(AutoRecovery::TDocumentInfo& rInfo);
+
+ /** retrieves the names of all active views of the given document
+ @param rInfo
+ the document info, whose <code>Document</code> member must not be <NULL/>.
+ */
+ void implts_collectActiveViewNames( AutoRecovery::TDocumentInfo& rInfo );
+
+ /** updates the configuration so that for all documents, their current view/names are stored
+ */
+ void implts_persistAllActiveViewNames();
//---------------------------------------
// TODO document me
diff --git a/framework/prj/build.lst b/framework/prj/build.lst
index b9814037e7..5c745e0907 100644
--- a/framework/prj/build.lst
+++ b/framework/prj/build.lst
@@ -20,4 +20,4 @@ fr framework\source\uiconfiguration nmake - all fr_uiconfiguration f
fr framework\source\accelerators nmake - all fr_accelerators fr_threadhelp fr_inc NULL
fr framework\source\tabwin nmake - all fr_tabwin fr_threadhelp fr_inc NULL
fr framework\util nmake - all fr_util fr_constant fr_threadhelp fr_classes fr_loadenv fr_jobs fr_interaction fr_helper fr_dispatch fr_services fr_register fr_recording fr_layoutmanager fr_uielement fr_uifactory fr_xml fr_uiconfiguration fr_accelerators fr_tabwin NULL
-
+fr framework\qa\unoapi nmake - all fr_qa_unoapi NULL
diff --git a/framework/qa/unoapi/Test.java b/framework/qa/unoapi/Test.java
new file mode 100644
index 0000000000..da9bb3bd50
--- /dev/null
+++ b/framework/qa/unoapi/Test.java
@@ -0,0 +1,51 @@
+/*************************************************************************
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+************************************************************************/
+
+package org.openoffice.framework.qa.unoapi;
+
+import org.openoffice.Runner;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
+
+public final class Test {
+ @org.junit.Before public void setUp() throws Exception {
+ connection.setUp();
+ }
+
+ @org.junit.After public void tearDown()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ connection.tearDown();
+ }
+
+ @org.junit.Test public void test() {
+ assertTrue(
+ Runner.run(
+ "-sce", "framework.sce", "-xcl", "knownissues.xcl", "-tdoc",
+ "testdocuments", "-cs", connection.getDescription()));
+ }
+
+ private final OfficeConnection connection = new OfficeConnection();
+}
diff --git a/framework/qa/unoapi/makefile.mk b/framework/qa/unoapi/makefile.mk
index 0be0e52a17..38a6cf7cce 100755
--- a/framework/qa/unoapi/makefile.mk
+++ b/framework/qa/unoapi/makefile.mk
@@ -1,7 +1,6 @@
#*************************************************************************
-#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -22,22 +21,28 @@
# version 3 along with OpenOffice.org. If not, see
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
+#***********************************************************************/
-PRJ=..$/..
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
-PRJNAME=framework
-TARGET=qa_unoapi
+PRJ = ../..
+PRJNAME = framework
+TARGET = qa_unoapi
-.INCLUDE: settings.mk
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = org/openoffice/framework/qa/unoapi
+JAVATESTFILES = Test.java
+JAVAFILES = $(JAVATESTFILES)
+JARFILES = OOoRunner.jar ridl.jar test.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+.END
+.INCLUDE: settings.mk
.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
-ALLTAR : UNOAPI_TEST
+ALLTAR : javatest
-UNOAPI_TEST:
- +$(SOLARENV)$/bin$/checkapi -sce framework.sce -xcl knownissues.xcl -tdoc $(PWD)$/testdocuments -THRCNT 1 -AutoRestart true
- @echo =======================================================================
- @echo In case you noticed a failures of fwk.JobExecutor or fwk.JobHandler make sure that you registered $(SOLARSRC)$/qadevOOo$/testdocs$/qadevlibs$/JobExecutor.jar
- @echo =======================================================================
+.END
diff --git a/framework/source/classes/addonmenu.cxx b/framework/source/classes/addonmenu.cxx
index c7c9b56138..7105da2d68 100644
--- a/framework/source/classes/addonmenu.cxx
+++ b/framework/source/classes/addonmenu.cxx
@@ -52,7 +52,7 @@
#include <tools/config.hxx>
#include <vcl/svapp.hxx>
#include <svtools/menuoptions.hxx>
-
+#include <svl/solar.hrc>
//_________________________________________________________________________________________________________________
// namespace
//_________________________________________________________________________________________________________________
@@ -64,7 +64,6 @@ using namespace ::com::sun::star::beans;
// Please look at sfx2/inc/sfxsids.hrc the values are defined there. Due to build dependencies
// we cannot include the header file.
-const USHORT SID_SFX_START = 5000;
const USHORT SID_HELPMENU = (SID_SFX_START + 410);
const USHORT SID_ONLINE_REGISTRATION = (SID_SFX_START + 1537);
diff --git a/framework/source/classes/resource.src b/framework/source/classes/resource.src
index d9c9c558ad..c8114e7129 100644
--- a/framework/source/classes/resource.src
+++ b/framework/source/classes/resource.src
@@ -124,7 +124,7 @@ String STR_TOOLBAR_TITLE_ADDON
String STR_STATUSBAR_LOGOTEXT
{
- Text [ en-US ] = "A %PRODUCTNAME product by Sun Microsystems, Inc.";
+ Text [ en-US ] = "A %PRODUCTNAME product by Oracle";
};
// ***********************************************************************
diff --git a/framework/source/inc/loadenv/loaddispatchlistener.hxx b/framework/source/inc/loadenv/loaddispatchlistener.hxx
deleted file mode 100644
index f148de9ba1..0000000000
--- a/framework/source/inc/loadenv/loaddispatchlistener.hxx
+++ /dev/null
@@ -1,165 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef __FRAMEWORK_LOADENV_LOADDISPATCHLISTENER_HXX_
-#define __FRAMEWORK_LOADENV_LOADDISPATCHLISTENER_HXX_
-
-//_______________________________________________
-// includes of own project
-
-#include <threadhelp/threadhelpbase.hxx>
-#include <threadhelp/gate.hxx>
-#include <macros/xinterface.hxx>
-
-//_______________________________________________
-// includes of uno interface
-#include <com/sun/star/frame/XDispatchResultListener.hpp>
-
-/*
-#include <com/sun/star/frame/DispatchResultEvent.hpp>
-*/
-
-//_______________________________________________
-// includes of an other project
-
-#ifndef _OSL_CONDITN_HXX_
-#include <osl/condition.hxx>
-#endif
-#include <cppuhelper/weak.hxx>
-
-//_______________________________________________
-// namespace
-
-namespace framework{
-
-namespace css = ::com::sun::star;
-
-//_______________________________________________
-// definitions
-
-/** @short listen for finished dispatches, where document will be loaded.
-
- @descr This listener can be bound to an URL - so its well known
- for which load request this event was triggered.
- Thats needed - but not supported by the XDispatchResultListener
- notification.
- Further a condition can be used to synchronize any outside code
- against the occurence of this event.
-
- @author as96863
- */
-class LoadDispatchListener : public css::frame::XDispatchResultListener // => css.lang.XEventListener
- , private ThreadHelpBase
- , public ::cppu::OWeakObject
-{
- //___________________________________________
- // member
-
- private:
-
- /** @short the URL which is bound to this callback. */
- ::rtl::OUString m_sURL;
-
- /** @short the original event, which was notified to this object. */
- css::frame::DispatchResultEvent m_aResult;
-
- /** @short used to let the user of this instance wait, till an
- event occures.
- */
- ::osl::Condition m_aUserWait;
-
- //___________________________________________
- // native interface
-
- public:
-
- //_______________________________________
- /** @short initialize a new instance of this class. */
- LoadDispatchListener();
-
- //_______________________________________
- /** @short deinitialize an instance of this class. */
- virtual ~LoadDispatchListener();
-
- //_______________________________________
- /** @short bind this listenerr to a new URL.
-
- @param sURL
- the new URL bound to this instance.
- */
- void setURL(const ::rtl::OUString & sURL);
-
- //_______________________________________
- /** @short let the user of this instance wait.
-
- @descr If the call timed out - false is returned.
- Otherwise it returns true.
- Then the method getResult() has to be called,
- to get the origianl event.
-
- @param nWait_ms
- the time for wait in [ms].
- If its set to 0 this call is blocked till
- an event occures!
-
- @return TRUE if an event occured in time - FALSE otherwhise.
- */
- sal_Bool wait(sal_Int32 nWait_ms);
-
- //_______________________________________
- /** @short returns the result of this listener operation.
-
- @descr If wait() (which must be called before!) returns FALSE
- the return of getResult() is undefined!
-
- @return The result of the got listener notification.
- */
- css::frame::DispatchResultEvent getResult() const;
-
- //___________________________________________
- // uno interface
-
- public:
-
- //_______________________________________
- // css.uno.XInterface
- FWK_DECLARE_XINTERFACE
-
- //_______________________________________
- // css.frame.XDispatchResultListener
- virtual void SAL_CALL dispatchFinished(const css::frame::DispatchResultEvent& aEvent)
- throw(css::uno::RuntimeException);
-
- //_______________________________________
- // css.lang.XEventListener
- virtual void SAL_CALL disposing(const css::lang::EventObject& aEvent)
- throw(css::uno::RuntimeException);
-};
-
-} // namespace framework
-
-#endif // __FRAMEWORK_LOADENV_LOADDISPATCHLISTENER_HXX_
diff --git a/framework/source/inc/loadenv/loadenv.hxx b/framework/source/inc/loadenv/loadenv.hxx
index 6f0b60a502..60c3c317e0 100644
--- a/framework/source/inc/loadenv/loadenv.hxx
+++ b/framework/source/inc/loadenv/loadenv.hxx
@@ -417,6 +417,7 @@ class LoadEnv : private ThreadHelpBase
virtual void SAL_CALL disposing(const css::lang::EventObject& aEvent)
throw(css::uno::RuntimeException);
*/
+
//___________________________________________
// static interface
@@ -455,6 +456,14 @@ class LoadEnv : private ThreadHelpBase
const css::uno::Sequence< css::beans::PropertyValue >& lMediaDescriptor);
/** TODO document me ... */
+ static void initializeUIDefaults(
+ const css::uno::Reference< css::lang::XMultiServiceFactory >& i_rSMGR,
+ ::comphelper::MediaDescriptor& io_lMediaDescriptor,
+ const bool _bUIMode,
+ QuietInteraction** o_ppQuiteInteraction
+ );
+
+ /** TODO document me ... */
void impl_setResult(sal_Bool bResult);
/** TODO document me ... */
@@ -484,7 +493,7 @@ class LoadEnv : private ThreadHelpBase
/** @short tries to detect the type and the filter of the specified content.
- @descr This method actualize the available media descriptor of this instance,
+ @descr This method update the available media descriptor of this instance,
so it contains the right type, a corresponding filter, may a
valid frame loader etc. In case detection failed, this descriptor
is corrected first, before a suitable exception will be thrown.
diff --git a/framework/source/inc/loadenv/loadenvexception.hxx b/framework/source/inc/loadenv/loadenvexception.hxx
index 7bce66a3bb..8af58d4c89 100644
--- a/framework/source/inc/loadenv/loadenvexception.hxx
+++ b/framework/source/inc/loadenv/loadenvexception.hxx
@@ -172,11 +172,11 @@ class LoadEnvException
@param exUno
the original catched uno exception.
*/
- LoadEnvException( sal_Int32 nID ,
- const css::uno::Exception& exUno)
+ LoadEnvException( sal_Int32 nID ,
+ const css::uno::Any& exUno)
{
- m_nID = nID ;
- m_exOriginal <<= exUno;
+ m_nID = nID ;
+ m_exOriginal = exUno;
}
//_______________________________________
diff --git a/framework/source/interaction/preventduplicateinteraction.cxx b/framework/source/interaction/preventduplicateinteraction.cxx
index 1fe71b6ade..d032aa1f24 100644
--- a/framework/source/interaction/preventduplicateinteraction.cxx
+++ b/framework/source/interaction/preventduplicateinteraction.cxx
@@ -109,6 +109,20 @@ void PreventDuplicateInteraction::useDefaultUUIHandler()
}
//_________________________________________________________________________________________________________________
+css::uno::Any SAL_CALL PreventDuplicateInteraction::queryInterface( const css::uno::Type& aType )
+ throw (css::uno::RuntimeException)
+{
+ if ( aType.equals( XInteractionHandler2::static_type() ) )
+ {
+ ::osl::ResettableMutexGuard aLock(m_aLock);
+ css::uno::Reference< css::task::XInteractionHandler2 > xHandler( m_xHandler, css::uno::UNO_QUERY );
+ if ( !xHandler.is() )
+ return css::uno::Any();
+ }
+ return ::cppu::WeakImplHelper1< css::task::XInteractionHandler2 >::queryInterface( aType );
+}
+
+//_________________________________________________________________________________________________________________
void SAL_CALL PreventDuplicateInteraction::handle(const css::uno::Reference< css::task::XInteractionRequest >& xRequest)
throw(css::uno::RuntimeException)
@@ -166,6 +180,65 @@ void SAL_CALL PreventDuplicateInteraction::handle(const css::uno::Reference< css
//_________________________________________________________________________________________________________________
+::sal_Bool SAL_CALL PreventDuplicateInteraction::handleInteractionRequest( const css::uno::Reference< css::task::XInteractionRequest >& xRequest )
+ throw (css::uno::RuntimeException)
+{
+ css::uno::Any aRequest = xRequest->getRequest();
+ sal_Bool bHandleIt = sal_True;
+
+ // SAFE ->
+ ::osl::ResettableMutexGuard aLock(m_aLock);
+
+ InteractionList::iterator pIt;
+ for ( pIt = m_lInteractionRules.begin();
+ pIt != m_lInteractionRules.end() ;
+ ++pIt )
+ {
+ InteractionInfo& rInfo = *pIt;
+
+ if (aRequest.isExtractableTo(rInfo.m_aInteraction))
+ {
+ ++rInfo.m_nCallCount;
+ rInfo.m_xRequest = xRequest;
+ bHandleIt = (rInfo.m_nCallCount <= rInfo.m_nMaxCount);
+ break;
+ }
+ }
+
+ css::uno::Reference< css::task::XInteractionHandler2 > xHandler( m_xHandler, css::uno::UNO_QUERY );
+ OSL_ENSURE( xHandler.is() || !m_xHandler.is(),
+ "PreventDuplicateInteraction::handleInteractionRequest: inconsistency!" );
+
+ aLock.clear();
+ // <- SAFE
+
+ if (
+ (bHandleIt ) &&
+ (xHandler.is())
+ )
+ {
+ return xHandler->handleInteractionRequest(xRequest);
+ }
+ else
+ {
+ const css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > > lContinuations = xRequest->getContinuations();
+ sal_Int32 c = lContinuations.getLength();
+ sal_Int32 i = 0;
+ for (i=0; i<c; ++i)
+ {
+ css::uno::Reference< css::task::XInteractionAbort > xAbort(lContinuations[i], css::uno::UNO_QUERY);
+ if (xAbort.is())
+ {
+ xAbort->select();
+ break;
+ }
+ }
+ }
+ return false;
+}
+
+//_________________________________________________________________________________________________________________
+
void PreventDuplicateInteraction::addInteractionRule(const PreventDuplicateInteraction::InteractionInfo& aInteractionInfo)
{
// SAFE ->
diff --git a/framework/source/interaction/quietinteraction.cxx b/framework/source/interaction/quietinteraction.cxx
index 81fc2ec39c..14357a8d13 100644
--- a/framework/source/interaction/quietinteraction.cxx
+++ b/framework/source/interaction/quietinteraction.cxx
@@ -44,7 +44,9 @@
#include <com/sun/star/task/XInteractionAbort.hpp>
#include <com/sun/star/task/XInteractionApprove.hpp>
#include <com/sun/star/document/XInteractionFilterSelect.hpp>
+#include <com/sun/star/document/XInteractionFilterOptions.hpp>
#include <com/sun/star/document/AmbigousFilterRequest.hpp>
+#include <com/sun/star/document/FilterOptionsRequest.hpp>
#include <com/sun/star/task/ErrorCodeRequest.hpp>
#ifndef _COM_SUN_STAR_DOCUMENT_LOCKEDDOCUMENTREQUEST_HPP_
@@ -111,6 +113,7 @@ void SAL_CALL QuietInteraction::handle( const css::uno::Reference< css::task::XI
css::uno::Reference< css::task::XInteractionAbort > xAbort ;
css::uno::Reference< css::task::XInteractionApprove > xApprove ;
css::uno::Reference< css::document::XInteractionFilterSelect > xFilter ;
+ css::uno::Reference< css::document::XInteractionFilterOptions > xFOptions ;
sal_Int32 nCount=lContinuations.getLength();
for (sal_Int32 i=0; i<nCount; ++i)
@@ -123,6 +126,9 @@ void SAL_CALL QuietInteraction::handle( const css::uno::Reference< css::task::XI
if ( ! xFilter.is() )
xFilter = css::uno::Reference< css::document::XInteractionFilterSelect >( lContinuations[i], css::uno::UNO_QUERY );
+
+ if ( ! xFOptions.is() )
+ xFOptions = css::uno::Reference< css::document::XInteractionFilterOptions >( lContinuations[i], css::uno::UNO_QUERY );
}
// differ between abortable interactions (error, unknown filter ...)
@@ -130,6 +136,7 @@ void SAL_CALL QuietInteraction::handle( const css::uno::Reference< css::task::XI
css::task::ErrorCodeRequest aErrorCodeRequest ;
css::document::AmbigousFilterRequest aAmbigousFilterRequest;
css::document::LockedDocumentRequest aLockedDocumentRequest;
+ css::document::FilterOptionsRequest aFilterOptionsRequest;
if (aRequest>>=aAmbigousFilterRequest)
{
@@ -163,6 +170,15 @@ void SAL_CALL QuietInteraction::handle( const css::uno::Reference< css::task::XI
xAbort->select();
}
else
+ if (aRequest>>=aFilterOptionsRequest)
+ {
+ if (xFOptions.is())
+ {
+ // let the default filter options be used
+ xFOptions->select();
+ }
+ }
+ else
if (xAbort.is())
xAbort->select();
}
diff --git a/framework/source/jobs/jobdata.cxx b/framework/source/jobs/jobdata.cxx
index b4bf19996e..6d48c3c2ac 100644
--- a/framework/source/jobs/jobdata.cxx
+++ b/framework/source/jobs/jobdata.cxx
@@ -302,10 +302,10 @@ void JobData::setJobConfig( const css::uno::Sequence< css::beans::NamedValue >&
/* SAFE { */
WriteGuard aWriteLock(m_aLock);
- // actualize member
+ // update member
m_lArguments = lArguments;
- // actualize the configuration ... if possible!
+ // update the configuration ... if possible!
if (m_eMode==E_ALIAS)
{
// It doesn't matter if this config object was already opened before.
@@ -363,7 +363,7 @@ void JobData::setResult( const JobResult& aResult )
// overwrite the last saved result
m_aLastExecutionResult = aResult;
- // Don't use his informations to actualize
+ // Don't use his informations to update
// e.g. the arguments of this job. It must be done
// from outside! Here we save this information only.
@@ -533,7 +533,7 @@ void JobData::disableJob()
if (m_eMode!=E_EVENT)
return;
- // actualize the configuration
+ // update the configuration
// It doesn't matter if this config object was already opened before.
// It doesn nothing here then ... or it change the mode automaticly, if
// it was opened using another one before.
diff --git a/framework/source/jobs/jobresult.cxx b/framework/source/jobs/jobresult.cxx
index eb35e3700c..98b657794f 100644
--- a/framework/source/jobs/jobresult.cxx
+++ b/framework/source/jobs/jobresult.cxx
@@ -81,7 +81,7 @@ JobResult::JobResult()
/**
@short special ctor
@descr It initialize this new instance with a pure job execution result
- and analyze it. Doing so, we actualize our other members.
+ and analyze it. Doing so, we update our other members.
<p>
It's a list of named values, packed inside this any.
@@ -133,7 +133,7 @@ JobResult::JobResult( /*IN*/ const css::uno::Any& aResult )
// That can be usefull if something will fail here ...
m_eParts = E_NOPART;
- // analyze the result and actualize our other members
+ // analyze the result and update our other members
::comphelper::SequenceAsHashMap aProtocol(aResult);
if ( aProtocol.empty() )
return;
diff --git a/framework/source/loadenv/loaddispatchlistener.cxx b/framework/source/loadenv/loaddispatchlistener.cxx
deleted file mode 100644
index 39effc9e5a..0000000000
--- a/framework/source/loadenv/loaddispatchlistener.cxx
+++ /dev/null
@@ -1,141 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_framework.hxx"
-
-//_______________________________________________
-// includes of own project
-#include <loadenv/loaddispatchlistener.hxx>
-#include <threadhelp/writeguard.hxx>
-#include <threadhelp/readguard.hxx>
-
-//_______________________________________________
-// includes of uno interface
-#include <com/sun/star/frame/DispatchResultState.hpp>
-
-//_______________________________________________
-// includes of an other project
-#include <vcl/svapp.hxx>
-
-//_______________________________________________
-// namespace
-
-namespace framework{
-
-// may there exist already a define .-(
-#ifndef css
-namespace css = ::com::sun::star;
-#endif
-
-//_______________________________________________
-// declarations
-
-//-----------------------------------------------
-DEFINE_XINTERFACE_2(LoadDispatchListener ,
- OWeakObject ,
- DIRECT_INTERFACE (css::frame::XDispatchResultListener ),
- DERIVED_INTERFACE(css::lang::XEventListener, css::frame::XDispatchResultListener))
-
-//-----------------------------------------------
-LoadDispatchListener::LoadDispatchListener()
- : ThreadHelpBase(&Application::GetSolarMutex())
-{
- // reset the condition object - so our user can wait there.
- m_aUserWait.reset();
- // set defined state for our result value
- m_aResult.State = css::frame::DispatchResultState::DONTKNOW;
- m_aResult.Result.clear();
-}
-
-//-----------------------------------------------
-LoadDispatchListener::~LoadDispatchListener()
-{
-}
-
-//-----------------------------------------------
-void SAL_CALL LoadDispatchListener::dispatchFinished(const css::frame::DispatchResultEvent& aEvent)
- throw(css::uno::RuntimeException)
-{
- // SAFE -> ----------------------------------
- WriteGuard aWriteLock(m_aLock);
- m_aResult = aEvent;
- aWriteLock.unlock();
- // <- SAFE ----------------------------------
-
- // inform user about this arrived event
- m_aUserWait.set();
-}
-
-//-----------------------------------------------
-void SAL_CALL LoadDispatchListener::disposing(const css::lang::EventObject&)
- throw(css::uno::RuntimeException)
-{
- // SAFE -> ----------------------------------
- WriteGuard aWriteLock(m_aLock);
- m_aResult.State = css::frame::DispatchResultState::DONTKNOW;
- m_aResult.Result.clear();
- aWriteLock.unlock();
- // <- SAFE ----------------------------------
-
- // inform user about this arrived event
- m_aUserWait.set();
-}
-
-//-----------------------------------------------
-void LoadDispatchListener::setURL(const ::rtl::OUString & sURL)
-{
- // SAFE -> ----------------------------------
- WriteGuard aWriteLock(m_aLock);
- m_sURL = sURL;
- aWriteLock.unlock();
- // <- SAFE ----------------------------------
-}
-
-//-----------------------------------------------
-sal_Bool LoadDispatchListener::wait(sal_Int32 /*nWait_ms*/)
-{
- // Wait till an event occures
- m_aUserWait.wait(0);
- // reset the condition, so this method can be called again.
- // Of course a new action has to be started outside too!
- m_aUserWait.reset();
-
- // TODO implement real timeout :-)
- return sal_True;
-}
-
-//-----------------------------------------------
-css::frame::DispatchResultEvent LoadDispatchListener::getResult() const
-{
- // SAFE -> ----------------------------------
- ReadGuard aReadLock(m_aLock);
- return m_aResult;
- // <- SAFE ----------------------------------
-}
-
-} // namespace framework
diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx
index c8cc2dd87f..380943b8ba 100644
--- a/framework/source/loadenv/loadenv.cxx
+++ b/framework/source/loadenv/loadenv.cxx
@@ -321,22 +321,41 @@ void LoadEnv::initializeLoading(const ::rtl::OUString&
/*TODO progress is bound to a frame ... How can we set it here? */
+ // UI mode
+ const bool bUIMode =
+ ( ( m_eFeature & E_WORK_WITH_UI ) == E_WORK_WITH_UI ) &&
+ ( m_lMediaDescriptor.getUnpackedValueOrDefault( ::comphelper::MediaDescriptor::PROP_HIDDEN() , sal_False ) == sal_False ) &&
+ ( m_lMediaDescriptor.getUnpackedValueOrDefault( ::comphelper::MediaDescriptor::PROP_PREVIEW(), sal_False ) == sal_False );
+
+ initializeUIDefaults(
+ m_xSMGR,
+ m_lMediaDescriptor,
+ bUIMode,
+ &m_pQuietInteraction
+ );
+
+ aWriteLock.unlock();
+ // <- SAFE ----------------------------------
+}
+
+/*-----------------------------------------------
+ 22.01.2010
+-----------------------------------------------*/
+void LoadEnv::initializeUIDefaults( const css::uno::Reference< css::lang::XMultiServiceFactory >& i_rSMGR,
+ ::comphelper::MediaDescriptor& io_lMediaDescriptor, const bool i_bUIMode,
+ QuietInteraction** o_ppQuietInteraction )
+{
css::uno::Reference< css::task::XInteractionHandler > xInteractionHandler;
sal_Int16 nMacroMode ;
sal_Int16 nUpdateMode ;
- // UI mode
- if (
- ((m_eFeature & E_WORK_WITH_UI) == E_WORK_WITH_UI) &&
- (m_lMediaDescriptor.getUnpackedValueOrDefault(::comphelper::MediaDescriptor::PROP_HIDDEN() , sal_False) == sal_False ) &&
- (m_lMediaDescriptor.getUnpackedValueOrDefault(::comphelper::MediaDescriptor::PROP_PREVIEW(), sal_False) == sal_False )
- )
+ if ( i_bUIMode )
{
nMacroMode = css::document::MacroExecMode::USE_CONFIG;
nUpdateMode = css::document::UpdateDocMode::ACCORDING_TO_CONFIG;
try
{
- xInteractionHandler = css::uno::Reference< css::task::XInteractionHandler >(m_xSMGR->createInstance(IMPLEMENTATIONNAME_UIINTERACTIONHANDLER), css::uno::UNO_QUERY);
+ xInteractionHandler = css::uno::Reference< css::task::XInteractionHandler >(i_rSMGR->createInstance(IMPLEMENTATIONNAME_UIINTERACTIONHANDLER), css::uno::UNO_QUERY);
}
catch(const css::uno::RuntimeException&) {throw;}
catch(const css::uno::Exception& ) { }
@@ -346,27 +365,28 @@ void LoadEnv::initializeLoading(const ::rtl::OUString&
{
nMacroMode = css::document::MacroExecMode::NEVER_EXECUTE;
nUpdateMode = css::document::UpdateDocMode::NO_UPDATE;
- m_pQuietInteraction = new QuietInteraction();
- m_pQuietInteraction->acquire();
- xInteractionHandler = css::uno::Reference< css::task::XInteractionHandler >(static_cast< css::task::XInteractionHandler* >(m_pQuietInteraction), css::uno::UNO_QUERY);
+ QuietInteraction* pQuietInteraction = new QuietInteraction();
+ xInteractionHandler = css::uno::Reference< css::task::XInteractionHandler >(static_cast< css::task::XInteractionHandler* >(pQuietInteraction), css::uno::UNO_QUERY);
+ if ( o_ppQuietInteraction != NULL )
+ {
+ *o_ppQuietInteraction = pQuietInteraction;
+ (*o_ppQuietInteraction)->acquire();
+ }
}
if (
- (xInteractionHandler.is() ) &&
- (m_lMediaDescriptor.find(::comphelper::MediaDescriptor::PROP_INTERACTIONHANDLER()) == m_lMediaDescriptor.end())
+ (xInteractionHandler.is() ) &&
+ (io_lMediaDescriptor.find(::comphelper::MediaDescriptor::PROP_INTERACTIONHANDLER()) == io_lMediaDescriptor.end())
)
{
- m_lMediaDescriptor[::comphelper::MediaDescriptor::PROP_INTERACTIONHANDLER()] <<= xInteractionHandler;
+ io_lMediaDescriptor[::comphelper::MediaDescriptor::PROP_INTERACTIONHANDLER()] <<= xInteractionHandler;
}
- if (m_lMediaDescriptor.find(::comphelper::MediaDescriptor::PROP_MACROEXECUTIONMODE()) == m_lMediaDescriptor.end())
- m_lMediaDescriptor[::comphelper::MediaDescriptor::PROP_MACROEXECUTIONMODE()] <<= nMacroMode;
-
- if (m_lMediaDescriptor.find(::comphelper::MediaDescriptor::PROP_UPDATEDOCMODE()) == m_lMediaDescriptor.end())
- m_lMediaDescriptor[::comphelper::MediaDescriptor::PROP_UPDATEDOCMODE()] <<= nUpdateMode;
+ if (io_lMediaDescriptor.find(::comphelper::MediaDescriptor::PROP_MACROEXECUTIONMODE()) == io_lMediaDescriptor.end())
+ io_lMediaDescriptor[::comphelper::MediaDescriptor::PROP_MACROEXECUTIONMODE()] <<= nMacroMode;
- aWriteLock.unlock();
- // <- SAFE ----------------------------------
+ if (io_lMediaDescriptor.find(::comphelper::MediaDescriptor::PROP_UPDATEDOCMODE()) == io_lMediaDescriptor.end())
+ io_lMediaDescriptor[::comphelper::MediaDescriptor::PROP_UPDATEDOCMODE()] <<= nUpdateMode;
}
/*-----------------------------------------------
@@ -818,7 +838,7 @@ void LoadEnv::impl_detectTypeAndFilter()
// Attention: Because our stl media descriptor is a copy of an uno sequence
// we cant use as an in/out parameter here. Copy it before and dont forget to
- // actualize structure afterwards again!
+ // update structure afterwards again!
css::uno::Sequence< css::beans::PropertyValue > lDescriptor = m_lMediaDescriptor.getAsConstPropertyValueList();
css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR;
@@ -1626,7 +1646,6 @@ void LoadEnv::impl_reactForLoadingState()
// We dont hide already visible frames here ...
css::uno::Reference< css::awt::XWindow > xWindow = m_xTargetFrame->getContainerWindow();
sal_Bool bHidden = m_lMediaDescriptor.getUnpackedValueOrDefault(::comphelper::MediaDescriptor::PROP_HIDDEN(), sal_False);
- sal_Bool bRecovered = (m_lMediaDescriptor.find(::comphelper::MediaDescriptor::PROP_SALVAGEDFILE()) != m_lMediaDescriptor.end());
sal_Bool bMinimized = m_lMediaDescriptor.getUnpackedValueOrDefault(::comphelper::MediaDescriptor::PROP_MINIMIZED(), sal_False);
if (bMinimized)
@@ -1638,7 +1657,7 @@ void LoadEnv::impl_reactForLoadingState()
((WorkWindow*)pWindow)->Minimize();
}
else
- if (!bHidden && !bRecovered)
+ if (!bHidden)
{
// show frame ... if it's not still visible ...
// But do nothing if it's already visible!
@@ -1723,9 +1742,8 @@ void LoadEnv::impl_reactForLoadingState()
if (bThrow)
{
- css::uno::Exception aEx;
- if ( aRequest >>= aEx )
- throw LoadEnvException( LoadEnvException::ID_GENERAL_ERROR, aEx );
+ if ( aRequest.isExtractableTo( ::cppu::UnoType< css::uno::Exception >::get() ) )
+ throw LoadEnvException( LoadEnvException::ID_GENERAL_ERROR, aRequest );
}
// <- SAFE ----------------------------------
diff --git a/framework/source/loadenv/makefile.mk b/framework/source/loadenv/makefile.mk
index fead332b06..c68ad8d304 100644
--- a/framework/source/loadenv/makefile.mk
+++ b/framework/source/loadenv/makefile.mk
@@ -38,7 +38,6 @@ ENABLE_EXCEPTIONS= TRUE
SLOFILES= \
$(SLO)$/loadenv.obj \
- $(SLO)$/loaddispatchlistener.obj \
$(SLO)$/targethelper.obj
# --- Targets ------------------------------------------------------
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx
index 9f514ae833..41dbe9b603 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -28,10 +28,10 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_framework.hxx"
#include "services/autorecovery.hxx"
+#include <loadenv/loadenv.hxx>
//_______________________________________________
// own includes
-#include <loadenv/loaddispatchlistener.hxx>
#include <loadenv/targethelper.hxx>
#include <pattern/frame.hxx>
#include <threadhelp/readguard.hxx>
@@ -47,6 +47,8 @@
// interface includes
#include <com/sun/star/ucb/NameClash.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/frame/XLoadable.hpp>
+#include <com/sun/star/frame/XModel2.hpp>
#include <com/sun/star/frame/XModuleManager.hpp>
#include <com/sun/star/frame/XTitle.hpp>
#include <com/sun/star/frame/XFrame.hpp>
@@ -67,6 +69,7 @@
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/container/XContainerQuery.hpp>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
+#include <com/sun/star/document/XDocumentRecovery.hpp>
#include <com/sun/star/util/XCloseable.hpp>
#include <com/sun/star/awt/XWindow2.hpp>
#include <com/sun/star/task/XStatusIndicatorFactory.hpp>
@@ -75,10 +78,12 @@
// other includes
#include <comphelper/configurationhelper.hxx>
#include <comphelper/mediadescriptor.hxx>
+#include <comphelper/namedvaluecollection.hxx>
#include <vcl/svapp.hxx>
#include <unotools/pathoptions.hxx>
#include <tools/link.hxx>
#include <tools/string.hxx>
+#include <tools/diagnose_ex.h>
#include <unotools/tempfile.hxx>
#include <ucbhelper/content.hxx>
@@ -88,6 +93,7 @@
#include <unotools/bootstrap.hxx>
#include <unotools/configmgr.hxx>
#include <svl/documentlockfile.hxx>
+#include <cppuhelper/exc_hlp.hxx>
#include <tools/urlobj.hxx>
@@ -98,6 +104,23 @@
namespace css = ::com::sun::star;
#endif
+using ::com::sun::star::uno::Sequence;
+using ::com::sun::star::uno::UNO_QUERY;
+using ::com::sun::star::uno::UNO_QUERY_THROW;
+using ::com::sun::star::uno::UNO_SET_THROW;
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::Any;
+using ::com::sun::star::beans::PropertyValue;
+using ::com::sun::star::container::XEnumeration;
+using ::com::sun::star::document::XDocumentRecovery;
+using ::com::sun::star::frame::XModel2;
+using ::com::sun::star::frame::XModel;
+using ::com::sun::star::frame::XFrame;
+using ::com::sun::star::frame::XController2;
+using ::com::sun::star::frame::XLoadable;
+using ::com::sun::star::frame::XStorable;
+using ::com::sun::star::lang::XComponent;
+
namespace fpf = ::framework::pattern::frame;
namespace framework
@@ -131,6 +154,7 @@ static const ::rtl::OUString CFG_ENTRY_PROP_DOCUMENTSTATE = ::rtl::OUString:
static const ::rtl::OUString CFG_ENTRY_PROP_FILTER = ::rtl::OUString::createFromAscii("Filter" );
static const ::rtl::OUString CFG_ENTRY_PROP_TITLE = ::rtl::OUString::createFromAscii("Title" );
static const ::rtl::OUString CFG_ENTRY_PROP_ID = ::rtl::OUString::createFromAscii("ID" );
+static const ::rtl::OUString CFG_ENTRY_PROP_VIEWNAMES = ::rtl::OUString::createFromAscii("ViewNames" );
static const ::rtl::OUString FILTER_PROP_TYPE = ::rtl::OUString::createFromAscii("Type" );
static const ::rtl::OUString FILTER_PROP_NAME = ::rtl::OUString::createFromAscii("Name" );
@@ -140,6 +164,7 @@ static const ::rtl::OUString DOCINFO_PROP_TEMPLATE = ::rtl::OUString::
// setup.xcu
static const ::rtl::OUString CFG_ENTRY_PROP_EMPTYDOCUMENTURL = ::rtl::OUString::createFromAscii("ooSetupFactoryEmptyDocumentURL");
static const ::rtl::OUString CFG_ENTRY_PROP_DEFAULTFILTER = ::rtl::OUString::createFromAscii("ooSetupFactoryDefaultFilter" );
+static const ::rtl::OUString CFG_ENTRY_PROP_FACTORYSERVICE = ::rtl::OUString::createFromAscii("ooSetupFactoryDocumentService" );
static const ::rtl::OUString EVENT_ON_NEW = ::rtl::OUString::createFromAscii("OnNew" );
static const ::rtl::OUString EVENT_ON_LOAD = ::rtl::OUString::createFromAscii("OnLoad" );
@@ -619,7 +644,7 @@ void SAL_CALL AutoRecovery::dispatch(const css::util::URL&
// dont enable AutoSave hardly !
// reload configuration to know the current state.
implts_readAutoSaveConfig();
- implts_actualizeTimer();
+ implts_updateTimer();
// can it happen that might be the listener was stopped ? .-)
// make sure it runs always ... even if AutoSave itself was disabled temporarly.
implts_startListening();
@@ -775,7 +800,7 @@ void AutoRecovery::implts_dispatch(const DispatchParams& aParams)
// <- SAFE ----------------------------------
// depends on bAllowAutoSaveReactivation implicitly by looking on m_eJob=E_AUTO_SAVE! see before ...
- implts_actualizeTimer();
+ implts_updateTimer();
if (bAllowAutoSaveReactivation)
implts_startListening();
@@ -791,7 +816,7 @@ void SAL_CALL AutoRecovery::addStatusListener(const css::uno::Reference< css::fr
// container is threadsafe by using a shared mutex!
m_lListener.addInterface(aURL.Complete, xListener);
- // REINTRANT !? -> --------------------------------
+ // REENTRANT !? -> --------------------------------
CacheLockGuard aCacheLock(this, m_aLock, m_nDocCacheLock, LOCK_FOR_CACHE_USE);
// THREAD SAFE -> ----------------------------------
@@ -845,7 +870,7 @@ void SAL_CALL AutoRecovery::notifyEvent(const css::document::EventObject& aEvent
else
if (aEvent.EventName.equals(EVENT_ON_MODIFYCHANGED))
{
- implts_actualizeModifiedState(xDocument);
+ implts_updateModifiedState(xDocument);
}
/* at least one document starts saving process =>
Our application code isnt ready for multiple save requests
@@ -954,7 +979,7 @@ void SAL_CALL AutoRecovery::changesOccurred(const css::util::ChangesEvent& aEven
// Note: This call stops the timer and starts it again.
// But it checks the different timer states internaly and
// may be supress the restart!
- implts_actualizeTimer();
+ implts_updateTimer();
}
//-----------------------------------------------
@@ -1096,7 +1121,7 @@ void AutoRecovery::implts_readConfig()
css::uno::Reference< css::container::XHierarchicalNameAccess > xCommonRegistry(implts_openConfig(), css::uno::UNO_QUERY);
- // REINTRANT -> --------------------------------
+ // REENTRANT -> --------------------------------
CacheLockGuard aCacheLock(this, m_aLock, m_nDocCacheLock, LOCK_FOR_CACHE_ADD_REMOVE);
// THREADSAFE -> -------------------------------
@@ -1108,7 +1133,7 @@ void AutoRecovery::implts_readConfig()
// <- THREADSAFE -------------------------------
aCacheLock.unlock();
- // <- REINTRANT --------------------------------
+ // <- REENTRANT --------------------------------
css::uno::Any aValue;
@@ -1123,7 +1148,7 @@ void AutoRecovery::implts_readConfig()
sal_Int32 c = lItems.getLength();
sal_Int32 i = 0;
- // REINTRANT -> --------------------------
+ // REENTRANT -> --------------------------
aCacheLock.lock(LOCK_FOR_CACHE_ADD_REMOVE);
for (i=0; i<c; ++i)
@@ -1143,7 +1168,8 @@ void AutoRecovery::implts_readConfig()
xItem->getPropertyValue(CFG_ENTRY_PROP_DOCUMENTSTATE) >>= aInfo.DocumentState;
xItem->getPropertyValue(CFG_ENTRY_PROP_MODULE ) >>= aInfo.AppModule ;
xItem->getPropertyValue(CFG_ENTRY_PROP_TITLE ) >>= aInfo.Title ;
- implts_specifyAppModuleAndFactoryURL(aInfo);
+ xItem->getPropertyValue(CFG_ENTRY_PROP_VIEWNAMES ) >>= aInfo.ViewNames ;
+ implts_specifyAppModuleAndFactory(aInfo);
implts_specifyDefaultFilterAndExtension(aInfo);
if (pItems[i].indexOf(RECOVERY_ITEM_BASE_IDENTIFIER)==0)
@@ -1173,10 +1199,10 @@ void AutoRecovery::implts_readConfig()
}
aCacheLock.unlock();
- // <- REINTRANT --------------------------
+ // <- REENTRANT --------------------------
}
- implts_actualizeTimer();
+ implts_updateTimer();
}
//-----------------------------------------------
@@ -1241,17 +1267,12 @@ void AutoRecovery::implts_specifyDefaultFilterAndExtension(AutoRecovery::TDocume
}
//-----------------------------------------------
-void AutoRecovery::implts_specifyAppModuleAndFactoryURL(AutoRecovery::TDocumentInfo& rInfo)
+void AutoRecovery::implts_specifyAppModuleAndFactory(AutoRecovery::TDocumentInfo& rInfo)
{
- if (
- (!rInfo.AppModule.getLength()) &&
- (!rInfo.Document.is() )
- )
- {
- throw css::uno::RuntimeException(
- ::rtl::OUString::createFromAscii("Cant find out the application module nor its factory URL, if no application module (or a suitable) document is known!"),
- static_cast< css::frame::XDispatch* >(this));
- }
+ ENSURE_OR_THROW2(
+ rInfo.AppModule.getLength() || rInfo.Document.is(),
+ "Cant find out the application module nor its factory URL, if no application module (or a suitable) document is known!",
+ *this );
// SAFE -> ----------------------------------
ReadGuard aReadLock(m_aLock);
@@ -1267,6 +1288,65 @@ void AutoRecovery::implts_specifyAppModuleAndFactoryURL(AutoRecovery::TDocumentI
::comphelper::SequenceAsHashMap lModuleDescription(xModuleConfig->getByName(rInfo.AppModule));
lModuleDescription[CFG_ENTRY_PROP_EMPTYDOCUMENTURL] >>= rInfo.FactoryURL;
+ lModuleDescription[CFG_ENTRY_PROP_FACTORYSERVICE] >>= rInfo.FactoryService;
+}
+
+//-----------------------------------------------
+void AutoRecovery::implts_collectActiveViewNames( AutoRecovery::TDocumentInfo& i_rInfo )
+{
+ ENSURE_OR_THROW2( i_rInfo.Document.is(), "need at document, at the very least", *this );
+
+ i_rInfo.ViewNames.realloc(0);
+
+ // obtain list of controllers of this document
+ ::std::vector< ::rtl::OUString > aViewNames;
+ const Reference< XModel2 > xModel( i_rInfo.Document, UNO_QUERY );
+ if ( xModel.is() )
+ {
+ const Reference< XEnumeration > xEnumControllers( xModel->getControllers() );
+ while ( xEnumControllers->hasMoreElements() )
+ {
+ const Reference< XController2 > xController( xEnumControllers->nextElement(), UNO_QUERY );
+ ::rtl::OUString sViewName;
+ if ( xController.is() )
+ sViewName = xController->getViewControllerName();
+ OSL_ENSURE( sViewName.getLength(), "AutoRecovery::implts_collectActiveViewNames: (no XController2 ->) no view name -> no recovery of this view!" );
+
+ if ( sViewName.getLength() )
+ aViewNames.push_back( sViewName );
+ }
+ }
+ else
+ {
+ const Reference< XController2 > xController( xModel->getCurrentController(), UNO_QUERY );
+ ::rtl::OUString sViewName;
+ if ( xController.is() )
+ sViewName = xController->getViewControllerName();
+ OSL_ENSURE( sViewName.getLength(), "AutoRecovery::implts_collectActiveViewNames: (no XController2 ->) no view name -> no recovery of this view!" );
+
+ if ( sViewName.getLength() )
+ aViewNames.push_back( sViewName );
+ }
+
+ i_rInfo.ViewNames.realloc( aViewNames.size() );
+ ::std::copy( aViewNames.begin(), aViewNames.end(), i_rInfo.ViewNames.getArray() );
+}
+
+//-----------------------------------------------
+void AutoRecovery::implts_persistAllActiveViewNames()
+{
+ // SAFE -> ----------------------------------
+ WriteGuard aWriteLock(m_aLock);
+
+ // This list will be filled with every document
+ AutoRecovery::TDocumentList::iterator pIt;
+ for ( pIt = m_lDocCache.begin();
+ pIt != m_lDocCache.end() ;
+ ++pIt )
+ {
+ implts_collectActiveViewNames( *pIt );
+ implts_flushConfigItem( *pIt );
+ }
}
//-----------------------------------------------
@@ -1319,6 +1399,7 @@ void AutoRecovery::implts_flushConfigItem(const AutoRecovery::TDocumentInfo& rIn
xSet->setPropertyValue(CFG_ENTRY_PROP_DOCUMENTSTATE, css::uno::makeAny(rInfo.DocumentState));
xSet->setPropertyValue(CFG_ENTRY_PROP_MODULE , css::uno::makeAny(rInfo.AppModule ));
xSet->setPropertyValue(CFG_ENTRY_PROP_TITLE , css::uno::makeAny(rInfo.Title ));
+ xSet->setPropertyValue(CFG_ENTRY_PROP_VIEWNAMES , css::uno::makeAny(rInfo.ViewNames ));
if (bNew)
xModify->insertByName(sID, css::uno::makeAny(xSet));
@@ -1478,7 +1559,7 @@ void AutoRecovery::implts_stopModifyListeningOnDoc(AutoRecovery::TDocumentInfo&
}
//-----------------------------------------------
-void AutoRecovery::implts_actualizeTimer()
+void AutoRecovery::implts_updateTimer()
{
implts_stopTimer();
@@ -1569,7 +1650,7 @@ IMPL_LINK(AutoRecovery, implts_timerExpired, void*, EMPTYARG)
m_eTimerType = AutoRecovery::E_POLL_TILL_AUTOSAVE_IS_ALLOWED;
aWriteLock.unlock();
// <- SAFE ------------------------------
- implts_actualizeTimer();
+ implts_updateTimer();
return 0;
}
@@ -1584,7 +1665,7 @@ IMPL_LINK(AutoRecovery, implts_timerExpired, void*, EMPTYARG)
sal_Bool bUserIdle = (Application::GetLastInputInterval()>MIN_TIME_FOR_USER_IDLE);
if (!bUserIdle)
{
- implts_actualizeTimer();
+ implts_updateTimer();
return 0;
}
}
@@ -1625,7 +1706,7 @@ IMPL_LINK(AutoRecovery, implts_timerExpired, void*, EMPTYARG)
aWriteLock.unlock();
// <- SAFE ----------------------------------
- implts_actualizeTimer();
+ implts_updateTimer();
}
catch(const css::uno::Exception&)
{
@@ -1662,7 +1743,7 @@ void AutoRecovery::implts_registerDocument(const css::uno::Reference< css::frame
// notification for already existing document !
// Can happen if events came in asynchronous on recovery time.
// Then our cache was filled from the configuration ... but now we get some
- // asynchronous events from the global event broadcaster. We must be shure that
+ // asynchronous events from the global event broadcaster. We must be sure that
// we dont add the same document more then once.
AutoRecovery::TDocumentList::iterator pIt = AutoRecovery::impl_searchDocument(m_lDocCache, xDocument);
if (pIt != m_lDocCache.end())
@@ -1670,7 +1751,7 @@ void AutoRecovery::implts_registerDocument(const css::uno::Reference< css::frame
// Normaly nothing must be done for this "late" notification.
// But may be the modified state was changed inbetween.
// Check it ...
- implts_actualizeModifiedState(xDocument);
+ implts_updateModifiedState(xDocument);
return;
}
@@ -1695,6 +1776,11 @@ void AutoRecovery::implts_registerDocument(const css::uno::Reference< css::frame
if (!xDesktop.is())
return;
+ // if the document doesn't support the XDocumentRecovery interface, we're not interested in it.
+ Reference< XDocumentRecovery > xDocRecovery( xDocument, UNO_QUERY );
+ if ( !xDocRecovery.is() )
+ return;
+
// get all needed informations of this document
// We need it to update our cache or to locate already existing elements there!
AutoRecovery::TDocumentInfo aNew;
@@ -1714,7 +1800,7 @@ void AutoRecovery::implts_registerDocument(const css::uno::Reference< css::frame
// <- SAFE ----------------------------------
// classify the used application module, which is used by this document.
- implts_specifyAppModuleAndFactoryURL(aNew);
+ implts_specifyAppModuleAndFactory(aNew);
// Hack! Check for "illegal office documents" ... as e.g. the Basic IDE
// Its not realy a full featured office document. It doesnt provide an URL, any filter, a factory URL etcpp.
@@ -1723,7 +1809,12 @@ void AutoRecovery::implts_registerDocument(const css::uno::Reference< css::frame
(!aNew.OrgURL.getLength() ) &&
(!aNew.FactoryURL.getLength())
)
- return;
+ {
+ OSL_ENSURE( false, "AutoRecovery::implts_registerDocument: this should not happen anymore!" );
+ // nowadays, the Basic IDE should already die on the "supports XDocumentRecovery" check. And no other known
+ // document type fits in here ...
+ return;
+ }
// By the way - get some information about the default format for saving!
// and save an information about the real used filter by this document.
@@ -1744,7 +1835,6 @@ void AutoRecovery::implts_registerDocument(const css::uno::Reference< css::frame
if (xModifyCheck->isModified())
{
aNew.DocumentState |= AutoRecovery::E_MODIFIED;
- aNew.DocumentState |= AutoRecovery::E_MODIFIED_SINCE_LAST_AUTOSAVE;
}
aCacheLock.lock(LOCK_FOR_CACHE_ADD_REMOVE);
@@ -1752,7 +1842,7 @@ void AutoRecovery::implts_registerDocument(const css::uno::Reference< css::frame
// SAFE -> ----------------------------------
WriteGuard aWriteLock(m_aLock);
- // create a new cache entry ... this document isnt well known.
+ // create a new cache entry ... this document isn't known.
++m_nIdPool;
aNew.ID = m_nIdPool;
LOG_ASSERT(m_nIdPool>=0, "AutoRecovery::implts_registerDocument()\nOverflow of ID pool detected.")
@@ -1831,7 +1921,6 @@ void AutoRecovery::implts_markDocumentModifiedAgainstLastBackup(const css::uno::
if (pIt != m_lDocCache.end())
{
AutoRecovery::TDocumentInfo& rInfo = *pIt;
- rInfo.DocumentState |= AutoRecovery::E_MODIFIED_SINCE_LAST_AUTOSAVE;
/* Now we know, that this document was modified again and must be saved next time.
But we dont need this information for every e.g. key input of the user.
@@ -1846,7 +1935,7 @@ void AutoRecovery::implts_markDocumentModifiedAgainstLastBackup(const css::uno::
}
//-----------------------------------------------
-void AutoRecovery::implts_actualizeModifiedState(const css::uno::Reference< css::frame::XModel >& xDocument)
+void AutoRecovery::implts_updateModifiedState(const css::uno::Reference< css::frame::XModel >& xDocument)
{
CacheLockGuard aCacheLock(this, m_aLock, m_nDocCacheLock, LOCK_FOR_CACHE_USE);
@@ -1866,12 +1955,10 @@ void AutoRecovery::implts_actualizeModifiedState(const css::uno::Reference< css:
if (bModified)
{
rInfo.DocumentState |= AutoRecovery::E_MODIFIED;
- rInfo.DocumentState |= AutoRecovery::E_MODIFIED_SINCE_LAST_AUTOSAVE;
}
else
{
rInfo.DocumentState &= ~AutoRecovery::E_MODIFIED;
- rInfo.DocumentState &= ~AutoRecovery::E_MODIFIED_SINCE_LAST_AUTOSAVE;
}
}
@@ -1964,6 +2051,33 @@ AutoRecovery::TDocumentList::iterator AutoRecovery::impl_searchDocument( Au
}
//-----------------------------------------------
+namespace
+{
+ void lcl_changeVisibility( const css::uno::Reference< css::frame::XFramesSupplier >& i_rFrames, sal_Bool i_bVisible )
+ {
+ css::uno::Reference< css::container::XIndexAccess > xFramesContainer( i_rFrames->getFrames(), css::uno::UNO_QUERY );
+ const sal_Int32 count = xFramesContainer->getCount();
+
+ Any aElement;
+ for ( sal_Int32 i=0; i < count; ++i )
+ {
+ aElement = xFramesContainer->getByIndex(i);
+ // check for sub frames
+ css::uno::Reference< css::frame::XFramesSupplier > xFramesSupp( aElement, css::uno::UNO_QUERY );
+ if ( xFramesSupp.is() )
+ lcl_changeVisibility( xFramesSupp, i_bVisible );
+
+ css::uno::Reference< css::frame::XFrame > xFrame( aElement, css::uno::UNO_QUERY );
+ if ( !xFrame.is() )
+ continue;
+
+ css::uno::Reference< css::awt::XWindow > xWindow( xFrame->getContainerWindow(), UNO_SET_THROW );
+ xWindow->setVisible( i_bVisible );
+ }
+ }
+}
+
+//-----------------------------------------------
void AutoRecovery::implts_changeAllDocVisibility(sal_Bool bVisible)
{
// SAFE -> ----------------------------------
@@ -1972,22 +2086,8 @@ void AutoRecovery::implts_changeAllDocVisibility(sal_Bool bVisible)
aReadLock.unlock();
// <- SAFE ----------------------------------
- css::uno::Reference< css::frame::XFramesSupplier > xDesktop (xSMGR->createInstance(SERVICENAME_DESKTOP), css::uno::UNO_QUERY);
- css::uno::Reference< css::container::XIndexAccess > xContainer(xDesktop->getFrames() , css::uno::UNO_QUERY);
- sal_Int32 c = xContainer->getCount();
- sal_Int32 i = 0;
-
- for (i=0; i<c; ++i)
- {
- css::uno::Reference< css::frame::XFrame > xTask;
-
- xContainer->getByIndex(i) >>= xTask;
- if (!xTask.is())
- continue;
-
- css::uno::Reference< css::awt::XWindow > xWindow = xTask->getContainerWindow();
- xWindow->setVisible(bVisible);
- }
+ css::uno::Reference< css::frame::XFramesSupplier > xDesktop(xSMGR->createInstance(SERVICENAME_DESKTOP), css::uno::UNO_QUERY);
+ lcl_changeVisibility( xDesktop, bVisible );
aReadLock.unlock();
// <- SAFE ----------------------------------
@@ -2180,15 +2280,15 @@ AutoRecovery::ETimerType AutoRecovery::implts_saveDocs( sal_Bool bAl
continue;
// already auto saved during this session :-)
- // This state must be reseted for all documents
+ // This state must be reset for all documents
// if timer is started with normnal AutoSaveTimerIntervall!
if ((aInfo.DocumentState & AutoRecovery::E_HANDLED) == AutoRecovery::E_HANDLED)
continue;
// Not modified documents are not saved.
// We safe an information about the URL only!
- sal_Bool bModified = ((aInfo.DocumentState & AutoRecovery::E_MODIFIED_SINCE_LAST_AUTOSAVE ) == AutoRecovery::E_MODIFIED_SINCE_LAST_AUTOSAVE);
- if (! bModified)
+ Reference< XDocumentRecovery > xDocRecover( aInfo.Document, UNO_QUERY_THROW );
+ if ( !xDocRecover->wasModifiedSinceLastSave() )
{
aInfo.DocumentState |= AutoRecovery::E_HANDLED;
continue;
@@ -2333,7 +2433,7 @@ void AutoRecovery::implts_saveOneDoc(const ::rtl::OUString&
// try to save this document as a new temp file everytimes.
// Mark AutoSave state as "INCOMPLETE" if it failed.
// Because the last temp file is to old and does not include all changes.
- css::uno::Reference< css::frame::XStorable > xStore(rInfo.Document, css::uno::UNO_QUERY_THROW);
+ Reference< XDocumentRecovery > xDocRecover(rInfo.Document, css::uno::UNO_QUERY_THROW);
// safe the state about "trying to save"
// ... we need it for recovery if e.g. a crash occures inside next line!
@@ -2346,7 +2446,7 @@ void AutoRecovery::implts_saveOneDoc(const ::rtl::OUString&
{
try
{
- xStore->storeToURL(rInfo.NewTempURL, lNewArgs.getAsConstPropertyValueList());
+ xDocRecover->storeToRecoveryFile( rInfo.NewTempURL, lNewArgs.getAsConstPropertyValueList() );
#ifdef TRIGGER_FULL_DISC_CHECK
throw css::uno::Exception();
@@ -2390,7 +2490,6 @@ void AutoRecovery::implts_saveOneDoc(const ::rtl::OUString&
rInfo.DocumentState &= ~AutoRecovery::E_TRY_SAVE;
rInfo.DocumentState |= AutoRecovery::E_HANDLED;
rInfo.DocumentState |= AutoRecovery::E_SUCCEDED;
- rInfo.DocumentState &= ~AutoRecovery::E_MODIFIED_SINCE_LAST_AUTOSAVE;
}
else
{
@@ -2466,6 +2565,9 @@ AutoRecovery::ETimerType AutoRecovery::implts_openDocs(const DispatchParams& aPa
lDescriptor[::comphelper::MediaDescriptor::PROP_REFERRER()] <<= REFERRER_USER;
lDescriptor[::comphelper::MediaDescriptor::PROP_SALVAGEDFILE()] <<= ::rtl::OUString();
+ // recovered documents are loaded hidden, and shown all at once, later
+ lDescriptor[::comphelper::MediaDescriptor::PROP_HIDDEN()] <<= true;
+
if (aParams.m_xProgress.is())
lDescriptor[::comphelper::MediaDescriptor::PROP_STATUSINDICATOR()] <<= aParams.m_xProgress;
@@ -2531,6 +2633,8 @@ AutoRecovery::ETimerType AutoRecovery::implts_openDocs(const DispatchParams& aPa
else
continue; // TODO ERROR!
+ LoadEnv::initializeUIDefaults( m_xSMGR, lDescriptor, true, NULL );
+
// <- SAFE ------------------------------
aWriteLock.unlock();
@@ -2571,12 +2675,18 @@ AutoRecovery::ETimerType AutoRecovery::implts_openDocs(const DispatchParams& aPa
{
::comphelper::MediaDescriptor lPatchDescriptor(rInfo.Document->getArgs());
lPatchDescriptor[::comphelper::MediaDescriptor::PROP_FILTERNAME()] <<= rInfo.RealFilter;
- rInfo.Document->attachResource(sURL, lPatchDescriptor.getAsConstPropertyValueList());
+ rInfo.Document->attachResource(rInfo.Document->getURL(), lPatchDescriptor.getAsConstPropertyValueList());
+ // do *not* use sURL here. In case this points to the recovery file, it has already been passed
+ // to recoverFromFile. Also, passing it here is logically wrong, as attachResource is intended
+ // to take the logical file URL.
}
css::uno::Reference< css::util::XModifiable > xModify(rInfo.Document, css::uno::UNO_QUERY);
- sal_Bool bModified = ((rInfo.DocumentState & AutoRecovery::E_MODIFIED) == AutoRecovery::E_MODIFIED);
- xModify->setModified(bModified);
+ if ( xModify.is() )
+ {
+ sal_Bool bModified = ((rInfo.DocumentState & AutoRecovery::E_MODIFIED) == AutoRecovery::E_MODIFIED);
+ xModify->setModified(bModified);
+ }
rInfo.DocumentState &= ~AutoRecovery::E_TRY_LOAD_BACKUP;
rInfo.DocumentState &= ~AutoRecovery::E_TRY_LOAD_ORIGINAL;
@@ -2589,8 +2699,8 @@ AutoRecovery::ETimerType AutoRecovery::implts_openDocs(const DispatchParams& aPa
/* Normaly we listen as XModifyListener on a document to know if a document was changed
since our last AutoSave. And we deregister us in case we know this state.
- But directly after one documentw as recovered ... we must start listening.
- Otherwhise the first "modify" dont reach us. Because weself called setModified()
+ But directly after one document as recovered ... we must start listening.
+ Otherwhise the first "modify" doesnt reach us. Because we ourself called setModified()
on the document via API. And currently we dont listen for any events (not at the GlobalEventBroadcaster
nor at any document!).
*/
@@ -2618,60 +2728,113 @@ void AutoRecovery::implts_openOneDoc(const ::rtl::OUString& sURL
aReadLock.unlock();
// <- SAFE ----------------------------------
- css::uno::Reference< css::util::XURLTransformer > xParser(xSMGR->createInstance(SERVICENAME_URLTRANSFORMER), css::uno::UNO_QUERY_THROW);
- css::util::URL aURL;
- aURL.Complete = sURL;
- xParser->parseStrict(aURL);
-
- LoadDispatchListener* pLoadListener = new LoadDispatchListener();
- css::uno::Reference< css::frame::XDispatchResultListener > xLoadListener (static_cast< css::frame::XDispatchResultListener* >(pLoadListener), css::uno::UNO_QUERY_THROW);
-
- css::uno::Reference< css::frame::XFrame > xDesktop (xSMGR->createInstance(SERVICENAME_DESKTOP), css::uno::UNO_QUERY_THROW);
- css::uno::Reference< css::frame::XFrame > xNewTarget = xDesktop->findFrame(SPECIALTARGET_BLANK, 0);
- css::uno::Reference< css::frame::XDispatchProvider > xProvider (xNewTarget, css::uno::UNO_QUERY_THROW);
- css::uno::Reference< css::frame::XNotifyingDispatch > xDispatcher(
- xProvider->queryDispatch(aURL, SPECIALTARGET_SELF, 0),
- css::uno::UNO_QUERY_THROW);
-
- // load the document and listen for the state of this operation.
- pLoadListener->setURL(aURL.Complete);
-
- // make sure the right progress is used always.
- impl_establishProgress(rInfo, lDescriptor, xNewTarget);
+ css::uno::Reference< css::frame::XFrame > xDesktop( xSMGR->createInstance(SERVICENAME_DESKTOP), css::uno::UNO_QUERY_THROW );
+ ::std::vector< Reference< XComponent > > aCleanup;
try
{
- xDispatcher->dispatchWithNotification(
- aURL,
- lDescriptor.getAsConstPropertyValueList(),
- xLoadListener);
+ // create a new document of the desired type
+ Reference< XModel2 > xModel( xSMGR->createInstance( rInfo.FactoryService ), UNO_QUERY_THROW );
+ aCleanup.push_back( xModel.get() );
- pLoadListener->wait(0); // wait for ever!
+ // put the filter name into the descriptor - we're not going to involve any type detection, so
+ // the document might be lost without the FilterName property
+ lDescriptor[ ::comphelper::MediaDescriptor::PROP_FILTERNAME() ] <<= rInfo.RealFilter;
- css::frame::DispatchResultEvent aResult = pLoadListener->getResult();
- if (aResult.State != css::frame::DispatchResultState::SUCCESS)
+ if ( sURL == rInfo.FactoryURL )
{
- ::rtl::OUStringBuffer sMsg(256);
- sMsg.appendAscii("Recovery of \"");
- sMsg.append (aURL.Complete );
- sMsg.appendAscii("\" failed." );
- throw css::uno::Exception(sMsg.makeStringAndClear(), static_cast< css::frame::XDispatch* >(this));
+ // if the document was a new, unmodified document, then there's nothing to recover, just to init
+ ENSURE_OR_THROW( ( rInfo.DocumentState & AutoRecovery::E_MODIFIED ) == 0,
+ "unexpected document state" );
+ Reference< XLoadable > xModelLoad( xModel, UNO_QUERY_THROW );
+ xModelLoad->initNew();
+
+ // TODO: remove load-process specific arguments from the descriptor, e.g. the status indicator
+ xModel->attachResource( sURL, lDescriptor.getAsConstPropertyValueList() );
}
+ else
+ {
+ // let it recover itself
+ Reference< XDocumentRecovery > xDocRecover( xModel, UNO_QUERY_THROW );
+ xDocRecover->recoverFromFile(
+ sURL,
+ lDescriptor.getUnpackedValueOrDefault( ::comphelper::MediaDescriptor::PROP_SALVAGEDFILE(), ::rtl::OUString() ),
+ lDescriptor.getAsConstPropertyValueList()
+ );
+
+ // No attachResource needed here. By definition (of XDocumentRecovery), the implementation is responsible
+ // for completely initializing the model, which includes attachResource (or equivalent), if required.
+ }
+
+ // re-create all the views
+ ::std::vector< ::rtl::OUString > aViewsToRestore( rInfo.ViewNames.getLength() );
+ if ( rInfo.ViewNames.getLength() )
+ ::std::copy( rInfo.ViewNames.getConstArray(), rInfo.ViewNames.getConstArray() + rInfo.ViewNames.getLength(), aViewsToRestore.begin() );
+ // if we don't have views for whatever reason, then create a default-view, at least
+ if ( aViewsToRestore.empty() )
+ aViewsToRestore.push_back( ::rtl::OUString() );
+
+ for ( ::std::vector< ::rtl::OUString >::const_iterator viewName = aViewsToRestore.begin();
+ viewName != aViewsToRestore.end();
+ ++viewName
+ )
+ {
+ // create a frame
+ Reference< XFrame > xTargetFrame = xDesktop->findFrame( SPECIALTARGET_BLANK, 0 );
+ aCleanup.push_back( xTargetFrame.get() );
- rInfo.Document = fpf::extractFrameModel(xNewTarget);
+ // create a view to the document
+ Reference< XController2 > xController;
+ if ( viewName->getLength() )
+ {
+ xController.set( xModel->createViewController( *viewName, Sequence< PropertyValue >(), xTargetFrame ), UNO_SET_THROW );
+ }
+ else
+ {
+ xController.set( xModel->createDefaultViewController( xTargetFrame ), UNO_SET_THROW );
+ }
+
+ // introduce model/view/controller to each other
+ xController->attachModel( xModel.get() );
+ xModel->connectController( xController.get() );
+ xTargetFrame->setComponent( xController->getComponentWindow(), xController.get() );
+ xController->attachFrame( xTargetFrame );
+ xModel->setCurrentController( xController.get() );
+ }
+
+ rInfo.Document = xModel.get();
}
catch(const css::uno::RuntimeException&)
{ throw; }
catch(const css::uno::Exception&)
{
- css::uno::Reference< css::util::XCloseable > xClose(xNewTarget, css::uno::UNO_QUERY);
- xClose->close(sal_True);
- xNewTarget.clear();
- throw;
- }
+ Any aCaughtException( ::cppu::getCaughtException() );
+
+ // clean up
+ for ( ::std::vector< Reference< XComponent > >::const_iterator component = aCleanup.begin();
+ component != aCleanup.end();
+ ++component
+ )
+ {
+ css::uno::Reference< css::util::XCloseable > xClose( *component, css::uno::UNO_QUERY );
+ if ( xClose.is() )
+ xClose->close( sal_True );
+ else
+ (*component)->dispose();
+ }
+
+ // re-throw
+ ::rtl::OUStringBuffer sMsg(256);
+ sMsg.appendAscii("Recovery of \"");
+ sMsg.append (sURL );
+ sMsg.appendAscii("\" failed." );
- // of course we must forget all references to this temp(!) progress
- impl_forgetProgress(rInfo, lDescriptor, xNewTarget);
+ throw css::lang::WrappedTargetException(
+ sMsg.makeStringAndClear(),
+ static_cast< css::frame::XDispatch* >(this),
+ aCaughtException
+ );
+ }
}
//-----------------------------------------------
@@ -2783,7 +2946,7 @@ void AutoRecovery::implts_informListener( sal_Int32 eJ
if ((eJob & AutoRecovery::E_AUTO_SAVE) == AutoRecovery::E_AUTO_SAVE)
sFeature.append(CMD_DO_AUTO_SAVE);
#ifdef ENABLE_WARNINGS
- else
+ else if ( eJob != AutoRecovery::E_NO_JOB )
LOG_WARNING("AutoRecovery::implst_getJobDescription()", "Invalid job identifier detected.")
#endif
@@ -2842,35 +3005,18 @@ css::frame::FeatureStateEvent AutoRecovery::implst_createFeatureStateEvent(
if (sEventType.equals(OPERATION_UPDATE) && pInfo)
{
// pack rInfo for transport via UNO
- css::uno::Sequence< css::beans::NamedValue > lInfo(8);
- lInfo[0].Name = CFG_ENTRY_PROP_ID;
- lInfo[0].Value <<= pInfo->ID;
-
- lInfo[1].Name = CFG_ENTRY_PROP_ORIGINALURL;
- lInfo[1].Value <<= pInfo->OrgURL;
-
- lInfo[2].Name = CFG_ENTRY_PROP_FACTORYURL;
- lInfo[2].Value <<= pInfo->FactoryURL;
-
- lInfo[3].Name = CFG_ENTRY_PROP_TEMPLATEURL;
- lInfo[3].Value <<= pInfo->TemplateURL;
-
- lInfo[4].Name = CFG_ENTRY_PROP_TEMPURL;
- if (pInfo->OldTempURL.getLength())
- lInfo[4].Value <<= pInfo->OldTempURL;
- else
- lInfo[4].Value <<= pInfo->NewTempURL;
-
- lInfo[5].Name = CFG_ENTRY_PROP_MODULE;
- lInfo[5].Value <<= pInfo->AppModule;
-
- lInfo[6].Name = CFG_ENTRY_PROP_TITLE;
- lInfo[6].Value <<= pInfo->Title;
+ ::comphelper::NamedValueCollection aInfo;
+ aInfo.put( CFG_ENTRY_PROP_ID, pInfo->ID );
+ aInfo.put( CFG_ENTRY_PROP_ORIGINALURL, pInfo->OrgURL );
+ aInfo.put( CFG_ENTRY_PROP_FACTORYURL, pInfo->FactoryURL );
+ aInfo.put( CFG_ENTRY_PROP_TEMPLATEURL, pInfo->TemplateURL );
+ aInfo.put( CFG_ENTRY_PROP_TEMPURL, pInfo->OldTempURL.getLength() ? pInfo->OldTempURL : pInfo->NewTempURL );
+ aInfo.put( CFG_ENTRY_PROP_MODULE, pInfo->AppModule );
+ aInfo.put( CFG_ENTRY_PROP_TITLE, pInfo->Title );
+ aInfo.put( CFG_ENTRY_PROP_VIEWNAMES, pInfo->ViewNames );
+ aInfo.put( CFG_ENTRY_PROP_DOCUMENTSTATE, pInfo->DocumentState );
- lInfo[7].Name = CFG_ENTRY_PROP_DOCUMENTSTATE;
- lInfo[7].Value <<= pInfo->DocumentState;
-
- aEvent.State <<= lInfo;
+ aEvent.State <<= aInfo.getPropertyValues();
}
return aEvent;
@@ -2928,6 +3074,9 @@ void AutoRecovery::implts_doEmergencySave(const DispatchParams& aParams)
css::uno::makeAny(sal_True),
::comphelper::ConfigurationHelper::E_STANDARD);
+ // for all docs, store their current view/names in the configurtion
+ implts_persistAllActiveViewNames();
+
// The called method for saving documents runs
// during normal AutoSave more then once. Because
// it postpone active documents and save it later.
@@ -2995,6 +3144,9 @@ void AutoRecovery::implts_doSessionSave(const DispatchParams& aParams)
// Be sure to know all open documents realy .-)
implts_verifyCacheAgainstDesktopDocumentList();
+ // for all docs, store their current view/names in the configurtion
+ implts_persistAllActiveViewNames();
+
// The called method for saving documents runs
// during normal AutoSave more then once. Because
// it postpone active documents and save it later.
diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx
index 290b4cebc4..e9938aecf0 100644
--- a/framework/source/services/backingwindow.cxx
+++ b/framework/source/services/backingwindow.cxx
@@ -110,39 +110,58 @@ Size DecoToolBox::getMinSize()
return maMinSize;
}
+#define STC_BUTTON_STYLE (WB_LEFT | WB_VCENTER | WB_FLATBUTTON | WB_BEVELBUTTON)
BackingWindow::BackingWindow( Window* i_pParent ) :
Window( i_pParent, FwkResId( DLG_BACKING ) ),
maWelcome( this, WB_LEFT ),
maProduct( this, WB_LEFT ),
- maCreateText( this, WB_LEFT ),
- maWriterText( this, WB_WORDBREAK | WB_VCENTER ),
- maWriterButton( this, WB_CENTER | WB_BEVELBUTTON ),
- maCalcText( this, WB_WORDBREAK | WB_VCENTER ),
- maCalcButton( this, WB_CENTER | WB_BEVELBUTTON ),
- maImpressText( this, WB_WORDBREAK | WB_VCENTER ),
- maImpressButton( this, WB_CENTER | WB_BEVELBUTTON ),
- maDrawText( this, WB_WORDBREAK | WB_VCENTER ),
- maDrawButton( this, WB_CENTER | WB_BEVELBUTTON ),
- maDBText( this, WB_WORDBREAK | WB_VCENTER ),
- maDBButton( this, WB_CENTER | WB_BEVELBUTTON ),
- maMathText( this, WB_WORDBREAK | WB_VCENTER ),
- maMathButton( this, WB_CENTER | WB_BEVELBUTTON ),
- maTemplateText( this, WB_WORDBREAK | WB_VCENTER ),
- maTemplateButton( this, WB_CENTER | WB_BEVELBUTTON ),
- maOpenText( this, WB_WORDBREAK | WB_VCENTER ),
- maOpenButton( this, WB_CENTER | WB_BEVELBUTTON ),
+ maWriterButton( this, STC_BUTTON_STYLE ),
+ maCalcButton( this, STC_BUTTON_STYLE ),
+ maImpressButton( this, STC_BUTTON_STYLE ),
+ maOpenButton( this, STC_BUTTON_STYLE ),
+ maDrawButton( this, STC_BUTTON_STYLE ),
+ maDBButton( this, STC_BUTTON_STYLE ),
+ maMathButton( this, STC_BUTTON_STYLE ),
+ maTemplateButton( this, STC_BUTTON_STYLE ),
maToolbox( this, WB_DIALOGCONTROL ),
maWelcomeString( FwkResId( STR_BACKING_WELCOME ) ),
maProductString( FwkResId( STR_BACKING_WELCOMEPRODUCT ) ),
- maCreateString( FwkResId( STR_BACKING_CREATE ) ),
maOpenString( FwkResId( STR_BACKING_FILE ) ),
maTemplateString( FwkResId( STR_BACKING_TEMPLATE ) ),
maButtonImageSize( 10, 10 ),
mbInitControls( false ),
- mpAccExec( NULL )
+ mnLayoutStyle( 0 ),
+ mpAccExec( NULL ),
+ mnBtnPos( 120 )
{
mnColumnWidth[0] = mnColumnWidth[1] = 0;
+ mnTextColumnWidth[0] = mnTextColumnWidth[1] = 0;
+
+ try
+ {
+ Reference<lang::XMultiServiceFactory> xConfig( comphelper::getProcessServiceFactory()->createInstance(SERVICENAME_CFGPROVIDER),UNO_QUERY);
+ if( xConfig.is() )
+ {
+ Sequence<Any> args(1);
+ PropertyValue val(
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("nodepath") ),
+ 0,
+ Any(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Office.Common/Help/StartCenter"))),
+ PropertyState_DIRECT_VALUE);
+ args.getArray()[0] <<= val;
+ Reference<container::XNameAccess> xNameAccess(xConfig->createInstanceWithArguments(SERVICENAME_CFGREADACCESS,args), UNO_QUERY);
+ if( xNameAccess.is() )
+ {
+ //throws css::container::NoSuchElementException, css::lang::WrappedTargetException
+ Any value( xNameAccess->getByName(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StartCenterLayoutStyle"))) );
+ mnLayoutStyle = value.get<sal_Int32>();
+ }
+ }
+ }
+ catch (Exception& )
+ {
+ }
// get icon images from vcl resource and set them on the appropriate buttons
loadImage( FwkResId( BMP_BACKING_WRITER ), maWriterButton );
@@ -151,16 +170,12 @@ BackingWindow::BackingWindow( Window* i_pParent ) :
loadImage( FwkResId( BMP_BACKING_DRAW ), maDrawButton );
loadImage( FwkResId( BMP_BACKING_DATABASE ), maDBButton );
loadImage( FwkResId( BMP_BACKING_FORMULA ), maMathButton );
- loadImage( FwkResId( BMP_BACKING_OPENFILE ), maOpenButton );
- loadImage( FwkResId( BMP_BACKING_OPENTEMPLATE ), maTemplateButton );
+ loadImage( FwkResId( BMP_BACKING_FOLDER ), maOpenButton );
+ loadImage( FwkResId( BMP_BACKING_FOLDER ), maTemplateButton );
- BitmapEx aExtImage( FwkResId( BMP_BACKING_EXT ) );
String aExtHelpText( FwkResId( STR_BACKING_EXTHELP ) );
- BitmapEx aRegImage( FwkResId( BMP_BACKING_REG ) );
String aRegHelpText( FwkResId( STR_BACKING_REGHELP ) );
- BitmapEx aInfoImage( FwkResId( BMP_BACKING_INFO ) );
String aInfoHelpText( FwkResId( STR_BACKING_INFOHELP ) );
- BitmapEx aTplRepImage( FwkResId( BMP_BACKING_TPLREP ) );
String aTplRepHelpText( FwkResId( STR_BACKING_TPLREP ) );
// clean up resource stack
@@ -180,25 +195,25 @@ BackingWindow::BackingWindow( Window* i_pParent ) :
maToolbox.SetStyle( maToolbox.GetStyle() | WB_FORCETABCYCLE );
// insert toolbox items
- maToolbox.InsertItem( nItemId_TplRep, Image( aTplRepImage ) );
+ maToolbox.InsertItem( nItemId_TplRep, Image() );
maToolbox.SetItemText( nItemId_TplRep, aTplRepHelpText );
maToolbox.SetQuickHelpText( nItemId_TplRep, aTplRepHelpText );
maToolbox.SetItemCommand( nItemId_TplRep, String( RTL_CONSTASCII_USTRINGPARAM( ".HelpId:StartCenter:TemplateRepository" ) ) );
maToolbox.ShowItem( nItemId_TplRep );
- maToolbox.InsertItem( nItemId_Extensions, Image( aExtImage ) );
+ maToolbox.InsertItem( nItemId_Extensions, Image() );
maToolbox.SetQuickHelpText( nItemId_Extensions, aExtHelpText );
maToolbox.SetItemText( nItemId_Extensions, aExtHelpText );
maToolbox.SetItemCommand( nItemId_Extensions, String( RTL_CONSTASCII_USTRINGPARAM( ".HelpId:StartCenter:Extensions" ) ) );
maToolbox.ShowItem( nItemId_Extensions );
- maToolbox.InsertItem( nItemId_Reg, Image( aRegImage ) );
+ maToolbox.InsertItem( nItemId_Reg, Image() );
maToolbox.SetQuickHelpText( nItemId_Reg, aRegHelpText );
maToolbox.SetItemText( nItemId_Reg, aRegHelpText );
maToolbox.SetItemCommand( nItemId_Reg, String( RTL_CONSTASCII_USTRINGPARAM( ".HelpId:StartCenter:Register" ) ) );
maToolbox.ShowItem( nItemId_Reg );
- maToolbox.InsertItem( nItemId_Info, Image( aInfoImage ) );
+ maToolbox.InsertItem( nItemId_Info, Image() );
maToolbox.SetItemText( nItemId_Info, aInfoHelpText );
maToolbox.SetQuickHelpText( nItemId_Info, aInfoHelpText );
maToolbox.SetItemCommand( nItemId_Info, String( RTL_CONSTASCII_USTRINGPARAM( ".HelpId:StartCenter:Info" ) ) );
@@ -259,7 +274,13 @@ void BackingWindow::initBackground()
SetBackground( GetSettings().GetStyleSettings().GetWorkspaceGradient() );
bool bDark = GetSettings().GetStyleSettings().GetHighContrastMode();
- maWelcomeTextColor = maLabelTextColor = bDark ? Color( COL_WHITE ) : Color( 0x26, 0x35, 0x42 );
+ if( bDark )
+ maWelcomeTextColor = maLabelTextColor = Color( COL_WHITE );
+ else if( mnLayoutStyle == 1 )
+ maWelcomeTextColor = maLabelTextColor = Color( COL_BLACK );
+ else
+ maWelcomeTextColor = maLabelTextColor = Color( 0x26, 0x35, 0x42 );
+
Color aTextBGColor( bDark ? COL_BLACK : COL_WHITE );
// select image set
@@ -286,29 +307,23 @@ void BackingWindow::initBackground()
maBackgroundLeft = BitmapEx( FwkResId( BMP_BACKING_BACKGROUND_LEFT ) );
maBackgroundRight = BitmapEx( FwkResId( BMP_BACKING_BACKGROUND_RIGHT ) );
}
+ maToolbox.SetItemImage( nItemId_Extensions, BitmapEx( FwkResId( BMP_BACKING_EXT ) ) );
+ maToolbox.SetItemImage( nItemId_Reg, BitmapEx( FwkResId( BMP_BACKING_REG ) ) );
+ maToolbox.SetItemImage( nItemId_Info, BitmapEx( FwkResId( BMP_BACKING_INFO ) ) );
+ maToolbox.SetItemImage( nItemId_TplRep, BitmapEx( FwkResId( BMP_BACKING_TPLREP ) ) );
maWelcome.SetControlForeground( maWelcomeTextColor );
maWelcome.SetBackground();
maProduct.SetControlForeground( maWelcomeTextColor );
maProduct.SetBackground();
- maCreateText.SetControlForeground( maLabelTextColor );
- maCreateText.SetControlBackground( aTextBGColor );
- maWriterText.SetControlForeground( maLabelTextColor );
- maWriterText.SetControlBackground( aTextBGColor );
- maCalcText.SetControlForeground( maLabelTextColor );
- maCalcText.SetControlBackground( aTextBGColor );
- maImpressText.SetControlForeground( maLabelTextColor );
- maImpressText.SetControlBackground( aTextBGColor );
- maDrawText.SetControlForeground( maLabelTextColor );
- maDrawText.SetControlBackground( aTextBGColor );
- maDBText.SetControlForeground( maLabelTextColor );
- maDBText.SetControlBackground( aTextBGColor );
- maMathText.SetControlForeground( maLabelTextColor );
- maMathText.SetControlBackground( aTextBGColor );
- maTemplateText.SetControlForeground( maLabelTextColor );
- maTemplateText.SetControlBackground( aTextBGColor );
- maOpenText.SetControlForeground( maLabelTextColor );
- maOpenText.SetControlBackground( aTextBGColor );
+
+ if( mnLayoutStyle == 1 )
+ {
+ if( Application::GetSettings().GetLayoutRTL() )
+ mnBtnPos = maBackgroundRight.GetSizePixel().Width() + 40;
+ else
+ mnBtnPos = maBackgroundLeft.GetSizePixel().Width() + 40;
+ }
}
void BackingWindow::initControls()
@@ -344,10 +359,8 @@ void BackingWindow::initControls()
nYPos += (maWelcomeSize.Height()*3)/2;
- if( maControlRect.GetWidth() < nBtnPos + maWelcomeSize.Width() + 20 )
- maControlRect.Right() = maControlRect.Left() + maWelcomeSize.Width() + nBtnPos + 20;
-
- maWelcome.Show();
+ if( maControlRect.GetWidth() < mnBtnPos + maWelcomeSize.Width() + 20 )
+ maControlRect.Right() = maControlRect.Left() + maWelcomeSize.Width() + mnBtnPos + 20;
nYPos += maWelcomeSize.Height();
@@ -365,10 +378,14 @@ void BackingWindow::initControls()
maProductSize = Size( maProduct.GetTextWidth( maProductString ), maProduct.GetTextHeight() );
maProductSize.Width() = (maProductSize.Width() * 20)/19;
- if( maControlRect.GetWidth() < maProductSize.Width() + nBtnPos + 10 )
- maControlRect.Right() = maControlRect.Left() + maProductSize.Width() + nBtnPos + 10;
+ if( maControlRect.GetWidth() < maProductSize.Width() + mnBtnPos + 10 )
+ maControlRect.Right() = maControlRect.Left() + maProductSize.Width() + mnBtnPos + 10;
- maProduct.Show();
+ if( mnLayoutStyle == 1 )
+ {
+ maWelcome.Show();
+ maProduct.Show();
+ }
nYPos += (maProductSize.Height()*3)/2;
@@ -376,14 +393,6 @@ void BackingWindow::initControls()
maTextFont.SetSize( Size( 0, 11 ) );
maTextFont.SetWeight( WEIGHT_NORMAL );
- maCreateText.SetText( maCreateString );
- maCreateText.SetFont( maTextFont );
- maCreateText.SetControlFont( maTextFont );
- maCreateSize = Size( maCreateText.GetTextWidth( maCreateString ), maCreateText.GetTextHeight() );
- maCreateText.Show();
-
- nYPos += (maCreateSize.Height()*3)/2;
-
// collect the URLs of the entries in the File/New menu
SvtModuleOptions aModuleOptions;
std::set< rtl::OUString > aFileNewAppsAvailable;
@@ -423,44 +432,65 @@ void BackingWindow::initControls()
}
// layout the buttons
- layoutButtonAndText( WRITER_URL, 0, aFileNewAppsAvailable,
- aModuleOptions, SvtModuleOptions::E_SWRITER,
- maWriterButton, maWriterText, aMnemns );
- layoutButtonAndText( CALC_URL, 1, aFileNewAppsAvailable,
- aModuleOptions, SvtModuleOptions::E_SCALC,
- maCalcButton, maCalcText, aMnemns );
+ layoutButton( WRITER_URL, 0, aFileNewAppsAvailable,
+ aModuleOptions, SvtModuleOptions::E_SWRITER,
+ maWriterButton, aMnemns );
+ layoutButton( DRAW_URL, 1, aFileNewAppsAvailable,
+ aModuleOptions, SvtModuleOptions::E_SDRAW,
+ maDrawButton, aMnemns );
nYPos += maButtonImageSize.Height() + 10;
- layoutButtonAndText( IMPRESS_WIZARD_URL, 0, aFileNewAppsAvailable,
- aModuleOptions, SvtModuleOptions::E_SIMPRESS,
- maImpressButton, maImpressText, aMnemns );
- layoutButtonAndText( DRAW_URL, 1, aFileNewAppsAvailable,
- aModuleOptions, SvtModuleOptions::E_SDRAW,
- maDrawButton, maDrawText, aMnemns );
+ layoutButton( CALC_URL, 0, aFileNewAppsAvailable,
+ aModuleOptions, SvtModuleOptions::E_SCALC,
+ maCalcButton, aMnemns );
+ layoutButton( BASE_URL, 1, aFileNewAppsAvailable,
+ aModuleOptions, SvtModuleOptions::E_SDATABASE,
+ maDBButton, aMnemns );
nYPos += maButtonImageSize.Height() + 10;
- layoutButtonAndText( BASE_URL, 0, aFileNewAppsAvailable,
- aModuleOptions, SvtModuleOptions::E_SDATABASE,
- maDBButton, maDBText, aMnemns );
- layoutButtonAndText( MATH_URL, 1, aFileNewAppsAvailable,
- aModuleOptions, SvtModuleOptions::E_SMATH,
- maMathButton, maMathText, aMnemns );
+ layoutButton( IMPRESS_WIZARD_URL, 0, aFileNewAppsAvailable,
+ aModuleOptions, SvtModuleOptions::E_SIMPRESS,
+ maImpressButton, aMnemns );
+ layoutButton( MATH_URL, 1, aFileNewAppsAvailable,
+ aModuleOptions, SvtModuleOptions::E_SMATH,
+ maMathButton, aMnemns );
nYPos += 3*maButtonImageSize.Height() / 2;
- layoutButtonAndText( NULL, -1, aFileNewAppsAvailable,
- aModuleOptions, SvtModuleOptions::E_SWRITER,
- maTemplateButton, maTemplateText, aMnemns, maTemplateString );
-
- nYPos += 10;
- layoutButtonAndText( NULL, -1, aFileNewAppsAvailable,
- aModuleOptions, SvtModuleOptions::E_SWRITER,
- maOpenButton, maOpenText, aMnemns, maOpenString );
+
+ layoutButton( NULL, 0, aFileNewAppsAvailable,
+ aModuleOptions, SvtModuleOptions::E_SWRITER,
+ maOpenButton, aMnemns, maOpenString );
+ layoutButton( NULL, 1, aFileNewAppsAvailable,
+ aModuleOptions, SvtModuleOptions::E_SWRITER,
+ maTemplateButton, aMnemns, maTemplateString );
nYPos += 10;
DBG_ASSERT( nYPos < maControlRect.GetHeight(), "misformatting !" );
- if( mnColumnWidth[0] + mnColumnWidth[1] + nBtnPos + 20 > maControlRect.GetWidth() )
- maControlRect.Right() = maControlRect.Left() + mnColumnWidth[0] + mnColumnWidth[1] + nBtnPos + 20;
+ if( mnColumnWidth[0] + mnColumnWidth[1] + mnBtnPos + 20 > maControlRect.GetWidth() )
+ maControlRect.Right() = maControlRect.Left() + mnColumnWidth[0] + mnColumnWidth[1] + mnBtnPos + 20;
+
+ mnTextColumnWidth[0] = mnColumnWidth[0];
+ mnTextColumnWidth[1] = mnColumnWidth[1];
+
+ if( mnTextColumnWidth[1] > mnTextColumnWidth[0] )
+ {
+ mnColumnWidth[0] = mnColumnWidth[1];
+ mnTextColumnWidth[0] = mnTextColumnWidth[1];
+ }
+ else
+ {
+ mnColumnWidth[1] = mnColumnWidth[0];
+ mnTextColumnWidth[1] = mnTextColumnWidth[0];
+ }
+ if( maControlRect.GetWidth() < maControlRect.GetHeight() * 3 / 2 )
+ {
+ maControlRect.Right() = maControlRect.Left() + maControlRect.GetHeight() * 3 / 2;
+ long nDelta = (maControlRect.GetWidth() - mnBtnPos - mnColumnWidth[1] - mnColumnWidth[0] - 20);
+ mnColumnWidth[0] += nDelta/2;
+ mnColumnWidth[1] += nDelta/2;
+ }
maToolbox.SetSelectHdl( LINK( this, BackingWindow, ToolboxHdl ) );
- maToolbox.Show();
+ if( mnLayoutStyle == 0 )
+ maToolbox.Show();
// scale middle map to formatted width
Size aMiddleSegmentSize( maControlRect.GetSize().Width() + nShadowLeft + nShadowRight,
@@ -478,6 +508,8 @@ void BackingWindow::initControls()
maBackgroundMiddle = BitmapEx();
Resize();
+
+ maWriterButton.GrabFocus();
}
void BackingWindow::loadImage( const ResId& i_rId, ImageButton& i_rButton )
@@ -491,11 +523,11 @@ void BackingWindow::loadImage( const ResId& i_rId, ImageButton& i_rButton )
i_rButton.SetModeImage( aBmp );
}
-void BackingWindow::layoutButtonAndText(
+void BackingWindow::layoutButton(
const char* i_pURL, int nColumn,
const std::set<rtl::OUString>& i_rURLS,
SvtModuleOptions& i_rOpt, SvtModuleOptions::EModule i_eMod,
- ImageButton& i_rBtn, FixedText& i_rText,
+ ImageButton& i_rBtn,
MnemonicGenerator& i_rMnemns,
const String& i_rStr
)
@@ -510,37 +542,28 @@ void BackingWindow::layoutButtonAndText(
}
// setup text
- i_rText.SetFont( maTextFont );
- i_rText.SetControlFont( maTextFont );
+ i_rBtn.SetFont( maTextFont );
+ i_rBtn.SetControlFont( maTextFont );
String aText( i_rStr.Len() ? i_rStr : SvFileInformationManager::GetDescription( INetURLObject( aURL ) ) );
i_rMnemns.CreateMnemonic( aText );
- i_rText.SetText( aText );
+ i_rBtn.SetText( aText );
+
+ long nTextWidth = i_rBtn.GetTextWidth( i_rBtn.GetText() );
- long nTextWidth = i_rText.GetTextWidth( i_rText.GetText() );
- i_rText.SetPaintTransparent( TRUE );
-
- nTextWidth += maButtonImageSize.Width() + 30;
+ nTextWidth += maButtonImageSize.Width();
if( nColumn >= 0 && nColumn < static_cast<int>(sizeof(mnColumnWidth)/sizeof(mnColumnWidth[0])) )
{
if( nTextWidth > mnColumnWidth[nColumn] )
mnColumnWidth[nColumn] = nTextWidth;
}
+ i_rBtn.SetImageAlign( IMAGEALIGN_LEFT );
// show the controls
i_rBtn.Show();
- i_rText.Show();
}
void BackingWindow::Paint( const Rectangle& )
{
- bool bDark = GetSettings().GetStyleSettings().GetHighContrastMode();
-
- Color aBackColor( bDark ? COL_BLACK : COL_WHITE );
-
- // fill control rect
- SetLineColor();
- SetFillColor( aBackColor );
- DrawRect( maControlRect );
// draw bitmap
if( GetSettings().GetLayoutRTL() )
@@ -584,8 +607,73 @@ long BackingWindow::Notify( NotifyEvent& rNEvt )
}
const KeyEvent* pEvt = rNEvt.GetKeyEvent();
- if( pEvt && mpAccExec->execute(pEvt->GetKeyCode()) )
+ const KeyCode& rKeyCode(pEvt->GetKeyCode());
+ if( pEvt && mpAccExec->execute(rKeyCode) )
return 1;
+ // #i110344# extrawurst: specialized arrow key control
+ if( rKeyCode.GetModifier() == 0 )
+ {
+ if( rKeyCode.GetCode() == KEY_RIGHT )
+ {
+ if( maWriterButton.HasFocus() )
+ maDrawButton.GrabFocus();
+ else if( maCalcButton.HasFocus() )
+ maDBButton.GrabFocus();
+ else if( maImpressButton.HasFocus() )
+ maMathButton.GrabFocus();
+ else if( maOpenButton.HasFocus() )
+ maTemplateButton.GrabFocus();
+ return 1;
+ }
+ else if( rKeyCode.GetCode() == KEY_LEFT )
+ {
+ if( maDrawButton.HasFocus() )
+ maWriterButton.GrabFocus();
+ else if( maDBButton.HasFocus() )
+ maCalcButton.GrabFocus();
+ else if( maMathButton.HasFocus() )
+ maImpressButton.GrabFocus();
+ else if( maTemplateButton.HasFocus() )
+ maOpenButton.GrabFocus();
+ return 1;
+ }
+ else if( rKeyCode.GetCode() == KEY_UP )
+ {
+ // first column
+ if( maOpenButton.HasFocus() )
+ maImpressButton.GrabFocus();
+ else if( maImpressButton.HasFocus() )
+ maCalcButton.GrabFocus();
+ else if( maCalcButton.HasFocus() )
+ maWriterButton.GrabFocus();
+ // second column
+ else if( maTemplateButton.HasFocus() )
+ maMathButton.GrabFocus();
+ else if( maMathButton.HasFocus() )
+ maDBButton.GrabFocus();
+ else if( maDBButton.HasFocus() )
+ maDrawButton.GrabFocus();
+ return 1;
+ }
+ else if( rKeyCode.GetCode() == KEY_DOWN )
+ {
+ // first column
+ if( maWriterButton.HasFocus() )
+ maCalcButton.GrabFocus();
+ else if( maCalcButton.HasFocus() )
+ maImpressButton.GrabFocus();
+ else if( maImpressButton.HasFocus() )
+ maOpenButton.GrabFocus();
+ // second column
+ else if( maDrawButton.HasFocus() )
+ maDBButton.GrabFocus();
+ else if( maDBButton.HasFocus() )
+ maMathButton.GrabFocus();
+ else if( maMathButton.HasFocus() )
+ maTemplateButton.GrabFocus();
+ return 1;
+ }
+ }
}
return Window::Notify( rNEvt );
}
@@ -607,8 +695,10 @@ void BackingWindow::Resize()
maToolbox.calcMinSize();
Size aTBSize( maToolbox.getMinSize() );
- Point aTBPos( maControlRect.Right() - aTBSize.Width() - 10,
+ Point aTBPos( maControlRect.Left() + mnBtnPos,
maControlRect.Bottom() - aTBSize.Height() - 10 );
+ if( Application::GetSettings().GetLayoutRTL() )
+ aTBPos.X() = maControlRect.Right() - aTBSize.Width() - mnBtnPos;
maToolbox.SetPosSizePixel( aTBPos, aTBSize );
// #i93631# squeeze controls so they fit into the box
@@ -617,7 +707,6 @@ void BackingWindow::Resize()
const long nWDelta = maWelcomeSize.Height();
const long nW2Delta = (maWelcomeSize.Height()*3)/2;
const long nPDelta = (maProductSize.Height()*3)/2;
- const long nCDelta = (maCreateSize.Height()*3)/2;
const long nBDelta = maButtonImageSize.Height() + 10;
const long nB2Delta = 3*maButtonImageSize.Height()/2;
const long nLastDelta = maButtonImageSize.Height();
@@ -626,7 +715,6 @@ void BackingWindow::Resize()
(nWDelta - nDiff) +
(nW2Delta- nDiff) +
(nPDelta - nDiff) +
- (nCDelta - nDiff) +
3 * (nBDelta - nDiff) +
(nB2Delta- nDiff) +
nLastDelta
@@ -637,47 +725,26 @@ void BackingWindow::Resize()
long nYPos = maControlRect.Top();
nYPos += nW2Delta - nDiff;
- maWelcome.SetPosSizePixel( Point( maControlRect.Left() + nBtnPos, nYPos ),
- Size( maControlRect.GetWidth() - nBtnPos - 5, (maWelcomeSize.Height()*20)/19 ) );
+ maWelcome.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ),
+ Size( maControlRect.GetWidth() - mnBtnPos - 5, (maWelcomeSize.Height()*20)/19 ) );
nYPos += nWDelta - nDiff;
- maProduct.SetPosSizePixel( Point( maControlRect.Left() + nBtnPos, nYPos ), Size( maControlRect.GetWidth() - nBtnPos - 5, (maProductSize.Height()*20)/19 ) );
+ maProduct.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( maControlRect.GetWidth() - mnBtnPos - 5, (maProductSize.Height()*20)/19 ) );
nYPos += nPDelta - nDiff;
- maCreateText.SetPosSizePixel( Point( maControlRect.Left() + nBtnPos, nYPos ),
- Size( maControlRect.GetWidth() - nBtnPos - 5, maCreateSize.Height() ) );
+ nYPos += nWDelta/2 - nDiff;
- nYPos += nCDelta - nDiff;
-
- maWriterButton.SetPosSizePixel( Point( maControlRect.Left() + nBtnPos, nYPos ), maButtonImageSize );
- maWriterText.SetPosSizePixel( Point( maControlRect.Left() + nBtnPos + maButtonImageSize.Width() + 10, nYPos ),
- Size( mnColumnWidth[0] - maButtonImageSize.Width() - 10, maButtonImageSize.Height() ) );
- maCalcButton.SetPosSizePixel( Point( maControlRect.Left() + nBtnPos + mnColumnWidth[0], nYPos ), maButtonImageSize );
- maCalcText.SetPosSizePixel( Point( maControlRect.Left() + nBtnPos + maButtonImageSize.Width() + 10 + mnColumnWidth[0], nYPos ),
- Size( mnColumnWidth[1] - maButtonImageSize.Width() - 10, maButtonImageSize.Height() ) );
+ maWriterButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( mnTextColumnWidth[0], maButtonImageSize.Height() ) );
+ maDrawButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + mnColumnWidth[0], nYPos ), Size( mnTextColumnWidth[1], maButtonImageSize.Height() ) );
nYPos += nBDelta - nDiff;
- maImpressButton.SetPosSizePixel( Point( maControlRect.Left() + nBtnPos, nYPos ), maButtonImageSize );
- maImpressText.SetPosSizePixel( Point( maControlRect.Left() + nBtnPos + maButtonImageSize.Width() + 10, nYPos ),
- Size( mnColumnWidth[0] - maButtonImageSize.Width() - 10, maButtonImageSize.Height() ) );
- maDrawButton.SetPosSizePixel( Point( maControlRect.Left() + nBtnPos + mnColumnWidth[0], nYPos ), maButtonImageSize );
- maDrawText.SetPosSizePixel( Point( maControlRect.Left() + nBtnPos + maButtonImageSize.Width() + 10 + mnColumnWidth[0], nYPos ),
- Size( mnColumnWidth[1] - maButtonImageSize.Width() - 10, maButtonImageSize.Height() ) );
+ maCalcButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( mnTextColumnWidth[0], maButtonImageSize.Height() ) );
+ maDBButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + mnColumnWidth[0], nYPos ), Size( mnTextColumnWidth[1], maButtonImageSize.Height() ) );
nYPos += nBDelta - nDiff;
- maDBButton.SetPosSizePixel( Point( maControlRect.Left() + nBtnPos, nYPos ), maButtonImageSize );
- maDBText.SetPosSizePixel( Point( maControlRect.Left() + nBtnPos + maButtonImageSize.Width() + 10, nYPos ),
- Size( mnColumnWidth[0] - maButtonImageSize.Width() - 10, maButtonImageSize.Height() ) );
- maMathButton.SetPosSizePixel( Point( maControlRect.Left() + nBtnPos + mnColumnWidth[0], nYPos ), maButtonImageSize );
- maMathText.SetPosSizePixel( Point( maControlRect.Left() + nBtnPos + maButtonImageSize.Width() + 10 + mnColumnWidth[0], nYPos ),
- Size( mnColumnWidth[1] - maButtonImageSize.Width() - 10, maButtonImageSize.Height() ) );
+ maImpressButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( mnTextColumnWidth[0], maButtonImageSize.Height() ) );
+ maMathButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + mnColumnWidth[0], nYPos ), Size( mnTextColumnWidth[1], maButtonImageSize.Height() ) );
nYPos += nB2Delta - nDiff;
- maTemplateButton.SetPosSizePixel( Point( maControlRect.Left() + nBtnPos, nYPos ), maButtonImageSize );
- maTemplateText.SetPosSizePixel( Point( maControlRect.Left() + nBtnPos + maButtonImageSize.Width() + 10, nYPos ),
- Size( mnColumnWidth[0]+mnColumnWidth[1] - maButtonImageSize.Width() - 10, maButtonImageSize.Height() ) );
- nYPos += nBDelta - nDiff;
- maOpenButton.SetPosSizePixel( Point( maControlRect.Left() + nBtnPos, nYPos ), maButtonImageSize );
- maOpenText.SetPosSizePixel( Point( maControlRect.Left() + nBtnPos + maButtonImageSize.Width() + 10, nYPos ),
- Size( mnColumnWidth[0]+mnColumnWidth[1] - maButtonImageSize.Width() - 10, maButtonImageSize.Height() ) );
- nYPos += nBDelta - nDiff;
+ maOpenButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( mnTextColumnWidth[0], maButtonImageSize.Height() ) );
+ maTemplateButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + mnColumnWidth[0], nYPos ), Size( mnTextColumnWidth[1], maButtonImageSize.Height() ) );
}
IMPL_LINK( BackingWindow, ToolboxHdl, void*, EMPTYARG )
@@ -835,54 +902,6 @@ IMPL_LINK( BackingWindow, ClickHdl, Button*, pButton )
return 0;
}
-Window* BackingWindow::GetParentLabelFor( const Window* pLabel ) const
-{
- const Window* pRet = NULL;
-
- if( pLabel == &maWriterText )
- pRet = &maWriterButton;
- else if( pLabel == &maCalcText )
- pRet = &maCalcButton;
- else if( pLabel == &maImpressText )
- pRet = &maImpressButton;
- else if( pLabel == &maDrawText )
- pRet = &maDrawButton;
- else if( pLabel == &maDBText )
- pRet = &maDBButton;
- else if( pLabel == &maMathText )
- pRet = &maMathButton;
- else if( pLabel == &maTemplateText )
- pRet = &maTemplateButton;
- else if( pLabel == &maOpenText )
- pRet = &maOpenButton;
-
- return const_cast<Window*>(pRet);
-}
-
-Window* BackingWindow::GetParentLabeledBy( const Window* pLabeled ) const
-{
- const Window *pRet = NULL;
-
- if( pLabeled == &maWriterButton )
- pRet = &maWriterText;
- else if( pLabeled == &maCalcButton )
- pRet = &maCalcText;
- else if( pLabeled == &maImpressButton )
- pRet = &maImpressText;
- else if( pLabeled == &maDrawButton )
- pRet = &maDrawText;
- else if( pLabeled == &maDBButton )
- pRet = &maDBText;
- else if( pLabeled == &maMathButton )
- pRet = &maMathText;
- else if( pLabeled == &maTemplateButton )
- pRet = &maTemplateText;
- else if( pLabeled == &maOpenButton )
- pRet = &maOpenText;
-
- return const_cast<Window*>(pRet);
-}
-
struct ImplDelayedDispatch
{
Reference< XDispatch > xDispatch;
diff --git a/framework/source/services/backingwindow.hxx b/framework/source/services/backingwindow.hxx
index c617b5321d..45fe60f67f 100644
--- a/framework/source/services/backingwindow.hxx
+++ b/framework/source/services/backingwindow.hxx
@@ -86,24 +86,14 @@ namespace framework
Size maWelcomeSize;
FixedText maProduct;
Size maProductSize;
- FixedText maCreateText;
- Size maCreateSize;
- FixedText maWriterText;
ImageButton maWriterButton;
- FixedText maCalcText;
ImageButton maCalcButton;
- FixedText maImpressText;
ImageButton maImpressButton;
- FixedText maDrawText;
+ ImageButton maOpenButton;
ImageButton maDrawButton;
- FixedText maDBText;
ImageButton maDBButton;
- FixedText maMathText;
ImageButton maMathButton;
- FixedText maTemplateText;
ImageButton maTemplateButton;
- FixedText maOpenText;
- ImageButton maOpenButton;
DecoToolBox maToolbox;
@@ -121,16 +111,17 @@ namespace framework
Rectangle maControlRect;
long mnColumnWidth[2];
+ long mnTextColumnWidth[2];
Color maLabelTextColor;
Color maWelcomeTextColor;
Size maButtonImageSize;
bool mbInitControls;
+ sal_Int32 mnLayoutStyle;
svt::AcceleratorExecute* mpAccExec;
+ long mnBtnPos;
-
- static const long nBtnPos = 240;
static const int nItemId_Extensions = 1;
static const int nItemId_Reg = 2;
static const int nItemId_Info = 3;
@@ -142,12 +133,12 @@ namespace framework
void loadImage( const ResId& i_rId, ImageButton& i_rButton );
- void layoutButtonAndText( const char* i_pURL, int nColumn, const std::set<rtl::OUString>& i_rURLS,
- SvtModuleOptions& i_rOpt, SvtModuleOptions::EModule i_eMod,
- ImageButton& i_rBtn, FixedText& i_rText,
- MnemonicGenerator& i_rMnemonicGen,
- const String& i_rStr = String()
- );
+ void layoutButton( const char* i_pURL, int nColumn, const std::set<rtl::OUString>& i_rURLS,
+ SvtModuleOptions& i_rOpt, SvtModuleOptions::EModule i_eMod,
+ ImageButton& i_rBtn,
+ MnemonicGenerator& i_rMnemonicGen,
+ const String& i_rStr = String()
+ );
void dispatchURL( const rtl::OUString& i_rURL,
const rtl::OUString& i_rTarget = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_default" ) ),
@@ -168,8 +159,6 @@ namespace framework
virtual void Resize();
virtual long Notify( NotifyEvent& rNEvt );
virtual void DataChanged( const DataChangedEvent& rDCEvt );
- virtual Window* GetParentLabelFor( const Window* pLabel ) const;
- virtual Window* GetParentLabeledBy( const Window* pLabeled ) const;
virtual void GetFocus();
void setOwningFrame( const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& xFrame );
diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx
index 92207c9928..08f9b171a9 100644
--- a/framework/source/services/frame.cxx
+++ b/framework/source/services/frame.cxx
@@ -2701,21 +2701,7 @@ css::uno::Any SAL_CALL Frame::impl_getPropertyValue(const ::rtl::OUString& /*sPr
break;
case FRAME_PROPHANDLE_ISHIDDEN :
-// aValue <<= m_bIsHidden;
- {
- sal_Bool bLoadedHidden = m_bIsHidden;
- css::uno::Reference< css::frame::XModel > xModel;
- if (m_xController.is())
- xModel = m_xController->getModel();
- if (xModel.is())
- {
- ::comphelper::MediaDescriptor lDesc(xModel->getArgs());
- bLoadedHidden = lDesc.getUnpackedValueOrDefault(
- ::comphelper::MediaDescriptor::PROP_HIDDEN(),
- (sal_Bool)sal_False);
- }
- aValue <<= bLoadedHidden;
- }
+ aValue <<= m_bIsHidden;
break;
case FRAME_PROPHANDLE_LAYOUTMANAGER :
diff --git a/framework/source/services/fwk_services.src b/framework/source/services/fwk_services.src
index 1401e3c13e..7329b381c1 100644
--- a/framework/source/services/fwk_services.src
+++ b/framework/source/services/fwk_services.src
@@ -77,42 +77,22 @@ Window DLG_BACKING
{
File = "odf_32.png";
};
- Bitmap BMP_BACKING_OPENFILE
+ Bitmap BMP_BACKING_FOLDER
{
- File = "open_32.png";
- };
- Bitmap BMP_BACKING_OPENTEMPLATE
- {
- File = "template_32.png";
- };
- Bitmap BMP_BACKING_EXT
- {
- File = "extension_plus_26.png";
+ File = "folder_32.png";
};
String STR_BACKING_EXTHELP
{
Text [ en-US ] = "Add new features to %PRODUCTNAME";
};
- Bitmap BMP_BACKING_REG
- {
- File = "register_32.png";
- };
String STR_BACKING_REGHELP
{
Text [ en-US ] = "Register your %PRODUCTNAME";
};
- Bitmap BMP_BACKING_INFO
- {
- File = "info_26.png";
- };
String STR_BACKING_INFOHELP
{
Text [ en-US ] = "Get more information about %PRODUCTNAME";
};
- Bitmap BMP_BACKING_TPLREP
- {
- File = "addtemplate_32.png";
- };
String STR_BACKING_TPLREP
{
Text [ en-US ] = "Get more templates for %PRODUCTNAME";
@@ -141,6 +121,22 @@ Resource RES_BACKING_IMAGES
{
File = "backing_rtl_right.png";
};
+ Bitmap BMP_BACKING_EXT
+ {
+ File = "extension.png";
+ };
+ Bitmap BMP_BACKING_REG
+ {
+ File = "register_32.png";
+ };
+ Bitmap BMP_BACKING_INFO
+ {
+ File = "info_26.png";
+ };
+ Bitmap BMP_BACKING_TPLREP
+ {
+ File = "addtemplate_32.png";
+ };
};
Resource RES_BACKING_IMAGES_HC
@@ -165,6 +161,22 @@ Resource RES_BACKING_IMAGES_HC
{
File = "backing_rtl_right_hc.png";
};
+ Bitmap BMP_BACKING_EXT
+ {
+ File = "extension_hc.png";
+ };
+ Bitmap BMP_BACKING_REG
+ {
+ File = "register_hc.png";
+ };
+ Bitmap BMP_BACKING_INFO
+ {
+ File = "info_hc.png";
+ };
+ Bitmap BMP_BACKING_TPLREP
+ {
+ File = "template_hc.png";
+ };
};
Window WIN_TABWINDOW
diff --git a/framework/util/exports.map b/framework/util/exports.map
deleted file mode 100644
index 85610ad808..0000000000
--- a/framework/util/exports.map
+++ /dev/null
@@ -1,10 +0,0 @@
-UDK_3_0_0 {
- global:
- GetVersionInfo;
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/framework/util/makefile.mk b/framework/util/makefile.mk
index ed7e2e1315..65edaff42d 100644
--- a/framework/util/makefile.mk
+++ b/framework/util/makefile.mk
@@ -219,7 +219,7 @@ SHL3DEPN= $(SHL1IMPLIBN) $(SHL1TARGETN) $(SHL2TARGETN)
DEF3NAME= $(SHL3TARGET)
-SHL3VERSIONMAP= exports.map
+SHL3VERSIONMAP= $(SOLARENV)/src/component.map
# --- services library ----------------------------------------------------
@@ -278,7 +278,6 @@ SHL4OBJS= \
$(SLO)$/langselectionstatusbarcontroller.obj \
$(SLO)$/layoutmanager.obj \
$(SLO)$/loaddispatcher.obj \
- $(SLO)$/loaddispatchlistener.obj \
$(SLO)$/loadenv.obj \
$(SLO)$/menubarfactory.obj \
$(SLO)$/menubarmanager.obj \
@@ -361,7 +360,7 @@ SHL4DEPN= $(SHL1IMPLIBN) $(SHL1TARGETN) $(SHL2IMPLIBN) $(SHL2TARGETN)
DEF4NAME= $(SHL4TARGET)
-SHL4VERSIONMAP= exports.map
+SHL4VERSIONMAP= $(SOLARENV)/src/component.map
# --- services library ----------------------------------------------------
@@ -392,7 +391,7 @@ SHL5DEPN= $(SHL1IMPLIBN) $(SHL1TARGETN)
DEF5NAME= $(SHL5TARGET)
-SHL5VERSIONMAP= exports.map
+SHL5VERSIONMAP= $(SOLARENV)/src/component.map
RESLIB1NAME= fwe
RESLIB1IMAGES= $(PRJ)$/res
diff --git a/idl/util/svidl.hdb b/idl/util/svidl.hdb
deleted file mode 100644
index d57bedb453..0000000000
--- a/idl/util/svidl.hdb
+++ /dev/null
@@ -1,25 +0,0 @@
-write "/*************************************************************************"
-write "* SV.HXX"
-write "* __DATE__"
-write "* (c) 1992-1994 STAR DIVISION"
-write "*************************************************************************/"
-write "#ifndef _SVIDL_HXX"
-write "#define _SVIDL_HXX"
-write "#ifndef _PSTREAM_HXX"
-write "#include <pstream.hxx>"
-write "#endif"
-write "#ifndef _SBX_HXX"
-write "#include <sbx.hxx>"
-write "#endif"
-write "#define IDL_COMPILER /*vorlaeufig immer */"
-file char.hxx
-file hash.hxx
-file lex.hxx
-file bastype.hxx
-file basobj.hxx
-file types.hxx
-file object.hxx
-file slot.hxx
-file module.hxx
-file database.hxx
-write "#endif"
diff --git a/linguistic/prj/build.lst b/linguistic/prj/build.lst
index 8e09e3fd42..57c332f6f3 100644
--- a/linguistic/prj/build.lst
+++ b/linguistic/prj/build.lst
@@ -3,3 +3,4 @@ lg linguistic usr1 - all lg_mkout NULL
lg linguistic\prj get - all lg_prj NULL
lg linguistic\inc nmake - all lg_inc NULL
lg linguistic\source nmake - all lg_src lg_inc NULL
+lg linguistic\qa\unoapi nmake - all lg_qa_unoapi NULL
diff --git a/linguistic/qa/unoapi/Test.java b/linguistic/qa/unoapi/Test.java
new file mode 100644
index 0000000000..4a96418255
--- /dev/null
+++ b/linguistic/qa/unoapi/Test.java
@@ -0,0 +1,51 @@
+/*************************************************************************
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+************************************************************************/
+
+package org.openoffice.linguistic.qa.unoapi;
+
+import org.openoffice.Runner;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
+
+public final class Test {
+ @org.junit.Before public void setUp() throws Exception {
+ connection.setUp();
+ }
+
+ @org.junit.After public void tearDown()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ connection.tearDown();
+ }
+
+ @org.junit.Test public void test() {
+ assertTrue(
+ Runner.run(
+ "-sce", "lng.sce", "-xcl", "knownissues.xcl", "-cs",
+ connection.getDescription()));
+ }
+
+ private final OfficeConnection connection = new OfficeConnection();
+}
diff --git a/linguistic/qa/unoapi/makefile.mk b/linguistic/qa/unoapi/makefile.mk
index d24be03615..bd330c6fba 100644
--- a/linguistic/qa/unoapi/makefile.mk
+++ b/linguistic/qa/unoapi/makefile.mk
@@ -1,7 +1,6 @@
#*************************************************************************
-#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -22,19 +21,28 @@
# version 3 along with OpenOffice.org. If not, see
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
+#***********************************************************************/
-PRJ=..$/..
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
-PRJNAME=linguistic
-TARGET=qa_unoapi
+PRJ = ../..
+PRJNAME = linguistic
+TARGET = qa_unoapi
-.INCLUDE: settings.mk
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = org/openoffice/linguistic/qa/unoapi
+JAVATESTFILES = Test.java
+JAVAFILES = $(JAVATESTFILES)
+JARFILES = OOoRunner.jar ridl.jar test.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+.END
+.INCLUDE: settings.mk
.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
-ALLTAR : UNOAPI_TEST
+ALLTAR : javatest
-UNOAPI_TEST:
- +$(SOLARENV)$/bin$/checkapi -sce lng.sce -xcl knownissues.xcl -tdoc $(PWD)$/testdocuments
+.END
diff --git a/linguistic/source/convdiclist.cxx b/linguistic/source/convdiclist.cxx
index 3c95f1b52f..4647861b99 100644
--- a/linguistic/source/convdiclist.cxx
+++ b/linguistic/source/convdiclist.cxx
@@ -397,41 +397,12 @@ void ConvDicNameContainer::AddConvDics(
namespace
{
-template<typename T, typename InitData,
- typename Unique = InitData, typename Data = T>
-class StaticWithInit_ {
-public:
- /** Gets the static. Mutual exclusion is performed using the
- osl global mutex.
-
- @return
- static variable
- */
- static T & get() {
- return *rtl_Instance<
- T, StaticInstanceWithInit,
- ::osl::MutexGuard, ::osl::GetGlobalMutex,
- Data, InitData >::create( StaticInstanceWithInit(),
- ::osl::GetGlobalMutex(),
- InitData() );
- }
-private:
- struct StaticInstanceWithInit {
- T * operator () ( Data d ) {
- static T instance(d);
- return &instance;
+ struct StaticConvDicList : public rtl::StaticWithInit<
+ uno::Reference<XInterface>, StaticConvDicList> {
+ uno::Reference<XInterface> operator () () {
+ return (cppu::OWeakObject *) new ConvDicList;
}
};
-};
-
-//after src680m62 you can replace StaticWithInit_ with rtl::StaticWithInit and remove the above definition of StaticWithInit_
-
-struct StaticConvDicList : public StaticWithInit_<
- uno::Reference<XInterface>, StaticConvDicList> {
- uno::Reference<XInterface> operator () () {
- return (cppu::OWeakObject *) new ConvDicList;
- }
-};
}
diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx
index f48ac10fdb..82caafe02e 100644
--- a/linguistic/source/lngsvcmgr.cxx
+++ b/linguistic/source/lngsvcmgr.cxx
@@ -640,15 +640,14 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames )
for (sal_Int32 i = 0; i < nLen; ++i)
{
// property names look like
- // "ServiceManager/ThesaurusList/cfg:any['de-CH']"
+ // "ServiceManager/ThesaurusList/de-CH"
const OUString &rName = pPropertyNames[i];
- sal_Int32 nKeyStart, nKeyEnd;
- nKeyStart = rName.indexOf( A2OU("['"), 0 );
- nKeyEnd = rName.indexOf( A2OU("']"), nKeyStart + 2);
+ sal_Int32 nKeyStart;
+ nKeyStart = rName.lastIndexOf( '/' );
OUString aKeyText;
- if (nKeyStart != -1 && nKeyEnd != -1)
- aKeyText = rName.copy( nKeyStart + 2, nKeyEnd - nKeyStart - 2);
+ if (nKeyStart != -1)
+ aKeyText = rName.copy( nKeyStart + 1 );
DBG_ASSERT( aKeyText.getLength() != 0, "unexpected key (lang::Locale) string" );
if (0 == rName.compareTo( aSpellCheckerList, aSpellCheckerList.getLength() ))
{
diff --git a/linguistic/source/staticmb.cxx b/linguistic/source/staticmb.cxx
deleted file mode 100644
index e67e3e7cdb..0000000000
--- a/linguistic/source/staticmb.cxx
+++ /dev/null
@@ -1,29 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General 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_linguistic.hxx"
diff --git a/linguistic/workben/lex.map b/linguistic/workben/lex.map
deleted file mode 100644
index bd76ef3b85..0000000000
--- a/linguistic/workben/lex.map
+++ /dev/null
@@ -1,8 +0,0 @@
-LEX_1_0 {
- global:
- component_getFactory;
- component_getImplementationEnvironment;
- component_writeInfo;
- local:
- *;
-};
diff --git a/linguistic/workben/makefile.mk b/linguistic/workben/makefile.mk
index 5c8cc67e85..26cbb7ec8d 100644
--- a/linguistic/workben/makefile.mk
+++ b/linguistic/workben/makefile.mk
@@ -94,7 +94,7 @@ SHL1IMPLIB= i$(TARGET)
SHL1DEPN= $(SHL1LIBS)
SHL1DEF= $(MISC)$/$(SHL1TARGET).def
.IF "$(OS)"!="MACOSX"
-SHL1VERSIONMAP= $(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
.ENDIF
# build DEF file
diff --git a/officecfg/prj/build.lst b/officecfg/prj/build.lst
index dba837c643..04d2cfd87a 100644
--- a/officecfg/prj/build.lst
+++ b/officecfg/prj/build.lst
@@ -1,5 +1,4 @@
oc officecfg : l10n soltools solenv LIBXSLT:libxslt NULL
-oc officecfg usr30073 - none NULL
oc officecfg usr1 - all oc_mkout NULL
oc officecfg\registry\schema nmake - all oc_reg_schema NULL
oc officecfg\registry nmake - all oc_reg NULL
diff --git a/officecfg/prj/d.lst b/officecfg/prj/d.lst
index 66ba41abd6..debb9659a9 100644
--- a/officecfg/prj/d.lst
+++ b/officecfg/prj/d.lst
@@ -27,10 +27,8 @@ mkdir: %_DEST%\xml%_EXT%\registry\data\org\openoffice\Office\OOoImprovement
mkdir: %_DEST%\xml%_EXT%\registry\data\org\openoffice\ucb
mkdir: %_DEST%\xml%_EXT%\registry\data\org\openoffice\TypeDetection
-..\registry\schema\oo-ldap-attr.map %_DEST%\xml%_EXT%\registry\schema\oo-ldap-attr.map
-..\registry\schema\oo-ad-ldap-attr.map %_DEST%\xml%_EXT%\registry\schema\oo-ad-ldap-attr.map
-
-..\%__SRC%\misc\registry\data\org\openoffice\*.xcu.sample %_DEST%\xml%_EXT%\registry\data\org\openoffice\*.xcu.sample
+..\registry\schema\oo-ldap.xcd.sample %_DEST%\xml%_EXT%\oo-ldap.xcd.sample
+..\registry\schema\oo-ad-ldap.xcd.sample %_DEST%\xml%_EXT%\oo-ad-ldap.xcd.sample
..\%__SRC%\misc\registry\data\org\openoffice\*.xcu %_DEST%\xml%_EXT%\registry\data\org\openoffice
..\%__SRC%\misc\registry\data\org\openoffice\Office\*.xcu %_DEST%\xml%_EXT%\registry\data\org\openoffice\Office
diff --git a/officecfg/registry/component-schema.dtd b/officecfg/registry/component-schema.dtd
index 7fb3f4a1e5..17d265da91 100644
--- a/officecfg/registry/component-schema.dtd
+++ b/officecfg/registry/component-schema.dtd
@@ -1,127 +1,152 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
<!ELEMENT oor:component-schema (info?, import*, uses*, templates?, component)>
<!ATTLIST oor:component-schema
- oor:name NMTOKEN #REQUIRED
- oor:package NMTOKEN #REQUIRED
+ oor:package CDATA #REQUIRED
+ oor:name CDATA #REQUIRED
oor:version NMTOKEN #IMPLIED
xml:lang CDATA #IMPLIED
xmlns:oor CDATA #FIXED "http://openoffice.org/2001/registry"
- xmlns:xs CDATA #FIXED "http://www.w3.org/2001/XMLSchema"
- xmlns:xsi CDATA #FIXED "http://www.w3.org/2001/XMLSchema-instance"
->
+ xmlns:xs CDATA #FIXED "http://www.w3.org/2001/XMLSchema">
<!ELEMENT import EMPTY>
<!ATTLIST import
- oor:component CDATA #REQUIRED
->
+ oor:component CDATA #REQUIRED>
<!ELEMENT uses EMPTY>
<!ATTLIST uses
- oor:component CDATA #REQUIRED
->
+ oor:component CDATA #REQUIRED>
-<!ELEMENT templates (info?, (group | set)*)>
-<!ELEMENT component (info?, (node-ref | group | set)*)>
+<!ELEMENT templates (info?, (set | group)*)>
+<!ATTLIST templates>
<!ELEMENT info (deprecated?, author*, desc*, label*)>
+<!ATTLIST info>
<!ELEMENT deprecated (#PCDATA)>
+<!ATTLIST deprecated>
<!ELEMENT author (#PCDATA)>
+<!ATTLIST author>
<!ELEMENT desc (#PCDATA)>
<!ATTLIST desc
- xml:lang CDATA #IMPLIED
->
+ xml:lang CDATA #IMPLIED>
<!ELEMENT label (#PCDATA)>
<!ATTLIST label
- xml:lang CDATA #IMPLIED
->
+ xml:lang CDATA #IMPLIED>
-<!ELEMENT group (info?, (prop | node-ref | group | set)*)>
-<!ATTLIST group
- oor:name CDATA #REQUIRED
- oor:extensible (true | false) #IMPLIED
->
+<!ELEMENT component (info?, (set | group | prop | node-ref)*)>
+<!ATTLIST component>
<!ELEMENT set (info?, item*)>
<!ATTLIST set
oor:name CDATA #REQUIRED
- oor:node-type NMTOKEN #REQUIRED
- oor:component CDATA #IMPLIED
->
+ oor:node-type CDATA #REQUIRED
+ oor:component CDATA #IMPLIED>
-<!ELEMENT node-ref (info?)>
-<!ATTLIST node-ref
+<!ELEMENT item EMPTY>
+<!ATTLIST item
+ oor:node-type CDATA #REQUIRED
+ oor:component CDATA #IMPLIED>
+
+<!ELEMENT group (info?, (set | group | prop | node-ref)*)>
+<!ATTLIST group
oor:name CDATA #REQUIRED
- oor:node-type NMTOKEN #REQUIRED
- oor:component CDATA #IMPLIED
->
+ oor:extensible (false | true) #IMPLIED>
<!ELEMENT prop (info?, constraints?, value?)>
<!ATTLIST prop
oor:name CDATA #REQUIRED
- oor:type (xs:boolean | xs:short | xs:int | xs:long | xs:double | xs:string | xs:hexBinary | oor:any | oor:boolean-list | oor:short-list | oor:int-list | oor:long-list | oor:double-list | oor:string-list | oor:hexBinary-list) #REQUIRED
- oor:localized (true | false) #IMPLIED
- oor:nillable (true | false) #IMPLIED
->
-
-<!ELEMENT item EMPTY>
-<!ATTLIST item
- oor:node-type NMTOKEN #REQUIRED
- oor:component CDATA #IMPLIED
->
-
-<!ELEMENT value (#PCDATA)>
-<!ATTLIST value
- oor:separator CDATA #IMPLIED
->
-
-<!ELEMENT constraints (enumeration*, length?, minLength?, maxLength?, minInclusive?, maxInclusive?, minExclusive?, maxExclusive?, whiteSpace?)>
+ oor:localized (false | true) #IMPLIED
+ oor:type
+ (oor:any | xs:boolean | xs:short | xs:int | xs:long | xs:double |
+ xs:string | xs:hexBinary | oor:boolean-list | oor:short-list |
+ oor:int-list | oor:long-list | oor:double-list | oor:string-list |
+ oor:hexBinary-list)
+ #REQUIRED
+ oor:nillable (false | true) #IMPLIED>
+
+<!ELEMENT constraints
+ (enumeration*, length?, minLength?, maxLength?, minInclusive?,
+ maxInclusive?, minExclusive?, maxExclusive?, whiteSpace?)>
<!ELEMENT enumeration (info?)>
<!ATTLIST enumeration
- oor:value CDATA #REQUIRED
->
+ oor:value CDATA #REQUIRED>
<!ELEMENT length (info?)>
<!ATTLIST length
- oor:value CDATA #REQUIRED
->
+ oor:value CDATA #REQUIRED>
<!ELEMENT minLength (info?)>
<!ATTLIST minLength
- oor:value CDATA #REQUIRED
->
+ oor:value CDATA #REQUIRED>
<!ELEMENT maxLength (info?)>
<!ATTLIST maxLength
- oor:value CDATA #REQUIRED
->
+ oor:value CDATA #REQUIRED>
<!ELEMENT minInclusive (info?)>
<!ATTLIST minInclusive
- oor:value CDATA #REQUIRED
->
+ oor:value CDATA #REQUIRED>
<!ELEMENT maxInclusive (info?)>
<!ATTLIST maxInclusive
- oor:value CDATA #REQUIRED
->
+ oor:value CDATA #REQUIRED>
<!ELEMENT minExclusive (info?)>
<!ATTLIST minExclusive
- oor:value CDATA #REQUIRED
->
+ oor:value CDATA #REQUIRED>
<!ELEMENT maxExclusive (info?)>
<!ATTLIST maxExclusive
- oor:value CDATA #REQUIRED
->
+ oor:value CDATA #REQUIRED>
<!ELEMENT whiteSpace (info?)>
<!ATTLIST whiteSpace
- oor:value CDATA #REQUIRED
->
+ oor:value CDATA #REQUIRED>
+
+<!ELEMENT value (#PCDATA | it | unicode)*>
+<!ATTLIST value
+ oor:separator CDATA #IMPLIED>
+<!ELEMENT it (#PCDATA | unicode)*>
+<!ATTLIST it>
+
+<!ELEMENT unicode EMPTY>
+<!ATTLIST unicode
+ oor:scalar NMTOKEN #REQUIRED>
+
+<!ELEMENT node-ref (info?)>
+<!ATTLIST node-ref
+ oor:name CDATA #REQUIRED
+ oor:node-type CDATA #REQUIRED
+ oor:component CDATA #IMPLIED>
diff --git a/officecfg/registry/component-schema.xsd b/officecfg/registry/component-schema.xsd
deleted file mode 100644
index cc3c18a16c..0000000000
--- a/officecfg/registry/component-schema.xsd
+++ /dev/null
@@ -1,224 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- edited with XML Spy v4.3 U (http://www.xmlspy.com) by Dirk Grobler (OpenOffice) -->
-<xs:schema targetNamespace="http://openoffice.org/2001/registry" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified" attributeFormDefault="qualified">
- <xs:annotation>
- <xs:documentation>specifies the document format for OOo configuration component schemata.</xs:documentation>
- </xs:annotation>
- <xs:attribute name="extensible" type="xs:boolean" use="optional" default="false">
- <xs:annotation>
- <xs:documentation>determines, whether a node has an extensible list of attributes or fixed list of attributes.</xs:documentation>
- </xs:annotation>
-</xs:attribute>
-<xs:attribute name="localized" type="xs:boolean" use="optional" default="false">
- <xs:annotation>
- <xs:documentation>specifies, whether an attribute has or might have different values for different locales. </xs:documentation>
- </xs:annotation>
-</xs:attribute>
- <xs:attribute name="nillable" type="xs:boolean" use="optional" default="true">
- <xs:annotation>
- <xs:documentation>specifies, whether it is permissible to have a 'nil' i.e., missing, node content. The default for 'nillable' is 'true'.
-If a non-optional (nillable = 'false') has no default value (given in the component schema) it must be
-explicitly specified for each user.</xs:documentation>
- </xs:annotation>
-</xs:attribute>
- <xs:complexType name="prop">
- <xs:annotation>
- <xs:documentation>redefines the property type
- by adding documentation and type constraint elements.</xs:documentation>
- </xs:annotation>
- <xs:complexContent>
- <xs:extension base="oor:basic-prop">
- <xs:sequence>
- <xs:element name="info" type="oor:info" minOccurs="0"/>
- <xs:element name="constraints" minOccurs="0">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="enumeration" type="oor:constraint" minOccurs="0" maxOccurs="unbounded"/>
- <xs:element name="length" type="oor:constraint" minOccurs="0"/>
- <xs:element name="minLength" type="oor:constraint" minOccurs="0"/>
- <xs:element name="maxLength" type="oor:constraint" minOccurs="0"/>
- <xs:element name="minInclusive" type="oor:constraint" minOccurs="0"/>
- <xs:element name="maxInclusive" type="oor:constraint" minOccurs="0"/>
- <xs:element name="minExclusive" type="oor:constraint" minOccurs="0"/>
- <xs:element name="maxExclusive" type="oor:constraint" minOccurs="0"/>
- <xs:element name="whiteSpace" type="oor:constraint" minOccurs="0"/>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="value" type="oor:value" minOccurs="0"/>
- </xs:sequence>
- <xs:attribute ref="oor:localized"/>
- <xs:attribute ref="oor:nillable"/>
- <xs:attribute ref="oor:type" use="required"/>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- <xs:complexType name="group">
- <xs:annotation>
- <xs:documentation>type definition for group nodes</xs:documentation>
- </xs:annotation>
- <xs:complexContent>
- <xs:extension base="oor:basic-node">
- <xs:sequence>
- <xs:element name="info" type="oor:info" minOccurs="0"/>
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element name="prop" type="oor:prop" />
- <xs:element name="group" type="oor:group"/>
- <xs:element name="set" type="oor:set"/>
- <xs:element name="node-ref" type="oor:node-ref"/>
- </xs:choice>
- </xs:sequence>
- <xs:attribute ref="oor:extensible"/>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- <xs:complexType name="set">
- <xs:annotation>
- <xs:documentation>type definition for set nodes</xs:documentation>
- </xs:annotation>
- <xs:complexContent>
- <xs:extension base="oor:basic-node">
- <xs:sequence>
- <xs:element name="info" type="oor:info" minOccurs="0"/>
- <xs:element name="item" minOccurs="0" maxOccurs="unbounded">
- <xs:complexType>
- <xs:attributeGroup ref="oor:node-type-info" />
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- <xs:attribute ref="oor:extensible"/>
- <xs:attributeGroup ref="oor:node-type-info" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- <xs:complexType name="node-ref">
- <xs:annotation>
- <xs:documentation>allows to define node references. A node references points to an existing templated definition. This definition will be expanded at runtime.</xs:documentation>
- </xs:annotation>
- <xs:sequence>
- <xs:element name="info" type="oor:info" minOccurs="0"/>
- </xs:sequence>
- <xs:attribute ref="oor:name" use="required"/>
- <xs:attributeGroup ref="oor:node-type-info" />
- </xs:complexType>
- <xs:complexType name="constraint">
- <xs:annotation>
- <xs:documentation>basic type for constraints, which can be applied for property elements.</xs:documentation>
- </xs:annotation>
- <xs:sequence>
- <xs:element name="info" type="oor:info" minOccurs="0"/>
- </xs:sequence>
- <xs:attribute name="value" type="xs:anySimpleType" use="required"/>
- </xs:complexType>
- <xs:complexType name="info">
- <xs:annotation>
- <xs:documentation>type for providing human readable information. Can be attached to any kind of component schema element.</xs:documentation>
- </xs:annotation>
- <xs:sequence>
- <xs:element name="deprecated" type="xs:string" minOccurs="0">
- <xs:annotation>
- <xs:documentation>identifies an entry as deprecated. Can be assiciated with an explanation e.g. since when the entry is deprecated.</xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element name="author" type="xs:string" minOccurs="0" maxOccurs="unbounded">
- <xs:annotation>
- <xs:documentation>author(s) of the configuration entry.</xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element name="desc" minOccurs="0" maxOccurs="unbounded">
- <xs:complexType>
- <xs:annotation>
- <xs:documentation>provide a human
- readable documentation for a schema element.</xs:documentation>
- </xs:annotation>
- <xs:simpleContent>
- <xs:extension base="xs:string">
- <xs:attribute ref="xml:lang"/>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- <xs:element name="label" minOccurs="0" maxOccurs="unbounded">
- <xs:complexType>
- <xs:annotation>
- <xs:documentation>describes a title or label,
- which can be reused in a console.</xs:documentation>
- </xs:annotation>
- <xs:simpleContent>
- <xs:extension base="xs:string">
- <xs:attribute ref="xml:lang"/>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- <xs:element name="component-schema">
- <xs:annotation>
- <xs:documentation>Root element, which encompasses the schema specification</xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element name="info" type="oor:info" minOccurs="0"/>
- <xs:element name="import" minOccurs="0" maxOccurs="unbounded">
- <xs:complexType>
- <xs:attribute ref="oor:component" use="required"/>
- </xs:complexType>
- </xs:element>
- <xs:element name="uses" minOccurs="0" maxOccurs="unbounded">
- <xs:complexType>
- <xs:attribute ref="oor:component" use="required"/>
- </xs:complexType>
- </xs:element>
- <xs:element name="templates" minOccurs="0">
- <xs:complexType>
- <xs:sequence>
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element name="group" type="oor:group">
- <xs:unique name="groupMember">
- <xs:selector xpath="group|set|node-ref|prop"/>
- <xs:field xpath="@oor:name"/>
- </xs:unique>
- </xs:element>
- <xs:element name="set" type="oor:set"/>
- </xs:choice>
- </xs:sequence>
- </xs:complexType>
- <xs:unique name="templatesMember">
- <xs:selector xpath="oor:group|oor:set"/>
- <xs:field xpath="@oor:name"/>
- </xs:unique>
- </xs:element>
- <xs:element name="component">
- <xs:complexType>
- <xs:sequence>
- <xs:choice minOccurs="1" maxOccurs="unbounded">
- <xs:element name="prop" type="oor:prop"/>
- <xs:element name="node-ref" type="oor:node-ref"/>
- <xs:element name="group" type="oor:group">
- <xs:unique name="groupMember1">
- <xs:selector xpath="oor:group|oor:set|oor:node-ref|oor:prop"/>
- <xs:field xpath="@oor:name"/>
- </xs:unique>
- </xs:element>
- <xs:element name="set" type="oor:set"/>
- </xs:choice>
- </xs:sequence>
- </xs:complexType>
- <xs:unique name="schemaMember">
- <xs:selector xpath="oor:group|oor:set|oor:node-ref|oor:prop"/>
- <xs:field xpath="@oor:name"/>
- </xs:unique>
- </xs:element>
- </xs:sequence>
- <xs:attribute name="name" type="xs:NMTOKEN" use="required"/>
- <xs:attribute ref="oor:package"/>
- <xs:attribute name="version" type="xs:string" use="optional">
- <xs:annotation>
- <xs:documentation>identifies the version of the component. The version number is build of major.minor.micro</xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute ref="xml:lang" use="optional"/>
- </xs:complexType>
- </xs:element>
-</xs:schema>
diff --git a/officecfg/registry/component-types.xsd b/officecfg/registry/component-types.xsd
deleted file mode 100644
index 9b2f2371ce..0000000000
--- a/officecfg/registry/component-types.xsd
+++ /dev/null
@@ -1,135 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xs:schema targetNamespace="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:oor="http://openoffice.org/2001/registry" elementFormDefault="unqualified" attributeFormDefault="qualified">
- <xs:annotation>
- <xs:documentation>provides a list of standard attribute and element definitions, reused in most parts of the different OOR document types</xs:documentation>
- </xs:annotation>
- <xs:import namespace="http://www.w3.org/XML/1998/namespace"
- schemaLocation="http://www.w3.org/2001/xml.xsd"/>
- <!--List of attributes known in OOR-->
- <xs:attribute name="name" type="xs:string" use="required">
- <xs:annotation>
- <xs:documentation>identifies a node or an attribute within a tree, must be unique for all siblings.</xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute name="package" type="xs:NMTOKEN" use="required">
- <xs:annotation>
- <xs:documentation>contains the name of the package.
- Package names are composed similar to java packages.
- Packages are used to structure component configuration data.
- An example of a package is 'org.openoffice',
- where 'org' and 'openoffice' each define a package.</xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute name="node-type" type="xs:NMTOKEN">
- <xs:annotation>
- <xs:documentation>identifies the template to use for the set or a node reference. </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute name="component" type="xs:string" use="optional">
- <xs:annotation>
- <xs:documentation>specifies the component, which contains a template definition</xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute name="separator" type="xs:string" default=" ">
- <xs:annotation>
- <xs:documentation>specifies a separator for list types. The default
- is a blank, which is sufficient for most basic types like xs:int or
- xs:boolean. Only in certain cases, when using a sting or a binary
- list, the separator might differ. For example, a list of string values like build of the items 'europe' and 'south america' needs a different separator, as the usage of the default separator would result in a list of three items.</xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute name="type" use="optional">
- <xs:annotation>
- <xs:documentation>specifies the list of known basic types and their list equivalents. Is only allowed for properties.</xs:documentation>
- </xs:annotation>
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:enumeration value="xs:boolean"/>
- <xs:enumeration value="xs:short"/>
- <xs:enumeration value="xs:int"/>
- <xs:enumeration value="xs:long"/>
- <xs:enumeration value="xs:double"/>
- <xs:enumeration value="xs:string"/>
- <xs:enumeration value="xs:hexBinary"/>
- <xs:enumeration value="oor:any"/>
- <xs:enumeration value="oor:boolean-list"/>
- <xs:enumeration value="oor:short-list"/>
- <xs:enumeration value="oor:int-list"/>
- <xs:enumeration value="oor:long-list"/>
- <xs:enumeration value="oor:double-list"/>
- <xs:enumeration value="oor:string-list"/>
- <xs:enumeration value="oor:hexBinary-list"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- <xs:attributeGroup name="node-info">
- <xs:annotation>
- <xs:documentation>encompasses common attributes for nodes.</xs:documentation>
- </xs:annotation>
- <xs:attribute ref="oor:name" use="required"/>
- </xs:attributeGroup>
- <xs:attributeGroup name="node-type-info">
- <xs:annotation>
- <xs:documentation>encompasses attributes for referencing a node-type.</xs:documentation>
- </xs:annotation>
- <xs:attribute ref="oor:node-type" use="required"/>
- <xs:attribute ref="oor:component" use="optional"/>
- </xs:attributeGroup>
- <xs:attributeGroup name="prop-info">
- <xs:annotation>
- <xs:documentation>encompasses common attributes for properties.</xs:documentation>
- </xs:annotation>
- <xs:attribute ref="oor:name" use="required"/>
- </xs:attributeGroup>
- <!--List of list data types supported by OOR-->
- <xs:simpleType name="boolean-list">
- <xs:list itemType="xs:boolean"/>
- </xs:simpleType>
- <xs:simpleType name="short-list">
- <xs:list itemType="xs:short"/>
- </xs:simpleType>
- <xs:simpleType name="int-list">
- <xs:list itemType="xs:int"/>
- </xs:simpleType>
- <xs:simpleType name="long-list">
- <xs:list itemType="xs:long"/>
- </xs:simpleType>
- <xs:simpleType name="double-list">
- <xs:list itemType="xs:double"/>
- </xs:simpleType>
- <xs:simpleType name="string-list">
- <xs:restriction base="xs:string"/>
- </xs:simpleType>
- <xs:simpleType name="hexBinary-list">
- <xs:restriction base="xs:string"/>
- </xs:simpleType>
- <!--List of basic type definitions for all schema and instance elements known by OOR-->
- <xs:complexType name="basic-node">
- <xs:annotation>
- <xs:documentation>base class for all kinds of nodes (set | group)</xs:documentation>
- </xs:annotation>
- <xs:attributeGroup ref="oor:node-info"/>
- </xs:complexType>
- <xs:complexType name="basic-prop">
- <xs:annotation>
- <xs:documentation>type definition for node properties</xs:documentation>
- </xs:annotation>
- <xs:attributeGroup ref="oor:prop-info"/>
- </xs:complexType>
- <xs:complexType name="value">
- <xs:annotation>
- <xs:documentation>type definition for value nodes.</xs:documentation>
- </xs:annotation>
- <xs:simpleContent>
- <xs:extension base="oor:anyValue">
- <xs:attribute ref="oor:separator" use="optional"/>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- <xs:simpleType name="anyValue">
- <xs:annotation>
- <xs:documentation>defines the list of possible basic data-types for properties.</xs:documentation>
- </xs:annotation>
- <xs:union memberTypes="xs:boolean xs:short xs:int xs:long xs:double xs:string xs:hexBinary oor:boolean-list oor:short-list oor:int-list oor:long-list oor:double-list oor:string-list oor:hexBinary-list"/>
- </xs:simpleType>
-</xs:schema>
diff --git a/officecfg/registry/component-update.dtd b/officecfg/registry/component-update.dtd
index 10c4632a91..51623f40ba 100644
--- a/officecfg/registry/component-update.dtd
+++ b/officecfg/registry/component-update.dtd
@@ -1,41 +1,119 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
-<!ELEMENT oor:component-data ((prop|node)*)>
+<!ELEMENT oor:component-data ((node | prop)*)>
<!ATTLIST oor:component-data
- oor:name NMTOKEN #REQUIRED
- oor:package NMTOKEN #REQUIRED
- oor:finalized (true | false) #IMPLIED
- oor:op (modify | replace | fuse | remove | reset) #IMPLIED
- xmlns:oor CDATA #FIXED "http://openoffice.org/2001/registry"
- xmlns:install CDATA #FIXED "http://openoffice.org/2004/installation"
- xmlns:xs CDATA #FIXED "http://www.w3.org/2001/XMLSchema"
- xmlns:xsi CDATA #FIXED "http://www.w3.org/2001/XMLSchema-instance"
->
-
-<!ELEMENT node ((prop|node)*)>
+ oor:package CDATA #REQUIRED
+ oor:name CDATA #REQUIRED
+ oor:op (modify | replace | fuse | remove) #IMPLIED
+ oor:finalized (false | true) #IMPLIED
+ xmlns:oor CDATA #FIXED "http://openoffice.org/2001/registry"
+ xmlns:xs CDATA #FIXED "http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi CDATA #FIXED "http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:install CDATA #FIXED "http://openoffice.org/2004/installation">
+
+<!ELEMENT node ((node | prop)*)>
<!ATTLIST node
- oor:name CDATA #REQUIRED
- oor:component CDATA #IMPLIED
- oor:finalized (true | false) #IMPLIED
- oor:mandatory (true | false) #IMPLIED
- oor:op (modify | replace | fuse | remove | reset) #IMPLIED
- oor:node-type NMTOKEN #IMPLIED
- install:module NMTOKEN #IMPLIED
->
+ oor:name CDATA #REQUIRED
+ oor:op (modify | replace | fuse | remove) #IMPLIED
+ oor:finalized (true | false) #IMPLIED
+ oor:mandatory (true | false) #IMPLIED
+ oor:node-type CDATA #IMPLIED
+ oor:component CDATA #IMPLIED
+ install:module CDATA #IMPLIED>
<!ELEMENT prop (value*)>
<!ATTLIST prop
- oor:name CDATA #REQUIRED
- oor:op (modify | replace | fuse | remove | reset) #IMPLIED
- oor:finalized CDATA #IMPLIED
- oor:type (xs:boolean | xs:short | xs:int | xs:long | xs:double | xs:string | xs:hexBinary | oor:boolean-list | oor:short-list | oor:int-list | oor:long-list | oor:double-list | oor:string-list | oor:hexBinary-list) #IMPLIED
- install:module NMTOKEN #IMPLIED
->
-
-<!ELEMENT value (#PCDATA)>
+ oor:name CDATA #REQUIRED
+ oor:op (modify | replace | fuse | remove) #IMPLIED
+ oor:finalized (true | false) #IMPLIED
+ oor:type
+ (oor:any | xs:boolean | xs:short | xs:int | xs:long | xs:double |
+ xs:string | xs:hexBinary | oor:boolean-list | oor:short-list |
+ oor:int-list | oor:long-list | oor:double-list | oor:string-list |
+ oor:hexBinary-list)
+ #IMPLIED
+ install:module CDATA #IMPLIED>
+
+<!ELEMENT value (#PCDATA | it | unicode)*>
+ <!-- EMPTY if oor:op="remove", xsi:nil="true", or oor:external is used
+ #PCDATA if the property type is a non-list type other than xs:string
+ (#PCDATA | unicode)* if the property type is xs:string
+ #PCDATA or it* if the property type is a list type other than
+ oor:string-list
+ (#PCDATA | unicode)* or it* if the property type is
+ oor:string-list -->
<!ATTLIST value
- xsi:nil (true | false) #IMPLIED
- oor:separator CDATA #IMPLIED
- xml:lang CDATA #IMPLIED
- install:module NMTOKEN #IMPLIED
->
+ xml:lang CDATA #IMPLIED
+ oor:op (fuse | remove) #IMPLIED
+ xsi:nil (true | false) #IMPLIED
+ oor:type
+ (xs:boolean | xs:short | xs:int | xs:long | xs:double | xs:string |
+ xs:hexBinary | oor:boolean-list | oor:short-list | oor:int-list |
+ oor:long-list | oor:double-list | oor:string-list | oor:hexBinary-list)
+ #IMPLIED
+ oor:separator CDATA #IMPLIED
+ oor:external CDATA #IMPLIED
+ install:module CDATA #IMPLIED>
+ <!-- xml:lang must only be used for localized properties; defaults to the
+ empty string
+ oor:op defaults to "fuse"; "remove" must only be used for localized
+ properties
+ xsi:nil defaults to "false"; "true" must only be used for nillable
+ properties
+ oor:type is relevant for localized properties of type oor:any with
+ different value types for different locales
+ oor:separator must only be used if the property type is a list type
+ and the element content is #PCDATA or (#PCDATA | unicode)* (and not
+ EMPTY or it*)
+ oor:external must only be used for non-localized properties and must
+ not be used together with xsi:nil="true" -->
+
+<!ELEMENT it (#PCDATA | unicode)*>
+ <!-- #PCDATA if the property type is a list type other than
+ oor:string-list
+ (#PCDATA | unicode)* if the property type is oor:string-list -->
+<!ATTLIST it>
+
+<!ELEMENT unicode EMPTY>
+<!ATTLIST unicode
+ oor:scalar NMTOKEN #REQUIRED>
+ <!-- must syntactically match xs:integer and have a value in {0, ..., 8,
+ 11, 12, 14, ..., 31, 65534, 65535} -->
+
+<!-- oor:items is an alternative root element to oor:component-data (in plain
+ .xcu files only; not when nested in an .xcd file), used for the user-layer
+ registrymodifications.xcu: -->
+
+<!ELEMENT oor:items (item*)>
+<!ATTLIST oor:items>
+
+<!ELEMENT item ((prop | node)*)>
+<!ATTLIST item
+ oor:path CDATA #REQUIRED>
+ <!-- the absolute path representation of a set or group node -->
diff --git a/officecfg/registry/component-update.xsd b/officecfg/registry/component-update.xsd
deleted file mode 100644
index 5e0d099473..0000000000
--- a/officecfg/registry/component-update.xsd
+++ /dev/null
@@ -1,113 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xs:schema targetNamespace="http://openoffice.org/2001/registry" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified" attributeFormDefault="qualified">
- <xs:annotation>
- <xs:documentation>defines the document format for configuration update documents.
- Updates are increments to default documents like a component schema and contain
- additional information for merging and access control</xs:documentation>
- </xs:annotation>
- <xs:redefine schemaLocation="component-types.xsd">
- <xs:complexType name="value">
- <xs:annotation>
- <xs:documentation>adds the xml:lang attribute for localized information. Only the update format is allowed to contain localized data.</xs:documentation>
- </xs:annotation>
- <xs:simpleContent>
- <xs:extension base="oor:value">
- <xs:attribute ref="xml:lang"/>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:redefine>
- <xs:complexType name="node">
- <xs:annotation>
- <xs:documentation>Identifies a node in the schema by it's name and position within the hierarchy. Overrides or adds information from the base layer. A node can be of type set or group.</xs:documentation>
- </xs:annotation>
- <xs:complexContent>
- <xs:extension base="oor:basic-node">
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element name="node" type="oor:node"/>
- <xs:element name="prop" type="oor:prop">
- <xs:unique name="uniqueLang">
- <xs:selector xpath="oor:value"/>
- <xs:field xpath="@xml:lang"/>
- </xs:unique>
- </xs:element>
- </xs:choice>
- <xs:attributeGroup ref="oor:update-info"/>
- <xs:attribute ref="oor:mandatory"/>
- <xs:attributeGroup ref="oor:node-type-info" use="optional"/>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- <xs:complexType name="prop">
- <xs:annotation>
- <xs:documentation>adds operational info to a property, should only be applied for dynamic properties. Dynamic properties are not available in the component schema and are added or removed during runtime.</xs:documentation>
- </xs:annotation>
- <xs:complexContent>
- <xs:extension base="oor:basic-prop">
- <xs:sequence minOccurs="0" maxOccurs="unbounded">
- <xs:element name="value" type="oor:value" nillable="true"/>
- </xs:sequence>
- <xs:attributeGroup ref="oor:update-info"/>
- <xs:attribute ref="oor:type" use="optional"/>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- <xs:attributeGroup name="update-info">
- <xs:attribute ref="oor:finalized"/>
- <xs:attribute ref="oor:readonly"/>
- <xs:attribute ref="oor:op"/>
- </xs:attributeGroup>
- <xs:attribute name="op" use="optional" default="modify">
- <xs:annotation>
- <xs:documentation>defines a list of possible operations, which are applied during merging of node fragments.</xs:documentation>
- </xs:annotation>
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:enumeration value="modify"/>
- <xs:enumeration value="replace"/>
- <xs:enumeration value="fuse"/>
- <xs:enumeration value="remove"/>
- <xs:enumeration value="reset"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- <xs:attribute name="finalized" type="xs:boolean" use="optional" default="false">
- <xs:annotation>
- <xs:documentation>indicates that the content of a node and its descendant nodes are not allowed to be overwritten.</xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute name="mandatory" type="xs:boolean" default="false">
- <xs:annotation>
- <xs:documentation>specifies that a node MUST be present and can not be removed or replaced by a node during the merging process. </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute name="readonly" type="xs:boolean" use="optional" default="false">
- <xs:annotation>
- <xs:documentation>determines, whether a node and its descendants are readonly or not. This is a computed attribute and can not be set by an application.</xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:element name="component-data">
- <xs:annotation>
- <xs:documentation>root element of the update document.</xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:extension base="oor:basic-node">
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element name="node" type="oor:node"/>
- <xs:element name="prop" type="oor:prop">
- <xs:unique name="uniqueLang">
- <xs:selector xpath="oor:value"/>
- <xs:field xpath="@xml:lang"/>
- </xs:unique>
- </xs:element>
- </xs:choice>
- <xs:attributeGroup ref="oor:update-info"/>
- <xs:attribute ref="oor:package"/>
- </xs:extension>
- </xs:complexType>
- <xs:unique name="member">
- <xs:selector xpath="oor:node|oor:prop"/>
- <xs:field xpath="@oor:name"/>
- </xs:unique>
- </xs:element>
-</xs:schema>
diff --git a/officecfg/registry/data.dtd b/officecfg/registry/data.dtd
new file mode 100644
index 0000000000..c3f7d0a61b
--- /dev/null
+++ b/officecfg/registry/data.dtd
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<!ELEMENT oor:data (dependency*, (oor:component-schema | oor:component-data)*)>
+<!ATTLIST oor:data>
+
+<!ELEMENT dependency EMPTY>
+<!ATTLIST dependency
+ file CDATA #REQUIRED>
+
+<!ENTITY % component-schema.dtd SYSTEM "component-schema.dtd">
+%component-schema.dtd;
+
+<!ENTITY % component-update.dtd SYSTEM "component-update.dtd">
+%component-update.dtd;
diff --git a/officecfg/registry/data/org/openoffice/Inet.xcu b/officecfg/registry/data/org/openoffice/Inet.xcu
index c2e955e49a..2f8e44c784 100644
--- a/officecfg/registry/data/org/openoffice/Inet.xcu
+++ b/officecfg/registry/data/org/openoffice/Inet.xcu
@@ -26,10 +26,72 @@
*
************************************************************************ -->
<!DOCTYPE oor:component-data SYSTEM "../../../component-update.dtd">
-<oor:component-data oor:name="Inet" oor:package="org.openoffice" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<oor:component-data oor:name="Inet" oor:package="org.openoffice" xmlns:oor="http://openoffice.org/2001/registry" xmlns:install="http://openoffice.org/2004/installation" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<node oor:name="Settings">
+ <prop oor:name="ooInetNoProxy">
+ <value install:module="macosx" oor:external=
+ "com.sun.star.configuration.backend.MacOSXBackend ooInetNoProxy"/>
+ <value install:module="unixdesktop" oor:external=
+ "com.sun.star.configuration.backend.DesktopBackend ooInetNoProxy"/>
+ <value install:module="wnt" oor:external=
+ "com.sun.star.configuration.backend.WinInetBackend ooInetNoProxy"/>
+ </prop>
<prop oor:name="ooInetProxyType">
<value>1</value>
+ <value install:module="macosx" oor:external=
+ "com.sun.star.configuration.backend.MacOSXBackend ooInetProxyType"/>
+ <value install:module="unixdesktop" oor:external=
+ "com.sun.star.configuration.backend.DesktopBackend ooInetProxyType"/>
+ <value install:module="wnt" oor:external=
+ "com.sun.star.configuration.backend.WinInetBackend ooInetProxyType"/>
+ </prop>
+ <prop oor:name="ooInetFTPProxyName">
+ <value install:module="macosx" oor:external=
+ "com.sun.star.configuration.backend.MacOSXBackend ooInetFTPProxyName"/>
+ <value install:module="unixdesktop" oor:external=
+ "com.sun.star.configuration.backend.DesktopBackend ooInetFTPProxyName"/>
+ <value install:module="wnt" oor:external=
+ "com.sun.star.configuration.backend.WinInetBackend ooInetFTPProxyName"/>
+ </prop>
+ <prop oor:name="ooInetFTPProxyPort">
+ <value install:module="macosx" oor:external=
+ "com.sun.star.configuration.backend.MacOSXBackend ooInetFTPProxyPort"/>
+ <value install:module="unixdesktop" oor:external=
+ "com.sun.star.configuration.backend.DesktopBackend ooInetFTPProxyPort"/>
+ <value install:module="wnt" oor:external=
+ "com.sun.star.configuration.backend.WinInetBackend ooInetFTPProxyPort"/>
+ </prop>
+ <prop oor:name="ooInetHTTPProxyName">
+ <value install:module="macosx" oor:external=
+ "com.sun.star.configuration.backend.MacOSXBackend ooInetHTTPProxyName"/>
+ <value install:module="unixdesktop" oor:external=
+ "com.sun.star.configuration.backend.DesktopBackend ooInetHTTPProxyName"/>
+ <value install:module="wnt" oor:external=
+ "com.sun.star.configuration.backend.WinInetBackend ooInetHTTPProxyName"/>
+ </prop>
+ <prop oor:name="ooInetHTTPProxyPort">
+ <value install:module="macosx" oor:external=
+ "com.sun.star.configuration.backend.MacOSXBackend ooInetHTTPProxyPort"/>
+ <value install:module="unixdesktop" oor:external=
+ "com.sun.star.configuration.backend.DesktopBackend ooInetHTTPProxyPort"/>
+ <value install:module="wnt" oor:external=
+ "com.sun.star.configuration.backend.WinInetBackend ooInetHTTPProxyPort"/>
+ </prop>
+ <prop oor:name="ooInetHTTPSProxyName">
+ <value install:module="macosx" oor:external=
+ "com.sun.star.configuration.backend.MacOSXBackend ooInetHTTPSProxyName"/>
+ <value install:module="unixdesktop" oor:external=
+ "com.sun.star.configuration.backend.DesktopBackend ooInetHTTPSProxyName"/>
+ <value install:module="wnt" oor:external=
+ "com.sun.star.configuration.backend.WinInetBackend ooInetHTTPSProxyName"/>
+ </prop>
+ <prop oor:name="ooInetHTTPSProxyPort">
+ <value install:module="macosx" oor:external=
+ "com.sun.star.configuration.backend.MacOSXBackend ooInetHTTPSProxyPort"/>
+ <value install:module="unixdesktop" oor:external=
+ "com.sun.star.configuration.backend.DesktopBackend ooInetHTTPSProxyPort"/>
+ <value install:module="wnt" oor:external=
+ "com.sun.star.configuration.backend.WinInetBackend ooInetHTTPSProxyPort"/>
</prop>
</node>
<node oor:name="SearchEngines">
diff --git a/officecfg/registry/data/org/openoffice/Interaction.xcu b/officecfg/registry/data/org/openoffice/Interaction.xcu
new file mode 100644
index 0000000000..4269378c36
--- /dev/null
+++ b/officecfg/registry/data/org/openoffice/Interaction.xcu
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--***********************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************ -->
+<!DOCTYPE oor:component-data SYSTEM "../../../component-update.dtd">
+<oor:component-data oor:name="Interaction" oor:package="org.openoffice" xmlns:oor="http://openoffice.org/2001/registry" xmlns:install="http://openoffice.org/2004/installation" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <node oor:name="InteractionHandlers">
+ <!-- The interaction handler for SQLExceptions (and derived exceptions), implemented in the Base module.
+ -->
+ <node oor:name="org.openoffice.Office.Base.DatabaseInteractions" oor:op="replace">
+ <node oor:name="HandledRequestTypes">
+ <node oor:name="com.sun.star.sdbc.SQLException" oor:op="replace">
+ <prop oor:name="Propagation" oor:type="xs:string">
+ <value>named-and-derived</value>
+ </prop>
+ </node>
+ <node oor:name="com.sun.star.sdb.ParametersRequest" oor:op="replace">
+ <prop oor:name="Propagation" oor:type="xs:string">
+ <value>named-and-derived</value>
+ </prop>
+ </node>
+ <node oor:name="com.sun.star.sdb.DocumentSaveRequest" oor:op="replace">
+ <prop oor:name="Propagation" oor:type="xs:string">
+ <value>named-and-derived</value>
+ </prop>
+ </node>
+ </node>
+ <prop oor:name="ServiceName" oor:type="xs:string">
+ <value>com.sun.star.comp.dbaccess.DatabaseInteractionHandler</value>
+ </prop>
+ </node>
+ </node>
+</oor:component-data>
diff --git a/officecfg/registry/data/org/openoffice/LDAP.xcu.sample b/officecfg/registry/data/org/openoffice/LDAP.xcu.sample
deleted file mode 100644
index 2917e65a51..0000000000
--- a/officecfg/registry/data/org/openoffice/LDAP.xcu.sample
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--***********************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************ -->
-<!-- This file is an example of an LDAP.xcu ldap configuration file.
-
- To use user data from LDAP in your installation, you need to provide a
- customized version of this file named 'LDAP.xcu'.
-
- To customize values in this file, please replace the data within
- <value>...</value> elements with the values for your organization.
-
- If a certain setting is not necessary for your installation, you may remove the
- entire 'prop' element, i.e. everything from '<prop oor:name="[SettingName]"' to
- the closing '</prop>'.
--->
-<oor:component-data oor:name="LDAP" oor:package="org.openoffice"
- xmlns:oor="http://openoffice.org/2001/registry"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <node oor:name="UserDirectory">
- <node oor:name="ServerDefinition">
- <prop oor:name="Server" oor:type="xs:string">
- <value>ldapserver.mycorp.com</value>
- </prop>
- <prop oor:name="BaseDN" oor:type="xs:string">
- <value>dc=mycorp,dc=com</value>
- </prop>
- <prop oor:name="Port" oor:type="xs:int">
- <value>389</value>
- </prop>
- </node>
- <!-- The following settings should be omitted, if anonymous access is possible
- <prop oor:name="SearchUser" oor:type="xs:string"><value>MyUserLogin</value></prop>
- <prop oor:name="SearchPassword" oor:type="xs:string"><value>MyPassword</value></prop>
- -->
- <prop oor:name="UserObjectClass" oor:type="xs:string">
- <value>inetorgperson</value>
- </prop>
- <prop oor:name="UserUniqueAttribute" oor:type="xs:string">
- <value>uid</value>
- </prop>
- <prop oor:name="Mapping" oor:type="xs:string">
- <value>oo-ldap</value>
- </prop>
- </node>
-</oor:component-data>
diff --git a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu
index 18b0658cc0..c197b77231 100644..100755
--- a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu
@@ -394,6 +394,7 @@
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="de">.uno:AlignBlock</value>
<value xml:lang="en-US">.uno:Bold</value>
+ <value xml:lang="es">.uno:SearchDialog</value>
</prop>
</node>
<node oor:name="B_SHIFT_MOD1" oor:op="replace">
@@ -459,6 +460,7 @@
<node oor:name="E_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:AlignHorizontalCenter</value>
+ <value xml:lang="es">.uno:SelectAll</value>
</prop>
</node>
<node oor:name="F11" oor:op="replace">
@@ -828,6 +830,7 @@
<node oor:name="U_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:Underline</value>
+ <value xml:lang="es">.uno:AddDirect</value>
</prop>
</node>
<node oor:name="U_SHIFT_MOD1" oor:op="replace">
@@ -988,6 +991,7 @@
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="de">.uno:JustifyPara</value>
<value xml:lang="en-US">.uno:Bold</value>
+ <value xml:lang="es">.uno:SearchDialog</value>
</prop>
</node>
<node oor:name="B_SHIFT_MOD1" oor:op="replace">
@@ -1023,6 +1027,7 @@
<node oor:name="E_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:CenterPara</value>
+ <value xml:lang="es">.uno:SelectAll</value>
</prop>
</node>
<node oor:name="F11" oor:op="replace">
@@ -1228,6 +1233,7 @@
<node oor:name="U_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:Underline</value>
+ <value xml:lang="es">.uno:AddDirect</value>
</prop>
</node>
<node oor:name="U_SHIFT_MOD1" oor:op="replace">
@@ -1336,6 +1342,7 @@
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="de">.uno:JustifyPara</value>
<value xml:lang="en-US">.uno:Bold</value>
+ <value xml:lang="es">.uno:SearchDialog</value>
</prop>
</node>
<node oor:name="B_SHIFT_MOD1" oor:op="replace">
@@ -1421,6 +1428,7 @@
<node oor:name="E_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:CenterPara</value>
+ <value xml:lang="es">.uno:SelectAll</value>
</prop>
</node>
<node oor:name="F10_MOD1" oor:op="replace">
@@ -1835,6 +1843,7 @@
<node oor:name="U_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:Underline</value>
+ <value xml:lang="es">.uno:AddDirect</value>
</prop>
</node>
<node oor:name="U_SHIFT_MOD1" oor:op="replace">
@@ -1869,6 +1878,12 @@
</node>
</node>
<node oor:name="com.sun.star.presentation.PresentationDocument" oor:op="replace">
+ <node oor:name="N_MOD1_MOD2" oor:op="replace">
+ <prop oor:name="Command">
+ <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
+ <value xml:lang="en-US">.uno:InsertAnnotation</value>
+ </prop>
+ </node>
<node oor:name="PAGEDOWN_MOD1_MOD2" oor:op="replace">
<prop oor:name="Command">
<value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
@@ -1925,6 +1940,7 @@
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="de">.uno:JustifyPara</value>
<value xml:lang="en-US">.uno:Bold</value>
+ <value xml:lang="es">.uno:SearchDialog</value>
</prop>
</node>
<node oor:name="B_SHIFT_MOD1" oor:op="replace">
@@ -1965,6 +1981,7 @@
<node oor:name="E_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:CenterPara</value>
+ <value xml:lang="es">.uno:SelectAll</value>
</prop>
</node>
<node oor:name="F11" oor:op="replace">
@@ -2195,6 +2212,7 @@
<node oor:name="U_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:Underline</value>
+ <value xml:lang="es">.uno:AddDirect</value>
</prop>
</node>
<node oor:name="U_SHIFT_MOD1" oor:op="replace">
@@ -2355,6 +2373,7 @@
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="de">.uno:JustifyPara</value>
<value xml:lang="en-US">.uno:Bold</value>
+ <value xml:lang="es">.uno:SearchDialog</value>
</prop>
</node>
<node oor:name="B_SHIFT_MOD1" oor:op="replace">
@@ -2440,6 +2459,7 @@
<node oor:name="E_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:CenterPara</value>
+ <value xml:lang="es">.uno:SelectAll</value>
</prop>
</node>
<node oor:name="F10_MOD1" oor:op="replace">
@@ -2854,6 +2874,7 @@
<node oor:name="U_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:Underline</value>
+ <value xml:lang="es">.uno:AddDirect</value>
</prop>
</node>
<node oor:name="U_SHIFT_MOD1" oor:op="replace">
@@ -2967,6 +2988,7 @@
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="de">.uno:JustifyPara</value>
<value xml:lang="en-US">.uno:Bold</value>
+ <value xml:lang="es">.uno:SearchDialog</value>
</prop>
</node>
<node oor:name="B_SHIFT_MOD1" oor:op="replace">
@@ -3057,6 +3079,7 @@
<node oor:name="E_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:CenterPara</value>
+ <value xml:lang="es">.uno:SelectAll</value>
</prop>
</node>
<node oor:name="F10_MOD1" oor:op="replace">
@@ -3491,6 +3514,7 @@
<node oor:name="U_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:Underline</value>
+ <value xml:lang="es">.uno:AddDirect</value>
</prop>
</node>
<node oor:name="U_SHIFT_MOD1" oor:op="replace">
@@ -3589,6 +3613,7 @@
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="de">.uno:JustifyPara</value>
<value xml:lang="en-US">.uno:Bold</value>
+ <value xml:lang="es">.uno:SearchDialog</value>
</prop>
</node>
<node oor:name="B_SHIFT_MOD1" oor:op="replace">
@@ -3674,6 +3699,7 @@
<node oor:name="E_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:CenterPara</value>
+ <value xml:lang="es">.uno:SelectAll</value>
</prop>
</node>
<node oor:name="F10_MOD1" oor:op="replace">
@@ -4088,6 +4114,7 @@
<node oor:name="U_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:Underline</value>
+ <value xml:lang="es">.uno:AddDirect</value>
</prop>
</node>
<node oor:name="U_SHIFT_MOD1" oor:op="replace">
@@ -4191,6 +4218,7 @@
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="de">.uno:JustifyPara</value>
<value xml:lang="en-US">.uno:Bold</value>
+ <value xml:lang="es">.uno:SearchDialog</value>
</prop>
</node>
<node oor:name="B_SHIFT_MOD1" oor:op="replace">
@@ -4248,7 +4276,7 @@
<value xml:lang="en-US">.uno:ParaRightToLeft</value>
</prop>
</node>
- <node oor:name="END" oor:op="replace">
+ <node oor:name="END" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:GoToEndOfLine</value>
</prop>
@@ -4276,6 +4304,7 @@
<node oor:name="E_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:CenterPara</value>
+ <value xml:lang="es">.uno:SelectAll</value>
</prop>
</node>
<node oor:name="F10_MOD1" oor:op="replace">
@@ -4690,6 +4719,7 @@
<node oor:name="U_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:Underline</value>
+ <value xml:lang="es">.uno:AddDirect</value>
</prop>
</node>
<node oor:name="U_SHIFT_MOD1" oor:op="replace">
@@ -4798,6 +4828,7 @@
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="de">.uno:JustifyPara</value>
<value xml:lang="en-US">.uno:Bold</value>
+ <value xml:lang="es">.uno:SearchDialog</value>
</prop>
</node>
<node oor:name="B_SHIFT_MOD1" oor:op="replace">
@@ -4883,6 +4914,7 @@
<node oor:name="E_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:CenterPara</value>
+ <value xml:lang="es">.uno:SelectAll</value>
</prop>
</node>
<node oor:name="F10_MOD1" oor:op="replace">
@@ -5297,6 +5329,7 @@
<node oor:name="U_MOD1" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:Underline</value>
+ <value xml:lang="es">.uno:AddDirect</value>
</prop>
</node>
<node oor:name="U_SHIFT_MOD1" oor:op="replace">
@@ -5499,7 +5532,13 @@
</node>
</node>
<node oor:name="com.sun.star.drawing.DrawingDocument" oor:op="replace">
- <node oor:name="BACKSPACE_MOD2" oor:op="replace">
+ <node oor:name="N_MOD1_MOD2" oor:op="replace">
+ <prop oor:name="Command">
+ <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
+ <value xml:lang="en-US">.uno:InsertAnnotation</value>
+ </prop>
+ </node>
+ <node oor:name="BACKSPACE_MOD2" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:Undo</value>
</prop>
@@ -5529,7 +5568,19 @@
<value xml:lang="en-US">.uno:Paste</value>
</prop>
</node>
- <node oor:name="OPEN" oor:op="replace">
+ <node oor:name="K_MOD1" oor:op="replace">
+ <prop oor:name="Command">
+ <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
+ <value xml:lang="es">.uno:Italic</value>
+ </prop>
+ </node>
+ <node oor:name="N_MOD1" oor:op="replace">
+ <prop oor:name="Command">
+ <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
+ <value xml:lang="es">.uno:Bold</value>
+ </prop>
+ </node>
+ <node oor:name="OPEN" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:Open</value>
</prop>
@@ -5603,7 +5654,19 @@
<value xml:lang="en-US">.uno:Paste</value>
</prop>
</node>
- <node oor:name="OPEN" oor:op="replace">
+ <node oor:name="K_MOD1" oor:op="replace">
+ <prop oor:name="Command">
+ <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
+ <value xml:lang="es">.uno:Italic</value>
+ </prop>
+ </node>
+ <node oor:name="N_MOD1" oor:op="replace">
+ <prop oor:name="Command">
+ <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
+ <value xml:lang="es">.uno:Bold</value>
+ </prop>
+ </node>
+ <node oor:name="OPEN" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:Open</value>
</prop>
@@ -5613,6 +5676,20 @@
<value xml:lang="en-US">.uno:Paste</value>
</prop>
</node>
+ <node oor:name="S_MOD1" oor:op="replace">
+ <prop oor:name="Command">
+ <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
+ <value xml:lang="es">.uno:Underline</value>
+ </prop>
+ </node>
+ <node oor:name="T_MOD1" oor:op="replace">
+ <prop oor:name="Command">
+ <value xml:lang="x-no-translate" install:module="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
+ <value xml:lang="de" install:module="unxwnt">.uno:SubScript</value>
+ <value xml:lang="es" install:module="unxwnt">.uno:AlignHorizontalCenter</value>
+ <value xml:lang="en-US" install:module="macosx">.uno:DesignerDialog</value>
+ </prop>
+ </node>
<node oor:name="UNDO" oor:op="replace">
<prop oor:name="Command"><value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
<value xml:lang="en-US">.uno:Undo</value>
diff --git a/officecfg/registry/data/org/openoffice/Office/Common.xcu b/officecfg/registry/data/org/openoffice/Office/Common.xcu
index 1bca926e38..722ed4df10 100644
--- a/officecfg/registry/data/org/openoffice/Office/Common.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Common.xcu
@@ -100,6 +100,27 @@
<value xml:lang="zh-TW">13</value>
</prop>
</node>
+ <node oor:name="FontAntiAliasing" install:module="gconflockdown">
+ <prop oor:name="Enabled">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend FontAntiAliasingEnabled"/>
+ </prop>
+ <prop oor:name="MinPixelHeight">
+ <value oor:external=
+"com.sun.star.configuration.backend.GconfBackend FontAntiAliasingMinPixelHeight"
+/>
+ </prop>
+ </node>
+ <node oor:name="Menu" install:module="gconflockdown">
+ <prop oor:name="DontHideDisabledEntry">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend DontHideDisabledEntry"/>
+ </prop>
+ <prop oor:name="ShowIconsInMenues">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend ShowIconsInMenues"/>
+ </prop>
+ </node>
</node>
<node oor:name="Help">
<node oor:name="StartCenter">
@@ -113,6 +134,9 @@
<prop oor:name="TemplateRepositoryURL" oor:type="xs:string">
<value>${STARTCENTER_TEMPLREP_URL}</value>
</prop>
+ <prop oor:name="StartCenterLayoutStyle" oor:type="xs:int">
+ <value>${STARTCENTER_LAYOUT_STYLE}</value>
+ </prop>
</node>
<node oor:name="Registration">
<prop oor:name="TemplateURL">
@@ -546,18 +570,32 @@
</node>
</node>
<node oor:name="Misc">
- <prop oor:name="UseSystemFileDialog" install:module="UseOOoFileDialogs">
- <value>false</value>
+ <prop oor:name="UseSystemFileDialog">
+ <value install:module="UseOOoFileDialogs">false</value>
+ <value install:module="gconflockdown" oor:external=
+ "com.sun.star.configuration.backend.GconfBackend UseSystemFileDialog"/>
</prop>
<prop oor:name="UseSystemPrintDialog" install:module="macosx">
<value>true</value>
</prop>
+ <prop oor:name="SymbolSet" install:module="gconflockdown">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend SymbolSet"/>
+ </prop>
</node>
<node oor:name="Save">
<node oor:name="Document">
<prop oor:name="SaveBackwardCompatibleODF" oor:type="xs:boolean">
<value>true</value>
</prop>
+ <prop oor:name="CreateBackup" install:module="gconflockdown">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend CreateBackup"/>
+ </prop>
+ <prop oor:name="WarnAlienFormat" install:module="gconflockdown">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend WarnAlienFormat"/>
+ </prop>
</node>
<node oor:name="ODF">
<prop oor:name="DefaultVersion" oor:type="xs:short">
@@ -570,6 +608,36 @@
<prop oor:name="HyperlinksWithCtrlClick" oor:type="xs:boolean">
<value>true</value>
</prop>
+ <prop oor:name="MacroSecurityLevel" install:module="gconflockdown">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend MacroSecurityLevel"/>
+ </prop>
+ <prop oor:name="RecommendPasswordProtection"
+ install:module="gconflockdown">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend RecommendPasswordProtection"/>
+ </prop>
+ <prop oor:name="RemovePersonalInfoOnSaving"
+ install:module="gconflockdown">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend RemovePersonalInfoOnSaving"/>
+ </prop>
+ <prop oor:name="WarnCreatePDF" install:module="gconflockdown">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend WarnCreatePDF"/>
+ </prop>
+ <prop oor:name="WarnPrintDoc" install:module="gconflockdown">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend WarnPrintDoc"/>
+ </prop>
+ <prop oor:name="WarnSaveOrSendDoc" install:module="gconflockdown">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend WarnSaveOrSendDoc"/>
+ </prop>
+ <prop oor:name="WarnSignDoc" install:module="gconflockdown">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend WarnSignDoc"/>
+ </prop>
</node>
</node>
<node oor:name="Path">
@@ -581,4 +649,60 @@
</prop>
</node>
</node>
+ <node oor:name="ExternalMailer" install:module="unixdesktop">
+ <prop oor:name="Program">
+ <value oor:external=
+ "com.sun.star.configuration.backend.DesktopBackend ExternalMailer"/>
+ </prop>
+ </node>
+ <node oor:name="Font">
+ <node oor:name="SourceViewFont" install:module="unixdesktop">
+ <prop oor:name="FontName">
+ <value oor:external=
+ "com.sun.star.configuration.backend.DesktopBackend SourceViewFontName"/>
+ </prop>
+ <prop oor:name="FontHeight">
+ <value oor:external=
+ "com.sun.star.configuration.backend.DesktopBackend SourceViewFontHeight"/>
+ </prop>
+ </node>
+ <node oor:name="View" install:module="gconflockdown">
+ <prop oor:name="History">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend FontViewHistory"/>
+ </prop>
+ <prop oor:name="ShowFontBoxWYSIWYG">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend ShowFontBoxWYSIWYG"/>
+ </prop>
+ </node>
+ </node>
+ <node oor:name="Accessibility" install:module="gconflockdown">
+ <prop oor:name="IsSystemFont">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend AccessibilityIsSystemFont"/>
+ </prop>
+ </node>
+ <node oor:name="Print" install:module="gconflockdown">
+ <prop oor:name="PrintingModifiesDocument">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend PrintingModifiesDocument"/>
+ </prop>
+ </node>
+ <node oor:name="Undo" install:module="gconflockdown">
+ <prop oor:name="Steps">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend UndoSteps"/>
+ </prop>
+ </node>
+ <node oor:name="_3D_Engine" install:module="gconflockdown">
+ <prop oor:name="OpenGL">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend OpenGL"/>
+ </prop>
+ <prop oor:name="OpenGL_Faster">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend OpenGL_Faster"/>
+ </prop>
+ </node>
</oor:component-data>
diff --git a/officecfg/registry/data/org/openoffice/Office/Labels.xcu b/officecfg/registry/data/org/openoffice/Office/Labels.xcu
index cb3fc9f96b..3a006d23c5 100644
--- a/officecfg/registry/data/org/openoffice/Office/Labels.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Labels.xcu
@@ -36,8 +36,8 @@
<node oor:name="L0" oor:op="replace" oor:finalized="true">
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2050 Video Spine</value>
+
+ <value>C2050 Video Spine</value>
</prop>
<prop oor:name="Measure">
@@ -47,8 +47,8 @@
<node oor:name="L1" oor:op="replace" oor:finalized="true">
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2050 Video Face</value>
+
+ <value>C2050 Video Face</value>
</prop>
<prop oor:name="Measure">
@@ -58,9 +58,8 @@
<node oor:name="L2" oor:op="replace" oor:finalized="true">
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2070 Transfer Film for Mouse Pad</value>
+ <value>C2070 Transfer Film for Mouse Pad</value>
</prop>
<prop oor:name="Measure">
@@ -70,8 +69,8 @@
<node oor:name="L3" oor:op="replace" oor:finalized="true">
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2080 Transfer Film for Puzzle</value>
+
+ <value>C2080 Transfer Film for Puzzle</value>
</prop>
<prop oor:name="Measure">
@@ -82,8 +81,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2090 T-Shirt Transfer Set</value>
+ <value>C2090 T-Shirt Transfer Set</value>
</prop>
<prop oor:name="Measure">
@@ -94,8 +92,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2160 Avery Inkjet Label</value>
+ <value>C2160 Avery Inkjet Label</value>
</prop>
<prop oor:name="Measure">
@@ -106,8 +103,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2163 Avery Inkjet Label</value>
+ <value>C2163 Avery Inkjet Label</value>
</prop>
<prop oor:name="Measure">
@@ -118,8 +114,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2165 Large Labels</value>
+ <value>C2165 Large Labels</value>
</prop>
<prop oor:name="Measure">
@@ -130,8 +125,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2166 Avery 3.5&quot; Disk Label (Face only)</value>
+ <value>C2166 Avery 3.5&quot; Disk Label (Face only)</value>
</prop>
<prop oor:name="Measure">
@@ -142,8 +136,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2241 Avery Rectangle Sticker</value>
+ <value>C2241 Avery Rectangle Sticker</value>
</prop>
<prop oor:name="Measure">
@@ -154,8 +147,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2243 Avery Small Round Sticker</value>
+ <value>C2243 Avery Small Round Sticker</value>
</prop>
<prop oor:name="Measure">
@@ -166,8 +158,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2244 Avery Big Round Sticker</value>
+ <value>C2244 Avery Big Round Sticker</value>
</prop>
<prop oor:name="Measure">
@@ -178,8 +169,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2246 Avery Full Page Sticker</value>
+ <value>C2246 Avery Full Page Sticker</value>
</prop>
<prop oor:name="Measure">
@@ -190,8 +180,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2265 Disk Labels</value>
+ <value>C2265 Disk Labels</value>
</prop>
<prop oor:name="Measure">
@@ -202,8 +191,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2341 Embossed Cards A5 (Cover)</value>
+ <value>C2341 Embossed Cards A5 (Cover)</value>
</prop>
<prop oor:name="Measure">
@@ -214,8 +202,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2341 Embossed Cards A5 (Inside)</value>
+ <value>C2341 Embossed Cards A5 (Inside)</value>
</prop>
<prop oor:name="Measure">
@@ -226,8 +213,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2342 Embossed cards A6 (Coverl)</value>
+ <value>C2342 Embossed cards A6 (Coverl)</value>
</prop>
<prop oor:name="Measure">
@@ -238,8 +224,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2342 Embossed Cards A6 (Inside)</value>
+ <value>C2342 Embossed Cards A6 (Inside)</value>
</prop>
<prop oor:name="Measure">
@@ -250,8 +235,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2351 Avery A5 Greeting Card</value>
+ <value>C2351 Avery A5 Greeting Card</value>
</prop>
<prop oor:name="Measure">
@@ -262,8 +246,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2352 Avery A6 Greeting Card</value>
+ <value>C2352 Avery A6 Greeting Card</value>
</prop>
<prop oor:name="Measure">
@@ -274,8 +257,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2353 Avery Postcard</value>
+ <value>C2353 Avery Postcard</value>
</prop>
<prop oor:name="Measure">
@@ -286,8 +268,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2354 Avery Biz Card</value>
+ <value>C2354 Avery Biz Card</value>
</prop>
<prop oor:name="Measure">
@@ -298,8 +279,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2355 Avery Note Cards</value>
+ <value>C2355 Avery Note Cards</value>
</prop>
<prop oor:name="Measure">
@@ -310,8 +290,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2356 Avery Full Page Card</value>
+ <value>C2356 Avery Full Page Card</value>
</prop>
<prop oor:name="Measure">
@@ -322,8 +301,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2357 Compliment Cards</value>
+ <value>C2357 Compliment Cards</value>
</prop>
<prop oor:name="Measure">
@@ -334,8 +312,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2361 Greeting Cards (A6)</value>
+ <value>C2361 Greeting Cards (A6)</value>
</prop>
<prop oor:name="Measure">
@@ -346,8 +323,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2364 Marbled Business Cards</value>
+ <value>C2364 Marbled Business Cards</value>
</prop>
<prop oor:name="Measure">
@@ -358,8 +334,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2365 Marbled Business Cards</value>
+ <value>C2365 Marbled Business Cards</value>
</prop>
<prop oor:name="Measure">
@@ -370,8 +345,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2366 Marbled Business Cards</value>
+ <value>C2366 Marbled Business Cards</value>
</prop>
<prop oor:name="Measure">
@@ -382,8 +356,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2367 Marbled Business Cards</value>
+ <value>C2367 Marbled Business Cards</value>
</prop>
<prop oor:name="Measure">
@@ -394,8 +367,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2370 A4 Coated Paper -110gsm</value>
+ <value>C2370 A4 Coated Paper -110gsm</value>
</prop>
<prop oor:name="Measure">
@@ -406,8 +378,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2371 A4 Coated Paper -160gsm</value>
+ <value>C2371 A4 Coated Paper -160gsm</value>
</prop>
<prop oor:name="Measure">
@@ -418,8 +389,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2374 Marbled Paper</value>
+ <value>C2374 Marbled Paper</value>
</prop>
<prop oor:name="Measure">
@@ -430,8 +400,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2375 Marbled Paper</value>
+ <value>C2375 Marbled Paper</value>
</prop>
<prop oor:name="Measure">
@@ -442,8 +411,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2376 Marbled Paper</value>
+ <value>C2376 Marbled Paper</value>
</prop>
<prop oor:name="Measure">
@@ -454,8 +422,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2377 Marbled Paper</value>
+ <value>C2377 Marbled Paper</value>
</prop>
<prop oor:name="Measure">
@@ -466,8 +433,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2378 A4 Colour Laser Paper</value>
+ <value>C2378 A4 Colour Laser Paper</value>
</prop>
<prop oor:name="Measure">
@@ -478,8 +444,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2379 A4 Bright White</value>
+ <value>C2379 A4 Bright White</value>
</prop>
<prop oor:name="Measure">
@@ -490,8 +455,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2410 Avery Self-Laminating Card</value>
+ <value>C2410 Avery Self-Laminating Card</value>
</prop>
<prop oor:name="Measure">
@@ -502,8 +466,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2420 Avery Self-Laminating Bookmark</value>
+ <value>C2420 Avery Self-Laminating Bookmark</value>
</prop>
<prop oor:name="Measure">
@@ -514,8 +477,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2546 Windows Decals</value>
+ <value>C2546 Windows Decals</value>
</prop>
<prop oor:name="Measure">
@@ -526,8 +488,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2547 Fantastic Plastic</value>
+ <value>C2547 Fantastic Plastic</value>
</prop>
<prop oor:name="Measure">
@@ -538,8 +499,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2651 Avery Inkjet Mini Label</value>
+ <value>C2651 Avery Inkjet Mini Label</value>
</prop>
<prop oor:name="Measure">
@@ -550,8 +510,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C6353 Photo Quality Gloss 4 x 6 Cards</value>
+ <value>C6353 Photo Quality Gloss 4 x 6 Cards</value>
</prop>
<prop oor:name="Measure">
@@ -562,8 +521,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9146 Photo Quality Label (Full Page)</value>
+ <value>C9146 Photo Quality Label (Full Page)</value>
</prop>
<prop oor:name="Measure">
@@ -574,8 +532,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9151 Photo Quality Label</value>
+ <value>C9151 Photo Quality Label</value>
</prop>
<prop oor:name="Measure">
@@ -586,8 +543,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9169 Photo Quality Label (4 per page)</value>
+ <value>C9169 Photo Quality Label (4 per page)</value>
</prop>
<prop oor:name="Measure">
@@ -598,8 +554,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9312 Clean Edge(TM) Business Card</value>
+ <value>C9312 Clean Edge(TM) Business Card</value>
</prop>
<prop oor:name="Measure">
@@ -610,8 +565,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9351 Photo Quality Gloss A5 Greeting Card</value>
+ <value>C9351 Photo Quality Gloss A5 Greeting Card</value>
</prop>
<prop oor:name="Measure">
@@ -622,8 +576,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9352 Greeting Cards Glossy A6</value>
+ <value>C9352 Greeting Cards Glossy A6</value>
</prop>
<prop oor:name="Measure">
@@ -634,8 +587,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9353 Photo Quality Gloss Postcards</value>
+ <value>C9353 Photo Quality Gloss Postcards</value>
</prop>
<prop oor:name="Measure">
@@ -646,8 +598,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9354 Photo Quality Gloss Business Cards</value>
+ <value>C9354 Photo Quality Gloss Business Cards</value>
</prop>
<prop oor:name="Measure">
@@ -658,8 +609,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9355 Post Cards</value>
+ <value>C9355 Post Cards</value>
</prop>
<prop oor:name="Measure">
@@ -670,8 +620,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9356 Photo Quality A4 Card Sheet</value>
+ <value>C9356 Photo Quality A4 Card Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -682,8 +631,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9362 Business Cards Glossy</value>
+ <value>C9362 Business Cards Glossy</value>
</prop>
<prop oor:name="Measure">
@@ -694,8 +642,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9372 Photo Paper Glossy 9 x 13</value>
+ <value>C9372 Photo Paper Glossy 9 x 13</value>
</prop>
<prop oor:name="Measure">
@@ -706,8 +653,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9373 Photo Gloss Paper</value>
+ <value>C9373 Photo Gloss Paper</value>
</prop>
<prop oor:name="Measure">
@@ -718,8 +664,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9374 Photo Quality Glossy Inkjet Card</value>
+ <value>C9374 Photo Quality Glossy Inkjet Card</value>
</prop>
<prop oor:name="Measure">
@@ -730,8 +675,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9405 Avery T-Shirt Transfer Sheets</value>
+ <value>C9405 Avery T-Shirt Transfer Sheets</value>
</prop>
<prop oor:name="Measure">
@@ -742,8 +686,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9406 Avery T-Shirt Transfer Sheets</value>
+ <value>C9406 Avery T-Shirt Transfer Sheets</value>
</prop>
<prop oor:name="Measure">
@@ -754,8 +697,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9430 Photo Quality Glossy A4 Inkjet Paper</value>
+ <value>C9430 Photo Quality Glossy A4 Inkjet Paper</value>
</prop>
<prop oor:name="Measure">
@@ -766,8 +708,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9431 Photo Quality Glossy Paper - 160gsm</value>
+ <value>C9431 Photo Quality Glossy Paper - 160gsm</value>
</prop>
<prop oor:name="Measure">
@@ -778,8 +719,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9433 Inkjet Glossy Double Sided Paper</value>
+ <value>C9433 Inkjet Glossy Double Sided Paper</value>
</prop>
<prop oor:name="Measure">
@@ -790,8 +730,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9434 Photo Cards Glossy</value>
+ <value>C9434 Photo Cards Glossy</value>
</prop>
<prop oor:name="Measure">
@@ -802,8 +741,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9612 CD-R Business Card</value>
+ <value>C9612 CD-R Business Card</value>
</prop>
<prop oor:name="Measure">
@@ -814,8 +752,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9660 Full Face CD/DVD Labels</value>
+ <value>C9660 Full Face CD/DVD Labels</value>
</prop>
<prop oor:name="Measure">
@@ -826,8 +763,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">COPT210 Copier Transparency</value>
+ <value>COPT210 Copier Transparency</value>
</prop>
<prop oor:name="Measure">
@@ -838,8 +774,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">IJT310 Inkjet Transparency - 90microns</value>
+ <value>IJT310 Inkjet Transparency - 90microns</value>
</prop>
<prop oor:name="Measure">
@@ -850,8 +785,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">IJT311 Inkjet Transparency - 120 microns</value>
+ <value>IJT311 Inkjet Transparency - 120 microns</value>
</prop>
<prop oor:name="Measure">
@@ -862,8 +796,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J40063 Address</value>
+ <value>J40063 Address</value>
</prop>
<prop oor:name="Measure">
@@ -874,8 +807,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J40065 Parcel</value>
+ <value>J40065 Parcel</value>
</prop>
<prop oor:name="Measure">
@@ -886,8 +818,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J400DK 3.5&quot; Diskette - Face Only</value>
+ <value>J400DK 3.5&quot; Diskette - Face Only</value>
</prop>
<prop oor:name="Measure">
@@ -898,8 +829,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J400SL 35mm Slide</value>
+ <value>J400SL 35mm Slide</value>
</prop>
<prop oor:name="Measure">
@@ -910,8 +840,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J400VF Video Face</value>
+ <value>J400VF Video Face</value>
</prop>
<prop oor:name="Measure">
@@ -922,8 +851,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J400VS Video Spine</value>
+ <value>J400VS Video Spine</value>
</prop>
<prop oor:name="Measure">
@@ -934,8 +862,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8156 Address</value>
+ <value>J8156 Address</value>
</prop>
<prop oor:name="Measure">
@@ -946,8 +873,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8157 Address</value>
+ <value>J8157 Address</value>
</prop>
<prop oor:name="Measure">
@@ -958,8 +884,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8158 Address</value>
+ <value>J8158 Address</value>
</prop>
<prop oor:name="Measure">
@@ -970,8 +895,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8159 Address</value>
+ <value>J8159 Address</value>
</prop>
<prop oor:name="Measure">
@@ -982,8 +906,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8160 Address</value>
+ <value>J8160 Address</value>
</prop>
<prop oor:name="Measure">
@@ -994,8 +917,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8161 Address</value>
+ <value>J8161 Address</value>
</prop>
<prop oor:name="Measure">
@@ -1006,8 +928,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8162 Address</value>
+ <value>J8162 Address</value>
</prop>
<prop oor:name="Measure">
@@ -1018,8 +939,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8163 Address</value>
+ <value>J8163 Address</value>
</prop>
<prop oor:name="Measure">
@@ -1030,8 +950,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8164 Address</value>
+ <value>J8164 Address</value>
</prop>
<prop oor:name="Measure">
@@ -1042,8 +961,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8165 Parcel</value>
+ <value>J8165 Parcel</value>
</prop>
<prop oor:name="Measure">
@@ -1054,8 +972,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8166 Parcel</value>
+ <value>J8166 Parcel</value>
</prop>
<prop oor:name="Measure">
@@ -1066,8 +983,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8167 Shipping</value>
+ <value>J8167 Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -1078,8 +994,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8168 Shipping</value>
+ <value>J8168 Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -1090,8 +1005,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8169 Parcel</value>
+ <value>J8169 Parcel</value>
</prop>
<prop oor:name="Measure">
@@ -1102,8 +1016,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8170 Collect/Filing</value>
+ <value>J8170 Collect/Filing</value>
</prop>
<prop oor:name="Measure">
@@ -1114,8 +1027,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8171 Lever Arch Labels - White</value>
+ <value>J8171 Lever Arch Labels - White</value>
</prop>
<prop oor:name="Measure">
@@ -1126,8 +1038,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8173 Address</value>
+ <value>J8173 Address</value>
</prop>
<prop oor:name="Measure">
@@ -1138,8 +1049,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8359 Address</value>
+ <value>J8359 Address</value>
</prop>
<prop oor:name="Measure">
@@ -1150,8 +1060,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8360 Address</value>
+ <value>J8360 Address</value>
</prop>
<prop oor:name="Measure">
@@ -1162,8 +1071,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8361 Address</value>
+ <value>J8361 Address</value>
</prop>
<prop oor:name="Measure">
@@ -1174,8 +1082,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8362 Address</value>
+ <value>J8362 Address</value>
</prop>
<prop oor:name="Measure">
@@ -1186,8 +1093,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8363 Address</value>
+ <value>J8363 Address</value>
</prop>
<prop oor:name="Measure">
@@ -1198,8 +1104,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8364 Address</value>
+ <value>J8364 Address</value>
</prop>
<prop oor:name="Measure">
@@ -1210,8 +1115,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8365 Parcel</value>
+ <value>J8365 Parcel</value>
</prop>
<prop oor:name="Measure">
@@ -1222,8 +1126,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8366 Parcel</value>
+ <value>J8366 Parcel</value>
</prop>
<prop oor:name="Measure">
@@ -1234,8 +1137,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8367 Shipping</value>
+ <value>J8367 Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -1246,8 +1148,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8368 Shipping</value>
+ <value>J8368 Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -1258,8 +1159,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8369 Parcel</value>
+ <value>J8369 Parcel</value>
</prop>
<prop oor:name="Measure">
@@ -1270,8 +1170,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8371 Lever Arch</value>
+ <value>J8371 Lever Arch</value>
</prop>
<prop oor:name="Measure">
@@ -1282,8 +1181,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8414 Clean Edge (TM) Business Card</value>
+ <value>J8414 Clean Edge (TM) Business Card</value>
</prop>
<prop oor:name="Measure">
@@ -1294,8 +1192,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8415 Greeting Cards Maxi (A6)</value>
+ <value>J8415 Greeting Cards Maxi (A6)</value>
</prop>
<prop oor:name="Measure">
@@ -1306,8 +1203,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8423 Name Card</value>
+ <value>J8423 Name Card</value>
</prop>
<prop oor:name="Measure">
@@ -1318,8 +1214,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8431 CD Case Insert - Cover</value>
+ <value>J8431 CD Case Insert - Cover</value>
</prop>
<prop oor:name="Measure">
@@ -1330,8 +1225,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8432 CD Case Insert - Tray</value>
+ <value>J8432 CD Case Insert - Tray</value>
</prop>
<prop oor:name="Measure">
@@ -1342,8 +1236,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8433 CD Envelope</value>
+ <value>J8433 CD Envelope</value>
</prop>
<prop oor:name="Measure">
@@ -1354,8 +1247,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8434 Inkjet CD Inserts - Cover Section</value>
+ <value>J8434 Inkjet CD Inserts - Cover Section</value>
</prop>
<prop oor:name="Measure">
@@ -1366,8 +1258,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8434 Inkjet CD Inserts - Tray Section</value>
+ <value>J8434 Inkjet CD Inserts - Tray Section</value>
</prop>
<prop oor:name="Measure">
@@ -1378,8 +1269,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8435 CD Case Insert Cover Section</value>
+ <value>J8435 CD Case Insert Cover Section</value>
</prop>
<prop oor:name="Measure">
@@ -1390,8 +1280,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8435 CD Case Insert Tray Section</value>
+ <value>J8435 CD Case Insert Tray Section</value>
</prop>
<prop oor:name="Measure">
@@ -1402,8 +1291,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8436 CD Case Spine Labels</value>
+ <value>J8436 CD Case Spine Labels</value>
</prop>
<prop oor:name="Measure">
@@ -1414,8 +1302,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8440 Zip(TM) Disk Card Insert - Panels</value>
+ <value>J8440 Zip(TM) Disk Card Insert - Panels</value>
</prop>
<prop oor:name="Measure">
@@ -1426,8 +1313,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8560 Clear Address</value>
+ <value>J8560 Clear Address</value>
</prop>
<prop oor:name="Measure">
@@ -1438,8 +1324,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8562 Clear Address</value>
+ <value>J8562 Clear Address</value>
</prop>
<prop oor:name="Measure">
@@ -1450,8 +1335,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8563 Clear Address</value>
+ <value>J8563 Clear Address</value>
</prop>
<prop oor:name="Measure">
@@ -1462,8 +1346,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8565 Clear Parcel</value>
+ <value>J8565 Clear Parcel</value>
</prop>
<prop oor:name="Measure">
@@ -1474,8 +1357,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8567 Clear A4 Labels</value>
+ <value>J8567 Clear A4 Labels</value>
</prop>
<prop oor:name="Measure">
@@ -1486,8 +1368,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8570 Full Face CD/DVD Labels - Clear Inkjet</value>
+ <value>J8570 Full Face CD/DVD Labels - Clear Inkjet</value>
</prop>
<prop oor:name="Measure">
@@ -1498,8 +1379,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8587 Inkjet Transparencies</value>
+ <value>J8587 Inkjet Transparencies</value>
</prop>
<prop oor:name="Measure">
@@ -1510,8 +1390,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8612 CD-R Business Card</value>
+ <value>J8612 CD-R Business Card</value>
</prop>
<prop oor:name="Measure">
@@ -1522,8 +1401,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8651 Mini Address</value>
+ <value>J8651 Mini Address</value>
</prop>
<prop oor:name="Measure">
@@ -1534,8 +1412,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8654 Miini Address</value>
+ <value>J8654 Miini Address</value>
</prop>
<prop oor:name="Measure">
@@ -1546,8 +1423,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8655 Audio Cassette</value>
+ <value>J8655 Audio Cassette</value>
</prop>
<prop oor:name="Measure">
@@ -1558,8 +1434,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8656 35 mm Slide</value>
+ <value>J8656 35 mm Slide</value>
</prop>
<prop oor:name="Measure">
@@ -1570,8 +1445,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8657 35 mm Slides/Small Items</value>
+ <value>J8657 35 mm Slides/Small Items</value>
</prop>
<prop oor:name="Measure">
@@ -1582,8 +1456,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8658 Mini Labels - Removable</value>
+ <value>J8658 Mini Labels - Removable</value>
</prop>
<prop oor:name="Measure">
@@ -1594,8 +1467,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8659 Mini Labels - Removable</value>
+ <value>J8659 Mini Labels - Removable</value>
</prop>
<prop oor:name="Measure">
@@ -1606,8 +1478,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8666 3.5&quot; Diskette - Face Only</value>
+ <value>J8666 3.5&quot; Diskette - Face Only</value>
</prop>
<prop oor:name="Measure">
@@ -1618,8 +1489,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8667 Mini Disk Label - Face</value>
+ <value>J8667 Mini Disk Label - Face</value>
</prop>
<prop oor:name="Measure">
@@ -1630,8 +1500,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8667 Mini Disk Label - Spine</value>
+ <value>J8667 Mini Disk Label - Spine</value>
</prop>
<prop oor:name="Measure">
@@ -1642,8 +1511,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8668 Labels for Zip (TM.) Disk</value>
+ <value>J8668 Labels for Zip (TM.) Disk</value>
</prop>
<prop oor:name="Measure">
@@ -1654,8 +1522,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8671 Video Face</value>
+ <value>J8671 Video Face</value>
</prop>
<prop oor:name="Measure">
@@ -1666,8 +1533,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8674 Video Spine</value>
+ <value>J8674 Video Spine</value>
</prop>
<prop oor:name="Measure">
@@ -1678,8 +1544,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8676 Full Face CD/DVD Labels</value>
+ <value>J8676 Full Face CD/DVD Labels</value>
</prop>
<prop oor:name="Measure">
@@ -1690,8 +1555,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8701 Lever Arch</value>
+ <value>J8701 Lever Arch</value>
</prop>
<prop oor:name="Measure">
@@ -1702,8 +1566,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8702 Lever Arch</value>
+ <value>J8702 Lever Arch</value>
</prop>
<prop oor:name="Measure">
@@ -1714,8 +1577,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8766 3.5&quot; Diskette - Face Only</value>
+ <value>J8766 3.5&quot; Diskette - Face Only</value>
</prop>
<prop oor:name="Measure">
@@ -1726,8 +1588,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8770 Full Face CD/DVD Labels</value>
+ <value>J8770 Full Face CD/DVD Labels</value>
</prop>
<prop oor:name="Measure">
@@ -1738,8 +1599,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8771 Video Face</value>
+ <value>J8771 Video Face</value>
</prop>
<prop oor:name="Measure">
@@ -1750,8 +1610,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8774 Video Spine</value>
+ <value>J8774 Video Spine</value>
</prop>
<prop oor:name="Measure">
@@ -1762,8 +1621,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8776 Full Face CD/DVD Labels - Holographic</value>
+ <value>J8776 Full Face CD/DVD Labels - Holographic</value>
</prop>
<prop oor:name="Measure">
@@ -1774,8 +1632,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8777 Full Face CD/DVD Labels - Silver</value>
+ <value>J8777 Full Face CD/DVD Labels - Silver</value>
</prop>
<prop oor:name="Measure">
@@ -1786,8 +1643,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8778 Full Face CD/DVD Labels - Gold</value>
+ <value>J8778 Full Face CD/DVD Labels - Gold</value>
</prop>
<prop oor:name="Measure">
@@ -1798,8 +1654,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8867 Printable Magnets - Full Sheet</value>
+ <value>J8867 Printable Magnets - Full Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -1810,8 +1665,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8871 Printable Magnets</value>
+ <value>J8871 Printable Magnets</value>
</prop>
<prop oor:name="Measure">
@@ -1822,8 +1676,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8875 Printable Magnets</value>
+ <value>J8875 Printable Magnets</value>
</prop>
<prop oor:name="Measure">
@@ -1834,8 +1687,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J9124 Inkjet Labels, Glossy</value>
+ <value>J9124 Inkjet Labels, Glossy</value>
</prop>
<prop oor:name="Measure">
@@ -1846,8 +1698,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L30063 Address</value>
+ <value>L30063 Address</value>
</prop>
<prop oor:name="Measure">
@@ -1858,8 +1709,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L30065 Parcel</value>
+ <value>L30065 Parcel</value>
</prop>
<prop oor:name="Measure">
@@ -1870,8 +1720,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L300DK 3.5&quot; Diskette - Face Only</value>
+ <value>L300DK 3.5&quot; Diskette - Face Only</value>
</prop>
<prop oor:name="Measure">
@@ -1882,8 +1731,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L300SL 35mm Slide</value>
+ <value>L300SL 35mm Slide</value>
</prop>
<prop oor:name="Measure">
@@ -1894,8 +1742,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L300VF Video Face</value>
+ <value>L300VF Video Face</value>
</prop>
<prop oor:name="Measure">
@@ -1906,8 +1753,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L300VS Video Spine</value>
+ <value>L300VS Video Spine</value>
</prop>
<prop oor:name="Measure">
@@ -1918,8 +1764,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L6008 Silver Heavy Duty Labels</value>
+ <value>L6008 Silver Heavy Duty Labels</value>
</prop>
<prop oor:name="Measure">
@@ -1930,8 +1775,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L6009 Silver Heavy Duty Labels</value>
+ <value>L6009 Silver Heavy Duty Labels</value>
</prop>
<prop oor:name="Measure">
@@ -1942,8 +1786,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L6011 Silver Heavy Duty Labels</value>
+ <value>L6011 Silver Heavy Duty Labels</value>
</prop>
<prop oor:name="Measure">
@@ -1954,8 +1797,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L6012 Silver Heavy Duty Labels</value>
+ <value>L6012 Silver Heavy Duty Labels</value>
</prop>
<prop oor:name="Measure">
@@ -1966,8 +1808,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L6112 Anti Tamper Labels</value>
+ <value>L6112 Anti Tamper Labels</value>
</prop>
<prop oor:name="Measure">
@@ -1978,8 +1819,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L6113 Anti Tamper Labels</value>
+ <value>L6113 Anti Tamper Labels</value>
</prop>
<prop oor:name="Measure">
@@ -1990,8 +1830,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L6114 Anti Tamper Labels</value>
+ <value>L6114 Anti Tamper Labels</value>
</prop>
<prop oor:name="Measure">
@@ -2002,8 +1841,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7051 Heavy Duty Labels Mini</value>
+ <value>L7051 Heavy Duty Labels Mini</value>
</prop>
<prop oor:name="Measure">
@@ -2014,8 +1852,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7060 White Heavy Duty Labels</value>
+ <value>L7060 White Heavy Duty Labels</value>
</prop>
<prop oor:name="Measure">
@@ -2026,8 +1863,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7063 White Heavy Duty Labels</value>
+ <value>L7063 White Heavy Duty Labels</value>
</prop>
<prop oor:name="Measure">
@@ -2038,8 +1874,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7067 White Heavy Duty Labels</value>
+ <value>L7067 White Heavy Duty Labels</value>
</prop>
<prop oor:name="Measure">
@@ -2050,8 +1885,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7068 White Heavy Duty Labels</value>
+ <value>L7068 White Heavy Duty Labels</value>
</prop>
<prop oor:name="Measure">
@@ -2062,8 +1896,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7069 White Heavy Duty Labels</value>
+ <value>L7069 White Heavy Duty Labels</value>
</prop>
<prop oor:name="Measure">
@@ -2074,8 +1907,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7156 Address</value>
+ <value>L7156 Address</value>
</prop>
<prop oor:name="Measure">
@@ -2086,8 +1918,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7157 Address</value>
+ <value>L7157 Address</value>
</prop>
<prop oor:name="Measure">
@@ -2098,8 +1929,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7158 Address</value>
+ <value>L7158 Address</value>
</prop>
<prop oor:name="Measure">
@@ -2110,8 +1940,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7159 Address</value>
+ <value>L7159 Address</value>
</prop>
<prop oor:name="Measure">
@@ -2122,8 +1951,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7160 Address</value>
+ <value>L7160 Address</value>
</prop>
<prop oor:name="Measure">
@@ -2134,8 +1962,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7161 Address</value>
+ <value>L7161 Address</value>
</prop>
<prop oor:name="Measure">
@@ -2146,8 +1973,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7162 Address</value>
+ <value>L7162 Address</value>
</prop>
<prop oor:name="Measure">
@@ -2158,8 +1984,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7163 Address</value>
+ <value>L7163 Address</value>
</prop>
<prop oor:name="Measure">
@@ -2170,8 +1995,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7164 Address</value>
+ <value>L7164 Address</value>
</prop>
<prop oor:name="Measure">
@@ -2182,8 +2006,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7165 Parcel</value>
+ <value>L7165 Parcel</value>
</prop>
<prop oor:name="Measure">
@@ -2194,8 +2017,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7166 Parcel</value>
+ <value>L7166 Parcel</value>
</prop>
<prop oor:name="Measure">
@@ -2206,8 +2028,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7167 Shipping</value>
+ <value>L7167 Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -2218,8 +2039,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7168 Shipping</value>
+ <value>L7168 Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -2230,8 +2050,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7169 Parcel</value>
+ <value>L7169 Parcel</value>
</prop>
<prop oor:name="Measure">
@@ -2242,8 +2061,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7170 Eurofolio</value>
+ <value>L7170 Eurofolio</value>
</prop>
<prop oor:name="Measure">
@@ -2254,8 +2072,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7171 Lever Arch - White</value>
+ <value>L7171 Lever Arch - White</value>
</prop>
<prop oor:name="Measure">
@@ -2266,8 +2083,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7171B Lever Arch Labels - Blue</value>
+ <value>L7171B Lever Arch Labels - Blue</value>
</prop>
<prop oor:name="Measure">
@@ -2278,8 +2094,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7171G Lever Arch Labels - Green</value>
+ <value>L7171G Lever Arch Labels - Green</value>
</prop>
<prop oor:name="Measure">
@@ -2290,8 +2105,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7171R Lever Arch Labels - Red</value>
+ <value>L7171R Lever Arch Labels - Red</value>
</prop>
<prop oor:name="Measure">
@@ -2302,8 +2116,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7172 Ring Binder</value>
+ <value>L7172 Ring Binder</value>
</prop>
<prop oor:name="Measure">
@@ -2314,8 +2127,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7173 Shipping</value>
+ <value>L7173 Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -2326,8 +2138,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7176 Labels for 60mm Box File</value>
+ <value>L7176 Labels for 60mm Box File</value>
</prop>
<prop oor:name="Measure">
@@ -2338,8 +2149,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7177 Address</value>
+ <value>L7177 Address</value>
</prop>
<prop oor:name="Measure">
@@ -2350,8 +2160,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7178 Labels for 40mm Box File</value>
+ <value>L7178 Labels for 40mm Box File</value>
</prop>
<prop oor:name="Measure">
@@ -2362,8 +2171,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7179 Labels for 25mm Box File</value>
+ <value>L7179 Labels for 25mm Box File</value>
</prop>
<prop oor:name="Measure">
@@ -2374,8 +2182,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7263 Fluorescent Yellow Address</value>
+ <value>L7263 Fluorescent Yellow Address</value>
</prop>
<prop oor:name="Measure">
@@ -2386,8 +2193,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7363 Address</value>
+ <value>L7363 Address</value>
</prop>
<prop oor:name="Measure">
@@ -2398,8 +2204,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7400 Suspended Files (Cupboard)</value>
+ <value>L7400 Suspended Files (Cupboard)</value>
</prop>
<prop oor:name="Measure">
@@ -2410,8 +2215,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7408 Suspended Files (Drawer)</value>
+ <value>L7408 Suspended Files (Drawer)</value>
</prop>
<prop oor:name="Measure">
@@ -2422,8 +2226,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7409 Suspension Tab Card Inserts</value>
+ <value>L7409 Suspension Tab Card Inserts</value>
</prop>
<prop oor:name="Measure">
@@ -2434,8 +2237,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7410-5 IndexMaker 5 part - Labels</value>
+ <value>L7410-5 IndexMaker 5 part - Labels</value>
</prop>
<prop oor:name="Measure">
@@ -2446,8 +2248,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7410-5 IndexMaker 5 part - Contents Sheet</value>
+ <value>L7410-5 IndexMaker 5 part - Contents Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -2458,8 +2259,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7410-6 IndexMaker 6 part - Labels</value>
+ <value>L7410-6 IndexMaker 6 part - Labels</value>
</prop>
<prop oor:name="Measure">
@@ -2470,8 +2270,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7410-6 IndexMaker 6 part - Contents Sheet</value>
+ <value>L7410-6 IndexMaker 6 part - Contents Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -2482,8 +2281,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7410-10 IndexMaker 10 part - Labels</value>
+ <value>L7410-10 IndexMaker 10 part - Labels</value>
</prop>
<prop oor:name="Measure">
@@ -2494,8 +2292,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7410-10 IndexMaker 10 part - Contents Sheet</value>
+ <value>L7410-10 IndexMaker 10 part - Contents Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -2506,8 +2303,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7410-12 IndexMaker 12 part - Labels</value>
+ <value>L7410-12 IndexMaker 12 part - Labels</value>
</prop>
<prop oor:name="Measure">
@@ -2518,8 +2314,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7410-12 IndexMaker 12 part - Contents Sheet</value>
+ <value>L7410-12 IndexMaker 12 part - Contents Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -2530,8 +2325,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7411-5 ReadyIndex 1-5 Index - Contents Sheet</value>
+ <value>L7411-5 ReadyIndex 1-5 Index - Contents Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -2542,8 +2336,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7411-6 ReadyIndex 1-6 Index - Contents Sheet</value>
+ <value>L7411-6 ReadyIndex 1-6 Index - Contents Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -2554,8 +2347,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7411-10 ReadyIndex 1-10 Index - Contents Sheet</value>
+ <value>L7411-10 ReadyIndex 1-10 Index - Contents Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -2566,8 +2358,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7411-12 ReadyIndex 1-12 Index - Contents Sheet</value>
+ <value>L7411-12 ReadyIndex 1-12 Index - Contents Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -2578,8 +2369,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7411-15 ReadyIndex 1-15 Index - Contents Sheet</value>
+ <value>L7411-15 ReadyIndex 1-15 Index - Contents Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -2590,8 +2380,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7411-20 ReadyIndex 1-20 Index - Contents Sheet</value>
+ <value>L7411-20 ReadyIndex 1-20 Index - Contents Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -2602,8 +2391,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7411-31 ReadyIndex 1-31 Index - Contents Sheet</value>
+ <value>L7411-31 ReadyIndex 1-31 Index - Contents Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -2614,8 +2402,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7411-AZ ReadyIndex A-Z Index - Contents Sheet</value>
+ <value>L7411-AZ ReadyIndex A-Z Index - Contents Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -2626,8 +2413,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7411-JD ReadyIndex Jan-Dec Index - Contents Sheet</value>
+ <value>L7411-JD ReadyIndex Jan-Dec Index - Contents Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -2638,8 +2424,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7412-5 Insertable Tab Dividers - 5 Tabs</value>
+ <value>L7412-5 Insertable Tab Dividers - 5 Tabs</value>
</prop>
<prop oor:name="Measure">
@@ -2650,8 +2435,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7412-6 Insertable Tab Dividers - 6 Tabs</value>
+ <value>L7412-6 Insertable Tab Dividers - 6 Tabs</value>
</prop>
<prop oor:name="Measure">
@@ -2662,8 +2446,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7412-8 Insertable Tab Dividers - 8 Tabs</value>
+ <value>L7412-8 Insertable Tab Dividers - 8 Tabs</value>
</prop>
<prop oor:name="Measure">
@@ -2674,8 +2457,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7412-10 Insertable Tab Dividers - 10 Tabs</value>
+ <value>L7412-10 Insertable Tab Dividers - 10 Tabs</value>
</prop>
<prop oor:name="Measure">
@@ -2686,8 +2468,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7412-12 Insertable Tab Dividers - 12 Tabs</value>
+ <value>L7412-12 Insertable Tab Dividers - 12 Tabs</value>
</prop>
<prop oor:name="Measure">
@@ -2698,8 +2479,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7413 Business Card</value>
+ <value>L7413 Business Card</value>
</prop>
<prop oor:name="Measure">
@@ -2710,8 +2490,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7414 Business Card</value>
+ <value>L7414 Business Card</value>
</prop>
<prop oor:name="Measure">
@@ -2722,8 +2501,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7415 Business Card</value>
+ <value>L7415 Business Card</value>
</prop>
<prop oor:name="Measure">
@@ -2734,8 +2512,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7416-5 IndexMaker 5 part (Unpunched) - Labels</value>
+ <value>L7416-5 IndexMaker 5 part (Unpunched) - Labels</value>
</prop>
<prop oor:name="Measure">
@@ -2746,8 +2523,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7416-5 IndexMaker 5 part (Unpunched) - Contents Sheet</value>
+ <value>L7416-5 IndexMaker 5 part (Unpunched) - Contents Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -2758,8 +2534,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7416-6 IndexMaker 6 part - Extra Wide - Labels</value>
+ <value>L7416-6 IndexMaker 6 part - Extra Wide - Labels</value>
</prop>
<prop oor:name="Measure">
@@ -2770,8 +2545,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7416-6 IndexMaker 6 part - Extra Wide - Contents Sheet</value>
+ <value>L7416-6 IndexMaker 6 part - Extra Wide - Contents Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -2782,8 +2556,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7416-10 IndexMaker 10 part (Unpunched) - Labels</value>
+ <value>L7416-10 IndexMaker 10 part (Unpunched) - Labels</value>
</prop>
<prop oor:name="Measure">
@@ -2794,8 +2567,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7416-10 IndexMaker 10 part (Unpunched) - Contents Sheet</value>
+ <value>L7416-10 IndexMaker 10 part (Unpunched) - Contents Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -2806,8 +2578,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7416-12 IndexMaker 12 part - Extra Wide - Labels</value>
+ <value>L7416-12 IndexMaker 12 part - Extra Wide - Labels</value>
</prop>
<prop oor:name="Measure">
@@ -2818,8 +2589,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7416-12 IndexMaker 12 part - Extra Wide - Contents Sheet</value>
+ <value>L7416-12 IndexMaker 12 part - Extra Wide - Contents Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -2830,8 +2600,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7417 Business Card</value>
+ <value>L7417 Business Card</value>
</prop>
<prop oor:name="Measure">
@@ -2842,8 +2611,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7418 Name Badge</value>
+ <value>L7418 Name Badge</value>
</prop>
<prop oor:name="Measure">
@@ -2854,8 +2622,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7419 Business Card</value>
+ <value>L7419 Business Card</value>
</prop>
<prop oor:name="Measure">
@@ -2866,8 +2633,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7420-5 Direct Print Dividers</value>
+ <value>L7420-5 Direct Print Dividers</value>
</prop>
<prop oor:name="Measure">
@@ -2878,8 +2644,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7420-6 Direct Print Dividers</value>
+ <value>L7420-6 Direct Print Dividers</value>
</prop>
<prop oor:name="Measure">
@@ -2890,8 +2655,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7420-8 Direct Print Dividers</value>
+ <value>L7420-8 Direct Print Dividers</value>
</prop>
<prop oor:name="Measure">
@@ -2902,8 +2666,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7421 Post Card</value>
+ <value>L7421 Post Card</value>
</prop>
<prop oor:name="Measure">
@@ -2914,8 +2677,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7422 Suspension Tab Card Inserts</value>
+ <value>L7422 Suspension Tab Card Inserts</value>
</prop>
<prop oor:name="Measure">
@@ -2926,8 +2688,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7423 Delegate Card - Embossed</value>
+ <value>L7423 Delegate Card - Embossed</value>
</prop>
<prop oor:name="Measure">
@@ -2938,8 +2699,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7424 Lever Arch Labels</value>
+ <value>L7424 Lever Arch Labels</value>
</prop>
<prop oor:name="Measure">
@@ -2950,8 +2710,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7425 Lever Arch Labels</value>
+ <value>L7425 Lever Arch Labels</value>
</prop>
<prop oor:name="Measure">
@@ -2962,8 +2721,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7426 Note Card</value>
+ <value>L7426 Note Card</value>
</prop>
<prop oor:name="Measure">
@@ -2974,8 +2732,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7451-5 ReadyIndex 5 Index (Unnumbered) - Contents</value>
+ <value>L7451-5 ReadyIndex 5 Index (Unnumbered) - Contents</value>
</prop>
<prop oor:name="Measure">
@@ -2986,8 +2743,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7451-10 ReadyIndex 10 Index (Unnumbered) - Contents</value>
+ <value>L7451-10 ReadyIndex 10 Index (Unnumbered) - Contents</value>
</prop>
<prop oor:name="Measure">
@@ -2998,8 +2754,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7551 Clear Mini Address</value>
+ <value>L7551 Clear Mini Address</value>
</prop>
<prop oor:name="Measure">
@@ -3010,8 +2765,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7552 Clear Mini</value>
+ <value>L7552 Clear Mini</value>
</prop>
<prop oor:name="Measure">
@@ -3022,8 +2776,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7553 Clear Mini</value>
+ <value>L7553 Clear Mini</value>
</prop>
<prop oor:name="Measure">
@@ -3034,8 +2787,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7560 Clear Address</value>
+ <value>L7560 Clear Address</value>
</prop>
<prop oor:name="Measure">
@@ -3046,8 +2798,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7562 Clear Address</value>
+ <value>L7562 Clear Address</value>
</prop>
<prop oor:name="Measure">
@@ -3058,8 +2809,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7563 Clear Address</value>
+ <value>L7563 Clear Address</value>
</prop>
<prop oor:name="Measure">
@@ -3070,8 +2820,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7565 Clear Parcel</value>
+ <value>L7565 Clear Parcel</value>
</prop>
<prop oor:name="Measure">
@@ -3082,8 +2831,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7567 Clear A4 Labels</value>
+ <value>L7567 Clear A4 Labels</value>
</prop>
<prop oor:name="Measure">
@@ -3094,8 +2842,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7568 Clear A5 Labels</value>
+ <value>L7568 Clear A5 Labels</value>
</prop>
<prop oor:name="Measure">
@@ -3106,8 +2853,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7587 Laser Transparencies</value>
+ <value>L7587 Laser Transparencies</value>
</prop>
<prop oor:name="Measure">
@@ -3118,8 +2864,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7630 Circular</value>
+ <value>L7630 Circular</value>
</prop>
<prop oor:name="Measure">
@@ -3130,8 +2875,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7650 Circular</value>
+ <value>L7650 Circular</value>
</prop>
<prop oor:name="Measure">
@@ -3142,8 +2886,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7651 Mini Address</value>
+ <value>L7651 Mini Address</value>
</prop>
<prop oor:name="Measure">
@@ -3154,8 +2897,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7651/PF Mini Address</value>
+ <value>L7651/PF Mini Address</value>
</prop>
<prop oor:name="Measure">
@@ -3166,8 +2908,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7651/YF Mini Address</value>
+ <value>L7651/YF Mini Address</value>
</prop>
<prop oor:name="Measure">
@@ -3178,8 +2919,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7652 Miini Address</value>
+ <value>L7652 Miini Address</value>
</prop>
<prop oor:name="Measure">
@@ -3190,8 +2930,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7653 Mini</value>
+ <value>L7653 Mini</value>
</prop>
<prop oor:name="Measure">
@@ -3202,8 +2941,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7654 Miini Address</value>
+ <value>L7654 Miini Address</value>
</prop>
<prop oor:name="Measure">
@@ -3214,8 +2952,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7655 Audio Cassette</value>
+ <value>L7655 Audio Cassette</value>
</prop>
<prop oor:name="Measure">
@@ -3226,8 +2963,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7656 35 mm Slide</value>
+ <value>L7656 35 mm Slide</value>
</prop>
<prop oor:name="Measure">
@@ -3238,8 +2974,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7657 Mini Labels - Removable - Laser</value>
+ <value>L7657 Mini Labels - Removable - Laser</value>
</prop>
<prop oor:name="Measure">
@@ -3250,8 +2985,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7658 Mini Labels - Removable - Laser</value>
+ <value>L7658 Mini Labels - Removable - Laser</value>
</prop>
<prop oor:name="Measure">
@@ -3262,8 +2996,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7663 5.25&quot; Diskette</value>
+ <value>L7663 5.25&quot; Diskette</value>
</prop>
<prop oor:name="Measure">
@@ -3274,8 +3007,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7664 3.5&quot; Diskette - Wraparound</value>
+ <value>L7664 3.5&quot; Diskette - Wraparound</value>
</prop>
<prop oor:name="Measure">
@@ -3286,8 +3018,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7665 Mini Data Cartridge</value>
+ <value>L7665 Mini Data Cartridge</value>
</prop>
<prop oor:name="Measure">
@@ -3298,8 +3029,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7666 3.5&quot; Diskette - Face Only</value>
+ <value>L7666 3.5&quot; Diskette - Face Only</value>
</prop>
<prop oor:name="Measure">
@@ -3310,8 +3040,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7667 Standard Data Cartridge</value>
+ <value>L7667 Standard Data Cartridge</value>
</prop>
<prop oor:name="Measure">
@@ -3322,8 +3051,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7668 Labels for Zip(TM) Disk</value>
+ <value>L7668 Labels for Zip(TM) Disk</value>
</prop>
<prop oor:name="Measure">
@@ -3334,8 +3062,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7669 Labels for SuperDisk (TM )</value>
+ <value>L7669 Labels for SuperDisk (TM )</value>
</prop>
<prop oor:name="Measure">
@@ -3346,8 +3073,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7670 Circular - Fluorescent Yellow</value>
+ <value>L7670 Circular - Fluorescent Yellow</value>
</prop>
<prop oor:name="Measure">
@@ -3358,8 +3084,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7671 Video Face</value>
+ <value>L7671 Video Face</value>
</prop>
<prop oor:name="Measure">
@@ -3370,8 +3095,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7674 Video Spine</value>
+ <value>L7674 Video Spine</value>
</prop>
<prop oor:name="Measure">
@@ -3382,8 +3106,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7675 4mm Data Cartridge</value>
+ <value>L7675 4mm Data Cartridge</value>
</prop>
<prop oor:name="Measure">
@@ -3394,8 +3117,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7676 Full Face CD/DVD Labels - Black &amp; White</value>
+ <value>L7676 Full Face CD/DVD Labels - Black &amp; White</value>
</prop>
<prop oor:name="Measure">
@@ -3406,8 +3128,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7680 Mini Address - Gold</value>
+ <value>L7680 Mini Address - Gold</value>
</prop>
<prop oor:name="Measure">
@@ -3418,8 +3139,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7701 Lever Arch</value>
+ <value>L7701 Lever Arch</value>
</prop>
<prop oor:name="Measure">
@@ -3430,8 +3150,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7702 Lever Arch</value>
+ <value>L7702 Lever Arch</value>
</prop>
<prop oor:name="Measure">
@@ -3442,8 +3161,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7760 Full Face CD/DVD Labels - Colour Laser</value>
+ <value>L7760 Full Face CD/DVD Labels - Colour Laser</value>
</prop>
<prop oor:name="Measure">
@@ -3454,8 +3172,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7765 Presentation/Photo - Glossy Colour Laser</value>
+ <value>L7765 Presentation/Photo - Glossy Colour Laser</value>
</prop>
<prop oor:name="Measure">
@@ -3466,8 +3183,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7767 Presentation/Photo - Glossy Colour Laser</value>
+ <value>L7767 Presentation/Photo - Glossy Colour Laser</value>
</prop>
<prop oor:name="Measure">
@@ -3478,8 +3194,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7768 Presentation/Photo - Glossy Colour Laser</value>
+ <value>L7768 Presentation/Photo - Glossy Colour Laser</value>
</prop>
<prop oor:name="Measure">
@@ -3490,8 +3205,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7769 Presentation/Photo - Glossy Colour Laser</value>
+ <value>L7769 Presentation/Photo - Glossy Colour Laser</value>
</prop>
<prop oor:name="Measure">
@@ -3502,8 +3216,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7901 Organizer Page</value>
+ <value>L7901 Organizer Page</value>
</prop>
<prop oor:name="Measure">
@@ -3514,8 +3227,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7902 Organizer Page (A5)</value>
+ <value>L7902 Organizer Page (A5)</value>
</prop>
<prop oor:name="Measure">
@@ -3526,8 +3238,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7905 Compliment Slip</value>
+ <value>L7905 Compliment Slip</value>
</prop>
<prop oor:name="Measure">
@@ -3538,8 +3249,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">LPT110 Laser/Copier Transparency - 100micron</value>
+ <value>LPT110 Laser/Copier Transparency - 100micron</value>
</prop>
<prop oor:name="Measure">
@@ -3550,8 +3260,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">LPT111 Laser/Copier Transparency - 100micron</value>
+ <value>LPT111 Laser/Copier Transparency - 100micron</value>
</prop>
<prop oor:name="Measure">
@@ -3565,8 +3274,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2412 Laminated Cards, large</value>
+ <value>C2412 Laminated Cards, large</value>
</prop>
<prop oor:name="Measure">
@@ -3577,8 +3285,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2413 Laminated Cards</value>
+ <value>C2413 Laminated Cards</value>
</prop>
<prop oor:name="Measure">
@@ -3589,8 +3296,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2414 Laminated Cards</value>
+ <value>C2414 Laminated Cards</value>
</prop>
<prop oor:name="Measure">
@@ -3601,8 +3307,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C24412 Laminated Cards, large</value>
+ <value>C24412 Laminated Cards, large</value>
</prop>
<prop oor:name="Measure">
@@ -3613,8 +3318,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C25446 A5 Sheet</value>
+ <value>C25446 A5 Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -3625,8 +3329,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C25447 A5 Sheet</value>
+ <value>C25447 A5 Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -3637,8 +3340,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2546 Windows Decals</value>
+ <value>C2546 Windows Decals</value>
</prop>
<prop oor:name="Measure">
@@ -3649,8 +3351,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2547 Fantastic Plastic</value>
+ <value>C2547 Fantastic Plastic</value>
</prop>
<prop oor:name="Measure">
@@ -3661,8 +3362,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C91131 Business Cards</value>
+ <value>C91131 Business Cards</value>
</prop>
<prop oor:name="Measure">
@@ -3673,8 +3373,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C91149 Business Cards</value>
+ <value>C91149 Business Cards</value>
</prop>
<prop oor:name="Measure">
@@ -3685,8 +3384,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9167 A4 Sheet</value>
+ <value>C9167 A4 Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -3697,8 +3395,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9169 Glossy Photo Quality Labels</value>
+ <value>C9169 Glossy Photo Quality Labels</value>
</prop>
<prop oor:name="Measure">
@@ -3709,8 +3406,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9356 Photo Quality A4 Card Sheet</value>
+ <value>C9356 Photo Quality A4 Card Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -3721,8 +3417,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J21013 Business Cards</value>
+ <value>J21013 Business Cards</value>
</prop>
<prop oor:name="Measure">
@@ -3733,8 +3428,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J21015 Business Cards</value>
+ <value>J21015 Business Cards</value>
</prop>
<prop oor:name="Measure">
@@ -3745,8 +3439,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J21016 Business Cards</value>
+ <value>J21016 Business Cards</value>
</prop>
<prop oor:name="Measure">
@@ -3757,8 +3450,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J21031 Business Cards</value>
+ <value>J21031 Business Cards</value>
</prop>
<prop oor:name="Measure">
@@ -3769,8 +3461,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J21033 Business Cards</value>
+ <value>J21033 Business Cards</value>
</prop>
<prop oor:name="Measure">
@@ -3781,8 +3472,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J21131 Business Cards</value>
+ <value>J21131 Business Cards</value>
</prop>
<prop oor:name="Measure">
@@ -3793,8 +3483,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J21141 Greeting Cards</value>
+ <value>J21141 Greeting Cards</value>
</prop>
<prop oor:name="Measure">
@@ -3805,8 +3494,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J21149 Business Cards</value>
+ <value>J21149 Business Cards</value>
</prop>
<prop oor:name="Measure">
@@ -3817,8 +3505,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J2356 A4 Sheet</value>
+ <value>J2356 A4 Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -3829,8 +3516,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8359 Address</value>
+ <value>J8359 Address</value>
</prop>
<prop oor:name="Measure">
@@ -3841,8 +3527,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8360 Address</value>
+ <value>J8360 Address</value>
</prop>
<prop oor:name="Measure">
@@ -3853,8 +3538,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8361 Address</value>
+ <value>J8361 Address</value>
</prop>
<prop oor:name="Measure">
@@ -3865,8 +3549,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8362 Address</value>
+ <value>J8362 Address</value>
</prop>
<prop oor:name="Measure">
@@ -3877,8 +3560,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8363 Address</value>
+ <value>J8363 Address</value>
</prop>
<prop oor:name="Measure">
@@ -3889,8 +3571,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8365 Address</value>
+ <value>J8365 Address</value>
</prop>
<prop oor:name="Measure">
@@ -3901,8 +3582,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8367 Shipping A4</value>
+ <value>J8367 Shipping A4</value>
</prop>
<prop oor:name="Measure">
@@ -3913,8 +3593,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8368 Shipping A5</value>
+ <value>J8368 Shipping A5</value>
</prop>
<prop oor:name="Measure">
@@ -3925,8 +3604,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8369 Parcel</value>
+ <value>J8369 Parcel</value>
</prop>
<prop oor:name="Measure">
@@ -3937,8 +3615,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8371 Lever Arch</value>
+ <value>J8371 Lever Arch</value>
</prop>
<prop oor:name="Measure">
@@ -3949,8 +3626,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8751 Mini Address</value>
+ <value>J8751 Mini Address</value>
</prop>
<prop oor:name="Measure">
@@ -3961,8 +3637,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8756 35 mm Slide</value>
+ <value>J8756 35 mm Slide</value>
</prop>
<prop oor:name="Measure">
@@ -3973,8 +3648,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8766 3.5&quot; Diskette</value>
+ <value>J8766 3.5&quot; Diskette</value>
</prop>
<prop oor:name="Measure">
@@ -3985,8 +3659,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8771 Video Face</value>
+ <value>J8771 Video Face</value>
</prop>
<prop oor:name="Measure">
@@ -3997,8 +3670,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8774 Video Spine</value>
+ <value>J8774 Video Spine</value>
</prop>
<prop oor:name="Measure">
@@ -4009,8 +3681,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J88911 Address</value>
+ <value>J88911 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4021,8 +3692,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J88915 Address</value>
+ <value>J88915 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4033,8 +3703,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J88919 Address</value>
+ <value>J88919 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4045,8 +3714,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J88923 Address</value>
+ <value>J88923 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4057,8 +3725,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J88927 Address</value>
+ <value>J88927 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4069,8 +3736,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J88935 Address</value>
+ <value>J88935 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4081,8 +3747,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7159 Address</value>
+ <value>L7159 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4093,8 +3758,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7160 Address</value>
+ <value>L7160 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4105,8 +3769,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7161 Address</value>
+ <value>L7161 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4117,8 +3780,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7162 Address</value>
+ <value>L7162 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4129,8 +3791,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7163 Address</value>
+ <value>L7163 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4141,8 +3802,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7164 Address</value>
+ <value>L7164 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4153,8 +3813,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7165 Parcel</value>
+ <value>L7165 Parcel</value>
</prop>
<prop oor:name="Measure">
@@ -4165,8 +3824,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7166 Parcel</value>
+ <value>L7166 Parcel</value>
</prop>
<prop oor:name="Measure">
@@ -4177,8 +3835,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7167 Shipping</value>
+ <value>L7167 Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -4189,8 +3846,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7168 Shipping</value>
+ <value>L7168 Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -4201,8 +3857,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7169 Parcel</value>
+ <value>L7169 Parcel</value>
</prop>
<prop oor:name="Measure">
@@ -4213,8 +3868,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7170 Eurofolio</value>
+ <value>L7170 Eurofolio</value>
</prop>
<prop oor:name="Measure">
@@ -4225,8 +3879,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7171 Lever Arch</value>
+ <value>L7171 Lever Arch</value>
</prop>
<prop oor:name="Measure">
@@ -4237,8 +3890,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7172 Ring Binder</value>
+ <value>L7172 Ring Binder</value>
</prop>
<prop oor:name="Measure">
@@ -4249,8 +3901,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7173 Address</value>
+ <value>L7173 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4261,8 +3912,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7651 Mini Adress</value>
+ <value>L7651 Mini Adress</value>
</prop>
<prop oor:name="Measure">
@@ -4273,8 +3923,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7656 35 mm Slide</value>
+ <value>L7656 35 mm Slide</value>
</prop>
<prop oor:name="Measure">
@@ -4285,8 +3934,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7664 3.5&quot; Diskette - Wraparound</value>
+ <value>L7664 3.5&quot; Diskette - Wraparound</value>
</prop>
<prop oor:name="Measure">
@@ -4297,8 +3945,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7665 Mini Data Cartridge</value>
+ <value>L7665 Mini Data Cartridge</value>
</prop>
<prop oor:name="Measure">
@@ -4309,8 +3956,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7666 3.5&quot; Diskette</value>
+ <value>L7666 3.5&quot; Diskette</value>
</prop>
<prop oor:name="Measure">
@@ -4321,8 +3967,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7667 Standard Data Cartridge</value>
+ <value>L7667 Standard Data Cartridge</value>
</prop>
<prop oor:name="Measure">
@@ -4333,8 +3978,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7668 Labels for Zip(TM) Disk</value>
+ <value>L7668 Labels for Zip(TM) Disk</value>
</prop>
<prop oor:name="Measure">
@@ -4345,8 +3989,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7671 Video Face</value>
+ <value>L7671 Video Face</value>
</prop>
<prop oor:name="Measure">
@@ -4357,8 +4000,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7674 Video Spine</value>
+ <value>L7674 Video Spine</value>
</prop>
<prop oor:name="Measure">
@@ -4369,8 +4011,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L78382 Address</value>
+ <value>L78382 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4381,8 +4022,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L78383 Address</value>
+ <value>L78383 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4393,8 +4033,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L78384 Address</value>
+ <value>L78384 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4405,8 +4044,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L78386 Address</value>
+ <value>L78386 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4417,8 +4055,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L78387 Address</value>
+ <value>L78387 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4429,8 +4066,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L78388 Address</value>
+ <value>L78388 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4441,8 +4077,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">M21131 Business Cards</value>
+ <value>M21131 Business Cards</value>
</prop>
<prop oor:name="Measure">
@@ -4453,8 +4088,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">M8167 A4 Sheet</value>
+ <value>M8167 A4 Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -4465,8 +4099,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">M88173 Address</value>
+ <value>M88173 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4477,8 +4110,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">M88175 Address</value>
+ <value>M88175 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4489,8 +4121,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">M88177 Address</value>
+ <value>M88177 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4501,8 +4132,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">M88179 Address</value>
+ <value>M88179 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4513,8 +4143,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">M88183 Address</value>
+ <value>M88183 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4525,8 +4154,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">M88185 Address</value>
+ <value>M88185 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4537,8 +4165,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">M88187 Address</value>
+ <value>M88187 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4549,8 +4176,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">M88315 Address</value>
+ <value>M88315 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4561,8 +4187,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">P78204 Address</value>
+ <value>P78204 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4573,8 +4198,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">P78261 Address</value>
+ <value>P78261 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4585,8 +4209,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">P78270 Address</value>
+ <value>P78270 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4597,8 +4220,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">P78275 Address</value>
+ <value>P78275 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4612,8 +4234,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5167 Return Address</value>
+ <value>5167 Return Address</value>
</prop>
<prop oor:name="Measure">
@@ -4624,8 +4245,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5267 Return Address</value>
+ <value>5267 Return Address</value>
</prop>
<prop oor:name="Measure">
@@ -4636,8 +4256,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5160 Address</value>
+ <value>5160 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4648,8 +4267,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5260 Address</value>
+ <value>5260 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4660,8 +4278,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5960 Address</value>
+ <value>5960 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4672,8 +4289,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5159 Address</value>
+ <value>5159 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4684,8 +4300,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5161 Address</value>
+ <value>5161 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4696,8 +4311,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5261 Address</value>
+ <value>5261 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4708,8 +4322,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5961 Address</value>
+ <value>5961 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4720,8 +4333,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5162 Address</value>
+ <value>5162 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4732,8 +4344,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5262 Address</value>
+ <value>5262 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4744,8 +4355,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5922 Address</value>
+ <value>5922 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4756,8 +4366,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5962 Address</value>
+ <value>5962 Address</value>
</prop>
<prop oor:name="Measure">
@@ -4768,8 +4377,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5163 Address / Shipping</value>
+ <value>5163 Address / Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -4780,8 +4388,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5263 Address / Shipping</value>
+ <value>5263 Address / Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -4792,8 +4399,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5963 Address / Shipping</value>
+ <value>5963 Address / Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -4804,8 +4410,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5164 Address / Shipping</value>
+ <value>5164 Address / Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -4816,8 +4421,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5264 Address / Shipping</value>
+ <value>5264 Address / Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -4828,8 +4432,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5168 Shipping</value>
+ <value>5168 Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -4840,8 +4443,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5667 Clear Return Address</value>
+ <value>5667 Clear Return Address</value>
</prop>
<prop oor:name="Measure">
@@ -4852,8 +4454,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5660 Clear Address</value>
+ <value>5660 Clear Address</value>
</prop>
<prop oor:name="Measure">
@@ -4864,8 +4465,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5930 Clear Address</value>
+ <value>5930 Clear Address</value>
</prop>
<prop oor:name="Measure">
@@ -4876,8 +4476,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5661 Clear Address</value>
+ <value>5661 Clear Address</value>
</prop>
<prop oor:name="Measure">
@@ -4888,8 +4487,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5662 Clear Address</value>
+ <value>5662 Clear Address</value>
</prop>
<prop oor:name="Measure">
@@ -4900,8 +4498,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5663 Clear Address</value>
+ <value>5663 Clear Address</value>
</prop>
<prop oor:name="Measure">
@@ -4912,8 +4509,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5664 Clear Address / Shipping</value>
+ <value>5664 Clear Address / Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -4924,8 +4520,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5165 Full Sheet</value>
+ <value>5165 Full Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -4936,8 +4531,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5265 Full Sheet</value>
+ <value>5265 Full Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -4948,8 +4542,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5266 File Folder-Assorted</value>
+ <value>5266 File Folder-Assorted</value>
</prop>
<prop oor:name="Measure">
@@ -4960,8 +4553,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5066 File Folder-Red</value>
+ <value>5066 File Folder-Red</value>
</prop>
<prop oor:name="Measure">
@@ -4972,8 +4564,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5166 File Folder-Orange</value>
+ <value>5166 File Folder-Orange</value>
</prop>
<prop oor:name="Measure">
@@ -4984,8 +4575,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5366 File Folder-White</value>
+ <value>5366 File Folder-White</value>
</prop>
<prop oor:name="Measure">
@@ -4996,8 +4586,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5666 File Folder-Purple</value>
+ <value>5666 File Folder-Purple</value>
</prop>
<prop oor:name="Measure">
@@ -5008,8 +4597,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5766 File Folder-Blue</value>
+ <value>5766 File Folder-Blue</value>
</prop>
<prop oor:name="Measure">
@@ -5020,8 +4608,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5866 File Folder-Green</value>
+ <value>5866 File Folder-Green</value>
</prop>
<prop oor:name="Measure">
@@ -5032,8 +4619,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5966 File Folder-Yellow</value>
+ <value>5966 File Folder-Yellow</value>
</prop>
<prop oor:name="Measure">
@@ -5044,8 +4630,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5293 Round</value>
+ <value>5293 Round</value>
</prop>
<prop oor:name="Measure">
@@ -5056,8 +4641,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5294 Round</value>
+ <value>5294 Round</value>
</prop>
<prop oor:name="Measure">
@@ -5068,8 +4652,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5196 3-1/2&quot; Diskette - White</value>
+ <value>5196 3-1/2&quot; Diskette - White</value>
</prop>
<prop oor:name="Measure">
@@ -5080,8 +4663,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5096 3-1/2&quot; Diskette - Red</value>
+ <value>5096 3-1/2&quot; Diskette - Red</value>
</prop>
<prop oor:name="Measure">
@@ -5092,8 +4674,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5896 3-1/2&quot; Diskette - Blue</value>
+ <value>5896 3-1/2&quot; Diskette - Blue</value>
</prop>
<prop oor:name="Measure">
@@ -5104,8 +4685,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5197 5-1/4 Diskette - White</value>
+ <value>5197 5-1/4 Diskette - White</value>
</prop>
<prop oor:name="Measure">
@@ -5116,8 +4696,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5198 Audio Cassette</value>
+ <value>5198 Audio Cassette</value>
</prop>
<prop oor:name="Measure">
@@ -5128,8 +4707,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5199 Video Cassette Face</value>
+ <value>5199 Video Cassette Face</value>
</prop>
<prop oor:name="Measure">
@@ -5140,8 +4718,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5199 Video Cassette Spine</value>
+ <value>5199 Video Cassette Spine</value>
</prop>
<prop oor:name="Measure">
@@ -5152,8 +4729,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5925 White Laser Labels for Zip Disks (bottom spine)</value>
+ <value>5925 White Laser Labels for Zip Disks (bottom spine)</value>
</prop>
<prop oor:name="Measure">
@@ -5164,8 +4740,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5925 White Laser Labels for Zip Disks (face)</value>
+ <value>5925 White Laser Labels for Zip Disks (face)</value>
</prop>
<prop oor:name="Measure">
@@ -5176,8 +4751,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5925 White Laser Labels for Zip Disks (top spine)</value>
+ <value>5925 White Laser Labels for Zip Disks (top spine)</value>
</prop>
<prop oor:name="Measure">
@@ -5188,8 +4762,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5931 White CD/DVD Labels for Lasers (face)</value>
+ <value>5931 White CD/DVD Labels for Lasers (face)</value>
</prop>
<prop oor:name="Measure">
@@ -5200,8 +4773,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5931 White CD/DVD Labels for Lasers (spines)</value>
+ <value>5931 White CD/DVD Labels for Lasers (spines)</value>
</prop>
<prop oor:name="Measure">
@@ -5212,8 +4784,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5970 Fluorescent Laser - Magenta</value>
+ <value>5970 Fluorescent Laser - Magenta</value>
</prop>
<prop oor:name="Measure">
@@ -5224,8 +4795,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5971 Fluorescent Laser - Green</value>
+ <value>5971 Fluorescent Laser - Green</value>
</prop>
<prop oor:name="Measure">
@@ -5236,8 +4806,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5972 Fluorescent Laser - Yellow</value>
+ <value>5972 Fluorescent Laser - Yellow</value>
</prop>
<prop oor:name="Measure">
@@ -5248,8 +4817,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5975 Fluorescent Laser - Full Sheet Assorted</value>
+ <value>5975 Fluorescent Laser - Full Sheet Assorted</value>
</prop>
<prop oor:name="Measure">
@@ -5260,8 +4828,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5979 Fluorescent Laser - Assorted</value>
+ <value>5979 Fluorescent Laser - Assorted</value>
</prop>
<prop oor:name="Measure">
@@ -5272,8 +4839,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5980 Pastel Laser - Blue</value>
+ <value>5980 Pastel Laser - Blue</value>
</prop>
<prop oor:name="Measure">
@@ -5284,8 +4850,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5997 Videotape Face</value>
+ <value>5997 Videotape Face</value>
</prop>
<prop oor:name="Measure">
@@ -5296,8 +4861,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5997 Videotape Spine</value>
+ <value>5997 Videotape Spine</value>
</prop>
<prop oor:name="Measure">
@@ -5308,8 +4872,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5998 Audio Tape</value>
+ <value>5998 Audio Tape</value>
</prop>
<prop oor:name="Measure">
@@ -5320,8 +4883,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5395 Name Badge - White</value>
+ <value>5395 Name Badge - White</value>
</prop>
<prop oor:name="Measure">
@@ -5332,8 +4894,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5095 Name Badge - Red</value>
+ <value>5095 Name Badge - Red</value>
</prop>
<prop oor:name="Measure">
@@ -5344,8 +4905,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5895 Name Badge - Blue</value>
+ <value>5895 Name Badge - Blue</value>
</prop>
<prop oor:name="Measure">
@@ -5356,8 +4916,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5371 Business Card - White</value>
+ <value>5371 Business Card - White</value>
</prop>
<prop oor:name="Measure">
@@ -5368,8 +4927,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5871 Laser Business Card</value>
+ <value>5871 Laser Business Card</value>
</prop>
<prop oor:name="Measure">
@@ -5380,8 +4938,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5376 Business Card - Ivory</value>
+ <value>5376 Business Card - Ivory</value>
</prop>
<prop oor:name="Measure">
@@ -5392,8 +4949,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5377 Business Card - Gray</value>
+ <value>5377 Business Card - Gray</value>
</prop>
<prop oor:name="Measure">
@@ -5404,8 +4960,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5911 Business Card</value>
+ <value>5911 Business Card</value>
</prop>
<prop oor:name="Measure">
@@ -5416,8 +4971,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5383 Name Tag Kit</value>
+ <value>5383 Name Tag Kit</value>
</prop>
<prop oor:name="Measure">
@@ -5428,8 +4982,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5390 Name Tag Refill</value>
+ <value>5390 Name Tag Refill</value>
</prop>
<prop oor:name="Measure">
@@ -5440,8 +4993,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5883 Name Tag Kit - Blue</value>
+ <value>5883 Name Tag Kit - Blue</value>
</prop>
<prop oor:name="Measure">
@@ -5452,8 +5004,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5384 Name Tag Kit</value>
+ <value>5384 Name Tag Kit</value>
</prop>
<prop oor:name="Measure">
@@ -5464,8 +5015,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5392 Name Tag Refill</value>
+ <value>5392 Name Tag Refill</value>
</prop>
<prop oor:name="Measure">
@@ -5476,8 +5026,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5385 Rotary Card - Small</value>
+ <value>5385 Rotary Card - Small</value>
</prop>
<prop oor:name="Measure">
@@ -5488,8 +5037,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5386 Rotary Card - Large</value>
+ <value>5386 Rotary Card - Large</value>
</prop>
<prop oor:name="Measure">
@@ -5500,8 +5048,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5388 Index Card</value>
+ <value>5388 Index Card</value>
</prop>
<prop oor:name="Measure">
@@ -5512,8 +5059,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5389 Post Card</value>
+ <value>5389 Post Card</value>
</prop>
<prop oor:name="Measure">
@@ -5524,8 +5070,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5305 Laser Tent Cards Med.</value>
+ <value>5305 Laser Tent Cards Med.</value>
</prop>
<prop oor:name="Measure">
@@ -5536,8 +5081,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5309 Laser Tent Cards Large</value>
+ <value>5309 Laser Tent Cards Large</value>
</prop>
<prop oor:name="Measure">
@@ -5548,8 +5092,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5315 Laser Note Cards</value>
+ <value>5315 Laser Note Cards</value>
</prop>
<prop oor:name="Measure">
@@ -5560,8 +5103,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5361 Laminated ID Cards</value>
+ <value>5361 Laminated ID Cards</value>
</prop>
<prop oor:name="Measure">
@@ -5572,8 +5114,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5361 Laminated ID Cards-Single Card</value>
+ <value>5361 Laminated ID Cards-Single Card</value>
</prop>
<prop oor:name="Measure">
@@ -5584,8 +5125,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5362 Laminated Name Badges</value>
+ <value>5362 Laminated Name Badges</value>
</prop>
<prop oor:name="Measure">
@@ -5596,8 +5136,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5362 Laminated N. Badges-Single Card</value>
+ <value>5362 Laminated N. Badges-Single Card</value>
</prop>
<prop oor:name="Measure">
@@ -5608,8 +5147,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5364 Laminated Rotary Index Cards</value>
+ <value>5364 Laminated Rotary Index Cards</value>
</prop>
<prop oor:name="Measure">
@@ -5620,8 +5158,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5364 Laminated Rotary Index-Single Card</value>
+ <value>5364 Laminated Rotary Index-Single Card</value>
</prop>
<prop oor:name="Measure">
@@ -5632,8 +5169,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">74520 Name Badge Inserts - 3&quot; x 4&quot;</value>
+ <value>74520 Name Badge Inserts - 3&quot; x 4&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -5644,8 +5180,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">74540 Name Badge Inserts - 3&quot; x 4&quot;</value>
+ <value>74540 Name Badge Inserts - 3&quot; x 4&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -5656,8 +5191,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">74541 Name Badge Inserts - 3&quot; x 4&quot;</value>
+ <value>74541 Name Badge Inserts - 3&quot; x 4&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -5668,8 +5202,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">74550 Name Badge Inserts - 2 1/4&quot; x 3 1/2&quot;</value>
+ <value>74550 Name Badge Inserts - 2 1/4&quot; x 3 1/2&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -5680,8 +5213,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">74552 Name Badge Inserts - 2&quot; x 3&quot;</value>
+ <value>74552 Name Badge Inserts - 2&quot; x 3&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -5692,8 +5224,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">74558 Name Badge Inserts - 2&quot; x 3&quot;</value>
+ <value>74558 Name Badge Inserts - 2&quot; x 3&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -5704,8 +5235,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">74650 Name Badge Inserts - 2 1/4&quot; x 3 1/2&quot;</value>
+ <value>74650 Name Badge Inserts - 2 1/4&quot; x 3 1/2&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -5716,8 +5246,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">74651 Name Badge Inserts - 2 1/4&quot; x 3 1/2&quot;</value>
+ <value>74651 Name Badge Inserts - 2 1/4&quot; x 3 1/2&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -5728,8 +5257,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8160 Ink Jet Address</value>
+ <value>8160 Ink Jet Address</value>
</prop>
<prop oor:name="Measure">
@@ -5740,8 +5268,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8460 Ink Jet Address</value>
+ <value>8460 Ink Jet Address</value>
</prop>
<prop oor:name="Measure">
@@ -5752,8 +5279,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8461 Ink Jet Address</value>
+ <value>8461 Ink Jet Address</value>
</prop>
<prop oor:name="Measure">
@@ -5764,8 +5290,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8161 Ink Jet Address</value>
+ <value>8161 Ink Jet Address</value>
</prop>
<prop oor:name="Measure">
@@ -5776,8 +5301,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8162 Ink Jet Address</value>
+ <value>8162 Ink Jet Address</value>
</prop>
<prop oor:name="Measure">
@@ -5788,8 +5312,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8462 Ink Jet Address</value>
+ <value>8462 Ink Jet Address</value>
</prop>
<prop oor:name="Measure">
@@ -5800,8 +5323,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8163 Ink Jet Address / Shipping</value>
+ <value>8163 Ink Jet Address / Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -5812,8 +5334,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8463 Ink Jet Address / Shipping</value>
+ <value>8463 Ink Jet Address / Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -5824,8 +5345,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8464 Ink Jet Address / Shipping</value>
+ <value>8464 Ink Jet Address / Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -5836,8 +5356,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8923 Ink Jet Address / Shipping</value>
+ <value>8923 Ink Jet Address / Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -5848,8 +5367,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8164 Ink Jet Address / Shipping</value>
+ <value>8164 Ink Jet Address / Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -5860,8 +5378,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8165 Ink Jet Full Sheet</value>
+ <value>8165 Ink Jet Full Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -5872,8 +5389,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8465 Ink Jet Full Sheet</value>
+ <value>8465 Ink Jet Full Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -5884,8 +5400,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8166 Ink Jet File Folder-Assorted</value>
+ <value>8166 Ink Jet File Folder-Assorted</value>
</prop>
<prop oor:name="Measure">
@@ -5896,8 +5411,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8366 Ink Jet File Folder-White</value>
+ <value>8366 Ink Jet File Folder-White</value>
</prop>
<prop oor:name="Measure">
@@ -5908,8 +5422,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8167 Ink Jet Return Address</value>
+ <value>8167 Ink Jet Return Address</value>
</prop>
<prop oor:name="Measure">
@@ -5920,8 +5433,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8196 Ink Jet 3-1/2&quot; Diskette</value>
+ <value>8196 Ink Jet 3-1/2&quot; Diskette</value>
</prop>
<prop oor:name="Measure">
@@ -5932,8 +5444,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8250 Ink Jet Label for Color Printing</value>
+ <value>8250 Ink Jet Label for Color Printing</value>
</prop>
<prop oor:name="Measure">
@@ -5944,8 +5455,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8252 Ink Jet Label for Color Printing</value>
+ <value>8252 Ink Jet Label for Color Printing</value>
</prop>
<prop oor:name="Measure">
@@ -5956,8 +5466,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8253 Ink Jet Label for Color Printing</value>
+ <value>8253 Ink Jet Label for Color Printing</value>
</prop>
<prop oor:name="Measure">
@@ -5968,8 +5477,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8254 Ink Jet Label for Color Printing</value>
+ <value>8254 Ink Jet Label for Color Printing</value>
</prop>
<prop oor:name="Measure">
@@ -5980,8 +5488,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8255 Ink Jet Label for Color Printing </value>
+ <value>8255 Ink Jet Label for Color Printing </value>
</prop>
<prop oor:name="Measure">
@@ -5992,8 +5499,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8257 Ink Jet Return Address for Color Printing</value>
+ <value>8257 Ink Jet Return Address for Color Printing</value>
</prop>
<prop oor:name="Measure">
@@ -6004,8 +5510,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8309 Tent Card Large</value>
+ <value>8309 Tent Card Large</value>
</prop>
<prop oor:name="Measure">
@@ -6016,8 +5521,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8315 Ink Jet Note Cards</value>
+ <value>8315 Ink Jet Note Cards</value>
</prop>
<prop oor:name="Measure">
@@ -6028,8 +5532,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8316 Ink Jet Greeting Card (Portrait)*</value>
+ <value>8316 Ink Jet Greeting Card (Portrait)*</value>
</prop>
<prop oor:name="Measure">
@@ -6040,8 +5543,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8316 Ink Jet Greeting Card (Landscape)*</value>
+ <value>8316 Ink Jet Greeting Card (Landscape)*</value>
</prop>
<prop oor:name="Measure">
@@ -6052,8 +5554,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8324 Ink Jet Brochures</value>
+ <value>8324 Ink Jet Brochures</value>
</prop>
<prop oor:name="Measure">
@@ -6064,8 +5565,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8371 Ink Jet Business Card</value>
+ <value>8371 Ink Jet Business Card</value>
</prop>
<prop oor:name="Measure">
@@ -6076,8 +5576,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8385 Rotary Card - Small</value>
+ <value>8385 Rotary Card - Small</value>
</prop>
<prop oor:name="Measure">
@@ -6088,8 +5587,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8387 Ink Jet Postcard - 4-up</value>
+ <value>8387 Ink Jet Postcard - 4-up</value>
</prop>
<prop oor:name="Measure">
@@ -6100,8 +5598,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8388 Index Card</value>
+ <value>8388 Index Card</value>
</prop>
<prop oor:name="Measure">
@@ -6112,8 +5609,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8871 Clean Edge Business Cards (IJ)</value>
+ <value>8871 Clean Edge Business Cards (IJ)</value>
</prop>
<prop oor:name="Measure">
@@ -6124,8 +5620,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8376 Ink Jet Business Card - Ivory</value>
+ <value>8376 Ink Jet Business Card - Ivory</value>
</prop>
<prop oor:name="Measure">
@@ -6136,8 +5631,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8377 Ink Jet Business Card - Gray</value>
+ <value>8377 Ink Jet Business Card - Gray</value>
</prop>
<prop oor:name="Measure">
@@ -6148,8 +5642,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8660 Ink Jet Clear Address</value>
+ <value>8660 Ink Jet Clear Address</value>
</prop>
<prop oor:name="Measure">
@@ -6160,8 +5653,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8662 Ink Jet Clear Address</value>
+ <value>8662 Ink Jet Clear Address</value>
</prop>
<prop oor:name="Measure">
@@ -6172,8 +5664,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8663 Ink Jet Clear Address/Shipping</value>
+ <value>8663 Ink Jet Clear Address/Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -6184,8 +5675,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8665 Ink Jet Clear Full Sheet</value>
+ <value>8665 Ink Jet Clear Full Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -6196,8 +5686,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8667 Ink Jet Clear Address Labels</value>
+ <value>8667 Ink Jet Clear Address Labels</value>
</prop>
<prop oor:name="Measure">
@@ -6208,8 +5697,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8925 White Inkjet Labels for Zip Disks (bottom spine)</value>
+ <value>8925 White Inkjet Labels for Zip Disks (bottom spine)</value>
</prop>
<prop oor:name="Measure">
@@ -6220,8 +5708,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8925 White Inkjet Labels for Zip Disks (face)</value>
+ <value>8925 White Inkjet Labels for Zip Disks (face)</value>
</prop>
<prop oor:name="Measure">
@@ -6232,8 +5719,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8925 White Inkjet Labels for Zip Disks (top spine)</value>
+ <value>8925 White Inkjet Labels for Zip Disks (top spine)</value>
</prop>
<prop oor:name="Measure">
@@ -6244,8 +5730,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8931 White CD/DVD Jewel Case Insert (spines)</value>
+ <value>8931 White CD/DVD Jewel Case Insert (spines)</value>
</prop>
<prop oor:name="Measure">
@@ -6256,8 +5741,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8931 White CD/DVD Jewel Case Inserts (cover)</value>
+ <value>8931 White CD/DVD Jewel Case Inserts (cover)</value>
</prop>
<prop oor:name="Measure">
@@ -6268,8 +5752,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8931 White CD/DVD Jewel Case Inserts (tray)</value>
+ <value>8931 White CD/DVD Jewel Case Inserts (tray)</value>
</prop>
<prop oor:name="Measure">
@@ -6280,8 +5763,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8931 White CD/DVD Labels for Inkjet Printers</value>
+ <value>8931 White CD/DVD Labels for Inkjet Printers</value>
</prop>
<prop oor:name="Measure">
@@ -6292,8 +5774,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11161 Ready Index ExtraWide 5 Tab</value>
+ <value>11161 Ready Index ExtraWide 5 Tab</value>
</prop>
<prop oor:name="Measure">
@@ -6304,8 +5785,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11163 Ready Index ExtraWide 8 Tab</value>
+ <value>11163 Ready Index ExtraWide 8 Tab</value>
</prop>
<prop oor:name="Measure">
@@ -6316,8 +5796,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11165 Ready Index ExtraWide 10 Tab</value>
+ <value>11165 Ready Index ExtraWide 10 Tab</value>
</prop>
<prop oor:name="Measure">
@@ -6328,8 +5807,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11526 Direct Print Custom Dividers 5 Tab Single Set</value>
+ <value>11526 Direct Print Custom Dividers 5 Tab Single Set</value>
</prop>
<prop oor:name="Measure">
@@ -6340,8 +5818,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11527 Direct Print Custom Dividers 8 Tab Single Set</value>
+ <value>11527 Direct Print Custom Dividers 8 Tab Single Set</value>
</prop>
<prop oor:name="Measure">
@@ -6352,8 +5829,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11171 Easy Edit Ready Index - 5 Tabs</value>
+ <value>11171 Easy Edit Ready Index - 5 Tabs</value>
</prop>
<prop oor:name="Measure">
@@ -6364,8 +5840,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11172 Easy Edit Ready Index - 8 Tabs</value>
+ <value>11172 Easy Edit Ready Index - 8 Tabs</value>
</prop>
<prop oor:name="Measure">
@@ -6376,8 +5851,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11173 Easy Edit Ready Index - 10 Tabs</value>
+ <value>11173 Easy Edit Ready Index - 10 Tabs</value>
</prop>
<prop oor:name="Measure">
@@ -6388,8 +5862,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11251 Clear Label/Index Maker Presentation Kit 5 Tab</value>
+ <value>11251 Clear Label/Index Maker Presentation Kit 5 Tab</value>
</prop>
<prop oor:name="Measure">
@@ -6400,8 +5873,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11251 Clear Label/Index Maker Spine Label 1/4&quot; or 5/16&quot;</value>
+ <value>11251 Clear Label/Index Maker Spine Label 1/4&quot; or 5/16&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6412,8 +5884,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11251 Clear Label/Index Maker Spine Label 3/8&quot; or 1/2&quot;</value>
+ <value>11251 Clear Label/Index Maker Spine Label 3/8&quot; or 1/2&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6424,8 +5895,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11251 Clear Label/Index Maker Spine Label 5/8&quot; or 3/4&quot;</value>
+ <value>11251 Clear Label/Index Maker Spine Label 5/8&quot; or 3/4&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6436,8 +5906,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11251 Clear Label/Index Maker Spine Label 1&quot; or Larger</value>
+ <value>11251 Clear Label/Index Maker Spine Label 1&quot; or Larger</value>
</prop>
<prop oor:name="Measure">
@@ -6448,8 +5917,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11253 Clear Label/Index Maker Narrow 5 Tab</value>
+ <value>11253 Clear Label/Index Maker Narrow 5 Tab</value>
</prop>
<prop oor:name="Measure">
@@ -6460,8 +5928,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11253 Clear Label/Index Maker Spine Label 1/4&quot; or 5/16&quot;</value>
+ <value>11253 Clear Label/Index Maker Spine Label 1/4&quot; or 5/16&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6472,8 +5939,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11253 Clear Label/Index Maker Spine Label 3/8&quot; or 1/2&quot;</value>
+ <value>11253 Clear Label/Index Maker Spine Label 3/8&quot; or 1/2&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6484,8 +5950,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11253 Clear Label/Index Maker Spine Label 5/8&quot; or 3/4&quot;</value>
+ <value>11253 Clear Label/Index Maker Spine Label 5/8&quot; or 3/4&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6496,8 +5961,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11253 Clear Label/Index Maker Spine Label 1&quot; or Larger</value>
+ <value>11253 Clear Label/Index Maker Spine Label 1&quot; or Larger</value>
</prop>
<prop oor:name="Measure">
@@ -6508,8 +5972,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11260 Ready Index Landscape - 5 Tabs</value>
+ <value>11260 Ready Index Landscape - 5 Tabs</value>
</prop>
<prop oor:name="Measure">
@@ -6520,8 +5983,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">11261 Ready Index Landscape - 8 Tabs</value>
+ <value>11261 Ready Index Landscape - 8 Tabs</value>
</prop>
<prop oor:name="Measure">
@@ -6532,8 +5994,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">12260 Ready Index Landscape - 5 Tabs</value>
+ <value>12260 Ready Index Landscape - 5 Tabs</value>
</prop>
<prop oor:name="Measure">
@@ -6544,8 +6005,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">12261 Ready Index Landscape - 8 Tabs</value>
+ <value>12261 Ready Index Landscape - 8 Tabs</value>
</prop>
<prop oor:name="Measure">
@@ -6556,8 +6016,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Index Maker 3 Tab</value>
+ <value>Index Maker 3 Tab</value>
</prop>
<prop oor:name="Measure">
@@ -6568,8 +6027,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Index Maker 5 Tab</value>
+ <value>Index Maker 5 Tab</value>
</prop>
<prop oor:name="Measure">
@@ -6580,8 +6038,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Index Maker 8 Tab</value>
+ <value>Index Maker 8 Tab</value>
</prop>
<prop oor:name="Measure">
@@ -6592,8 +6049,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Hidden Tab 5 Tab</value>
+ <value>Hidden Tab 5 Tab</value>
</prop>
<prop oor:name="Measure">
@@ -6604,8 +6060,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Hidden Tab 8 Tab</value>
+ <value>Hidden Tab 8 Tab</value>
</prop>
<prop oor:name="Measure">
@@ -6616,8 +6071,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Hidden Tab 10 Tab</value>
+ <value>Hidden Tab 10 Tab</value>
</prop>
<prop oor:name="Measure">
@@ -6628,8 +6082,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Prof. Ready Index Spine Insert 1&quot;</value>
+ <value>Prof. Ready Index Spine Insert 1&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6640,8 +6093,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Prof. Ready Index Spine Insert 1 1/2&quot;</value>
+ <value>Prof. Ready Index Spine Insert 1 1/2&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6652,8 +6104,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Prof. Ready Index Spine Insert 2&quot;</value>
+ <value>Prof. Ready Index Spine Insert 2&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6664,8 +6115,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Prof. Ready Index Spine Insert 3&quot;</value>
+ <value>Prof. Ready Index Spine Insert 3&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6676,8 +6126,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Ready Index 5 Tab</value>
+ <value>Ready Index 5 Tab</value>
</prop>
<prop oor:name="Measure">
@@ -6688,8 +6137,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Ready Index 8 Tab</value>
+ <value>Ready Index 8 Tab</value>
</prop>
<prop oor:name="Measure">
@@ -6700,8 +6148,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Ready Index 10 Tab</value>
+ <value>Ready Index 10 Tab</value>
</prop>
<prop oor:name="Measure">
@@ -6712,8 +6159,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Ready Index 12 Tab</value>
+ <value>Ready Index 12 Tab</value>
</prop>
<prop oor:name="Measure">
@@ -6724,8 +6170,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Ready Index 15 Tab</value>
+ <value>Ready Index 15 Tab</value>
</prop>
<prop oor:name="Measure">
@@ -6736,8 +6181,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">WorkSaver Divider 5 Tabs</value>
+ <value>WorkSaver Divider 5 Tabs</value>
</prop>
<prop oor:name="Measure">
@@ -6748,8 +6192,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">WorkSaver Divider 8 Tabs</value>
+ <value>WorkSaver Divider 8 Tabs</value>
</prop>
<prop oor:name="Measure">
@@ -6760,8 +6203,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">WorkSaver Inserts 1/3 Cut</value>
+ <value>WorkSaver Inserts 1/3 Cut</value>
</prop>
<prop oor:name="Measure">
@@ -6772,8 +6214,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">WorkSaver Inserts 1/5 Cut</value>
+ <value>WorkSaver Inserts 1/5 Cut</value>
</prop>
<prop oor:name="Measure">
@@ -6784,8 +6225,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Self Adhesive Index Tab 1&quot;</value>
+ <value>Self Adhesive Index Tab 1&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6796,8 +6236,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Self Adhesive Index Tab 1 1/2&quot;</value>
+ <value>Self Adhesive Index Tab 1 1/2&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6808,8 +6247,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Self Adhesive Index Tab 2&quot;</value>
+ <value>Self Adhesive Index Tab 2&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6820,8 +6258,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Protect &apos;n Tab - 5 Tab</value>
+ <value>Protect &apos;n Tab - 5 Tab</value>
</prop>
<prop oor:name="Measure">
@@ -6832,8 +6269,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">Protect &apos;n Tab - 8 Tab</value>
+ <value>Protect &apos;n Tab - 8 Tab</value>
</prop>
<prop oor:name="Measure">
@@ -6844,8 +6280,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">TitleFrames Asst.Spines Insert 1&quot;</value>
+ <value>TitleFrames Asst.Spines Insert 1&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6856,8 +6291,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">TitleFrames Asst.Spines Insert 1 1/2&quot;</value>
+ <value>TitleFrames Asst.Spines Insert 1 1/2&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6868,8 +6302,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">TitleFrames Asst.Spines Insert 2&quot;</value>
+ <value>TitleFrames Asst.Spines Insert 2&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6880,8 +6313,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">TitleFrames Asst. Spines Insert 3&quot;</value>
+ <value>TitleFrames Asst. Spines Insert 3&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6892,8 +6324,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">TitleFrames Cover - 1&quot;</value>
+ <value>TitleFrames Cover - 1&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6904,8 +6335,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">TitleFrames Spine - 1&quot;</value>
+ <value>TitleFrames Spine - 1&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6916,8 +6346,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">TitleFrames Cover - 1 1/2&quot;</value>
+ <value>TitleFrames Cover - 1 1/2&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6928,8 +6357,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">TitleFrames Spine - 1 1/2&quot;</value>
+ <value>TitleFrames Spine - 1 1/2&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -6940,8 +6368,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">2160 Addressing</value>
+ <value>2160 Addressing</value>
</prop>
<prop oor:name="Measure">
@@ -6952,8 +6379,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">2162 Addressing</value>
+ <value>2162 Addressing</value>
</prop>
<prop oor:name="Measure">
@@ -6964,8 +6390,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">2163 Address/Shipping</value>
+ <value>2163 Address/Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -6976,8 +6401,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">2164 Shipping</value>
+ <value>2164 Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -6988,8 +6412,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">2180 File Folder-Assorted</value>
+ <value>2180 File Folder-Assorted</value>
</prop>
<prop oor:name="Measure">
@@ -7000,8 +6423,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">2181 File Folder-White</value>
+ <value>2181 File Folder-White</value>
</prop>
<prop oor:name="Measure">
@@ -7012,8 +6434,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">2186 3.5&quot; Diskette-White</value>
+ <value>2186 3.5&quot; Diskette-White</value>
</prop>
<prop oor:name="Measure">
@@ -7024,8 +6445,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6490 Remove &apos;Em 3.5&quot; Diskette-Face Only Labels</value>
+ <value>6490 Remove &apos;Em 3.5&quot; Diskette-Face Only Labels</value>
</prop>
<prop oor:name="Measure">
@@ -7036,8 +6456,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6466 Remove &apos;Em File Folder Labels</value>
+ <value>6466 Remove &apos;Em File Folder Labels</value>
</prop>
<prop oor:name="Measure">
@@ -7048,8 +6467,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6460 Remove &apos;Em Address Labels</value>
+ <value>6460 Remove &apos;Em Address Labels</value>
</prop>
<prop oor:name="Measure">
@@ -7060,8 +6478,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6464 Remove &apos;Em Shipping Labels</value>
+ <value>6464 Remove &apos;Em Shipping Labels</value>
</prop>
<prop oor:name="Measure">
@@ -7072,8 +6489,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6465 Removable Laser - Full Sheet</value>
+ <value>6465 Removable Laser - Full Sheet</value>
</prop>
<prop oor:name="Measure">
@@ -7084,8 +6500,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6467 Removable Laser - Small Multi-Purpose</value>
+ <value>6467 Removable Laser - Small Multi-Purpose</value>
</prop>
<prop oor:name="Measure">
@@ -7096,8 +6511,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6503 Remove&apos;em white laser 8 1/2&quot; x 11&quot;</value>
+ <value>6503 Remove&apos;em white laser 8 1/2&quot; x 11&quot;</value>
</prop>
<prop oor:name="Measure">
@@ -7108,8 +6522,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5824 CD-Recordable Labels</value>
+ <value>5824 CD-Recordable Labels</value>
</prop>
<prop oor:name="Measure">
@@ -7120,8 +6533,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5836 MtgCreator Portfolio Label</value>
+ <value>5836 MtgCreator Portfolio Label</value>
</prop>
<prop oor:name="Measure">
@@ -7132,8 +6544,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5836 MtgCreator Divider 5 Tab</value>
+ <value>5836 MtgCreator Divider 5 Tab</value>
</prop>
<prop oor:name="Measure">
@@ -7144,8 +6555,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3111 Square Stickers</value>
+ <value>3111 Square Stickers</value>
</prop>
<prop oor:name="Measure">
@@ -7156,8 +6566,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3112 Small Round Stickers</value>
+ <value>3112 Small Round Stickers</value>
</prop>
<prop oor:name="Measure">
@@ -7168,8 +6577,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3114 Full Page Stickers</value>
+ <value>3114 Full Page Stickers</value>
</prop>
<prop oor:name="Measure">
@@ -7180,8 +6588,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3248 Glossy Photo Quality Postcard</value>
+ <value>3248 Glossy Photo Quality Postcard</value>
</prop>
<prop oor:name="Measure">
@@ -7192,8 +6599,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3251 Feather Edge Greeting Card</value>
+ <value>3251 Feather Edge Greeting Card</value>
</prop>
<prop oor:name="Measure">
@@ -7204,8 +6610,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3252 Vellum Overlay Greeting Card</value>
+ <value>3252 Vellum Overlay Greeting Card</value>
</prop>
<prop oor:name="Measure">
@@ -7216,8 +6621,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3254 Glossy Photo Quality Print-to-the-Edge Greeting Card</value>
+ <value>3254 Glossy Photo Quality Print-to-the-Edge Greeting Card</value>
</prop>
<prop oor:name="Measure">
@@ -7228,8 +6632,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3256 White Embossed Note Cards</value>
+ <value>3256 White Embossed Note Cards</value>
</prop>
<prop oor:name="Measure">
@@ -7240,8 +6643,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3259 Ivory Embossed Note Card</value>
+ <value>3259 Ivory Embossed Note Card</value>
</prop>
<prop oor:name="Measure">
@@ -7252,8 +6654,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3260 Ivory Embossed Half-Fold Card</value>
+ <value>3260 Ivory Embossed Half-Fold Card</value>
</prop>
<prop oor:name="Measure">
@@ -7264,8 +6665,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3261 White Large Labels</value>
+ <value>3261 White Large Labels</value>
</prop>
<prop oor:name="Measure">
@@ -7276,8 +6676,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3261 White Small Labels</value>
+ <value>3261 White Small Labels</value>
</prop>
<prop oor:name="Measure">
@@ -7288,8 +6687,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3261 White Return Address Labels</value>
+ <value>3261 White Return Address Labels</value>
</prop>
<prop oor:name="Measure">
@@ -7300,8 +6698,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3263 White Postcard</value>
+ <value>3263 White Postcard</value>
</prop>
<prop oor:name="Measure">
@@ -7312,8 +6709,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3265 White Half-Fold Card</value>
+ <value>3265 White Half-Fold Card</value>
</prop>
<prop oor:name="Measure">
@@ -7324,8 +6720,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3266 White Quarter-Fold Card</value>
+ <value>3266 White Quarter-Fold Card</value>
</prop>
<prop oor:name="Measure">
@@ -7336,8 +6731,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3268 White Note Card</value>
+ <value>3268 White Note Card</value>
</prop>
<prop oor:name="Measure">
@@ -7348,8 +6742,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3274 White Big Round Stickers</value>
+ <value>3274 White Big Round Stickers</value>
</prop>
<prop oor:name="Measure">
@@ -7360,8 +6753,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3274 White Small Round Stickers</value>
+ <value>3274 White Small Round Stickers</value>
</prop>
<prop oor:name="Measure">
@@ -7372,8 +6764,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3274 White Square Stickers</value>
+ <value>3274 White Square Stickers</value>
</prop>
<prop oor:name="Measure">
@@ -7384,8 +6775,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3269 Glossy Photo Quality Half-Fold Cards</value>
+ <value>3269 Glossy Photo Quality Half-Fold Cards</value>
</prop>
<prop oor:name="Measure">
@@ -7396,8 +6786,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8313 Glossy Photo Quality 4&quot; x 6&quot; Card</value>
+ <value>8313 Glossy Photo Quality 4&quot; x 6&quot; Card</value>
</prop>
<prop oor:name="Measure">
@@ -7408,8 +6797,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8314 Glossy Photo Quality 8-1/2&quot; x 11&quot; Card</value>
+ <value>8314 Glossy Photo Quality 8-1/2&quot; x 11&quot; Card</value>
</prop>
<prop oor:name="Measure">
@@ -7420,8 +6808,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8373 Glossy Photo Quality Business Card</value>
+ <value>8373 Glossy Photo Quality Business Card</value>
</prop>
<prop oor:name="Measure">
@@ -7432,8 +6819,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8389 Glossy Photo Quality Postcard</value>
+ <value>8389 Glossy Photo Quality Postcard</value>
</prop>
<prop oor:name="Measure">
@@ -7444,8 +6830,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8763 Glossy Photo Quality Labels</value>
+ <value>8763 Glossy Photo Quality Labels</value>
</prop>
<prop oor:name="Measure">
@@ -7456,8 +6841,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8769 Glossy Photo Quality Labels</value>
+ <value>8769 Glossy Photo Quality Labels</value>
</prop>
<prop oor:name="Measure">
@@ -7468,8 +6852,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3273 White Print-to-the-Edge Greeting Cards</value>
+ <value>3273 White Print-to-the-Edge Greeting Cards</value>
</prop>
<prop oor:name="Measure">
@@ -7480,8 +6863,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3277 Textured Canvas for Ink Jet Printers</value>
+ <value>3277 Textured Canvas for Ink Jet Printers</value>
</prop>
<prop oor:name="Measure">
@@ -7492,8 +6874,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8317 Embossed Ink Jet Note Card - Ivory</value>
+ <value>8317 Embossed Ink Jet Note Card - Ivory</value>
</prop>
<prop oor:name="Measure">
@@ -7504,8 +6885,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8384 Photo Quality Brochures</value>
+ <value>8384 Photo Quality Brochures</value>
</prop>
<prop oor:name="Measure">
@@ -7516,8 +6896,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">53220 Glossy 4x6 Photo Paper</value>
+ <value>53220 Glossy 4x6 Photo Paper</value>
</prop>
<prop oor:name="Measure">
@@ -7528,8 +6907,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">53221 Glossy 5x7 Photo Paper</value>
+ <value>53221 Glossy 5x7 Photo Paper</value>
</prop>
<prop oor:name="Measure">
@@ -7540,8 +6918,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5881 Color Laser Business Cards</value>
+ <value>5881 Color Laser Business Cards</value>
</prop>
<prop oor:name="Measure">
@@ -7552,8 +6929,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5884 Glossy Color Laser Brochures</value>
+ <value>5884 Glossy Color Laser Brochures</value>
</prop>
<prop oor:name="Measure">
@@ -7564,8 +6940,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5889 Color Laser Postcards</value>
+ <value>5889 Color Laser Postcards</value>
</prop>
<prop oor:name="Measure">
@@ -7576,8 +6951,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">8877 Ink Jet Business Card - Gray</value>
+ <value>8877 Ink Jet Business Card - Gray</value>
</prop>
<prop oor:name="Measure">
@@ -7588,8 +6962,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6873 Color Laser Address Labels</value>
+ <value>6873 Color Laser Address Labels</value>
</prop>
<prop oor:name="Measure">
@@ -7600,8 +6973,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6879 Color Laser Address Labels</value>
+ <value>6879 Color Laser Address Labels</value>
</prop>
<prop oor:name="Measure">
@@ -7612,8 +6984,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4207 Price Marking</value>
+ <value>4207 Price Marking</value>
</prop>
<prop oor:name="Measure">
@@ -7624,8 +6995,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4144 Address</value>
+ <value>4144 Address</value>
</prop>
<prop oor:name="Measure">
@@ -7636,8 +7006,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4021 Address</value>
+ <value>4021 Address</value>
</prop>
<prop oor:name="Measure">
@@ -7648,8 +7017,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4145 Address</value>
+ <value>4145 Address</value>
</prop>
<prop oor:name="Measure">
@@ -7660,8 +7028,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4013 Address</value>
+ <value>4013 Address</value>
</prop>
<prop oor:name="Measure">
@@ -7672,8 +7039,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">R-4013 Address</value>
+ <value>R-4013 Address</value>
</prop>
<prop oor:name="Measure">
@@ -7684,8 +7050,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4030 Address</value>
+ <value>4030 Address</value>
</prop>
<prop oor:name="Measure">
@@ -7696,8 +7061,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4031 Address</value>
+ <value>4031 Address</value>
</prop>
<prop oor:name="Measure">
@@ -7708,8 +7072,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4029 Address</value>
+ <value>4029 Address</value>
</prop>
<prop oor:name="Measure">
@@ -7720,8 +7083,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4060 Address</value>
+ <value>4060 Address</value>
</prop>
<prop oor:name="Measure">
@@ -7732,8 +7094,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4065 Address</value>
+ <value>4065 Address</value>
</prop>
<prop oor:name="Measure">
@@ -7744,8 +7105,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4143 Address</value>
+ <value>4143 Address</value>
</prop>
<prop oor:name="Measure">
@@ -7756,8 +7116,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4066 Address</value>
+ <value>4066 Address</value>
</prop>
<prop oor:name="Measure">
@@ -7768,8 +7127,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4146 Address</value>
+ <value>4146 Address</value>
</prop>
<prop oor:name="Measure">
@@ -7780,8 +7138,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4014 Address</value>
+ <value>4014 Address</value>
</prop>
<prop oor:name="Measure">
@@ -7792,8 +7149,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4032 Address</value>
+ <value>4032 Address</value>
</prop>
<prop oor:name="Measure">
@@ -7804,8 +7160,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4033 Address</value>
+ <value>4033 Address</value>
</prop>
<prop oor:name="Measure">
@@ -7816,8 +7171,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4022 Address</value>
+ <value>4022 Address</value>
</prop>
<prop oor:name="Measure">
@@ -7828,8 +7182,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4162 Address-Clear</value>
+ <value>4162 Address-Clear</value>
</prop>
<prop oor:name="Measure">
@@ -7840,8 +7193,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4601 Address-Clear</value>
+ <value>4601 Address-Clear</value>
</prop>
<prop oor:name="Measure">
@@ -7852,8 +7204,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4161 Shipping-Red Border</value>
+ <value>4161 Shipping-Red Border</value>
</prop>
<prop oor:name="Measure">
@@ -7864,8 +7215,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4088 Shipping</value>
+ <value>4088 Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -7876,8 +7226,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4076 Shipping</value>
+ <value>4076 Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -7888,8 +7237,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4110 Shipping</value>
+ <value>4110 Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -7900,8 +7248,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4027 File Folder / Address</value>
+ <value>4027 File Folder / Address</value>
</prop>
<prop oor:name="Measure">
@@ -7912,8 +7259,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4255 File Folder</value>
+ <value>4255 File Folder</value>
</prop>
<prop oor:name="Measure">
@@ -7924,8 +7270,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4266 File Folder-Assorted</value>
+ <value>4266 File Folder-Assorted</value>
</prop>
<prop oor:name="Measure">
@@ -7936,8 +7281,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4163 Piggyback</value>
+ <value>4163 Piggyback</value>
</prop>
<prop oor:name="Measure">
@@ -7948,8 +7292,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4160 Name Badge</value>
+ <value>4160 Name Badge</value>
</prop>
<prop oor:name="Measure">
@@ -7960,8 +7303,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4241 3-1/2&quot; Diskette</value>
+ <value>4241 3-1/2&quot; Diskette</value>
</prop>
<prop oor:name="Measure">
@@ -7972,8 +7314,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4166 Index Card</value>
+ <value>4166 Index Card</value>
</prop>
<prop oor:name="Measure">
@@ -7984,8 +7325,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4167 Post Card</value>
+ <value>4167 Post Card</value>
</prop>
<prop oor:name="Measure">
@@ -7996,8 +7336,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4037 Address</value>
+ <value>4037 Address</value>
</prop>
<prop oor:name="Measure">
@@ -8008,8 +7347,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4020 Address</value>
+ <value>4020 Address</value>
</prop>
<prop oor:name="Measure">
@@ -8020,8 +7358,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4109 Address</value>
+ <value>4109 Address</value>
</prop>
<prop oor:name="Measure">
@@ -8032,8 +7369,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4018 Address - Removable</value>
+ <value>4018 Address - Removable</value>
</prop>
<prop oor:name="Measure">
@@ -8044,8 +7380,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4062 Address</value>
+ <value>4062 Address</value>
</prop>
<prop oor:name="Measure">
@@ -8056,8 +7391,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4035 Address</value>
+ <value>4035 Address</value>
</prop>
<prop oor:name="Measure">
@@ -8068,8 +7402,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4052 Data Storage</value>
+ <value>4052 Data Storage</value>
</prop>
<prop oor:name="Measure">
@@ -8080,8 +7413,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4067 Address</value>
+ <value>4067 Address</value>
</prop>
<prop oor:name="Measure">
@@ -8092,8 +7424,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4019 Address - Removable</value>
+ <value>4019 Address - Removable</value>
</prop>
<prop oor:name="Measure">
@@ -8104,8 +7435,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4015 Address</value>
+ <value>4015 Address</value>
</prop>
<prop oor:name="Measure">
@@ -8116,8 +7446,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4090 Address</value>
+ <value>4090 Address</value>
</prop>
<prop oor:name="Measure">
@@ -8128,8 +7457,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4043 Shipping</value>
+ <value>4043 Shipping</value>
</prop>
<prop oor:name="Measure">
@@ -8143,8 +7471,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">2493 Inkjet-Photo-Papier, blanko</value>
+ <value>2493 Inkjet-Photo-Papier, blanko</value>
</prop>
<prop oor:name="Measure">
@@ -8155,8 +7482,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">2494 Inkjet-Photo-Papier, blanko</value>
+ <value>2494 Inkjet-Photo-Papier, blanko</value>
</prop>
<prop oor:name="Measure">
@@ -8167,8 +7493,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">2495 Inkjet-Photo-Papier, blanko</value>
+ <value>2495 Inkjet-Photo-Papier, blanko</value>
</prop>
<prop oor:name="Measure">
@@ -8179,8 +7504,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32010 Visitenkarten, blanko</value>
+ <value>32010 Visitenkarten, blanko</value>
</prop>
<prop oor:name="Measure">
@@ -8191,8 +7515,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32011 Visitenkarten, blanko, schnittgestanzt</value>
+ <value>32011 Visitenkarten, blanko, schnittgestanzt</value>
</prop>
<prop oor:name="Measure">
@@ -8203,8 +7526,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32012 Visitenkarten, blanko, schnittgestanzt</value>
+ <value>32012 Visitenkarten, blanko, schnittgestanzt</value>
</prop>
<prop oor:name="Measure">
@@ -8215,8 +7537,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32014 Inkjet-Visitenkarten, blanko</value>
+ <value>32014 Inkjet-Visitenkarten, blanko</value>
</prop>
<prop oor:name="Measure">
@@ -8227,8 +7548,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32017 Doppel-Visitenkarten, blanko</value>
+ <value>32017 Doppel-Visitenkarten, blanko</value>
</prop>
<prop oor:name="Measure">
@@ -8239,8 +7559,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32020 Visitenkarten, marmoriert</value>
+ <value>32020 Visitenkarten, marmoriert</value>
</prop>
<prop oor:name="Measure">
@@ -8251,8 +7570,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32021 Visitenkarten, marmoriert</value>
+ <value>32021 Visitenkarten, marmoriert</value>
</prop>
<prop oor:name="Measure">
@@ -8263,8 +7581,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32022 Visitenkarten, marmoriert</value>
+ <value>32022 Visitenkarten, marmoriert</value>
</prop>
<prop oor:name="Measure">
@@ -8275,8 +7592,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32023 Visitenkarten, marmoriert</value>
+ <value>32023 Visitenkarten, marmoriert</value>
</prop>
<prop oor:name="Measure">
@@ -8287,8 +7603,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32029 Visitenkarten, blanko, Glossy</value>
+ <value>32029 Visitenkarten, blanko, Glossy</value>
</prop>
<prop oor:name="Measure">
@@ -8299,8 +7614,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32030 Visitenkarten, Blue Wave</value>
+ <value>32030 Visitenkarten, Blue Wave</value>
</prop>
<prop oor:name="Measure">
@@ -8311,8 +7625,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32031 Visitenkarten, Paradise</value>
+ <value>32031 Visitenkarten, Paradise</value>
</prop>
<prop oor:name="Measure">
@@ -8323,8 +7636,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32032 Visitenkarten, Sahara</value>
+ <value>32032 Visitenkarten, Sahara</value>
</prop>
<prop oor:name="Measure">
@@ -8335,8 +7647,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32036 Visitenkarten, Cosmic</value>
+ <value>32036 Visitenkarten, Cosmic</value>
</prop>
<prop oor:name="Measure">
@@ -8347,8 +7658,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32040 Visitenkarten, blanko</value>
+ <value>32040 Visitenkarten, blanko</value>
</prop>
<prop oor:name="Measure">
@@ -8359,8 +7669,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32060 Inkjet Bütten-Papier, Cream</value>
+ <value>32060 Inkjet Bütten-Papier, Cream</value>
</prop>
<prop oor:name="Measure">
@@ -8371,8 +7680,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32061 Inkjet Bütten-Papier, Aqua</value>
+ <value>32061 Inkjet Bütten-Papier, Aqua</value>
</prop>
<prop oor:name="Measure">
@@ -8383,8 +7691,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32062 Inkjet Bütten-Papier, Jade</value>
+ <value>32062 Inkjet Bütten-Papier, Jade</value>
</prop>
<prop oor:name="Measure">
@@ -8395,8 +7702,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32063 Inkjet Bütten-Papier, Sand</value>
+ <value>32063 Inkjet Bütten-Papier, Sand</value>
</prop>
<prop oor:name="Measure">
@@ -8407,8 +7713,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32064 Inkjet-Papier, Leinenstruktur</value>
+ <value>32064 Inkjet-Papier, Leinenstruktur</value>
</prop>
<prop oor:name="Measure">
@@ -8419,8 +7724,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32065 Inkjet-Papier, Hammerschlag</value>
+ <value>32065 Inkjet-Papier, Hammerschlag</value>
</prop>
<prop oor:name="Measure">
@@ -8431,8 +7735,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32080 Marmoriertes Papier</value>
+ <value>32080 Marmoriertes Papier</value>
</prop>
<prop oor:name="Measure">
@@ -8443,8 +7746,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32081 Marmoriertes Papier</value>
+ <value>32081 Marmoriertes Papier</value>
</prop>
<prop oor:name="Measure">
@@ -8455,8 +7757,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32082 Marmoriertes Papier</value>
+ <value>32082 Marmoriertes Papier</value>
</prop>
<prop oor:name="Measure">
@@ -8467,8 +7768,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32083 Marmoriertes Papier</value>
+ <value>32083 Marmoriertes Papier</value>
</prop>
<prop oor:name="Measure">
@@ -8479,8 +7779,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32098 Urkunde marmoriert, Text rot</value>
+ <value>32098 Urkunde marmoriert, Text rot</value>
</prop>
<prop oor:name="Measure">
@@ -8491,8 +7790,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32099 Urkunde marmoriert, Text gold</value>
+ <value>32099 Urkunde marmoriert, Text gold</value>
</prop>
<prop oor:name="Measure">
@@ -8503,8 +7801,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32250 CD-Einleger, blanko</value>
+ <value>32250 CD-Einleger, blanko</value>
</prop>
<prop oor:name="Measure">
@@ -8515,8 +7812,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32251 Inkjet-CD-Einleger</value>
+ <value>32251 Inkjet-CD-Einleger</value>
</prop>
<prop oor:name="Measure">
@@ -8527,8 +7823,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32252 Postkarte, blanko</value>
+ <value>32252 Postkarte, blanko</value>
</prop>
<prop oor:name="Measure">
@@ -8539,8 +7834,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32253 Tischkarte, blanko</value>
+ <value>32253 Tischkarte, blanko</value>
</prop>
<prop oor:name="Measure">
@@ -8551,8 +7845,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32254 Karteikarte, blanko</value>
+ <value>32254 Karteikarte, blanko</value>
</prop>
<prop oor:name="Measure">
@@ -8563,8 +7856,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32255 Cassetten-Einleger, blanko</value>
+ <value>32255 Cassetten-Einleger, blanko</value>
</prop>
<prop oor:name="Measure">
@@ -8575,8 +7867,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32256 Video-Einleger, blanko</value>
+ <value>32256 Video-Einleger, blanko</value>
</prop>
<prop oor:name="Measure">
@@ -8587,8 +7878,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32257 Tischkarte lang, blanko</value>
+ <value>32257 Tischkarte lang, blanko</value>
</prop>
<prop oor:name="Measure">
@@ -8599,8 +7889,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32258 Regalschilder</value>
+ <value>32258 Regalschilder</value>
</prop>
<prop oor:name="Measure">
@@ -8611,8 +7900,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32286 Inkjet-Glückwunschkarten, blanko</value>
+ <value>32286 Inkjet-Glückwunschkarten, blanko</value>
</prop>
<prop oor:name="Measure">
@@ -8623,8 +7911,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32287 Inkjet-Glückwunschkarten, blanko</value>
+ <value>32287 Inkjet-Glückwunschkarten, blanko</value>
</prop>
<prop oor:name="Measure">
@@ -8635,8 +7922,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32288 Inkjet-Glückwunschkarten, blanko</value>
+ <value>32288 Inkjet-Glückwunschkarten, blanko</value>
</prop>
<prop oor:name="Measure">
@@ -8647,8 +7933,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">32289 Inkjet-Glückwunschkarten, blanko</value>
+ <value>32289 Inkjet-Glückwunschkarten, blanko</value>
</prop>
<prop oor:name="Measure">
@@ -8659,8 +7944,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9312 Glossy Visitenkarten, schnittgestanzt</value>
+ <value>C9312 Glossy Visitenkarten, schnittgestanzt</value>
</prop>
<prop oor:name="Measure">
@@ -8671,8 +7955,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3415 Kreise</value>
+ <value>3415 Kreise</value>
</prop>
<prop oor:name="Measure">
@@ -8683,8 +7966,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3416 Kreise</value>
+ <value>3416 Kreise</value>
</prop>
<prop oor:name="Measure">
@@ -8695,8 +7977,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3418 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3418 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8707,8 +7988,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3420 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3420 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8719,8 +7999,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3421 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3421 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8731,8 +8010,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3422 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3422 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8743,8 +8021,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3423 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3423 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8755,8 +8032,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3424 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3424 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8767,8 +8043,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3425 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3425 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8779,8 +8054,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3426 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3426 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8791,8 +8065,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3427 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3427 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8803,8 +8076,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3448 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3448 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8815,8 +8087,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3449 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3449 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8827,8 +8098,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3450 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3450 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8839,8 +8109,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3451 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3451 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8851,8 +8120,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3452 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3452 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8863,8 +8131,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3453 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3453 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8875,8 +8142,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3454 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3454 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8887,8 +8153,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3455 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3455 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8899,8 +8164,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3456 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3456 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8911,8 +8175,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3457 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3457 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8923,8 +8186,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3458 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3458 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8935,8 +8197,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3459 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3459 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8947,8 +8208,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3470 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3470 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8959,8 +8219,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3471 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3471 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8971,8 +8230,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3472 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3472 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8983,8 +8241,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3473 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3473 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -8995,8 +8252,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3474 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3474 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9007,8 +8263,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3475 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3475 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9019,8 +8274,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3477 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3477 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9031,8 +8285,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3478 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3478 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9043,8 +8296,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3479 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3479 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9055,8 +8307,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3481 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3481 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9067,8 +8318,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3483 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3483 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9079,8 +8329,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3484 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3484 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9091,8 +8340,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3489 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3489 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9103,8 +8351,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3490 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3490 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9115,8 +8362,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3651 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3651 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9127,8 +8373,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3652 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3652 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9139,8 +8384,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3653 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3653 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9151,8 +8395,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3654 CD-Etiketten</value>
+ <value>3654 CD-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9163,8 +8406,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3655 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3655 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9175,8 +8417,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3657 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3657 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9187,8 +8428,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3658 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3658 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9199,8 +8439,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3659 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3659 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9211,8 +8450,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3660 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3660 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9223,8 +8461,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3661 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3661 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9235,8 +8472,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3662 Ordnerrücken-Etiketten, schmal</value>
+ <value>3662 Ordnerrücken-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -9247,8 +8483,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3663 Ordnerrücken-Etiketten, breit</value>
+ <value>3663 Ordnerrücken-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -9259,8 +8494,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3664 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3664 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9271,8 +8505,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3665 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3665 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9283,8 +8516,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3666 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3666 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9295,8 +8527,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3667 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3667 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9307,8 +8538,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3668 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3668 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9319,8 +8549,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3669 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>3669 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9331,8 +8560,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3674 Computer-Etiketten</value>
+ <value>3674 Computer-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9343,8 +8571,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3675 Computer-Etiketten</value>
+ <value>3675 Computer-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9355,8 +8582,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3676 Computer-Etiketten</value>
+ <value>3676 Computer-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9367,8 +8593,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3677 Computer-Etiketten, für 3,5&quot; Disk.</value>
+ <value>3677 Computer-Etiketten, für 3,5&quot; Disk.</value>
</prop>
<prop oor:name="Measure">
@@ -9379,8 +8604,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3684 Computer-Etiketten, für 3,5&quot; Disk.</value>
+ <value>3684 Computer-Etiketten, für 3,5&quot; Disk.</value>
</prop>
<prop oor:name="Measure">
@@ -9391,8 +8615,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3685 Computer-Etiketten, für 3,5&quot; Disk.</value>
+ <value>3685 Computer-Etiketten, für 3,5&quot; Disk.</value>
</prop>
<prop oor:name="Measure">
@@ -9403,8 +8626,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3686 Computer-Etiketten, für 3,5&quot; Disk.</value>
+ <value>3686 Computer-Etiketten, für 3,5&quot; Disk.</value>
</prop>
<prop oor:name="Measure">
@@ -9415,8 +8637,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3687 Computer-Etiketten, für 3,5&quot; Disk.</value>
+ <value>3687 Computer-Etiketten, für 3,5&quot; Disk.</value>
</prop>
<prop oor:name="Measure">
@@ -9427,8 +8648,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3688 Ordnerrücken-Etiketten, breit</value>
+ <value>3688 Ordnerrücken-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -9439,8 +8659,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3689 Ordnerrücken-Etiketten, schmal</value>
+ <value>3689 Ordnerrücken-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -9451,8 +8670,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3691 Ordnerrücken-Etiketten, breit</value>
+ <value>3691 Ordnerrücken-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -9463,8 +8681,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3692 Ordnerrücken-Etiketten, breit</value>
+ <value>3692 Ordnerrücken-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -9475,8 +8692,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3693 Ordnerrücken-Etiketten, breit</value>
+ <value>3693 Ordnerrücken-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -9487,8 +8703,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3694 Ordnerrücken-Etiketten, breit</value>
+ <value>3694 Ordnerrücken-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -9499,8 +8714,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3696 Ordnerrücken-Etiketten, schmal</value>
+ <value>3696 Ordnerrücken-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -9511,8 +8725,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3697 Ordnerrücken-Etiketten, schmal</value>
+ <value>3697 Ordnerrücken-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -9523,8 +8736,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3698 Ordnerrücken-Etiketten, schmal</value>
+ <value>3698 Ordnerrücken-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -9535,8 +8747,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3699 Ordnerrücken-Etiketten, schmal</value>
+ <value>3699 Ordnerrücken-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -9547,8 +8758,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4720 Transparente Etiketten</value>
+ <value>4720 Transparente Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9559,8 +8769,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4721 Transparente Etiketten</value>
+ <value>4721 Transparente Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9571,8 +8780,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4722 Transparente Etiketten</value>
+ <value>4722 Transparente Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9583,8 +8791,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4723 Transparente Etiketten</value>
+ <value>4723 Transparente Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -9595,8 +8802,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4730 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
+ <value>4730 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -9607,8 +8813,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4731 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
+ <value>4731 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -9619,8 +8824,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4732 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
+ <value>4732 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -9631,8 +8835,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4733 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
+ <value>4733 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -9643,8 +8846,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4734 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
+ <value>4734 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -9655,8 +8857,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4735 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
+ <value>4735 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -9667,8 +8868,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4736 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
+ <value>4736 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -9679,8 +8879,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4737 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
+ <value>4737 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -9691,8 +8890,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4738 Disketten-Etiketten, Stick+Lift</value>
+ <value>4738 Disketten-Etiketten, Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -9703,8 +8901,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4739 Disketten-Etiketten, Stick+Lift</value>
+ <value>4739 Disketten-Etiketten, Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -9715,8 +8912,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4740 Disketten-Etiketten, Stick+Lift</value>
+ <value>4740 Disketten-Etiketten, Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -9727,8 +8923,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4741 Disketten-Etiketten, Stick+Lift</value>
+ <value>4741 Disketten-Etiketten, Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -9739,8 +8934,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4742 Video-Etiketten, Stick+Lift</value>
+ <value>4742 Video-Etiketten, Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -9751,8 +8945,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4743 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
+ <value>4743 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -9763,8 +8956,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4744 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
+ <value>4744 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -9775,8 +8967,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4745 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
+ <value>4745 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -9787,8 +8978,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4746 Video-Etiketten, Stick+Lift</value>
+ <value>4746 Video-Etiketten, Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -9799,8 +8989,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4747 Etiketten für ZIP-Disketten</value>
+ <value>4747 Etiketten für ZIP-Disketten</value>
</prop>
<prop oor:name="Measure">
@@ -9811,8 +9000,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4748 Ordnerrücken-Etiketten, schmal</value>
+ <value>4748 Ordnerrücken-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -9823,8 +9011,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4749 Ordnerrücken-Etiketten, schmal</value>
+ <value>4749 Ordnerrücken-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -9835,8 +9022,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4750 Ordnerrücken-Etiketten, schmal</value>
+ <value>4750 Ordnerrücken-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -9847,8 +9033,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4751 Ordnerrücken-Etiketten, schmal</value>
+ <value>4751 Ordnerrücken-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -9859,8 +9044,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4752 Ordnerrücken-Etiketten, breit</value>
+ <value>4752 Ordnerrücken-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -9871,8 +9055,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4753 Ordnerrücken-Etiketten, breit</value>
+ <value>4753 Ordnerrücken-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -9883,8 +9066,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4754 Ordnerrücken-Etiketten, breit</value>
+ <value>4754 Ordnerrücken-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -9895,8 +9077,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4755 Ordnerrücken-Etiketten, breit</value>
+ <value>4755 Ordnerrücken-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -9907,8 +9088,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4756 Hängeordner-Etiketten, schmal</value>
+ <value>4756 Hängeordner-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -9919,8 +9099,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4757 Hängeordner-Etiketten, breit</value>
+ <value>4757 Hängeordner-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -9931,8 +9110,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4758 Ordnerrücken-Etiketten, schmal</value>
+ <value>4758 Ordnerrücken-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -9943,8 +9121,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4759 Ordnerrücken-Etiketten, breit</value>
+ <value>4759 Ordnerrücken-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -9955,8 +9132,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4760 Ordnerrücken-Etiketten, schmal</value>
+ <value>4760 Ordnerrücken-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -9967,8 +9143,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4761 Ordnerrücken-Etiketten, breit</value>
+ <value>4761 Ordnerrücken-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -9979,8 +9154,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4762 Ordnerrücken-Etiketten, schmal</value>
+ <value>4762 Ordnerrücken-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -9991,8 +9165,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4763 Ordnerrücken-Etiketten, schmal</value>
+ <value>4763 Ordnerrücken-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -10003,8 +9176,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4764 Ordnerrücken-Etiketten, schmal</value>
+ <value>4764 Ordnerrücken-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -10015,8 +9187,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4765 Ordnerrücken-Etiketten, schmal</value>
+ <value>4765 Ordnerrücken-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -10027,8 +9198,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4766 Ordnerrücken-Etiketten, breit</value>
+ <value>4766 Ordnerrücken-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -10039,8 +9209,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4767 Ordnerrücken-Etiketten, breit</value>
+ <value>4767 Ordnerrücken-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -10051,8 +9220,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4768 Ordnerrücken-Etiketten, breit</value>
+ <value>4768 Ordnerrücken-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -10063,8 +9231,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4769 Ordnerrücken-Etiketten, breit</value>
+ <value>4769 Ordnerrücken-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -10075,8 +9242,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4770 Transparente Etiketten</value>
+ <value>4770 Transparente Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10087,8 +9253,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4771 Transparente Etiketten</value>
+ <value>4771 Transparente Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10099,8 +9264,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4772 Transparente Etiketten</value>
+ <value>4772 Transparente Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10111,8 +9275,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4773 Wetterfeste Etiketten</value>
+ <value>4773 Wetterfeste Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10123,8 +9286,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4774 Wetterfeste Etiketten</value>
+ <value>4774 Wetterfeste Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10135,8 +9297,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4775 Wetterfeste Etiketten</value>
+ <value>4775 Wetterfeste Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10147,8 +9308,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4776 Wetterfeste Etiketten</value>
+ <value>4776 Wetterfeste Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10159,8 +9319,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4777 Transparente Etiketten</value>
+ <value>4777 Transparente Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10171,8 +9330,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4780 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>4780 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10183,8 +9341,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4781 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>4781 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10195,8 +9352,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4782 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>4782 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10207,8 +9363,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4784 Namens-Etiketten</value>
+ <value>4784 Namens-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10219,8 +9374,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4790 Inkjet-Etiketten, rund</value>
+ <value>4790 Inkjet-Etiketten, rund</value>
</prop>
<prop oor:name="Measure">
@@ -10231,8 +9385,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4791 Inkjet-Etiketten</value>
+ <value>4791 Inkjet-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10243,8 +9396,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4792 Inkjet-Etiketten</value>
+ <value>4792 Inkjet-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10255,8 +9407,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4793 Inkjet-Etiketten</value>
+ <value>4793 Inkjet-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10267,8 +9418,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4794 Inkjet-Etiketten</value>
+ <value>4794 Inkjet-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10279,8 +9429,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4795 Inkjet-Etiketten</value>
+ <value>4795 Inkjet-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10291,8 +9440,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4798 Disketten-Etiketten Photo-Qualität</value>
+ <value>4798 Disketten-Etiketten Photo-Qualität</value>
</prop>
<prop oor:name="Measure">
@@ -10303,8 +9451,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">4799 Inkjet-Etiketten, oval</value>
+ <value>4799 Inkjet-Etiketten, oval</value>
</prop>
<prop oor:name="Measure">
@@ -10315,8 +9462,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6002 Neon-Etiketten</value>
+ <value>6002 Neon-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10327,8 +9473,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6003 Neon-Etiketten</value>
+ <value>6003 Neon-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10339,8 +9484,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6004 Neon-Etiketten</value>
+ <value>6004 Neon-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10351,8 +9495,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6005 Neon-Etiketten</value>
+ <value>6005 Neon-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10363,8 +9506,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6006 Neon-Etiketten</value>
+ <value>6006 Neon-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10375,8 +9517,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6008 Typenschild-Etiketten</value>
+ <value>6008 Typenschild-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10387,8 +9528,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6009 Typenschild-Etiketten</value>
+ <value>6009 Typenschild-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10399,8 +9539,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6011 Typenschild-Etiketten</value>
+ <value>6011 Typenschild-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10411,8 +9550,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6012 Typenschild-Etiketten</value>
+ <value>6012 Typenschild-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10423,8 +9561,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6013 Typenschild-Etiketten</value>
+ <value>6013 Typenschild-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10435,8 +9572,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6014 Etiketten für CD-Hüllen</value>
+ <value>6014 Etiketten für CD-Hüllen</value>
</prop>
<prop oor:name="Measure">
@@ -10447,8 +9583,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6015 CD-Etiketten incl. Zentrierhilfe</value>
+ <value>6015 CD-Etiketten incl. Zentrierhilfe</value>
</prop>
<prop oor:name="Measure">
@@ -10459,8 +9594,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6019 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
+ <value>6019 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -10471,8 +9605,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6020 Dia-Etiketten, Stick+Lift</value>
+ <value>6020 Dia-Etiketten, Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -10483,8 +9616,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6021 Sichtreiter-Etiketten, Stick+Lift</value>
+ <value>6021 Sichtreiter-Etiketten, Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -10495,8 +9627,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6022 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
+ <value>6022 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -10507,8 +9638,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6023 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
+ <value>6023 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -10519,8 +9649,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6024 Inkjet+Laser+Kopier-Etiketten Stick+Lift, </value>
+ <value>6024 Inkjet+Laser+Kopier-Etiketten Stick+Lift, </value>
</prop>
<prop oor:name="Measure">
@@ -10531,8 +9660,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6025 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
+ <value>6025 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -10543,8 +9671,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6026 Disketten-Etiketten, Stick+Lift</value>
+ <value>6026 Disketten-Etiketten, Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -10555,8 +9682,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6029 Disketten-Etiketten, Stick+Lift</value>
+ <value>6029 Disketten-Etiketten, Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -10567,8 +9693,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6030 Cassetten-Etiketten, Stick+Lift</value>
+ <value>6030 Cassetten-Etiketten, Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -10579,8 +9704,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6031 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
+ <value>6031 Inkjet+Laser+Kopier-Etiketten Stick+Lift</value>
</prop>
<prop oor:name="Measure">
@@ -10591,8 +9715,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6036 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>6036 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10603,8 +9726,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6037 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>6037 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10615,8 +9737,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6038 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>6038 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10627,8 +9748,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6039 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>6039 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10639,8 +9759,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6040 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>6040 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10651,8 +9770,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6041 Inkjet+Laser+Kopier-Etiketten</value>
+ <value>6041 Inkjet+Laser+Kopier-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10663,8 +9781,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6043 CD-Etiketten</value>
+ <value>6043 CD-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10675,8 +9792,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6044 CD-Etiketten</value>
+ <value>6044 CD-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10687,8 +9803,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6045 CD-Etiketten</value>
+ <value>6045 CD-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10699,8 +9814,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6046 CD-Etiketten</value>
+ <value>6046 CD-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10711,8 +9825,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6047 CD-Etiketten</value>
+ <value>6047 CD-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10723,8 +9836,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6058 Ordnerrücken-Etiketten, schmal</value>
+ <value>6058 Ordnerrücken-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -10735,8 +9847,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6059 Ordnerrücken-Etiketten, breit</value>
+ <value>6059 Ordnerrücken-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -10747,8 +9858,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6060 Ordnerrücken-Etiketten, schmal</value>
+ <value>6060 Ordnerrücken-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -10759,8 +9869,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6061 Ordnerrücken-Etiketten, breit</value>
+ <value>6061 Ordnerrücken-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -10771,8 +9880,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6074 Inkjet-Glossy-CD-Etiketten</value>
+ <value>6074 Inkjet-Glossy-CD-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10783,8 +9891,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6077 Inkjet-Glossy-Etiketten</value>
+ <value>6077 Inkjet-Glossy-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10795,8 +9902,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6078 Inkjet-Glossy-Etiketten</value>
+ <value>6078 Inkjet-Glossy-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10807,8 +9913,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6079 Inkjet-Glossy-Etiketten, oval</value>
+ <value>6079 Inkjet-Glossy-Etiketten, oval</value>
</prop>
<prop oor:name="Measure">
@@ -10819,8 +9924,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6080 Inkjet-Glossy-Etiketten</value>
+ <value>6080 Inkjet-Glossy-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10831,8 +9935,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6081 Inkjet-Glossy-Etiketten</value>
+ <value>6081 Inkjet-Glossy-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10843,8 +9946,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6082 Inkjet-Glossy-CD-Etiketten</value>
+ <value>6082 Inkjet-Glossy-CD-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10855,8 +9957,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6083 Inkjet-Glossy-Etiketten</value>
+ <value>6083 Inkjet-Glossy-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10867,8 +9968,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6090 Korrektur- und Abdeck-Etiketten</value>
+ <value>6090 Korrektur- und Abdeck-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10879,8 +9979,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6091 Korrektur- und Abdeck-Etiketten</value>
+ <value>6091 Korrektur- und Abdeck-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10891,8 +9990,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6092 Korrektur- und Abdeck-Etiketten</value>
+ <value>6092 Korrektur- und Abdeck-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10903,8 +10001,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6093 Korrektur- und Abdeck-Etiketten</value>
+ <value>6093 Korrektur- und Abdeck-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10915,8 +10012,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6094 Korrektur- und Abdeck-Etiketten</value>
+ <value>6094 Korrektur- und Abdeck-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10927,8 +10023,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6102 Farbige Folien-Etiketten</value>
+ <value>6102 Farbige Folien-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10939,8 +10034,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6103 Farbige Folien-Etiketten</value>
+ <value>6103 Farbige Folien-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10951,8 +10045,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6104 Farbige Folien-Etiketten</value>
+ <value>6104 Farbige Folien-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10963,8 +10056,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6105 Farbige Folien-Etiketten</value>
+ <value>6105 Farbige Folien-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10975,8 +10067,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6106 Farbige Folien-Etiketten</value>
+ <value>6106 Farbige Folien-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10987,8 +10078,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6107 Farbige Folien-Etiketten</value>
+ <value>6107 Farbige Folien-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -10999,8 +10089,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6108 Farbige Folien-Etiketten</value>
+ <value>6108 Farbige Folien-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11011,8 +10100,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6109 Farbige Folien-Etiketten</value>
+ <value>6109 Farbige Folien-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11023,8 +10111,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6110 Farbige Folien-Etiketten</value>
+ <value>6110 Farbige Folien-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11035,8 +10122,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6111 Farbige Folien-Etiketten</value>
+ <value>6111 Farbige Folien-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11047,8 +10133,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6112 Sicherheits-Etiketten</value>
+ <value>6112 Sicherheits-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11059,8 +10144,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6113 Sicherheits-Etiketten</value>
+ <value>6113 Sicherheits-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11071,8 +10155,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6114 Sicherheits-Etiketten</value>
+ <value>6114 Sicherheits-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11083,8 +10166,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6115 CD-Etiketten</value>
+ <value>6115 CD-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11095,8 +10177,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6116 MiniDisc-Etiketten</value>
+ <value>6116 MiniDisc-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11107,8 +10188,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6117 CD-Etiketten</value>
+ <value>6117 CD-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11119,8 +10199,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">6118 CD-Etiketten</value>
+ <value>6118 CD-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11131,8 +10210,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7767 Farblaser-Glossy-Etiketten</value>
+ <value>L7767 Farblaser-Glossy-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11143,8 +10221,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7768 Farblaser-Glossy-Etiketten</value>
+ <value>L7768 Farblaser-Glossy-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11155,8 +10232,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7769 Farblaser-Glossy-Etiketten</value>
+ <value>L7769 Farblaser-Glossy-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11167,8 +10243,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7765 Farblaser-Glossy-Etiketten</value>
+ <value>L7765 Farblaser-Glossy-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11179,8 +10254,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9660 SuperSize Inkjet-Glossy-CD-Etiketten</value>
+ <value>C9660 SuperSize Inkjet-Glossy-CD-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11191,8 +10265,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7760 SuperSize Farblaser-Glossy-CD-Etiketten</value>
+ <value>L7760 SuperSize Farblaser-Glossy-CD-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11203,8 +10276,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8776 Inkjet-Stardust-CD-Etiketten*</value>
+ <value>J8776 Inkjet-Stardust-CD-Etiketten*</value>
</prop>
<prop oor:name="Measure">
@@ -11215,8 +10287,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8871 Inkjet-Magnet-Schilder**</value>
+ <value>J8871 Inkjet-Magnet-Schilder**</value>
</prop>
<prop oor:name="Measure">
@@ -11227,8 +10298,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8875 Inkjet-Magnet-Schilder**</value>
+ <value>J8875 Inkjet-Magnet-Schilder**</value>
</prop>
<prop oor:name="Measure">
@@ -11239,8 +10309,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8867 Inkjet-Magnet-Schilder**</value>
+ <value>J8867 Inkjet-Magnet-Schilder**</value>
</prop>
<prop oor:name="Measure">
@@ -11251,8 +10320,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2166 Etikett rechteckig</value>
+ <value>C2166 Etikett rechteckig</value>
</prop>
<prop oor:name="Measure">
@@ -11263,8 +10331,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2243 Etikett rund, klein</value>
+ <value>C2243 Etikett rund, klein</value>
</prop>
<prop oor:name="Measure">
@@ -11275,8 +10342,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2351 Glückwunschkarten A5</value>
+ <value>C2351 Glückwunschkarten A5</value>
</prop>
<prop oor:name="Measure">
@@ -11287,8 +10353,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2354 Visitenkarten bis zum Rand</value>
+ <value>C2354 Visitenkarten bis zum Rand</value>
</prop>
<prop oor:name="Measure">
@@ -11299,8 +10364,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2355 Glückwunschkarten Standard</value>
+ <value>C2355 Glückwunschkarten Standard</value>
</prop>
<prop oor:name="Measure">
@@ -11311,8 +10375,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2410 Clubkarten laminiert</value>
+ <value>C2410 Clubkarten laminiert</value>
</prop>
<prop oor:name="Measure">
@@ -11323,8 +10386,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2651 Etikett rechteckig, klein</value>
+ <value>C2651 Etikett rechteckig, klein</value>
</prop>
<prop oor:name="Measure">
@@ -11335,8 +10397,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9405 T-Shirt Transferfolie</value>
+ <value>C9405 T-Shirt Transferfolie</value>
</prop>
<prop oor:name="Measure">
@@ -11347,8 +10408,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2547 Fantastic Plastic</value>
+ <value>C2547 Fantastic Plastic</value>
</prop>
<prop oor:name="Measure">
@@ -11359,8 +10419,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2070 Transfer-Folie für Mousepad</value>
+ <value>C2070 Transfer-Folie für Mousepad</value>
</prop>
<prop oor:name="Measure">
@@ -11371,8 +10430,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2090 T-Shirt Transfer-Folie</value>
+ <value>C2090 T-Shirt Transfer-Folie</value>
</prop>
<prop oor:name="Measure">
@@ -11383,8 +10441,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2080 Transfer-Folie für Puzzles</value>
+ <value>C2080 Transfer-Folie für Puzzles</value>
</prop>
<prop oor:name="Measure">
@@ -11395,8 +10452,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8416 Einladungskarten mit Klebeverschluss</value>
+ <value>J8416 Einladungskarten mit Klebeverschluss</value>
</prop>
<prop oor:name="Measure">
@@ -11407,8 +10463,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2546 Fensterbilder</value>
+ <value>C2546 Fensterbilder</value>
</prop>
<prop oor:name="Measure">
@@ -11419,8 +10474,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9660 CD-Etiketten, glossy, Super-Size</value>
+ <value>C9660 CD-Etiketten, glossy, Super-Size</value>
</prop>
<prop oor:name="Measure">
@@ -11431,8 +10485,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8770 CD-Etiketten, Super-Ssize</value>
+ <value>J8770 CD-Etiketten, Super-Ssize</value>
</prop>
<prop oor:name="Measure">
@@ -11443,8 +10496,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2050 Video-Etiketten, seitlich</value>
+ <value>C2050 Video-Etiketten, seitlich</value>
</prop>
<prop oor:name="Measure">
@@ -11455,8 +10507,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2050 Video-Etiketten, oben</value>
+ <value>C2050 Video-Etiketten, oben</value>
</prop>
<prop oor:name="Measure">
@@ -11467,8 +10518,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8666 Disketten-Etiketten</value>
+ <value>J8666 Disketten-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11479,8 +10529,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J9124 Photo-Etiketten, 13 x 18</value>
+ <value>J9124 Photo-Etiketten, 13 x 18</value>
</prop>
<prop oor:name="Measure">
@@ -11491,8 +10540,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7424 Ordner-Etiketten, breit</value>
+ <value>L7424 Ordner-Etiketten, breit</value>
</prop>
<prop oor:name="Measure">
@@ -11503,8 +10551,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7425 Ordner-Etiketten, schmal</value>
+ <value>L7425 Ordner-Etiketten, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -11515,8 +10562,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8587 Inkjet-Folie</value>
+ <value>J8587 Inkjet-Folie</value>
</prop>
<prop oor:name="Measure">
@@ -11527,8 +10573,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7587 Laser-Folie</value>
+ <value>L7587 Laser-Folie</value>
</prop>
<prop oor:name="Measure">
@@ -11539,8 +10584,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9431 Photo-Papier, glossy</value>
+ <value>C9431 Photo-Papier, glossy</value>
</prop>
<prop oor:name="Measure">
@@ -11551,8 +10595,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9434 Photo-Karton, glossy</value>
+ <value>C9434 Photo-Karton, glossy</value>
</prop>
<prop oor:name="Measure">
@@ -11563,8 +10606,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9372 Photo-Papier, glossy, 9 x 13</value>
+ <value>C9372 Photo-Papier, glossy, 9 x 13</value>
</prop>
<prop oor:name="Measure">
@@ -11575,8 +10617,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2371 Inkjet-Papier</value>
+ <value>C2371 Inkjet-Papier</value>
</prop>
<prop oor:name="Measure">
@@ -11587,8 +10628,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2370 Inkjet-Papier</value>
+ <value>C2370 Inkjet-Papier</value>
</prop>
<prop oor:name="Measure">
@@ -11599,8 +10639,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2374 Marmoriertes Papier</value>
+ <value>C2374 Marmoriertes Papier</value>
</prop>
<prop oor:name="Measure">
@@ -11611,8 +10650,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2375 Marmoriertes Papier</value>
+ <value>C2375 Marmoriertes Papier</value>
</prop>
<prop oor:name="Measure">
@@ -11623,8 +10661,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2376 Marmoriertes Papier</value>
+ <value>C2376 Marmoriertes Papier</value>
</prop>
<prop oor:name="Measure">
@@ -11635,8 +10672,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2377 Marmoriertes Papier</value>
+ <value>C2377 Marmoriertes Papier</value>
</prop>
<prop oor:name="Measure">
@@ -11647,8 +10683,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9355 Postkarten, Vorderseite</value>
+ <value>C9355 Postkarten, Vorderseite</value>
</prop>
<prop oor:name="Measure">
@@ -11659,8 +10694,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9355 Postkarten, Rückseite</value>
+ <value>C9355 Postkarten, Rückseite</value>
</prop>
<prop oor:name="Measure">
@@ -11671,8 +10705,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">J8435 CD-Einleger</value>
+ <value>J8435 CD-Einleger</value>
</prop>
<prop oor:name="Measure">
@@ -11683,8 +10716,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9362 Visitenkarten, glossy</value>
+ <value>C9362 Visitenkarten, glossy</value>
</prop>
<prop oor:name="Measure">
@@ -11695,8 +10727,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2364 Marmorierte Visitenkarten</value>
+ <value>C2364 Marmorierte Visitenkarten</value>
</prop>
<prop oor:name="Measure">
@@ -11707,8 +10738,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2365 Marmorierte Visitenkarten</value>
+ <value>C2365 Marmorierte Visitenkarten</value>
</prop>
<prop oor:name="Measure">
@@ -11719,8 +10749,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2366 Marmorierte Visitenkarten</value>
+ <value>C2366 Marmorierte Visitenkarten</value>
</prop>
<prop oor:name="Measure">
@@ -11731,8 +10760,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C2367 Marmorierte Visitenkarten</value>
+ <value>C2367 Marmorierte Visitenkarten</value>
</prop>
<prop oor:name="Measure">
@@ -11743,8 +10771,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">C9352 Glückwunschkarten A6, glossy</value>
+ <value>C9352 Glückwunschkarten A6, glossy</value>
</prop>
<prop oor:name="Measure">
@@ -11755,8 +10782,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7159 Laser-Etiketten</value>
+ <value>L7159 Laser-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11767,8 +10793,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7160 Laser-Etiketten</value>
+ <value>L7160 Laser-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11779,8 +10804,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7161 Laser-Etiketten</value>
+ <value>L7161 Laser-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11791,8 +10815,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7162 Laser-Etiketten</value>
+ <value>L7162 Laser-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11803,8 +10826,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7163 Laser-Etiketten</value>
+ <value>L7163 Laser-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11815,8 +10837,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7164 Laser-Etiketten</value>
+ <value>L7164 Laser-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11827,8 +10848,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7165 Laser-Etiketten</value>
+ <value>L7165 Laser-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11839,8 +10859,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7166 Laser-Etiketten</value>
+ <value>L7166 Laser-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11851,8 +10870,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7167 Laser-Etiketten</value>
+ <value>L7167 Laser-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11863,8 +10881,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7168 Laser-Etiketten</value>
+ <value>L7168 Laser-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11875,8 +10892,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7169 Laser-Etiketten</value>
+ <value>L7169 Laser-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11887,8 +10903,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7173 Laser-Etiketten</value>
+ <value>L7173 Laser-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11899,8 +10914,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7651 Laser-Etiketten</value>
+ <value>L7651 Laser-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -11911,8 +10925,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7410-10 Etiketten Register - Etikettenbogen 10</value>
+ <value>L7410-10 Etiketten Register - Etikettenbogen 10</value>
</prop>
<prop oor:name="Measure">
@@ -11923,8 +10936,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7410-10 Etiketten Register - Inhaltsblatt 10-t</value>
+ <value>L7410-10 Etiketten Register - Inhaltsblatt 10-t</value>
</prop>
<prop oor:name="Measure">
@@ -11935,8 +10947,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7410-12 Etiketten Register - Etikettenbogen 12</value>
+ <value>L7410-12 Etiketten Register - Etikettenbogen 12</value>
</prop>
<prop oor:name="Measure">
@@ -11947,8 +10958,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7410-12 Etiketten Register - Inhaltsblatt 12-t</value>
+ <value>L7410-12 Etiketten Register - Inhaltsblatt 12-t</value>
</prop>
<prop oor:name="Measure">
@@ -11959,8 +10969,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7410-5 Etiketten Register - Etikettenbogen 5-t</value>
+ <value>L7410-5 Etiketten Register - Etikettenbogen 5-t</value>
</prop>
<prop oor:name="Measure">
@@ -11971,8 +10980,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7410-5 Etiketten Register - Inhaltsblatt 5-tei</value>
+ <value>L7410-5 Etiketten Register - Inhaltsblatt 5-tei</value>
</prop>
<prop oor:name="Measure">
@@ -11983,8 +10991,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7411-10 Zahlen Register - Inhaltsblatt 1-10</value>
+ <value>L7411-10 Zahlen Register - Inhaltsblatt 1-10</value>
</prop>
<prop oor:name="Measure">
@@ -11995,8 +11002,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7411-12 Zahlen Register - Inhaltsblatt 1-12</value>
+ <value>L7411-12 Zahlen Register - Inhaltsblatt 1-12</value>
</prop>
<prop oor:name="Measure">
@@ -12007,8 +11013,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7411-15 Zahlen Register - Inhaltsblatt 1-15</value>
+ <value>L7411-15 Zahlen Register - Inhaltsblatt 1-15</value>
</prop>
<prop oor:name="Measure">
@@ -12019,8 +11024,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7411-20 Zahlen Register - Inhaltsblatt 1-20</value>
+ <value>L7411-20 Zahlen Register - Inhaltsblatt 1-20</value>
</prop>
<prop oor:name="Measure">
@@ -12031,8 +11035,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7411-31 Zahlen Register - Inhaltsblatt 1-31</value>
+ <value>L7411-31 Zahlen Register - Inhaltsblatt 1-31</value>
</prop>
<prop oor:name="Measure">
@@ -12043,8 +11046,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7411-5 Zahlen Register - Inhaltsblatt 1-5</value>
+ <value>L7411-5 Zahlen Register - Inhaltsblatt 1-5</value>
</prop>
<prop oor:name="Measure">
@@ -12055,8 +11057,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7411-AZ A-Z Register - Inhaltsblatt</value>
+ <value>L7411-AZ A-Z Register - Inhaltsblatt</value>
</prop>
<prop oor:name="Measure">
@@ -12067,8 +11068,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7411-JD Monats Register - Inhaltsblatt Jan - D</value>
+ <value>L7411-JD Monats Register - Inhaltsblatt Jan - D</value>
</prop>
<prop oor:name="Measure">
@@ -12079,8 +11079,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7412-10 Einsteckschilder für Register 10-teilig</value>
+ <value>L7412-10 Einsteckschilder für Register 10-teilig</value>
</prop>
<prop oor:name="Measure">
@@ -12091,8 +11090,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7412-12 Einsteckschilder für Register 12-teilig</value>
+ <value>L7412-12 Einsteckschilder für Register 12-teilig</value>
</prop>
<prop oor:name="Measure">
@@ -12103,8 +11101,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">L7412-5 Einsteckschilder für Register 5-teilig</value>
+ <value>L7412-5 Einsteckschilder für Register 5-teilig</value>
</prop>
<prop oor:name="Measure">
@@ -12115,8 +11112,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5129061 Trennstreifen </value>
+ <value>5129061 Trennstreifen </value>
</prop>
<prop oor:name="Measure">
@@ -12127,8 +11123,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3600 Computer-Etikett</value>
+ <value>3600 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12139,8 +11134,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3601 Computer-Etikett</value>
+ <value>3601 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12151,8 +11145,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3602 Computer-Etikett</value>
+ <value>3602 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12163,8 +11156,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3603 Computer-Etikett</value>
+ <value>3603 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12175,8 +11167,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3604 Computer-Etikett</value>
+ <value>3604 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12187,8 +11178,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3605 Computer-Etikett</value>
+ <value>3605 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12199,8 +11189,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3606 Computer-Etikett</value>
+ <value>3606 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12211,8 +11200,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3607 Computer-Etikett</value>
+ <value>3607 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12223,8 +11211,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3608 Computer-Etikett</value>
+ <value>3608 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12235,8 +11222,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3609 Computer-Etikett</value>
+ <value>3609 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12247,8 +11233,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3610 Computer-Etikett</value>
+ <value>3610 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12259,8 +11244,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3611 Computer-Etikett</value>
+ <value>3611 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12271,8 +11255,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3612 Computer-Etikett</value>
+ <value>3612 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12283,8 +11266,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3613 Computer-Etikett</value>
+ <value>3613 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12295,8 +11277,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3614 Computer-Etikett</value>
+ <value>3614 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12307,8 +11288,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3615 Computer-Etikett</value>
+ <value>3615 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12319,8 +11299,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3617 Computer-Etikett</value>
+ <value>3617 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12331,8 +11310,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3620 Computer-Etikett</value>
+ <value>3620 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12343,8 +11321,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3621 Computer-Etikett</value>
+ <value>3621 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12355,8 +11332,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3623 Computer-Etikett</value>
+ <value>3623 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12367,8 +11343,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3633 Computer-Etikett</value>
+ <value>3633 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12379,8 +11354,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3634 Computer-Etikett, schnittgestanzt</value>
+ <value>3634 Computer-Etikett, schnittgestanzt</value>
</prop>
<prop oor:name="Measure">
@@ -12391,8 +11365,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3635 Computer-Etikett</value>
+ <value>3635 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12403,8 +11376,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3643 Computer-Etikett</value>
+ <value>3643 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12415,8 +11387,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3645 Computer-Etikett</value>
+ <value>3645 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12427,8 +11398,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3646 Computer-Etikett</value>
+ <value>3646 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12439,8 +11409,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3647 Computer-Etikett</value>
+ <value>3647 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12451,8 +11420,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3648 Computer-Etikett, ablösbar</value>
+ <value>3648 Computer-Etikett, ablösbar</value>
</prop>
<prop oor:name="Measure">
@@ -12463,8 +11431,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3674 Computer-Etikett</value>
+ <value>3674 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12475,8 +11442,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3675 Computer-Etikett</value>
+ <value>3675 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12487,8 +11453,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">3676 Computer-Etikett</value>
+ <value>3676 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12499,8 +11464,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5100 Computer-Etikett</value>
+ <value>5100 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12511,8 +11475,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5101 Computer-Etikett</value>
+ <value>5101 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12523,8 +11486,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5103 Computer-Etikett</value>
+ <value>5103 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12535,8 +11497,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5104 Computer-Etikett</value>
+ <value>5104 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12547,8 +11508,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5105 Computer-Etikett</value>
+ <value>5105 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12559,8 +11519,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5106 Computer-Etikett</value>
+ <value>5106 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12571,8 +11530,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5107 Computer-Etikett</value>
+ <value>5107 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12583,8 +11541,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5108 Computer-Etikett</value>
+ <value>5108 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12595,8 +11552,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5109 Computer-Etikett</value>
+ <value>5109 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12607,8 +11563,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5110 Computer-Etikett</value>
+ <value>5110 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12619,8 +11574,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5111 Computer-Etikett</value>
+ <value>5111 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12631,8 +11585,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5112 Computer-Etikett</value>
+ <value>5112 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12643,8 +11596,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5121 Computer-Etikett</value>
+ <value>5121 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12655,8 +11607,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5122 Computer-Etikett</value>
+ <value>5122 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12667,8 +11618,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5123 Computer-Etikett</value>
+ <value>5123 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12679,8 +11629,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5124 Computer-Etikett</value>
+ <value>5124 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12691,8 +11640,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5130 Computer-Etikett</value>
+ <value>5130 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12703,8 +11651,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5131 Computer-Etikett</value>
+ <value>5131 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12715,8 +11662,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5132 Computer-Etikett</value>
+ <value>5132 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12727,8 +11673,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5133 Computer-Etikett</value>
+ <value>5133 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12739,8 +11684,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5137 Computer-Etikett</value>
+ <value>5137 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12751,8 +11695,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5140 Computer-Etikett</value>
+ <value>5140 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12763,8 +11706,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5141 Computer-Etikett</value>
+ <value>5141 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12775,8 +11717,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5142 Computer-Etikett</value>
+ <value>5142 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12787,8 +11728,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5143 Computer-Etikett</value>
+ <value>5143 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12799,8 +11739,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5145 Computer-Etikett</value>
+ <value>5145 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12811,8 +11750,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5146 Computer-Etikett</value>
+ <value>5146 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12823,8 +11761,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5147 Computer-Etikett</value>
+ <value>5147 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12835,8 +11772,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5160 Computer-Etikett</value>
+ <value>5160 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12847,8 +11783,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5161 Computer-Etikett</value>
+ <value>5161 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12859,8 +11794,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5162 Computer-Etikett</value>
+ <value>5162 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12871,8 +11805,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5163 Computer-Etikett</value>
+ <value>5163 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12883,8 +11816,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5164 Computer-Etikett</value>
+ <value>5164 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12895,8 +11827,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5170 Computer-Etikett</value>
+ <value>5170 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12907,8 +11838,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">5171 Computer-Etikett</value>
+ <value>5171 Computer-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -12922,8 +11852,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083200/6 Adressetikett</value>
+ <value>083200/6 Adressetikett</value>
</prop>
<prop oor:name="Measure">
@@ -12934,8 +11863,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083200/6 Adressetikett</value>
+ <value>083200/6 Adressetikett</value>
</prop>
<prop oor:name="Measure">
@@ -12946,8 +11874,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083203/0 Adressetikett</value>
+ <value>083203/0 Adressetikett</value>
</prop>
<prop oor:name="Measure">
@@ -12958,8 +11885,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083204/8 Adressetikett</value>
+ <value>083204/8 Adressetikett</value>
</prop>
<prop oor:name="Measure">
@@ -12970,8 +11896,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083205/5 Diskettenetikett</value>
+ <value>083205/5 Diskettenetikett</value>
</prop>
<prop oor:name="Measure">
@@ -12982,8 +11907,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083207/1 Adressetikett</value>
+ <value>083207/1 Adressetikett</value>
</prop>
<prop oor:name="Measure">
@@ -12994,8 +11918,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083215/4 Diskettenetikett</value>
+ <value>083215/4 Diskettenetikett</value>
</prop>
<prop oor:name="Measure">
@@ -13006,8 +11929,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083216/2 CD-ROM-Etikett</value>
+ <value>083216/2 CD-ROM-Etikett</value>
</prop>
<prop oor:name="Measure">
@@ -13018,8 +11940,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083217/0 Adressetikett</value>
+ <value>083217/0 Adressetikett</value>
</prop>
<prop oor:name="Measure">
@@ -13030,8 +11951,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083219/6 Adressetikett</value>
+ <value>083219/6 Adressetikett</value>
</prop>
<prop oor:name="Measure">
@@ -13042,8 +11962,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083220/4 Adressetikett Laser</value>
+ <value>083220/4 Adressetikett Laser</value>
</prop>
<prop oor:name="Measure">
@@ -13054,8 +11973,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083221/2 Adressetikett Laser</value>
+ <value>083221/2 Adressetikett Laser</value>
</prop>
<prop oor:name="Measure">
@@ -13066,8 +11984,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083222/0 Adressetikett Laser</value>
+ <value>083222/0 Adressetikett Laser</value>
</prop>
<prop oor:name="Measure">
@@ -13078,8 +11995,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083224/6 Diskettenetikett Laser</value>
+ <value>083224/6 Diskettenetikett Laser</value>
</prop>
<prop oor:name="Measure">
@@ -13090,8 +12006,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083230/3 Adressetikett Inkjet</value>
+ <value>083230/3 Adressetikett Inkjet</value>
</prop>
<prop oor:name="Measure">
@@ -13102,8 +12017,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083231/1 Adressetikett Inkjet</value>
+ <value>083231/1 Adressetikett Inkjet</value>
</prop>
<prop oor:name="Measure">
@@ -13114,8 +12028,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083234/5 Diskettenetikett Inkjet</value>
+ <value>083234/5 Diskettenetikett Inkjet</value>
</prop>
<prop oor:name="Measure">
@@ -13126,8 +12039,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083240/2 Adressetik. Laser+InkJet</value>
+ <value>083240/2 Adressetik. Laser+InkJet</value>
</prop>
<prop oor:name="Measure">
@@ -13138,8 +12050,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083244/4 Diskettenetik.Laser+InkJet</value>
+ <value>083244/4 Diskettenetik.Laser+InkJet</value>
</prop>
<prop oor:name="Measure">
@@ -13150,8 +12061,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083250/1 Adressetiketten</value>
+ <value>083250/1 Adressetiketten</value>
</prop>
<prop oor:name="Measure">
@@ -13162,8 +12072,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083251/9 Ordner-Etiketten, 8 cm</value>
+ <value>083251/9 Ordner-Etiketten, 8 cm</value>
</prop>
<prop oor:name="Measure">
@@ -13174,8 +12083,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083252/7 Ordner-Etiketten, 5 cm</value>
+ <value>083252/7 Ordner-Etiketten, 5 cm</value>
</prop>
<prop oor:name="Measure">
@@ -13186,8 +12094,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083253/5 Neonetiketten</value>
+ <value>083253/5 Neonetiketten</value>
</prop>
<prop oor:name="Measure">
@@ -13198,8 +12105,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083254/3 Transparente Etiketten</value>
+ <value>083254/3 Transparente Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -13210,8 +12116,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083255/0 Diskettenetiketten</value>
+ <value>083255/0 Diskettenetiketten</value>
</prop>
<prop oor:name="Measure">
@@ -13222,8 +12127,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">83256/8a Videoetiketten 0</value>
+ <value>83256/8a Videoetiketten 0</value>
</prop>
<prop oor:name="Measure">
@@ -13234,8 +12138,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">83256/8b Videoetiketten 0</value>
+ <value>83256/8b Videoetiketten 0</value>
</prop>
<prop oor:name="Measure">
@@ -13246,8 +12149,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083257/6 Diaetiketten</value>
+ <value>083257/6 Diaetiketten</value>
</prop>
<prop oor:name="Measure">
@@ -13258,8 +12160,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083258/4 Farbdruck-Etiketten</value>
+ <value>083258/4 Farbdruck-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -13270,8 +12171,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">502041/7 Visitenkarten</value>
+ <value>502041/7 Visitenkarten</value>
</prop>
<prop oor:name="Measure">
@@ -13282,8 +12182,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value>
- <value xml:lang="en-US">083271/7 Ordnerrückeneinsteckschilder</value>
+ <value>083271/7 Ordnerrückeneinsteckschilder</value>
</prop>
<prop oor:name="Measure">
@@ -13293,987 +12192,987 @@
</node>
<node oor:name="Herma A4" oor:op="replace">
- <node oor:name="L0" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4093 SuperPrint CD-Etikett, gold</value></prop>
+ <node oor:name="L0" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4093 SuperPrint CD-Etikett, gold</value></prop>
<prop oor:name="Measure"><value>S;11600;14800;11600;11600;4700;1650;1;2</value></prop></node>
- <node oor:name="L1" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4094 SuperPrint CD-Etikett, silber</value></prop>
+ <node oor:name="L1" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4094 SuperPrint CD-Etikett, silber</value></prop>
<prop oor:name="Measure"><value>S;11600;14800;11600;11600;4700;1650;1;2</value></prop></node>
- <node oor:name="L2" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4097 SuperPrint Silberfolie</value></prop>
+ <node oor:name="L2" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4097 SuperPrint Silberfolie</value></prop>
<prop oor:name="Measure"><value>S;4826;2116,7;4572;2116,7;975;2150;4;12</value></prop></node>
- <node oor:name="L3" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4098 SuperPrint Silberfolie</value></prop>
+ <node oor:name="L3" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4098 SuperPrint Silberfolie</value></prop>
<prop oor:name="Measure"><value>S;6604;2963,3;6350;2963,3;721;1515;3;9</value></prop></node>
- <node oor:name="L4" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4099 SuperPrint Silberfolie</value></prop>
+ <node oor:name="L4" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4099 SuperPrint Silberfolie</value></prop>
<prop oor:name="Measure"><value>S;9854;5080;9600;5080;773;2150;2;5</value></prop></node>
- <node oor:name="L5" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4100 SuperPrint Goldfolie</value></prop>
+ <node oor:name="L5" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4100 SuperPrint Goldfolie</value></prop>
<prop oor:name="Measure"><value>S;3302;1693;3048;1693;721;1303;6;16</value></prop></node>
- <node oor:name="L6" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4101 SuperPrint Goldfolie</value></prop>
+ <node oor:name="L6" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4101 SuperPrint Goldfolie</value></prop>
<prop oor:name="Measure"><value>S;4318;1270;4318;1030;1864;1000;4;22</value></prop></node>
- <node oor:name="L7" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4102 SuperPrint Goldfolie</value></prop>
+ <node oor:name="L7" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4102 SuperPrint Goldfolie</value></prop>
<prop oor:name="Measure"><value>S;4830;2540;4830;2540;840;880;4;11</value></prop></node>
- <node oor:name="L8" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4103 SuperPrint Goldfolie</value></prop>
+ <node oor:name="L8" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4103 SuperPrint Goldfolie</value></prop>
<prop oor:name="Measure"><value>S;6604;3810;6350;3810;721;1515;3;7</value></prop></node>
- <node oor:name="L9" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4104 SuperPrint Goldfolie</value></prop>
+ <node oor:name="L9" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4104 SuperPrint Goldfolie</value></prop>
<prop oor:name="Measure"><value>S;10160;6773;9906;6773;467;1303;2;4</value></prop></node>
-<node oor:name="L10" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4105 SuperPrint Goldfolie, Kreise 60 mm</value></prop>
+<node oor:name="L10" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4105 SuperPrint Goldfolie, Kreise 60 mm</value></prop>
<prop oor:name="Measure"><value>S;6700;6700;6000;6000;800;1800;3;4</value></prop></node>
-<node oor:name="L11" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4106 SuperPrint Goldfolie, oval</value></prop>
+<node oor:name="L11" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4106 SuperPrint Goldfolie, oval</value></prop>
<prop oor:name="Measure"><value>S;6350;4656;5842;4233;1229;1093;3;6</value></prop></node>
-<node oor:name="L12" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4107 SuperPrint Goldfolie, A4</value></prop>
+<node oor:name="L12" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4107 SuperPrint Goldfolie, A4</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L13" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4108 SuperPrint Goldfolie</value></prop>
+<node oor:name="L13" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4108 SuperPrint Goldfolie</value></prop>
<prop oor:name="Measure"><value>S;2794;1000;2540;1000;848;1350;7;27</value></prop></node>
-<node oor:name="L14" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4109 SuperPrint Goldfolie, oval</value></prop>
+<node oor:name="L14" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4109 SuperPrint Goldfolie, oval</value></prop>
<prop oor:name="Measure"><value>S;4572;2963;4064;2540;1610;1727;4;9</value></prop></node>
-<node oor:name="L15" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4110 SuperPrint Silberfolie</value></prop>
+<node oor:name="L15" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4110 SuperPrint Silberfolie</value></prop>
<prop oor:name="Measure"><value>S;3302;1693;3048;1693;721;1303;6;16</value></prop></node>
-<node oor:name="L16" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4111 SuperPrint Silberfolie</value></prop>
+<node oor:name="L16" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4111 SuperPrint Silberfolie</value></prop>
<prop oor:name="Measure"><value>S;4318;1270;4318;1030;1864;1000;4;22</value></prop></node>
-<node oor:name="L17" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4112 SuperPrint Silberfolie</value></prop>
+<node oor:name="L17" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4112 SuperPrint Silberfolie</value></prop>
<prop oor:name="Measure"><value>S;4826;2540;4826;2540;848;880;4;11</value></prop></node>
-<node oor:name="L18" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4113 SuperPrint Silberfolie</value></prop>
+<node oor:name="L18" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4113 SuperPrint Silberfolie</value></prop>
<prop oor:name="Measure"><value>S;6604;3810;6350;3810;721;1515;3;7</value></prop></node>
-<node oor:name="L19" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4114 SuperPrint Silberfolie</value></prop>
+<node oor:name="L19" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4114 SuperPrint Silberfolie</value></prop>
<prop oor:name="Measure"><value>S;10160;6773;9906;6773;467;1303;2;4</value></prop></node>
-<node oor:name="L20" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4115 SuperPrint Silberfolie, Kreise 60 mm</value></prop>
+<node oor:name="L20" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4115 SuperPrint Silberfolie, Kreise 60 mm</value></prop>
<prop oor:name="Measure"><value>S;6700;6700;6000;6000;800;1800;3;4</value></prop></node>
-<node oor:name="L21" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4116 SuperPrint Silberfolie, oval</value></prop>
+<node oor:name="L21" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4116 SuperPrint Silberfolie, oval</value></prop>
<prop oor:name="Measure"><value>S;6350;4656;5842;4233;1229;1093;3;6</value></prop></node>
-<node oor:name="L22" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4117 SuperPrint Silberfolie, A4</value></prop>
+<node oor:name="L22" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4117 SuperPrint Silberfolie, A4</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L23" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4118 SuperPrint Silberfolie</value></prop>
+<node oor:name="L23" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4118 SuperPrint Silberfolie</value></prop>
<prop oor:name="Measure"><value>S;2794;1000;2540;1000;848;1350;7;27</value></prop></node>
-<node oor:name="L24" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4119 SuperPrint Silberfolie</value></prop>
+<node oor:name="L24" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4119 SuperPrint Silberfolie</value></prop>
<prop oor:name="Measure"><value>S;6604;1693;6350;1693;721;1303;3;16</value></prop></node>
-<node oor:name="L25" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4200 SuperPrint weiß</value></prop>
+<node oor:name="L25" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4200 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;4830;3387;4830;3387;840;1302;4;8</value></prop></node>
-<node oor:name="L26" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4201 SuperPrint Sichtreiteretiketten, weiß</value></prop>
+<node oor:name="L26" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4201 SuperPrint Sichtreiteretiketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;4826;1693;4572;1693;975;1306;4;16</value></prop></node>
-<node oor:name="L27" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4202 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
+<node oor:name="L27" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4202 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;6604;847;6350;847;721;1298;3;32</value></prop></node>
-<node oor:name="L28" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4203 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
+<node oor:name="L28" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4203 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;6604;4656;6350;4656;721;882;3;6</value></prop></node>
-<node oor:name="L29" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4204 SuperPrint 3,5"-Disketten, gelb</value></prop>
+<node oor:name="L29" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4204 SuperPrint 3,5"-Disketten, gelb</value></prop>
<prop oor:name="Measure"><value>S;9000;5080;7000;5080;2500;2150;2;5</value></prop></node>
-<node oor:name="L30" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4205 SuperPrint 3,5"-Disketten, rot</value></prop>
+<node oor:name="L30" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4205 SuperPrint 3,5"-Disketten, rot</value></prop>
<prop oor:name="Measure"><value>S;9000;5080;7000;5080;2500;2150;2;5</value></prop></node>
-<node oor:name="L31" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4206 SuperPrint 3,5"-Disketten, blau</value></prop>
+<node oor:name="L31" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4206 SuperPrint 3,5"-Disketten, blau</value></prop>
<prop oor:name="Measure"><value>S;9000;5080;7000;5080;2500;2150;2;5</value></prop></node>
-<node oor:name="L32" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4207 SuperPrint 3,5"-Disketten, grün</value></prop>
+<node oor:name="L32" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4207 SuperPrint 3,5"-Disketten, grün</value></prop>
<prop oor:name="Measure"><value>S;9000;5080;7000;5080;2500;2150;2;5</value></prop></node>
-<node oor:name="L33" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4208 SuperPrint Musik-Cassetten, weiß</value></prop>
+<node oor:name="L33" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4208 SuperPrint Musik-Cassetten, weiß</value></prop>
<prop oor:name="Measure"><value>S;9154;4233;8900;4233;1475;2150;2;6</value></prop></node>
-<node oor:name="L34" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4209 SuperPrint weiß, z.B. für Regalbeschriftung, ablösbar</value></prop>
+<node oor:name="L34" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4209 SuperPrint weiß, z.B. für Regalbeschriftung, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;9854;1693;9600;1693;773;1306;2;16</value></prop></node>
-<node oor:name="L35" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4210 SuperPrint weiß, ablösbar</value></prop>
+<node oor:name="L35" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4210 SuperPrint weiß, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;3810;1270;3810;1270;975;880;5;22</value></prop></node>
-<node oor:name="L36" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4211 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
+<node oor:name="L36" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4211 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;2794;1693;2540;1693;848;1306;7;16</value></prop></node>
-<node oor:name="L37" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4212 SuperPrint weiß, ablösbar</value></prop>
+<node oor:name="L37" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4212 SuperPrint weiß, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;3810;2120;3810;2120;975;1070;5;13</value></prop></node>
-<node oor:name="L38" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4226 SuperPrint weiß, deckend</value></prop>
+<node oor:name="L38" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4226 SuperPrint weiß, deckend</value></prop>
<prop oor:name="Measure"><value>S;4826;1693;4826;1693;848;1306;4;16</value></prop></node>
-<node oor:name="L39" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4227 SuperPrint weiß, deckend</value></prop>
+<node oor:name="L39" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4227 SuperPrint weiß, deckend</value></prop>
<prop oor:name="Measure"><value>S;6460;3387;6460;3387;810;1303;3;8</value></prop></node>
-<node oor:name="L40" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4228 SuperPrint weiß, deckend</value></prop>
+<node oor:name="L40" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4228 SuperPrint weiß, deckend</value></prop>
<prop oor:name="Measure"><value>S;9652;4233;9652;4233;848;2151;2;6</value></prop></node>
-<node oor:name="L41" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4229 SuperPrint weiß, deckend</value></prop>
+<node oor:name="L41" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4229 SuperPrint weiß, deckend</value></prop>
<prop oor:name="Measure"><value>S;10500;14850;10500;14850;0;0;2;2</value></prop></node>
-<node oor:name="L42" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4230 SuperPrint weiß, deckend</value></prop>
+<node oor:name="L42" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4230 SuperPrint weiß, deckend</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L43" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4232 SuperPrint Sicherheits-/Verschlussetiketten, weiß</value></prop>
+<node oor:name="L43" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4232 SuperPrint Sicherheits-/Verschlussetiketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;4826;2116,7;4572;2116,7;975;2150;4;12</value></prop></node>
-<node oor:name="L44" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4233 SuperPrint Sicherheits-/Verschlussetiketten, weiß</value></prop>
+<node oor:name="L44" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4233 SuperPrint Sicherheits-/Verschlussetiketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;6604;2963,3;6350;2963,3;721;1515;3;9</value></prop></node>
-<node oor:name="L45" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4234 SuperPrint Sicherheits-/Verschlussetiketten, weiß</value></prop>
+<node oor:name="L45" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4234 SuperPrint Sicherheits-/Verschlussetiketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;4600;4600;4000;4000;1600;1350;4;6</value></prop></node>
-<node oor:name="L46" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4249 SuperPrint weiß</value></prop>
+<node oor:name="L46" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4249 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;19960;14350;19960;14350;520;500;1;2</value></prop></node>
-<node oor:name="L47" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4250 SuperPrint weiß</value></prop>
+<node oor:name="L47" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4250 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10190;13900;9910;13900;450;950;2;2</value></prop></node>
-<node oor:name="L48" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4252 SuperPrint weiß</value></prop>
+<node oor:name="L48" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4252 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;19960;28910;19960;28910;520;395;1;1</value></prop></node>
-<node oor:name="L49" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4256 SuperPrint gelb</value></prop>
+<node oor:name="L49" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4256 SuperPrint gelb</value></prop>
<prop oor:name="Measure"><value>S;10500;3712,5;10500;3712,5;0;0;2;8</value></prop></node>
-<node oor:name="L50" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4257 SuperPrint rot</value></prop>
+<node oor:name="L50" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4257 SuperPrint rot</value></prop>
<prop oor:name="Measure"><value>S;10500;3712,5;10500;3712,5;0;0;2;8</value></prop></node>
-<node oor:name="L51" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4258 SuperPrint blau</value></prop>
+<node oor:name="L51" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4258 SuperPrint blau</value></prop>
<prop oor:name="Measure"><value>S;10500;3712,5;10500;3712,5;0;0;2;8</value></prop></node>
-<node oor:name="L52" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4259 SuperPrint grün</value></prop>
+<node oor:name="L52" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4259 SuperPrint grün</value></prop>
<prop oor:name="Measure"><value>S;10500;3712,5;10500;3712,5;0;0;2;8</value></prop></node>
-<node oor:name="L53" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4262 SuperPrint weiß</value></prop>
+<node oor:name="L53" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4262 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;6460;3387;6460;3387;810;1303;3;8</value></prop></node>
-<node oor:name="L54" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4263 SuperPrint weiß</value></prop>
+<node oor:name="L54" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4263 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;3387;7000;3387;0;1303;3;8</value></prop></node>
-<node oor:name="L55" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4264 SuperPrint weiß</value></prop>
+<node oor:name="L55" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4264 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;3387;10500;3387;0;1303;2;8</value></prop></node>
-<node oor:name="L56" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4265 SuperPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L56" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4265 SuperPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;6604;4656;6350;4656;721;882;3;6</value></prop></node>
-<node oor:name="L57" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4266 SuperPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L57" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4266 SuperPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;6604;7200;6350;7200;721;450;3;4</value></prop></node>
-<node oor:name="L58" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4267 SuperPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L58" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4267 SuperPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;10160;3387;9906;3387;467;1303;2;8</value></prop></node>
-<node oor:name="L59" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4268 SuperPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L59" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4268 SuperPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;10160;5700;9906;5700;467;600;2;5</value></prop></node>
-<node oor:name="L60" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4269 SuperPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L60" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4269 SuperPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;10160;6773;9906;6773;467;1303;2;4</value></prop></node>
-<node oor:name="L61" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4270 SuperPrint weiß</value></prop>
+<node oor:name="L61" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4270 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;3810;2120;3810;2120;975;1070;5;13</value></prop></node>
-<node oor:name="L62" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4271 SuperPrint weiß</value></prop>
+<node oor:name="L62" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4271 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;4826;1693;4826;1693;848;1306;4;16</value></prop></node>
-<node oor:name="L63" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4272 SuperPrint weiß</value></prop>
+<node oor:name="L63" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4272 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;4826;2540;4826;2540;848;880;4;11</value></prop></node>
-<node oor:name="L64" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4273 SuperPrint weiß</value></prop>
+<node oor:name="L64" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4273 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;5250;2120;5250;2120;0;0;4;14</value></prop></node>
-<node oor:name="L65" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4275 SuperPrint weiß</value></prop>
+<node oor:name="L65" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4275 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;6600;2540;6600;2540;600;880;3;11</value></prop></node>
-<node oor:name="L66" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4278 SuperPrint 3,5"-Disketten, weiß</value></prop>
+<node oor:name="L66" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4278 SuperPrint 3,5"-Disketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;5080;7000;5080;0;2150;3;5</value></prop></node>
-<node oor:name="L67" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4279 SuperPrint 3,5"-Disketten, weiß</value></prop>
+<node oor:name="L67" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4279 SuperPrint 3,5"-Disketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;6773;7000;6773;0;1303;3;4</value></prop></node>
-<node oor:name="L68" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4280 SuperPrint weiß</value></prop>
+<node oor:name="L68" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4280 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;9652;6773;9652;6773;848;1303;2;4</value></prop></node>
-<node oor:name="L69" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4281 SuperPrint weiß</value></prop>
+<node oor:name="L69" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4281 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;5080;10500;5080;0;2150;2;5</value></prop></node>
-<node oor:name="L70" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4282 SuperPrint weiß, A5</value></prop>
+<node oor:name="L70" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4282 SuperPrint weiß, A5</value></prop>
<prop oor:name="Measure"><value>S;21000;14850;21000;14850;0;0;1;2</value></prop></node>
-<node oor:name="L71" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4283 SuperPrint für schmale Ordner, weiß</value></prop>
+<node oor:name="L71" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4283 SuperPrint für schmale Ordner, weiß</value></prop>
<prop oor:name="Measure"><value>S;19200;3800;19200;3800;900;1550;1;7</value></prop></node>
-<node oor:name="L72" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4284 SuperPrint für breite Ordner, weiß</value></prop>
+<node oor:name="L72" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4284 SuperPrint für breite Ordner, weiß</value></prop>
<prop oor:name="Measure"><value>S;19200;6100;19200;6100;900;2650;1;4</value></prop></node>
-<node oor:name="L73" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4290 SuperPrint für schmale Ordner, weiß</value></prop>
+<node oor:name="L73" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4290 SuperPrint für schmale Ordner, weiß</value></prop>
<prop oor:name="Measure"><value>S;19200;3400;19200;3400;900;1250;1;8</value></prop></node>
-<node oor:name="L74" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4291 SuperPrint für breite Ordner, weiß</value></prop>
+<node oor:name="L74" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4291 SuperPrint für breite Ordner, weiß</value></prop>
<prop oor:name="Measure"><value>S;19200;5900;19200;5900;900;3050;1;4</value></prop></node>
-<node oor:name="L75" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4292 SuperPrint für schmale Ordner, gelb</value></prop>
+<node oor:name="L75" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4292 SuperPrint für schmale Ordner, gelb</value></prop>
<prop oor:name="Measure"><value>S;19200;3800;19200;3800;900;1550;1;7</value></prop></node>
-<node oor:name="L76" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4293 SuperPrint für schmale Ordner, rot</value></prop>
+<node oor:name="L76" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4293 SuperPrint für schmale Ordner, rot</value></prop>
<prop oor:name="Measure"><value>S;19200;3800;19200;3800;900;1550;1;7</value></prop></node>
-<node oor:name="L77" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4294 SuperPrint für schmale Ordner, blau</value></prop>
+<node oor:name="L77" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4294 SuperPrint für schmale Ordner, blau</value></prop>
<prop oor:name="Measure"><value>S;19200;3800;19200;3800;900;1550;1;7</value></prop></node>
-<node oor:name="L78" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4295 SuperPrint für schmale Ordner, grün</value></prop>
+<node oor:name="L78" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4295 SuperPrint für schmale Ordner, grün</value></prop>
<prop oor:name="Measure"><value>S;19200;3800;19200;3800;900;1550;1;7</value></prop></node>
-<node oor:name="L79" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4296 SuperPrint für breite Ordner, gelb</value></prop>
+<node oor:name="L79" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4296 SuperPrint für breite Ordner, gelb</value></prop>
<prop oor:name="Measure"><value>S;19200;6100;19200;6100;900;2650;1;4</value></prop></node>
-<node oor:name="L80" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4297 SuperPrint für breite Ordner, rot</value></prop>
+<node oor:name="L80" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4297 SuperPrint für breite Ordner, rot</value></prop>
<prop oor:name="Measure"><value>S;19200;6100;19200;6100;900;2650;1;4</value></prop></node>
-<node oor:name="L81" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4298 SuperPrint für breite Ordner, blau</value></prop>
+<node oor:name="L81" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4298 SuperPrint für breite Ordner, blau</value></prop>
<prop oor:name="Measure"><value>S;19200;6100;19200;6100;900;2650;1;4</value></prop></node>
-<node oor:name="L82" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4299 SuperPrint für breite Ordner, grün</value></prop>
+<node oor:name="L82" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4299 SuperPrint für breite Ordner, grün</value></prop>
<prop oor:name="Measure"><value>S;19200;6100;19200;6100;900;2650;1;4</value></prop></node>
-<node oor:name="L83" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4333 SuperPrint weiß </value></prop>
+<node oor:name="L83" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4333 SuperPrint weiß </value></prop>
<prop oor:name="Measure"><value>S;2794;1000;2540;1000;848;1350;7;27</value></prop></node>
-<node oor:name="L84" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4334 SuperPrint weiß </value></prop>
+<node oor:name="L84" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4334 SuperPrint weiß </value></prop>
<prop oor:name="Measure"><value>S;2794;1693;2540;1693;848;1306;7;16</value></prop></node>
-<node oor:name="L85" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4336 SuperPrint weiß </value></prop>
+<node oor:name="L85" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4336 SuperPrint weiß </value></prop>
<prop oor:name="Measure"><value>S;3810;1693;3556;1693;1102;1306;5;16</value></prop></node>
-<node oor:name="L86" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4343 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
+<node oor:name="L86" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4343 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;2041;1000;1780;1000;425,5;1350;10;27</value></prop></node>
-<node oor:name="L87" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4344 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
+<node oor:name="L87" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4344 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;2794;1000;2540;1000;848;1350;7;27</value></prop></node>
-<node oor:name="L88" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4345 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
+<node oor:name="L88" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4345 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;3810;1693;3556;1693;1102;1306;5;16</value></prop></node>
-<node oor:name="L89" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4346 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
+<node oor:name="L89" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4346 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;4826;2116,7;4572;2116,7;975;2150;4;12</value></prop></node>
-<node oor:name="L90" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4347 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
+<node oor:name="L90" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4347 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;6604;2963,3;6350;2963,3;721;1515;3;9</value></prop></node>
-<node oor:name="L91" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4348 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
+<node oor:name="L91" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4348 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;9854;4233;9600;4233;773;2150;2;6</value></prop></node>
-<node oor:name="L92" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4349 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
+<node oor:name="L92" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4349 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;9854;5080;9600;5080;773;2150;2;5</value></prop></node>
-<node oor:name="L93" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4350 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
+<node oor:name="L93" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4350 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;9854;6350;9600;6350;773;2150;2;4</value></prop></node>
-<node oor:name="L94" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4351 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
+<node oor:name="L94" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4351 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;21000;14850;21000;14850;0;0;1;2</value></prop></node>
-<node oor:name="L95" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4352 SuperPrint weiß, ablösbar</value></prop>
+<node oor:name="L95" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4352 SuperPrint weiß, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L96" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4353 SuperPrint 3,5"-Disketten, weiß</value></prop>
+<node oor:name="L96" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4353 SuperPrint 3,5"-Disketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;9000;5080;7000;5080;2500;2150;2;5</value></prop></node>
-<node oor:name="L97" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4354 SuperPrint 3,5"-Disketten, farbig sortiert</value></prop>
+<node oor:name="L97" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4354 SuperPrint 3,5"-Disketten, farbig sortiert</value></prop>
<prop oor:name="Measure"><value>S;9000;5080;7000;5080;2500;2150;2;5</value></prop></node>
-<node oor:name="L98" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4355 SuperPrint 3,5"-Disketten, weiß</value></prop>
+<node oor:name="L98" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4355 SuperPrint 3,5"-Disketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;9000;6773;7000;6773;2500;1304;2;4</value></prop></node>
-<node oor:name="L99" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4356 SuperPrint 3,5"-Disketten, farbig sortiert</value></prop>
+<node oor:name="L99" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4356 SuperPrint 3,5"-Disketten, farbig sortiert</value></prop>
<prop oor:name="Measure"><value>S;9000;6773;7000;6773;2500;1304;2;4</value></prop></node>
-<node oor:name="L100" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4357 SuperPrint weiß</value></prop>
+<node oor:name="L100" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4357 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;4850;2540;4850;2540;800;2150;4;10</value></prop></node>
-<node oor:name="L101" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4358 SuperPrint Oval, weiß, ablösbar</value></prop>
+<node oor:name="L101" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4358 SuperPrint Oval, weiß, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;6604;4656,7;6350;4233;721;1093;3;6</value></prop></node>
-<node oor:name="L102" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4359 SuperPrint weiß</value></prop>
+<node oor:name="L102" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4359 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;9652;6773;9652;6773;848;1303;2;4</value></prop></node>
-<node oor:name="L103" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4360 SuperPrint weiß</value></prop>
+<node oor:name="L103" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4360 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;3600;7000;3600;0;450;3;8</value></prop></node>
-<node oor:name="L104" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4361 SuperPrint weiß</value></prop>
+<node oor:name="L104" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4361 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;4125;7000;4125;0;412,5;3;7</value></prop></node>
-<node oor:name="L105" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4362 SuperPrint weiß</value></prop>
+<node oor:name="L105" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4362 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;4125;10500;4125;0;412,5;2;7</value></prop></node>
-<node oor:name="L106" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4363 SuperPrint weiß</value></prop>
+<node oor:name="L106" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4363 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;4800;10500;4800;0;450;2;6</value></prop></node>
-<node oor:name="L107" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4364 SuperPrint weiß</value></prop>
+<node oor:name="L107" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4364 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;14400;10500;14400;0;450;2;2</value></prop></node>
-<node oor:name="L108" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4366 SuperPrint gelb, Ecken abgerundet</value></prop>
+<node oor:name="L108" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4366 SuperPrint gelb, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;4826;2116,7;4572;2116,7;975;2150;4;12</value></prop></node>
-<node oor:name="L109" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4367 SuperPrint rot, Ecken abgerundet</value></prop>
+<node oor:name="L109" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4367 SuperPrint rot, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;4826;2116,7;4572;2116,7;975;2150;4;12</value></prop></node>
-<node oor:name="L110" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4368 SuperPrint blau, Ecken abgerundet</value></prop>
+<node oor:name="L110" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4368 SuperPrint blau, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;4826;2116,7;4572;2116,7;975;2150;4;12</value></prop></node>
-<node oor:name="L111" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4369 SuperPrint grün, Ecken abgerundet</value></prop>
+<node oor:name="L111" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4369 SuperPrint grün, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;4826;2116,7;4572;2116,7;975;2150;4;12</value></prop></node>
-<node oor:name="L112" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4373 SuperPrint CD-Cover, weiß</value></prop>
+<node oor:name="L112" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4373 SuperPrint CD-Cover, weiß</value></prop>
<prop oor:name="Measure"><value>S;12150;14550;12150;11750;4425;1700;1;2</value></prop></node>
-<node oor:name="L113" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4374 SuperPrint CD-Etikett, transparente Folie</value></prop>
+<node oor:name="L113" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4374 SuperPrint CD-Etikett, transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;11600;14800;11600;11600;4700;1650;1;2</value></prop></node>
-<node oor:name="L114" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4375 SuperPrint transparente Folie</value></prop>
+<node oor:name="L114" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4375 SuperPrint transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L115" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4376 SuperPrint transparente Folie</value></prop>
+<node oor:name="L115" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4376 SuperPrint transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L116" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4377 SuperPrint witterungsbeständig, weiß</value></prop>
+<node oor:name="L116" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4377 SuperPrint witterungsbeständig, weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;14850;10500;14850;0;0;2;2</value></prop></node>
-<node oor:name="L117" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4378 SuperPrint witterungsbeständig, weiß</value></prop>
+<node oor:name="L117" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4378 SuperPrint witterungsbeständig, weiß</value></prop>
<prop oor:name="Measure"><value>S;21000;14850;21000;14850;0;0;1;2</value></prop></node>
-<node oor:name="L118" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4379 SuperPrint witterungsbeständig, weiß</value></prop>
+<node oor:name="L118" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4379 SuperPrint witterungsbeständig, weiß</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L119" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4380 SuperPrint Oval, weiß</value></prop>
+<node oor:name="L119" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4380 SuperPrint Oval, weiß</value></prop>
<prop oor:name="Measure"><value>S;4572;2963;4064;2540;1610;1727;4;9</value></prop></node>
-<node oor:name="L120" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4385 SuperPrint Kreise 10 mm, weiß, ablösbar</value></prop>
+<node oor:name="L120" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4385 SuperPrint Kreise 10 mm, weiß, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;1270;1270;1000;1000;1110;1650;15;21</value></prop></node>
-<node oor:name="L121" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4386 SuperPrint Kreise 20 mm, weiß, ablösbar</value></prop>
+<node oor:name="L121" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4386 SuperPrint Kreise 20 mm, weiß, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;2254;2254;2000;2000;1611;1453;8;12</value></prop></node>
-<node oor:name="L122" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4387 SuperPrint Kreise 30 mm, weiß</value></prop>
+<node oor:name="L122" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4387 SuperPrint Kreise 30 mm, weiß</value></prop>
<prop oor:name="Measure"><value>S;3254;3254;3000;3000;865;1961;6;8</value></prop></node>
-<node oor:name="L123" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4388 SuperPrint Tiefkühletiketten, weiß</value></prop>
+<node oor:name="L123" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4388 SuperPrint Tiefkühletiketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;3810;2120;3810;2120;975;1070;5;13</value></prop></node>
-<node oor:name="L124" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4389 SuperPrint Tiefkühletiketten, weiß</value></prop>
+<node oor:name="L124" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4389 SuperPrint Tiefkühletiketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;6600;3387;6600;3387;600;1303;3;8</value></prop></node>
-<node oor:name="L125" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4390 SuperPrint weiß</value></prop>
+<node oor:name="L125" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4390 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;3712,5;7000;3712,5;0;0;3;8</value></prop></node>
-<node oor:name="L126" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4391 SuperPrint weiß</value></prop>
+<node oor:name="L126" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4391 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;3712,5;10500;3712,5;0;0;2;8</value></prop></node>
-<node oor:name="L127" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4392 SuperPrint weiß, ablösbar</value></prop>
+<node oor:name="L127" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4392 SuperPrint weiß, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;5250;2970;5250;2970;0;0;4;10</value></prop></node>
-<node oor:name="L128" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4393 SuperPrint weiß, ablösbar</value></prop>
+<node oor:name="L128" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4393 SuperPrint weiß, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;10500;4125;10500;4125;0;412,5;2;7</value></prop></node>
-<node oor:name="L129" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4394 SuperPrint weiß, ablösbar</value></prop>
+<node oor:name="L129" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4394 SuperPrint weiß, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;10500;14400;10500;14400;0;450;2;2</value></prop></node>
-<node oor:name="L130" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4396 SuperPrint gelb, A6</value></prop>
+<node oor:name="L130" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4396 SuperPrint gelb, A6</value></prop>
<prop oor:name="Measure"><value>S;10500;14850;10500;14850;0;0;2;2</value></prop></node>
-<node oor:name="L131" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4397 SuperPrint rot, A6</value></prop>
+<node oor:name="L131" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4397 SuperPrint rot, A6</value></prop>
<prop oor:name="Measure"><value>S;10500;14850;10500;14850;0;0;2;2</value></prop></node>
-<node oor:name="L132" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4398 SuperPrint blau, A6</value></prop>
+<node oor:name="L132" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4398 SuperPrint blau, A6</value></prop>
<prop oor:name="Measure"><value>S;10500;14850;10500;14850;0;0;2;2</value></prop></node>
-<node oor:name="L133" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4399 SuperPrint grün, A6</value></prop>
+<node oor:name="L133" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4399 SuperPrint grün, A6</value></prop>
<prop oor:name="Measure"><value>S;10500;14850;10500;14850;0;0;2;2</value></prop></node>
-<node oor:name="L134" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4401 SuperPrint gelb, A4</value></prop>
+<node oor:name="L134" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4401 SuperPrint gelb, A4</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L135" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4402 SuperPrint rot, A4</value></prop>
+<node oor:name="L135" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4402 SuperPrint rot, A4</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L136" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4403 SuperPrint blau, A4</value></prop>
+<node oor:name="L136" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4403 SuperPrint blau, A4</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L137" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4404 SuperPrint grün, A4</value></prop>
+<node oor:name="L137" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4404 SuperPrint grün, A4</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L138" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4406 SuperPrint gelb</value></prop>
+<node oor:name="L138" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4406 SuperPrint gelb</value></prop>
<prop oor:name="Measure"><value>S;7000;3712,5;7000;3712,5;0;0;3;8</value></prop></node>
-<node oor:name="L139" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4407 SuperPrint rot</value></prop>
+<node oor:name="L139" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4407 SuperPrint rot</value></prop>
<prop oor:name="Measure"><value>S;7000;3712,5;7000;3712,5;0;0;3;8</value></prop></node>
-<node oor:name="L140" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4408 SuperPrint blau</value></prop>
+<node oor:name="L140" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4408 SuperPrint blau</value></prop>
<prop oor:name="Measure"><value>S;7000;3712,5;7000;3712,5;0;0;3;8</value></prop></node>
-<node oor:name="L141" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4409 SuperPrint grün</value></prop>
+<node oor:name="L141" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4409 SuperPrint grün</value></prop>
<prop oor:name="Measure"><value>S;7000;3712,5;7000;3712,5;0;0;3;8</value></prop></node>
-<node oor:name="L142" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4414 SuperPrint weiß</value></prop>
+<node oor:name="L142" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4414 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;3600;7000;3600;0;450;3;8</value></prop></node>
-<node oor:name="L143" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4415 SuperPrint weiß</value></prop>
+<node oor:name="L143" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4415 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;4125;7000;4125;0;412,5;3;7</value></prop></node>
-<node oor:name="L144" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4416 SuperPrint weiß</value></prop>
+<node oor:name="L144" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4416 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;4125;10500;4125;0;412,5;2;7</value></prop></node>
-<node oor:name="L145" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4417 SuperPrint weiß</value></prop>
+<node oor:name="L145" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4417 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;4800;10500;4800;0;450;2;6</value></prop></node>
-<node oor:name="L146" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4418 SuperPrint Namensetiketten Acetatseide, rot</value></prop>
+<node oor:name="L146" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4418 SuperPrint Namensetiketten Acetatseide, rot</value></prop>
<prop oor:name="Measure"><value>S;6604;2963,3;6350;2963,3;721;1515;3;9</value></prop></node>
-<node oor:name="L147" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4419 SuperPrint Namensetiketten Acetatseide, blau</value></prop>
+<node oor:name="L147" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4419 SuperPrint Namensetiketten Acetatseide, blau</value></prop>
<prop oor:name="Measure"><value>S;6604;2963,3;6350;2963,3;721;1515;3;9</value></prop></node>
-<node oor:name="L148" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4421 SuperPrint gelb</value></prop>
+<node oor:name="L148" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4421 SuperPrint gelb</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L149" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4422 SuperPrint rot</value></prop>
+<node oor:name="L149" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4422 SuperPrint rot</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L150" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4423 SuperPrint blau</value></prop>
+<node oor:name="L150" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4423 SuperPrint blau</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L151" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4424 SuperPrint grün</value></prop>
+<node oor:name="L151" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4424 SuperPrint grün</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L152" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4425 SuperPrint weiß</value></prop>
+<node oor:name="L152" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4425 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;5700;10500;5700;0;600;2;5</value></prop></node>
-<node oor:name="L153" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4426 SuperPrint weiß</value></prop>
+<node oor:name="L153" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4426 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;7000;10500;7000;0;850;2;4</value></prop></node>
-<node oor:name="L154" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4427 SuperPrint weiß</value></prop>
+<node oor:name="L154" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4427 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;3500;10500;3500;0;850;2;8</value></prop></node>
-<node oor:name="L155" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4428 SuperPrint weiß, A4</value></prop>
+<node oor:name="L155" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4428 SuperPrint weiß, A4</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L156" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4429 SuperPrint weiß</value></prop>
+<node oor:name="L156" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4429 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;3500;7000;3500;0;850;3;8</value></prop></node>
-<node oor:name="L157" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4450 SuperPrint weiß</value></prop>
+<node oor:name="L157" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4450 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;3200;7000;3200;0;450;3;9</value></prop></node>
-<node oor:name="L158" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4451 SuperPrint weiß</value></prop>
+<node oor:name="L158" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4451 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;4125;7000;4125;0;412,5;3;7</value></prop></node>
-<node oor:name="L159" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4452 SuperPrint weiß</value></prop>
+<node oor:name="L159" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4452 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;4125;10500;4125;0;412,5;2;7</value></prop></node>
-<node oor:name="L160" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4453 SuperPrint weiß</value></prop>
+<node oor:name="L160" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4453 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;3600;7000;3600;0;450;3;8</value></prop></node>
-<node oor:name="L161" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4454 SuperPrint weiß</value></prop>
+<node oor:name="L161" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4454 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;14400;10500;14400;0;450;2;2</value></prop></node>
-<node oor:name="L162" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4455 SuperPrint weiß</value></prop>
+<node oor:name="L162" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4455 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;2540;7000;2540;0;880;3;11</value></prop></node>
-<node oor:name="L163" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4456 SuperPrint weiß</value></prop>
+<node oor:name="L163" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4456 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;2970;7000;2970;0;0;3;10</value></prop></node>
-<node oor:name="L164" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4457 SuperPrint weiß</value></prop>
+<node oor:name="L164" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4457 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;4800;10500;4800;0;450;2;6</value></prop></node>
-<node oor:name="L165" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4458 SuperPrint weiß</value></prop>
+<node oor:name="L165" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4458 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;20000;29700;20000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L166" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4459 SuperPrint weiß</value></prop>
+<node oor:name="L166" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4459 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;1693;7000;1693;0;460;3;17</value></prop></node>
-<node oor:name="L167" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4461 SuperPrint weiß</value></prop>
+<node oor:name="L167" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4461 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;5250;2970;5250;2970;0;0;4;10</value></prop></node>
-<node oor:name="L168" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4462 SuperPrint weiß</value></prop>
+<node oor:name="L168" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4462 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;3712,5;10500;3712,5;0;0;2;8</value></prop></node>
-<node oor:name="L169" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4464 SuperPrint weiß</value></prop>
+<node oor:name="L169" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4464 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;3712,5;7000;3712,5;0;0;3;8</value></prop></node>
-<node oor:name="L170" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4465 SuperPrint transparente Folie</value></prop>
+<node oor:name="L170" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4465 SuperPrint transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L171" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4466 SuperPrint gelb</value></prop>
+<node oor:name="L171" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4466 SuperPrint gelb</value></prop>
<prop oor:name="Measure"><value>S;7000;3712,5;7000;3712,5;0;0;3;8</value></prop></node>
-<node oor:name="L172" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4467 SuperPrint rot</value></prop>
+<node oor:name="L172" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4467 SuperPrint rot</value></prop>
<prop oor:name="Measure"><value>S;7000;3712,5;7000;3712,5;0;0;3;8</value></prop></node>
-<node oor:name="L173" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4468 SuperPrint blau</value></prop>
+<node oor:name="L173" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4468 SuperPrint blau</value></prop>
<prop oor:name="Measure"><value>S;7000;3712,5;7000;3712,5;0;0;3;8</value></prop></node>
-<node oor:name="L174" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4469 SuperPrint grün</value></prop>
+<node oor:name="L174" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4469 SuperPrint grün</value></prop>
<prop oor:name="Measure"><value>S;7000;3712,5;7000;3712,5;0;0;3;8</value></prop></node>
-<node oor:name="L175" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4470 SuperPrint weiß</value></prop>
+<node oor:name="L175" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4470 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;7425;10500;7425;0;0;2;4</value></prop></node>
-<node oor:name="L176" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4471 SuperPrint CD-Etikett, weiß</value></prop>
+<node oor:name="L176" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4471 SuperPrint CD-Etikett, weiß</value></prop>
<prop oor:name="Measure"><value>S;11600;14800;11600;11600;4700;1650;1;2</value></prop></node>
-<node oor:name="L177" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4472 SuperPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L177" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4472 SuperPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;8128;13970;7874;13970;2499;880;2;2</value></prop></node>
-<node oor:name="L178" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4473 SuperPrint weiß</value></prop>
+<node oor:name="L178" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4473 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;4100;7000;4100;0;500;3;7</value></prop></node>
-<node oor:name="L179" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4474 SuperPrint weiß</value></prop>
+<node oor:name="L179" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4474 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;4850;2540;4850;2540;800;2150;4;10</value></prop></node>
-<node oor:name="L180" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4475 SuperPrint weiß</value></prop>
+<node oor:name="L180" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4475 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;4100;10500;4100;0;500;2;7</value></prop></node>
-<node oor:name="L181" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4476 SuperPrint Kreise 40 mm, weiß</value></prop>
+<node oor:name="L181" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4476 SuperPrint Kreise 40 mm, weiß</value></prop>
<prop oor:name="Measure"><value>S;4600;4600;4000;4000;1600;1350;4;6</value></prop></node>
-<node oor:name="L182" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4477 SuperPrint Kreise 60 mm, weiß</value></prop>
+<node oor:name="L182" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4477 SuperPrint Kreise 60 mm, weiß</value></prop>
<prop oor:name="Measure"><value>S;6700;6700;6000;6000;800;1800;3;4</value></prop></node>
-<node oor:name="L183" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4478 SuperPrint Kreise 85 mm, weiß</value></prop>
+<node oor:name="L183" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4478 SuperPrint Kreise 85 mm, weiß</value></prop>
<prop oor:name="Measure"><value>S;9500;9500;8500;8500;1500;1100;2;3</value></prop></node>
-<node oor:name="L184" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4479 SuperPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L184" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4479 SuperPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9652;3387;8890;3387;1229;1303;2;8</value></prop></node>
-<node oor:name="L185" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4606 SuperPrint weiß</value></prop>
+<node oor:name="L185" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4606 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;3810;2120;3810;2120;975;1070;5;13</value></prop></node>
-<node oor:name="L186" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4607 SuperPrint weiß</value></prop>
+<node oor:name="L186" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4607 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;4826;1693;4826;1693;848;1306;4;16</value></prop></node>
-<node oor:name="L187" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4608 SuperPrint weiß</value></prop>
+<node oor:name="L187" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4608 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;4826;2540;4826;2540;848;880;4;11</value></prop></node>
-<node oor:name="L188" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4609 SuperPrint weiß</value></prop>
+<node oor:name="L188" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4609 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;5250;2120;5250;2120;0;0;4;14</value></prop></node>
-<node oor:name="L189" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4610 SuperPrint weiß</value></prop>
+<node oor:name="L189" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4610 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;5250;2970;5250;2970;0;0;4;10</value></prop></node>
-<node oor:name="L190" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4611 SuperPrint weiß</value></prop>
+<node oor:name="L190" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4611 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;1693;7000;1693;0;460;3;17</value></prop></node>
-<node oor:name="L191" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4612 SuperPrint weiß</value></prop>
+<node oor:name="L191" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4612 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;2970;7000;2970;0;0;3;10</value></prop></node>
-<node oor:name="L192" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4613 SuperPrint weiß</value></prop>
+<node oor:name="L192" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4613 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;6600;2540;6600;2540;600;880;3;11</value></prop></node>
-<node oor:name="L193" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4614 SuperPrint weiß</value></prop>
+<node oor:name="L193" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4614 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;6600;3387;6600;3387;600;1303;3;8</value></prop></node>
-<node oor:name="L194" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4615 SuperPrint weiß</value></prop>
+<node oor:name="L194" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4615 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;3712,5;7000;3712,5;0;0;3;8</value></prop></node>
-<node oor:name="L195" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4616 SuperPrint weiß</value></prop>
+<node oor:name="L195" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4616 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;4243;7000;4243;0;0;3;7</value></prop></node>
-<node oor:name="L196" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4617 SuperPrint 3,5"-Disketten, weiß</value></prop>
+<node oor:name="L196" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4617 SuperPrint 3,5"-Disketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;6773;7000;6773;0;1303;3;4</value></prop></node>
-<node oor:name="L197" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4618 SuperPrint 3,5"-Disketten, weiß</value></prop>
+<node oor:name="L197" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4618 SuperPrint 3,5"-Disketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;5080;7000;5080;0;2150;3;5</value></prop></node>
-<node oor:name="L198" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4619 SuperPrint weiß</value></prop>
+<node oor:name="L198" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4619 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;9652;3387;9652;3387;848;1303;2;8</value></prop></node>
-<node oor:name="L199" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4620 SuperPrint weiß</value></prop>
+<node oor:name="L199" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4620 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;3712,5;10500;3712,5;0;0;2;8</value></prop></node>
-<node oor:name="L200" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4623 SuperPrint weiß</value></prop>
+<node oor:name="L200" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4623 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;9652;4233;9652;4233;848;2151;2;6</value></prop></node>
-<node oor:name="L201" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4624 SuperPrint weiß</value></prop>
+<node oor:name="L201" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4624 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;9652;6773;9652;6773;848;1303;2;4</value></prop></node>
-<node oor:name="L202" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4625 SuperPrint weiß</value></prop>
+<node oor:name="L202" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4625 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;4243;10500;4243;0;0;2;7</value></prop></node>
-<node oor:name="L203" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4626 SuperPrint weiß</value></prop>
+<node oor:name="L203" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4626 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;7425;10500;7425;0;0;2;4</value></prop></node>
-<node oor:name="L204" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4627 SuperPrint weiß, A6</value></prop>
+<node oor:name="L204" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4627 SuperPrint weiß, A6</value></prop>
<prop oor:name="Measure"><value>S;10500;14850;10500;14850;0;0;2;2</value></prop></node>
-<node oor:name="L205" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4628 SuperPrint weiß, A5</value></prop>
+<node oor:name="L205" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4628 SuperPrint weiß, A5</value></prop>
<prop oor:name="Measure"><value>S;21000;14850;21000;14850;0;0;1;2</value></prop></node>
-<node oor:name="L206" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4629 SuperPrint weiß</value></prop>
+<node oor:name="L206" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4629 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;5080;10500;5080;0;2150;2;5</value></prop></node>
-<node oor:name="L207" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4631 SuperPrint weiß</value></prop>
+<node oor:name="L207" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4631 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L208" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4654 SuperPrint weiß</value></prop>
+<node oor:name="L208" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4654 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;3900;10500;3900;0;1200;2;7</value></prop></node>
-<node oor:name="L209" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4664 SuperPrint Lohnsteueretikett,perforiert mit Klebestreifen, weiß </value></prop>
+<node oor:name="L209" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4664 SuperPrint Lohnsteueretikett,perforiert mit Klebestreifen, weiß </value></prop>
<prop oor:name="Measure"><value>S;10500;3900;10500;3900;0;1200;2;7</value></prop></node>
-<node oor:name="L210" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4666 SuperPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L210" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4666 SuperPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9652;4656;8890;4656;1229;880;2;6</value></prop></node>
-<node oor:name="L211" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4667 SuperPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L211" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4667 SuperPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9854;5080;9600;5080;773;2150;2;5</value></prop></node>
-<node oor:name="L212" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4668 SuperPrint weiß</value></prop>
+<node oor:name="L212" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4668 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;4243;7000;4243;0;0;3;7</value></prop></node>
-<node oor:name="L213" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4669 SuperPrint weiß</value></prop>
+<node oor:name="L213" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4669 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;9652;4233;9652;4233;848;2150;2;6</value></prop></node>
-<node oor:name="L214" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4670 SuperPrint weiß</value></prop>
+<node oor:name="L214" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4670 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;6600;3387;6600;3387;600;1303;3;8</value></prop></node>
-<node oor:name="L215" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4672 SuperPrint weiß</value></prop>
+<node oor:name="L215" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4672 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;9652;3387;9652;3387;848;1303;2;8</value></prop></node>
-<node oor:name="L216" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4674 SuperPrint weiß</value></prop>
+<node oor:name="L216" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4674 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;4243;10500;4243;0;0;2;7</value></prop></node>
-<node oor:name="L217" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4676 SuperPrint weiß, A6</value></prop>
+<node oor:name="L217" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4676 SuperPrint weiß, A6</value></prop>
<prop oor:name="Measure"><value>S;10500;14850;10500;14850;0;0;2;2</value></prop></node>
-<node oor:name="L218" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4677 SuperPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L218" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4677 SuperPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;6604;3810;6350;3810;721;1515;3;7</value></prop></node>
-<node oor:name="L219" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4678 SuperPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L219" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4678 SuperPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;10160;3810;9906;3810;467;1515;2;7</value></prop></node>
-<node oor:name="L220" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4680 SuperPrint transparente Folie</value></prop>
+<node oor:name="L220" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4680 SuperPrint transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;4826;2540;4826;2540;848;880;4;11</value></prop></node>
-<node oor:name="L221" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4681 SuperPrint transparente Folie</value></prop>
+<node oor:name="L221" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4681 SuperPrint transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;6600;3387;6600;3387;600;1303;3;8</value></prop></node>
-<node oor:name="L222" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4682 SuperPrint transparente Folie</value></prop>
+<node oor:name="L222" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4682 SuperPrint transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;9652;4233;9652;4233;848;2150;2;6</value></prop></node>
-<node oor:name="L223" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4683 SuperPrint transparente Folie, A5</value></prop>
+<node oor:name="L223" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4683 SuperPrint transparente Folie, A5</value></prop>
<prop oor:name="Measure"><value>S;21000;14850;21000;14850;0;0;1;2</value></prop></node>
-<node oor:name="L224" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4684 SuperPrint transparente Folie</value></prop>
+<node oor:name="L224" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4684 SuperPrint transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;5250;2970;5250;2970;0;0;4;10</value></prop></node>
-<node oor:name="L225" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4685 SuperPrint transparente Folie</value></prop>
+<node oor:name="L225" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4685 SuperPrint transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;7000;3712,5;7000;3712,5;0;0;3;8</value></prop></node>
-<node oor:name="L226" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4686 SuperPrint Kreise 40 mm, transparent</value></prop>
+<node oor:name="L226" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4686 SuperPrint Kreise 40 mm, transparent</value></prop>
<prop oor:name="Measure"><value>S;4600;4600;4000;4000;1600;1350;4;6</value></prop></node>
-<node oor:name="L227" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4690 SuperPrint weiße Folie</value></prop>
+<node oor:name="L227" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4690 SuperPrint weiße Folie</value></prop>
<prop oor:name="Measure"><value>S;4826;2540;4826;2540;848;880;4;11</value></prop></node>
-<node oor:name="L228" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4691 SuperPrint weiße Folie</value></prop>
+<node oor:name="L228" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4691 SuperPrint weiße Folie</value></prop>
<prop oor:name="Measure"><value>S;6600;3387;6600;3387;600;1303;3;8</value></prop></node>
-<node oor:name="L229" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4692 SuperPrint weiße Folie</value></prop>
+<node oor:name="L229" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4692 SuperPrint weiße Folie</value></prop>
<prop oor:name="Measure"><value>S;9652;4233;9652;4233;848;2150;2;6</value></prop></node>
-<node oor:name="L230" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4693 SuperPrint weiße Folie, A5</value></prop>
+<node oor:name="L230" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4693 SuperPrint weiße Folie, A5</value></prop>
<prop oor:name="Measure"><value>S;21000;14850;21000;14850;0;0;1;2</value></prop></node>
-<node oor:name="L231" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4694 SuperPrint weiße Folie</value></prop>
+<node oor:name="L231" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4694 SuperPrint weiße Folie</value></prop>
<prop oor:name="Measure"><value>S;5250;2970;5250;2970;0;0;4;10</value></prop></node>
-<node oor:name="L232" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4695 SuperPrint weiße Folie</value></prop>
+<node oor:name="L232" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4695 SuperPrint weiße Folie</value></prop>
<prop oor:name="Measure"><value>S;7000;3712,5;7000;3712,5;0;0;3;8</value></prop></node>
-<node oor:name="L233" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4696 SuperPrint weiße Folie</value></prop>
+<node oor:name="L233" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4696 SuperPrint weiße Folie</value></prop>
<prop oor:name="Measure"><value>S;10500;4243;10500;4243;0;0;2;7</value></prop></node>
-<node oor:name="L234" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4697 SuperPrint weiße Folie</value></prop>
+<node oor:name="L234" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4697 SuperPrint weiße Folie</value></prop>
<prop oor:name="Measure"><value>S;10500;14850;10500;14850;0;0;2;2</value></prop></node>
-<node oor:name="L235" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4698 SuperPrint weiße Folie</value></prop>
+<node oor:name="L235" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4698 SuperPrint weiße Folie</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L236" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4810 InkPrint Special weiß</value></prop>
+<node oor:name="L236" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4810 InkPrint Special weiß</value></prop>
<prop oor:name="Measure"><value>S;3810;2120;3810;2120;975;1070;5;13</value></prop></node>
-<node oor:name="L237" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4811 InkPrint Special weiß</value></prop>
+<node oor:name="L237" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4811 InkPrint Special weiß</value></prop>
<prop oor:name="Measure"><value>S;4826;1693;4826;1693;848;1303;4;16</value></prop></node>
-<node oor:name="L238" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4812 InkPrint Special weiß</value></prop>
+<node oor:name="L238" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4812 InkPrint Special weiß</value></prop>
<prop oor:name="Measure"><value>S;4826;2540;4826;2540;848;880;4;11</value></prop></node>
-<node oor:name="L239" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4814 InkPrint Special weiß</value></prop>
+<node oor:name="L239" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4814 InkPrint Special weiß</value></prop>
<prop oor:name="Measure"><value>S;6600;3387;6600;3387;600;1303;3;8</value></prop></node>
-<node oor:name="L240" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4815 InkPrint Special weiß</value></prop>
+<node oor:name="L240" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4815 InkPrint Special weiß</value></prop>
<prop oor:name="Measure"><value>S;9652;3387;9652;3387;848;1303;2;8</value></prop></node>
-<node oor:name="L241" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4816 InkPrint Special weiß</value></prop>
+<node oor:name="L241" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4816 InkPrint Special weiß</value></prop>
<prop oor:name="Measure"><value>S;9652;4230;9652;4230;848;2150;2;6</value></prop></node>
-<node oor:name="L242" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4817 InkPrint Special weiß</value></prop>
+<node oor:name="L242" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4817 InkPrint Special weiß</value></prop>
<prop oor:name="Measure"><value>S;9652;6773;9652;6773;848;1303;2;4</value></prop></node>
-<node oor:name="L243" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4819 InkPrint Special weiß</value></prop>
+<node oor:name="L243" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4819 InkPrint Special weiß</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L244" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4820 InkPrint Special weiß</value></prop>
+<node oor:name="L244" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4820 InkPrint Special weiß</value></prop>
<prop oor:name="Measure"><value>S;6600;3387;6600;3387;600;1303;3;8</value></prop></node>
-<node oor:name="L245" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4821 InkPrint Special 3,5"-Disketten, weiß</value></prop>
+<node oor:name="L245" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4821 InkPrint Special 3,5"-Disketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;6600;6773;6600;6773;600;1303;3;4</value></prop></node>
-<node oor:name="L246" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4822 InkPrint Special weiß</value></prop>
+<node oor:name="L246" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4822 InkPrint Special weiß</value></prop>
<prop oor:name="Measure"><value>S;9652;3387;9652;3387;848;1303;2;8</value></prop></node>
-<node oor:name="L247" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4823 InkPrint Special weiß</value></prop>
+<node oor:name="L247" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4823 InkPrint Special weiß</value></prop>
<prop oor:name="Measure"><value>S;9652;4230;9652;4230;848;2150;2;6</value></prop></node>
-<node oor:name="L248" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4824 InkPrint Special weiß</value></prop>
+<node oor:name="L248" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4824 InkPrint Special weiß</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L249" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4825 InkPrint Special für schmale Ordner, weiß</value></prop>
+<node oor:name="L249" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4825 InkPrint Special für schmale Ordner, weiß</value></prop>
<prop oor:name="Measure"><value>S;19200;3800;19200;3800;900;1550;1;7</value></prop></node>
-<node oor:name="L250" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4826 InkPrint Special für breite Ordner, weiß</value></prop>
+<node oor:name="L250" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4826 InkPrint Special für breite Ordner, weiß</value></prop>
<prop oor:name="Measure"><value>S;19200;6100;19200;6100;900;2650;1;4</value></prop></node>
-<node oor:name="L251" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4827 InkPrint Special Videocassette, Rücken, weiß</value></prop>
+<node oor:name="L251" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4827 InkPrint Special Videocassette, Rücken, weiß</value></prop>
<prop oor:name="Measure"><value>S;14732;2000;14732;2000;3134;1850;1;13</value></prop></node>
-<node oor:name="L252" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4828 InkPrint Special Videocassette, Front, weiß</value></prop>
+<node oor:name="L252" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4828 InkPrint Special Videocassette, Front, weiß</value></prop>
<prop oor:name="Measure"><value>S;8128;4656;7874;4656;2499;882;2;6</value></prop></node>
-<node oor:name="L253" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4829 InkPrint Special Diabeschriftung, weiß</value></prop>
+<node oor:name="L253" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4829 InkPrint Special Diabeschriftung, weiß</value></prop>
<prop oor:name="Measure"><value>S;4572;847;4318;847;1483;1298;4;32</value></prop></node>
-<node oor:name="L254" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4830 InkPrint Special für schmale Ordner, lang, weiß</value></prop>
+<node oor:name="L254" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4830 InkPrint Special für schmale Ordner, lang, weiß</value></prop>
<prop oor:name="Measure"><value>S;3800;29700;3800;29700;1000;0;5;1</value></prop></node>
-<node oor:name="L255" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4831 InkPrint Special für breite Ordner, lang, weiß</value></prop>
+<node oor:name="L255" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4831 InkPrint Special für breite Ordner, lang, weiß</value></prop>
<prop oor:name="Measure"><value>S;6100;29700;6100;29700;1350;0;3;1</value></prop></node>
-<node oor:name="L256" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4841 InkPrint Special transparente Folie</value></prop>
+<node oor:name="L256" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4841 InkPrint Special transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;4826;2540;4826;2540;848;880;4;11</value></prop></node>
-<node oor:name="L257" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4842 InkPrint Special transparente Folie</value></prop>
+<node oor:name="L257" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4842 InkPrint Special transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;6600;3387;6600;3387;600;1303;3;8</value></prop></node>
-<node oor:name="L258" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4843 InkPrint Special transparente Folie</value></prop>
+<node oor:name="L258" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4843 InkPrint Special transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;9652;4233;9652;4233;848;2150;2;6</value></prop></node>
-<node oor:name="L259" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4844 InkPrint Special transparente Folie, A4</value></prop>
+<node oor:name="L259" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4844 InkPrint Special transparente Folie, A4</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L260" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4845 InkPrint Special transparente Folie</value></prop>
+<node oor:name="L260" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4845 InkPrint Special transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;4826;2116,7;4572;2116,7;975;2150;4;12</value></prop></node>
-<node oor:name="L261" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4846 InkPrint Special transparente Folie</value></prop>
+<node oor:name="L261" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4846 InkPrint Special transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;6604;2963,3;6350;2963,3;721;1515;3;9</value></prop></node>
-<node oor:name="L262" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4847 InkPrint Special transparente Folie</value></prop>
+<node oor:name="L262" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4847 InkPrint Special transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;9854;5080;9600;5080;773;2150;2;5</value></prop></node>
-<node oor:name="L263" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4848 InkPrint Special CD-Etikett, transparente Folie</value></prop>
+<node oor:name="L263" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4848 InkPrint Special CD-Etikett, transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;11600;14800;11600;11600;4700;1650;1;2</value></prop></node>
-<node oor:name="L264" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4851 InkPrint Special weiße Folie</value></prop>
+<node oor:name="L264" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4851 InkPrint Special weiße Folie</value></prop>
<prop oor:name="Measure"><value>S;4826;2540;4826;2540;848;880;4;11</value></prop></node>
-<node oor:name="L265" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4852 InkPrint Special weiße Folie</value></prop>
+<node oor:name="L265" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4852 InkPrint Special weiße Folie</value></prop>
<prop oor:name="Measure"><value>S;6600;3387;6600;3387;600;1303;3;8</value></prop></node>
-<node oor:name="L266" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4853 InkPrint Special weiße Folie</value></prop>
+<node oor:name="L266" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4853 InkPrint Special weiße Folie</value></prop>
<prop oor:name="Measure"><value>S;9652;4233;9652;4233;848;2150;2;6</value></prop></node>
-<node oor:name="L267" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4854 InkPrint Special weiße Folie, A4</value></prop>
+<node oor:name="L267" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4854 InkPrint Special weiße Folie, A4</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L268" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4864 InkPrint Special wetterfeste Folie, weiß</value></prop>
+<node oor:name="L268" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4864 InkPrint Special wetterfeste Folie, weiß</value></prop>
<prop oor:name="Measure"><value>S;6604;2963,3;6350;2963,3;721;1515;3;9</value></prop></node>
-<node oor:name="L269" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4865 InkPrint Special wetterfeste Folie, weiß</value></prop>
+<node oor:name="L269" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4865 InkPrint Special wetterfeste Folie, weiß</value></prop>
<prop oor:name="Measure"><value>S;9854;13970;9600;13970;773;880;2;2</value></prop></node>
-<node oor:name="L270" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4866 InkPrint Special wetterfeste Folie, weiß</value></prop>
+<node oor:name="L270" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4866 InkPrint Special wetterfeste Folie, weiß</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L271" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4867 InkPrint Special wetterfeste Folie, weiß, oval</value></prop>
+<node oor:name="L271" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4867 InkPrint Special wetterfeste Folie, weiß, oval</value></prop>
<prop oor:name="Measure"><value>S;9398;6773;8890;6350;1356;1515;2;4</value></prop></node>
-<node oor:name="L272" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5051 SuperPrint weiß</value></prop>
+<node oor:name="L272" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5051 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;4826;2540;4826;2540;848;880;4;11</value></prop></node>
-<node oor:name="L273" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5052 SuperPrint weiß</value></prop>
+<node oor:name="L273" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5052 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;5250;2120;5250;2120;0;0;4;14</value></prop></node>
-<node oor:name="L274" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5053 SuperPrint weiß</value></prop>
+<node oor:name="L274" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5053 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;6600;3387;6600;3387;600;1303;3;8</value></prop></node>
-<node oor:name="L275" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5054 SuperPrint weiß</value></prop>
+<node oor:name="L275" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5054 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;4243;7000;4243;0;0;3;7</value></prop></node>
-<node oor:name="L276" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5055 SuperPrint 3,5"-Disketten, weiß</value></prop>
+<node oor:name="L276" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5055 SuperPrint 3,5"-Disketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;5080;7000;5080;0;2150;3;5</value></prop></node>
-<node oor:name="L277" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5056 SuperPrint weiß</value></prop>
+<node oor:name="L277" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5056 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;9652;4233;9652;4233;850;2151;2;6</value></prop></node>
-<node oor:name="L278" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5057 SuperPrint weiß</value></prop>
+<node oor:name="L278" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5057 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;4243;10500;4243;0;0;2;7</value></prop></node>
-<node oor:name="L279" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5058 SuperPrint gelb</value></prop>
+<node oor:name="L279" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5058 SuperPrint gelb</value></prop>
<prop oor:name="Measure"><value>S;10500;4243;10500;4243;0;0;2;7</value></prop></node>
-<node oor:name="L280" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5059 SuperPrint rot</value></prop>
+<node oor:name="L280" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5059 SuperPrint rot</value></prop>
<prop oor:name="Measure"><value>S;10500;4243;10500;4243;0;0;2;7</value></prop></node>
-<node oor:name="L281" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5060 SuperPrint blau</value></prop>
+<node oor:name="L281" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5060 SuperPrint blau</value></prop>
<prop oor:name="Measure"><value>S;10500;4243;10500;4243;0;0;2;7</value></prop></node>
-<node oor:name="L282" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5061 SuperPrint grün</value></prop>
+<node oor:name="L282" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5061 SuperPrint grün</value></prop>
<prop oor:name="Measure"><value>S;10500;4243;10500;4243;0;0;2;7</value></prop></node>
-<node oor:name="L283" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5062 SuperPrint weiß</value></prop>
+<node oor:name="L283" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5062 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;10500;7425;10500;7425;0;0;2;4</value></prop></node>
-<node oor:name="L284" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5063 SuperPrint weiß, A6</value></prop>
+<node oor:name="L284" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5063 SuperPrint weiß, A6</value></prop>
<prop oor:name="Measure"><value>S;10500;14850;10500;14850;0;0;2;2</value></prop></node>
-<node oor:name="L285" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5064 SuperPrint weiß, A5</value></prop>
+<node oor:name="L285" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5064 SuperPrint weiß, A5</value></prop>
<prop oor:name="Measure"><value>S;21000;14850;21000;14850;0;0;1;2</value></prop></node>
-<node oor:name="L286" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5065 SuperPrint weiß, A4</value></prop>
+<node oor:name="L286" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5065 SuperPrint weiß, A4</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L287" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5066 SuperPrint Kreise 40 mm, weiß</value></prop>
+<node oor:name="L287" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5066 SuperPrint Kreise 40 mm, weiß</value></prop>
<prop oor:name="Measure"><value>S;4600;4600;4000;4000;1600;1350;4;6</value></prop></node>
-<node oor:name="L288" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5067 SuperPrint Kreise 60 mm, weiß</value></prop>
+<node oor:name="L288" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5067 SuperPrint Kreise 60 mm, weiß</value></prop>
<prop oor:name="Measure"><value>S;6700;6700;6000;6000;800;1800;3;4</value></prop></node>
-<node oor:name="L289" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5068 SuperPrint Kreise 85 mm, weiß</value></prop>
+<node oor:name="L289" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5068 SuperPrint Kreise 85 mm, weiß</value></prop>
<prop oor:name="Measure"><value>S;9500;9500;8500;8500;1500;1100;2;3</value></prop></node>
-<node oor:name="L290" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5069 SuperPrint Videocassette, Rücken, weiß</value></prop>
+<node oor:name="L290" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5069 SuperPrint Videocassette, Rücken, weiß</value></prop>
<prop oor:name="Measure"><value>S;14732;2000;14732;2000;3134;1850;1;13</value></prop></node>
-<node oor:name="L291" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5070 SuperPrint Videocassette, Front, weiß</value></prop>
+<node oor:name="L291" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5070 SuperPrint Videocassette, Front, weiß</value></prop>
<prop oor:name="Measure"><value>S;8128;4656;7874;4656;2499;882;2;6</value></prop></node>
-<node oor:name="L292" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5071 SuperPrint Diabeschriftung, weiß</value></prop>
+<node oor:name="L292" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5071 SuperPrint Diabeschriftung, weiß</value></prop>
<prop oor:name="Measure"><value>S;4572;847;4318;847;1483;1298;4;32</value></prop></node>
-<node oor:name="L293" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5072 SuperPrint Pfeile, gelb</value></prop>
+<node oor:name="L293" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5072 SuperPrint Pfeile, gelb</value></prop>
<prop oor:name="Measure"><value>S;9652;4656;9144;2540;1102;1938;2;6</value></prop></node>
-<node oor:name="L294" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5073 SuperPrint Pfeile, rot</value></prop>
+<node oor:name="L294" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5073 SuperPrint Pfeile, rot</value></prop>
<prop oor:name="Measure"><value>S;9652;4656;9144;2540;1102;1938;2;6</value></prop></node>
-<node oor:name="L295" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5074 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
+<node oor:name="L295" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5074 SuperPrint weiß, Ecken abgerundet, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;6604;3810;6350;3810;721;1515;3;7</value></prop></node>
-<node oor:name="L296" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5075 SuperPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L296" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5075 SuperPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;10160;3387;9906;3387;467;1303;2;8</value></prop></node>
-<node oor:name="L297" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5076 SuperPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L297" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5076 SuperPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;10160;3810;9906;3810;467;1515;2;7</value></prop></node>
-<node oor:name="L298" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5077 SuperPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L298" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5077 SuperPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;10160;6773;9906;6773;467;1303;2;4</value></prop></node>
-<node oor:name="L299" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5078 SuperPrint CD-Box-Etiketten, weiß</value></prop>
+<node oor:name="L299" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5078 SuperPrint CD-Box-Etiketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;11430;550;11430;550;4785;1650;1;48</value></prop></node>
-<node oor:name="L300" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5079 SuperPrint CD-Etikett, weiß</value></prop>
+<node oor:name="L300" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5079 SuperPrint CD-Etikett, weiß</value></prop>
<prop oor:name="Measure"><value>S;11600;14800;11600;11600;4700;1650;1;2</value></prop></node>
-<node oor:name="L301" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5080 SuperPrint weiß, ablösbar</value></prop>
+<node oor:name="L301" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5080 SuperPrint weiß, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;5250;2120;5250;2120;0;0;4;14</value></prop></node>
-<node oor:name="L302" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5081 SuperPrint weiß, ablösbar</value></prop>
+<node oor:name="L302" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5081 SuperPrint weiß, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;10500;4243;10500;4243;0;0;2;7</value></prop></node>
-<node oor:name="L303" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5082 SuperPrint weiß, ablösbar</value></prop>
+<node oor:name="L303" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5082 SuperPrint weiß, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;10500;14850;10500;14850;0;0;2;2</value></prop></node>
-<node oor:name="L304" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5083 SuperPrint CD-Etikett, gelb</value></prop>
+<node oor:name="L304" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5083 SuperPrint CD-Etikett, gelb</value></prop>
<prop oor:name="Measure"><value>S;11600;14800;11600;11600;4700;1650;1;2</value></prop></node>
-<node oor:name="L305" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5084 SuperPrint CD-Etikett, rot</value></prop>
+<node oor:name="L305" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5084 SuperPrint CD-Etikett, rot</value></prop>
<prop oor:name="Measure"><value>S;11600;14800;11600;11600;4700;1650;1;2</value></prop></node>
-<node oor:name="L306" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5085 SuperPrint CD-Etikett, blau</value></prop>
+<node oor:name="L306" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5085 SuperPrint CD-Etikett, blau</value></prop>
<prop oor:name="Measure"><value>S;11600;14800;11600;11600;4700;1650;1;2</value></prop></node>
-<node oor:name="L307" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5086 SuperPrint CD-Etikett, grün</value></prop>
+<node oor:name="L307" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5086 SuperPrint CD-Etikett, grün</value></prop>
<prop oor:name="Measure"><value>S;11600;14800;11600;11600;4700;1650;1;2</value></prop></node>
-<node oor:name="L308" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5087 SuperPrint ZIP-Disketten, weiß</value></prop>
+<node oor:name="L308" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5087 SuperPrint ZIP-Disketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;6175;5000;5900;5000;1375;2350;3;5</value></prop></node>
-<node oor:name="L309" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5088 SuperPrint für schmale Ordner, farbig sort.</value></prop>
+<node oor:name="L309" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5088 SuperPrint für schmale Ordner, farbig sort.</value></prop>
<prop oor:name="Measure"><value>S;19200;3800;19200;3800;900;1550;1;7</value></prop></node>
-<node oor:name="L310" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5089 SuperPrint für breite Ordner, farbig sort.</value></prop>
+<node oor:name="L310" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5089 SuperPrint für breite Ordner, farbig sort.</value></prop>
<prop oor:name="Measure"><value>S;19200;6100;19200;6100;900;2650;1;4</value></prop></node>
-<node oor:name="L311" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5090 SuperPrint für schmale Ordner, weiß</value></prop>
+<node oor:name="L311" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5090 SuperPrint für schmale Ordner, weiß</value></prop>
<prop oor:name="Measure"><value>S;19200;3800;19200;3800;900;1550;1;7</value></prop></node>
-<node oor:name="L312" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5091 SuperPrint für schmale Ordner, gelb</value></prop>
+<node oor:name="L312" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5091 SuperPrint für schmale Ordner, gelb</value></prop>
<prop oor:name="Measure"><value>S;19200;3800;19200;3800;900;1550;1;7</value></prop></node>
-<node oor:name="L313" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5092 SuperPrint für schmale Ordner, rot</value></prop>
+<node oor:name="L313" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5092 SuperPrint für schmale Ordner, rot</value></prop>
<prop oor:name="Measure"><value>S;19200;3800;19200;3800;900;1550;1;7</value></prop></node>
-<node oor:name="L314" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5093 SuperPrint für schmale Ordner, blau</value></prop>
+<node oor:name="L314" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5093 SuperPrint für schmale Ordner, blau</value></prop>
<prop oor:name="Measure"><value>S;19200;3800;19200;3800;900;1550;1;7</value></prop></node>
-<node oor:name="L315" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5094 SuperPrint für schmale Ordner, grün</value></prop>
+<node oor:name="L315" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5094 SuperPrint für schmale Ordner, grün</value></prop>
<prop oor:name="Measure"><value>S;19200;3800;19200;3800;900;1550;1;7</value></prop></node>
-<node oor:name="L316" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5095 SuperPrint für breite Ordner, weiß</value></prop>
+<node oor:name="L316" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5095 SuperPrint für breite Ordner, weiß</value></prop>
<prop oor:name="Measure"><value>S;19200;6100;19200;6100;900;2650;1;4</value></prop></node>
-<node oor:name="L317" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5096 SuperPrint für breite Ordner, gelb</value></prop>
+<node oor:name="L317" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5096 SuperPrint für breite Ordner, gelb</value></prop>
<prop oor:name="Measure"><value>S;19200;6100;19200;6100;900;2650;1;4</value></prop></node>
-<node oor:name="L318" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5097 SuperPrint für breite Ordner, rot</value></prop>
+<node oor:name="L318" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5097 SuperPrint für breite Ordner, rot</value></prop>
<prop oor:name="Measure"><value>S;19200;6100;19200;6100;900;2650;1;4</value></prop></node>
-<node oor:name="L319" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5098 SuperPrint für breite Ordner, blau</value></prop>
+<node oor:name="L319" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5098 SuperPrint für breite Ordner, blau</value></prop>
<prop oor:name="Measure"><value>S;19200;6100;19200;6100;900;2650;1;4</value></prop></node>
-<node oor:name="L320" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5099 SuperPrint für breite Ordner, grün</value></prop>
+<node oor:name="L320" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5099 SuperPrint für breite Ordner, grün</value></prop>
<prop oor:name="Measure"><value>S;19200;6100;19200;6100;900;2650;1;4</value></prop></node>
-<node oor:name="L321" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5123 SuperPrint für breite Ordner, weiß</value></prop>
+<node oor:name="L321" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5123 SuperPrint für breite Ordner, weiß</value></prop>
<prop oor:name="Measure"><value>S;19200;5900;19200;5900;900;3050;1;4</value></prop></node>
-<node oor:name="L322" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5124 SuperPrint für breite Ordner, gelb</value></prop>
+<node oor:name="L322" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5124 SuperPrint für breite Ordner, gelb</value></prop>
<prop oor:name="Measure"><value>S;19200;5900;19200;5900;900;3050;1;4</value></prop></node>
-<node oor:name="L323" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5125 SuperPrint für breite Ordner, rot</value></prop>
+<node oor:name="L323" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5125 SuperPrint für breite Ordner, rot</value></prop>
<prop oor:name="Measure"><value>S;19200;5900;19200;5900;900;3050;1;4</value></prop></node>
-<node oor:name="L324" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5126 SuperPrint für breite Ordner, blau</value></prop>
+<node oor:name="L324" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5126 SuperPrint für breite Ordner, blau</value></prop>
<prop oor:name="Measure"><value>S;19200;5900;19200;5900;900;3050;1;4</value></prop></node>
-<node oor:name="L325" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5127 SuperPrint für breite Ordner, grün</value></prop>
+<node oor:name="L325" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5127 SuperPrint für breite Ordner, grün</value></prop>
<prop oor:name="Measure"><value>S;19200;5900;19200;5900;900;3050;1;4</value></prop></node>
-<node oor:name="L326" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5128 SuperPrint für schmale Ordner, lang, farbig sort.</value></prop>
+<node oor:name="L326" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5128 SuperPrint für schmale Ordner, lang, farbig sort.</value></prop>
<prop oor:name="Measure"><value>S;3800;29700;3800;29700;1000;0;5;1</value></prop></node>
-<node oor:name="L327" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5129 SuperPrint für breite Ordner, lang, farbig sort.</value></prop>
+<node oor:name="L327" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5129 SuperPrint für breite Ordner, lang, farbig sort.</value></prop>
<prop oor:name="Measure"><value>S;6100;29700;6100;29700;1350;0;3;1</value></prop></node>
-<node oor:name="L328" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5130 SuperPrint für schmale Ordner, lang, weiß</value></prop>
+<node oor:name="L328" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5130 SuperPrint für schmale Ordner, lang, weiß</value></prop>
<prop oor:name="Measure"><value>S;3800;29700;3800;29700;1000;0;5;1</value></prop></node>
-<node oor:name="L329" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5131 SuperPrint für schmale Ordner, lang, gelb</value></prop>
+<node oor:name="L329" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5131 SuperPrint für schmale Ordner, lang, gelb</value></prop>
<prop oor:name="Measure"><value>S;3800;29700;3800;29700;1000;0;5;1</value></prop></node>
-<node oor:name="L330" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5132 SuperPrint für schmale Ordner, lang, rot</value></prop>
+<node oor:name="L330" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5132 SuperPrint für schmale Ordner, lang, rot</value></prop>
<prop oor:name="Measure"><value>S;3800;29700;3800;29700;1000;0;5;1</value></prop></node>
-<node oor:name="L331" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5133 SuperPrint für schmale Ordner, lang, blau</value></prop>
+<node oor:name="L331" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5133 SuperPrint für schmale Ordner, lang, blau</value></prop>
<prop oor:name="Measure"><value>S;3800;29700;3800;29700;1000;0;5;1</value></prop></node>
-<node oor:name="L332" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5134 SuperPrint für schmale Ordner, lang, grün</value></prop>
+<node oor:name="L332" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5134 SuperPrint für schmale Ordner, lang, grün</value></prop>
<prop oor:name="Measure"><value>S;3800;29700;3800;29700;1000;0;5;1</value></prop></node>
-<node oor:name="L333" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5135 SuperPrint für breite Ordner, lang, weiß</value></prop>
+<node oor:name="L333" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5135 SuperPrint für breite Ordner, lang, weiß</value></prop>
<prop oor:name="Measure"><value>S;6100;29700;6100;29700;1350;0;3;1</value></prop></node>
-<node oor:name="L334" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5136 SuperPrint für breite Ordner, lang, gelb</value></prop>
+<node oor:name="L334" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5136 SuperPrint für breite Ordner, lang, gelb</value></prop>
<prop oor:name="Measure"><value>S;6100;29700;6100;29700;1350;0;3;1</value></prop></node>
-<node oor:name="L335" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5137 SuperPrint für breite Ordner, lang, rot</value></prop>
+<node oor:name="L335" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5137 SuperPrint für breite Ordner, lang, rot</value></prop>
<prop oor:name="Measure"><value>S;6100;29700;6100;29700;1350;0;3;1</value></prop></node>
-<node oor:name="L336" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5138 SuperPrint für breite Ordner, lang, blau</value></prop>
+<node oor:name="L336" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5138 SuperPrint für breite Ordner, lang, blau</value></prop>
<prop oor:name="Measure"><value>S;6100;29700;6100;29700;1350;0;3;1</value></prop></node>
-<node oor:name="L337" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5139 SuperPrint für breite Ordner, lang, grün</value></prop>
+<node oor:name="L337" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5139 SuperPrint für breite Ordner, lang, grün</value></prop>
<prop oor:name="Measure"><value>S;6100;29700;6100;29700;1350;0;3;1</value></prop></node>
-<node oor:name="L338" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5140 SuperPrint neon-gelb</value></prop>
+<node oor:name="L338" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5140 SuperPrint neon-gelb</value></prop>
<prop oor:name="Measure"><value>S;6604;2963,3;6350;2963,3;721;1515;3;9</value></prop></node>
-<node oor:name="L339" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5141 SuperPrint neon-orange</value></prop>
+<node oor:name="L339" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5141 SuperPrint neon-orange</value></prop>
<prop oor:name="Measure"><value>S;6604;2963,3;6350;2963,3;721;1515;3;9</value></prop></node>
-<node oor:name="L340" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5142 SuperPrint neon-pink</value></prop>
+<node oor:name="L340" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5142 SuperPrint neon-pink</value></prop>
<prop oor:name="Measure"><value>S;6604;2963,3;6350;2963,3;721;1515;3;9</value></prop></node>
-<node oor:name="L341" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5143 SuperPrint neon-grün</value></prop>
+<node oor:name="L341" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5143 SuperPrint neon-grün</value></prop>
<prop oor:name="Measure"><value>S;6604;2963,3;6350;2963,3;721;1515;3;9</value></prop></node>
-<node oor:name="L342" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5144 SuperPrint neon-gelb</value></prop>
+<node oor:name="L342" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5144 SuperPrint neon-gelb</value></prop>
<prop oor:name="Measure"><value>S;10160;6773;9906;6773;467;1303;2;4</value></prop></node>
-<node oor:name="L343" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5145 SuperPrint neon-orange</value></prop>
+<node oor:name="L343" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5145 SuperPrint neon-orange</value></prop>
<prop oor:name="Measure"><value>S;10160;6773;9906;6773;467;1303;2;4</value></prop></node>
-<node oor:name="L344" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5146 SuperPrint neon-pink</value></prop>
+<node oor:name="L344" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5146 SuperPrint neon-pink</value></prop>
<prop oor:name="Measure"><value>S;10160;6773;9906;6773;467;1303;2;4</value></prop></node>
-<node oor:name="L345" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5147 SuperPrint neon-grün</value></prop>
+<node oor:name="L345" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5147 SuperPrint neon-grün</value></prop>
<prop oor:name="Measure"><value>S;10160;6773;9906;6773;467;1303;2;4</value></prop></node>
-<node oor:name="L346" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5148 SuperPrint neon-gelb, A4</value></prop>
+<node oor:name="L346" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5148 SuperPrint neon-gelb, A4</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L347" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5149 SuperPrint neon-orange, A4</value></prop>
+<node oor:name="L347" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5149 SuperPrint neon-orange, A4</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L348" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5150 SuperPrint neon-pink, A4</value></prop>
+<node oor:name="L348" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5150 SuperPrint neon-pink, A4</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L349" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5151 SuperPrint neon-grün, A4</value></prop>
+<node oor:name="L349" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5151 SuperPrint neon-grün, A4</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L350" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5152 SuperPrint neon-gelb, Kreise 60 mm</value></prop>
+<node oor:name="L350" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5152 SuperPrint neon-gelb, Kreise 60 mm</value></prop>
<prop oor:name="Measure"><value>S;6700;6700;6000;6000;800;1800;3;4</value></prop></node>
-<node oor:name="L351" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5153 SuperPrint neon-orange, Kreise 60 mm</value></prop>
+<node oor:name="L351" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5153 SuperPrint neon-orange, Kreise 60 mm</value></prop>
<prop oor:name="Measure"><value>S;6700;6700;6000;6000;800;1800;3;4</value></prop></node>
-<node oor:name="L352" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5154 SuperPrint neon-pink, Kreise 60 mm</value></prop>
+<node oor:name="L352" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5154 SuperPrint neon-pink, Kreise 60 mm</value></prop>
<prop oor:name="Measure"><value>S;6700;6700;6000;6000;800;1800;3;4</value></prop></node>
-<node oor:name="L353" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5155 SuperPrint neon-grün, Kreise 60 mm</value></prop>
+<node oor:name="L353" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5155 SuperPrint neon-grün, Kreise 60 mm</value></prop>
<prop oor:name="Measure"><value>S;6700;6700;6000;6000;800;1800;3;4</value></prop></node>
-<node oor:name="L354" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5158 SuperPrint für schmale Ordner, lang, weiß</value></prop>
+<node oor:name="L354" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5158 SuperPrint für schmale Ordner, lang, weiß</value></prop>
<prop oor:name="Measure"><value>S;3400;29700;3400;29700;2000;0;5;1</value></prop></node>
-<node oor:name="L355" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5159 SuperPrint für breite Ordner, lang, weiß</value></prop>
+<node oor:name="L355" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5159 SuperPrint für breite Ordner, lang, weiß</value></prop>
<prop oor:name="Measure"><value>S;5900;29700;5900;29700;1650;0;3;1</value></prop></node>
-<node oor:name="L356" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5160 SuperPrint für schmale Ordner, weiß</value></prop>
+<node oor:name="L356" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5160 SuperPrint für schmale Ordner, weiß</value></prop>
<prop oor:name="Measure"><value>S;19200;3400;19200;3400;900;1250;1;8</value></prop></node>
-<node oor:name="L357" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5161 SuperPrint für schmale Ordner, gelb</value></prop>
+<node oor:name="L357" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5161 SuperPrint für schmale Ordner, gelb</value></prop>
<prop oor:name="Measure"><value>S;19200;3400;19200;3400;900;1250;1;8</value></prop></node>
-<node oor:name="L358" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5162 SuperPrint für schmale Ordner, rot</value></prop>
+<node oor:name="L358" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5162 SuperPrint für schmale Ordner, rot</value></prop>
<prop oor:name="Measure"><value>S;19200;3400;19200;3400;900;1250;1;8</value></prop></node>
-<node oor:name="L359" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5163 SuperPrint für schmale Ordner, blau</value></prop>
+<node oor:name="L359" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5163 SuperPrint für schmale Ordner, blau</value></prop>
<prop oor:name="Measure"><value>S;19200;3400;19200;3400;900;1250;1;8</value></prop></node>
-<node oor:name="L360" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5164 SuperPrint für schmale Ordner, grün</value></prop>
+<node oor:name="L360" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5164 SuperPrint für schmale Ordner, grün</value></prop>
<prop oor:name="Measure"><value>S;19200;3400;19200;3400;900;1250;1;8</value></prop></node>
-<node oor:name="L361" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5165 SuperPrint für schmale Hängeordner, weiß</value></prop>
+<node oor:name="L361" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5165 SuperPrint für schmale Hängeordner, weiß</value></prop>
<prop oor:name="Measure"><value>S;3400;29700;3400;29700;2000;0;5;1</value></prop></node>
-<node oor:name="L362" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5166 SuperPrint für breite Hängeordner, weiß</value></prop>
+<node oor:name="L362" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5166 SuperPrint für breite Hängeordner, weiß</value></prop>
<prop oor:name="Measure"><value>S;5800;29700;5800;29700;1800;0;3;1</value></prop></node>
-<node oor:name="L363" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5167 SuperPrint für breite Hängeordner, weiß</value></prop>
+<node oor:name="L363" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5167 SuperPrint für breite Hängeordner, weiß</value></prop>
<prop oor:name="Measure"><value>S;6300;29700;6300;29700;1050;0;3;1</value></prop></node>
-<node oor:name="L364" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8619 SuperPrint Mini-CD-Etiketten, weiß</value></prop>
+<node oor:name="L364" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8619 SuperPrint Mini-CD-Etiketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;9200;8950;7800;7800;2000;2000;2;3</value></prop></node>
-<node oor:name="L365" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8631 SuperPrint weiß</value></prop>
+<node oor:name="L365" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8631 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;4826;2540;4826;2540;848;880;4;11</value></prop></node>
-<node oor:name="L366" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8632 SuperPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L366" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8632 SuperPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;6604;3810;6350;3810;721;1515;3;7</value></prop></node>
-<node oor:name="L367" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8633 SuperPrint weiß</value></prop>
+<node oor:name="L367" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8633 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;6600;3387;6600;3387;600;1303;3;8</value></prop></node>
-<node oor:name="L368" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8634 SuperPrint weiß</value></prop>
+<node oor:name="L368" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8634 SuperPrint weiß</value></prop>
<prop oor:name="Measure"><value>S;7000;4243;7000;4243;0;0;3;7</value></prop></node>
-<node oor:name="L369" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8635 SuperPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L369" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8635 SuperPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;10160;3810;9906;3810;467;1515;2;7</value></prop></node>
-<node oor:name="L370" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8636 SuperPrint weiß, A5</value></prop>
+<node oor:name="L370" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8636 SuperPrint weiß, A5</value></prop>
<prop oor:name="Measure"><value>S;21000;14850;21000;14850;0;0;1;2</value></prop></node>
-<node oor:name="L371" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8637 SuperPrint weiß, A4</value></prop>
+<node oor:name="L371" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8637 SuperPrint weiß, A4</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L372" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8650 ColorPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L372" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8650 ColorPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;6604;3810;6350;3810;721;1515;3;7</value></prop></node>
-<node oor:name="L373" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8651 ColorPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L373" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8651 ColorPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9652;3387;8890;3387;1229;1303;2;8</value></prop></node>
-<node oor:name="L374" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8652 ColorPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L374" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8652 ColorPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9652;4656;8890;4656;1229;882;2;6</value></prop></node>
-<node oor:name="L375" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8653 ColorPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L375" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8653 ColorPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9854;5080;9600;5080;773;2150;2;5</value></prop></node>
-<node oor:name="L376" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8654 ColorPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L376" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8654 ColorPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9854;13970;9600;13970;773;880;2;2</value></prop></node>
-<node oor:name="L377" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8655 ColorPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L377" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8655 ColorPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L378" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8680 ColorPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L378" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8680 ColorPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;6604;3810;6350;3810;721;1515;3;7</value></prop></node>
-<node oor:name="L379" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8681 ColorPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L379" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8681 ColorPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9652;4656;8890;4656;1229;882;2;6</value></prop></node>
-<node oor:name="L380" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8682 ColorPrint weiß, Ecken abgerundet</value></prop>
+<node oor:name="L380" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8682 ColorPrint weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L381" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8683 ColorPrint CD-Etikett, weiß</value></prop>
+<node oor:name="L381" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8683 ColorPrint CD-Etikett, weiß</value></prop>
<prop oor:name="Measure"><value>S;11600;14800;11600;11600;4700;1650;1;2</value></prop></node>
-<node oor:name="L382" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8800 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L382" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8800 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;6096;3387;5334;3387;1737;1303;3;8</value></prop></node>
-<node oor:name="L383" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8801 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L383" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8801 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;6604;3810;6350;3810;721;1515;3;7</value></prop></node>
-<node oor:name="L384" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8802 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L384" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8802 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;6604;4656;6350;4656;721;882;3;6</value></prop></node>
-<node oor:name="L385" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8803 InkPrint Special 3,5"-Disketten, weiß</value></prop>
+<node oor:name="L385" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8803 InkPrint Special 3,5"-Disketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;9000;5080;7000;5080;2500;2150;2;5</value></prop></node>
-<node oor:name="L386" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8804 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L386" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8804 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9652;3387;8890;3387;1229;1303;2;8</value></prop></node>
-<node oor:name="L387" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8805 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L387" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8805 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9652;4656;8890;4656;1229;882;2;6</value></prop></node>
-<node oor:name="L388" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8806 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L388" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8806 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9854;5080;9600;5080;773;2150;2;5</value></prop></node>
-<node oor:name="L389" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8807 InkPrint Special weiß, z.B. Paketadresse, ca. A6</value></prop>
+<node oor:name="L389" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8807 InkPrint Special weiß, z.B. Paketadresse, ca. A6</value></prop>
<prop oor:name="Measure"><value>S;9854;13970;9600;13970;773;880;2;2</value></prop></node>
-<node oor:name="L390" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8808 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L390" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8808 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;10160;3387;9906;3387;467;1303;2;8</value></prop></node>
-<node oor:name="L391" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8809 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L391" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8809 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;10160;3810;9906;3810;467;1515;2;7</value></prop></node>
-<node oor:name="L392" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8810 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L392" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8810 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;10160;6773;9906;6773;467;1303;2;4</value></prop></node>
-<node oor:name="L393" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8811 InkPrint Special weiß, ca. DIN A5</value></prop>
+<node oor:name="L393" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8811 InkPrint Special weiß, ca. DIN A5</value></prop>
<prop oor:name="Measure"><value>S;19200;13970;19200;13970;900;880;1;2</value></prop></node>
-<node oor:name="L394" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8830 InkPrint Special weiß, z.B. für Preisauszeichnung</value></prop>
+<node oor:name="L394" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8830 InkPrint Special weiß, z.B. für Preisauszeichnung</value></prop>
<prop oor:name="Measure"><value>S;2794;847;2540;847;848;1303;7;32</value></prop></node>
-<node oor:name="L395" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8831 InkPrint Special weiß, quadratisch</value></prop>
+<node oor:name="L395" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8831 InkPrint Special weiß, quadratisch</value></prop>
<prop oor:name="Measure"><value>S;3048;2540;2540;2540;1610;880;6;11</value></prop></node>
-<node oor:name="L396" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8832 InkPrint Special weiß, z.B. für Preisauszeichnung</value></prop>
+<node oor:name="L396" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8832 InkPrint Special weiß, z.B. für Preisauszeichnung</value></prop>
<prop oor:name="Measure"><value>S;3302;1693;3048;1693;721;1303;6;16</value></prop></node>
-<node oor:name="L397" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8833 InkPrint Special weiß</value></prop>
+<node oor:name="L397" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8833 InkPrint Special weiß</value></prop>
<prop oor:name="Measure"><value>S;3810;2120;3810;2120;975;1070;5;13</value></prop></node>
-<node oor:name="L398" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8834 InkPrint Special weiß</value></prop>
+<node oor:name="L398" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8834 InkPrint Special weiß</value></prop>
<prop oor:name="Measure"><value>S;4830;1693;4830;1693;840;1330;4;16</value></prop></node>
-<node oor:name="L399" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8835 InkPrint Special weiß</value></prop>
+<node oor:name="L399" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8835 InkPrint Special weiß</value></prop>
<prop oor:name="Measure"><value>S;4830;2540;4830;2540;840;880;4;11</value></prop></node>
-<node oor:name="L400" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8836 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L400" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8836 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;6096;3387;5334;3387;1737;1303;3;8</value></prop></node>
-<node oor:name="L401" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8837 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L401" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8837 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;6604;2540;6350;2540;721;880;3;11</value></prop></node>
-<node oor:name="L402" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8838 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L402" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8838 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;6604;3810;6350;3810;721;1515;3;7</value></prop></node>
-<node oor:name="L403" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8839 InkPrint Special 3,5"-Disketten, weiß</value></prop>
+<node oor:name="L403" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8839 InkPrint Special 3,5"-Disketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;9000;5080;7000;5080;2500;2150;2;5</value></prop></node>
-<node oor:name="L404" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8840 InkPrint Special weiß, Visitenkartenformat</value></prop>
+<node oor:name="L404" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8840 InkPrint Special weiß, Visitenkartenformat</value></prop>
<prop oor:name="Measure"><value>S;8890;5080;8382;5080;1864;2150;2;5</value></prop></node>
-<node oor:name="L405" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8841 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L405" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8841 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9652;3387;8890;3387;1229;1303;2;8</value></prop></node>
-<node oor:name="L406" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8842 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L406" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8842 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9652;4656;8890;4656;1229;882;2;6</value></prop></node>
-<node oor:name="L407" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8843 InkPrint Special weiß, z.B. für Regalbeschriftung</value></prop>
+<node oor:name="L407" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8843 InkPrint Special weiß, z.B. für Regalbeschriftung</value></prop>
<prop oor:name="Measure"><value>S;9854;847;9600;847;773;1303;2;32</value></prop></node>
-<node oor:name="L408" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8844 InkPrint Special weiß, z.B. für Regalbeschriftung</value></prop>
+<node oor:name="L408" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8844 InkPrint Special weiß, z.B. für Regalbeschriftung</value></prop>
<prop oor:name="Measure"><value>S;9854;1693;9600;1693;773;1303;2;16</value></prop></node>
-<node oor:name="L409" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8845 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L409" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8845 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9854;5080;9600;5080;773;2150;2;5</value></prop></node>
-<node oor:name="L410" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8846 InkPrint Special weiß</value></prop>
+<node oor:name="L410" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8846 InkPrint Special weiß</value></prop>
<prop oor:name="Measure"><value>S;9652;6773;9652;6773;848;1303;2;4</value></prop></node>
-<node oor:name="L411" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8847 InkPrint Special weiß, Paketadresse, ca. A6</value></prop>
+<node oor:name="L411" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8847 InkPrint Special weiß, Paketadresse, ca. A6</value></prop>
<prop oor:name="Measure"><value>S;9854;13970;9600;13970;773;880;2;2</value></prop></node>
-<node oor:name="L412" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8848 InkPrint Special weiß, z.B. für Regalbeschriftung</value></prop>
+<node oor:name="L412" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8848 InkPrint Special weiß, z.B. für Regalbeschriftung</value></prop>
<prop oor:name="Measure"><value>S;19200;847;19200;847;900;1303;1;32</value></prop></node>
-<node oor:name="L413" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8849 InkPrint Special weiß, z.B. für Regalbeschriftung</value></prop>
+<node oor:name="L413" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8849 InkPrint Special weiß, z.B. für Regalbeschriftung</value></prop>
<prop oor:name="Measure"><value>S;19200;1693;19200;1693;900;1303;1;16</value></prop></node>
-<node oor:name="L414" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8850 InkPrint Special weiß, ca. DIN A5</value></prop>
+<node oor:name="L414" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8850 InkPrint Special weiß, ca. DIN A5</value></prop>
<prop oor:name="Measure"><value>S;19200;13970;19200;13970;900;880;1;2</value></prop></node>
-<node oor:name="L415" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8851 InkPrint Special Kreise 32 mm, weiß</value></prop>
+<node oor:name="L415" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8851 InkPrint Special Kreise 32 mm, weiß</value></prop>
<prop oor:name="Measure"><value>S;3810;3810;3200;3200;1280;1820;5;7</value></prop></node>
-<node oor:name="L416" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8852 InkPrint Special Kreise 63,5 mm, weiß</value></prop>
+<node oor:name="L416" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8852 InkPrint Special Kreise 63,5 mm, weiß</value></prop>
<prop oor:name="Measure"><value>S;6604;6773;6350;6350;721;1516;3;4</value></prop></node>
-<node oor:name="L417" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8853 InkPrint Special Oval, weiß</value></prop>
+<node oor:name="L417" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8853 InkPrint Special Oval, weiß</value></prop>
<prop oor:name="Measure"><value>S;6350;4656;5842;4233;1229;1093;3;6</value></prop></node>
-<node oor:name="L418" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8854 InkPrint Special Oval, weiß</value></prop>
+<node oor:name="L418" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8854 InkPrint Special Oval, weiß</value></prop>
<prop oor:name="Measure"><value>S;9398;6773;8890;6350;1356;1515;2;4</value></prop></node>
-<node oor:name="L419" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8855 InkPrint Special abgeschrägte Ecken, weiß</value></prop>
+<node oor:name="L419" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8855 InkPrint Special abgeschrägte Ecken, weiß</value></prop>
<prop oor:name="Measure"><value>S;9652;6773;8890;6773;1229;1303;2;4</value></prop></node>
-<node oor:name="L420" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8856 InkPrint Special Registeretiketten, weiß</value></prop>
+<node oor:name="L420" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8856 InkPrint Special Registeretiketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;3048;4656;2540;4230;1610;1092;6;6</value></prop></node>
-<node oor:name="L421" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8857 InkPrint Special Sterne 63,5 mm, weiß</value></prop>
+<node oor:name="L421" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8857 InkPrint Special Sterne 63,5 mm, weiß</value></prop>
<prop oor:name="Measure"><value>S;6604;6773;6350;6350;721;1516;3;4</value></prop></node>
-<node oor:name="L422" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8858 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L422" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8858 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;6604;4656;6350;4656;721;882;3;6</value></prop></node>
-<node oor:name="L423" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8859 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L423" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8859 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;10160;3387;9906;3387;467;1303;2;8</value></prop></node>
-<node oor:name="L424" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8860 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L424" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8860 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;10160;3810;9906;3810;467;1515;2;7</value></prop></node>
-<node oor:name="L425" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8861 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L425" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8861 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;10160;5700;9906;5700;467;600;2;5</value></prop></node>
-<node oor:name="L426" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8862 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L426" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8862 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;10160;6773;9906;6773;467;1303;2;4</value></prop></node>
-<node oor:name="L427" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8863 InkPrint Special Kreise 40 mm, weiß</value></prop>
+<node oor:name="L427" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8863 InkPrint Special Kreise 40 mm, weiß</value></prop>
<prop oor:name="Measure"><value>S;4600;4600;4000;4000;1600;1350;4;6</value></prop></node>
-<node oor:name="L428" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8864 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L428" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8864 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;4826;2116,7;4572;2116,7;975;2150;4;12</value></prop></node>
-<node oor:name="L429" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8865 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L429" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8865 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;6604;2963,3;6350;2963,3;721;1515;3;9</value></prop></node>
-<node oor:name="L430" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8866 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L430" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8866 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9854;4233;9600;4233;773;2150;2;6</value></prop></node>
-<node oor:name="L431" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8867 InkPrint Special weiß, Ecken abgerundet</value></prop>
+<node oor:name="L431" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8867 InkPrint Special weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9854;6350;9600;6350;773;2150;2;4</value></prop></node>
-<node oor:name="L432" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8868 InkPrint Special Sonderform, weiß</value></prop>
+<node oor:name="L432" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8868 InkPrint Special Sonderform, weiß</value></prop>
<prop oor:name="Measure"><value>S;6604;4656,7;6350;4233;721;1093;3;6</value></prop></node>
-<node oor:name="L433" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8869 InkPrint Special Oval, weiß</value></prop>
+<node oor:name="L433" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8869 InkPrint Special Oval, weiß</value></prop>
<prop oor:name="Measure"><value>S;6604;4656,7;6350;4233;721;1093;3;6</value></prop></node>
-<node oor:name="L434" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8870 InkPrint Special Oval, weiß</value></prop>
+<node oor:name="L434" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8870 InkPrint Special Oval, weiß</value></prop>
<prop oor:name="Measure"><value>S;9854;6773;9600;6350;773;1515;2;4</value></prop></node>
-<node oor:name="L435" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8886 InkPrint Special Glossy-Qualität, Fotos 10x15, Two-in-one</value></prop>
+<node oor:name="L435" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8886 InkPrint Special Glossy-Qualität, Fotos 10x15, Two-in-one</value></prop>
<prop oor:name="Measure"><value>S;15000;14800;15000;10000;3000;2450;1;2</value></prop></node>
-<node oor:name="L436" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8887 InkPrint Special Glossy-Qualität, Paßfoto-Format, Two-in-one</value></prop>
+<node oor:name="L436" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8887 InkPrint Special Glossy-Qualität, Paßfoto-Format, Two-in-one</value></prop>
<prop oor:name="Measure"><value>S;4100;5100;3500;4500;2600;2400;4;5</value></prop></node>
-<node oor:name="L437" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8888 InkPrint Special Glossy-Qualität, CD-Cover-Etikett, weiß</value></prop>
+<node oor:name="L437" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8888 InkPrint Special Glossy-Qualität, CD-Cover-Etikett, weiß</value></prop>
<prop oor:name="Measure"><value>S;12150;14550;12150;11750;4425;1700;1;2</value></prop></node>
-<node oor:name="L438" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8889 InkPrint Special Glossy-Qualität,Visitenkartenetikett, weiß</value></prop>
+<node oor:name="L438" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8889 InkPrint Special Glossy-Qualität,Visitenkartenetikett, weiß</value></prop>
<prop oor:name="Measure"><value>S;9600;5500;8300;5200;1550;1250;2;5</value></prop></node>
-<node oor:name="L439" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8890 InkPrint Special Glossy-Qualität, Ecken abgerundet</value></prop>
+<node oor:name="L439" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8890 InkPrint Special Glossy-Qualität, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;6604;3810;6350;3810;721;1515;3;7</value></prop></node>
-<node oor:name="L440" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8891 InkPrint Special Glossy-Qualität, Ecken abgerundet</value></prop>
+<node oor:name="L440" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8891 InkPrint Special Glossy-Qualität, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9652;3387;8890;3387;1229;1303;2;8</value></prop></node>
-<node oor:name="L441" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8892 InkPrint Special Glossy-Qualität, Ecken abgerundet</value></prop>
+<node oor:name="L441" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8892 InkPrint Special Glossy-Qualität, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9652;4656;8890;4656;1229;882;2;6</value></prop></node>
-<node oor:name="L442" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8893 InkPrint Special Glossy-Qualität, Ecken abgerundet</value></prop>
+<node oor:name="L442" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8893 InkPrint Special Glossy-Qualität, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9854;5080;9600;5080;773;2150;2;5</value></prop></node>
-<node oor:name="L443" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8894 InkPrint Special Glossy-Qualität, Ecken abgerundet</value></prop>
+<node oor:name="L443" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8894 InkPrint Special Glossy-Qualität, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9854;13970;9600;13970;773;880;2;2</value></prop></node>
-<node oor:name="L444" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8895 InkPrint Special Glossy-Qualität, weiß</value></prop>
+<node oor:name="L444" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8895 InkPrint Special Glossy-Qualität, weiß</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L445" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8896 InkPrint Special Glossy-Qualität, Ecken abgerundet</value></prop>
+<node oor:name="L445" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8896 InkPrint Special Glossy-Qualität, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;6604;5079;6350;4656;721;2363,5;3;5</value></prop></node>
-<node oor:name="L446" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8897 InkPrint Special Glossy-Qualität, Ecken abgerundet</value></prop>
+<node oor:name="L446" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8897 InkPrint Special Glossy-Qualität, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9398;6773;8890;6350;1356;1515;2;4</value></prop></node>
-<node oor:name="L447" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8898 InkPrint Special Glossy-Qualität, Ecken abgerundet</value></prop>
+<node oor:name="L447" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8898 InkPrint Special Glossy-Qualität, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9398;13123;8890;12700;1356;1932;2;2</value></prop></node>
-<node oor:name="L448" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8899 InkPrint Special Glossy-Qualität, Ecken abgerundet</value></prop>
+<node oor:name="L448" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8899 InkPrint Special Glossy-Qualität, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;17800;13300;17800;12700;1600;1843;1;2</value></prop></node>
-<node oor:name="L449" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8900 InkPrint Special Glossy-Qualität, CD-Etikett, weiß</value></prop>
+<node oor:name="L449" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8900 InkPrint Special Glossy-Qualität, CD-Etikett, weiß</value></prop>
<prop oor:name="Measure"><value>S;11600;14800;11600;11600;4700;1650;1;2</value></prop></node>
-<node oor:name="L450" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8901 InkPrint Special Glossy-Qualität, oval</value></prop>
+<node oor:name="L450" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8901 InkPrint Special Glossy-Qualität, oval</value></prop>
<prop oor:name="Measure"><value>S;6604;4656;6350;4233;721;1093;3;6</value></prop></node>
-<node oor:name="L451" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8939 InkPrint Special Mini-CD-Etiketten, weiß</value></prop>
+<node oor:name="L451" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8939 InkPrint Special Mini-CD-Etiketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;9200;8950;7800;7800;2000;2000;2;3</value></prop></node>
-<node oor:name="L452" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8961 InkPrint Special transparente Folie</value></prop>
+<node oor:name="L452" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8961 InkPrint Special transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;4826;2540;4826;2540;848;880;4;11</value></prop></node>
-<node oor:name="L453" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8962 InkPrint Special transparente Folie</value></prop>
+<node oor:name="L453" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8962 InkPrint Special transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;6600;3387;6600;3387;600;1303;3;8</value></prop></node>
-<node oor:name="L454" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8963 InkPrint Special transparente Folie</value></prop>
+<node oor:name="L454" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8963 InkPrint Special transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;9652;4233;9652;4233;848;2150;2;6</value></prop></node>
-<node oor:name="L455" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8964 InkPrint Special transparente Folie, A4</value></prop>
+<node oor:name="L455" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8964 InkPrint Special transparente Folie, A4</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L456" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8965 InkPrint Special transparente Folie</value></prop>
+<node oor:name="L456" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8965 InkPrint Special transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;4826;2116,7;4572;2116,7;975;2150;4;12</value></prop></node>
-<node oor:name="L457" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8966 InkPrint Special transparente Folie</value></prop>
+<node oor:name="L457" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8966 InkPrint Special transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;6604;2963,3;6350;2963,3;721;1515;3;9</value></prop></node>
-<node oor:name="L458" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8967 InkPrint Special transparente Folie</value></prop>
+<node oor:name="L458" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8967 InkPrint Special transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;9854;5080;9600;5080;773;2150;2;5</value></prop></node>
-<node oor:name="L459" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8968 InkPrint Special CD-Etikett, transparente Folie</value></prop>
+<node oor:name="L459" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8968 InkPrint Special CD-Etikett, transparente Folie</value></prop>
<prop oor:name="Measure"><value>S;11600;14800;11600;11600;4700;1650;1;2</value></prop></node>
-<node oor:name="L460" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8971 InkPrint Special weiße Folie</value></prop>
+<node oor:name="L460" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8971 InkPrint Special weiße Folie</value></prop>
<prop oor:name="Measure"><value>S;4826;2540;4826;2540;848;880;4;11</value></prop></node>
-<node oor:name="L461" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8972 InkPrint Special weiße Folie</value></prop>
+<node oor:name="L461" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8972 InkPrint Special weiße Folie</value></prop>
<prop oor:name="Measure"><value>S;6600;3387;6600;3387;600;1303;3;8</value></prop></node>
-<node oor:name="L462" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8973 InkPrint Special weiße Folie</value></prop>
+<node oor:name="L462" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8973 InkPrint Special weiße Folie</value></prop>
<prop oor:name="Measure"><value>S;9652;4233;9652;4233;848;2150;2;6</value></prop></node>
-<node oor:name="L463" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8974 InkPrint Special weiße Folie, A4</value></prop>
+<node oor:name="L463" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8974 InkPrint Special weiße Folie, A4</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L464" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8981 InkPrint Special Goldfolie</value></prop>
+<node oor:name="L464" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8981 InkPrint Special Goldfolie</value></prop>
<prop oor:name="Measure"><value>S;4826;2540;4826;2540;848;880;4;11</value></prop></node>
-<node oor:name="L465" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8982 InkPrint Special Goldfolie</value></prop>
+<node oor:name="L465" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8982 InkPrint Special Goldfolie</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L466" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8983 SuperPrint Goldfolie, oval</value></prop>
+<node oor:name="L466" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8983 SuperPrint Goldfolie, oval</value></prop>
<prop oor:name="Measure"><value>S;4572;2963;4064;2540;1610;1727;4;9</value></prop></node>
-<node oor:name="L467" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8984 InkPrint Special CD-Etikett, gold</value></prop>
+<node oor:name="L467" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8984 InkPrint Special CD-Etikett, gold</value></prop>
<prop oor:name="Measure"><value>S;11600;14800;11600;11600;4700;1650;1;2</value></prop></node>
-<node oor:name="L468" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8991 InkPrint Special Silberfolie</value></prop>
+<node oor:name="L468" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8991 InkPrint Special Silberfolie</value></prop>
<prop oor:name="Measure"><value>S;6600;3387;6600;3387;600;1303;3;8</value></prop></node>
-<node oor:name="L469" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8992 InkPrint Special Silberfolie</value></prop>
+<node oor:name="L469" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8992 InkPrint Special Silberfolie</value></prop>
<prop oor:name="Measure"><value>S;21000;29700;21000;29700;0;0;1;1</value></prop></node>
-<node oor:name="L470" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8993 SuperPrint Silberfolie, oval</value></prop>
+<node oor:name="L470" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8993 SuperPrint Silberfolie, oval</value></prop>
<prop oor:name="Measure"><value>S;4572;2963;4064;2540;1610;1727;4;9</value></prop></node>
-<node oor:name="L471" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8994 InkPrint Special CD-Etikett, silber</value></prop>
+<node oor:name="L471" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8994 InkPrint Special CD-Etikett, silber</value></prop>
<prop oor:name="Measure"><value>S;11600;14800;11600;11600;4700;1650;1;2</value></prop></node>
-<node oor:name="L472" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4639a SuperPrint BETACAM SP/U-MATIC, Cassette (Front), weiß</value></prop>
+<node oor:name="L472" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4639a SuperPrint BETACAM SP/U-MATIC, Cassette (Front), weiß</value></prop>
<prop oor:name="Measure"><value>S;10160;6773;9906;6773;467;1303;2;4</value></prop></node>
-<node oor:name="L473" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4639b SuperPrint BETACAM SP/U-MATIC, Cassette (Rücken), weiß</value></prop>
+<node oor:name="L473" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4639b SuperPrint BETACAM SP/U-MATIC, Cassette (Rücken), weiß</value></prop>
<prop oor:name="Measure"><value>S;14000;1693;14000;1693;3500;1306;1;16</value></prop></node>
-<node oor:name="L474" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4640a SuperPrint Maxi Data Cartridge, weiß</value></prop>
+<node oor:name="L474" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4640a SuperPrint Maxi Data Cartridge, weiß</value></prop>
<prop oor:name="Measure"><value>S;13400;6770;13400;6770;3800;1310;1;4</value></prop></node>
-<node oor:name="L475" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4640b SuperPrint Maxi Data Cartridge (Hülle), weiß</value></prop>
+<node oor:name="L475" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4640b SuperPrint Maxi Data Cartridge (Hülle), weiß</value></prop>
<prop oor:name="Measure"><value>S;13400;1270;13400;1270;3800;1515;1;21</value></prop></node>
-<node oor:name="L476" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4641a SuperPrint Data Cartridge 4 mm, weiß</value></prop>
+<node oor:name="L476" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4641a SuperPrint Data Cartridge 4 mm, weiß</value></prop>
<prop oor:name="Measure"><value>S;6096;2120;5334;2120;1737;1070;3;13</value></prop></node>
-<node oor:name="L477" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4641b SuperPrint Data Cartridge 4 mm (Hülle), weiß</value></prop>
+<node oor:name="L477" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4641b SuperPrint Data Cartridge 4 mm (Hülle), weiß</value></prop>
<prop oor:name="Measure"><value>S;6604;3810;6350;3810;721;1515;3;7</value></prop></node>
-<node oor:name="L478" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4642a SuperPrint MiniData Cartridge, weiß</value></prop>
+<node oor:name="L478" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4642a SuperPrint MiniData Cartridge, weiß</value></prop>
<prop oor:name="Measure"><value>S;8800;2400;7300;2400;2450;1650;2;11</value></prop></node>
-<node oor:name="L479" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4642b SuperPrint MiniData Cartridge (Hülle), weiß</value></prop>
+<node oor:name="L479" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4642b SuperPrint MiniData Cartridge (Hülle), weiß</value></prop>
<prop oor:name="Measure"><value>S;9000;1000;7500;1000;2250;1850;2;26</value></prop></node>
-<node oor:name="L480" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4643a SuperPrint Magneto Optical Disk 3,5", weiß</value></prop>
+<node oor:name="L480" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4643a SuperPrint Magneto Optical Disk 3,5", weiß</value></prop>
<prop oor:name="Measure"><value>S;9000;6773;7000;6773;2500;1304;2;4</value></prop></node>
-<node oor:name="L481" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4643b SuperPrint Magneto Optical Disk 3,5" (Hülle), weiß</value></prop>
+<node oor:name="L481" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4643b SuperPrint Magneto Optical Disk 3,5" (Hülle), weiß</value></prop>
<prop oor:name="Measure"><value>S;9800;12400;8800;10400;1200;3450;2;2</value></prop></node>
-<node oor:name="L482" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4646a SuperPrint Mini Digital Video, weiß</value></prop>
+<node oor:name="L482" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4646a SuperPrint Mini Digital Video, weiß</value></prop>
<prop oor:name="Measure"><value>S;4572;847;4318;847;1483;1298;4;32</value></prop></node>
-<node oor:name="L483" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4646b SuperPrint Mini Digital Video (Hülle), weiß</value></prop>
+<node oor:name="L483" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4646b SuperPrint Mini Digital Video (Hülle), weiß</value></prop>
<prop oor:name="Measure"><value>S;6604;2540;6350;2540;721;880;3;11</value></prop></node>
-<node oor:name="L484" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4647a SuperPrint Video 8, Hi-8, Data Cartridge 8mm, weiß </value></prop>
+<node oor:name="L484" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4647a SuperPrint Video 8, Hi-8, Data Cartridge 8mm, weiß </value></prop>
<prop oor:name="Measure"><value>S;9000;1000;7500;1000;2250;1850;2;26</value></prop></node>
-<node oor:name="L485" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4647b SuperPrint Video 8, Hi-8, Data Cartridge 8 mm (Hülle), weiß</value></prop>
+<node oor:name="L485" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4647b SuperPrint Video 8, Hi-8, Data Cartridge 8 mm (Hülle), weiß</value></prop>
<prop oor:name="Measure"><value>S;9652;4656;8890;4656;1229;882;2;6</value></prop></node>
-<node oor:name="L486" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4648a SuperPrint VHS-C, SVHS-C, Cassette (Rücken) weiß</value></prop>
+<node oor:name="L486" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4648a SuperPrint VHS-C, SVHS-C, Cassette (Rücken) weiß</value></prop>
<prop oor:name="Measure"><value>S;4826;1200;4318;1200;1102;1050;4;23</value></prop></node>
-<node oor:name="L487" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4648b SuperPrint VHS-C, SVHS-C, Cassette (Front), weiß</value></prop>
+<node oor:name="L487" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4648b SuperPrint VHS-C, SVHS-C, Cassette (Front), weiß</value></prop>
<prop oor:name="Measure"><value>S;6350;3810;5842;3810;1229;1515;3;7</value></prop></node>
-<node oor:name="L488" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4649a SuperPrint MiniDisk, weiß</value></prop>
+<node oor:name="L488" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4649a SuperPrint MiniDisk, weiß</value></prop>
<prop oor:name="Measure"><value>S;3600;5500;3600;5200;1500;1250;5;5</value></prop></node>
-<node oor:name="L489" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">4649b SuperPrint MiniDisk-Hülle, weiß</value></prop>
+<node oor:name="L489" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>4649b SuperPrint MiniDisk-Hülle, weiß</value></prop>
<prop oor:name="Measure"><value>S;9000;5080;7000;5080;2500;2150;2;5</value></prop></node>
-<node oor:name="L490" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">5116 taillierte Ringetiketten für Schmuck, weiß</value></prop>
+<node oor:name="L490" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>5116 taillierte Ringetiketten für Schmuck, weiß</value></prop>
<prop oor:name="Measure"><value>S;5900;1400;4900;1000;2150;1050;3;20</value>
</prop>
</node>
@@ -14281,280 +13180,280 @@
</node>
<node oor:name="Herma A5" oor:op="replace">
- <node oor:name="L0" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8600 A5 Kreise 10 mm, weiß, ablösbar</value></prop>
+ <node oor:name="L0" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8600 A5 Kreise 10 mm, weiß, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;1270;1270;1000;1000;1110;1210;15;10</value></prop></node>
- <node oor:name="L1" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8601 A5 Kreise 20 mm, weiß, ablösbar</value></prop>
+ <node oor:name="L1" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8601 A5 Kreise 20 mm, weiß, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;2300;2300;2000;2000;1450;675;8;6</value></prop></node>
- <node oor:name="L2" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8602 A5 Kreise 60 mm, gelb, ablösbar</value></prop>
+ <node oor:name="L2" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8602 A5 Kreise 60 mm, gelb, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;6700;6700;6000;6000;800;1075;3;2</value></prop></node>
- <node oor:name="L3" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8603 A5 weiß, Ecken abgerundet, ablösbar</value></prop>
+ <node oor:name="L3" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8603 A5 weiß, Ecken abgerundet, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;1524;850;1270;850;721;1050;13;15</value></prop></node>
- <node oor:name="L4" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8604 A5 weiß, Ecken abgerundet, ablösbar</value></prop>
+ <node oor:name="L4" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8604 A5 weiß, Ecken abgerundet, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;2034;1000;1780;1000;457;1425;10;12</value></prop></node>
- <node oor:name="L5" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8605 A5 weiß, Ecken abgerundet, ablösbar</value></prop>
+ <node oor:name="L5" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8605 A5 weiß, Ecken abgerundet, ablösbar</value></prop>
<prop oor:name="Measure"><value>S;2794;1693;2540;1693;848;1499,5;7;7</value></prop></node>
- <node oor:name="L6" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8606 A5 Diabeschriftung, weiß</value></prop>
+ <node oor:name="L6" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8606 A5 Diabeschriftung, weiß</value></prop>
<prop oor:name="Measure"><value>S;4826;1000;4572;1000;975;1425;4;12</value></prop></node>
- <node oor:name="L7" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8607 A5 Sichtreiteretiketten, weiß</value></prop>
+ <node oor:name="L7" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8607 A5 Sichtreiteretiketten, weiß</value></prop>
<prop oor:name="Measure"><value>S;4826;1693;4572;1693;975;1499,5;4;7</value></prop></node>
- <node oor:name="L8" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8608 A5 weiß, Ecken abgerundet</value></prop>
+ <node oor:name="L8" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8608 A5 weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;6604;2963,3;6350;2963,3;721;1499,5;3;4</value></prop></node>
- <node oor:name="L9" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8609 A5 weiß, Ecken abgerundet</value></prop>
+ <node oor:name="L9" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8609 A5 weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9854;4233;9600;4233;773;1075,5;2;3</value></prop></node>
- <node oor:name="L10" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8610 A5 weiß, Ecken abgerundet</value></prop>
+ <node oor:name="L10" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8610 A5 weiß, Ecken abgerundet</value></prop>
<prop oor:name="Measure"><value>S;9854;6350;9600;6350;773;1075;2;2</value></prop></node>
- <node oor:name="L11" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8611 A5 3,5"-Disketten, farbig sortiert</value></prop>
+ <node oor:name="L11" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8611 A5 3,5"-Disketten, farbig sortiert</value></prop>
<prop oor:name="Measure"><value>S;9000;6773;7000;6773;2500;652;2;2</value></prop></node>
- <node oor:name="L12" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8612 A5 Videoetiketten, Front, weiß</value></prop>
+ <node oor:name="L12" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8612 A5 Videoetiketten, Front, weiß</value></prop>
<prop oor:name="Measure"><value>S;8128;4646;7874;4646;2499;2769;2;2</value></prop></node>
- <node oor:name="L13" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8613 A5 Videoetiketten, Rücken, weiß</value></prop>
+ <node oor:name="L13" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8613 A5 Videoetiketten, Rücken, weiß</value></prop>
<prop oor:name="Measure"><value>S;14732;1693;14732;1693;3134;1499,5;1;7</value></prop></node>
- <node oor:name="L14" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8614 A5 Musik-Cassetten, weiß</value></prop>
+ <node oor:name="L14" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8614 A5 Musik-Cassetten, weiß</value></prop>
<prop oor:name="Measure"><value>S;9154;4233;8900;4233;1473;1075,5;2;3</value></prop></node>
- <node oor:name="L15" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8615 A5 für schmale Ordner, farbig sortiert</value></prop>
+ <node oor:name="L15" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8615 A5 für schmale Ordner, farbig sortiert</value></prop>
<prop oor:name="Measure"><value>S;19200;3800;19200;3800;900;1725;1;3</value></prop></node>
- <node oor:name="L16" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8616 A5 für breite Ordner, farbig sortiert</value></prop>
+ <node oor:name="L16" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8616 A5 für breite Ordner, farbig sortiert</value></prop>
<prop oor:name="Measure"><value>S;19200;6100;19200;6100;900;1325;1;2</value></prop></node>
</node>
<node oor:name="Herma endlos" oor:op="replace">
-<node oor:name="L0" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8001 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L0" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8001 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;8890;2540;8890;2300;1105;0;1;1</value></prop></node>
-<node oor:name="L1" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8002 Endlosetiketten 3-bahnig, Kennzeichnung</value></prop>
+<node oor:name="L1" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8002 Endlosetiketten 3-bahnig, Kennzeichnung</value></prop>
<prop oor:name="Measure"><value>C;2794;1693;2540;1453;1486;0;3;1</value></prop></node>
-<node oor:name="L2" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8003 Endlosetiketten 2-bahnig, Kennzeichnung</value></prop>
+<node oor:name="L2" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8003 Endlosetiketten 2-bahnig, Kennzeichnung</value></prop>
<prop oor:name="Measure"><value>C;3810;2117;3556;1900;1867;0;2;1</value></prop></node>
-<node oor:name="L3" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8004 Endlosetiketten 2-bahnig, Diabeschriftung</value></prop>
+<node oor:name="L3" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8004 Endlosetiketten 2-bahnig, Diabeschriftung</value></prop>
<prop oor:name="Measure"><value>C;4572;1270;4318;1030;1105;0;2;1</value></prop></node>
-<node oor:name="L4" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8005 Endlosetiketten 2-bahnig, Kennzeichnung</value></prop>
+<node oor:name="L4" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8005 Endlosetiketten 2-bahnig, Kennzeichnung</value></prop>
<prop oor:name="Measure"><value>C;4064;2540;3810;2300;1613;0;2;1</value></prop></node>
-<node oor:name="L5" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8006 Endlosetiketten 2-bahnig, Kennzeichnung</value></prop>
+<node oor:name="L5" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8006 Endlosetiketten 2-bahnig, Kennzeichnung</value></prop>
<prop oor:name="Measure"><value>C;4318;1693;4064;1453;1359;0;2;1</value></prop></node>
-<node oor:name="L6" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8007 Endlosetiketten 2-bahnig, Kennzeichnung</value></prop>
+<node oor:name="L6" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8007 Endlosetiketten 2-bahnig, Kennzeichnung</value></prop>
<prop oor:name="Measure"><value>C;4572;3810;4318;3570;1105;0;2;1</value></prop></node>
-<node oor:name="L7" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8008 Endlosetiketten 1-bahnig, 3,5"-Diskette, weiß</value></prop>
+<node oor:name="L7" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8008 Endlosetiketten 1-bahnig, 3,5"-Diskette, weiß</value></prop>
<prop oor:name="Measure"><value>C;7112;7620;7112;6960;1994;0;1;1</value></prop></node>
-<node oor:name="L8" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8009 Endlosetiketten 1-bahnig, Namensetiketten, Acetatseide</value></prop>
+<node oor:name="L8" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8009 Endlosetiketten 1-bahnig, Namensetiketten, Acetatseide</value></prop>
<prop oor:name="Measure"><value>C;7000;2540;7000;2300;1500;0;1;1</value></prop></node>
-<node oor:name="L9" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8010 Endlosetiketten 1-bahnig, 3,5"-Diskette, weiß, Front</value></prop>
+<node oor:name="L9" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8010 Endlosetiketten 1-bahnig, 3,5"-Diskette, weiß, Front</value></prop>
<prop oor:name="Measure"><value>C;7112;5080;7112;4840;1444;0;1;1</value></prop></node>
-<node oor:name="L10" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8011 Endlosetiketten 1-bahnig, 3,5"-Diskette, gelb</value></prop>
+<node oor:name="L10" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8011 Endlosetiketten 1-bahnig, 3,5"-Diskette, gelb</value></prop>
<prop oor:name="Measure"><value>C;7112;7620;7112;6960;1994;0;1;1</value></prop></node>
-<node oor:name="L11" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8012 Endlosetiketten 1-bahnig, 3,5"-Diskette, rot</value></prop>
+<node oor:name="L11" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8012 Endlosetiketten 1-bahnig, 3,5"-Diskette, rot</value></prop>
<prop oor:name="Measure"><value>C;7112;7620;7112;6960;1994;0;1;1</value></prop></node>
-<node oor:name="L12" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8013 Endlosetiketten 1-bahnig, 3,5"-Diskette, blau</value></prop>
+<node oor:name="L12" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8013 Endlosetiketten 1-bahnig, 3,5"-Diskette, blau</value></prop>
<prop oor:name="Measure"><value>C;7112;7620;7112;6960;1994;0;1;1</value></prop></node>
-<node oor:name="L13" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8014 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L13" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8014 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;6858;3810;6858;3570;1571;0;1;1</value></prop></node>
-<node oor:name="L14" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8015 Endlosetiketten 1-bahnig, 3,5"-Diskette, grün</value></prop>
+<node oor:name="L14" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8015 Endlosetiketten 1-bahnig, 3,5"-Diskette, grün</value></prop>
<prop oor:name="Measure"><value>C;7112;7620;7112;6960;1994;0;1;1</value></prop></node>
-<node oor:name="L15" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8021 Endlosetiketten 2-bahnig, gelb</value></prop>
+<node oor:name="L15" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8021 Endlosetiketten 2-bahnig, gelb</value></prop>
<prop oor:name="Measure"><value>C;4064;2540;3810;2300;1613;0;2;1</value></prop></node>
-<node oor:name="L16" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8022 Endlosetiketten 2-bahnig, rot</value></prop>
+<node oor:name="L16" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8022 Endlosetiketten 2-bahnig, rot</value></prop>
<prop oor:name="Measure"><value>C;4064;2540;3810;2300;1613;0;2;1</value></prop></node>
-<node oor:name="L17" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8036 Endlosetiketten 2-bahnig, ablösbar</value></prop>
+<node oor:name="L17" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8036 Endlosetiketten 2-bahnig, ablösbar</value></prop>
<prop oor:name="Measure"><value>C;4064;2540;3810;2300;1613;0;2;1</value></prop></node>
-<node oor:name="L18" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8040 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L18" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8040 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;8890;3810;8890;3570;1105;0;1;1</value></prop></node>
-<node oor:name="L19" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8041 Endlosetiketten 1-bahnig, gelb</value></prop>
+<node oor:name="L19" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8041 Endlosetiketten 1-bahnig, gelb</value></prop>
<prop oor:name="Measure"><value>C;8890;3810;8890;3570;1105;0;1;1</value></prop></node>
-<node oor:name="L20" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8042 Endlosetiketten 1-bahnig, rot</value></prop>
+<node oor:name="L20" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8042 Endlosetiketten 1-bahnig, rot</value></prop>
<prop oor:name="Measure"><value>C;8890;3810;8890;3570;1105;0;1;1</value></prop></node>
-<node oor:name="L21" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8043 Endlosetiketten 1-bahnig, blau</value></prop>
+<node oor:name="L21" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8043 Endlosetiketten 1-bahnig, blau</value></prop>
<prop oor:name="Measure"><value>C;8890;3810;8890;3570;1105;0;1;1</value></prop></node>
-<node oor:name="L22" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8045 Endlosetiketten 1-bahnig, grün</value></prop>
+<node oor:name="L22" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8045 Endlosetiketten 1-bahnig, grün</value></prop>
<prop oor:name="Measure"><value>C;8890;3810;8890;3570;1105;0;1;1</value></prop></node>
-<node oor:name="L23" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8050 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L23" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8050 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;8890;5080;8890;4840;1105;0;1;1</value></prop></node>
-<node oor:name="L24" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8060 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L24" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8060 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;8890;3810;8890;3570;1105;0;1;1</value></prop></node>
-<node oor:name="L25" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8061 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L25" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8061 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;8890;5080;8890;4840;1105;0;1;1</value></prop></node>
-<node oor:name="L26" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8066 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L26" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8066 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10160;3810;10160;3570;1170;0;1;1</value></prop></node>
-<node oor:name="L27" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8067 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L27" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8067 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10668;3810;10668;3570;916;0;1;1</value></prop></node>
-<node oor:name="L28" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8068 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L28" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8068 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10160;5080;10160;4840;1170;0;1;1</value></prop></node>
-<node oor:name="L29" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8069 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L29" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8069 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10668;5080;10668;4840;916;0;1;1</value></prop></node>
-<node oor:name="L30" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8070 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L30" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8070 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;11176;5080;11176;4840;1162;0;1;1</value></prop></node>
-<node oor:name="L31" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8071 Endlosetiketten 1-bahnig, Videocassetten</value></prop>
+<node oor:name="L31" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8071 Endlosetiketten 1-bahnig, Videocassetten</value></prop>
<prop oor:name="Measure"><value>C;14732;2540;14732;1900;1134;0;1;1</value></prop></node>
-<node oor:name="L32" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8072 Endlosetiketten 1-bahnig, Querperforation, weiß</value></prop>
+<node oor:name="L32" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8072 Endlosetiketten 1-bahnig, Querperforation, weiß</value></prop>
<prop oor:name="Measure"><value>C;14732;10160;14732;9920;1134;0;1;1</value></prop></node>
-<node oor:name="L33" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8073 Endlosetiketten 1-bahnig, Querperforation, gelb</value></prop>
+<node oor:name="L33" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8073 Endlosetiketten 1-bahnig, Querperforation, gelb</value></prop>
<prop oor:name="Measure"><value>C;14732;10160;14732;9920;1134;0;1;1</value></prop></node>
-<node oor:name="L34" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8074 Endlosetiketten 1-bahnig, Querperforation, rot</value></prop>
+<node oor:name="L34" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8074 Endlosetiketten 1-bahnig, Querperforation, rot</value></prop>
<prop oor:name="Measure"><value>C;14732;10160;14732;9920;1134;0;1;1</value></prop></node>
-<node oor:name="L35" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8104 Endlosetiketten 1-bahnig, mit Querperforation</value></prop>
+<node oor:name="L35" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8104 Endlosetiketten 1-bahnig, mit Querperforation</value></prop>
<prop oor:name="Measure"><value>C;8890;5080;8890;4840;1105;0;1;1</value></prop></node>
-<node oor:name="L36" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8111 Endlosetiketten 1-bahnig, mit Querperforation</value></prop>
+<node oor:name="L36" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8111 Endlosetiketten 1-bahnig, mit Querperforation</value></prop>
<prop oor:name="Measure"><value>C;8890;3810;8890;3570;1105;0;1;1</value></prop></node>
-<node oor:name="L37" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8112 Endlosetiketten 1-bahnig, mit Querperforation</value></prop>
+<node oor:name="L37" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8112 Endlosetiketten 1-bahnig, mit Querperforation</value></prop>
<prop oor:name="Measure"><value>C;10160;3810;10160;3570;1170;0;1;1</value></prop></node>
-<node oor:name="L38" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8113 Endlosetiketten 1-bahnig, mit Querperforation</value></prop>
+<node oor:name="L38" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8113 Endlosetiketten 1-bahnig, mit Querperforation</value></prop>
<prop oor:name="Measure"><value>C;10160;5080;10160;4840;1170;0;1;1</value></prop></node>
-<node oor:name="L39" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8116 Endlosetiketten 1-bahnig, mit Querperforation</value></prop>
+<node oor:name="L39" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8116 Endlosetiketten 1-bahnig, mit Querperforation</value></prop>
<prop oor:name="Measure"><value>C;11176;5080;11176;4840;1162;0;1;1</value></prop></node>
-<node oor:name="L40" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8121 Endlosetiketten 1-bahnig, gelb</value></prop>
+<node oor:name="L40" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8121 Endlosetiketten 1-bahnig, gelb</value></prop>
<prop oor:name="Measure"><value>C;10160;5080;10160;4840;1170;0;1;1</value></prop></node>
-<node oor:name="L41" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8122 Endlosetiketten 1-bahnig, rot</value></prop>
+<node oor:name="L41" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8122 Endlosetiketten 1-bahnig, rot</value></prop>
<prop oor:name="Measure"><value>C;10160;5080;10160;4840;1170;0;1;1</value></prop></node>
-<node oor:name="L42" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8123 Endlosetiketten 1-bahnig, blau</value></prop>
+<node oor:name="L42" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8123 Endlosetiketten 1-bahnig, blau</value></prop>
<prop oor:name="Measure"><value>C;10160;5080;10160;4840;1170;0;1;1</value></prop></node>
-<node oor:name="L43" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8125 Endlosetiketten 1-bahnig, grün</value></prop>
+<node oor:name="L43" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8125 Endlosetiketten 1-bahnig, grün</value></prop>
<prop oor:name="Measure"><value>C;10160;5080;10160;4840;1170;0;1;1</value></prop></node>
-<node oor:name="L44" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8158 Endlosetiketten 1-bahnig, Kennzeichnung</value></prop>
+<node oor:name="L44" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8158 Endlosetiketten 1-bahnig, Kennzeichnung</value></prop>
<prop oor:name="Measure"><value>C;7366;1270;7366;1030;1317;0;1;1</value></prop></node>
-<node oor:name="L45" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8160 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L45" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8160 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;8890;2540;8890;2300;1105;0;1;1</value></prop></node>
-<node oor:name="L46" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8161 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L46" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8161 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;8890;3810;8890;3570;1105;0;1;1</value></prop></node>
-<node oor:name="L47" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8162 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L47" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8162 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10160;3810;10160;3570;1170;0;1;1</value></prop></node>
-<node oor:name="L48" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8163 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L48" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8163 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10160;5080;10160;4840;1170;0;1;1</value></prop></node>
-<node oor:name="L49" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8164 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L49" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8164 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10160;2540;10160;2300;1170;0;1;1</value></prop></node>
-<node oor:name="L50" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8166 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L50" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8166 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;11176;5080;11176;4840;1162;0;1;1</value></prop></node>
-<node oor:name="L51" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8167 Endlosetiketten 2-bahnig</value></prop>
+<node oor:name="L51" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8167 Endlosetiketten 2-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10414;3810;10160;3570;1713;0;2;1</value></prop></node>
-<node oor:name="L52" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8168 Endlosetiketten 2-bahnig</value></prop>
+<node oor:name="L52" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8168 Endlosetiketten 2-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10414;5080;10160;4840;2213;0;2;1</value></prop></node>
-<node oor:name="L53" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8169 Endlosetiketten 2-bahnig</value></prop>
+<node oor:name="L53" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8169 Endlosetiketten 2-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10414;2540;10160;2300;1213;0;2;1</value></prop></node>
-<node oor:name="L54" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8170 Endlosetiketten 1-bahnig, ablösbar</value></prop>
+<node oor:name="L54" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8170 Endlosetiketten 1-bahnig, ablösbar</value></prop>
<prop oor:name="Measure"><value>C;8890;2540;8890;2300;1105;0;1;1</value></prop></node>
-<node oor:name="L55" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8171 Endlosetiketten 1-bahnig, ablösbar</value></prop>
+<node oor:name="L55" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8171 Endlosetiketten 1-bahnig, ablösbar</value></prop>
<prop oor:name="Measure"><value>C;8890;3810;8890;3570;1105;0;1;1</value></prop></node>
-<node oor:name="L56" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8172 Endlosetiketten 1-bahnig, ablösbar</value></prop>
+<node oor:name="L56" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8172 Endlosetiketten 1-bahnig, ablösbar</value></prop>
<prop oor:name="Measure"><value>C;6858;3810;6858;3570;1571;0;1;1</value></prop></node>
-<node oor:name="L57" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8173 Endlosetiketten 1-bahn., Querperforation, ablösbar</value></prop>
+<node oor:name="L57" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8173 Endlosetiketten 1-bahn., Querperforation, ablösbar</value></prop>
<prop oor:name="Measure"><value>C;14732;7620;14732;7380;1134;0;1;1</value></prop></node>
-<node oor:name="L58" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8178 Endlosetiketten 1-bahnig, schnittgestanzt</value></prop>
+<node oor:name="L58" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8178 Endlosetiketten 1-bahnig, schnittgestanzt</value></prop>
<prop oor:name="Measure"><value>C;9500;3810;9500;3810;1000;0;1;1</value></prop></node>
-<node oor:name="L59" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8179 Endlosetiketten 1-bahnig, schnittgestanzt</value></prop>
+<node oor:name="L59" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8179 Endlosetiketten 1-bahnig, schnittgestanzt</value></prop>
<prop oor:name="Measure"><value>C;15200;5080;15200;5080;900;0;1;1</value></prop></node>
-<node oor:name="L60" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8181 Endlosetiketten 1-bahnig, gelb</value></prop>
+<node oor:name="L60" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8181 Endlosetiketten 1-bahnig, gelb</value></prop>
<prop oor:name="Measure"><value>C;8890;3810;8890;3570;1105;0;1;1</value></prop></node>
-<node oor:name="L61" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8182 Endlosetiketten 1-bahnig, rot</value></prop>
+<node oor:name="L61" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8182 Endlosetiketten 1-bahnig, rot</value></prop>
<prop oor:name="Measure"><value>C;8890;3810;8890;3570;1105;0;1;1</value></prop></node>
-<node oor:name="L62" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8183 Endlosetiketten 1-bahnig, blau</value></prop>
+<node oor:name="L62" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8183 Endlosetiketten 1-bahnig, blau</value></prop>
<prop oor:name="Measure"><value>C;8890;3810;8890;3570;1105;0;1;1</value></prop></node>
-<node oor:name="L63" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8185 Endlosetiketten 1-bahnig, grün</value></prop>
+<node oor:name="L63" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8185 Endlosetiketten 1-bahnig, grün</value></prop>
<prop oor:name="Measure"><value>C;8890;3810;8890;3570;1105;0;1;1</value></prop></node>
-<node oor:name="L64" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8200 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L64" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8200 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;7874;2540;7874;2300;1063;0;1;1</value></prop></node>
-<node oor:name="L65" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8201 Endlosetiketten 1-bahnig, 3,5"-Diskette, Front</value></prop>
+<node oor:name="L65" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8201 Endlosetiketten 1-bahnig, 3,5"-Diskette, Front</value></prop>
<prop oor:name="Measure"><value>C;7112;5080;7112;4840;1444;0;1;1</value></prop></node>
-<node oor:name="L66" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8202 Endlosetiketten 1-bahnig, Kennzeichnung</value></prop>
+<node oor:name="L66" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8202 Endlosetiketten 1-bahnig, Kennzeichnung</value></prop>
<prop oor:name="Measure"><value>C;7366;1270;7366;1030;1317;0;1;1</value></prop></node>
-<node oor:name="L67" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8203 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L67" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8203 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10160;7620;10160;7380;1170;0;1;1</value></prop></node>
-<node oor:name="L68" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8204 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L68" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8204 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;8890;5080;8890;4840;1105;0;1;1</value></prop></node>
-<node oor:name="L69" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8207 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L69" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8207 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;6858;3810;6858;3570;881;0;1;1</value></prop></node>
-<node oor:name="L70" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8209 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L70" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8209 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10668;3810;10668;3570;916;0;1;1</value></prop></node>
-<node oor:name="L71" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8210 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L71" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8210 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;8890;2540;8890;2300;1105;0;1;1</value></prop></node>
-<node oor:name="L72" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8211 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L72" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8211 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;8890;3810;8890;3570;1105;0;1;1</value></prop></node>
-<node oor:name="L73" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8212 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L73" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8212 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10160;3810;10160;3570;1170;0;1;1</value></prop></node>
-<node oor:name="L74" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8213 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L74" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8213 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10160;5080;10160;4840;1170;0;1;1</value></prop></node>
-<node oor:name="L75" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8214 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L75" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8214 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10160;2540;10160;2300;1170;0;1;1</value></prop></node>
-<node oor:name="L76" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8215 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L76" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8215 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;11176;3810;11176;3570;1162;0;1;1</value></prop></node>
-<node oor:name="L77" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8216 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L77" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8216 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;11176;5080;11176;4840;1162;0;1;1</value></prop></node>
-<node oor:name="L78" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8217 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L78" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8217 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;12700;2540;12700;2300;1150;0;1;1</value></prop></node>
-<node oor:name="L79" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8218 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L79" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8218 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;12700;3810;12700;3570;1150;0;1;1</value></prop></node>
-<node oor:name="L80" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8219 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L80" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8219 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;13460;2117;13460;1900;1200;0;1;1</value></prop></node>
-<node oor:name="L81" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8220 Endlosetiketten 2-bahnig</value></prop>
+<node oor:name="L81" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8220 Endlosetiketten 2-bahnig</value></prop>
<prop oor:name="Measure"><value>C;9144;3810;8890;3570;1108;0;2;1</value></prop></node>
-<node oor:name="L82" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8221 Endlosetiketten 2-bahnig</value></prop>
+<node oor:name="L82" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8221 Endlosetiketten 2-bahnig</value></prop>
<prop oor:name="Measure"><value>C;9144;2540;8890;2300;1108;0;2;1</value></prop></node>
-<node oor:name="L83" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8222 Endlosetiketten 2-bahnig</value></prop>
+<node oor:name="L83" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8222 Endlosetiketten 2-bahnig</value></prop>
<prop oor:name="Measure"><value>C;5334;3810;5080;3570;1043;0;2;1</value></prop></node>
-<node oor:name="L84" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8223 Endlosetiketten 2-bahnig</value></prop>
+<node oor:name="L84" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8223 Endlosetiketten 2-bahnig</value></prop>
<prop oor:name="Measure"><value>C;4064;2540;3810;2300;1613;0;2;1</value></prop></node>
-<node oor:name="L85" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8225 Endlosetiketten 2-bahnig</value></prop>
+<node oor:name="L85" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8225 Endlosetiketten 2-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10414;3810;10160;3570;1213;0;2;1</value></prop></node>
-<node oor:name="L86" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8226 Endlosetiketten 2-bahnig</value></prop>
+<node oor:name="L86" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8226 Endlosetiketten 2-bahnig</value></prop>
<prop oor:name="Measure"><value>C;9144;5080;8890;4840;1108;0;2;1</value></prop></node>
-<node oor:name="L87" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8227 Endlosetiketten 2-bahnig</value></prop>
+<node oor:name="L87" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8227 Endlosetiketten 2-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10414;5080;10160;4840;1213;0;2;1</value></prop></node>
-<node oor:name="L88" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8228 Endlosetiketten 2-bahnig</value></prop>
+<node oor:name="L88" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8228 Endlosetiketten 2-bahnig</value></prop>
<prop oor:name="Measure"><value>C;4064;1270;3810;1030;1613;0;2;1</value></prop></node>
-<node oor:name="L89" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8229 Endlosetiketten 2-bahnig</value></prop>
+<node oor:name="L89" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8229 Endlosetiketten 2-bahnig</value></prop>
<prop oor:name="Measure"><value>C;5334;2540;5080;2300;1043;0;2;1</value></prop></node>
-<node oor:name="L90" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8230 Endlosetiketten 3-bahnig</value></prop>
+<node oor:name="L90" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8230 Endlosetiketten 3-bahnig</value></prop>
<prop oor:name="Measure"><value>C;9144;2540;8890;2300;1211;0;3;1</value></prop></node>
-<node oor:name="L91" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8231 Endlosetiketten 3-bahnig</value></prop>
+<node oor:name="L91" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8231 Endlosetiketten 3-bahnig</value></prop>
<prop oor:name="Measure"><value>C;9144;3810;8890;3570;1211;0;3;1</value></prop></node>
-<node oor:name="L92" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8232 Endlosetiketten 3-bahnig</value></prop>
+<node oor:name="L92" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8232 Endlosetiketten 3-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10414;3810;10160;3570;1156;0;3;1</value></prop></node>
-<node oor:name="L93" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8233 Endlosetiketten 3-bahnig</value></prop>
+<node oor:name="L93" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8233 Endlosetiketten 3-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10922;5080;10668;4840;1244;0;3;1</value></prop></node>
-<node oor:name="L94" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8234 Endlosetiketten 3-bahnig</value></prop>
+<node oor:name="L94" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8234 Endlosetiketten 3-bahnig</value></prop>
<prop oor:name="Measure"><value>C;9144;5080;8890;4840;1211;0;3;1</value></prop></node>
-<node oor:name="L95" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8235 Endlosetiketten 3-bahnig</value></prop>
+<node oor:name="L95" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8235 Endlosetiketten 3-bahnig</value></prop>
<prop oor:name="Measure"><value>C;11430;5080;11176;4840;1232;0;3;1</value></prop></node>
-<node oor:name="L96" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8236 Endlosetiketten 3-bahnig, mit Querperforation</value></prop>
+<node oor:name="L96" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8236 Endlosetiketten 3-bahnig, mit Querperforation</value></prop>
<prop oor:name="Measure"><value>C;7112;3810;6858;3570;1209;0;3;1</value></prop></node>
-<node oor:name="L97" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8237 Endlosetiketten 3-bahnig</value></prop>
+<node oor:name="L97" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8237 Endlosetiketten 3-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10922;3810;10668;3570;1244;0;3;1</value></prop></node>
-<node oor:name="L98" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8238 Endlosetiketten 3-bahnig</value></prop>
+<node oor:name="L98" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8238 Endlosetiketten 3-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10414;5080;10160;4840;1156;0;3;1</value></prop></node>
-<node oor:name="L99" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8240 Endlosetiketten 4-bahnig</value></prop>
+<node oor:name="L99" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8240 Endlosetiketten 4-bahnig</value></prop>
<prop oor:name="Measure"><value>C;7620;3810;7366;3570;1087;0;4;1</value></prop></node>
-<node oor:name="L100" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8241 Endlosetiketten 4-bahnig</value></prop>
+<node oor:name="L100" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8241 Endlosetiketten 4-bahnig</value></prop>
<prop oor:name="Measure"><value>C;8382;2540;8128;2300;1213;0;4;1</value></prop></node>
-<node oor:name="L101" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8242 Endlosetiketten 4-bahnig</value></prop>
+<node oor:name="L101" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8242 Endlosetiketten 4-bahnig</value></prop>
<prop oor:name="Measure"><value>C;8382;3810;8128;3570;1213;0;4;1</value></prop></node>
-<node oor:name="L102" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8243 Endlosetiketten 4-bahnig</value></prop>
+<node oor:name="L102" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8243 Endlosetiketten 4-bahnig</value></prop>
<prop oor:name="Measure"><value>C;8382;5080;8128;4840;1213;0;4;1</value></prop></node>
-<node oor:name="L103" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8245 Endlosetiketten 4-bahnig</value></prop>
+<node oor:name="L103" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8245 Endlosetiketten 4-bahnig</value></prop>
<prop oor:name="Measure"><value>C;5334;2540;5080;2300;1209;0;4;1</value></prop></node>
-<node oor:name="L104" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8246 Endlosetiketten 4-bahnig</value></prop>
+<node oor:name="L104" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8246 Endlosetiketten 4-bahnig</value></prop>
<prop oor:name="Measure"><value>C;5334;3810;5080;3570;1209;0;4;1</value></prop></node>
-<node oor:name="L105" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8265 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L105" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8265 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;12700;5080;12700;4840;1150;0;1;1</value></prop></node>
-<node oor:name="L106" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8266 Endlosetiketten 2-bahnig</value></prop>
+<node oor:name="L106" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8266 Endlosetiketten 2-bahnig</value></prop>
<prop oor:name="Measure"><value>C;12954;5080;12700;4840;1173;0;2;1</value></prop></node>
-<node oor:name="L107" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8267 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L107" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8267 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;7874;3810;7874;3570;1063;0;1;1</value></prop></node>
-<node oor:name="L108" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8268 Endlosetiketten 3-bahnig, Kennzeichnung</value></prop>
+<node oor:name="L108" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8268 Endlosetiketten 3-bahnig, Kennzeichnung</value></prop>
<prop oor:name="Measure"><value>C;2794;1693;2540;1453;1486;0;3;1</value></prop></node>
-<node oor:name="L109" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8002 Endlosetiketten 3-bahnig, Kennzeichnung</value></prop>
+<node oor:name="L109" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8002 Endlosetiketten 3-bahnig, Kennzeichnung</value></prop>
<prop oor:name="Measure"><value>C;2794;1693;2540;1453;1486;0;3;1</value></prop></node>
-<node oor:name="L110" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8269 Endlosetiketten 1-bahnig, mit Querperforation</value></prop>
+<node oor:name="L110" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8269 Endlosetiketten 1-bahnig, mit Querperforation</value></prop>
<prop oor:name="Measure"><value>C;21082;15240;21082;15000;1209;0;1;1</value></prop></node>
-<node oor:name="L111" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8290 Endlosetiketten 2-bahnig, mit Querperforation</value></prop>
+<node oor:name="L111" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8290 Endlosetiketten 2-bahnig, mit Querperforation</value></prop>
<prop oor:name="Measure"><value>C;14986;10160;14732;9920;1141;0;2;1</value></prop></node>
-<node oor:name="L112" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8291 Endlosetiketten 1-bahnig, 3,5"-Diskette</value></prop>
+<node oor:name="L112" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8291 Endlosetiketten 1-bahnig, 3,5"-Diskette</value></prop>
<prop oor:name="Measure"><value>C;7112;7620;7112;6960;1994;0;1;1</value></prop></node>
-<node oor:name="L113" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8292 Endlosetiketten 1-bahnig, mit Querperforation</value></prop>
+<node oor:name="L113" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8292 Endlosetiketten 1-bahnig, mit Querperforation</value></prop>
<prop oor:name="Measure"><value>C;14732;10160;14732;9920;1134;0;1;1</value></prop></node>
-<node oor:name="L114" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8293 Endlosetiketten 1-bahnig, mit Querperforation</value></prop>
+<node oor:name="L114" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8293 Endlosetiketten 1-bahnig, mit Querperforation</value></prop>
<prop oor:name="Measure"><value>C;14732;5080;14732;4840;1134;0;1;1</value></prop></node>
-<node oor:name="L115" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8294 Endlosetiketten 1-bahnig, mit Querperforation</value></prop>
+<node oor:name="L115" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8294 Endlosetiketten 1-bahnig, mit Querperforation</value></prop>
<prop oor:name="Measure"><value>C;14732;7620;14732;7380;1134;0;1;1</value></prop></node>
-<node oor:name="L116" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8295 Endlosetiketten 8-bahnig</value></prop>
+<node oor:name="L116" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8295 Endlosetiketten 8-bahnig</value></prop>
<prop oor:name="Measure"><value>C;4064;1270;3810;1030;1371;0;8;1</value></prop></node>
-<node oor:name="L117" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8296 Endlosetiketten 1-bahnig</value></prop>
+<node oor:name="L117" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8296 Endlosetiketten 1-bahnig</value></prop>
<prop oor:name="Measure"><value>C;10668;5080;10668;4840;916;0;1;1</value></prop></node>
-<node oor:name="L118" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value xml:lang="x-no-translate">true</value><value xml:lang="en-US">8299 Endlosetiketten 1-bahnig, 5,25"-Diskette, ablösbar</value></prop>
+<node oor:name="L118" oor:op="replace" oor:finalized="true"><prop oor:name="Name"><value>8299 Endlosetiketten 1-bahnig, 5,25"-Diskette, ablösbar</value></prop>
<prop oor:name="Measure"><value>C;7112;3386;7112;3146;1444;0;1;1</value></prop></node>
</node>
<node oor:name="Leitz" oor:op="replace">
@@ -14563,7 +13462,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">1680 Kartonrückenschilder, breit</value>
+ <value>1680 Kartonrückenschilder, breit</value>
</prop>
<prop oor:name="Measure">
@@ -14574,7 +13473,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">1681 Kartonrückenschilder, schmal</value>
+ <value>1681 Kartonrückenschilder, schmal</value>
</prop>
<prop oor:name="Measure">
@@ -14585,7 +13484,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">1685 Papierrückenschilder selbstkl., breit</value>
+ <value>1685 Papierrückenschilder selbstkl., breit</value>
</prop>
<prop oor:name="Measure">
@@ -14596,7 +13495,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">1686 Papierrückenschilder selbstkl., schmal</value>
+ <value>1686 Papierrückenschilder selbstkl., schmal</value>
</prop>
<prop oor:name="Measure">
@@ -14607,7 +13506,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">1687 Papierrückenschilder selbstkl., breit</value>
+ <value>1687 Papierrückenschilder selbstkl., breit</value>
</prop>
<prop oor:name="Measure">
@@ -14618,7 +13517,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">1688 Papierrückenschilder selbstkl., schmal</value>
+ <value>1688 Papierrückenschilder selbstkl., schmal</value>
</prop>
<prop oor:name="Measure">
@@ -14629,7 +13528,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">6098 Papierrückenschilder selbstkl., breit</value>
+ <value>6098 Papierrückenschilder selbstkl., breit</value>
</prop>
<prop oor:name="Measure">
@@ -14640,7 +13539,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">6099 Papierrückenschilder selbstkl., schmal</value>
+ <value>6099 Papierrückenschilder selbstkl., schmal</value>
</prop>
<prop oor:name="Measure">
@@ -14651,7 +13550,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">1900 Blanko-Schildchen</value>
+ <value>1900 Blanko-Schildchen</value>
</prop>
<prop oor:name="Measure">
@@ -14662,7 +13561,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">2466 Blanko-Schildchen</value>
+ <value>2466 Blanko-Schildchen</value>
</prop>
<prop oor:name="Measure">
@@ -14673,7 +13572,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">6010 Blanko-Schildchen</value>
+ <value>6010 Blanko-Schildchen</value>
</prop>
<prop oor:name="Measure">
@@ -14684,7 +13583,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">6643 Beschriftungsschilder, selbstklebend </value>
+ <value>6643 Beschriftungsschilder, selbstklebend </value>
</prop>
<prop oor:name="Measure">
@@ -14698,7 +13597,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">DP001 Tischkarten blanko weiß</value>
+ <value>DP001 Tischkarten blanko weiß</value>
</prop>
<prop oor:name="Measure">
@@ -14709,7 +13608,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">DP002 Tischkarten konturgestanzt</value>
+ <value>DP002 Tischkarten konturgestanzt</value>
</prop>
<prop oor:name="Measure">
@@ -14720,7 +13619,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">DE115 Design-Etiketten</value>
+ <value>DE115 Design-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -14731,7 +13630,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">DE141 Design-Etiketten</value>
+ <value>DE141 Design-Etiketten</value>
</prop>
<prop oor:name="Measure">
@@ -14742,7 +13641,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">LP750 CD-Einleger</value>
+ <value>LP750 CD-Einleger</value>
</prop>
<prop oor:name="Measure">
@@ -14753,7 +13652,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">DD300 CD-Einleger</value>
+ <value>DD300 CD-Einleger</value>
</prop>
<prop oor:name="Measure">
@@ -14764,7 +13663,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">DD405 CD-Einleger</value>
+ <value>DD405 CD-Einleger</value>
</prop>
<prop oor:name="Measure">
@@ -14775,7 +13674,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">LP755 CD-Booklet</value>
+ <value>LP755 CD-Booklet</value>
</prop>
<prop oor:name="Measure">
@@ -14786,7 +13685,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">DD450 CD-Booklet</value>
+ <value>DD450 CD-Booklet</value>
</prop>
<prop oor:name="Measure">
@@ -14797,7 +13696,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">DP839/DP939 Design-Visitenkarten</value>
+ <value>DP839/DP939 Design-Visitenkarten</value>
</prop>
<prop oor:name="Measure">
@@ -14808,7 +13707,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">DP835/DP935 Design-Visitenkarten gestanzt</value>
+ <value>DP835/DP935 Design-Visitenkarten gestanzt</value>
</prop>
<prop oor:name="Measure">
@@ -14819,7 +13718,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">DP836/DP936 Design-Visitenkarten</value>
+ <value>DP836/DP936 Design-Visitenkarten</value>
</prop>
<prop oor:name="Measure">
@@ -14830,7 +13729,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">DP837/DP937 Design-Visitenkarten gestanzt, m. abger. Ecken</value>
+ <value>DP837/DP937 Design-Visitenkarten gestanzt, m. abger. Ecken</value>
</prop>
<prop oor:name="Measure">
@@ -14841,7 +13740,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">DP838/DP938 Design-Klapp-Visitenkarten</value>
+ <value>DP838/DP938 Design-Klapp-Visitenkarten</value>
</prop>
<prop oor:name="Measure">
@@ -14852,7 +13751,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">LP781 Regalschild</value>
+ <value>LP781 Regalschild</value>
</prop>
<prop oor:name="Measure">
@@ -14863,7 +13762,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">LP731 Ordner-Einsteckschild</value>
+ <value>LP731 Ordner-Einsteckschild</value>
</prop>
<prop oor:name="Measure">
@@ -14874,7 +13773,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">LP734 Ordner-Einsteckschild</value>
+ <value>LP734 Ordner-Einsteckschild</value>
</prop>
<prop oor:name="Measure">
@@ -14885,7 +13784,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">LP710 Postkarte bedruckt</value>
+ <value>LP710 Postkarte bedruckt</value>
</prop>
<prop oor:name="Measure">
@@ -14896,7 +13795,7 @@
<prop oor:name="Name">
- <value xml:lang="x-no-translate">true</value><value xml:lang="en-US">LP711 Postkarte</value>
+ <value>LP711 Postkarte</value>
</prop>
<prop oor:name="Measure">
diff --git a/officecfg/registry/data/org/openoffice/Office/Paths.xcu b/officecfg/registry/data/org/openoffice/Office/Paths.xcu
index 433e399759..bb062d94a8 100644
--- a/officecfg/registry/data/org/openoffice/Office/Paths.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Paths.xcu
@@ -223,6 +223,13 @@
</prop>
</node>
</node>
-
+ <node oor:name="Variables">
+ <prop oor:name="Work">
+ <value install:module="macosx" oor:external=
+ "com.sun.star.configuration.backend.MacOSXBackend WorkPathVariable"/>
+ <value install:module="unixdesktop" oor:external=
+ "com.sun.star.configuration.backend.DesktopBackend WorkPathVariable"/>
+ </prop>
+ </node>
</oor:component-data>
diff --git a/officecfg/registry/data/org/openoffice/Office/Recovery.xcu b/officecfg/registry/data/org/openoffice/Office/Recovery.xcu
new file mode 100644
index 0000000000..efe80701a6
--- /dev/null
+++ b/officecfg/registry/data/org/openoffice/Office/Recovery.xcu
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<oor:component-data xmlns:install="http://openoffice.org/2004/installation"
+ xmlns:oor="http://openoffice.org/2001/registry"
+ oor:package="org.openoffice.Office" oor:name="Recovery">
+ <node oor:name="AutoSave" install:module="gconflockdown">
+ <prop oor:name="Enabled">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend AutoSaveEnabled"/>
+ </prop>
+ <prop oor:name="TimeIntervall">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend AutoSaveTimeIntervall"/>
+ </prop>
+ </node>
+</oor:component-data>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/BasicIDEWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/BasicIDEWindowState.xcu
index a53f9632e2..8ba1a72b81 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/BasicIDEWindowState.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/BasicIDEWindowState.xcu
@@ -113,7 +113,7 @@
</prop>
<prop oor:name="Docked" oor:type="xs:boolean">
- <value>False</value>
+ <value>false</value>
</prop>
<prop oor:name="Visible" oor:type="xs:boolean">
<value>true</value>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/ChartCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/ChartCommands.xcu
index cc40843f4d..6619f83e8e 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/ChartCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/ChartCommands.xcu
@@ -529,7 +529,7 @@
<value xml:lang="en-US">Select Chart Element</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
+ <value>0</value>
</prop>
</node>
@@ -656,6 +656,29 @@
<value xml:lang="en-US">Number of lines in combination chart</value>
</prop>
</node>
+ <node oor:name=".uno:TextAttributes" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Te~xt...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:ObjectTitleDescription" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Description...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:RenameObject" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Name...</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:LineArrowEnd" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Line Ends with Arrow</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
</node>
<!-- menu items with sub menu -->
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/ChartWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/ChartWindowState.xcu
index 337efa0969..2397810ed2 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/ChartWindowState.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/ChartWindowState.xcu
@@ -59,6 +59,20 @@
<value>true</value>
</prop>
</node>
+ <node oor:name="private:resource/toolbar/drawbar" oor:op="replace">
+ <prop oor:name="Docked" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ <prop oor:name="DockingArea" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Drawing</value>
+ </prop>
+ <prop oor:name="Visible" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
</node>
</node>
</oor:component-data>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu
index 65c884fe51..d57d1b3b4d 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu
@@ -220,15 +220,81 @@
</node>
<node oor:name="c3" oor:op="replace">
<prop oor:name="Command">
- <value>.uno:ChartElementSelector</value>
+ <value>.uno:ChartElementSelector</value>
</prop>
<prop oor:name="Module">
- <value>com.sun.star.chart2.ChartDocument</value>
+ <value>com.sun.star.chart2.ChartDocument</value>
</prop>
<prop oor:name="Controller">
- <value>com.sun.star.comp.chart.ElementSelectorToolbarController</value>
+ <value>com.sun.star.comp.chart.ElementSelectorToolbarController</value>
</prop>
- </node>
+ </node>
+ <node oor:name="c4" oor:op="replace">
+ <prop oor:name="Command">
+ <value>.uno:BasicShapes</value>
+ </prop>
+ <prop oor:name="Module">
+ <value>com.sun.star.chart2.ChartDocument</value>
+ </prop>
+ <prop oor:name="Controller">
+ <value>com.sun.star.chart2.comp.ShapeToolbarController</value>
+ </prop>
+ </node>
+ <node oor:name="c5" oor:op="replace">
+ <prop oor:name="Command">
+ <value>.uno:SymbolShapes</value>
+ </prop>
+ <prop oor:name="Module">
+ <value>com.sun.star.chart2.ChartDocument</value>
+ </prop>
+ <prop oor:name="Controller">
+ <value>com.sun.star.chart2.comp.ShapeToolbarController</value>
+ </prop>
+ </node>
+ <node oor:name="c6" oor:op="replace">
+ <prop oor:name="Command">
+ <value>.uno:ArrowShapes</value>
+ </prop>
+ <prop oor:name="Module">
+ <value>com.sun.star.chart2.ChartDocument</value>
+ </prop>
+ <prop oor:name="Controller">
+ <value>com.sun.star.chart2.comp.ShapeToolbarController</value>
+ </prop>
+ </node>
+ <node oor:name="c7" oor:op="replace">
+ <prop oor:name="Command">
+ <value>.uno:FlowChartShapes</value>
+ </prop>
+ <prop oor:name="Module">
+ <value>com.sun.star.chart2.ChartDocument</value>
+ </prop>
+ <prop oor:name="Controller">
+ <value>com.sun.star.chart2.comp.ShapeToolbarController</value>
+ </prop>
+ </node>
+ <node oor:name="c8" oor:op="replace">
+ <prop oor:name="Command">
+ <value>.uno:CalloutShapes</value>
+ </prop>
+ <prop oor:name="Module">
+ <value>com.sun.star.chart2.ChartDocument</value>
+ </prop>
+ <prop oor:name="Controller">
+ <value>com.sun.star.chart2.comp.ShapeToolbarController</value>
+ </prop>
+ </node>
+ <node oor:name="c9" oor:op="replace">
+ <prop oor:name="Command">
+ <value>.uno:StarShapes</value>
+ </prop>
+ <prop oor:name="Module">
+ <value>com.sun.star.chart2.ChartDocument</value>
+ </prop>
+ <prop oor:name="Controller">
+ <value>com.sun.star.chart2.comp.ShapeToolbarController</value>
+ </prop>
+ </node>
</node>
<node oor:name="StatusBar">
<node oor:name="c1" oor:op="replace">
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu
index 735fcd0204..af45c79cdf 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu
@@ -129,9 +129,6 @@
<prop oor:name="DockingArea" oor:type="xs:int">
<value>0</value>
</prop>
- <prop oor:name="Style" oor:type="xs:int">
- <value>2</value>
- </prop>
<prop oor:name="Visible" oor:type="xs:boolean">
<value>true</value>
</prop>
diff --git a/officecfg/registry/data/org/openoffice/Office/makefile.mk b/officecfg/registry/data/org/openoffice/Office/makefile.mk
index 20ce0479e6..5cd876f75b 100644
--- a/officecfg/registry/data/org/openoffice/Office/makefile.mk
+++ b/officecfg/registry/data/org/openoffice/Office/makefile.mk
@@ -74,6 +74,8 @@ MODULEFILES= \
Common-base.xcu \
Common-math.xcu \
Common-unx.xcu \
+ Common-unixdesktop.xcu \
+ Common-gconflockdown.xcu \
Common-macosx.xcu \
Common-wnt.xcu \
Common-UseOOoFileDialogs.xcu \
@@ -84,6 +86,7 @@ MODULEFILES= \
Common-korea.xcu \
Paths-macosx.xcu \
Paths-unxwnt.xcu \
+ Paths-unixdesktop.xcu \
Writer-cjk.xcu \
Writer-javamail.xcu \
Impress-ogltrans.xcu \
@@ -94,8 +97,8 @@ MODULEFILES= \
Embedding-math.xcu \
Embedding-base.xcu \
Embedding-writer.xcu \
- UI-brand.xcu
-
+ UI-brand.xcu \
+ Recovery-gconflockdown.xcu
LOCALIZEDFILES= \
Accelerators.xcu \
diff --git a/officecfg/registry/data/org/openoffice/Setup.xcu b/officecfg/registry/data/org/openoffice/Setup.xcu
index e8e34c53c4..087e2cf6c5 100644..100755
--- a/officecfg/registry/data/org/openoffice/Setup.xcu
+++ b/officecfg/registry/data/org/openoffice/Setup.xcu
@@ -326,7 +326,7 @@
<value >swform</value>
</prop>
<prop oor:name="ooSetupFactoryUIName">
- <value xml:lang="en-US">Base: Form Design</value>
+ <value>Base: Form Design</value>
</prop>
<prop oor:name="ooSetupFactoryWindowStateConfigRef">
<value >WriterFormWindowState</value>
@@ -361,7 +361,7 @@
<value>swreport</value>
</prop>
<prop oor:name="ooSetupFactoryUIName">
- <value xml:lang="en-US">Base: Report Design</value>
+ <value>Base: Report Design</value>
</prop>
<prop oor:name="ooSetupFactoryWindowStateConfigRef">
<value>WriterReportWindowState</value>
@@ -399,8 +399,7 @@
<value >swxform</value>
</prop>
<prop oor:name="ooSetupFactoryUIName">
- <value xml:lang="en-US">XML Form Document</value>
- <value xml:lang="de">XML Formulardokumente</value>
+ <value>XML Form Document</value>
</prop>
<prop oor:name="ooSetupFactoryWindowStateConfigRef">
<value >XFormsWindowState</value>
@@ -470,7 +469,7 @@
<value >GenericCategories</value>
</prop>
<prop oor:name="ooSetupFactoryUIName">
- <value xml:lang="en-US">Base: Relation Design</value>
+ <value>Base: Relation Design</value>
</prop>
</node>
<node oor:name="com.sun.star.sdb.QueryDesign" oor:op="replace" install:module="base">
@@ -495,7 +494,7 @@
<value >GenericCategories</value>
</prop>
<prop oor:name="ooSetupFactoryUIName">
- <value xml:lang="en-US">Base: Query Design</value>
+ <value>Base: Query Design</value>
</prop>
</node>
<node oor:name="com.sun.star.sdb.ViewDesign" oor:op="replace" install:module="base">
@@ -520,7 +519,7 @@
<value >GenericCategories</value>
</prop>
<prop oor:name="ooSetupFactoryUIName">
- <value xml:lang="en-US">Base: View Design</value>
+ <value>Base: View Design</value>
</prop>
</node>
<node oor:name="com.sun.star.sdb.TableDesign" oor:op="replace" install:module="base">
@@ -545,7 +544,7 @@
<value >GenericCategories</value>
</prop>
<prop oor:name="ooSetupFactoryUIName">
- <value xml:lang="en-US">Base: Table Design</value>
+ <value>Base: Table Design</value>
</prop>
</node>
<node oor:name="com.sun.star.sdb.DataSourceBrowser" oor:op="replace" install:module="base">
@@ -570,7 +569,7 @@
<value >GenericCategories</value>
</prop>
<prop oor:name="ooSetupFactoryUIName">
- <value xml:lang="en-US">Base: Data View</value>
+ <value>Base: Data View</value>
</prop>
</node>
<node oor:name="com.sun.star.sdb.TableDataView" oor:op="replace" install:module="base">
@@ -595,7 +594,7 @@
<value>GenericCategories</value>
</prop>
<prop oor:name="ooSetupFactoryUIName">
- <value>Table Data View</value>
+ <value xml:lang="en-US">Base: Table Data View</value>
</prop>
</node>
<node oor:name="com.sun.star.frame.Bibliography" oor:op="replace">
@@ -617,7 +616,7 @@
<value >GenericCategories</value>
</prop>
<prop oor:name="ooSetupFactoryUIName">
- <value >Bibliography</value>
+ <value xml:lang="en-US">Bibliography</value>
</prop>
</node>
<node oor:name="com.sun.star.script.BasicIDE" oor:op="replace">
@@ -751,174 +750,182 @@
<value>true</value>
</prop>
</node>
- <node oor:name="Migration">
- <prop oor:name="SupportedVersions">
- <value oor:separator=",">OpenOffice.org 2=openoffice.org2,StarOffice 8=staroffice8,StarSuite 8=starsuite8</value>
+ <node oor:name="Migration">
+ <node oor:name="SupportedVersions">
+ <node oor:name="OpenOffice.org2+StarOffice8+StarSuite8" oor:op="replace">
+ <prop oor:name="Priority">
+ <value>10</value>
</prop>
- <node oor:name="MigrationSteps">
- <node oor:name="Datasources" oor:op="replace">
- <prop oor:name="IncludedFiles">
- <value>.*/database/biblio/biblio\.dbf</value>
- </prop>
- <prop oor:name="ExcludedFiles">
- </prop>
- <prop oor:name="IncludedNodes">
- <value>org.openoffice.Office.DataAccess</value>
- </prop>
- <prop oor:name="ExcludedNodes">
- <value>
- org.openoffice.Office.DataAccess/Bibliography
- org.openoffice.Office.DataAccess/ConnectionPool
- org.openoffice.Office.DataAccess/DataSources
- org.openoffice.Office.DataAccess/DriverManager
- </value>
- </prop>
- </node>
- <node oor:name="Deployment" oor:op="replace">
- <prop oor:name="MigrationService">
- <value>com.sun.star.migration.Extensions</value>
- </prop>
- </node>
- <node oor:name="Inet" oor:op="replace">
- <prop oor:name="IncludedNodes">
- <value>org.openoffice.Inet
- </value>
- </prop>
- </node>
- <node oor:name="Basic" oor:op="replace">
- <prop oor:name="MigrationService">
- <value>com.sun.star.migration.Basic</value>
- </prop>
- </node>
- <node oor:name="UserProfile" oor:op="replace">
- <prop oor:name="IncludedNodes">
- <value>org.openoffice.UserProfile</value>
- </prop>
- </node>
- <node oor:name="Common" oor:op="replace">
- <prop oor:name="IncludedFiles">
- <value>
- .*/autotext/.*
- .*/autocorr/.*
- .*/config/.*\.so[bcdegh]
- .*/config/soffice.cfg/modules/.*/toolbar/custom.*\.xml
- .*/config/soffice.cfg/modules/.*/images/.*
- .*/gallery/.*
- .*/template/.*
- </value>
- </prop>
- <prop oor:name="IncludedNodes">
- <value>
- org.openoffice.Office.Compatibility
- org.openoffice.Office.Custom
- org.openoffice.Office.Embedding
- org.openoffice.Office.Events
- org.openoffice.Office.ExtendedColorScheme
- org.openoffice.Office.Common/Accessibility
- org.openoffice.Office.Common/Accessibility/AutoDetectSystemHC
- org.openoffice.Office.Common/AsianLayout
- org.openoffice.Office.Common/AutoCorrect
- org.openoffice.Office.Common/Cache
- org.openoffice.Office.Common/DateFormat
- org.openoffice.Office.Common/ExternalMailer/Program
- org.openoffice.Office.Common/Filter
- org.openoffice.Office.Common/Font
- org.openoffice.Office.Common/Forms
- org.openoffice.Office.Common/Gallery
- org.openoffice.Office.Common/Help
- org.openoffice.Office.Common/History
- org.openoffice.Office.Common/I18N
- org.openoffice.Office.Common/InternalMSExport
- org.openoffice.Office.Common/Load
- org.openoffice.Office.Common/Misc/FormControlPilotsEnabled
- org.openoffice.Office.Common/Misc/PluginsEnabled
- org.openoffice.Office.Common/Misc/SymbolSet
- org.openoffice.Office.Common/Misc/UseSystemFileDialog
- org.openoffice.Office.Common/Misc/UseSystemPrintDialog
- org.openoffice.Office.Common/Misc/SymbolStyle
- org.openoffice.Office.Common/Passwords
- org.openoffice.Office.Common/Print/PrintingModifiesDocument
- org.openoffice.Office.Common/Print/Warning
- org.openoffice.Office.Common/Vectorize
- org.openoffice.Office.Common/Save
- org.openoffice.Office.Common/SearchOptions
- org.openoffice.Office.Common/Undo
- org.openoffice.Office.Common/View/Dialog/Dialog/MiddleMouseButton
- org.openoffice.Office.Common/View/Dialog/MousePositioning
- org.openoffice.Office.Common/View/Localization
- org.openoffice.Office.Common/View/Menu
- org.openoffice.Office.Common/_3D_Engine
- </value>
- </prop>
- <prop oor:name="ExcludedNodes">
- <value>
- org.openoffice.Office.Common/_3D_Engine/OpenGL
- org.openoffice.Office.Common/Help/Registration
- </value>
- </prop>
- </node>
- <node oor:name="Calc" oor:op="replace">
- <prop oor:name="IncludedNodes">
- <value>org.openoffice.Office.Calc</value>
- </prop>
- </node>
- <node oor:name="Chart" oor:op="replace">
- <prop oor:name="IncludedNodes">
- <value>org.openoffice.Office.Chart</value>
- </prop>
- </node>
- <node oor:name="Draw" oor:op="replace">
- <prop oor:name="IncludedNodes">
- <value>org.openoffice.Office.Draw</value>
- </prop>
- </node>
- <node oor:name="Impress" oor:op="replace">
- <prop oor:name="IncludedNodes">
- <value>org.openoffice.Office.Impress</value>
- </prop>
- </node>
- <node oor:name="Labels" oor:op="replace">
- <prop oor:name="IncludedNodes">
- <value>org.openoffice.Office.Labels</value>
- </prop>
- </node>
- <node oor:name="Linguistic" oor:op="replace">
- <prop oor:name="MigrationService">
- <value>com.sun.star.migration.Wordbooks</value>
- </prop>
- <prop oor:name="IncludedNodes">
- <value>org.openoffice.Office.Linguistic</value>
- </prop>
- <prop oor:name="ExcludedNodes">
- <value>org.openoffice.Office.Linguistic/ServiceManager</value>
- </prop>
- </node>
- <node oor:name="Math" oor:op="replace">
- <prop oor:name="IncludedNodes">
- <value>org.openoffice.Office.Math</value>
- </prop>
- </node>
- <node oor:name="Security" oor:op="replace">
- <prop oor:name="IncludedNodes">
- <value>org.openoffice.Office.Security</value>
- </prop>
- </node>
- <node oor:name="UI" oor:op="replace">
- <prop oor:name="IncludedNodes">
- <value>org.openoffice.Office.UI/ColorScheme</value>
- </prop>
- </node>
- <node oor:name="Writer" oor:op="replace">
- <prop oor:name="IncludedNodes">
- <value>
- org.openoffice.Office.Writer
- org.openoffice.Office.WriterWeb
- </value>
- </prop>
- <prop oor:name="ExcludedNodes">
- <value>org.openoffice.Office.Writer/Wizard</value>
+ <prop oor:name="VersionIdentifiers">
+ <value oor:separator=",">OpenOffice.org 2=openoffice.org2,StarOffice 8=staroffice8,StarSuite 8=starsuite8</value>
</prop>
+ <node oor:name="MigrationSteps">
+ <node oor:name="Datasources" oor:op="replace">
+ <prop oor:name="IncludedFiles">
+ <value>.*/database/biblio/biblio\.dbf</value>
+ </prop>
+ <prop oor:name="ExcludedFiles">
+ </prop>
+ <prop oor:name="IncludedNodes">
+ <value>org.openoffice.Office.DataAccess</value>
+ </prop>
+ <prop oor:name="ExcludedNodes">
+ <value>
+ org.openoffice.Office.DataAccess/Bibliography
+ org.openoffice.Office.DataAccess/ConnectionPool
+ org.openoffice.Office.DataAccess/DataSources
+ org.openoffice.Office.DataAccess/DriverManager
+ </value>
+ </prop>
+ </node>
+ <node oor:name="Deployment" oor:op="replace">
+ <prop oor:name="MigrationService">
+ <value>com.sun.star.migration.Extensions</value>
+ </prop>
+ </node>
+ <node oor:name="Inet" oor:op="replace">
+ <prop oor:name="IncludedNodes">
+ <value>
+ org.openoffice.Inet
+ </value>
+ </prop>
+ </node>
+ <node oor:name="Basic" oor:op="replace">
+ <prop oor:name="MigrationService">
+ <value>com.sun.star.migration.Basic</value>
+ </prop>
+ </node>
+ <node oor:name="UserProfile" oor:op="replace">
+ <prop oor:name="IncludedNodes">
+ <value>org.openoffice.UserProfile</value>
+ </prop>
+ </node>
+ <node oor:name="Common" oor:op="replace">
+ <prop oor:name="IncludedFiles">
+ <value>
+ .*/autotext/.*
+ .*/autocorr/.*
+ .*/config/.*\.so[bcdegh]
+ .*/config/soffice.cfg/modules/.*/toolbar/custom.*\.xml
+ .*/config/soffice.cfg/modules/.*/images/.*
+ .*/gallery/.*
+ .*/template/.*
+ </value>
+ </prop>
+ <prop oor:name="IncludedNodes">
+ <value>
+ org.openoffice.Office.Compatibility
+ org.openoffice.Office.Custom
+ org.openoffice.Office.Embedding
+ org.openoffice.Office.Events
+ org.openoffice.Office.ExtendedColorScheme
+ org.openoffice.Office.Common/Accessibility
+ org.openoffice.Office.Common/Accessibility/AutoDetectSystemHC
+ org.openoffice.Office.Common/AsianLayout
+ org.openoffice.Office.Common/AutoCorrect
+ org.openoffice.Office.Common/Cache
+ org.openoffice.Office.Common/DateFormat
+ org.openoffice.Office.Common/ExternalMailer/Program
+ org.openoffice.Office.Common/Filter
+ org.openoffice.Office.Common/Font
+ org.openoffice.Office.Common/Forms
+ org.openoffice.Office.Common/Gallery
+ org.openoffice.Office.Common/Help
+ org.openoffice.Office.Common/History
+ org.openoffice.Office.Common/I18N
+ org.openoffice.Office.Common/InternalMSExport
+ org.openoffice.Office.Common/Load
+ org.openoffice.Office.Common/Misc/FormControlPilotsEnabled
+ org.openoffice.Office.Common/Misc/PluginsEnabled
+ org.openoffice.Office.Common/Misc/SymbolSet
+ org.openoffice.Office.Common/Misc/UseSystemFileDialog
+ org.openoffice.Office.Common/Misc/UseSystemPrintDialog
+ org.openoffice.Office.Common/Misc/SymbolStyle
+ org.openoffice.Office.Common/Passwords
+ org.openoffice.Office.Common/Print/PrintingModifiesDocument
+ org.openoffice.Office.Common/Print/Warning
+ org.openoffice.Office.Common/Vectorize
+ org.openoffice.Office.Common/Save
+ org.openoffice.Office.Common/SearchOptions
+ org.openoffice.Office.Common/Undo
+ org.openoffice.Office.Common/View/Dialog/Dialog/MiddleMouseButton
+ org.openoffice.Office.Common/View/Dialog/MousePositioning
+ org.openoffice.Office.Common/View/Localization
+ org.openoffice.Office.Common/View/Menu
+ org.openoffice.Office.Common/_3D_Engine
+ </value>
+ </prop>
+ <prop oor:name="ExcludedNodes">
+ <value>
+ org.openoffice.Office.Common/_3D_Engine/OpenGL
+ org.openoffice.Office.Common/Help/Registration
+ </value>
+ </prop>
+ </node>
+ <node oor:name="Calc" oor:op="replace">
+ <prop oor:name="IncludedNodes">
+ <value>org.openoffice.Office.Calc</value>
+ </prop>
+ </node>
+ <node oor:name="Chart" oor:op="replace">
+ <prop oor:name="IncludedNodes">
+ <value>org.openoffice.Office.Chart</value>
+ </prop>
+ </node>
+ <node oor:name="Draw" oor:op="replace">
+ <prop oor:name="IncludedNodes">
+ <value>org.openoffice.Office.Draw</value>
+ </prop>
+ </node>
+ <node oor:name="Impress" oor:op="replace">
+ <prop oor:name="IncludedNodes">
+ <value>org.openoffice.Office.Impress</value>
+ </prop>
+ </node>
+ <node oor:name="Labels" oor:op="replace">
+ <prop oor:name="IncludedNodes">
+ <value>org.openoffice.Office.Labels</value>
+ </prop>
+ </node>
+ <node oor:name="Linguistic" oor:op="replace">
+ <prop oor:name="MigrationService">
+ <value>com.sun.star.migration.Wordbooks</value>
+ </prop>
+ <prop oor:name="IncludedNodes">
+ <value>org.openoffice.Office.Linguistic</value>
+ </prop>
+ <prop oor:name="ExcludedNodes">
+ <value>org.openoffice.Office.Linguistic/ServiceManager</value>
+ </prop>
+ </node>
+ <node oor:name="Math" oor:op="replace">
+ <prop oor:name="IncludedNodes">
+ <value>org.openoffice.Office.Math</value>
+ </prop>
+ </node>
+ <node oor:name="Security" oor:op="replace">
+ <prop oor:name="IncludedNodes">
+ <value>org.openoffice.Office.Security</value>
+ </prop>
+ </node>
+ <node oor:name="UI" oor:op="replace">
+ <prop oor:name="IncludedNodes">
+ <value>org.openoffice.Office.UI/ColorScheme</value>
+ </prop>
+ </node>
+ <node oor:name="Writer" oor:op="replace">
+ <prop oor:name="IncludedNodes">
+ <value>
+ org.openoffice.Office.Writer
+ org.openoffice.Office.WriterWeb
+ </value>
+ </prop>
+ <prop oor:name="ExcludedNodes">
+ <value>org.openoffice.Office.Writer/Wizard</value>
+ </prop>
</node>
</node>
+ </node>
+ </node>
</node>
</oor:component-data>
diff --git a/officecfg/registry/data/org/openoffice/System.xcu b/officecfg/registry/data/org/openoffice/System.xcu
new file mode 100644
index 0000000000..9e3ae0ea77
--- /dev/null
+++ b/officecfg/registry/data/org/openoffice/System.xcu
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<oor:component-data xmlns:oor="http://openoffice.org/2001/registry"
+ oor:package="org.openoffice" oor:name="System">
+ <node oor:name="L10N">
+ <prop oor:name="Locale">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LocaleBackend Locale"/>
+ </prop>
+ <prop oor:name="UILocale">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LocaleBackend UILocale"/>
+ </prop>
+ <prop oor:name="SystemLocale">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LocaleBackend SystemLocale"/>
+ </prop>
+ </node>
+</oor:component-data>
diff --git a/officecfg/registry/data/org/openoffice/UserProfile.xcu b/officecfg/registry/data/org/openoffice/UserProfile.xcu
index 97d31ea182..4934c05e97 100644
--- a/officecfg/registry/data/org/openoffice/UserProfile.xcu
+++ b/officecfg/registry/data/org/openoffice/UserProfile.xcu
@@ -34,5 +34,12 @@
<prop oor:name="fathersname" oor:type="xs:string">
<value/>
</prop>
+ <prop oor:name="givenname" install:module="gconflockdown">
+ <value oor:external=
+ "com.sun.star.configuration.backend.GconfBackend givenname"/>
+ </prop>
+ <prop oor:name="sn" install:module="gconflockdown">
+ <value oor:external="com.sun.star.configuration.backend.GconfBackend sn"/>
+ </prop>
</node>
</oor:component-data>
diff --git a/officecfg/registry/data/org/openoffice/VCL.xcu b/officecfg/registry/data/org/openoffice/VCL.xcu
index 55a356599c..ef9c7a3bcc 100644
--- a/officecfg/registry/data/org/openoffice/VCL.xcu
+++ b/officecfg/registry/data/org/openoffice/VCL.xcu
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
<!--***********************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -26,16 +26,20 @@
*
************************************************************************ -->
<!DOCTYPE oor:component-data SYSTEM "../../../component-update.dtd">
-<oor:component-data oor:name="VCL" oor:package="org.openoffice" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<oor:component-data oor:name="VCL" oor:package="org.openoffice" xmlns:oor="http://openoffice.org/2001/registry" xmlns:install="http://openoffice.org/2004/installation" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<node oor:name="Settings">
<node oor:name="Accessibility" oor:op="replace">
<prop oor:name="EnableATToolSupport" oor:type="xs:string" oor:op="replace">
<value>false</value>
+ <value install:module="unixdesktop" oor:external=
+ "com.sun.star.configuration.backend.DesktopBackend EnableATToolSupport"/>
</prop>
</node>
<node oor:name="DesktopManagement" oor:op="replace">
<prop oor:name="DisablePrinting" oor:type="xs:string" oor:op="replace">
<value>false</value>
+ <value install:module="gconflockdown" oor:external=
+ "com.sun.star.configuration.backend.GconfBackend DisablePrinting"/>
</prop>
</node>
<node oor:name="Transfer" oor:op="replace">
@@ -1549,7 +1553,6 @@
</prop>
<prop oor:name="SubstFontsMS">
<value>바탕</value>
- <value></value>
</prop>
<prop oor:name="SubstFontsPS">
<value></value>
diff --git a/officecfg/registry/data/org/openoffice/makefile.mk b/officecfg/registry/data/org/openoffice/makefile.mk
index 72ef12a479..b51285af50 100644..100755
--- a/officecfg/registry/data/org/openoffice/makefile.mk
+++ b/officecfg/registry/data/org/openoffice/makefile.mk
@@ -38,11 +38,16 @@ PACKAGE=org.openoffice
XCUFILES= \
Inet.xcu \
Setup.xcu \
+ System.xcu \
VCL.xcu \
FirstStartWizard.xcu \
- UserProfile.xcu
+ UserProfile.xcu \
+ Interaction.xcu
MODULEFILES= \
+ Inet-macosx.xcu \
+ Inet-unixdesktop.xcu \
+ Inet-wnt.xcu \
Setup-brand.xcu \
Setup-writer.xcu \
Setup-calc.xcu \
@@ -51,22 +56,15 @@ MODULEFILES= \
Setup-base.xcu \
Setup-math.xcu \
Setup-report.xcu \
- Setup-start.xcu
+ Setup-start.xcu \
+ UserProfile-gconflockdown.xcu \
+ VCL-gconflockdown.xcu \
+ VCL-unixdesktop.xcu
LOCALIZEDFILES=Setup.xcu
-SAMPLEFILES= \
- LDAP.xcu.sample
-
.INCLUDE : target.mk
LANGUAGEPACKS=$(MISC)$/registry$/spool$/Langpack-{$(alllangiso)}.xcu
-SAMPLETARGETS=$(MISC)$/registry$/data$/$(PACKAGEDIR)$/{$(SAMPLEFILES)}
ALLTAR : $(LANGUAGEPACKS)
-ALLTAR : $(SAMPLETARGETS)
-
-$(SAMPLETARGETS) : $(SAMPLEFILES)
- -$(MKDIRHIER) $(@:d)
- $(COPY) $< $@
-
diff --git a/officecfg/registry/schema/oo-ad-ldap-attr.map b/officecfg/registry/schema/oo-ad-ldap-attr.map
deleted file mode 100644
index 497ec66ce4..0000000000
--- a/officecfg/registry/schema/oo-ad-ldap-attr.map
+++ /dev/null
@@ -1,50 +0,0 @@
-# User.givenName
-org.openoffice.UserProfile/Data/givenname = givenName
-
-# User.sn
-org.openoffice.UserProfile/Data/sn = sn
-
-# User.initials
-org.openoffice.UserProfile/Data/initials = initials
-
-# User.street
-org.openoffice.UserProfile/Data/street = street,postalAddress
-
-# User.l (city)
-org.openoffice.UserProfile/Data/l = l
-
-# User.st (state)
-org.openoffice.UserProfile/Data/st = st
-
-# User.postalCode
-org.openoffice.UserProfile/Data/postalcode = postalCode
-
-# User.c (country)
-org.openoffice.UserProfile/Data/c = c,co
-
-# User.department (company)
-org.openoffice.UserProfile/Data/o = department
-
-# deprecated -- no LDAP corollary
-org.openoffice.UserProfile/Data/position =
-
-# User.title
-org.openoffice.UserProfile/Data/title = title
-
-# User.homePhone
-org.openoffice.UserProfile/Data/homephone = homePhone
-
-# User.telephoneNumber
-org.openoffice.UserProfile/Data/telephonenumber = telephoneNumber
-
-# UserfacsimileTelephoneNumber
-org.openoffice.UserProfile/Data/facsimiletelephonenumber = facsimileTelephoneNumber
-
-# User.mail
-org.openoffice.UserProfile/Data/mail = mail
-
-# Deprecated
-#UserGroup =
-
-
-
diff --git a/officecfg/registry/schema/oo-ad-ldap.xcd.sample b/officecfg/registry/schema/oo-ad-ldap.xcd.sample
new file mode 100644
index 0000000000..edc50fb637
--- /dev/null
+++ b/officecfg/registry/schema/oo-ad-ldap.xcd.sample
@@ -0,0 +1,153 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<!-- This file is an example of an LDAP configuration file.
+
+ To use user data from LDAP in your installation, you need to provide a
+ customized version of this file, removing the ".sample" suffix.
+
+ This sample file is designed to work with a Windows Active Directory
+ Server. There is another sample file designed to work with a Sun Java
+ System Directory Server. Only one of those files should be activated by
+ removing its ".sample" suffix.
+
+ To customize values in this file, replace the data within <value>...
+ </value> elements flagged as "CUSTOMIZE" with the values for your
+ organization. If a certain setting is not necessary for your installation,
+ you can remove the compelete corresponding <value>...</value> element.
+-->
+
+<oor:data xmlns:oor="http://openoffice.org/2001/registry">
+ <dependency file="main"/>
+ <oor:component-data oor:package="org.openoffice" oor:name="LDAP">
+ <node oor:name="UserDirectory">
+ <prop oor:name="SearchUser">
+ <!-- CUSTOMIZE, activate unless anonymous access is possible:
+ <value>MyUserLogin</value> -->
+ </prop>
+ <prop oor:name="SearchPassword">
+ <!-- CUSTOMIZE, activate unless anonymous access is possible:
+ <value>MyPassword</value> -->
+ </prop>
+ <prop oor:name="UserObjectClass">
+ <!-- CUSTOMIZE --><value>inetorgperson</value>
+ </prop>
+ <prop oor:name="UserUniqueAttribute">
+ <!-- CUSTOMIZE --><value>uid</value>
+ </prop>
+ <node oor:name="ServerDefinition">
+ <prop oor:name="Server">
+ <!-- CUSTOMIZE --><value>ldapserver.mycorp.com</value>
+ </prop>
+ <prop oor:name="Port">
+ <!-- CUSTOMIZE --><value>389</value>
+ </prop>
+ <prop oor:name="BaseDN">
+ <!-- CUSTOMIZE --><value>dc=mycorp,dc=com</value>
+ </prop>
+ </node>
+ </node>
+ </oor:component-data>
+ <oor:component-data oor:package="org.openoffice" oor:name="UserProfile">
+ <node oor:name="Data">
+ <prop oor:name="o">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe department"/>
+ </prop>
+ <prop oor:name="givenname">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe givenname"/>
+ </prop>
+ <prop oor:name="sn">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe sn"/>
+ </prop>
+ <prop oor:name="initials">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe initials"/>
+ </prop>
+ <prop oor:name="street">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe street,postalAddress"/>
+ </prop>
+ <prop oor:name="l">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe l"/>
+ </prop>
+ <prop oor:name="st">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe st"/>
+ </prop>
+ <prop oor:name="postalcode">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe postalCode"/>
+ </prop>
+ <prop oor:name="c">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe c,co"/>
+ </prop>
+ <prop oor:name="title">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe title"/>
+ </prop>
+ <prop oor:name="position">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe position"/>
+ </prop>
+ <prop oor:name="homephone">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe homePhone"/>
+ </prop>
+ <prop oor:name="telephonenumber">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe telephoneNumber"/>
+ </prop>
+ <prop oor:name="facsimiletelephonenumber">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe facsimileTelephoneNumber"
+/>
+ </prop>
+ <prop oor:name="mail">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe mail"/>
+ </prop>
+ <!--
+ <prop oor:name="fathersname">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe ..."/>
+ </prop>
+ -->
+ <!--
+ <prop oor:name="apartment">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe ..."/>
+ </prop>
+ -->
+ </node>
+ </oor:component-data>
+</oor:data>
diff --git a/officecfg/registry/schema/oo-ldap-attr.map b/officecfg/registry/schema/oo-ldap-attr.map
deleted file mode 100644
index 61046f2bb8..0000000000
--- a/officecfg/registry/schema/oo-ldap-attr.map
+++ /dev/null
@@ -1,50 +0,0 @@
-# inetOrgPerson.givenName
-org.openoffice.UserProfile/Data/givenname = givenname
-
-# person.sn
-org.openoffice.UserProfile/Data/sn = sn
-
-# inetOrgPerson.initials
-org.openoffice.UserProfile/Data/initials = initials
-
-# organizationalPerson.street
-org.openoffice.UserProfile/Data/street = street,postalAddress,streetAddress
-
-# organizationalPerson.l (city)
-org.openoffice.UserProfile/Data/l = l
-
-# organizationalPerson.st (state)
-org.openoffice.UserProfile/Data/st = st
-
-# organizationalPerson.postalCode
-org.openoffice.UserProfile/Data/postalcode = postalcode
-
-# country.c (country)
-org.openoffice.UserProfile/Data/c =
-
-# organizationalPerson.o (company)
-org.openoffice.UserProfile/Data/o = o,organizationName
-
-# deprecated -- no LDAP corollary
-org.openoffice.UserProfile/Data/position =
-
-# organizationalPerson.title
-org.openoffice.UserProfile/Data/title = title
-
-# inetOrgPerson.homePhone
-org.openoffice.UserProfile/Data/homephone = homephone
-
-# organizationalPerson.telephoneNumber
-org.openoffice.UserProfile/Data/telephonenumber = telephonenumber
-
-# organizationalPerson.facsimileTelephoneNumber
-org.openoffice.UserProfile/Data/facsimiletelephonenumber = facsimiletelephonenumber,officeFax
-
-# inetOrgPerson.mail
-org.openoffice.UserProfile/Data/mail = mail
-
-# Deprecated
-#UserGroup =
-
-
-
diff --git a/officecfg/registry/schema/oo-ldap.xcd.sample b/officecfg/registry/schema/oo-ldap.xcd.sample
new file mode 100644
index 0000000000..8e9271a44d
--- /dev/null
+++ b/officecfg/registry/schema/oo-ldap.xcd.sample
@@ -0,0 +1,156 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<!-- This file is an example of an LDAP configuration file.
+
+ To use user data from LDAP in your installation, you need to provide a
+ customized version of this file, removing the ".sample" suffix.
+
+ This sample file is designed to work with a Sun Java System Directory
+ Server. There is another sample file designed to work with a Windows
+ Active Directory Server. Only one of those files should be activated by
+ removing its ".sample" suffix.
+
+ To customize values in this file, replace the data within <value>...
+ </value> elements flagged as "CUSTOMIZE" with the values for your
+ organization. If a certain setting is not necessary for your installation,
+ you can remove the compelete corresponding <value>...</value> element.
+-->
+
+<oor:data xmlns:oor="http://openoffice.org/2001/registry">
+ <dependency file="main"/>
+ <oor:component-data oor:package="org.openoffice" oor:name="LDAP">
+ <node oor:name="UserDirectory">
+ <prop oor:name="SearchUser">
+ <!-- CUSTOMIZE, activate unless anonymous access is possible:
+ <value>MyUserLogin</value> -->
+ </prop>
+ <prop oor:name="SearchPassword">
+ <!-- CUSTOMIZE, activate unless anonymous access is possible:
+ <value>MyPassword</value> -->
+ </prop>
+ <prop oor:name="UserObjectClass">
+ <!-- CUSTOMIZE --><value>inetorgperson</value>
+ </prop>
+ <prop oor:name="UserUniqueAttribute">
+ <!-- CUSTOMIZE --><value>uid</value>
+ </prop>
+ <node oor:name="ServerDefinition">
+ <prop oor:name="Server">
+ <!-- CUSTOMIZE --><value>ldapserver.mycorp.com</value>
+ </prop>
+ <prop oor:name="Port">
+ <!-- CUSTOMIZE --><value>389</value>
+ </prop>
+ <prop oor:name="BaseDN">
+ <!-- CUSTOMIZE --><value>dc=mycorp,dc=com</value>
+ </prop>
+ </node>
+ </node>
+ </oor:component-data>
+ <oor:component-data oor:package="org.openoffice" oor:name="UserProfile">
+ <node oor:name="Data">
+ <prop oor:name="o">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe o,organizationName"/>
+ </prop>
+ <prop oor:name="givenname">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe givenname"/>
+ </prop>
+ <prop oor:name="sn">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe sn"/>
+ </prop>
+ <prop oor:name="initials">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe initials"/>
+ </prop>
+ <prop oor:name="street">
+ <value oor:external=
+"com.sun.star.configuration.backend.LdapUserProfileBe street,postalAddress,streetAddress"
+/>
+ </prop>
+ <prop oor:name="l">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe l"/>
+ </prop>
+ <prop oor:name="st">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe st"/>
+ </prop>
+ <prop oor:name="postalcode">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe postalcode"/>
+ </prop>
+ <!--
+ <prop oor:name="c">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe ..."/>
+ </prop>
+ -->
+ <prop oor:name="title">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe title"/>
+ </prop>
+ <prop oor:name="position">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe position"/>
+ </prop>
+ <prop oor:name="homephone">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe homephone"/>
+ </prop>
+ <prop oor:name="telephonenumber">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe telephonenumber"/>
+ </prop>
+ <prop oor:name="facsimiletelephonenumber">
+ <value oor:external=
+"com.sun.star.configuration.backend.LdapUserProfileBe facsimiletelephonenumber,officeFax"
+/>
+ </prop>
+ <prop oor:name="mail">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe mail"/>
+ </prop>
+ <!--
+ <prop oor:name="fathersname">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe ..."/>
+ </prop>
+ -->
+ <!--
+ <prop oor:name="apartment">
+ <value oor:external=
+ "com.sun.star.configuration.backend.LdapUserProfileBe ..."/>
+ </prop>
+ -->
+ </node>
+ </oor:component-data>
+</oor:data>
diff --git a/officecfg/registry/schema/org/openoffice/Interaction.xcs b/officecfg/registry/schema/org/openoffice/Interaction.xcs
new file mode 100644
index 0000000000..e39d44da7f
--- /dev/null
+++ b/officecfg/registry/schema/org/openoffice/Interaction.xcs
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--***********************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************ -->
+<!DOCTYPE oor:component-schema SYSTEM "../../../component-schema.dtd">
+<oor:component-schema xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="Interaction" oor:package="org.openoffice" xml:lang="en-US">
+ <info>
+ <author>Frank Schönheit</author>
+ <desc>contains configuration related to the interaction system of OpenOffice.org.</desc>
+ </info>
+ <templates>
+ <group oor:name="RequestTypeResponsibility">
+ <info>
+ <desc>describes the responsibility for a single interaction request type.</desc>
+ </info>
+ <prop oor:name="Propagation" oor:type="xs:string">
+ <info>
+ <desc>describes how the responsibility for this particular request type propagates through the
+ type hierarchy.</desc>
+ </info>
+ <constraints>
+ <enumeration oor:value="named-only">
+ <info>
+ <desc>specifies that the interaction handler is responsible only for this particular type.</desc>
+ </info>
+ </enumeration>
+ <enumeration oor:value="named-and-derived">
+ <info>
+ <desc>
+ specifies that the interaction handler is responsible not only for this particular type,
+ but also for all derived types.
+ </desc>
+ </info>
+ </enumeration>
+ </constraints>
+ </prop>
+ </group>
+ <group oor:name="InteractionHandlerImplementation">
+ <info>
+ <desc>contains information about a concrete interaction handler implementation.</desc>
+ </info>
+ <set oor:name="HandledRequestTypes" oor:node-type="RequestTypeResponsibility">
+ <info>
+ <desc>specifies the types which the interaction handler implementation is responsible for. The node names
+ of this set are interpreted as names in the UNO type system, this way specifying the request types
+ which should be delegated to the given interaction handler.</desc>
+ </info>
+ </set>
+ <prop oor:name="ServiceName" oor:type="xs:string">
+ <info>
+ <desc>contains the name to be used to create an instance of the interaction handler implementation.</desc>
+ </info>
+ </prop>
+ </group>
+ </templates>
+ <component>
+ <set oor:name="InteractionHandlers" oor:node-type="InteractionHandlerImplementation">
+ <info>
+ <desc>collects information about registered interaction handlers.</desc>
+ </info>
+ </set>
+ </component>
+</oor:component-schema>
diff --git a/officecfg/registry/schema/org/openoffice/LDAP.xcs b/officecfg/registry/schema/org/openoffice/LDAP.xcs
index e820de94df..dd5e79833a 100644
--- a/officecfg/registry/schema/org/openoffice/LDAP.xcs
+++ b/officecfg/registry/schema/org/openoffice/LDAP.xcs
@@ -54,7 +54,7 @@
</prop>
<prop oor:name="UserUniqueAttribute" oor:type="xs:string"><info><desc>Name of User entity unique attribute in LDAP repository</desc></info>
</prop>
- <prop oor:name="Mapping" oor:type="xs:string"><info><desc>Name of OOo to LDAP mapping file</desc></info>
+ <prop oor:name="Mapping" oor:type="xs:string"><info><desc>Obsolete and unused</desc></info>
</prop>
<node-ref oor:name="ServerDefinition" oor:node-type="ServerDefinition">
<info><desc>Specifies the LDAP related settings</desc></info>
diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
index 6daeaf69a8..b5232c21eb 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
@@ -1016,6 +1016,97 @@
<value>NULL</value>
</prop>
</group>
+ <group oor:name="Dialogs">
+ <info>
+ <desc>Contains the dialogs settings.</desc>
+ </info>
+ <group oor:name="CSVImport">
+ <info>
+ <desc>Contains setting for Text CSV Import</desc>
+ </info>
+ <prop oor:name="MergeDelimiters" oor:type="xs:boolean">
+ <info>
+ <author>muthusuba</author>
+ <desc>Merge Delimiter check box status</desc>
+ <label>MergeDelimiters</label>
+ </info>
+ <value>false</value>
+ </prop>
+ <prop oor:name="QuotedFieldAsText" oor:type="xs:boolean">
+ <info>
+ <author>kyoshida</author>
+ <desc>If true, quoted field is always imported as text
+ with no exception.</desc>
+ <label>QuotedFieldAsText</label>
+ </info>
+ <value>true</value>
+ </prop>
+ <prop oor:name="DetectSpecialNumbers" oor:type="xs:boolean">
+ <info>
+ <author>kyoshida</author>
+ <desc>If true, Calc tries to detect special number format, such as date and scientific notation.</desc>
+ <label>DetectSpecialNumbers</label>
+ </info>
+ <value>false</value>
+ </prop>
+ <prop oor:name="Language" oor:type="xs:int">
+ <info>
+ <author>kyoshida</author>
+ <desc>Language to use for CSV import. This determines how the numbers are parsed.</desc>
+ <label>Language</label>
+ </info>
+ <value>0</value>
+ </prop>
+ <prop oor:name="Separators" oor:type="xs:string">
+ <info>
+ <author>muthusuba</author>
+ <desc>List of Separators - as a String</desc>
+ <label>Separators</label>
+ </info>
+ <value>; </value>
+ </prop>
+ <prop oor:name="TextSeparators" oor:type="xs:string">
+ <info>
+ <author>muthusuba</author>
+ <desc>Text Separators</desc>
+ <label>TextSeparators</label>
+ </info>
+ <value>"</value>
+ </prop>
+ <prop oor:name="FixedWidth" oor:type="xs:boolean">
+ <info>
+ <author>muthusuba</author>
+ <desc>Fixed width</desc>
+ <label>FixedWidth</label>
+ </info>
+ <value>false</value>
+ </prop>
+ <prop oor:name="FromRow" oor:type="xs:int">
+ <info>
+ <author>muthusuba</author>
+ <desc>From Row</desc>
+ <label>FromRow</label>
+ </info>
+ <value>1</value>
+ </prop>
+ <prop oor:name="CharSet" oor:type="xs:int">
+ <info>
+ <author>muthusuba</author>
+ <desc>Char Set</desc>
+ <label>CharSet</label>
+ </info>
+ <value>-1</value>
+ </prop>
+ <prop oor:name="FixedWidthList" oor:type="xs:string">
+ <info>
+ <author>muthusuba</author>
+ <desc>Fixed Width List of separators</desc>
+ <label>FixedWidthList</label>
+ </info>
+ <value></value>
+ </prop>
+ </group>
+ </group>
<group oor:name="Calculate">
<info>
<desc>Contains settings that affect cell calculation.</desc>
diff --git a/officecfg/registry/schema/org/openoffice/Office/Chart.xcs b/officecfg/registry/schema/org/openoffice/Office/Chart.xcs
index e70a12b27d..8989c0f7c2 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Chart.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Chart.xcs
@@ -45,7 +45,8 @@
<desc>Specifies a list of color values to be used for the first n series, where n is the size of the list. For i &gt; n the color used is equal to entry number i modulo n in the list. You should keep the size of the list at 12. Also note that the values are interpreted as unsigned 32bit values, although it is possible to get negative (signed) numbers in this list when being displayed in decimal.</desc>
<label>Chart colors</label>
</info>
- <value>0x004586 0xff420e 0xffd320 0x579d1c 0x7e0021 0x83caff 0x314004 0xaecf00 0x4b1f6f 0xff950e 0xc5000b 0x0084d1</value>
+ <value>17798 16728590 16765728 5741852 8257569 8637183 3227652 11456256 4923247 16749838 12910603 34001</value>
+ <!-- 0x004586 0xff420e 0xffd320 0x579d1c 0x7e0021 0x83caff 0x314004 0xaecf00 0x4b1f6f 0xff950e 0xc5000b 0x0084d1 -->
</prop>
</group>
</component>
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index a0e17004f5..a1e203a293 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -2238,17 +2238,6 @@
</info>
<value>true</value>
</prop>
- <prop oor:name="DocumentWindows" oor:type="xs:boolean">
- <!-- OldPath: General/Restore -->
- <!-- OldLocation: soffice.cfg -->
- <!-- UIHints: Tools Options - General Save - [Section] Restore editing view - Open windows-->
- <info>
- <author>MBA</author>
- <desc>Specifies whether all currently open windows of a document should be saved. If true the view properties for all open document views of that document are saved.</desc>
- <label>Open windows</label>
- </info>
- <value>false</value>
- </prop>
<prop oor:name="PrettyPrinting" oor:type="xs:boolean">
<!-- UIHints: Tools Options - General Save - optimize XML file size-->
<!--the UI setting is inverse to this setting-->
@@ -3562,6 +3551,12 @@
</info>
<value/>
</prop>
+ <prop oor:name="StartCenterLayoutStyle" oor:type="xs:int">
+ <info>
+ <desc>Contains a number deciding the layout style of the start center</desc>
+ </info>
+ <value>0</value>
+ </prop>
</group>
<group oor:name="Registration">
<info>
diff --git a/officecfg/registry/schema/org/openoffice/Office/Recovery.xcs b/officecfg/registry/schema/org/openoffice/Office/Recovery.xcs
index 6f6c661e8f..f424180c76 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Recovery.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Recovery.xcs
@@ -28,54 +28,59 @@
<!DOCTYPE oor:component-schema SYSTEM "../../../../component-schema.dtd">
<oor:component-schema xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="Recovery" oor:package="org.openoffice.Office" xml:lang="en-US">
<info>
- <desc>TODO</desc>
+ <desc> </desc>
</info>
<templates>
<group oor:name="RecoveryEntry">
<info>
- <desc>TODO</desc>
+ <desc> </desc>
</info>
<prop oor:name="TempURL" oor:type="xs:string">
<info>
- <desc>TODO</desc>
+ <desc> </desc>
</info>
</prop>
<prop oor:name="OriginalURL" oor:type="xs:string">
<info>
- <desc>TODO</desc>
+ <desc> </desc>
</info>
</prop>
<prop oor:name="TemplateURL" oor:type="xs:string">
<info>
- <desc>TODO</desc>
+ <desc> </desc>
</info>
</prop>
<prop oor:name="Module" oor:type="xs:string">
<info>
- <desc>TODO</desc>
+ <desc> </desc>
</info>
</prop>
<prop oor:name="DocumentState" oor:type="xs:int">
<info>
- <desc>TODO</desc>
+ <desc> </desc>
</info>
</prop>
<prop oor:name="Filter" oor:type="xs:string">
<info>
- <desc>TODO</desc>
+ <desc> </desc>
</info>
</prop>
<prop oor:name="Title" oor:type="xs:string">
<info>
- <desc>TODO</desc>
+ <desc> </desc>
</info>
</prop>
- </group>
+ <prop oor:name="ViewNames" oor:type="oor:string-list">
+ <info>
+ <desc> </desc>
+ </info>
+ </prop>
+ </group>
</templates>
<component>
<set oor:name="RecoveryList" oor:node-type="RecoveryEntry">
<info>
- <desc>TODO</desc>
+ <desc> </desc>
</info>
</set>
<group oor:name="SessionShutdown">
@@ -93,7 +98,7 @@
</group>
<group oor:name="RecoveryInfo">
<info>
- <desc>TODO</desc>
+ <desc> </desc>
</info>
<prop oor:name="Enabled" oor:type="xs:boolean">
<info>
@@ -103,13 +108,13 @@
</prop>
<prop oor:name="Crashed" oor:type="xs:boolean">
<info>
- <desc>TODO</desc>
+ <desc> </desc>
</info>
<value>false</value>
</prop>
<prop oor:name="SessionData" oor:type="xs:boolean">
<info>
- <desc>TODO</desc>
+ <desc> </desc>
</info>
<value>false</value>
</prop>
@@ -127,17 +132,17 @@
</group>
<group oor:name="AutoSave">
<info>
- <desc>TODO</desc>
+ <desc> </desc>
</info>
<prop oor:name="Enabled" oor:type="xs:boolean">
<info>
- <desc>TODO</desc>
+ <desc> </desc>
</info>
<value>true</value>
</prop>
<prop oor:name="TimeIntervall" oor:type="xs:int">
<info>
- <desc>TODO</desc>
+ <desc> </desc>
</info>
<value>15</value>
</prop>
diff --git a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
index 2b2b0f7cb9..4a3c2c02c3 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
@@ -4796,22 +4796,22 @@
<label>Accept with</label>
</info>
<constraints>
- <enumeration oor:value="0x405">
+ <enumeration oor:value="1029"> <!-- 0x405 -->
<info>
<desc>KeyEnd</desc>
</info>
</enumeration>
- <enumeration oor:value="0x500">
+ <enumeration oor:value="1280"> <!-- 0x500 -->
<info>
<desc>KeyReturn</desc>
</info>
</enumeration>
- <enumeration oor:value="0x403">
+ <enumeration oor:value="1027"> <!-- 0x403 -->
<info>
<desc>KeyRight</desc>
</info>
</enumeration>
- <enumeration oor:value="0x504">
+ <enumeration oor:value="1284"> <!-- 0x504 -->
<info>
<desc>KeySpace</desc>
</info>
diff --git a/officecfg/registry/schema/org/openoffice/Setup.xcs b/officecfg/registry/schema/org/openoffice/Setup.xcs
index 9e5551bda1..de8a64e2b0 100644
--- a/officecfg/registry/schema/org/openoffice/Setup.xcs
+++ b/officecfg/registry/schema/org/openoffice/Setup.xcs
@@ -34,61 +34,86 @@
<templates>
<group oor:name="InstalledLocale">
<info>
- <author>JB</author>
+ <author>JB</author>
<desc>Describes a language pack that is installed to provide a localized office UI.</desc>
</info>
<prop oor:name="Origin" oor:type="xs:string">
- <info>
- <author>JB</author>
- <desc>Identifies the organization, group or person that provided this language pack.</desc>
- </info>
+ <info>
+ <author>JB</author>
+ <desc>Identifies the organization, group or person that provided this language pack.</desc>
+ </info>
</prop>
</group>
- <group oor:name="MigrationStep">
+ <group oor:name="MigrationStep">
+ <info>
+ <desc>Describes one step of migration</desc>
+ </info>
+ <prop oor:name="MigrationService" oor:type="xs:string">
+ <info>
+ <desc>an optional uno service that is called after files and nodes have been copied in order to perform custom migration actions. The service needs to support XInitializable and XJob interfaces according do http://specs.openoffice.org/appwide/migration/spec_migration.sxw</desc>
+ </info>
+ </prop>
+ <prop oor:name="ServiceConfigComponents" oor:type="oor:string-list">
+ <info>
+ <desc>a list of config components that are to be passed to service</desc>
+ </info>
+ </prop>
+ <prop oor:name="IncludedFiles" oor:type="oor:string-list">
+ <info>
+ <desc>a list of wildcards relative to the old userdata origin that are to be copied</desc>
+ </info>
+ </prop>
+ <prop oor:name="ExcludedFiles" oor:type="oor:string-list">
+ <info>
+ <desc>a list of wildcards relative to the old userdata origin that are to be copied</desc>
+ </info>
+ </prop>
+ <prop oor:name="IncludedNodes" oor:type="oor:string-list">
+ <info>
+ <desc>a list of configuration node paths that are to be moved from the old user layer to the new user layer</desc>
+ </info>
+ </prop>
+ <prop oor:name="ExcludedNodes" oor:type="oor:string-list">
+ <info>
+ <desc>a list of configuration node paths that are not to be moved from the old user layer to the new user layer</desc>
+ </info>
+ </prop>
+ <prop oor:name="IncludedExtensions" oor:type="oor:string-list">
+ <info>
+ <desc>a list of extension identifiers that are to be copied from the old user layer to the new user layer</desc>
+ </info>
+ </prop>
+ <prop oor:name="ExcludedExtensions" oor:type="oor:string-list">
+ <info>
+ <desc>a list of extension identifiers that are not to be copied from the old user layer to the new user layer</desc>
+ </info>
+ </prop>
+ </group>
+ <group oor:name="MigrateVersion">
+ <info>
+ <desc>Describes migration steps specific for certain version(s)</desc>
+ </info>
+ <prop oor:name="VersionIdentifiers" oor:type="oor:string-list">
+ <info>
+ <desc>version identifiers, that are supported for migration</desc>
+ </info>
+ <value/>
+ </prop>
+ <prop oor:name="Priority" oor:type="xs:int">
+ <info>
+ <desc>Contains the priority value to specify which migration should be prefered. Higher values are prefered.</desc>
+ </info>
+ <value/>
+ </prop>
+ <set oor:name="MigrationSteps" oor:node-type="MigrationStep">
+ <info>
+ <desc>Contains necessary migration steps for specific versions</desc>
+ </info>
+ </set>
+ </group>
+ <group oor:name="Factory">
<info>
- <author>LO</author>
- <desc>Describes one step of migration</desc>
- </info>
- <prop oor:name="MigrationService" oor:type="xs:string">
- <info>
- <author>LO</author>
- <desc>an optional uno service that is called after files and nodes have been copied in order to perform custom migration actions. The service needs to support XInitializable and XJob interfaces according do http://specs.openoffice.org/appwide/migration/spec_migration.sxw</desc>
- </info>
- </prop>
- <prop oor:name="ServiceConfigComponents" oor:type="oor:string-list">
- <info>
- <author>LO</author>
- <desc>a list of config components that are to be passed to service</desc>
- </info>
- </prop>
- <prop oor:name="IncludedFiles" oor:type="oor:string-list">
- <info>
- <author>LO</author>
- <desc>a list of wildcards relative to the old userdata origin that are to be copied</desc>
- </info>
- </prop>
- <prop oor:name="ExcludedFiles" oor:type="oor:string-list">
- <info>
- <author>LO</author>
- <desc>a list of wildcards relative to the old userdata origin that are to be copied</desc>
- </info>
- </prop>
- <prop oor:name="IncludedNodes" oor:type="oor:string-list">
- <info>
- <author>LO</author>
- <desc>a list of configuration node paths that are to be moved from the old user layer to the new user layer</desc>
- </info>
- </prop>
- <prop oor:name="ExcludedNodes" oor:type="oor:string-list">
- <info>
- <author>LO</author>
- <desc>a list of configuration node paths that are not to be moved from the old user layer to the new user layer</desc>
- </info>
- </prop>
- </group>
- <group oor:name="Factory">
- <info>
- <author>AS</author>
+ <author>AS</author>
<desc>Describes an application module (a document factory, such as Writer).</desc>
</info>
<prop oor:name="ooSetupFactoryActualFilter" oor:type="xs:string">
@@ -416,30 +441,21 @@
</info>
<prop oor:name="TransferUserSettingsOnce" oor:type="xs:boolean" oor:nillable="false">
<info>
- <deprecated>This feature is not supported any more since OOo 2.0</deprecated>
+ <deprecated>This feature is not supported any more since OOo 2.0</deprecated>
<author>JB</author>
- <desc>Deprecated</desc>
- </info>
- </prop>
- </group>
- <group oor:name="Migration">
- <info>
- <author>LO</author>
- <desc>Contains settings that control configuration data access.</desc>
- </info>
- <set oor:name="MigrationSteps" oor:node-type="MigrationStep">
- <info>
- <author>LO</author>
- <desc>The enumeration of migration steps that are to be applied on first start</desc>
- </info>
- </set>
- <prop oor:name="SupportedVersions" oor:type="oor:string-list">
- <info>
- <author>LO</author>
- <desc>version identifiers, that are supported for migration</desc>
+ <desc>Deprecated</desc>
</info>
- <value/>
</prop>
</group>
- </component>
+ <group oor:name="Migration">
+ <info>
+ <desc>Contains settings that control the migration process for certain versions.</desc>
+ </info>
+ <set oor:name="SupportedVersions" oor:node-type="MigrateVersion">
+ <info>
+ <desc>Define migration steps for supported versions</desc>
+ </info>
+ </set>
+ </group>
+ </component>
</oor:component-schema>
diff --git a/officecfg/registry/schema/org/openoffice/makefile.mk b/officecfg/registry/schema/org/openoffice/makefile.mk
index 98cbdb4b21..f928e447f4 100644
--- a/officecfg/registry/schema/org/openoffice/makefile.mk
+++ b/officecfg/registry/schema/org/openoffice/makefile.mk
@@ -42,7 +42,8 @@ XCSFILES= \
System.xcs \
UserProfile.xcs \
VCL.xcs \
- FirstStartWizard.xcs
+ FirstStartWizard.xcs \
+ Interaction.xcs
.INCLUDE : target.mk
diff --git a/officecfg/registry/schema/org/openoffice/ucb/InteractionHandler.xcs b/officecfg/registry/schema/org/openoffice/ucb/InteractionHandler.xcs
index 8775baa91d..ea6de5b80a 100644
--- a/officecfg/registry/schema/org/openoffice/ucb/InteractionHandler.xcs
+++ b/officecfg/registry/schema/org/openoffice/ucb/InteractionHandler.xcs
@@ -26,39 +26,28 @@
*
************************************************************************ -->
<!DOCTYPE oor:component-schema SYSTEM "../../../../component-schema.dtd">
-<oor:component-schema xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="InteractionHandler" oor:package="org.openoffice.ucb" xml:lang="en-US"> <info>
- <author>TKR</author>
- <desc >Contains components and templates used for InteractionHandler configuration related data. </desc>
- </info>
- <templates>
- <group oor:name="InteractionHandlerData">
- <info>
- <desc>Contains the Service name of the custom InteractionHandler. The listed InteractionHandlers will be called after the "build-in" InteractionHandler sequently.</desc>
- </info>
- <prop oor:name="ServiceName" oor:type="xs:string">
- <info>
- <desc>Specifies the name of the UNO service to be used to instantiate the InteractionHandler. The type should be com.sun.star.task.XInteractionHandler.</desc>
- </info>
- </prop>
- </group>
- </templates>
- <component>
- <set oor:name="InteractionHandlers" oor:node-type="InteractionHandlerData">
- <info>
- <desc>Contains a root entry for InteractionHandler configurations.</desc>
- </info>
- </set>
- </component>
+<oor:component-schema xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="InteractionHandler" oor:package="org.openoffice.ucb" xml:lang="en-US">
+ <info>
+ <author>TKR</author>
+ <desc>Deprecated. Use org.openoffice.Interaction instead.</desc>
+ </info>
+ <templates>
+ <group oor:name="InteractionHandlerData">
+ <info>
+ <desc>Deprecated. Use org.openoffice.Interaction instead.</desc>
+ </info>
+ <prop oor:name="ServiceName" oor:type="xs:string">
+ <info>
+ <desc>Deprecated. Use org.openoffice.Interaction instead.</desc>
+ </info>
+ </prop>
+ </group>
+ </templates>
+ <component>
+ <set oor:name="InteractionHandlers" oor:node-type="InteractionHandlerData">
+ <info>
+ <desc>Deprecated. Use org.openoffice.Interaction instead.</desc>
+ </info>
+ </set>
+ </component>
</oor:component-schema>
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/officecfg/util/alllang.xsl b/officecfg/util/alllang.xsl
index 998a9a55e2..339c6685fa 100644
--- a/officecfg/util/alllang.xsl
+++ b/officecfg/util/alllang.xsl
@@ -312,6 +312,9 @@
<xsl:when test="not ($dataval)">
<xsl:value-of select="true()"/>
</xsl:when>
+ <xsl:when test="$dataval/@oor:external">
+ <xsl:value-of select="false()"/>
+ </xsl:when>
<xsl:when test="not ($schemaval)">
<xsl:choose>
<xsl:when test="$dataval/@xsi:nil='true'">
diff --git a/officecfg/util/data_val.xsl b/officecfg/util/data_val.xsl
index 883bffc197..d918431c75 100644
--- a/officecfg/util/data_val.xsl
+++ b/officecfg/util/data_val.xsl
@@ -202,9 +202,6 @@
<xsl:if test="following-sibling::value[@install:module=$module and @xml:lang=$lang]">
<xsl:message terminate="yes">ERROR: Property '<xsl:value-of select="$path"/>' has multiple values for module <xsl:value-of select="$module"/> and locale <xsl:value-of select="$lang"/>!</xsl:message>
</xsl:if>
- <xsl:if test="../value[not(@install:module)]">
- <xsl:message terminate="yes">ERROR: Property '<xsl:value-of select="$path"/>' has values both with and without module. This is currently not supported. Please contact jb@openoffice.org, if you need this!</xsl:message>
- </xsl:if>
<xsl:if test="not(preceding-sibling::value/@install:module)">
<xsl:message>ATTENTION: Property '<xsl:value-of select="$path"/>' has different values for different modules. Make sure the modules are mutually exclusive!</xsl:message>
</xsl:if>
diff --git a/officecfg/util/makefile.mk b/officecfg/util/makefile.mk
index d6c6ddf16f..332ac90fe2 100644
--- a/officecfg/util/makefile.mk
+++ b/officecfg/util/makefile.mk
@@ -41,9 +41,7 @@ $(MISC)$/$(TARGET)_delzip :
$(BIN)$/registry_{$(alllangiso)}.zip : $(MISC)$/$(TARGET)_delzip
cd $(MISC)$/registry$/res$/$(@:b:s/registry_//) && zip -ru ..$/..$/..$/..$/bin$/registry_$(@:b:s/registry_//).zip org/*
-.IF "$(USE_SHELL)"!="4nt"
$(PERL) -w $(SOLARENV)$/bin$/cleanzip.pl $@
-.ENDIF # "$(USE_SHELL)"!="4nt"
ALLTAR: \
$(MISC)$/$(TARGET)_delzip \
diff --git a/readlicense_oo/source/license/license_en-US.html b/readlicense_oo/source/license/license_en-US.html
index 58ff877904..d11c348ee9 100644
--- a/readlicense_oo/source/license/license_en-US.html
+++ b/readlicense_oo/source/license/license_en-US.html
@@ -19,10 +19,10 @@ in the THIRDPARTYLICENSEREADME.html file.</p>
<p>All trademarks and registered trademarks mentioned herein are the
property of their respective owners.</p>
<hr>
-<p>Copyright 2002-2008 Sun Microsystems, Inc.</p>
+<p>Copyright (c) 2000, 2010 Oracle and/or its affiliates. All rights reserved.</p>
<p>This product has been created with contributions from the
-OpenOffice.org community, of which Sun Microsystems Inc. is the
-founding member. OpenOffice.org acknowledges all community members,
+OpenOffice.org community, of which Oracle is a
+principal member. OpenOffice.org acknowledges all community members,
especially those mentioned at
http://www.openoffice.org/welcome/credits.html.</p>
<hr>
diff --git a/readlicense_oo/source/license/license_en-US.rtf b/readlicense_oo/source/license/license_en-US.rtf
index 1a8ef275f9..56792a79cd 100644
--- a/readlicense_oo/source/license/license_en-US.rtf
+++ b/readlicense_oo/source/license/license_en-US.rtf
@@ -1,271 +1,374 @@
-{\rtf1\ansi\ansicpg1252\deff0\deftab709{\fonttbl{\f0\fswiss\fprq2\fcharset0 Tahoma;}{\f1\froman\fprq2\fcharset0 Thorndale;}}
-{\colortbl ;\red0\green0\blue255;\red0\green0\blue0;\red0\green0\blue128;\red128\green128\blue128;}
-{\*\generator Msftedit 5.41.15.1507;}\viewkind4\uc1\pard\lang1033\b\i\f0\fs24 License\par
-\pard\sa283\b0\i0\f1 This product is made available subject to the terms of GNU Lesser General Public License Version 3. A copy of the LGPL license can be found at http://www.openoffice.org/license.html\par
-\pard\brdrb\brdrdb\brdrw15\brdrcf4 \sa283\fs12\par
-\pard\sa283\fs24 Third Party Code. Additional copyright notices and license terms applicable to portions of the Software are set forth in the THIRDPARTYLICENSEREADME.html file.\par
-\pard\brdrb\brdrdb\brdrw15\brdrcf4 \sa283\fs12\par
-\pard\sa283\fs24 All trademarks and registered trademarks mentioned herein are the property of their respective owners.\par
-\pard\brdrb\brdrdb\brdrw15\brdrcf4 \sa283\fs12\par
-\pard\sa283\fs24 Copyright 2002,2008 Sun Microsystems, Inc.\par
-\cf2 This product has been created with contributions from the OpenOffice.org community, of which Sun Microsystems Inc. is the founding member. OpenOffice.org acknowledges all community members, especially those mentioned at\cf3\ul \cf0\ulnone http://www.openoffice.org/welcome/credits.html\par
-\par
-GNU LESSER GENERAL PUBLIC LICENSE\par
-\par
-Version 3, 29 June 2007\par
-\par
-Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\par
-\par
-Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.\par
-\par
-This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below.\par
-0. Additional Definitions.\par
-\par
-As used herein, \ldblquote this License\rdblquote refers to version 3 of the GNU Lesser General Public License, and the \ldblquote GNU GPL\rdblquote refers to version 3 of the GNU General Public License.\par
-\par
-\ldblquote The Library\rdblquote refers to a covered work governed by this License, other than an Application or a Combined Work as defined below.\par
-\par
-An \ldblquote Application\rdblquote is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library.\par
-\par
-A \ldblquote Combined Work\rdblquote is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the \ldblquote Linked Version\rdblquote .\par
-\par
-The \ldblquote Minimal Corresponding Source\rdblquote for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version.\par
-\par
-The \ldblquote Corresponding Application Code\rdblquote for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work.\par
-1. Exception to Section 3 of the GNU GPL.\par
-\par
-You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL.\par
-2. Conveying Modified Versions.\par
-\par
-If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version:\par
-\par
- * a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or\par
- * b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy.\par
-\par
-3. Object Code Incorporating Material from Library Header Files.\par
-\par
-The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following:\par
-\par
- * a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License.\par
- * b) Accompany the object code with a copy of the GNU GPL and this license document.\par
-\par
-4. Combined Works.\par
-\par
-You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following:\par
-\par
- * a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License.\par
- * b) Accompany the Combined Work with a copy of the GNU GPL and this license document.\par
- * c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document.\par
- * d) Do one of the following:\par
- o 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.\par
- o 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version.\par
- * e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.)\par
-\par
-5. Combined Libraries.\par
-\par
-You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following:\par
-\par
- * a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License.\par
- * b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.\par
-\par
-6. Revised Versions of the GNU Lesser General Public License.\par
-\par
-The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.\par
-\par
-Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License \ldblquote or any later version\rdblquote applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation.\par
-\par
-If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library.\par
-\par
-GNU GENERAL PUBLIC LICENSE\par
-\par
-Version 3, 29 June 2007\par
-\par
-Copyright \'a9 2007 Free Software Foundation, Inc. <http://fsf.org/>\par
-\par
-Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.\par
-Preamble\par
-\par
-The GNU General Public License is a free, copyleft license for software and other kinds of works.\par
-\par
-The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.\par
-\par
-When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.\par
-\par
-To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.\par
-\par
-For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.\par
-\par
-Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.\par
-\par
-For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.\par
-\par
-Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.\par
-\par
-Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.\par
-\par
-The precise terms and conditions for copying, distribution and modification follow.\par
-TERMS AND CONDITIONS\par
-0. Definitions.\par
-\par
-\ldblquote This License\rdblquote refers to version 3 of the GNU General Public License.\par
-\par
-\ldblquote Copyright\rdblquote also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.\par
-\par
-\ldblquote The Program\rdblquote refers to any copyrightable work licensed under this License. Each licensee is addressed as \ldblquote you\rdblquote . \ldblquote Licensees\rdblquote and \ldblquote recipients\rdblquote may be individuals or organizations.\par
-\par
-To \ldblquote modify\rdblquote a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a \ldblquote modified version\rdblquote of the earlier work or a work \ldblquote based on\rdblquote the earlier work.\par
-\par
-A \ldblquote covered work\rdblquote means either the unmodified Program or a work based on the Program.\par
-\par
-To \ldblquote propagate\rdblquote a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.\par
-\par
-To \ldblquote convey\rdblquote a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.\par
-\par
-An interactive user interface displays \ldblquote Appropriate Legal Notices\rdblquote to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.\par
-1. Source Code.\par
-\par
-The \ldblquote source code\rdblquote for a work means the preferred form of the work for making modifications to it. \ldblquote Object code\rdblquote means any non-source form of a work.\par
-\par
-A \ldblquote Standard Interface\rdblquote means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.\par
-\par
-The \ldblquote System Libraries\rdblquote of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A \ldblquote Major Component\rdblquote , in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.\par
-\par
-The \ldblquote Corresponding Source\rdblquote for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.\par
-\par
-The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.\par
-\par
-The Corresponding Source for a work in source code form is that same work.\par
-2. Basic Permissions.\par
-\par
-All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.\par
-\par
-You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.\par
-\par
-Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.\par
-3. Protecting Users' Legal Rights From Anti-Circumvention Law.\par
-\par
-No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.\par
-\par
-When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.\par
-4. Conveying Verbatim Copies.\par
-\par
-You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.\par
-\par
-You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.\par
-5. Conveying Modified Source Versions.\par
-\par
-You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:\par
-\par
- * a) The work must carry prominent notices stating that you modified it, and giving a relevant date.\par
- * b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to \ldblquote keep intact all notices\rdblquote .\par
- * c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.\par
- * d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.\par
-\par
-A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an \ldblquote aggregate\rdblquote if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.\par
-6. Conveying Non-Source Forms.\par
-\par
-You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:\par
-\par
- * a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.\par
- * b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.\par
- * c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.\par
- * d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.\par
- * e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.\par
-\par
-A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.\par
-\par
-A \ldblquote User Product\rdblquote is either (1) a \ldblquote consumer product\rdblquote , which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, \ldblquote normally used\rdblquote refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.\par
-\par
-\ldblquote Installation Information\rdblquote for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.\par
-\par
-If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).\par
-\par
-The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.\par
-\par
-Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.\par
-7. Additional Terms.\par
-\par
-\ldblquote Additional permissions\rdblquote are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.\par
-\par
-When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.\par
-\par
-Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:\par
-\par
- * a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or\par
- * b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or\par
- * c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or\par
- * d) Limiting the use for publicity purposes of names of licensors or authors of the material; or\par
- * e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or\par
- * f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.\par
-\par
-All other non-permissive additional terms are considered \ldblquote further restrictions\rdblquote within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.\par
-\par
-If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.\par
-\par
-Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.\par
-8. Termination.\par
-\par
-You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).\par
-\par
-However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.\par
-\par
-Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.\par
-\par
-Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.\par
-9. Acceptance Not Required for Having Copies.\par
-\par
-You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.\par
-10. Automatic Licensing of Downstream Recipients.\par
-\par
-Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.\par
-\par
-An \ldblquote entity transaction\rdblquote is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.\par
-\par
-You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.\par
-11. Patents.\par
-\par
-A \ldblquote contributor\rdblquote is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's \ldblquote contributor version\rdblquote .\par
-\par
-A contributor's \ldblquote essential patent claims\rdblquote are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, \ldblquote control\rdblquote includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.\par
-\par
-Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.\par
-\par
-In the following three paragraphs, a \ldblquote patent license\rdblquote is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To \ldblquote grant\rdblquote such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.\par
-\par
-If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. \ldblquote Knowingly relying\rdblquote means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.\par
-\par
-If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.\par
-\par
-A patent license is \ldblquote discriminatory\rdblquote if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.\par
-\par
-Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.\par
-12. No Surrender of Others' Freedom.\par
-\par
-If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.\par
-13. Use with the GNU Affero General Public License.\par
-\par
-Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.\par
-14. Revised Versions of this License.\par
-\par
-The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.\par
-\par
-Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License \ldblquote or any later version\rdblquote applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.\par
-\par
-If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.\par
-\par
-Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.\par
-15. Disclaimer of Warranty.\par
-\par
-THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \ldblquote AS IS\rdblquote WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\par
-16. Limitation of Liability.\par
-\par
-IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\par
-17. Interpretation of Sections 15 and 16.\par
-\par
-If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.\par
-\par
-END OF TERMS AND CONDITIONS\par
-\pard\brdrb\brdrdb\brdrw15\brdrcf4 \sa283\fs12\par
-\par
-}
-
+{\rtf1\ansi\deff1\adeflang1025
+{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\fswiss\fprq2\fcharset0 Tahoma;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\fswiss\fprq2\fcharset0 Tahoma;}{\f4\froman\fprq2\fcharset0 Thorndale{\*\falt Times New Roman};}{\f5\fnil\fprq2\fcharset0 HG Mincho Light J{\*\falt msmincho};}{\f6\fnil\fprq2\fcharset0 LucidaSans;}{\f7\fnil\fprq0\fcharset0 LucidaSans;}}
+{\colortbl;\red0\green0\blue0;\red0\green0\blue128;\red128\green128\blue128;}
+{\stylesheet{\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033\snext1 Normal;}
+{\s2\sb240\sa120\keepn\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af6\afs28\lang255\ltrch\dbch\af5\langfe255\hich\f2\fs28\lang1033\loch\f2\fs28\lang1033\sbasedon1\snext3 Heading;}
+{\s3\sa120\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033\sbasedon1\snext3 Body Text;}
+{\s4\sa120\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af7\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033\sbasedon3\snext4 List;}
+{\s5\sb120\sa120\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af7\afs24\lang255\ai\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\i\loch\f1\fs24\lang1033\i\sbasedon1\snext5 caption;}
+{\s6\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af7\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033\sbasedon1\snext6 Index;}
+}
+{\info{\creatim\yr0\mo0\dy0\hr0\min0}{\revtim\yr0\mo0\dy0\hr0\min0}{\printim\yr0\mo0\dy0\hr0\min0}{\comment StarWriter}{\vern3100}}\deftab709
+{\*\pgdsctbl
+{\pgdsc0\pgdscuse195\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\pgdscnxt0 Standard;}}
+{\*\pgdscno0}\paperh15840\paperw12240\margl1800\margr1800\margt1440\margb1440\sectd\sbknone\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc
+\pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ai\ab\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\i\b\loch\f1\fs24\lang1033\i\b {\rtlch \ltrch\loch\f1\fs24\lang1033\i\b License}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sa283\rtlch\af4\afs24\lang255\ltrch\dbch\af4\langfe255\hich\f4\fs24\lang1033\loch\f4\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 This product is made available subject to the terms of GNU Lesser General Public License Version 3. A copy of the LGPL license can be found at http://www.openoffice.org/license.html}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sa283\brdrb\brdrdb\brdrw15\brdrcf3\brsp0{\*\brdrb\brdlncol3\brdlnin1\brdlnout1\brdlndist20}\brsp0\rtlch\af4\afs12\lang255\ltrch\dbch\af4\langfe255\hich\f4\fs12\lang1033\loch\f4\fs12\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sa283\rtlch\af4\afs24\lang255\ltrch\dbch\af4\langfe255\hich\f4\fs24\lang1033\loch\f4\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Third Party Code. Additional copyright notices and license terms applicable to portions of the Software are set forth in the THIRDPARTYLICENSEREADME.html file.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sa283\brdrb\brdrdb\brdrw15\brdrcf3\brsp0{\*\brdrb\brdlncol3\brdlnin1\brdlnout1\brdlndist20}\brsp0\rtlch\af4\afs12\lang255\ltrch\dbch\af4\langfe255\hich\f4\fs12\lang1033\loch\f4\fs12\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sa283\rtlch\af4\afs24\lang255\ltrch\dbch\af4\langfe255\hich\f4\fs24\lang1033\loch\f4\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 All trademarks and registered trademarks mentioned herein are the property of their respective owners.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sa283\brdrb\brdrdb\brdrw15\brdrcf3\brsp0{\*\brdrb\brdlncol3\brdlnin1\brdlnout1\brdlndist20}\brsp0\rtlch\af4\afs12\lang255\ltrch\dbch\af4\langfe255\hich\f4\fs12\lang1033\loch\f4\fs12\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sa283\rtlch\af4\afs24\lang255\ltrch\dbch\af4\langfe255\hich\f4\fs24\lang1033\loch\f4\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Copyright \'a9 2000,2010 Oracle and/or its affiliates.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sa283\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\cf1\rtlch\ltrch\dbch\hich\f4\loch\f4 This product has been created with contributions from the OpenOffice.org community, of which Oracle is a principal member. OpenOffice.org acknowledges all community members, especially those mentioned at}}{\rtlch \ltrch\loch\f1\fs24\lang1033\i0\b0{\cf2\ul\ulc0\rtlch\ltrch\dbch\hich\f4\loch\f4 }{\rtlch\ltrch\dbch\hich\f4\loch\f4 http://www.openoffice.org/welcome/credits.html}}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sa283\rtlch\af4\afs24\lang255\ltrch\dbch\af4\langfe255\hich\f4\fs24\lang1033\loch\f4\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 GNU LESSER GENERAL PUBLIC LICENSE}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Version 3, 29 June 2007}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 0. Additional Definitions.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 As used herein, \'93this License\'94 refers to version 3 of the GNU Lesser General Public License, and the \'93GNU GPL\'94 refers to version 3 of the GNU General Public License.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch \'93}{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The Library\'94 refers to a covered work governed by this License, other than an Application or a Combined Work as defined below.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 An \'93Application\'94 is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 A \'93Combined Work\'94 is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the \'93Linked Version\'94.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The \'93Minimal Corresponding Source\'94 for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Vers
+ion.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The \'93Corresponding Application Code\'94 for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries
+ of the Combined Work.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 1. Exception to Section 3 of the GNU GPL.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 2. Conveying Modified Versions.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of
+the modified version:}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 3. Object Code Incorporating Material from Library Header Files.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters,
+data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following:}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * b) Accompany the object code with a copy of the GNU GPL and this license document.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 4. Combined Works.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do
+each of the following:}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * b) Accompany the Combined Work with a copy of the GNU GPL and this license document.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * d) Do one of the following:}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 o 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of t
+he Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 o 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified ve
+rsion of the Library that is interface-compatible with the Linked Version.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Co
+mbined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you
+use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.)}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 5. Combined Libraries.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of y
+our choice, if you do both of the following:}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 6. Revised Versions of the GNU Lesser General Public License.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concern
+s.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License \'93or any later version\'94 applies to it, you have the option of following the terms and
+ conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the
+GNU Lesser General Public License ever published by the Free Software Foundation.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that v
+ersion for the Library.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 GNU GENERAL PUBLIC LICENSE}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Version 3, 29 June 2007}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Copyright \'a9 2007 Free Software Foundation, Inc. <http://fsf.org/>}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Preamble}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The GNU General Public License is a free, copyleft license for software and other kinds of works.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--
+to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, t
+oo.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or
+ can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect t
+he freedom of others.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them thes
+e terms so they know their rights.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attr
+ibuted erroneously to authors of previous versions.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The sy
+stematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise
+substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to
+ a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The precise terms and conditions for copying, distribution and modification follow.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 TERMS AND CONDITIONS}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 0. Definitions.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch \'93}{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 This License\'94 refers to version 3 of the GNU General Public License.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch \'93}{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Copyright\'94 also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch \'93}{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The Program\'94 refers to any copyrightable work licensed under this License. Each licensee is addressed as \'93you\'94. \'93Licensees\'94 and \'93recipients\'94 may be individuals or organizations.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 To \'93modify\'94 a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a \'93modified version\'94 of the earlier work or a work \'93based on\'94 the earli
+er work.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 A \'93covered work\'94 means either the unmodified Program or a work based on the Program.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 To \'93propagate\'94 a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes
+copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 To \'93convey\'94 a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 An interactive user interface displays \'93Appropriate Legal Notices\'94 to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work
+(except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list m
+eets this criterion.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 1. Source Code.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The \'93source code\'94 for a work means the preferred form of the work for making modifications to it. \'93Object code\'94 means any non-source form of a work.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 A \'93Standard Interface\'94 means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that la
+nguage.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The \'93System Libraries\'94 of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the w
+ork with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A \'93Major Component\'94, in this context, means a major essential component (kernel, window system, and so on) of th
+e specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The \'93Corresponding Source\'94 for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not in
+clude the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition fi
+les associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms a
+nd other parts of the work.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The Corresponding Source for a work in source code form is that same work.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 2. Basic Permissions.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from
+ running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you,
+or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively
+on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 3. Protecting Users' Legal Rights From Anti-Circumvention Law.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention o
+f such measures.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intentio
+n to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 4. Conveying Verbatim Copies.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 5. Conveying Modified Source Versions.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * a) The work must carry prominent notices stating that you modified it, and giving a relevant date.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to \'93keep intact all notices\'94.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, r
+egardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution med
+ium, is called an \'93aggregate\'94 if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause thi
+s License to apply to the other parts of the aggregate.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 6. Conveying Non-Source Forms.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that pr
+oduct model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price
+ no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in ac
+cord with subsection 6b.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to cop
+y the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided
+you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requir
+ements.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 A \'93User Product\'94 is either (1) a \'93consumer product\'94, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a
+ product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, \'93normally used\'94 refers to a typical or common use of that class of product, regardless of the status of the parti
+cular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such u
+ses represent the only significant mode of use of the product.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch \'93}{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Installation Information\'94 for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Sour
+ce. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in
+perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third
+party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been mo
+dified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password
+ or key for unpacking, reading or copying.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 7. Additional Terms.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch \'93}{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Additional permissions\'94 are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this Lic
+ense, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to t
+he additional permissions.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You m
+ay place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * d) Limiting the use for publicity purposes of names of licensors or authors of the material; or}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch }{\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 * f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions di
+rectly impose on those licensors and authors.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 All other non-permissive additional terms are considered \'93further restrictions\'94 within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is
+a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided t
+hat the further restriction does not survive such relicensing or conveying.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 8. Termination.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted
+under the third paragraph of section 11).}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the cop
+yright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work)
+from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new l
+icenses for the same material under section 10.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 9. Acceptance Not Required for Having Copies.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptanc
+e. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptan
+ce of this License to do so.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 10. Automatic Licensing of Downstream Recipients.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this Li
+cense.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 An \'93entity transaction\'94 is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party
+to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the
+predecessor in interest, if the predecessor has it or can get it with reasonable efforts.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not ini
+tiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 11. Patents.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 A \'93contributor\'94 is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's \'93contributor version\'94.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 A contributor's \'93essential patent claims\'94 are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its cont
+ributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, \'93control\'94 includes the right to grant patent sublicenses in a manner consistent wi
+th the requirements of this License.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
+}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 In the following three paragraphs, a \'93patent license\'94 is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To \'93grant\'94 such
+a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other read
+ily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements
+ of this License, to extend the patent license to downstream recipients. \'93Knowingly relying\'94 means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a co
+untry, would infringe one or more identifiable patents in that country that you have reason to believe are valid.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate,
+ modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 A patent license is \'93discriminatory\'94 if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey
+ a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third
+party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection wi
+th specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 12. No Surrender of Others' Freedom.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneousl
+y your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the
+ Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 13. Use with the GNU Affero General Public License.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The te
+rms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 14. Revised Versions of this License.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License \'93or any later version\'94 applies to it, you have the option of following the terms and conditions either of that
+ numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 15. Disclaimer of Warranty.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \'93AS IS\'94 WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLU
+DING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY
+ SERVICING, REPAIR OR CORRECTION.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 16. Limitation of Liability.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONS
+EQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS
+), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 17. Interpretation of Sections 15 and 16.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connect
+ion with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033 {\rtlch \ltrch\loch\f4\fs24\lang1033\i0\b0 END OF TERMS AND CONDITIONS}
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\sa283\brdrb\brdrdb\brdrw15\brdrcf3\brsp0{\*\brdrb\brdlncol3\brdlnin1\brdlnout1\brdlndist20}\brsp0\rtlch\af4\afs12\lang255\ltrch\dbch\af4\langfe255\hich\f4\fs12\lang1033\loch\f4\fs12\lang1033
+\par \pard\plain \ltrpar\s1\cf0{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\af1\afs24\lang255\ltrch\dbch\af1\langfe255\hich\f1\fs24\lang1033\loch\f1\fs24\lang1033
+\par } \ No newline at end of file
diff --git a/readlicense_oo/source/license/license_en-US.txt b/readlicense_oo/source/license/license_en-US.txt
index 6e80610260..52fd9d1cfc 100644
--- a/readlicense_oo/source/license/license_en-US.txt
+++ b/readlicense_oo/source/license/license_en-US.txt
@@ -7,9 +7,9 @@ Third Party Code. Additional copyright notices and license terms applicable to p
All trademarks and registered trademarks mentioned herein are the property of their respective owners.
------------------------------------
-Copyright 2002,2008 Sun Microsystems, Inc.
+Copyright (c) 2000,2010 Oracle and/or it affiliates. All rights reserved.
-This product has been created with contributions from the OpenOffice.org community, of which Sun Microsystems Inc. is the founding member. OpenOffice.org acknowledges all community members, especially those mentioned at http://www.openoffice.org/welcome/credits.html.
+This product has been created with contributions from the OpenOffice.org community, of which Oracle is a principal member. OpenOffice.org acknowledges all community members, especially those mentioned at http://www.openoffice.org/welcome/credits.html.
------------------------------------
diff --git a/readlicense_oo/util/makefile.pmk b/readlicense_oo/util/makefile.pmk
index 88974113e6..8aee1ce3b6 100755
--- a/readlicense_oo/util/makefile.pmk
+++ b/readlicense_oo/util/makefile.pmk
@@ -53,11 +53,7 @@ $(COMMONMISC)$/readme.dtd : ..$/readme.dtd
virtual : $(MERGEDXRM) $(COMMONMISC)$/readme.dtd $(PRJ)$/docs/readme.xsl
$(MISC)$/readme_text.xsl : virtual
-.IF "$(USE_SHELL)"!="4nt"
$(SED) 's#method="html".*>#method="text"/>#' < ..$/readme.xsl > $@
-.ELSE # "$(USE_SHELL)"!="4nt"
- $(SED) "s/method=\"html\".*>/method=\"text\"\/>/" < ..$/readme.xsl > $@
-.ENDIF # "$(USE_SHELL)"!="4nt"
$(MISC)$/$(GUI)$/$(eq,$(GUI),WNT readme README)_%.html : 'virtual'
@@-$(MKDIRHIER) $(@:d)
diff --git a/scripting/source/basprov/basprov.map b/scripting/source/basprov/basprov.map
deleted file mode 100644
index 737cddbfe3..0000000000
--- a/scripting/source/basprov/basprov.map
+++ /dev/null
@@ -1,9 +0,0 @@
-OOO_1.1 {
- global:
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/scripting/source/basprov/makefile.mk b/scripting/source/basprov/makefile.mk
index 1555a74926..5001e5db28 100644
--- a/scripting/source/basprov/makefile.mk
+++ b/scripting/source/basprov/makefile.mk
@@ -50,7 +50,7 @@ SLOFILES= \
SHL1TARGET= $(TARGET)$(DLLPOSTFIX).uno
SHL1IMPLIB= i$(TARGET)
-SHL1VERSIONMAP=$(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
diff --git a/scripting/source/dlgprov/dlgprov.map b/scripting/source/dlgprov/dlgprov.map
deleted file mode 100644
index 737cddbfe3..0000000000
--- a/scripting/source/dlgprov/dlgprov.map
+++ /dev/null
@@ -1,9 +0,0 @@
-OOO_1.1 {
- global:
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/scripting/source/dlgprov/makefile.mk b/scripting/source/dlgprov/makefile.mk
index 0ad861d5c2..4554234127 100644
--- a/scripting/source/dlgprov/makefile.mk
+++ b/scripting/source/dlgprov/makefile.mk
@@ -46,7 +46,7 @@ SLOFILES= \
SHL1TARGET= $(TARGET)$(DLLPOSTFIX).uno
SHL1IMPLIB= i$(TARGET)
-SHL1VERSIONMAP=$(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
diff --git a/scripting/source/pyprov/pythonscript.py b/scripting/source/pyprov/pythonscript.py
index 6a57fa7928..88e0a9efbc 100644
--- a/scripting/source/pyprov/pythonscript.py
+++ b/scripting/source/pyprov/pythonscript.py
@@ -5,6 +5,7 @@ import sys
import os
import imp
import time
+import compiler
class LogLevel:
NONE = 0
@@ -340,6 +341,32 @@ class ProviderContext:
ret = url[0:pos]+ package.transientPathElement + "/" + url[pos:len(url)]
log.isDebugLevel() and log.debug( "getStorageUrlFromPersistentUrl " + url + " -> "+ ret)
return ret
+
+ def getFuncsByUrl( self, url ):
+ src = readTextFromStream( self.sfa.openFileRead( url ) )
+ checkForPythonPathBesideScript( url[0:url.rfind('/')] )
+ src = ensureSourceState( src )
+
+ code = compiler.parse( src )
+
+ allFuncs = []
+
+ if code == None:
+ return allFuncs
+
+ g_exportedScripts = []
+ for node in code.node.nodes:
+ if node.__class__.__name__ == 'Function':
+ allFuncs.append(node.name)
+ elif node.__class__.__name__ == 'Assign':
+ for assignee in node.nodes:
+ if assignee.name == 'g_exportedScripts':
+ for item in node.expr:
+ if item.__class__.__name__ == 'Name':
+ g_exportedScripts.append(item.name)
+ return g_exportedScripts
+
+ return allFuncs
def getModuleByUrl( self, url ):
entry = self.modules.get(url)
@@ -382,11 +409,10 @@ def isScript( candidate ):
#-------------------------------------------------------
class ScriptBrowseNode( unohelper.Base, XBrowseNode , XPropertySet, XInvocation, XActionListener ):
- def __init__( self, provCtx, uri, fileName, funcName, func ):
+ def __init__( self, provCtx, uri, fileName, funcName ):
self.fileName = fileName
self.funcName = funcName
self.provCtx = provCtx
- self.func = func
self.uri = uri
def getName( self ):
@@ -407,8 +433,6 @@ class ScriptBrowseNode( unohelper.Base, XBrowseNode , XPropertySet, XInvocation,
if name == "URI":
ret = self.provCtx.uriHelper.getScriptURI(
self.provCtx.getPersistentUrlFromStorageUrl( self.uri + "$" + self.funcName ) )
- elif name == "Description":
- ret = getattr( self.func, "__doc__", None )
elif name == "Editable" and ENABLE_EDIT_DIALOG:
ret = not self.provCtx.sfa.isReadOnly( self.uri )
@@ -506,7 +530,7 @@ class FileBrowseNode( unohelper.Base, XBrowseNode ):
self.provCtx = provCtx
self.uri = uri
self.name = name
- self.module = None
+ self.funcnames = None
def getName( self ):
return self.name
@@ -514,21 +538,14 @@ class FileBrowseNode( unohelper.Base, XBrowseNode ):
def getChildNodes(self):
ret = ()
try:
- self.module = self.provCtx.getModuleByUrl( self.uri )
- values = self.module.__dict__.get( CALLABLE_CONTAINER_NAME , None )
+ self.funcnames = self.provCtx.getFuncsByUrl( self.uri )
- # no g_exportedScripts, export every function
- if not isinstance(values, type(())):
- values = self.module.__dict__.values()
-
scriptNodeList = []
- for i in values:
- if isScript( i ):
- scriptNodeList.append(
- ScriptBrowseNode(
- self.provCtx, self.uri, self.name, i.__name__, i ))
+ for i in self.funcnames:
+ scriptNodeList.append(
+ ScriptBrowseNode(
+ self.provCtx, self.uri, self.name, i ))
ret = tuple( scriptNodeList )
- # must compile !
log.isDebugLevel() and log.debug( "returning " +str(len(ret)) + " ScriptChildNodes on " + self.uri )
except Exception, e:
text = lastException2String()
diff --git a/scripting/source/stringresource/makefile.mk b/scripting/source/stringresource/makefile.mk
index afb07fddfa..dfc2d19791 100644
--- a/scripting/source/stringresource/makefile.mk
+++ b/scripting/source/stringresource/makefile.mk
@@ -44,7 +44,7 @@ SLOFILES= \
SHL1TARGET= $(TARGET)$(DLLPOSTFIX).uno
SHL1IMPLIB= i$(TARGET)
-SHL1VERSIONMAP=$(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
diff --git a/scripting/source/stringresource/stringresource.map b/scripting/source/stringresource/stringresource.map
deleted file mode 100644
index 737cddbfe3..0000000000
--- a/scripting/source/stringresource/stringresource.map
+++ /dev/null
@@ -1,9 +0,0 @@
-OOO_1.1 {
- global:
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/scripting/source/vbaevents/makefile.mk b/scripting/source/vbaevents/makefile.mk
index 227da45f9f..1946c61d1e 100755..100644
--- a/scripting/source/vbaevents/makefile.mk
+++ b/scripting/source/vbaevents/makefile.mk
@@ -60,7 +60,7 @@ SLOFILES= \
SHL1TARGET= $(TARGET)$(DLLPOSTFIX).uno
SHL1IMPLIB= i$(TARGET)
-SHL1VERSIONMAP=$(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
diff --git a/scripting/source/vbaevents/vbaevents.map b/scripting/source/vbaevents/vbaevents.map
deleted file mode 100755
index 737cddbfe3..0000000000
--- a/scripting/source/vbaevents/vbaevents.map
+++ /dev/null
@@ -1,9 +0,0 @@
-OOO_1.1 {
- global:
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/sfx2/inc/about.hxx b/sfx2/inc/about.hxx
index a7c76d09f1..7a4d1c5f31 100644
--- a/sfx2/inc/about.hxx
+++ b/sfx2/inc/about.hxx
@@ -29,15 +29,10 @@
// include ---------------------------------------------------------------
-#ifndef _RESARY_HXX //autogen
#include <tools/resary.hxx>
-#endif
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
-#ifndef _ACCEL_HXX //autogen
#include <vcl/accel.hxx>
-#endif
+#include <svtools/svmedit.hxx>
#include <tools/list.hxx>
#include <svtools/stdctrl.hxx>
#include <sfx2/basedlgs.hxx> // SfxModalDialog
@@ -53,13 +48,14 @@ private:
Image aAppLogo;
FixedInfo aVersionText;
- FixedInfo aCopyrightText;
+ MultiLineEdit aCopyrightText;
FixedInfo aBuildData;
ResStringArray aDeveloperAry;
String aDevVersionStr;
String aAccelStr;
String aVersionData;
+ String aCopyrightTextStr;
AccelList aAccelList;
diff --git a/sfx2/inc/frmload.hxx b/sfx2/inc/frmload.hxx
index 78294180c1..aa9b7e5cee 100644
--- a/sfx2/inc/frmload.hxx
+++ b/sfx2/inc/frmload.hxx
@@ -28,80 +28,126 @@
#ifndef _SFX_FRMLOAD_HXX
#define _SFX_FRMLOAD_HXX
+#include "sfx2/sfxuno.hxx"
+#include "sfx2/objsh.hxx"
+
+/** === begin UNO includes === **/
#include <com/sun/star/frame/XLoadEventListener.hpp>
-#include <rtl/ustring.hxx>
-#include <tools/debug.hxx>
#include <com/sun/star/frame/XSynchronousFrameLoader.hpp>
+#include <com/sun/star/frame/XController2.hpp>
+#include <com/sun/star/frame/XModel2.hpp>
#include <com/sun/star/document/XExtendedFilterDetection.hpp>
#include <com/sun/star/uno/Exception.hpp>
-#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XSingleServiceFactory.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/task/XInteractionHandler.hpp>
+/** === end UNO includes === **/
+
+#include <rtl/ustring.hxx>
+#include <tools/debug.hxx>
#include <cppuhelper/implbase1.hxx>
#include <cppuhelper/implbase2.hxx>
#include <cppuhelper/implbase3.hxx>
-
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <cppuhelper/factory.hxx>
#include <tools/link.hxx>
#include <tools/string.hxx>
+#include <comphelper/componentcontext.hxx>
+#include <comphelper/namedvaluecollection.hxx>
-class SfxObjectFactory;
+class SfxFilter;
class SfxFilterMatcher;
-class LoadEnvironment_Impl;
-class SfxMedium;
-namespace com
-{
- namespace sun
- {
- namespace star
- {
- namespace uno
- {
- class Any;
- }
- namespace lang
- {
- class XMultiServiceFactory;
- }
- namespace frame
- {
- class XFrame;
- }
- namespace beans
- {
- struct PropertyValue;
- }
- }
- }
-}
-
-#include <sfx2/sfxuno.hxx>
-
-#define REFERENCE ::com::sun::star::uno::Reference
-#define SEQUENCE ::com::sun::star::uno::Sequence
-#define RUNTIME_EXCEPTION ::com::sun::star::uno::RuntimeException
-
-class SfxFrameLoader_Impl : public ::cppu::WeakImplHelper2< ::com::sun::star::frame::XSynchronousFrameLoader, ::com::sun::star::lang::XServiceInfo >
-{
- REFERENCE < ::com::sun::star::frame::XFrame > xFrame;
- REFERENCE < ::com::sun::star::frame::XLoadEventListener > xListener;
- String aFilterName;
- SfxMedium* pMedium;
+class SfxFrameWeak;
- DECL_LINK( LoadDone_Impl, void* );
+class SAL_DLLPRIVATE SfxFrameLoader_Impl : public ::cppu::WeakImplHelper2< ::com::sun::star::frame::XSynchronousFrameLoader, ::com::sun::star::lang::XServiceInfo >
+{
+ ::comphelper::ComponentContext m_aContext;
public:
- SfxFrameLoader_Impl( const REFERENCE < ::com::sun::star::lang::XMultiServiceFactory >& xFactory );
- virtual ~SfxFrameLoader_Impl();
+ SfxFrameLoader_Impl( const ::com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory );
SFX_DECL_XSERVICEINFO
//----------------------------------------------------------------------------------
// XSynchronousFrameLoader
//----------------------------------------------------------------------------------
- virtual sal_Bool SAL_CALL load( const SEQUENCE< ::com::sun::star::beans::PropertyValue >& lDescriptor, const REFERENCE< ::com::sun::star::frame::XFrame >& xFrame ) throw( RUNTIME_EXCEPTION );
- virtual void SAL_CALL cancel() throw( RUNTIME_EXCEPTION );
+ virtual sal_Bool SAL_CALL load( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rArgs, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxFrame ) throw( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL cancel() throw( ::com::sun::star::uno::RuntimeException );
+
+protected:
+ virtual ~SfxFrameLoader_Impl();
+
+private:
+ const SfxFilter* impl_getFilterFromServiceName_nothrow(
+ const ::rtl::OUString& i_rServiceName
+ ) const;
+
+ ::rtl::OUString impl_askForFilter_nothrow(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& i_rxHandler,
+ const ::rtl::OUString& i_rDocumentURL
+ ) const;
+
+ const SfxFilter* impl_detectFilterForURL(
+ const ::rtl::OUString& _rURL,
+ const ::comphelper::NamedValueCollection& i_rDescriptor,
+ const SfxFilterMatcher& rMatcher
+ ) const;
+
+ sal_Bool impl_createNewDocWithSlotParam(
+ const USHORT _nSlotID,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rxFrame,
+ const bool i_bHidden
+ );
+
+ void impl_determineFilter(
+ ::comphelper::NamedValueCollection& io_rDescriptor
+ ) const;
+
+ bool impl_determineTemplateDocument(
+ ::comphelper::NamedValueCollection& io_rDescriptor
+ ) const;
+
+ USHORT impl_findSlotParam(
+ const ::rtl::OUString& i_rFactoryURL
+ ) const;
+
+ SfxObjectShellLock impl_findObjectShell(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel2 >& i_rxDocument
+ ) const;
+
+ void impl_lockHiddenDocument(
+ SfxObjectShell& i_rDocument,
+ const ::comphelper::NamedValueCollection& i_rDescriptor
+ ) const;
+
+ void impl_handleCaughtError_nothrow(
+ const ::com::sun::star::uno::Any& i_rCaughtError,
+ const ::comphelper::NamedValueCollection& i_rDescriptor
+ ) const;
+
+ void impl_removeLoaderArguments(
+ ::comphelper::NamedValueCollection& io_rDescriptor
+ );
+
+ sal_Int16 impl_determineEffectiveViewId_nothrow(
+ const SfxObjectShell& i_rDocument,
+ const ::comphelper::NamedValueCollection& i_rDescriptor
+ );
+
+ ::comphelper::NamedValueCollection
+ impl_extractViewCreationArgs(
+ ::comphelper::NamedValueCollection& io_rDescriptor
+ );
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController2 >
+ impl_createDocumentView(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel2 >& i_rModel,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame,
+ const ::comphelper::NamedValueCollection& i_rViewFactoryArgs,
+ const ::rtl::OUString& i_rViewName
+ );
};
#endif
diff --git a/sfx2/inc/inettbc.hxx b/sfx2/inc/inettbc.hxx
index 633c3c007a..c50e3a87ed 100644
--- a/sfx2/inc/inettbc.hxx
+++ b/sfx2/inc/inettbc.hxx
@@ -74,19 +74,6 @@ public:
virtual void StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState );
};
-class SfxCancelToolBoxControl_Impl : public SfxToolBoxControl
-{
-public:
-
- SFX_DECL_TOOLBOX_CONTROL();
-
- SfxCancelToolBoxControl_Impl( USHORT nSlotId, USHORT nId, ToolBox& rBox );
-
- virtual SfxPopupWindowType GetPopupWindowType() const;
- virtual SfxPopupWindow* CreatePopupWindow();
- virtual void StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState );
-};
-
#endif
#endif
diff --git a/sfx2/inc/pch/precompiled_sfx2.hxx b/sfx2/inc/pch/precompiled_sfx2.hxx
index d457cc4759..6e6ada026d 100644
--- a/sfx2/inc/pch/precompiled_sfx2.hxx
+++ b/sfx2/inc/pch/precompiled_sfx2.hxx
@@ -492,7 +492,6 @@
#include "svl/aeitem.hxx"
#include "svtools/asynclink.hxx"
#include "svl/brdcst.hxx"
-#include "svl/cancel.hxx"
#include "svl/cntwids.hrc"
#include "svtools/controldims.hrc"
#include "svl/ctypeitm.hxx"
diff --git a/sfx2/inc/sfx2/app.hxx b/sfx2/inc/sfx2/app.hxx
index ac548cf14b..18c3735d1c 100644
--- a/sfx2/inc/sfx2/app.hxx
+++ b/sfx2/inc/sfx2/app.hxx
@@ -58,7 +58,6 @@ class AppSettings;
struct SfxChildWinContextFactory;
class SfxAppData_Impl;
class SfxBindings;
-class SfxCancelManager;
class SfxChildWinFactArr_Impl;
class SfxChildWindow;
class SfxDispatcher;
@@ -218,7 +217,6 @@ public:
// members
SfxFilterMatcher& GetFilterMatcher();
- SfxCancelManager* GetCancelManager() const;
SfxMacroConfig* GetMacroConfig() const;
SfxProgress* GetProgress() const;
const String& GetLastSaveDirectory() const;
@@ -264,7 +262,6 @@ public:
SAL_DLLPRIVATE SfxDispatcher* GetAppDispatcher_Impl();
SAL_DLLPRIVATE SfxDispatcher* GetDispatcher_Impl();
- SAL_DLLPRIVATE SfxObjectShellLock NewDoc_Impl( const String& rFactory, const SfxItemSet* pSet = NULL );
SAL_DLLPRIVATE BOOL QueryExit_Impl();
SAL_DLLPRIVATE void SetOptions_Impl(const SfxItemSet &);
SAL_DLLPRIVATE FASTBOOL Initialize_Impl();
@@ -290,7 +287,6 @@ public:
// TODO/CLEANUP: still needed?
SAL_DLLPRIVATE void NewDocDirectExec_Impl(SfxRequest &);
SAL_DLLPRIVATE void NewDocExec_Impl(SfxRequest &);
- SAL_DLLPRIVATE const SfxPoolItem* NewDocDirectExec_ImplOld(SfxRequest &); // used by FrameLoader to work with the old behaviour ...
SAL_DLLPRIVATE void OpenDocExec_Impl(SfxRequest &);
SAL_DLLPRIVATE void MiscExec_Impl(SfxRequest &);
SAL_DLLPRIVATE void MiscState_Impl(SfxItemSet &);
diff --git a/sfx2/inc/sfx2/bindings.hxx b/sfx2/inc/sfx2/bindings.hxx
index f7cd994b07..6eab21e0b7 100644
--- a/sfx2/inc/sfx2/bindings.hxx
+++ b/sfx2/inc/sfx2/bindings.hxx
@@ -96,8 +96,7 @@ class SFX2_DLLPUBLIC SfxBindings: public SfxBroadcaster
der Klasse SfxBindings. Sie wird von der SfxApplication automatisch
angelegt und zerst"ort. Instanzen werden aber i.d.R. "uber das
Makro <SFX_BINDINGS> oder den zugeh"origen <SfxViewFrame> besorgt
- werden. Bestimmte SfxViewFrame Subklassen (z.B. <SfxInPlaceFrame>)
- legen ihre eigene Instanz der SfxBindings an.
+ werden.
Die SfxBindings verwalten alle in den an ihr angemeldeten Controllern
gebundenen Slot-Ids und cachen die jeweiligen <Slot-Server>
diff --git a/sfx2/inc/sfx2/docfac.hxx b/sfx2/inc/sfx2/docfac.hxx
index cf1b5ce9f6..87fa15db4d 100644
--- a/sfx2/inc/sfx2/docfac.hxx
+++ b/sfx2/inc/sfx2/docfac.hxx
@@ -82,6 +82,7 @@ public:
const SvGlobalName& GetClassId() const;
SfxObjectShellFlags GetFlags() { return nFlags; }
const char* GetShortName() const { return pShortName; }
+ String GetFactoryURL() const; // shortcut for "private:factory/GetShortName()"
String GetFactoryName() const { return String::CreateFromAscii( pShortName ); }
String GetModuleName() const;
void SetDocumentTypeNameResource( const ResId& rId );
@@ -93,6 +94,9 @@ public:
USHORT GetViewFactoryCount() const;
SfxViewFactory& GetViewFactory(USHORT i = 0) const;
+ /// returns the view factory whose GetViewName delivers the requested logical name
+ SfxViewFactory* GetViewFactoryByViewName( const String& i_rViewName ) const;
+
// Filter
const SfxFilter* GetTemplateFilter() const;
static String GetStandardTemplate( const String& rServiceName );
@@ -106,6 +110,7 @@ public:
//#if 0 // _SOLAR__PRIVATE
SAL_DLLPRIVATE void SetModule_Impl( SfxModule* );
SAL_DLLPRIVATE static void UpdateFilterContainers_Impl();
+ SAL_DLLPRIVATE sal_uInt16 GetViewNo_Impl( const sal_uInt16 i_nViewId, const sal_uInt16 i_nFallback ) const;
//#endif
private:
diff --git a/sfx2/inc/sfx2/docfile.hxx b/sfx2/inc/sfx2/docfile.hxx
index 12e3b3dcee..e6961a1a1b 100644
--- a/sfx2/inc/sfx2/docfile.hxx
+++ b/sfx2/inc/sfx2/docfile.hxx
@@ -48,7 +48,6 @@
#include <svl/lstner.hxx>
#include <tools/globname.hxx>
-#include <svl/cancel.hxx>
#include <cppuhelper/weak.hxx>
#include <ucbhelper/content.hxx>
@@ -64,16 +63,6 @@ class SfxItemSet;
class DateTime;
class SvStringsDtor;
class SvEaMgr;
-class SfxPoolCancelManager_Impl;
-
-#define SFX_TFPRIO_SYNCHRON 0
-#define SFX_TFPRIO_DOC 10
-#define SFX_TFPRIO_VISIBLE_LOWRES_GRAPHIC 20
-#define SFX_TFPRIO_VISIBLE_HIGHRES_GRAPHIC 21
-#define SFX_TFPRIO_PLUGINS 40
-#define SFX_TFPRIO_INVISIBLE_LOWRES_GRAPHIC 50
-#define SFX_TFPRIO_INVISIBLE_HIGHRES_GRAPHIC 51
-#define SFX_TFPRIO_DOWNLOADS 60
#define S2BS(s) ByteString( s, RTL_TEXTENCODING_MS_1252 )
@@ -157,7 +146,6 @@ public:
void SetLoadTargetFrame(SfxFrame* pFrame );
SfxFrame* GetLoadTargetFrame() const;
- void CancelTransfers();
void SetReferer( const String& rRefer );
const String& GetReferer( ) const;
@@ -235,7 +223,6 @@ public:
void SetUsesCache( sal_Bool );
sal_Bool IsExpired() const;
void SetName( const String& rName, sal_Bool bSetOrigURL = sal_False );
- void SetDontCreateCancellable();
sal_Bool IsAllowedForExternalBrowser() const;
long GetFileVersion() const;
@@ -273,8 +260,6 @@ public:
SAL_DLLPRIVATE sal_Bool TransferVersionList_Impl( SfxMedium& rMedium );
SAL_DLLPRIVATE sal_Bool SaveVersionList_Impl( sal_Bool bUseXML );
SAL_DLLPRIVATE sal_Bool RemoveVersion_Impl( const ::rtl::OUString& rVersion );
- SAL_DLLPRIVATE SfxPoolCancelManager_Impl* GetCancelManager_Impl() const;
- SAL_DLLPRIVATE void SetCancelManager_Impl( SfxPoolCancelManager_Impl* pMgr );
SAL_DLLPRIVATE void SetExpired_Impl( const DateTime& rDateTime );
SAL_DLLPRIVATE SvKeyValueIterator* GetHeaderAttributes_Impl();
diff --git a/sfx2/inc/sfx2/frame.hxx b/sfx2/inc/sfx2/frame.hxx
index 9d9a6b3f26..fe47d4674b 100644
--- a/sfx2/inc/sfx2/frame.hxx
+++ b/sfx2/inc/sfx2/frame.hxx
@@ -68,6 +68,7 @@ namespace com
#include <svl/brdcst.hxx>
#include <tools/list.hxx>
#include <svl/poolitem.hxx>
+#include <comphelper/namedvaluecollection.hxx>
class SvBorder;
class SfxWorkWindow;
@@ -83,31 +84,18 @@ class SfxMedium;
class SfxFrameHistory_Impl;
class SfxDispatcher;
class SfxMedium;
-class SfxCancellable;
class Rectangle;
class SfxRequest;
class SfxUnoControllerItem;
class SvCompatWeakHdl;
+class SystemWindow;
typedef SfxFrame* SfxFramePtr;
class SfxFrameArr_Impl;
DECLARE_LIST( TargetList, String* )
-#define SFXFRAME_INTERNAL 0x0001
-#define SFXFRAME_EXTERNAL 0x0002
-#define SFXFRAME_OWNSDOCUMENT 0x0004
-#define SFXFRAME_PLUGIN 0x0008
-#define SFXFRAME_HASTITLE 0x0010
-#define SFXFRAME_SERVER 0x0020 // Is es ein Frame, der in einem Container steckt ?
-#define SFXFRAME_FRAMESET 0x0040
-
-#define BROWSE_NORMAL 0
-#define BROWSE_FORWARD 1
-#define BROWSE_BACKWARD 2
-#define NO_BROWSE 3
-#define BROWSE_FRAME 4
-#define BROWSE_MAX_MODE 10
+#define SFXFRAME_HASTITLE 0x0001
//==========================================================================
// Ein SfxFrame ist eine Verwaltungsklasse f"ur Fenster und deren Inhalte.
@@ -123,82 +111,63 @@ DECLARE_LIST( TargetList, String* )
//==========================================================================
class SfxFrameArr_Impl;
-class SfxCancelManager;
struct SfxFramePickEntry_Impl;
-class SfxUnoFrame;
class SFX2_DLLPUBLIC SfxFrame
{
friend class SfxFrameIterator;
- friend struct SfxFramePickEntry_Impl;
- friend class SfxUnoFrame;
- friend class SfxViewFrame; /*HACK!*/
+ friend class SfxFrameWindow_Impl;
private:
- String aName;
SfxFrame* pParentFrame;
SfxFrameArr_Impl* pChildArr;
SfxFrame_Impl* pImp;
- SfxUnoFrame* pUnoImp;
-
- SAL_DLLPRIVATE void UpdateUndoHistory_Impl(
- SfxObjectShell *pDocSh, const String* pNew, const String *pTitle = 0 );
- SAL_DLLPRIVATE void UpdateCurrentHistory_Impl(
- SfxObjectShell *pDocSh, const String* pNew );
+ Window* pWindow;
protected:
- virtual sal_Bool Close() = 0;
- virtual ~SfxFrame();
+ sal_Bool Close();
+ virtual ~SfxFrame();
-//#if 0 // _SOLAR__PRIVATE
- SAL_DLLPRIVATE void SetCurrentDocument_Impl( SfxObjectShell* );
- SAL_DLLPRIVATE void InsertChildFrame_Impl( SfxFrame*, sal_uInt16 nPos = 0 );
- SAL_DLLPRIVATE void RemoveChildFrame_Impl( sal_uInt16 nPos );
SAL_DLLPRIVATE void RemoveChildFrame_Impl( SfxFrame* );
- SAL_DLLPRIVATE void SetIsTop_Impl( sal_Bool bIsTop = sal_True );
-//#endif
+
+ SfxFrame( ); // not implemented
+ SAL_DLLPRIVATE SfxFrame( Window& i_rContainerWindow, bool bHidden );
public:
TYPEINFO();
- SfxFrame(SfxFrame* pParent = 0);
+
+ static SfxFrame* Create( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame );
+ static ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >
+ CreateBlankFrame();
+ static SfxFrame* Create( SfxObjectShell& rDoc, Window& rWindow, USHORT nViewId, bool bHidden );
SvCompatWeakHdl* GetHdl();
- virtual Window& GetWindow() const = 0;
+ Window& GetWindow() const;
void CancelTransfers( sal_Bool bCancelLoadEnv = sal_True );
sal_Bool DoClose();
sal_uInt16 GetChildFrameCount() const;
SfxFrame* GetChildFrame( sal_uInt16 nPos ) const;
- void SetFrameName( const String& rName );
- const String& GetFrameName() const
- { return aName; }
SfxFrame* GetParentFrame() const
{ return pParentFrame; }
- String GetContent() const;
+
+ void SetPresentationMode( BOOL bSet );
+ SystemWindow* GetSystemWindow() const;
static SfxFrame* GetFirst();
static SfxFrame* GetNext( SfxFrame& );
- virtual sal_Bool InsertDocument( SfxObjectShell *pDoc );
- const SfxPoolItem* LoadDocumentSynchron( SfxItemSet& aSet );
- void DocumentInserted( SfxObjectShell* pDoc );
+ static const SfxPoolItem*
+ OpenDocumentSynchron( SfxItemSet& aSet, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rTargetFrame );
SfxBroadcaster& GetBroadcaster() const;
SfxObjectShell* GetCurrentDocument() const;
SfxViewFrame* GetCurrentViewFrame() const;
- SfxFrame* GetTopFrame() const;
+ SfxFrame& GetTopFrame() const;
sal_Bool IsParent( SfxFrame* ) const;
- SfxFrame* findFrame( const ::rtl::OUString& aTargetFrameName, sal_Int32 nSearchFlags);
- SfxFrame* SearchFrame( const String&, SfxMedium* pMedium = 0 );
sal_uInt32 GetFrameType() const;
void GetTargetList( TargetList& ) const;
- void ClearHistory();
SAL_DLLPRIVATE SfxFrame* GetContainingDocFrame_Impl( SfxFrame* pSelf );
sal_Bool IsTop() const;
- sal_Bool CloseChildFrames();
- void UpdatePickEntries();
- void UpdatePickEntries( const ::com::sun::star::uno::Any& rValue );
- void UpdateHistory( const ::rtl::OUString& aURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgs, const ::rtl::OUString& rTitle );
- void UpdateHistory(SfxObjectShell*, const String*pNew = 0 );
void UpdateDescriptor( SfxObjectShell *pDoc );
void Resize();
sal_Bool HasComponent() const;
@@ -212,68 +181,30 @@ public:
::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >
GetController() const;
- static sal_Bool LoadSfxComponent( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > &,
- const ::rtl::OUString&,
- const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >&,
- const SfxObjectFactory* );
-
sal_Bool IsInPlace() const;
//#if 0 // _SOLAR__PRIVATE
SAL_DLLPRIVATE sal_Bool DoClose_Impl();
- SAL_DLLPRIVATE void SetFrameInterface_Impl( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
+ SAL_DLLPRIVATE void SetFrameInterface_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
SAL_DLLPRIVATE void ReleasingComponent_Impl( sal_Bool bSet );
- SAL_DLLPRIVATE const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterceptor >
- GetInterceptor_Impl();
- SAL_DLLPRIVATE void Clear_Impl();
- SAL_DLLPRIVATE sal_uInt16 LoadComponent_Impl( const ::rtl::OUString& rURL,
- const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rArgs,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrameLoader > & rLoader,
- SfxItemSet* pSet=0, sal_Bool bDontClose=sal_False );
- SAL_DLLPRIVATE void LoadFinished_Impl();
- DECL_DLLPRIVATE_STATIC_LINK( SfxFrame, BindingHasNewPart_Impl, void* );
- SAL_DLLPRIVATE SfxCancelManager* GetCancelManager() const;
SAL_DLLPRIVATE void GetViewData_Impl();
- SAL_DLLPRIVATE sal_Bool CheckContentForLoad_Impl();
- SAL_DLLPRIVATE sal_Bool ExecuteHistoryMenu_Impl( sal_uInt16 nWnich, const Rectangle& rRect, sal_uInt16 nFlags=0 );
- SAL_DLLPRIVATE void ActivatePickEntry_Impl( SfxFramePickEntry_Impl*, sal_uInt16 nMode, SfxFrameDescriptor *pD = NULL );
- SAL_DLLPRIVATE void CopyHistory_Impl( SfxFrame *pFrame ) const;
- SAL_DLLPRIVATE SfxFrame* SearchChildrenForName_Impl( const String&, sal_Bool bDeep = sal_True ) const;
SAL_DLLPRIVATE void SetFrameType_Impl( sal_uInt32 );
- SAL_DLLPRIVATE void Activate_Impl( sal_Bool bBeamerOn );
- SAL_DLLPRIVATE void Deactivate_Impl();
SAL_DLLPRIVATE sal_uInt16 PrepareClose_Impl( sal_Bool bUI, sal_Bool bForBrowsing=sal_False );
SAL_DLLPRIVATE sal_Bool DocIsModified_Impl();
SAL_DLLPRIVATE void SetCurrentViewFrame_Impl( SfxViewFrame* );
- SAL_DLLPRIVATE SfxFrame* SearchFrame_Impl( sal_uInt16, sal_Bool bDeep=sal_False );
- SAL_DLLPRIVATE SfxFrame* SearchFrame_Impl( const String&, sal_Bool bDeep=sal_False );
- SAL_DLLPRIVATE void SetFrameId_Impl( sal_uInt16 );
- SAL_DLLPRIVATE sal_uInt16 GetFrameId_Impl() const;
- SAL_DLLPRIVATE void SetFrameIdName_Impl( const String& );
SAL_DLLPRIVATE sal_Bool IsClosing_Impl() const;
SAL_DLLPRIVATE void SetIsClosing_Impl();
- SAL_DLLPRIVATE sal_Bool BrowseInFrame( int nDelta );
- SAL_DLLPRIVATE sal_Bool Browse( sal_Bool bForward, sal_uInt16 nDelta = 1, sal_Bool bNewFrame=sal_False );
- SAL_DLLPRIVATE sal_Bool CanBrowseForward() const;
- SAL_DLLPRIVATE sal_Bool CanBrowseBackward() const;
// Methoden f"ur den Zugriff auf das aktuelle Set
SAL_DLLPRIVATE void SetDescriptor( SfxFrameDescriptor* );
SAL_DLLPRIVATE SfxFrameDescriptor* GetDescriptor() const;
SAL_DLLPRIVATE void Lock_Impl( sal_Bool bLock );
- SAL_DLLPRIVATE sal_uInt16 GetLockCount_Impl() const;
- //sal_Bool IsLocked_Impl() const
- // { return GetLockCount_Impl() > 0; }
- SAL_DLLPRIVATE void CloseOnUnlock_Impl();
- SAL_DLLPRIVATE SfxViewFrame* ActivateChildFrame_Impl();
SAL_DLLPRIVATE SfxDispatcher* GetDispatcher_Impl() const;
SAL_DLLPRIVATE sal_Bool IsAutoLoadLocked_Impl() const;
SAL_DLLPRIVATE static void InsertTopFrame_Impl( SfxFrame* pFrame );
SAL_DLLPRIVATE static void RemoveTopFrame_Impl( SfxFrame* pFrame );
- SAL_DLLPRIVATE void SetItemSet_Impl( const SfxItemSet* pSet );
- SAL_DLLPRIVATE const SfxItemSet* GetItemSet_Impl();
SAL_DLLPRIVATE void SetOwnsBindings_Impl( sal_Bool bSet );
SAL_DLLPRIVATE sal_Bool OwnsBindings_Impl() const;
SAL_DLLPRIVATE void InvalidateUnoControllers_Impl();
@@ -284,15 +215,19 @@ public:
SAL_DLLPRIVATE Rectangle GetTopOuterRectPixel_Impl() const;
SAL_DLLPRIVATE void CreateWorkWindow_Impl();
SAL_DLLPRIVATE void SetWorkWindow_Impl( SfxWorkWindow* pWorkwin );
- SAL_DLLPRIVATE const SvBorder& GetBorder_Impl() const;
SAL_DLLPRIVATE void GrabFocusOnComponent_Impl();
- SAL_DLLPRIVATE void ReFill_Impl( const SfxFrameSetDescriptor* pSet );
- SAL_DLLPRIVATE void LockFocus_Impl( sal_Bool bLock );
- SAL_DLLPRIVATE sal_Bool IsFocusLocked_Impl() const;
- SAL_DLLPRIVATE void CloseDocument_Impl();
SAL_DLLPRIVATE void SetInPlace_Impl( sal_Bool );
-// sal_Bool IsPlugin_Impl() const;
+
+ SAL_DLLPRIVATE void PrepareForDoc_Impl( SfxObjectShell& i_rDoc );
+ SAL_DLLPRIVATE void LockResize_Impl( BOOL bLock );
+ SAL_DLLPRIVATE void SetMenuBarOn_Impl( BOOL bOn );
+ SAL_DLLPRIVATE BOOL IsMenuBarOn_Impl() const;
+ SAL_DLLPRIVATE SystemWindow* GetTopWindow_Impl() const;
+ SAL_DLLPRIVATE void PositionWindow_Impl( const Rectangle& rWinArea ) const;
+ SAL_DLLPRIVATE bool IsMarkedHidden_Impl() const;
//#endif
+private:
+ SAL_DLLPRIVATE void Construct_Impl();
};
SV_DECL_COMPAT_WEAK( SfxFrame )
@@ -350,7 +285,24 @@ public:
::com::sun::star::uno::Any GetValue() const
{ return aValue; }
virtual int operator==( const SfxPoolItem& ) const;
- virtual String GetValueText() const;
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
+ virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
+};
+
+class SFX2_DLLPUBLIC SfxUnoFrameItem : public SfxPoolItem
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >
+ m_xFrame;
+
+public:
+ TYPEINFO();
+ SfxUnoFrameItem();
+ SfxUnoFrameItem( sal_uInt16 nWhich, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >&
+ GetFrame() const
+ { return m_xFrame; }
+ virtual int operator==( const SfxPoolItem& ) const;
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
diff --git a/sfx2/inc/sfx2/linkmgr.hxx b/sfx2/inc/sfx2/linkmgr.hxx
index f17ed58a0c..6ff4e267d9 100644
--- a/sfx2/inc/sfx2/linkmgr.hxx
+++ b/sfx2/inc/sfx2/linkmgr.hxx
@@ -131,8 +131,6 @@ public:
// (ist zur Zeit nur fuer die FileLinks interressant!)
void CancelTransfers();
- static void SetTransferPriority( sfx2::SvBaseLink& rLink, USHORT nPrio );
-
// um Status Informationen aus dem FileObject an den BaseLink zu
// senden, gibt es eine eigene ClipBoardId. Das SvData-Object hat
// dann die entsprechenden Informationen als String.
diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx
index c73e373d57..97196ad3c4 100644
--- a/sfx2/inc/sfx2/objsh.hxx
+++ b/sfx2/inc/sfx2/objsh.hxx
@@ -92,7 +92,6 @@ class GDIMetaFile;
class Bitmap;
class INetURLObject;
class IndexBitSet;
-class SfxTopFrame;
class JobSetup;
class Size;
class Point;
@@ -217,17 +216,13 @@ private:
SfxMedium * pMedium; // Beschreibung der Datei bzw. des Storage, in dem sich das Objekt befindet
SfxStyleSheetBasePool* pStyleSheetPool; // StyleSheets
SfxObjectCreateMode eCreateMode; // Zweck des Objekts
- sal_uInt16 nViewNo; // Numerierung der MDIWins
sal_Bool bHasName :1, // sal_True := bestehendes Objekt, sal_False := es ist ein neues Objekt
bIsTmp :1; // temp. Storage
private:
//#if 0 // _SOLAR__PRIVATE
- SAL_DLLPRIVATE void Construct_Impl();
SAL_DLLPRIVATE void UpdateTime_Impl(const ::com::sun::star::uno::Reference<
::com::sun::star::document::XDocumentProperties> & i_xDocProps);
- SAL_DLLPRIVATE sal_Bool MakeBackup_Impl(const String &rName,
- sal_Bool bCopyAllways = sal_False);
SAL_DLLPRIVATE sal_Bool SaveTo_Impl(SfxMedium &rMedium, const SfxItemSet* pSet );
@@ -237,6 +232,7 @@ private:
protected:
SfxObjectShell(SfxObjectCreateMode);
+ SfxObjectShell( const sal_uInt64 i_nCreationFlags ); // see sfxmodelfactory.hxx
virtual ~SfxObjectShell();
virtual void ModifyChanged();
@@ -246,10 +242,6 @@ protected:
*/
void SetHasNoBasic();
-//#if 0 // _SOLAR__PRIVATE
- SAL_DLLPRIVATE void StartLoading_Impl();
-//#endif
-
/// template method, called by FlushDocInfo; this implementation is empty
virtual void DoFlushDocInfo();
@@ -501,11 +493,6 @@ public:
void SetTitle( const String& rTitle );
String GetTitle( sal_uInt16 nMaxLen = 0 ) const;
void InvalidateName(); // Zuruecksetzen auf unbenannt
-//#if 0 // _SOLAR__PRIVATE
- SAL_DLLPRIVATE void SetLastMark_Impl( const String & );
- SAL_DLLPRIVATE const String& GetLastMark_Impl() const;
- SAL_DLLPRIVATE sal_Bool DoInitNew_Impl( const ::rtl::OUString& rName );
-//#endif
// DDE-Interface
virtual long DdeExecute( const String& rCmd );
@@ -609,19 +596,15 @@ public:
virtual SfxFrame* GetSmartSelf( SfxFrame* pSelf, SfxMedium& rMedium );
- void SetModel( SfxBaseModel* pModel );
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >&
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >
GetModel() const;
// Nur uebergangsweise fuer die Applikationen !!!
void SetBaseModel( SfxBaseModel* pModel );
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > GetBaseModel();
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > GetBaseModel() const;
// Nur uebergangsweise fuer die Applikationen !!!
virtual SEQUENCE< OUSTRING > GetEventNames();
-//REMOVE SotStorageStreamRef GetConfigurationStream( const String& rName, BOOL bCreate=FALSE );
-//REMOVE SvStorageRef GetConfigurationStorage( SotStorage* pStor=NULL );
-
Window* GetDialogParent( SfxMedium* pMedium=0 );
String UpdateTitle( SfxMedium* pMed=NULL, USHORT nDocViewNo=0 );
static SfxObjectShell* CreateObject( const String& rServiceName, SfxObjectCreateMode = SFX_CREATE_MODE_STANDARD );
@@ -674,12 +657,10 @@ public:
virtual Printer * GetDocumentPrinter();
virtual OutputDevice* GetDocumentRefDev();
virtual void OnDocumentPrinterChanged( Printer * pNewPrinter );
- //virtual UINT32 GetViewAspect() const;
virtual Rectangle GetVisArea( USHORT nAspect ) const;
virtual void SetVisArea( const Rectangle & rVisArea );
const Rectangle & GetVisArea() const;
void SetVisAreaSize( const Size & rVisSize );
-//REMOVE virtual ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > CreateTransferableSnapshot();
virtual ULONG GetMiscStatus() const;
MapUnit GetMapUnit() const;
@@ -723,9 +704,6 @@ public:
SAL_DLLPRIVATE ::rtl::OUString CreateTempCopyOfStorage_Impl(
const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage );
- SAL_DLLPRIVATE static sal_Bool NoDependencyFromManifest_Impl(
- const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage );
-
SAL_DLLPRIVATE void InitOwnModel_Impl();
SAL_DLLPRIVATE void BreakMacroSign_Impl( sal_Bool bBreakMacroSing );
SAL_DLLPRIVATE void CheckSecurityOnLoading_Impl();
@@ -734,7 +712,6 @@ public:
const ::com::sun::star::uno::Sequence< ::com::sun::star::security::DocumentSignatureInformation >& aInfos );
SAL_DLLPRIVATE void CheckEncryption_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& xHandler );
- SAL_DLLPRIVATE SEQUENCE< OUSTRING > GetEventNames_Impl();
SAL_DLLPRIVATE void InitBasicManager_Impl();
SAL_DLLPRIVATE SfxObjectShell_Impl* Get_Impl() { return pImp; }
@@ -768,12 +745,10 @@ public:
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aMediaDescr );
SAL_DLLPRIVATE void PositionView_Impl();
SAL_DLLPRIVATE void UpdateFromTemplate_Impl();
- SAL_DLLPRIVATE void Reload_Impl();
SAL_DLLPRIVATE sal_Bool CanReload_Impl();
SAL_DLLPRIVATE void SetNamedVisibility_Impl();
SAL_DLLPRIVATE sal_Bool DoSave_Impl( const SfxItemSet* pSet=0 );
SAL_DLLPRIVATE sal_Bool Save_Impl( const SfxItemSet* pSet=0 );
- SAL_DLLPRIVATE void UpdatePickList_Impl();
SAL_DLLPRIVATE sal_Bool PreDoSaveAs_Impl(const String &rFileName, const String &rFiltName, SfxItemSet *);
SAL_DLLPRIVATE sal_Bool APISaveAs_Impl ( const String& aFileName, SfxItemSet* aParams );
SAL_DLLPRIVATE sal_Bool CommonSaveAs_Impl ( const INetURLObject& aURL, const String& aFilterName, SfxItemSet* aParams );
@@ -781,15 +756,13 @@ public:
const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
sal_Bool bTypeMustBeSetAlready );
SAL_DLLPRIVATE void PrepareSecondTryLoad_Impl();
+ SAL_DLLPRIVATE void SetInitialized_Impl( const bool i_fromInitNew );
// public-internals
SAL_DLLPRIVATE IndexBitSet& GetNoSet_Impl();
SAL_DLLPRIVATE void SetProgress_Impl( SfxProgress *pProgress );
- SAL_DLLPRIVATE sal_uInt16& GetAktViewNo() { return nViewNo; }
SAL_DLLPRIVATE void PostActivateEvent_Impl( SfxViewFrame* );
SAL_DLLPRIVATE void SetActivateEvent_Impl(sal_uInt16 );
-//REMOVE FASTBOOL SaveWindows_Impl( SvStorage &rStor ) const;
- SAL_DLLPRIVATE SfxViewFrame* LoadWindows_Impl( SfxTopFrame *pPrefered = 0 );
SAL_DLLPRIVATE SfxObjectShell* GetParentShellByModel_Impl();
// configuration items
diff --git a/sfx2/inc/sfx2/sfx.hrc b/sfx2/inc/sfx2/sfx.hrc
index 573b6944e1..b0d91faf9e 100644
--- a/sfx2/inc/sfx2/sfx.hrc
+++ b/sfx2/inc/sfx2/sfx.hrc
@@ -216,6 +216,7 @@
#define ABOUT_STR_DEVELOPER_ARY 1
#define ABOUT_STR_FRENCH_COPYRIGHT 2
#define ABOUT_STR_ACCEL 3
+#define ABOUT_STR_COPYRIGHT 4
#define RID_APPTITLE (RID_SFX_START+4)
#define RID_BUILDVERSION (RID_SFX_START+5)
diff --git a/sfx2/inc/sfx2/sfxbasecontroller.hxx b/sfx2/inc/sfx2/sfxbasecontroller.hxx
index 1583ae0d25..566e45a599 100644
--- a/sfx2/inc/sfx2/sfxbasecontroller.hxx
+++ b/sfx2/inc/sfx2/sfxbasecontroller.hxx
@@ -35,7 +35,7 @@
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/frame/DispatchDescriptor.hpp>
#include <com/sun/star/frame/XDispatchInformationProvider.hpp>
-#include <com/sun/star/frame/XController.hpp>
+#include <com/sun/star/frame/XController2.hpp>
#include <com/sun/star/frame/XControllerBorder.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/frame/XFrame.hpp>
@@ -43,7 +43,8 @@
#include <com/sun/star/frame/XTitleChangeBroadcaster.hpp>
#include <com/sun/star/util/URL.hpp>
#include <com/sun/star/lang/XTypeProvider.hpp>
-#include <cppuhelper/weak.hxx>
+#include <cppuhelper/implbase9.hxx>
+#include <cppuhelper/basemutex.hxx>
#include <osl/mutex.hxx>
#include <com/sun/star/task/XStatusIndicatorSupplier.hpp>
#include <com/sun/star/ui/XContextMenuInterception.hpp>
@@ -67,27 +68,16 @@
#define ANY ::com::sun::star::uno::Any
#define SEQUENCE ::com::sun::star::uno::Sequence
#define XDISPATCH ::com::sun::star::frame::XDispatch
-#define XDISPATCHPROVIDER ::com::sun::star::frame::XDispatchProvider
#define DISPATCHDESCRIPTOR ::com::sun::star::frame::DispatchDescriptor
#define XMODEL ::com::sun::star::frame::XModel
#define XFRAME ::com::sun::star::frame::XFrame
-#define XCONTROLLER ::com::sun::star::frame::XController
-#define XCONTROLLERBORDER ::com::sun::star::frame::XControllerBorder
#define XEVENTLISTENER ::com::sun::star::lang::XEventListener
#define MUTEX ::osl::Mutex
#define RUNTIMEEXCEPTION ::com::sun::star::uno::RuntimeException
#define UNOTYPE ::com::sun::star::uno::Type
-#define OWEAKOBJECT ::cppu::OWeakObject
-#define XTYPEPROVIDER ::com::sun::star::lang::XTypeProvider
#define UNOURL ::com::sun::star::util::URL
#define OUSTRING ::rtl::OUString
-#define XSTATUSINDICATORSUPPLIER ::com::sun::star::task::XStatusIndicatorSupplier
-#define XCONTEXTMENUINTERCEPTION ::com::sun::star::ui::XContextMenuInterception
#define XCONTEXTMENUINTERCEPTOR ::com::sun::star::ui::XContextMenuInterceptor
-#define XUSERINPUTINTERCEPTION ::com::sun::star::awt::XUserInputInterception
-#define XDISPATCHINFORMATIONPROVIDER ::com::sun::star::frame::XDispatchInformationProvider
-#define XTITLE ::com::sun::star::frame::XTitle
-#define XTITLECHANGEBROADCASTER ::com::sun::star::frame::XTitleChangeBroadcaster
//________________________________________________________________________________________________________
// forwards
@@ -95,6 +85,8 @@
struct IMPL_SfxBaseController_DataContainer ; // impl. struct to hold member of class SfxBaseController
+class SfxViewFrame;
+
sal_Int16 MapGroupIDToCommandGroup( sal_Int16 nGroupID );
sal_Bool SupportsCommandGroup( sal_Int16 nCommandGroup );
sal_Int16 MapCommandGroupToGroupID( sal_Int16 nCommandGroup );
@@ -103,36 +95,19 @@ sal_Int16 MapCommandGroupToGroupID( sal_Int16 nCommandGroup );
// class declarations
//________________________________________________________________________________________________________
-struct IMPL_SfxBaseController_MutexContainer
-{
- MUTEX m_aMutex ;
-} ;
-
-/**_______________________________________________________________________________________________________
- @short -
-
- @descr -
-
- @implements -
-
- @base -
-*/
-
-// Forward to impl-baseclass!
-//class IMPL_SfxBaseController ;
-
-class SFX2_DLLPUBLIC SfxBaseController : public XTYPEPROVIDER
- , public XCONTROLLER
- , public XCONTROLLERBORDER
- , public XDISPATCHPROVIDER
- , public XSTATUSINDICATORSUPPLIER
- , public XCONTEXTMENUINTERCEPTION
- , public XUSERINPUTINTERCEPTION
- , public XDISPATCHINFORMATIONPROVIDER
- , public XTITLE
- , public XTITLECHANGEBROADCASTER
- , public IMPL_SfxBaseController_MutexContainer
- , public OWEAKOBJECT
+typedef ::cppu::WeakImplHelper9 < ::com::sun::star::frame::XController2
+ , ::com::sun::star::frame::XControllerBorder
+ , ::com::sun::star::frame::XDispatchProvider
+ , ::com::sun::star::task::XStatusIndicatorSupplier
+ , ::com::sun::star::ui::XContextMenuInterception
+ , ::com::sun::star::awt::XUserInputInterception
+ , ::com::sun::star::frame::XDispatchInformationProvider
+ , ::com::sun::star::frame::XTitle
+ , ::com::sun::star::frame::XTitleChangeBroadcaster
+ > SfxBaseController_Base;
+
+class SFX2_DLLPUBLIC SfxBaseController :public SfxBaseController_Base
+ ,public ::cppu::BaseMutex
{
//________________________________________________________________________________________________________
// public methods
@@ -177,93 +152,14 @@ public:
SAL_DLLPRIVATE void ReleaseShell_Impl();
SAL_DLLPRIVATE void BorderWidthsChanged_Impl();
- //____________________________________________________________________________________________________
- // XInterface
- //____________________________________________________________________________________________________
-
- /**___________________________________________________________________________________________________
- @short give answer, if interface is supported
- @descr The interfaces are searched by type.
-
- @seealso XInterface
-
- @param "rType" is the type of searched interface.
-
- @return Any information about found interface
-
- @onerror A RuntimeException is thrown.
- */
-
- virtual ANY SAL_CALL queryInterface( const UNOTYPE& rType ) throw( RUNTIMEEXCEPTION ) ;
-
- /**___________________________________________________________________________________________________
- @short increment refcount
- @descr -
-
- @seealso XInterface
- @seealso release()
-
- @param -
-
- @return -
-
- @onerror A RuntimeException is thrown.
- */
-
- virtual void SAL_CALL acquire() throw() ;
-
- /**___________________________________________________________________________________________________
- @short decrement refcount
- @descr -
-
- @seealso XInterface
- @seealso acquire()
-
- @param -
-
- @return -
-
- @onerror A RuntimeException is thrown.
- */
-
- virtual void SAL_CALL release() throw() ;
+ ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator > SAL_CALL getStatusIndicator( ) throw (::com::sun::star::uno::RuntimeException);
//____________________________________________________________________________________________________
- // XTypeProvider
+ // XController2
//____________________________________________________________________________________________________
-
- /**___________________________________________________________________________________________________
- @short get information about supported interfaces
- @descr -
-
- @seealso XTypeProvider
-
- @param -
-
- @return Sequence of types of all supported interfaces
-
- @onerror A RuntimeException is thrown.
- */
-
- virtual SEQUENCE< UNOTYPE > SAL_CALL getTypes() throw( RUNTIMEEXCEPTION ) ;
-
- /**___________________________________________________________________________________________________
- @short get implementation id
- @descr This ID is neccessary for UNO-caching. If there no ID, cache is disabled.
- Another way, cache is enabled.
-
- @seealso XTypeProvider
-
- @param -
-
- @return ID as Sequence of byte
-
- @onerror A RuntimeException is thrown.
- */
-
- virtual SEQUENCE< sal_Int8 > SAL_CALL getImplementationId() throw( RUNTIMEEXCEPTION ) ;
-
- ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator > SAL_CALL getStatusIndicator( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL getComponentWindow() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getViewControllerName() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getCreationArguments() throw (::com::sun::star::uno::RuntimeException);
//____________________________________________________________________________________________________
// XController
@@ -496,23 +392,23 @@ public:
SAL_DLLPRIVATE BOOL HandleEvent_Impl( NotifyEvent& rEvent );
SAL_DLLPRIVATE BOOL HasKeyListeners_Impl();
SAL_DLLPRIVATE BOOL HasMouseClickListeners_Impl();
+ SAL_DLLPRIVATE void SetCreationArguments_Impl( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& i_rCreationArgs );
SAL_DLLPRIVATE ::com::sun::star::uno::Reference< ::com::sun::star::frame::XTitle > impl_getTitleHelper ();
//#endif
+private:
+ enum ConnectSfxFrame
+ {
+ E_CONNECT,
+ E_DISCONNECT,
+ E_RECONNECT
+ };
+ SAL_DLLPRIVATE void ConnectSfxFrame_Impl( const ConnectSfxFrame i_eConnect );
+ SAL_DLLPRIVATE SfxViewFrame& GetViewFrame_Impl() const;
//________________________________________________________________________________________________________
// private variables
//________________________________________________________________________________________________________
- /** With this method you can set the flag that controlls whether the
- frame is released together with a controller when the later one is
- disposed.
- @param bFlag
- When passing <true/>, the default value of this flag, then
- disposing the controller results in releasing the frame.
- Passing <false/> leaves the frame unaffected.
- */
- void FrameIsReleasedWithController (sal_Bool bFlag);
-
private:
IMPL_SfxBaseController_DataContainer* m_pData ;
diff --git a/sfx2/inc/sfx2/sfxbasemodel.hxx b/sfx2/inc/sfx2/sfxbasemodel.hxx
index 605929710e..52fe2c14bf 100644
--- a/sfx2/inc/sfx2/sfxbasemodel.hxx
+++ b/sfx2/inc/sfx2/sfxbasemodel.hxx
@@ -43,6 +43,7 @@
#include <com/sun/star/document/XDocumentInfo.hpp>
#include <com/sun/star/document/XDocumentInfoSupplier.hpp>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
+#include <com/sun/star/document/XDocumentRecovery.hpp>
#include <com/sun/star/rdf/XDocumentMetadataAccess.hpp>
@@ -55,6 +56,8 @@
#include <com/sun/star/document/XStorageBasedDocument.hpp>
#include <com/sun/star/document/XScriptInvocationContext.hpp>
#include <com/sun/star/lang/XEventListener.hpp>
+#include <com/sun/star/lang/NotInitializedException.hpp>
+#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/frame/XModel2.hpp>
#include <com/sun/star/frame/DoubleInitializationException.hpp>
#include <com/sun/star/util/XModifiable2.hpp>
@@ -82,6 +85,8 @@
#include <cppuhelper/typeprovider.hxx>
#include <com/sun/star/script/XStarBasicAccess.hpp>
#include <osl/mutex.hxx>
+#include <vos/mutex.hxx>
+#include <vcl/svapp.hxx>
#include <tools/link.hxx>
@@ -91,9 +96,9 @@
#include <com/sun/star/task/XInteractionHandler.hpp>
//________________________________________________________________________________________________________
-#if ! defined(INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_29)
-#define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_29
-#define COMPHELPER_IMPLBASE_INTERFACE_NUMBER 29
+#if ! defined(INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_30)
+#define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_30
+#define COMPHELPER_IMPLBASE_INTERFACE_NUMBER 30
#include <comphelper/implbase_var.hxx>
#endif
@@ -196,8 +201,12 @@ class SfxPrinter;
class SfxViewShell;
class SfxObjectShell ;
class SfxEventHint;
+class SfxViewFrame;
struct IMPL_SfxBaseModel_DataContainer ; // impl. struct to hold member of class SfxBaseModel
+namespace sfx { namespace intern {
+ class ViewCreationGuard;
+} }
//________________________________________________________________________________________________________
// class declarations
//________________________________________________________________________________________________________
@@ -228,10 +237,11 @@ struct IMPL_SfxBaseModel_DataContainer ; // impl. struct to hold member of clas
SfxListener
*/
-typedef ::comphelper::WeakImplHelper29 < XCHILD
+typedef ::comphelper::WeakImplHelper30 < XCHILD
, XDOCUMENTINFOSUPPLIER
, ::com::sun::star::document::XDocumentPropertiesSupplier
, ::com::sun::star::rdf::XDocumentMetadataAccess
+ , ::com::sun::star::document::XDocumentRecovery
, XEVENTBROADCASTER
, XEVENTLISTENER
, XEVENTSSUPPLIER
@@ -1284,6 +1294,18 @@ public:
virtual ::rtl::OUString SAL_CALL getUntitledPrefix()
throw (css::uno::RuntimeException);
+ // css.document.XDocumentRecovery
+ virtual ::sal_Bool SAL_CALL wasModifiedSinceLastSave()
+ throw ( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL storeToRecoveryFile( const ::rtl::OUString& i_TargetLocation, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& i_MediaDescriptor )
+ throw ( ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::io::IOException,
+ ::com::sun::star::lang::WrappedTargetException );
+ virtual void SAL_CALL recoverFromFile( const ::rtl::OUString& i_SourceLocation, const ::rtl::OUString& i_SalvagedFile, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& i_MediaDescriptor )
+ throw ( ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::io::IOException,
+ ::com::sun::star::lang::WrappedTargetException );
+
//____________________________________________________________________________________________________
// ::com::sun::star::rdf::XNode:
@@ -1463,6 +1485,7 @@ public:
SAL_DLLPRIVATE sal_Bool impl_isDisposed() const ;
sal_Bool IsDisposed() const ;
+ sal_Bool IsInitialized() const;
::com::sun::star::uno::Reference < ::com::sun::star::container::XIndexAccess > SAL_CALL getViewData() throw (::com::sun::star::uno::RuntimeException);
void SAL_CALL setViewData( const ::com::sun::star::uno::Reference < ::com::sun::star::container::XIndexAccess >& aData ) throw (::com::sun::star::uno::RuntimeException);
@@ -1473,7 +1496,6 @@ public:
/** returns true if someone added a XEventListener to this XEventBroadcaster */
sal_Bool hasEventListeners() const;
-
protected:
/* returns a unique id for the model that is valid as long as the document
@@ -1517,6 +1539,13 @@ private:
SAL_DLLPRIVATE css::uno::Reference< css::frame::XTitle > impl_getTitleHelper ();
SAL_DLLPRIVATE css::uno::Reference< css::frame::XUntitledNumbers > impl_getUntitledHelper ();
+ SAL_DLLPRIVATE SfxViewFrame* FindOrCreateViewFrame_Impl(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame,
+ ::sfx::intern::ViewCreationGuard& i_rGuard
+ ) const;
+
+ SAL_DLLPRIVATE void NotifyModifyListeners_Impl() const;
+
//________________________________________________________________________________________________________
// private variables and methods
//________________________________________________________________________________________________________
@@ -1526,9 +1555,42 @@ private:
IMPL_SfxBaseModel_DataContainer* m_pData ;
// cannot be held in m_pData, since it needs to be accessed in non-threadsafe context
const bool m_bSupportEmbeddedScripts;
+ const bool m_bSupportDocRecovery;
} ; // class SfxBaseModel
+class SFX2_DLLPUBLIC SfxModelGuard
+{
+public:
+ enum AllowedModelState
+ {
+ // not yet initialized
+ E_INITIALIZING,
+ // fully alive, i.e. initialized, and not yet disposed
+ E_FULLY_ALIVE
+ };
+
+ SfxModelGuard( SfxBaseModel& i_rModel, const AllowedModelState i_eState = E_FULLY_ALIVE )
+ :m_aGuard( Application::GetSolarMutex() )
+ {
+ if ( i_rModel.IsDisposed() )
+ throw ::com::sun::star::lang::DisposedException( ::rtl::OUString(), *&i_rModel );
+ if ( ( i_eState != E_INITIALIZING ) && !i_rModel.IsInitialized() )
+ throw ::com::sun::star::lang::NotInitializedException( ::rtl::OUString(), *&i_rModel );
+ }
+ ~SfxModelGuard()
+ {
+ }
+
+ void clear()
+ {
+ m_aGuard.clear();
+ }
+
+private:
+ ::vos::OClearableGuard m_aGuard;
+};
+
#undef css
#endif // _SFX_SFXBASEMODEL_HXX_
diff --git a/sfx2/inc/sfx2/sfxmodelfactory.hxx b/sfx2/inc/sfx2/sfxmodelfactory.hxx
index 9136251614..ac22ef41df 100644
--- a/sfx2/inc/sfx2/sfxmodelfactory.hxx
+++ b/sfx2/inc/sfx2/sfxmodelfactory.hxx
@@ -40,8 +40,10 @@ namespace sfx2
{
//........................................................................
+ #define SFXMODEL_STANDARD (sal_uInt64)(0x0000)
#define SFXMODEL_EMBEDDED_OBJECT (sal_uInt64)(0x0001)
#define SFXMODEL_DISABLE_EMBEDDED_SCRIPTS (sal_uInt64)(0x0002)
+ #define SFXMODEL_DISABLE_DOCUMENT_RECOVERY (sal_uInt64)(0x0004)
typedef ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > ( SAL_CALL * SfxModelFactoryFunc ) (
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory,
diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc
index 16e0205de1..3d6f742a81 100644
--- a/sfx2/inc/sfx2/sfxsids.hrc
+++ b/sfx2/inc/sfx2/sfxsids.hrc
@@ -53,7 +53,6 @@
#define SID_NONE 0
#define SID_UNKNOWN SID_SFX_START
-#define SID_SUBREQUEST (SID_SFX_START+90)
//-------------------------------------------------------------------------
@@ -83,79 +82,28 @@
#define SID_PRINTER_CHANGESTODOC (SID_SFX_START + 324)
#define SID_PRINTPREVIEW (SID_SFX_START + 325)
-#define SID_MAIL_DATE (SID_SFX_START + 326)
-#define SID_MAIL_FROM (SID_SFX_START + 327)
#define SID_MAIL_SUBJECT (SID_SFX_START + 328)
-#define SID_MAIL_OPEN (SID_SFX_START + 329)
#define SID_MAIL_NOTIFY (SID_SFX_START + 330)
#define SID_MAIL_SENDDOC (SID_SFX_START + 331)
#define SID_MAIL_SENDDOCASPDF (SID_SFX_START + 1672)
-
#define SID_MAIL_RECIPIENT (SID_SFX_START + 334)
#define SID_MAIL_TEXT (SID_SFX_START + 335)
#define SID_MAIL_ATTACH (SID_SFX_START + 336)
#define SID_MAIL_PRIORITY (SID_SFX_START + 337)
-#define SID_MAIL_DELETE (SID_SFX_START + 338)
-#define SID_MAIL_NEW (SID_SFX_START + 339)
-
-#define SID_MAIL_NEWWITHSERVER (SID_SFX_START + 360)
-#define SID_MAIL_REPLY (SID_SFX_START + 361)
-#define SID_MAIL_FOLLOWUP (SID_SFX_START + 362)
-#define SID_MAIL_FORWARD (SID_SFX_START + 363)
-#define SID_MAIL_SEND (SID_SFX_START + 364)
-#define SID_MAIL_FILE (SID_SFX_START + 365)
-#define SID_MAIL_MARKASREAD (SID_SFX_START + 366)
-#define SID_MAIL_MARKASUNREAD (SID_SFX_START + 367)
-#define SID_MAIL_NEXT (SID_SFX_START + 368)
-#define SID_MAIL_PREV (SID_SFX_START + 369)
-#define SID_MAIL_NEXTDELETE (SID_SFX_START + 370)
-#define SID_MAIL_PREVDELETE (SID_SFX_START + 371)
-#define SID_MAIL_OPEN_NEWS (SID_SFX_START + 372)
-#define SID_MAIL_THREAD_MARKASREAD (SID_SFX_START + 373)
-#define SID_MAIL_THREAD_MARKASUNREAD (SID_SFX_START + 374)
+
#define SID_MAIL_ATTACH_FILE (SID_SFX_START + 375)
-#define SID_MAIL_DETACH_FILE (SID_SFX_START + 376)
-#define SID_MAIL_MARK (SID_SFX_START + 377)
-#define SID_MAIL_TXTFORMAT (SID_SFX_START + 378)
-#define SID_MAIL_UPDATETOOLBOX (SID_SFX_START + 379)
-
-#define SID_OPEN_ANCHOR (SID_SFX_START + 380)
-#define SID_MAIL_ADDRESSBOOK (SID_SFX_START + 1644)
-#define SID_MAIL_ALLNEWSGROUPS (SID_SFX_START + 382)
-#define SID_MAIL_GROUPREPLY (SID_SFX_START + 383)
-#define SID_MAIL_SIGNATURE (SID_SFX_START + 384)
-#define SID_MAIL_PREPAREEXPORT (SID_SFX_START + 385)
-#define SID_MAIL_NEXTUNREAD (SID_SFX_START + 386)
-#define SID_MAIL_PREVUNREAD (SID_SFX_START + 387)
+
#define SID_MAIL_EXPORT_FINISHED (SID_SFX_START + 388)
-#define SID_NEWSSERVER_NAME (SID_SFX_START + 389)
-#define SID_NEWS_GROUP_CHANGED (SID_SFX_START + 390)
-#define SID_MAILBROWSER_CTRL (SID_SFX_START + 391)
-#define SID_NEWSGROUP_NAME (SID_SFX_START + 392)
#define SID_WEBHTML (SID_SFX_START + 393)
#define SID_MAIL_SCROLLBODY_PAGEDOWN (SID_SFX_START + 1588)
-#define SID_MAIL_REPLY_FOLLOWUP (SID_SFX_START + 1635)
-#define SID_PHONE_STATUSBAR_CONTROL (SID_SFX_START + 398)
-#define SID_RECOGNIZER_STATUSBAR_CONTROL (SID_SFX_START + 399)
#define SID_PROGRESS_STATUSBAR_CONTROL (SID_SFX_START + 1597)
-#define SID_RESOURCE_WARNING (SID_SFX_START + 333)
-
#define SID_APPLICATION (SID_SFX_START + 340)
#define SID_PROGNAME (SID_SFX_START + 341)
#define SID_PROGFILENAME (SID_SFX_START + 342)
-#define SID_PROGPATH (SID_SFX_START + 343)
-#define SID_INTERACTIVEMODE (SID_SFX_START + 344)
-#define SID_PARENTOBJECT (SID_SFX_START + 345)
#define SID_SELECTION (SID_SFX_START + 346)
-#define SID_CREATOR (SID_SFX_START + 347)
-
-#define SID_COLL_COUNT (SID_SFX_START + 350)
-#define SID_COLL_ITEM (SID_SFX_START + 351)
-#define SID_COLL_REMOVE (SID_SFX_START + 352)
-#define SID_COLL_ADD (SID_SFX_START + 353)
// 360-400 siehe SID_MAIL_...
@@ -207,26 +155,14 @@
#define SID_RELOAD (SID_SFX_START + 508)
#define SID_PRINTDOCDIRECT (SID_SFX_START + 509)
#define SID_PICKLIST (SID_SFX_START + 510)
-#define SID_EDIT_FRAMESET (SID_SFX_START + 646)
-#define SID_SPLIT_HORIZONTAL (SID_SFX_START + 647)
-#define SID_SPLIT_VERTICAL (SID_SFX_START + 648)
-#define SID_SPLIT_PARENT_HORIZONTAL (SID_SFX_START + 649)
-#define SID_SPLIT_PARENT_VERTICAL (SID_SFX_START + 650)
-#define SID_MODIFY_FRAME (SID_SFX_START + 651)
-#define SID_DELETE_FRAME (SID_SFX_START + 652)
-#define SID_FRAME_NAME (SID_SFX_START + 825)
-#define SID_FRAME_CONTENT (SID_SFX_START + 826)
#define SID_PLUGIN_MODE (SID_SFX_START + 827)
-#define SID_LOCKBYTES_FACTORY (SID_SFX_START + 828)
#define SID_EXPORTDOC (SID_SFX_START + 829)
#define SID_EXPORTDOCASPDF (SID_SFX_START + 1673)
#define SID_DIRECTEXPORTDOCASPDF (SID_SFX_START + 1674)
#define SID_UPDATEDOCMODE (SID_SFX_START + 1668)
-#define SID_NOCACHE (SID_SFX_START + 653)
#define SID_FORCERELOAD (SID_SFX_START + 1502)
#define SID_FILE_DIALOG (SID_SFX_START + 304)
-#define SID_GRAFIC_DIALOG (SID_SFX_START + 305)
#define SID_PATH (SID_SFX_START + 308)
#define SID_SAVEDOCS (SID_SFX_START + 309)
#define SID_STANDARD_DIR (SID_SFX_START + 450)
@@ -235,88 +171,20 @@
// browse-ids
#define SID_BROWSE_FORWARD (SID_SFX_START + 1300)
#define SID_BROWSE_BACKWARD (SID_SFX_START + 1301)
-#define SID_BROWSE_STOP (SID_SFX_START + 1302)
#define SID_BROWSE_HOME (SID_SFX_START + 1303)
-#define SID_AUTOBROWSE (SID_SFX_START + 1304)
-#define SID_AUTOMAIL (SID_SFX_START + 1305)
-#define SID_BROWSING (SID_SFX_START + 1306)
-#define SID_ADDR_BOOK (SID_SFX_START + 1307)
-#define SID_EXPLORER (SID_SFX_START + 1308)
#define SID_CREATELINK (SID_SFX_START + 1309)
#define SID_BOOKMARK_TITLE (SID_SFX_START + 1310)
#define SID_BOOKMARK_URL (SID_SFX_START + 1311)
#define SID_EDITDOC (SID_SFX_START + 1312)
#define SID_BROWSER_MODE (SID_SFX_START + 1313)
#define SID_PLUGINS_ACTIVE (SID_SFX_START + 1314)
-#define SID_SAVEDOCTOBOOKMARK (SID_SFX_START + 1315)
-#define SID_CLEARMEMCACHE (SID_SFX_START + 1316)
#define SID_BROWSER (SID_SFX_START + 1318)
#define SID_MACROEXECMODE (SID_SFX_START + 1319)
-#define SID_EXPLORERCONTENT_OPEN (SID_SFX_START + 1322)
-#define SID_EXPLORERCONTENT_OPEN_DOCUMENT (SID_SFX_START + 1321)
-#define SID_EXPLORERCONTENT_OPEN_TEMPLATE (SID_SFX_START + 1362)
-#define SID_EXPLORERCONTENT_OPEN_FOLDER (SID_SFX_START + 1542)
-#define SID_EXPLORERCONTENT_OPEN_OBJECT (SID_SFX_START + 1543)
-#define SID_EXPLORERCONTENT_NEW (SID_SFX_START + 1323)
-#define SID_EXPLORERCONTENT_DESTROY (SID_SFX_START + 1324)
-#define SID_EXPLORERCONTENT_MAKEROOT (SID_SFX_START + 1325)
-#define SID_EXPLORERCONTENT_RENAME (SID_SFX_START + 1326)
-#define SID_EXPLORERCONTENT_COPY (SID_SFX_START + 1327)
-#define SID_EXPLORERCONTENT_PASTE (SID_SFX_START + 1328)
-#define SID_EXPLORERCONTENT_CREATELINK (SID_SFX_START + 1329)
-#define SID_EXPLORERCONTENT_DEFAULTTEMPLATE (SID_SFX_START + 1330)
-#define SID_EXPLORER_CREATEFOLDER (SID_SFX_START + 1331)
-#define SID_EXPLORER_CREATEBOOKMARK (SID_SFX_START + 1332)
-#define SID_EXPLORER_CREATEWORKPLACE (SID_SFX_START + 1333)
-#define SID_EXPLORER_CREATELINK (SID_SFX_START + 1334)
-#define SID_EXPLORER_CREATEMAILINTRAY (SID_SFX_START + 1335)
-#define SID_EXPLORER_CREATENEWSSERVER (SID_SFX_START + 1336)
-#define SID_EXPLORER_CREATEFTPSERVER (SID_SFX_START + 1337)
-#define SID_EXPLORER_CREATEDATABASE (SID_SFX_START + 1338)
-#define SID_EXPLORER_CREATEGALLERY (SID_SFX_START + 1339)
-#define SID_PROPERTIES (SID_SFX_START + 1350)
-#define SID_EXPLORER_MAKEROOT (SID_SFX_START + 1351)
-#define SID_EXPLORER_MAKEBMKDIR (SID_SFX_START + 1352)
-#define SID_EXPLORER_PREVLEVEL (SID_SFX_START + 1353)
-#define SID_EXPLORER_IMPORTBOOKMARKS (SID_SFX_START + 1354)
-#define SID_EXPLORER_SEARCHORIGINAL (SID_SFX_START + 1355)
-#define SID_EXPLORER_DETAILS (SID_SFX_START + 1356)
-#define SID_EXPLORER_ICONS (SID_SFX_START + 1357)
-#define SID_VIEWTYPE_DETAILS (SID_SFX_START + 1358)
-#define SID_EXPLORER_MSGROUP_FSYS (SID_SFX_START + 1359)
-#define SID_EXPLORER_MSGROUP_NEWSARTICLE (SID_SFX_START + 1360)
-#define SID_EXPLORER_MSGROUP_NEWSGROUP (SID_SFX_START + 1361)
-#define SID_EXPLORER_RESETURL (SID_SFX_START + 1520)
-
-#define SID_EXPLORER_DOCINFO (SID_SFX_START + 1363)
-#define SID_EXPLORER_PREVIEW (SID_SFX_START + 1364)
-#define SID_EXPLORER_MSGROUP_FTPFILE (SID_SFX_START + 1365)
-#define SID_SEARCHORIGINAL (SID_SFX_START + 1366)
-#define SID_EXPLORER_MSGROUP_MAILS (SID_SFX_START + 1367)
-#define SID_EXPLORER_MSGROUP_CHAOS (SID_SFX_START + 1368)
// die Id steht mit diesem Wert in chaos/cntids.hrc!!
//#define SID_INTERNET_ONLINE (SID_SFX_START + 1370)
-#define SID_INTERNET_UPDATE (SID_SFX_START + 1371)
-#define SID_INTERNET_1 (SID_SFX_START + 1372)
-#define SID_INTERNET_2 (SID_SFX_START + 1373)
-#define SID_INTERNET_3 (SID_SFX_START + 1374)
-
#define SID_FILTER_DATA (SID_SFX_START + 1375)
-#define SID_EXPLORER_SEARCH_DLG (SID_SFX_START + 1380)
-#define SID_EXPLORER_MULTIQUICKSEARCH (SID_SFX_START + 1522)
-#define SID_EXPLORER_SHOWEXTENSION (SID_SFX_START + 1594)
-#define SID_EXPLORER_MAIL_HEADER (SID_SFX_START + 1595)
-#define SID_EXPLORER_MAIL_BODY (SID_SFX_START + 1596)
-
-#define SID_TABPAGE (SID_SFX_START + 1383)
-//#define SID_EXPLORER_CREATESEARCHFOLDER (SID_SFX_START + 1384)
-#define SID_EMPTY_TRASH (SID_SFX_START + 1385)
-#define SID_AFTEROPENEVENT (SID_SFX_START + 1386)
-#define SID_QUERYICON (SID_SFX_START + 1387)
-#define SID_SYNCEXPLORER (SID_SFX_START + 1388)
-#define SID_EXPLORER_PASTE_ASLINK (SID_SFX_START + 1389)
#define SID_EXPLORER_FILEPROPS_START (SID_SFX_START + 1390)
#define SID_EXPLORER_FILEPROPS_END (SID_SFX_START + 1399)
@@ -324,73 +192,22 @@
#define ID_FILETP_START SID_EXPLORER_FILEPROPS_START
#define ID_FILETP_READONLY (ID_FILETP_START + 0)
#define ID_FILETP_TITLE (ID_FILETP_START + 1)
-#define ID_FILETP_SIZE (ID_FILETP_START + 2)
-#define ID_FILETP_TYPE (ID_FILETP_START + 3)
-#define ID_FILETP_PATH (ID_FILETP_START + 4)
-#define ID_FILETP_CREATED (ID_FILETP_START + 5)
-#define ID_FILETP_CHANGED (ID_FILETP_START + 6)
-#define ID_FILETP_EDIT (ID_FILETP_START + 7)
-#define ID_FILETP_IMAGE (ID_FILETP_START + 8)
-#define ID_FILETP_LINK (ID_FILETP_START + 9)
-#define ID_FILETP_END (ID_FILETP_START + 9)
-
-#define SID_NEWFRAMESET (SID_SFX_START + 1400)
#define SID_EXPLORER_PROPS_START (SID_SFX_START + 1410)
#define SID_EXPLORER_PROPS_END (SID_SFX_START + 1499)
-
-
-#define SID_TRASH_RECOVER (SID_SFX_START + 1502)
-#define SID_TRASH_AUTOEMPTY (SID_SFX_START + 1503)
-#define SID_TRASH_EMPTY (SID_SFX_START + 1504)
-#define SID_EXPLORER_BOOKMARKDIR (SID_SFX_START + 1505)
-#define SID_EXPLORER_SEARCHORIG (SID_SFX_START + 1506)
-#define SID_FRAMESPACING (SID_SFX_START + 1507)
-#define SID_LATEINIT_DONE (SID_SFX_START + 1508)
#define SID_AUTOLOAD (SID_SFX_START + 1509)
-#define SID_FRAMECOUNT (SID_SFX_START + 1510)
-#define SID_ISTOP (SID_SFX_START + 1511)
-#define SID_VIEW (SID_SFX_START + 1512)
-#define SID_ORIG_PROPERTIES (SID_SFX_START + 1513)
-#define SID_MAIL_NOTIFY_RESET (SID_SFX_START + 1514)
#define SID_FILLFRAME (SID_SFX_START + 1516)
-#define SID_LOAD_LIBRARY (SID_SFX_START + 1517)
#define SID_BASEURL (SID_SFX_START + 1518)
#define SID_TEMPLATE (SID_SFX_START + 1519)
-#define SID_UNLOAD_LIBRARY (SID_SFX_START + 1523)
-#define SID_ADD_LIBRARY (SID_SFX_START + 1524)
-#define SID_REMOVE_LIBRARY (SID_SFX_START + 1525)
-#define SID_CLASSNAME (SID_SFX_START + 1526)
-#define SID_INTERCEPTOR (SID_SFX_START + 1527)
-#define SID_TARGETPATH (SID_SFX_START + 1528)
-
-#define SID_START (SID_SFX_START + 1529)
-#define SID_STOP (SID_SFX_START + 1530)
-#define SID_VALUE (SID_SFX_START + 1531)
-#define SID_SUSPEND (SID_SFX_START + 1532)
-#define SID_RESUME (SID_SFX_START + 1533)
-#define SID_LOCKALL (SID_SFX_START + 1534)
-#define SID_WAITPOINTER (SID_SFX_START + 1535)
-
#define SID_ONLINE_REGISTRATION (SID_SFX_START + 1537)
#define SID_ONLINE_REGISTRATION_DLG (SID_SFX_START + 1540)
#define SID_CONTENTTYPE (SID_SFX_START + 1541)
-#define SID_DOC_IGNOREINFORMATIONLOST (SID_SFX_START + 1544)
-#define SID_EXPLORER_SELECTIONSIZE (SID_SFX_START + 1545)
#define SID_SAVETO (SID_SFX_START + 1546)
-#define SID_ADJUSTICONS (SID_SFX_START + 1547)
-#define SID_AUTO_ADJUSTICONS (SID_SFX_START + 1548)
-#define SID_ICONGRID (SID_SFX_START + 1549)
-#define SID_BINDING (SID_SFX_START + 1550)
-
-#define SID_ISCHILDFRAMELOAD (SID_SFX_START + 1552)
-#define SID_PARENTFRAME (SID_SFX_START + 1554)
-
#define SID_CREATE_BASICOBJECT (SID_SFX_START + 1555)
#define SID_DELETE_BASICOBJECT (SID_SFX_START + 1556)
@@ -399,27 +216,11 @@
#define SID_UPDATE_VERSION (SID_SFX_START + 1568)
#define SID_BUILD_VERSION (SID_SFX_START + 1569)
-#define SID_INSERT_TASKFRAME (SID_SFX_START + 1572)
-#define SID_TASK (SID_SFX_START + 1573)
-#define SID_ACTIVETASK (SID_SFX_START + 1574)
-#define SID_EXPLORER_ISDESKTOP (SID_SFX_START + 1576)
-
-#define SID_CHAOSDOC_LAYOUT1 (SID_SFX_START + 1578)
-#define SID_CHAOSDOC_LAYOUT2 (SID_SFX_START + 1579)
-#define SID_CHAOSDOC_LAYOUT3 (SID_SFX_START + 1580)
-#define SID_CHAOSDOC_LAYOUT4 (SID_SFX_START + 1581)
-
#define SID_VERSION (SID_SFX_START + 1583)
-#define SID_UNO (SID_SFX_START + 1584)
#define SID_DOCUMENT_COMPARE (SID_SFX_START + 1586)
#define SID_DOCUMENT_MERGE (SID_SFX_START + 1587)
-#define SID_EXECUTE (SID_SFX_START + 1593)
-#define SID_OWNS_FRAME (SID_SFX_START + 1598)
-
-#define SID_OFFICE_VERSION_ID (SID_SFX_START + 1599)
-#define SID_USE_FILTEROPTIONS (SID_SFX_START + 1600)
#define SID_OFFICE_PLK (SID_SFX_START + 1601)
#define SID_OFFICE_PALK (SID_SFX_START + 1604)
#define SID_CHECK_KEY (SID_SFX_START + 1605)
@@ -452,7 +253,7 @@
#define SID_LOGOUT (SID_SFX_START + 1652)
#define SID_JUMPMARK (SID_SFX_START + 1654)
#define SID_BROWSE (SID_SFX_START + 1658)
-#define SID_BACKTOWEBTOP (SID_SFX_START + 1657)
+ // FREE (was: SID_BACKTOWEBTOP)
#define SID_SEGMENTSIZE (SID_SFX_START + 1659)
#define SID_VIEW_DATA_SOURCE_BROWSER (SID_SFX_START + 1660)
#define SID_TOGGLE_MENUBAR (SID_SFX_START + 1661)
@@ -509,10 +310,10 @@
#define SID_SFX_free_END (SID_SFX_START + 3999)
#define SID_OPEN_NEW_VIEW (SID_SFX_START + 520)
-#define SID_VIEW_ZOOM_MODE (SID_SFX_START + 521)
-#define SID_VIEW_POS_SIZE (SID_SFX_START + 522)
+ // FREE, was SID_VIEW_ZOOM_MODE
+ // FREE, was SID_VIEW_POS_SIZE
#define SID_VIEW_ID (SID_SFX_START + 523)
-#define SID_USER_DATA (SID_SFX_START + 524)
+ // FREE, was SID_USER_DATA
#define SID_VIEW_DATA (SID_SFX_START + 1582)
#define SID_SILENT (SID_SFX_START + 528)
#define SID_HIDDEN (SID_SFX_START + 534)
@@ -663,7 +464,7 @@
#define SID_WIN_MINIMIZED (SID_SFX_START + 625)
#define SID_WIN_MAXIMIZED (SID_SFX_START + 626)
#define SID_WIN_FULLSCREEN (SID_SFX_START + 627)
-#define SID_WIN_POSSIZE (SID_SFX_START + 628)
+ // FREE, was SID_WIN_POSSIZE
#define SID_WIN_VISIBLE (SID_SFX_START + 629)
#define SID_VIEWSHELL0 (SID_SFX_START + 630)
@@ -932,7 +733,7 @@
#define SID_ATTR_AUTOSAVEMINUTE (SID_OPTIONS_START + 5)
#define SID_ATTR_WORKINGSET (SID_OPTIONS_START + 13)
#define SID_ATTR_UNDO_COUNT (SID_OPTIONS_START + 16)
-#define SID_ATTR_SAVEDOCWINS (SID_OPTIONS_START + 17)
+ // unused
#define SID_ATTR_SAVEDOCVIEW (SID_OPTIONS_START + 18)
// GeneralTabPage
diff --git a/sfx2/inc/sfx2/shell.hxx b/sfx2/inc/sfx2/shell.hxx
index e7cfa08b3b..9d2ef73d5f 100644
--- a/sfx2/inc/sfx2/shell.hxx
+++ b/sfx2/inc/sfx2/shell.hxx
@@ -86,7 +86,6 @@ enum SfxInterfaceId
SFX_INTERFACE_NONE,
SFX_INTERFACE_SFXAPP,
SFX_INTERFACE_SFXDOCSH,
- SFX_INTERFACE_SFXTOPFRM,
SFX_INTERFACE_SFXIPFRM,
SFX_INTERFACE_SFXVIEWSH,
SFX_INTERFACE_SFXVIEWFRM,
diff --git a/sfx2/inc/sfx2/topfrm.hxx b/sfx2/inc/sfx2/topfrm.hxx
deleted file mode 100644
index 76b238efe0..0000000000
--- a/sfx2/inc/sfx2/topfrm.hxx
+++ /dev/null
@@ -1,122 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SFX_TOPFRM_HXX
-#define _SFX_TOPFRM_HXX
-
-#include "sal/config.h"
-#include "sfx2/dllapi.h"
-#include "sal/types.h"
-#include <com/sun/star/uno/Reference.h>
-#include <vcl/dockwin.hxx>
-#include <vcl/wrkwin.hxx>
-
-#include <sfx2/frame.hxx>
-#include <sfx2/viewfrm.hxx>
-
-class SfxViewShell;
-class SfxTopFrame;
-class SfxTopFrame_Impl;
-namespace svtools { class AsynchronLink; }
-
-// class SfxTopFrame -----------------------------------------------------
-
-class SFX2_DLLPUBLIC SfxTopFrame : public SfxFrame
-{
-friend class SfxTopWindow_Impl;
-friend class SfxTopFrameWindow_Impl;
-friend class SfxTopFrame_Impl;
-
- SfxTopFrame_Impl* pImp;
- Window* pWindow;
- SAL_DLLPRIVATE SfxTopFrame( Window* pWindow=NULL, sal_Bool bHidden = sal_False );
- SAL_DLLPRIVATE virtual ~SfxTopFrame();
-public:
- TYPEINFO();
-
- static SfxTopFrame* Create( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > xFrame );
- static SfxTopFrame* Create( SfxObjectShell* pDoc=0, USHORT nViewId=0, BOOL bHidden=sal_False, const SfxItemSet* pSet=NULL );
- static SfxTopFrame* Create( SfxObjectShell* pDoc, Window* pWindow, USHORT nViewId=0, BOOL bHidden=sal_False, const SfxItemSet* pSet=NULL );
-
- virtual Window& GetWindow() const;
- virtual BOOL Close();
- virtual BOOL InsertDocument( SfxObjectShell *pDoc );
- String GetWindowData();
-
- void SetPresentationMode( BOOL bSet );
- SystemWindow* GetSystemWindow() const;
-
-//#if 0 // _SOLAR__PRIVATE
- SAL_DLLPRIVATE void LockResize_Impl( BOOL bLock );
- SAL_DLLPRIVATE void SetMenuBarOn_Impl( BOOL bOn );
- SAL_DLLPRIVATE BOOL IsMenuBarOn_Impl() const;
- SAL_DLLPRIVATE BOOL InsertDocument_Impl( SfxObjectShell *pDoc, USHORT nViewId=0 );
- SAL_DLLPRIVATE SystemWindow* GetTopWindow_Impl() const;
- SAL_DLLPRIVATE void CheckMenuCloser_Impl( MenuBar* pMenubar );
-//#endif
-};
-
-// class SfxTopViewFrame -------------------------------------------------
-
-class SfxTopViewFrame_Impl;
-class SFX2_DLLPUBLIC SfxTopViewFrame : public SfxViewFrame
-{
-friend class SfxTopWindow_Impl;
-friend class SfxTopViewFrame_Impl;
-
- SfxTopViewFrame_Impl* pImp;
- svtools::AsynchronLink* pCloser;
-
-protected:
-
- virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
- virtual void Activate( BOOL bUI );
- virtual void Deactivate( BOOL bUI );
- virtual BOOL Close();
- virtual ~SfxTopViewFrame();
-
-public:
- TYPEINFO();
- SFX_DECL_INTERFACE(SFX_INTERFACE_SFXTOPFRM)
-
- SfxTopViewFrame( SfxFrame* pFrame, SfxObjectShell *pDoc=NULL, USHORT nViewId=0 );
-
- virtual void SetZoomFactor( const Fraction &rZoomX, const Fraction &rZoomY );
- SAL_DLLPRIVATE virtual BOOL SetBorderPixelImpl( const SfxViewShell *pSh, const SvBorder &rBorder );
- virtual String UpdateTitle();
-
-//#if 0 // _SOLAR__PRIVATE
- SAL_DLLPRIVATE void Exec_Impl(SfxRequest &);
- SAL_DLLPRIVATE void GetState_Impl(SfxItemSet &);
- SAL_DLLPRIVATE void INetExecute_Impl(SfxRequest &);
- SAL_DLLPRIVATE void INetState_Impl(SfxItemSet &);
- SAL_DLLPRIVATE SfxTopFrame* GetTopFrame_Impl()
- { return (SfxTopFrame*) GetFrame(); }
-//#endif
-};
-
-#endif // #ifndef _SFX_TOPFRM_HXX
-
diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx
index e3da424a31..06e6b9dcae 100644
--- a/sfx2/inc/sfx2/viewfrm.hxx
+++ b/sfx2/inc/sfx2/viewfrm.hxx
@@ -38,6 +38,7 @@
#include <svl/poolitem.hxx>
#include <com/sun/star/frame/status/Verb.hpp>
#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/frame/XController2.hpp>
class SfxMacro;
class SvBorder;
@@ -48,7 +49,6 @@ class SfxProgress;
class SvData;
class SfxViewShell;
class SvPseudoObject;
-class SfxCancelManager;
class SystemWindow;
class Fraction;
class Point;
@@ -59,6 +59,10 @@ namespace sfx2
{
class SvLinkSource;
}
+namespace svtools
+{
+ class AsynchronLink;
+}
#ifndef SFX_DECL_OBJECTSHELL_DEFINED
#define SFX_DECL_OBJECTSHELL_DEFINED
@@ -127,6 +131,7 @@ Rectangle & operator += ( Rectangle & rRect, const SvBorder & rBorder );
Rectangle & operator -= ( Rectangle & rRect, const SvBorder & rBorder );
+DBG_NAMEEX(SfxViewFrame)
class SFX2_DLLPUBLIC SfxViewFrame: public SfxShell, public SfxListener
{
struct SfxViewFrame_Impl* pImp;
@@ -144,39 +149,32 @@ private:
protected:
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
- SAL_DLLPRIVATE void SetWindow_Impl( Window *pWin );
-
#ifndef _SFX_HXX
- SAL_DLLPRIVATE BOOL SwitchToViewShell_Impl( USHORT nNo, BOOL bIsIndex = FALSE );
SAL_DLLPRIVATE void KillDispatcher_Impl();
#endif
virtual ~SfxViewFrame();
public:
+ SfxViewFrame( SfxFrame& rFrame, SfxObjectShell *pDoc = NULL );
+
TYPEINFO();
SFX_DECL_INTERFACE(SFX_INTERFACE_SFXVIEWFRM)
- SfxViewFrame( SfxBindings&, SfxFrame*, SfxObjectShell *pDoc=0, sal_uInt32 nType = 0 );
- SfxViewFrame(SfxObjectShell&, SfxBindings&, SfxFrame*p=0, sal_uInt32 nType = 0);
- SfxViewFrame(
- const SfxViewFrame &, SfxBindings &, SfxFrame *pFrame);
-
- static SfxViewFrame* SearchViewFrame( SfxViewFrame*, const String& );
static void SetViewFrame( SfxViewFrame* );
- static SfxViewFrame* CreateViewFrame( SfxObjectShell& rDoc,
- USHORT nViewId=0,
- BOOL bHidden=FALSE );
+
+ static SfxViewFrame* LoadHiddenDocument( SfxObjectShell& i_rDoc, const USHORT i_nViewId );
+ static SfxViewFrame* LoadDocument( SfxObjectShell& i_rDoc, const USHORT i_nViewId );
+ static SfxViewFrame* LoadDocumentIntoFrame( SfxObjectShell& i_rDoc, const SfxFrameItem* i_pFrameItem, const USHORT i_nViewId = 0 );
+ static SfxViewFrame* LoadDocumentIntoFrame( SfxObjectShell& i_rDoc, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrameItem, const USHORT i_nViewId = 0 );
+ static SfxViewFrame* DisplayNewDocument( SfxObjectShell& i_rDoc, const SfxRequest& i_rCreateDocRequest, const USHORT i_nViewId = 0 );
static SfxViewFrame* Current();
- static SfxViewFrame* GetFirst( const SfxObjectShell* pDoc = 0,
- TypeId aType = 0,
- BOOL bOnlyVisible = TRUE );
- static SfxViewFrame* GetNext( const SfxViewFrame& rPrev,
- const SfxObjectShell* pDoc = 0,
- TypeId aType = 0 ,
- BOOL bOnlyVisible = TRUE );
- static USHORT Count(TypeId = 0);
+ static SfxViewFrame* GetFirst( const SfxObjectShell* pDoc = 0, BOOL bOnlyVisible = TRUE );
+ static SfxViewFrame* GetNext( const SfxViewFrame& rPrev, const SfxObjectShell* pDoc = 0, BOOL bOnlyVisible = TRUE );
+ static USHORT Count();
+
+ static SfxViewFrame* Get( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController>& i_rController, const SfxObjectShell* i_pDoc = NULL );
void DoActivate(BOOL bMDI, SfxViewFrame *pOld=NULL);
void DoDeactivate(BOOL bMDI, SfxViewFrame *pOld=NULL);
@@ -188,8 +186,7 @@ public:
SfxBindings& GetBindings() { return *pBindings; }
const SfxBindings& GetBindings() const { return *pBindings; }
Window& GetWindow() const;
- virtual void SetZoomFactor( const Fraction &rZoomX,
- const Fraction &rZoomY ) = 0;
+ virtual void SetZoomFactor( const Fraction &rZoomX, const Fraction &rZoomY );
SfxProgress* GetProgress() const;
#ifdef ENABLE_INIMANAGER//MUSTINI
@@ -213,6 +210,8 @@ public:
void ToTop();
void Enable( BOOL bEnable );
virtual BOOL Close();
+ virtual void Activate( BOOL bUI );
+ virtual void Deactivate( BOOL bUI );
// DDE-Interface
virtual long DdeExecute( const String& rCmd );
@@ -224,10 +223,10 @@ public:
const ::com::sun::star::uno::Any & rValue );
virtual ::sfx2::SvLinkSource* DdeCreateLinkSource( const String& rItem );
- virtual void ShowStatusText( const String& rText );
- virtual void HideStatusText();
+ void ShowStatusText( const String& rText );
+ void HideStatusText();
- virtual String UpdateTitle();
+ String UpdateTitle();
// interne Handler
SAL_DLLPRIVATE virtual BOOL SetBorderPixelImpl( const SfxViewShell *pSh, const SvBorder &rBorder );
@@ -236,21 +235,18 @@ public:
virtual SfxObjectShell* GetObjectShell();
USHORT GetCurViewId() const;
- SfxFrame* GetFrame() const;
+ SfxFrame& GetFrame() const;
SfxViewFrame* GetTopViewFrame() const;
BOOL DoClose();
ULONG GetFrameType() const
- { return GetFrame()->GetFrameType(); }
- SfxFrame* GetTopFrame() const
- { return GetFrame()->GetTopFrame(); }
- SfxFrame* SearchFrame( const String& rName, SfxMedium* pMedium = 0)
- { return GetFrame()->SearchFrame( rName, pMedium ); }
+ { return GetFrame().GetFrameType(); }
+ SfxFrame& GetTopFrame() const
+ { return GetFrame().GetTopFrame(); }
void GetTargetList( TargetList& rList ) const
- { GetFrame()->GetTargetList( rList ); }
+ { GetFrame().GetTargetList( rList ); }
void CancelTransfers()
- { GetFrame()->CancelTransfers(); }
- SfxCancelManager* GetCancelManager() const;
+ { GetFrame().CancelTransfers(); }
void SetModalMode( BOOL );
BOOL IsInModalMode() const;
@@ -267,19 +263,11 @@ public:
void ChildWindowState(SfxItemSet&);
//#if 0 // _SOLAR__PRIVATE
- SAL_DLLPRIVATE SfxMacro* GetRecordingMacro_Impl();
- SAL_DLLPRIVATE void SetFrame_Impl( SfxFrame* );
SAL_DLLPRIVATE void SetDowning_Impl();
SAL_DLLPRIVATE void GetDocNumber_Impl();
SAL_DLLPRIVATE BOOL IsDowning_Impl() const;
- SAL_DLLPRIVATE void SetSetViewFrameAllowed_Impl( BOOL bSet );
- SAL_DLLPRIVATE BOOL IsSetViewFrameAllowed_Impl() const;
- SAL_DLLPRIVATE void SetImportingObjectShell_Impl( SfxObjectShell* pSH );
- SAL_DLLPRIVATE SfxObjectShell* GetImportingObjectShell_Impl( ) const;
SAL_DLLPRIVATE void SetViewShell_Impl( SfxViewShell *pVSh );
- SAL_DLLPRIVATE void SetObjectShell_Impl( SfxObjectShell& rObjSh ,
- FASTBOOL bDefaultView = FALSE );
- SAL_DLLPRIVATE void ReleaseObjectShell_Impl( BOOL bStoreView = FALSE );
+ SAL_DLLPRIVATE void ReleaseObjectShell_Impl();
SAL_DLLPRIVATE void GetState_Impl( SfxItemSet &rSet );
SAL_DLLPRIVATE void ExecReload_Impl( SfxRequest &rReq );
@@ -287,10 +275,8 @@ public:
SAL_DLLPRIVATE void StateReload_Impl( SfxItemSet &rSet );
SAL_DLLPRIVATE void ExecView_Impl( SfxRequest &rReq );
SAL_DLLPRIVATE void StateView_Impl( SfxItemSet &rSet );
- SAL_DLLPRIVATE void PropState_Impl( SfxItemSet &rSet );
SAL_DLLPRIVATE void ExecHistory_Impl( SfxRequest &rReq );
SAL_DLLPRIVATE void StateHistory_Impl( SfxItemSet &rSet );
- SAL_DLLPRIVATE void SetParentViewFrame_Impl(SfxViewFrame *pParentFrame);
SAL_DLLPRIVATE SfxViewFrame* GetParentViewFrame_Impl() const;
SAL_DLLPRIVATE void ForceOuterResize_Impl(BOOL bOn=TRUE);
SAL_DLLPRIVATE BOOL IsResizeInToOut_Impl() const;
@@ -301,25 +287,75 @@ public:
SAL_DLLPRIVATE void LockObjectShell_Impl(BOOL bLock=TRUE);
- SAL_DLLPRIVATE SfxViewShell* CreateView_Impl( USHORT nViewId );
SAL_DLLPRIVATE void MakeActive_Impl( BOOL bActivate );
SAL_DLLPRIVATE void SetQuietMode_Impl( BOOL );
SAL_DLLPRIVATE const Size& GetMargin_Impl() const;
- SAL_DLLPRIVATE void SetMargin_Impl( const Size& );
SAL_DLLPRIVATE void SetActiveChildFrame_Impl( SfxViewFrame* );
SAL_DLLPRIVATE SfxViewFrame* GetActiveChildFrame_Impl() const;
- SAL_DLLPRIVATE BOOL IsRestoreView_Impl() const;
- SAL_DLLPRIVATE void SetRestoreView_Impl( BOOL );
- SAL_DLLPRIVATE void SetViewData_Impl( USHORT, const String& );
- SAL_DLLPRIVATE String& GetViewData_Impl();
SAL_DLLPRIVATE String GetActualPresentationURL_Impl() const;
SAL_DLLPRIVATE static void CloseHiddenFrames_Impl();
SAL_DLLPRIVATE void MiscExec_Impl(SfxRequest &);
SAL_DLLPRIVATE void MiscState_Impl(SfxItemSet &);
SAL_DLLPRIVATE SfxWorkWindow* GetWorkWindow_Impl( USHORT nId );
SAL_DLLPRIVATE void AddDispatchMacroToBasic_Impl(const ::rtl::OUString& sMacro);
- SAL_DLLPRIVATE BOOL ClearEventFlag_Impl();
+
+ SAL_DLLPRIVATE void Exec_Impl(SfxRequest &);
+ SAL_DLLPRIVATE void INetExecute_Impl(SfxRequest &);
+ SAL_DLLPRIVATE void INetState_Impl(SfxItemSet &);
+
+ SAL_DLLPRIVATE void SetCurViewId_Impl( const USHORT i_nID );
+
//#endif
+private:
+ SAL_DLLPRIVATE BOOL SwitchToViewShell_Impl( USHORT nNo, BOOL bIsIndex = FALSE );
+ SAL_DLLPRIVATE void PopShellAndSubShells_Impl( SfxViewShell& i_rViewShell );
+
+ /** loads the given existing document into the given frame
+
+ This is done using the XComponentLoader interface of the frame, so the SFX document loader is invoked.
+
+ @param i_rDoc
+ the document to load
+ @param i_rFrame
+ the frame to load the document into
+ @param i_rLoadArgs
+ the arguments to pass to the component loader. If this sequence is empty, then the current arguments of the
+ model will be obtained, and passed to the loader. This ensures that any arguments in the model will be preserved,
+ instead of being reset.
+ @param i_nViewId
+ the ID of the view to create
+ @throws Exception
+ if something goes wrong. The caller is responsible for handling this.
+ */
+ SAL_DLLPRIVATE static SfxViewShell* LoadViewIntoFrame_Impl(
+ const SfxObjectShell& i_rDoc,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& i_rLoadArgs,
+ const USHORT i_nViewId,
+ const bool i_bHidden
+ );
+
+ /** loads the given existing document into the given frame
+
+ This is done using the XComponentLoader interface of the frame, so the SFX document loader is invoked.
+
+ If no frame is given, a blank top level frame is created.
+
+ If anything fails during the process, as much as possible is cleaned up.
+
+ @param i_rDoc
+ the document to load
+ @param i_rFrame
+ the frame to load the document into. Might be <NULL/>, in which case a new frame is created.
+ @param i_nViewId
+ the ID of the view to create
+ */
+ SAL_DLLPRIVATE static SfxViewFrame* LoadViewIntoFrame_Impl_NoThrow(
+ const SfxObjectShell& i_rDoc,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame,
+ const USHORT i_nViewId,
+ const bool i_bHidden
+ );
};
//--------------------------------------------------------------------
diff --git a/sfx2/inc/sfx2/viewsh.hxx b/sfx2/inc/sfx2/viewsh.hxx
index f12ef8b2e5..0e8bc90260 100644
--- a/sfx2/inc/sfx2/viewsh.hxx
+++ b/sfx2/inc/sfx2/viewsh.hxx
@@ -59,6 +59,7 @@ class SfxTabPage;
class SfxPrintMonitor;
class SfxFrameSetDescriptor;
class PrintDialog;
+class Printer;
class SfxPrinter;
class SfxProgress;
class SvStringsDtor;
@@ -96,24 +97,12 @@ enum SfxScrollingMode
// @[SfxViewShell-Flags]
-#define SFX_VIEW_MAXIMIZE_FIRST 0x0001 /* die erste View wird maximiert
- dargestellt */
-#define SFX_VIEW_OPTIMIZE_EACH 0x0002 /* jede View wird in optimaler
- Gr"o\se dargestellt */
-#define SFX_VIEW_DISABLE_ACCELS 0x0004 /* die Acceleratoren werden
- disabled, solange diese
- View den Focus hat */
-#define SFX_VIEW_OBJECTSIZE_EMBEDDED 0x0008 /* Views von embedded Objekten
- werden in optimaler Gr"o\se
- dargestellt */
#define SFX_VIEW_HAS_PRINTOPTIONS 0x0010 /* Options-Button und Options-
Dialog im PrintDialog */
#define SFX_VIEW_CAN_PRINT 0x0020 /* enabled Printing ohne Printer
erzeugen zu m"ussen */
#define SFX_VIEW_NO_SHOW 0x0040 /* Window der ViewShell darf nicht
automatisch geshowed werden */
-#define SFX_VIEW_IMPLEMENTED_AS_FRAMESET 0x0080 /* Das Dokument ist als
- Frameset implementiert*/
#define SFX_VIEW_NO_NEWWINDOW 0x0100 /* keine weitere View erlauben */
/* [Beschreibung]
@@ -159,12 +148,9 @@ class SFX2_DLLPUBLIC SfxViewShell: public SfxShell, public SfxListener
{
#ifdef _SFXVIEWSH_HXX
friend class SfxViewFrame;
-friend class SfxTopViewFrame;
friend class SfxPlugInFrame;
-friend class SfxInternalFrame;
-friend class SfxExternalTopViewFrame_Impl;
-friend class SfxOfficeDocController;
friend class SfxBaseController;
+friend class SfxPrinterController;
#endif
struct SfxViewShell_Impl* pImp;
@@ -172,8 +158,6 @@ friend class SfxBaseController;
SfxViewFrame* pFrame;
SfxShell* pSubShell;
Window* pWindow;
- BOOL bMaximizeFirst;
- BOOL bOptimizeEach;
BOOL bNoNewWindow;
protected:
@@ -197,6 +181,8 @@ public:
const TypeId* pType = 0, BOOL bOnlyVisible = TRUE );
static SfxViewShell* Current();
+ static SfxViewShell* Get( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController>& i_rController );
+
// Ctoren/Dtoren Initialisierung
TYPEINFO();
SFX_DECL_INTERFACE(SFX_INTERFACE_SFXVIEWSH)
@@ -204,10 +190,6 @@ public:
SfxViewShell( SfxViewFrame *pFrame, USHORT nFlags = 0 );
virtual ~SfxViewShell();
- // In-Place
- // should be superfluous
- //virtual SfxInPlaceClient* CreateIPClient( WorkWindow * pTop, WorkWindow * pDoc, Window * pDraw );
-
SfxInPlaceClient* GetIPClient() const;
SfxInPlaceClient* GetUIActiveClient() const;
SfxInPlaceClient* FindIPClient( const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& xObj, Window *pObjParentWin ) const;
@@ -224,9 +206,6 @@ public:
void VisAreaChanged(const Rectangle& rRect);
// Verhaltens-Flags
- BOOL IsMaximizeFirst() const { return bMaximizeFirst; }
- BOOL IsOptimizeEach() const { return bOptimizeEach; }
- HACK(inline) BOOL UseObjectSize() const;
SfxScrollingMode GetScrollingMode() const;
void SetScrollingMode( SfxScrollingMode eMode );
@@ -269,6 +248,7 @@ public:
void LockPrinter( BOOL bLock = TRUE );
BOOL IsPrinterLocked() const;
virtual JobSetup GetJobSetup() const;
+ Printer* GetActivePrinter() const;
// Workingset
virtual void WriteUserData( String&, BOOL bBrowse = FALSE );
@@ -319,7 +299,6 @@ public:
SAL_DLLPRIVATE void AddContextMenuInterceptor_Impl( const ::com::sun::star::uno::Reference < ::com::sun::star::ui::XContextMenuInterceptor >& xInterceptor );
SAL_DLLPRIVATE void RemoveContextMenuInterceptor_Impl( const ::com::sun::star::uno::Reference < ::com::sun::star::ui::XContextMenuInterceptor >& xInterceptor );
SAL_DLLPRIVATE FASTBOOL GlobalKeyInput_Impl( const KeyEvent &rKeyEvent );
- SAL_DLLPRIVATE BOOL IsImplementedAsFrameset_Impl() const;
SAL_DLLPRIVATE void NewIPClient_Impl( SfxInPlaceClient *pIPClient )
{ GetIPClientList_Impl(TRUE)->Insert(pIPClient); }
@@ -337,6 +316,8 @@ public:
SAL_DLLPRIVATE BOOL HasKeyListeners_Impl();
SAL_DLLPRIVATE BOOL HasMouseClickListeners_Impl();
+ SAL_DLLPRIVATE SfxBaseController* GetBaseController_Impl() const;
+
// Shell Interface
SAL_DLLPRIVATE void ExecPrint_Impl(SfxRequest &);
SAL_DLLPRIVATE void ExecMisc_Impl(SfxRequest &);
@@ -345,11 +326,11 @@ public:
SAL_DLLPRIVATE void SetFrameSet_Impl(SfxFrameSetDescriptor*);
SAL_DLLPRIVATE void CheckIPClient_Impl( SfxInPlaceClient*, const Rectangle& );
SAL_DLLPRIVATE void PushSubShells_Impl( BOOL bPush=TRUE );
+ SAL_DLLPRIVATE void PopSubShells_Impl() { PushSubShells_Impl( FALSE ); }
SAL_DLLPRIVATE void TakeOwnerShip_Impl();
SAL_DLLPRIVATE void CheckOwnerShip_Impl();
SAL_DLLPRIVATE void TakeFrameOwnerShip_Impl();
SAL_DLLPRIVATE BOOL ExecKey_Impl(const KeyEvent& aKey);
-
#endif
};
diff --git a/sfx2/inc/viewfac.hxx b/sfx2/inc/viewfac.hxx
index 3f383ef88c..0ab7159ae2 100644
--- a/sfx2/inc/viewfac.hxx
+++ b/sfx2/inc/viewfac.hxx
@@ -56,6 +56,9 @@ public:
{ return String( aDescription ); }
USHORT GetOrdinal() const { return nOrd; }
+ /// returns an API-compatible view name. For the moment, this is "view" with an appended ordinal/ID
+ String GetViewName() const;
+
private:
SfxViewCtor fnCreate;
SfxViewInit fnInit;
diff --git a/sfx2/prj/build.lst b/sfx2/prj/build.lst
index 89e618e8fc..3e791fbc20 100644
--- a/sfx2/prj/build.lst
+++ b/sfx2/prj/build.lst
@@ -21,3 +21,4 @@ sf sfx2\source\toolbox nmake - all sf_tbox sf_sdi sf_inc NULL
sf sfx2\source\inet nmake - all sf_inet sf_sdi sf_inc NULL
sf sfx2\source\explorer nmake - all sf_expl sf_sdi sf_inc NULL
sf sfx2\util nmake - all sf_util sf_appl sf_bast sf_cnfg sf_ctrl sf_dlg sf_doc sf_expl sf_inet sf_menu sf_layout sf_noti sf_sbar sf_tbox sf_view NULL
+sf sfx2\qa\unoapi nmake - all sf_qa_unoapi NULL
diff --git a/sfx2/qa/complex/DocumentMetaData.java b/sfx2/qa/complex/DocumentMetaData.java
index de3b22f299..e4ed104c4a 100644
--- a/sfx2/qa/complex/DocumentMetaData.java
+++ b/sfx2/qa/complex/DocumentMetaData.java
@@ -367,7 +367,7 @@ public class DocumentMetaData extends ComplexTestCase
dur.Hours = 777;
dur.Minutes = 666;
dur.Seconds = 555;
- dur.HundredthSeconds = 444;
+ dur.MilliSeconds = 444;
udpc.addProperty("Frobnicate", PropertyAttribute.REMOVEABLE,
new Boolean(b));
@@ -444,7 +444,11 @@ public class DocumentMetaData extends ComplexTestCase
udps.getPropertyValue("Frobnicate")));
assure ("UserDefined duration", eqDuration(dur, (Duration)
udps.getPropertyValue("FrobDuration")));
- assure ("UserDefined time", eqTime(t, (Time)
+ // this is now a Duration!
+ Duration t_dur = new Duration(false, (short)0, (short)0, (short)0,
+ t.Hours, t.Minutes, t.Seconds,
+ (short)(10 * t.HundredthSeconds));
+ assure ("UserDefined time", eqDuration(t_dur, (Duration)
udps.getPropertyValue("FrobDuration2")));
assure ("UserDefined date", eqDate(date, (Date)
udps.getPropertyValue("FrobEndDate")));
@@ -511,7 +515,7 @@ public class DocumentMetaData extends ComplexTestCase
return a.Years == b.Years && a.Months == b.Months && a.Days == b.Days
&& a.Hours == b.Hours && a.Minutes == b.Minutes
&& a.Seconds == b.Seconds
- && a.HundredthSeconds == b.HundredthSeconds
+ && a.MilliSeconds == b.MilliSeconds
&& a.Negative == b.Negative;
}
diff --git a/sfx2/qa/complex/docinfo/makefile.mk b/sfx2/qa/complex/docinfo/makefile.mk
index 18cfdb5344..8c35255410 100644
--- a/sfx2/qa/complex/docinfo/makefile.mk
+++ b/sfx2/qa/complex/docinfo/makefile.mk
@@ -53,4 +53,4 @@ JARCOMPRESS = TRUE
run:
- $(JAVAI) -cp $(CLASSPATH) org.openoffice.Runner -TestBase java_complex -o $(PACKAGE:s#$/#.#).$(JAVAFILES:b)
+ $(JAVAI) $(JAVAIFLAGS) -cp $(CLASSPATH) org.openoffice.Runner -TestBase java_complex -o $(PACKAGE:s#$/#.#).$(JAVAFILES:b)
diff --git a/sfx2/qa/unoapi/Test.java b/sfx2/qa/unoapi/Test.java
new file mode 100644
index 0000000000..4263985c13
--- /dev/null
+++ b/sfx2/qa/unoapi/Test.java
@@ -0,0 +1,51 @@
+/*************************************************************************
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+************************************************************************/
+
+package org.openoffice.sfx2.qa.unoapi;
+
+import org.openoffice.Runner;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
+
+public final class Test {
+ @org.junit.Before public void setUp() throws Exception {
+ connection.setUp();
+ }
+
+ @org.junit.After public void tearDown()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ connection.tearDown();
+ }
+
+ @org.junit.Test public void test() {
+ assertTrue(
+ Runner.run(
+ "-sce", "sfx.sce", "-xcl", "knownissues.xcl", "-tdoc",
+ "testdocuments", "-cs", connection.getDescription()));
+ }
+
+ private final OfficeConnection connection = new OfficeConnection();
+}
diff --git a/sfx2/qa/unoapi/makefile.mk b/sfx2/qa/unoapi/makefile.mk
index 3b078237f1..ea91ba4d1c 100644
--- a/sfx2/qa/unoapi/makefile.mk
+++ b/sfx2/qa/unoapi/makefile.mk
@@ -1,7 +1,6 @@
#*************************************************************************
-#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -22,19 +21,28 @@
# version 3 along with OpenOffice.org. If not, see
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
+#***********************************************************************/
-PRJ=..$/..
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
-PRJNAME=sfx2
-TARGET=qa_unoapi
+PRJ = ../..
+PRJNAME = sfx2
+TARGET = qa_unoapi
-.INCLUDE: settings.mk
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = org/openoffice/sfx2/qa/unoapi
+JAVATESTFILES = Test.java
+JAVAFILES = $(JAVATESTFILES)
+JARFILES = OOoRunner.jar ridl.jar test.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+.END
+.INCLUDE: settings.mk
.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
-ALLTAR : UNOAPI_TEST
+ALLTAR : javatest
-UNOAPI_TEST:
- +$(SOLARENV)$/bin$/checkapi -sce sfx.sce -xcl knownissues.xcl -tdoc $(PWD)$/testdocuments
+.END
diff --git a/sfx2/sdi/frmslots.sdi b/sfx2/sdi/frmslots.sdi
index df218dca9e..8b11c49e73 100644
--- a/sfx2/sdi/frmslots.sdi
+++ b/sfx2/sdi/frmslots.sdi
@@ -396,21 +396,11 @@ interface TopWindow : BrowseWindow
[
StateMethod = StateView_Impl ;
]
- SID_WIN_POSSIZE // ole(no) api(final/play/rec)
- [
- ExecMethod = Exec_Impl ;
- StateMethod = GetState_Impl ;
- ]
SID_CLOSEWIN // ole(no) api(final/play/rec)
[
ExecMethod = Exec_Impl ;
StateMethod = GetState_Impl ;
]
- SID_BACKTOWEBTOP // ole(no) api(final/play/rec)
- [
- ExecMethod = Exec_Impl ;
- StateMethod = GetState_Impl ;
- ]
SID_BROWSE_FORWARD // ole(no) api()
[
ExecMethod = INetExecute_Impl ;
@@ -431,23 +421,29 @@ interface TopWindow : BrowseWindow
ExecMethod = INetExecute_Impl ;
StateMethod = INetState_Impl ;
]
- SID_BROWSE_STOP // ole(no) api()
- [
- ExecMethod = INetExecute_Impl ;
- StateMethod = INetState_Impl ;
- ]
-
}
//=========================================================================
shell SfxViewFrame
{
- import BrowseWindow [Automation];
+ import TopWindow [Automation];
SID_FORMATMENUSTATE
[
StateMethod = MiscState_Impl ;
]
+
+ SID_ACTIVATE // ole(no) api(final/play/rec)
+ [
+ ExecMethod = Exec_Impl ;
+ StateMethod = GetState_Impl ;
+ ]
+
+ SID_SHOWPOPUPS
+ [
+ ExecMethod = Exec_Impl ;
+ StateMethod = GetState_Impl ;
+ ]
}
diff --git a/sfx2/sdi/makefile.mk b/sfx2/sdi/makefile.mk
index 800a48d7f6..c02e51eb69 100644
--- a/sfx2/sdi/makefile.mk
+++ b/sfx2/sdi/makefile.mk
@@ -50,7 +50,6 @@ SVSDI1DEPEND= \
appslots.sdi \
sfxslots.sdi \
docslots.sdi \
- mdislots.sdi \
viwslots.sdi \
frmslots.sdi
diff --git a/sfx2/sdi/mdislots.sdi b/sfx2/sdi/mdislots.sdi
deleted file mode 100644
index 07a57009b1..0000000000
--- a/sfx2/sdi/mdislots.sdi
+++ /dev/null
@@ -1,44 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-shell SfxTopViewFrame : SfxViewFrame
-{
- import TopWindow [Automation];
-
- SID_ACTIVATE // ole(no) api(final/play/rec)
- [
- ExecMethod = Exec_Impl ;
- StateMethod = GetState_Impl ;
- ]
-
- SID_SHOWPOPUPS
- [
- ExecMethod = Exec_Impl ;
- StateMethod = GetState_Impl ;
- ]
-}
-
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi
index c035383f0d..7bc57471c9 100644
--- a/sfx2/sdi/sfx.sdi
+++ b/sfx2/sdi/sfx.sdi
@@ -396,33 +396,6 @@ SfxVoidItem AddWatch SID_BASICIDE_ADDWATCH
]
//--------------------------------------------------------------------------
-SfxRectangleItem Area SID_WIN_POSSIZE
-
-[
- /* flags: */
- AutoUpdate = FALSE,
- Cachable = Cachable,
- FastCall = FALSE,
- HasCoreId = FALSE,
- HasDialog = FALSE,
- ReadOnlyDoc = TRUE,
- Toggle = FALSE,
- Container = TRUE,
- RecordAbsolute = FALSE,
- RecordPerSet;
- Synchron;
-
- Readonly = FALSE,
-
- /* config: */
- AccelConfig = FALSE,
- MenuConfig = FALSE,
- StatusBarConfig = FALSE,
- ToolBoxConfig = FALSE,
- GroupId = ;
-]
-
-//--------------------------------------------------------------------------
SfxStringItem Author SID_DOCINFO_AUTHOR
[
@@ -558,31 +531,6 @@ SfxVoidItem Backspace SID_BACKSPACE
]
//--------------------------------------------------------------------------
-SfxVoidItem BackToWebtop SID_BACKTOWEBTOP
-()
-[
- /* flags: */
- AutoUpdate = FALSE,
- Cachable = Cachable,
- FastCall = FALSE,
- HasCoreId = FALSE,
- HasDialog = FALSE,
- ReadOnlyDoc = TRUE,
- Toggle = FALSE,
- Container = TRUE,
- RecordAbsolute = FALSE,
- RecordPerSet;
- Asynchron;
-
- /* config: */
- AccelConfig = FALSE,
- MenuConfig = FALSE,
- StatusBarConfig = FALSE,
- ToolBoxConfig = FALSE,
- GroupId = GID_VIEW;
-]
-
-//--------------------------------------------------------------------------
SfxVoidItem BasicBreak SID_BASICBREAK
()
[
@@ -898,34 +846,6 @@ SfxUInt32Item BuildVersion SID_BUILD_VERSION
]
//--------------------------------------------------------------------------
-SfxVoidItem Stop SID_BROWSE_STOP
-()
-[
- /* flags: */
- AutoUpdate = TRUE,
- Cachable = Cachable,
- FastCall = FALSE,
- HasCoreId = FALSE,
- HasDialog = FALSE,
- ReadOnlyDoc = TRUE,
- Toggle = FALSE,
- Container = TRUE,
- RecordAbsolute = FALSE,
- RecordPerSet;
- Synchron;
-
- /* status: */
- SlotType = SfxBoolItem
-
- /* config: */
- AccelConfig = TRUE,
- MenuConfig = TRUE,
- StatusBarConfig = FALSE,
- ToolBoxConfig = TRUE,
- GroupId = GID_NAVIGATOR;
-]
-
-//--------------------------------------------------------------------------
SfxStringItem Caption SID_CAPTION
[
@@ -1057,31 +977,6 @@ SfxVoidItem ClearHistory SID_CLEARHISTORY
]
//--------------------------------------------------------------------------
-SfxVoidItem ClearMemCache SID_CLEARMEMCACHE
-()
-[
- /* flags: */
- AutoUpdate = FALSE,
- Cachable = Cachable,
- FastCall = FALSE,
- HasCoreId = FALSE,
- HasDialog = FALSE,
- ReadOnlyDoc = TRUE,
- Toggle = FALSE,
- Container = TRUE,
- RecordAbsolute = FALSE,
- RecordPerSet;
- Synchron;
-
- /* config: */
- AccelConfig = FALSE,
- MenuConfig = FALSE,
- StatusBarConfig = FALSE,
- ToolBoxConfig = FALSE,
- GroupId = GID_OPTIONS;
-]
-
-//--------------------------------------------------------------------------
SfxBoolItem CloseWins SID_CLOSEWINS
()
[
@@ -1676,31 +1571,6 @@ SfxVoidItem DeleteCurrent SID_BASICIDE_DELETECURRENT
]
//--------------------------------------------------------------------------
-SfxVoidItem DeleteFrame SID_DELETE_FRAME
-(SfxStringItem Frame SID_FRAMETITLE)
-[
- /* flags: */
- AutoUpdate = TRUE,
- Cachable = Cachable,
- FastCall = FALSE,
- HasCoreId = FALSE,
- HasDialog = FALSE,
- ReadOnlyDoc = FALSE,
- Toggle = FALSE,
- Container = FALSE,
- RecordAbsolute = FALSE,
- RecordPerSet;
- Synchron;
-
- /* config: */
- AccelConfig = FALSE,
- MenuConfig = TRUE,
- StatusBarConfig = FALSE,
- ToolBoxConfig = TRUE,
- GroupId = GID_EDIT;
-]
-
-//--------------------------------------------------------------------------
SfxUInt16Item DeleteStyle SID_STYLE_DELETE
(SfxStringItem Param SID_STYLE_DELETE,SfxUInt16Item Family SID_STYLE_FAMILY)
[
@@ -1804,33 +1674,6 @@ SfxBoolItem EditDoc SID_EDITDOC
]
//--------------------------------------------------------------------------
-SfxBoolItem EditFrameSet SID_EDIT_FRAMESET
-
-[
- /* flags: */
- AutoUpdate = TRUE,
- Cachable = Cachable,
- FastCall = FALSE,
- HasCoreId = FALSE,
- HasDialog = FALSE,
- ReadOnlyDoc = TRUE,
- Toggle = FALSE,
- Container = FALSE,
- RecordAbsolute = FALSE,
- RecordPerSet;
- Asynchron;
-
- Readonly = FALSE,
-
- /* config: */
- AccelConfig = TRUE,
- MenuConfig = TRUE,
- StatusBarConfig = FALSE,
- ToolBoxConfig = TRUE,
- GroupId = GID_EDIT;
-]
-
-//--------------------------------------------------------------------------
SfxVoidItem EditMacro SID_BASICIDE_EDITMACRO
(SfxMacroInfoItem aMacroInfo SID_BASICIDE_ARG_MACROINFO)
[
@@ -1934,31 +1777,6 @@ SfxBoolItem ExtendedHelp SID_EXTENDEDHELP
]
//--------------------------------------------------------------------------
-SfxVoidItem FileDocument SID_SAVEDOCTOBOOKMARK
-()
-[
- /* flags: */
- AutoUpdate = FALSE,
- Cachable = Cachable,
- FastCall = FALSE,
- HasCoreId = FALSE,
- HasDialog = FALSE,
- ReadOnlyDoc = TRUE,
- Toggle = FALSE,
- Container = TRUE,
- RecordAbsolute = FALSE,
- RecordPerSet;
- Synchron;
-
- /* config: */
- AccelConfig = TRUE,
- MenuConfig = TRUE,
- StatusBarConfig = FALSE,
- ToolBoxConfig = TRUE,
- GroupId = GID_DOCUMENT;
-]
-
-//--------------------------------------------------------------------------
SfxStringItem FileName SID_FILE_NAME
[
@@ -2039,114 +1857,6 @@ SfxVoidItem FormatMenu SID_FORMATMENU
]
//--------------------------------------------------------------------------
-SfxStringItem FrameContent SID_FRAME_CONTENT
-
-[
- /* flags: */
- AutoUpdate = FALSE,
- Cachable = Cachable,
- FastCall = FALSE,
- HasCoreId = FALSE,
- HasDialog = FALSE,
- ReadOnlyDoc = FALSE,
- Toggle = FALSE,
- Container = TRUE,
- RecordAbsolute = TRUE,
- RecordPerSet;
- Synchron;
-
- Readonly = FALSE,
-
- /* config: */
- AccelConfig = FALSE,
- MenuConfig = FALSE,
- StatusBarConfig = FALSE,
- ToolBoxConfig = TRUE,
- GroupId = GID_VIEW;
-]
-
-//--------------------------------------------------------------------------
-SfxUInt16Item FrameCount SID_FRAMECOUNT
-
-[
- /* flags: */
- AutoUpdate = FALSE,
- Cachable = Cachable,
- FastCall = FALSE,
- HasCoreId = FALSE,
- HasDialog = FALSE,
- ReadOnlyDoc = FALSE,
- Toggle = FALSE,
- Container = TRUE,
- RecordAbsolute = FALSE,
- RecordPerSet;
- Synchron;
-
- Readonly = TRUE,
-
- /* config: */
- AccelConfig = FALSE,
- MenuConfig = FALSE,
- StatusBarConfig = FALSE,
- ToolBoxConfig = FALSE,
- GroupId = ;
-]
-
-//--------------------------------------------------------------------------
-SfxStringItem FrameName SID_FRAME_NAME
-
-[
- /* flags: */
- AutoUpdate = FALSE,
- Cachable = Cachable,
- FastCall = FALSE,
- HasCoreId = FALSE,
- HasDialog = FALSE,
- ReadOnlyDoc = FALSE,
- Toggle = FALSE,
- Container = TRUE,
- RecordAbsolute = TRUE,
- RecordPerSet;
- Synchron;
-
- Readonly = FALSE,
-
- /* config: */
- AccelConfig = FALSE,
- MenuConfig = FALSE,
- StatusBarConfig = FALSE,
- ToolBoxConfig = TRUE,
- GroupId = GID_VIEW;
-]
-
-//--------------------------------------------------------------------------
-SfxUInt16Item FrameSpacing SID_FRAMESPACING
-
-[
- /* flags: */
- AutoUpdate = FALSE,
- Cachable = Cachable,
- FastCall = FALSE,
- HasCoreId = FALSE,
- HasDialog = FALSE,
- ReadOnlyDoc = FALSE,
- Toggle = FALSE,
- Container = TRUE,
- RecordAbsolute = FALSE,
- RecordPerSet;
- Synchron;
-
- Readonly = FALSE,
-
- /* config: */
- AccelConfig = FALSE,
- MenuConfig = FALSE,
- StatusBarConfig = FALSE,
- ToolBoxConfig = TRUE,
- GroupId = GID_VIEW;
-]
-
-//--------------------------------------------------------------------------
SfxTemplateItem FrameStyle SID_STYLE_FAMILY3
[
@@ -3301,33 +3011,6 @@ SfxVoidItem InsertObjectFloatingFrame SID_INSERT_FLOATINGFRAME
]
//--------------------------------------------------------------------------
-SfxBoolItem Interactive SID_INTERACTIVEMODE
-
-[
- /* flags: */
- AutoUpdate = FALSE,
- Cachable = Cachable,
- FastCall = FALSE,
- HasCoreId = FALSE,
- HasDialog = FALSE,
- ReadOnlyDoc = TRUE,
- Toggle = FALSE,
- Container = TRUE,
- RecordAbsolute = FALSE,
- RecordPerSet;
- Synchron;
-
- Readonly = FALSE,
-
- /* config: */
- AccelConfig = FALSE,
- MenuConfig = FALSE,
- StatusBarConfig = FALSE,
- ToolBoxConfig = FALSE,
- GroupId = ;
-]
-
-//--------------------------------------------------------------------------
SfxBoolItem InternetOnline SID_INTERNET_ONLINE
[
@@ -3380,31 +3063,6 @@ SfxVoidItem InternetSearch SID_INTERNET_SEARCH
]
//--------------------------------------------------------------------------
-SfxVoidItem InternetUpdate SID_INTERNET_UPDATE
-()
-[
- /* flags: */
- AutoUpdate = FALSE,
- Cachable = Cachable,
- FastCall = FALSE,
- HasCoreId = TRUE,
- HasDialog = FALSE,
- ReadOnlyDoc = TRUE,
- Toggle = FALSE,
- Container = TRUE,
- RecordAbsolute = FALSE,
- RecordPerSet;
- Asynchron;
-
- /* config: */
- AccelConfig = FALSE,
- MenuConfig = FALSE,
- StatusBarConfig = FALSE,
- ToolBoxConfig = FALSE,
- GroupId = GID_EXPLORER;
-]
-
-//--------------------------------------------------------------------------
SfxBoolItem IsLoading SID_DOC_LOADING
[
@@ -3487,33 +3145,6 @@ SfxBoolItem IsPrinting SID_PRINTOUT
]
//--------------------------------------------------------------------------
-SfxBoolItem IsTopWindow SID_ISTOP
-
-[
- /* flags: */
- AutoUpdate = FALSE,
- Cachable = Cachable,
- FastCall = FALSE,
- HasCoreId = FALSE,
- HasDialog = FALSE,
- ReadOnlyDoc = FALSE,
- Toggle = FALSE,
- Container = TRUE,
- RecordAbsolute = FALSE,
- RecordPerSet;
- Synchron;
-
- Readonly = TRUE,
-
- /* config: */
- AccelConfig = FALSE,
- MenuConfig = FALSE,
- StatusBarConfig = FALSE,
- ToolBoxConfig = FALSE,
- GroupId = ;
-]
-
-//--------------------------------------------------------------------------
SfxVoidItem JumpToMark SID_JUMPTOMARK
(SfxStringItem Bookmark SID_JUMPTOMARK)
[
@@ -3566,33 +3197,6 @@ SfxStringItem Keywords SID_DOCINFO_KEYWORDS
]
//--------------------------------------------------------------------------
-SfxBoolItem LateInitDone SID_LATEINIT_DONE
-
-[
- /* flags: */
- AutoUpdate = FALSE,
- Cachable = Cachable,
- FastCall = FALSE,
- HasCoreId = FALSE,
- HasDialog = FALSE,
- ReadOnlyDoc = FALSE,
- Toggle = FALSE,
- Container = TRUE,
- RecordAbsolute = FALSE,
- RecordPerSet;
- Synchron;
-
- Readonly = TRUE,
-
- /* config: */
- AccelConfig = FALSE,
- MenuConfig = FALSE,
- StatusBarConfig = FALSE,
- ToolBoxConfig = FALSE,
- GroupId = GID_APPLICATION;
-]
-
-//--------------------------------------------------------------------------
SfxStringItem LibLoaded SID_BASICIDE_LIBLOADED
(SfxUsrAnyItem Document SID_BASICIDE_ARG_DOCUMENT_MODEL,SfxStringItem LibName SID_BASICIDE_ARG_LIBNAME)
[
@@ -4040,32 +3644,6 @@ SfxVoidItem MacroDialog SID_BASICCHOOSER
]
//--------------------------------------------------------------------------
-SfxVoidItem MailNotifyReset SID_MAIL_NOTIFY_RESET
-()
-[
- /* flags: */
- AutoUpdate = FALSE,
- Cachable = Cachable,
- FastCall = FALSE,
- HasCoreId = FALSE,
- HasDialog = FALSE,
- ReadOnlyDoc = TRUE,
- Toggle = TRUE,
- Container = TRUE,
- RecordAbsolute = FALSE,
- RecordPerSet;
- Asynchron;
-
- /* config: */
- AccelConfig = FALSE,
- MenuConfig = FALSE,
- StatusBarConfig = FALSE,
- ToolBoxConfig = FALSE,
- GroupId = GID_EXPLORER;
-]
-
-
-//--------------------------------------------------------------------------
SfxUInt16Item MailReceipt SID_MAIL_NOTIFY
[
@@ -4278,31 +3856,6 @@ SfxStringItem ModifiedStatus SID_DOC_MODIFIED
]
//--------------------------------------------------------------------------
-SfxVoidItem ModifyFrame SID_MODIFY_FRAME
-()
-[
- /* flags: */
- AutoUpdate = TRUE,
- Cachable = Cachable,
- FastCall = FALSE,
- HasCoreId = FALSE,
- HasDialog = FALSE,
- ReadOnlyDoc = FALSE,
- Toggle = FALSE,
- Container = FALSE,
- RecordAbsolute = TRUE,
- RecordPerItem;
- Synchron;
-
- /* config: */
- AccelConfig = FALSE,
- MenuConfig = TRUE,
- StatusBarConfig = FALSE,
- ToolBoxConfig = TRUE,
- GroupId = GID_EDIT;
-]
-
-//--------------------------------------------------------------------------
SfxVoidItem ModuleDialog SID_BASICIDE_MODULEDLG
()
[
@@ -4431,34 +3984,6 @@ SfxVoidItem NewDialog SID_BASICIDE_NEWDIALOG
]
//--------------------------------------------------------------------------
-SfxObjectItem NewFrameSet SID_NEWFRAMESET
-()
-[
- /* flags: */
- AutoUpdate = FALSE,
- Cachable = Cachable,
- FastCall = FALSE,
- HasCoreId = FALSE,
- HasDialog = FALSE,
- ReadOnlyDoc = TRUE,
- Toggle = FALSE,
- Container = TRUE,
- RecordAbsolute = FALSE,
- RecordPerSet;
- Asynchron;
-
- /* status: */
- SlotType = SfxStringItem
-
- /* config: */
- AccelConfig = TRUE,
- MenuConfig = TRUE,
- StatusBarConfig = FALSE,
- ToolBoxConfig = TRUE,
- GroupId = GID_APPLICATION;
-]
-
-//--------------------------------------------------------------------------
SfxVoidItem NewModule SID_BASICIDE_NEWMODULE
()
[
@@ -4611,33 +4136,6 @@ SfxStringItem ObjectMenue SID_OBJECT
]
//--------------------------------------------------------------------------
-SfxStringItem OfficeVersionId SID_OFFICE_VERSION_ID
-
-[
- /* flags: */
- AutoUpdate = FALSE,
- Cachable = Cachable,
- FastCall = FALSE,
- HasCoreId = FALSE,
- HasDialog = FALSE,
- ReadOnlyDoc = TRUE,
- Toggle = FALSE,
- Container = FALSE,
- RecordAbsolute = FALSE,
- RecordPerSet;
- Synchron;
-
- Readonly = TRUE,
-
- /* config: */
- AccelConfig = FALSE,
- MenuConfig = FALSE,
- StatusBarConfig = FALSE,
- ToolBoxConfig = FALSE,
- GroupId = GID_SPECIAL;
-]
-
-//--------------------------------------------------------------------------
SfxStringItem OldPALK SID_OLD_PALK
[
@@ -5057,33 +4555,6 @@ SfxStringItem DocPath SID_DOCPATH
]
//--------------------------------------------------------------------------
-SfxStringItem Path SID_PROGPATH
-
-[
- /* flags: */
- AutoUpdate = FALSE,
- Cachable = Cachable,
- FastCall = FALSE,
- HasCoreId = FALSE,
- HasDialog = FALSE,
- ReadOnlyDoc = TRUE,
- Toggle = FALSE,
- Container = TRUE,
- RecordAbsolute = FALSE,
- RecordPerSet;
- Synchron;
-
- Readonly = TRUE,
-
- /* config: */
- AccelConfig = FALSE,
- MenuConfig = FALSE,
- StatusBarConfig = FALSE,
- ToolBoxConfig = FALSE,
- GroupId = ;
-]
-
-//--------------------------------------------------------------------------
SfxVoidItem PickList SID_PICKLIST
()
[
@@ -6491,106 +5962,6 @@ SfxBoolItem SourceView SID_SOURCEVIEW
]
//--------------------------------------------------------------------------
-SfxObjectItem SplitHorizontal SID_SPLIT_HORIZONTAL
-(SfxStringItem Frame SID_FRAMETITLE)
-[
- /* flags: */
- AutoUpdate = TRUE,
- Cachable = Cachable,
- FastCall = FALSE,
- HasCoreId = FALSE,
- HasDialog = FALSE,
- ReadOnlyDoc = FALSE,
- Toggle = FALSE,
- Container = FALSE,
- RecordAbsolute = FALSE,
- RecordPerSet;
- Synchron;
-
- /* config: */
- AccelConfig = FALSE,
- MenuConfig = TRUE,
- StatusBarConfig = FALSE,
- ToolBoxConfig = TRUE,
- GroupId = GID_EDIT;
-]
-
-//--------------------------------------------------------------------------
-SfxObjectItem SplitParentHorizontal SID_SPLIT_PARENT_HORIZONTAL
-(SfxStringItem Frame SID_FRAMETITLE)
-[
- /* flags: */
- AutoUpdate = TRUE,
- Cachable = Cachable,
- FastCall = FALSE,
- HasCoreId = FALSE,
- HasDialog = FALSE,
- ReadOnlyDoc = FALSE,
- Toggle = FALSE,
- Container = FALSE,
- RecordAbsolute = FALSE,
- RecordPerSet;
- Synchron;
-
- /* config: */
- AccelConfig = FALSE,
- MenuConfig = TRUE,
- StatusBarConfig = FALSE,
- ToolBoxConfig = TRUE,
- GroupId = GID_EDIT;
-]
-
-//--------------------------------------------------------------------------
-SfxObjectItem SplitParentVertical SID_SPLIT_PARENT_VERTICAL
-(SfxStringItem Frame SID_FRAMETITLE)
-[
- /* flags: */
- AutoUpdate = TRUE,
- Cachable = Cachable,
- FastCall = FALSE,
- HasCoreId = FALSE,
- HasDialog = FALSE,
- ReadOnlyDoc = FALSE,
- Toggle = FALSE,
- Container = FALSE,
- RecordAbsolute = FALSE,
- RecordPerSet;
- Synchron;
-
- /* config: */
- AccelConfig = FALSE,
- MenuConfig = TRUE,
- StatusBarConfig = FALSE,
- ToolBoxConfig = TRUE,
- GroupId = GID_EDIT;
-]
-
-//--------------------------------------------------------------------------
-SfxObjectItem SplitVertical SID_SPLIT_VERTICAL
-(SfxStringItem Frame SID_FRAMETITLE)
-[
- /* flags: */
- AutoUpdate = TRUE,
- Cachable = Cachable,
- FastCall = FALSE,
- HasCoreId = FALSE,
- HasDialog = FALSE,
- ReadOnlyDoc = FALSE,
- Toggle = FALSE,
- Container = FALSE,
- RecordAbsolute = FALSE,
- RecordPerSet;
- Synchron;
-
- /* config: */
- AccelConfig = FALSE,
- MenuConfig = TRUE,
- StatusBarConfig = FALSE,
- ToolBoxConfig = TRUE,
- GroupId = GID_EDIT;
-]
-
-//--------------------------------------------------------------------------
SfxVoidItem StartRegistrationDialog SID_ONLINE_REGISTRATION_DLG
()
[
@@ -8114,7 +7485,7 @@ SfxVoidItem AutoPilotAddressDataSource SID_ADDRESS_DATA_SOURCE
//--------------------------------------------------------------------------
SfxVoidItem InsertBusinessCard FN_BUSINESS_CARD
-( SfxFrameItem Frame SID_DOCFRAME )
+( SfxUnoFrameItem Frame SID_FILLFRAME, SfxBoolItem Hidden SID_HIDDEN )
[
/* flags: */
AutoUpdate = FALSE,
@@ -8139,7 +7510,7 @@ SfxVoidItem InsertBusinessCard FN_BUSINESS_CARD
//--------------------------------------------------------------------------
SfxVoidItem InsertLabels FN_LABEL
-( SfxFrameItem Frame SID_DOCFRAME )
+( SfxUnoFrameItem Frame SID_FILLFRAME, SfxBoolItem Hidden SID_HIDDEN )
[
/* flags: */
AutoUpdate = FALSE,
@@ -8164,7 +7535,7 @@ SfxVoidItem InsertLabels FN_LABEL
//--------------------------------------------------------------------------
SfxVoidItem NewXForms FN_XFORMS_INIT
-( SfxFrameItem Frame SID_DOCFRAME )
+( SfxUnoFrameItem Frame SID_FILLFRAME, SfxBoolItem Hidden SID_HIDDEN )
[
/* flags: */
AutoUpdate = FALSE,
@@ -8189,7 +7560,7 @@ SfxVoidItem NewXForms FN_XFORMS_INIT
//--------------------------------------------------------------------------
SfxVoidItem AutoPilotPresentations SID_SD_AUTOPILOT
-( SfxFrameItem Frame SID_DOCFRAME )
+( SfxUnoFrameItem Frame SID_FILLFRAME, SfxBoolItem Hidden SID_HIDDEN )
[
/* flags: */
AutoUpdate = FALSE,
@@ -8214,7 +7585,7 @@ SfxVoidItem AutoPilotPresentations SID_SD_AUTOPILOT
//--------------------------------------------------------------------------
SfxVoidItem NewPresentation SID_NEWSD
-( SfxFrameItem Frame SID_DOCFRAME )
+( SfxUnoFrameItem Frame SID_FILLFRAME, SfxBoolItem Hidden SID_HIDDEN )
[
/* flags: */
AutoUpdate = FALSE,
diff --git a/sfx2/sdi/sfxitems.sdi b/sfx2/sdi/sfxitems.sdi
index e447b48a54..e191f4371f 100644
--- a/sfx2/sdi/sfxitems.sdi
+++ b/sfx2/sdi/sfxitems.sdi
@@ -18,6 +18,7 @@
item String SfxFrameItem; //! Dummy
item String SfxObjectShellItem //! Dummy
item String SfxUsrAnyItem //! Dummy
+ item String SfxUnoFrameItem //! Dummy
struct Point
{
diff --git a/sfx2/sdi/sfxslots.sdi b/sfx2/sdi/sfxslots.sdi
index be98315c0b..fc78c60a65 100644
--- a/sfx2/sdi/sfxslots.sdi
+++ b/sfx2/sdi/sfxslots.sdi
@@ -39,7 +39,6 @@ SlotIdFile( "sfx2/sfx.hrc" )
include "docslots.sdi"
include "viwslots.sdi"
include "frmslots.sdi"
- include "mdislots.sdi"
include "appslots.sdi"
}
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index 1bfa1df3dc..66d06cfce2 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -108,7 +108,7 @@
#include <sfx2/dispatch.hxx>
#include <sfx2/viewsh.hxx>
#include <sfx2/genlink.hxx>
-#include <sfx2/topfrm.hxx>
+#include <sfx2/viewfrm.hxx>
#include "appdata.hxx"
#include "openflag.hxx"
#include "app.hrc"
@@ -472,9 +472,6 @@ SfxDispatcher* SfxApplication::GetDispatcher_Impl()
//--------------------------------------------------------------------
void SfxApplication::SetViewFrame_Impl( SfxViewFrame *pFrame )
{
- if( pFrame && !pFrame->IsSetViewFrameAllowed_Impl() )
- return;
-
if ( pFrame != pAppData_Impl->pViewFrame )
{
// get the containerframes ( if one of the frames is an InPlaceFrame )
@@ -491,12 +488,6 @@ void SfxApplication::SetViewFrame_Impl( SfxViewFrame *pFrame )
// BOOL bDocWinActivate = pOldContainerFrame && pNewContainerFrame &&
// pOldContainerFrame->GetTopViewFrame() == pNewContainerFrame->GetTopViewFrame();
BOOL bTaskActivate = pOldContainerFrame != pNewContainerFrame;
- if ( pAppData_Impl->pViewFrame )
- {
- if ( bTaskActivate )
- // prepare UI for deacivation
- pAppData_Impl->pViewFrame->GetFrame()->Deactivate_Impl();
- }
if ( pOldContainerFrame )
{
@@ -565,11 +556,11 @@ short SfxApplication::QuerySave_Impl( SfxObjectShell& rDoc, sal_Bool /*bAutoSave
String aMsg( SfxResId( STR_ISMODIFIED ) );
aMsg.SearchAndReplaceAscii( "%1", rDoc.GetTitle() );
- SfxFrame *pFrame = SfxViewFrame::GetFirst(&rDoc)->GetFrame();
- pFrame->Appear();
+ SfxFrame& rFrame = SfxViewFrame::GetFirst(&rDoc)->GetFrame();
+ rFrame.Appear();
WinBits nBits = WB_YES_NO_CANCEL | WB_DEF_NO;
- QueryBox aBox( &pFrame->GetWindow(), nBits, aMsg );
+ QueryBox aBox( &rFrame.GetWindow(), nBits, aMsg );
return aBox.Execute();
}
@@ -693,7 +684,7 @@ uno::Reference< task::XStatusIndicator > SfxApplication::GetStatusIndicator() co
while ( pTop->GetParentViewFrame_Impl() )
pTop = pTop->GetParentViewFrame_Impl();
- return pTop->GetFrame()->GetWorkWindow_Impl()->GetStatusIndicator();
+ return pTop->GetFrame().GetWorkWindow_Impl()->GetStatusIndicator();
}
SfxTbxCtrlFactArr_Impl& SfxApplication::GetTbxCtrlFactories_Impl() const
@@ -810,7 +801,7 @@ SfxApplication::ChooseScript()
OSL_TRACE("create selector dialog");
const SfxViewFrame* pViewFrame = SfxViewFrame::Current();
- const SfxFrame* pFrame = pViewFrame ? pViewFrame->GetFrame() : NULL;
+ const SfxFrame* pFrame = pViewFrame ? &pViewFrame->GetFrame() : NULL;
uno::Reference< frame::XFrame > xFrame( pFrame ? pFrame->GetFrameInterface() : uno::Reference< frame::XFrame >() );
AbstractScriptSelectorDialog* pDlg =
diff --git a/sfx2/source/appl/app.src b/sfx2/source/appl/app.src
index 2b1078424b..e1c43c072e 100644
--- a/sfx2/source/appl/app.src
+++ b/sfx2/source/appl/app.src
@@ -652,11 +652,6 @@ ToolBox RID_ENVTOOLBOX
};
ToolBoxItem
{
- Identifier = SID_BROWSE_STOP ;
- Hide = TRUE;
- };
- ToolBoxItem
- {
Type = TOOLBOXITEM_SEPARATOR ;
};
ToolBoxItem
diff --git a/sfx2/source/appl/appbas.cxx b/sfx2/source/appl/appbas.cxx
index ad51b56cbe..641991cf67 100644
--- a/sfx2/source/appl/appbas.cxx
+++ b/sfx2/source/appl/appbas.cxx
@@ -351,7 +351,7 @@ void SfxApplication::EnterBasicCall()
}
// die SbxObjects der SfxShells auf den Stacks der Frames erzeugen
- for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst(0,0,sal_False);
+ for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst(0,sal_False);
pFrame;
pFrame = SfxViewFrame::GetNext(*pFrame,0,0,sal_False) )
{
@@ -422,16 +422,6 @@ void SfxApplication::PropExec_Impl( SfxRequest &rReq )
break;
}
- case SID_WIN_POSSIZE:
- {
- break;
- }
-
- case SID_INTERACTIVEMODE:
- {
- break;
- }
-
case SID_ATTR_UNDO_COUNT:
{
SFX_REQUEST_ARG(rReq, pCountItem, SfxUInt16Item, nSID, sal_False);
diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx
index 5b970dbdb2..44b970e82b 100644
--- a/sfx2/source/appl/appcfg.cxx
+++ b/sfx2/source/appl/appcfg.cxx
@@ -268,14 +268,6 @@ BOOL SfxApplication::GetOptions( SfxItemSet& rSet )
bRet = FALSE;
}
break;
- case SID_ATTR_SAVEDOCWINS :
- {
- bRet = TRUE;
- if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_SAVEDOCWINS))
- if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_SAVEDOCWINS ), aSaveOptions.IsSaveDocWins())))
- bRet = FALSE;
- }
- break;
case SID_ATTR_SAVEDOCVIEW :
{
bRet = TRUE;
@@ -627,13 +619,6 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
aSaveOptions.SetSaveWorkingSet(((const SfxBoolItem *)pItem)->GetValue());
}
- // offene Fenster speichern
- if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_SAVEDOCWINS), TRUE, &pItem))
- {
- DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
- aSaveOptions.SetSaveDocWins(((const SfxBoolItem *)pItem)->GetValue());
- }
-
// Fenster-Einstellung speichern
if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_SAVEDOCVIEW), TRUE, &pItem))
{
diff --git a/sfx2/source/appl/appchild.cxx b/sfx2/source/appl/appchild.cxx
index 9bd7cec041..dc3e6c4bf3 100644
--- a/sfx2/source/appl/appchild.cxx
+++ b/sfx2/source/appl/appchild.cxx
@@ -167,9 +167,9 @@ SfxTemplateDialog* SfxApplication::GetTemplateDialog()
SfxWorkWindow* SfxApplication::GetWorkWindow_Impl(const SfxViewFrame *pFrame) const
{
if ( pFrame )
- return pFrame->GetFrame()->GetWorkWindow_Impl();
+ return pFrame->GetFrame().GetWorkWindow_Impl();
else if ( pAppData_Impl->pViewFrame )
- return pAppData_Impl->pViewFrame->GetFrame()->GetWorkWindow_Impl();
+ return pAppData_Impl->pViewFrame->GetFrame().GetWorkWindow_Impl();
else
return NULL;
}
diff --git a/sfx2/source/appl/appdata.cxx b/sfx2/source/appl/appdata.cxx
index d58131d088..7936110356 100644
--- a/sfx2/source/appl/appdata.cxx
+++ b/sfx2/source/appl/appdata.cxx
@@ -98,7 +98,6 @@ SfxAppData_Impl::SfxAppData_Impl( SfxApplication* pApp ) :
pTopFrames( new SfxFrameArr_Impl ),
pInitLinkList(0),
pMatcher( 0 ),
- pCancelMgr( 0 ),
pLabelResMgr( 0 ),
pAppDispatch(NULL),
pTemplates( 0 ),
@@ -148,7 +147,6 @@ SfxAppData_Impl::~SfxAppData_Impl()
{
DeInitDDE();
delete pTopFrames;
- delete pCancelMgr;
delete pSecureURLs;
delete pBasicManager;
diff --git a/sfx2/source/appl/appdde.cxx b/sfx2/source/appl/appdde.cxx
index 4de64efcc3..789de8b425 100644
--- a/sfx2/source/appl/appdde.cxx
+++ b/sfx2/source/appl/appdde.cxx
@@ -46,7 +46,7 @@
#include "appdata.hxx"
#include <sfx2/objsh.hxx>
#include <sfx2/viewfrm.hxx>
-#include <sfx2/topfrm.hxx>
+#include <sfx2/viewfrm.hxx>
#include <sfx2/dispatch.hxx>
#include "sfxtypes.hxx"
#include <sfx2/sfxsids.hrc>
@@ -593,17 +593,12 @@ BOOL ImplDdeService::MakeTopic( const String& rNm )
// dann versuche die Datei zu laden:
SfxStringItem aName( SID_FILE_NAME, aFile.GetMainURL( INetURLObject::NO_DECODE ) );
SfxBoolItem aNewView(SID_OPEN_NEW_VIEW, TRUE);
-// SfxBoolItem aHidden(SID_HIDDEN, TRUE);
- // minimiert!
- SfxUInt16Item aViewStat( SID_VIEW_ZOOM_MODE, 0 );
- SfxRectangleItem aRectItem( SID_VIEW_POS_SIZE, Rectangle() );
SfxBoolItem aSilent(SID_SILENT, TRUE);
SfxDispatcher* pDispatcher = SFX_APP()->GetDispatcher_Impl();
const SfxPoolItem* pRet = pDispatcher->Execute( SID_OPENDOC,
SFX_CALLMODE_SYNCHRON,
&aName, &aNewView,
- &aViewStat,&aRectItem/*aHidden*/,
&aSilent, 0L );
if( pRet && pRet->ISA( SfxViewFrameItem ) &&
@@ -629,7 +624,7 @@ String ImplDdeService::Topics()
SfxObjectShell* pShell = SfxObjectShell::GetFirst( &aType );
while( pShell )
{
- if( SfxViewFrame::GetFirst( pShell, TYPE(SfxTopViewFrame) ))
+ if( SfxViewFrame::GetFirst( pShell ) )
{
if( sRet.Len() )
sRet += '\t';
diff --git a/sfx2/source/appl/appmisc.cxx b/sfx2/source/appl/appmisc.cxx
index 9565fcf7a8..e7eb75f99b 100644
--- a/sfx2/source/appl/appmisc.cxx
+++ b/sfx2/source/appl/appmisc.cxx
@@ -86,7 +86,7 @@
#include <sfx2/templdlg.hxx>
#include <sfx2/module.hxx>
#include <sfx2/msgpool.hxx>
-#include <sfx2/topfrm.hxx>
+#include <sfx2/viewfrm.hxx>
#include "openflag.hxx"
#include <sfx2/viewsh.hxx>
#include <sfx2/objface.hxx>
@@ -326,13 +326,6 @@ ISfxTemplateCommon* SfxApplication::GetCurrentTemplateCommon( SfxBindings& rBind
return 0;
}
-SfxCancelManager* SfxApplication::GetCancelManager() const
-{
- if ( !pAppData_Impl->pCancelMgr )
- pAppData_Impl->pCancelMgr = new SfxCancelManager;
- return pAppData_Impl->pCancelMgr;
-}
-
SfxResourceManager& SfxApplication::GetResourceManager() const { return *pAppData_Impl->pResMgr; }
BOOL SfxApplication::IsDowning() const { return pAppData_Impl->bDowning; }
SfxDispatcher* SfxApplication::GetAppDispatcher_Impl() { return pAppData_Impl->pAppDispat; }
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index b61d0bf797..b7cf7129bd 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -101,7 +101,7 @@
#include "sfxresid.hxx"
#include <sfx2/viewsh.hxx>
#include "app.hrc"
-#include <sfx2/topfrm.hxx>
+#include <sfx2/viewfrm.hxx>
#include <sfx2/sfxuno.hxx>
#include <sfx2/objface.hxx>
#include <sfx2/filedlghelper.hxx>
@@ -193,7 +193,7 @@ SfxObjectShellRef SfxApplication::DocAlreadyLoaded
// Vergleiche anhand der URLs
INetURLObject aUrl( xDoc->GetMedium()->GetName() );
if ( !aUrl.HasError() && aUrl == aUrlToFind &&
- (!bForbidVisible || !SfxViewFrame::GetFirst( xDoc, 0, TRUE )) &&
+ (!bForbidVisible || !SfxViewFrame::GetFirst( xDoc, TRUE )) &&
!xDoc->IsLoading())
{
break;
@@ -210,12 +210,10 @@ SfxObjectShellRef SfxApplication::DocAlreadyLoaded
DBG_ASSERT(
!bForbidVisible, "Unsichtbares kann nicht aktiviert werden" );
- SfxTopViewFrame *pFrame;
- for( pFrame = (SfxTopViewFrame*)
- SfxViewFrame::GetFirst( xDoc, TYPE(SfxTopViewFrame) );
+ SfxViewFrame* pFrame;
+ for( pFrame = SfxViewFrame::GetFirst( xDoc );
pFrame && !pFrame->IsVisible();
- pFrame = (SfxTopViewFrame*)
- SfxViewFrame::GetNext( *pFrame, xDoc, TYPE(SfxTopViewFrame) ) ) ;
+ pFrame = SfxViewFrame::GetNext( *pFrame, xDoc ) ) ;
if ( pFrame )
{
SfxViewFrame *pCur = SfxViewFrame::Current();
@@ -511,65 +509,6 @@ ULONG SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const String &rFil
//--------------------------------------------------------------------
-SfxObjectShellLock SfxApplication::NewDoc_Impl( const String& rFact, const SfxItemSet *pSet )
-{
- SfxObjectShellLock xDoc;
- String aFact( rFact );
- String aPrefix = String::CreateFromAscii( "private:factory/" );
- if ( aPrefix.Len() == aFact.Match( aPrefix ) )
- aFact.Erase( 0, aPrefix.Len() );
- USHORT nPos = aFact.Search( '?' );
- String aParam;
- if ( nPos != STRING_NOTFOUND )
- {
- aParam = aFact.Copy( nPos, aFact.Len() );
- aFact.Erase( nPos, aFact.Len() );
- aParam.Erase(0,1);
- }
-
- xDoc = SfxObjectShell::CreateObjectByFactoryName( aFact );
- aParam = INetURLObject::decode( aParam, '%', INetURLObject::DECODE_WITH_CHARSET );
- if( xDoc.Is() )
- xDoc->DoInitNew_Impl( aParam );
-
- if ( xDoc.Is() )
- {
- if ( pSet )
- {
- // TODO/LATER: Should the other arguments be transfered as well?
- SFX_ITEMSET_ARG( pSet, pDefaultPathItem, SfxStringItem, SID_DEFAULTFILEPATH, FALSE);
- if ( pDefaultPathItem )
- xDoc->GetMedium()->GetItemSet()->Put( *pDefaultPathItem );
- SFX_ITEMSET_ARG( pSet, pDefaultNameItem, SfxStringItem, SID_DEFAULTFILENAME, FALSE);
- if ( pDefaultNameItem )
- xDoc->GetMedium()->GetItemSet()->Put( *pDefaultNameItem );
- SFX_ITEMSET_ARG( pSet, pTitleItem, SfxStringItem, SID_DOCINFO_TITLE, FALSE );
- if ( pTitleItem )
- xDoc->GetMedium()->GetItemSet()->Put( *pTitleItem );
- }
-
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > xModel ( xDoc->GetModel(), ::com::sun::star::uno::UNO_QUERY );
- if ( xModel.is() )
- {
- SfxItemSet* pNew = xDoc->GetMedium()->GetItemSet()->Clone();
- pNew->ClearItem( SID_PROGRESS_STATUSBAR_CONTROL );
- ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aArgs;
- TransformItems( SID_OPENDOC, *pNew, aArgs );
-
- sal_Int32 nLength = aArgs.getLength();
- aArgs.realloc( nLength + 1 );
-
- aArgs[nLength].Name = DEFINE_CONST_UNICODE("Title");
- aArgs[nLength].Value <<= ::rtl::OUString( xDoc->GetTitle( SFX_TITLE_DETECT ) );
-
- xModel->attachResource( ::rtl::OUString(), aArgs );
- delete pNew;
- }
- }
-
- return xDoc;
-}
-
void SfxApplication::NewDocDirectExec_Impl( SfxRequest& rReq )
{
DBG_MEMTEST();
@@ -603,131 +542,6 @@ void SfxApplication::NewDocDirectExec_Impl( SfxRequest& rReq )
rReq.SetReturnValue( SfxFrameItem( 0, pItem->GetFrame() ) );
}
-const SfxPoolItem* SfxApplication::NewDocDirectExec_ImplOld( SfxRequest& rReq )
-{
- DBG_MEMTEST();
-/*
- SFX_REQUEST_ARG(rReq, pHidden, SfxBoolItem, SID_HIDDEN, FALSE);
-//(mba)/task
-
- if ( !pHidden || !pHidden->GetValue() )
- Application::GetAppWindow()->EnterWait();
-*/
- SfxObjectShellLock xDoc;
-
- // Factory-RegNo kann per Parameter angegeben sein
- SfxErrorContext aEc(ERRCTX_SFX_NEWDOCDIRECT);
- rReq.GetArgs(); // -Wall required??
- String aFactory;
- rReq.AppendItem( SfxBoolItem( SID_TEMPLATE, TRUE ) );
- SFX_REQUEST_ARG( rReq, pFactoryName, SfxStringItem, SID_NEWDOCDIRECT, FALSE );
- if( pFactoryName )
- aFactory = pFactoryName->GetValue();
- else
- aFactory = SvtModuleOptions().GetDefaultModuleName();
-
- SFX_REQUEST_ARG( rReq, pFileFlagsItem, SfxStringItem, SID_OPTIONS, FALSE);
- if ( pFileFlagsItem )
- {
- // Werte auf einzelne Items verteilen
- String aFileFlags = pFileFlagsItem->GetValue();
- aFileFlags.ToUpperAscii();
- if ( STRING_NOTFOUND != aFileFlags.Search( 0x0054 ) ) // T = 54h
- rReq.AppendItem( SfxBoolItem( SID_TEMPLATE, TRUE ) );
- if ( STRING_NOTFOUND != aFileFlags.Search( 0x0048 ) ) // H = 48h
- rReq.AppendItem( SfxBoolItem( SID_HIDDEN, TRUE ) );
- if ( STRING_NOTFOUND != aFileFlags.Search( 0x0052 ) ) // R = 52h
- rReq.AppendItem( SfxBoolItem( SID_DOC_READONLY, TRUE ) );
- if ( STRING_NOTFOUND != aFileFlags.Search( 0x0042 ) ) // B = 42h
- rReq.AppendItem( SfxBoolItem( SID_PREVIEW, TRUE ) );
- if ( STRING_NOTFOUND != aFileFlags.Search( 0x0053 ) ) // S = 53h
- rReq.AppendItem( SfxBoolItem( SID_SILENT, TRUE ) );
- }
-
- xDoc = NewDoc_Impl( aFactory, rReq.GetArgs() );
- if ( xDoc.Is() )
- {
- SFX_REQUEST_ARG(rReq, pReadonly, SfxBoolItem, SID_DOC_READONLY, FALSE);
- if ( pReadonly )
- xDoc->GetMedium()->GetItemSet()->Put( *pReadonly );
-
- SFX_REQUEST_ARG(rReq, pPreview, SfxBoolItem, SID_PREVIEW, FALSE);
- if ( pPreview )
- xDoc->GetMedium()->GetItemSet()->Put( *pPreview );
-
- SFX_REQUEST_ARG(rReq, pSilent, SfxBoolItem, SID_SILENT, FALSE);
- if ( pSilent )
- xDoc->GetMedium()->GetItemSet()->Put( *pSilent );
-
- SFX_REQUEST_ARG(rReq, pFlags, SfxStringItem, SID_OPTIONS, FALSE);
- if ( pFlags )
- xDoc->GetMedium()->GetItemSet()->Put( *pFlags );
- }
-
- // View erzeugen
- if ( xDoc.Is() )
- {
- SFX_REQUEST_ARG(rReq, pHidden, SfxBoolItem, SID_HIDDEN, FALSE);
- BOOL bHidden = FALSE;
- if ( pHidden )
- {
- xDoc->GetMedium()->GetItemSet()->Put( *pHidden, SID_HIDDEN );
- bHidden = pHidden->GetValue();
- }
-
- SFX_REQUEST_ARG(rReq, pViewId, SfxUInt16Item, SID_VIEW_ID, FALSE);
- USHORT nViewId = 0;
- if ( pViewId )
- {
- xDoc->GetMedium()->GetItemSet()->Put( *pViewId, SID_VIEW_ID );
- nViewId = pViewId->GetValue();
- }
-
- xDoc->SetActivateEvent_Impl( SFX_EVENT_CREATEDOC );
-// xDoc->Get_Impl()->nLoadedFlags = SFX_LOADED_ALL;
- const SfxItemSet* pInternalArgs = rReq.GetInternalArgs_Impl();
- if( pInternalArgs )
- xDoc->GetMedium()->GetItemSet()->Put( *pInternalArgs );
- SFX_REQUEST_ARG(rReq, pFrameItem, SfxFrameItem, SID_DOCFRAME, FALSE);
-
- SfxFrame* pFrame = NULL;
- if (pFrameItem)
- pFrame = pFrameItem->GetFrame();
- else
- pFrame = (SfxFrame*)SfxTopFrame::Create(xDoc, nViewId, bHidden, pInternalArgs);
- if ( pFrame )
- {
- if ( pFrame->GetCurrentDocument() == xDoc || pFrame->PrepareClose_Impl( TRUE, TRUE ) == TRUE )
- {
- if ( bHidden )
- {
- xDoc->RestoreNoDelete();
- xDoc->OwnerLock( TRUE );
- xDoc->Get_Impl()->bHiddenLockedByAPI = TRUE;
- }
-
- if ( pFrame->GetCurrentDocument() != xDoc )
- {
- if ( pFrame->InsertDocument( xDoc ) )
- rReq.SetReturnValue( SfxFrameItem( 0, pFrame ) );
- else
- xDoc->DoClose();
- }
- }
- else
- xDoc.Clear();
- }
- }
-
- return rReq.GetReturnValue();
-
-//(mba)/task
-/*
- if ( !pHidden || !pHidden->GetValue() )
- Application::GetAppWindow()->LeaveWait();
- */
-}
-
//--------------------------------------------------------------------
void SfxApplication::NewDocExec_Impl( SfxRequest& rReq )
@@ -1303,12 +1117,22 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
return;
}
- SFX_REQUEST_ARG(rReq, pFrmItem, SfxFrameItem, SID_DOCFRAME, FALSE);
- SfxFrame *pFrame = NULL;
- if ( pFrmItem )
- pFrame = pFrmItem->GetFrame();
- else if ( SfxViewFrame::Current() )
- pFrame = SfxViewFrame::Current()->GetFrame();
+ SfxFrame* pTargetFrame = NULL;
+ Reference< XFrame > xTargetFrame;
+
+ SFX_REQUEST_ARG(rReq, pFrameItem, SfxFrameItem, SID_DOCFRAME, FALSE);
+ if ( pFrameItem )
+ pTargetFrame = pFrameItem->GetFrame();
+
+ if ( !pTargetFrame )
+ {
+ SFX_REQUEST_ARG(rReq, pUnoFrameItem, SfxUnoFrameItem, SID_FILLFRAME, FALSE);
+ if ( pUnoFrameItem )
+ xTargetFrame = pUnoFrameItem->GetFrame();
+ }
+
+ if ( !pTargetFrame && !xTargetFrame.is() && SfxViewFrame::Current() )
+ pTargetFrame = &SfxViewFrame::Current()->GetFrame();
// check if caller has set a callback
SFX_REQUEST_ARG(rReq, pLinkItem, SfxLinkItem, SID_DONELINK, FALSE );
@@ -1319,21 +1143,6 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
rReq.RemoveItem( SID_DONELINK );
- // check if caller wants to create a view
- BOOL bCreateView = TRUE;
- SFX_REQUEST_ARG( rReq, pCreateViewItem, SfxBoolItem, SID_VIEW, FALSE );
- if ( pCreateViewItem )
- {
- if ( !pCreateViewItem->GetValue() )
- bCreateView = FALSE;
- // this is an "SFX only" parameter
- rReq.RemoveItem( SID_VIEW );
- }
-
- // we can't load without a view - switch to hidden view
- if ( !bCreateView )
- rReq.AppendItem( SfxBoolItem( SID_HIDDEN, TRUE ) );
-
// check if the view must be hidden
BOOL bHidden = FALSE;
SFX_REQUEST_ARG(rReq, pHidItem, SfxBoolItem, SID_HIDDEN, FALSE);
@@ -1385,18 +1194,24 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
// {
// if a frame is given, it must be used for the starting point of the targetting mechanism
// this code is also used if asynchronous loading is possible, because loadComponent always is synchron
- Reference < XFrame > xFrame;
- if ( pFrame )
- xFrame = pFrame->GetFrameInterface();
- else
- xFrame = Reference < XFrame >( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop")), UNO_QUERY );
+ if ( !xTargetFrame.is() )
+ {
+ if ( pTargetFrame )
+ {
+ xTargetFrame = pTargetFrame->GetFrameInterface();
+ }
+ else
+ {
+ xTargetFrame.set( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop")), UNO_QUERY );
+ }
+ }
// make URL ready
SFX_REQUEST_ARG( rReq, pURLItem, SfxStringItem, SID_FILE_NAME, FALSE );
aFileName = pURLItem->GetValue();
if( aFileName.Len() && aFileName.GetChar(0) == '#' ) // Mark without URL
{
- SfxViewFrame *pView = pFrame ? pFrame->GetCurrentViewFrame() : 0;
+ SfxViewFrame *pView = pTargetFrame ? pTargetFrame->GetCurrentViewFrame() : 0;
if ( !pView )
pView = SfxViewFrame::Current();
pView->GetViewShell()->JumpToMark( aFileName.Copy(1) );
@@ -1414,13 +1229,13 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
// if loading must be done synchron, we must wait for completion to get a return value
// find frame by myself; I must konw the exact frame to get the controller for the return value from it
//if( aTarget.getLength() )
- // xFrame = xFrame->findFrame( aTarget, FrameSearchFlag::ALL );
+ // xTargetFrame = xTargetFrame->findFrame( aTarget, FrameSearchFlag::ALL );
Reference < XComponent > xComp;
try
{
- xComp = ::comphelper::SynchronousDispatch::dispatch( xFrame, aFileName, aTarget, 0, aArgs );
-// Reference < XComponentLoader > xLoader( xFrame, UNO_QUERY );
+ xComp = ::comphelper::SynchronousDispatch::dispatch( xTargetFrame, aFileName, aTarget, 0, aArgs );
+// Reference < XComponentLoader > xLoader( xTargetFrame, UNO_QUERY );
// xComp = xLoader->loadComponentFromURL( aFileName, aTarget, 0, aArgs );
}
catch(const RuntimeException&)
@@ -1445,7 +1260,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" )), UNO_QUERY );
xTrans->parseStrict( aURL );
- Reference < XDispatchProvider > xProv( xFrame, UNO_QUERY );
+ Reference < XDispatchProvider > xProv( xTargetFrame, UNO_QUERY );
Reference < XDispatch > xDisp = xProv.is() ? xProv->queryDispatch( aURL, aTarget, FrameSearchFlag::ALL ) : Reference < XDispatch >();;
RTL_LOGFILE_PRODUCT_CONTEXT( aLog2, "PERFORMANCE - SfxApplication::OpenDocExec_Impl" );
if ( xDisp.is() )
@@ -1491,7 +1306,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
{
if ( pShell->GetController() == xController )
{
- pCntrFrame = pShell->GetViewFrame()->GetFrame();
+ pCntrFrame = &pShell->GetViewFrame()->GetFrame();
break;
}
}
@@ -1501,12 +1316,9 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
SfxObjectShell* pSh = pCntrFrame->GetCurrentDocument();
DBG_ASSERT( pSh, "Controller without ObjectShell ?!" );
- if ( bCreateView )
- rReq.SetReturnValue( SfxViewFrameItem( 0, pCntrFrame->GetCurrentViewFrame() ) );
- else
- rReq.SetReturnValue( SfxObjectItem( 0, pSh ) );
+ rReq.SetReturnValue( SfxViewFrameItem( 0, pCntrFrame->GetCurrentViewFrame() ) );
- if( ( bHidden || !bCreateView ) )
+ if ( bHidden )
pSh->RestoreNoDelete();
}
}
diff --git a/sfx2/source/appl/appquit.cxx b/sfx2/source/appl/appquit.cxx
index edb1cd7e35..7c41c802bb 100644
--- a/sfx2/source/appl/appquit.cxx
+++ b/sfx2/source/appl/appquit.cxx
@@ -116,9 +116,6 @@ BOOL SfxApplication::QueryExit_Impl()
}
}
*/
- // alles canceln was zu canceln ist
- GetCancelManager()->Cancel(TRUE);
-
/*
SfxObjectShell *pLastDocSh = SfxObjectShell::GetFirst();
if ( bQuit )
diff --git a/sfx2/source/appl/appreg.cxx b/sfx2/source/appl/appreg.cxx
index 9052154d37..37ca1f5e5e 100644
--- a/sfx2/source/appl/appreg.cxx
+++ b/sfx2/source/appl/appreg.cxx
@@ -43,7 +43,7 @@
#include "stbitem.hxx"
#include <sfx2/navigat.hxx>
#include <sfx2/module.hxx>
-#include <sfx2/topfrm.hxx>
+#include <sfx2/viewfrm.hxx>
#include "partwnd.hxx"
#include <sfx2/sfxsids.hrc>
#include "recfloat.hxx"
@@ -59,7 +59,6 @@ void SfxApplication::Registrations_Impl()
SfxApplication::RegisterInterface();
SfxModule::RegisterInterface();
SfxViewFrame::RegisterInterface();
- SfxTopViewFrame::RegisterInterface();
SfxObjectShell::RegisterInterface();
SfxViewShell::RegisterInterface();
@@ -73,7 +72,6 @@ void SfxApplication::Registrations_Impl()
// Controller
SfxToolBoxControl::RegisterControl(SID_REPEAT);
SfxURLToolBoxControl_Impl::RegisterControl(SID_OPENURL);
- SfxCancelToolBoxControl_Impl::RegisterControl(SID_BROWSE_STOP);
SfxAppToolBoxControl_Impl::RegisterControl( SID_NEWDOCDIRECT );
SfxAppToolBoxControl_Impl::RegisterControl( SID_AUTOPILOTMENU );
};
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index fde2c03913..c079a5a5f0 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -68,7 +68,6 @@
#include <tools/config.hxx>
#include <tools/diagnose_ex.h>
#include <vcl/msgbox.hxx>
-#include <svl/cancel.hxx>
#include <svl/intitem.hxx>
#include <svl/eitem.hxx>
#include <svl/stritem.hxx>
@@ -93,9 +92,11 @@
#include <cppuhelper/exc_hlp.hxx>
#include <com/sun/star/script/provider/XScriptProviderFactory.hpp>
+#include <com/sun/star/frame/XModuleManager.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include "about.hxx"
+#include "frmload.hxx"
#include "referers.hxx"
#include <sfx2/app.hxx>
#include <sfx2/request.hxx>
@@ -129,7 +130,7 @@
#include "minfitem.hxx"
#include <sfx2/event.hxx>
#include <sfx2/module.hxx>
-#include <sfx2/topfrm.hxx>
+#include <sfx2/viewfrm.hxx>
#include "sfxpicklist.hxx"
#include "imestatuswindow.hxx"
#include <sfx2/sfxdlg.hxx>
@@ -262,9 +263,9 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
Reference< XFrame > xFrame;
const SfxItemSet* pIntSet = rReq.GetInternalArgs_Impl();
- SFX_ITEMSET_ARG( pIntSet, pFrame, SfxUnoAnyItem, SID_FILLFRAME, FALSE );
- if (pFrame)
- pFrame->GetValue() >>= xFrame;
+ SFX_ITEMSET_ARG( pIntSet, pFrameItem, SfxUnoFrameItem, SID_FILLFRAME, FALSE );
+ if ( pFrameItem )
+ xFrame = pFrameItem->GetFrame();
SfxAbstractTabDialog* pDlg = pFact->CreateTabDialog(
RID_SVXDLG_CUSTOMIZE,
@@ -548,8 +549,10 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
case SID_CRASH :
{
- GetpApp()->Exception( EXC_SYSTEM );
- abort();
+ // Provoke a crash:
+ char * crash = 0;
+ *crash = 0;
+ break;
}
case SID_SHOW_IME_STATUS_WINDOW:
@@ -820,6 +823,60 @@ namespace
}
return _pFallback;
}
+
+ const ::rtl::OUString& lcl_getBasicIDEServiceName()
+ {
+ static const ::rtl::OUString s_sBasicName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.script.BasicIDE" ) );
+ return s_sBasicName;
+ }
+
+ SfxViewFrame* lcl_getBasicIDEViewFrame( SfxObjectShell* i_pBasicIDE )
+ {
+ SfxViewFrame* pView = SfxViewFrame::GetFirst( i_pBasicIDE );
+ while ( pView )
+ {
+ if ( pView->GetObjectShell()->GetFactory().GetDocumentServiceName() == lcl_getBasicIDEServiceName() )
+ break;
+ pView = SfxViewFrame::GetNext( *pView, i_pBasicIDE );
+ }
+ return pView;
+ }
+ Reference< XFrame > lcl_findStartModuleFrame( const ::comphelper::ComponentContext& i_rContext )
+ {
+ try
+ {
+ Reference < XFramesSupplier > xSupplier( i_rContext.createComponent( "com.sun.star.frame.Desktop" ), UNO_QUERY_THROW );
+ Reference < XIndexAccess > xContainer( xSupplier->getFrames(), UNO_QUERY_THROW );
+
+ Reference< XModuleManager > xCheck( i_rContext.createComponent( "com.sun.star.frame.ModuleManager" ), UNO_QUERY_THROW );
+
+ sal_Int32 nCount = xContainer->getCount();
+ for ( sal_Int32 i=0; i<nCount; ++i )
+ {
+ try
+ {
+ Reference < XFrame > xFrame( xContainer->getByIndex(i), UNO_QUERY_THROW );
+ ::rtl::OUString sModule = xCheck->identify( xFrame );
+ if ( sModule.equalsAscii( "com.sun.star.frame.StartModule" ) )
+ return xFrame;
+ }
+ catch( const UnknownModuleException& )
+ {
+ // silence
+ }
+ catch(const Exception&)
+ {
+ // re-throw, caught below
+ throw;
+ }
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return NULL;
+ }
}
void SfxApplication::OfaExec_Impl( SfxRequest& rReq )
@@ -837,7 +894,10 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq )
const SfxPoolItem* pItem = NULL;
Reference < XFrame > xFrame;
if ( pArgs && pArgs->GetItemState( SID_FILLFRAME, sal_False, &pItem ) == SFX_ITEM_SET )
- ( (SfxUnoAnyItem*)pItem )->GetValue() >>= xFrame;
+ {
+ OSL_ENSURE( pItem->ISA( SfxUnoFrameItem ), "SfxApplication::OfaExec_Impl: XFrames are to be transported via SfxUnoFrameItem by now!" );
+ xFrame = static_cast< const SfxUnoFrameItem*>( pItem )->GetFrame();
+ }
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
if ( pFact )
{
@@ -900,26 +960,46 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq )
case SID_BASICIDE_APPEAR:
{
- SfxViewFrame* pView = SfxViewFrame::GetFirst();
- ::rtl::OUString aBasicName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.script.BasicIDE" ) );
- while ( pView )
- {
- if ( pView->GetObjectShell()->GetFactory().GetDocumentServiceName() == aBasicName )
- break;
- pView = SfxViewFrame::GetNext( *pView );
- }
-
+ SfxViewFrame* pView = lcl_getBasicIDEViewFrame( NULL );
if ( !pView )
{
- SfxObjectShell* pDocShell = SfxObjectShell::CreateObject( aBasicName );
- pDocShell->DoInitNew( 0 );
- pDocShell->SetModified( FALSE );
- pView = SfxViewFrame::CreateViewFrame( *pDocShell, 0 );
- pView->SetName( String( RTL_CONSTASCII_USTRINGPARAM( "BASIC:1" ) ) );
+ SfxObjectShell* pBasicIDE = SfxObjectShell::CreateObject( lcl_getBasicIDEServiceName() );
+ pBasicIDE->DoInitNew( 0 );
+ pBasicIDE->SetModified( FALSE );
+ try
+ {
+ // load the Basic IDE via direct access to the SFX frame loader. A generic loadComponentFromURL
+ // (which could be done via SfxViewFrame::LoadDocumentIntoFrame) is not feasible here, since the Basic IDE
+ // does not really play nice with the framework's concept. For instance, it is a "singleton document",
+ // which conflicts, at the latest, with the framework's concept of loading into _blank frames.
+ // So, since we know that our frame loader can handle it, we skip the generic framework loader
+ // mechanism, and the type detection (which doesn't know about the Basic IDE).
+ ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
+ Reference< XSynchronousFrameLoader > xLoader( aContext.createComponent(
+ SfxFrameLoader_Impl::impl_getStaticImplementationName() ), UNO_QUERY_THROW );
+ ::comphelper::NamedValueCollection aLoadArgs;
+ aLoadArgs.put( "Model", pBasicIDE->GetModel() );
+ aLoadArgs.put( "URL", ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:factory/sbasic" ) ) );
+
+ Reference< XFrame > xTargetFrame( lcl_findStartModuleFrame( aContext ) );
+ if ( !xTargetFrame.is() )
+ xTargetFrame = SfxFrame::CreateBlankFrame();
+ ENSURE_OR_THROW( xTargetFrame.is(), "could not obtain a frameto load the Basic IDE into!" );
+
+ xLoader->load( aLoadArgs.getPropertyValues(), xTargetFrame );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+
+ pView = lcl_getBasicIDEViewFrame( pBasicIDE );
+ if ( pView )
+ pView->SetName( String( RTL_CONSTASCII_USTRINGPARAM( "BASIC:1" ) ) );
}
if ( pView )
- pView->GetFrame()->Appear();
+ pView->GetFrame().Appear();
const SfxItemSet* pArgs = rReq.GetArgs();
if ( pArgs && pView )
@@ -986,16 +1066,15 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq )
Reference< XFrame > xFrame;
const SfxItemSet* pIntSet = rReq.GetInternalArgs_Impl();
- SFX_ITEMSET_ARG( pIntSet, pFrameItem, SfxUnoAnyItem, SID_FILLFRAME, FALSE );
+ SFX_ITEMSET_ARG( pIntSet, pFrameItem, SfxUnoFrameItem, SID_FILLFRAME, FALSE );
if ( pFrameItem )
- pFrameItem->GetValue() >>= xFrame;
+ xFrame = pFrameItem->GetFrame();
if ( !xFrame.is() )
{
const SfxViewFrame* pViewFrame = SfxViewFrame::Current();
- const SfxFrame* pFrame = pViewFrame ? pViewFrame->GetFrame() : NULL;
- if ( pFrame )
- xFrame = pFrame->GetFrameInterface();
+ if ( pViewFrame )
+ xFrame = pViewFrame->GetFrame().GetFrameInterface();
}
do // artificial loop for flow control
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index 37d05ea997..f08cd7d546 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -144,54 +144,53 @@ using namespace ::com::sun::star::io;
#define FRAMELOADER_SERVICENAME "com.sun.star.frame.FrameLoader"
#define PROTOCOLHANDLER_SERVICENAME "com.sun.star.frame.ProtocolHandler"
-static const String sTemplateRegionName = String::CreateFromAscii( "TemplateRegionName" );
-static const String sTemplateName = String::CreateFromAscii( "TemplateName" );
-static const String sAsTemplate = String::CreateFromAscii( "AsTemplate" );
-static const String sOpenNewView = String::CreateFromAscii( "OpenNewView" );
-static const String sViewId = String::CreateFromAscii( "ViewId" );
-static const String sPluginMode = String::CreateFromAscii( "PluginMode" );
-static const String sReadOnly = String::CreateFromAscii( "ReadOnly" );
-static const String sStartPresentation = String::CreateFromAscii( "StartPresentation" );
-static const String sFrameName = String::CreateFromAscii( "FrameName" );
-static const String sMediaType = String::CreateFromAscii( "MediaType" );
-static const String sPostData = String::CreateFromAscii( "PostData" );
-static const String sCharacterSet = String::CreateFromAscii( "CharacterSet" );
-static const String sInputStream = String::CreateFromAscii( "InputStream" );
-static const String sStream = String::CreateFromAscii( "Stream" );
-static const String sOutputStream = String::CreateFromAscii( "OutputStream" );
-static const String sHidden = String::CreateFromAscii( "Hidden" );
-static const String sPreview = String::CreateFromAscii( "Preview" );
-static const String sViewOnly = String::CreateFromAscii( "ViewOnly" );
-static const String sDontEdit = String::CreateFromAscii( "DontEdit" );
-static const String sSilent = String::CreateFromAscii( "Silent" );
-static const String sJumpMark = String::CreateFromAscii( "JumpMark" );
-static const String sFileName = String::CreateFromAscii( "FileName" );
-static const String sSalvageURL = String::CreateFromAscii( "SalvagedFile" );
-static const String sStatusInd = String::CreateFromAscii( "StatusIndicator" );
-static const String sModel = String::CreateFromAscii( "Model" );
-static const String sFrame = String::CreateFromAscii( "Frame" );
-static const String sViewData = String::CreateFromAscii( "ViewData" );
-static const String sFilterData = String::CreateFromAscii( "FilterData" );
-static const String sSelectionOnly = String::CreateFromAscii( "SelectionOnly" );
-static const String sFilterFlags = String::CreateFromAscii( "FilterFlags" );
-static const String sMacroExecMode = String::CreateFromAscii( "MacroExecutionMode" );
-static const String sUpdateDocMode = String::CreateFromAscii( "UpdateDocMode" );
-static const String sMinimized = String::CreateFromAscii( "Minimized" );
-static const String sInteractionHdl = String::CreateFromAscii( "InteractionHandler" );
-static const String sWindowState = String::CreateFromAscii( "WindowState" );
-static const String sUCBContent = String::CreateFromAscii( "UCBContent" );
-static const String sRepairPackage = String::CreateFromAscii( "RepairPackage" );
-static const String sDocumentTitle = String::CreateFromAscii( "DocumentTitle" );
-static const String sComponentData = String::CreateFromAscii( "ComponentData" );
-static const String sComponentContext = String::CreateFromAscii( "ComponentContext" );
-static const String sDocumentBaseURL = String::CreateFromAscii( "DocumentBaseURL" );
-static const String sHierarchicalDocumentName = String::CreateFromAscii( "HierarchicalDocumentName" );
-static const String sCopyStreamIfPossible = String::CreateFromAscii( "CopyStreamIfPossible" );
-static const String sNoAutoSave = String::CreateFromAscii( "NoAutoSave" );
-static const String sFolderName = String::CreateFromAscii( "FolderName" );
-static const String sUseSystemDialog = String::CreateFromAscii( "UseSystemDialog" );
-static const String sStandardDir = String::CreateFromAscii( "StandardDir" );
-static const String sBlackList = String::CreateFromAscii( "BlackList" );
+static char const sTemplateRegionName[] = "TemplateRegionName";
+static char const sTemplateName[] = "TemplateName";
+static char const sAsTemplate[] = "AsTemplate";
+static char const sOpenNewView[] = "OpenNewView";
+static char const sViewId[] = "ViewId";
+static char const sPluginMode[] = "PluginMode";
+static char const sReadOnly[] = "ReadOnly";
+static char const sStartPresentation[] = "StartPresentation";
+static char const sFrameName[] = "FrameName";
+static char const sMediaType[] = "MediaType";
+static char const sPostData[] = "PostData";
+static char const sCharacterSet[] = "CharacterSet";
+static char const sInputStream[] = "InputStream";
+static char const sStream[] = "Stream";
+static char const sOutputStream[] = "OutputStream";
+static char const sHidden[] = "Hidden";
+static char const sPreview[] = "Preview";
+static char const sViewOnly[] = "ViewOnly";
+static char const sDontEdit[] = "DontEdit";
+static char const sSilent[] = "Silent";
+static char const sJumpMark[] = "JumpMark";
+static char const sFileName[] = "FileName";
+static char const sSalvageURL[] = "SalvagedFile";
+static char const sStatusInd[] = "StatusIndicator";
+static char const sModel[] = "Model";
+static char const sFrame[] = "Frame";
+static char const sViewData[] = "ViewData";
+static char const sFilterData[] = "FilterData";
+static char const sSelectionOnly[] = "SelectionOnly";
+static char const sFilterFlags[] = "FilterFlags";
+static char const sMacroExecMode[] = "MacroExecutionMode";
+static char const sUpdateDocMode[] = "UpdateDocMode";
+static char const sMinimized[] = "Minimized";
+static char const sInteractionHdl[] = "InteractionHandler";
+static char const sUCBContent[] = "UCBContent";
+static char const sRepairPackage[] = "RepairPackage";
+static char const sDocumentTitle[] = "DocumentTitle";
+static char const sComponentData[] = "ComponentData";
+static char const sComponentContext[] = "ComponentContext";
+static char const sDocumentBaseURL[] = "DocumentBaseURL";
+static char const sHierarchicalDocumentName[] = "HierarchicalDocumentName";
+static char const sCopyStreamIfPossible[] = "CopyStreamIfPossible";
+static char const sNoAutoSave[] = "NoAutoSave";
+static char const sFolderName[] = "FolderName";
+static char const sUseSystemDialog[] = "UseSystemDialog";
+static char const sStandardDir[] = "StandardDir";
+static char const sBlackList[] = "BlackList";
void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& rArgs, SfxAllItemSet& rSet, const SfxSlot* pSlot )
{
@@ -466,11 +465,15 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
for ( sal_uInt16 n=0; n<nCount; n++ )
{
const ::com::sun::star::beans::PropertyValue& rProp = pPropsVal[n];
- String aName = rProp.Name;
- if ( aName == sFrame )
- rSet.Put( SfxUnoAnyItem( SID_FILLFRAME, rProp.Value ) );
+ rtl::OUString aName = rProp.Name;
+ if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sFrame)) )
+ {
+ Reference< XFrame > xFrame;
+ OSL_VERIFY( rProp.Value >>= xFrame );
+ rSet.Put( SfxUnoFrameItem( SID_FILLFRAME, xFrame ) );
+ }
else
- if ( aName == sHidden )
+ if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sHidden)) )
{
sal_Bool bVal = sal_False;
if (rProp.Value >>= bVal)
@@ -487,18 +490,18 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
++nFoundArgs;
#endif
const ::com::sun::star::beans::PropertyValue& rProp = pPropsVal[n];
- String aName = rProp.Name;
- if ( aName == sModel )
+ rtl::OUString aName = rProp.Name;
+ if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sModel)) )
rSet.Put( SfxUnoAnyItem( SID_DOCUMENT, rProp.Value ) );
- else if ( aName == sComponentData )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sComponentData)) )
{
rSet.Put( SfxUnoAnyItem( SID_COMPONENTDATA, rProp.Value ) );
}
- else if ( aName == sComponentContext )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sComponentContext)) )
{
rSet.Put( SfxUnoAnyItem( SID_COMPONENTCONTEXT, rProp.Value ) );
}
- else if ( aName == sStatusInd )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sStatusInd)) )
{
Reference< ::com::sun::star::task::XStatusIndicator > xVal;
sal_Bool bOK = ((rProp.Value >>= xVal) && xVal.is());
@@ -506,7 +509,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxUnoAnyItem( SID_PROGRESS_STATUSBAR_CONTROL, rProp.Value ) );
}
- else if ( aName == sInteractionHdl )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sInteractionHdl)) )
{
Reference< ::com::sun::star::task::XInteractionHandler > xVal;
sal_Bool bOK = ((rProp.Value >>= xVal) && xVal.is());
@@ -514,11 +517,11 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxUnoAnyItem( SID_INTERACTIONHANDLER, rProp.Value ) );
}
- else if ( aName == sViewData )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sViewData)) )
rSet.Put( SfxUnoAnyItem( SID_VIEW_DATA, rProp.Value ) );
- else if ( aName == sFilterData )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sFilterData)) )
rSet.Put( SfxUnoAnyItem( SID_FILTER_DATA, rProp.Value ) );
- else if ( aName == sInputStream )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sInputStream)) )
{
Reference< XInputStream > xVal;
sal_Bool bOK = ((rProp.Value >>= xVal) && xVal.is());
@@ -526,7 +529,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxUnoAnyItem( SID_INPUTSTREAM, rProp.Value ) );
}
- else if ( aName == sStream )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sStream)) )
{
Reference< XInputStream > xVal;
sal_Bool bOK = ((rProp.Value >>= xVal) && xVal.is());
@@ -534,7 +537,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxUnoAnyItem( SID_STREAM, rProp.Value ) );
}
- else if ( aName == sUCBContent )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sUCBContent)) )
{
Reference< XContent > xVal;
sal_Bool bOK = ((rProp.Value >>= xVal) && xVal.is());
@@ -542,7 +545,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxUnoAnyItem( SID_CONTENT, rProp.Value ) );
}
- else if ( aName == sOutputStream )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sOutputStream)) )
{
Reference< XOutputStream > xVal;
sal_Bool bOK = ((rProp.Value >>= xVal) && xVal.is());
@@ -550,7 +553,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxUnoAnyItem( SID_OUTPUTSTREAM, rProp.Value ) );
}
- else if ( aName == sPostData )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sPostData)) )
{
Reference< XInputStream > xVal;
sal_Bool bOK = (rProp.Value >>= xVal);
@@ -558,15 +561,15 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxUnoAnyItem( SID_POSTDATA, rProp.Value ) );
}
- else if ( aName == sFrame )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sFrame)) )
{
- Reference< XFrame > xVal;
- sal_Bool bOK = (rProp.Value >>= xVal);
+ Reference< XFrame > xFrame;
+ sal_Bool bOK = (rProp.Value >>= xFrame);
DBG_ASSERT( bOK, "invalid type for Frame" );
if (bOK)
- rSet.Put( SfxUnoAnyItem( SID_FILLFRAME, rProp.Value ) );
+ rSet.Put( SfxUnoFrameItem( SID_FILLFRAME, xFrame ) );
}
- else if ( aName == sAsTemplate )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sAsTemplate)) )
{
sal_Bool bVal = sal_False;
sal_Bool bOK = (rProp.Value >>= bVal);
@@ -574,7 +577,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxBoolItem( SID_TEMPLATE, bVal ) );
}
- else if ( aName == sOpenNewView )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sOpenNewView)) )
{
sal_Bool bVal = sal_False;
sal_Bool bOK = (rProp.Value >>= bVal);
@@ -582,7 +585,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxBoolItem( SID_OPEN_NEW_VIEW, bVal ) );
}
- else if ( aName == sViewId )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sViewId)) )
{
sal_Int16 nVal = -1;
sal_Bool bOK = ((rProp.Value >>= nVal) && (nVal != -1));
@@ -590,7 +593,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxUInt16Item( SID_VIEW_ID, nVal ) );
}
- else if ( aName == sPluginMode )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sPluginMode)) )
{
sal_Int16 nVal = -1;
sal_Bool bOK = ((rProp.Value >>= nVal) && (nVal != -1));
@@ -598,7 +601,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxUInt16Item( SID_PLUGIN_MODE, nVal ) );
}
- else if ( aName == sReadOnly )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sReadOnly)) )
{
sal_Bool bVal = sal_False;
sal_Bool bOK = (rProp.Value >>= bVal);
@@ -606,7 +609,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxBoolItem( SID_DOC_READONLY, bVal ) );
}
- else if ( aName == sStartPresentation )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sStartPresentation)) )
{
sal_Bool bVal = sal_False;
sal_Bool bOK = (rProp.Value >>= bVal);
@@ -614,7 +617,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxBoolItem( SID_DOC_STARTPRESENTATION, bVal ) );
}
- else if ( aName == sSelectionOnly )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sSelectionOnly)) )
{
sal_Bool bVal = sal_False;
sal_Bool bOK = (rProp.Value >>= bVal);
@@ -622,7 +625,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxBoolItem( SID_SELECTION, bVal ) );
}
- else if ( aName == sHidden )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sHidden)) )
{
sal_Bool bVal = sal_False;
sal_Bool bOK = (rProp.Value >>= bVal);
@@ -630,7 +633,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxBoolItem( SID_HIDDEN, bVal ) );
}
- else if ( aName == sMinimized )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sMinimized)) )
{
sal_Bool bVal = sal_False;
sal_Bool bOK = (rProp.Value >>= bVal);
@@ -638,7 +641,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxBoolItem( SID_MINIMIZED, bVal ) );
}
- else if ( aName == sSilent )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sSilent)) )
{
sal_Bool bVal = sal_False;
sal_Bool bOK = (rProp.Value >>= bVal);
@@ -646,7 +649,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxBoolItem( SID_SILENT, bVal ) );
}
- else if ( aName == sPreview )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sPreview)) )
{
sal_Bool bVal = sal_False;
sal_Bool bOK = (rProp.Value >>= bVal);
@@ -654,7 +657,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxBoolItem( SID_PREVIEW, bVal ) );
}
- else if ( aName == sViewOnly )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sViewOnly)) )
{
sal_Bool bVal = sal_False;
sal_Bool bOK = (rProp.Value >>= bVal);
@@ -662,7 +665,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxBoolItem( SID_VIEWONLY, bVal ) );
}
- else if ( aName == sDontEdit )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sDontEdit)) )
{
sal_Bool bVal = sal_False;
sal_Bool bOK = (rProp.Value >>= bVal);
@@ -670,7 +673,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxBoolItem( SID_EDITDOC, !bVal ) );
}
- else if ( aName == sUseSystemDialog )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sUseSystemDialog)) )
{
sal_Bool bVal = sal_False;
sal_Bool bOK = (rProp.Value >>= bVal);
@@ -678,7 +681,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxBoolItem( SID_FILE_DIALOG, bVal ) );
}
- else if ( aName == sStandardDir )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sStandardDir)) )
{
::rtl::OUString sVal;
sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength());
@@ -686,7 +689,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxStringItem( SID_STANDARD_DIR, sVal ) );
}
- else if ( aName == sBlackList )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sBlackList)) )
{
::com::sun::star::uno::Sequence< ::rtl::OUString > xVal;
sal_Bool bOK = (rProp.Value >>= xVal);
@@ -698,7 +701,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
rSet.Put( stringList );
}
}
- else if ( aName == sFileName )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sFileName)) )
{
::rtl::OUString sVal;
sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength());
@@ -706,7 +709,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxStringItem( SID_FILE_NAME, sVal ) );
}
- else if ( aName == sSalvageURL )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sSalvageURL)) )
{
::rtl::OUString sVal;
sal_Bool bOK = (rProp.Value >>= sVal);
@@ -714,7 +717,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxStringItem( SID_DOC_SALVAGE, sVal ) );
}
- else if ( aName == sFolderName )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sFolderName)) )
{
::rtl::OUString sVal;
sal_Bool bOK = (rProp.Value >>= sVal);
@@ -722,7 +725,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxStringItem( SID_PATH, sVal ) );
}
- else if ( aName == sFrameName )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sFrameName)) )
{
::rtl::OUString sVal;
sal_Bool bOK = (rProp.Value >>= sVal);
@@ -730,7 +733,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK && sVal.getLength())
rSet.Put( SfxStringItem( SID_TARGETNAME, sVal ) );
}
- else if ( aName == sMediaType )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sMediaType)) )
{
::rtl::OUString sVal;
sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength());
@@ -738,15 +741,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxStringItem( SID_CONTENTTYPE, sVal ) );
}
- else if ( aName == sWindowState )
- {
- ::rtl::OUString sVal;
- sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength());
- DBG_ASSERT( bOK, "invalid type or value for WindowState" );
- if (bOK)
- rSet.Put( SfxStringItem( SID_WIN_POSSIZE, sVal ) );
- }
- else if ( aName == sTemplateName )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sTemplateName)) )
{
::rtl::OUString sVal;
sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength());
@@ -754,7 +749,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxStringItem( SID_TEMPLATE_NAME, sVal ) );
}
- else if ( aName == sTemplateRegionName )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sTemplateRegionName)) )
{
::rtl::OUString sVal;
sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength());
@@ -762,7 +757,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxStringItem( SID_TEMPLATE_REGIONNAME, sVal ) );
}
- else if ( aName == sJumpMark )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sJumpMark)) )
{
::rtl::OUString sVal;
sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength());
@@ -770,7 +765,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxStringItem( SID_JUMPMARK, sVal ) );
}
- else if ( aName == sCharacterSet )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sCharacterSet)) )
{
::rtl::OUString sVal;
sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength());
@@ -778,7 +773,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxStringItem( SID_CHARSET, sVal ) );
}
- else if ( aName == sFilterFlags )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sFilterFlags)) )
{
::rtl::OUString sVal;
sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength());
@@ -786,7 +781,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxStringItem( SID_FILE_FILTEROPTIONS, sVal ) );
}
- else if ( aName == sMacroExecMode )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sMacroExecMode)) )
{
sal_Int16 nVal =-1;
sal_Bool bOK = ((rProp.Value >>= nVal) && (nVal != -1));
@@ -794,7 +789,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxUInt16Item( SID_MACROEXECMODE, nVal ) );
}
- else if ( aName == sUpdateDocMode )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sUpdateDocMode)) )
{
sal_Int16 nVal =-1;
sal_Bool bOK = ((rProp.Value >>= nVal) && (nVal != -1));
@@ -802,7 +797,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxUInt16Item( SID_UPDATEDOCMODE, nVal ) );
}
- else if ( aName == sRepairPackage )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sRepairPackage)) )
{
sal_Bool bVal = sal_False;
sal_Bool bOK = (rProp.Value >>= bVal);
@@ -810,7 +805,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxBoolItem( SID_REPAIRPACKAGE, bVal ) );
}
- else if ( aName == sDocumentTitle )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sDocumentTitle)) )
{
::rtl::OUString sVal;
sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength());
@@ -818,7 +813,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxStringItem( SID_DOCINFO_TITLE, sVal ) );
}
- else if ( aName == sDocumentBaseURL )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sDocumentBaseURL)) )
{
::rtl::OUString sVal;
// the base url can be set to empty ( for embedded objects for example )
@@ -827,7 +822,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxStringItem( SID_DOC_BASEURL, sVal ) );
}
- else if ( aName == sHierarchicalDocumentName )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sHierarchicalDocumentName)) )
{
::rtl::OUString sVal;
sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength());
@@ -835,7 +830,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxStringItem( SID_DOC_HIERARCHICALNAME, sVal ) );
}
- else if ( aName == sCopyStreamIfPossible )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sCopyStreamIfPossible)) )
{
sal_Bool bVal = sal_False;
sal_Bool bOK = (rProp.Value >>= bVal);
@@ -843,7 +838,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque
if (bOK)
rSet.Put( SfxBoolItem( SID_COPY_STREAM_IF_POSSIBLE, bVal ) );
}
- else if ( aName == sNoAutoSave )
+ else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sNoAutoSave)) )
{
sal_Bool bVal = sal_False;
sal_Bool bOK = (rProp.Value >>= bVal);
@@ -1015,10 +1010,6 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta
nAdditional++;
if ( rSet.GetItemState( SID_CONTENTTYPE ) == SFX_ITEM_SET )
nAdditional++;
- if ( rSet.GetItemState( SID_WIN_POSSIZE ) == SFX_ITEM_SET )
- nAdditional++;
- // if ( rSet.GetItemState( SID_VIEW_POS_SIZE ) == SFX_ITEM_SET )
- // nAdditional++;
if ( rSet.GetItemState( SID_POSTDATA ) == SFX_ITEM_SET )
nAdditional++;
if ( rSet.GetItemState( SID_FILLFRAME ) == SFX_ITEM_SET )
@@ -1174,8 +1165,6 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta
continue;
if ( nId == SID_CONTENTTYPE )
continue;
- if ( nId == SID_WIN_POSSIZE )
- continue;
if ( nId == SID_TEMPLATE_NAME )
continue;
if ( nId == SID_TEMPLATE_REGIONNAME )
@@ -1331,147 +1320,155 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta
const SfxPoolItem *pItem=0;
if ( rSet.GetItemState( SID_COMPONENTDATA, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sComponentData;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sComponentData));
pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
}
if ( rSet.GetItemState( SID_COMPONENTCONTEXT, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sComponentContext;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sComponentContext));
pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
}
if ( rSet.GetItemState( SID_PROGRESS_STATUSBAR_CONTROL, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sStatusInd;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sStatusInd));
pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
}
if ( rSet.GetItemState( SID_INTERACTIONHANDLER, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sInteractionHdl;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sInteractionHdl));
pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
}
if ( rSet.GetItemState( SID_VIEW_DATA, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sViewData;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sViewData));
pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
}
if ( rSet.GetItemState( SID_FILTER_DATA, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sFilterData;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sFilterData));
pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
}
if ( rSet.GetItemState( SID_DOCUMENT, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sModel;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sModel));
pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
}
if ( rSet.GetItemState( SID_CONTENT, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sUCBContent;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sUCBContent));
pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
}
if ( rSet.GetItemState( SID_INPUTSTREAM, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sInputStream;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sInputStream));
pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
}
if ( rSet.GetItemState( SID_STREAM, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sStream;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sStream));
pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
}
if ( rSet.GetItemState( SID_OUTPUTSTREAM, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sOutputStream;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sOutputStream));
pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
}
if ( rSet.GetItemState( SID_POSTDATA, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sPostData;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sPostData));
pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
}
if ( rSet.GetItemState( SID_FILLFRAME, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sFrame;
- pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sFrame));
+ if ( pItem->ISA( SfxUsrAnyItem ) )
+ {
+ OSL_ENSURE( false, "TransformItems: transporting an XFrame via an SfxUsrAnyItem is not deprecated!" );
+ pValue[nActProp++].Value = static_cast< const SfxUsrAnyItem* >( pItem )->GetValue();
+ }
+ else if ( pItem->ISA( SfxUnoFrameItem ) )
+ pValue[nActProp++].Value <<= static_cast< const SfxUnoFrameItem* >( pItem )->GetFrame();
+ else
+ OSL_ENSURE( false, "TransformItems: invalid item type for SID_FILLFRAME!" );
}
if ( rSet.GetItemState( SID_TEMPLATE, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sAsTemplate;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sAsTemplate));
pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
}
if ( rSet.GetItemState( SID_OPEN_NEW_VIEW, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sOpenNewView;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sOpenNewView));
pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
}
if ( rSet.GetItemState( SID_VIEW_ID, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sViewId;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sViewId));
pValue[nActProp++].Value <<= ( (sal_Int16) ((SfxUInt16Item*)pItem)->GetValue() );
}
if ( rSet.GetItemState( SID_PLUGIN_MODE, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sPluginMode;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sPluginMode));
pValue[nActProp++].Value <<= ( (sal_Int16) ((SfxUInt16Item*)pItem)->GetValue() );
}
if ( rSet.GetItemState( SID_DOC_READONLY, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sReadOnly;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sReadOnly));
pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
}
if ( rSet.GetItemState( SID_DOC_STARTPRESENTATION, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sStartPresentation;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sStartPresentation));
pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
}
if ( rSet.GetItemState( SID_SELECTION, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sSelectionOnly;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sSelectionOnly));
pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
}
if ( rSet.GetItemState( SID_HIDDEN, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sHidden;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sHidden));
pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
}
if ( rSet.GetItemState( SID_MINIMIZED, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sMinimized;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sMinimized));
pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
}
if ( rSet.GetItemState( SID_SILENT, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sSilent;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sSilent));
pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
}
if ( rSet.GetItemState( SID_PREVIEW, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sPreview;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sPreview));
pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
}
if ( rSet.GetItemState( SID_VIEWONLY, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sViewOnly;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sViewOnly));
pValue[nActProp++].Value <<= (sal_Bool) (( ((SfxBoolItem*)pItem)->GetValue() ));
}
if ( rSet.GetItemState( SID_EDITDOC, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sDontEdit;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sDontEdit));
pValue[nActProp++].Value <<= (sal_Bool) (!( ((SfxBoolItem*)pItem)->GetValue() ));
}
if ( rSet.GetItemState( SID_FILE_DIALOG, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sUseSystemDialog;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sUseSystemDialog));
pValue[nActProp++].Value <<= (sal_Bool) ( ((SfxBoolItem*)pItem)->GetValue() );
}
if ( rSet.GetItemState( SID_STANDARD_DIR, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sStandardDir;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sStandardDir));
pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) );
}
if ( rSet.GetItemState( SID_BLACK_LIST, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sBlackList;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sBlackList));
com::sun::star::uno::Sequence< rtl::OUString > aList;
((SfxStringListItem*)pItem)->GetStringList( aList );
@@ -1479,94 +1476,83 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::sta
}
if ( rSet.GetItemState( SID_TARGETNAME, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sFrameName;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sFrameName));
pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) );
}
if ( rSet.GetItemState( SID_DOC_SALVAGE, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sSalvageURL;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sSalvageURL));
pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) );
}
if ( rSet.GetItemState( SID_PATH, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sFolderName;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sFolderName));
pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) );
}
if ( rSet.GetItemState( SID_CONTENTTYPE, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sMediaType;
- pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) );
- }
- if ( rSet.GetItemState( SID_WIN_POSSIZE, sal_False, &pItem ) == SFX_ITEM_SET )
- {
- pValue[nActProp].Name = sWindowState;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sMediaType));
pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) );
}
if ( rSet.GetItemState( SID_TEMPLATE_NAME, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sTemplateName;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sTemplateName));
pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) );
}
if ( rSet.GetItemState( SID_TEMPLATE_REGIONNAME, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sTemplateRegionName;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sTemplateRegionName));
pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) );
}
if ( rSet.GetItemState( SID_JUMPMARK, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sJumpMark;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sJumpMark));
pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) );
}
- SFX_ITEMSET_ARG( &rSet, pRectItem, SfxRectangleItem, SID_VIEW_POS_SIZE, sal_False );
- if ( pRectItem )
- {
- DBG_ERROR("PosSizeItem not supported yet!");
- }
-
if ( rSet.GetItemState( SID_CHARSET, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sCharacterSet;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sCharacterSet));
pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) );
}
if ( rSet.GetItemState( SID_MACROEXECMODE, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sMacroExecMode;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sMacroExecMode));
pValue[nActProp++].Value <<= ( (sal_Int16) ((SfxUInt16Item*)pItem)->GetValue() );
}
if ( rSet.GetItemState( SID_UPDATEDOCMODE, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sUpdateDocMode;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sUpdateDocMode));
pValue[nActProp++].Value <<= ( (sal_Int16) ((SfxUInt16Item*)pItem)->GetValue() );
}
if ( rSet.GetItemState( SID_REPAIRPACKAGE, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sRepairPackage;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sRepairPackage));
pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
}
if ( rSet.GetItemState( SID_DOCINFO_TITLE, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sDocumentTitle;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sDocumentTitle));
pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) );
}
if ( rSet.GetItemState( SID_DOC_BASEURL, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sDocumentBaseURL;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sDocumentBaseURL));
pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) );
}
if ( rSet.GetItemState( SID_DOC_HIERARCHICALNAME, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sHierarchicalDocumentName;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sHierarchicalDocumentName));
pValue[nActProp++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) );
}
if ( rSet.GetItemState( SID_COPY_STREAM_IF_POSSIBLE, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sCopyStreamIfPossible;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sCopyStreamIfPossible));
pValue[nActProp++].Value = ( ((SfxUnoAnyItem*)pItem)->GetValue() );
}
if ( rSet.GetItemState( SID_NOAUTOSAVE, sal_False, &pItem ) == SFX_ITEM_SET )
{
- pValue[nActProp].Name = sNoAutoSave;
+ pValue[nActProp].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(sNoAutoSave));
pValue[nActProp++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
}
diff --git a/sfx2/source/appl/fileobj.cxx b/sfx2/source/appl/fileobj.cxx
index c7d7df6558..158fbb3365 100644
--- a/sfx2/source/appl/fileobj.cxx
+++ b/sfx2/source/appl/fileobj.cxx
@@ -291,8 +291,6 @@ BOOL SvFileObject::LoadFile_Impl()
aStreamToLoadFrom.m_xInputStreamToLoadFrom,
aStreamToLoadFrom.m_bIsReadOnly);
// setStreamToLoadFrom(0,0);
- // Keinen Eintrag im Roter Button Menu
- xMed->SetDontCreateCancellable();
if( sReferer.Len() )
xMed->SetReferer( sReferer );
@@ -682,9 +680,6 @@ BOOL SvFileObject::IsDataComplete() const
void SvFileObject::CancelTransfers()
{
- if( xMed.Is() )
- xMed->CancelTransfers();
-
// und aus dem Cache austragen, wenn man mitten im Laden ist
if( !bDataReady )
{
@@ -696,11 +691,6 @@ void SvFileObject::CancelTransfers()
}
-void SvFileObject::SetTransferPriority( USHORT )
-{
-}
-
-
void SvFileObject::SendStateChg_Impl( sfx2::LinkManager::LinkState nState )
{
if( !bStateChangeCalled && HasDataLinks() )
diff --git a/sfx2/source/appl/fileobj.hxx b/sfx2/source/appl/fileobj.hxx
index cdc59b784f..98fa3ae622 100644
--- a/sfx2/source/appl/fileobj.hxx
+++ b/sfx2/source/appl/fileobj.hxx
@@ -88,7 +88,6 @@ public:
virtual BOOL IsDataComplete() const;
void CancelTransfers();
- void SetTransferPriority( USHORT nPrio );
};
diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx
index 4511e428e5..76536378ad 100644
--- a/sfx2/source/appl/linkmgr2.cxx
+++ b/sfx2/source/appl/linkmgr2.cxx
@@ -430,16 +430,6 @@ void LinkManager::CancelTransfers()
pFileObj->CancelTransfers();
}
-void LinkManager::SetTransferPriority( sfx2::SvBaseLink& /*rLink*/, USHORT /*nPrio*/ )
-{
-// SvFileObject* pFileObj =
-// (SvFileObject*)SvFileObject::ClassFactory()->
-// CastAndAddRef( rLink.GetObj() );
-// OBJECT_CLIENT_FILE == (OBJECT_CLIENT_FILE & rLink.GetObjType()) ?
-// (SvFileObject*)rLink.GetObj() : 0;
-}
-
-
// um Status Informationen aus dem FileObject an den BaseLink zu
// senden, gibt es eine eigene ClipBoardId. Das SvData-Object hat
// dann die entsprechenden Informationen als String.
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index 7d6b94382d..d5e6f24c72 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -122,7 +122,8 @@ rtl::OUString HelpLocaleString()
Any aLocale =
::utl::ConfigManager::GetConfigManager()->GetDirectConfigProperty(
::utl::ConfigManager::LOCALE );
- bool bOk = (aLocale >>= aLocaleStr);
+ aLocale >>= aLocaleStr;
+ bool bOk = aLocaleStr.getLength() != 0;
if ( bOk )
{
rtl::OUString aBaseInstallPath;
@@ -711,9 +712,6 @@ String SfxHelp::CreateHelpURL_Impl( const String& aCommandURL, const String& rMo
return aHelpURL;
}
-static ::rtl::OUString OFFICE_HELP_TASK = ::rtl::OUString(DEFINE_CONST_UNICODE("OFFICE_HELP_TASK"));
-static ::rtl::OUString OFFICE_HELP = ::rtl::OUString(DEFINE_CONST_UNICODE("OFFICE_HELP" ));
-
SfxHelpWindow_Impl* impl_createHelp(Reference< XFrame >& rHelpTask ,
Reference< XFrame >& rHelpContent)
{
@@ -722,7 +720,7 @@ SfxHelpWindow_Impl* impl_createHelp(Reference< XFrame >& rHelpTask ,
// otherwhise - create new help task
Reference< XFrame > xHelpTask = xDesktop->findFrame(
- OFFICE_HELP_TASK,
+ ::rtl::OUString(DEFINE_CONST_UNICODE("OFFICE_HELP_TASK")),
FrameSearchFlag::TASKS | FrameSearchFlag::CREATE);
if (!xHelpTask.is())
return 0;
@@ -737,7 +735,7 @@ SfxHelpWindow_Impl* impl_createHelp(Reference< XFrame >& rHelpTask ,
if (xHelpTask->setComponent( xHelpWindow, Reference< XController >() ))
{
// Customize UI ...
- xHelpTask->setName( OFFICE_HELP_TASK );
+ xHelpTask->setName( ::rtl::OUString(DEFINE_CONST_UNICODE("OFFICE_HELP_TASK")) );
Reference< XPropertySet > xProps(xHelpTask, UNO_QUERY);
if (xProps.is())
@@ -751,13 +749,13 @@ SfxHelpWindow_Impl* impl_createHelp(Reference< XFrame >& rHelpTask ,
// This sub frame is created internaly (if we called new SfxHelpWindow_Impl() ...)
// It should exist :-)
- xHelpContent = xHelpTask->findFrame(OFFICE_HELP, FrameSearchFlag::CHILDREN);
+ xHelpContent = xHelpTask->findFrame(::rtl::OUString(DEFINE_CONST_UNICODE("OFFICE_HELP")), FrameSearchFlag::CHILDREN);
}
if (!xHelpContent.is())
delete pHelpWindow;
- xHelpContent->setName(OFFICE_HELP);
+ xHelpContent->setName(::rtl::OUString(DEFINE_CONST_UNICODE("OFFICE_HELP")));
rHelpTask = xHelpTask;
rHelpContent = xHelpContent;
@@ -827,10 +825,10 @@ BOOL SfxHelp::Start( const String& rURL, const Window* pWindow )
// in both cases)!
Reference< XFrame > xHelp = xDesktop->findFrame(
- OFFICE_HELP_TASK,
+ ::rtl::OUString(DEFINE_CONST_UNICODE("OFFICE_HELP_TASK")),
FrameSearchFlag::CHILDREN);
Reference< XFrame > xHelpContent = xDesktop->findFrame(
- OFFICE_HELP,
+ ::rtl::OUString(DEFINE_CONST_UNICODE("OFFICE_HELP")),
FrameSearchFlag::CHILDREN);
SfxHelpWindow_Impl* pHelpWindow = 0;
diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx
index 3f86d22811..af3f346b2b 100644
--- a/sfx2/source/appl/sfxpicklist.cxx
+++ b/sfx2/source/appl/sfxpicklist.cxx
@@ -446,7 +446,7 @@ void SfxPickList::Notify( SfxBroadcaster&, const SfxHint& rHint )
return;
// ignore hidden documents
- if ( !SfxViewFrame::GetFirst( pDocSh, 0, TRUE ) )
+ if ( !SfxViewFrame::GetFirst( pDocSh, TRUE ) )
return;
::rtl::OUString aTitle = pDocSh->GetTitle(SFX_TITLE_PICKLIST);
diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx
index 5eb2d3df79..c65393b8e4 100644
--- a/sfx2/source/appl/shutdownicon.cxx
+++ b/sfx2/source/appl/shutdownicon.cxx
@@ -33,6 +33,7 @@
#include <sfx2/app.hxx>
#include <vos/mutex.hxx>
#include <svtools/imagemgr.hxx>
+#include <svtools/miscopt.hxx>
// #include <cmdlineargs.hxx>
#include <com/sun/star/task/XInteractionHandler.hpp>
#include <com/sun/star/frame/XDispatchResultListener.hpp>
@@ -235,6 +236,7 @@ ShutdownIcon::ShutdownIcon( Reference< XMultiServiceFactory > aSMgr ) :
ShutdownIconServiceBase( m_aMutex ),
m_bVeto ( false ),
m_bListenForTermination ( false ),
+ m_bSystemDialogs( false ),
m_pResMgr( NULL ),
m_pFileDlg( NULL ),
m_xServiceManager( aSMgr ),
@@ -243,6 +245,7 @@ ShutdownIcon::ShutdownIcon( Reference< XMultiServiceFactory > aSMgr ) :
m_pPlugin( 0 ),
m_bInitialized( false )
{
+ m_bSystemDialogs = SvtMiscOptions().UseSystemFileDialog();
}
ShutdownIcon::~ShutdownIcon()
@@ -376,6 +379,16 @@ void ShutdownIcon::StartFileDialog()
{
::vos::OGuard aGuard( Application::GetSolarMutex() );
+ bool bDirty = ( m_bSystemDialogs != static_cast<bool>(SvtMiscOptions().UseSystemFileDialog()) );
+
+ if ( m_pFileDlg && bDirty )
+ {
+ // Destroy instance as changing the system file dialog setting
+ // forces us to create a new FileDialogHelper instance!
+ delete m_pFileDlg;
+ m_pFileDlg = NULL;
+ }
+
if ( !m_pFileDlg )
m_pFileDlg = new FileDialogHelper( WB_OPEN | SFXWB_MULTISELECTION, String() );
m_pFileDlg->StartExecuteModal( STATIC_LINK( this, ShutdownIcon, DialogClosedHdl_Impl ) );
@@ -512,8 +525,14 @@ IMPL_STATIC_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, EMPTYAR
#ifdef WNT
// #103346 Destroy dialog to prevent problems with custom controls
- delete pThis->m_pFileDlg;
- pThis->m_pFileDlg = NULL;
+ // This fix is dependent on the dialog settings. Destroying the dialog here will
+ // crash the non-native dialog implementation! Therefore make this dependent on
+ // the settings.
+ if ( SvtMiscOptions().UseSystemFileDialog() )
+ {
+ delete pThis->m_pFileDlg;
+ pThis->m_pFileDlg = NULL;
+ }
#endif
LeaveModalMode();
diff --git a/sfx2/source/appl/shutdownicon.hxx b/sfx2/source/appl/shutdownicon.hxx
index a1c836cbea..cc18016e33 100644
--- a/sfx2/source/appl/shutdownicon.hxx
+++ b/sfx2/source/appl/shutdownicon.hxx
@@ -52,6 +52,7 @@ class SFX2_DLLPUBLIC ShutdownIcon : public ShutdownIconServiceBase
::osl::Mutex m_aMutex;
bool m_bVeto;
bool m_bListenForTermination;
+ bool m_bSystemDialogs;
ResMgr* m_pResMgr;
sfx2::FileDialogHelper* m_pFileDlg;
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;
diff --git a/sfx2/source/appl/shutdowniconw32.cxx b/sfx2/source/appl/shutdowniconw32.cxx
index e9e5ba6123..9e260fdc85 100644
--- a/sfx2/source/appl/shutdowniconw32.cxx
+++ b/sfx2/source/appl/shutdowniconw32.cxx
@@ -109,7 +109,7 @@ using namespace ::osl;
#define ICON_TEMPLATE 16
#define ICON_MACROLIBRARY 17
#define ICON_CONFIGURATION 18
-#define ICON_OPEN 19
+#define ICON_OPEN 5 // See index of open folder icon in shell32.dll
#define ICON_SETUP 500
#define SFX_TASKBAR_NOTIFICATION WM_USER+1
@@ -124,6 +124,7 @@ static void OnDrawItem(HWND hwnd, LPDRAWITEMSTRUCT lpdis);
typedef struct tagMYITEM
{
OUString text;
+ OUString module;
UINT iconId;
} MYITEM;
@@ -152,7 +153,7 @@ static bool isNT()
// -------------------------------
-static void addMenuItem( HMENU hMenu, UINT id, UINT iconId, const OUString& text, int& pos, int bOwnerdraw )
+static void addMenuItem( HMENU hMenu, UINT id, UINT iconId, const OUString& text, int& pos, int bOwnerdraw, const OUString& module )
{
MENUITEMINFOW mi;
memset( &mi, 0, sizeof( MENUITEMINFOW ) );
@@ -175,6 +176,7 @@ static void addMenuItem( HMENU hMenu, UINT id, UINT iconId, const OUString& text
MYITEM *pMyItem = new MYITEM;
pMyItem->text = text;
pMyItem->iconId = iconId;
+ pMyItem->module = module;
mi.dwItemData = (DWORD) pMyItem;
}
else
@@ -245,6 +247,8 @@ static HMENU createSystrayMenu( )
{ SvtModuleOptions::E_SMATH, IDM_MATH, ICON_MATH_DOCUMENT, MATH_URL },
};
+ OUString aEmpty;
+
// insert the menu entries for launching the applications
for ( size_t i = 0; i < sizeof( aMenuItems ) / sizeof( aMenuItems[0] ); ++i )
{
@@ -260,19 +264,21 @@ static HMENU createSystrayMenu( )
continue;
addMenuItem( hMenu, aMenuItems[i].nMenuItemID, aMenuItems[i].nMenuIconID,
- pShutdownIcon->GetUrlDescription( sURL ), pos, true );
+ pShutdownIcon->GetUrlDescription( sURL ), pos, true, aEmpty );
}
+
+
// insert the remaining menu entries
addMenuItem( hMenu, IDM_TEMPLATE, ICON_TEMPLATE,
- pShutdownIcon->GetResString( STR_QUICKSTART_FROMTEMPLATE ), pos, true);
- addMenuItem( hMenu, static_cast< UINT >( -1 ), 0, OUString(), pos, false );
- addMenuItem( hMenu, IDM_OPEN, ICON_OPEN, pShutdownIcon->GetResString( STR_QUICKSTART_FILEOPEN ), pos, true );
- addMenuItem( hMenu, static_cast< UINT >( -1 ), 0, OUString(), pos, false );
+ pShutdownIcon->GetResString( STR_QUICKSTART_FROMTEMPLATE ), pos, true, aEmpty);
+ addMenuItem( hMenu, static_cast< UINT >( -1 ), 0, OUString(), pos, false, aEmpty );
+ addMenuItem( hMenu, IDM_OPEN, ICON_OPEN, pShutdownIcon->GetResString( STR_QUICKSTART_FILEOPEN ), pos, true, OUString::createFromAscii( "SHELL32" ));
+ addMenuItem( hMenu, static_cast< UINT >( -1 ), 0, OUString(), pos, false, aEmpty );
#endif
- addMenuItem( hMenu, IDM_INSTALL,0, pShutdownIcon->GetResString( STR_QUICKSTART_PRELAUNCH ), pos, false );
- addMenuItem( hMenu, static_cast< UINT >( -1 ), 0, OUString(), pos, false );
- addMenuItem( hMenu, IDM_EXIT, 0, pShutdownIcon->GetResString( STR_QUICKSTART_EXIT ), pos, false );
+ addMenuItem( hMenu, IDM_INSTALL,0, pShutdownIcon->GetResString( STR_QUICKSTART_PRELAUNCH ), pos, false, aEmpty );
+ addMenuItem( hMenu, static_cast< UINT >( -1 ), 0, OUString(), pos, false, aEmpty );
+ addMenuItem( hMenu, IDM_EXIT, 0, pShutdownIcon->GetResString( STR_QUICKSTART_EXIT ), pos, false, aEmpty );
// indicate status of autostart folder
CheckMenuItem( hMenu, IDM_INSTALL, MF_BYCOMMAND | (ShutdownIcon::GetAutostart() ? MF_CHECKED : MF_UNCHECKED) );
@@ -736,11 +742,25 @@ void OnDrawItem(HWND /*hwnd*/, LPDRAWITEMSTRUCT lpdis)
x = aRect.left;
y = aRect.top;
- int cx = GetSystemMetrics( SM_CXSMICON );
- int cy = GetSystemMetrics( SM_CYSMICON );
- HICON hIcon = (HICON) LoadImageA( GetModuleHandle( NULL ), MAKEINTRESOURCE( pMyItem->iconId ),
- IMAGE_ICON, cx, cy,
- LR_DEFAULTCOLOR | LR_SHARED );
+ int cx = GetSystemMetrics( SM_CXSMICON );
+ int cy = GetSystemMetrics( SM_CYSMICON );
+ HICON hIcon( 0 );
+ HMODULE hModule( GetModuleHandle( NULL ) );
+
+ if ( pMyItem->module.getLength() > 0 )
+ {
+ LPCWSTR pModuleName = reinterpret_cast<LPCWSTR>( pMyItem->module.getStr() );
+ hModule = GetModuleHandleW( pModuleName );
+ if ( hModule == NULL )
+ {
+ LoadLibraryW( pModuleName );
+ hModule = GetModuleHandleW( pModuleName );
+ }
+ }
+
+ hIcon = (HICON) LoadImageA( hModule, MAKEINTRESOURCE( pMyItem->iconId ),
+ IMAGE_ICON, cx, cy,
+ LR_DEFAULTCOLOR | LR_SHARED );
// DrawIconEx( lpdis->hDC, x, y+(height-cy)/2, hIcon, cx, cy, 0, NULL, DI_NORMAL );
diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx
index ab4df850cc..89b52ac0c6 100644
--- a/sfx2/source/appl/workwin.cxx
+++ b/sfx2/source/appl/workwin.cxx
@@ -38,7 +38,7 @@
#include <sfx2/objsh.hxx>
#include <sfx2/app.hxx>
#include "workwin.hxx"
-#include <sfx2/topfrm.hxx>
+#include <sfx2/viewfrm.hxx>
#include "arrdecl.hxx"
#include <sfx2/viewfrm.hxx>
#include <sfx2/module.hxx>
@@ -1431,8 +1431,8 @@ sal_Bool SfxWorkWindow::IsPluginMode( SfxObjectShell* pObjShell )
if ( pDispatcher )
{
SfxViewFrame* pFrame = pDispatcher->GetFrame();
- if ( pFrame && pFrame->GetFrame() )
- xFrame = pFrame->GetFrame()->GetFrameInterface();
+ if ( pFrame )
+ xFrame = pFrame->GetFrame().GetFrameInterface();
}
return xFrame;
diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx
index 31744d05eb..c42e49d49e 100644
--- a/sfx2/source/bastyp/fltfnc.cxx
+++ b/sfx2/source/bastyp/fltfnc.cxx
@@ -124,7 +124,7 @@ using namespace ::vos;
#include <sfx2/doctempl.hxx>
#include <sfx2/frame.hxx>
#include <sfx2/dispatch.hxx>
-#include <sfx2/topfrm.hxx>
+#include <sfx2/viewfrm.hxx>
#include "helper.hxx"
#include "fltlst.hxx"
#include <sfx2/request.hxx>
diff --git a/sfx2/source/bastyp/helper.cxx b/sfx2/source/bastyp/helper.cxx
index ae2347cd94..0b698070da 100644
--- a/sfx2/source/bastyp/helper.cxx
+++ b/sfx2/source/bastyp/helper.cxx
@@ -549,9 +549,17 @@ uno::Sequence < OUString > SfxContentHelper::GetResultSet( const String& rURL )
}
}
}
- catch( uno::Exception& )
- {
- DBG_ERRORFILE( "GetResultSet: Any other exception" );
+ catch( uno::Exception& e )
+ {
+ (void) e;
+ DBG_ERRORFILE(
+ rtl::OUStringToOString(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "GetResultSet: Any other exception: ")) +
+ e.Message),
+ RTL_TEXTENCODING_UTF8).
+ getStr());
}
if ( pList )
diff --git a/sfx2/source/bastyp/progress.cxx b/sfx2/source/bastyp/progress.cxx
index 2fb864a019..9fd7a95a3c 100644
--- a/sfx2/source/bastyp/progress.cxx
+++ b/sfx2/source/bastyp/progress.cxx
@@ -77,7 +77,7 @@ void AddNumber_Impl( String& aNumber, sal_uInt32 nArg )
}
}
-struct SfxProgress_Impl : public SfxCancellable
+struct SfxProgress_Impl
{
Reference < XStatusIndicator > xStatusInd;
String aText, aStateText;
@@ -141,11 +141,9 @@ void SfxProgress_Impl::Enable_Impl( BOOL bEnable )
// -----------------------------------------------------------------------
-SfxProgress_Impl::SfxProgress_Impl( const String &rTitle )
- : SfxCancellable( SFX_APP()->GetCancelManager(), rTitle ),
- pActiveProgress( 0 )
+SfxProgress_Impl::SfxProgress_Impl( const String &/*rTitle*/ )
+ : pActiveProgress( 0 )
{
- SFX_APP()->GetCancelManager()->RemoveCancellable(this);
}
// -----------------------------------------------------------------------
@@ -183,21 +181,6 @@ SfxProgress::SfxProgress
pImp->bRunning = TRUE;
pImp->bAllowRescheduling = Application::IsInExecute();;
- if ( pObjSh )
- {
- for( SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pObjSh ); pFrame; pFrame = SfxViewFrame::GetNext( *pFrame, pObjSh ) )
- {
- pFrame->GetCancelManager()->InsertCancellable( pImp );
-/*
- SfxBindings& rBindings = pFrame->GetBindings();
- rBindings.Invalidate( SID_BROWSE_STOP );
- if ( !rBindings.IsInRegistrations() )
- rBindings.Update( SID_BROWSE_STOP );
- rBindings.Invalidate( SID_BROWSE_STOP );
- */
- }
- }
-
pImp->xObjSh = pObjSh;
pImp->aText = rText;
pImp->nMax = nRange;
@@ -238,14 +221,6 @@ SfxProgress::~SfxProgress()
if( pImp->bIsStatusText == TRUE )
GetpApp()->HideStatusText( );
- SfxObjectShell* pDoc = pImp->xObjSh;
- if ( pDoc )
- {
- for( SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDoc ); pFrame; pFrame = SfxViewFrame::GetNext( *pFrame, pDoc ) )
- pFrame->GetCancelManager()->RemoveCancellable( pImp );//Invalidate( SID_BROWSE_STOP );
- }
- else
- SFX_APP()->Invalidate( SID_BROWSE_STOP );
delete pImp;
}
@@ -387,8 +362,8 @@ BOOL SfxProgress::SetState
{
// wurde via Stop-Button angehalten?
- if ( pImp->IsCancelled() )
- return FALSE;
+// if ( pImp->IsCancelled() )
+// return FALSE;
if( pImp->pActiveProgress ) return TRUE;
diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index 7765636bf3..ef0c1e80c3 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -68,7 +68,7 @@
#include <sfx2/unoctitm.hxx>
#include <sfx2/sfx.hrc>
#include <sfx2/sfxuno.hxx>
-#include <sfx2/topfrm.hxx>
+#include <sfx2/viewfrm.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/msgpool.hxx>
@@ -719,7 +719,7 @@ void SfxBindings::InvalidateAll
pImp->pCaches->GetObject(n)->Invalidate(bWithMsg);
/*
::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame > xFrame
- ( pDispatcher->GetFrame()->GetFrame()->GetFrameInterface(), UNO_QUERY );
+ ( pDispatcher->GetFrame()->GetFrame().GetFrameInterface(), UNO_QUERY );
if ( bWithMsg && xFrame.is() )
xFrame->contextChanged();
@@ -1381,7 +1381,7 @@ void SfxBindings::UpdateSlotServer_Impl()
if ( !nRegLevel )
{
::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame > xFrame
- ( pDispatcher->GetFrame()->GetFrame()->GetFrameInterface(), UNO_QUERY );
+ ( pDispatcher->GetFrame()->GetFrame().GetFrameInterface(), UNO_QUERY );
//if ( xFrame.is() )
// xFrame->contextChanged();
pImp->bContextChanged = FALSE;
@@ -1923,7 +1923,7 @@ void SfxBindings::LeaveRegistrations( sal_uInt16 nLevel, const char *pFile, int
pImp->bContextChanged = FALSE;
/*
::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame > xFrame
- ( pDispatcher->GetFrame()->GetFrame()->GetFrameInterface(), UNO_QUERY );
+ ( pDispatcher->GetFrame()->GetFrame().GetFrameInterface(), UNO_QUERY );
if ( xFrame.is() )
xFrame->contextChanged();*/
}
@@ -2030,7 +2030,7 @@ void SfxBindings::SetDispatcher( SfxDispatcher *pDisp )
::com::sun::star::uno::Reference < ::com::sun::star::frame::XDispatchProvider > xProv;
if ( pDisp )
xProv = ::com::sun::star::uno::Reference < ::com::sun::star::frame::XDispatchProvider >
- ( pDisp->GetFrame()->GetFrame()->GetFrameInterface(), UNO_QUERY );
+ ( pDisp->GetFrame()->GetFrame().GetFrameInterface(), UNO_QUERY );
SetDispatchProvider_Impl( xProv );
InvalidateAll( sal_True );
@@ -2313,7 +2313,7 @@ void SfxBindings::SetActiveFrame( const ::com::sun::star::uno::Reference< ::com:
SetDispatchProvider_Impl( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > ( rFrame, ::com::sun::star::uno::UNO_QUERY ) );
else
SetDispatchProvider_Impl( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > (
- pDispatcher->GetFrame()->GetFrame()->GetFrameInterface(), ::com::sun::star::uno::UNO_QUERY ) );
+ pDispatcher->GetFrame()->GetFrame().GetFrameInterface(), ::com::sun::star::uno::UNO_QUERY ) );
}
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > SfxBindings::GetActiveFrame() const
@@ -2322,7 +2322,7 @@ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > SfxBin
if ( xFrame.is() || !pDispatcher )
return xFrame;
else
- return pDispatcher->GetFrame()->GetFrame()->GetFrameInterface();
+ return pDispatcher->GetFrame()->GetFrame().GetFrameInterface();
}
void SfxBindings::SetDispatchProvider_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > & rProv )
@@ -2349,8 +2349,8 @@ SystemWindow* SfxBindings::GetSystemWindow() const
SfxViewFrame *pFrame = pDispatcher->GetFrame();
while ( pFrame->GetParentViewFrame_Impl() )
pFrame = pFrame->GetParentViewFrame_Impl();
- SfxTopViewFrame* pTop = PTR_CAST( SfxTopViewFrame, pFrame->GetTopViewFrame() );
- return pTop->GetTopFrame_Impl()->GetTopWindow_Impl();
+ SfxViewFrame* pTop = pFrame->GetTopViewFrame();
+ return pTop->GetFrame().GetTopWindow_Impl();
}
BOOL SfxBindings::ExecuteCommand_Impl( const String& rCommand )
@@ -2374,7 +2374,7 @@ BOOL SfxBindings::ExecuteCommand_Impl( const String& rCommand )
xServiceManager->createInstance(our_aModuleManagerName)
, ::com::sun::star::uno::UNO_QUERY_THROW);
::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame > xFrame(
- pDispatcher->GetFrame()->GetFrame()->GetFrameInterface(), UNO_QUERY_THROW);
+ pDispatcher->GetFrame()->GetFrame().GetFrameInterface(), UNO_QUERY_THROW);
sAppName = xModuleManager->identify(xFrame);
} catch(::com::sun::star::uno::Exception&) {}
Sequence<beans::PropertyValue> source;
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 6608abe08f..2549af2a6a 100755..100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -76,7 +76,7 @@
#include <sfx2/docfac.hxx>
#include <sfx2/msgpool.hxx>
#include <sfx2/module.hxx>
-#include <sfx2/topfrm.hxx>
+#include <sfx2/viewfrm.hxx>
#include <sfx2/sfxuno.hxx>
#include <sfx2/docfile.hxx>
#include <sfx2/mnumgr.hxx>
@@ -239,14 +239,13 @@ int SfxDispatcher::Call_Impl( SfxShell& rShell, const SfxSlot &rSlot, SfxRequest
SFX_STACK(SfxDispatcher::Call_Impl);
// darf der Slot gerufen werden (i.S.v. enabled)
- SfxApplication *pSfxApp = SFX_APP();
if ( rSlot.IsMode(SFX_SLOT_FASTCALL) || rShell.CanExecuteSlot_Impl(rSlot) )
{
if ( GetFrame() )
{
// ggf. Recording anwerfen
com::sun::star::uno::Reference< com::sun::star::frame::XFrame > xFrame(
- GetFrame()->GetFrame()->GetFrameInterface(),
+ GetFrame()->GetFrame().GetFrameInterface(),
com::sun::star::uno::UNO_QUERY);
com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xSet(
@@ -270,19 +269,6 @@ int SfxDispatcher::Call_Impl( SfxShell& rShell, const SfxSlot &rSlot, SfxRequest
// Alles holen, was gebraucht wird, da der Slot den Execute evtl. nicht
// "uberlebt, falls es ein 'Pseudoslot' f"ur Macros oder Verben ist
sal_Bool bAutoUpdate = rSlot.IsMode(SFX_SLOT_AUTOUPDATE);
- SFX_REQUEST_ARG(rReq, pOrigItem, SfxExecuteItem, SID_SUBREQUEST, sal_False);
- SfxExecuteItem *pExecuteItem = pOrigItem
- ? (SfxExecuteItem*)pOrigItem->Clone()
- : 0;
-
- // ggf. TabPage-ID setzen
- SfxAppData_Impl *pAppData = pSfxApp->Get_Impl();
- SFX_REQUEST_ARG(rReq, pTabPageItem, SfxUInt16Item, SID_TABPAGE, sal_False);
- if ( pTabPageItem )
- {
- pAppData->nAutoTabPageId = pTabPageItem->GetValue();
- rReq.RemoveItem( SID_TABPAGE ); // sonst ArgCount > 0 => Seiteneff.
- }
// API-Call-Klammerung und Document-Lock w"ahrend des Calls
{
@@ -295,7 +281,7 @@ int SfxDispatcher::Call_Impl( SfxShell& rShell, const SfxSlot &rSlot, SfxRequest
if ( !pView )
pView = SfxViewFrame::Current();
if ( pView )
- SfxHelp::OpenHelpAgent( pView->GetFrame(), rReq.GetSlot() );
+ SfxHelp::OpenHelpAgent( &pView->GetFrame(), rReq.GetSlot() );
SfxExecFunc pFunc = rSlot.GetExecFnc();
rShell.CallExec( pFunc, rReq );
@@ -316,16 +302,6 @@ int SfxDispatcher::Call_Impl( SfxShell& rShell, const SfxSlot &rSlot, SfxRequest
}
}
- // TabPage-ID und Executing-SID zurueck setzen
- if ( pTabPageItem )
- pAppData->nAutoTabPageId = 0;
-
- if( pExecuteItem )
- {
- Execute( *pExecuteItem );
- delete pExecuteItem;
- }
-
if ( rReq.IsDone() )
{
SfxBindings *pBindings = GetBindings();
@@ -519,7 +495,7 @@ void SfxDispatcher::Pop
SfxApplication *pSfxApp = SFX_APP();
#ifdef DBG_UTIL
- ByteString aMsg( "SfxDispatcher(" );
+ ByteString aMsg( "-SfxDispatcher(" );
aMsg += ByteString::CreateFromInt64( (sal_uIntPtr) this );
aMsg += bPush ? ")::Push(" : ")::Pop(";
if ( rShell.GetInterface() )
@@ -527,6 +503,7 @@ void SfxDispatcher::Pop
else
aMsg += ByteString::CreateFromInt64( (sal_uIntPtr) &rShell );
aMsg += bDelete ? ") with delete" : ")";
+ if ( bUntil ) aMsg += " (up to)";
DbgTrace( aMsg.GetBuffer() );
#endif
@@ -797,7 +774,7 @@ void SfxDispatcher::DoActivate_Impl( sal_Bool bMDI, SfxViewFrame* /* pOld */ )
if ( pBindings )
{
pBindings->SetDispatcher(this);
- pBindings->SetActiveFrame( pImp->pFrame->GetFrame()->GetFrameInterface() );
+ pBindings->SetActiveFrame( pImp->pFrame->GetFrame().GetFrameInterface() );
}
}
else
@@ -817,7 +794,7 @@ void SfxDispatcher::DoActivate_Impl( sal_Bool bMDI, SfxViewFrame* /* pOld */ )
if ( bMDI && pImp->pFrame )
{
- //SfxWorkWindow *pWorkWin = pImp->pFrame->GetFrame()->GetWorkWindow_Impl();
+ //SfxWorkWindow *pWorkWin = pImp->pFrame->GetFrame().GetWorkWindow_Impl();
SfxBindings *pBind = GetBindings();
while ( pBind )
{
@@ -825,7 +802,7 @@ void SfxDispatcher::DoActivate_Impl( sal_Bool bMDI, SfxViewFrame* /* pOld */ )
pBind = pBind->GetSubBindings_Impl();
}
- pImp->pFrame->GetFrame()->GetWorkWindow_Impl()->HidePopups_Impl( FALSE, FALSE, 1 );
+ pImp->pFrame->GetFrame().GetWorkWindow_Impl()->HidePopups_Impl( FALSE, FALSE, 1 );
}
if ( pImp->aToDoStack.Count() )
@@ -883,7 +860,7 @@ void SfxDispatcher::DoDeactivate_Impl( sal_Bool bMDI, SfxViewFrame* pNew )
if ( pImp->pFrame && !(pImp->pFrame->GetObjectShell()->IsInPlaceActive() ) )
{
- SfxWorkWindow *pWorkWin = pImp->pFrame->GetFrame()->GetWorkWindow_Impl();
+ SfxWorkWindow *pWorkWin = pImp->pFrame->GetFrame().GetWorkWindow_Impl();
if ( pWorkWin )
{
for (sal_uInt16 n=0; n<pImp->aChildWins.Count();)
@@ -911,10 +888,10 @@ void SfxDispatcher::DoDeactivate_Impl( sal_Bool bMDI, SfxViewFrame* pNew )
if ( pNew && pImp->pFrame )
{
com::sun::star::uno::Reference< com::sun::star::frame::XFrame > xOldFrame(
- pNew->GetFrame()->GetFrameInterface()->getCreator(), com::sun::star::uno::UNO_QUERY );
+ pNew->GetFrame().GetFrameInterface()->getCreator(), com::sun::star::uno::UNO_QUERY );
com::sun::star::uno::Reference< com::sun::star::frame::XFrame > xMyFrame(
- GetFrame()->GetFrame()->GetFrameInterface(), com::sun::star::uno::UNO_QUERY );
+ GetFrame()->GetFrame().GetFrameInterface(), com::sun::star::uno::UNO_QUERY );
if ( xOldFrame == xMyFrame )
bHidePopups = FALSE;
@@ -922,7 +899,7 @@ void SfxDispatcher::DoDeactivate_Impl( sal_Bool bMDI, SfxViewFrame* pNew )
if ( bHidePopups )
{
- //SfxWorkWindow *pWorkWin = pImp->pFrame->GetFrame()->GetWorkWindow_Impl();
+ //SfxWorkWindow *pWorkWin = pImp->pFrame->GetFrame().GetWorkWindow_Impl();
SfxBindings *pBind = GetBindings();
while ( pBind )
{
@@ -930,7 +907,7 @@ void SfxDispatcher::DoDeactivate_Impl( sal_Bool bMDI, SfxViewFrame* pNew )
pBind = pBind->GetSubBindings_Impl();
}
- pImp->pFrame->GetFrame()->GetWorkWindow_Impl()->HidePopups_Impl( TRUE, FALSE, 1 );
+ pImp->pFrame->GetFrame().GetWorkWindow_Impl()->HidePopups_Impl( TRUE, FALSE, 1 );
}
Flush();
@@ -1673,13 +1650,13 @@ void SfxDispatcher::SetMenu_Impl()
{
if ( pImp->pFrame )
{
- SfxTopViewFrame* pTop= PTR_CAST( SfxTopViewFrame, pImp->pFrame->GetTopViewFrame() );
+ SfxViewFrame* pTop = pImp->pFrame->GetTopViewFrame();
if ( pTop && pTop->GetBindings().GetDispatcher() == this )
{
- SfxTopFrame* pFrm = pTop->GetTopFrame_Impl();
- if ( pFrm->IsMenuBarOn_Impl() )
+ SfxFrame& rFrame = pTop->GetFrame();
+ if ( rFrame.IsMenuBarOn_Impl() )
{
- com::sun::star::uno::Reference < com::sun::star::beans::XPropertySet > xPropSet( pFrm->GetFrameInterface(), com::sun::star::uno::UNO_QUERY );
+ com::sun::star::uno::Reference < com::sun::star::beans::XPropertySet > xPropSet( rFrame.GetFrameInterface(), com::sun::star::uno::UNO_QUERY );
if ( xPropSet.is() )
{
com::sun::star::uno::Reference< ::com::sun::star::frame::XLayoutManager > xLayoutManager;
@@ -1712,7 +1689,7 @@ long SfxDispatcher::Update_Impl( sal_Bool bForce )
sal_Bool bUpdate = bForce;
while ( pDisp && pDisp->pImp->pFrame )
{
- SfxWorkWindow *pWork = pDisp->pImp->pFrame->GetFrame()->GetWorkWindow_Impl();
+ SfxWorkWindow *pWork = pDisp->pImp->pFrame->GetFrame().GetWorkWindow_Impl();
SfxDispatcher *pAct = pWork->GetBindings().GetDispatcher_Impl();
if ( pAct == pDisp || pAct == this )
{
@@ -1726,10 +1703,10 @@ long SfxDispatcher::Update_Impl( sal_Bool bForce )
pDisp = pDisp->pImp->pParent;
}
- if ( !bUpdate || pImp->pFrame->GetFrame()->IsClosing_Impl() )
+ if ( !bUpdate || pImp->pFrame->GetFrame().IsClosing_Impl() )
return 0;
- SfxTopViewFrame* pTop = pImp->pFrame ? PTR_CAST( SfxTopViewFrame, pImp->pFrame->GetTopViewFrame() ) : NULL;
+ SfxViewFrame* pTop = pImp->pFrame ? pImp->pFrame->GetTopViewFrame() : NULL;
sal_Bool bUIActive = pTop && pTop->GetBindings().GetDispatcher() == this;
if ( !bUIActive && pTop && GetBindings() == &pTop->GetBindings() )
@@ -1763,14 +1740,14 @@ long SfxDispatcher::Update_Impl( sal_Bool bForce )
if ( bUIActive && /* !bIsIPActive && */ ( !pClient || !pClient->IsObjectUIActive() ) )
SetMenu_Impl();
- SfxWorkWindow *pWorkWin = pImp->pFrame->GetFrame()->GetWorkWindow_Impl();
- SfxWorkWindow *pTaskWin = pImp->pFrame->GetTopFrame()->GetWorkWindow_Impl();
+ SfxWorkWindow *pWorkWin = pImp->pFrame->GetFrame().GetWorkWindow_Impl();
+ SfxWorkWindow *pTaskWin = pImp->pFrame->GetTopFrame().GetWorkWindow_Impl();
pTaskWin->ResetStatusBar_Impl();
SfxDispatcher *pDispat = this;
while ( pDispat )
{
- SfxWorkWindow *pWork = pDispat->pImp->pFrame->GetFrame()->GetWorkWindow_Impl();
+ SfxWorkWindow *pWork = pDispat->pImp->pFrame->GetFrame().GetWorkWindow_Impl();
SfxDispatcher *pAct = pWork->GetBindings().GetDispatcher_Impl();
if ( pAct == pDispat || pAct == this )
{
@@ -1808,7 +1785,7 @@ sal_uInt32 SfxDispatcher::_Update_Impl( sal_Bool bUIActive, sal_Bool bIsMDIApp,
{
sal_uInt32 nHelpId = 0;
SFX_APP();
- SfxWorkWindow *pWorkWin = pImp->pFrame->GetFrame()->GetWorkWindow_Impl();
+ SfxWorkWindow *pWorkWin = pImp->pFrame->GetFrame().GetWorkWindow_Impl();
sal_Bool bIsActive = sal_False;
sal_Bool bIsTaskActive = sal_False;
SfxDispatcher *pActDispat = pWorkWin->GetBindings().GetDispatcher_Impl();
@@ -1970,7 +1947,7 @@ sal_uInt32 SfxDispatcher::_Update_Impl( sal_Bool bUIActive, sal_Bool bIsMDIApp,
{
// internal frames also may control statusbar
SfxBindings& rBindings = pImp->pFrame->GetBindings();
- pImp->pFrame->GetFrame()->GetWorkWindow_Impl()->SetStatusBar_Impl( nStatBarId, pStatusBarShell, rBindings );
+ pImp->pFrame->GetFrame().GetWorkWindow_Impl()->SetStatusBar_Impl( nStatBarId, pStatusBarShell, rBindings );
}
}
@@ -2247,7 +2224,7 @@ sal_Bool SfxDispatcher::_TryIntercept_Impl
sal_uInt16 nLevels = pImp->aStack.Count();
while ( pParent && pParent->pImp->pFrame )
{
- if ( pParent->pImp->pFrame->GetFrame()->HasComponent() )
+ if ( pParent->pImp->pFrame->GetFrame().HasComponent() )
{
// Components d"urfen intercepten
if ( pParent->_TryIntercept_Impl( nSlot, rServer, sal_True ) )
@@ -2321,7 +2298,7 @@ sal_Bool SfxDispatcher::_FindServer
{
SFX_STACK(SfxDispatcher::_FindServer);
- // Dispatcher gelockt? (SID_BROWSE_STOP und SID_HELP_PI trotzdem durchlassen)
+ // Dispatcher gelockt? (SID_HELP_PI trotzdem durchlassen)
SfxApplication *pSfxApp = SFX_APP();
if ( IsLocked(nSlot) )
{
@@ -2741,7 +2718,7 @@ SfxPopupMenuManager* SfxDispatcher::Popup( sal_uInt16 nConfigId,Window *pWin, co
nShLevel = rDisp.pImp->aStack.Count();
}
- Window *pWindow = pWin ? pWin : rDisp.pImp->pFrame->GetFrame()->GetWorkWindow_Impl()->GetWindow();
+ Window *pWindow = pWin ? pWin : rDisp.pImp->pFrame->GetFrame().GetWorkWindow_Impl()->GetWindow();
for ( pSh = rDisp.GetShell(nShLevel); pSh; ++nShLevel, pSh = rDisp.GetShell(nShLevel) )
{
const ResId& rResId = pSh->GetInterface()->GetPopupMenuResId();
@@ -2781,7 +2758,7 @@ void SfxDispatcher::ExecutePopup( sal_uInt16 nConfigId, Window *pWin, const Poin
nShLevel = rDisp.pImp->aStack.Count();
}
- Window *pWindow = pWin ? pWin : rDisp.pImp->pFrame->GetFrame()->GetWorkWindow_Impl()->GetWindow();
+ Window *pWindow = pWin ? pWin : rDisp.pImp->pFrame->GetFrame().GetWorkWindow_Impl()->GetWindow();
for ( pSh = rDisp.GetShell(nShLevel); pSh; ++nShLevel, pSh = rDisp.GetShell(nShLevel) )
{
const ResId& rResId = pSh->GetInterface()->GetPopupMenuResId();
@@ -2804,7 +2781,7 @@ void SfxDispatcher::ExecutePopup( sal_uInt16 nConfigId, Window *pWin, const Poin
//----------------------------------------------------------------------
void SfxDispatcher::ExecutePopup( const ResId &rId, Window *pWin, const Point *pPos )
{
- Window *pWindow = pWin ? pWin : pImp->pFrame->GetFrame()->GetWorkWindow_Impl()->GetWindow();
+ Window *pWindow = pWin ? pWin : pImp->pFrame->GetFrame().GetWorkWindow_Impl()->GetWindow();
/*
SfxPopupMenuManager aPop( rId, *GetBindings() );
aPop.AddClipboardFunctions();
@@ -2908,13 +2885,13 @@ void SfxDispatcher::HideUI( sal_Bool bHide )
pImp->bNoUI = bHide;
if ( pImp->pFrame )
{
- SfxTopViewFrame* pTop= PTR_CAST( SfxTopViewFrame, pImp->pFrame->GetTopViewFrame() );
+ SfxViewFrame* pTop = pImp->pFrame->GetTopViewFrame();
if ( pTop && pTop->GetBindings().GetDispatcher() == this )
{
- SfxTopFrame* pFrm = pTop->GetTopFrame_Impl();
- if ( pFrm->IsMenuBarOn_Impl() )
+ SfxFrame& rFrame = pTop->GetFrame();
+ if ( rFrame.IsMenuBarOn_Impl() )
{
- com::sun::star::uno::Reference < com::sun::star::beans::XPropertySet > xPropSet( pFrm->GetFrameInterface(), com::sun::star::uno::UNO_QUERY );
+ com::sun::star::uno::Reference < com::sun::star::beans::XPropertySet > xPropSet( rFrame.GetFrameInterface(), com::sun::star::uno::UNO_QUERY );
if ( xPropSet.is() )
{
com::sun::star::uno::Reference< ::com::sun::star::frame::XLayoutManager > xLayoutManager;
@@ -3157,27 +3134,6 @@ void SfxDispatcher::InvalidateBindings_Impl( sal_Bool bModify )
pFrame;
pFrame = SfxViewFrame::GetNext( *pFrame ) )
pFrame->GetBindings().InvalidateAll(bModify);
-/*
- // alle Bindings sind betroffen
- for ( SfxInPlaceFrame *pIPFrame = (SfxInPlaceFrame*)
- SfxViewFrame::GetFirst(0, TYPE(SfxInPlaceFrame));
- pIPFrame;
- pIPFrame = (SfxInPlaceFrame*)
- SfxViewFrame::GetNext(*pIPFrame, 0, TYPE(SfxInPlaceFrame)) )
- pIPFrame->GetBindings().InvalidateAll(bModify);
-
- for ( SfxPlugInFrame *pPIFrame = (SfxPlugInFrame*)
- SfxViewFrame::GetFirst(0, TYPE(SfxPlugInFrame));
- pPIFrame;
- pPIFrame = (SfxPlugInFrame*)
- SfxViewFrame::GetNext(*pPIFrame, 0, TYPE(SfxPlugInFrame)) )
- pPIFrame->GetBindings().InvalidateAll(bModify);
-
- for ( SfxTask* pTask = SfxTask::GetFirst(); pTask;
- pTask = SfxTask::GetNext( *pTask ) )
- if ( !pTask->IsExternal() )
- pTask->GetBindings()->InvalidateAll(bModify);
-*/
}
else
{
diff --git a/sfx2/source/control/request.cxx b/sfx2/source/control/request.cxx
index 525819ee74..5dd20c34f0 100644
--- a/sfx2/source/control/request.cxx
+++ b/sfx2/source/control/request.cxx
@@ -866,7 +866,7 @@ com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorder > SfxRe
com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorder > xRecorder;
com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xSet(
- (pView ? pView : SfxViewFrame::Current())->GetFrame()->GetFrameInterface(),
+ (pView ? pView : SfxViewFrame::Current())->GetFrame().GetFrameInterface(),
com::sun::star::uno::UNO_QUERY);
if(xSet.is())
diff --git a/sfx2/source/control/statcach.cxx b/sfx2/source/control/statcach.cxx
index ed6469ca81..3c4d89f801 100644
--- a/sfx2/source/control/statcach.cxx
+++ b/sfx2/source/control/statcach.cxx
@@ -342,7 +342,7 @@ const SfxSlotServer* SfxStateCache::GetSlotServer( SfxDispatcher &rDispat , cons
else if ( rDispat.GetFrame() )
{
::com::sun::star::uno::Reference < ::com::sun::star::frame::XDispatchProvider > xFrameProv(
- rDispat.GetFrame()->GetFrame()->GetFrameInterface(), ::com::sun::star::uno::UNO_QUERY );
+ rDispat.GetFrame()->GetFrame().GetFrameInterface(), ::com::sun::star::uno::UNO_QUERY );
if ( xFrameProv != xProv )
return GetSlotServer( rDispat, xFrameProv );
}
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 8d5a5b9076..8159fc8430 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -217,8 +217,8 @@ void SfxUnoControllerItem::GetNewDispatch()
if ( !pBindings->GetDispatcher_Impl() || !pBindings->GetDispatcher_Impl()->GetFrame() )
return;
- SfxFrame *pFrame = pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame();
- SfxFrame *pParent = pFrame->GetParentFrame();
+ SfxFrame& rFrame = pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame();
+ SfxFrame *pParent = rFrame.GetParentFrame();
if ( pParent )
// parent may intercept
xDispatch = TryGetDispatch( pParent );
@@ -226,7 +226,7 @@ void SfxUnoControllerItem::GetNewDispatch()
if ( !xDispatch.is() )
{
// no interception
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > xFrame = pFrame->GetFrameInterface();
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > xFrame = rFrame.GetFrameInterface();
::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > xProv( xFrame, ::com::sun::star::uno::UNO_QUERY );
if ( xProv.is() )
xDispatch = xProv->queryDispatch( aCommand, ::rtl::OUString(), 0 );
@@ -250,7 +250,7 @@ void SfxUnoControllerItem::GetNewDispatch()
if ( !xDisp.is() && pFrame->HasComponent() )
{
// no interception
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > xFrame = pFrame->GetFrameInterface();
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > xFrame = pFrame->GetFrameInterface();
::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > xProv( xFrame, ::com::sun::star::uno::UNO_QUERY );
if ( xProv.is() )
xDisp = xProv->queryDispatch( aCommand, ::rtl::OUString(), 0 );
@@ -752,11 +752,11 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const ::com::sun::star::util
{
SfxViewFrame* pViewFrame = pDispatcher->GetFrame();
if (pViewFrame)
- xFrameRef = pViewFrame->GetFrame()->GetFrameInterface();
+ xFrameRef = pViewFrame->GetFrame().GetFrameInterface();
}
SfxAllItemSet aInternalSet( SFX_APP()->GetPool() );
if (xFrameRef.is()) // an empty set is no problem ... but an empty frame reference can be a problem !
- aInternalSet.Put( SfxUnoAnyItem( SID_FILLFRAME, css::uno::makeAny(xFrameRef) ) );
+ aInternalSet.Put( SfxUnoFrameItem( SID_FILLFRAME, xFrameRef ) );
sal_Bool bSuccess = sal_False;
sal_Bool bFailure = sal_False;
diff --git a/sfx2/source/dialog/about.cxx b/sfx2/source/dialog/about.cxx
index 770de189b4..0822d50f8b 100644
--- a/sfx2/source/dialog/about.cxx
+++ b/sfx2/source/dialog/about.cxx
@@ -47,6 +47,8 @@
#include <unotools/bootstrap.hxx>
#include <com/sun/star/uno/Any.h>
#include <unotools/configmgr.hxx>
+#include <vcl/graph.hxx>
+#include <svtools/filter.hxx>
#include <sfx2/sfxuno.hxx>
#include "about.hxx"
@@ -92,8 +94,15 @@ static bool impl_loadBitmap(
SvFileStream aStrm( aObj.PathToFileName(), STREAM_STD_READ );
if ( !aStrm.GetError() )
{
- Bitmap aBmp;
- aStrm >> aBmp;
+ // Use graphic class to also support more graphic formats (bmp,png,...)
+ Graphic aGraphic;
+
+ GraphicFilter* pGF = GraphicFilter::GetGraphicFilter();
+ pGF->ImportGraphic( aGraphic, String(), aStrm, GRFILTER_FORMAT_DONTKNOW );
+
+ // Default case, we load the intro bitmap from a seperate file
+ // (e.g. staroffice_intro.bmp or starsuite_intro.bmp)
+ BitmapEx aBmp = aGraphic.GetBitmapEx();
rLogo = Image( aBmp );
return true;
}
@@ -111,6 +120,7 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId, const String& rVerS
aDeveloperAry ( ResId( ABOUT_STR_DEVELOPER_ARY, *rId.GetResMgr() ) ),
aDevVersionStr ( rVerStr ),
aAccelStr ( ResId( ABOUT_STR_ACCEL, *rId.GetResMgr() ) ),
+ aCopyrightTextStr( ResId( ABOUT_STR_COPYRIGHT, *rId.GetResMgr() ) ),
aTimer (),
nOff ( 0 ),
m_nDeltaWidth ( 0 ),
@@ -151,14 +161,22 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId, const String& rVerS
{
bLoaded = impl_loadBitmap(
rtl::OUString::createFromAscii( "$BRAND_BASE_DIR/program/edition" ),
- rtl::OUString::createFromAscii( "about.bmp" ), aAppLogo );
+ rtl::OUString::createFromAscii( "about.png" ), aAppLogo );
+ if ( !bLoaded )
+ bLoaded = impl_loadBitmap(
+ rtl::OUString::createFromAscii( "$BRAND_BASE_DIR/program/edition" ),
+ rtl::OUString::createFromAscii( "about.bmp" ), aAppLogo );
}
if ( !bLoaded )
{
bLoaded = impl_loadBitmap(
rtl::OUString::createFromAscii( "$BRAND_BASE_DIR/program" ),
- rtl::OUString::createFromAscii( "about.bmp" ), aAppLogo );
+ rtl::OUString::createFromAscii( "about.png" ), aAppLogo );
+ if ( !bLoaded )
+ bLoaded = impl_loadBitmap(
+ rtl::OUString::createFromAscii( "$BRAND_BASE_DIR/program" ),
+ rtl::OUString::createFromAscii( "about.bmp" ), aAppLogo );
}
// Transparenter Font
@@ -231,46 +249,40 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId, const String& rVerS
// determine size and position of the dialog & elements
Size aAppLogoSiz = aAppLogo.GetSizePixel();
- Size aOutSiz = GetOutputSizePixel();
- aOutSiz.Width() = aAppLogoSiz.Width();
- // spacing to the margin
- Size a6Size = aVersionText.LogicToPixel( Size( 6, 6 ), MAP_APPFONT );
- long nDlgMargin = a6Size.Width() * 4 ;
- // The URL (if found in copyright text) should not be line-wrapped
- if ( aCopyrightText.GetText().Search( WELCOME_URL ) != STRING_NOTFOUND )
- {
- long nURLWidth = GetTextWidth( WELCOME_URL ) + nDlgMargin + (2*SPACE_OFFSET);
- if ( nURLWidth > aAppLogoSiz.Width() )
- {
- // pb: can be used to align the position of the logo
- // m_nDeltaWidth = nURLWidth - aOutSiz.Width();
+ Size aOutSiz = GetOutputSizePixel();
+ aOutSiz.Width() = aAppLogoSiz.Width();
- aOutSiz.Width() = nURLWidth;
- }
- }
-
- // layout the text-elements
- long nTextWidth = aOutSiz.Width() - nDlgMargin;
- long nY = aAppLogoSiz.Height() + ( a6Size.Height() * 2 );
+ Size a6Size = aVersionText.LogicToPixel( Size( 6, 6 ), MAP_APPFONT );
+ long nY = aAppLogoSiz.Height() + ( a6Size.Height() * 2 );
+ long nDlgMargin = a6Size.Width() * 4 ;
+ long nCtrlMargin = a6Size.Height() * 2;
+ long nTextWidth = aOutSiz.Width() - nDlgMargin;
+ aCopyrightText.SetText( aCopyrightTextStr );
+
layoutText( aVersionText, nY, nTextWidth, a6Size );
- nY += ( a6Size.Height() / 3 );
- layoutText( aCopyrightText, nY, nTextWidth, a6Size );
- nY += ( a6Size.Height() / 3 );
- if( aBuildString.Len() > 0 )
- {
- layoutText( aBuildData, nY, nTextWidth, a6Size );
- nY += ( a6Size.Height() / 2 );
- }
-
+ nY += nCtrlMargin;
+
// OK-Button-Position (at the bottom and centered)
Size aOKSiz = aOKButton.GetSizePixel();
Point aOKPnt = aOKButton.GetPosPixel();
+
+ // Multiline edit with Copyright-Text
+ Point aCopyPnt = aCopyrightText.GetPosPixel();
+ Size aCopySize = aCopyrightText.GetSizePixel();
+ aCopySize.Width() = nTextWidth;
+ aCopySize.Height() = aOutSiz.Height() - nY - ( aOKSiz.Height() * 2 ) - nCtrlMargin;
+
+ aCopyPnt.X() = ( aOutSiz.Width() - aCopySize.Width() ) / 2;
+ aCopyPnt.Y() = nY;
+ aCopyrightText.SetPosSizePixel( aCopyPnt, aCopySize );
+
+ nY += aCopySize.Height() + nCtrlMargin;
aOKPnt.X() = ( aOutSiz.Width() - aOKSiz.Width() ) / 2;
- aOKPnt.Y() = nY + 8;
+ aOKPnt.Y() = nY;
aOKButton.SetPosPixel( aOKPnt );
- nY = aOKPnt.Y() + aOKSiz.Height() + a6Size.Height();
- aOutSiz.Height() = nY;
+
+ // Change the width of the dialog
SetOutputSizePixel( aOutSiz );
FreeResource();
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx
index 9e6d69d497..c96fa7008b 100644
--- a/sfx2/source/dialog/basedlgs.cxx
+++ b/sfx2/source/dialog/basedlgs.cxx
@@ -426,7 +426,7 @@ long SfxModelessDialog::Notify( NotifyEvent& rEvt )
}
if ( nHelpId )
- SfxHelp::OpenHelpAgent( pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame(), nHelpId );
+ SfxHelp::OpenHelpAgent( &pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame(), nHelpId );
}
else if ( rEvt.GetType() == EVENT_LOSEFOCUS && !HasChildPathFocus() )
{
@@ -528,7 +528,7 @@ long SfxFloatingWindow::Notify( NotifyEvent& rEvt )
}
if ( nHelpId )
- SfxHelp::OpenHelpAgent( pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame(), nHelpId );
+ SfxHelp::OpenHelpAgent( &pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame(), nHelpId );
}
else if ( rEvt.GetType() == EVENT_LOSEFOCUS )
{
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index e1d0307af7..2dc396956a 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -1600,8 +1600,8 @@ class DurationDialog_Impl : public ModalDialog
NumericField aMinuteNF;
FixedText aSecondFT;
NumericField aSecondNF;
- FixedText aHSecondFT;
- NumericField aHSecondNF;
+ FixedText aMSecondFT;
+ NumericField aMSecondNF;
public:
@@ -1613,8 +1613,9 @@ public:
/*-- 20.11.2009 15:40:46---------------------------------------------------
-----------------------------------------------------------------------*/
-DurationDialog_Impl::DurationDialog_Impl( Window* pParent, const util::Duration& rDuration ) :
- ModalDialog( pParent, SfxResId( RID_EDIT_DURATIONS ) ),
+DurationDialog_Impl::DurationDialog_Impl(
+ Window* pParent, const util::Duration& rDuration)
+ : ModalDialog( pParent, SfxResId( RID_EDIT_DURATIONS ) ),
aDurationFL(this, SfxResId( FL_DURATION )),
aOKPB( this, SfxResId( PB_OK )),
aCancelPB( this, SfxResId( PB_CANCEL )),
@@ -1632,8 +1633,8 @@ DurationDialog_Impl::DurationDialog_Impl( Window* pParent, const util::Duration&
aMinuteNF( this, SfxResId( ED_MINUTE )),
aSecondFT( this, SfxResId( FT_SECOND )),
aSecondNF( this, SfxResId( ED_SECOND )),
- aHSecondFT( this, SfxResId( FT_HSECOND )),
- aHSecondNF( this, SfxResId( ED_HSECOND ))
+ aMSecondFT( this, SfxResId( FT_MSECOND )),
+ aMSecondNF( this, SfxResId( ED_MSECOND ))
{
FreeResource();
aNegativeCB.Check(rDuration.Negative);
@@ -1643,7 +1644,7 @@ DurationDialog_Impl::DurationDialog_Impl( Window* pParent, const util::Duration&
aHourNF.SetValue(rDuration.Hours );
aMinuteNF.SetValue(rDuration.Minutes);
aSecondNF.SetValue(rDuration.Seconds);
- aHSecondNF.SetValue(rDuration.HundredthSeconds);
+ aMSecondNF.SetValue(rDuration.MilliSeconds);
}
/*-- 20.11.2009 16:08:55---------------------------------------------------
@@ -1664,7 +1665,7 @@ util::Duration DurationDialog_Impl::GetDuration() const
aRet.Hours = aHourNF.GetValue( );
aRet.Minutes = aMinuteNF.GetValue();
aRet.Seconds = aSecondNF.GetValue();
- aRet.HundredthSeconds = aHSecondNF.GetValue();
+ aRet.MilliSeconds = aMSecondNF.GetValue();
return aRet;
}
@@ -2126,12 +2127,12 @@ void CustomPropertiesWindow::AddLine( const ::rtl::OUString& sName, Any& rAny )
nType = CUSTOM_TYPE_DATE;
pNewLine->m_aDateField.SetDate( Date( aTmpDate.Day, aTmpDate.Month, aTmpDate.Year ) );
- }
+ }
else if ( rAny >>= aTmpDuration )
{
nType = CUSTOM_TYPE_DURATION;
pNewLine->m_aDurationField.SetDuration( aTmpDuration );
- }
+ }
else if ( rAny >>= aTmpDateTime )
{
pNewLine->m_aDateField.SetDate( Date( aTmpDateTime.Day, aTmpDateTime.Month, aTmpDateTime.Year ) );
diff --git a/sfx2/source/dialog/dinfdlg.hrc b/sfx2/source/dialog/dinfdlg.hrc
index e91c8fb6eb..774b91b637 100644
--- a/sfx2/source/dialog/dinfdlg.hrc
+++ b/sfx2/source/dialog/dinfdlg.hrc
@@ -169,8 +169,8 @@
#define ED_MINUTE 113
#define FT_SECOND 114
#define ED_SECOND 115
-#define FT_HSECOND 116
-#define ED_HSECOND 117
+#define FT_MSECOND 116
+#define ED_MSECOND 117
#define FL_DURATION 118
#endif
diff --git a/sfx2/source/dialog/dinfdlg.src b/sfx2/source/dialog/dinfdlg.src
index 84a5b55ba3..c8c7d09099 100644
--- a/sfx2/source/dialog/dinfdlg.src
+++ b/sfx2/source/dialog/dinfdlg.src
@@ -877,14 +877,14 @@ ModalDialog RID_EDIT_DURATIONS
SpinSize = 1 ;
Value = 0 ;
};
- FixedText FT_HSECOND
+ FixedText FT_MSECOND
{
Pos = MAP_APPFONT ( 6 , 122 ) ;
Size = MAP_APPFONT ( 60 , RSC_CD_FIXEDTEXT_HEIGHT ) ;
Left = TRUE ;
- Text [ en-US ] = "1/100 se~conds" ;
+ Text [ en-US ] = "Millise~conds" ;
};
- NumericField ED_HSECOND
+ NumericField ED_MSECOND
{
Border = TRUE ;
Pos = MAP_APPFONT ( 70 , 120 ) ;
@@ -893,7 +893,7 @@ ModalDialog RID_EDIT_DURATIONS
Spin = TRUE ;
Minimum = 0 ;
First = 1 ;
- Last = 100 ;
+ Last = 1000 ;
SpinSize = 1 ;
Value = 0 ;
};
diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx
index 4d3bc0c22c..c090ccc532 100644
--- a/sfx2/source/dialog/dockwin.cxx
+++ b/sfx2/source/dialog/dockwin.cxx
@@ -161,7 +161,7 @@ SfxDockingWrapper::SfxDockingWrapper( Window* pParentWnd ,
if (xFactoryMgr.is())
{
SfxDispatcher* pDispatcher = pBindings->GetDispatcher();
- uno::Reference< frame::XFrame > xFrame( pDispatcher->GetFrame()->GetFrame()->GetFrameInterface(), uno::UNO_QUERY );
+ uno::Reference< frame::XFrame > xFrame( pDispatcher->GetFrame()->GetFrame().GetFrameInterface(), uno::UNO_QUERY );
uno::Sequence< uno::Any > aArgs(2);
beans::PropertyValue aPropValue;
aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Frame" ));
@@ -1852,7 +1852,7 @@ long SfxDockingWindow::Notify( NotifyEvent& rEvt )
}
if ( nHelpId )
- SfxHelp::OpenHelpAgent( pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame(), nHelpId );
+ SfxHelp::OpenHelpAgent( &pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame(), nHelpId );
// In VCL geht Notify zun"achst an das Fenster selbst,
// also base class rufen, sonst erf"ahrt der parent nichts
diff --git a/sfx2/source/dialog/mailmodelapi.cxx b/sfx2/source/dialog/mailmodelapi.cxx
index 2c138d561c..bedb057c7e 100644
--- a/sfx2/source/dialog/mailmodelapi.cxx
+++ b/sfx2/source/dialog/mailmodelapi.cxx
@@ -328,14 +328,6 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocument( const ::rtl::OUString& _sAt
// save the document
if ( xMod.is() )
{
- // save old settings
-/*
- BOOL bModified = xMod->isModified();
- // prepare for mail export
- TODO
- SfxDispatcher* pDisp = pTopViewFrm->GetDispatcher();
- pDisp->Execute( SID_MAIL_PREPAREEXPORT, SFX_CALLMODE_SYNCHRON );
-*/
// detect filter
const SfxFilter* pFilter = SfxFilter::GetDefaultFilter(lcl_getFactoryName(_xModel));
// sal_Bool bHasFilter = pFilter != NULL;
@@ -432,14 +424,6 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocAsPDF( const ::rtl::OUString& _sAt
// save the document
if ( xMod.is() )
{
- /* TODO
- // save old settings
- BOOL bModified = xMod->isModified();
- // prepare for mail export
- SfxDispatcher* pDisp = pTopViewFrm->GetDispatcher();
- pDisp->Execute( SID_MAIL_PREPAREEXPORT, SFX_CALLMODE_SYNCHRON );
- */
-
// Get PDF Filter from document
::rtl::OUString sPDFMediaType(RTL_CONSTASCII_USTRINGPARAM("application/pdf"));
diff --git a/sfx2/source/dialog/partwnd.cxx b/sfx2/source/dialog/partwnd.cxx
index 9e61959ed7..747560edba 100644
--- a/sfx2/source/dialog/partwnd.cxx
+++ b/sfx2/source/dialog/partwnd.cxx
@@ -178,7 +178,7 @@ SfxPartDockWnd_Impl::SfxPartDockWnd_Impl
if ( pBind->GetDispatcher() )
{
::com::sun::star::uno::Reference < ::com::sun::star::frame::XFramesSupplier >
- xSupp ( pBind->GetDispatcher()->GetFrame()->GetFrame()->GetFrameInterface(), ::com::sun::star::uno::UNO_QUERY );
+ xSupp ( pBind->GetDispatcher()->GetFrame()->GetFrame().GetFrameInterface(), ::com::sun::star::uno::UNO_QUERY );
if ( xSupp.is() )
xSupp->getFrames()->append( xFrame );
}
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index ad738ed2a8..5bb4a26fcf 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -1788,7 +1788,7 @@ long SfxTabDialog::Notify( NotifyEvent& rNEvt )
}
if ( nHelpId )
- SfxHelp::OpenHelpAgent( pViewFrame->GetFrame(), nHelpId );
+ SfxHelp::OpenHelpAgent( &pViewFrame->GetFrame(), nHelpId );
}
}
diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx
index 2a6a582ca8..6f9c9d0bd5 100644
--- a/sfx2/source/doc/SfxDocumentMetaData.cxx
+++ b/sfx2/source/doc/SfxDocumentMetaData.cxx
@@ -585,7 +585,9 @@ sal_Int32 textToDuration(::rtl::OUString const& i_rText) throw ()
{
css::util::Duration d;
if (textToDuration(d, i_rText)) {
- return (d.Days * (24*3600))
+ // #i107372#: approximate years/months
+ const sal_Int32 days( (d.Years * 365) + (d.Months * 30) + d.Days );
+ return (days * (24*3600))
+ (d.Hours * 3600) + (d.Minutes * 60) + d.Seconds;
} else {
return 0; // default
@@ -608,7 +610,7 @@ sal_Int32 textToDuration(::rtl::OUString const& i_rText) throw ()
ud.Hours = static_cast<sal_Int16>((i_value % (24 * 3600)) / 3600);
ud.Minutes = static_cast<sal_Int16>((i_value % 3600) / 60);
ud.Seconds = static_cast<sal_Int16>(i_value % 60);
- ud.HundredthSeconds = 0;
+ ud.MilliSeconds = 0;
return durationToText(ud);
}
@@ -925,8 +927,13 @@ propsToStrings(css::uno::Reference<css::beans::XPropertySet> const & i_xPropSet)
values.push_back(s);
// #i90847# OOo 2.x does stupid things if value-type="string";
// fortunately string is default anyway, so we can just omit it
-// as.push_back(std::make_pair(vt,
-// ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("string"))));
+// #i107502#: however, OOo 2.x only reads 4 user-defined without @value-type
+// => best backward compatibility: first 4 without @value-type, rest with
+ if (4 <= i)
+ {
+ as.push_back(std::make_pair(vt,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("string"))));
+ }
} else if (type == ::cppu::UnoType<css::util::DateTime>::get()) {
css::util::DateTime dt;
any >>= dt;
@@ -948,7 +955,7 @@ propsToStrings(css::uno::Reference<css::beans::XPropertySet> const & i_xPropSet)
ud.Hours = ut.Hours;
ud.Minutes = ut.Minutes;
ud.Seconds = ut.Seconds;
- ud.HundredthSeconds = ut.HundredthSeconds;
+ ud.MilliSeconds = 10 * ut.HundredthSeconds;
values.push_back(durationToText(ud));
as.push_back(std::make_pair(vt,
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("time"))));
diff --git a/sfx2/source/doc/commitlistener.cxx b/sfx2/source/doc/commitlistener.cxx
deleted file mode 100644
index 73e0d10683..0000000000
--- a/sfx2/source/doc/commitlistener.cxx
+++ /dev/null
@@ -1,81 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sfx2.hxx"
-
-#include "commitlistener.hxx"
-
-using namespace ::com::sun::star;
-
-OChildCommitListen_Impl::OChildCommitListen_Impl( SfxBaseModel& aModel )
-: m_pModel( &aModel )
-{}
-
-OChildCommitListen_Impl::~OChildCommitListen_Impl()
-{}
-
-void OChildCommitListen_Impl::OwnerIsDisposed()
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- m_pModel = NULL;
-}
-
-void SAL_CALL OChildCommitListen_Impl::preCommit( const ::com::sun::star::lang::EventObject& )
- throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException)
-{
- // not interesting
-}
-
-void SAL_CALL OChildCommitListen_Impl::commited( const ::com::sun::star::lang::EventObject& /*aEvent*/ )
- throw (::com::sun::star::uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- // StorageIsModified_Impl must not contain any locking!
- if ( m_pModel )
- m_pModel->StorageIsModified_Impl();
-}
-
-void SAL_CALL OChildCommitListen_Impl::preRevert( const ::com::sun::star::lang::EventObject& )
- throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException)
-{
- // not interesting
-}
-
-void SAL_CALL OChildCommitListen_Impl::reverted( const ::com::sun::star::lang::EventObject& )
- throw (::com::sun::star::uno::RuntimeException)
-{
- // not interesting
-}
-
-
-void SAL_CALL OChildCommitListen_Impl::disposing( const lang::EventObject& )
- throw ( uno::RuntimeException )
-{
- // not interesting
-}
-
diff --git a/sfx2/source/doc/commitlistener.hxx b/sfx2/source/doc/commitlistener.hxx
deleted file mode 100644
index bffcd508d4..0000000000
--- a/sfx2/source/doc/commitlistener.hxx
+++ /dev/null
@@ -1,57 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef __COMMITLISTENER_HXX_
-#define __COMMITLISTENER_HXX_
-
-#include <com/sun/star/embed/XTransactionListener.hpp>
-#include <cppuhelper/implbase1.hxx>
-#include <osl/mutex.hxx>
-
-#include <sfx2/sfxbasemodel.hxx>
-
-class OChildCommitListen_Impl : public ::cppu::WeakImplHelper1 < ::com::sun::star::embed::XTransactionListener >
-{
- ::osl::Mutex m_aMutex;
- SfxBaseModel* m_pModel;
-
-public:
- OChildCommitListen_Impl( SfxBaseModel& aStorage );
- virtual ~OChildCommitListen_Impl();
-
- void OwnerIsDisposed();
-
- virtual void SAL_CALL preCommit( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL commited( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL preRevert( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL reverted( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException);
-
- virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
-};
-
-#endif
-
diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx
index 93acc40a89..e0c75790d0 100644
--- a/sfx2/source/doc/docfac.cxx
+++ b/sfx2/source/doc/docfac.cxx
@@ -284,6 +284,14 @@ const SvGlobalName& SfxObjectFactory::GetClassId() const
return pImpl->aClassName;
}
+String SfxObjectFactory::GetFactoryURL() const
+{
+ ::rtl::OUStringBuffer aURLComposer;
+ aURLComposer.appendAscii( "private:factory/" );
+ aURLComposer.appendAscii( GetShortName() );
+ return aURLComposer.makeStringAndClear();
+}
+
String SfxObjectFactory::GetModuleName() const
{
static ::rtl::OUString SERVICENAME_MODULEMANAGER = ::rtl::OUString::createFromAscii("com.sun.star.frame.ModuleManager");
@@ -302,10 +310,36 @@ String SfxObjectFactory::GetModuleName() const
::rtl::OUString sModuleName = aPropSet.getUnpackedValueOrDefault(PROP_MODULEUINAME, ::rtl::OUString());
return String(sModuleName);
}
- catch(const css::uno::RuntimeException& exRun)
- { throw exRun; }
+ catch(const css::uno::RuntimeException&)
+ { throw; }
catch(const css::uno::Exception&)
{}
return String();
}
+
+
+sal_uInt16 SfxObjectFactory::GetViewNo_Impl( const sal_uInt16 i_nViewId, const sal_uInt16 i_nFallback ) const
+{
+ for ( sal_uInt16 curViewNo = 0; curViewNo < GetViewFactoryCount(); ++curViewNo )
+ {
+ const sal_uInt16 curViewId = GetViewFactory( curViewNo ).GetOrdinal();
+ if ( i_nViewId == curViewId )
+ return curViewNo;
+ }
+ return i_nFallback;
+}
+
+SfxViewFactory* SfxObjectFactory::GetViewFactoryByViewName( const String& i_rViewName ) const
+{
+ for ( USHORT nViewNo = 0;
+ nViewNo < GetViewFactoryCount();
+ ++nViewNo
+ )
+ {
+ SfxViewFactory& rViewFac( GetViewFactory( nViewNo ) );
+ if ( rViewFac.GetViewName() == i_rViewName )
+ return &rViewFac;
+ }
+ return NULL;
+}
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index df9477c489..b5f0358d29 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -133,7 +133,6 @@ using namespace ::com::sun::star::io;
#include <unotools/saveopt.hxx>
#include <svl/documentlockfile.hxx>
-#include "opostponedtruncationstream.hxx"
#include "helper.hxx"
#include <sfx2/request.hxx> // SFX_ITEMSET_SET
#include <sfx2/app.hxx> // GetFilterMatcher
@@ -260,79 +259,6 @@ void SAL_CALL SfxMediumHandler_Impl::handle( const com::sun::star::uno::Referenc
}
//----------------------------------------------------------------
-class SfxPoolCancelManager_Impl : public SfxCancelManager ,
- public SfxCancellable ,
- public SfxListener ,
- public SvRefBase
-{
- SfxCancelManagerWeak wParent;
-
- ~SfxPoolCancelManager_Impl();
-public:
- SfxPoolCancelManager_Impl( SfxCancelManager* pParent, const String& rName );
-
- virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
- using SfxCancelManager::Cancel;
- virtual void Cancel();
-};
-
-//----------------------------------------------------------------
-SV_DECL_IMPL_REF( SfxPoolCancelManager_Impl )
-
-
-//----------------------------------------------------------------
-SfxPoolCancelManager_Impl::SfxPoolCancelManager_Impl( SfxCancelManager* pParent, const String& rName )
- : SfxCancelManager( pParent ),
- SfxCancellable( pParent ? pParent : this, rName ),
- wParent( pParent )
-{
- if( pParent )
- {
- StartListening( *this );
- SetManager( 0 );
- }
-}
-
-//----------------------------------------------------------------
-SfxPoolCancelManager_Impl::~SfxPoolCancelManager_Impl()
-{
- for( sal_uInt16 nPos = GetCancellableCount(); nPos--; )
- {
- // nicht an Parent uebernehmen!
- SfxCancellable* pCbl = GetCancellable( nPos );
- if ( pCbl )
- pCbl->SetManager( 0 );
- }
-}
-
-
-//----------------------------------------------------------------
-void SfxPoolCancelManager_Impl::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& /*rHint*/ )
-{
- if( !GetCancellableCount() ) SetManager( 0 );
- else if( !GetManager() )
- {
- if( !wParent.Is() ) wParent = SFX_APP()->GetCancelManager();
- SetManager( wParent );
- }
-}
-
-//----------------------------------------------------------------
-void SfxPoolCancelManager_Impl::Cancel()
-{
- SfxPoolCancelManager_ImplRef xThis = this;
- for( sal_uInt16 nPos = GetCancellableCount(); nPos--; )
- {
- SfxCancellable* pCbl = GetCancellable( nPos );
- // Wenn wir nicht im Button stehen
- if( pCbl && pCbl != this )
- pCbl->Cancel();
- if( GetCancellableCount() < nPos )
- nPos = GetCancellableCount();
- }
-}
-
-//----------------------------------------------------------------
class SfxMedium_Impl : public SvCompatWeakBase
{
public:
@@ -340,7 +266,6 @@ public:
sal_Bool bUpdatePickList : 1;
sal_Bool bIsTemp : 1;
sal_Bool bForceSynchron : 1;
- sal_Bool bDontCreateCancellable : 1;
sal_Bool bDownloadDone : 1;
sal_Bool bDontCallDoneLinkOnSharingError : 1;
sal_Bool bIsStorage: 1;
@@ -356,7 +281,6 @@ public:
uno::Reference < embed::XStorage > xStorage;
- SfxPoolCancelManager_ImplRef xCancelManager;
SfxMedium* pAntiImpl;
long nFileVersion;
@@ -399,8 +323,6 @@ public:
uno::Reference< logging::XSimpleLogRing > m_xLogRing;
- SfxPoolCancelManager_Impl* GetCancelManager();
-
SfxMedium_Impl( SfxMedium* pAntiImplP );
~SfxMedium_Impl();
};
@@ -416,29 +338,12 @@ void SfxMedium::Cancel_Impl()
SetError( ERRCODE_IO_GENERAL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
}
-SfxPoolCancelManager_Impl* SfxMedium_Impl::GetCancelManager()
-{
- if( !xCancelManager.Is() )
- {
- if( !bDontCreateCancellable )
- xCancelManager = new SfxPoolCancelManager_Impl(
- wLoadTargetFrame ? wLoadTargetFrame->GetCancelManager() :
- SFX_APP()->GetCancelManager(),
- pAntiImpl->GetURLObject().GetURLNoPass() );
- else
- xCancelManager = new SfxPoolCancelManager_Impl(
- 0, pAntiImpl->GetURLObject().GetURLNoPass() );
- }
- return xCancelManager;
-}
-
//------------------------------------------------------------------
SfxMedium_Impl::SfxMedium_Impl( SfxMedium* pAntiImplP )
: SvCompatWeakBase( pAntiImplP ),
bUpdatePickList(sal_True),
bIsTemp( sal_False ),
bForceSynchron( sal_False ),
- bDontCreateCancellable( sal_False ),
bDownloadDone( sal_True ),
bDontCallDoneLinkOnSharingError( sal_False ),
bIsStorage( sal_False ),
@@ -2439,25 +2344,7 @@ void SfxMedium::GetMedium_Impl()
}
}
-//------------------------------------------------------------------
-SfxPoolCancelManager_Impl* SfxMedium::GetCancelManager_Impl() const
-{
- return pImp->GetCancelManager();
-}
-
-//------------------------------------------------------------------
-void SfxMedium::SetCancelManager_Impl( SfxPoolCancelManager_Impl* pMgr )
-{
- pImp->xCancelManager = pMgr;
-}
-
//----------------------------------------------------------------
-void SfxMedium::CancelTransfers()
-{
- if( pImp->xCancelManager.Is() )
- pImp->xCancelManager->Cancel();
-}
-
sal_Bool SfxMedium::IsRemote()
{
return bRemote;
@@ -3286,13 +3173,6 @@ sal_Bool SfxMedium::IsDownloadDone_Impl()
return pImp->bDownloadDone;
}
-//----------------------------------------------------------------
-
-void SfxMedium::SetDontCreateCancellable( )
-{
- pImp->bDontCreateCancellable = sal_True;
-}
-
::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SfxMedium::GetInputStream()
{
if ( !pImp->xInputStream.is() )
diff --git a/sfx2/source/doc/makefile.mk b/sfx2/source/doc/makefile.mk
index 7da456ebaa..b766921e34 100644
--- a/sfx2/source/doc/makefile.mk
+++ b/sfx2/source/doc/makefile.mk
@@ -75,7 +75,6 @@ SLOFILES = \
$(SLO)$/objembed.obj\
$(SLO)$/graphhelp.obj \
$(SLO)$/QuerySaveDocument.obj \
- $(SLO)$/opostponedtruncationstream.obj \
$(SLO)$/docinsert.obj \
$(SLO)$/docmacromode.obj \
$(SLO)$/SfxDocumentMetaData.obj \
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx
index c25b0d79b0..301a2546c2 100644
--- a/sfx2/source/doc/objcont.cxx
+++ b/sfx2/source/doc/objcont.cxx
@@ -47,8 +47,8 @@
#include <svl/eitem.hxx>
#include <svl/urihelper.hxx>
#include <svl/ctloptions.hxx>
-#include <comphelper/processfactory.hxx>
#include <comphelper/storagehelper.hxx>
+#include <comphelper/processfactory.hxx>
#include <unotools/securityoptions.hxx>
#include <svtools/sfxecode.hxx>
#include <svtools/ehdl.hxx>
@@ -74,7 +74,7 @@
#include "sfxhelp.hxx"
#include <sfx2/dispatch.hxx>
#include <sfx2/printer.hxx>
-#include <sfx2/topfrm.hxx>
+#include <sfx2/viewfrm.hxx>
#include "basmgr.hxx"
#include <sfx2/doctempl.hxx>
#include "doc.hrc"
@@ -89,9 +89,6 @@ using namespace ::com::sun::star::uno;
//====================================================================
-#define SFX_WINDOWS_STREAM "SfxWindows"
-#define SFX_PREVIEW_STREAM "SfxPreview"
-
//====================================================================
static
@@ -189,252 +186,6 @@ SfxObjectShell::CreatePreviewMetaFile_Impl( sal_Bool bFullContent, sal_Bool bHig
return pFile;
}
-//REMOVE FASTBOOL SfxObjectShell::SaveWindows_Impl( SvStorage &rStor ) const
-//REMOVE {
-//REMOVE SvStorageStreamRef xStream = rStor.OpenStream( DEFINE_CONST_UNICODE( SFX_WINDOWS_STREAM ),
-//REMOVE STREAM_TRUNC | STREAM_STD_READWRITE);
-//REMOVE if ( !xStream )
-//REMOVE return FALSE;
-//REMOVE
-//REMOVE xStream->SetBufferSize(1024);
-//REMOVE xStream->SetVersion( rStor.GetVersion() );
-//REMOVE
-//REMOVE // "uber alle Fenster iterieren (aber aktives Window zuletzt)
-//REMOVE SfxViewFrame *pActFrame = SfxViewFrame::Current();
-//REMOVE if ( !pActFrame || pActFrame->GetObjectShell() != this )
-//REMOVE pActFrame = SfxViewFrame::GetFirst(this);
-//REMOVE
-//REMOVE String aActWinData;
-//REMOVE for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst(this, TYPE(SfxTopViewFrame) ); pFrame;
-//REMOVE pFrame = SfxViewFrame::GetNext(*pFrame, this, TYPE(SfxTopViewFrame) ) )
-//REMOVE {
-//REMOVE // Bei Dokumenten, die Outplace aktiv sind, kann beim Speichern auch schon die View weg sein!
-//REMOVE if ( pFrame->GetViewShell() )
-//REMOVE {
-//REMOVE SfxTopFrame* pTop = (SfxTopFrame*) pFrame->GetFrame();
-//REMOVE pTop->GetTopWindow_Impl();
-//REMOVE
-//REMOVE char cToken = ',';
-//REMOVE const BOOL bActWin = pActFrame == pFrame;
-//REMOVE String aUserData;
-//REMOVE pFrame->GetViewShell()->WriteUserData(aUserData);
-//REMOVE
-//REMOVE // assemble ini-data
-//REMOVE String aWinData;
-//REMOVE aWinData += String::CreateFromInt32( pFrame->GetCurViewId() );
-//REMOVE aWinData += cToken;
-//REMOVE /*
-//REMOVE if ( !pWin || pWin->IsMaximized() )
-//REMOVE aWinData += SFX_WINSIZE_MAX;
-//REMOVE else if ( pWin->IsMinimized() )
-//REMOVE aWinData += SFX_WINSIZE_MIN;
-//REMOVE else
-//REMOVE */
-//REMOVE aWinData += cToken;
-//REMOVE aWinData += aUserData;
-//REMOVE
-//REMOVE // aktives kennzeichnen
-//REMOVE aWinData += cToken;
-//REMOVE aWinData += bActWin ? '1' : '0';
-//REMOVE
-//REMOVE // je nachdem merken oder abspeichern
-//REMOVE if ( bActWin )
-//REMOVE aActWinData = aWinData;
-//REMOVE else
-//REMOVE xStream->WriteByteString( aWinData );
-//REMOVE }
-//REMOVE }
-//REMOVE
-//REMOVE // aktives Window hinterher
-//REMOVE xStream->WriteByteString( aActWinData );
-//REMOVE return !xStream->GetError();
-//REMOVE }
-
-//====================================================================
-
-SfxViewFrame* SfxObjectShell::LoadWindows_Impl( SfxTopFrame *pPreferedFrame )
-{
- DBG_ASSERT( pPreferedFrame, "Call without preferred Frame is not supported anymore!" );
- if ( pImp->bLoadingWindows || !pPreferedFrame )
- return NULL;
-
- DBG_ASSERT( GetMedium(), "A Medium should exist here!");
- if( !GetMedium() )
- return 0;
-
- // get correct mode
- SFX_APP();
- SfxViewFrame *pPrefered = pPreferedFrame ? pPreferedFrame->GetCurrentViewFrame() : 0;
- SvtSaveOptions aOpt;
- BOOL bLoadDocWins = aOpt.IsSaveDocWins() && !pPrefered;
-
- // try to get viewdata information for XML format
- REFERENCE < XVIEWDATASUPPLIER > xViewDataSupplier( GetModel(), ::com::sun::star::uno::UNO_QUERY );
- REFERENCE < XINDEXACCESS > xViewData;
-
- if ( xViewDataSupplier.is() )
- {
- xViewData = xViewDataSupplier->getViewData();
- if ( !xViewData.is() )
- return NULL;
- }
- else
- return NULL;
-
- SfxViewFrame *pActiveFrame = 0;
- String aWinData;
- SfxItemSet *pSet = GetMedium()->GetItemSet();
-
- pImp->bLoadingWindows = TRUE;
- BOOL bLoaded = FALSE;
- sal_Int32 nView = 0;
-
- // get saved information for all views
- while ( TRUE )
- {
- USHORT nViewId = 0;
- FASTBOOL bMaximized=FALSE;
- String aPosSize;
- String aUserData; // used in the binary format
- SEQUENCE < PROPERTYVALUE > aSeq; // used in the XML format
-
- // XML format
- // active view is the first view in the container
- FASTBOOL bActive = ( nView == 0 );
-
- if ( nView == xViewData->getCount() )
- // finished
- break;
-
- // get viewdata and look for the stored ViewId
- ::com::sun::star::uno::Any aAny = xViewData->getByIndex( nView++ );
- if ( aAny >>= aSeq )
- {
- for ( sal_Int32 n=0; n<aSeq.getLength(); n++ )
- {
- const PROPERTYVALUE& rProp = aSeq[n];
- if ( rProp.Name.compareToAscii("ViewId") == COMPARE_EQUAL )
- {
- ::rtl::OUString aId;
- rProp.Value >>= aId;
- String aTmp( aId );
- aTmp.Erase( 0, 4 ); // format is like in "view3"
- nViewId = (USHORT) aTmp.ToInt32();
- break;
- }
- }
- }
-
- // load only active view, but current item is not the active one ?
- // in XML format the active view is the first one
- if ( !bLoadDocWins && !bActive )
- break;
-
- // check for minimized/maximized/size
- if ( aPosSize.EqualsAscii( "max" ) )
- bMaximized = TRUE;
- else if ( aPosSize.EqualsAscii( "min" ) )
- {
- bMaximized = TRUE;
- bActive = FALSE;
- }
- else
- bMaximized = FALSE;
-
- Point aPt;
- Size aSz;
-
- pSet->ClearItem( SID_USER_DATA );
- SfxViewFrame *pFrame = 0;
- if ( pPrefered )
- {
- // use the frame from the arguments, but don't set a window size
- pFrame = pPrefered;
- if ( pFrame->GetViewShell() || !pFrame->GetObjectShell() )
- {
- pSet->ClearItem( SID_VIEW_POS_SIZE );
- pSet->ClearItem( SID_WIN_POSSIZE );
- pSet->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) );
-
- // avoid flickering controllers
- SfxBindings &rBind = pFrame->GetBindings();
- rBind.ENTERREGISTRATIONS();
-
- // set document into frame
- pPreferedFrame->InsertDocument( this );
-
- // restart controller updating
- rBind.LEAVEREGISTRATIONS();
- }
- else
- {
- // create new view
- pFrame->CreateView_Impl( nViewId );
- }
- }
- else
- {
- if ( bLoadDocWins )
- {
- // open in the background
- pSet->Put( SfxUInt16Item( SID_VIEW_ZOOM_MODE, 0 ) );
- if ( !bMaximized )
- pSet->Put( SfxRectangleItem( SID_VIEW_POS_SIZE, Rectangle( aPt, aSz ) ) );
- }
-
- pSet->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) );
-
- if ( pPreferedFrame )
- {
- // Frame "ubergeben, allerdings ist der noch leer
- pPreferedFrame->InsertDocument( this );
- pFrame = pPreferedFrame->GetCurrentViewFrame();
- }
- else
- {
- pFrame = SfxTopFrame::Create( this, nViewId, FALSE, pSet )->GetCurrentViewFrame();
- }
-
- // only temporary data, don't hold it in the itemset
- pSet->ClearItem( SID_VIEW_POS_SIZE );
- pSet->ClearItem( SID_WIN_POSSIZE );
- pSet->ClearItem( SID_VIEW_ZOOM_MODE );
- }
-
- bLoaded = TRUE;
-
- // UserData hier einlesen, da es ansonsten immer mit bBrowse=TRUE
- // aufgerufen wird, beim Abspeichern wurde aber bBrowse=FALSE verwendet
- if ( pFrame && pFrame->GetViewShell() )
- {
- if ( aUserData.Len() )
- pFrame->GetViewShell()->ReadUserData( aUserData, !bLoadDocWins );
- else if ( aSeq.getLength() )
- pFrame->GetViewShell()->ReadUserDataSequence( aSeq, !bLoadDocWins );
- }
-
- // perhaps there are more windows to load
- pPreferedFrame = NULL;
-
- if ( bActive )
- pActiveFrame = pFrame;
-
- if( pPrefered || !bLoadDocWins )
- // load only active window
- break;
- }
-
- if ( pActiveFrame )
- {
- if ( !pPrefered )
- // activate frame
- pActiveFrame->MakeActive_Impl( TRUE );
- }
-
- pImp->bLoadingWindows = FALSE;
- return pPrefered && bLoaded ? pPrefered : pActiveFrame;
-}
-
//====================================================================
void SfxObjectShell::UpdateDocInfoForSave()
@@ -479,13 +230,24 @@ void SfxObjectShell::UpdateDocInfoForSave()
//--------------------------------------------------------------------
+static void
+lcl_add(util::Duration & rDur, Time const& rTime)
+{
+ // here we don't care about overflow: rDur is converted back to seconds
+ // anyway, and Time cannot store more than ~4000 hours
+ rDur.Hours += rTime.GetHour();
+ rDur.Minutes += rTime.GetMin();
+ rDur.Seconds += rTime.GetSec();
+}
+
// Bearbeitungszeit aktualisieren
void SfxObjectShell::UpdateTime_Impl(
const uno::Reference<document::XDocumentProperties> & i_xDocProps)
{
// Get old time from documentinfo
- sal_Int32 secs = i_xDocProps->getEditingDuration();
- Time aOldTime(secs/3600, (secs%3600)/60, secs%60);
+ const sal_Int32 secs = i_xDocProps->getEditingDuration();
+ util::Duration editDuration(sal_False, 0, 0, 0,
+ secs/3600, (secs%3600)/60, secs%60, 0);
// Initialize some local member! Its neccessary for wollow operations!
DateTime aNow ; // Date and time at current moment
@@ -522,13 +284,14 @@ void SfxObjectShell::UpdateTime_Impl(
nAddTime += aNow ;
}
- aOldTime += nAddTime;
+ lcl_add(editDuration, nAddTime);
}
pImp->nTime = aNow;
try {
- i_xDocProps->setEditingDuration(
- aOldTime.GetHour()*3600+aOldTime.GetMin()*60+aOldTime.GetSec());
+ const sal_Int32 newSecs( (editDuration.Hours*3600)
+ + (editDuration.Minutes*60) + editDuration.Seconds);
+ i_xDocProps->setEditingDuration(newSecs);
i_xDocProps->setEditingCycles(i_xDocProps->getEditingCycles() + 1);
}
catch (lang::IllegalArgumentException &)
diff --git a/sfx2/source/doc/objembed.cxx b/sfx2/source/doc/objembed.cxx
index a2b7d47e7b..868f337102 100644
--- a/sfx2/source/doc/objembed.cxx
+++ b/sfx2/source/doc/objembed.cxx
@@ -305,7 +305,7 @@ void SfxObjectShell::DoDraw_Impl( OutputDevice* pDev,
comphelper::EmbeddedObjectContainer& SfxObjectShell::GetEmbeddedObjectContainer() const
{
if ( !pImp->mpObjectContainer )
- pImp->mpObjectContainer = new comphelper::EmbeddedObjectContainer( ((SfxObjectShell*)this)->GetStorage(), pImp->xModel );
+ pImp->mpObjectContainer = new comphelper::EmbeddedObjectContainer( ((SfxObjectShell*)this)->GetStorage(), GetModel() );
return *pImp->mpObjectContainer;
}
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 9373cdef27..3cb2177833 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -84,7 +84,7 @@
#include <comphelper/configurationhelper.hxx>
#include <com/sun/star/security/XDocumentDigitalSignatures.hpp>
-#include <com/sun/star/task/DocumentMacroConfirmationRequest2.hpp>
+#include <com/sun/star/task/DocumentMacroConfirmationRequest.hpp>
#include <com/sun/star/task/InteractionClassification.hpp>
#include <com/sun/star/frame/XModel.hpp>
@@ -405,17 +405,11 @@ void SfxObjectShell::ModifyChanged()
return;
{DBG_CHKTHIS(SfxObjectShell, 0);}
- SfxObjectShell *pDoc;
- for ( pDoc = SfxObjectShell::GetFirst(); pDoc;
- pDoc = SfxObjectShell::GetNext(*pDoc) )
- if( pDoc->IsModified() )
- break;
SfxViewFrame* pViewFrame = SfxViewFrame::Current();
if ( pViewFrame )
pViewFrame->GetBindings().Invalidate( SID_SAVEDOCS );
-
Invalidate( SID_SIGNATURE );
Invalidate( SID_MACRO_SIGNATURE );
Broadcast( SfxSimpleHint( SFX_HINT_TITLECHANGED ) ); // xmlsec05, signed state might change in title...
@@ -1134,7 +1128,7 @@ void SfxObjectShell::SetProgress_Impl
void SfxObjectShell::PostActivateEvent_Impl( SfxViewFrame* pFrame )
{
SfxApplication* pSfxApp = SFX_APP();
- if ( !pSfxApp->IsDowning() && !IsLoading() && pFrame && !pFrame->GetFrame()->IsClosing_Impl() )
+ if ( !pSfxApp->IsDowning() && !IsLoading() && pFrame && !pFrame->GetFrame().IsClosing_Impl() )
{
SFX_ITEMSET_ARG( pMedium->GetItemSet(), pHiddenItem, SfxBoolItem, SID_HIDDEN, sal_False );
if ( !pHiddenItem || !pHiddenItem->GetValue() )
@@ -1165,7 +1159,6 @@ void SfxObjectShell::RegisterTransfer( SfxMedium& rMedium )
laden, muessen an der zugehoerigen SfxObjectShell angemeldet
werden. So kann dokumentweise abgebrochen werden. */
{
- rMedium.SetCancelManager_Impl( GetMedium()->GetCancelManager_Impl() );
rMedium.SetReferer( GetMedium()->GetName() );
}
@@ -1437,8 +1430,7 @@ void SfxObjectShell::FinishedLoading( sal_uInt16 nFlags )
}
}
- pImp->bInitialized = sal_True;
- SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_LOADFINISHED, GlobalEventConfig::GetEventName(STR_EVENT_LOADFINISHED), this ) );
+ SetInitialized_Impl( false );
// Title is not available until loading has finished
Broadcast( SfxSimpleHint( SFX_HINT_TITLECHANGED ) );
@@ -1557,7 +1549,7 @@ void SfxObjectShell::PositionView_Impl()
sal_Bool SfxObjectShell::IsLoading() const
/* [Beschreibung ]
- Wurde bereits FinishedLoading aufgerufeb? */
+ Has FinishedLoading been called? */
{
return !( pImp->nLoadedFlags & SFX_LOADED_MAINDOCUMENT );
}
@@ -1569,7 +1561,6 @@ void SfxObjectShell::CancelTransfers()
Hier koennen Transfers gecanceled werden, die nicht mit
RegisterTransfer registiert wurden */
{
- GetMedium()->CancelTransfers();
if( ( pImp->nLoadedFlags & SFX_LOADED_ALL ) != SFX_LOADED_ALL )
{
AbortImport();
@@ -2028,12 +2019,6 @@ void SfxObjectShell::SetHeaderAttributesForSourceViewHack()
->SetAttributes();
}
-void SfxObjectShell::StartLoading_Impl()
-{
- pImp->nLoadedFlags = 0;
- pImp->bModelInitialized = sal_False;
-}
-
sal_Bool SfxObjectShell::IsPreview() const
{
if ( !pMedium )
@@ -2109,9 +2094,9 @@ void SfxObjectShell::SetWaitCursor( BOOL bSet ) const
for( SfxViewFrame* pFrame = SfxViewFrame::GetFirst( this ); pFrame; pFrame = SfxViewFrame::GetNext( *pFrame, this ) )
{
if ( bSet )
- pFrame->GetFrame()->GetWindow().EnterWait();
+ pFrame->GetFrame().GetWindow().EnterWait();
else
- pFrame->GetFrame()->GetWindow().LeaveWait();
+ pFrame->GetFrame().GetWindow().LeaveWait();
}
}
@@ -2149,13 +2134,11 @@ Window* SfxObjectShell::GetDialogParent( SfxMedium* pLoadingMedium )
{
Window* pWindow = 0;
SfxItemSet* pSet = pLoadingMedium ? pLoadingMedium->GetItemSet() : GetMedium()->GetItemSet();
- SFX_ITEMSET_ARG( pSet, pUnoItem, SfxUnoAnyItem, SID_FILLFRAME, FALSE );
+ SFX_ITEMSET_ARG( pSet, pUnoItem, SfxUnoFrameItem, SID_FILLFRAME, FALSE );
if ( pUnoItem )
{
- uno::Reference < frame::XFrame > xFrame;
- pUnoItem->GetValue() >>= xFrame;
- if ( xFrame.is() )
- pWindow = VCLUnoHelper::GetWindow( xFrame->getContainerWindow() );
+ uno::Reference < frame::XFrame > xFrame( pUnoItem->GetFrame() );
+ pWindow = VCLUnoHelper::GetWindow( xFrame->getContainerWindow() );
}
if ( !pWindow )
@@ -2173,7 +2156,7 @@ Window* SfxObjectShell::GetDialogParent( SfxMedium* pLoadingMedium )
// get any visible frame
pView = SfxViewFrame::GetFirst(this);
if ( pView )
- pFrame = pView->GetFrame();
+ pFrame = &pView->GetFrame();
}
if ( pFrame )
@@ -2242,7 +2225,7 @@ BOOL SfxObjectShell::IsInPlaceActive()
return FALSE;
SfxViewFrame* pFrame = SfxViewFrame::GetFirst( this );
- return pFrame && pFrame->GetFrame()->IsInPlace();
+ return pFrame && pFrame->GetFrame().IsInPlace();
}
BOOL SfxObjectShell::IsUIActive()
@@ -2251,7 +2234,7 @@ BOOL SfxObjectShell::IsUIActive()
return FALSE;
SfxViewFrame* pFrame = SfxViewFrame::GetFirst( this );
- return pFrame && pFrame->GetFrame()->IsInPlace() && pFrame->GetFrame()->GetWorkWindow_Impl()->IsVisible_Impl();
+ return pFrame && pFrame->GetFrame().IsInPlace() && pFrame->GetFrame().GetWorkWindow_Impl()->IsVisible_Impl();
}
void SfxObjectShell::UIActivate( BOOL )
@@ -2455,9 +2438,9 @@ sal_Bool SfxObjectShell_Impl::hasTrustedScriptingSignature( sal_Bool bAllowUIToA
if ( xInteraction.is() )
{
- task::DocumentMacroConfirmationRequest2 aRequest;
+ task::DocumentMacroConfirmationRequest aRequest;
aRequest.DocumentURL = getDocumentLocation();
- aRequest.DocumentZipStorage = rDocShell.GetMedium()->GetZipStorageToSign_Impl();
+ aRequest.DocumentStorage = rDocShell.GetMedium()->GetZipStorageToSign_Impl();
aRequest.DocumentSignatureInformation = aInfo;
aRequest.DocumentVersion = aVersion;
aRequest.Classification = task::InteractionClassification_QUERY;
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index ace54aa855..795f5a20ca 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -85,7 +85,7 @@
#include "sfxtypes.hxx"
//#include "interno.hxx"
#include <sfx2/module.hxx>
-#include <sfx2/topfrm.hxx>
+#include <sfx2/viewfrm.hxx>
#include "versdlg.hxx"
#include "doc.hrc"
#include <sfx2/docfac.hxx>
@@ -137,8 +137,6 @@ public:
#define SfxObjectShell
#include "sfxslots.hxx"
-svtools::AsynchronLink* pPendingCloser = 0;
-
//=========================================================================
@@ -280,7 +278,7 @@ void SfxObjectShell::PrintExec_Impl(SfxRequest &rReq)
void SfxObjectShell::PrintState_Impl(SfxItemSet &rSet)
{
bool bPrinting = false;
- SfxViewFrame *pFrame = SfxViewFrame::GetFirst(this, TYPE(SfxTopViewFrame));
+ SfxViewFrame* pFrame = SfxViewFrame::GetFirst( this );
if ( pFrame )
{
SfxPrinter *pPrinter = pFrame->GetViewShell()->GetPrinter();
@@ -388,7 +386,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
if ( !pFrame )
return;
- if ( pFrame->GetFrame()->GetParentFrame() )
+ if ( pFrame->GetFrame().GetParentFrame() )
{
pFrame->GetTopViewFrame()->GetObjectShell()->ExecuteSlot( rReq );
return;
@@ -427,28 +425,15 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
// collect data for dialog
String aURL, aTitle;
- if ( HasName() && !pImp->aNewName.Len() )
+ if ( HasName() )
{
aURL = GetMedium()->GetName();
aTitle = GetTitle();
}
else
{
- if ( !pImp->aNewName.Len() )
- {
- aURL = DEFINE_CONST_UNICODE( "private:factory/" );
- aURL += String::CreateFromAscii( GetFactory().GetShortName() );
- // aTitle = String( SfxResId( STR_NONAME ) );
- }
- else
- {
- aURL = DEFINE_CONST_UNICODE( "[private:factory/" );
- aURL += String::CreateFromAscii( GetFactory().GetShortName() );
- aURL += DEFINE_CONST_UNICODE( "]" );
- INetURLObject aURLObj( pImp->aNewName );
- aURL += String(aURLObj.GetMainURL( INetURLObject::DECODE_TO_IURI ));
- // aTitle = aURLObj.GetBase();
- }
+ aURL = DEFINE_CONST_UNICODE( "private:factory/" );
+ aURL += String::CreateFromAscii( GetFactory().GetShortName() );
aTitle = GetTitle();
}
@@ -539,10 +524,10 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
// get statusindicator
uno::Reference< task::XStatusIndicator > xStatusIndicator;
SfxViewFrame *pFrame = GetFrame();
- if ( pFrame && pFrame->GetFrame() )
+ if ( pFrame )
{
uno::Reference< task::XStatusIndicatorFactory > xStatFactory(
- pFrame->GetFrame()->GetFrameInterface(),
+ pFrame->GetFrame().GetFrameInterface(),
uno::UNO_QUERY );
if( xStatFactory.is() )
xStatusIndicator = xStatFactory->createStatusIndicator();
@@ -662,9 +647,8 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
&& pFilt->GetVersion() >= SOFFICE_FILEFORMAT_60 )
{
SfxViewFrame* pDocViewFrame = SfxViewFrame::GetFirst( this );
- SfxFrame* pDocFrame = pDocViewFrame ? pDocViewFrame->GetFrame() : NULL;
- if ( pDocFrame )
- SfxHelp::OpenHelpAgent( pDocFrame, HID_DID_SAVE_PACKED_XML );
+ if ( pDocViewFrame )
+ SfxHelp::OpenHelpAgent( &pDocViewFrame->GetFrame(), HID_DID_SAVE_PACKED_XML );
}
// the StoreAsURL/StoreToURL method have called this method with false
@@ -728,7 +712,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
case SID_CLOSEDOC:
{
SfxViewFrame *pFrame = GetFrame();
- if ( pFrame && pFrame->GetFrame()->GetParentFrame() )
+ if ( pFrame && pFrame->GetFrame().GetParentFrame() )
{
// Wenn SID_CLOSEDOC "uber Menue etc. ausgef"uhrt wird, das
// aktuelle Dokument aber in einem Frame liegt, soll eigentlich
@@ -743,7 +727,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
pFrame = SfxViewFrame::GetFirst( this );
while ( pFrame )
{
- if ( pFrame->GetFrame()->GetParentFrame() )
+ if ( pFrame->GetFrame().GetParentFrame() )
{
// Auf dieses Dokument existiert noch eine Sicht, die
// in einem FrameSet liegt; diese darf nat"urlich nicht
@@ -762,8 +746,8 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
pFrame = SfxViewFrame::GetFirst( this );
while ( pFrame )
{
- if ( !pFrame->GetFrame()->GetParentFrame() )
- pFrame->GetFrame()->DoClose();
+ if ( !pFrame->GetFrame().GetParentFrame() )
+ pFrame->GetFrame().DoClose();
pFrame = SfxViewFrame::GetNext( *pFrame, this );
}
}
@@ -937,7 +921,7 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet)
pFrame = SfxViewFrame::GetFirst( this );
if ( pFrame )
{
- if ( pFrame->GetFrame()->GetParentFrame() )
+ if ( pFrame->GetFrame().GetParentFrame() )
{
pFrame = pFrame->GetTopViewFrame();
pDoc = pFrame->GetObjectShell();
@@ -970,7 +954,7 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet)
{
SfxObjectShell *pDoc = this;
SfxViewFrame *pFrame = GetFrame();
- if ( pFrame && pFrame->GetFrame()->GetParentFrame() )
+ if ( pFrame && pFrame->GetFrame().GetParentFrame() )
{
// Wenn SID_CLOSEDOC "uber Menue etc. ausgef"uhrt wird, das
// aktuelle Dokument aber in einem Frame liegt, soll eigentlich
@@ -1190,7 +1174,7 @@ void SfxObjectShell::StateProps_Impl(SfxItemSet &rSet)
case SID_CLOSING:
{
- rSet.Put( SfxBoolItem( SID_CLOSING, Get_Impl()->bInCloseEvent ) );
+ rSet.Put( SfxBoolItem( SID_CLOSING, false ) );
break;
}
@@ -1215,10 +1199,9 @@ void SfxObjectShell::ExecView_Impl(SfxRequest &rReq)
{
case SID_ACTIVATE:
{
- SfxViewFrame *pFrame =
- SfxViewFrame::GetFirst( this, TYPE(SfxTopViewFrame), TRUE );
+ SfxViewFrame *pFrame = SfxViewFrame::GetFirst( this, TRUE );
if ( pFrame )
- pFrame->GetFrame()->Appear();
+ pFrame->GetFrame().Appear();
rReq.SetReturnValue( SfxObjectItem( 0, pFrame ) );
rReq.Done();
break;
@@ -1259,21 +1242,13 @@ sal_uInt16 SfxObjectShell::ImplCheckSignaturesInformation( const uno::Sequence<
bool bCompleteSignature = true;
if( nInfos )
{
- //These errors of certificates are allowed
- sal_Int32 nNonErrors = security::CertificateValidity::VALID |
- security::CertificateValidity::UNKNOWN_REVOKATION;
- //Build a mask to filter out the allowed errors
- sal_Int32 nMask = ~nNonErrors;
-
nResult = SIGNATURESTATE_SIGNATURES_OK;
for ( int n = 0; n < nInfos; n++ )
{
if ( bCertValid )
{
sal_Int32 nCertStat = aInfos[n].CertificateStatus;
- // "subtract" the allowed error flags from the result
- sal_Int32 nErrors = ( nCertStat & nMask );
- bCertValid = nErrors > 0 ? sal_False : sal_True;
+ bCertValid = nCertStat == security::CertificateValidity::VALID ? sal_True : sal_False;
}
if ( !aInfos[n].SignatureIsValid )
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 22fb955887..902793af73 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -208,31 +208,6 @@ sal_Bool GetPasswd_Impl( const SfxItemSet* pSet, ::rtl::OUString& rPasswd )
}
//-------------------------------------------------------------------------
-sal_Bool SfxObjectShell::NoDependencyFromManifest_Impl( const uno::Reference< embed::XStorage >& xStorage )
-{
- uno::Sequence< ::rtl::OUString > aElements = xStorage->getElementNames();
- for ( sal_Int32 nInd = 0; nInd < aElements.getLength(); nInd++ )
- {
- if ( xStorage->isStorageElement( aElements[nInd] ) )
- {
- // if there are other standard elements that do not need manifest.xml the following
- // list can be extended
- if ( !aElements[nInd].equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Pictures" ) ) )
- && !aElements[nInd].equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Configurations" ) ) )
- && !aElements[nInd].equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Configurations2" ) ) )
- && !aElements[nInd].equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Thumbnails" ) ) )
- && !aElements[nInd].equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Basic" ) ) ) )
- {
- // the substorage is not know as one that does not need manifest.xml
- return sal_False;
- }
- }
- }
-
- return sal_True;
-}
-
-//-------------------------------------------------------------------------
sal_Bool SfxObjectShell::PutURLContentsToVersionStream_Impl(
::rtl::OUString aURL,
const uno::Reference< embed::XStorage >& xDocStorage,
@@ -444,23 +419,6 @@ sal_Bool SfxObjectShell::Load( SfxMedium& rMedium )
return GeneralInit_Impl( rMedium.GetStorage(), sal_True );
}
-//-------------------------------------------------------------------------
-sal_Bool SfxObjectShell::DoInitNew_Impl( const ::rtl::OUString& rName )
-
-/* [Beschreibung]
-*/
-
-{
- if ( rName.getLength() )
- {
- DBG_ERROR( "This code is intended to be removed, the caller part must be checked!\n" );
- return DoInitNew(0);
- }
- else
- return DoInitNew(0);
-}
-
-
sal_Bool SfxObjectShell::DoInitNew( SfxMedium* pMed )
/* [Beschreibung]
@@ -515,9 +473,7 @@ sal_Bool SfxObjectShell::DoInitNew( SfxMedium* pMed )
impl_addToModelCollection(xModel);
}
- pImp->bInitialized = sal_True;
- SetActivateEvent_Impl( SFX_EVENT_CREATEDOC );
- SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_DOCCREATED, GlobalEventConfig::GetEventName(STR_EVENT_DOCCREATED), this ) );
+ SetInitialized_Impl( true );
return sal_True;
}
@@ -2592,6 +2548,7 @@ sal_Bool SfxObjectShell::DoSave_Impl( const SfxItemSet* pArgs )
// is a new medium "from scratch", so no version should be stored into it
SfxItemSet* pSet = new SfxAllItemSet(*pRetrMedium->GetItemSet());
pSet->ClearItem( SID_VERSION );
+ pSet->ClearItem( SID_DOC_BASEURL );
// create a medium as a copy; this medium is only for writingm, because it uses the same name as the original one
// writing is done through a copy, that will be transferred to the target ( of course after calling HandsOff )
@@ -2815,7 +2772,6 @@ sal_Bool SfxObjectShell::CommonSaveAs_Impl
pSet->ClearItem( SID_OPTIONS );
//pSet->ClearItem( SID_FILE_FILTEROPTIONS );
pSet->ClearItem( SID_VERSION );
- //pSet->ClearItem( SID_USE_FILTEROPTIONS );
pSet->ClearItem( SID_EDITDOC );
pSet->ClearItem( SID_OVERWRITE );
pSet->ClearItem( SID_DEFAULTFILEPATH );
@@ -2878,6 +2834,7 @@ sal_Bool SfxObjectShell::PreDoSaveAs_Impl
pMergedParams->ClearItem( SID_STREAM );
pMergedParams->ClearItem( SID_CONTENT );
pMergedParams->ClearItem( SID_DOC_READONLY );
+ pMergedParams->ClearItem( SID_DOC_BASEURL );
pMergedParams->ClearItem( SID_REPAIRPACKAGE );
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index b114960b20..2298b93486 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -62,6 +62,7 @@
#include <sfx2/objsh.hxx>
#include <sfx2/signaturestate.hxx>
+#include <sfx2/sfxmodelfactory.hxx>
#ifndef _BASIC_SBUNO_HXX
#include <basic/sbuno.hxx>
@@ -131,7 +132,6 @@ DBG_NAME(SfxObjectShell)
#define DocumentInfo
#include "sfxslots.hxx"
-extern svtools::AsynchronLink* pPendingCloser;
static WeakReference< XInterface > s_xCurrentComponent;
//=========================================================================
@@ -186,8 +186,7 @@ TYPEINIT1(SfxObjectShell, SfxShell);
//--------------------------------------------------------------------
SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell )
-:mpObjectContainer(0)
- ,pCfgMgr( 0)
+ :mpObjectContainer(0)
,pBasicManager( new SfxBasicManagerHolder )
,rDocShell( _rDocShell )
,aMacroMode( *this )
@@ -196,10 +195,8 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell )
,nVisualDocumentNumber( USHRT_MAX)
,nDocumentSignatureState( SIGNATURESTATE_UNKNOWN )
,nScriptingSignatureState( SIGNATURESTATE_UNKNOWN )
- ,bTemplateConfig( sal_False)
,bInList( sal_False)
,bClosing( sal_False)
- ,bSetInPlaceObj( sal_False)
,bIsSaving( sal_False)
,bPasswd( sal_False)
,bIsTmp( sal_False)
@@ -209,15 +206,9 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell )
,bImportDone ( sal_False)
,bInPrepareClose( sal_False )
,bPreparedForClose( sal_False )
- ,bWaitingForPicklist( sal_False )
- ,bModuleSearched( sal_False )
- ,bIsHelpObjSh( sal_False )
- ,bForbidCaching( sal_False )
+ ,bWaitingForPicklist( sal_True )
,bForbidReload( sal_False )
- ,bSupportsEventMacros( sal_True )
- ,bLoadingWindows( sal_False )
,bBasicInitialized( sal_False )
-// ,bHidden( sal_False )
,bIsPrintJobCancelable( sal_True )
,bOwnsStorage( sal_True )
,bNoBaseURL( sal_False )
@@ -227,6 +218,7 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell )
,bPreserveVersions( sal_True )
,m_bMacroSignBroken( sal_False )
,m_bNoBasicCapabilities( sal_False )
+ ,m_bDocRecoverySupport( sal_True )
,bQueryLoadTemplate( sal_True )
,bLoadReadonly( sal_False )
,bUseUserData( sal_True )
@@ -235,46 +227,62 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell )
,m_bAllowShareControlFileClean( sal_True )
,lErr(ERRCODE_NONE)
,nEventId ( 0)
- ,bDoNotTouchDocInfo( sal_False )
,pReloadTimer ( 0)
,pMarkData( 0 )
- ,nLoadedFlags ( SFX_LOADED_MAINDOCUMENT )
+ ,nLoadedFlags ( SFX_LOADED_ALL )
,nFlagsInProgress( 0 )
- ,bInFrame( sal_False )
,bModalMode( sal_False )
,bRunningMacro( sal_False )
,bReloadAvailable( sal_False )
,nAutoLoadLocks( 0 )
,pModule( 0 )
- ,pFrame( 0 )
- ,pTbxConfig( 0 )
,eFlags( SFXOBJECTSHELL_UNDEFINED )
- ,pCloser( 0 )
,bReadOnlyUI( sal_False )
,bHiddenLockedByAPI( sal_False )
- ,bInCloseEvent( sal_False )
,nStyleFilter( 0 )
,bDisposing( sal_False )
,m_bEnableSetModified( sal_True )
,m_bIsModified( sal_False )
,m_nMapUnit( MAP_100TH_MM )
,m_bCreateTempStor( sal_False )
- ,m_xDocInfoListener()
,m_bIsInit( sal_False )
,m_bIncomplEncrWarnShown( sal_False )
{
+ SfxObjectShell* pDoc = &_rDocShell;
+ SfxObjectShellArr_Impl &rArr = SFX_APP()->GetObjectShells_Impl();
+ rArr.C40_INSERT( SfxObjectShell, pDoc, rArr.Count() );
+ bInList = sal_True;
}
//--------------------------------------------------------------------
SfxObjectShell_Impl::~SfxObjectShell_Impl()
{
- if ( pPendingCloser == pCloser )
- pPendingCloser = 0;
- delete pCloser;
delete pBasicManager;
}
+//--------------------------------------------------------------------
+
+SfxObjectShell::SfxObjectShell( const sal_uInt64 i_nCreationFlags )
+ : pImp( new SfxObjectShell_Impl( *this ) )
+ , pMedium(0)
+ , pStyleSheetPool(0)
+ , eCreateMode( ( i_nCreationFlags & SFXMODEL_EMBEDDED_OBJECT ) ? SFX_CREATE_MODE_EMBEDDED : SFX_CREATE_MODE_STANDARD )
+ , bHasName( sal_False )
+{
+ DBG_CTOR(SfxObjectShell, 0);
+
+ const bool bScriptSupport = ( i_nCreationFlags & SFXMODEL_DISABLE_EMBEDDED_SCRIPTS ) == 0;
+ if ( !bScriptSupport )
+ SetHasNoBasic();
+
+ const bool bDocRecovery = ( i_nCreationFlags & SFXMODEL_DISABLE_DOCUMENT_RECOVERY ) == 0;
+ if ( !bDocRecovery )
+ pImp->m_bDocRecoverySupport = sal_False;
+}
+
+//--------------------------------------------------------------------
+
// initializes a document from a file-description
SfxObjectShell::SfxObjectShell
@@ -308,24 +316,10 @@ SfxObjectShell::SfxObjectShell
: pImp( new SfxObjectShell_Impl( *this ) ),
pMedium(0),
pStyleSheetPool(0),
- eCreateMode(eMode)
+ eCreateMode(eMode),
+ bHasName( sal_False )
{
DBG_CTOR(SfxObjectShell, 0);
-
- bHasName = sal_False;
- nViewNo = 0;
-
- pImp->bWaitingForPicklist = sal_True;
-
- // Aggregation InPlaceObject+Automation
-//(mba) AddInterface( SvDispatch::ClassFactory() );
-
- SfxObjectShell *pThis = this;
- SfxObjectShellArr_Impl &rArr = SFX_APP()->GetObjectShells_Impl();
- rArr.C40_INSERT( SfxObjectShell, pThis, rArr.Count() );
- pImp->bInList = sal_True;
- pImp->nLoadedFlags = SFX_LOADED_ALL;
-//REMOVE SetObjectShell( TRUE );
}
//--------------------------------------------------------------------
@@ -343,12 +337,8 @@ SfxObjectShell::~SfxObjectShell()
// Ableitungszweig SfxInternObject ist wegen eines Compiler Bugs nicht
// erlaubt
SfxObjectShell::Close();
- pImp->xModel = NULL;
+ pImp->pBaseModel.set( NULL );
-// DELETEX(pImp->pEventConfig);
-// DELETEX(pImp->pTbxConfig);
-// DELETEX(pImp->pAccMgr);
-// DELETEX(pImp->pCfgMgr);
DELETEX(pImp->pReloadTimer );
SfxApplication *pSfxApp = SFX_APP();
@@ -361,8 +351,7 @@ SfxObjectShell::~SfxObjectShell()
if ( pSfxApp->GetDdeService() )
pSfxApp->RemoveDdeTopic( this );
- if ( pImp->xModel.is() )
- pImp->xModel = ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > ();
+ pImp->pBaseModel.set( NULL );
// don't call GetStorage() here, in case of Load Failure it's possible that a storage was never assigned!
if ( pMedium && pMedium->HasStorage_Impl() && pMedium->GetStorage( sal_False ) == pImp->m_xDocStorage )
@@ -488,7 +477,7 @@ SfxObjectShell* SfxObjectShell::GetFirst
continue;
if ( ( !pType || pSh->IsA(*pType) ) &&
- ( !bOnlyVisible || SfxViewFrame::GetFirst( pSh, 0, sal_True )))
+ ( !bOnlyVisible || SfxViewFrame::GetFirst( pSh, sal_True )))
return pSh;
}
@@ -521,7 +510,7 @@ SfxObjectShell* SfxObjectShell::GetNext
continue;
if ( ( !pType || pSh->IsA(*pType) ) &&
- ( !bOnlyVisible || SfxViewFrame::GetFirst( pSh, 0, sal_True )))
+ ( !bOnlyVisible || SfxViewFrame::GetFirst( pSh, sal_True )))
return pSh;
}
return 0;
@@ -561,12 +550,11 @@ sal_uInt16 SfxObjectShell::PrepareClose
return sal_False;
SfxViewFrame* pFirst = SfxViewFrame::GetFirst( this );
- if( pFirst && !pFirst->GetFrame()->PrepareClose_Impl( bUI, bForBrowsing ) )
+ if( pFirst && !pFirst->GetFrame().PrepareClose_Impl( bUI, bForBrowsing ) )
return sal_False;
// prepare views for closing
- for ( SfxViewFrame* pFrm = SfxViewFrame::GetFirst(
- this, TYPE(SfxViewFrame));
+ for ( SfxViewFrame* pFrm = SfxViewFrame::GetFirst( this );
pFrm; pFrm = SfxViewFrame::GetNext( *pFrm, this ) )
{
DBG_ASSERT(pFrm->GetViewShell(),"KeineShell");
@@ -591,83 +579,69 @@ sal_uInt16 SfxObjectShell::PrepareClose
// nur fuer in sichtbaren Fenstern dargestellte Dokumente fragen
SfxViewFrame *pFrame = SfxObjectShell::Current() == this
? SfxViewFrame::Current() : SfxViewFrame::GetFirst( this );
- while ( pFrame && (pFrame->GetFrameType() & SFXFRAME_SERVER ) )
- pFrame = SfxViewFrame::GetNext( *pFrame, this );
sal_Bool bClose = sal_False;
- if ( bUI && IsModified() )
+ if ( bUI && IsModified() && pFrame )
{
- if ( pFrame )
+ // minimierte restoren
+ SfxFrame& rTop = pFrame->GetTopFrame();
+ SfxViewFrame::SetViewFrame( rTop.GetCurrentViewFrame() );
+ pFrame->GetFrame().Appear();
+
+ // fragen, ob gespeichert werden soll
+ short nRet = RET_YES;
+ //TODO/CLEANUP
+ //brauchen wir UI=2 noch?
+ //if( SfxApplication::IsPlugin() == sal_False || bUI == 2 )
{
- // minimierte restoren
- SfxFrame* pTop = pFrame->GetTopFrame();
- SfxViewFrame::SetViewFrame( pTop->GetCurrentViewFrame() );
- pFrame->GetFrame()->Appear();
-
- // fragen, ob gespeichert werden soll
- short nRet = RET_YES;
- //TODO/CLEANUP
- //brauchen wir UI=2 noch?
- //if( SfxApplication::IsPlugin() == sal_False || bUI == 2 )
+ //initiate help agent to inform about "print modifies the document"
+ SvtPrintWarningOptions aPrintOptions;
+ if (aPrintOptions.IsModifyDocumentOnPrintingAllowed() &&
+ HasName() && getDocProperties()->getPrintDate().Month > 0)
{
- //initiate help agent to inform about "print modifies the document"
- SvtPrintWarningOptions aPrintOptions;
- if (aPrintOptions.IsModifyDocumentOnPrintingAllowed() &&
- HasName() && getDocProperties()->getPrintDate().Month > 0)
- {
- SfxHelp::OpenHelpAgent(pFirst->GetFrame(), HID_CLOSE_WARNING);
- }
- const Reference< XTitle > xTitle(pImp->xModel, UNO_QUERY_THROW);
- const ::rtl::OUString sTitle = xTitle->getTitle ();
- nRet = ExecuteQuerySaveDocument(&pFrame->GetWindow(),sTitle);
+ SfxHelp::OpenHelpAgent( &pFirst->GetFrame(), HID_CLOSE_WARNING );
}
- /*HACK for plugin::destroy()*/
+ const Reference< XTitle > xTitle( *pImp->pBaseModel.get(), UNO_QUERY_THROW );
+ const ::rtl::OUString sTitle = xTitle->getTitle ();
+ nRet = ExecuteQuerySaveDocument(&pFrame->GetWindow(),sTitle);
+ }
+ /*HACK for plugin::destroy()*/
- if ( RET_YES == nRet )
+ if ( RET_YES == nRet )
+ {
+ // per Dispatcher speichern
+ const SfxPoolItem *pPoolItem;
+ if ( IsSaveVersionOnClose() )
{
- // per Dispatcher speichern
- const SfxPoolItem *pPoolItem;
- if ( IsSaveVersionOnClose() )
- {
- SfxStringItem aItem( SID_DOCINFO_COMMENTS, String( SfxResId( STR_AUTOMATICVERSION ) ) );
- SfxBoolItem aWarnItem( SID_FAIL_ON_WARNING, bUI );
- const SfxPoolItem* ppArgs[] = { &aItem, &aWarnItem, 0 };
- pPoolItem = pFrame->GetBindings().ExecuteSynchron( SID_SAVEDOC, ppArgs );
- }
- else
- {
- SfxBoolItem aWarnItem( SID_FAIL_ON_WARNING, bUI );
- const SfxPoolItem* ppArgs[] = { &aWarnItem, 0 };
- pPoolItem = pFrame->GetBindings().ExecuteSynchron( SID_SAVEDOC, ppArgs );
- }
-
- if ( !pPoolItem || pPoolItem->ISA(SfxVoidItem) || ( pPoolItem->ISA(SfxBoolItem) && !( (const SfxBoolItem*) pPoolItem )->GetValue() ) )
- return sal_False;
- else
- bClose = sal_True;
+ SfxStringItem aItem( SID_DOCINFO_COMMENTS, String( SfxResId( STR_AUTOMATICVERSION ) ) );
+ SfxBoolItem aWarnItem( SID_FAIL_ON_WARNING, bUI );
+ const SfxPoolItem* ppArgs[] = { &aItem, &aWarnItem, 0 };
+ pPoolItem = pFrame->GetBindings().ExecuteSynchron( SID_SAVEDOC, ppArgs );
}
- else if ( RET_CANCEL == nRet )
- // abgebrochen
- return sal_False;
- else if ( RET_NEWTASK == nRet )
+ else
{
- return RET_NEWTASK;
+ SfxBoolItem aWarnItem( SID_FAIL_ON_WARNING, bUI );
+ const SfxPoolItem* ppArgs[] = { &aWarnItem, 0 };
+ pPoolItem = pFrame->GetBindings().ExecuteSynchron( SID_SAVEDOC, ppArgs );
}
+
+ if ( !pPoolItem || pPoolItem->ISA(SfxVoidItem) || ( pPoolItem->ISA(SfxBoolItem) && !( (const SfxBoolItem*) pPoolItem )->GetValue() ) )
+ return sal_False;
else
- {
- // Bei Nein nicht noch Informationlost
bClose = sal_True;
- }
}
- }
-
- // ggf. hinweisen, da\s unter Fremdformat gespeichert
- if( pMedium )
- {
- SFX_ITEMSET_ARG( pMedium->GetItemSet(), pIgnoreInformationLost,
- SfxBoolItem, SID_DOC_IGNOREINFORMATIONLOST, sal_False);
- if( pIgnoreInformationLost && pIgnoreInformationLost->GetValue() )
- bUI = sal_False;
+ else if ( RET_CANCEL == nRet )
+ // abgebrochen
+ return sal_False;
+ else if ( RET_NEWTASK == nRet )
+ {
+ return RET_NEWTASK;
+ }
+ else
+ {
+ // Bei Nein nicht noch Informationlost
+ bClose = sal_True;
+ }
}
pImp->bPreparedForClose = sal_True;
@@ -861,20 +835,6 @@ sal_Bool SfxObjectShell::DoClose()
//--------------------------------------------------------------------
-void SfxObjectShell::SetLastMark_Impl( const String &rMark )
-{
- pImp->aMark = rMark;
-}
-
-//--------------------------------------------------------------------
-
-const String& SfxObjectShell::GetLastMark_Impl() const
-{
- return pImp->aMark;
-}
-
-//--------------------------------------------------------------------
-
SfxObjectShell* SfxObjectShell::GetObjectShell()
{
return this;
@@ -899,45 +859,28 @@ SEQUENCE< OUSTRING > SfxObjectShell::GetEventNames()
return *pEventNameContainer;
}
-SEQUENCE< OUSTRING > SfxObjectShell::GetEventNames_Impl()
-{
- if (!pImp->xEventNames.getLength())
- pImp->xEventNames = GetEventNames();
- return pImp->xEventNames;
-}
-
//--------------------------------------------------------------------
-void SfxObjectShell::SetModel( SfxBaseModel* pModel )
+::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > SfxObjectShell::GetModel() const
{
- OSL_ENSURE( !pImp->xModel.is() || pModel == NULL, "Model already set!" );
- pImp->xModel = pModel;
- if ( pModel ) {
- pModel->addCloseListener( new SfxModelListener_Impl(this) );
- //pImp->m_xDocInfoListener = new SfxDocInfoListener_Impl(*this);
- //uno::Reference<util::XModifyBroadcaster> xMB(
- // pModel->getDocumentProperties(), uno::UNO_QUERY_THROW);
- //xMB->addModifyListener(pImp->m_xDocInfoListener);
- }
-}
-
-//--------------------------------------------------------------------
-
-const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& SfxObjectShell::GetModel() const
-{
- return pImp->xModel;
+ return GetBaseModel();
}
void SfxObjectShell::SetBaseModel( SfxBaseModel* pModel )
{
- SetModel(pModel);
+ OSL_ENSURE( !pImp->pBaseModel.is() || pModel == NULL, "Model already set!" );
+ pImp->pBaseModel.set( pModel );
+ if ( pImp->pBaseModel.is() )
+ {
+ pImp->pBaseModel->addCloseListener( new SfxModelListener_Impl(this) );
+ }
}
//--------------------------------------------------------------------
-::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > SfxObjectShell::GetBaseModel()
+::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > SfxObjectShell::GetBaseModel() const
{
- return pImp->xModel;
+ return pImp->pBaseModel.get();
}
/* -----------------------------10.09.2001 15:56------------------------------
@@ -1118,3 +1061,16 @@ SfxObjectShell* SfxObjectShell::CreateAndLoadObject( const SfxItemSet& rSet, Sfx
return NULL;
}
+void SfxObjectShell::SetInitialized_Impl( const bool i_fromInitNew )
+{
+ pImp->bInitialized = sal_True;
+ if ( i_fromInitNew )
+ {
+ SetActivateEvent_Impl( SFX_EVENT_CREATEDOC );
+ SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_DOCCREATED, GlobalEventConfig::GetEventName(STR_EVENT_DOCCREATED), this ) );
+ }
+ else
+ {
+ SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_LOADFINISHED, GlobalEventConfig::GetEventName(STR_EVENT_LOADFINISHED), this ) );
+ }
+}
diff --git a/sfx2/source/doc/opostponedtruncationstream.cxx b/sfx2/source/doc/opostponedtruncationstream.cxx
deleted file mode 100644
index 364a4d5a65..0000000000
--- a/sfx2/source/doc/opostponedtruncationstream.cxx
+++ /dev/null
@@ -1,491 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General 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_sfx2.hxx"
-#include <osl/diagnose.h>
-
-#include <opostponedtruncationstream.hxx>
-
-using namespace ::com::sun::star;
-
-// ========================================================================
-struct PTFStreamData_Impl
-{
- uno::Reference< ucb::XSimpleFileAccess > m_xFileAccess;
- sal_Bool m_bDelete;
- ::rtl::OUString m_aURL;
-
- // the streams below are not visible from outside so there is no need to remember position
-
- // original stream related members
- uno::Reference< io::XStream > m_xOrigStream;
- uno::Reference< io::XTruncate > m_xOrigTruncate;
- uno::Reference< io::XSeekable > m_xOrigSeekable;
- uno::Reference< io::XInputStream > m_xOrigInStream;
- uno::Reference< io::XOutputStream > m_xOrigOutStream;
-
- sal_Bool m_bInOpen;
- sal_Bool m_bOutOpen;
-
- sal_Bool m_bPostponedTruncate;
-
-
- PTFStreamData_Impl(
- const uno::Reference< ucb::XSimpleFileAccess >& xFileAccess,
- sal_Bool bDelete,
- const ::rtl::OUString& aURL,
- const uno::Reference< io::XStream >& xOrigStream,
- const uno::Reference< io::XTruncate >& xOrigTruncate,
- const uno::Reference< io::XSeekable >& xOrigSeekable,
- const uno::Reference< io::XInputStream >& xOrigInStream,
- const uno::Reference< io::XOutputStream >& xOrigOutStream )
- : m_xFileAccess( xFileAccess )
- , m_bDelete( bDelete )
- , m_aURL( aURL )
- , m_xOrigStream( xOrigStream )
- , m_xOrigTruncate( xOrigTruncate )
- , m_xOrigSeekable( xOrigSeekable )
- , m_xOrigInStream( xOrigInStream )
- , m_xOrigOutStream( xOrigOutStream )
- , m_bInOpen( sal_False )
- , m_bOutOpen( sal_False )
- , m_bPostponedTruncate( sal_True )
- {}
-
- void NoPostponing()
- {
- m_bDelete = sal_False;
- m_bPostponedTruncate = sal_False;
- }
-};
-
-// ========================================================================
-// ------------------------------------------------------------------------
-OPostponedTruncationFileStream::OPostponedTruncationFileStream(
- const ::rtl::OUString& aURL,
- const uno::Reference< lang::XMultiServiceFactory >& /*xFactory*/,
- const uno::Reference< ucb::XSimpleFileAccess >& xFileAccess,
- const uno::Reference< io::XStream >& xOrigStream,
- sal_Bool bDelete )
-: m_pStreamData( NULL )
-{
- if ( !xFileAccess.is() || !xOrigStream.is() )
- throw uno::RuntimeException();
-
- uno::Reference< io::XTruncate > xOrigTruncate( xOrigStream, uno::UNO_QUERY_THROW );
- uno::Reference< io::XSeekable > xOrigSeekable( xOrigStream, uno::UNO_QUERY_THROW );
- uno::Reference< io::XInputStream > xOrigInStream = xOrigStream->getInputStream();
- uno::Reference< io::XOutputStream > xOrigOutStream = xOrigStream->getOutputStream();
- if ( !xOrigInStream.is() || !xOrigOutStream.is() )
- throw uno::RuntimeException();
-
- m_pStreamData = new PTFStreamData_Impl( xFileAccess, bDelete, aURL,
- xOrigStream, xOrigTruncate, xOrigSeekable, xOrigInStream, xOrigOutStream );
-}
-
-// ------------------------------------------------------------------------
-OPostponedTruncationFileStream::~OPostponedTruncationFileStream()
-{
- CloseAll_Impl();
-}
-
-// ------------------------------------------------------------------------
-void OPostponedTruncationFileStream::CloseAll_Impl()
-{
- if ( m_pStreamData )
- {
- sal_Bool bDelete = m_pStreamData->m_bDelete;
- ::rtl::OUString aURL = m_pStreamData->m_aURL;
- uno::Reference< ucb::XSimpleFileAccess > xFileAccess = m_pStreamData->m_xFileAccess;
-
- delete m_pStreamData;
- m_pStreamData = NULL;
-
- if ( bDelete && xFileAccess.is() && aURL.getLength() )
- {
- // delete the file
- try
- {
- xFileAccess->kill( aURL );
- } catch( uno::Exception& )
- {
- OSL_ENSURE( sal_False, "Could not remove the file!" );
- }
- }
- }
-}
-
-// ------------------------------------------------------------------------
-void OPostponedTruncationFileStream::CheckScheduledTruncation_Impl()
-{
- if ( !m_pStreamData )
- throw io::NotConnectedException();
-
- if ( m_pStreamData->m_bPostponedTruncate )
- {
- // the original stream data should be provided
- if ( !m_pStreamData->m_xOrigTruncate.is() )
- throw uno::RuntimeException();
-
- m_pStreamData->m_xOrigTruncate->truncate();
- m_pStreamData->NoPostponing();
- }
-}
-
-// com::sun::star::io::XStream
-// ------------------------------------------------------------------------
-uno::Reference< io::XInputStream > SAL_CALL OPostponedTruncationFileStream::getInputStream( )
- throw (uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- if ( m_pStreamData )
- m_pStreamData->m_bInOpen = sal_True;
- return static_cast< io::XInputStream* >( this );
-}
-
-
-// ------------------------------------------------------------------------
-uno::Reference< io::XOutputStream > SAL_CALL OPostponedTruncationFileStream::getOutputStream( )
- throw (uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- if ( m_pStreamData )
- m_pStreamData->m_bOutOpen = sal_True;
- return static_cast< io::XOutputStream* >( this );
-}
-
-
-
-// com::sun::star::io::XInputStream
-// ------------------------------------------------------------------------
-::sal_Int32 SAL_CALL OPostponedTruncationFileStream::readBytes( uno::Sequence< ::sal_Int8 >& aData, ::sal_Int32 nBytesToRead )
- throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- if ( !m_pStreamData )
- throw io::NotConnectedException();
-
- if ( m_pStreamData->m_bPostponedTruncate )
- {
- // the stream must behave as truncated one
- aData.realloc( 0 );
- return 0;
- }
- else
- {
- // the original stream data should be provided
- if ( !m_pStreamData->m_xOrigInStream.is() )
- throw uno::RuntimeException();
-
- return m_pStreamData->m_xOrigInStream->readBytes( aData, nBytesToRead );
- }
-}
-
-
-// ------------------------------------------------------------------------
-::sal_Int32 SAL_CALL OPostponedTruncationFileStream::readSomeBytes( uno::Sequence< ::sal_Int8 >& aData, ::sal_Int32 nMaxBytesToRead )
- throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- if ( !m_pStreamData )
- throw io::NotConnectedException();
-
- if ( m_pStreamData->m_bPostponedTruncate )
- {
- // the stream must behave as truncated one
- aData.realloc( 0 );
- return 0;
- }
- else
- {
- // the original stream data should be provided
- if ( !m_pStreamData->m_xOrigInStream.is() )
- throw uno::RuntimeException();
-
- return m_pStreamData->m_xOrigInStream->readBytes( aData, nMaxBytesToRead );
- }
-}
-
-// ------------------------------------------------------------------------
-void SAL_CALL OPostponedTruncationFileStream::skipBytes( ::sal_Int32 nBytesToSkip )
- throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- if ( !m_pStreamData )
- throw io::NotConnectedException();
-
- if ( m_pStreamData->m_bPostponedTruncate )
- {
- // the stream must behave as truncated one
- if ( nBytesToSkip > 0 )
- throw io::BufferSizeExceededException();
-
- return;
- }
- else
- {
- // the original stream data should be provided
- if ( !m_pStreamData->m_xOrigInStream.is() )
- throw uno::RuntimeException();
-
- m_pStreamData->m_xOrigInStream->skipBytes( nBytesToSkip );
- }
-}
-
-
-// ------------------------------------------------------------------------
-::sal_Int32 SAL_CALL OPostponedTruncationFileStream::available( )
- throw (io::NotConnectedException, io::IOException, uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- if ( !m_pStreamData )
- throw io::NotConnectedException();
-
- if ( m_pStreamData->m_bPostponedTruncate )
- {
- // the stream must behave as truncated one
- return 0;
- }
- else
- {
- // the original stream data should be provided
- if ( !m_pStreamData->m_xOrigInStream.is() )
- throw uno::RuntimeException();
-
- return m_pStreamData->m_xOrigInStream->available();
- }
-}
-
-
-// ------------------------------------------------------------------------
-void SAL_CALL OPostponedTruncationFileStream::closeInput()
- throw (io::NotConnectedException, io::IOException, uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- if ( !m_pStreamData )
- throw io::NotConnectedException();
-
- m_pStreamData->m_bInOpen = sal_False;
- if ( !m_pStreamData->m_bOutOpen )
- CloseAll_Impl();
-}
-
-
-
-// com::sun::star::io::XOutputStream
-// ------------------------------------------------------------------------
-void SAL_CALL OPostponedTruncationFileStream::writeBytes( const uno::Sequence< ::sal_Int8 >& aData )
- throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- if ( !m_pStreamData )
- throw io::NotConnectedException();
-
- // writing method must check the truncation
- CheckScheduledTruncation_Impl();
-
- // the original stream data should be provided
- if ( !m_pStreamData->m_xOrigOutStream.is() )
- throw uno::RuntimeException();
-
- m_pStreamData->m_xOrigOutStream->writeBytes( aData );
-}
-
-
-// ------------------------------------------------------------------------
-void SAL_CALL OPostponedTruncationFileStream::flush( )
- throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- if ( !m_pStreamData )
- {
- OSL_ENSURE( sal_False, "flush() call on closed stream!\n" );
- return;
- // in future throw exception, for now some code might call flush() on closed stream
- // since file ucp implementation allows it
- // throw io::NotConnectedException();
- }
-
- if ( m_pStreamData->m_bPostponedTruncate )
- {
- // it is no writing call, thus must be ignored
- return;
- }
- else
- {
- // the original stream data should be provided
- if ( !m_pStreamData->m_xOrigOutStream.is() )
- throw uno::RuntimeException();
-
- m_pStreamData->m_xOrigOutStream->flush();
- }
-}
-
-
-// ------------------------------------------------------------------------
-void SAL_CALL OPostponedTruncationFileStream::closeOutput( )
- throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- if ( !m_pStreamData )
- throw io::NotConnectedException();
-
- m_pStreamData->m_bOutOpen = sal_False;
- if ( !m_pStreamData->m_bInOpen )
- CloseAll_Impl();
-}
-
-
-
-// com::sun::star::io::XTruncate
-// ------------------------------------------------------------------------
-void SAL_CALL OPostponedTruncationFileStream::truncate( )
- throw (io::IOException, uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- if ( !m_pStreamData )
- throw io::NotConnectedException();
-
- if ( m_pStreamData->m_bPostponedTruncate )
- {
- // the truncation is already scheduled, ignore
- return;
- }
- else
- {
- // the original stream data should be provided
- if ( !m_pStreamData->m_xOrigTruncate.is() )
- throw uno::RuntimeException();
-
- m_pStreamData->m_xOrigTruncate->truncate();
- }
-}
-
-
-
-// com::sun::star::io::XSeekable
-// ------------------------------------------------------------------------
-void SAL_CALL OPostponedTruncationFileStream::seek( ::sal_Int64 location )
- throw (lang::IllegalArgumentException, io::IOException, uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- if ( !m_pStreamData )
- throw io::NotConnectedException();
-
- if ( m_pStreamData->m_bPostponedTruncate )
- {
- if ( location > 0 )
- throw lang::IllegalArgumentException();
-
- return;
- }
- else
- {
- // the original stream data should be provided
- if ( !m_pStreamData->m_xOrigSeekable.is() )
- throw uno::RuntimeException();
-
- m_pStreamData->m_xOrigSeekable->seek( location );
- }
-}
-
-
-// ------------------------------------------------------------------------
-::sal_Int64 SAL_CALL OPostponedTruncationFileStream::getPosition( )
- throw (io::IOException, uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- if ( !m_pStreamData )
- throw io::NotConnectedException();
-
- if ( m_pStreamData->m_bPostponedTruncate )
- {
- return 0;
- }
- else
- {
- // the original stream data should be provided
- if ( !m_pStreamData->m_xOrigSeekable.is() )
- throw uno::RuntimeException();
-
- return m_pStreamData->m_xOrigSeekable->getPosition();
- }
-}
-
-
-// ------------------------------------------------------------------------
-::sal_Int64 SAL_CALL OPostponedTruncationFileStream::getLength( )
- throw (io::IOException, uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- if ( !m_pStreamData )
- throw io::NotConnectedException();
-
- if ( m_pStreamData->m_bPostponedTruncate )
- {
- return 0;
- }
- else
- {
- // the original stream data should be provided
- if ( !m_pStreamData->m_xOrigSeekable.is() )
- throw uno::RuntimeException();
-
- return m_pStreamData->m_xOrigSeekable->getLength();
- }
-}
-
-// ------------------------------------------------------------------------
-void SAL_CALL OPostponedTruncationFileStream::waitForCompletion()
- throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException)
-{
- if ( !m_pStreamData )
- throw io::NotConnectedException();
-
- if ( m_pStreamData->m_bPostponedTruncate )
- return;
-
- uno::Reference< io::XAsyncOutputMonitor > asyncOutputMonitor( m_pStreamData->m_xOrigOutStream, uno::UNO_QUERY );
- if ( asyncOutputMonitor.is() )
- asyncOutputMonitor->waitForCompletion();
-}
-
diff --git a/sfx2/source/doc/opostponedtruncationstream.hxx b/sfx2/source/doc/opostponedtruncationstream.hxx
deleted file mode 100644
index ce60cdf2e0..0000000000
--- a/sfx2/source/doc/opostponedtruncationstream.hxx
+++ /dev/null
@@ -1,122 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SFX_OPOSTPONEDTRUNCATIONFILESTREAM_HXX
-#define _SFX_OPOSTPONEDTRUNCATIONFILESTREAM_HXX
-
-#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/io/XInputStream.hpp>
-#include <com/sun/star/io/XOutputStream.hpp>
-#include <com/sun/star/io/XSeekable.hpp>
-#include <com/sun/star/io/XTruncate.hpp>
-#include <com/sun/star/io/XStream.hpp>
-#include <com/sun/star/embed/XTransactedObject.hpp>
-#include <com/sun/star/beans/XPropertySetInfo.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
-#include <com/sun/star/io/XAsyncOutputMonitor.hpp>
-#include <osl/mutex.hxx>
-#include <cppuhelper/implbase6.hxx>
-#include "sfx2/dllapi.h"
-
-//==================================================================
-// OPostponedTruncationFileStream
-//
-// Allows to get stream access to a file, where the first truncation
-// of the file is postponed till the first writing. If no writing happens
-// after the first truncation/creation, it has no effect. ( The postponing of
-// the creation can be switched off during initialization. Here the postponing
-// of the creation means that the file will be created immediatelly, but
-// if nothing is written into it, it will be removed during destruction
-// of the object. )
-//
-// On creation of this object the target file is scheduled for
-// creation/truncation. But the action happens only during the first
-// write access. After the first write access the object behaves
-// itself as the original stream.
-//==================================================================
-
-struct PTFStreamData_Impl;
-class SFX2_DLLPUBLIC OPostponedTruncationFileStream
- : public ::cppu::WeakImplHelper6 <
- ::com::sun::star::io::XStream,
- ::com::sun::star::io::XInputStream,
- ::com::sun::star::io::XOutputStream,
- ::com::sun::star::io::XTruncate,
- ::com::sun::star::io::XSeekable,
- ::com::sun::star::io::XAsyncOutputMonitor >
-{
- ::osl::Mutex m_aMutex;
- PTFStreamData_Impl* m_pStreamData;
-
- void CloseAll_Impl();
-
- void CheckScheduledTruncation_Impl();
-
-public:
-
- OPostponedTruncationFileStream(
- const ::rtl::OUString& aURL,
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory,
- const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess >& xFileAccess,
- const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xStream,
- sal_Bool bDelete );
-
- ~OPostponedTruncationFileStream();
-
-// com::sun::star::io::XStream
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getInputStream( ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > SAL_CALL getOutputStream( ) throw (::com::sun::star::uno::RuntimeException);
-
-// com::sun::star::io::XInputStream
- virtual ::sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< ::sal_Int8 >& aData, ::sal_Int32 nBytesToRead ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual ::sal_Int32 SAL_CALL readSomeBytes( ::com::sun::star::uno::Sequence< ::sal_Int8 >& aData, ::sal_Int32 nMaxBytesToRead ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL skipBytes( ::sal_Int32 nBytesToSkip ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual ::sal_Int32 SAL_CALL available( ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL closeInput( ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
-
-// com::sun::star::io::XOutputStream
- virtual void SAL_CALL writeBytes( const ::com::sun::star::uno::Sequence< ::sal_Int8 >& aData ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL flush( ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL closeOutput( ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
-
-// com::sun::star::io::XTruncate
- virtual void SAL_CALL truncate( ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
-
-// com::sun::star::io::XSeekable
- virtual void SAL_CALL seek( ::sal_Int64 location ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual ::sal_Int64 SAL_CALL getPosition( ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual ::sal_Int64 SAL_CALL getLength( ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
-
-// ::com::sun::star::io::XAsyncOutputMonitor
- virtual void SAL_CALL waitForCompletion( ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
-
-};
-
-#endif //_SFX_OPOSTPONEDTRUNCATIONFILESTREAM_HXX
-
-
diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx
index 3a0ce9b044..fee1e4df3c 100755
--- a/sfx2/source/doc/printhelper.cxx
+++ b/sfx2/source/doc/printhelper.cxx
@@ -266,17 +266,23 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SfxPrintHelper::getPrinter() thro
// object already disposed?
::vos::OGuard aGuard( Application::GetSolarMutex() );
- // Printer beschaffen
- SfxViewFrame *pViewFrm = m_pData->m_pObjectShell.Is() ?
- SfxViewFrame::GetFirst( m_pData->m_pObjectShell, 0, sal_False ) : 0;
- if ( !pViewFrm )
- return uno::Sequence< beans::PropertyValue >();
-
- const SfxPrinter *pPrinter = pViewFrm->GetViewShell()->GetPrinter(sal_True);
+ // search for any view of this document that is currently printing
+ const Printer *pPrinter = NULL;
+ SfxViewFrame *pViewFrm = m_pData->m_pObjectShell.Is() ? SfxViewFrame::GetFirst( m_pData->m_pObjectShell, sal_False ) : 0;
+ SfxViewFrame* pFirst = pViewFrm;
+ while ( pViewFrm && !pPrinter )
+ {
+ pPrinter = pViewFrm->GetViewShell()->GetActivePrinter();
+ pViewFrm = SfxViewFrame::GetNext( *pViewFrm, m_pData->m_pObjectShell, sal_False );
+ }
+
+ // if no view is printing currently, use the permanent SfxPrinter instance
+ if ( !pPrinter && pFirst )
+ pPrinter = pFirst->GetViewShell()->GetPrinter(sal_True);
+
if ( !pPrinter )
return uno::Sequence< beans::PropertyValue >();
- // Printer Eigenschaften uebertragen
uno::Sequence< beans::PropertyValue > aPrinter(8);
aPrinter.getArray()[7].Name = DEFINE_CONST_UNICODE( "CanSetPaperSize" );
@@ -319,7 +325,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue >
{
// alten Printer beschaffen
SfxViewFrame *pViewFrm = m_pData->m_pObjectShell.Is() ?
- SfxViewFrame::GetFirst( m_pData->m_pObjectShell, 0, sal_False ) : 0;
+ SfxViewFrame::GetFirst( m_pData->m_pObjectShell, sal_False ) : 0;
if ( !pViewFrm )
return;
@@ -582,7 +588,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >&
// get view for sfx printing capabilities
SfxViewFrame *pViewFrm = m_pData->m_pObjectShell.Is() ?
- SfxViewFrame::GetFirst( m_pData->m_pObjectShell, 0, sal_False ) : 0;
+ SfxViewFrame::GetFirst( m_pData->m_pObjectShell, sal_False ) : 0;
if ( !pViewFrm )
return;
SfxViewShell* pView = pViewFrm->GetViewShell();
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index a502931ffd..7a5f630659 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -70,6 +70,7 @@
#include <cppuhelper/exc_hlp.hxx>
#include <comphelper/processfactory.hxx> // can be removed when this is a "real" service
#include <comphelper/componentcontext.hxx>
+#include <comphelper/namedvaluecollection.hxx>
#include <svl/itemset.hxx>
#include <svl/stritem.hxx>
#include <svl/eitem.hxx>
@@ -98,6 +99,9 @@
// includes of my own project
//________________________________________________________________________________________________________
+#include <sfx2/sfxbasecontroller.hxx>
+#include "viewfac.hxx"
+#include "workwin.hxx"
#include <sfx2/signaturestate.hxx>
#include <sfx2/sfxuno.hxx>
#include <objshimp.hxx>
@@ -114,7 +118,7 @@
#include <sfx2/evntconf.hxx>
#include <sfx2/sfx.hrc>
#include <sfx2/app.hxx>
-#include <sfx2/topfrm.hxx>
+#include <sfx2/viewfrm.hxx>
#include "appdata.hxx"
#include <sfx2/docfac.hxx>
#include <sfx2/fcontnr.hxx>
@@ -137,11 +141,19 @@ static const ::rtl::OUString SERVICENAME_DESKTOP = ::rtl::OUString::createFromAs
namespace css = ::com::sun::star;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
+using ::com::sun::star::beans::PropertyValue;
+using ::com::sun::star::frame::XFrame;
+using ::com::sun::star::frame::XController;
+using ::com::sun::star::frame::XController2;
+using ::com::sun::star::lang::IllegalArgumentException;
+using ::com::sun::star::io::IOException;
+using ::com::sun::star::lang::WrappedTargetException;
+using ::com::sun::star::uno::Type;
+using ::com::sun::star::uno::Sequence;
+using ::com::sun::star::document::XDocumentRecovery;
/** This Listener is used to get notified when the XDocumentProperties of the
XModel change.
- If several changes are done the "bQuiet" member can be used to
- temporarily suppress notifications.
*/
class SfxDocInfoListener_Impl : public ::cppu::WeakImplHelper1<
::com::sun::star::util::XModifyListener >
@@ -149,12 +161,9 @@ class SfxDocInfoListener_Impl : public ::cppu::WeakImplHelper1<
public:
SfxObjectShell& m_rShell;
- bool bQuiet;
- bool bGotModified;
SfxDocInfoListener_Impl( SfxObjectShell& i_rDoc )
: m_rShell(i_rDoc)
- , bQuiet(false)
{ };
~SfxDocInfoListener_Impl();
@@ -171,12 +180,9 @@ void SAL_CALL SfxDocInfoListener_Impl::modified( const lang::EventObject& )
throw ( uno::RuntimeException )
{
::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
- bGotModified = true;
// notify changes to the SfxObjectShell
- if ( !bQuiet ) {
- m_rShell.FlushDocInfo();
- }
+ m_rShell.FlushDocInfo();
}
void SAL_CALL SfxDocInfoListener_Impl::disposing( const lang::EventObject& )
@@ -212,6 +218,8 @@ struct IMPL_SfxBaseModel_DataContainer : public ::sfx2::IModifiableDocument
sal_Bool m_bClosing ;
sal_Bool m_bSaving ;
sal_Bool m_bSuicide ;
+ sal_Bool m_bInitialized ;
+ sal_Bool m_bModifiedSinceLastSave;
uno::Reference< com::sun::star::view::XPrintable> m_xPrintable ;
uno::Reference< script::provider::XScriptProvider > m_xScriptProvider;
uno::Reference< ui::XUIConfigurationManager > m_xUIConfigurationManager;
@@ -230,6 +238,8 @@ struct IMPL_SfxBaseModel_DataContainer : public ::sfx2::IModifiableDocument
, m_bClosing ( sal_False )
, m_bSaving ( sal_False )
, m_bSuicide ( sal_False )
+ , m_bInitialized ( sal_False )
+ , m_bModifiedSinceLastSave( sal_False )
, m_pStorageModifyListen ( NULL )
, m_xTitleHelper ()
, m_xNumberedControllers ()
@@ -357,41 +367,40 @@ SfxOwnFramesLocker::SfxOwnFramesLocker( SfxObjectShell* pObjectShell )
if ( !pObjectShell )
return;
- for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst(pObjectShell, TYPE(SfxTopViewFrame) ); pFrame;
- pFrame = SfxViewFrame::GetNext(*pFrame, pObjectShell, TYPE(SfxTopViewFrame) ) )
+ for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst( pObjectShell );
+ pFrame;
+ pFrame = SfxViewFrame::GetNext( *pFrame, pObjectShell )
+ )
{
- SfxFrame* pSfxFrame = pFrame->GetFrame();
- if ( pSfxFrame )
+ SfxFrame& rSfxFrame = pFrame->GetFrame();
+ try
{
- try
+ // get vcl window related to the frame and lock it if it is still not locked
+ uno::Reference< frame::XFrame > xFrame = rSfxFrame.GetFrameInterface();
+ Window* pWindow = GetVCLWindow( xFrame );
+ if ( !pWindow )
+ throw uno::RuntimeException();
+
+ if ( pWindow->IsEnabled() )
{
- // get vcl window related to the frame and lock it if it is still not locked
- uno::Reference< frame::XFrame > xFrame = pSfxFrame->GetFrameInterface();
- Window* pWindow = GetVCLWindow( xFrame );
- if ( !pWindow )
- throw uno::RuntimeException();
+ pWindow->Disable();
- if ( pWindow->IsEnabled() )
+ try
{
- pWindow->Disable();
-
- try
- {
- sal_Int32 nLen = m_aLockedFrames.getLength();
- m_aLockedFrames.realloc( nLen + 1 );
- m_aLockedFrames[nLen] = xFrame;
- }
- catch( uno::Exception& )
- {
- pWindow->Enable();
- throw;
- }
+ sal_Int32 nLen = m_aLockedFrames.getLength();
+ m_aLockedFrames.realloc( nLen + 1 );
+ m_aLockedFrames[nLen] = xFrame;
+ }
+ catch( uno::Exception& )
+ {
+ pWindow->Enable();
+ throw;
}
}
- catch( uno::Exception& )
- {
- OSL_ENSURE( sal_False, "Not possible to lock the frame window!\n" );
- }
+ }
+ catch( uno::Exception& )
+ {
+ OSL_ENSURE( sal_False, "Not possible to lock the frame window!\n" );
}
}
}
@@ -522,6 +531,7 @@ SfxBaseModel::SfxBaseModel( SfxObjectShell *pObjectShell )
: BaseMutex()
, m_pData( new IMPL_SfxBaseModel_DataContainer( m_aMutex, pObjectShell ) )
, m_bSupportEmbeddedScripts( pObjectShell && pObjectShell->Get_Impl() ? !pObjectShell->Get_Impl()->m_bNoBasicCapabilities : false )
+, m_bSupportDocRecovery( pObjectShell && pObjectShell->Get_Impl() ? pObjectShell->Get_Impl()->m_bDocRecoverySupport : false )
{
DBG_CTOR(sfx2_SfxBaseModel,NULL);
if ( pObjectShell != NULL )
@@ -545,7 +555,9 @@ SfxBaseModel::~SfxBaseModel()
uno::Any SAL_CALL SfxBaseModel::queryInterface( const UNOTYPE& rType ) throw( uno::RuntimeException )
{
- if ( !m_bSupportEmbeddedScripts && rType.equals( XEMBEDDEDSCRIPTS::static_type() ) )
+ if ( ( !m_bSupportEmbeddedScripts && rType.equals( XEMBEDDEDSCRIPTS::static_type() ) )
+ || ( !m_bSupportDocRecovery && rType.equals( XDocumentRecovery::static_type() ) )
+ )
return Any();
return SfxBaseModel_Base::queryInterface( rType );
@@ -581,21 +593,31 @@ void SAL_CALL SfxBaseModel::release() throw( )
// XTypeProvider
//________________________________________________________________________________________________________
-uno::Sequence< UNOTYPE > SAL_CALL SfxBaseModel::getTypes() throw( uno::RuntimeException )
+namespace
{
- uno::Sequence< UNOTYPE > aTypes( SfxBaseModel_Base::getTypes() );
- if ( !m_bSupportEmbeddedScripts )
+ void lcl_stripType( Sequence< Type >& io_rTypes, const Type& i_rTypeToStrip )
{
- // remove XEmbeddedScripts type from the sequence
- Sequence< UNOTYPE > aStrippedTypes( aTypes.getLength() - 1 );
+ Sequence< UNOTYPE > aStrippedTypes( io_rTypes.getLength() - 1 );
::std::remove_copy_if(
- aTypes.getConstArray(),
- aTypes.getConstArray() + aTypes.getLength(),
+ io_rTypes.getConstArray(),
+ io_rTypes.getConstArray() + io_rTypes.getLength(),
aStrippedTypes.getArray(),
- ::std::bind2nd( ::std::equal_to< UNOTYPE >(), XEMBEDDEDSCRIPTS::static_type() )
+ ::std::bind2nd( ::std::equal_to< Type >(), i_rTypeToStrip )
);
- aTypes = aStrippedTypes;
+ io_rTypes = aStrippedTypes;
}
+}
+
+uno::Sequence< UNOTYPE > SAL_CALL SfxBaseModel::getTypes() throw( uno::RuntimeException )
+{
+ uno::Sequence< UNOTYPE > aTypes( SfxBaseModel_Base::getTypes() );
+
+ if ( !m_bSupportEmbeddedScripts )
+ lcl_stripType( aTypes, XEMBEDDEDSCRIPTS::static_type() );
+
+ if ( !m_bSupportDocRecovery )
+ lcl_stripType( aTypes, XDocumentRecovery::static_type() );
+
return aTypes;
}
@@ -648,9 +670,7 @@ uno::Reference< script::XStarBasicAccess > implGetStarBasicAccess( SfxObjectShel
uno::Reference< XNAMECONTAINER > SAL_CALL SfxBaseModel::getLibraryContainer() throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
uno::Reference< script::XStarBasicAccess >& rxAccess = m_pData->m_xStarBasicAccess;
if( !rxAccess.is() && m_pData->m_pObjectShell.Is() )
@@ -669,9 +689,7 @@ void SAL_CALL SfxBaseModel::createLibrary( const ::rtl::OUString& LibName, const
const ::rtl::OUString& ExternalSourceURL, const ::rtl::OUString& LinkTargetURL )
throw(ELEMENTEXISTEXCEPTION, uno::RuntimeException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
uno::Reference< script::XStarBasicAccess >& rxAccess = m_pData->m_xStarBasicAccess;
if( !rxAccess.is() && m_pData->m_pObjectShell.Is() )
@@ -688,9 +706,7 @@ void SAL_CALL SfxBaseModel::addModule( const ::rtl::OUString& LibraryName, const
const ::rtl::OUString& Language, const ::rtl::OUString& Source )
throw( NOSUCHELEMENTEXCEPTION, uno::RuntimeException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
uno::Reference< script::XStarBasicAccess >& rxAccess = m_pData->m_xStarBasicAccess;
if( !rxAccess.is() && m_pData->m_pObjectShell.Is() )
@@ -707,9 +723,7 @@ void SAL_CALL SfxBaseModel::addDialog( const ::rtl::OUString& LibraryName, const
const ::com::sun::star::uno::Sequence< sal_Int8 >& Data )
throw(NOSUCHELEMENTEXCEPTION, uno::RuntimeException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
uno::Reference< script::XStarBasicAccess >& rxAccess = m_pData->m_xStarBasicAccess;
if( !rxAccess.is() && m_pData->m_pObjectShell.Is() )
@@ -726,9 +740,7 @@ void SAL_CALL SfxBaseModel::addDialog( const ::rtl::OUString& LibraryName, const
uno::Reference< uno::XInterface > SAL_CALL SfxBaseModel::getParent() throw( uno::RuntimeException )
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
return m_pData->m_xParent;
}
@@ -739,7 +751,7 @@ uno::Reference< uno::XInterface > SAL_CALL SfxBaseModel::getParent() throw( uno:
void SAL_CALL SfxBaseModel::setParent(const uno::Reference< uno::XInterface >& Parent) throw(NOSUPPORTEXCEPTION, uno::RuntimeException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING );
m_pData->m_xParent = Parent;
}
@@ -749,11 +761,7 @@ void SAL_CALL SfxBaseModel::setParent(const uno::Reference< uno::XInterface >& P
void SAL_CALL SfxBaseModel::dispose() throw(::com::sun::star::uno::RuntimeException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
-
- // object already disposed?
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING );
if ( !m_pData->m_bClosed )
{
@@ -812,11 +820,7 @@ void SAL_CALL SfxBaseModel::dispose() throw(::com::sun::star::uno::RuntimeExcept
void SAL_CALL SfxBaseModel::addEventListener( const uno::Reference< XEVENTLISTENER >& aListener )
throw(::com::sun::star::uno::RuntimeException)
{
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- return;
-
+ SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING );
m_pData->m_aInterfaceContainer.addInterface( ::getCppuType((const uno::Reference< XEVENTLISTENER >*)0), aListener );
}
@@ -827,11 +831,7 @@ void SAL_CALL SfxBaseModel::addEventListener( const uno::Reference< XEVENTLISTEN
void SAL_CALL SfxBaseModel::removeEventListener( const uno::Reference< XEVENTLISTENER >& aListener )
throw(::com::sun::star::uno::RuntimeException)
{
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- return;
-
+ SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING );
m_pData->m_aInterfaceContainer.removeInterface( ::getCppuType((const uno::Reference< XEVENTLISTENER >*)0), aListener );
}
@@ -841,11 +841,7 @@ void SAL_CALL SfxBaseModel::removeEventListener( const uno::Reference< XEVENTLIS
uno::Reference< document::XDocumentInfo > SAL_CALL SfxBaseModel::getDocumentInfo() throw(::com::sun::star::uno::RuntimeException)
{
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
-
+ SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING );
if ( !m_pData->m_xDocumentInfo.is() )
{
// WARNING: this will only work if (when loading a document) the
@@ -891,11 +887,7 @@ uno::Reference< document::XDocumentProperties > SAL_CALL
SfxBaseModel::getDocumentProperties()
throw(::com::sun::star::uno::RuntimeException)
{
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
-
+ SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING );
if ( !m_pData->m_xDocumentProperties.is() )
{
uno::Reference< lang::XInitialization > xDocProps(
@@ -943,10 +935,7 @@ sal_Bool SAL_CALL SfxBaseModel::attachResource( const ::rtl::OUString&
const uno::Sequence< beans::PropertyValue >& rArgs )
throw(::com::sun::star::uno::RuntimeException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
-
+ SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING );
if ( rURL.getLength() == 0 && rArgs.getLength() == 1 && rArgs[0].Name.equalsAscii( "SetEmbedded" ) )
{
// allows to set a windowless document to EMBEDDED state
@@ -964,53 +953,50 @@ sal_Bool SAL_CALL SfxBaseModel::attachResource( const ::rtl::OUString&
if ( m_pData->m_pObjectShell.Is() )
{
m_pData->m_sURL = rURL;
- uno::Sequence< beans::PropertyValue > aNewSeqArgs( rArgs.getLength() );
- sal_Int32 nNewLen = 0;
- for ( sal_Int32 nInd = 0; nInd < rArgs.getLength(); nInd++ )
+ SfxObjectShell* pObjectShell = m_pData->m_pObjectShell;
+
+ ::comphelper::NamedValueCollection aArgs( rArgs );
+
+ Sequence< sal_Int32 > aWinExtent;
+ if ( ( aArgs.get( "WinExtent" ) >>= aWinExtent )&& ( aWinExtent.getLength() == 4 ) )
{
- if ( rArgs[nInd].Name.equalsAscii( "WinExtent" ) )
- {
- Sequence< sal_Int32 > aSize;
- if ( ( rArgs[nInd].Value >>= aSize ) && aSize.getLength() == 4 )
- {
- Rectangle aTmpRect( aSize[0], aSize[1], aSize[2], aSize[3] );
- aTmpRect = OutputDevice::LogicToLogic( aTmpRect, MAP_100TH_MM, m_pData->m_pObjectShell->GetMapUnit() );
- m_pData->m_pObjectShell->SetVisArea( aTmpRect );
- }
- }
- else if ( rArgs[nInd].Name.equalsAscii( "BreakMacroSignature" ) )
- {
- sal_Bool bBreakMacroSign = sal_False;
- rArgs[nInd].Value >>= bBreakMacroSign;
- m_pData->m_pObjectShell->BreakMacroSign_Impl( bBreakMacroSign );
- }
- else if ( !rArgs[nInd].Name.equalsAscii( "Stream" ) && !rArgs[nInd].Name.equalsAscii( "InputStream" ) )
- {
- // TODO/LATER: all the parameters that are accepted by ItemSet of the DocShell must be ignored here
- aNewSeqArgs[nNewLen++] = rArgs[nInd];
- }
+ Rectangle aVisArea( aWinExtent[0], aWinExtent[1], aWinExtent[2], aWinExtent[3] );
+ aVisArea = OutputDevice::LogicToLogic( aVisArea, MAP_100TH_MM, pObjectShell->GetMapUnit() );
+ pObjectShell->SetVisArea( aVisArea );
+ }
+
+ sal_Bool bBreakMacroSign = sal_False;
+ if ( aArgs.get( "BreakMacroSignature" ) >>= bBreakMacroSign )
+ {
+ pObjectShell->BreakMacroSign_Impl( bBreakMacroSign );
}
- aNewSeqArgs.realloc( nNewLen );
+ aArgs.remove( "WinExtent" );
+ aArgs.remove( "BreakMacroSignature" );
+ aArgs.remove( "Stream" );
+ aArgs.remove( "InputStream" );
- m_pData->m_seqArguments = aNewSeqArgs;
+ // TODO/LATER: all the parameters that are accepted by ItemSet of the DocShell must be removed here
- if( m_pData->m_pObjectShell->GetMedium() )
+ m_pData->m_seqArguments = aArgs.getPropertyValues();
+
+ SfxMedium* pMedium = pObjectShell->GetMedium();
+ if ( pMedium )
{
- SfxAllItemSet aSet( m_pData->m_pObjectShell->GetPool() );
+ SfxAllItemSet aSet( pObjectShell->GetPool() );
TransformParameters( SID_OPENDOC, rArgs, aSet );
- m_pData->m_pObjectShell->GetMedium()->GetItemSet()->Put( aSet );
+ pMedium->GetItemSet()->Put( aSet );
SFX_ITEMSET_ARG( &aSet, pItem, SfxStringItem, SID_FILTER_NAME, sal_False );
if ( pItem )
- m_pData->m_pObjectShell->GetMedium()->SetFilter(
- m_pData->m_pObjectShell->GetFactory().GetFilterContainer()->GetFilter4FilterName( pItem->GetValue() ) );
+ pMedium->SetFilter(
+ pObjectShell->GetFactory().GetFilterContainer()->GetFilter4FilterName( pItem->GetValue() ) );
SFX_ITEMSET_ARG( &aSet, pTitleItem, SfxStringItem, SID_DOCINFO_TITLE, sal_False );
if ( pTitleItem )
{
- SfxViewFrame* pFrame = SfxViewFrame::GetFirst( m_pData->m_pObjectShell );
+ SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pObjectShell );
if ( pFrame )
pFrame->UpdateTitle();
}
@@ -1026,10 +1012,7 @@ sal_Bool SAL_CALL SfxBaseModel::attachResource( const ::rtl::OUString&
::rtl::OUString SAL_CALL SfxBaseModel::getURL() throw(::com::sun::star::uno::RuntimeException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
-
+ SfxModelGuard aGuard( *this );
return m_pData->m_sURL ;
}
@@ -1039,10 +1022,7 @@ sal_Bool SAL_CALL SfxBaseModel::attachResource( const ::rtl::OUString&
uno::Sequence< beans::PropertyValue > SAL_CALL SfxBaseModel::getArgs() throw(::com::sun::star::uno::RuntimeException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
-
+ SfxModelGuard aGuard( *this );
if ( m_pData->m_pObjectShell.Is() )
{
uno::Sequence< beans::PropertyValue > seqArgsNew;
@@ -1142,9 +1122,10 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SfxBaseModel::getArgs() throw(::c
void SAL_CALL SfxBaseModel::connectController( const uno::Reference< frame::XController >& xController )
throw(::com::sun::star::uno::RuntimeException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
+ OSL_PRECOND( xController.is(), "SfxBaseModel::connectController: invalid controller!" );
+ if ( !xController.is() )
+ return;
sal_uInt32 nOldCount = m_pData->m_seqControllers.getLength();
uno::Sequence< uno::Reference< frame::XController > > aNewSeq( nOldCount + 1 );
@@ -1152,6 +1133,16 @@ void SAL_CALL SfxBaseModel::connectController( const uno::Reference< frame::XCon
aNewSeq.getArray()[n] = m_pData->m_seqControllers.getConstArray()[n];
aNewSeq.getArray()[nOldCount] = xController;
m_pData->m_seqControllers = aNewSeq;
+
+ if ( m_pData->m_seqControllers.getLength() == 1 )
+ {
+ SfxViewFrame* pViewFrame = SfxViewFrame::Get( xController, GetObjectShell() );
+ ENSURE_OR_THROW( pViewFrame, "SFX document without SFX view!?" );
+ pViewFrame->UpdateDocument_Impl();
+ const String sDocumentURL = GetObjectShell()->GetMedium()->GetName();
+ if ( sDocumentURL.Len() )
+ SFX_APP()->Broadcast( SfxStringHint( SID_OPENURL, sDocumentURL ) );
+ }
}
//________________________________________________________________________________________________________
@@ -1160,9 +1151,7 @@ void SAL_CALL SfxBaseModel::connectController( const uno::Reference< frame::XCon
void SAL_CALL SfxBaseModel::disconnectController( const uno::Reference< frame::XController >& xController ) throw(::com::sun::star::uno::RuntimeException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
sal_uInt32 nOldCount = m_pData->m_seqControllers.getLength();
if ( !nOldCount )
@@ -1190,9 +1179,8 @@ void SAL_CALL SfxBaseModel::disconnectController( const uno::Reference< frame::X
void SAL_CALL SfxBaseModel::lockControllers() throw(::com::sun::star::uno::RuntimeException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
+
++m_pData->m_nControllerLockCount ;
}
@@ -1202,9 +1190,8 @@ void SAL_CALL SfxBaseModel::lockControllers() throw(::com::sun::star::uno::Runti
void SAL_CALL SfxBaseModel::unlockControllers() throw(::com::sun::star::uno::RuntimeException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
+
--m_pData->m_nControllerLockCount ;
}
@@ -1214,9 +1201,7 @@ void SAL_CALL SfxBaseModel::unlockControllers() throw(::com::sun::star::uno::Run
sal_Bool SAL_CALL SfxBaseModel::hasControllersLocked() throw(::com::sun::star::uno::RuntimeException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
return ( m_pData->m_nControllerLockCount != 0 ) ;
}
@@ -1226,10 +1211,7 @@ sal_Bool SAL_CALL SfxBaseModel::hasControllersLocked() throw(::com::sun::star::u
uno::Reference< frame::XController > SAL_CALL SfxBaseModel::getCurrentController() throw(::com::sun::star::uno::RuntimeException)
{
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
// get the last active controller of this model
if ( m_pData->m_xCurrent.is() )
@@ -1246,10 +1228,7 @@ uno::Reference< frame::XController > SAL_CALL SfxBaseModel::getCurrentController
void SAL_CALL SfxBaseModel::setCurrentController( const uno::Reference< frame::XController >& xCurrentController )
throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException)
{
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
m_pData->m_xCurrent = xCurrentController;
}
@@ -1260,10 +1239,7 @@ void SAL_CALL SfxBaseModel::setCurrentController( const uno::Reference< frame::X
uno::Reference< uno::XInterface > SAL_CALL SfxBaseModel::getCurrentSelection() throw(::com::sun::star::uno::RuntimeException)
{
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
uno::Reference< uno::XInterface > xReturn;
uno::Reference< frame::XController > xController = getCurrentController() ;
@@ -1287,9 +1263,7 @@ uno::Reference< uno::XInterface > SAL_CALL SfxBaseModel::getCurrentSelection() t
sal_Bool SAL_CALL SfxBaseModel::disableSetModified() throw (::com::sun::star::uno::RuntimeException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw DISPOSEDEXCEPTION();
+ SfxModelGuard aGuard( *this );
if ( !m_pData->m_pObjectShell.Is() )
throw uno::RuntimeException();
@@ -1302,9 +1276,7 @@ sal_Bool SAL_CALL SfxBaseModel::disableSetModified() throw (::com::sun::star::un
sal_Bool SAL_CALL SfxBaseModel::enableSetModified() throw (::com::sun::star::uno::RuntimeException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw DISPOSEDEXCEPTION();
+ SfxModelGuard aGuard( *this );
if ( !m_pData->m_pObjectShell.Is() )
throw uno::RuntimeException();
@@ -1317,9 +1289,7 @@ sal_Bool SAL_CALL SfxBaseModel::enableSetModified() throw (::com::sun::star::uno
sal_Bool SAL_CALL SfxBaseModel::isSetModifiedEnabled() throw (::com::sun::star::uno::RuntimeException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw DISPOSEDEXCEPTION();
+ SfxModelGuard aGuard( *this );
if ( !m_pData->m_pObjectShell.Is() )
throw uno::RuntimeException();
@@ -1333,10 +1303,7 @@ sal_Bool SAL_CALL SfxBaseModel::isSetModifiedEnabled() throw (::com::sun::star::
sal_Bool SAL_CALL SfxBaseModel::isModified() throw(::com::sun::star::uno::RuntimeException)
{
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
return m_pData->m_pObjectShell.Is() ? m_pData->m_pObjectShell->IsModified() : sal_False;
}
@@ -1348,10 +1315,7 @@ sal_Bool SAL_CALL SfxBaseModel::isModified() throw(::com::sun::star::uno::Runtim
void SAL_CALL SfxBaseModel::setModified( sal_Bool bModified )
throw (::com::sun::star::beans::PropertyVetoException, ::com::sun::star::uno::RuntimeException)
{
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
if ( m_pData->m_pObjectShell.Is() )
m_pData->m_pObjectShell->SetModified(bModified);
@@ -1363,10 +1327,7 @@ void SAL_CALL SfxBaseModel::setModified( sal_Bool bModified )
void SAL_CALL SfxBaseModel::addModifyListener(const uno::Reference< XMODIFYLISTENER >& xListener) throw( uno::RuntimeException )
{
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- return;
+ SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING );
m_pData->m_aInterfaceContainer.addInterface( ::getCppuType((const uno::Reference< XMODIFYLISTENER >*)0),xListener );
}
@@ -1377,10 +1338,7 @@ void SAL_CALL SfxBaseModel::addModifyListener(const uno::Reference< XMODIFYLISTE
void SAL_CALL SfxBaseModel::removeModifyListener(const uno::Reference< XMODIFYLISTENER >& xListener) throw( uno::RuntimeException )
{
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- return;
+ SfxModelGuard aGuard( *this );
m_pData->m_aInterfaceContainer.removeInterface( ::getCppuType((const uno::Reference< XMODIFYLISTENER >*)0), xListener );
}
@@ -1394,7 +1352,7 @@ void SAL_CALL SfxBaseModel::close( sal_Bool bDeliverOwnership ) throw (util::Clo
static ::rtl::OUString MSG_1 = ::rtl::OUString::createFromAscii("Cant close while saving.");
::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( !m_pData || m_pData->m_bClosed || m_pData->m_bClosing )
+ if ( impl_isDisposed() || m_pData->m_bClosed || m_pData->m_bClosing )
return;
uno::Reference< uno::XInterface > xSelfHold( static_cast< ::cppu::OWeakObject* >(this) );
@@ -1456,10 +1414,7 @@ void SAL_CALL SfxBaseModel::close( sal_Bool bDeliverOwnership ) throw (util::Clo
void SAL_CALL SfxBaseModel::addCloseListener( const uno::Reference< XCLOSELISTENER >& xListener ) throw (uno::RuntimeException)
{
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- return;
+ SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING );
m_pData->m_aInterfaceContainer.addInterface( ::getCppuType((const uno::Reference< XCLOSELISTENER >*)0), xListener );
}
@@ -1470,10 +1425,7 @@ void SAL_CALL SfxBaseModel::addCloseListener( const uno::Reference< XCLOSELISTEN
void SAL_CALL SfxBaseModel::removeCloseListener( const uno::Reference< XCLOSELISTENER >& xListener ) throw (uno::RuntimeException)
{
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- return;
+ SfxModelGuard aGuard( *this );
m_pData->m_aInterfaceContainer.removeInterface( ::getCppuType((const uno::Reference< XCLOSELISTENER >*)0), xListener );
}
@@ -1484,10 +1436,7 @@ void SAL_CALL SfxBaseModel::removeCloseListener( const uno::Reference< XCLOSELIS
uno::Sequence< beans::PropertyValue > SAL_CALL SfxBaseModel::getPrinter() throw(::com::sun::star::uno::RuntimeException)
{
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
if ( impl_getPrintHelper() )
return m_pData->m_xPrintable->getPrinter();
@@ -1498,10 +1447,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SfxBaseModel::getPrinter() throw(
void SAL_CALL SfxBaseModel::setPrinter(const uno::Sequence< beans::PropertyValue >& rPrinter)
throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
{
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
if ( impl_getPrintHelper() )
m_pData->m_xPrintable->setPrinter( rPrinter );
@@ -1510,10 +1456,7 @@ void SAL_CALL SfxBaseModel::setPrinter(const uno::Sequence< beans::PropertyValue
void SAL_CALL SfxBaseModel::print(const uno::Sequence< beans::PropertyValue >& rOptions)
throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
{
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
if ( impl_getPrintHelper() )
m_pData->m_xPrintable->print( rOptions );
@@ -1525,10 +1468,7 @@ void SAL_CALL SfxBaseModel::print(const uno::Sequence< beans::PropertyValue >& r
sal_Bool SAL_CALL SfxBaseModel::hasLocation() throw(::com::sun::star::uno::RuntimeException)
{
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
return m_pData->m_pObjectShell.Is() ? m_pData->m_pObjectShell->HasName() : sal_False;
}
@@ -1539,10 +1479,7 @@ sal_Bool SAL_CALL SfxBaseModel::hasLocation() throw(::com::sun::star::uno::Runti
::rtl::OUString SAL_CALL SfxBaseModel::getLocation() throw(::com::sun::star::uno::RuntimeException)
{
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
if ( m_pData->m_pObjectShell.Is() )
{
@@ -1562,10 +1499,7 @@ sal_Bool SAL_CALL SfxBaseModel::hasLocation() throw(::com::sun::star::uno::Runti
sal_Bool SAL_CALL SfxBaseModel::isReadonly() throw(::com::sun::star::uno::RuntimeException)
{
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
return m_pData->m_pObjectShell.Is() ? m_pData->m_pObjectShell->IsReadOnly() : sal_True;
}
@@ -1581,10 +1515,7 @@ void SAL_CALL SfxBaseModel::storeSelf( const uno::Sequence< beans::PropertyVa
{
RTL_LOGFILE_PRODUCT_CONTEXT( aPerfLog, "PERFORMANCE - SfxBaseModel::storeSelf" );
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
if ( m_pData->m_pObjectShell.Is() )
{
@@ -1682,10 +1613,7 @@ void SAL_CALL SfxBaseModel::storeAsURL( const ::rtl::OUString&
{
RTL_LOGFILE_PRODUCT_CONTEXT( aPerfLog, "PERFORMANCE - SfxBaseModel::storeAsURL" );
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
if ( m_pData->m_pObjectShell.Is() )
{
@@ -1708,10 +1636,7 @@ void SAL_CALL SfxBaseModel::storeToURL( const ::rtl::OUString&
const uno::Sequence< beans::PropertyValue >& rArgs )
throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException)
{
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
if ( m_pData->m_pObjectShell.Is() )
{
@@ -1721,6 +1646,51 @@ void SAL_CALL SfxBaseModel::storeToURL( const ::rtl::OUString&
}
}
+::sal_Bool SAL_CALL SfxBaseModel::wasModifiedSinceLastSave() throw ( RuntimeException )
+{
+ SfxModelGuard aGuard( *this );
+ return m_pData->m_bModifiedSinceLastSave;
+}
+
+void SAL_CALL SfxBaseModel::storeToRecoveryFile( const ::rtl::OUString& i_TargetLocation, const Sequence< PropertyValue >& i_MediaDescriptor ) throw ( RuntimeException, IOException, WrappedTargetException )
+{
+ SfxModelGuard aGuard( *this );
+
+ // delegate
+ SfxSaveGuard aSaveGuard( this, m_pData, sal_False );
+ impl_store( i_TargetLocation, i_MediaDescriptor, sal_True );
+
+ // no need for subsequent calls to storeToRecoveryFile, unless we're modified, again
+ m_pData->m_bModifiedSinceLastSave = sal_False;
+}
+
+void SAL_CALL SfxBaseModel::recoverFromFile( const ::rtl::OUString& i_SourceLocation, const ::rtl::OUString& i_SalvagedFile, const Sequence< PropertyValue >& i_MediaDescriptor ) throw ( RuntimeException, IOException, WrappedTargetException )
+{
+ SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING );
+
+ // delegate to our "load" method
+ ::comphelper::NamedValueCollection aMediaDescriptor( i_MediaDescriptor );
+
+ // our load implementation expects the SalvagedFile to be in the media descriptor
+ OSL_ENSURE( !aMediaDescriptor.has( "SalvagedFile" ) || ( aMediaDescriptor.getOrDefault( "SalvagedFile", ::rtl::OUString() ) == i_SalvagedFile ),
+ "SfxBaseModel::recoverFromFile: inconsistent information!" );
+ aMediaDescriptor.put( "SalvagedFile", i_SalvagedFile );
+
+ // similar for the to-be-loaded file
+ OSL_ENSURE( !aMediaDescriptor.has( "URL" ) || ( aMediaDescriptor.getOrDefault( "URL", ::rtl::OUString() ) == i_SourceLocation ),
+ "SfxBaseModel::recoverFromFile: inconsistent information!" );
+ aMediaDescriptor.put( "URL", i_SourceLocation );
+
+ load( aMediaDescriptor.getPropertyValues() );
+
+ // Note: The XDocumentRecovery interface specification requires us to do an attachResource after loading.
+ // However, we will not do this here, as we know that our load implementation (respectively some method
+ // called from there) already did so.
+ // In particular, the load process might already have modified some elements of the media
+ // descriptor, for instance the MacroExecMode (in case the user was involved to decide about it), and we do
+ // not want to overwrite it with the "old" elements passed to this method here.
+}
+
//________________________________________________________________________________________________________
// XLoadable
//________________________________________________________________________________________________________
@@ -1731,10 +1701,9 @@ void SAL_CALL SfxBaseModel::initNew()
::com::sun::star::uno::RuntimeException,
::com::sun::star::uno::Exception)
{
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING );
+ if ( IsInitialized() )
+ throw ::com::sun::star::frame::DoubleInitializationException( ::rtl::OUString(), *this );
// the object shell should exist always
DBG_ASSERT( m_pData->m_pObjectShell.Is(), "Model is useless without an ObjectShell" );
@@ -1763,10 +1732,9 @@ void SAL_CALL SfxBaseModel::load( const uno::Sequence< beans::PropertyValue >&
::com::sun::star::uno::RuntimeException,
::com::sun::star::uno::Exception)
{
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING );
+ if ( IsInitialized() )
+ throw ::com::sun::star::frame::DoubleInitializationException( ::rtl::OUString(), *this );
// the object shell should exist always
DBG_ASSERT( m_pData->m_pObjectShell.Is(), "Model is useless without an ObjectShell" );
@@ -1910,6 +1878,13 @@ void SAL_CALL SfxBaseModel::load( const uno::Sequence< beans::PropertyValue >&
nError ? nError : ERRCODE_IO_CANTREAD );
}
}
+
+ BOOL bHidden = FALSE;
+ SFX_ITEMSET_ARG( pMedium->GetItemSet(), pHidItem, SfxBoolItem, SID_HIDDEN, sal_False);
+ if ( pHidItem )
+ bHidden = pHidItem->GetValue();
+ // !TODO: will be done by Framework!
+ pMedium->SetUpdatePickList( !bHidden );
}
}
@@ -1922,10 +1897,7 @@ uno::Any SAL_CALL SfxBaseModel::getTransferData( const DATAFLAVOR& aFlavor )
::com::sun::star::io::IOException,
::com::sun::star::uno::RuntimeException)
{
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
uno::Any aAny;
@@ -2164,10 +2136,7 @@ uno::Any SAL_CALL SfxBaseModel::getTransferData( const DATAFLAVOR& aFlavor )
uno::Sequence< DATAFLAVOR > SAL_CALL SfxBaseModel::getTransferDataFlavors()
throw (::com::sun::star::uno::RuntimeException)
{
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
sal_Int32 nSuppFlavors = GraphicHelper::supportsMetaFileHandle_Impl() ? 10 : 8;
uno::Sequence< DATAFLAVOR > aFlavorSeq( nSuppFlavors );
@@ -2236,10 +2205,7 @@ uno::Sequence< DATAFLAVOR > SAL_CALL SfxBaseModel::getTransferDataFlavors()
sal_Bool SAL_CALL SfxBaseModel::isDataFlavorSupported( const DATAFLAVOR& aFlavor )
throw (::com::sun::star::uno::RuntimeException)
{
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
if ( aFlavor.MimeType.equalsAscii( "application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"" ) )
{
@@ -2298,10 +2264,7 @@ sal_Bool SAL_CALL SfxBaseModel::isDataFlavorSupported( const DATAFLAVOR& aFlavor
uno::Reference< container::XNameReplace > SAL_CALL SfxBaseModel::getEvents() throw( uno::RuntimeException )
{
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
if ( ! m_pData->m_xEvents.is() )
{
@@ -2317,9 +2280,7 @@ uno::Reference< container::XNameReplace > SAL_CALL SfxBaseModel::getEvents() thr
uno::Reference< script::XStorageBasedLibraryContainer > SAL_CALL SfxBaseModel::getBasicLibraries() throw (RuntimeException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
uno::Reference< script::XStorageBasedLibraryContainer > xBasicLibraries;
if ( m_pData->m_pObjectShell )
@@ -2329,9 +2290,7 @@ uno::Reference< script::XStorageBasedLibraryContainer > SAL_CALL SfxBaseModel::g
uno::Reference< script::XStorageBasedLibraryContainer > SAL_CALL SfxBaseModel::getDialogLibraries() throw (RuntimeException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
uno::Reference< script::XStorageBasedLibraryContainer > xDialogLibraries;
if ( m_pData->m_pObjectShell )
@@ -2341,9 +2300,7 @@ uno::Reference< script::XStorageBasedLibraryContainer > SAL_CALL SfxBaseModel::g
::sal_Bool SAL_CALL SfxBaseModel::getAllowMacroExecution() throw (RuntimeException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
if ( m_pData->m_pObjectShell )
return m_pData->m_pObjectShell->AdjustMacroMode( String(), false );
@@ -2356,9 +2313,7 @@ uno::Reference< script::XStorageBasedLibraryContainer > SAL_CALL SfxBaseModel::g
Reference< document::XEmbeddedScripts > SAL_CALL SfxBaseModel::getScriptContainer() throw (RuntimeException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
Reference< document::XEmbeddedScripts > xDocumentScripts;
@@ -2394,10 +2349,7 @@ Reference< document::XEmbeddedScripts > SAL_CALL SfxBaseModel::getScriptContaine
void SAL_CALL SfxBaseModel::addEventListener( const uno::Reference< XDOCEVENTLISTENER >& aListener ) throw( uno::RuntimeException )
{
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- return;
+ SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING );
m_pData->m_aInterfaceContainer.addInterface( ::getCppuType((const uno::Reference< XDOCEVENTLISTENER >*)0), aListener );
}
@@ -2408,10 +2360,7 @@ void SAL_CALL SfxBaseModel::addEventListener( const uno::Reference< XDOCEVENTLIS
void SAL_CALL SfxBaseModel::removeEventListener( const uno::Reference< XDOCEVENTLISTENER >& aListener ) throw( uno::RuntimeException )
{
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- return;
+ SfxModelGuard aGuard( *this );
m_pData->m_aInterfaceContainer.removeInterface( ::getCppuType((const uno::Reference< XDOCEVENTLISTENER >*)0), aListener );
}
@@ -2489,7 +2438,9 @@ void SfxBaseModel::Notify( SfxBroadcaster& rBC ,
if ( pNamedHint )
{
- if ( SFX_EVENT_STORAGECHANGED == pNamedHint->GetEventId() )
+ switch ( pNamedHint->GetEventId() )
+ {
+ case SFX_EVENT_STORAGECHANGED:
{
// for now this event is sent only on creation of a new storage for new document
// and in case of reload of medium without document reload
@@ -2520,12 +2471,17 @@ void SfxBaseModel::Notify( SfxBroadcaster& rBC ,
ListenForStorage_Impl( m_pData->m_pObjectShell->GetStorage() );
}
- else if ( SFX_EVENT_LOADFINISHED == pNamedHint->GetEventId() )
+ break;
+
+ case SFX_EVENT_LOADFINISHED:
{
impl_getPrintHelper();
ListenForStorage_Impl( m_pData->m_pObjectShell->GetStorage() );
+ m_pData->m_bModifiedSinceLastSave = sal_False;
}
- else if ( SFX_EVENT_SAVEASDOCDONE == pNamedHint->GetEventId() )
+ break;
+
+ case SFX_EVENT_SAVEASDOCDONE:
{
m_pData->m_sURL = m_pData->m_pObjectShell->GetMedium()->GetName();
@@ -2536,9 +2492,20 @@ void SfxBaseModel::Notify( SfxBroadcaster& rBC ,
addTitle_Impl( aArgs, aTitle );
attachResource( m_pData->m_pObjectShell->GetMedium()->GetName(), aArgs );
}
- else if ( SFX_EVENT_DOCCREATED == pNamedHint->GetEventId() )
+ break;
+
+ case SFX_EVENT_DOCCREATED:
{
impl_getPrintHelper();
+ m_pData->m_bModifiedSinceLastSave = sal_False;
+ }
+ break;
+
+ case SFX_EVENT_MODIFYCHANGED:
+ {
+ m_pData->m_bModifiedSinceLastSave = isModified();
+ }
+ break;
}
postEvent_Impl( pNamedHint->GetEventName() );
@@ -2572,36 +2539,29 @@ void SfxBaseModel::Notify( SfxBroadcaster& rBC ,
// public impl.
//________________________________________________________________________________________________________
+void SfxBaseModel::NotifyModifyListeners_Impl() const
+{
+ ::cppu::OInterfaceContainerHelper* pIC = m_pData->m_aInterfaceContainer.getContainer( ::getCppuType((const uno::Reference< XMODIFYLISTENER >*)0) );
+ if ( pIC )
+ {
+ lang::EventObject aEvent( (frame::XModel *)this );
+ pIC->notifyEach( &util::XModifyListener::modified, aEvent );
+ }
+
+ // this notification here is done too generously, we cannot simply assume that we're really modified
+ // now, but we need to check it ...
+ m_pData->m_bModifiedSinceLastSave = const_cast< SfxBaseModel* >( this )->isModified();
+}
+
void SfxBaseModel::changing()
{
- // object already disposed?
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- return;
+ SfxModelGuard aGuard( *this );
// the notification should not be sent if the document can not be modified
if ( !m_pData->m_pObjectShell.Is() || !m_pData->m_pObjectShell->IsEnableSetModified() )
return;
- ::cppu::OInterfaceContainerHelper* pIC = m_pData->m_aInterfaceContainer.getContainer( ::getCppuType((const uno::Reference< XMODIFYLISTENER >*)0) );
- if( pIC )
-
- {
- lang::EventObject aEvent( (frame::XModel *)this );
- ::cppu::OInterfaceIteratorHelper aIt( *pIC );
- while( aIt.hasMoreElements() )
- {
- try
- {
- ((XMODIFYLISTENER *)aIt.next())->modified( aEvent );
- }
- catch( uno::RuntimeException& )
- {
- aIt.remove();
- }
- }
- }
+ NotifyModifyListeners_Impl();
}
void SfxBaseModel::impl_change()
@@ -2610,24 +2570,7 @@ void SfxBaseModel::impl_change()
if ( impl_isDisposed() )
return;
- ::cppu::OInterfaceContainerHelper* pIC = m_pData->m_aInterfaceContainer.getContainer( ::getCppuType((const uno::Reference< XMODIFYLISTENER >*)0) );
- if( pIC )
-
- {
- lang::EventObject aEvent( (frame::XModel *)this );
- ::cppu::OInterfaceIteratorHelper aIt( *pIC );
- while( aIt.hasMoreElements() )
- {
- try
- {
- ((XMODIFYLISTENER *)aIt.next())->modified( aEvent );
- }
- catch( uno::RuntimeException& )
- {
- aIt.remove();
- }
- }
- }
+ NotifyModifyListeners_Impl();
}
//________________________________________________________________________________________________________
@@ -2653,6 +2596,17 @@ sal_Bool SfxBaseModel::IsDisposed() const
return ( m_pData == NULL ) ;
}
+sal_Bool SfxBaseModel::IsInitialized() const
+{
+ if ( !m_pData || !m_pData->m_pObjectShell )
+ {
+ OSL_ENSURE( false, "SfxBaseModel::IsInitialized: this should have been caught earlier!" );
+ return sal_False;
+ }
+
+ return m_pData->m_pObjectShell->GetMedium() != NULL;
+}
+
sal_Bool SfxBaseModel::impl_isDisposed() const
{
return ( m_pData == NULL ) ;
@@ -2920,16 +2874,13 @@ void SfxBaseModel::postEvent_Impl( ::rtl::OUString aName )
uno::Reference < container::XIndexAccess > SAL_CALL SfxBaseModel::getViewData() throw(::com::sun::star::uno::RuntimeException)
{
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
if ( m_pData->m_pObjectShell.Is() && !m_pData->m_contViewData.is() )
{
SfxViewFrame *pActFrame = SfxViewFrame::Current();
if ( !pActFrame || pActFrame->GetObjectShell() != m_pData->m_pObjectShell )
- pActFrame = SfxViewFrame::GetFirst(m_pData->m_pObjectShell, TYPE(SfxTopViewFrame));
+ pActFrame = SfxViewFrame::GetFirst( m_pData->m_pObjectShell );
if ( !pActFrame || !pActFrame->GetViewShell() )
// currently no frame for this document at all or View is under construction
@@ -2950,8 +2901,8 @@ uno::Reference < container::XIndexAccess > SAL_CALL SfxBaseModel::getViewData()
sal_Int32 nCount = 0;
uno::Sequence < beans::PropertyValue > aSeq;
::com::sun::star::uno::Any aAny;
- for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst(m_pData->m_pObjectShell, TYPE(SfxTopViewFrame) ); pFrame;
- pFrame = SfxViewFrame::GetNext(*pFrame, m_pData->m_pObjectShell, TYPE(SfxTopViewFrame) ) )
+ for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst( m_pData->m_pObjectShell ); pFrame;
+ pFrame = SfxViewFrame::GetNext( *pFrame, m_pData->m_pObjectShell ) )
{
BOOL bIsActive = ( pFrame == pActFrame );
pFrame->GetViewShell()->WriteUserDataSequence( aSeq );
@@ -2966,10 +2917,7 @@ uno::Reference < container::XIndexAccess > SAL_CALL SfxBaseModel::getViewData()
void SAL_CALL SfxBaseModel::setViewData( const uno::Reference < container::XIndexAccess >& aData ) throw(::com::sun::star::uno::RuntimeException)
{
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
m_pData->m_contViewData = aData;
}
@@ -3009,10 +2957,7 @@ sal_Bool SfxBaseModel::hasEventListeners() const
void SAL_CALL SfxBaseModel::addPrintJobListener( const uno::Reference< view::XPrintJobListener >& xListener ) throw (uno::RuntimeException)
{
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- return;
+ SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING );
if ( impl_getPrintHelper() )
{
@@ -3026,10 +2971,7 @@ void SAL_CALL SfxBaseModel::addPrintJobListener( const uno::Reference< view::XPr
void SAL_CALL SfxBaseModel::removePrintJobListener( const uno::Reference< view::XPrintJobListener >& xListener ) throw (uno::RuntimeException)
{
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- return;
+ SfxModelGuard aGuard( *this );
if ( impl_getPrintHelper() )
{
@@ -3048,7 +2990,7 @@ class SvObject;
sal_Int64 SAL_CALL SfxBaseModel::getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException)
{
::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( !impl_isDisposed() && GetObjectShell() )
+ if ( GetObjectShell() )
{
SvGlobalName aName( aIdentifier );
if ( aName == SvGlobalName( SO3_GLOBAL_CLASSID ) )
@@ -3082,9 +3024,7 @@ void SfxBaseModel::ListenForStorage_Impl( const uno::Reference< embed::XStorage
uno::Reference< XSTORAGE > SAL_CALL SfxBaseModel::getDocumentSubStorage( const ::rtl::OUString& aStorageName, sal_Int32 nMode )
throw ( uno::RuntimeException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
uno::Reference< XSTORAGE > xResult;
if ( m_pData->m_pObjectShell.Is() )
@@ -3109,9 +3049,7 @@ Sequence< ::rtl::OUString > SAL_CALL SfxBaseModel::getDocumentSubStoragesNames()
throw ( io::IOException,
RuntimeException )
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
Sequence< ::rtl::OUString > aResult;
sal_Int32 nResultSize = 0;
@@ -3150,9 +3088,7 @@ Sequence< ::rtl::OUString > SAL_CALL SfxBaseModel::getDocumentSubStoragesNames()
uno::Reference< script::provider::XScriptProvider > SAL_CALL SfxBaseModel::getScriptProvider()
throw ( uno::RuntimeException )
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
uno::Reference< script::provider::XScriptProvider > xScriptProvider;
@@ -3258,9 +3194,7 @@ static void ConvertSlotsToCommands( SfxObjectShell* pDoc, uno::Reference< contai
uno::Reference< ui::XUIConfigurationManager > SAL_CALL SfxBaseModel::getUIConfigurationManager()
throw ( uno::RuntimeException )
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
if ( !m_pData->m_xUIConfigurationManager.is() )
{
@@ -3376,17 +3310,15 @@ void SAL_CALL SfxBaseModel::setVisualAreaSize( sal_Int64 nAspect, const awt::Siz
uno::Exception,
uno::RuntimeException )
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
if ( !m_pData->m_pObjectShell.Is() )
throw uno::Exception(); // TODO: error handling
- SfxViewFrame* pViewFrm = SfxViewFrame::GetFirst( m_pData->m_pObjectShell, 0, sal_False );
- if ( pViewFrm && m_pData->m_pObjectShell->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED && !pViewFrm->GetFrame()->IsInPlace() )
+ SfxViewFrame* pViewFrm = SfxViewFrame::GetFirst( m_pData->m_pObjectShell, sal_False );
+ if ( pViewFrm && m_pData->m_pObjectShell->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED && !pViewFrm->GetFrame().IsInPlace() )
{
- Window* pWindow = VCLUnoHelper::GetWindow( pViewFrm->GetFrame()->GetFrameInterface()->getContainerWindow() );
+ Window* pWindow = VCLUnoHelper::GetWindow( pViewFrm->GetFrame().GetFrameInterface()->getContainerWindow() );
Size aWinSize = pWindow->GetSizePixel();
awt::Size aCurrent = getVisualAreaSize( nAspect );
Size aDiff( aSize.Width-aCurrent.Width, aSize.Height-aCurrent.Height );
@@ -3410,9 +3342,7 @@ awt::Size SAL_CALL SfxBaseModel::getVisualAreaSize( sal_Int64 /*nAspect*/ )
uno::Exception,
uno::RuntimeException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
if ( !m_pData->m_pObjectShell.Is() )
throw uno::Exception(); // TODO: error handling
@@ -3441,9 +3371,7 @@ sal_Int32 SAL_CALL SfxBaseModel::getMapUnit( sal_Int64 /*nAspect*/ )
throw ( uno::Exception,
uno::RuntimeException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
if ( !m_pData->m_pObjectShell.Is() )
throw uno::Exception(); // TODO: error handling
@@ -3457,9 +3385,7 @@ embed::VisualRepresentation SAL_CALL SfxBaseModel::getPreferredVisualRepresentat
uno::Exception,
uno::RuntimeException )
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
datatransfer::DataFlavor aDataFlavor(
::rtl::OUString::createFromAscii( "application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"" ),
@@ -3485,44 +3411,34 @@ void SAL_CALL SfxBaseModel::loadFromStorage( const uno::Reference< XSTORAGE >& x
EXCEPTION,
uno::RuntimeException )
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING );
+ if ( IsInitialized() )
+ throw ::com::sun::star::frame::DoubleInitializationException( ::rtl::OUString(), *this );
- if ( !m_pData->m_pObjectShell.Is() )
- throw IOEXCEPTION(); // TODO:
+ // after i36090 is fixed the pool from object shell can be used
+ // SfxAllItemSet aSet( m_pData->m_pObjectShell->GetPool() );
+ SfxAllItemSet aSet( SFX_APP()->GetPool() );
- if ( m_pData->m_pObjectShell.Is() )
- {
- if( m_pData->m_pObjectShell->GetMedium() )
- // if a Medium is present, the document is already initialized
- throw DOUBLEINITIALIZATIONEXCEPTION();
+ // the BaseURL is part of the ItemSet
+ SfxMedium* pMedium = new SfxMedium( xStorage, String() );
+ TransformParameters( SID_OPENDOC, aMediaDescriptor, aSet );
+ pMedium->GetItemSet()->Put( aSet );
- // after i36090 is fixed the pool from object shell can be used
- // SfxAllItemSet aSet( m_pData->m_pObjectShell->GetPool() );
- SfxAllItemSet aSet( SFX_APP()->GetPool() );
+ // allow to use an interactionhandler (if there is one)
+ pMedium->UseInteractionHandler( TRUE );
- // the BaseURL is part of the ItemSet
- SfxMedium* pMedium = new SfxMedium( xStorage, String() );
- TransformParameters( SID_OPENDOC, aMediaDescriptor, aSet );
- pMedium->GetItemSet()->Put( aSet );
-
- // allow to use an interactionhandler (if there is one)
- pMedium->UseInteractionHandler( TRUE );
-
- SFX_ITEMSET_ARG( &aSet, pTemplateItem, SfxBoolItem, SID_TEMPLATE, sal_False);
- BOOL bTemplate = pTemplateItem && pTemplateItem->GetValue();
- m_pData->m_pObjectShell->SetActivateEvent_Impl( bTemplate ? SFX_EVENT_CREATEDOC : SFX_EVENT_OPENDOC );
- m_pData->m_pObjectShell->Get_Impl()->bOwnsStorage = FALSE;
+ SFX_ITEMSET_ARG( &aSet, pTemplateItem, SfxBoolItem, SID_TEMPLATE, sal_False);
+ BOOL bTemplate = pTemplateItem && pTemplateItem->GetValue();
+ m_pData->m_pObjectShell->SetActivateEvent_Impl( bTemplate ? SFX_EVENT_CREATEDOC : SFX_EVENT_OPENDOC );
+ m_pData->m_pObjectShell->Get_Impl()->bOwnsStorage = FALSE;
- // load document
- if ( !m_pData->m_pObjectShell->DoLoad(pMedium) )
- {
- sal_uInt32 nError = m_pData->m_pObjectShell->GetErrorCode();
- throw task::ErrorCodeIOException( ::rtl::OUString(),
- uno::Reference< uno::XInterface >(),
- nError ? nError : ERRCODE_IO_CANTREAD );
- }
+ // load document
+ if ( !m_pData->m_pObjectShell->DoLoad(pMedium) )
+ {
+ sal_uInt32 nError = m_pData->m_pObjectShell->GetErrorCode();
+ throw task::ErrorCodeIOException( ::rtl::OUString(),
+ uno::Reference< uno::XInterface >(),
+ nError ? nError : ERRCODE_IO_CANTREAD );
}
}
@@ -3533,9 +3449,7 @@ void SAL_CALL SfxBaseModel::storeToStorage( const uno::Reference< XSTORAGE >& xS
EXCEPTION,
uno::RuntimeException )
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
uno::Reference< XSTORAGE > xResult;
if ( !m_pData->m_pObjectShell.Is() )
@@ -3596,9 +3510,7 @@ void SAL_CALL SfxBaseModel::switchToStorage( const uno::Reference< XSTORAGE >& x
EXCEPTION,
uno::RuntimeException )
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
uno::Reference< XSTORAGE > xResult;
if ( !m_pData->m_pObjectShell.Is() )
@@ -3622,9 +3534,7 @@ uno::Reference< XSTORAGE > SAL_CALL SfxBaseModel::getDocumentStorage()
EXCEPTION,
uno::RuntimeException )
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
uno::Reference< XSTORAGE > xResult;
if ( !m_pData->m_pObjectShell.Is() )
@@ -3637,9 +3547,7 @@ void SAL_CALL SfxBaseModel::addStorageChangeListener(
const uno::Reference< document::XStorageChangeListener >& xListener )
throw ( uno::RuntimeException )
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- return;
+ SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING );
m_pData->m_aInterfaceContainer.addInterface(
::getCppuType((const uno::Reference< document::XStorageChangeListener >*)0), xListener );
@@ -3649,9 +3557,7 @@ void SAL_CALL SfxBaseModel::removeStorageChangeListener(
const uno::Reference< document::XStorageChangeListener >& xListener )
throw ( uno::RuntimeException )
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- return;
+ SfxModelGuard aGuard( *this );
m_pData->m_aInterfaceContainer.removeInterface(
::getCppuType((const uno::Reference< document::XStorageChangeListener >*)0), xListener );
@@ -3677,9 +3583,7 @@ bool SfxBaseModel::impl_getPrintHelper()
void SAL_CALL SfxBaseModel::setIdentifier(const ::rtl::OUString& Identifier)
throw (css::uno::RuntimeException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- return;
+ SfxModelGuard aGuard( *this );
m_pData->m_sModuleIdentifier = Identifier;
}
@@ -3688,9 +3592,7 @@ bool SfxBaseModel::impl_getPrintHelper()
::rtl::OUString SAL_CALL SfxBaseModel::getIdentifier()
throw (css::uno::RuntimeException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- return ::rtl::OUString();
+ SfxModelGuard aGuard( *this );
if (m_pData->m_sModuleIdentifier.getLength() > 0)
return m_pData->m_sModuleIdentifier;
if (m_pData->m_pObjectShell)
@@ -3701,10 +3603,7 @@ bool SfxBaseModel::impl_getPrintHelper()
//=============================================================================
css::uno::Reference< css::frame::XTitle > SfxBaseModel::impl_getTitleHelper ()
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
-
- if ( impl_isDisposed() )
- return css::uno::Reference< css::frame::XTitle >();
+ SfxModelGuard aGuard( *this );
if ( ! m_pData->m_xTitleHelper.is ())
{
@@ -3724,10 +3623,7 @@ css::uno::Reference< css::frame::XTitle > SfxBaseModel::impl_getTitleHelper ()
//=============================================================================
css::uno::Reference< css::frame::XUntitledNumbers > SfxBaseModel::impl_getUntitledHelper ()
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
-
- if ( impl_isDisposed() )
- return css::uno::Reference< css::frame::XUntitledNumbers >();
+ SfxModelGuard aGuard( *this );
if ( ! m_pData->m_xNumberedControllers.is ())
{
@@ -3749,10 +3645,7 @@ css::uno::Reference< css::frame::XUntitledNumbers > SfxBaseModel::impl_getUntitl
throw (css::uno::RuntimeException)
{
// SYNCHRONIZED ->
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
-
- if ( impl_isDisposed() )
- return ::rtl::OUString();
+ SfxModelGuard aGuard( *this );
::rtl::OUString aResult = impl_getTitleHelper()->getTitle ();
if ( m_pData->m_pObjectShell )
@@ -3783,10 +3676,7 @@ void SAL_CALL SfxBaseModel::setTitle( const ::rtl::OUString& sTitle )
throw (css::uno::RuntimeException)
{
// SYNCHRONIZED ->
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
-
- if ( impl_isDisposed() )
- return;
+ SfxModelGuard aGuard( *this );
impl_getTitleHelper()->setTitle (sTitle);
}
@@ -3797,10 +3687,7 @@ void SAL_CALL SfxBaseModel::addTitleChangeListener( const css::uno::Reference< c
throw (css::uno::RuntimeException)
{
// SYNCHRONIZED ->
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
-
- if ( impl_isDisposed() )
- return;
+ SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING );
css::uno::Reference< css::frame::XTitleChangeBroadcaster > xBroadcaster(impl_getTitleHelper(), css::uno::UNO_QUERY);
if (xBroadcaster.is ())
@@ -3813,10 +3700,7 @@ void SAL_CALL SfxBaseModel::removeTitleChangeListener( const css::uno::Reference
throw (css::uno::RuntimeException)
{
// SYNCHRONIZED ->
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
-
- if ( impl_isDisposed() )
- return;
+ SfxModelGuard aGuard( *this );
css::uno::Reference< css::frame::XTitleChangeBroadcaster > xBroadcaster(impl_getTitleHelper(), css::uno::UNO_QUERY);
if (xBroadcaster.is ())
@@ -3829,10 +3713,7 @@ void SAL_CALL SfxBaseModel::removeTitleChangeListener( const css::uno::Reference
throw (css::lang::IllegalArgumentException,
css::uno::RuntimeException )
{
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- return css::frame::UntitledNumbersConst::INVALID_NUMBER;
+ SfxModelGuard aGuard( *this );
return impl_getUntitledHelper ()->leaseNumber (xComponent);
}
@@ -3843,11 +3724,7 @@ void SAL_CALL SfxBaseModel::releaseNumber( ::sal_Int32 nNumber )
throw (css::lang::IllegalArgumentException,
css::uno::RuntimeException )
{
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- return;
-
+ SfxModelGuard aGuard( *this );
impl_getUntitledHelper ()->releaseNumber (nNumber);
}
@@ -3857,11 +3734,7 @@ void SAL_CALL SfxBaseModel::releaseNumberForComponent( const css::uno::Reference
throw (css::lang::IllegalArgumentException,
css::uno::RuntimeException )
{
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- return;
-
+ SfxModelGuard aGuard( *this );
impl_getUntitledHelper ()->releaseNumberForComponent (xComponent);
}
@@ -3870,11 +3743,7 @@ void SAL_CALL SfxBaseModel::releaseNumberForComponent( const css::uno::Reference
::rtl::OUString SAL_CALL SfxBaseModel::getUntitledPrefix()
throw (css::uno::RuntimeException)
{
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- return ::rtl::OUString ();
-
+ SfxModelGuard aGuard( *this );
return impl_getUntitledHelper ()->getUntitledPrefix ();
}
@@ -3883,10 +3752,7 @@ void SAL_CALL SfxBaseModel::releaseNumberForComponent( const css::uno::Reference
css::uno::Reference< css::container::XEnumeration > SAL_CALL SfxBaseModel::getControllers()
throw (css::uno::RuntimeException)
{
- // object already disposed?
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- return css::uno::Reference< css::container::XEnumeration >();
+ SfxModelGuard aGuard( *this );
sal_Int32 c = m_pData->m_seqControllers.getLength();
sal_Int32 i = 0;
@@ -3904,29 +3770,217 @@ css::uno::Reference< css::container::XEnumeration > SAL_CALL SfxBaseModel::getCo
css::uno::Sequence< ::rtl::OUString > SAL_CALL SfxBaseModel::getAvailableViewControllerNames()
throw (css::uno::RuntimeException)
{
- return css::uno::Sequence< ::rtl::OUString >();
+ SfxModelGuard aGuard( *this );
+
+ const SfxObjectFactory& rDocumentFactory = GetObjectShell()->GetFactory();
+ const sal_Int32 nViewFactoryCount = rDocumentFactory.GetViewFactoryCount();
+
+ Sequence< ::rtl::OUString > aViewNames( nViewFactoryCount );
+ for ( sal_Int32 nViewNo = 0; nViewNo < nViewFactoryCount; ++nViewNo )
+ aViewNames[nViewNo] = rDocumentFactory.GetViewFactory( nViewNo ).GetViewName();
+ return aViewNames;
}
//=============================================================================
// css::frame::XModel2
-css::uno::Reference< css::frame::XController2 > SAL_CALL SfxBaseModel::createDefaultViewController(const css::uno::Reference< css::frame::XFrame >& /*Frame*/)
+css::uno::Reference< css::frame::XController2 > SAL_CALL SfxBaseModel::createDefaultViewController( const css::uno::Reference< css::frame::XFrame >& i_rFrame )
throw (css::uno::RuntimeException ,
css::lang::IllegalArgumentException,
css::uno::Exception )
{
- return css::uno::Reference< css::frame::XController2 >();
+ SfxModelGuard aGuard( *this );
+
+ const SfxObjectFactory& rDocumentFactory = GetObjectShell()->GetFactory();
+ const ::rtl::OUString sDefaultViewName = rDocumentFactory.GetViewFactory( 0 ).GetViewName();
+
+ aGuard.clear();
+
+ return createViewController( sDefaultViewName, Sequence< PropertyValue >(), i_rFrame );
+}
+
+//=============================================================================
+namespace sfx { namespace intern {
+
+ /** a class which, in its dtor, cleans up variuos objects (well, at the moment only the frame) collected during
+ the creation of a document view, unless the creation was successful.
+ */
+ class SAL_DLLPRIVATE ViewCreationGuard
+ {
+ public:
+ ViewCreationGuard()
+ :m_bSuccess( false )
+ {
+ }
+
+ ~ViewCreationGuard()
+ {
+ if ( !m_bSuccess )
+ impl_closeAll();
+ }
+
+ void takeFrameOwnership( SfxFrame* i_pFrame )
+ {
+ OSL_PRECOND( !m_aWeakFrame, "ViewCreationGuard::takeFrameOwnership: already have a frame!" );
+ OSL_PRECOND( i_pFrame != NULL, "ViewCreationGuard::takeFrameOwnership: invalid frame!" );
+ m_aWeakFrame = i_pFrame;
+ }
+
+ void releaseAll()
+ {
+ m_bSuccess = true;
+ }
+
+ private:
+ void impl_closeAll()
+ {
+ if ( m_aWeakFrame && !m_aWeakFrame->GetCurrentDocument() )
+ {
+ m_aWeakFrame->SetFrameInterface_Impl( NULL );
+ m_aWeakFrame->DoClose();
+ }
+ }
+
+ private:
+ bool m_bSuccess;
+ SfxFrameWeak m_aWeakFrame;
+ };
+} }
+
+//=============================================================================
+SfxViewFrame* SfxBaseModel::FindOrCreateViewFrame_Impl( const Reference< XFrame >& i_rFrame, ::sfx::intern::ViewCreationGuard& i_rGuard ) const
+{
+ SfxViewFrame* pViewFrame = NULL;
+ for ( pViewFrame = SfxViewFrame::GetFirst( GetObjectShell(), FALSE );
+ pViewFrame;
+ pViewFrame= SfxViewFrame::GetNext( *pViewFrame, GetObjectShell(), FALSE )
+ )
+ {
+ if ( pViewFrame->GetFrame().GetFrameInterface() == i_rFrame )
+ break;
+ }
+ if ( !pViewFrame )
+ {
+ #if OSL_DEBUG_LEVEL > 0
+ for ( SfxFrame* pCheckFrame = SfxFrame::GetFirst();
+ pCheckFrame;
+ pCheckFrame = SfxFrame::GetNext( *pCheckFrame )
+ )
+ {
+ if ( pCheckFrame->GetFrameInterface() == i_rFrame )
+ {
+ if ( ( pCheckFrame->GetCurrentViewFrame() != NULL )
+ || ( pCheckFrame->GetCurrentDocument() != NULL )
+ )
+ // Note that it is perfectly letgitimate that during loading into an XFrame which already contains
+ // a document, there exist two SfxFrame instances bound to this XFrame - the old one, which will be
+ // destroyed later, and the new one, which we're going to create
+ continue;
+
+ OSL_ENSURE( false, "SfxBaseModel::FindOrCreateViewFrame_Impl: there already is an SfxFrame for the given XFrame, but no view in it!" );
+ // nowadays, we're the only instance allowed to create an SfxFrame for an XFrame, so this case here should not happen
+ break;
+ }
+ }
+ #endif
+
+ SfxFrame* pTargetFrame = SfxFrame::Create( i_rFrame );
+ ENSURE_OR_THROW( pTargetFrame, "could not create an SfxFrame" );
+ i_rGuard.takeFrameOwnership( pTargetFrame );
+
+ // prepare it
+ pTargetFrame->PrepareForDoc_Impl( *GetObjectShell() );
+
+ // create view frame
+ pViewFrame = new SfxViewFrame( *pTargetFrame, GetObjectShell() );
+ }
+ return pViewFrame;
}
//=============================================================================
// css::frame::XModel2
-css::uno::Reference< css::frame::XController2 > SAL_CALL SfxBaseModel::createViewController(const ::rtl::OUString& /*ViewName*/,
- const css::uno::Sequence< css::beans::PropertyValue >& /*Arguments*/,
- const css::uno::Reference< css::frame::XFrame >& /*Frame */)
+css::uno::Reference< css::frame::XController2 > SAL_CALL SfxBaseModel::createViewController(
+ const ::rtl::OUString& i_rViewName, const Sequence< PropertyValue >& i_rArguments, const Reference< XFrame >& i_rFrame )
throw (css::uno::RuntimeException ,
css::lang::IllegalArgumentException,
css::uno::Exception )
{
- return css::uno::Reference< css::frame::XController2 >();
+ SfxModelGuard aGuard( *this );
+
+ if ( !i_rFrame.is() )
+ throw css::lang::IllegalArgumentException( ::rtl::OUString(), *this, 3 );
+
+ // find the proper SFX view factory
+ SfxViewFactory* pViewFactory = GetObjectShell()->GetFactory().GetViewFactoryByViewName( i_rViewName );
+ if ( !pViewFactory )
+ throw IllegalArgumentException( ::rtl::OUString(), *this, 1 );
+
+ // determine previous shell (used in some special cases)
+ Reference< XController > xPreviousController( i_rFrame->getController() );
+ const Reference< XModel > xMe( this );
+ if ( ( xPreviousController.is() )
+ && ( xMe != xPreviousController->getModel() )
+ )
+ {
+ xPreviousController.clear();
+ }
+ SfxViewShell* pOldViewShell = SfxViewShell::Get( xPreviousController );
+ OSL_ENSURE( !xPreviousController.is() || ( pOldViewShell != NULL ),
+ "SfxBaseModel::createViewController: invalid old controller!" );
+
+ // a guard which will clean up in case of failure
+ ::sfx::intern::ViewCreationGuard aViewCreationGuard;
+
+ // determine the ViewFrame belonging to the given XFrame
+ SfxViewFrame* pViewFrame = FindOrCreateViewFrame_Impl( i_rFrame, aViewCreationGuard );
+ OSL_POSTCOND( pViewFrame, "SfxBaseModel::createViewController: no frame?" );
+
+ // delegate to SFX' view factory
+ pViewFrame->GetBindings().ENTERREGISTRATIONS();
+ SfxViewShell* pViewShell = pViewFactory->CreateInstance( pViewFrame, pOldViewShell );
+ pViewFrame->GetBindings().LEAVEREGISTRATIONS();
+ ENSURE_OR_THROW( pViewShell, "invalid view shell provided by factory" );
+
+ // by setting the ViewShell it is prevented that disposing the Controller will destroy this ViewFrame also
+ pViewFrame->GetDispatcher()->SetDisableFlags( 0 );
+ pViewFrame->SetViewShell_Impl( pViewShell );
+
+ // remember ViewID
+ pViewFrame->SetCurViewId_Impl( pViewFactory->GetOrdinal() );
+
+ // ensure a default controller, if the view shell did not provide an own implementation
+ if ( !pViewShell->GetController().is() )
+ pViewShell->SetController( new SfxBaseController( pViewShell ) );
+
+ // pass the creation arguments to the controller
+ SfxBaseController* pBaseController = pViewShell->GetBaseController_Impl();
+ ENSURE_OR_THROW( pBaseController, "invalid controller implementation!" );
+ pBaseController->SetCreationArguments_Impl( i_rArguments );
+
+ // some initial view settings, coming from our most recent attachResource call
+ ::comphelper::NamedValueCollection aDocumentLoadArgs( getArgs() );
+ if ( aDocumentLoadArgs.getOrDefault( "ViewOnly", false ) )
+ pViewFrame->GetFrame().SetMenuBarOn_Impl( FALSE );
+
+ const sal_Int16 nPluginMode = aDocumentLoadArgs.getOrDefault( "PluginMode", sal_Int16( 0 ) );
+ if ( nPluginMode == 1 )
+ {
+ pViewFrame->ForceOuterResize_Impl( FALSE );
+ pViewFrame->GetBindings().HidePopups( TRUE );
+
+ SfxFrame& rFrame = pViewFrame->GetFrame();
+ // MBA: layoutmanager of inplace frame starts locked and invisible
+ rFrame.GetWorkWindow_Impl()->MakeVisible_Impl( FALSE );
+ rFrame.GetWorkWindow_Impl()->Lock_Impl( TRUE );
+
+ rFrame.GetWindow().SetBorderStyle( WINDOW_BORDER_NOBORDER );
+ pViewFrame->GetWindow().SetBorderStyle( WINDOW_BORDER_NOBORDER );
+ }
+
+ // tell the guard we were successful
+ aViewCreationGuard.releaseAll();
+
+ // outta gere
+ return pBaseController;
}
//=============================================================================
@@ -3936,9 +3990,7 @@ css::uno::Reference< css::frame::XController2 > SAL_CALL SfxBaseModel::createVie
uno::Reference< rdf::XRepository > SAL_CALL
SfxBaseModel::getRDFRepository() throw (uno::RuntimeException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
@@ -3953,9 +4005,7 @@ SfxBaseModel::getRDFRepository() throw (uno::RuntimeException)
::rtl::OUString SAL_CALL
SfxBaseModel::getStringValue() throw (uno::RuntimeException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
@@ -3970,9 +4020,7 @@ SfxBaseModel::getStringValue() throw (uno::RuntimeException)
::rtl::OUString SAL_CALL
SfxBaseModel::getNamespace() throw (uno::RuntimeException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
@@ -3986,9 +4034,7 @@ SfxBaseModel::getNamespace() throw (uno::RuntimeException)
::rtl::OUString SAL_CALL
SfxBaseModel::getLocalName() throw (uno::RuntimeException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
@@ -4005,9 +4051,7 @@ SfxBaseModel::getElementByMetadataReference(
const ::com::sun::star::beans::StringPair & i_rReference)
throw (uno::RuntimeException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
@@ -4022,9 +4066,7 @@ uno::Reference< rdf::XMetadatable > SAL_CALL
SfxBaseModel::getElementByURI(const uno::Reference< rdf::XURI > & i_xURI)
throw (uno::RuntimeException, lang::IllegalArgumentException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
@@ -4040,9 +4082,7 @@ SfxBaseModel::getMetadataGraphsWithType(
const uno::Reference<rdf::XURI> & i_xType)
throw (uno::RuntimeException, lang::IllegalArgumentException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
@@ -4059,9 +4099,7 @@ SfxBaseModel::addMetadataFile(const ::rtl::OUString & i_rFileName,
throw (uno::RuntimeException, lang::IllegalArgumentException,
container::ElementExistException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
@@ -4082,9 +4120,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
datatransfer::UnsupportedFlavorException,
container::ElementExistException, rdf::ParseException, io::IOException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
@@ -4102,9 +4138,7 @@ SfxBaseModel::removeMetadataFile(
throw (uno::RuntimeException, lang::IllegalArgumentException,
container::NoSuchElementException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
@@ -4120,9 +4154,7 @@ SfxBaseModel::addContentOrStylesFile(const ::rtl::OUString & i_rFileName)
throw (uno::RuntimeException, lang::IllegalArgumentException,
container::ElementExistException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
@@ -4138,9 +4170,7 @@ SfxBaseModel::removeContentOrStylesFile(const ::rtl::OUString & i_rFileName)
throw (uno::RuntimeException, lang::IllegalArgumentException,
container::NoSuchElementException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
@@ -4159,9 +4189,7 @@ SfxBaseModel::loadMetadataFromStorage(
throw (uno::RuntimeException, lang::IllegalArgumentException,
lang::WrappedTargetException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(
m_pData->CreateDMAUninitialized());
@@ -4189,9 +4217,7 @@ SfxBaseModel::storeMetadataToStorage(
throw (uno::RuntimeException, lang::IllegalArgumentException,
lang::WrappedTargetException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
@@ -4208,9 +4234,7 @@ SfxBaseModel::loadMetadataFromMedium(
throw (uno::RuntimeException, lang::IllegalArgumentException,
lang::WrappedTargetException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(
m_pData->CreateDMAUninitialized());
@@ -4237,9 +4261,7 @@ SfxBaseModel::storeMetadataToMedium(
throw (uno::RuntimeException, lang::IllegalArgumentException,
lang::WrappedTargetException)
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( impl_isDisposed() )
- throw lang::DisposedException();
+ SfxModelGuard aGuard( *this );
const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
diff --git a/sfx2/source/doc/sfxmodelfactory.cxx b/sfx2/source/doc/sfxmodelfactory.cxx
index cd45e2b042..6f9545e244 100644
--- a/sfx2/source/doc/sfxmodelfactory.cxx
+++ b/sfx2/source/doc/sfxmodelfactory.cxx
@@ -149,7 +149,8 @@ namespace sfx2
static bool isSpecialArgumentName( const ::rtl::OUString& _rValueName )
{
return _rValueName.equalsAscii( "EmbeddedObject" )
- || _rValueName.equalsAscii( "EmbeddedScriptSupport" );
+ || _rValueName.equalsAscii( "EmbeddedScriptSupport" )
+ || _rValueName.equalsAscii( "DocumentRecoverySupport" );
}
bool operator()( const Any& _rArgument ) const
@@ -171,15 +172,17 @@ namespace sfx2
::comphelper::NamedValueCollection aArgs( _rArguments );
const sal_Bool bEmbeddedObject = aArgs.getOrDefault( "EmbeddedObject", sal_False );
const sal_Bool bScriptSupport = aArgs.getOrDefault( "EmbeddedScriptSupport", sal_True );
+ const sal_Bool bDocRecoverySupport = aArgs.getOrDefault( "DocumentRecoverySupport", sal_True );
sal_uInt64 nCreationFlags =
( bEmbeddedObject ? SFXMODEL_EMBEDDED_OBJECT : 0 )
- | ( bScriptSupport ? 0 : SFXMODEL_DISABLE_EMBEDDED_SCRIPTS );
+ | ( bScriptSupport ? 0 : SFXMODEL_DISABLE_EMBEDDED_SCRIPTS )
+ | ( bDocRecoverySupport ? 0 : SFXMODEL_DISABLE_DOCUMENT_RECOVERY );
Reference< XInterface > xInstance( impl_createInstance( nCreationFlags ) );
// to mimic the bahaviour of the default factory's createInstanceWithArguments, we initialize
- // the object with the given arguments, stripped by the two special ones
+ // the object with the given arguments, stripped by the three special ones
Sequence< Any > aStrippedArguments( _rArguments.getLength() );
Any* pStrippedArgs = aStrippedArguments.getArray();
Any* pStrippedArgsEnd = ::std::remove_copy_if(
diff --git a/sfx2/source/inc/appdata.hxx b/sfx2/source/inc/appdata.hxx
index b12b717390..96aafcfbf7 100644
--- a/sfx2/source/inc/appdata.hxx
+++ b/sfx2/source/inc/appdata.hxx
@@ -52,7 +52,6 @@ class SfxFilterMatcher;
class SvUShorts;
class ISfxTemplateCommon;
class SfxFilterMatcher;
-class SfxCancelManager;
class SfxStatusDispatcher;
class SfxDdeTriggerTopic_Impl;
class SfxDocumentTemplates;
@@ -108,7 +107,6 @@ public:
// application members
SfxFilterMatcher* pMatcher;
- SfxCancelManager* pCancelMgr;
ResMgr* pLabelResMgr;
SfxStatusDispatcher* pAppDispatch;
SfxDocumentTemplates* pTemplates;
diff --git a/sfx2/source/inc/objshimp.hxx b/sfx2/source/inc/objshimp.hxx
index 1c60561c49..e0220316f7 100644
--- a/sfx2/source/inc/objshimp.hxx
+++ b/sfx2/source/inc/objshimp.hxx
@@ -32,6 +32,7 @@
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/uno/Sequence.hxx>
#include <rtl/ustring.hxx>
+#include <rtl/ref.hxx>
#include <com/sun/star/logging/XSimpleLogRing.hpp>
#include <tools/datetime.hxx>
@@ -61,7 +62,6 @@ class SfxBasicManagerHolder;
struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess
{
::comphelper::EmbeddedObjectContainer* mpObjectContainer;
- SfxConfigManager* pCfgMgr;
SfxBasicManagerHolder*
pBasicManager;
SfxObjectShell& rDocShell;
@@ -79,10 +79,8 @@ struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess
sal_uInt16 nVisualDocumentNumber;
sal_Int16 nDocumentSignatureState;
sal_Int16 nScriptingSignatureState;
- sal_Bool bTemplateConfig:1,
- bInList:1, // ob per First/Next erreichbar
+ sal_Bool bInList:1, // ob per First/Next erreichbar
bClosing:1, // sal_True w"aehrend Close(), um Benachrichtigungs-Rekursionen zu verhindern
- bSetInPlaceObj:1, // sal_True, falls bereits versucht wurde pInPlaceObject zu casten
bIsSaving:1,
bPasswd:1,
bIsTmp:1,
@@ -93,14 +91,8 @@ struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess
bInPrepareClose : 1,
bPreparedForClose : 1,
bWaitingForPicklist : 1,// Muss noch in die Pickliste
- bModuleSearched : 1,
- bIsHelpObjSh : 1,
- bForbidCaching : 1,
bForbidReload : 1,
- bSupportsEventMacros: 1,
- bLoadingWindows: 1,
bBasicInitialized :1,
- //bHidden :1, // indicates a hidden view shell
bIsPrintJobCancelable :1, // Stampit disable/enable cancel button for print jobs ... default = true = enable!
bOwnsStorage:1,
bNoBaseURL:1,
@@ -110,6 +102,7 @@ struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess
bPreserveVersions:1,
m_bMacroSignBroken:1, // whether the macro signature was explicitly broken
m_bNoBasicCapabilities:1,
+ m_bDocRecoverySupport:1,
bQueryLoadTemplate:1,
bLoadReadonly:1,
bUseUserData:1,
@@ -117,36 +110,25 @@ struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess
m_bSharedXMLFlag:1, // whether the flag should be stored in xml file
m_bAllowShareControlFileClean:1; // whether the flag should be stored in xml file
- String aNewName; // Der Name, unter dem das Doc gespeichert
- // werden soll
IndexBitSet aBitSet;
sal_uInt32 lErr;
sal_uInt16 nEventId; // falls vor Activate noch ein
// Open/Create gesendet werden mu/s
- sal_Bool bDoNotTouchDocInfo;
-
AutoReloadTimer_Impl *pReloadTimer;
MarkData_Impl* pMarkData;
sal_uInt16 nLoadedFlags;
sal_uInt16 nFlagsInProgress;
- String aMark;
- Size aViewSize; // wird leider vom Writer beim
- sal_Bool bInFrame; // HTML-Import gebraucht
sal_Bool bModalMode;
sal_Bool bRunningMacro;
sal_Bool bReloadAvailable;
sal_uInt16 nAutoLoadLocks;
SfxModule* pModule;
- SfxFrame* pFrame;
- SfxToolBoxConfig* pTbxConfig;
SfxObjectShellFlags eFlags;
- svtools::AsynchronLink* pCloser;
- String aBaseURL;
sal_Bool bReadOnlyUI;
SvRefBaseRef xHeaderAttributes;
sal_Bool bHiddenLockedByAPI;
- sal_Bool bInCloseEvent;
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > xModel;
+ ::rtl::Reference< SfxBaseModel >
+ pBaseModel;
sal_uInt16 nStyleFilter;
sal_Bool bDisposing;
@@ -159,9 +141,6 @@ struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess
sal_Bool m_bCreateTempStor;
::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xDocStorage;
- ::com::sun::star::uno::Reference<
- ::com::sun::star::util::XModifyListener > m_xDocInfoListener;
-
sal_Bool m_bIsInit;
::rtl::OUString m_aSharedFileURL;
diff --git a/sfx2/source/inet/inettbc.cxx b/sfx2/source/inet/inettbc.cxx
index 204b9d95a5..e026dc6356 100644
--- a/sfx2/source/inet/inettbc.cxx
+++ b/sfx2/source/inet/inettbc.cxx
@@ -39,7 +39,6 @@
#include <com/sun/star/task/XInteractionHandler.hpp>
#include <svl/eitem.hxx>
#include <svl/stritem.hxx>
-#include <svl/cancel.hxx>
#include <unotools/historyoptions.hxx>
#include <svl/folderrestriction.hxx>
#include <vcl/toolbox.hxx>
@@ -302,102 +301,3 @@ void SfxURLToolBoxControl_Impl::StateChanged
}
}
-//***************************************************************************
-// SfxCancelToolBoxControl_Impl
-//***************************************************************************
-
-SFX_IMPL_TOOLBOX_CONTROL(SfxCancelToolBoxControl_Impl,SfxBoolItem)
-
-//***************************************************************************
-
-SfxCancelToolBoxControl_Impl::SfxCancelToolBoxControl_Impl( USHORT nSlotId, USHORT nId, ToolBox& rBox ) :
- SfxToolBoxControl( nSlotId, nId, rBox )
-{
-}
-
-//***************************************************************************
-
-SfxPopupWindowType SfxCancelToolBoxControl_Impl::GetPopupWindowType() const
-{
- return SFX_POPUPWINDOW_ONTIMEOUT;
-}
-
-//***************************************************************************
-
-SfxPopupWindow* SfxCancelToolBoxControl_Impl::CreatePopupWindow()
-{
- PopupMenu aMenu;
- BOOL bExecute = FALSE, bSeparator = FALSE;
- USHORT nIndex = 1;
- for ( SfxCancelManager *pCancelMgr = SfxViewFrame::Current()->GetTopViewFrame()->GetCancelManager();
- pCancelMgr;
- pCancelMgr = pCancelMgr->GetParent() )
- {
- for ( USHORT n=0; n<pCancelMgr->GetCancellableCount(); ++n )
- {
- if ( !n && bSeparator )
- {
- aMenu.InsertSeparator();
- bSeparator = FALSE;
- }
- String aItemText = pCancelMgr->GetCancellable(n)->GetTitle();
- if ( aItemText.Len() > 50 )
- {
- aItemText.Erase( 48 );
- aItemText += DEFINE_CONST_UNICODE("...");
- }
- aMenu.InsertItem( nIndex++, aItemText );
- bExecute = TRUE;
- bSeparator = TRUE;
- }
- }
-
- ToolBox& rToolBox = GetToolBox();
- USHORT nId = bExecute ? aMenu.Execute( &rToolBox, rToolBox.GetPointerPosPixel() ) : 0;
- GetToolBox().EndSelection();
-// ClearCache();
-// UpdateSlot();
- if ( nId )
- {
- String aSearchText = aMenu.GetItemText(nId);
- for ( SfxCancelManager *pCancelMgr = SfxViewFrame::Current()->GetTopViewFrame()->GetCancelManager();
- pCancelMgr;
- pCancelMgr = pCancelMgr->GetParent() )
- {
- for ( USHORT n = 0; n < pCancelMgr->GetCancellableCount(); ++n )
- {
- SfxCancellable *pCancel = pCancelMgr->GetCancellable(n);
- String aItemText = pCancel->GetTitle();
- if ( aItemText.Len() > 50 )
- {
- aItemText.Erase( 48 );
- aItemText += DEFINE_CONST_UNICODE("...");
- }
-
- if ( aItemText == aSearchText )
- {
- pCancel->Cancel();
- return 0;
- }
- }
- }
-
- }
-
- return 0;
-}
-
-//***************************************************************************
-
-void SfxCancelToolBoxControl_Impl::StateChanged
-(
- USHORT nSID,
- SfxItemState eState,
- const SfxPoolItem* pState
-)
-{
- SfxVoidItem aVoidItem( nSID );
- //SfxToolBoxControl::StateChanged( nSID, eState, pState ? &aVoidItem : 0 );
- SfxToolBoxControl::StateChanged( nSID, eState, pState );
-}
-
diff --git a/sfx2/source/menu/mnuitem.cxx b/sfx2/source/menu/mnuitem.cxx
index db5cd8f40a..31181f5806 100644
--- a/sfx2/source/menu/mnuitem.cxx
+++ b/sfx2/source/menu/mnuitem.cxx
@@ -453,7 +453,7 @@ SfxAppMenuControl_Impl::SfxAppMenuControl_Impl(
Reference<com::sun::star::lang::XMultiServiceFactory> aXMultiServiceFactory(::comphelper::getProcessServiceFactory());
::framework::MenuConfiguration aConf( aXMultiServiceFactory );
- Reference<com::sun::star::frame::XFrame> aXFrame( GetBindings().GetDispatcher_Impl()->GetFrame()->GetFrame()->GetFrameInterface() );
+ Reference<com::sun::star::frame::XFrame> aXFrame( GetBindings().GetDispatcher_Impl()->GetFrame()->GetFrame().GetFrameInterface() );
pMenu = aConf.CreateBookmarkMenu( aXFrame, GetId() == SID_NEWDOCDIRECT ? BOOKMARK_NEWMENU : BOOKMARK_WIZARDMENU );
if( pMenu )
{
diff --git a/sfx2/source/menu/virtmenu.cxx b/sfx2/source/menu/virtmenu.cxx
index 7f0c470ec5..7a06bc08aa 100644
--- a/sfx2/source/menu/virtmenu.cxx
+++ b/sfx2/source/menu/virtmenu.cxx
@@ -345,7 +345,7 @@ void SfxVirtualMenu::CreateFromSVMenu()
DBG_CHKTHIS(SfxVirtualMenu, 0);
// Merge Addon popup menus into the SV Menu
- Reference< com::sun::star::frame::XFrame > xFrame( pBindings->GetDispatcher()->GetFrame()->GetFrame()->GetFrameInterface() );
+ Reference< com::sun::star::frame::XFrame > xFrame( pBindings->GetDispatcher()->GetFrame()->GetFrame().GetFrameInterface() );
if ( pSVMenu->IsMenuBar() )
{
@@ -610,7 +610,7 @@ IMPL_LINK( SfxVirtualMenu, SettingsChanged, void*, EMPTYARG )
SfxViewFrame *pViewFrame = pBindings->GetDispatcher()->GetFrame();
BOOL bIcons = Application::GetSettings().GetStyleSettings().GetUseImagesInMenus();
BOOL bIsHiContrastMode = IsHiContrastMode();
- Reference<com::sun::star::frame::XFrame> xFrame( pViewFrame->GetFrame()->GetFrameInterface() );
+ Reference<com::sun::star::frame::XFrame> xFrame( pViewFrame->GetFrame().GetFrameInterface() );
if ( !bIsAddonPopupMenu )
{
@@ -682,7 +682,7 @@ void SfxVirtualMenu::UpdateImages()
BOOL bIsHiContrastMode = IsHiContrastMode();
USHORT nItemCount = pSVMenu->GetItemCount();
SfxViewFrame * pViewFrame = pBindings->GetDispatcher()->GetFrame();
- Reference<com::sun::star::frame::XFrame> xFrame( pViewFrame->GetFrame()->GetFrameInterface() );
+ Reference<com::sun::star::frame::XFrame> xFrame( pViewFrame->GetFrame().GetFrameInterface() );
for ( USHORT nSVPos=0; nSVPos < nItemCount; ++nSVPos )
{
@@ -731,7 +731,7 @@ void SfxVirtualMenu::UpdateImages( Menu* pMenu )
{
BOOL bIsHiContrastMode = IsHiContrastMode();
USHORT nItemCount = pMenu->GetItemCount();
- Reference<com::sun::star::frame::XFrame> aXFrame( pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame()->GetFrameInterface() );
+ Reference<com::sun::star::frame::XFrame> aXFrame( pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame().GetFrameInterface() );
for ( USHORT nPos=0; nPos < nItemCount; ++nPos )
{
@@ -900,7 +900,7 @@ void SfxVirtualMenu::InsertAddOnsMenuItem( Menu* pMenu )
// Create special popup menu that is filled with the 3rd party components popup menu items
Reference<com::sun::star::lang::XMultiServiceFactory> aXMultiServiceFactory(::comphelper::getProcessServiceFactory());
::framework::MenuConfiguration aConf( aXMultiServiceFactory );
- Reference<com::sun::star::frame::XFrame> xFrame( pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame()->GetFrameInterface() );
+ Reference<com::sun::star::frame::XFrame> xFrame( pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame().GetFrameInterface() );
PopupMenu* pAddonMenu = NULL;
try
diff --git a/sfx2/source/notify/eventsupplier.cxx b/sfx2/source/notify/eventsupplier.cxx
index 6ec6503fcf..3818a49e8f 100644
--- a/sfx2/source/notify/eventsupplier.cxx
+++ b/sfx2/source/notify/eventsupplier.cxx
@@ -266,7 +266,7 @@ static void Execute( ANY& aEventData, const css::document::DocumentEvent& aTrigg
{
xProv = ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatchProvider > (
- pView->GetFrame()->GetFrameInterface(), UNO_QUERY );
+ pView->GetFrame().GetFrameInterface(), UNO_QUERY );
}
else
{
diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx
index 24d85ff7d6..3b34d147e4 100644
--- a/sfx2/source/view/frame.cxx
+++ b/sfx2/source/view/frame.cxx
@@ -77,7 +77,7 @@
#include <sfx2/fcontnr.hxx>
#include "impframe.hxx"
#include <sfx2/appuno.hxx>
-#include <sfx2/topfrm.hxx>
+#include <sfx2/viewfrm.hxx>
#include "workwin.hxx"
#include <sfx2/sfxuno.hxx>
#include <sfx2/msgpool.hxx>
@@ -100,41 +100,29 @@ using namespace ::com::sun::star::container;
TYPEINIT1(SfxFrame, SfxListener);
TYPEINIT1_AUTOFACTORY(SfxFrameItem, SfxPoolItem);
TYPEINIT1(SfxUsrAnyItem, SfxPoolItem);
-
-SfxFrame::SfxFrame(SfxFrame* pParent):
- pParentFrame( pParent ),
- pChildArr(0),
- pUnoImp(0)
-{
- pImp = new SfxFrame_Impl( this );
- if ( pParent )
- pParent->InsertChildFrame_Impl( this );
- if ( !pFramesArr_Impl )
- pFramesArr_Impl = new SfxFrameArr_Impl;
- pFramesArr_Impl->Insert( this, pFramesArr_Impl->Count() );
-}
+TYPEINIT1_AUTOFACTORY(SfxUnoFrameItem, SfxPoolItem);
SvCompatWeakHdl* SfxFrame::GetHdl()
{
return pImp->GetHdl();
}
-SfxCancelManager* SfxFrame::GetCancelManager() const
+//--------------------------------------------------------------------
+void SfxFrame::Construct_Impl()
{
- SfxFrame *pFrame = GetTopFrame();
- SfxCancelManager*& rpMgr = pFrame->pImp->pCancelMgr;
- if ( !rpMgr )
- {
- rpMgr = new SfxCancelManager( SFX_APP()->GetCancelManager() );
- pFrame->pImp->StartListening( *rpMgr );
- }
- return rpMgr;
+ pImp = new SfxFrame_Impl( this );
+ if ( !pFramesArr_Impl )
+ pFramesArr_Impl = new SfxFrameArr_Impl;
+ pFramesArr_Impl->Insert( this, pFramesArr_Impl->Count() );
}
//--------------------------------------------------------------------
SfxFrame::~SfxFrame()
{
+ RemoveTopFrame_Impl( this );
+ DELETEZ( pWindow );
+
pFramesArr_Impl->Remove( pFramesArr_Impl->GetPos( this ) );
if ( pParentFrame )
@@ -214,53 +202,6 @@ sal_Bool SfxFrame::DoClose_Impl()
return bRet;
}
-void SfxFrame::Clear_Impl()
-{
- CancelTransfers();
-
- // Bei FrameSets verhindern, da\s das Closen der Childs zu st"andigen
- // ReCalcs im SplitWindow f"uhrt; SetUpdateMode am FrameWindow wirkt
- // leider nicht auf dem MAC
- Window *pWin = NULL;
- SfxViewShell *pViewSh;
- if ( pImp->pCurrentViewFrame &&
- 0 != ( pViewSh = pImp->pCurrentViewFrame->GetViewShell() ) )
- {
- pWin = pViewSh->GetWindow();
- if ( pWin )
- pWin->Hide();
- }
-
- sal_Bool bRet = sal_True;
- SfxBindings* pBindings = NULL;
- if ( pImp->pCurrentViewFrame )
- {
- pBindings = &pImp->pCurrentViewFrame->GetBindings();
- pImp->bClosing = sal_True;
- bRet = pImp->pCurrentViewFrame->Close();
- pImp->bClosing = sal_False;
- }
-
- if ( bRet )
- {
- // Bei internen Tasks m"ussen Controller und Tools abger"aumt werden
- if ( pImp->pWorkWin )
- {
- pImp->pWorkWin->DeleteControllers_Impl();
- DELETEZ( pImp->pWorkWin );
- }
-
- if ( pImp->bOwnsBindings )
- delete pBindings;
- }
- else
- {
- if ( pWin )
- pWin->Show();
- }
-}
-
-
sal_Bool SfxFrame::DocIsModified_Impl()
{
if ( pImp->pCurrentViewFrame && pImp->pCurrentViewFrame->GetObjectShell() &&
@@ -290,7 +231,7 @@ sal_uInt16 SfxFrame::PrepareClose_Impl( sal_Bool bUI, sal_Bool bForBrowsing )
for ( const SfxViewFrame *pFrame = SfxViewFrame::GetFirst( pCur );
!bOther && pFrame; pFrame = SfxViewFrame::GetNext( *pFrame, pCur ) )
{
- bOther = ( pFrame->GetFrame() != this );
+ bOther = ( &pFrame->GetFrame() != this );
}
SFX_APP()->NotifyEvent( SfxEventHint(SFX_EVENT_PREPARECLOSEVIEW, GlobalEventConfig::GetEventName( STR_EVENT_PREPARECLOSEVIEW ), pCur) );
@@ -333,164 +274,19 @@ SfxFrame* SfxFrame::GetChildFrame( sal_uInt16 nPos ) const
return 0L;
}
-void SfxFrame::InsertChildFrame_Impl( SfxFrame* pFrame, sal_uInt16 nPos )
-{
- if ( !pChildArr )
- pChildArr = new SfxFrameArr_Impl;
- pChildArr->Insert( pFrame, nPos );
- pFrame->pParentFrame = this;
-}
-
-void SfxFrame::RemoveChildFrame_Impl( sal_uInt16 nPos )
-{
- DBG_ASSERT( pChildArr, "Unbekannter Frame!");
- pChildArr->Remove( nPos );
-};
-
void SfxFrame::RemoveChildFrame_Impl( SfxFrame* pFrame )
{
DBG_ASSERT( pChildArr, "Unbekannter Frame!");
sal_uInt16 nPos = pChildArr->GetPos(pFrame);
- RemoveChildFrame_Impl( nPos );
+ pChildArr->Remove( nPos );
};
-sal_Bool SfxFrame::CloseChildFrames()
-{
- sal_Bool bRet = sal_True;
- if ( pChildArr )
- {
- // Childs closen
- sal_uInt16 nCount = pChildArr->Count();
- for ( sal_uInt16 n=nCount; n>0; n--)
- {
- SfxFrame* pFrame = (*pChildArr)[n-1];
- // pFrame removed sich selbst
- bRet = pFrame->DoClose();
- if ( !bRet )
- break;
- }
- }
-
- return bRet;
-}
-
-SfxFrame* SfxFrame::SearchChildrenForName_Impl( const String& rName, sal_Bool bDeep ) const
-{
- if ( pChildArr )
- {
- sal_uInt16 nCount = pChildArr->Count();
- for ( sal_uInt16 n=nCount; n>0; n--)
- {
- SfxFrame* pFrame = (*pChildArr)[n-1];
- if ( rName.CompareIgnoreCaseToAscii( pFrame->GetFrameName() ) == COMPARE_EQUAL )
- return pFrame;
- if( bDeep )
- {
- pFrame = pFrame->SearchChildrenForName_Impl( rName );
- if ( pFrame )
- return pFrame;
- }
- }
- }
-
- return NULL;
-}
-
-SfxFrame* SfxFrame::GetTopFrame() const
+SfxFrame& SfxFrame::GetTopFrame() const
{
- SfxFrame *pParent = (SfxFrame*) this;
+ const SfxFrame* pParent = this;
while ( pParent->pParentFrame )
pParent = pParent->pParentFrame;
- return pParent;
-}
-
-SfxFrame* SfxFrame::SearchFrame( const String& rName, SfxMedium* /*pMedium*/ )
-{
- // Weil Netscape f"uhrende BLANKS "uberliest, m"ussen wir das wohl auch
- // Sollte besser auch bei den FrameNames gemacht werden!
- String aFrameName( rName );
- aFrameName.EraseLeadingChars();
-
- SfxFrame *pFrame = this;
- if( !aFrameName.Len() || aFrameName.CompareIgnoreCaseToAscii("_self") == COMPARE_EQUAL )
- {
- return pFrame;
- }
- else if ( aFrameName.CompareIgnoreCaseToAscii("_smartself") == COMPARE_EQUAL )
- {
- DBG_ERROR("Not supported!");
- return pFrame;
- }
- else if ( aFrameName.CompareIgnoreCaseToAscii( GetFrameName() ) == COMPARE_EQUAL)
- {
- // Eigener Name, kein Name oder Selbstbezug
- return pFrame;
- }
- else if ( aFrameName.CompareIgnoreCaseToAscii("_parent") == COMPARE_EQUAL )
- {
- // Gesucht ist das Parent Frameset
- return pParentFrame ? pParentFrame : this;
- }
- else if ( aFrameName.CompareIgnoreCaseToAscii("_blank") == COMPARE_EQUAL )
- {
- return NULL;
- }
- else if ( aFrameName.CompareIgnoreCaseToAscii("_top") == COMPARE_EQUAL )
- {
- while ( pFrame->GetParentFrame() )
- pFrame = pFrame->GetParentFrame();
- return pFrame;
- }
- else
- {
- // Zuerst unterhalb dieses Frames absuchen
- pFrame = SearchChildrenForName_Impl( aFrameName );
- }
-
- if ( !pFrame && GetParentFrame() )
- {
- // Noch nichts gefunden, nach oben weitergehen
- // Eigentlich m"u\sten Frames, die schon abgesucht wurden, aus
- // Performance-Gr"unden markiert werden
- SfxFrame *pParent = GetParentFrame();
- do
- {
- // Ist es der Parent ?
- if ( aFrameName.CompareIgnoreCaseToAscii( pParent->GetFrameName() ) == COMPARE_EQUAL )
- return pParent;
-
- // Weiter nach oben
- pParent = pParent->GetParentFrame();
- }
- while ( pParent );
- }
-
- if( !pFrame )
- {
- SfxFrameArr_Impl& rArr = *SFX_APP()->Get_Impl()->pTopFrames;
- // keinen Frame im MDI-Fenster gefunden. Jetzt die anderen
- // Toplevel Frames checken.
- SfxFrame *pTop = GetTopFrame();
- for( sal_uInt16 nPos = rArr.Count(); nPos--; )
- {
- // Unser Topframe wurde bereits durchsucht
- SfxFrame* pCurFrame = rArr[ nPos ];
- if( pCurFrame != pTop )
- {
- if( aFrameName.CompareIgnoreCaseToAscii( pCurFrame->GetFrameName() ) ==
- COMPARE_EQUAL )
- return pCurFrame;
- else
- {
- pFrame = pCurFrame->SearchChildrenForName_Impl( aFrameName );
- if( pFrame )
- return pFrame;
- }
- }
- }
- }
-
- return pFrame;
+ return *const_cast< SfxFrame* >( pParent );
}
sal_Bool SfxFrame::IsClosing_Impl() const
@@ -503,21 +299,11 @@ void SfxFrame::SetIsClosing_Impl()
pImp->bClosing = TRUE;
}
-void SfxFrame::DocumentInserted( SfxObjectShell* /*pDoc*/ )
-{
-}
-
sal_uInt16 SfxFrame::GetChildFrameCount() const
{
return pChildArr ? pChildArr->Count() : 0;
}
-sal_Bool SfxFrame::InsertDocument( SfxObjectShell* pDoc )
-{
- DocumentInserted( pDoc );
- return sal_True;
-}
-
void SfxFrame::CancelTransfers( sal_Bool /*bCancelLoadEnv*/ )
{
if( !pImp->bInCancelTransfers )
@@ -528,7 +314,7 @@ void SfxFrame::CancelTransfers( sal_Bool /*bCancelLoadEnv*/ )
{
SfxViewFrame* pFrm;
for( pFrm = SfxViewFrame::GetFirst( pObj );
- pFrm && pFrm->GetFrame() == this;
+ pFrm && &pFrm->GetFrame() == this;
pFrm = SfxViewFrame::GetNext( *pFrm, pObj ) ) ;
// Keine anderer Frame mehr auf Doc -> Cancel
if( !pFrm )
@@ -566,12 +352,7 @@ SfxObjectShell* SfxFrame::GetCurrentDocument() const
{
return pImp->pCurrentViewFrame ?
pImp->pCurrentViewFrame->GetObjectShell() :
- pImp->pCurrentObjectShell;
-}
-
-void SfxFrame::SetCurrentDocument_Impl( SfxObjectShell *pDoc )
-{
- pImp->pCurrentObjectShell = pDoc;
+ NULL;
}
void SfxFrame::SetCurrentViewFrame_Impl( SfxViewFrame *pFrame )
@@ -589,56 +370,10 @@ void SfxFrame::SetFrameType_Impl( sal_uInt32 n )
pImp->nType = n;
}
-void SfxFrame::CopyHistory_Impl( SfxFrame* /*pFrame*/ ) const
-{
-}
-
-
-void SfxFrame::ClearHistory()
-{
-}
-
-sal_Bool SfxFrame::ExecuteHistoryMenu_Impl( sal_uInt16 /*nWhich*/, const Rectangle& /*rRect*/, sal_uInt16 /*nFlags*/ )
-{
- return sal_True;
-}
-
-sal_Bool SfxFrame::Browse( sal_Bool /*bForward*/, sal_uInt16 /*nSteps*/, sal_Bool /*bNewFrame*/ )
-{
- return FALSE;
-}
-
-void SfxFrame::UpdatePickEntries()
-{
-}
-
-void SfxFrame::UpdatePickEntries( const ::com::sun::star::uno::Any& /*rValue*/ )
-{
-}
-
-void SfxFrame::UpdateUndoHistory_Impl( SfxObjectShell* /*pDocSh*/, const String* /*pNew*/, const String* /*pTitle*/ )
-{
-}
-
-void SfxFrame::UpdateCurrentHistory_Impl( SfxObjectShell* /*pDocSh*/, const String* /*pNew*/ )
-{
-}
-
-void SfxFrame::UpdateHistory( SfxObjectShell* /*pDocSh*/, const String* /*pNew*/ )
-{
-}
-
-void SfxFrame::UpdateHistory(
- const ::rtl::OUString& /*aURL*/,
- const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& /*aArgs*/,
- const ::rtl::OUString& /*rTitle*/ )
-{
-}
-
void SfxFrame::GetViewData_Impl()
{
// Alle zwischen Laden und Entfernen "anderbaren Daten aktualisieren; die
- // festen Daten werden nur einmal ( nach InsertDocument in UpdateDescriptor )
+ // festen Daten werden nur einmal ( nach PrepareForDoc_Impl in UpdateDescriptor )
// geholt, um Zeit zu sparen.
SfxViewFrame* pViewFrame = GetCurrentViewFrame();
if( pViewFrame && pViewFrame->GetViewShell() )
@@ -647,10 +382,7 @@ void SfxFrame::GetViewData_Impl()
sal_Bool bReadOnly = pMed->GetOpenMode() == SFX_STREAM_READONLY;
GetDescriptor()->SetReadOnly( bReadOnly );
- String aUserData;
- pViewFrame->GetViewShell()->WriteUserData( aUserData, sal_True );
SfxItemSet *pSet = GetDescriptor()->GetArgs();
- pSet->Put( SfxStringItem( SID_USER_DATA, aUserData ));
sal_Bool bGetViewData = sal_False;
if ( GetController().is() && pSet->GetItemState( SID_VIEW_DATA ) != SFX_ITEM_SET )
{
@@ -678,9 +410,9 @@ void SfxFrame::GetViewData_Impl()
void SfxFrame::UpdateDescriptor( SfxObjectShell *pDoc )
{
- // Beim InsertDocument wird der Descriptor des Frames aktualisiert
+ // Beim PrepareForDoc_Impl wird der Descriptor des Frames aktualisiert
// und sein ItemSet neu initialisiert. Alle Daten, die f"ur ein sp"ateres
- // Restaurieren der ::com::sun::star::sdbcx::View n"otig sind, sind damit festgehalten.
+ // Restaurieren der View n"otig sind, sind damit festgehalten.
// Soll das Dokument ersetzt werden, wird durch GetViewData_Impl (s.o.)
// die neueste Information hinzugef"ugt. Alles zusammen wird dann in der
// Browse-History gesichert. Beim Aktivieren eines solchen FramePickEntry
@@ -732,20 +464,6 @@ void SfxFrame::UpdateDescriptor( SfxObjectShell *pDoc )
//-------------------------------------------------------------------------
-sal_Bool SfxFrame::CanBrowseBackward() const
-{
- return FALSE;
-}
-
-//-------------------------------------------------------------------------
-
-sal_Bool SfxFrame::CanBrowseForward() const
-{
- return FALSE;
-}
-
-//-------------------------------------------------------------------------
-
void SfxFrame::SetDescriptor( SfxFrameDescriptor *pD )
{
DBG_ASSERT( pD, "Kein Descriptor!" );
@@ -793,14 +511,12 @@ void SfxFrame::GetTargetList( TargetList& rList ) const
}
SfxViewFrame* pView = GetCurrentViewFrame();
- if( pView && pView->GetViewShell() && !pView->GetViewShell()->IsImplementedAsFrameset_Impl() && pChildArr )
+ if( pView && pView->GetViewShell() && pChildArr )
{
sal_uInt16 nCount = pChildArr->Count();
for ( sal_uInt16 n=0; n<nCount; n++)
{
SfxFrame* pFrame = (*pChildArr)[n];
- if ( pFrame->GetFrameName().Len() )
- rList.Insert( new String (pFrame->GetFrameName()) );
pFrame->GetTargetList( rList );
}
}
@@ -808,147 +524,11 @@ void SfxFrame::GetTargetList( TargetList& rList ) const
//-------------------------------------------------------------------------
-void SfxFrame::SetFrameId_Impl( sal_uInt16 nId )
-{
- pImp->nFrameId = nId;
- if ( GetCurrentViewFrame() )
- GetCurrentViewFrame()->UpdateTitle();
-}
-
-sal_uInt16 SfxFrame::GetFrameId_Impl() const
-{
- return pImp->nFrameId;
-}
-
-void SfxFrame::SetFrameIdName_Impl( const String& rName )
-{
- pImp->aFrameIdName = rName;
-}
-
-//-------------------------------------------------------------------------
-
-SfxFrame* SfxFrame::SearchFrame_Impl( sal_uInt16 nId, sal_Bool bDeep )
-{
- if ( pImp->nFrameId == nId )
- return this;
-
- if ( pChildArr )
- {
- sal_uInt16 nCount = pChildArr->Count();
- for ( sal_uInt16 n=0; n<nCount; n++)
- {
- SfxFrame* pFrame = (*pChildArr)[n];
- if ( pFrame->pImp->nFrameId == nId )
- return pFrame;
- if ( bDeep )
- {
- pFrame = pFrame->SearchFrame_Impl( nId, sal_True );
- if ( pFrame )
- return pFrame;
- }
- }
- }
-
- return NULL;
-}
-
-SfxFrame* SfxFrame::SearchFrame_Impl( const String& rName, sal_Bool bDeep )
-{
- if ( pImp->aFrameIdName == rName )
- return this;
-
- if ( pChildArr )
- {
- sal_uInt16 nCount = pChildArr->Count();
- for ( sal_uInt16 n=0; n<nCount; n++)
- {
- SfxFrame* pFrame = (*pChildArr)[n];
- if ( pFrame->pImp->aFrameIdName == rName )
- return pFrame;
- if ( bDeep )
- {
- pFrame = pFrame->SearchFrame_Impl( rName );
- if ( pFrame )
- return pFrame;
- }
- }
- }
-
- return NULL;
-}
-
-//-------------------------------------------------------------------------
-
-//-------------------------------------------------------------------------
-
-void SfxFrame::Activate_Impl( sal_Bool bBeamerOn )
-
-/* [Description]
-
- Internal Activate-Handler, called from derived classes which supports
- Activate-Handling.
-*/
-
-{
- if ( GetParentFrame() )
- GetParentFrame()->Activate_Impl( bBeamerOn );
-}
-
SfxBroadcaster& SfxFrame::GetBroadcaster() const
{
return *pImp;
}
-//-------------------------------------------------------------------------
-
-void SfxFrame::Deactivate_Impl()
-
-/* [Description]
-
- Internal Deactivate-Handler, called from derived classes which supports
- Activate-Handling.
-*/
-
-{
- if( GetParentFrame() )
- GetParentFrame()->Deactivate_Impl();
-}
-
-String SfxFrame::GetContent() const
-{
- SfxObjectShell *pObj = GetCurrentDocument();
- if ( !pObj || !pObj->GetMedium() )
- return String();
- else
- return pObj->GetMedium()->GetName();
-}
-
-sal_Bool SfxFrame::CheckContentForLoad_Impl()
-{
- if ( GetCurrentDocument() )
- {
- SfxMedium* pMedium = GetCurrentDocument()->GetMedium();
-#ifdef DEBUG
- SfxItemSet* pSet;
- pSet = pMedium->GetItemSet();
-#endif
- SfxItemSet* pNew = GetDescriptor()->GetArgs();
-
- // Falls URLs nicht uebereinstimmen
- if ( INetURLObject( GetDescriptor()->GetActualURL() ) != INetURLObject( pMedium->GetOrigURL() ) )
- return sal_True;
-
- // Falls die Filter nicht uebereinstimmen
- SFX_ITEMSET_ARG( pNew, pFilterItem, SfxStringItem, SID_FILTER_NAME, sal_False );
- if( pMedium->GetOrigFilter() && pFilterItem && pFilterItem->GetValue() != pMedium->GetOrigFilter()->GetFilterName() )
- return sal_True;
-
- return sal_False;
- }
-
- return (GetDescriptor()->GetActualURL().GetMainURL( INetURLObject::NO_DECODE ).getLength() != 0);
-}
-
sal_Bool SfxFrame::IsParent( SfxFrame *pFrame ) const
{
SfxFrame *pParent = pParentFrame;
@@ -975,7 +555,7 @@ void SfxFrame::RemoveTopFrame_Impl( SfxFrame* pFrame )
}
SfxFrameItem::SfxFrameItem( sal_uInt16 nWhichId, SfxViewFrame *p )
- : SfxPoolItem( nWhichId ), pFrame( p ? p->GetFrame() : NULL )
+ : SfxPoolItem( nWhichId ), pFrame( p ? &p->GetFrame() : NULL )
{
wFrame = pFrame;
}
@@ -1058,11 +638,6 @@ int SfxUsrAnyItem::operator==( const SfxPoolItem& /*rItem*/ ) const
return sal_False;
}
-String SfxUsrAnyItem::GetValueText() const
-{
- return String();
-}
-
SfxPoolItem* SfxUsrAnyItem::Clone( SfxItemPool *) const
{
return new SfxUsrAnyItem( Which(), aValue );
@@ -1080,9 +655,37 @@ sal_Bool SfxUsrAnyItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE /*n
return sal_True;
}
-sal_Bool SfxFrame::BrowseInFrame( int /*nDelta*/ )
+SfxUnoFrameItem::SfxUnoFrameItem()
+ : SfxPoolItem()
+ , m_xFrame()
+{
+}
+
+SfxUnoFrameItem::SfxUnoFrameItem( sal_uInt16 nWhichId, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rFrame )
+ : SfxPoolItem( nWhichId )
+ , m_xFrame( i_rFrame )
{
- return sal_False;
+}
+
+int SfxUnoFrameItem::operator==( const SfxPoolItem& i_rItem ) const
+{
+ return i_rItem.ISA( SfxUnoFrameItem ) && static_cast< const SfxUnoFrameItem& >( i_rItem ).m_xFrame == m_xFrame;
+}
+
+SfxPoolItem* SfxUnoFrameItem::Clone( SfxItemPool* ) const
+{
+ return new SfxUnoFrameItem( Which(), m_xFrame );
+}
+
+sal_Bool SfxUnoFrameItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE /*nMemberId*/ ) const
+{
+ rVal <<= m_xFrame;
+ return sal_True;
+}
+
+sal_Bool SfxUnoFrameItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE /*nMemberId*/ )
+{
+ return ( rVal >>= m_xFrame );
}
SfxFrameIterator::SfxFrameIterator( const SfxFrame& rFrame, sal_Bool bRecur )
@@ -1129,116 +732,6 @@ SfxFrame* SfxFrameIterator::NextSibling_Impl( SfxFrame& rPrev )
return pRet;
}
-void SfxFrame::SetFrameName( const String& rName )
-{
- if ( pImp->pDescr )
- pImp->pDescr->SetName( rName );
- aName = rName;
- if ( pImp->pCurrentViewFrame )
- pImp->pCurrentViewFrame->UpdateTitle();
- if ( GetFrameInterface().is() )
- GetFrameInterface()->setName( rName );
-}
-
-void SfxFrame::LoadFinished_Impl()
-{
-}
-
-SfxFrame* SfxFrame::findFrame(const ::rtl::OUString& aTargetframename, sal_Int32 nSearchFlags)
-{
- // Weil Netscape f"uhrende BLANKS "uberliest, m"ussen wir das wohl auch
- // Sollte besser auch bei den FrameNames gemacht werden!
- String aTargetName( aTargetframename );
- aTargetName.EraseLeadingChars();
-
- SfxFrame *pFrame = this;
-
- if ( !aTargetName.Len() && GetParentFrame() && GetParentFrame()->GetCurrentViewFrame()->GetViewShell()->IsImplementedAsFrameset_Impl() )
- return GetParentFrame();
-
- if( !aTargetName.Len() || aTargetName.CompareIgnoreCaseToAscii("_self") == COMPARE_EQUAL )
- return pFrame;
-
- if ( aTargetName.CompareIgnoreCaseToAscii("_smartself") == COMPARE_EQUAL )
- {
- DBG_ERROR("Not supported!");
- return pFrame;
- }
-
- if ( aTargetName.CompareIgnoreCaseToAscii("_parent") == COMPARE_EQUAL )
- {
- // Gesucht ist das Parent Frameset
- return pFrame->GetParentFrame();
- }
- else if ( aTargetName.CompareIgnoreCaseToAscii("_blank") == COMPARE_EQUAL )
- {
- return NULL;
-
- }
- else if ( aTargetName.CompareIgnoreCaseToAscii("_top") == COMPARE_EQUAL )
- {
- while ( pFrame->GetParentFrame() )
- pFrame = pFrame->GetParentFrame();
- return pFrame;
- }
-
- if ( ( nSearchFlags & FRAME_SEARCH_SELF ) && aTargetName.CompareIgnoreCaseToAscii( GetFrameName() ) == COMPARE_EQUAL )
- {
- // Eigener Name
- return pFrame;
- }
-
- if ( nSearchFlags & FRAME_SEARCH_CHILDREN )
- {
- // Zuerst unterhalb dieses Frames absuchen
- pFrame = SearchChildrenForName_Impl( aTargetName );
- }
-
- if ( ( nSearchFlags & FRAME_SEARCH_CHILDREN ) && !pFrame && GetParentFrame() )
- {
- // Noch nichts gefunden, nach oben weitergehen
- // Eigentlich m"u\sten Frames, die schon abgesucht wurden, aus
- // Performance-Gr"unden markiert werden
- SfxFrame *pParent = GetParentFrame();
- do
- {
- // Ist es der Parent ?
- if ( aTargetName.CompareIgnoreCaseToAscii( pParent->GetFrameName() ) == COMPARE_EQUAL )
- return pParent;
-
- // Weiter nach oben
- pParent = pParent->GetParentFrame();
- }
- while ( pParent );
- }
-
- if( !pFrame )
- {
- SfxFrameArr_Impl& rArr = *SFX_APP()->Get_Impl()->pTopFrames;
- // keinen Frame im MDI-Fenster gefunden. Jetzt die anderen
- // Toplevel Frames checken.
- SfxFrame *pTop = GetTopFrame();
- for( sal_uInt16 nPos = rArr.Count(); nPos--; )
- {
- // Unser Topframe wurde bereits durchsucht
- SfxFrame* pCurFrame = rArr[ nPos ];
- if( pCurFrame != pTop )
- {
- if( aTargetName.CompareIgnoreCaseToAscii( pCurFrame->GetFrameName() ) == COMPARE_EQUAL )
- return pCurFrame;
- else
- {
- pFrame = pCurFrame->SearchChildrenForName_Impl( aTargetName );
- if( pFrame )
- return pFrame;
- }
- }
- }
- }
-
- return pFrame;
-}
-
sal_Bool SfxFrame::IsTop() const
{
return GetFrameInterface().is() ? GetFrameInterface()->isTop() : sal_False;
@@ -1262,7 +755,7 @@ sal_Bool SfxFrame::HasComponent() const
return pImp->xFrame;
}
-void SfxFrame::SetFrameInterface_Impl( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame )
+void SfxFrame::SetFrameInterface_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame )
{
pImp->xFrame = rFrame;
com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorder > xRecorder;
@@ -1270,16 +763,6 @@ void SfxFrame::SetFrameInterface_Impl( ::com::sun::star::uno::Reference< ::com::
GetCurrentViewFrame()->GetBindings().SetRecorder_Impl( xRecorder );
}
-void SfxFrame::SetItemSet_Impl( const SfxItemSet* pSet )
-{
- pImp->pSet = pSet;
-}
-
-const SfxItemSet* SfxFrame::GetItemSet_Impl()
-{
- return pImp->pSet;
-}
-
void SfxFrame::Appear()
{
if ( GetCurrentViewFrame() )
@@ -1407,11 +890,6 @@ void SfxFrame::CreateWorkWindow_Impl()
pImp->pWorkWin = new SfxFrameWorkWin_Impl( &pFrame->GetWindow(), this, pFrame );
}
-const SvBorder& SfxFrame::GetBorder_Impl() const
-{
- return pImp->aBorder;
-}
-
void SfxFrame::GrabFocusOnComponent_Impl()
{
if ( pImp->bReleasingComponent )
@@ -1420,18 +898,12 @@ void SfxFrame::GrabFocusOnComponent_Impl()
return;
}
- Window* pWindow = &GetWindow();
+ Window* pFocusWindow = &GetWindow();
if ( GetCurrentViewFrame() && GetCurrentViewFrame()->GetViewShell() && GetCurrentViewFrame()->GetViewShell()->GetWindow() )
- pWindow = GetCurrentViewFrame()->GetViewShell()->GetWindow();
-
- if( !pWindow->HasChildPathFocus() )
- pWindow->GrabFocus();
-}
+ pFocusWindow = GetCurrentViewFrame()->GetViewShell()->GetWindow();
-const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterceptor > SfxFrame::GetInterceptor_Impl()
-{
-//(mba)/compview: hier fehlt der Zugriff auf den Interceptor !!!!!
- return ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterceptor > ();
+ if( !pFocusWindow->HasChildPathFocus() )
+ pFocusWindow->GrabFocus();
}
void SfxFrame::ReleasingComponent_Impl( sal_Bool bSet )
@@ -1439,36 +911,6 @@ void SfxFrame::ReleasingComponent_Impl( sal_Bool bSet )
pImp->bReleasingComponent = bSet;
}
-sal_Bool SfxFrame::LoadSfxComponent(
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > & /*aFrame*/,
- const ::rtl::OUString& /*aURL*/,
- const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& /*aArgs*/,
- const SfxObjectFactory* /*pFact*/ )
-{
- // get Implementation of xComponents ...
- DBG_ERROR( "Should not be called anymore!" );
- return sal_False;
-}
-
-void SfxFrame::LockFocus_Impl( sal_Bool bLock )
-{
- if ( pChildArr && pChildArr->Count() )
- {
- sal_uInt16 nCount = pChildArr->Count();
- for ( sal_uInt16 n=0; n<nCount; n++ )
- {
- SfxFrame* pFrame = (*pChildArr)[n];
- pFrame->pImp->bFocusLocked = bLock;
- pFrame->LockFocus_Impl( bLock );
- }
- }
-}
-
-sal_Bool SfxFrame::IsFocusLocked_Impl() const
-{
- return pImp->bFocusLocked;
-}
-
sal_Bool SfxFrame::IsInPlace() const
{
return pImp->bInPlace;
@@ -1503,7 +945,7 @@ void SfxFrame::Resize()
if ( nHandle )
{
SfxObjectShell* pDoc = reinterpret_cast< SfxObjectShell* >( sal::static_int_cast< sal_IntPtr >( nHandle ));
- pWork = SfxViewFrame::GetFirst( pDoc )->GetFrame()->GetWorkWindow_Impl();
+ pWork = SfxViewFrame::GetFirst( pDoc )->GetFrame().GetWorkWindow_Impl();
}
}
@@ -1543,10 +985,10 @@ SfxFrame* SfxFrame::GetNext( SfxFrame& rFrame )
return NULL;
}
-const SfxPoolItem* SfxFrame::LoadDocumentSynchron( SfxItemSet& aSet )
+const SfxPoolItem* SfxFrame::OpenDocumentSynchron( SfxItemSet& i_rSet, const Reference< XFrame >& i_rTargetFrame )
{
- aSet.Put( SfxFrameItem( SID_DOCFRAME, this ) );
- aSet.ClearItem( SID_TARGETNAME );
- return SFX_APP()->GetDispatcher_Impl()->Execute( SID_OPENDOC, SFX_CALLMODE_SYNCHRON, aSet );
+ i_rSet.Put( SfxUnoFrameItem( SID_FILLFRAME, i_rTargetFrame ) );
+ i_rSet.ClearItem( SID_TARGETNAME );
+ return SFX_APP()->GetDispatcher_Impl()->Execute( SID_OPENDOC, SFX_CALLMODE_SYNCHRON, i_rSet );
}
diff --git a/sfx2/source/view/frame2.cxx b/sfx2/source/view/frame2.cxx
new file mode 100644
index 0000000000..c9876ce1f0
--- /dev/null
+++ b/sfx2/source/view/frame2.cxx
@@ -0,0 +1,484 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General 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_sfx2.hxx"
+
+#include "impframe.hxx"
+#include "objshimp.hxx"
+#include "sfxhelp.hxx"
+#include "workwin.hxx"
+
+#include "sfx2/app.hxx"
+#include "sfx2/bindings.hxx"
+#include "sfx2/dispatch.hxx"
+#include "sfx2/docfac.hxx"
+#include "sfx2/docfile.hxx"
+#include "sfx2/event.hxx"
+#include "sfx2/objface.hxx"
+#include "sfx2/request.hxx"
+
+#include <com/sun/star/awt/XWindow2.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/frame/XComponentLoader.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/frame/XFramesSupplier.hpp>
+#include <com/sun/star/frame/XLayoutManager.hpp>
+
+#include <comphelper/componentcontext.hxx>
+#include <comphelper/namedvaluecollection.hxx>
+#include <comphelper/processfactory.hxx>
+#include <svl/eitem.hxx>
+#include <svl/intitem.hxx>
+#include <svl/itemset.hxx>
+#include <svl/rectitem.hxx>
+#include <svl/stritem.hxx>
+#include <toolkit/helper/vclunohelper.hxx>
+#include <tools/diagnose_ex.h>
+
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::frame;
+using namespace ::com::sun::star::util;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::beans;
+using ::com::sun::star::lang::XMultiServiceFactory;
+using ::com::sun::star::lang::XComponent;
+using ::com::sun::star::frame::XComponentLoader;
+
+//------------------------------------------------------------------------
+
+class SfxFrameWindow_Impl : public Window
+{
+public:
+ SfxFrame* pFrame;
+
+ SfxFrameWindow_Impl( SfxFrame* pF, Window& i_rContainerWindow );
+ ~SfxFrameWindow_Impl( );
+
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ virtual long Notify( NotifyEvent& rEvt );
+ virtual void Resize();
+ virtual void GetFocus();
+ void DoResize();
+ DECL_LINK( CloserHdl, void* );
+};
+
+SfxFrameWindow_Impl::SfxFrameWindow_Impl( SfxFrame* pF, Window& i_rContainerWindow )
+ : Window( &i_rContainerWindow, WB_BORDER | WB_CLIPCHILDREN | WB_NODIALOGCONTROL | WB_3DLOOK )
+ , pFrame( pF )
+{
+}
+
+SfxFrameWindow_Impl::~SfxFrameWindow_Impl( )
+{
+}
+
+void SfxFrameWindow_Impl::DataChanged( const DataChangedEvent& rDCEvt )
+{
+ Window::DataChanged( rDCEvt );
+ SfxWorkWindow *pWorkWin = pFrame->GetWorkWindow_Impl();
+ if ( pWorkWin )
+ pWorkWin->DataChanged_Impl( rDCEvt );
+}
+
+long SfxFrameWindow_Impl::Notify( NotifyEvent& rNEvt )
+{
+ if ( pFrame->IsClosing_Impl() || !pFrame->GetFrameInterface().is() )
+ return sal_False;
+
+ SfxViewFrame* pView = pFrame->GetCurrentViewFrame();
+ if ( !pView || !pView->GetObjectShell() )
+ return Window::Notify( rNEvt );
+
+ if ( rNEvt.GetType() == EVENT_GETFOCUS )
+ {
+ if ( pView->GetViewShell() && !pView->GetViewShell()->GetUIActiveIPClient_Impl() && !pFrame->IsInPlace() )
+ {
+ DBG_TRACE("SfxFrame: GotFocus");
+ pView->MakeActive_Impl( FALSE );
+ }
+
+ // TODO/LATER: do we still need this code?
+ Window* pWindow = rNEvt.GetWindow();
+ ULONG nHelpId = 0;
+ while ( !nHelpId && pWindow )
+ {
+ nHelpId = pWindow->GetHelpId();
+ pWindow = pWindow->GetParent();
+ }
+
+ if ( nHelpId )
+ SfxHelp::OpenHelpAgent( pFrame, nHelpId );
+
+ // if focus was on an external window, the clipboard content might have been changed
+ pView->GetBindings().Invalidate( SID_PASTE );
+ pView->GetBindings().Invalidate( SID_PASTE_SPECIAL );
+ return sal_True;
+ }
+ else if( rNEvt.GetType() == EVENT_KEYINPUT )
+ {
+ if ( pView->GetViewShell()->KeyInput( *rNEvt.GetKeyEvent() ) )
+ return TRUE;
+ }
+ else if ( rNEvt.GetType() == EVENT_EXECUTEDIALOG /*|| rNEvt.GetType() == EVENT_INPUTDISABLE*/ )
+ {
+ pView->SetModalMode( sal_True );
+ return sal_True;
+ }
+ else if ( rNEvt.GetType() == EVENT_ENDEXECUTEDIALOG /*|| rNEvt.GetType() == EVENT_INPUTENABLE*/ )
+ {
+ //EnableInput( sal_True, sal_True );
+ pView->SetModalMode( sal_False );
+ return sal_True;
+ }
+
+ return Window::Notify( rNEvt );
+}
+
+long SfxFrameWindow_Impl::PreNotify( NotifyEvent& rNEvt )
+{
+ USHORT nType = rNEvt.GetType();
+ if ( nType == EVENT_KEYINPUT || nType == EVENT_KEYUP )
+ {
+ SfxViewFrame* pView = pFrame->GetCurrentViewFrame();
+ SfxViewShell* pShell = pView ? pView->GetViewShell() : NULL;
+ if ( pShell && pShell->HasKeyListeners_Impl() && pShell->HandleNotifyEvent_Impl( rNEvt ) )
+ return sal_True;
+ }
+ else if ( nType == EVENT_MOUSEBUTTONUP || nType == EVENT_MOUSEBUTTONDOWN )
+ {
+ Window* pWindow = rNEvt.GetWindow();
+ SfxViewFrame* pView = pFrame->GetCurrentViewFrame();
+ SfxViewShell* pShell = pView ? pView->GetViewShell() : NULL;
+ if ( pShell )
+ if ( pWindow == pShell->GetWindow() || pShell->GetWindow()->IsChild( pWindow ) )
+ if ( pShell->HasMouseClickListeners_Impl() && pShell->HandleNotifyEvent_Impl( rNEvt ) )
+ return sal_True;
+ }
+
+ if ( nType == EVENT_MOUSEBUTTONDOWN )
+ {
+ Window* pWindow = rNEvt.GetWindow();
+ const MouseEvent* pMEvent = rNEvt.GetMouseEvent();
+ Point aPos = pWindow->OutputToScreenPixel( pMEvent->GetPosPixel() );
+ SfxWorkWindow *pWorkWin = pFrame->GetWorkWindow_Impl();
+ if ( pWorkWin )
+ pWorkWin->EndAutoShow_Impl( aPos );
+ }
+
+ return Window::PreNotify( rNEvt );
+}
+
+void SfxFrameWindow_Impl::GetFocus()
+{
+ if ( pFrame && !pFrame->IsClosing_Impl() && pFrame->GetCurrentViewFrame() && pFrame->GetFrameInterface().is() )
+ pFrame->GetCurrentViewFrame()->MakeActive_Impl( TRUE );
+}
+
+void SfxFrameWindow_Impl::Resize()
+{
+ if ( IsReallyVisible() || IsReallyShown() || GetOutputSizePixel().Width() )
+ DoResize();
+}
+
+void SfxFrameWindow_Impl::StateChanged( StateChangedType nStateChange )
+{
+ if ( nStateChange == STATE_CHANGE_INITSHOW )
+ {
+ pFrame->pImp->bHidden = FALSE;
+ if ( pFrame->IsInPlace() )
+ // TODO/MBA: workaround for bug in LayoutManager: the final resize does not get through because the
+ // LayoutManager works asynchronously and between resize and time execution the DockingAcceptor was exchanged so that
+ // the resize event never is sent to the component
+ SetSizePixel( GetParent()->GetOutputSizePixel() );
+
+ DoResize();
+ SfxViewFrame* pView = pFrame->GetCurrentViewFrame();
+ if ( pView )
+ pView->GetBindings().GetWorkWindow_Impl()->ShowChilds_Impl();
+ }
+
+ Window::StateChanged( nStateChange );
+}
+
+void SfxFrameWindow_Impl::DoResize()
+{
+ if ( !pFrame->pImp->bLockResize )
+ pFrame->Resize();
+}
+
+Reference < XFrame > SfxFrame::CreateBlankFrame()
+{
+ Reference < XFrame > xFrame;
+ try
+ {
+ ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
+ Reference < XFrame > xDesktop( aContext.createComponent( "com.sun.star.frame.Desktop" ), UNO_QUERY_THROW );
+ xFrame.set( xDesktop->findFrame( DEFINE_CONST_UNICODE("_blank"), 0 ), UNO_SET_THROW );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return xFrame;
+}
+
+SfxFrame* SfxFrame::Create( SfxObjectShell& rDoc, Window& rWindow, USHORT nViewId, bool bHidden )
+{
+ SfxFrame* pFrame = NULL;
+ try
+ {
+ // create and initialize new top level frame for this window
+ ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
+ Reference < XFramesSupplier > xDesktop( aContext.createComponent( "com.sun.star.frame.Desktop" ), UNO_QUERY_THROW );
+ Reference < XFrame > xFrame( aContext.createComponent( "com.sun.star.frame.Frame"), UNO_QUERY_THROW );
+
+ Reference< awt::XWindow2 > xWin( VCLUnoHelper::GetInterface ( &rWindow ), uno::UNO_QUERY_THROW );
+ xFrame->initialize( xWin.get() );
+ xDesktop->getFrames()->append( xFrame );
+
+ if ( xWin->isActive() )
+ xFrame->activate();
+
+ // create load arguments
+ Sequence< PropertyValue > aLoadArgs;
+ TransformItems( SID_OPENDOC, *rDoc.GetMedium()->GetItemSet(), aLoadArgs );
+
+ ::comphelper::NamedValueCollection aArgs( aLoadArgs );
+ aArgs.put( "Model", rDoc.GetModel() );
+ aArgs.put( "Hidden", bHidden );
+ if ( nViewId )
+ aArgs.put( "ViewId", nViewId );
+
+ aLoadArgs = aArgs.getPropertyValues();
+
+ // load the doc into that frame
+ ::rtl::OUString sLoaderURL( rDoc.GetModel()->getURL() );
+ if ( sLoaderURL.getLength() == 0 )
+ sLoaderURL = rDoc.GetFactory().GetFactoryURL();
+
+ Reference< XComponentLoader > xLoader( xFrame, UNO_QUERY_THROW );
+ xLoader->loadComponentFromURL(
+ sLoaderURL,
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_self" ) ),
+ 0,
+ aLoadArgs
+ );
+
+ for ( pFrame = SfxFrame::GetFirst();
+ pFrame;
+ pFrame = SfxFrame::GetNext( *pFrame )
+ )
+ {
+ if ( pFrame->GetFrameInterface() == xFrame )
+ break;
+ }
+
+ OSL_ENSURE( pFrame, "SfxFrame::Create: load succeeded, but no SfxFrame was created during this!" );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+
+ return pFrame;
+}
+
+SfxFrame* SfxFrame::Create( const Reference < XFrame >& i_rFrame )
+{
+ // create a new TopFrame to an external XFrame object ( wrap controller )
+ ENSURE_OR_THROW( i_rFrame.is(), "NULL frame not allowed" );
+ Window* pWindow = VCLUnoHelper::GetWindow( i_rFrame->getContainerWindow() );
+ ENSURE_OR_THROW( pWindow, "frame without container window not allowed" );
+
+ SfxFrame* pFrame = new SfxFrame( *pWindow, false );
+ pFrame->SetFrameInterface_Impl( i_rFrame );
+ return pFrame;
+}
+
+SfxFrame::SfxFrame( Window& i_rContainerWindow, bool i_bHidden )
+ :pParentFrame( NULL )
+ ,pChildArr( NULL )
+ ,pImp( NULL )
+ ,pWindow( NULL )
+{
+ Construct_Impl();
+
+ pImp->bHidden = i_bHidden;
+ InsertTopFrame_Impl( this );
+ pImp->pExternalContainerWindow = &i_rContainerWindow;
+
+ pWindow = new SfxFrameWindow_Impl( this, i_rContainerWindow );
+
+ // always show pWindow, which is the ComponentWindow of the XFrame we live in
+ // nowadays, since SfxFrames can be created with an XFrame only, hiding or showing the complete XFrame
+ // is not done at level of the container window, not at SFX level. Thus, the component window can
+ // always be visible.
+ pWindow->Show();
+}
+
+void SfxFrame::SetPresentationMode( BOOL bSet )
+{
+ if ( GetCurrentViewFrame() )
+ GetCurrentViewFrame()->GetWindow().SetBorderStyle( bSet ? WINDOW_BORDER_NOBORDER : WINDOW_BORDER_NORMAL );
+
+ Reference< com::sun::star::beans::XPropertySet > xPropSet( GetFrameInterface(), UNO_QUERY );
+ Reference< ::com::sun::star::frame::XLayoutManager > xLayoutManager;
+
+ if ( xPropSet.is() )
+ {
+ Any aValue = xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" )));
+ aValue >>= xLayoutManager;
+ }
+
+ if ( xLayoutManager.is() )
+ xLayoutManager->setVisible( !bSet ); // we don't want to have ui in presentation mode
+
+ SetMenuBarOn_Impl( !bSet );
+ if ( GetWorkWindow_Impl() )
+ GetWorkWindow_Impl()->SetDockingAllowed( !bSet );
+ if ( GetCurrentViewFrame() )
+ GetCurrentViewFrame()->GetDispatcher()->Update_Impl( TRUE );
+}
+
+SystemWindow* SfxFrame::GetSystemWindow() const
+{
+ return GetTopWindow_Impl();
+}
+
+SystemWindow* SfxFrame::GetTopWindow_Impl() const
+{
+ if ( pImp->pExternalContainerWindow->IsSystemWindow() )
+ return (SystemWindow*) pImp->pExternalContainerWindow;
+ else
+ return NULL;
+}
+
+Window& SfxFrame::GetWindow() const
+{
+ return *pWindow;
+}
+
+sal_Bool SfxFrame::Close()
+{
+ delete this;
+ return sal_True;
+}
+
+void SfxFrame::LockResize_Impl( BOOL bLock )
+{
+ pImp->bLockResize = bLock;
+}
+
+IMPL_LINK( SfxFrameWindow_Impl, CloserHdl, void*, EMPTYARG )
+{
+ if ( pFrame && !pFrame->PrepareClose_Impl( TRUE ) )
+ return 0L;
+
+ if ( pFrame )
+ pFrame->GetCurrentViewFrame()->GetBindings().Execute( SID_CLOSEWIN, 0, 0, SFX_CALLMODE_ASYNCHRON );
+ return 0L;
+}
+
+void SfxFrame::SetMenuBarOn_Impl( BOOL bOn )
+{
+ pImp->bMenuBarOn = bOn;
+
+ Reference< com::sun::star::beans::XPropertySet > xPropSet( GetFrameInterface(), UNO_QUERY );
+ Reference< ::com::sun::star::frame::XLayoutManager > xLayoutManager;
+
+ if ( xPropSet.is() )
+ {
+ Any aValue = xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" )));
+ aValue >>= xLayoutManager;
+ }
+
+ if ( xLayoutManager.is() )
+ {
+ rtl::OUString aMenuBarURL( RTL_CONSTASCII_USTRINGPARAM( "private:resource/menubar/menubar" ));
+
+ if ( bOn )
+ xLayoutManager->showElement( aMenuBarURL );
+ else
+ xLayoutManager->hideElement( aMenuBarURL );
+ }
+}
+
+BOOL SfxFrame::IsMenuBarOn_Impl() const
+{
+ return pImp->bMenuBarOn;
+}
+
+void SfxFrame::PositionWindow_Impl( const Rectangle& rWinArea ) const
+{
+ Window *pWin = pImp->pExternalContainerWindow;
+
+ // Groesse setzen
+ const Size aAppWindow( pImp->pExternalContainerWindow->GetDesktopRectPixel().GetSize() );
+ Point aPos( rWinArea.TopLeft() );
+ Size aSz( rWinArea.GetSize() );
+ if ( aSz.Width() && aSz.Height() )
+ {
+ aPos.X() = Min(aPos.X(),
+ long(aAppWindow.Width() - aSz.Width() + aSz.Width() / 2) );
+ aPos.Y() = Min(aPos.Y(),
+ long( aAppWindow.Height() - aSz.Height() + aSz.Height() / 2) );
+ if ( aPos.X() + aSz.Width() <
+ aAppWindow.Width() + aSz.Width() / 2 &&
+ aPos.Y() + aSz.Height() <
+ aAppWindow.Height() + aSz.Height() / 2 )
+ {
+ pWin->SetPosPixel( aPos );
+ pWin->SetOutputSizePixel( aSz );
+ }
+ }
+}
+
+void SfxFrame::PrepareForDoc_Impl( SfxObjectShell& i_rDoc )
+{
+ const ::comphelper::NamedValueCollection aDocumentArgs( i_rDoc.GetModel()->getArgs() );
+
+ // hidden?
+ OSL_ENSURE( !pImp->bHidden, "when does this happen?" );
+ pImp->bHidden = aDocumentArgs.getOrDefault( "Hidden", pImp->bHidden );
+
+ // update our descriptor
+ UpdateDescriptor( &i_rDoc );
+
+ // plugin mode
+ sal_Int16 nPluginMode = aDocumentArgs.getOrDefault( "PluginMode", sal_Int16( 0 ) );
+ if ( nPluginMode && ( nPluginMode != 2 ) )
+ SetInPlace_Impl( TRUE );
+}
+
+bool SfxFrame::IsMarkedHidden_Impl() const
+{
+ return pImp->bHidden;
+}
diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx
index 72cf7bea3f..f59b80b84c 100644
--- a/sfx2/source/view/frmload.cxx
+++ b/sfx2/source/view/frmload.cxx
@@ -29,70 +29,85 @@
#include "precompiled_sfx2.hxx"
#include "frmload.hxx"
-
-#include <framework/interaction.hxx>
-#include <com/sun/star/frame/XLoadable.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include "objshimp.hxx"
+#include "viewfac.hxx"
+#include "sfx2/app.hxx"
+#include "sfx2/dispatch.hxx"
+#include "sfx2/docfac.hxx"
+#include "sfx2/docfile.hxx"
+#include "sfx2/docfilt.hxx"
+#include "sfx2/doctempl.hxx"
+#include "sfx2/fcontnr.hxx"
+#include "sfx2/frame.hxx"
+#include "sfx2/request.hxx"
+#include "sfx2/sfx.hrc"
+#include "sfx2/sfxsids.hrc"
+#include "sfx2/sfxuno.hxx"
+#include "sfx2/viewfrm.hxx"
+#include "sfx2/viewsh.hxx"
+
+/** === begin UNO includes === **/
#include <com/sun/star/container/XContainerQuery.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/document/XTypeDetection.hpp>
#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/frame/XLoadable.hpp>
#include <com/sun/star/frame/XModel.hpp>
-#include <com/sun/star/awt/XWindow.hpp>
-#include <com/sun/star/lang/XUnoTunnel.hpp>
-#ifndef _UNOTOOLS_PROCESSFACTORY_HXX
-#include <comphelper/processfactory.hxx>
-#endif
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/io/XInputStream.hpp>
-#include <com/sun/star/task/XInteractionHandler.hpp>
-#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
-#include <com/sun/star/ucb/CommandAbortedException.hpp>
-#include <com/sun/star/ucb/InteractiveAppException.hpp>
-#include <com/sun/star/document/XTypeDetection.hpp>
-#include <framework/interaction.hxx>
-
-#ifndef _TOOLKIT_UNOHLP_HXX
-#include <toolkit/helper/vclunohelper.hxx>
-#endif
-#include <ucbhelper/simpleinteractionrequest.hxx>
+#include <com/sun/star/task/XInteractionHandler2.hpp>
+#include <com/sun/star/document/XViewDataSupplier.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
+/** === end UNO includes === **/
-#include <rtl/ustring.h>
+#include <comphelper/interaction.hxx>
+#include <comphelper/namedvaluecollection.hxx>
+#include <comphelper/sequenceashashmap.hxx>
+#include <cppuhelper/exc_hlp.hxx>
+#include <framework/interaction.hxx>
#include <rtl/logfile.hxx>
-#include <svl/itemset.hxx>
-#include <vcl/window.hxx>
+#include <rtl/ustring.h>
+#include <sot/storinfo.hxx>
+#include <svtools/ehdl.hxx>
#include <svl/eitem.hxx>
+#include <svl/itemset.hxx>
+#include <unotools/moduleoptions.hxx>
+#include <svtools/sfxecode.hxx>
#include <svl/stritem.hxx>
-#include <tools/urlobj.hxx>
+#include <toolkit/helper/vclunohelper.hxx>
+#include <tools/diagnose_ex.h>
+#include <ucbhelper/simpleinteractionrequest.hxx>
#include <vos/mutex.hxx>
-#include <svtools/sfxecode.hxx>
-#include <svtools/ehdl.hxx>
-#include <sot/storinfo.hxx>
-#include <comphelper/sequenceashashmap.hxx>
-#include <comphelper/mediadescriptor.hxx>
-#include <unotools/moduleoptions.hxx>
-
-#ifndef css
-namespace css = ::com::sun::star;
-#endif
-
-#include <sfx2/doctempl.hxx>
-#include <sfx2/app.hxx>
-#include <sfx2/request.hxx>
-#include <sfx2/sfxsids.hrc>
-#include <sfx2/dispatch.hxx>
-#include <sfx2/sfxuno.hxx>
-#include <sfx2/viewfrm.hxx>
-#include <sfx2/topfrm.hxx>
-#include <sfx2/frame.hxx>
-#include <sfx2/docfac.hxx>
-#include <sfx2/fcontnr.hxx>
-#include <sfx2/docfile.hxx>
-#include <sfx2/docfilt.hxx>
-#include "brokenpackageint.hxx"
-#include "objshimp.hxx"
-SfxFrameLoader_Impl::SfxFrameLoader_Impl( const css::uno::Reference< css::lang::XMultiServiceFactory >& /*xFactory*/ )
+/** === begin UNO using === **/
+using ::com::sun::star::beans::PropertyValue;
+using ::com::sun::star::container::XContainerQuery;
+using ::com::sun::star::container::XEnumeration;
+using ::com::sun::star::document::XTypeDetection;
+using ::com::sun::star::frame::XFrame;
+using ::com::sun::star::frame::XLoadable;
+using ::com::sun::star::frame::XModel;
+using ::com::sun::star::lang::XMultiServiceFactory;
+using ::com::sun::star::task::XInteractionHandler;
+using ::com::sun::star::task::XInteractionHandler2;
+using ::com::sun::star::task::XInteractionRequest;
+using ::com::sun::star::task::XStatusIndicator;
+using ::com::sun::star::uno::Any;
+using ::com::sun::star::uno::Exception;
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::RuntimeException;
+using ::com::sun::star::uno::Sequence;
+using ::com::sun::star::uno::UNO_QUERY;
+using ::com::sun::star::uno::UNO_QUERY_THROW;
+using ::com::sun::star::uno::UNO_SET_THROW;
+using ::com::sun::star::uno::makeAny;
+using ::com::sun::star::util::XCloseable;
+using ::com::sun::star::document::XViewDataSupplier;
+using ::com::sun::star::container::XIndexAccess;
+using ::com::sun::star::frame::XController2;
+using ::com::sun::star::frame::XController;
+using ::com::sun::star::frame::XModel2;
+/** === end UNO using === **/
+
+SfxFrameLoader_Impl::SfxFrameLoader_Impl( const Reference< XMultiServiceFactory >& _rxFactory )
+ :m_aContext( _rxFactory )
{
}
@@ -100,54 +115,46 @@ SfxFrameLoader_Impl::~SfxFrameLoader_Impl()
{
}
-const SfxFilter* impl_detectFilterForURL(const ::rtl::OUString& sURL ,
- const css::uno::Sequence< css::beans::PropertyValue >& rArgs ,
- const SfxFilterMatcher& rMatcher)
+// --------------------------------------------------------------------------------------------------------------------
+const SfxFilter* SfxFrameLoader_Impl::impl_detectFilterForURL( const ::rtl::OUString& sURL,
+ const ::comphelper::NamedValueCollection& i_rDescriptor, const SfxFilterMatcher& rMatcher ) const
{
- static ::rtl::OUString SERVICENAME_TYPEDETECTION = ::rtl::OUString::createFromAscii("com.sun.star.document.TypeDetection");
-
::rtl::OUString sFilter;
try
{
- if (!sURL.getLength())
+ if ( !sURL.getLength() )
return 0;
- css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory();
- if (!xSMGR.is())
- return 0;
+ Reference< XTypeDetection > xDetect(
+ m_aContext.createComponent( "com.sun.star.document.TypeDetection" ),
+ UNO_QUERY_THROW);
+
+ ::comphelper::NamedValueCollection aNewArgs;
+ aNewArgs.put( "URL", sURL );
- css::uno::Reference< css::document::XTypeDetection > xDetect(
- xSMGR->createInstance(SERVICENAME_TYPEDETECTION),
- css::uno::UNO_QUERY_THROW);
-
- ::comphelper::MediaDescriptor lOrgArgs(rArgs);
- css::uno::Reference< css::task::XInteractionHandler > xInteraction = lOrgArgs.getUnpackedValueOrDefault(
- ::comphelper::MediaDescriptor::PROP_INTERACTIONHANDLER(),
- css::uno::Reference< css::task::XInteractionHandler >());
- css::uno::Reference< css::task::XStatusIndicator > xProgress = lOrgArgs.getUnpackedValueOrDefault(
- ::comphelper::MediaDescriptor::PROP_STATUSINDICATOR(),
- css::uno::Reference< css::task::XStatusIndicator >());
-
- ::comphelper::SequenceAsHashMap lNewArgs;
- lNewArgs[::comphelper::MediaDescriptor::PROP_URL()] <<= sURL;
- if (xInteraction.is())
- lNewArgs[::comphelper::MediaDescriptor::PROP_INTERACTIONHANDLER()] <<= xInteraction;
- if (xProgress.is())
- lNewArgs[::comphelper::MediaDescriptor::PROP_STATUSINDICATOR()] <<= xProgress;
-
- css::uno::Sequence< css::beans::PropertyValue > lDescr = lNewArgs.getAsConstPropertyValueList();
- ::rtl::OUString sType = xDetect->queryTypeByDescriptor(lDescr, sal_True);
- if (sType.getLength())
+ if ( i_rDescriptor.has( "InteractionHandler" ) )
+ aNewArgs.put( "InteractionHandler", i_rDescriptor.get( "InteractionHandler" ) );
+ if ( i_rDescriptor.has( "StatusIndicator" ) )
+ aNewArgs.put( "StatusIndicator", i_rDescriptor.get( "StatusIndicator" ) );
+
+ Sequence< PropertyValue > aQueryArgs( aNewArgs.getPropertyValues() );
+ ::rtl::OUString sType = xDetect->queryTypeByDescriptor( aQueryArgs, sal_True );
+ if ( sType.getLength() )
{
- const SfxFilter* pFilter = rMatcher.GetFilter4EA(sType);
- if (pFilter)
+ const SfxFilter* pFilter = rMatcher.GetFilter4EA( sType );
+ if ( pFilter )
sFilter = pFilter->GetName();
}
}
- catch(const css::uno::RuntimeException& exRun)
- { throw exRun; }
- catch(const css::uno::Exception&)
- { sFilter = ::rtl::OUString(); }
+ catch ( const RuntimeException& )
+ {
+ throw;
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ sFilter = ::rtl::OUString();
+ }
const SfxFilter* pFilter = 0;
if (sFilter.getLength())
@@ -155,453 +162,548 @@ const SfxFilter* impl_detectFilterForURL(const ::rtl::OUString&
return pFilter;
}
-sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const css::uno::Sequence< css::beans::PropertyValue >& rArgs ,
- const css::uno::Reference< css::frame::XFrame >& rFrame )
- throw( css::uno::RuntimeException )
+// --------------------------------------------------------------------------------------------------------------------
+const SfxFilter* SfxFrameLoader_Impl::impl_getFilterFromServiceName_nothrow( const ::rtl::OUString& i_rServiceName ) const
{
- static ::rtl::OUString PROP_URL = ::rtl::OUString::createFromAscii("URL" );
- static ::rtl::OUString PROP_FILENAME = ::rtl::OUString::createFromAscii("FileName" );
- static ::rtl::OUString PROP_TYPENAME = ::rtl::OUString::createFromAscii("TypeName" );
- static ::rtl::OUString PROP_FILTERNAME = ::rtl::OUString::createFromAscii("FilterName" );
- static ::rtl::OUString PROP_MODEL = ::rtl::OUString::createFromAscii("Model" );
- static ::rtl::OUString PROP_DOCUMENTSERVICE = ::rtl::OUString::createFromAscii("DocumentService" );
- static ::rtl::OUString PROP_READONLY = ::rtl::OUString::createFromAscii("ReadOnly" );
- static ::rtl::OUString PROP_ASTEMPLATE = ::rtl::OUString::createFromAscii("AsTemplate" );
- static ::rtl::OUString PROP_INTERACTIONHANDLER = ::rtl::OUString::createFromAscii("InteractionHandler");
-
- sal_Bool bLoadState = sal_False;
-
- // this methods assumes that the filter is detected before, usually by calling the detect() method below
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ try
+ {
+ ::comphelper::NamedValueCollection aQuery;
+ aQuery.put( "DocumentService", i_rServiceName );
- RTL_LOGFILE_CONTEXT( aLog, "sfx2 (mb93783) ::SfxFrameLoader::load" );
+ const Reference< XContainerQuery > xQuery(
+ m_aContext.createComponent( "com.sun.star.document.FilterFactory" ),
+ UNO_QUERY_THROW );
- if ( !rFrame.is() )
- return sal_False;
+ const SfxFilterMatcher& rMatcher = SFX_APP()->GetFilterMatcher();
+ const SfxFilterFlags nMust = SFX_FILTER_IMPORT;
+ const SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED;
- ::comphelper::SequenceAsHashMap lDescriptor(rArgs);
- String rURL = lDescriptor.getUnpackedValueOrDefault(PROP_URL , ::rtl::OUString() );
- String aTypeName = lDescriptor.getUnpackedValueOrDefault(PROP_TYPENAME , ::rtl::OUString() );
- aFilterName = lDescriptor.getUnpackedValueOrDefault(PROP_FILTERNAME , ::rtl::OUString() );
- String aServiceName = lDescriptor.getUnpackedValueOrDefault(PROP_DOCUMENTSERVICE , ::rtl::OUString() );
- css::uno::Reference< css::task::XInteractionHandler > xInteraction = lDescriptor.getUnpackedValueOrDefault(PROP_INTERACTIONHANDLER, css::uno::Reference< css::task::XInteractionHandler >());
- css::uno::Reference< css::frame::XModel > xModel = lDescriptor.getUnpackedValueOrDefault(PROP_MODEL , css::uno::Reference< css::frame::XModel >() );
+ Reference < XEnumeration > xEnum( xQuery->createSubSetEnumerationByProperties(
+ aQuery.getNamedValues() ), UNO_SET_THROW );
+ while ( xEnum->hasMoreElements() )
+ {
+ ::comphelper::NamedValueCollection aType( xEnum->nextElement() );
+ ::rtl::OUString sFilterName = aType.getOrDefault( "Name", ::rtl::OUString() );
+ if ( !sFilterName.getLength() )
+ continue;
+
+ const SfxFilter* pFilter = rMatcher.GetFilter4FilterName( sFilterName );
+ if ( !pFilter )
+ continue;
+
+ SfxFilterFlags nFlags = pFilter->GetFilterFlags();
+ if ( ( ( nFlags & nMust ) == nMust )
+ && ( ( nFlags & nDont ) == 0 )
+ )
+ {
+ return pFilter;
+ }
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return NULL;
+}
- const SfxFilter* pFilter = NULL;
- const SfxFilterMatcher& rMatcher = SFX_APP()->GetFilterMatcher();
+// --------------------------------------------------------------------------------------------------------------------
+::rtl::OUString SfxFrameLoader_Impl::impl_askForFilter_nothrow( const Reference< XInteractionHandler >& i_rxHandler,
+ const ::rtl::OUString& i_rDocumentURL ) const
+{
+ ENSURE_OR_THROW( i_rxHandler.is(), "invalid interaction handler" );
- /* special mode: use already loaded model ...
- In such case no filter name will be selected and no URL will be given!
- Such informations are not neccessary. We have to create a new view only
- and call setComponent() at the corresponding frame. */
- if( !xModel.is() )
+ ::rtl::OUString sFilterName;
+ try
{
+ ::framework::RequestFilterSelect* pRequest = new ::framework::RequestFilterSelect( i_rDocumentURL );
+ Reference< XInteractionRequest > xRequest ( pRequest );
+ i_rxHandler->handle( xRequest );
+ if( !pRequest->isAbort() )
+ sFilterName = pRequest->getFilter();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
- // get filter by its name directly ...
- if( aFilterName.Len() )
- pFilter = rMatcher.GetFilter4FilterName( aFilterName );
+ return sFilterName;
+}
- // or search the preferred filter for the detected type ...
- if( !pFilter && aTypeName.Len() )
- pFilter = rMatcher.GetFilter4EA(aTypeName);
+// --------------------------------------------------------------------------------------------------------------------
+namespace
+{
+ sal_Bool lcl_getDispatchResult( const SfxPoolItem* _pResult )
+ {
+ if ( !_pResult )
+ return sal_False;
- // or use given document service for detection too!
- if (!pFilter && aServiceName.Len())
- {
- ::comphelper::SequenceAsHashMap lQuery;
+ // default must be set to true, because some return values
+ // cant be checked, but nonetheless indicate "success"!
+ sal_Bool bSuccess = sal_True;
- if (aServiceName.Len())
- lQuery[::rtl::OUString::createFromAscii("DocumentService")] <<= ::rtl::OUString(aServiceName);
+ // On the other side some special slots return a boolean state,
+ // which can be set to FALSE.
+ SfxBoolItem *pItem = PTR_CAST( SfxBoolItem, _pResult );
+ if ( pItem )
+ bSuccess = pItem->GetValue();
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceManager = ::comphelper::getProcessServiceFactory();
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerQuery > xQuery ( xServiceManager->createInstance( DEFINE_CONST_UNICODE( "com.sun.star.document.FilterFactory" ) ), ::com::sun::star::uno::UNO_QUERY );
+ return bSuccess;
+ }
+}
- SfxFilterFlags nMust = SFX_FILTER_IMPORT;
- SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED;
+// --------------------------------------------------------------------------------------------------------------------
+sal_Bool SfxFrameLoader_Impl::impl_createNewDocWithSlotParam( const USHORT _nSlotID, const Reference< XFrame >& i_rxFrame,
+ const bool i_bHidden )
+{
+ SfxRequest aRequest( _nSlotID, SFX_CALLMODE_SYNCHRON, SFX_APP()->GetPool() );
+ aRequest.AppendItem( SfxUnoFrameItem( SID_FILLFRAME, i_rxFrame ) );
+ if ( i_bHidden )
+ aRequest.AppendItem( SfxBoolItem( SID_HIDDEN, TRUE ) );
+ return lcl_getDispatchResult( SFX_APP()->ExecuteSlot( aRequest ) );
+}
- ::com::sun::star::uno::Reference < com::sun::star::container::XEnumeration > xEnum = xQuery->createSubSetEnumerationByProperties(lQuery.getAsConstNamedValueList());
- while ( xEnum->hasMoreElements() )
- {
- ::comphelper::SequenceAsHashMap aType( xEnum->nextElement() );
- aFilterName = aType.getUnpackedValueOrDefault(::rtl::OUString::createFromAscii("Name"), ::rtl::OUString());
- if (!aFilterName.Len())
- continue;
- pFilter = rMatcher.GetFilter4FilterName(aFilterName);
- if (!pFilter)
- continue;
- SfxFilterFlags nFlags = pFilter->GetFilterFlags();
- if (
- ((nFlags & nMust) == nMust) &&
- (!(nFlags & nDont ))
- )
- {
- break;
- }
- pFilter = 0; //! in case we reach end of enumeration we must have a valid value ...
- }
- }
+// --------------------------------------------------------------------------------------------------------------------
+void SfxFrameLoader_Impl::impl_lockHiddenDocument( SfxObjectShell& i_rDocument, const ::comphelper::NamedValueCollection& i_rDescriptor ) const
+{
+ const sal_Bool bHidden = i_rDescriptor.getOrDefault( "Hidden", sal_False );
+ if ( !bHidden )
+ return;
+
+ const SfxViewFrame* pExistingViewFrame = SfxViewFrame::GetFirst( &i_rDocument );
+ if ( pExistingViewFrame )
+ return;
+
+ // the document is to be loaded hidden, and it is not yet displayed in any other frame
+ // To prevent it from being closed when the loader returns, increase its OwnerLock
+ // (the OwnerLock is normally increased by every frame in which the document is displayed, and by this loader)
+ i_rDocument.RestoreNoDelete();
+ i_rDocument.OwnerLock( TRUE );
+ i_rDocument.Get_Impl()->bHiddenLockedByAPI = TRUE;
+}
- // or use interaction to ask user for right filter.
- if ( !pFilter && xInteraction.is() && rURL.Len() )
- {
- ::framework::RequestFilterSelect* pRequest = new ::framework::RequestFilterSelect( rURL );
- css::uno::Reference< css::task::XInteractionRequest > xRequest ( pRequest );
- xInteraction->handle( xRequest );
- if( !pRequest->isAbort() )
- {
- aFilterName = pRequest->getFilter();
- pFilter = rMatcher.GetFilter4FilterName( aFilterName );
- }
- }
+// --------------------------------------------------------------------------------------------------------------------
+void SfxFrameLoader_Impl::impl_determineFilter( ::comphelper::NamedValueCollection& io_rDescriptor ) const
+{
+ const ::rtl::OUString sURL = io_rDescriptor.getOrDefault( "URL", ::rtl::OUString() );
+ const ::rtl::OUString sTypeName = io_rDescriptor.getOrDefault( "TypeName", ::rtl::OUString() );
+ const ::rtl::OUString sFilterName = io_rDescriptor.getOrDefault( "FilterName", ::rtl::OUString() );
+ const ::rtl::OUString sServiceName = io_rDescriptor.getOrDefault( "DocumentService", ::rtl::OUString() );
+ const Reference< XInteractionHandler >
+ xInteraction = io_rDescriptor.getOrDefault( "InteractionHandler", Reference< XInteractionHandler >() );
- if( !pFilter )
- return sal_False;
+ const SfxFilterMatcher& rMatcher = SFX_APP()->GetFilterMatcher();
+ const SfxFilter* pFilter = NULL;
+
+ // get filter by its name directly ...
+ if ( sFilterName.getLength() )
+ pFilter = rMatcher.GetFilter4FilterName( sFilterName );
+
+ // or search the preferred filter for the detected type ...
+ if ( !pFilter && sTypeName.getLength() )
+ pFilter = rMatcher.GetFilter4EA( sTypeName );
- aTypeName = pFilter->GetTypeName();
- // use filter names without prefix
- aFilterName = pFilter->GetFilterName();
+ // or use given document service for detection, too
+ if ( !pFilter && sServiceName.getLength() )
+ pFilter = impl_getFilterFromServiceName_nothrow( sServiceName );
+
+ // or use interaction to ask user for right filter.
+ if ( !pFilter && xInteraction.is() && sURL.getLength() )
+ {
+ ::rtl::OUString sSelectedFilter = impl_askForFilter_nothrow( xInteraction, sURL );
+ if ( sSelectedFilter.getLength() )
+ pFilter = rMatcher.GetFilter4FilterName( sSelectedFilter );
+ }
+
+ if ( pFilter )
+ {
+ io_rDescriptor.put( "FilterName", ::rtl::OUString( pFilter->GetFilterName() ) );
// If detected filter indicates using of an own template format
- // add property "AsTemplate" to descriptor. But supress this step
+ // add property "AsTemplate" to descriptor. But suppress this step
// if such property already exists.
- if( pFilter->IsOwnTemplateFormat())
+ if ( pFilter->IsOwnTemplateFormat() && !io_rDescriptor.has( "AsTemplate" ) )
+ io_rDescriptor.put( "AsTemplate", sal_Bool( sal_True ) );
+
+ // The DocumentService property will finally be used to determine the document type to create, so
+ // override it with the service name as indicated by the found filter.
+ io_rDescriptor.put( "DocumentService", ::rtl::OUString( pFilter->GetServiceName() ) );
+ }
+}
+
+// --------------------------------------------------------------------------------------------------------------------
+SfxObjectShellLock SfxFrameLoader_Impl::impl_findObjectShell( const Reference< XModel2 >& i_rxDocument ) const
+{
+ for ( SfxObjectShell* pDoc = SfxObjectShell::GetFirst( NULL, FALSE ); pDoc; pDoc = SfxObjectShell::GetNext( *pDoc, NULL, FALSE ) )
+ {
+ if ( i_rxDocument == pDoc->GetModel() )
{
- ::comphelper::SequenceAsHashMap::iterator pIt = lDescriptor.find(PROP_ASTEMPLATE);
- if (pIt == lDescriptor.end())
- lDescriptor[PROP_ASTEMPLATE] <<= sal_True;
+ return pDoc;
}
}
- xFrame = rFrame;
+ DBG_ERROR( "SfxFrameLoader_Impl::impl_findObjectShell: model is not based on SfxObjectShell - wrong frame loader usage!" );
+ return NULL;
+}
- // Achtung: beim Abraeumen der Objekte kann die SfxApp destruiert werden, vorher noch Deinitialize_Impl rufen
- SfxApplication* pApp = SFX_APP();
+// --------------------------------------------------------------------------------------------------------------------
+bool SfxFrameLoader_Impl::impl_determineTemplateDocument( ::comphelper::NamedValueCollection& io_rDescriptor ) const
+{
+ const ::rtl::OUString sTemplateRegioName = io_rDescriptor.getOrDefault( "TemplateRegionName", ::rtl::OUString() );
+ const ::rtl::OUString sTemplateName = io_rDescriptor.getOrDefault( "TemplateName", ::rtl::OUString() );
+ const ::rtl::OUString sServiceName = io_rDescriptor.getOrDefault( "DocumentService", ::rtl::OUString() );
+ const ::rtl::OUString sURL = io_rDescriptor.getOrDefault( "URL", ::rtl::OUString() );
+
+ // determine the full URL of the template to use, if any
+ String sTemplateURL;
+ if ( sTemplateRegioName.getLength() && sTemplateName.getLength() )
+ {
+ SfxDocumentTemplates aTmpFac;
+ aTmpFac.GetFull( sTemplateRegioName, sTemplateName, sTemplateURL );
+ }
+ else
+ {
+ if ( sServiceName.getLength() )
+ sTemplateURL = SfxObjectFactory::GetStandardTemplate( sServiceName );
+ else
+ sTemplateURL = SfxObjectFactory::GetStandardTemplate( SfxObjectShell::GetServiceNameFromFactory( sURL ) );
+ }
- // Attention! Because lDescriptor is a copy of rArgs
- // and was might by changed (e.g. for AsTemplate)
- // move all changes there back!
- SfxAllItemSet aSet( pApp->GetPool() );
- TransformParameters( SID_OPENDOC, lDescriptor.getAsConstPropertyValueList(), aSet );
+ if ( sTemplateURL.Len() > 0 )
+ {
+ // detect the filter for the template. Might still be NULL (if the template is broken, or does not
+ // exist, or some such), but this is handled by our caller the same way as if no template/URL was present.
+ const SfxFilter* pTemplateFilter = impl_detectFilterForURL( sTemplateURL, io_rDescriptor, SFX_APP()->GetFilterMatcher() );
+ if ( pTemplateFilter )
+ {
+ // load the template document, but, well, "as template"
+ io_rDescriptor.put( "FilterName", ::rtl::OUString( pTemplateFilter->GetName() ) );
+ io_rDescriptor.put( "FileName", ::rtl::OUString( sTemplateURL ) );
+ io_rDescriptor.put( "AsTemplate", sal_True );
- SFX_ITEMSET_ARG( &aSet, pRefererItem, SfxStringItem, SID_REFERER, FALSE );
- if ( !pRefererItem )
- aSet.Put( SfxStringItem( SID_REFERER, String() ) );
+ // #i21583#
+ // the DocumentService property will finally be used to create the document. Thus, override any possibly
+ // present value with the document service of the template.
+ io_rDescriptor.put( "DocumentService", ::rtl::OUString( pTemplateFilter->GetServiceName() ) );
+ return true;
+ }
+ }
+ return false;
+}
- SfxFrame* pFrame=0;
- for ( pFrame = SfxFrame::GetFirst(); pFrame; pFrame = SfxFrame::GetNext( *pFrame ) )
+// --------------------------------------------------------------------------------------------------------------------
+USHORT SfxFrameLoader_Impl::impl_findSlotParam( const ::rtl::OUString& i_rFactoryURL ) const
+{
+ ::rtl::OUString sSlotParam;
+ const sal_Int32 nParamPos = i_rFactoryURL.indexOf( '?' );
+ if ( nParamPos >= 0 )
{
- if ( pFrame->GetFrameInterface() == xFrame )
- break;
+ // currently only the "slot" parameter is supported
+ const sal_Int32 nSlotPos = i_rFactoryURL.indexOfAsciiL( RTL_CONSTASCII_STRINGPARAM( "slot=" ), nParamPos );
+ if ( nSlotPos > 0 )
+ sSlotParam = i_rFactoryURL.copy( nSlotPos + 5 );
}
- BOOL bFrameCreated = FALSE;
- if ( !pFrame )
+ if ( sSlotParam.getLength() )
+ return USHORT( sSlotParam.toInt32() );
+
+ return 0;
+}
+
+// --------------------------------------------------------------------------------------------------------------------
+void SfxFrameLoader_Impl::impl_handleCaughtError_nothrow( const Any& i_rCaughtError, const ::comphelper::NamedValueCollection& i_rDescriptor ) const
+{
+ try
+ {
+ const Reference< XInteractionHandler > xInteraction =
+ i_rDescriptor.getOrDefault( "InteractionHandler", Reference< XInteractionHandler >() );
+ if ( !xInteraction.is() )
+ return;
+ ::rtl::Reference< ::comphelper::OInteractionRequest > pRequest( new ::comphelper::OInteractionRequest( i_rCaughtError ) );
+ ::rtl::Reference< ::comphelper::OInteractionApprove > pApprove( new ::comphelper::OInteractionApprove );
+ pRequest->addContinuation( pApprove.get() );
+
+ const Reference< XInteractionHandler2 > xHandler( xInteraction, UNO_QUERY );
+ #if OSL_DEBUG_LEVEL > 0
+ const sal_Bool bHandled =
+ #endif
+ xHandler.is() && xHandler->handleInteractionRequest( pRequest.get() );
+
+ #if OSL_DEBUG_LEVEL > 0
+ if ( !bHandled )
+ // the interaction handler couldn't deal with this error
+ // => report it as assertion, at least (done in the DBG_UNHANDLED_EXCEPTION below)
+ ::cppu::throwException( i_rCaughtError );
+ #endif
+ }
+ catch( const Exception& )
{
- pFrame = SfxTopFrame::Create( rFrame );
- bFrameCreated = TRUE;
+ DBG_UNHANDLED_EXCEPTION();
}
+}
+
+// --------------------------------------------------------------------------------------------------------------------
+void SfxFrameLoader_Impl::impl_removeLoaderArguments( ::comphelper::NamedValueCollection& io_rDescriptor )
+{
+ // remove the arguments which are for the loader only, and not for a call to attachResource
+ io_rDescriptor.remove( "StatusIndicator" );
+ io_rDescriptor.remove( "Model" );
+}
- if ( xModel.is() )
+// --------------------------------------------------------------------------------------------------------------------
+::comphelper::NamedValueCollection SfxFrameLoader_Impl::impl_extractViewCreationArgs( ::comphelper::NamedValueCollection& io_rDescriptor )
+{
+ const sal_Char* pKnownViewArgs[] = {
+ "JumpMark"
+ };
+
+ ::comphelper::NamedValueCollection aViewArgs;
+ for ( size_t i=0; i < sizeof( pKnownViewArgs ) / sizeof( pKnownViewArgs[0] ); ++i )
{
- // !TODO: replace by ViewFactory
- if ( pFrame->GetFrameInterface()->getController().is() )
+ if ( io_rDescriptor.has( pKnownViewArgs[i] ) )
{
- // remove old component
- // if a frame was created already, it can't be an SfxComponent!
- pFrame->GetFrameInterface()->setComponent( 0, 0 );
- if ( !bFrameCreated )
- pFrame = SfxTopFrame::Create( rFrame );
+ aViewArgs.put( pKnownViewArgs[i], io_rDescriptor.get( pKnownViewArgs[i] ) );
+ io_rDescriptor.remove( pKnownViewArgs[i] );
}
+ }
+ return aViewArgs;
+}
- aSet.Put( SfxFrameItem( SID_DOCFRAME, pFrame ) );
-
- for ( SfxObjectShell* pDoc = SfxObjectShell::GetFirst( NULL, FALSE ); pDoc; pDoc = SfxObjectShell::GetNext( *pDoc, NULL, FALSE ) )
+// --------------------------------------------------------------------------------------------------------------------
+sal_Int16 SfxFrameLoader_Impl::impl_determineEffectiveViewId_nothrow( const SfxObjectShell& i_rDocument, const ::comphelper::NamedValueCollection& i_rDescriptor )
+{
+ sal_Int16 nViewId = i_rDescriptor.getOrDefault( "ViewId", sal_Int16( 0 ) );
+ try
+ {
+ if ( nViewId == 0 ) do
{
- if ( xModel == pDoc->GetModel() )
- {
- pFrame->SetItemSet_Impl( &aSet );
- ::comphelper::SequenceAsHashMap lUpdateDescr( lDescriptor );
- lUpdateDescr.erase( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Model" ) ) );
- lUpdateDescr.erase( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) ) );
-
- xModel->attachResource( rURL, lUpdateDescr.getAsConstPropertyValueList() );
- return pFrame->InsertDocument( pDoc );
- }
+ Reference< XViewDataSupplier > xViewDataSupplier( i_rDocument.GetModel(), UNO_QUERY );
+ Reference< XIndexAccess > xViewData;
+ if ( xViewDataSupplier.is() )
+ xViewData.set( xViewDataSupplier->getViewData() );
+
+ if ( !xViewData.is() || ( xViewData->getCount() == 0 ) )
+ // no view data stored together with the model
+ break;
+
+ // obtain the ViewID from the view data
+ Sequence< PropertyValue > aViewData;
+ if ( !( xViewData->getByIndex( 0 ) >>= aViewData ) )
+ break;
+
+ ::comphelper::NamedValueCollection aNamedViewData( aViewData );
+ ::rtl::OUString sViewId = aNamedViewData.getOrDefault( "ViewId", ::rtl::OUString() );
+ if ( !sViewId.getLength() )
+ break;
+
+ // somewhat weird convention here ... in the view data, the ViewId is a string, effectively describing
+ // a view name. In the document load descriptor, the ViewId is in fact the numeric ID.
+
+ SfxViewFactory* pViewFactory = i_rDocument.GetFactory().GetViewFactoryByViewName( sViewId );
+ if ( pViewFactory )
+ nViewId = sal_Int16( pViewFactory->GetOrdinal() );
}
-
- DBG_ERROR("Model is not based on SfxObjectShell - wrong frame loader use!");
- return sal_False;
+ while ( false );
}
-
- // check for the URL pattern of our factory URLs
- SfxFrameWeak wFrame = pFrame;
- String aPrefix = String::CreateFromAscii( "private:factory/" );
- String aFact( rURL );
- if ( aPrefix.Len() == aFact.Match( aPrefix ) )
+ catch( const Exception& )
{
- if ( !aServiceName.Len() )
- aServiceName = SfxObjectShell::GetServiceNameFromFactory( rURL );
+ DBG_UNHANDLED_EXCEPTION();
+ }
- // it's a factory URL
- aFact.Erase( 0, aPrefix.Len() );
+ if ( nViewId == 0 )
+ nViewId = i_rDocument.GetFactory().GetViewFactory( 0 ).GetOrdinal();
+ return nViewId;
+}
- // look for parameters
- String aParam;
- USHORT nPos = aFact.Search( '?' );
- if ( nPos != STRING_NOTFOUND )
- {
- // currently only the "slot" parameter is supported
- USHORT nParamPos = aFact.Search( String::CreateFromAscii("slot="), nPos );
- if ( nParamPos != STRING_NOTFOUND )
- aParam = aFact.Copy( nParamPos+5, aFact.Len() );
- aFact.Erase( nPos, aFact.Len() );
- }
+// --------------------------------------------------------------------------------------------------------------------
+Reference< XController2 > SfxFrameLoader_Impl::impl_createDocumentView( const Reference< XModel2 >& i_rModel,
+ const Reference< XFrame >& i_rFrame, const ::comphelper::NamedValueCollection& i_rViewFactoryArgs,
+ const ::rtl::OUString& i_rViewName )
+{
+ // let the model create a new controller
+ const Reference< XController2 > xController( i_rModel->createViewController(
+ i_rViewName,
+ i_rViewFactoryArgs.getPropertyValues(),
+ i_rFrame
+ ), UNO_SET_THROW );
+
+ // introduce model/view/controller to each other
+ xController->attachModel( i_rModel.get() );
+ i_rModel->connectController( xController.get() );
+ i_rFrame->setComponent( xController->getComponentWindow(), xController.get() );
+ xController->attachFrame( i_rFrame );
+ i_rModel->setCurrentController( xController.get() );
+
+ return xController;
+}
- WildCard aSearchedFac( aFact.EraseAllChars('4').ToUpperAscii() );
- SFX_ITEMSET_ARG( &aSet, pDocumentTitleItem, SfxStringItem, SID_DOCINFO_TITLE, FALSE );
- INetURLObject aObj( rURL );
+// --------------------------------------------------------------------------------------------------------------------
+sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rArgs,
+ const Reference< XFrame >& _rTargetFrame )
+ throw( RuntimeException )
+{
+ ENSURE_OR_THROW( _rTargetFrame.is(), "illegal NULL frame" );
- if ( aParam.Len() )
- {
- sal_uInt16 nSlotId = (sal_uInt16) aParam.ToInt32();
- SfxRequest aReq( nSlotId, SFX_CALLMODE_SYNCHRON, pApp->GetPool() );
- aReq.AppendItem( SfxFrameItem ( SID_DOCFRAME, pFrame ) );
- const SfxPoolItem* pRet = pApp->ExecuteSlot( aReq );
- if ( pRet )
- {
- // default must be set to true, because some return values
- // cant be checked ... but indicates "success"!
- bLoadState = sal_True;
-
- // On the other side some special slots return a boolean state,
- // which can be set to FALSE.
- SfxBoolItem *pItem = PTR_CAST( SfxBoolItem, pRet );
- if (pItem)
- bLoadState = pItem->GetValue();
- }
- else
- bLoadState = sal_False;
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if ( !bLoadState && bFrameCreated && wFrame && !wFrame->GetCurrentDocument() )
- {
- css::uno::Reference< css::frame::XFrame > axFrame;
- wFrame->SetFrameInterface_Impl( axFrame );
- wFrame->DoClose();
- }
+ RTL_LOGFILE_CONTEXT( aLog, "sfx2 (mb93783) ::SfxFrameLoader::load" );
- xFrame.clear();
- xListener.clear();
- return bLoadState;
- }
+ ::comphelper::NamedValueCollection aDescriptor( rArgs );
- String sTemplateURL;
- SFX_ITEMSET_ARG( &aSet, pTemplateRegionItem, SfxStringItem, SID_TEMPLATE_REGIONNAME, FALSE );
- SFX_ITEMSET_ARG( &aSet, pTemplateNameItem, SfxStringItem, SID_TEMPLATE_NAME, FALSE );
- if ( pTemplateRegionItem && pTemplateNameItem )
- {
- SfxDocumentTemplates aTmpFac;
- aTmpFac.GetFull( pTemplateRegionItem->GetValue(), pTemplateNameItem->GetValue(), sTemplateURL );
- }
- else
+ // ensure the descriptor contains a referrer
+ if ( !aDescriptor.has( "Referer" ) )
+ aDescriptor.put( "Referer", ::rtl::OUString() );
+
+ // TODO: is this needed? finally, when loading is successfull, then there should be no need for this item,
+ // as the document can always obtain its frame. In particular, there might be situations where this frame
+ // is accessed, but already disposed: Imagine the user loading a document, opening a second view on it, and
+ // then closing the first view/frame.
+ aDescriptor.put( "Frame", _rTargetFrame );
+
+ // did the caller already pass a model?
+ Reference< XModel2 > xModel = aDescriptor.getOrDefault( "Model", Reference< XModel2 >() );
+ const bool bExternalModel = xModel.is();
+
+ // check for factory URLs to create a new doc, instead of loading one
+ const ::rtl::OUString sURL = aDescriptor.getOrDefault( "URL", ::rtl::OUString() );
+ const bool bIsFactoryURL = ( sURL.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "private:factory/" ) ) == 0 );
+ bool bInitNewModel = bIsFactoryURL;
+ if ( bIsFactoryURL && !bExternalModel )
+ {
+ const ::rtl::OUString sFactory = sURL.copy( sizeof( "private:factory/" ) -1 );
+ // special handling for some weird factory URLs a la private:factory/swriter?slot=21053
+ const USHORT nSlotParam = impl_findSlotParam( sFactory );
+ if ( nSlotParam != 0 )
{
- sTemplateURL = SfxObjectFactory::GetStandardTemplate( aServiceName );
+ return impl_createNewDocWithSlotParam( nSlotParam, _rTargetFrame, aDescriptor.getOrDefault( "Hidden", false ) );
}
- BOOL bUseTemplate = (sTemplateURL.Len()>0);
- if( bUseTemplate )
+ const bool bDescribesValidTemplate = impl_determineTemplateDocument( aDescriptor );
+ if ( bDescribesValidTemplate )
{
- // #i21583#
- // Forget the filter, which was detected for the corresponding "private:factory/xxx" URL.
- // We must use the right filter, matching to this document ... not to the private URL!
- const SfxFilter* pTemplateFilter = impl_detectFilterForURL(sTemplateURL, rArgs, rMatcher);
- if (pTemplateFilter)
- {
- pFilter = pTemplateFilter;
- aFilterName = pTemplateFilter->GetName();
- // standard template set -> load it "AsTemplate"
- aSet.Put( SfxStringItem ( SID_FILE_NAME, sTemplateURL ) );
- aSet.Put( SfxBoolItem( SID_TEMPLATE, sal_True ) );
- }
-
- // #119268#
- // something is wrong with the set default template (e.g. unknown format, missing file etcpp)
- // The we have to jump into the following special code, where "private:factory/ URL's are handled.
- // We cant "load" such private/factory URL's!
- else
- bUseTemplate = FALSE;
+ // if the media descriptor allowed us to determine a template document to create the new document
+ // from, then do not init a new document model from scratch (below), but instead load the
+ // template document
+ bInitNewModel = false;
}
-
- if ( !bUseTemplate )
+ else
{
- // execute "NewDocument" request
- /* Attention!
- #107913#
- Pointers can't be used to check if two objects are equals!
- E.g. the memory manager can reuse freed memory ...
- and then the holded copy of a pointer will point to another
- (and different!) object - may using the same type then before.
- In such case we compare one object with itself ...
- */
- SfxRequest aReq( SID_NEWDOCDIRECT, SFX_CALLMODE_SYNCHRON, aSet );
- aReq.AppendItem( SfxFrameItem( SID_DOCFRAME, pFrame ) );
- aReq.AppendItem( SfxStringItem( SID_NEWDOCDIRECT, aFact ) );
-
- if ( pDocumentTitleItem )
- aReq.AppendItem( *pDocumentTitleItem );
-
- const SfxPoolItem* pRet = pApp->NewDocDirectExec_ImplOld(aReq);
- if (pRet)
- {
- // default must be set to true, because some return values
- // cant be checked ... but indicates "success"!
- bLoadState = sal_True;
-
- // On the other side some special slots return a boolean state,
- // which can be set to FALSE.
- SfxBoolItem *pItem = PTR_CAST( SfxBoolItem, pRet );
- if (pItem)
- bLoadState = pItem->GetValue();
- }
- else
- bLoadState = sal_False;
-
- if ( !bLoadState && bFrameCreated && wFrame && !wFrame->GetCurrentDocument() )
- {
- css::uno::Reference< css::frame::XFrame > axFrame;
- wFrame->SetFrameInterface_Impl( axFrame );
- wFrame->DoClose();
- }
-
- xFrame.clear();
- xListener.clear();
- return bLoadState;
+ const ::rtl::OUString sServiceName = SfxObjectShell::GetServiceNameFromFactory( sFactory );
+ aDescriptor.put( "DocumentService", sServiceName );
}
}
else
{
- // load the desired file
- aSet.Put( SfxStringItem ( SID_FILE_NAME, rURL ) );
+ // compatibility
+ aDescriptor.put( "FileName", aDescriptor.get( "URL" ) );
}
- aSet.Put( SfxFrameItem( SID_DOCFRAME, pFrame ) );
- aSet.Put( SfxUnoAnyItem( SID_FILLFRAME, css::uno::makeAny(xFrame) ) );
- aSet.Put( SfxStringItem( SID_FILTER_NAME, aFilterName ) );
-
- // !TODO: replace by direct construction of model (needs view factory)
- DBG_ASSERT( pFilter, "No filter set!" );
- if ( !pFilter )
- return sal_False;
-
- sal_Bool bDisaster = sal_False;
- SfxObjectShell* pDoc = SfxObjectShell::CreateObject( pFilter->GetServiceName() );
- if ( pDoc )
+ sal_Bool bLoadSuccess = sal_False;
+ try
{
- css::uno::Reference< css::frame::XLoadable > xLoadable = css::uno::Reference< css::frame::XLoadable >( pDoc->GetModel(), css::uno::UNO_QUERY );
- css::uno::Sequence < css::beans::PropertyValue > aLoadArgs;
- TransformItems( SID_OPENDOC, aSet, aLoadArgs );
- try
+ // extract view releant arguments from the loader args
+ ::comphelper::NamedValueCollection aViewCreationArgs( impl_extractViewCreationArgs( aDescriptor ) );
+
+ // no model passed from outside? => create one from scratch
+ if ( !xModel.is() )
{
- xLoadable->load( aLoadArgs );
-
- SfxMedium* pDocMedium = pDoc->GetMedium();
- BOOL bHidden = FALSE;
- SFX_ITEMSET_ARG( pDocMedium->GetItemSet(), pHidItem, SfxBoolItem, SID_HIDDEN, sal_False);
- if ( pHidItem )
- bHidden = pHidItem->GetValue();
-
- // !TODO: will be done by Framework!
- pDocMedium->SetUpdatePickList( !bHidden );
-
- /*
- #121119#
- We dont know why pFrame can be corrupt here.
- But if it was deleted it shouldnt exists inside our global list.
- May be we can use the damaged pointer to detect if it was removed from
- this global list.
- */
- SfxFrame* pTmp=0;
- for ( pTmp = SfxFrame::GetFirst(); pTmp; pTmp = SfxFrame::GetNext( *pTmp ) )
+ // beforehand, determine the filter to use, and update the descriptor with its information
+ if ( !bInitNewModel )
{
- if ( pFrame == pTmp )
- break;
+ impl_determineFilter( aDescriptor );
}
- if ( pTmp == pFrame )
+ // create the new doc
+ const ::rtl::OUString sServiceName = aDescriptor.getOrDefault( "DocumentService", ::rtl::OUString() );
+ xModel.set( m_aContext.createComponent( sServiceName ), UNO_QUERY_THROW );
+
+ // load resp. init it
+ const Reference< XLoadable > xLoadable( xModel, UNO_QUERY_THROW );
+ if ( bInitNewModel )
{
- // !TODO: replace by ViewFactory
- if ( pFrame->GetFrameInterface()->getController().is() )
- {
- // remove old component
- // if a frame was created already, it can't be an SfxComponent!
- // pFrame->GetFrameInterface()->setComponent( 0, 0 );
- if ( !bFrameCreated )
- pFrame = SfxTopFrame::Create( rFrame );
- }
-
- wFrame = pFrame;
- aSet.Put( SfxFrameItem( SID_DOCFRAME, pFrame ) );
- if( pFrame->InsertDocument( pDoc ) )
- {
- pFrame->GetCurrentViewFrame()->UpdateDocument_Impl();
- String aURL = pDoc->GetMedium()->GetName();
- SFX_APP()->Broadcast( SfxStringHint( SID_OPENURL, aURL ) );
- bLoadState = sal_True;
- }
- else
- bDisaster = sal_True;
+ xLoadable->initNew();
+
+ impl_removeLoaderArguments( aDescriptor );
+ xModel->attachResource( ::rtl::OUString(), aDescriptor.getPropertyValues() );
}
else
{
- DBG_ERROR("#121119# You found the reason for a stacktrace! Frame destroyed while loading document.");
- bLoadState = sal_False;
+ xLoadable->load( aDescriptor.getPropertyValues() );
}
}
- catch ( css::uno::Exception& )
+ else
{
- bDisaster = sal_True;
+ // tell the doc its (current) load args.
+ impl_removeLoaderArguments( aDescriptor );
+ xModel->attachResource( xModel->getURL(), aDescriptor.getPropertyValues() );
+ // TODO: not sure this is correct. The original, pre-refactoring code did it this way. However, I could
+ // imagine scenarios where it is *not* correct to overrule the *existing* model args (XModel::getArgs)
+ // with the ones passed to the loader here. For instance, what about the MacroExecutionMode? The document
+ // might have a mode other than the one passed to the loader, and we always overwrite the former with
+ // the latter.
}
- if ( bDisaster )
- {
- if ( wFrame && !wFrame->GetCurrentDocument() )
- {
- // document loading was not successful; close SfxFrame (but not XFrame!)
- css::uno::Reference< css::frame::XFrame > axFrame;
- wFrame->SetFrameInterface_Impl( axFrame );
- wFrame->DoClose();
- aSet.ClearItem( SID_DOCFRAME );
- }
+ // get the SfxObjectShell (still needed at the moment)
+ const SfxObjectShellLock xDoc = impl_findObjectShell( xModel );
+ ENSURE_OR_THROW( xDoc.Is(), "no SfxObjectShell for the given model" );
+
+ // ensure the ID of the to-be-created view is in the descriptor, if possible
+ const sal_Int16 nViewId = impl_determineEffectiveViewId_nothrow( *xDoc, aDescriptor );
+ const sal_Int16 nViewNo = xDoc->GetFactory().GetViewNo_Impl( nViewId, 0 );
+ const ::rtl::OUString sViewName( xDoc->GetFactory().GetViewFactory( nViewNo ).GetViewName() );
+
+ // if the document is created hidden, prevent it from being deleted until it is shown or disposed
+ impl_lockHiddenDocument( *xDoc, aDescriptor );
+ // TODO; if we wouldn't use a SfxObjectShellLock instance for xDoc, but a simple SfxObjectShellRef,
+ // then this would not be necessary, /me thinks. That is, the *Lock classes inc/dec a "Lock" counter
+ // (additional to the ref counter) in their ctor/dtor, and if the lock counter goes to 0, the
+ // object is closed (DoClose). The impl_lockHiddenDocument is to prevent exactly that premature
+ // closing. However, a *Ref object wouldn't close, anyway. And in case of unsuccessfull loading, the
+ // code at the very end of this method cares for closing the XModel, which should also close the
+ // ObjectShell.
+
+ // plug the document into the frame
+ impl_createDocumentView( xModel, _rTargetFrame, aViewCreationArgs, sViewName );
+ bLoadSuccess = sal_True;
+ }
+ catch ( Exception& )
+ {
+ const Any aError( ::cppu::getCaughtException() );
+ if ( !aDescriptor.getOrDefault( "Silent", sal_False ) )
+ impl_handleCaughtError_nothrow( aError, aDescriptor );
+ }
- css::uno::Reference< css::util::XCloseable > xCloseable( xLoadable, css::uno::UNO_QUERY );
- if ( xCloseable.is() )
- {
- try {
- xCloseable->close( sal_True );
- } catch ( css::uno::Exception& )
- {}
- }
+ // if loading was not successful, close the document
+ if ( !bLoadSuccess && !bExternalModel )
+ {
+ try
+ {
+ const Reference< XCloseable > xCloseable( xModel, UNO_QUERY_THROW );
+ xCloseable->close( sal_True );
+ }
+ catch ( Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
}
}
- xFrame.clear();
- xListener.clear();
- return bLoadState;
+ return bLoadSuccess;
}
-void SfxFrameLoader_Impl::cancel() throw( RUNTIME_EXCEPTION )
+void SfxFrameLoader_Impl::cancel() throw( RuntimeException )
{
}
SFX_IMPL_SINGLEFACTORY( SfxFrameLoader_Impl )
/* XServiceInfo */
-UNOOUSTRING SAL_CALL SfxFrameLoader_Impl::getImplementationName() throw( UNORUNTIMEEXCEPTION )
+UNOOUSTRING SAL_CALL SfxFrameLoader_Impl::getImplementationName() throw( RuntimeException )
{
return impl_getStaticImplementationName();
}
\
/* XServiceInfo */
-sal_Bool SAL_CALL SfxFrameLoader_Impl::supportsService( const UNOOUSTRING& sServiceName ) throw( UNORUNTIMEEXCEPTION )
+sal_Bool SAL_CALL SfxFrameLoader_Impl::supportsService( const UNOOUSTRING& sServiceName ) throw( RuntimeException )
{
UNOSEQUENCE< UNOOUSTRING > seqServiceNames = getSupportedServiceNames();
const UNOOUSTRING* pArray = seqServiceNames.getConstArray();
@@ -616,7 +718,7 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::supportsService( const UNOOUSTRING& sServ
}
/* XServiceInfo */
-UNOSEQUENCE< UNOOUSTRING > SAL_CALL SfxFrameLoader_Impl::getSupportedServiceNames() throw( UNORUNTIMEEXCEPTION )
+UNOSEQUENCE< UNOOUSTRING > SAL_CALL SfxFrameLoader_Impl::getSupportedServiceNames() throw( RuntimeException )
{
return impl_getStaticSupportedServiceNames();
}
diff --git a/sfx2/source/view/impframe.cxx b/sfx2/source/view/impframe.cxx
deleted file mode 100644
index 5991d999d9..0000000000
--- a/sfx2/source/view/impframe.cxx
+++ /dev/null
@@ -1,55 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General 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_sfx2.hxx"
-
-#ifndef GCC
-#endif
-
-#include "impframe.hxx"
-
-#include <svl/smplhint.hxx>
-
-#include <sfx2/frame.hxx>
-#include <sfx2/bindings.hxx>
-#include <sfx2/viewfrm.hxx>
-
-void SfxFrame_Impl::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
-{
- SfxSimpleHint* pHint = PTR_CAST( SfxSimpleHint, &rHint );
- if( pHint && pHint->GetId() == SFX_HINT_CANCELLABLE && pCurrentViewFrame )
- {
- // vom Cancel-Manager
- SfxBindings &rBind = pCurrentViewFrame->GetBindings();
- rBind.Invalidate( SID_BROWSE_STOP );
- if ( !rBind.IsInRegistrations() )
- rBind.Update( SID_BROWSE_STOP );
- rBind.Invalidate( SID_BROWSE_STOP );
- }
-}
-
diff --git a/sfx2/source/view/impframe.hxx b/sfx2/source/view/impframe.hxx
index ec0c899ccf..b327bce801 100644
--- a/sfx2/source/view/impframe.hxx
+++ b/sfx2/source/view/impframe.hxx
@@ -28,8 +28,6 @@
#ifndef _SFX_IMPFRAME_HXX
#define _SFX_IMPFRAME_HXX
-#include <svl/cancel.hxx>
-
#include <sfx2/frame.hxx>
#include <sfx2/viewfrm.hxx> // SvBorder
@@ -51,60 +49,51 @@ class SfxObjectShell;
#define FRAME_SEARCH_CREATE 0x00000008
#endif
-class SfxFrame_Impl : public SfxBroadcaster, public SvCompatWeakBase, public SfxListener
+class SfxFrame_Impl : public SfxBroadcaster, public SvCompatWeakBase
{
-friend class SfxFrame;
-
+public:
::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > xFrame;
- String aFrameIdName;
sal_uInt32 nType;
- sal_uInt32 nHistoryPos;
SfxViewFrame* pCurrentViewFrame;
- SfxObjectShell* pCurrentObjectShell;
SfxFrameDescriptor* pDescr;
- sal_uInt16 nFrameId;
sal_uInt16 nLocks;
- sal_Bool bCloseOnUnlock : 1;
sal_Bool bClosing : 1;
sal_Bool bPrepClosing : 1;
sal_Bool bInCancelTransfers : 1;
sal_Bool bOwnsBindings : 1;
sal_Bool bReleasingComponent : 1;
- sal_Bool bFocusLocked : 1;
sal_Bool bInPlace : 1;
- SfxCancelManager* pCancelMgr;
- SfxCancellable* pLoadCancellable;
SfxFrame* pFrame;
- const SfxItemSet* pSet;
SfxWorkWindow* pWorkWin;
SvBorder aBorder;
+ // formerly SfxTopFrame
+ Window* pExternalContainerWindow;
+ bool bHidden;
+ bool bLockResize;
+ bool bMenuBarOn;
- SfxFrame_Impl( SfxFrame* pAntiImplP ) :
- SvCompatWeakBase( pAntiImplP ),
- nType( 0L ),
- nHistoryPos( 0 ),
- pCurrentViewFrame( NULL ),
- pCurrentObjectShell( NULL ),
- pDescr( NULL ),
- nFrameId( 0 ),
- nLocks( 0 ),
- bCloseOnUnlock( sal_False ),
- bClosing(sal_False),
- bPrepClosing(sal_False),
- bInCancelTransfers( sal_False ),
- bOwnsBindings( sal_False ),
- bReleasingComponent( sal_False ),
- bFocusLocked( sal_False ),
- bInPlace( sal_False ),
- pCancelMgr( 0 ),
- pLoadCancellable( 0 ),
- pFrame( pAntiImplP ),
- pSet( 0 ),
- pWorkWin( 0 )
- {}
+ SfxFrame_Impl( SfxFrame* pAntiImplP )
+ :SvCompatWeakBase( pAntiImplP )
+ ,nType( 0L )
+ ,pCurrentViewFrame( NULL )
+ ,pDescr( NULL )
+ ,nLocks( 0 )
+ ,bClosing(sal_False)
+ ,bPrepClosing(sal_False)
+ ,bInCancelTransfers( sal_False )
+ ,bOwnsBindings( sal_False )
+ ,bReleasingComponent( sal_False )
+ ,bInPlace( sal_False )
+ ,pFrame( pAntiImplP )
+ ,pWorkWin( 0 )
+ ,pExternalContainerWindow( NULL )
+ ,bHidden( false )
+ ,bLockResize( false )
+ ,bMenuBarOn( true )
+ {
+ }
- virtual ~SfxFrame_Impl() { delete pCancelMgr; delete pLoadCancellable; }
- virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
+ virtual ~SfxFrame_Impl() { }
};
#endif
diff --git a/sfx2/source/view/impviewframe.hxx b/sfx2/source/view/impviewframe.hxx
new file mode 100644
index 0000000000..6d5326f887
--- /dev/null
+++ b/sfx2/source/view/impviewframe.hxx
@@ -0,0 +1,94 @@
+/*************************************************************************
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2009 by Sun Microsystems, Inc.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+************************************************************************/
+
+#ifndef SFX2_IMPVIEWFRAME_HXX
+#define SFX2_IMPVIEWFRAME_HXX
+
+#include "sfx2/viewfrm.hxx"
+
+#include <svtools/asynclink.hxx>
+#include <vcl/window.hxx>
+
+struct SfxViewFrame_Impl
+{
+ SvBorder aBorder;
+ Size aMargin;
+ Size aSize;
+ String aFrameTitle;
+ TypeId aLastType;
+ String aActualURL;
+ SfxFrame& rFrame;
+ svtools::AsynchronLink* pReloader;
+ Window* pWindow;
+ SfxViewFrame* pActiveChild;
+ Window* pFocusWin;
+ sal_uInt16 nDocViewNo;
+ sal_uInt16 nCurViewId;
+ sal_Bool bResizeInToOut:1;
+ sal_Bool bDontOverwriteResizeInToOut:1;
+ sal_Bool bObjLocked:1;
+ sal_Bool bReloading:1;
+ sal_Bool bIsDowning:1;
+ sal_Bool bModal:1;
+ sal_Bool bEnabled:1;
+ sal_Bool bWindowWasEnabled:1;
+ sal_Bool bActive;
+ String aFactoryName;
+
+ SfxViewFrame_Impl( SfxFrame& i_rFrame )
+ : rFrame( i_rFrame )
+ , pReloader(0 )
+ , pWindow( 0 )
+ , bWindowWasEnabled(sal_True)
+ , bActive( sal_False )
+ {
+ }
+
+ ~SfxViewFrame_Impl()
+ {
+ delete pReloader;
+ }
+};
+
+class SfxFrameViewWindow_Impl : public Window
+{
+ BOOL bActive;
+ SfxViewFrame* pFrame;
+
+public:
+ SfxFrameViewWindow_Impl( SfxViewFrame* p, Window& rParent, WinBits nBits=0 ) :
+ Window( &rParent, nBits | WB_BORDER | WB_CLIPCHILDREN ),
+ bActive( FALSE ),
+ pFrame( p )
+ {
+ p->GetFrame().GetWindow().SetBorderStyle( WINDOW_BORDER_NOBORDER );
+ }
+
+ virtual void Resize();
+ virtual void StateChanged( StateChangedType nStateChange );
+};
+
+#endif // SFX2_IMPVIEWFRAME_HXX
+
diff --git a/sfx2/source/view/ipclient.cxx b/sfx2/source/view/ipclient.cxx
index f5ff279a43..eb41088cd1 100644
--- a/sfx2/source/view/ipclient.cxx
+++ b/sfx2/source/view/ipclient.cxx
@@ -57,7 +57,7 @@
#include <sfx2/dispatch.hxx>
#include "workwin.hxx"
#include "guisaveas.hxx"
-#include <sfx2/topfrm.hxx>
+#include <sfx2/viewfrm.hxx>
#include <cppuhelper/implbase5.hxx>
#include <vcl/salbtype.hxx>
#include <svtools/ehdl.hxx>
@@ -201,7 +201,7 @@ throw (::com::sun::star::uno::RuntimeException)
// currently needs SFX code
SfxObjectShell* pDoc = reinterpret_cast< SfxObjectShell* >( sal::static_int_cast< sal_IntPtr >( nHandle ));
SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDoc );
- SfxWorkWindow *pWorkWin = pFrame->GetFrame()->GetWorkWindow_Impl();
+ SfxWorkWindow *pWorkWin = pFrame->GetFrame().GetWorkWindow_Impl();
pWorkWin->UpdateObjectBars_Impl();
}
*/
@@ -231,7 +231,7 @@ uno::Reference < frame::XFrame > SfxInPlaceClient_Impl::GetFrame() const
{
if ( !m_pClient )
throw uno::RuntimeException();
- return m_pClient->GetViewShell()->GetViewFrame()->GetFrame()->GetFrameInterface();
+ return m_pClient->GetViewShell()->GetViewFrame()->GetFrame().GetFrameInterface();
}
void SAL_CALL SfxInPlaceClient_Impl::saveObject()
@@ -733,7 +733,7 @@ void SfxInPlaceClient::SetObject( const uno::Reference < embed::XEmbeddedObject
}
}
- if ( !m_pViewSh || m_pViewSh->GetViewFrame()->GetFrame()->IsClosing_Impl() )
+ if ( !m_pViewSh || m_pViewSh->GetViewFrame()->GetFrame().IsClosing_Impl() )
// sometimes applications reconnect clients on shutting down because it happens in their Paint methods
return;
@@ -983,7 +983,7 @@ ErrCode SfxInPlaceClient::DoVerb( long nVerb )
{
if ( m_pViewSh )
- ((SfxTopFrame*)m_pViewSh->GetViewFrame()->GetTopFrame())->LockResize_Impl(TRUE);
+ m_pViewSh->GetViewFrame()->GetTopFrame().LockResize_Impl(TRUE);
try
{
m_pImp->m_xObject->setClientSite( m_pImp->m_xClient );
@@ -1033,8 +1033,8 @@ ErrCode SfxInPlaceClient::DoVerb( long nVerb )
if ( m_pViewSh )
{
SfxViewFrame* pFrame = m_pViewSh->GetViewFrame();
- ((SfxTopFrame*)pFrame->GetTopFrame())->LockResize_Impl(FALSE);
- pFrame->GetTopFrame()->Resize();
+ pFrame->GetTopFrame().LockResize_Impl(FALSE);
+ pFrame->GetTopFrame().Resize();
}
}
}
@@ -1094,7 +1094,7 @@ void SfxInPlaceClient::DeactivateObject()
}
if ( m_pViewSh )
- ((SfxTopFrame*)m_pViewSh->GetViewFrame()->GetTopFrame())->LockResize_Impl(TRUE);
+ m_pViewSh->GetViewFrame()->GetTopFrame().LockResize_Impl(TRUE);
if ( m_pImp->m_xObject->getStatus( m_pImp->m_nAspect ) & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE )
{
@@ -1116,8 +1116,8 @@ void SfxInPlaceClient::DeactivateObject()
{
SfxViewFrame* pFrame = m_pViewSh->GetViewFrame();
SfxViewFrame::SetViewFrame( pFrame );
- ((SfxTopFrame*)pFrame->GetTopFrame())->LockResize_Impl(FALSE);
- pFrame->GetTopFrame()->Resize();
+ pFrame->GetTopFrame().LockResize_Impl(FALSE);
+ pFrame->GetTopFrame().Resize();
}
}
catch (com::sun::star::uno::Exception& )
diff --git a/sfx2/source/view/makefile.mk b/sfx2/source/view/makefile.mk
index 758fd5ccb8..9c257f4c9f 100644
--- a/sfx2/source/view/makefile.mk
+++ b/sfx2/source/view/makefile.mk
@@ -45,17 +45,17 @@ SRC1FILES = \
view.src
SLOFILES = \
- $(SLO)$/ipclient.obj \
+ $(SLO)$/ipclient.obj \
$(SLO)$/viewsh.obj \
$(SLO)$/frmload.obj \
$(SLO)$/frame.obj \
+ $(SLO)$/frame2.obj \
$(SLO)$/printer.obj \
$(SLO)$/viewprn.obj \
$(SLO)$/viewfac.obj \
$(SLO)$/orgmgr.obj \
$(SLO)$/viewfrm.obj \
- $(SLO)$/impframe.obj \
- $(SLO)$/topfrm.obj \
+ $(SLO)$/viewfrm2.obj \
$(SLO)$/sfxbasecontroller.obj \
$(SLO)$/userinputinterception.obj
diff --git a/sfx2/source/view/prnmon.cxx b/sfx2/source/view/prnmon.cxx
index 0b3be9253d..d84e4a006e 100644
--- a/sfx2/source/view/prnmon.cxx
+++ b/sfx2/source/view/prnmon.cxx
@@ -319,7 +319,7 @@ SfxPrintProgress::~SfxPrintProgress()
pImp->pViewShell->GetPrinter()->EnablePrintFile( pImp->bOldEnablePrintFile );
// EndPrint-Notification an Frame
- //pImp->pViewShell->GetViewFrame()->GetFrame()->Lock_Impl(FALSE);
+ //pImp->pViewShell->GetViewFrame()->GetFrame().Lock_Impl(FALSE);
pImp->EndListening( *(pImp->pViewShell->GetObjectShell()) );
// the following call might destroy the view or even the document
diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx
index 47d978cc96..339e1bfcad 100644
--- a/sfx2/source/view/sfxbasecontroller.cxx
+++ b/sfx2/source/view/sfxbasecontroller.cxx
@@ -46,6 +46,7 @@
#include <com/sun/star/util/XCloseBroadcaster.hpp>
#include <com/sun/star/util/XCloseListener.hpp>
#include <com/sun/star/util/CloseVetoException.hpp>
+#include <com/sun/star/document/XViewDataSupplier.hpp>
#include <cppuhelper/implbase1.hxx>
#include <cppuhelper/implbase2.hxx>
#include <com/sun/star/frame/FrameActionEvent.hpp>
@@ -53,15 +54,18 @@
#include <com/sun/star/frame/CommandGroup.hpp>
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/frame/XBorderResizeListener.hpp>
+#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/lang/EventObject.hpp>
#include <com/sun/star/lang/XEventListener.hpp>
#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
#include <cppuhelper/interfacecontainer.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <cppuhelper/implbase1.hxx>
#include <basic/sbstar.hxx>
#include <uno/mapping.hxx>
#include <sfx2/viewsh.hxx>
+#include <sfx2/docfac.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/app.hxx>
@@ -84,10 +88,12 @@
#include <toolkit/helper/convert.hxx>
#include <framework/titlehelper.hxx>
#include <comphelper/processfactory.hxx>
+#include <tools/diagnose_ex.h>
#include <hash_map>
#include <sfx2/event.hxx>
+#include "viewfac.hxx"
#define OMULTITYPEINTERFACECONTAINERHELPER ::cppu::OMultiTypeInterfaceContainerHelper
#define OINTERFACECONTAINERHELPER ::cppu::OInterfaceContainerHelper
@@ -109,6 +115,24 @@
#define TIMEOUT_START_RESCHEDULE 10L /* 10th s */
using namespace ::com::sun::star;
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::RuntimeException;
+using ::com::sun::star::uno::UNO_QUERY_THROW;
+using ::com::sun::star::lang::DisposedException;
+using ::com::sun::star::awt::XWindow;
+using ::com::sun::star::frame::XController;
+using ::com::sun::star::frame::XDispatchProvider;
+using ::com::sun::star::document::XViewDataSupplier;
+using ::com::sun::star::container::XIndexAccess;
+using ::com::sun::star::beans::PropertyValue;
+using ::com::sun::star::uno::Sequence;
+using ::com::sun::star::uno::UNO_QUERY;
+using ::com::sun::star::uno::Exception;
+using ::com::sun::star::frame::XFrame;
+using ::com::sun::star::frame::XFrameActionListener;
+using ::com::sun::star::util::XCloseListener;
+using ::com::sun::star::task::XStatusIndicator;
+using ::com::sun::star::frame::XTitle;
namespace css = ::com::sun::star;
struct GroupIDToCommandGroup
@@ -220,7 +244,7 @@ void reschedule()
class SfxStatusIndicator : public ::cppu::WeakImplHelper2< ::com::sun::star::task::XStatusIndicator, ::com::sun::star::lang::XEventListener >
{
friend class SfxBaseController;
- ::com::sun::star::uno::Reference < XCONTROLLER > xOwner;
+ ::com::sun::star::uno::Reference < XController > xOwner;
::com::sun::star::uno::Reference < ::com::sun::star::task::XStatusIndicator > xProgress;
SfxWorkWindow* pWorkWindow;
sal_Int32 _nRange;
@@ -427,29 +451,19 @@ void SAL_CALL IMPL_SfxBaseController_CloseListenerHelper::notifyClosing( const E
struct IMPL_SfxBaseController_DataContainer
{
- REFERENCE < XFRAME > m_xFrame;
- REFERENCE < XFRAMEACTIONLISTENER > m_xListener ;
- REFERENCE < XCLOSELISTENER > m_xCloseListener ;
+ Reference< XFrame > m_xFrame ;
+ Reference< XFrameActionListener > m_xListener ;
+ Reference< XCloseListener > m_xCloseListener ;
::sfx2::UserInputInterception m_aUserInputInterception;
OMULTITYPEINTERFACECONTAINERHELPER m_aListenerContainer ;
- OINTERFACECONTAINERHELPER m_aInterceptorContainer ;
- REFERENCE < ::com::sun::star::task::XStatusIndicator > m_xIndicator;
+ OINTERFACECONTAINERHELPER m_aInterceptorContainer ;
+ Reference< XStatusIndicator > m_xIndicator ;
SfxViewShell* m_pViewShell ;
SfxBaseController* m_pController ;
sal_Bool m_bDisposing ;
- sal_Bool m_bSuspendState;
- /** When this flag is <true/> (the default) then in dispose() the frame
- and with it the view shell are released together with the
- controller.
- A derived class can set the flag to <false/> when it wants to
- exchange controllers that work on the same view shell. One
- application is the Impress Multi Pane GUI that changes shells that
- are stacked on one view shell. Controllers are associated with the
- stacked shells and thus must not destroy the view shell which is not
- affected by the switching.
- */
- sal_Bool m_bIsFrameReleasedWithController;
- css::uno::Reference< css::frame::XTitle > m_xTitleHelper;
+ sal_Bool m_bSuspendState ;
+ Reference< XTitle > m_xTitleHelper ;
+ Sequence< PropertyValue > m_aCreationArgs ;
IMPL_SfxBaseController_DataContainer( MUTEX& aMutex ,
SfxViewShell* pViewShell ,
@@ -463,7 +477,6 @@ struct IMPL_SfxBaseController_DataContainer
, m_pController ( pController )
, m_bDisposing ( sal_False )
, m_bSuspendState ( sal_False )
- , m_bIsFrameReleasedWithController( sal_True )
{
}
@@ -525,8 +538,7 @@ void SAL_CALL IMPL_SfxBaseController_ListenerHelper::disposing( const EVENTOBJEC
//________________________________________________________________________________________________________
DBG_NAME(sfx2_SfxBaseController)
SfxBaseController::SfxBaseController( SfxViewShell* pViewShell )
- : IMPL_SfxBaseController_MutexContainer ( )
- , m_pData ( new IMPL_SfxBaseController_DataContainer( m_aMutex, pViewShell, this ))
+ : m_pData ( new IMPL_SfxBaseController_DataContainer( m_aMutex, pViewShell, this ))
{
DBG_CTOR(sfx2_SfxBaseController,NULL);
m_pData->m_pViewShell->SetController( this );
@@ -543,138 +555,60 @@ SfxBaseController::~SfxBaseController()
}
//________________________________________________________________________________________________________
-// SfxBaseController -> XInterface
-//________________________________________________________________________________________________________
-ANY SAL_CALL SfxBaseController::queryInterface( const UNOTYPE& rType ) throw( RUNTIMEEXCEPTION )
-{
- // Attention:
- // Don't use mutex or guard in this method!!! Is a method of XInterface.
-
- // Ask for my own supported interfaces ...
- ANY aReturn( ::cppu::queryInterface( rType ,
- static_cast< XTYPEPROVIDER* > ( this ) ,
- static_cast< XCOMPONENT* > ( this ) ,
- static_cast< XCONTROLLER* > ( this ) ,
- static_cast< XCONTROLLERBORDER* > ( this ) ,
- static_cast< XUSERINPUTINTERCEPTION* > ( this ) ,
- static_cast< XSTATUSINDICATORSUPPLIER* > ( this ) ,
- static_cast< XCONTEXTMENUINTERCEPTION* > ( this ) ,
- static_cast< XDISPATCHPROVIDER* > ( this ),
- static_cast< XTITLE* > ( this ),
- static_cast< XTITLECHANGEBROADCASTER* > ( this ),
- static_cast< XDISPATCHINFORMATIONPROVIDER* > ( this ) ) ) ;
-
- // If searched interface supported by this class ...
- if ( aReturn.hasValue() == sal_True )
- {
- // ... return this information.
- return aReturn ;
- }
- else
- {
- // Else; ... ask baseclass for interfaces!
- return OWeakObject::queryInterface( rType ) ;
- }
-}
-
-//________________________________________________________________________________________________________
-// SfxBaseController -> XInterface
-//________________________________________________________________________________________________________
-
-void SAL_CALL SfxBaseController::acquire() throw()
-{
- // Attention:
- // Don't use mutex or guard in this method!!! Is a method of XInterface.
-
- // Forward to baseclass
- OWeakObject::acquire() ;
-}
-
-//________________________________________________________________________________________________________
-// SfxBaseController -> XInterface
+// SfxBaseController -> XController2
//________________________________________________________________________________________________________
-void SAL_CALL SfxBaseController::release() throw()
+Reference< XWindow > SAL_CALL SfxBaseController::getComponentWindow() throw (RuntimeException)
{
- // Attention:
- // Don't use mutex or guard in this method!!! Is a method of XInterface.
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if ( !m_pData->m_pViewShell )
+ throw DisposedException();
- // Forward to baseclass
- OWeakObject::release() ;
+ return Reference< XWindow >( GetViewFrame_Impl().GetFrame().GetWindow().GetComponentInterface(), UNO_QUERY_THROW );
}
-//________________________________________________________________________________________________________
-// SfxBaseController -> XTypeProvider
-//________________________________________________________________________________________________________
-
-SEQUENCE< UNOTYPE > SAL_CALL SfxBaseController::getTypes() throw( RUNTIMEEXCEPTION )
+::rtl::OUString SAL_CALL SfxBaseController::getViewControllerName() throw (RuntimeException)
{
- // Optimize this method !
- // We initialize a static variable only one time. And we don't must use a mutex at every call!
- // For the first call; pTypeCollection is NULL - for the second call pTypeCollection is different from NULL!
- static OTYPECOLLECTION* pTypeCollection = NULL ;
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if ( !m_pData->m_pViewShell || !m_pData->m_pViewShell->GetObjectShell() )
+ throw DisposedException();
- if ( pTypeCollection == NULL )
- {
- // Ready for multithreading; get global mutex for first call of this method only! see before
- MUTEXGUARD aGuard( MUTEX::getGlobalMutex() ) ;
+ const SfxObjectFactory& rDocFac( m_pData->m_pViewShell->GetObjectShell()->GetFactory() );
+ sal_uInt16 nViewNo = rDocFac.GetViewNo_Impl( GetViewFrame_Impl().GetCurViewId(), rDocFac.GetViewFactoryCount() );
+ OSL_ENSURE( nViewNo < rDocFac.GetViewFactoryCount(), "SfxBaseController::getViewControllerName: view ID not found in view factories!" );
- // Control these pointer again ... it can be, that another instance will be faster then these!
- if ( pTypeCollection == NULL )
- {
- // Create a static typecollection ...
- static OTYPECOLLECTION aTypeCollection( ::getCppuType(( const REFERENCE< XTYPEPROVIDER >*)NULL ) ,
- ::getCppuType(( const REFERENCE< XCONTROLLER >*)NULL ) ,
- ::getCppuType(( const REFERENCE< XCONTROLLERBORDER >*)NULL ) ,
- ::getCppuType(( const REFERENCE< XDISPATCHPROVIDER >*)NULL ) ,
- ::getCppuType(( const REFERENCE< XSTATUSINDICATORSUPPLIER >*)NULL ) ,
- ::getCppuType(( const REFERENCE< XCONTEXTMENUINTERCEPTION >*)NULL ) ,
- ::getCppuType(( const REFERENCE< XUSERINPUTINTERCEPTION >*)NULL ) ,
- ::getCppuType(( const REFERENCE< XTITLE >*)NULL ) ,
- ::getCppuType(( const REFERENCE< XTITLECHANGEBROADCASTER >*)NULL ) ,
- ::getCppuType(( const REFERENCE< XDISPATCHINFORMATIONPROVIDER >*)NULL ) );
- // ... and set his address to static pointer!
- pTypeCollection = &aTypeCollection ;
- }
- }
+ ::rtl::OUString sViewName;
+ if ( nViewNo < rDocFac.GetViewFactoryCount() )
+ sViewName = rDocFac.GetViewFactory( nViewNo ).GetViewName();
- return pTypeCollection->getTypes() ;
+ return sViewName;
}
-//________________________________________________________________________________________________________
-// SfxBaseController -> XTypeProvider
-//________________________________________________________________________________________________________
-
-SEQUENCE< sal_Int8 > SAL_CALL SfxBaseController::getImplementationId() throw( RUNTIMEEXCEPTION )
+Sequence< PropertyValue > SAL_CALL SfxBaseController::getCreationArguments() throw (RuntimeException)
{
- // Create one Id for all instances of this class.
- // Use ethernet address to do this! (sal_True)
-
- // Optimize this method
- // We initialize a static variable only one time. And we don't must use a mutex at every call!
- // For the first call; pID is NULL - for the second call pID is different from NULL!
- static OIMPLEMENTATIONID* pID = NULL ;
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if ( !m_pData->m_pViewShell || !m_pData->m_pViewShell->GetObjectShell() )
+ throw DisposedException();
- if ( pID == NULL )
- {
- // Ready for multithreading; get global mutex for first call of this method only! see before
- MUTEXGUARD aGuard( MUTEX::getGlobalMutex() ) ;
+ return m_pData->m_aCreationArgs;
+}
- // Control these pointer again ... it can be, that another instance will be faster then these!
- if ( pID == NULL )
- {
- // Create a new static ID ...
- static OIMPLEMENTATIONID aID( sal_False ) ;
- // ... and set his address to static pointer!
- pID = &aID ;
- }
- }
+void SfxBaseController::SetCreationArguments_Impl( const Sequence< PropertyValue >& i_rCreationArgs )
+{
+ OSL_ENSURE( m_pData->m_aCreationArgs.getLength() == 0, "SfxBaseController::SetCreationArguments_Impl: not intended to be called twice!" );
+ m_pData->m_aCreationArgs = i_rCreationArgs;
+}
- return pID->getImplementationId() ;
+SfxViewFrame& SfxBaseController::GetViewFrame_Impl() const
+{
+ ENSURE_OR_THROW( m_pData->m_pViewShell, "not to be called without a view shell" );
+ SfxViewFrame* pActFrame = m_pData->m_pViewShell->GetFrame();
+ ENSURE_OR_THROW( pActFrame, "a view shell without a view frame is pretty pathological" );
+ return *pActFrame;
}
//________________________________________________________________________________________________________
-// SfxBaseController -> XController
+// SfxBaseController -> XController2 -> XController
//________________________________________________________________________________________________________
void SAL_CALL SfxBaseController::attachFrame( const REFERENCE< XFRAME >& xFrame ) throw( ::com::sun::star::uno::RuntimeException )
@@ -701,32 +635,11 @@ void SAL_CALL SfxBaseController::attachFrame( const REFERENCE< XFRAME >& xFrame
if ( m_pData->m_pViewShell )
{
- SfxViewFrame* pActFrame = m_pData->m_pViewShell->GetFrame() ;
- pActFrame->Enable( TRUE );
- pActFrame->GetDispatcher()->Lock( FALSE );
+ ConnectSfxFrame_Impl( E_CONNECT );
- if ( ( m_pData->m_pViewShell->GetObjectShell() != NULL )
- && ( m_pData->m_pViewShell->GetObjectShell()->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
- )
- {
- SfxViewFrame* pViewFrm = m_pData->m_pViewShell->GetViewFrame();
- if ( !pViewFrm->GetFrame()->IsInPlace() )
- {
- // for outplace embedded objects, we want the layout manager to keep the content window
- // size constant, if possible
- try
- {
- uno::Reference< beans::XPropertySet > xFrameProps( m_pData->m_xFrame, uno::UNO_QUERY_THROW );
- uno::Reference< beans::XPropertySet > xLayouterProps(
- xFrameProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" ) ) ), uno::UNO_QUERY_THROW );
- xLayouterProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PreserveContentSize" ) ), uno::makeAny( sal_True ) );
- }
- catch( const uno::Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- }
- }
+ // attaching the frame to the controller is the last step in the creation of a new view, so notify this
+ SfxEventHint aHint( SFX_EVENT_VIEWCREATED, GlobalEventConfig::GetEventName( STR_EVENT_VIEWCREATED ), m_pData->m_pViewShell->GetObjectShell() );
+ SFX_APP()->NotifyEvent( aHint );
}
}
}
@@ -787,9 +700,7 @@ sal_Bool SAL_CALL SfxBaseController::suspend( sal_Bool bSuspend ) throw( ::com::
BOOL bRet = bOther || pDocShell->PrepareClose();
if ( bRet )
{
- // disable window and dispatcher until suspend call is withdrawn
- pActFrame->Enable( FALSE );
- pActFrame->GetDispatcher()->Lock( TRUE );
+ ConnectSfxFrame_Impl( E_DISCONNECT );
m_pData->m_bSuspendState = sal_True;
}
@@ -802,9 +713,7 @@ sal_Bool SAL_CALL SfxBaseController::suspend( sal_Bool bSuspend ) throw( ::com::
if ( m_pData->m_pViewShell )
{
- SfxViewFrame* pActFrame = m_pData->m_pViewShell->GetFrame() ;
- pActFrame->Enable( TRUE );
- pActFrame->GetDispatcher()->Lock( FALSE );
+ ConnectSfxFrame_Impl( E_RECONNECT );
}
m_pData->m_bSuspendState = sal_False;
@@ -893,7 +802,7 @@ REFERENCE< XDISPATCH > SAL_CALL SfxBaseController::queryDispatch( const UNOURL&
if ( xFrame.is() )
xFrame->setName( sTargetFrameName );
- REFERENCE < XDISPATCHPROVIDER > xProv( xFrame, ::com::sun::star::uno::UNO_QUERY );
+ Reference< XDispatchProvider > xProv( xFrame, ::com::sun::star::uno::UNO_QUERY );
if ( xProv.is() )
return xProv->queryDispatch( aURL, sTargetFrameName, ::com::sun::star::frame::FrameSearchFlag::SELF );
}
@@ -911,13 +820,13 @@ REFERENCE< XDISPATCH > SAL_CALL SfxBaseController::queryDispatch( const UNOURL&
pSlot = rSlotPool.GetUnoSlot( aMasterCommand );
else
pSlot = rSlotPool.GetUnoSlot( aURL.Path );
- if ( pSlot && ( !pAct->GetFrame()->IsInPlace() || !pSlot->IsMode( SFX_SLOT_CONTAINER ) ) )
+ if ( pSlot && ( !pAct->GetFrame().IsInPlace() || !pSlot->IsMode( SFX_SLOT_CONTAINER ) ) )
return pAct->GetBindings().GetDispatch( pSlot, aURL, bMasterCommand );
else
{
// try to find parent SfxViewFrame
uno::Reference< frame::XFrame > xParentFrame;
- uno::Reference< frame::XFrame > xOwnFrame = pAct->GetFrame()->GetFrameInterface();
+ uno::Reference< frame::XFrame > xOwnFrame = pAct->GetFrame().GetFrameInterface();
if ( xOwnFrame.is() )
xParentFrame = uno::Reference< frame::XFrame >( xOwnFrame->getCreator(), uno::UNO_QUERY );
@@ -932,7 +841,7 @@ REFERENCE< XDISPATCH > SAL_CALL SfxBaseController::queryDispatch( const UNOURL&
pFrame;
pFrame = SfxViewFrame::GetNext( *pFrame ) )
{
- if ( pFrame->GetFrame()->GetFrameInterface() == xParentFrame )
+ if ( pFrame->GetFrame().GetFrameInterface() == xParentFrame )
{
pParentFrame = pFrame;
break;
@@ -968,13 +877,13 @@ REFERENCE< XDISPATCH > SAL_CALL SfxBaseController::queryDispatch( const UNOURL&
SfxSlotPool& rSlotPool = SfxSlotPool::GetSlotPool( pAct );
const SfxSlot* pSlot = rSlotPool.GetSlot( nId );
- if ( pSlot && ( !pAct->GetFrame()->IsInPlace() || !pSlot->IsMode( SFX_SLOT_CONTAINER ) ) )
+ if ( pSlot && ( !pAct->GetFrame().IsInPlace() || !pSlot->IsMode( SFX_SLOT_CONTAINER ) ) )
return pAct->GetBindings().GetDispatch( pSlot, aURL, sal_False );
else
{
// try to find parent SfxViewFrame
uno::Reference< frame::XFrame > xParentFrame;
- uno::Reference< frame::XFrame > xOwnFrame = pAct->GetFrame()->GetFrameInterface();
+ uno::Reference< frame::XFrame > xOwnFrame = pAct->GetFrame().GetFrameInterface();
if ( xOwnFrame.is() )
xParentFrame = uno::Reference< frame::XFrame >( xOwnFrame->getCreator(), uno::UNO_QUERY );
@@ -989,7 +898,7 @@ REFERENCE< XDISPATCH > SAL_CALL SfxBaseController::queryDispatch( const UNOURL&
pFrame;
pFrame = SfxViewFrame::GetNext( *pFrame ) )
{
- if ( pFrame->GetFrame()->GetFrameInterface() == xParentFrame )
+ if ( pFrame->GetFrame().GetFrameInterface() == xParentFrame )
{
pParentFrame = pFrame;
break;
@@ -1123,19 +1032,14 @@ void SfxBaseController::BorderWidthsChanged_Impl()
// SfxBaseController -> XComponent
//________________________________________________________________________________________________________
-void SfxBaseController::FrameIsReleasedWithController (sal_Bool bFlag)
-{
- m_pData->m_bIsFrameReleasedWithController = bFlag;
-}
-
void SAL_CALL SfxBaseController::dispose() throw( ::com::sun::star::uno::RuntimeException )
{
::vos::OGuard aGuard( Application::GetSolarMutex() );
- REFERENCE < XCONTROLLER > xTmp( this );
+ Reference< XController > xTmp( this );
m_pData->m_bDisposing = sal_True ;
EVENTOBJECT aEventObject;
- aEventObject.Source = (XCONTROLLER*)this ;
+ aEventObject.Source = *this ;
m_pData->m_aListenerContainer.disposeAndClear( aEventObject ) ;
if ( m_pData->m_pController && m_pData->m_pController->getFrame().is() )
@@ -1144,18 +1048,15 @@ void SAL_CALL SfxBaseController::dispose() throw( ::com::sun::star::uno::Runtime
if ( m_pData->m_pViewShell )
{
SfxViewFrame* pFrame = m_pData->m_pViewShell->GetViewFrame() ;
- if (m_pData->m_bIsFrameReleasedWithController)
- {
- if ( pFrame && pFrame->GetViewShell() == m_pData->m_pViewShell )
- pFrame->GetFrame()->SetIsClosing_Impl();
- m_pData->m_pViewShell->DiscardClients_Impl();
- m_pData->m_pViewShell->pImp->bControllerSet = sal_False ;
- }
+ if ( pFrame && pFrame->GetViewShell() == m_pData->m_pViewShell )
+ pFrame->GetFrame().SetIsClosing_Impl();
+ m_pData->m_pViewShell->DiscardClients_Impl();
+ m_pData->m_pViewShell->pImp->bControllerSet = sal_False ;
if ( pFrame )
{
EVENTOBJECT aObject;
- aObject.Source = (OWEAKOBJECT*)this ;
+ aObject.Source = *this ;
SfxObjectShell* pDoc = pFrame->GetObjectShell() ;
SfxViewFrame *pView = SfxViewFrame::GetFirst(pDoc);
@@ -1167,12 +1068,9 @@ void SAL_CALL SfxBaseController::dispose() throw( ::com::sun::star::uno::Runtime
pView = SfxViewFrame::GetNext( *pView, pDoc );
}
- if ( m_pData->m_bIsFrameReleasedWithController )
- {
- SFX_APP()->NotifyEvent( SfxEventHint(SFX_EVENT_CLOSEVIEW, GlobalEventConfig::GetEventName( STR_EVENT_CLOSEVIEW ), pDoc ) );
- if ( !pView )
- SFX_APP()->NotifyEvent( SfxEventHint(SFX_EVENT_CLOSEDOC, GlobalEventConfig::GetEventName( STR_EVENT_CLOSEDOC ), pDoc) );
- }
+ SFX_APP()->NotifyEvent( SfxEventHint(SFX_EVENT_CLOSEVIEW, GlobalEventConfig::GetEventName( STR_EVENT_CLOSEVIEW ), pDoc ) );
+ if ( !pView )
+ SFX_APP()->NotifyEvent( SfxEventHint(SFX_EVENT_CLOSEDOC, GlobalEventConfig::GetEventName( STR_EVENT_CLOSEDOC ), pDoc) );
REFERENCE< XMODEL > xModel = pDoc->GetModel();
REFERENCE < ::com::sun::star::util::XCloseable > xCloseable( xModel, com::sun::star::uno::UNO_QUERY );
@@ -1189,14 +1087,13 @@ void SAL_CALL SfxBaseController::dispose() throw( ::com::sun::star::uno::Runtime
m_pData->m_xListener->disposing( aObject );
SfxViewShell *pShell = m_pData->m_pViewShell;
m_pData->m_pViewShell = NULL;
- if ( pFrame->GetViewShell() == pShell
- && m_pData->m_bIsFrameReleasedWithController)
+ if ( pFrame->GetViewShell() == pShell )
{
// Enter registrations only allowed if we are the owner!
- if ( pFrame->GetFrame()->OwnsBindings_Impl() )
+ if ( pFrame->GetFrame().OwnsBindings_Impl() )
pFrame->GetBindings().ENTERREGISTRATIONS();
- pFrame->GetFrame()->SetFrameInterface_Impl( aXFrame );
- pFrame->GetFrame()->DoClose_Impl();
+ pFrame->GetFrame().SetFrameInterface_Impl( aXFrame );
+ pFrame->GetFrame().DoClose_Impl();
}
}
}
@@ -1250,7 +1147,7 @@ SfxViewShell* SfxBaseController::GetViewShell_Impl() const
{
::vos::OGuard aGuard( Application::GetSolarMutex() );
if ( m_pData->m_pViewShell && !m_pData->m_xIndicator.is() )
- m_pData->m_xIndicator = new SfxStatusIndicator( this, m_pData->m_pViewShell->GetViewFrame()->GetFrame()->GetWorkWindow_Impl() );
+ m_pData->m_xIndicator = new SfxStatusIndicator( this, m_pData->m_pViewShell->GetViewFrame()->GetFrame().GetWorkWindow_Impl() );
return m_pData->m_xIndicator;
}
@@ -1395,6 +1292,165 @@ BOOL SfxBaseController::HasMouseClickListeners_Impl()
return m_pData->m_aUserInputInterception.hasMouseClickListeners();
}
+void SfxBaseController::ConnectSfxFrame_Impl( const ConnectSfxFrame i_eConnect )
+{
+ ENSURE_OR_THROW( m_pData->m_pViewShell, "not to be called without a view shell" );
+ SfxViewFrame* pViewFrame = m_pData->m_pViewShell->GetFrame();
+ ENSURE_OR_THROW( pViewFrame, "a view shell without a view frame is pretty pathological" );
+
+ const bool bConnect = ( i_eConnect != E_DISCONNECT );
+
+ // disable window and dispatcher
+ pViewFrame->Enable( bConnect );
+ pViewFrame->GetDispatcher()->Lock( !bConnect );
+
+ if ( bConnect )
+ {
+ if ( i_eConnect == E_CONNECT )
+ {
+ if ( ( m_pData->m_pViewShell->GetObjectShell() != NULL )
+ && ( m_pData->m_pViewShell->GetObjectShell()->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
+ )
+ {
+ SfxViewFrame* pViewFrm = m_pData->m_pViewShell->GetViewFrame();
+ if ( !pViewFrm->GetFrame().IsInPlace() )
+ {
+ // for outplace embedded objects, we want the layout manager to keep the content window
+ // size constant, if possible
+ try
+ {
+ uno::Reference< beans::XPropertySet > xFrameProps( m_pData->m_xFrame, uno::UNO_QUERY_THROW );
+ uno::Reference< beans::XPropertySet > xLayouterProps(
+ xFrameProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" ) ) ), uno::UNO_QUERY_THROW );
+ xLayouterProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PreserveContentSize" ) ), uno::makeAny( sal_True ) );
+ }
+ catch( const uno::Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+ }
+ }
+
+ // upon DISCONNECT, we did *not* pop the shells from the stack (this is done elsewhere), so upon
+ // RECONNECT, we're not allowed to push them
+ if ( i_eConnect != E_RECONNECT )
+ {
+ pViewFrame->GetDispatcher()->Push( *m_pData->m_pViewShell );
+ if ( m_pData->m_pViewShell->GetSubShell() )
+ pViewFrame->GetDispatcher()->Push( *m_pData->m_pViewShell->GetSubShell() );
+ m_pData->m_pViewShell->PushSubShells_Impl();
+ pViewFrame->GetDispatcher()->Flush();
+ }
+
+ Window* pEditWin = m_pData->m_pViewShell->GetWindow();
+ if ( pEditWin && m_pData->m_pViewShell->IsShowView_Impl() )
+ pEditWin->Show();
+
+ if ( SfxViewFrame::Current() == pViewFrame )
+ pViewFrame->GetDispatcher()->Update_Impl( sal_True );
+
+ Window* pFrameWin = &pViewFrame->GetWindow();
+ if ( pFrameWin != &pViewFrame->GetFrame().GetWindow() )
+ pFrameWin->Show();
+
+ if ( i_eConnect == E_CONNECT )
+ {
+ ::comphelper::NamedValueCollection aDocumentArgs( getModel()->getArgs() );
+
+ const sal_Int16 nPluginMode = aDocumentArgs.getOrDefault( "PluginMode", sal_Int16( 0 ) );
+ const bool bHasPluginMode = ( nPluginMode != 0 );
+
+ SfxFrame& rFrame = pViewFrame->GetFrame();
+ SfxObjectShell& rDoc = *m_pData->m_pViewShell->GetObjectShell();
+ if ( !rFrame.IsMarkedHidden_Impl() )
+ {
+ if ( rDoc.IsHelpDocument() || ( nPluginMode == 2 ) )
+ pViewFrame->GetDispatcher()->HideUI( TRUE );
+ else
+ pViewFrame->GetDispatcher()->HideUI( FALSE );
+
+ if ( rFrame.IsInPlace() )
+ pViewFrame->LockAdjustPosSizePixel();
+
+ if ( nPluginMode == 3 )
+ rFrame.GetWorkWindow_Impl()->SetInternalDockingAllowed( FALSE );
+
+ if ( !rFrame.IsInPlace() )
+ pViewFrame->GetDispatcher()->Update_Impl();
+ pViewFrame->Show();
+ rFrame.GetWindow().Show();
+ if ( !rFrame.IsInPlace() || ( nPluginMode == 3 ) )
+ pViewFrame->MakeActive_Impl( rFrame.GetFrameInterface()->isActive() );
+
+ if ( rFrame.IsInPlace() )
+ {
+ pViewFrame->UnlockAdjustPosSizePixel();
+ // force resize for OLE server to fix layout problems of writer and math
+ // see i53651
+ if ( nPluginMode == 3 )
+ pViewFrame->Resize( TRUE );
+ }
+ }
+ else
+ {
+ DBG_ASSERT( !rFrame.IsInPlace() && !bHasPluginMode, "Special modes not compatible with hidden mode!" );
+ rFrame.GetWindow().Show();
+ }
+
+ // Jetzt UpdateTitle, hidden TopFrames haben sonst keinen Namen!
+ pViewFrame->UpdateTitle();
+
+ if ( !rFrame.IsInPlace() )
+ pViewFrame->Resize( TRUE );
+
+ // if there's a JumpMark given, then, well, jump to it
+ ::comphelper::NamedValueCollection aViewArgs( getCreationArguments() );
+ const ::rtl::OUString sJumpMark = aViewArgs.getOrDefault( "JumpMark", ::rtl::OUString() );
+ const bool bHasJumpMark = ( sJumpMark.getLength() > 0 );
+ OSL_ENSURE( ( !m_pData->m_pViewShell->GetObjectShell()->IsLoading() )
+ || ( !sJumpMark.getLength() ),
+ "SfxBaseController::ConnectSfxFrame_Impl: so this code wasn't dead?" );
+ // Before CWS autorecovery, there was code which postponed jumping to the Mark to a later time
+ // (SfxObjectShell::PositionView_Impl), but it seems this branch was never used, since this method
+ // here is never called before the load process finished. At least not with a non-empty jump mark
+ if ( sJumpMark.getLength() )
+ m_pData->m_pViewShell->JumpToMark( sJumpMark );
+
+ // if no plugin mode and no jump mark was supplied, check whether the document itself can provide view data, and
+ // if so, forward it to the view/shell.
+ if ( !bHasPluginMode && !bHasJumpMark )
+ {
+ try
+ {
+ Reference< XViewDataSupplier > xViewDataSupplier( getModel(), UNO_QUERY );
+ Reference< XIndexAccess > xViewData;
+ if ( xViewDataSupplier.is() )
+ xViewData = xViewDataSupplier->getViewData();
+ if ( xViewData.is() && xViewData->getCount() > 0 )
+ {
+ Sequence< PropertyValue > aViewData;
+ if ( ( xViewData->getByIndex( 0 ) >>= aViewData ) && ( aViewData.getLength() ) )
+ {
+ m_pData->m_pViewShell->ReadUserDataSequence( aViewData, TRUE );
+ }
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+ }
+ }
+
+ // invalidate slot corresponding to the view shell
+ const sal_uInt16 nViewNo = m_pData->m_pViewShell->GetObjectShell()->GetFactory().GetViewNo_Impl( pViewFrame->GetCurViewId(), USHRT_MAX );
+ DBG_ASSERT( nViewNo != USHRT_MAX, "view shell id not found" );
+ if ( nViewNo != USHRT_MAX )
+ pViewFrame->GetBindings().Invalidate( nViewNo + SID_VIEWSHELL0 );
+}
+
//=============================================================================
css::uno::Reference< css::frame::XTitle > SfxBaseController::impl_getTitleHelper ()
{
diff --git a/sfx2/source/view/topfrm.cxx b/sfx2/source/view/topfrm.cxx
deleted file mode 100644
index d4b36a717e..0000000000
--- a/sfx2/source/view/topfrm.cxx
+++ /dev/null
@@ -1,1643 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General 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_sfx2.hxx"
-#ifndef GCC
-#endif
-
-#include <sfx2/topfrm.hxx>
-#include <sfx2/signaturestate.hxx>
-#include <com/sun/star/frame/XModuleManager.hpp>
-#include <com/sun/star/util/XURLTransformer.hpp>
-#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/frame/XFrame.hpp>
-#ifndef _UNOTOOLS_PROCESSFACTORY_HXX
-#include <comphelper/processfactory.hxx>
-#endif
-#include <com/sun/star/frame/XFramesSupplier.hpp>
-#include <com/sun/star/util/XCloseable.hpp>
-#include <com/sun/star/util/CloseVetoException.hpp>
-#ifndef _TOOLKIT_UNOHLP_HXX
-#include <toolkit/helper/vclunohelper.hxx>
-#endif
-#ifndef _UNO_COM_SUN_STAR_AWT_POSSIZE_HPP_
-#include <com/sun/star/awt/PosSize.hpp>
-#endif
-#include <com/sun/star/container/XIndexAccess.hpp>
-#ifndef _COM_SUN_STAR_CONTAINER_XPROPERTYSET_HPP_
-#include <com/sun/star/beans/XPropertySet.hpp>
-#endif
-#include <com/sun/star/frame/XLayoutManager.hpp>
-#include <com/sun/star/beans/NamedValue.hpp>
-#include <com/sun/star/beans/XMaterialHolder.hpp>
-#include <com/sun/star/awt/XWindow2.hpp>
-#include <vcl/menu.hxx>
-#include <svl/rectitem.hxx>
-#include <svl/intitem.hxx>
-#include <svl/eitem.hxx>
-#include <svl/stritem.hxx>
-#include <svtools/asynclink.hxx>
-#include <svtools/sfxecode.hxx>
-#include <vcl/dialog.hxx>
-#include <svl/urihelper.hxx>
-#include <unotools/moduleoptions.hxx>
-#include <unotools/configmgr.hxx>
-#include <unotools/bootstrap.hxx>
-
-#include <sfxresid.hxx>
-
-// wg. pTopFrames
-#include "appdata.hxx"
-#include <sfx2/app.hxx>
-#include <sfx2/sfx.hrc>
-#include <sfx2/objsh.hxx>
-#include <sfx2/docfile.hxx>
-#include <sfx2/viewsh.hxx>
-#include <sfx2/bindings.hxx>
-#include <sfx2/dispatch.hxx>
-#include <sfx2/request.hxx>
-#include <sfx2/objitem.hxx>
-#include <sfx2/objface.hxx>
-#include <sfx2/msg.hxx>
-#include "objshimp.hxx"
-#include "workwin.hxx"
-#include "sfxtypes.hxx"
-#include "splitwin.hxx"
-#include "arrdecl.hxx"
-#include "sfxhelp.hxx"
-#include <sfx2/fcontnr.hxx>
-#include <sfx2/docfac.hxx>
-#include "statcach.hxx"
-#include <sfx2/event.hxx>
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::frame;
-using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::beans;
-
-//------------------------------------------------------------------------
-
-#define SfxTopViewFrame
-#include "sfxslots.hxx"
-
-DBG_NAME(SfxTopViewFrame)
-
-#include <comphelper/sequenceashashmap.hxx>
-static ::rtl::OUString GetModuleName_Impl( const ::rtl::OUString& sDocService )
-{
- uno::Reference< container::XNameAccess > xMM( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.frame.ModuleManager")), uno::UNO_QUERY );
- ::rtl::OUString sVar;
- if ( !xMM.is() )
- return sVar;
-
- try
- {
- ::comphelper::SequenceAsHashMap aAnalyzer( xMM->getByName(sDocService) );
- sVar = aAnalyzer.getUnpackedValueOrDefault( ::rtl::OUString::createFromAscii("ooSetupFactoryUIName"), ::rtl::OUString() );
- }
- catch( uno::Exception& )
- {
- sVar = ::rtl::OUString();
- }
-
- return sVar;
-}
-
-class SfxTopFrame_Impl
-{
-public:
- Window* pWindow; // maybe external
- BOOL bHidden;
- BOOL bLockResize;
- BOOL bMenuBarOn;
-};
-
-class SfxTopWindow_Impl : public Window
-{
-public:
- SfxTopFrame* pFrame;
-
- SfxTopWindow_Impl( SfxTopFrame* pF );
-// : Window( pF->pImp->pWindow, WB_CLIPCHILDREN | WB_NODIALOGCONTROL | WB_3DLOOK )
-// , pFrame( pF )
-// { SetBackground(); }
- ~SfxTopWindow_Impl( );
-
- virtual void DataChanged( const DataChangedEvent& rDCEvt );
- virtual void StateChanged( StateChangedType nStateChange );
- virtual long PreNotify( NotifyEvent& rNEvt );
- virtual long Notify( NotifyEvent& rEvt );
- virtual void Resize();
- virtual void GetFocus();
- void DoResize();
- DECL_LINK( CloserHdl, void* );
-};
-
-SfxTopWindow_Impl::SfxTopWindow_Impl( SfxTopFrame* pF )
- : Window( pF->pImp->pWindow, WB_BORDER | WB_CLIPCHILDREN | WB_NODIALOGCONTROL | WB_3DLOOK )
- , pFrame( pF )
-{
-}
-
-SfxTopWindow_Impl::~SfxTopWindow_Impl( )
-{
-}
-
-void SfxTopWindow_Impl::DataChanged( const DataChangedEvent& rDCEvt )
-{
- Window::DataChanged( rDCEvt );
- SfxWorkWindow *pWorkWin = pFrame->GetWorkWindow_Impl();
- if ( pWorkWin )
- pWorkWin->DataChanged_Impl( rDCEvt );
-}
-
-long SfxTopWindow_Impl::Notify( NotifyEvent& rNEvt )
-{
- if ( pFrame->IsClosing_Impl() || !pFrame->GetFrameInterface().is() )
- return sal_False;
-
- SfxViewFrame* pView = pFrame->GetCurrentViewFrame();
- if ( !pView || !pView->GetObjectShell() )
- return Window::Notify( rNEvt );
-
- if ( rNEvt.GetType() == EVENT_GETFOCUS )
- {
- if ( pView->GetViewShell() && !pView->GetViewShell()->GetUIActiveIPClient_Impl() && !pFrame->IsInPlace() )
- {
- DBG_TRACE("SfxTopFrame: GotFocus");
- pView->MakeActive_Impl( FALSE );
- }
-
- // TODO/LATER: do we still need this code?
- Window* pWindow = rNEvt.GetWindow();
- ULONG nHelpId = 0;
- while ( !nHelpId && pWindow )
- {
- nHelpId = pWindow->GetHelpId();
- pWindow = pWindow->GetParent();
- }
-
- if ( nHelpId )
- SfxHelp::OpenHelpAgent( pFrame, nHelpId );
-
- // if focus was on an external window, the clipboard content might have been changed
- pView->GetBindings().Invalidate( SID_PASTE );
- pView->GetBindings().Invalidate( SID_PASTE_SPECIAL );
- return sal_True;
- }
- else if( rNEvt.GetType() == EVENT_KEYINPUT )
- {
- if ( pView->GetViewShell()->KeyInput( *rNEvt.GetKeyEvent() ) )
- return TRUE;
- }
- else if ( rNEvt.GetType() == EVENT_EXECUTEDIALOG /*|| rNEvt.GetType() == EVENT_INPUTDISABLE*/ )
- {
- pView->SetModalMode( sal_True );
- return sal_True;
- }
- else if ( rNEvt.GetType() == EVENT_ENDEXECUTEDIALOG /*|| rNEvt.GetType() == EVENT_INPUTENABLE*/ )
- {
- //EnableInput( sal_True, sal_True );
- pView->SetModalMode( sal_False );
- return sal_True;
- }
-
- return Window::Notify( rNEvt );
-}
-
-long SfxTopWindow_Impl::PreNotify( NotifyEvent& rNEvt )
-{
- USHORT nType = rNEvt.GetType();
- if ( nType == EVENT_KEYINPUT || nType == EVENT_KEYUP )
- {
- SfxViewFrame* pView = pFrame->GetCurrentViewFrame();
- SfxViewShell* pShell = pView ? pView->GetViewShell() : NULL;
- if ( pShell && pShell->HasKeyListeners_Impl() && pShell->HandleNotifyEvent_Impl( rNEvt ) )
- return sal_True;
- }
- else if ( nType == EVENT_MOUSEBUTTONUP || nType == EVENT_MOUSEBUTTONDOWN )
- {
- Window* pWindow = rNEvt.GetWindow();
- SfxViewFrame* pView = pFrame->GetCurrentViewFrame();
- SfxViewShell* pShell = pView ? pView->GetViewShell() : NULL;
- if ( pShell )
- if ( pWindow == pShell->GetWindow() || pShell->GetWindow()->IsChild( pWindow ) )
- if ( pShell->HasMouseClickListeners_Impl() && pShell->HandleNotifyEvent_Impl( rNEvt ) )
- return sal_True;
- }
-
- if ( nType == EVENT_MOUSEBUTTONDOWN )
- {
- Window* pWindow = rNEvt.GetWindow();
- const MouseEvent* pMEvent = rNEvt.GetMouseEvent();
- Point aPos = pWindow->OutputToScreenPixel( pMEvent->GetPosPixel() );
- SfxWorkWindow *pWorkWin = pFrame->GetWorkWindow_Impl();
- if ( pWorkWin )
- pWorkWin->EndAutoShow_Impl( aPos );
- }
-
- return Window::PreNotify( rNEvt );
-}
-
-void SfxTopWindow_Impl::GetFocus()
-{
- if ( pFrame && !pFrame->IsClosing_Impl() && pFrame->GetCurrentViewFrame() && pFrame->GetFrameInterface().is() )
- pFrame->GetCurrentViewFrame()->MakeActive_Impl( TRUE );
-}
-
-void SfxTopWindow_Impl::Resize()
-{
- if ( IsReallyVisible() || IsReallyShown() || GetOutputSizePixel().Width() )
- DoResize();
-}
-
-void SfxTopWindow_Impl::StateChanged( StateChangedType nStateChange )
-{
- if ( nStateChange == STATE_CHANGE_INITSHOW )
- {
- pFrame->pImp->bHidden = FALSE;
- if ( pFrame->IsInPlace() )
- // TODO/MBA: workaround for bug in LayoutManager: the final resize does not get through because the
- // LayoutManager works asynchronously and between resize and time execution the DockingAcceptor was exchanged so that
- // the resize event never is sent to the component
- SetSizePixel( GetParent()->GetOutputSizePixel() );
-
- DoResize();
- SfxViewFrame* pView = pFrame->GetCurrentViewFrame();
- if ( pView )
- pView->GetBindings().GetWorkWindow_Impl()->ShowChilds_Impl();
- }
-
- Window::StateChanged( nStateChange );
-}
-
-void SfxTopWindow_Impl::DoResize()
-{
- if ( !pFrame->pImp->bLockResize )
- pFrame->Resize();
-}
-
-class StopButtonTimer_Impl : public Timer
-{
- BOOL bState;
- SfxViewFrame* pFrame;
-protected:
- virtual void Timeout();
-public:
- StopButtonTimer_Impl( SfxViewFrame*);
- void SetButtonState( BOOL bStateP );
- BOOL GetButtonState() const { return bState; }
-};
-
-StopButtonTimer_Impl::StopButtonTimer_Impl( SfxViewFrame*p)
- : bState( FALSE )
- , pFrame( p )
-{
- SetTimeout( 200 );
-}
-
-void StopButtonTimer_Impl::SetButtonState( BOOL bStateP )
-{
- if( bStateP )
- {
- bState = TRUE;
- Stop();
- }
- else if( bState )
- Start();
-}
-
-void StopButtonTimer_Impl::Timeout()
-{
- bState = FALSE;
- pFrame->GetBindings().Invalidate( SID_BROWSE_STOP );
-}
-
-class SfxTopViewWin_Impl : public Window
-{
-friend class SfxInternalFrame;
-
- BOOL bActive;
- SfxTopViewFrame* pFrame;
-
-public:
- SfxTopViewWin_Impl( SfxTopViewFrame* p,
- Window *pParent, WinBits nBits=0 ) :
- Window( pParent, nBits | WB_BORDER | WB_CLIPCHILDREN ),
- bActive( FALSE ),
- pFrame( p )
- {
- p->GetFrame()->GetWindow().SetBorderStyle( WINDOW_BORDER_NOBORDER );
- }
-
- virtual void Resize();
- virtual void StateChanged( StateChangedType nStateChange );
-};
-
-//--------------------------------------------------------------------
-void SfxTopViewWin_Impl::StateChanged( StateChangedType nStateChange )
-{
- if ( nStateChange == STATE_CHANGE_INITSHOW )
- {
- SfxObjectShell* pDoc = pFrame->GetObjectShell();
- if ( pDoc && !pFrame->IsVisible() )
- pFrame->Show();
-
- pFrame->Resize();
- }
- else
- Window::StateChanged( nStateChange );
-}
-
-void SfxTopViewWin_Impl::Resize()
-{
- if ( IsReallyVisible() || IsReallyShown() || GetOutputSizePixel().Width() )
- pFrame->Resize();
-}
-
-class SfxTopViewFrame_Impl
-{
-public:
- sal_Bool bActive;
- Window* pWindow;
- String aFactoryName;
- StopButtonTimer_Impl* pStopButtonTimer;
-
- SfxTopViewFrame_Impl()
- : bActive( sal_False )
- , pWindow( 0 )
- , pStopButtonTimer( 0 )
- {}
-};
-
-static svtools::AsynchronLink* pPendingCloser = 0;
-
-static String _getTabString()
-{
- String result;
-
- Reference < XMaterialHolder > xHolder(
- ::comphelper::getProcessServiceFactory()->createInstance(
- DEFINE_CONST_UNICODE("com.sun.star.tab.tabreg") ), UNO_QUERY );
- if (xHolder.is())
- {
- rtl::OUString aTabString;
- Sequence< NamedValue > sMaterial;
- if (xHolder->getMaterial() >>= sMaterial) {
- for (int i=0; i < sMaterial.getLength(); i++) {
- if ((sMaterial[i].Name.equalsAscii("title")) &&
- (sMaterial[i].Value >>= aTabString))
- {
- result += ' ';
- result += String(aTabString);
- }
- }
- }
- }
- return result;
-}
-
-SfxTopFrame* SfxTopFrame::Create( SfxObjectShell* pDoc, USHORT nViewId, BOOL bHidden, const SfxItemSet* pSet )
-{
- Reference < XFrame > xDesktop ( ::comphelper::getProcessServiceFactory()->createInstance( DEFINE_CONST_UNICODE("com.sun.star.frame.Desktop") ), UNO_QUERY );
- SfxTopFrame *pFrame = NULL;
- BOOL bNewView = FALSE;
- if ( pSet )
- {
- SFX_ITEMSET_ARG( pSet, pItem, SfxBoolItem, SID_OPEN_NEW_VIEW, sal_False );
- bNewView = pItem && pItem->GetValue();
- }
-
- if ( pDoc && !bHidden && !bNewView )
- {
- URL aTargetURL;
- aTargetURL.Complete = pDoc->GetMedium()->GetURLObject().GetMainURL( INetURLObject::NO_DECODE );
-
- BOOL bIsBasic = FALSE;
- if ( !aTargetURL.Complete.getLength() )
- {
- String sFactory = String::CreateFromAscii(pDoc->GetFactory().GetShortName());
- bIsBasic = (sFactory.CompareIgnoreCaseToAscii("sbasic")==COMPARE_EQUAL);
-
- if (!bIsBasic)
- {
- String aURL = String::CreateFromAscii("private:factory/");
- aURL += sFactory;
- aTargetURL.Complete = aURL;
- }
- }
-
- if (bIsBasic)
- {
- Reference < XFramesSupplier > xSupplier( xDesktop, UNO_QUERY );
- if (xSupplier.is())
- {
- Reference < XIndexAccess > xContainer(xSupplier->getFrames(), UNO_QUERY);
- if (xContainer.is())
- {
- Reference< ::com::sun::star::frame::XModuleManager > xCheck(::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString::createFromAscii("com.sun.star.frame.ModuleManager" )), UNO_QUERY);
- sal_Int32 nCount = xContainer->getCount();
- for (sal_Int32 i=0; i<nCount; ++i)
- {
- try
- {
- Reference < XFrame > xFrame;
- if (!(xContainer->getByIndex(i) >>= xFrame) || !xFrame.is())
- continue;
- ::rtl::OUString sModule = xCheck->identify(xFrame);
- if (sModule.equalsAscii("com.sun.star.frame.StartModule"))
- {
- pFrame = Create(xFrame);
- break;
- }
- }
- catch(const Exception&) {}
- }
- }
- }
- }
- else
- {
- Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" )), UNO_QUERY );
- xTrans->parseStrict( aTargetURL );
-
- Reference < ::com::sun::star::frame::XDispatchProvider > xProv( xDesktop, UNO_QUERY );
- Reference < ::com::sun::star::frame::XDispatch > xDisp;
- if ( xProv.is() )
- {
- Sequence < ::com::sun::star::beans::PropertyValue > aSeq(1);
- aSeq[0].Name = ::rtl::OUString::createFromAscii("Model");
- aSeq[0].Value <<= pDoc->GetModel();
- ::rtl::OUString aTargetFrame( ::rtl::OUString::createFromAscii("_default") );
- xDisp = xProv->queryDispatch( aTargetURL, aTargetFrame , 0 );
- if ( xDisp.is() )
- xDisp->dispatch( aTargetURL, aSeq );
- }
-
- SfxFrameArr_Impl& rArr = *SFX_APP()->Get_Impl()->pTopFrames;
- for( USHORT nPos = rArr.Count(); nPos--; )
- {
- SfxTopFrame *pF = (SfxTopFrame*) rArr[ nPos ];
- if ( pF->GetCurrentDocument() == pDoc )
- {
- pFrame = pF;
- break;
- }
- }
- }
- }
-
- if ( !pFrame )
- {
- Reference < XFrame > xFrame = xDesktop->findFrame( DEFINE_CONST_UNICODE("_blank"), 0 );
- pFrame = Create( xFrame );
- }
-
- pFrame->pImp->bHidden = bHidden;
- Window* pWindow = pFrame->GetTopWindow_Impl();
- if ( pWindow && pDoc )
- {
- ::rtl::OUString aDocServiceName( pDoc->GetFactory().GetDocumentServiceName() );
- ::rtl::OUString aProductName;
- ::utl::ConfigManager::GetDirectConfigProperty(::utl::ConfigManager::PRODUCTNAME) >>= aProductName;
- String aTitle = pDoc->GetTitle( SFX_TITLE_DETECT );
- aTitle += String::CreateFromAscii( " - " );
- aTitle += String(aProductName);
- aTitle += ' ';
- aTitle += String( GetModuleName_Impl( aDocServiceName ) );
-#ifdef DBG_UTIL
- ::rtl::OUString aDefault;
- aTitle += DEFINE_CONST_UNICODE(" [");
- String aVerId( utl::Bootstrap::getBuildIdData( aDefault ));
- aTitle += aVerId;
- aTitle += ']';
-#endif
-
- // append TAB string if available
- aTitle += _getTabString();
-
- /* AS_TITLE
- pWindow->SetText( aTitle );
- */
-
- /* AS_ICON
- if( pWindow->GetType() == WINDOW_WORKWINDOW )
- {
- SvtModuleOptions::EFactory eFactory;
- if( SvtModuleOptions::ClassifyFactoryByName( aDocServiceName, eFactory ) )
- {
- WorkWindow* pWorkWindow = (WorkWindow*)pWindow;
- pWorkWindow->SetIcon( (sal_uInt16) SvtModuleOptions().GetFactoryIcon( eFactory ) );
- }
- }
- */
- }
-
- pFrame->SetItemSet_Impl( pSet );
- if ( pDoc && pDoc != pFrame->GetCurrentDocument() )
- {
- if ( nViewId )
- pDoc->GetMedium()->GetItemSet()->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) );
- pFrame->InsertDocument( pDoc );
- if ( pWindow && !bHidden )
- pWindow->Show();
- }
-
- return pFrame;
-}
-
-SfxTopFrame* SfxTopFrame::Create( SfxObjectShell* pDoc, Window* pWindow, USHORT nViewId, BOOL bHidden, const SfxItemSet* pSet )
-{
- Reference < ::com::sun::star::lang::XMultiServiceFactory > xFact( ::comphelper::getProcessServiceFactory() );
- Reference < XFramesSupplier > xDesktop ( xFact->createInstance( DEFINE_CONST_UNICODE("com.sun.star.frame.Desktop") ), UNO_QUERY );
- Reference < XFrame > xFrame( xFact->createInstance( DEFINE_CONST_UNICODE("com.sun.star.frame.Frame") ), UNO_QUERY );
-
- xFrame->initialize( VCLUnoHelper::GetInterface ( pWindow ) );
- if ( xDesktop.is() )
- xDesktop->getFrames()->append( xFrame );
-
- uno::Reference< awt::XWindow2 > xWin( VCLUnoHelper::GetInterface ( pWindow ), uno::UNO_QUERY );
- if ( xWin.is() && xWin->isActive() )
- xFrame->activate();
-
- SfxTopFrame* pFrame = new SfxTopFrame( pWindow );
- pFrame->SetFrameInterface_Impl( xFrame );
- pFrame->pImp->bHidden = bHidden;
-
- pFrame->SetItemSet_Impl( pSet );
- if ( pDoc )
- {
- if ( nViewId )
- pDoc->GetMedium()->GetItemSet()->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) );
- pFrame->InsertDocument( pDoc );
- }
-
- return pFrame;
-}
-
-SfxTopFrame* SfxTopFrame::Create( Reference < XFrame > xFrame )
-{
- // create a new TopFrame to an external XFrame object ( wrap controller )
- DBG_ASSERT( xFrame.is(), "Wrong parameter!" );
-
- Window* pWindow = VCLUnoHelper::GetWindow( xFrame->getContainerWindow() );
- SfxTopFrame* pFrame = new SfxTopFrame( pWindow );
- pFrame->SetFrameInterface_Impl( xFrame );
- return pFrame;
-}
-
-SfxTopFrame::SfxTopFrame( Window* pExternal, sal_Bool bHidden )
- : SfxFrame( NULL )
- , pWindow( NULL )
-{
- pImp = new SfxTopFrame_Impl;
- pImp->bHidden = bHidden;
- pImp->bLockResize = FALSE;
- pImp->bMenuBarOn = TRUE;
- InsertTopFrame_Impl( this );
- if ( pExternal )
- {
- pImp->pWindow = pExternal;
- }
- else
- {
- DBG_ERROR( "TopFrame without window created!" );
-/*
- pImp->pWindow = new SfxTopFrameWindow_Impl( this );
- pImp->pWindow->SetActivateMode( ACTIVATE_MODE_GRABFOCUS );
- pImp->pWindow->SetPosSizePixel( Point( 20,20 ), Size( 800,600 ) );
- if ( GetFrameInterface().is() )
- GetFrameInterface()->initialize( VCLUnoHelper::GetInterface( pImp->pWindow ) );
- pImp->pWindow->Show();
- */
- }
-
- pWindow = new SfxTopWindow_Impl( this );
-/** AS:
- Hide this window till the component was realy loaded. Otherwhise it overpaint e.g. the old component hardly
- and produce repaint errors.
- pWindow->Show();
- */
-}
-
-SfxTopFrame::~SfxTopFrame()
-{
- RemoveTopFrame_Impl( this );
- DELETEZ( pWindow );
- delete pImp;
-}
-
-void SfxTopFrame::SetPresentationMode( BOOL bSet )
-{
- if ( GetCurrentViewFrame() )
- GetCurrentViewFrame()->GetWindow().SetBorderStyle( bSet ? WINDOW_BORDER_NOBORDER : WINDOW_BORDER_NORMAL );
-
- Reference< com::sun::star::beans::XPropertySet > xPropSet( GetFrameInterface(), UNO_QUERY );
- Reference< ::com::sun::star::frame::XLayoutManager > xLayoutManager;
-
- if ( xPropSet.is() )
- {
- Any aValue = xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" )));
- aValue >>= xLayoutManager;
- }
-
- if ( xLayoutManager.is() )
- xLayoutManager->setVisible( !bSet ); // we don't want to have ui in presentation mode
-
- SetMenuBarOn_Impl( !bSet );
- if ( GetWorkWindow_Impl() )
- GetWorkWindow_Impl()->SetDockingAllowed( !bSet );
- if ( GetCurrentViewFrame() )
- GetCurrentViewFrame()->GetDispatcher()->Update_Impl( TRUE );
-}
-
-SystemWindow*
-SfxTopFrame::GetSystemWindow() const
-{
- return GetTopWindow_Impl();
-}
-
-SystemWindow* SfxTopFrame::GetTopWindow_Impl() const
-{
- if ( pImp->pWindow->IsSystemWindow() )
- return (SystemWindow*) pImp->pWindow;
- else
- return NULL;
-}
-
-Window& SfxTopFrame::GetWindow() const
-{
- return *pWindow;
-}
-
-sal_Bool SfxTopFrame::Close()
-{
- delete this;
- return sal_True;
-}
-
-void SfxTopFrame::LockResize_Impl( BOOL bLock )
-{
- pImp->bLockResize = bLock;
-}
-
-IMPL_LINK( SfxTopWindow_Impl, CloserHdl, void*, EMPTYARG )
-{
- if ( pFrame && !pFrame->PrepareClose_Impl( TRUE ) )
- return 0L;
-
- if ( pFrame )
- pFrame->GetCurrentViewFrame()->GetBindings().Execute( SID_CLOSEWIN, 0, 0, SFX_CALLMODE_ASYNCHRON );
- return 0L;
-}
-
-void SfxTopFrame::SetMenuBarOn_Impl( BOOL bOn )
-{
- pImp->bMenuBarOn = bOn;
-
- Reference< com::sun::star::beans::XPropertySet > xPropSet( GetFrameInterface(), UNO_QUERY );
- Reference< ::com::sun::star::frame::XLayoutManager > xLayoutManager;
-
- if ( xPropSet.is() )
- {
- Any aValue = xPropSet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" )));
- aValue >>= xLayoutManager;
- }
-
- if ( xLayoutManager.is() )
- {
- rtl::OUString aMenuBarURL( RTL_CONSTASCII_USTRINGPARAM( "private:resource/menubar/menubar" ));
-
- if ( bOn )
- xLayoutManager->showElement( aMenuBarURL );
- else
- xLayoutManager->hideElement( aMenuBarURL );
- }
-}
-
-BOOL SfxTopFrame::IsMenuBarOn_Impl() const
-{
- return pImp->bMenuBarOn;
-}
-
-String SfxTopFrame::GetWindowData()
-{
- String aActWinData;
- char cToken = ',';
-
- SfxViewFrame *pActFrame = SfxViewFrame::Current();
- SfxViewFrame *pFrame = GetCurrentViewFrame();
- const sal_Bool bActWin = ( pActFrame->GetTopViewFrame() == pFrame );
-
- // ::com::sun::star::sdbcx::User-Daten der ViewShell
- String aUserData;
- pFrame->GetViewShell()->WriteUserData(aUserData);
-
- // assemble ini-data
- String aWinData;
- aWinData += String::CreateFromInt32( pFrame->GetCurViewId() );
- aWinData += cToken;
-
- aWinData += '1'; // former attribute "isfloating"
- aWinData += cToken;
-
- // aktives kennzeichnen
- aWinData += cToken;
- aWinData += bActWin ? '1' : '0';
-
- aWinData += cToken;
- aWinData += aUserData;
-
- return aWinData;
-}
-
-sal_Bool SfxTopFrame::InsertDocument( SfxObjectShell* pDoc )
-/* [Beschreibung]
- */
-{
- // Spezielle Bedingungen testen: nicht im ModalMode!
- if ( !SfxFrame::InsertDocument( pDoc ) )
- return sal_False;
-
- SfxObjectShell *pOld = GetCurrentDocument();
-
- // Position und Groesse testen
- // Wenn diese schon gesetzt sind, soll offensichtlich nicht noch
- // LoadWindows_Impl aufgerufen werden ( z.B. weil dieses ein CreateFrame()
- // an einer Task aufgerufen hat! )
- const SfxItemSet* pSet = GetItemSet_Impl();
- if ( !pSet )
- pSet = pDoc->GetMedium()->GetItemSet();
- SetItemSet_Impl(0);
-
- // Position und Gr"o\se
- SFX_ITEMSET_ARG(
- pSet, pAreaItem, SfxRectangleItem, SID_VIEW_POS_SIZE, sal_False );
- // View-Id
- SFX_ITEMSET_ARG(
- pSet, pViewIdItem, SfxUInt16Item, SID_VIEW_ID, sal_False );
- // Zoom
- SFX_ITEMSET_ARG(
- pSet, pModeItem, SfxUInt16Item, SID_VIEW_ZOOM_MODE, sal_False );
- // Hidden
- SFX_ITEMSET_ARG(
- pSet, pHidItem, SfxBoolItem, SID_HIDDEN, sal_False);
- // ViewDaten
- SFX_ITEMSET_ARG(
- pSet, pViewDataItem, SfxStringItem, SID_USER_DATA, sal_False );
- // ViewOnly
- SFX_ITEMSET_ARG(
- pSet, pEditItem, SfxBoolItem, SID_VIEWONLY, sal_False);
- // InPlace (Hack)
- SFX_ITEMSET_ARG(
- pSet, pPluginItem, SfxUInt16Item, SID_PLUGIN_MODE, sal_False );
-
- // Plugin (external InPlace)
- SFX_ITEMSET_ARG(
- pSet, pPluginMode, SfxUInt16Item, SID_PLUGIN_MODE, sal_False);
- // Jump (GotoBookmark)
- SFX_ITEMSET_ARG(
- pSet, pJumpItem, SfxStringItem, SID_JUMPMARK, sal_False);
-
- if ( pEditItem && pEditItem->GetValue() )
- SetMenuBarOn_Impl( FALSE );
-
- if ( pHidItem )
- pImp->bHidden = pHidItem->GetValue();
-
- if( !pImp->bHidden )
- pDoc->OwnerLock( sal_True );
-
- // Wenn z.B. eine Fenstergr"o\se gesetzt wurde, soll keine Fensterinformation
- // aus den Dokument geladen werden, z.B. weil InsertDocument seinerseits
- // aus LoadWindows_Impl aufgerufen wurde!
- if ( !pJumpItem && !pPluginMode && pDoc && !pAreaItem && !pViewIdItem && !pModeItem &&
- pDoc->LoadWindows_Impl( this ) )
- {
- if ( GetCurrentDocument() != pDoc )
- // something went wrong during insertion
- return sal_False;
- pDoc->OwnerLock( sal_False );
- return sal_True;
- }
-
- if ( pDoc )
- {
- UpdateHistory( pDoc );
- UpdateDescriptor( pDoc );
- }
-
- SetFrameType_Impl( GetFrameType() & ~SFXFRAME_FRAMESET );
- sal_Bool bBrowsing = sal_True;
- SfxViewFrame *pFrame = GetCurrentViewFrame();
- if ( pFrame )
- {
- sal_Bool bChildActivated = sal_False;
- if ( pFrame->GetActiveChildFrame_Impl() && pFrame->GetActiveChildFrame_Impl() == SfxViewFrame::Current() )
- {
-// ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFramesSupplier > xFrames( GetFrameInterface(), ::com::sun::star::uno::UNO_QUERY );
-// if ( xFrames.is() )
-// xFrames->setActiveFrame( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > () );
- pFrame->SetActiveChildFrame_Impl(0);
- SfxViewFrame::SetViewFrame( pFrame );
- bChildActivated = sal_True;
- }
-
- if ( pFrame->GetObjectShell() )
- {
- pFrame->ReleaseObjectShell_Impl( sal_False );
- }
-
- if ( pViewIdItem )
- pFrame->SetViewData_Impl( pViewIdItem->GetValue(), String() );
- if ( pDoc )
- pFrame->SetObjectShell_Impl( *pDoc );
- }
- else
- {
- // 1: internal embedded object
- // 2: external embedded object
- // 3: OLE server
- if ( pPluginItem && pPluginItem->GetValue() != 2 )
- SetInPlace_Impl( TRUE );
-
- bBrowsing = sal_False;
- pFrame = new SfxTopViewFrame( this, pDoc, pViewIdItem ? pViewIdItem->GetValue() : 0 );
- if ( !pFrame->GetViewShell() )
- return sal_False;
-
- if ( pPluginItem && pPluginItem->GetValue() == 1 )
- {
- pFrame->ForceOuterResize_Impl( FALSE );
- pFrame->GetBindings().HidePopups(TRUE);
-
- // MBA: layoutmanager of inplace frame starts locked and invisible
- GetWorkWindow_Impl()->MakeVisible_Impl( FALSE );
- GetWorkWindow_Impl()->Lock_Impl( TRUE );
-
- GetWindow().SetBorderStyle( WINDOW_BORDER_NOBORDER );
- if ( GetCurrentViewFrame() )
- GetCurrentViewFrame()->GetWindow().SetBorderStyle( WINDOW_BORDER_NOBORDER );
- }
- }
-
- String aMark;
- SFX_ITEMSET_ARG( pSet, pMarkItem, SfxStringItem, SID_JUMPMARK, FALSE );
- if ( pMarkItem )
- aMark = pMarkItem->GetValue();
-
- if ( pDoc->Get_Impl()->nLoadedFlags & SFX_LOADED_MAINDOCUMENT )
- {
- if ( pViewDataItem )
- pFrame->GetViewShell()->ReadUserData( pViewDataItem->GetValue(), sal_True );
- else if( aMark.Len() )
- GetCurrentViewFrame()->GetViewShell()->JumpToMark( aMark );
- }
- else
- {
- // Daten setzen, die in FinishedLoading ausgewertet werden
- MarkData_Impl*& rpMark = pDoc->Get_Impl()->pMarkData;
- if (!rpMark)
- rpMark = new MarkData_Impl;
- rpMark->pFrame = GetCurrentViewFrame();
- if ( pViewDataItem )
- rpMark->aUserData = pViewDataItem->GetValue();
- else
- rpMark->aMark = aMark;
- }
-
- // Position und Groesse setzen
- //sal_uInt16 nWinMode = pModeItem ? pModeItem->GetValue() : 1;
- if ( pAreaItem && !pOld )
- {
- Window *pWin = pImp->pWindow;
-
- // Groesse setzen
- const Rectangle aWinRect( pAreaItem->GetValue() );
- const Size aAppWindow( pImp->pWindow->GetDesktopRectPixel().GetSize() );
- Point aPos( aWinRect.TopLeft() );
- Size aSz(aWinRect.GetSize());
- if ( aSz.Width() && aSz.Height() )
- {
- aPos.X() = Min(aPos.X(),
- long(aAppWindow.Width() - aSz.Width() + aSz.Width() / 2) );
- aPos.Y() = Min(aPos.Y(),
- long( aAppWindow.Height() - aSz.Height() + aSz.Height() / 2) );
- if ( aPos.X() + aSz.Width() <
- aAppWindow.Width() + aSz.Width() / 2 &&
- aPos.Y() + aSz.Height() <
- aAppWindow.Height() + aSz.Height() / 2 )
- {
- pWin->SetPosPixel( aPos );
- pWin->SetOutputSizePixel( aSz );
- }
- }
- }
-
- if ( !pImp->bHidden )
- {
- if ( pDoc->IsHelpDocument() || (pPluginItem && pPluginItem->GetValue() == 2) )
- pFrame->GetDispatcher()->HideUI( TRUE );
- else
- pFrame->GetDispatcher()->HideUI( FALSE );
-
- if ( IsInPlace() )
- pFrame->LockAdjustPosSizePixel();
-
- if ( pPluginMode && pPluginMode->GetValue() == 3)
- GetWorkWindow_Impl()->SetInternalDockingAllowed(FALSE);
-
- if ( !IsInPlace() )
- pFrame->GetDispatcher()->Update_Impl();
- pFrame->Show();
- GetWindow().Show();
- if ( !IsInPlace() || (pPluginItem && pPluginItem->GetValue() == 3) )
- pFrame->MakeActive_Impl( GetFrameInterface()->isActive() );
- pDoc->OwnerLock( sal_False );
-
- // Dont show container window! Its done by framework or directly
- // by SfxTopFrame::Create() or SfxViewFrame::ExecView_Impl() ...
-
- if ( IsInPlace() )
- {
- pFrame->UnlockAdjustPosSizePixel();
- // force resize for OLE server to fix layout problems of writer and math
- // see i53651
- if ( pPluginItem && pPluginItem->GetValue() == 3 )
- pFrame->Resize(TRUE);
- }
- }
- else
- {
- DBG_ASSERT( !IsInPlace() && !pPluginMode && !pPluginItem, "Special modes not compatible with hidden mode!" );
- GetWindow().Show();
- }
-
- // Jetzt UpdateTitle, hidden TopFrames haben sonst keinen Namen!
- pFrame->UpdateTitle();
-
- if ( !IsInPlace() )
- {
- if ( pFrame->GetViewShell()->UseObjectSize() )
- {
- GetCurrentViewFrame()->UnlockAdjustPosSizePixel();
- GetCurrentViewFrame()->Resize(TRUE);
- GetCurrentViewFrame()->ForceInnerResize_Impl( FALSE );
- GetCurrentViewFrame()->Resize(TRUE);
- }
- else
- GetCurrentViewFrame()->Resize(TRUE);
- }
-
- SFX_APP()->NotifyEvent( SfxEventHint(SFX_EVENT_VIEWCREATED, GlobalEventConfig::GetEventName( STR_EVENT_VIEWCREATED ), pDoc ) );
- return sal_True;
-}
-
-
-//========================================================================
-
-long SfxViewFrameClose_Impl( void* /*pObj*/, void* pArg )
-{
- ((SfxViewFrame*)pArg)->GetFrame()->DoClose();
- return 0;
-}
-
-TYPEINIT1(SfxTopFrame, SfxFrame);
-TYPEINIT1(SfxTopViewFrame, SfxViewFrame);
-
-//--------------------------------------------------------------------
-SFX_IMPL_INTERFACE(SfxTopViewFrame,SfxViewFrame,SfxResId(0))
-{
-}
-
-//--------------------------------------------------------------------
-String SfxTopViewFrame::UpdateTitle()
-
-/* [Beschreibung]
-
- Mit dieser Methode kann der SfxTopViewFrame gezwungen werden, sich sofort
- den neuen Titel vom der <SfxObjectShell> zu besorgen.
-
- [Anmerkung]
-
- Dies ist z.B. dann notwendig, wenn man der SfxObjectShell als SfxListener
- zuh"ort und dort auf den <SfxSimpleHint> SFX_HINT_TITLECHANGED reagieren
- m"ochte, um dann die Titel seiner Views abzufragen. Diese Views (SfxTopViewFrames)
- jedoch sind ebenfalls SfxListener und da die Reihenfolge der Benachrichtigung
- nicht feststeht, mu\s deren Titel-Update vorab erzwungen werden.
-
-
- [Beispiel]
-
- void SwDocShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
- {
- if ( rHint.IsA(TYPE(SfxSimpleHint)) )
- {
- switch( ( (SfxSimpleHint&) rHint ).GetId() )
- {
- case SFX_HINT_TITLECHANGED:
- for ( SfxTopViewFrame *pTop = (SfxTopViewFrame*)
- SfxViewFrame::GetFirst(this, TYPE(SfxTopViewFrame));
- pTop;
- pTop = (SfxTopViewFrame*)
- SfxViewFrame::GetNext(this, TYPE(SfxTopViewFrame));
- {
- pTop->UpdateTitle();
- ... pTop->GetName() ...
- }
- break;
- ...
- }
- }
- }
-*/
-
-{
- DBG_CHKTHIS(SfxTopViewFrame, 0);
-
- const SfxObjectFactory &rFact = GetObjectShell()->GetFactory();
- pImp->aFactoryName = String::CreateFromAscii( rFact.GetShortName() );
-
- String aTitle = SfxViewFrame::UpdateTitle();
-
- ::rtl::OUString aProductName;
- ::utl::ConfigManager::GetDirectConfigProperty(::utl::ConfigManager::PRODUCTNAME) >>= aProductName;
-
- aTitle += String::CreateFromAscii( " - " );
- aTitle += String(aProductName);
- aTitle += ' ';
- ::rtl::OUString aDocServiceName( GetObjectShell()->GetFactory().GetDocumentServiceName() );
- aTitle += String( GetModuleName_Impl( aDocServiceName ) );
-#ifdef DBG_UTIL
- ::rtl::OUString aDefault;
- aTitle += DEFINE_CONST_UNICODE(" [");
- String aVerId( utl::Bootstrap::getBuildIdData( aDefault ));
- aTitle += aVerId;
- aTitle += ']';
-#endif
-
- // append TAB string if available
- aTitle += _getTabString();
-
- GetBindings().Invalidate( SID_NEWDOCDIRECT );
-
- /* AS_TITLE
- Window* pWindow = GetTopFrame_Impl()->GetTopWindow_Impl();
- if ( pWindow && pWindow->GetText() != aTitle )
- pWindow->SetText( aTitle );
- */
- return aTitle;
-}
-
-//--------------------------------------------------------------------
-void SfxTopViewFrame::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
-{
- {DBG_CHKTHIS(SfxTopViewFrame, 0);}
-
- if( IsDowning_Impl())
- return;
-
- // we know only SimpleHints
- if ( rHint.IsA(TYPE(SfxSimpleHint)) )
- {
- switch( ( (SfxSimpleHint&) rHint ).GetId() )
- {
- case SFX_HINT_MODECHANGED:
- case SFX_HINT_TITLECHANGED:
- // when the document changes its title, change views too
- UpdateTitle();
- break;
-
- case SFX_HINT_DEINITIALIZING:
- // on all other changes force repaint
- GetFrame()->DoClose();
- return;
- }
- }
-
- SfxViewFrame::Notify( rBC, rHint );
-}
-
-//--------------------------------------------------------------------
-sal_Bool SfxTopViewFrame::Close()
-{
- {DBG_CHKTHIS(SfxTopViewFrame, 0);}
-
- // Modaler Dialog oben ??
-// if ( pImp->GetModalDialog() )
-// return sal_False;
-
- // eigentliches Schlie\sen
- if ( SfxViewFrame::Close() )
- {
- if (SfxViewFrame::Current() == this)
- SfxViewFrame::SetViewFrame(0);
-
- // Da der Dispatcher leer ger"aumt wird, kann man ihn auch nicht mehr
- // vern"unftig verwenden - also besser still legen
- GetDispatcher()->Lock(sal_True);
- delete this;
-
- return sal_True;
- }
-
- return sal_False;
-}
-
-SfxTopViewFrame::SfxTopViewFrame
-(
- SfxFrame* pFrame,
- SfxObjectShell* pObjShell,
- sal_uInt16 nViewId
-)
-
-/* [Beschreibung]
-
- Ctor des SfxTopViewFrame f"ur eine <SfxObjectShell> aus der Ressource.
- Die 'nViewId' der zu erzeugenden <SfxViewShell> kann angegeben werden
- (default ist die zuerst registrierte SfxViewShell-Subklasse).
-*/
-
- : SfxViewFrame( *(new SfxBindings), pFrame, pObjShell, SFXFRAME_HASTITLE )
-{
- DBG_CTOR(SfxTopViewFrame, 0);
-
- pCloser = 0;
- pImp = new SfxTopViewFrame_Impl;
- pImp->pStopButtonTimer = new StopButtonTimer_Impl(this);
-
-//(mba)/task if ( !pFrame->GetTask() )
- {
- pImp->pWindow = new SfxTopViewWin_Impl( this, &pFrame->GetWindow() );
- pImp->pWindow->SetSizePixel( pFrame->GetWindow().GetOutputSizePixel() );
- SetWindow_Impl( pImp->pWindow );
- pFrame->SetOwnsBindings_Impl( sal_True );
- pFrame->CreateWorkWindow_Impl();
- }
-
- sal_uInt32 nType = SFXFRAME_OWNSDOCUMENT | SFXFRAME_HASTITLE;
- if ( pObjShell && pObjShell->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
- nType |= SFXFRAME_EXTERNAL;
- GetFrame()->SetFrameType_Impl( GetFrame()->GetFrameType() | nType );
-
- if ( GetFrame()->IsInPlace() )
- {
- LockAdjustPosSizePixel();
- }
-
- try
- {
- if ( pObjShell )
- SwitchToViewShell_Impl( nViewId );
- }
- catch (com::sun::star::uno::Exception& )
- {
- // make sure that the ctor is left regularly
- ReleaseObjectShell_Impl();
- return;
- }
-
- if ( GetFrame()->IsInPlace() )
- {
- UnlockAdjustPosSizePixel();
- }
- else if ( GetViewShell() && GetViewShell()->UseObjectSize() )
- {
- // initiale Gr"o\se festlegen
- // Zuerst die logischen Koordinaten von IP-Objekt und EditWindow
- // ber"ucksichtigen
- LockAdjustPosSizePixel();
- ForceInnerResize_Impl( TRUE );
-
- Window *pWindow = GetViewShell()->GetWindow();
-
- // Da in den Applikationen bei der R"ucktransformation immer die
- // Eckpunkte tranformiert werden und nicht die Size (um die Ecken
- // alignen zu k"onnen), transformieren wir hier auch die Punkte, um
- // m"oglichst wenig Rundungsfehler zu erhalten.
-/*
- Rectangle aRect = pWindow->LogicToLogic( GetObjectShell()->GetVisArea(),
- GetObjectShell()->GetMapUnit(),
- pWindow->GetMapMode() );
-*/
- Rectangle aRect = pWindow->LogicToPixel( GetObjectShell()->GetVisArea() );
- Size aSize = aRect.GetSize();
- GetViewShell()->GetWindow()->SetSizePixel( aSize );
- DoAdjustPosSizePixel(GetViewShell(), Point(), aSize );
- }
-}
-
-//------------------------------------------------------------------------
-SfxTopViewFrame::~SfxTopViewFrame()
-{
- DBG_DTOR(SfxTopViewFrame, 0);
-
- SetDowning_Impl();
-
- if ( SfxViewFrame::Current() == this )
- SfxViewFrame::SetViewFrame(NULL);
-
- ReleaseObjectShell_Impl();
- if ( pPendingCloser == pCloser )
- pPendingCloser = 0;
- delete pCloser;
- if ( GetFrame()->OwnsBindings_Impl() )
- // Die Bindings l"oscht der Frame!
- KillDispatcher_Impl();
-
- delete pImp->pWindow;
- delete pImp->pStopButtonTimer;
- delete pImp;
-}
-
-//------------------------------------------------------------------------
-sal_Bool SfxTopViewFrame::SetBorderPixelImpl( const SfxViewShell *pVSh, const SvBorder &rBorder )
-{
- if( SfxViewFrame::SetBorderPixelImpl( GetViewShell(), rBorder ) )
- {
- if ( IsResizeInToOut_Impl() && !GetFrame()->IsInPlace() )
- {
- Size aSize = pVSh->GetWindow()->GetOutputSizePixel();
- if ( aSize.Width() && aSize.Height() )
- {
- aSize.Width() += rBorder.Left() + rBorder.Right();
- aSize.Height() += rBorder.Top() + rBorder.Bottom();
-
- Size aOldSize = GetWindow().GetOutputSizePixel();
- GetWindow().SetOutputSizePixel( aSize );
- Window* pParent = &GetWindow();
- while ( pParent->GetParent() )
- pParent = pParent->GetParent();
- Size aOuterSize = pParent->GetOutputSizePixel();
- aOuterSize.Width() += ( aSize.Width() - aOldSize.Width() );
- aOuterSize.Height() += ( aSize.Height() - aOldSize.Height() );
- pParent->SetOutputSizePixel( aOuterSize );
- }
- }
- else
- {
- Point aPoint;
- Rectangle aEditArea( aPoint, GetWindow().GetOutputSizePixel() );
- aEditArea.Left() += rBorder.Left();
- aEditArea.Right() -= rBorder.Right();
- aEditArea.Top() += rBorder.Top();
- aEditArea.Bottom() -= rBorder.Bottom();
- pVSh->GetWindow()->SetPosSizePixel( aEditArea.TopLeft(), aEditArea.GetSize() );
- }
- return sal_True;
-
- }
- return sal_False;
-}
-
-void SfxTopViewFrame::Exec_Impl(SfxRequest &rReq )
-{
- // Wenn gerade die Shells ausgetauscht werden...
- if ( !GetObjectShell() || !GetViewShell() )
- return;
-
- switch ( rReq.GetSlot() )
- {
- case SID_SHOWPOPUPS :
- {
- SFX_REQUEST_ARG(rReq, pShowItem, SfxBoolItem, SID_SHOWPOPUPS, FALSE);
- BOOL bShow = pShowItem ? pShowItem->GetValue() : TRUE;
- SFX_REQUEST_ARG(rReq, pIdItem, SfxUInt16Item, SID_CONFIGITEMID, FALSE);
- USHORT nId = pIdItem ? pIdItem->GetValue() : 0;
-
- // ausfuehren
- SfxWorkWindow *pWorkWin = GetFrame()->GetWorkWindow_Impl();
- if ( bShow )
- {
- // Zuerst die Floats auch anzeigbar machen
- pWorkWin->MakeChildsVisible_Impl( bShow );
- GetDispatcher()->Update_Impl( TRUE );
-
- // Dann anzeigen
- GetBindings().HidePopups( !bShow );
- }
- else
- {
- // Alles hiden
- SfxBindings *pBind = &GetBindings();
- while ( pBind )
- {
- pBind->HidePopupCtrls_Impl( !bShow );
- pBind = pBind->GetSubBindings_Impl();
- }
-
- pWorkWin->HidePopups_Impl( !bShow, TRUE, nId );
- pWorkWin->MakeChildsVisible_Impl( bShow );
- }
-
- Invalidate( rReq.GetSlot() );
- rReq.Done();
- break;
- }
-
- case SID_ACTIVATE:
- {
- MakeActive_Impl( TRUE );
- rReq.SetReturnValue( SfxObjectItem( 0, this ) );
- break;
- }
-
- case SID_WIN_POSSIZE:
- break;
-
- case SID_NEWDOCDIRECT :
- {
- SFX_REQUEST_ARG( rReq, pFactoryItem, SfxStringItem, SID_NEWDOCDIRECT, FALSE);
- String aFactName;
- if ( pFactoryItem )
- aFactName = pFactoryItem->GetValue();
- else if ( pImp->aFactoryName.Len() )
- aFactName = pImp->aFactoryName;
- else
- {
- DBG_ERROR("Missing argument!");
- break;
- }
-
- SfxRequest aReq( SID_OPENDOC, SFX_CALLMODE_SYNCHRON, GetPool() );
- String aFact = String::CreateFromAscii("private:factory/");
- aFact += aFactName;
- aReq.AppendItem( SfxStringItem( SID_FILE_NAME, aFact ) );
- aReq.AppendItem( SfxFrameItem( SID_DOCFRAME, GetFrame() ) );
- aReq.AppendItem( SfxStringItem( SID_TARGETNAME, String::CreateFromAscii( "_blank" ) ) );
- SFX_APP()->ExecuteSlot( aReq );
- const SfxViewFrameItem* pItem = PTR_CAST( SfxViewFrameItem, aReq.GetReturnValue() );
- if ( pItem )
- rReq.SetReturnValue( SfxFrameItem( 0, pItem->GetFrame() ) );
- break;
- }
-
- case SID_CLOSEWIN:
- {
- // disable CloseWin, if frame is not a task
- Reference < XCloseable > xTask( GetFrame()->GetFrameInterface(), UNO_QUERY );
- if ( !xTask.is() )
- break;
-
- if ( GetViewShell()->PrepareClose() )
- {
- // weitere Views auf dasselbe Doc?
- SfxObjectShell *pDocSh = GetObjectShell();
- int bOther = sal_False;
- for ( const SfxTopViewFrame *pFrame =
- (SfxTopViewFrame *)SfxViewFrame::GetFirst( pDocSh, TYPE(SfxTopViewFrame) );
- !bOther && pFrame;
- pFrame = (SfxTopViewFrame *)SfxViewFrame::GetNext( *pFrame, pDocSh, TYPE(SfxTopViewFrame) ) )
- bOther = (pFrame != this);
-
- // Doc braucht nur gefragt zu werden, wenn keine weitere View
- sal_Bool bClosed = sal_False;
- sal_Bool bUI = TRUE;
- if ( ( bOther || pDocSh->PrepareClose( bUI ) ) )
- {
- if ( !bOther )
- pDocSh->SetModified( FALSE );
- rReq.Done(); // unbedingt vor Close() rufen!
- bClosed = sal_False;
- try
- {
- xTask->close(sal_True);
- bClosed = sal_True;
- }
- catch( CloseVetoException& )
- {
- bClosed = sal_False;
- }
- }
-
- rReq.SetReturnValue( SfxBoolItem( rReq.GetSlot(), bClosed ));
- }
- return;
- }
- }
-
- rReq.Done();
-}
-
-void SfxTopViewFrame::GetState_Impl( SfxItemSet &rSet )
-{
- SfxObjectShell *pDocSh = GetObjectShell();
-
- if ( !pDocSh )
- return;
-
- const sal_uInt16 *pRanges = rSet.GetRanges();
- DBG_ASSERT(pRanges, "Set ohne Bereich");
- while ( *pRanges )
- {
- for ( sal_uInt16 nWhich = *pRanges++; nWhich <= *pRanges; ++nWhich )
- {
- switch(nWhich)
- {
- case SID_NEWDOCDIRECT :
- {
- if ( pImp->aFactoryName.Len() )
- {
- String aFact = String::CreateFromAscii("private:factory/");
- aFact += pImp->aFactoryName;
- rSet.Put( SfxStringItem( nWhich, aFact ) );
- }
- break;
- }
-
- case SID_NEWWINDOW:
- rSet.DisableItem(nWhich);
- break;
-
- case SID_CLOSEWIN:
- {
- // disable CloseWin, if frame is not a task
- Reference < XCloseable > xTask( GetFrame()->GetFrameInterface(), UNO_QUERY );
- if ( !xTask.is() )
- rSet.DisableItem(nWhich);
- break;
- }
-
- case SID_SHOWPOPUPS :
- break;
-
- case SID_WIN_POSSIZE:
- {
- rSet.Put( SfxRectangleItem( nWhich, Rectangle(
- GetWindow().GetPosPixel(), GetWindow().GetSizePixel() ) ) );
- break;
- }
-
- default:
- DBG_ERROR( "invalid message-id" );
- }
- }
- ++pRanges;
- }
-}
-
-void SfxTopViewFrame::INetExecute_Impl( SfxRequest &rRequest )
-{
- sal_uInt16 nSlotId = rRequest.GetSlot();
- switch( nSlotId )
- {
- case SID_BROWSE_FORWARD:
- case SID_BROWSE_BACKWARD:
- {
- // Anzeige der n"achsten oder vorherigen Seite aus der History
- SFX_REQUEST_ARG( rRequest, pSteps, SfxUInt16Item, nSlotId, sal_False );
- GetFrame()->Browse( nSlotId == SID_BROWSE_FORWARD, pSteps ? pSteps->GetValue() : 1,
- (rRequest.GetModifier() & KEY_MOD1) != 0 );
- break;
- }
- case SID_CREATELINK:
- {
-/*! (pb) we need new implementation to create a link
-*/
- break;
- }
- case SID_BROWSE_STOP:
- {
- if ( GetCancelManager() )
- GetCancelManager()->Cancel( TRUE );
-
- // cancel jobs in hidden tasks
- SfxFrameArr_Impl& rArr = *SFX_APP()->Get_Impl()->pTopFrames;
- for( USHORT nPos = rArr.Count(); nPos--; )
- {
- SfxFrame *pFrame = rArr[ nPos ];
- if ( !pFrame->GetCurrentViewFrame() )
- pFrame->GetCancelManager()->Cancel( TRUE );
- }
-
- break;
- }
- case SID_FOCUSURLBOX:
- {
- SfxStateCache *pCache = GetBindings().GetAnyStateCache_Impl( SID_OPENURL );
- if( pCache )
- {
- SfxControllerItem* pCtrl = pCache->GetItemLink();
- while( pCtrl )
- {
- pCtrl->StateChanged( SID_FOCUSURLBOX, SFX_ITEM_UNKNOWN, 0 );
- pCtrl = pCtrl->GetItemLink();
- }
- }
- }
- }
-
- // Recording
- rRequest.Done();
-}
-
-void SfxTopViewFrame::INetState_Impl( SfxItemSet &rItemSet )
-{
- if ( !GetFrame()->CanBrowseForward() )
- rItemSet.DisableItem( SID_BROWSE_FORWARD );
-
- if ( !GetFrame()->CanBrowseBackward() )
- rItemSet.DisableItem( SID_BROWSE_BACKWARD );
-
- // Add/SaveToBookmark bei BASIC-IDE, QUERY-EDITOR etc. disablen
- SfxObjectShell *pDocSh = GetObjectShell();
- sal_Bool bPseudo = pDocSh && !( pDocSh->GetFactory().GetFlags() & SFXOBJECTSHELL_HASOPENDOC );
- sal_Bool bEmbedded = pDocSh && pDocSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED;
- if ( !pDocSh || bPseudo || bEmbedded || !pDocSh->HasName() )
- rItemSet.DisableItem( SID_CREATELINK );
-
- pImp->pStopButtonTimer->SetButtonState( GetCancelManager()->CanCancel() );
- if ( !pImp->pStopButtonTimer->GetButtonState() )
- rItemSet.DisableItem( SID_BROWSE_STOP );
-}
-
-void SfxTopViewFrame::SetZoomFactor( const Fraction &rZoomX, const Fraction &rZoomY )
-{
- GetViewShell()->SetZoomFactor( rZoomX, rZoomY );
-}
-
-void SfxTopViewFrame::Activate( sal_Bool bMDI )
-{
- DBG_ASSERT(GetViewShell(), "Keine Shell");
- if ( bMDI )
- pImp->bActive = sal_True;
-//(mba): hier evtl. wie in Beanframe NotifyEvent ?!
-}
-
-void SfxTopViewFrame::Deactivate( sal_Bool bMDI )
-{
- DBG_ASSERT(GetViewShell(), "Keine Shell");
- if ( bMDI )
- pImp->bActive = sal_False;
-//(mba): hier evtl. wie in Beanframe NotifyEvent ?!
-}
-
-void SfxTopFrame::CheckMenuCloser_Impl( MenuBar* pMenuBar )
-{
- Reference < ::com::sun::star::frame::XFrame > xFrame = GetFrameInterface();
-
- // checks if there is more than one "real" (not help) task window
- // in this case a close button is inserted into the menubar
-
- DBG_ASSERT( xFrame.is(), "Attention: this bug is very hard to reproduce. Please try to remember how you triggered it!");
- if ( !xFrame.is() || !xFrame->getController().is() )
- // dummy component
- return;
-
- Reference < ::com::sun::star::frame::XFramesSupplier > xDesktop( xFrame->getCreator(), UNO_QUERY );
- if ( !xDesktop.is() )
- // test only for task windows
- return;
-
- sal_Bool bLastTask = sal_False;
- Reference < ::com::sun::star::container::XIndexAccess >
- xList ( xDesktop->getFrames(), ::com::sun::star::uno::UNO_QUERY );
- sal_Int32 nCount = xList->getCount();
- if ( nCount<=1 )
- // only one task
- bLastTask = sal_True;
- else if ( nCount==2 )
- {
- // if we have to tasks, one can be the help task, that should be ignored
- for( sal_Int32 i=0; i<nCount; ++i )
- {
- Reference < ::com::sun::star::frame::XFrame > xTask;
- ::com::sun::star::uno::Any aVal = xList->getByIndex(i);
- if ( (aVal>>=xTask) && xTask.is() && xTask->getName().compareToAscii("OFFICE_HELP_TASK") == COMPARE_EQUAL )
- {
- // one of the two open tasks was the help task -> ignored
- bLastTask = sal_True;
- break;
- }
- }
- }
-
- pMenuBar->ShowCloser(bLastTask);
-}
diff --git a/sfx2/source/view/view.hxx b/sfx2/source/view/view.hxx
deleted file mode 100644
index e6daf9484d..0000000000
--- a/sfx2/source/view/view.hxx
+++ /dev/null
@@ -1,27 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
diff --git a/sfx2/source/view/viewfac.cxx b/sfx2/source/view/viewfac.cxx
index e22c08abe5..57187cda67 100644
--- a/sfx2/source/view/viewfac.cxx
+++ b/sfx2/source/view/viewfac.cxx
@@ -29,10 +29,8 @@
#include "precompiled_sfx2.hxx"
// INCLUDE ---------------------------------------------------------------
-#ifndef GCC
-#endif
-
#include <sfx2/app.hxx>
+#include <rtl/ustrbuf.hxx>
#include "viewfac.hxx"
// STATIC DATA -----------------------------------------------------------
@@ -51,6 +49,14 @@ void SfxViewFactory::InitFactory()
(*fnInit)();
}
+String SfxViewFactory::GetViewName() const
+{
+ ::rtl::OUStringBuffer aViewName;
+ aViewName.appendAscii( "view" );
+ aViewName.append( sal_Int32( GetOrdinal() ) );
+ return aViewName.makeStringAndClear();
+}
+
// CTOR / DTOR -----------------------------------------------------------
SfxViewFactory::SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI,
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index ad2bf643ca..8eb2fcfa4f 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -34,6 +34,7 @@
#include <com/sun/star/document/MacroExecMode.hpp>
#include <com/sun/star/frame/XLoadable.hpp>
#include <com/sun/star/frame/XLayoutManager.hpp>
+#include <com/sun/star/frame/XComponentLoader.hpp>
#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_
#include <toolkit/unohlp.hxx>
@@ -53,6 +54,7 @@
#endif
#include <svtools/sfxecode.hxx>
#include <svtools/ehdl.hxx>
+#include <tools/diagnose_ex.h>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/frame/XFramesSupplier.hpp>
#include <com/sun/star/frame/FrameSearchFlag.hpp>
@@ -61,8 +63,9 @@
#include <com/sun/star/frame/XFramesSupplier.hpp>
#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/frame/XController.hpp>
-#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/frame/XModel2.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
+#include <com/sun/star/util/XCloseable.hpp>
#include <com/sun/star/frame/XDispatchRecorderSupplier.hpp>
#include <com/sun/star/document/MacroExecMode.hpp>
#include <com/sun/star/document/UpdateDocMode.hpp>
@@ -76,6 +79,8 @@
#include <unotools/localfilehelper.hxx>
#include <unotools/ucbhelper.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/componentcontext.hxx>
+#include <comphelper/namedvaluecollection.hxx>
#include <comphelper/configurationhelper.hxx>
#include <com/sun/star/uno/Reference.h>
@@ -94,6 +99,8 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::ucb;
using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::lang;
+using ::com::sun::star::awt::XWindow;
+using ::com::sun::star::beans::PropertyValue;
namespace css = ::com::sun::star;
#ifndef GCC
@@ -123,7 +130,7 @@ namespace css = ::com::sun::star;
#include <sfx2/docfile.hxx>
#include <sfx2/module.hxx>
#include <sfx2/msgpool.hxx>
-#include <sfx2/topfrm.hxx>
+#include <sfx2/viewfrm.hxx>
#include "viewimp.hxx"
#include <sfx2/sfxbasecontroller.hxx>
#include <sfx2/sfx.hrc>
@@ -136,11 +143,14 @@ namespace css = ::com::sun::star;
#include "macro.hxx"
#include "minfitem.hxx"
#include "../appl/app.hrc"
+#include "impviewframe.hxx"
+
//-------------------------------------------------------------------------
DBG_NAME(SfxViewFrame)
#define SfxViewFrame
#include "sfxslots.hxx"
+#undef SfxViewFrame
//-------------------------------------------------------------------------
@@ -158,54 +168,6 @@ TYPEINIT1(SfxViewFrameItem, SfxPoolItem);
//=========================================================================
-struct SfxViewFrame_Impl
-{
- SvBorder aBorder;
- Size aMargin;
- Size aSize;
- String aViewData;
- String aFrameTitle;
- TypeId aLastType;
- String aActualURL;
- String aActualPresentationURL;
- SfxFrame* pFrame;
- SfxCancelManager* pCancelMgr;
- svtools::AsynchronLink* pReloader;
- //SfxInPlaceFrame* pIPFrame;
- Window* pWindow;
- SfxViewFrame* pActiveChild;
- SfxViewFrame* pParentViewFrame;
- SfxObjectShell* pImportShell;
- Window* pFocusWin;
- SfxMacro* pMacro;
- sal_uInt16 nDocViewNo;
- sal_uInt16 nCurViewId;
- sal_Bool bResizeInToOut:1;
- sal_Bool bDontOverwriteResizeInToOut:1;
- sal_Bool bObjLocked:1;
- sal_Bool bRestoreView:1;
- sal_Bool bSetViewFrameLocked:1;
- sal_Bool bReloading:1;
- sal_Bool bIsDowning:1;
- sal_Bool bInCtor:1;
- sal_Bool bModal:1;
- sal_Bool bEnabled:1;
- sal_Bool bEventFlag:1;
- sal_Bool bWindowWasEnabled:1;
-
- SfxViewFrame_Impl()
- : pReloader(0 )
- , pMacro( 0 )
- , bWindowWasEnabled(sal_True)
- {}
-
- ~SfxViewFrame_Impl()
- {
- delete pReloader;
- delete pCancelMgr;
- }
-};
-
//-------------------------------------------------------------------------
void SfxViewFrame::SetDowning_Impl()
{
@@ -219,31 +181,7 @@ sal_Bool SfxViewFrame::IsDowning_Impl() const
}
-//-------------------------------------------------------------------------
-void SfxViewFrame::SetSetViewFrameAllowed_Impl( sal_Bool bSet )
-{
- pImp->bSetViewFrameLocked = !bSet;
-};
-
-//-------------------------------------------------------------------------
-sal_Bool SfxViewFrame::IsSetViewFrameAllowed_Impl() const
-{
- return !pImp->bSetViewFrameLocked;
-}
-
-//-------------------------------------------------------------------------
-void SfxViewFrame::SetImportingObjectShell_Impl( SfxObjectShell* pSh )
-{
- pImp->pImportShell = pSh;
-}
-
//--------------------------------------------------------------------
-SfxObjectShell* SfxViewFrame::GetImportingObjectShell_Impl() const
-{
- return pImp->pImportShell;
-}
-
-
class SfxViewNotificatedFrameList_Impl :
public SfxListener, public SfxViewFrameArr_Impl
{
@@ -299,7 +237,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq, sal_Bool bAsync )
void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
{
- SfxFrame *pParent = GetFrame()->GetParentFrame();
+ SfxFrame *pParent = GetFrame().GetParentFrame();
if ( rReq.GetSlot() == SID_RELOAD )
{
// Bei CTRL-Reload den aktiven Frame reloaden
@@ -319,11 +257,11 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
// Wenn nur ein Reload der Graphiken eines oder mehrerer ChildFrames
// gemacht werden soll
- SfxFrame *pFrame = GetFrame();
- if ( pParent == pFrame && pFrame->GetChildFrameCount() )
+ SfxFrame& rFrame = GetFrame();
+ if ( pParent == &rFrame && rFrame.GetChildFrameCount() )
{
sal_Bool bReloadAvailable = sal_False;
- SfxFrameIterator aIter( *pFrame, sal_False );
+ SfxFrameIterator aIter( rFrame, sal_False );
SfxFrame *pChild = aIter.FirstFrame();
while ( pChild )
{
@@ -356,13 +294,11 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
}
SfxObjectShell* pSh = GetObjectShell();
- sal_Bool bWasReadonly = pSh->IsReadOnly();
-
switch ( rReq.GetSlot() )
{
case SID_EDITDOC:
{
- if ( GetFrame()->HasComponent() )
+ if ( GetFrame().HasComponent() )
break;
// Wg. Doppeltbelegung in Toolboxen (mit/ohne Ctrl) ist es auch
@@ -498,12 +434,11 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
// r/o-Doc kann nicht in Editmode geschaltet werden?
rReq.Done( sal_False );
- SFX_REQUEST_ARG( rReq, pFSetItem, SfxBoolItem, SID_EDIT_FRAMESET, sal_False);
if ( nOpenMode == SFX_STREAM_READWRITE && !rReq.IsAPI() )
{
// dem ::com::sun::star::sdbcx::User anbieten, als Vorlage zu oeffnen
QueryBox aBox( &GetWindow(), SfxResId(MSG_QUERY_OPENASTEMPLATE) );
- if ( !pFSetItem && RET_YES == aBox.Execute() )
+ if ( RET_YES == aBox.Execute() )
{
SfxApplication* pApp = SFX_APP();
SfxAllItemSet aSet( pApp->GetPool() );
@@ -544,16 +479,6 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
rReq.Done( sal_True );
// if( nOpenMode == SFX_STREAM_READONLY )
// pMed->Close();
-
- // ReloadForEdit bei Framesets schaltet auch FramesetEditmode
- sal_Bool bIsReadonly = GetObjectShell()->IsReadOnly();
- if ( bIsReadonly != bWasReadonly && !GetFrame()->GetParentFrame() )
- {
- SfxBoolItem aItem( SID_EDIT_FRAMESET, !bIsReadonly );
- GetDispatcher()->Execute( SID_EDIT_FRAMESET,
- SFX_CALLMODE_RECORD, &aItem, 0L );
- pSh->Broadcast( SfxSimpleHint( SFX_HINT_TITLECHANGED ) );
- }
return;
}
}
@@ -596,7 +521,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
// AutoLoad ist ggf. verboten
SFX_REQUEST_ARG(rReq, pAutoLoadItem, SfxBoolItem, SID_AUTOLOAD, sal_False);
if ( pAutoLoadItem && pAutoLoadItem->GetValue() &&
- GetFrame()->IsAutoLoadLocked_Impl() )
+ GetFrame().IsAutoLoadLocked_Impl() )
return;
SfxObjectShellLock xOldObj( pSh );
@@ -611,7 +536,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
// ggf. beim User nachfragen
sal_Bool bDo = ( GetViewShell()->PrepareClose() != FALSE );
SFX_REQUEST_ARG(rReq, pSilentItem, SfxBoolItem, SID_SILENT, sal_False);
- if ( bDo && GetFrame()->DocIsModified_Impl() &&
+ if ( bDo && GetFrame().DocIsModified_Impl() &&
!rReq.IsAPI() && ( !pSilentItem || !pSilentItem->GetValue() ) )
{
QueryBox aBox( &GetWindow(), SfxResId(MSG_QUERY_LASTVERSION) );
@@ -631,25 +556,21 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
// bestehende SfxMDIFrames f"ur dieses Doc leeren
// eigenes Format oder R/O jetzt editierbar "offnen?
- SfxViewNotificatedFrameList_Impl aFrames;
SfxObjectShellLock xNewObj;
- sal_Bool bRestoreView = ( pURLItem == NULL );
- TypeId aOldType = xOldObj->Type();
- SfxViewFrame *pView = GetFirst(xOldObj);
- while(pView)
+ // collect the views of the document
+ // TODO: when UNO ViewFactories are available for SFX-based documents, the below code should
+ // be UNOized, too
+ typedef ::std::pair< Reference< XFrame >, USHORT > ViewDescriptor;
+ ::std::list< ViewDescriptor > aViewFrames;
+ SfxViewFrame *pView = GetFirst( xOldObj );
+ while ( pView )
{
- if( bHandsOff )
- pView->GetDispatcher()->LockUI_Impl(sal_True);
- aFrames.InsertViewFrame( pView );
- pView->GetBindings().ENTERREGISTRATIONS();
-
- // RestoreView nur wenn keine neue Datei geladen
- // (Client-Pull-Reloading)
- pView = /*bHandsOff ? (SfxTopViewFrame*) GetFirst(
- xOldObj, TYPE(SfxTopViewFrame) ) :*/
- (SfxTopViewFrame*)GetNext( *pView, xOldObj,
- TYPE( SfxTopViewFrame ) );
+ Reference< XFrame > xFrame( pView->GetFrame().GetFrameInterface() );
+ OSL_ENSURE( xFrame.is(), "SfxViewFrame::ExecReload_Impl: no XFrame?!" );
+ aViewFrames.push_back( ViewDescriptor( xFrame, pView->GetCurViewId() ) );
+
+ pView = GetNext( *pView, xOldObj );
}
DELETEZ( xOldObj->Get_Impl()->pReloadTimer );
@@ -672,7 +593,6 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
{
pNewSet = new SfxAllItemSet( *pMedium->GetItemSet() );
pNewSet->ClearItem( SID_VIEW_ID );
- pNewSet->ClearItem( SID_USER_DATA );
pNewSet->ClearItem( SID_STREAM );
pNewSet->ClearItem( SID_INPUTSTREAM );
pNewSet->Put( SfxStringItem( SID_FILTER_NAME, pMedium->GetFilter()->GetName() ) );
@@ -741,9 +661,6 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
SFX_ITEMSET_ARG( pMedium->GetItemSet(), pSavedOptions, SfxStringItem, SID_FILE_FILTEROPTIONS, sal_False);
SFX_ITEMSET_ARG( pMedium->GetItemSet(), pSavedReferer, SfxStringItem, SID_REFERER, sal_False);
- if( !pURLItem || pURLItem->GetValue() == xOldObj->GetMedium()->GetName() )
- xOldObj->Get_Impl()->bForbidCaching = sal_True;
-
sal_Bool bHasStorage = pMedium->HasStorage_Impl();
if( bHandsOff )
{
@@ -758,12 +675,12 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
}
xNewObj = SfxObjectShell::CreateObject( pFilter->GetServiceName(), SFX_CREATE_MODE_STANDARD );
+ uno::Sequence < beans::PropertyValue > aLoadArgs;
+ TransformItems( SID_OPENDOC, *pNewSet, aLoadArgs );
try
{
- uno::Sequence < beans::PropertyValue > aProps;
- TransformItems( SID_OPENDOC, *pNewSet, aProps );
uno::Reference < frame::XLoadable > xLoad( xNewObj->GetModel(), uno::UNO_QUERY );
- xLoad->load( aProps );
+ xLoad->load( aLoadArgs );
}
catch ( uno::Exception& )
{
@@ -815,54 +732,41 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
{
if ( xNewObj->IsDocShared() )
{
- // the file is shared but the closing can chang the sharing control file
+ // the file is shared but the closing can change the sharing control file
xOldObj->DoNotCleanShareControlFile();
}
+ // the Reload and Silent items were only temporary, remove them
xNewObj->GetMedium()->GetItemSet()->ClearItem( SID_RELOAD );
xNewObj->GetMedium()->GetItemSet()->ClearItem( SID_SILENT );
- UpdateDocument_Impl();
- }
+ TransformItems( SID_OPENDOC, *xNewObj->GetMedium()->GetItemSet(), aLoadArgs );
- SfxViewFrame* pThis = (SfxViewFrame*)this;
- sal_Bool bDeleted = aFrames.C40_GETPOS( SfxViewFrame, pThis ) == USHRT_MAX;
-
- if( !bDeleted )
- {
- GetBindings().Invalidate( SID_RELOAD );
- pImp->bReloading = sal_False;
+ UpdateDocument_Impl();
}
- // neues Doc in die bestehenden SfxMDIFrames einsetzen; wenn
- // das Reload geklappt hat, mu\s in diesem Frame kein Dokument
- // eingesetzt werden, weil das schon vom LoadEnvironment
- // gemacht wurde
- if ( xNewObj.Is() && xNewObj->Type() != aOldType )
- // RestoreView nur, wenn gleicher Dokumenttyp
- bRestoreView = sal_False;
-
- const sal_uInt16 nCount = aFrames.Count();
- for(sal_uInt16 i = 0; i < nCount; ++i)
+ if ( xNewObj.Is() )
{
- SfxViewFrame *pCurrView = aFrames.GetObject( i );
- if ( xNewObj.Is() )
+ try
{
- //if( /*!bHandsOff &&*/ this != pView )
- pCurrView->ReleaseObjectShell_Impl( bRestoreView );
- pCurrView->SetRestoreView_Impl( bRestoreView );
- //if( pView != this || !xNewObj.Is() )
+ while ( !aViewFrames.empty() )
{
- SfxFrame *pFrame = pCurrView->GetFrame();
- pFrame->InsertDocument(xNewObj.Is() ? xNewObj : xOldObj );
+ LoadViewIntoFrame_Impl( *xNewObj, aViewFrames.front().first, aLoadArgs, aViewFrames.front().second, false );
+ aViewFrames.pop_front();
+ }
+ }
+ catch( const Exception& )
+ {
+ // close the remaining frames
+ // Don't catch exceptions herein, if this fails, then we're left in an indetermined state, and
+ // crashing is better than trying to proceed
+ while ( !aViewFrames.empty() )
+ {
+ Reference< util::XCloseable > xClose( aViewFrames.front().first, UNO_QUERY_THROW );
+ xClose->close( sal_True );
+ aViewFrames.pop_front();
}
}
- pCurrView->GetBindings().LEAVEREGISTRATIONS();
- pCurrView->GetDispatcher()->LockUI_Impl( sal_False );
- }
-
- if ( xNewObj.Is() )
- {
// Propagate document closure.
SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_CLOSEDOC, GlobalEventConfig::GetEventName( STR_EVENT_CLOSEDOC ), xOldObj ) );
}
@@ -870,11 +774,6 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
// als erledigt recorden
rReq.Done( sal_True );
rReq.SetReturnValue(SfxBoolItem(rReq.GetSlot(), sal_True));
- if( !bDeleted )
- {
- Notify( *GetObjectShell(), SfxSimpleHint(
- SFX_HINT_TITLECHANGED ));
- }
return;
}
else
@@ -897,11 +796,11 @@ void SfxViewFrame::StateReload_Impl( SfxItemSet& rSet )
// Ich bin gerade am Reloaden und Yielde so vor mich hin ...
return;
- GetFrame()->GetParentFrame();
+ GetFrame().GetParentFrame();
SfxWhichIter aIter( rSet );
for ( sal_uInt16 nWhich = aIter.FirstWhich(); nWhich; nWhich = aIter.NextWhich() )
{
- if ( GetFrame()->HasComponent() )
+ if ( GetFrame().HasComponent() )
{
// Wenn die Komponente es nicht selbst dispatched, dann
// macht es auch keinen Sinn!
@@ -929,16 +828,7 @@ void SfxViewFrame::StateReload_Impl( SfxItemSet& rSet )
case SID_RELOAD:
{
- SfxFrame* pFrame = GetTopFrame();
- SfxViewFrame *pView = pFrame->GetCurrentViewFrame();
- if ( pView && pView->GetViewShell() &&
- pView->GetViewShell()->IsImplementedAsFrameset_Impl() &&
- pView->GetViewShell()->GetInterface()->GetSlot( nWhich ) )
- {
- // Hack f"ur Explorer: Reload wird an der ViewShell ausgef"uhrt
- pView->GetViewShell()->GetSlotState( nWhich, 0, &rSet );
- break;
- }
+ SfxFrame* pFrame = &GetTopFrame();
if ( !pSh || !pSh->CanReload_Impl() || pSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
rSet.DisableItem(nWhich);
@@ -1009,7 +899,7 @@ void SfxViewFrame::ExecHistory_Impl( SfxRequest &rReq )
}
else if ( GetViewShell() )
{
- // der SW hat eigenes Undo an der ::com::sun::star::sdbcx::View
+ // der SW hat eigenes Undo an der View
const SfxPoolItem *pRet = GetViewShell()->ExecuteSlot( rReq );
if ( pRet )
bOK = ((SfxBoolItem*)pRet)->GetValue();
@@ -1031,7 +921,7 @@ void SfxViewFrame::StateHistory_Impl( SfxItemSet &rSet )
SfxUndoManager *pShUndoMgr = pSh->GetUndoManager();
if ( !pShUndoMgr )
{
- // der SW hat eigenes Undo an der ::com::sun::star::sdbcx::View
+ // der SW hat eigenes Undo an der View
SfxWhichIter aIter( rSet );
SfxViewShell *pViewSh = GetViewShell();
if( !pViewSh ) return;
@@ -1075,86 +965,30 @@ void SfxViewFrame::StateHistory_Impl( SfxItemSet &rSet )
}
//--------------------------------------------------------------------
-void SfxViewFrame::SetObjectShell_Impl
-(
- SfxObjectShell& rObjSh, // eine initialisierte SfxObjectShell,
- FASTBOOL bDefaultView // sal_True: nicht restaurieren
-)
-
-/* [Beschreibung]
-
- Diese Methode setzt eine <SfxObjectShell> in den SfxViewFrame ein.
-
- Zuvor mu\s die vorherige SfxObjectShell, insofern schein eine gesetzt
- wurde, mit der Methode ReleaseObjectShell() entfernt worden sein. Somit
- kann durch Aufruf von ReleaseObjectShell() und SetObjectShell() die
- SfxObjectShell ausgetauscht werden.
-
-
- [Querverweise]
-
- <SfxViewFrame::ReleaseObjectShell()>
-*/
-
+void SfxViewFrame::PopShellAndSubShells_Impl( SfxViewShell& i_rViewShell )
{
- DBG_CHKTHIS(SfxViewFrame, 0);
- DBG_ASSERT( !xObjSh.Is(), "old feature used: only one Object per View!" );
-
- GetFrame()->ReleasingComponent_Impl( sal_False );
-
- // Doc einsetzen
- xObjSh = &rObjSh;
- if ( xObjSh.Is() && xObjSh->IsPreview() )
- SetQuietMode_Impl( sal_True );
-
- GetFrame()->SetFrameType_Impl( GetFrameType() & ~SFXFRAME_FRAMESET );
-
- // Modulshell einf"ugen
- SfxModule* pModule = xObjSh->GetModule();
- if( pModule )
- pDispatcher->InsertShell_Impl( *pModule, 1 );
-
- pDispatcher->Push( rObjSh );
- pDispatcher->Flush();
- StartListening( rObjSh );
-
- rObjSh.ViewAssigned();
- pDispatcher->SetReadOnly_Impl( rObjSh.IsReadOnly() );
-
- const SfxMedium *pMedium = GetObjectShell()->GetMedium();
- SFX_ITEMSET_ARG(
- pMedium->GetItemSet(), pHiddenItem, SfxBoolItem, SID_HIDDEN, sal_False );
- if ( !pHiddenItem || !pHiddenItem->GetValue() )
+ i_rViewShell.PopSubShells_Impl();
+ sal_uInt16 nLevel = pDispatcher->GetShellLevel( i_rViewShell );
+ if ( nLevel != USHRT_MAX )
{
- LockObjectShell_Impl(sal_True);
- GetDocNumber_Impl();
+ if ( nLevel )
+ {
+ // more sub shells on the stack, which were not affected by PopSubShells_Impl
+ SfxShell *pSubShell = pDispatcher->GetShell( nLevel-1 );
+ if ( pSubShell == i_rViewShell.GetSubShell() )
+ // "real" sub shells will be deleted elsewhere
+ pDispatcher->Pop( *pSubShell, SFX_SHELL_POP_UNTIL );
+ else
+ pDispatcher->Pop( *pSubShell, SFX_SHELL_POP_UNTIL | SFX_SHELL_POP_DELETE );
+ }
+ pDispatcher->Pop( i_rViewShell );
+ pDispatcher->Flush();
}
- // ::com::sun::star::sdbcx::View erzeugen
- if ( bDefaultView )
- SetRestoreView_Impl( sal_False );
-
-// So darf man es nicht machen, da LaodWindows hierueber laeuft. Kann meiner Meinung nach
-// auch nur beim Reload mit Dokumenttypwechsel passieren.
-/* if ( xObjSh->Type() != pImp->aLastType )
- SetRestoreView_Impl( sal_False ); */
-
- SwitchToViewShell_Impl( !IsRestoreView_Impl() ? (sal_uInt16) 0 : GetCurViewId() );
- rObjSh.PostActivateEvent_Impl( this );
- if ( Current() == this )
- SFX_APP()->NotifyEvent(SfxEventHint(SFX_EVENT_ACTIVATEDOC, GlobalEventConfig::GetEventName( STR_EVENT_ACTIVATEDOC ), &rObjSh ) );
-
- Notify( rObjSh, SfxSimpleHint(SFX_HINT_TITLECHANGED) );
- Notify( rObjSh, SfxSimpleHint(SFX_HINT_DOCCHANGED) );
-
- // Zur Sicherheit, aber eigentlich sollte jetzt nichts mehr passieren
- // ( kein erzwungenes Update )
- if ( SfxViewFrame::Current() == this )
- GetDispatcher()->Update_Impl();
}
//--------------------------------------------------------------------
-void SfxViewFrame::ReleaseObjectShell_Impl( sal_Bool bStoreView )
+void SfxViewFrame::ReleaseObjectShell_Impl()
/* [Beschreibung]
@@ -1166,7 +1000,7 @@ void SfxViewFrame::ReleaseObjectShell_Impl( sal_Bool bStoreView )
die SfxObjectShell ausgetauscht werden.
Zwischen RealeaseObjectShell() und SetObjectShell() darf die Kontrolle
- nicht an das ::com::sun::star::chaos::System abgegeben werden.
+ nicht an das System abgegeben werden.
[Querverweise]
@@ -1177,7 +1011,7 @@ void SfxViewFrame::ReleaseObjectShell_Impl( sal_Bool bStoreView )
DBG_CHKTHIS(SfxViewFrame, 0);
DBG_ASSERT( xObjSh.Is(), "no SfxObjectShell to release!" );
- GetFrame()->ReleasingComponent_Impl( sal_True );
+ GetFrame().ReleasingComponent_Impl( sal_True );
if ( GetWindow().HasChildPathFocus( sal_True ) )
{
DBG_ASSERT( !GetActiveChildFrame_Impl(), "Wrong active child frame!" );
@@ -1187,25 +1021,7 @@ void SfxViewFrame::ReleaseObjectShell_Impl( sal_Bool bStoreView )
SfxViewShell *pDyingViewSh = GetViewShell();
if ( pDyingViewSh )
{
- SetRestoreView_Impl( bStoreView );
- if ( bStoreView )
- pDyingViewSh->WriteUserData( GetViewData_Impl(), sal_True );
-
- // Jetzt alle SubShells wechhauen
- pDyingViewSh->PushSubShells_Impl( sal_False );
- sal_uInt16 nLevel = pDispatcher->GetShellLevel( *pDyingViewSh );
- if ( nLevel && nLevel != USHRT_MAX )
- {
- // Es gibt immer nocht SubShells
- SfxShell *pSubShell = pDispatcher->GetShell( nLevel-1 );
- if ( pSubShell == pDyingViewSh->GetSubShell() )
- //"Echte" Subshells nicht deleten
- pDispatcher->Pop( *pSubShell, SFX_SHELL_POP_UNTIL );
- else
- pDispatcher->Pop( *pSubShell, SFX_SHELL_POP_UNTIL | SFX_SHELL_POP_DELETE );
- }
- pDispatcher->Pop( *pDyingViewSh );
- pDispatcher->Flush();
+ PopShellAndSubShells_Impl( *pDyingViewSh );
pDyingViewSh->DisconnectAllClients();
SetViewShell_Impl(0);
delete pDyingViewSh;
@@ -1244,116 +1060,26 @@ void SfxViewFrame::ReleaseObjectShell_Impl( sal_Bool bStoreView )
GetDispatcher()->SetDisableFlags( 0 );
}
-//-------------------------------------------------------------------------
-
-String SfxViewFrame::UpdateTitle()
-
-/* [Beschreibung]
-
- Mit dieser Methode kann der SfxMDIFrame gezwungen werden, sich sofort
- den neuen Titel vom der <SfxObjectShell> zu besorgen.
-
- [Anmerkung]
-
- Dies ist z.B. dann notwendig, wenn man der SfxObjectShell als SfxListener
- zuh"ort und dort auf den <SfxSimpleHint> SFX_HINT_TITLECHANGED reagieren
- m"ochte, um dann die Titel seiner Views abzufragen. Diese Views (SfxMDIFrames)
- jedoch sind ebenfalls SfxListener und da die Reihenfolge der Benachrichtigung
- nicht feststeht, mu\s deren Titel-Update vorab erzwungen werden.
-
-
- [Beispiel]
-
- void SwDocShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
- {
- if ( rHint.IsA(TYPE(SfxSimpleHint)) )
- {
- switch( ( (SfxSimpleHint&) rHint ).GetId() )
- {
- case SFX_HINT_TITLECHANGED:
- for ( SfxMDIFrame *pMDI = (SfxMDIFrame*)
- SfxViewFrame::GetFirst(this, TYPE(SfxMDIFrame));
- pMDI;
- pMDI = (SfxMDIFrame*)
- SfxViewFrame::GetNext(this, TYPE(SfxMDIFrame));
- {
- pMDI->UpdateTitle();
- ... pMDI->GetName() ...
- }
- break;
- ...
- }
- }
- }
-*/
-
-{
- SfxObjectShell *pObjSh = GetObjectShell();
- if ( !pObjSh )
- return String();
-
-// if ( pObjSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
-// // kein UpdateTitle mit Embedded-ObjectShell
-// return String();
-
- const SfxMedium *pMedium = pObjSh->GetMedium();
- String aURL;
- GetFrame(); // -Wall required??
- if ( pObjSh->HasName() )
- {
- INetURLObject aTmp( pMedium->GetName() );
- aURL = aTmp.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET );
- }
-
- if ( aURL != pImp->aActualURL )
- // URL hat sich ge"andert
- pImp->aActualURL = aURL;
-
- // gibt es noch eine weitere View?
- sal_uInt16 nViews=0;
- for ( SfxViewFrame *pView= GetFirst(pObjSh);
- pView && nViews<2;
- pView = GetNext(*pView,pObjSh) )
- if ( ( pView->GetFrameType() & SFXFRAME_HASTITLE ) &&
- !IsDowning_Impl())
- nViews++;
-
- // Titel des Fensters
- String aTitle;
- if ( nViews == 2 || pImp->nDocViewNo > 1 )
- // dann die Nummer dranh"angen
- aTitle = pObjSh->UpdateTitle( NULL, pImp->nDocViewNo );
- else
- aTitle = pObjSh->UpdateTitle();
-
- // Name des SbxObjects
- String aSbxName = pObjSh->SfxShell::GetName();
- if ( IsVisible() )
- {
- aSbxName += ':';
- aSbxName += String::CreateFromInt32(pImp->nDocViewNo);
- }
-
- SetName( aSbxName );
- pImp->aFrameTitle = aTitle;
- GetBindings().Invalidate( SID_FRAMETITLE );
- GetBindings().Invalidate( SID_CURRENT_URL );
- return aTitle;
-}
-
-
//--------------------------------------------------------------------
sal_Bool SfxViewFrame::Close()
{
DBG_CHKTHIS(SfxViewFrame, 0);
- DBG_ASSERT( GetFrame()->IsClosing_Impl() || !GetFrame()->GetFrameInterface().is(), "ViewFrame closed too early!" );
+ DBG_ASSERT( GetFrame().IsClosing_Impl() || !GetFrame().GetFrameInterface().is(), "ViewFrame closed too early!" );
// Wenn bis jetzt noch nicht gespeichert wurde, sollen eingebettete Objekte
// auch nicht mehr automatisch gespeichert werden!
if ( GetViewShell() )
GetViewShell()->DiscardClients_Impl();
- Broadcast( SfxSimpleHint(SFX_HINT_DYING) );
+ Broadcast( SfxSimpleHint( SFX_HINT_DYING ) );
+
+ if (SfxViewFrame::Current() == this)
+ SfxViewFrame::SetViewFrame( NULL );
+
+ // Da der Dispatcher leer ger"aumt wird, kann man ihn auch nicht mehr
+ // vern"unftig verwenden - also besser still legen
+ GetDispatcher()->Lock(sal_True);
+ delete this;
return sal_True;
}
@@ -1394,7 +1120,7 @@ void SfxViewFrame::DoActivate( sal_Bool bUI, SfxViewFrame* pOldFrame )
SfxViewFrame *pFrame = GetParentViewFrame();
while ( pFrame )
{
- if ( !pOldFrame || !pOldFrame->GetFrame()->IsParent( pFrame->GetFrame() ) )
+ if ( !pOldFrame || !pOldFrame->GetFrame().IsParent( &pFrame->GetFrame() ) )
pFrame->pDispatcher->DoParentActivate_Impl();
pFrame = pFrame->GetParentViewFrame();
}
@@ -1412,8 +1138,8 @@ void SfxViewFrame::DoDeactivate(sal_Bool bUI, SfxViewFrame* pNewFrame )
// ViewFrames, erh"alt er ein ParentDeactivate
if ( bUI )
{
-// if ( GetFrame()->GetWorkWindow_Impl() )
-// GetFrame()->GetWorkWindow_Impl()->SaveStatus_Impl();
+// if ( GetFrame().GetWorkWindow_Impl() )
+// GetFrame().GetWorkWindow_Impl()->SaveStatus_Impl();
/*
SfxMedium* pMed = GetObjectShell() ? GetObjectShell()->GetMedium() : NULL;
if( pMed )
@@ -1428,7 +1154,7 @@ void SfxViewFrame::DoDeactivate(sal_Bool bUI, SfxViewFrame* pNewFrame )
SfxViewFrame *pFrame = GetParentViewFrame();
while ( pFrame )
{
- if ( !pNewFrame || !pNewFrame->GetFrame()->IsParent( pFrame->GetFrame() ) )
+ if ( !pNewFrame || !pNewFrame->GetFrame().IsParent( &pFrame->GetFrame() ) )
pFrame->pDispatcher->DoParentDeactivate_Impl();
pFrame = pFrame->GetParentViewFrame();
}
@@ -1445,7 +1171,7 @@ void SfxViewFrame::InvalidateBorderImpl( const SfxViewShell* pSh )
{
if ( GetViewShell() && GetWindow().IsVisible() )
{
- if ( GetFrame()->IsInPlace() )
+ if ( GetFrame().IsInPlace() )
{
/*
Size aSize( GetViewShell()->GetWindow()->GetSizePixel() );
@@ -1457,24 +1183,8 @@ void SfxViewFrame::InvalidateBorderImpl( const SfxViewShell* pSh )
return;
}
- if ( GetViewShell()->UseObjectSize() )
- {
- // Zun"achst die Gr"o\se des MDI-Fensters berechnen
-
- DoAdjustPosSizePixel( GetViewShell(), Point(),
- GetViewShell()->GetWindow()->GetSizePixel() );
-
- // Da nach einem InnerResize die Position des EditFensters und
- // damit auch der Tools nocht stimmt, mu\s nun noch einmal von
- // au\sen resized werden !
-
- ForceOuterResize_Impl(sal_True);
- }
-
DoAdjustPosSizePixel( (SfxViewShell *) GetViewShell(), Point(),
GetWindow().GetOutputSizePixel() );
- if ( GetViewShell()->UseObjectSize() )
- ForceOuterResize_Impl(sal_False);
}
}
}
@@ -1482,12 +1192,43 @@ void SfxViewFrame::InvalidateBorderImpl( const SfxViewShell* pSh )
//------------------------------------------------------------------------
sal_Bool SfxViewFrame::SetBorderPixelImpl
(
- const SfxViewShell* /*pSh*/,
+ const SfxViewShell* pVSh,
const SvBorder& rBorder
)
{
pImp->aBorder = rBorder;
+
+ if ( IsResizeInToOut_Impl() && !GetFrame().IsInPlace() )
+ {
+ Size aSize = pVSh->GetWindow()->GetOutputSizePixel();
+ if ( aSize.Width() && aSize.Height() )
+ {
+ aSize.Width() += rBorder.Left() + rBorder.Right();
+ aSize.Height() += rBorder.Top() + rBorder.Bottom();
+
+ Size aOldSize = GetWindow().GetOutputSizePixel();
+ GetWindow().SetOutputSizePixel( aSize );
+ Window* pParent = &GetWindow();
+ while ( pParent->GetParent() )
+ pParent = pParent->GetParent();
+ Size aOuterSize = pParent->GetOutputSizePixel();
+ aOuterSize.Width() += ( aSize.Width() - aOldSize.Width() );
+ aOuterSize.Height() += ( aSize.Height() - aOldSize.Height() );
+ pParent->SetOutputSizePixel( aOuterSize );
+ }
+ }
+ else
+ {
+ Point aPoint;
+ Rectangle aEditArea( aPoint, GetWindow().GetOutputSizePixel() );
+ aEditArea.Left() += rBorder.Left();
+ aEditArea.Right() -= rBorder.Right();
+ aEditArea.Top() += rBorder.Top();
+ aEditArea.Bottom() -= rBorder.Bottom();
+ pVSh->GetWindow()->SetPosSizePixel( aEditArea.TopLeft(), aEditArea.GetSize() );
+ }
+
return sal_True;
}
@@ -1505,15 +1246,22 @@ const SvBorder& SfxViewFrame::GetBorderPixelImpl
void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
{DBG_CHKTHIS(SfxViewFrame, 0);}
- if ( !xObjSh.Is() )
+
+ if( IsDowning_Impl())
return;
+ // we know only SimpleHints
if ( rHint.IsA(TYPE(SfxSimpleHint)) )
{
switch( ( (SfxSimpleHint&) rHint ).GetId() )
{
case SFX_HINT_MODECHANGED:
{
+ UpdateTitle();
+
+ if ( !xObjSh.Is() )
+ break;
+
// r/o Umschaltung?
SfxBindings& rBind = GetBindings();
rBind.Invalidate( SID_RELOAD );
@@ -1555,13 +1303,15 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
break;
}
- case SFX_HINT_DYING:
case SFX_HINT_DEINITIALIZING:
+ GetFrame().DoClose();
+ break;
+ case SFX_HINT_DYING:
// when the Object is being deleted, destroy the view too
if ( xObjSh.Is() )
ReleaseObjectShell_Impl();
else
- GetFrame()->DoClose();
+ GetFrame().DoClose();
break;
}
@@ -1586,6 +1336,9 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
case SFX_EVENT_OPENDOC:
case SFX_EVENT_CREATEDOC:
{
+ if ( !xObjSh.Is() )
+ break;
+
SfxBindings& rBind = GetBindings();
rBind.Invalidate( SID_RELOAD );
rBind.Invalidate( SID_EDITDOC );
@@ -1609,7 +1362,7 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
case SFX_EVENT_TOGGLEFULLSCREENMODE:
{
- if ( GetFrame()->OwnsBindings_Impl() )
+ if ( GetFrame().OwnsBindings_Impl() )
GetBindings().GetDispatcher_Impl()->Update_Impl( sal_True );
break;
}
@@ -1620,26 +1373,18 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
//------------------------------------------------------------------------
void SfxViewFrame::Construct_Impl( SfxObjectShell *pObjSh )
{
- pImp->pFrame->DocumentInserted( pObjSh );
- pImp->bInCtor = sal_True;
- pImp->pParentViewFrame = 0;
pImp->bResizeInToOut = sal_True;
pImp->bDontOverwriteResizeInToOut = sal_False;
- pImp->pImportShell = 0;
pImp->bObjLocked = sal_False;
- pImp->bEventFlag = sal_True;
pImp->pFocusWin = 0;
pImp->pActiveChild = NULL;
- pImp->bRestoreView = sal_False;
pImp->nCurViewId = 0;
- pImp->bSetViewFrameLocked = sal_False;
pImp->bReloading = sal_False;
pImp->bIsDowning = sal_False;
pImp->bModal = sal_False;
pImp->bEnabled = sal_True;
pImp->nDocViewNo = 0;
pImp->aMargin = Size( -1, -1 );
- pImp->pCancelMgr = 0;
pImp->pWindow = 0;
SetPool( &SFX_APP()->GetPool() );
@@ -1651,7 +1396,6 @@ void SfxViewFrame::Construct_Impl( SfxObjectShell *pObjSh )
if ( xObjSh.Is() && xObjSh->IsPreview() )
SetQuietMode_Impl( sal_True );
- GetFrame()->SetFrameType_Impl( GetFrameType() & ~SFXFRAME_FRAMESET );
if ( pObjSh )
{
pDispatcher->Push( *SFX_APP() );
@@ -1677,56 +1421,36 @@ void SfxViewFrame::Construct_Impl( SfxObjectShell *pObjSh )
SfxViewFrame *pThis = this; // wegen der kranken Array-Syntax
SfxViewFrameArr_Impl &rViewArr = SFX_APP()->GetViewFrames_Impl();
rViewArr.C40_INSERT(SfxViewFrame, pThis, rViewArr.Count() );
- pImp->bInCtor = sal_False;
}
-//------------------------------------------------------------------------
-SfxViewFrame::SfxViewFrame( SfxObjectShell &rObjShell, SfxBindings &rBindings,
- SfxFrame* pParent, sal_uInt32 nType )
-:
- pImp( new SfxViewFrame_Impl ),
- pDispatcher(0),
- pBindings(&rBindings),
- nAdjustPosPixelLock( 0 )
-{
- DBG_CTOR(SfxViewFrame, 0);
-
- SetFrame_Impl( pParent );
- pImp->pFrame->SetCurrentViewFrame_Impl( this );
- GetFrame()->SetFrameType_Impl( GetFrameType() | nType );
- Construct_Impl( &rObjShell );
-}
+SfxViewFrame::SfxViewFrame
+(
+ SfxFrame& rFrame,
+ SfxObjectShell* pObjShell
+)
-//------------------------------------------------------------------------
-SfxViewFrame::SfxViewFrame(const SfxViewFrame &rCopy, SfxBindings &rBindings,
- SfxFrame *pFrame )
-:
- pImp( new SfxViewFrame_Impl ),
- pDispatcher(0),
- pBindings(&rBindings),
- nAdjustPosPixelLock( 0 )
-{
- DBG_CTOR(SfxViewFrame, 0);
+/* [Beschreibung]
- SetFrame_Impl( pFrame );
- pImp->pFrame->SetCurrentViewFrame_Impl( this );
- GetFrame()->SetFrameType_Impl( rCopy.GetFrameType() );
- Construct_Impl( rCopy.GetObjectShell() );
-}
+ Ctor des SfxViewFrame f"ur eine <SfxObjectShell> aus der Ressource.
+ Die 'nViewId' der zu erzeugenden <SfxViewShell> kann angegeben werden
+ (default ist die zuerst registrierte SfxViewShell-Subklasse).
+*/
-SfxViewFrame::SfxViewFrame( SfxBindings& rBindings, SfxFrame *pFrame,
- SfxObjectShell *pDoc, sal_uInt32 nType )
- : pImp( new SfxViewFrame_Impl )
+ : pImp( new SfxViewFrame_Impl( rFrame ) )
, pDispatcher(0)
- , pBindings(&rBindings)
+ , pBindings( new SfxBindings )
, nAdjustPosPixelLock( 0 )
{
- DBG_CTOR(SfxViewFrame, 0);
+ DBG_CTOR( SfxViewFrame, NULL );
+
+ rFrame.SetCurrentViewFrame_Impl( this );
+ rFrame.SetFrameType_Impl( GetFrameType() | SFXFRAME_HASTITLE );
+ Construct_Impl( pObjShell );
- SetFrame_Impl( pFrame );
- pImp->pFrame->SetCurrentViewFrame_Impl( this );
- GetFrame()->SetFrameType_Impl( GetFrameType() | nType );
- Construct_Impl( pDoc);
+ pImp->pWindow = new SfxFrameViewWindow_Impl( this, rFrame.GetWindow() );
+ pImp->pWindow->SetSizePixel( rFrame.GetWindow().GetOutputSizePixel() );
+ rFrame.SetOwnsBindings_Impl( sal_True );
+ rFrame.CreateWorkWindow_Impl();
}
//------------------------------------------------------------------------
@@ -1734,12 +1458,21 @@ SfxViewFrame::~SfxViewFrame()
{
DBG_DTOR(SfxViewFrame, 0);
- if ( GetFrame() && GetFrame()->GetCurrentViewFrame() == this )
- GetFrame()->SetCurrentViewFrame_Impl( NULL );
+ SetDowning_Impl();
- SfxObjectShell* pSh = pImp->pImportShell;
- if( pSh )
- pSh->AbortImport();
+ if ( SfxViewFrame::Current() == this )
+ SfxViewFrame::SetViewFrame( NULL );
+
+ ReleaseObjectShell_Impl();
+
+ if ( GetFrame().OwnsBindings_Impl() )
+ // Die Bindings l"oscht der Frame!
+ KillDispatcher_Impl();
+
+ delete pImp->pWindow;
+
+ if ( GetFrame().GetCurrentViewFrame() == this )
+ GetFrame().SetCurrentViewFrame_Impl( NULL );
// von Frame-Liste abmelden
SfxApplication *pSfxApp = SFX_APP();
@@ -1781,12 +1514,11 @@ SfxViewFrame* SfxViewFrame::Current()
}
//--------------------------------------------------------------------
-sal_uInt16 SfxViewFrame::Count(TypeId aType)
+sal_uInt16 SfxViewFrame::Count()
/* [Beschreibung]
- Liefert die Anzahl der sichtbaren <SfxViewFrame>-Instanzen vom Typ
- 'aType' bzw. aller sichtbaren, falls 'aType==0' (default).
+ Liefert die Anzahl der sichtbaren <SfxViewFrame>-Instanzen.
*/
{
@@ -1797,8 +1529,7 @@ sal_uInt16 SfxViewFrame::Count(TypeId aType)
for ( sal_uInt16 i = 0; i < nCount; ++i )
{
SfxViewFrame *pFrame = rFrames[i];
- if ( ( !aType || pFrame->IsA(aType) ) &&
- pFrame->IsVisible() )
+ if ( pFrame->IsVisible() )
++nFound;
}
return nFound;
@@ -1809,7 +1540,6 @@ sal_uInt16 SfxViewFrame::Count(TypeId aType)
SfxViewFrame* SfxViewFrame::GetFirst
(
const SfxObjectShell* pDoc,
- TypeId aType,
sal_Bool bOnlyIfVisible
)
{
@@ -1820,9 +1550,9 @@ SfxViewFrame* SfxViewFrame::GetFirst
for ( sal_uInt16 nPos = 0; nPos < rFrames.Count(); ++nPos )
{
SfxViewFrame *pFrame = rFrames.GetObject(nPos);
- if ( ( !pDoc || pDoc == pFrame->GetObjectShell() ) &&
- ( !aType || pFrame->IsA(aType) ) &&
- ( !bOnlyIfVisible || pFrame->IsVisible()) )
+ if ( ( !pDoc || pDoc == pFrame->GetObjectShell() )
+ && ( !bOnlyIfVisible || pFrame->IsVisible() )
+ )
return pFrame;
}
@@ -1835,7 +1565,6 @@ SfxViewFrame* SfxViewFrame::GetNext
(
const SfxViewFrame& rPrev,
const SfxObjectShell* pDoc,
- TypeId aType,
sal_Bool bOnlyIfVisible
)
{
@@ -1852,9 +1581,9 @@ SfxViewFrame* SfxViewFrame::GetNext
for ( ++nPos; nPos < rFrames.Count(); ++nPos )
{
SfxViewFrame *pFrame = rFrames.GetObject(nPos);
- if ( ( !pDoc || pDoc == pFrame->GetObjectShell() ) &&
- ( !aType || pFrame->IsA(aType) ) &&
- ( !bOnlyIfVisible || pFrame->IsVisible()) )
+ if ( ( !pDoc || pDoc == pFrame->GetObjectShell() )
+ && ( !bOnlyIfVisible || pFrame->IsVisible() )
+ )
return pFrame;
}
return 0;
@@ -1887,7 +1616,7 @@ void SfxViewFrame::ShowStatusText( const String& /*rText*/)
/* OBSOLETE: If this is used, framework/uielement/progressbarwrapper.[h|c]xx &
framework/uielement/statusindicatorinterfacewrapper.[h|c]xx must be
extended to support a new interface to support ShowStatusText/HideStatusText
- SfxWorkWindow* pWorkWin = GetFrame()->GetWorkWindow_Impl();
+ SfxWorkWindow* pWorkWin = GetFrame().GetWorkWindow_Impl();
SfxStatusBarManager *pMgr = pWorkWin->GetStatusBarManager_Impl();
if ( pMgr )
{
@@ -1903,7 +1632,7 @@ void SfxViewFrame::HideStatusText()
/* OBSOLETE: If this is used, framework/uielement/progressbarwrapper.[h|c]xx &
framework/uielement/statusindicatorinterfacewrapper.[h|c]xx must be
extended to support a new interface to support ShowStatusText/HideStatusText
- SfxWorkWindow* pWorkWin = GetFrame()->GetWorkWindow_Impl();
+ SfxWorkWindow* pWorkWin = GetFrame().GetWorkWindow_Impl();
SfxStatusBarManager *pMgr = pWorkWin->GetStatusBarManager_Impl();
if ( pMgr )
pMgr->GetStatusBar()->ShowItems();
@@ -1978,7 +1707,7 @@ void SfxViewFrame::SetViewShell_Impl( SfxViewShell *pVSh )
SfxShell::SetViewShell_Impl( pVSh );
// Hack: InPlaceMode
- if ( pVSh && !pVSh->UseObjectSize() )
+ if ( pVSh )
pImp->bResizeInToOut = sal_False;
}
@@ -1988,21 +1717,10 @@ void SfxViewFrame::SetViewShell_Impl( SfxViewShell *pVSh )
Der ParentViewFrame ist der ViewFrame des Containers bei internem InPlace
*/
-void SfxViewFrame::SetParentViewFrame_Impl(SfxViewFrame *pFrame)
-{
- pImp->pParentViewFrame = pFrame;
-}
-
-//--------------------------------------------------------------------
-/*
- Beschreibung:
- Der ParentViewFrame ist der ViewFrame des Containers bei internem InPlace
-*/
-
//TODO/LATER: is it still necessary? is there a replacement for GetParentViewFrame_Impl?
SfxViewFrame* SfxViewFrame::GetParentViewFrame_Impl() const
{
- return pImp->pParentViewFrame;
+ return NULL;
}
//--------------------------------------------------------------------
@@ -2027,7 +1745,7 @@ void SfxViewFrame::DoAdjustPosSize( SfxViewShell *pSh,
const Point rPos, const Size &rSize )
{
DBG_CHKTHIS(SfxViewFrame, 0);
- if( pSh && !nAdjustPosPixelLock && pSh->UseObjectSize())
+ if( pSh && !nAdjustPosPixelLock )
{
Window *pWindow = pSh->GetWindow();
Point aPos = pWindow->LogicToPixel(rPos);
@@ -2060,7 +1778,7 @@ void SfxViewFrame::Enable( sal_Bool bEnable )
}
else
{
- Window *pWindow = &GetFrame()->GetTopFrame()->GetWindow();
+ Window *pWindow = &GetFrame().GetTopFrame().GetWindow();
if ( !bEnable )
pImp->bWindowWasEnabled = pWindow->IsInputEnabled();
if ( !bEnable || pImp->bWindowWasEnabled )
@@ -2110,7 +1828,7 @@ void SfxViewFrame::Show()
LockObjectShell_Impl( sal_True );
// Doc-Shell Titel-Nummer anpassen, get unique view-no
- if ( 0 == pImp->nDocViewNo && !(GetFrameType() & SFXFRAME_PLUGIN ) )
+ if ( 0 == pImp->nDocViewNo )
{
GetDocNumber_Impl();
UpdateTitle();
@@ -2121,12 +1839,12 @@ void SfxViewFrame::Show()
// Frame-Window anzeigen, aber nur wenn der ViewFrame kein eigenes Window
// hat oder wenn er keine Component enth"alt
- if ( &GetWindow() == &GetFrame()->GetWindow() || !GetFrame()->HasComponent() )
+ if ( &GetWindow() == &GetFrame().GetWindow() || !GetFrame().HasComponent() )
GetWindow().Show();
- GetFrame()->GetWindow().Show();
+ GetFrame().GetWindow().Show();
/* SfxViewFrame* pCurrent = SfxViewFrame::Current();
- if ( GetFrame()->GetFrameInterface()->isActive() &&
+ if ( GetFrame().GetFrameInterface()->isActive() &&
pCurrent != this &&
( !pCurrent || pCurrent->GetParentViewFrame_Impl() != this ) &&
!GetActiveChildFrame_Impl() )
@@ -2141,8 +1859,6 @@ void SfxViewFrame::Show()
//--------------------------------------------------------------------
sal_Bool SfxViewFrame::IsVisible() const
{
- //Window *pWin = pImp->bInCtor ? 0 : &GetWindow();
- //return GetFrame()->HasComponent() || pImp->bObjLocked || ( pWin && pWin->IsVisible() );
return pImp->bObjLocked;
}
@@ -2167,7 +1883,7 @@ void SfxViewFrame::LockObjectShell_Impl( sal_Bool bLock )
//--------------------------------------------------------------------
void SfxViewFrame::MakeActive_Impl( BOOL bGrabFocus )
{
- if ( GetViewShell() && !GetFrame()->IsClosing_Impl() )
+ if ( GetViewShell() && !GetFrame().IsClosing_Impl() )
{
if ( IsVisible() )
{
@@ -2186,7 +1902,7 @@ void SfxViewFrame::MakeActive_Impl( BOOL bGrabFocus )
}
SfxViewFrame* pCurrent = SfxViewFrame::Current();
- css::uno::Reference< css::frame::XFrame > xFrame = GetFrame()->GetFrameInterface();
+ css::uno::Reference< css::frame::XFrame > xFrame = GetFrame().GetFrameInterface();
if ( !bPreview )
{
SetViewFrame( this );
@@ -2202,7 +1918,7 @@ void SfxViewFrame::MakeActive_Impl( BOOL bGrabFocus )
SfxInPlaceClient *pCli = GetViewShell()->GetUIActiveClient();
if ( ( !pCli || !pCli->IsObjectUIActive() ) &&
( !pCurrent || pCurrent->GetParentViewFrame_Impl() != this ) )
- GetFrame()->GrabFocusOnComponent_Impl();
+ GetFrame().GrabFocusOnComponent_Impl();
}
}
else
@@ -2216,89 +1932,6 @@ void SfxViewFrame::MakeActive_Impl( BOOL bGrabFocus )
}
}
-//--------------------------------------------------------------------
-
-SfxViewShell* SfxViewFrame::CreateView_Impl( sal_uInt16 nViewId )
-
-/* [Beschreibung]
-
- Erzeugt eine SfxViewShell f"ur diesen SfxViewFrame. Wird auch aus
- <SfxObjectShell::LoadWindows_Impl()>
- gerufen.
-*/
-
-{
- DBG_ASSERT( GetObjectShell(), "Kein Dokument!" );
-
- LockAdjustPosSizePixel();
-
- // passende ::com::sun::star::sdbcx::View-Factory suchen
- SfxObjectFactory &rDocFact = GetObjectShell()->GetFactory();
- sal_uInt16 nNewNo = nViewId ? USHRT_MAX : 0;
- for ( sal_uInt16 nNo = 0;
- nNo < rDocFact.GetViewFactoryCount();
- ++nNo )
- {
- sal_uInt16 nFoundId = rDocFact.GetViewFactory(nNo).GetOrdinal();
- if ( nNewNo == USHRT_MAX )
- {
- if ( nViewId == nFoundId )
- nNewNo = nNo;
- }
- }
-
- // per Factory erzeugen
- GetBindings().ENTERREGISTRATIONS();
- SfxViewFactory &rViewFactory = rDocFact.GetViewFactory( nNewNo );
- SfxViewShell *pViewShell = rViewFactory.CreateInstance(this, 0);
- SetViewShell_Impl(pViewShell);
- UnlockAdjustPosSizePixel();
-
- if ( GetWindow().IsReallyVisible() )
- DoAdjustPosSizePixel(pViewShell, Point(), GetWindow().GetOutputSizePixel());
-
- // erste jetzt anzeigen (ausser wenn MTs BASIC-IDE mal wieder keins hat)
- Window *pViewWin = pViewShell->GetWindow();
- if ( pViewWin && pViewShell->IsShowView_Impl() )
- pViewWin->Show();
-
- // Dispatcher
- GetDispatcher()->Push( *pViewShell );
- if ( pViewShell->GetSubShell() )
- GetDispatcher()->Push( *pViewShell->GetSubShell() );
- pViewShell->PushSubShells_Impl();
-
-#if defined SFX_HINT_VIEWCREATED
- GetObjectShell()->Broadcast( SfxSimpleHint( SFX_HINT_VIEWCREATED ) );
-#endif
-
- GetBindings().LEAVEREGISTRATIONS();
-
- DBG_ASSERT( SFX_APP()->GetViewFrames_Impl().Count() == SFX_APP()->GetViewShells_Impl().Count(), "Inconsistent view arrays!" );
- return pViewShell;
-}
-
-//-------------------------------------------------------------------------
-SfxViewFrame* SfxViewFrame::SearchViewFrame( SfxViewFrame *pViewFrame,
- const String& rName )
-{
- if ( !pViewFrame )
- pViewFrame = SfxViewFrame::Current();
- if ( !pViewFrame )
- return NULL;
- SfxFrame *pFrame = pViewFrame->GetFrame()->SearchFrame( rName );
- if ( !pFrame )
- return NULL;
-
- // Der Frame ist selbst ein ViewFrame oder enth"alt einen
-/*
- pViewFrame = PTR_CAST( SfxViewFrame, pFrame );
- if ( !pViewFrame && pFrame->GetChildFrameCount() )
- pViewFrame = PTR_CAST( SfxViewFrame, pFrame->GetChildFrame(0) );
-*/
- return pFrame->GetCurrentViewFrame();
-}
-
//-------------------------------------------------------------------------
void SfxViewFrame::SetQuietMode_Impl( sal_Bool bOn )
@@ -2313,11 +1946,6 @@ SfxObjectShell* SfxViewFrame::GetObjectShell()
return xObjSh;
}
-void SfxViewFrame::SetMargin_Impl( const Size& rMargin )
-{
- pImp->aMargin = rMargin;
-}
-
const Size& SfxViewFrame::GetMargin_Impl() const
{
return pImp->aMargin;
@@ -2332,10 +1960,10 @@ void SfxViewFrame::SetActiveChildFrame_Impl( SfxViewFrame *pViewFrame )
pImp->pActiveChild = pViewFrame;
- Reference< XFramesSupplier > xFrame( GetFrame()->GetFrameInterface(), UNO_QUERY );
+ Reference< XFramesSupplier > xFrame( GetFrame().GetFrameInterface(), UNO_QUERY );
Reference< XFrame > xActive;
if ( pViewFrame )
- xActive = pViewFrame->GetFrame()->GetFrameInterface();
+ xActive = pViewFrame->GetFrame().GetFrameInterface();
if ( xFrame.is() ) // PB: #74432# xFrame cann be NULL
xFrame->setActiveFrame( xActive );
@@ -2364,20 +1992,181 @@ SfxViewFrame* SfxViewFrame::GetActiveChildFrame_Impl() const
}
//--------------------------------------------------------------------
+SfxViewFrame* SfxViewFrame::LoadViewIntoFrame_Impl_NoThrow( const SfxObjectShell& i_rDoc, const Reference< XFrame >& i_rFrame,
+ const USHORT i_nViewId, const bool i_bHidden )
+{
+ Reference< XFrame > xFrame( i_rFrame );
+ bool bOwnFrame = false;
+ SfxViewShell* pSuccessView = NULL;
+ try
+ {
+ if ( !xFrame.is() )
+ {
+ ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
+ Reference < XFrame > xDesktop( aContext.createComponent( "com.sun.star.frame.Desktop" ), UNO_QUERY_THROW );
+ xFrame.set( xDesktop->findFrame( DEFINE_CONST_UNICODE("_blank"), 0 ), UNO_SET_THROW );
+ bOwnFrame = true;
+ }
+
+ pSuccessView = LoadViewIntoFrame_Impl(
+ i_rDoc,
+ xFrame,
+ Sequence< PropertyValue >(), // means "reuse existing model's args"
+ i_nViewId,
+ i_bHidden
+ );
+
+ if ( bOwnFrame && !i_bHidden )
+ {
+ // ensure the frame/window is visible
+ Reference< XWindow > xContainerWindow( xFrame->getContainerWindow(), UNO_SET_THROW );
+ xContainerWindow->setVisible( sal_True );
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+
+ if ( pSuccessView )
+ return pSuccessView->GetViewFrame();
+
+ if ( bOwnFrame )
+ {
+ try
+ {
+ xFrame->dispose();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+ return NULL;
+}
+
+//--------------------------------------------------------------------
+SfxViewShell* SfxViewFrame::LoadViewIntoFrame_Impl( const SfxObjectShell& i_rDoc, const Reference< XFrame >& i_rFrame,
+ const Sequence< PropertyValue >& i_rLoadArgs, const USHORT i_nViewId,
+ const bool i_bHidden )
+{
+ Reference< XModel > xDocument( i_rDoc.GetModel(), UNO_SET_THROW );
+
+ ::comphelper::NamedValueCollection aTransformLoadArgs( i_rLoadArgs.getLength() ? i_rLoadArgs : xDocument->getArgs() );
+ aTransformLoadArgs.put( "Model", xDocument );
+ if ( i_nViewId )
+ aTransformLoadArgs.put( "ViewId", sal_Int16( i_nViewId ) );
+ if ( i_bHidden )
+ aTransformLoadArgs.put( "Hidden", i_bHidden );
+ else
+ aTransformLoadArgs.remove( "Hidden" );
+
+ ::rtl::OUString sURL( xDocument->getURL() );
+ if ( !sURL.getLength() )
+ sURL = i_rDoc.GetFactory().GetFactoryURL();
+
+ Reference< XComponentLoader > xLoader( i_rFrame, UNO_QUERY_THROW );
+ xLoader->loadComponentFromURL( sURL, ::rtl::OUString::createFromAscii( "_self" ), 0,
+ aTransformLoadArgs.getPropertyValues() );
+
+ SfxViewShell* pViewShell = SfxViewShell::Get( i_rFrame->getController() );
+ ENSURE_OR_THROW( pViewShell,
+ "SfxViewFrame::LoadViewIntoFrame_Impl: loading an SFX doc into a frame resulted in a non-SFX view - quite impossible" );
+ return pViewShell;
+}
+
+//--------------------------------------------------------------------
+
+SfxViewFrame* SfxViewFrame::LoadHiddenDocument( SfxObjectShell& i_rDoc, const USHORT i_nViewId )
+{
+ return LoadViewIntoFrame_Impl_NoThrow( i_rDoc, Reference< XFrame >(), i_nViewId, true );
+}
+
+//--------------------------------------------------------------------
+
+SfxViewFrame* SfxViewFrame::LoadDocument( SfxObjectShell& i_rDoc, const USHORT i_nViewId )
+{
+ return LoadViewIntoFrame_Impl_NoThrow( i_rDoc, Reference< XFrame >(), i_nViewId, false );
+}
+
+//--------------------------------------------------------------------
+
+SfxViewFrame* SfxViewFrame::LoadDocumentIntoFrame( SfxObjectShell& i_rDoc, const Reference< XFrame >& i_rTargetFrame, const USHORT i_nViewId )
+{
+ return LoadViewIntoFrame_Impl_NoThrow( i_rDoc, i_rTargetFrame, i_nViewId, false );
+}
+
+//--------------------------------------------------------------------
+
+SfxViewFrame* SfxViewFrame::LoadDocumentIntoFrame( SfxObjectShell& i_rDoc, const SfxFrameItem* i_pFrameItem, const USHORT i_nViewId )
+{
+ return LoadViewIntoFrame_Impl_NoThrow( i_rDoc, i_pFrameItem && i_pFrameItem->GetFrame() ? i_pFrameItem->GetFrame()->GetFrameInterface() : NULL, i_nViewId, false );
+}
+
+//--------------------------------------------------------------------
+SfxViewFrame* SfxViewFrame::DisplayNewDocument( SfxObjectShell& i_rDoc, const SfxRequest& i_rCreateDocRequest, const USHORT i_nViewId )
+{
+ SFX_REQUEST_ARG( i_rCreateDocRequest, pFrameItem, SfxUnoFrameItem, SID_FILLFRAME, FALSE );
+ SFX_REQUEST_ARG( i_rCreateDocRequest, pHiddenItem, SfxBoolItem, SID_HIDDEN, FALSE );
+
+ return LoadViewIntoFrame_Impl_NoThrow(
+ i_rDoc,
+ pFrameItem ? pFrameItem->GetFrame() : NULL,
+ i_nViewId,
+ pHiddenItem ? pHiddenItem->GetValue() : false
+ );
+}
+
+//--------------------------------------------------------------------
+
+SfxViewFrame* SfxViewFrame::Get( const Reference< XController>& i_rController, const SfxObjectShell* i_pDoc )
+{
+ if ( !i_rController.is() )
+ return NULL;
+
+ const SfxObjectShell* pDoc = i_pDoc;
+ if ( !pDoc )
+ {
+ Reference< XModel > xDocument( i_rController->getModel() );
+ for ( pDoc = SfxObjectShell::GetFirst( 0, false );
+ pDoc;
+ pDoc = SfxObjectShell::GetNext( *pDoc, 0, false )
+ )
+ {
+ if ( pDoc->GetModel() == xDocument )
+ break;
+ }
+ }
+
+ SfxViewFrame* pViewFrame = NULL;
+ for ( pViewFrame = SfxViewFrame::GetFirst( pDoc, FALSE );
+ pViewFrame;
+ pViewFrame = SfxViewFrame::GetNext( *pViewFrame, pDoc, FALSE )
+ )
+ {
+ if ( pViewFrame->GetViewShell()->GetController() == i_rController )
+ break;
+ }
+
+ return pViewFrame;
+}
+
+//--------------------------------------------------------------------
sal_Bool SfxViewFrame::SwitchToViewShell_Impl
(
- sal_uInt16 nViewId, /* > 0
- Registrierungs-Id der ::com::sun::star::sdbcx::View, auf die umge-
+ sal_uInt16 nViewIdOrNo, /* > 0
+ Registrierungs-Id der View, auf die umge-
schaltet werden soll, bzw. die erstmalig
erzeugt werden soll.
== 0
- Es soll die Default-::com::sun::star::sdbcx::View verwendet werden. */
+ Es soll die Default-View verwendet werden. */
sal_Bool bIsIndex /* sal_True
- 'nViewId' ist keine Registrations-Id sondern
- ein ::com::sun::star::sdbcx::Index in die f"ur die in diesem
+ 'nViewIdOrNo' ist keine Registrations-Id sondern
+ ein Index in die f"ur die in diesem
<SfxViewFrame> dargestellte <SfxObjectShell>.
*/
)
@@ -2403,174 +2192,64 @@ sal_Bool SfxViewFrame::SwitchToViewShell_Impl
*/
{
- try{
- DBG_ASSERT( GetObjectShell(), "Kein Dokument!" );
-
- SfxObjectFactory &rDocFact = GetObjectShell()->GetFactory();
-
- // find index of old and new ViewShell
- sal_uInt16 nOldNo = USHRT_MAX, nNewNo = USHRT_MAX;
- bIsIndex |= 0 == nViewId;
- for ( sal_uInt16 nNo = 0; nNo < rDocFact.GetViewFactoryCount(); ++nNo )
- {
- sal_uInt16 nFoundId = rDocFact.GetViewFactory(nNo).GetOrdinal();
- if ( nNewNo == USHRT_MAX )
- {
- if ( bIsIndex && nViewId == nNo )
- {
- nNewNo = nNo;
- nViewId = nFoundId; // for nViewId == 0
- }
- else if ( !bIsIndex && nViewId == nFoundId )
- nNewNo = nNo;
- }
- if ( pImp->nCurViewId == nFoundId )
- nOldNo = nNo;
- }
-
- if ( nNewNo == USHRT_MAX )
- {
- // unknown ID -> fall back to default
- sal_uInt16 nFoundId = rDocFact.GetViewFactory(0).GetOrdinal();
- nNewNo = 0;
- nViewId = nFoundId;
- if ( pImp->nCurViewId == nFoundId )
- nOldNo = 0;
- }
-
- SfxViewShell *pSh = GetViewShell();
-
- DBG_ASSERT( !pSh || nOldNo != USHRT_MAX, "old shell id not found" );
-
- // does a ViewShell exist already?
- SfxViewShell *pOldSh = pSh;
- if ( pOldSh )
+ try
{
- // ask wether it can be closed
- if ( !pOldSh->PrepareClose() )
- return sal_False;
+ ENSURE_OR_THROW( GetObjectShell() != NULL, "not possible without a document" );
- // remove SubShells from Dispatcher before switching to new ViewShell
- pOldSh->PushSubShells_Impl( sal_False );
- sal_uInt16 nLevel = pDispatcher->GetShellLevel( *pOldSh );
- if ( nLevel )
+ // if we already have a view shell, remove it
+ SfxViewShell* pOldSh = GetViewShell();
+ OSL_PRECOND( pOldSh, "SfxViewFrame::SwitchToViewShell_Impl: that's called *switch* (not for *initial-load*) for a reason" );
+ if ( pOldSh )
{
- SfxShell *pSubShell = pDispatcher->GetShell( nLevel-1 );
- if ( pSubShell == pOldSh->GetSubShell() )
- //"real" SubShells are not deleted
- pDispatcher->Pop( *pSubShell, SFX_SHELL_POP_UNTIL );
- else
- // SubShells only known to Dispatcher must be deleted
- pDispatcher->Pop( *pSubShell, SFX_SHELL_POP_UNTIL | SFX_SHELL_POP_DELETE );
- }
-
- pDispatcher->Pop( *pOldSh );
- GetBindings().Invalidate( nOldNo + SID_VIEWSHELL0 );
- }
-
- // remember ViewID
- pImp->nCurViewId = nViewId;
- GetBindings().Invalidate( nNewNo + SID_VIEWSHELL0 );
-
- // create new ViewShell
- SfxViewFactory &rViewFactory = rDocFact.GetViewFactory( nNewNo );
- LockAdjustPosSizePixel();
-
- GetBindings().ENTERREGISTRATIONS();
- pSh = rViewFactory.CreateInstance(this, pOldSh);
-
- Window *pEditWin = pSh->GetWindow();
- DBG_ASSERT( !pEditWin || !pEditWin->IsReallyVisible(), "don`t show your ViewShell`s Window by yourself!" );
+ // ask wether it can be closed
+ if ( !pOldSh->PrepareClose( TRUE ) )
+ return sal_False;
- // by setting the ViewShell it is prevented that disposing the Controller will destroy this ViewFrame also
- GetDispatcher()->SetDisableFlags( 0 );
- SetViewShell_Impl(pSh);
-
- Reference < ::com::sun::star::awt::XWindow > xWindow(
- GetFrame()->GetWindow().GetComponentInterface(), UNO_QUERY );
- Reference < XFrame > xFrame( GetFrame()->GetFrameInterface() );
- if ( !pSh->GetController().is() )
- pSh->SetController( new SfxBaseController( pSh ) );
- Reference < XController > xController( pSh->GetController() );
- xFrame->setComponent( xWindow, xController );
-
- xController->attachFrame( xFrame );
- Reference < XModel > xModel( GetObjectShell()->GetModel() );
- if ( xModel.is() )
- {
- xController->attachModel( xModel );
- xModel->connectController( xController );
- xModel->setCurrentController( xController );
- }
-
- GetDispatcher()->Push( *pSh );
- if ( pSh->GetSubShell() )
- GetDispatcher()->Push( *pSh->GetSubShell() );
- pSh->PushSubShells_Impl();
- GetDispatcher()->Flush();
-
- if ( pImp->bRestoreView && pImp->aViewData.Len() )
- {
- // restore view data if required
- pSh->ReadUserData( pImp->aViewData, sal_True );
- pImp->bRestoreView = sal_False;
- }
+ // remove sub shells from Dispatcher before switching to new ViewShell
+ PopShellAndSubShells_Impl( *pOldSh );
+ }
- // create UI elements before size is set
- if ( SfxViewFrame::Current() == this )
- GetDispatcher()->Update_Impl( sal_True );
+ GetBindings().ENTERREGISTRATIONS();
+ LockAdjustPosSizePixel();
- // allow resize events to be processed
- UnlockAdjustPosSizePixel();
+ // ID of the new view
+ SfxObjectFactory& rDocFact = GetObjectShell()->GetFactory();
+ const USHORT nViewId = ( bIsIndex || !nViewIdOrNo ) ? rDocFact.GetViewFactory( nViewIdOrNo ).GetOrdinal() : nViewIdOrNo;
- Window* pFrameWin = &GetWindow();
- if ( pFrameWin != &GetFrame()->GetWindow() )
- pFrameWin->Show();
+ // create and load new ViewShell
+ SfxViewShell* pNewSh = LoadViewIntoFrame_Impl(
+ *GetObjectShell(),
+ GetFrame().GetFrameInterface(),
+ Sequence< PropertyValue >(), // means "reuse existing model's args"
+ nViewId,
+ false
+ );
- if ( GetWindow().IsReallyVisible() )
- DoAdjustPosSizePixel( pSh, Point(), GetWindow().GetOutputSizePixel() );
+ // allow resize events to be processed
+ UnlockAdjustPosSizePixel();
- if ( pEditWin && pSh->IsShowView_Impl() )
- pEditWin->Show();
+ if ( GetWindow().IsReallyVisible() )
+ DoAdjustPosSizePixel( pNewSh, Point(), GetWindow().GetOutputSizePixel() );
- GetBindings().LEAVEREGISTRATIONS();
- delete pOldSh;
+ GetBindings().LEAVEREGISTRATIONS();
+ delete pOldSh;
}
- catch ( com::sun::star::uno::Exception& )
+ catch ( const com::sun::star::uno::Exception& )
{
// the SfxCode is not able to cope with exceptions thrown while creating views
// the code will crash in the stack unwinding procedure, so we shouldn't let exceptions go through here
- DBG_ERROR("Exception in SwitchToViewShell_Impl - urgent issue. Please contact development!");
+ DBG_UNHANDLED_EXCEPTION();
+ return sal_False;
}
DBG_ASSERT( SFX_APP()->GetViewFrames_Impl().Count() == SFX_APP()->GetViewShells_Impl().Count(), "Inconsistent view arrays!" );
return sal_True;
}
-//--------------------------------------------------------------------
-
-void SfxViewFrame::SetViewData_Impl( sal_uInt16 nViewId, const String &rViewData )
-{
- pImp->bRestoreView = sal_True;
- pImp->nCurViewId = nViewId;
- pImp->aViewData = rViewData;
-}
//-------------------------------------------------------------------------
-String& SfxViewFrame::GetViewData_Impl()
+void SfxViewFrame::SetCurViewId_Impl( const USHORT i_nID )
{
- return pImp->aViewData;
-}
-
-//-------------------------------------------------------------------------
-sal_Bool SfxViewFrame::IsRestoreView_Impl() const
-{
- return pImp->bRestoreView;
-}
-
-//-------------------------------------------------------------------------
-void SfxViewFrame::SetRestoreView_Impl( sal_Bool bOn )
-{
- pImp->bRestoreView = bOn;
+ pImp->nCurViewId = i_nID;
}
//-------------------------------------------------------------------------
@@ -2608,58 +2287,17 @@ void SfxViewFrame::ExecView_Impl
break;
}
- case SID_FILLFRAME:
- {
- // Bei Mail etc. k"onnen die Frames nicht angesprochen werden
- SfxFrame *pParent = GetFrame()->GetParentFrame();
- if ( pParent && pParent->GetCurrentViewFrame()->
- GetViewShell()->IsImplementedAsFrameset_Impl() )
- break;
-
- SfxViewFrame *pRet = NULL;
- SFX_REQUEST_ARG(
- rReq, pItem, SfxStringItem, SID_FILLFRAME, sal_False );
- if ( pItem )
- {
- String aName( pItem->GetValue() );
- sal_uInt16 nFrame = (sal_uInt16) aName.ToInt32();
- if ( nFrame == 0 )
- nFrame = USHRT_MAX;
-
- SfxFrameIterator aIter( *GetFrame(), sal_False );
- SfxFrame *pFrame = aIter.FirstFrame();
- sal_uInt16 nActFrame = 1;
- while ( pFrame )
- {
- SfxViewFrame *pView = pFrame->GetCurrentViewFrame();
- if (
- nActFrame == nFrame ||
- (
- pView &&
- aName.CompareIgnoreCaseToAscii( pView->SfxShell::GetName() ) == COMPARE_EQUAL
- )
- )
- {
- pRet = pView;
- break;
- }
-
- pFrame = aIter.NextFrame( *pFrame );
- nActFrame++;
- }
- }
-
- rReq.SetReturnValue( SfxObjectItem( SID_DOCFRAME, pRet ) );
- break;
- }
-
case SID_VIEWSHELL:
{
const SfxPoolItem *pItem = 0;
- if ( rReq.GetArgs() &&
- SFX_ITEM_SET == rReq.GetArgs()->GetItemState( SID_VIEWSHELL, sal_False, &pItem ) )
- rReq.SetReturnValue( SfxBoolItem(0, SwitchToViewShell_Impl(
- (sal_uInt16)((const SfxUInt16Item*) pItem)->GetValue()) ));
+ if ( rReq.GetArgs()
+ && SFX_ITEM_SET == rReq.GetArgs()->GetItemState( SID_VIEWSHELL, sal_False, &pItem )
+ )
+ {
+ const sal_uInt16 nViewId = static_cast< const SfxUInt16Item* >( pItem )->GetValue();
+ BOOL bSuccess = SwitchToViewShell_Impl( nViewId );
+ rReq.SetReturnValue( SfxBoolItem( 0, bSuccess ) );
+ }
break;
}
@@ -2669,86 +2307,40 @@ void SfxViewFrame::ExecView_Impl
case SID_VIEWSHELL3:
case SID_VIEWSHELL4:
{
- rReq.SetReturnValue( SfxBoolItem(0,
- SwitchToViewShell_Impl( rReq.GetSlot() - SID_VIEWSHELL0, sal_True ) ) );
+ const sal_uInt16 nViewNo = rReq.GetSlot() - SID_VIEWSHELL0;
+ BOOL bSuccess = SwitchToViewShell_Impl( nViewNo, sal_True );
+ rReq.SetReturnValue( SfxBoolItem( 0, bSuccess ) );
break;
}
case SID_NEWWINDOW:
{
// Hack. demnaechst virtuelle Funktion
- if ( !GetViewShell()->NewWindowAllowed() && !GetObjectShell()->HasName() )
- return;
-
- // ViewData bei FrameSets rekursiv holen
- GetFrame()->GetViewData_Impl();
- SfxMedium *pMed = GetObjectShell()->GetMedium();
- String aUserData;
- GetViewShell()->WriteUserData( aUserData, sal_True );
if ( !GetViewShell()->NewWindowAllowed() )
{
- SFX_REQUEST_ARG( rReq, pFrameItem, SfxUnoAnyItem, SID_FILLFRAME, sal_False );
- SfxFrame *pFrame = NULL;
- Reference < XFrame > xFrame;
- if ( pFrameItem )
- {
- pFrameItem->GetValue() >>= xFrame;
- pFrame = SfxTopFrame::Create( xFrame );
- }
- else
- pFrame = SfxTopFrame::Create();
-
- SfxAllItemSet aSet( SFX_APP()->GetPool() );
- SFX_REQUEST_ARG( rReq, pHiddenItem, SfxBoolItem, SID_HIDDEN, sal_False );
- if ( pHiddenItem )
- aSet.Put( *pHiddenItem );
-
- SFX_ITEMSET_ARG( pMed->GetItemSet(), pRefererItem, SfxStringItem, SID_REFERER, sal_False );
- SfxStringItem aReferer( SID_REFERER, DEFINE_CONST_UNICODE( "private:user" ) );
- if ( !pRefererItem )
- pRefererItem = &aReferer;
-
- aSet.Put( SfxStringItem( SID_FILE_NAME, pMed->GetName() ) );
- aSet.Put( SfxStringItem( SID_USER_DATA, aUserData ) );
- aSet.Put( SfxUInt16Item( SID_VIEW_ID, GetCurViewId() ) );
- aSet.Put( *pRefererItem );
- if( pMed->GetFilter() )
- aSet.Put( SfxStringItem( SID_FILTER_NAME, pMed->GetFilter()->GetFilterName()) );
- aSet.Put( SfxFrameItem ( SID_DOCFRAME, pFrame ) );
- if ( xFrame.is() )
- GetDispatcher()->Execute( SID_OPENDOC, SFX_CALLMODE_SYNCHRON, aSet );
- else
- GetDispatcher()->Execute( SID_OPENDOC, SFX_CALLMODE_ASYNCHRON, aSet );
- }
- else
- {
- pMed->GetItemSet()->Put( SfxStringItem( SID_USER_DATA, aUserData ) );
-
- BOOL bHidden = FALSE;
- SFX_REQUEST_ARG( rReq, pHiddenItem, SfxBoolItem, SID_HIDDEN, sal_False );
- if ( pHiddenItem )
- bHidden = pHiddenItem->GetValue();
- SFX_REQUEST_ARG( rReq, pFrameItem, SfxUnoAnyItem, SID_FILLFRAME, sal_False );
- if ( pFrameItem )
- {
- Reference < XFrame > xFrame;
- pFrameItem->GetValue() >>= xFrame;
- SfxFrame* pFrame = SfxTopFrame::Create( xFrame );
- pMed->GetItemSet()->ClearItem( SID_HIDDEN );
- pFrame->InsertDocument( GetObjectShell() );
- if ( !bHidden )
- xFrame->getContainerWindow()->setVisible( sal_True );
- }
- else
- {
- SfxAllItemSet aSet( GetPool() );
- aSet.Put( SfxBoolItem( SID_OPEN_NEW_VIEW, TRUE ) );
- SfxFrame* pFrame = SfxTopFrame::Create( GetObjectShell(), GetCurViewId(), bHidden, &aSet );
- if ( bHidden )
- pFrame->GetCurrentViewFrame()->LockObjectShell_Impl( TRUE );
- }
+ OSL_ENSURE( false, "You should have disabled the 'Window/New Window' slot!" );
+ return;
}
+ // ViewData bei FrameSets rekursiv holen
+ GetFrame().GetViewData_Impl();
+ SfxMedium* pMed = GetObjectShell()->GetMedium();
+
+ // do not open the new window hidden
+ pMed->GetItemSet()->ClearItem( SID_HIDDEN );
+
+ // the view ID (optional arg. TODO: this is currently not supported in the slot definition ...)
+ SFX_REQUEST_ARG( rReq, pViewIdItem, SfxUInt16Item, SID_VIEW_ID, sal_False );
+ const USHORT nViewId = pViewIdItem ? pViewIdItem->GetValue() : GetCurViewId();
+
+ Reference < XFrame > xFrame;
+ // the frame (optional arg. TODO: this is currently not supported in the slot definition ...)
+ SFX_REQUEST_ARG( rReq, pFrameItem, SfxUnoFrameItem, SID_FILLFRAME, sal_False );
+ if ( pFrameItem )
+ xFrame = pFrameItem->GetFrame();
+
+ LoadViewIntoFrame_Impl_NoThrow( *GetObjectShell(), xFrame, nViewId, false );
+
rReq.Done();
break;
}
@@ -2912,13 +2504,10 @@ void SfxViewFrame::StateView_Impl
case SID_NEWWINDOW:
{
- if ( !GetViewShell()->NewWindowAllowed() /* && !pDocSh->HasName() */ )
- rSet.DisableItem( nWhich );
- else
- {
- if (impl_maxOpenDocCountReached())
- rSet.DisableItem( nWhich );
- }
+ if ( !GetViewShell()->NewWindowAllowed()
+ || impl_maxOpenDocCountReached()
+ )
+ rSet.DisableItem( nWhich );
break;
}
}
@@ -2927,22 +2516,9 @@ void SfxViewFrame::StateView_Impl
}
//-------------------------------------------------------------------------
-void SfxViewFrame::GetState_Impl( SfxItemSet &rSet )
-{
- if ( GetViewShell() && GetViewShell()->GetVerbs().getLength() && !GetObjectShell()->IsInPlaceActive() )
- {
- uno::Any aAny;
- aAny <<= GetViewShell()->GetVerbs();
- rSet.Put( SfxUnoAnyItem( USHORT( SID_OBJECT ), aAny ) );
- }
- else
- rSet.DisableItem( SID_OBJECT );
-}
-
-//-------------------------------------------------------------------------
void SfxViewFrame::ToTop()
{
- GetFrame()->Appear();
+ GetFrame().Appear();
}
//-------------------------------------------------------------------------
@@ -2952,66 +2528,41 @@ SfxViewFrame* SfxViewFrame::GetParentViewFrame() const
Der ParentViewFrame ist der ViewFrame des ParentFrames
*/
{
- SfxFrame *pFrame = GetFrame()->GetParentFrame();
+ SfxFrame *pFrame = GetFrame().GetParentFrame();
return pFrame ? pFrame->GetCurrentViewFrame() : NULL;
}
//-------------------------------------------------------------------------
-SfxFrame* SfxViewFrame::GetFrame() const
+SfxFrame& SfxViewFrame::GetFrame() const
/*
Beschreibung:
GetFrame liefert den Frame, in dem sich der ViewFrame befindet
*/
{
- return pImp->pFrame;
-}
-
-//-------------------------------------------------------------------------
-void SfxViewFrame::SetFrame_Impl( SfxFrame *pFrame )
-{
- pImp->pFrame = pFrame;
+ return pImp->rFrame;
}
//-------------------------------------------------------------------------
SfxViewFrame* SfxViewFrame::GetTopViewFrame() const
{
- return GetFrame()->GetTopFrame()->GetCurrentViewFrame();
-}
-
-//-------------------------------------------------------------------------
-
-SfxCancelManager *SfxViewFrame::GetCancelManager() const
-
-/* <H3>Description</H3>
-
- Returns a pointer to the <SfxCancelManager> of the top-view-frame of
- this view-frame.
-*/
-
-{
- return GetTopViewFrame()->GetFrame()->GetCancelManager();
-}
-
-void SfxViewFrame::SetWindow_Impl( Window *pWin )
-{
- pImp->pWindow = pWin;
+ return GetFrame().GetTopFrame().GetCurrentViewFrame();
}
Window& SfxViewFrame::GetWindow() const
{
- return pImp->pWindow ? *pImp->pWindow : GetFrame()->GetWindow();
+ return pImp->pWindow ? *pImp->pWindow : GetFrame().GetWindow();
}
sal_Bool SfxViewFrame::DoClose()
{
- return GetFrame()->DoClose();
+ return GetFrame().DoClose();
}
String SfxViewFrame::GetActualPresentationURL_Impl() const
{
if ( xObjSh.Is() )
return xObjSh->GetMedium()->GetName();
- return pImp->aActualPresentationURL;
+ return String();
}
void SfxViewFrame::SetModalMode( sal_Bool bModal )
@@ -3028,7 +2579,7 @@ void SfxViewFrame::SetModalMode( sal_Bool bModal )
BOOL SfxViewFrame::IsInModalMode() const
{
- return pImp->bModal || GetFrame()->GetWindow().IsInModalMode();
+ return pImp->bModal || GetFrame().GetWindow().IsInModalMode();
}
void SfxViewFrame::Resize( BOOL bForce )
@@ -3040,18 +2591,14 @@ void SfxViewFrame::Resize( BOOL bForce )
SfxViewShell *pShell = GetViewShell();
if ( pShell )
{
- if ( GetFrame()->IsInPlace() )
+ if ( GetFrame().IsInPlace() )
{
Point aPoint = GetWindow().GetPosPixel();
DoAdjustPosSizePixel( pShell, aPoint, aSize );
}
else
{
- if ( pShell->UseObjectSize() )
- ForceOuterResize_Impl(TRUE);
DoAdjustPosSizePixel( pShell, Point(), aSize );
- if ( pShell->UseObjectSize() )
- ForceOuterResize_Impl(FALSE);
}
}
}
@@ -3324,7 +2871,7 @@ void SfxViewFrame::MiscExec_Impl( SfxRequest& rReq )
// try to find any active recorder on this frame
::rtl::OUString sProperty = rtl::OUString::createFromAscii("DispatchRecorderSupplier");
com::sun::star::uno::Reference< com::sun::star::frame::XFrame > xFrame(
- GetFrame()->GetFrameInterface(),
+ GetFrame().GetFrameInterface(),
com::sun::star::uno::UNO_QUERY);
com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xSet(xFrame,com::sun::star::uno::UNO_QUERY);
@@ -3389,7 +2936,7 @@ void SfxViewFrame::MiscExec_Impl( SfxRequest& rReq )
case SID_TOGGLESTATUSBAR:
{
com::sun::star::uno::Reference< com::sun::star::frame::XFrame > xFrame(
- GetFrame()->GetFrameInterface(),
+ GetFrame().GetFrameInterface(),
com::sun::star::uno::UNO_QUERY);
Reference< com::sun::star::beans::XPropertySet > xPropSet( xFrame, UNO_QUERY );
@@ -3436,14 +2983,14 @@ void SfxViewFrame::MiscExec_Impl( SfxRequest& rReq )
case SID_WIN_FULLSCREEN:
{
SFX_REQUEST_ARG(rReq, pItem, SfxBoolItem, rReq.GetSlot(), FALSE);
- SfxTopViewFrame *pTop= PTR_CAST( SfxTopViewFrame, GetTopViewFrame() );
+ SfxViewFrame *pTop = GetTopViewFrame();
if ( pTop )
{
- WorkWindow* pWork = (WorkWindow*) pTop->GetTopFrame_Impl()->GetTopWindow_Impl();
+ WorkWindow* pWork = (WorkWindow*) pTop->GetFrame().GetTopWindow_Impl();
if ( pWork )
{
com::sun::star::uno::Reference< com::sun::star::frame::XFrame > xFrame(
- GetFrame()->GetFrameInterface(),
+ GetFrame().GetFrameInterface(),
com::sun::star::uno::UNO_QUERY);
Reference< ::com::sun::star::beans::XPropertySet > xPropSet( xFrame, UNO_QUERY );
@@ -3478,7 +3025,7 @@ void SfxViewFrame::MiscExec_Impl( SfxRequest& rReq )
}
pWork->ShowFullScreenMode( bNewFullScreenMode );
pWork->SetMenuBarMode( bNewFullScreenMode ? MENUBAR_MODE_HIDE : MENUBAR_MODE_NORMAL );
- GetFrame()->GetWorkWindow_Impl()->SetFullScreen_Impl( bNewFullScreenMode );
+ GetFrame().GetWorkWindow_Impl()->SetFullScreen_Impl( bNewFullScreenMode );
if ( !pItem )
rReq.AppendItem( SfxBoolItem( SID_WIN_FULLSCREEN, bNewFullScreenMode ) );
rReq.Done();
@@ -3532,7 +3079,7 @@ void SfxViewFrame::MiscState_Impl(SfxItemSet &rSet)
::rtl::OUString sProperty = rtl::OUString::createFromAscii("DispatchRecorderSupplier");
com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xSet(
- GetFrame()->GetFrameInterface(),
+ GetFrame().GetFrameInterface(),
com::sun::star::uno::UNO_QUERY);
com::sun::star::uno::Any aProp = xSet->getPropertyValue(sProperty);
@@ -3555,7 +3102,7 @@ void SfxViewFrame::MiscState_Impl(SfxItemSet &rSet)
::rtl::OUString sProperty = rtl::OUString::createFromAscii("DispatchRecorderSupplier");
com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xSet(
- GetFrame()->GetFrameInterface(),
+ GetFrame().GetFrameInterface(),
com::sun::star::uno::UNO_QUERY);
com::sun::star::uno::Any aProp = xSet->getPropertyValue(sProperty);
@@ -3569,7 +3116,7 @@ void SfxViewFrame::MiscState_Impl(SfxItemSet &rSet)
{
com::sun::star::uno::Reference< ::com::sun::star::frame::XLayoutManager > xLayoutManager;
com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet > xSet(
- GetFrame()->GetFrameInterface(),
+ GetFrame().GetFrameInterface(),
com::sun::star::uno::UNO_QUERY);
com::sun::star::uno::Any aProp = xSet->getPropertyValue(
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" )) );
@@ -3587,10 +3134,10 @@ void SfxViewFrame::MiscState_Impl(SfxItemSet &rSet)
case SID_WIN_FULLSCREEN:
{
- SfxTopViewFrame *pTop= PTR_CAST( SfxTopViewFrame, GetTopViewFrame() );
+ SfxViewFrame* pTop = GetTopViewFrame();
if ( pTop )
{
- WorkWindow* pWork = (WorkWindow*) pTop->GetTopFrame_Impl()->GetTopWindow_Impl();
+ WorkWindow* pWork = (WorkWindow*) pTop->GetFrame().GetTopWindow_Impl();
if ( pWork )
{
rSet.Put( SfxBoolItem( nWhich, pWork->IsFullScreenMode() ) );
@@ -3639,7 +3186,7 @@ void SfxViewFrame::ChildWindowExecute( SfxRequest &rReq )
{
if (!SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::E_SDATABASE))
return;
- Reference < XFrame > xFrame = GetFrame()->GetTopFrame()->GetFrameInterface();
+ Reference < XFrame > xFrame = GetFrame().GetTopFrame().GetFrameInterface();
Reference < XFrame > xBeamer( xFrame->findFrame( DEFINE_CONST_UNICODE("_beamer"), FrameSearchFlag::CHILDREN ) );
BOOL bShow = FALSE;
BOOL bHasChild = xBeamer.is();
@@ -3740,7 +3287,7 @@ void SfxViewFrame::ChildWindowState( SfxItemSet& rState )
}
else if ( nSID == SID_BROWSER )
{
- Reference < XFrame > xFrame = GetFrame()->GetTopFrame()->GetFrameInterface()->
+ Reference < XFrame > xFrame = GetFrame().GetTopFrame().GetFrameInterface()->
findFrame( DEFINE_CONST_UNICODE("_beamer"), FrameSearchFlag::CHILDREN );
if ( !xFrame.is() )
rState.DisableItem( nSID );
@@ -3758,7 +3305,7 @@ void SfxViewFrame::ChildWindowState( SfxItemSet& rState )
SfxWorkWindow* SfxViewFrame::GetWorkWindow_Impl( USHORT /*nId*/ )
{
SfxWorkWindow* pWork = 0;
- pWork = GetFrame()->GetWorkWindow_Impl();
+ pWork = GetFrame().GetWorkWindow_Impl();
return pWork;
}
@@ -3820,11 +3367,6 @@ SfxChildWindow* SfxViewFrame::GetChildWindow(USHORT nId)
return pWork ? pWork->GetChildWindow_Impl(nId) : NULL;
}
-SfxMacro* SfxViewFrame::GetRecordingMacro_Impl()
-{
- return pImp->pMacro;
-}
-
void SfxViewFrame::UpdateDocument_Impl()
{
SfxObjectShell* pDoc = GetObjectShell();
@@ -3835,29 +3377,6 @@ void SfxViewFrame::UpdateDocument_Impl()
pDoc->UpdateFromTemplate_Impl();
}
-BOOL SfxViewFrame::ClearEventFlag_Impl()
-{
- if ( pImp->bEventFlag )
- {
- pImp->bEventFlag = FALSE;
- return TRUE;
- }
- else
- return FALSE;
-}
-
-SfxViewFrame* SfxViewFrame::CreateViewFrame( SfxObjectShell& rDoc, sal_uInt16 nViewId, sal_Bool bHidden )
-{
- SfxItemSet *pSet = rDoc.GetMedium()->GetItemSet();
- if ( nViewId )
- pSet->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) );
- if ( bHidden )
- pSet->Put( SfxBoolItem( SID_HIDDEN, sal_True ) );
-
- SfxFrame *pFrame = SfxTopFrame::Create( &rDoc, 0, bHidden );
- return pFrame->GetCurrentViewFrame();
-}
-
void SfxViewFrame::SetViewFrame( SfxViewFrame* pFrame )
{
SFX_APP()->SetViewFrame_Impl( pFrame );
diff --git a/sfx2/source/view/viewfrm2.cxx b/sfx2/source/view/viewfrm2.cxx
new file mode 100644
index 0000000000..cde08f292b
--- /dev/null
+++ b/sfx2/source/view/viewfrm2.cxx
@@ -0,0 +1,523 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General 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_sfx2.hxx"
+
+#include "impviewframe.hxx"
+#include "statcach.hxx"
+#include "viewfac.hxx"
+#include "workwin.hxx"
+
+#include "sfx2/app.hxx"
+#include "sfx2/bindings.hxx"
+#include "sfx2/ctrlitem.hxx"
+#include "sfx2/dispatch.hxx"
+#include "sfx2/docfac.hxx"
+#include "sfx2/docfile.hxx"
+#include "sfx2/objitem.hxx"
+#include "sfx2/objsh.hxx"
+#include "sfx2/request.hxx"
+#include "sfx2/viewfrm.hxx"
+#include "sfx2/viewsh.hxx"
+
+#include <com/sun/star/beans/NamedValue.hpp>
+#include <com/sun/star/beans/XMaterialHolder.hpp>
+#include <com/sun/star/util/XCloseable.hpp>
+
+#include <comphelper/componentcontext.hxx>
+#include <comphelper/namedvaluecollection.hxx>
+#include <comphelper/processfactory.hxx>
+#include <svtools/asynclink.hxx>
+#include <svl/eitem.hxx>
+#include <svl/intitem.hxx>
+#include <svl/rectitem.hxx>
+#include <svl/stritem.hxx>
+#include <tools/diagnose_ex.h>
+#include <tools/urlobj.hxx>
+#include <unotools/bootstrap.hxx>
+#include <unotools/configmgr.hxx>
+#include <vcl/window.hxx>
+
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::frame;
+using namespace ::com::sun::star::util;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::beans;
+using ::com::sun::star::lang::XMultiServiceFactory;
+using ::com::sun::star::lang::XComponent;
+
+//------------------------------------------------------------------------
+
+static ::rtl::OUString GetModuleName_Impl( const ::rtl::OUString& sDocService )
+{
+ uno::Reference< container::XNameAccess > xMM( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.frame.ModuleManager")), uno::UNO_QUERY );
+ ::rtl::OUString sVar;
+ if ( !xMM.is() )
+ return sVar;
+
+ try
+ {
+ ::comphelper::NamedValueCollection aAnalyzer( xMM->getByName( sDocService ) );
+ sVar = aAnalyzer.getOrDefault( "ooSetupFactoryUIName", ::rtl::OUString() );
+ }
+ catch( uno::Exception& )
+ {
+ sVar = ::rtl::OUString();
+ }
+
+ return sVar;
+}
+
+//--------------------------------------------------------------------
+void SfxFrameViewWindow_Impl::StateChanged( StateChangedType nStateChange )
+{
+ if ( nStateChange == STATE_CHANGE_INITSHOW )
+ {
+ SfxObjectShell* pDoc = pFrame->GetObjectShell();
+ if ( pDoc && !pFrame->IsVisible() )
+ pFrame->Show();
+
+ pFrame->Resize();
+ }
+ else
+ Window::StateChanged( nStateChange );
+}
+
+void SfxFrameViewWindow_Impl::Resize()
+{
+ if ( IsReallyVisible() || IsReallyShown() || GetOutputSizePixel().Width() )
+ pFrame->Resize();
+}
+
+static String _getTabString()
+{
+ String result;
+
+ Reference < XMaterialHolder > xHolder(
+ ::comphelper::getProcessServiceFactory()->createInstance(
+ DEFINE_CONST_UNICODE("com.sun.star.tab.tabreg") ), UNO_QUERY );
+ if (xHolder.is())
+ {
+ rtl::OUString aTabString;
+ Sequence< NamedValue > sMaterial;
+ if (xHolder->getMaterial() >>= sMaterial) {
+ for (int i=0; i < sMaterial.getLength(); i++) {
+ if ((sMaterial[i].Name.equalsAscii("title")) &&
+ (sMaterial[i].Value >>= aTabString))
+ {
+ result += ' ';
+ result += String(aTabString);
+ }
+ }
+ }
+ }
+ return result;
+}
+
+//========================================================================
+
+//--------------------------------------------------------------------
+String SfxViewFrame::UpdateTitle()
+
+/* [Beschreibung]
+
+ Mit dieser Methode kann der SfxViewFrame gezwungen werden, sich sofort
+ den neuen Titel vom der <SfxObjectShell> zu besorgen.
+
+ [Anmerkung]
+
+ Dies ist z.B. dann notwendig, wenn man der SfxObjectShell als SfxListener
+ zuh"ort und dort auf den <SfxSimpleHint> SFX_HINT_TITLECHANGED reagieren
+ m"ochte, um dann die Titel seiner Views abzufragen. Diese Views (SfxTopViewFrames)
+ jedoch sind ebenfalls SfxListener und da die Reihenfolge der Benachrichtigung
+ nicht feststeht, mu\s deren Titel-Update vorab erzwungen werden.
+
+
+ [Beispiel]
+
+ void SwDocShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
+ {
+ if ( rHint.IsA(TYPE(SfxSimpleHint)) )
+ {
+ switch( ( (SfxSimpleHint&) rHint ).GetId() )
+ {
+ case SFX_HINT_TITLECHANGED:
+ for ( SfxViewFrame *pTop = SfxViewFrame::GetFirst( this );
+ pTop;
+ pTop = SfxViewFrame::GetNext( this );
+ {
+ pTop->UpdateTitle();
+ ... pTop->GetName() ...
+ }
+ break;
+ ...
+ }
+ }
+ }
+*/
+
+{
+ DBG_CHKTHIS(SfxViewFrame, 0);
+
+ const SfxObjectFactory &rFact = GetObjectShell()->GetFactory();
+ pImp->aFactoryName = String::CreateFromAscii( rFact.GetShortName() );
+
+ SfxObjectShell *pObjSh = GetObjectShell();
+ if ( !pObjSh )
+ return String();
+
+// if ( pObjSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
+// // kein UpdateTitle mit Embedded-ObjectShell
+// return String();
+
+ const SfxMedium *pMedium = pObjSh->GetMedium();
+ String aURL;
+ GetFrame(); // -Wall required??
+ if ( pObjSh->HasName() )
+ {
+ INetURLObject aTmp( pMedium->GetName() );
+ aURL = aTmp.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET );
+ }
+
+ if ( aURL != pImp->aActualURL )
+ // URL hat sich ge"andert
+ pImp->aActualURL = aURL;
+
+ // gibt es noch eine weitere View?
+ sal_uInt16 nViews=0;
+ for ( SfxViewFrame *pView= GetFirst(pObjSh);
+ pView && nViews<2;
+ pView = GetNext(*pView,pObjSh) )
+ if ( ( pView->GetFrameType() & SFXFRAME_HASTITLE ) &&
+ !IsDowning_Impl())
+ nViews++;
+
+ // Titel des Fensters
+ String aTitle;
+ if ( nViews == 2 || pImp->nDocViewNo > 1 )
+ // dann die Nummer dranh"angen
+ aTitle = pObjSh->UpdateTitle( NULL, pImp->nDocViewNo );
+ else
+ aTitle = pObjSh->UpdateTitle();
+
+ // Name des SbxObjects
+ String aSbxName = pObjSh->SfxShell::GetName();
+ if ( IsVisible() )
+ {
+ aSbxName += ':';
+ aSbxName += String::CreateFromInt32(pImp->nDocViewNo);
+ }
+
+ SetName( aSbxName );
+ pImp->aFrameTitle = aTitle;
+ GetBindings().Invalidate( SID_FRAMETITLE );
+ GetBindings().Invalidate( SID_CURRENT_URL );
+
+ ::rtl::OUString aProductName;
+ ::utl::ConfigManager::GetDirectConfigProperty(::utl::ConfigManager::PRODUCTNAME) >>= aProductName;
+
+ aTitle += String::CreateFromAscii( " - " );
+ aTitle += String(aProductName);
+ aTitle += ' ';
+ ::rtl::OUString aDocServiceName( GetObjectShell()->GetFactory().GetDocumentServiceName() );
+ aTitle += String( GetModuleName_Impl( aDocServiceName ) );
+#ifdef DBG_UTIL
+ ::rtl::OUString aDefault;
+ aTitle += DEFINE_CONST_UNICODE(" [");
+ String aVerId( utl::Bootstrap::getBuildIdData( aDefault ));
+ aTitle += aVerId;
+ aTitle += ']';
+#endif
+
+ // append TAB string if available
+ aTitle += _getTabString();
+
+ GetBindings().Invalidate( SID_NEWDOCDIRECT );
+
+ /* AS_TITLE
+ Window* pWindow = GetFrame()->GetTopWindow_Impl();
+ if ( pWindow && pWindow->GetText() != aTitle )
+ pWindow->SetText( aTitle );
+ */
+ return aTitle;
+}
+
+void SfxViewFrame::Exec_Impl(SfxRequest &rReq )
+{
+ // Wenn gerade die Shells ausgetauscht werden...
+ if ( !GetObjectShell() || !GetViewShell() )
+ return;
+
+ switch ( rReq.GetSlot() )
+ {
+ case SID_SHOWPOPUPS :
+ {
+ SFX_REQUEST_ARG(rReq, pShowItem, SfxBoolItem, SID_SHOWPOPUPS, FALSE);
+ BOOL bShow = pShowItem ? pShowItem->GetValue() : TRUE;
+ SFX_REQUEST_ARG(rReq, pIdItem, SfxUInt16Item, SID_CONFIGITEMID, FALSE);
+ USHORT nId = pIdItem ? pIdItem->GetValue() : 0;
+
+ // ausfuehren
+ SfxWorkWindow *pWorkWin = GetFrame().GetWorkWindow_Impl();
+ if ( bShow )
+ {
+ // Zuerst die Floats auch anzeigbar machen
+ pWorkWin->MakeChildsVisible_Impl( bShow );
+ GetDispatcher()->Update_Impl( TRUE );
+
+ // Dann anzeigen
+ GetBindings().HidePopups( !bShow );
+ }
+ else
+ {
+ // Alles hiden
+ SfxBindings *pBind = &GetBindings();
+ while ( pBind )
+ {
+ pBind->HidePopupCtrls_Impl( !bShow );
+ pBind = pBind->GetSubBindings_Impl();
+ }
+
+ pWorkWin->HidePopups_Impl( !bShow, TRUE, nId );
+ pWorkWin->MakeChildsVisible_Impl( bShow );
+ }
+
+ Invalidate( rReq.GetSlot() );
+ rReq.Done();
+ break;
+ }
+
+ case SID_ACTIVATE:
+ {
+ MakeActive_Impl( TRUE );
+ rReq.SetReturnValue( SfxObjectItem( 0, this ) );
+ break;
+ }
+
+ case SID_NEWDOCDIRECT :
+ {
+ SFX_REQUEST_ARG( rReq, pFactoryItem, SfxStringItem, SID_NEWDOCDIRECT, FALSE);
+ String aFactName;
+ if ( pFactoryItem )
+ aFactName = pFactoryItem->GetValue();
+ else if ( pImp->aFactoryName.Len() )
+ aFactName = pImp->aFactoryName;
+ else
+ {
+ DBG_ERROR("Missing argument!");
+ break;
+ }
+
+ SfxRequest aReq( SID_OPENDOC, SFX_CALLMODE_SYNCHRON, GetPool() );
+ String aFact = String::CreateFromAscii("private:factory/");
+ aFact += aFactName;
+ aReq.AppendItem( SfxStringItem( SID_FILE_NAME, aFact ) );
+ aReq.AppendItem( SfxFrameItem( SID_DOCFRAME, &GetFrame() ) );
+ aReq.AppendItem( SfxStringItem( SID_TARGETNAME, String::CreateFromAscii( "_blank" ) ) );
+ SFX_APP()->ExecuteSlot( aReq );
+ const SfxViewFrameItem* pItem = PTR_CAST( SfxViewFrameItem, aReq.GetReturnValue() );
+ if ( pItem )
+ rReq.SetReturnValue( SfxFrameItem( 0, pItem->GetFrame() ) );
+ break;
+ }
+
+ case SID_CLOSEWIN:
+ {
+ // disable CloseWin, if frame is not a task
+ Reference < XCloseable > xTask( GetFrame().GetFrameInterface(), UNO_QUERY );
+ if ( !xTask.is() )
+ break;
+
+ if ( GetViewShell()->PrepareClose() )
+ {
+ // weitere Views auf dasselbe Doc?
+ SfxObjectShell *pDocSh = GetObjectShell();
+ int bOther = sal_False;
+ for ( const SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocSh );
+ !bOther && pFrame;
+ pFrame = SfxViewFrame::GetNext( *pFrame, pDocSh ) )
+ bOther = (pFrame != this);
+
+ // Doc braucht nur gefragt zu werden, wenn keine weitere View
+ sal_Bool bClosed = sal_False;
+ sal_Bool bUI = TRUE;
+ if ( ( bOther || pDocSh->PrepareClose( bUI ) ) )
+ {
+ if ( !bOther )
+ pDocSh->SetModified( FALSE );
+ rReq.Done(); // unbedingt vor Close() rufen!
+ bClosed = sal_False;
+ try
+ {
+ xTask->close(sal_True);
+ bClosed = sal_True;
+ }
+ catch( CloseVetoException& )
+ {
+ bClosed = sal_False;
+ }
+ }
+
+ rReq.SetReturnValue( SfxBoolItem( rReq.GetSlot(), bClosed ));
+ }
+ return;
+ }
+ }
+
+ rReq.Done();
+}
+
+void SfxViewFrame::GetState_Impl( SfxItemSet &rSet )
+{
+ SfxObjectShell *pDocSh = GetObjectShell();
+
+ if ( !pDocSh )
+ return;
+
+ const sal_uInt16 *pRanges = rSet.GetRanges();
+ DBG_ASSERT(pRanges, "Set ohne Bereich");
+ while ( *pRanges )
+ {
+ for ( sal_uInt16 nWhich = *pRanges++; nWhich <= *pRanges; ++nWhich )
+ {
+ switch(nWhich)
+ {
+ case SID_NEWDOCDIRECT :
+ {
+ if ( pImp->aFactoryName.Len() )
+ {
+ String aFact = String::CreateFromAscii("private:factory/");
+ aFact += pImp->aFactoryName;
+ rSet.Put( SfxStringItem( nWhich, aFact ) );
+ }
+ break;
+ }
+
+ case SID_NEWWINDOW:
+ rSet.DisableItem(nWhich);
+ break;
+
+ case SID_CLOSEWIN:
+ {
+ // disable CloseWin, if frame is not a task
+ Reference < XCloseable > xTask( GetFrame().GetFrameInterface(), UNO_QUERY );
+ if ( !xTask.is() )
+ rSet.DisableItem(nWhich);
+ break;
+ }
+
+ case SID_SHOWPOPUPS :
+ break;
+
+ case SID_OBJECT:
+ if ( GetViewShell() && GetViewShell()->GetVerbs().getLength() && !GetObjectShell()->IsInPlaceActive() )
+ {
+ uno::Any aAny;
+ aAny <<= GetViewShell()->GetVerbs();
+ rSet.Put( SfxUnoAnyItem( USHORT( SID_OBJECT ), aAny ) );
+ }
+ else
+ rSet.DisableItem( SID_OBJECT );
+ break;
+
+ default:
+ DBG_ERROR( "invalid message-id" );
+ }
+ }
+ ++pRanges;
+ }
+}
+
+void SfxViewFrame::INetExecute_Impl( SfxRequest &rRequest )
+{
+ sal_uInt16 nSlotId = rRequest.GetSlot();
+ switch( nSlotId )
+ {
+ case SID_BROWSE_FORWARD:
+ case SID_BROWSE_BACKWARD:
+ OSL_ENSURE( false, "SfxViewFrame::INetExecute_Impl: SID_BROWSE_FORWARD/BACKWARD are dead!" );
+ break;
+ case SID_CREATELINK:
+ {
+/*! (pb) we need new implementation to create a link
+*/
+ break;
+ }
+ case SID_FOCUSURLBOX:
+ {
+ SfxStateCache *pCache = GetBindings().GetAnyStateCache_Impl( SID_OPENURL );
+ if( pCache )
+ {
+ SfxControllerItem* pCtrl = pCache->GetItemLink();
+ while( pCtrl )
+ {
+ pCtrl->StateChanged( SID_FOCUSURLBOX, SFX_ITEM_UNKNOWN, 0 );
+ pCtrl = pCtrl->GetItemLink();
+ }
+ }
+ }
+ }
+
+ // Recording
+ rRequest.Done();
+}
+
+void SfxViewFrame::INetState_Impl( SfxItemSet &rItemSet )
+{
+ rItemSet.DisableItem( SID_BROWSE_FORWARD );
+ rItemSet.DisableItem( SID_BROWSE_BACKWARD );
+
+ // Add/SaveToBookmark bei BASIC-IDE, QUERY-EDITOR etc. disablen
+ SfxObjectShell *pDocSh = GetObjectShell();
+ sal_Bool bPseudo = pDocSh && !( pDocSh->GetFactory().GetFlags() & SFXOBJECTSHELL_HASOPENDOC );
+ sal_Bool bEmbedded = pDocSh && pDocSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED;
+ if ( !pDocSh || bPseudo || bEmbedded || !pDocSh->HasName() )
+ rItemSet.DisableItem( SID_CREATELINK );
+}
+
+void SfxViewFrame::SetZoomFactor( const Fraction &rZoomX, const Fraction &rZoomY )
+{
+ GetViewShell()->SetZoomFactor( rZoomX, rZoomY );
+}
+
+void SfxViewFrame::Activate( sal_Bool bMDI )
+{
+ DBG_ASSERT(GetViewShell(), "Keine Shell");
+ if ( bMDI )
+ pImp->bActive = sal_True;
+//(mba): hier evtl. wie in Beanframe NotifyEvent ?!
+}
+
+void SfxViewFrame::Deactivate( sal_Bool bMDI )
+{
+ DBG_ASSERT(GetViewShell(), "Keine Shell");
+ if ( bMDI )
+ pImp->bActive = sal_False;
+//(mba): hier evtl. wie in Beanframe NotifyEvent ?!
+}
diff --git a/sfx2/source/view/viewimp.hxx b/sfx2/source/view/viewimp.hxx
index 15a1aa10f2..1f7607ac0b 100644
--- a/sfx2/source/view/viewimp.hxx
+++ b/sfx2/source/view/viewimp.hxx
@@ -30,20 +30,16 @@
// include ---------------------------------------------------------------
-#ifndef __SBX_SBXOBJ_HXX
#include <basic/sbxobj.hxx>
-#endif
#include <sfx2/viewsh.hxx>
#include <sfx2/viewfrm.hxx> // SvBorder
#include <osl/mutex.hxx>
#include <cppuhelper/interfacecontainer.hxx>
-
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <svtools/acceleratorexecute.hxx>
-
#include <rtl/ref.hxx>
-
+#include <vcl/print.hxx>
#include <queue>
// forward ---------------------------------------------------------------
@@ -54,24 +50,6 @@ class SfxBaseController;
typedef SfxShell* SfxShellPtr_Impl;
SV_DECL_PTRARR( SfxShellArr_Impl, SfxShellPtr_Impl, 4, 4 )
-// struct SfxViewShell_Impl ----------------------------------------------
-#if 0
-class SfxAsyncPrintExec_Impl : public SfxListener
-{
- SfxViewShell* pView;
- ::std::queue < SfxRequest*> aReqs;
-
- virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
-
-public:
- SfxAsyncPrintExec_Impl( SfxViewShell* pShell)
- : pView( pShell )
- {}
-
- void AddRequest( SfxRequest& rReq );
-};
-#endif
-
class SfxClipboardChangeListener;
struct SfxViewShell_Impl
@@ -84,12 +62,10 @@ struct SfxViewShell_Impl
Size aOptimalSize;
Size aMargin;
USHORT nPrinterLocks;
- BOOL bUseObjectSize;
BOOL bCanPrint;
BOOL bHasPrintOptions;
BOOL bPlugInsActive;
BOOL bIsShowView;
- BOOL bFrameSetImpl;
BOOL bOwnsMenu;
BOOL bGotOwnerShip;
BOOL bGotFrameOwnerShip;
@@ -97,10 +73,10 @@ struct SfxViewShell_Impl
USHORT nFamily;
SfxBaseController* pController;
::svt::AcceleratorExecute* pAccExec;
-// SfxAsyncPrintExec_Impl* pPrinterCommandQueue;
com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue > aPrintOpts;
::rtl::Reference< SfxClipboardChangeListener > xClipboardListener;
-
+ vcl::PrinterController* pPrinterController;
+
SfxViewShell_Impl();
};
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index b167034362..15d07472b0 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -329,6 +329,9 @@ void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nSt
if ( m_bNeedsChange )
mpObjectShell->EnableSetModified( m_bOrigStatus );
+
+ if ( mpViewShell )
+ mpViewShell->pImp->pPrinterController = 0;
}
}
@@ -639,6 +642,8 @@ void SfxViewShell::ExecPrint( const uno::Sequence < beans::PropertyValue >& rPro
this,
rProps
) );
+ pImp->pPrinterController = pController.get();
+
SfxObjectShell *pObjShell = GetObjectShell();
pController->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "JobName" ) ),
makeAny( rtl::OUString( pObjShell->GetTitle(0) ) ) );
@@ -653,6 +658,11 @@ void SfxViewShell::ExecPrint( const uno::Sequence < beans::PropertyValue >& rPro
Printer::PrintJob( pController, aJobSetup );
}
+Printer* SfxViewShell::GetActivePrinter() const
+{
+ return pImp->pPrinterController ? pImp->pPrinterController->getPrinter().get() : 0;
+}
+
void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
{
// USHORT nCopies=1;
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 5543284056..93b6e7f308 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -81,7 +81,7 @@
#include "view.hrc"
#include "sfxlocal.hrc"
#include <sfx2/sfxbasecontroller.hxx>
-#include <sfx2/topfrm.hxx>
+#include <sfx2/viewfrm.hxx>
#include "mailmodelapi.hxx"
#include <sfx2/event.hxx>
#include <sfx2/fcontnr.hxx>
@@ -389,7 +389,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq )
case SID_ACTIVATE_STYLE_APPLY:
{
com::sun::star::uno::Reference< com::sun::star::frame::XFrame > xFrame(
- GetViewFrame()->GetFrame()->GetFrameInterface(),
+ GetViewFrame()->GetFrame().GetFrameInterface(),
com::sun::star::uno::UNO_QUERY);
Reference< com::sun::star::beans::XPropertySet > xPropSet( xFrame, UNO_QUERY );
@@ -485,7 +485,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq )
if ( pMailDocType )
aDocType = pMailDocType->GetValue();
- uno::Reference < frame::XFrame > xFrame( pFrame->GetFrame()->GetFrameInterface() );
+ uno::Reference < frame::XFrame > xFrame( pFrame->GetFrame().GetFrameInterface() );
SfxMailModel::SendMailResult eResult = SfxMailModel::SEND_MAIL_ERROR;
if ( nId == SID_MAIL_SENDDOC )
@@ -529,7 +529,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq )
const sal_Int32 FILTERFLAG_EXPORT = 0x00000002;
css::uno::Reference< lang::XMultiServiceFactory > xSMGR(::comphelper::getProcessServiceFactory(), css::uno::UNO_QUERY_THROW);
- css::uno::Reference < css::frame::XFrame > xFrame( pFrame->GetFrame()->GetFrameInterface() );
+ css::uno::Reference < css::frame::XFrame > xFrame( pFrame->GetFrame().GetFrameInterface() );
css::uno::Reference< css::frame::XModel > xModel;
const rtl::OUString aModuleManager( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ModuleManager" ));
@@ -686,8 +686,8 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq )
// ausfuehren
if ( !pShowItem || bActive != pImp->bPlugInsActive )
{
- SfxFrame* pTopFrame = GetFrame()->GetTopFrame();
- if ( pTopFrame != GetFrame()->GetFrame() )
+ SfxFrame* pTopFrame = &GetFrame()->GetTopFrame();
+ if ( pTopFrame != &GetFrame()->GetFrame() )
{
// FramesetDocument
SfxViewShell *pShell = pTopFrame->GetCurrentViewFrame()->GetViewShell();
@@ -773,7 +773,7 @@ void SfxViewShell::GetState_Impl( SfxItemSet &rSet )
aPrinterName = Printer::GetDefaultPrinterName();
if ( aPrinterName.getLength() > 0 )
{
- uno::Reference < frame::XFrame > xFrame( pFrame->GetFrame()->GetFrameInterface() );
+ uno::Reference < frame::XFrame > xFrame( pFrame->GetFrame().GetFrameInterface() );
::rtl::OUStringBuffer aBuffer( 60 );
aBuffer.append( RetrieveLabelFromCommand(
@@ -871,7 +871,7 @@ ErrCode SfxViewShell::DoVerb(long /*nVerb*/)
void SfxViewShell::OutplaceActivated( sal_Bool bActive, SfxInPlaceClient* /*pClient*/ )
{
if ( !bActive )
- GetFrame()->GetFrame()->Appear();
+ GetFrame()->GetFrame().Appear();
}
//--------------------------------------------------------------------
@@ -893,7 +893,7 @@ void SfxViewShell::InplaceDeactivated( SfxInPlaceClient* /*pClient*/ )
void SfxViewShell::UIActivating( SfxInPlaceClient* /*pClient*/ )
{
- uno::Reference < frame::XFrame > xOwnFrame( pFrame->GetFrame()->GetFrameInterface() );
+ uno::Reference < frame::XFrame > xOwnFrame( pFrame->GetFrame().GetFrameInterface() );
uno::Reference < frame::XFramesSupplier > xParentFrame( xOwnFrame->getCreator(), uno::UNO_QUERY );
if ( xParentFrame.is() )
xParentFrame->setActiveFrame( xOwnFrame );
@@ -906,12 +906,12 @@ void SfxViewShell::UIActivating( SfxInPlaceClient* /*pClient*/ )
void SfxViewShell::UIDeactivated( SfxInPlaceClient* /*pClient*/ )
{
- if ( !pFrame->GetFrame()->IsClosing_Impl() ||
+ if ( !pFrame->GetFrame().IsClosing_Impl() ||
SfxViewFrame::Current() != pFrame )
pFrame->GetDispatcher()->Update_Impl( TRUE );
pFrame->GetBindings().HidePopups(FALSE);
- // uno::Reference < frame::XFrame > xOwnFrame( pFrame->GetFrame()->GetFrameInterface() );
+ // uno::Reference < frame::XFrame > xOwnFrame( pFrame->GetFrame().GetFrameInterface() );
// uno::Reference < frame::XFramesSupplier > xParentFrame( xOwnFrame->getCreator(), uno::UNO_QUERY );
// if ( xParentFrame.is() )
// xParentFrame->setActiveFrame( uno::Reference < frame::XFrame >() );
@@ -992,7 +992,7 @@ void SfxViewShell::Activate( BOOL bMDI )
{
SfxObjectShell *pSh = GetViewFrame()->GetObjectShell();
if ( pSh->GetModel().is() )
- pSh->GetModel()->setCurrentController( GetViewFrame()->GetFrame()->GetController() );
+ pSh->GetModel()->setCurrentController( GetViewFrame()->GetFrame().GetController() );
SetCurrentDocument();
}
@@ -1252,8 +1252,6 @@ SfxViewShell::SfxViewShell
,pFrame(pViewFrame)
,pSubShell(0)
,pWindow(0)
- ,bMaximizeFirst( 0 != (nFlags & SFX_VIEW_MAXIMIZE_FIRST) )
- ,bOptimizeEach(0 != (nFlags & SFX_VIEW_OPTIMIZE_EACH))
,bNoNewWindow( 0 != (nFlags & SFX_VIEW_NO_NEWWINDOW) )
{
DBG_CTOR(SfxViewShell, 0);
@@ -1263,11 +1261,7 @@ SfxViewShell::SfxViewShell
pImp->bIsShowView =
!(SFX_VIEW_NO_SHOW == (nFlags & SFX_VIEW_NO_SHOW));
- pImp->bUseObjectSize = FALSE;
-// SFX_CREATE_MODE_EMBEDDED==pFrame->GetObjectShell()->GetCreateMode() &&
-// SFX_VIEW_OBJECTSIZE_EMBEDDED == (nFlags & SFX_VIEW_OBJECTSIZE_EMBEDDED);
pImp->bCanPrint = SFX_VIEW_CAN_PRINT == (nFlags & SFX_VIEW_CAN_PRINT);
- pImp->bFrameSetImpl = (nFlags & SFX_VIEW_IMPLEMENTED_AS_FRAMESET) != 0;
pImp->bHasPrintOptions =
SFX_VIEW_HAS_PRINTOPTIONS == (nFlags & SFX_VIEW_HAS_PRINTOPTIONS);
pImp->bPlugInsActive = TRUE;
@@ -1363,6 +1357,24 @@ SfxViewShell* SfxViewShell::Current()
//--------------------------------------------------------------------
+SfxViewShell* SfxViewShell::Get( const Reference< XController>& i_rController )
+{
+ if ( !i_rController.is() )
+ return NULL;
+
+ for ( SfxViewShell* pViewShell = SfxViewShell::GetFirst( NULL, FALSE );
+ pViewShell;
+ pViewShell = SfxViewShell::GetNext( *pViewShell, NULL, FALSE )
+ )
+ {
+ if ( pViewShell->GetController() == i_rController )
+ return pViewShell;
+ }
+ return NULL;
+}
+
+//--------------------------------------------------------------------
+
SdrView* SfxViewShell::GetDrawView() const
/* [Beschreibung]
@@ -1514,16 +1526,12 @@ void SfxViewShell::PushSubShells_Impl( BOOL bPush )
{
for ( USHORT n=0; n<nCount; n++ )
pDisp->Push( *pImp->aArr[n] );
-
-// HACK(evtl. PushSubShells fuer SW virtuell machen oder im SW umbauen)
-// Notify( *this, SfxSimpleHint( SFX_HINT_RESERVED4 ) );
}
else if ( nCount )
{
- pDisp->Pop( *pImp->aArr[0], SFX_SHELL_POP_UNTIL );
-
-// HACK(evtl. PushSubShells fuer SW virtuell machen oder im SW umbauen)
-// Notify( *this, SfxSimpleHint( SFX_HINT_RESERVED3 ) );
+ SfxShell& rPopUntil = *pImp->aArr[0];
+ if ( pDisp->GetShellLevel( rPopUntil ) != USHRT_MAX )
+ pDisp->Pop( rPopUntil, SFX_SHELL_POP_UNTIL );
}
pDisp->Flush();
@@ -1674,7 +1682,7 @@ BOOL SfxViewShell::ExecKey_Impl(const KeyEvent& aKey)
if (!pImp->pAccExec)
{
pImp->pAccExec = ::svt::AcceleratorExecute::createAcceleratorHelper();
- pImp->pAccExec->init(::comphelper::getProcessServiceFactory(), pFrame->GetFrame()->GetFrameInterface());
+ pImp->pAccExec->init(::comphelper::getProcessServiceFactory(), pFrame->GetFrame().GetFrameInterface());
}
return pImp->pAccExec->execute(aKey.GetKeyCode());
@@ -1779,13 +1787,6 @@ void SfxViewShell::DisconnectAllClients()
//--------------------------------------------------------------------
-BOOL SfxViewShell::UseObjectSize() const
-{
- return pImp->bUseObjectSize;
-}
-
-//--------------------------------------------------------------------
-
void SfxViewShell::QueryObjAreaPixel( Rectangle& ) const
{
}
@@ -1795,14 +1796,7 @@ void SfxViewShell::QueryObjAreaPixel( Rectangle& ) const
void SfxViewShell::AdjustVisArea(const Rectangle& rRect)
{
DBG_ASSERT (pFrame, "Kein Frame?");
- if ( UseObjectSize() )
- {
- Point aPos = rRect.TopLeft();
- Size aSize = GetObjectShell()->GetVisArea().GetSize();
- GetObjectShell()->SetVisArea( Rectangle(aPos, aSize) );
- }
- else
- GetObjectShell()->SetVisArea( rRect );
+ GetObjectShell()->SetVisArea( rRect );
}
//--------------------------------------------------------------------
@@ -1974,13 +1968,6 @@ SfxFrame* SfxViewShell::GetSmartSelf( SfxFrame* pSelf, SfxMedium& /*rMedium*/ )
return pSelf;
}
-//--------------------------------------------------------------------
-
-BOOL SfxViewShell::IsImplementedAsFrameset_Impl( ) const
-{
- return pImp->bFrameSetImpl;
-}
-
//------------------------------------------------------------------------
void SfxViewShell::JumpToMark( const String& rMark )
@@ -2020,6 +2007,11 @@ Reference < XController > SfxViewShell::GetController()
return pImp->pController;
}
+SfxBaseController* SfxViewShell::GetBaseController_Impl() const
+{
+ return pImp->pController;
+}
+
void SfxViewShell::AddContextMenuInterceptor_Impl( const REFERENCE< XCONTEXTMENUINTERCEPTOR >& xInterceptor )
{
pImp->aInterceptorContainer.addInterface( xInterceptor );
@@ -2174,7 +2166,7 @@ void SfxViewShell::CheckOwnerShip_Impl()
{
// document couldn't be closed or it shouldn't, now try at least to close the frame
com::sun::star::uno::Reference < com::sun::star::util::XCloseable > xFrame(
- GetViewFrame()->GetFrame()->GetFrameInterface(), com::sun::star::uno::UNO_QUERY );
+ GetViewFrame()->GetFrame().GetFrameInterface(), com::sun::star::uno::UNO_QUERY );
if ( xFrame.is() )
{
try
@@ -2253,3 +2245,4 @@ void SfxViewShell::AddRemoveClipboardListener( const uno::Reference < datatransf
{
}
}
+
diff --git a/sfx2/util/hidother.src b/sfx2/util/hidother.src
index 89110beeea..18e302d995 100644
--- a/sfx2/util/hidother.src
+++ b/sfx2/util/hidother.src
@@ -57,35 +57,12 @@ hidspecial SID_STYLE_FAMILY4 { HelpID = SID_STYLE_FAMILY4; };
hidspecial SID_STYLE_FAMILY5 { HelpID = SID_STYLE_FAMILY5; };
hidspecial SID_FILTER_NAME { HelpID = SID_FILTER_NAME; };
hidspecial HID_NAVIGATOR_WINDOW { HelpID = HID_NAVIGATOR_WINDOW; };
-hidspecial SID_EXPLORERCONTENT_OPEN { HelpId = SID_EXPLORERCONTENT_OPEN; };
-hidspecial SID_EXPLORERCONTENT_OPEN_FOLDER { HelpId = SID_EXPLORERCONTENT_OPEN_FOLDER; };
-hidspecial SID_EXPLORERCONTENT_OPEN_TEMPLATE { HelpId = SID_EXPLORERCONTENT_OPEN_TEMPLATE; };
-hidspecial SID_EXPLORERCONTENT_OPEN_DOCUMENT { HelpId = SID_EXPLORERCONTENT_OPEN_DOCUMENT; };
-hidspecial SID_EXPLORERCONTENT_OPEN_OBJECT { HelpId = SID_EXPLORERCONTENT_OPEN_OBJECT; };
hidspecial HID_HELPAGENT_TIP_BOX { HelpId = HID_HELPAGENT_TIP_BOX; };
-hidspecial SID_EXPLORER_SEARCH_DLG { HelpId = SID_EXPLORER_SEARCH_DLG; };
-hidspecial SID_TRASH_RECOVER { HelpId = SID_TRASH_RECOVER; };
-hidspecial SID_TRASH_AUTOEMPTY { HelpId = SID_TRASH_AUTOEMPTY; };
-hidspecial SID_TRASH_EMPTY { HelpId = SID_TRASH_EMPTY; };
-hidspecial SID_EXPLORERCONTENT_NEW { HelpId = SID_EXPLORERCONTENT_NEW; };
-hidspecial SID_EXPLORERCONTENT_DESTROY { HelpId = SID_EXPLORERCONTENT_DESTROY; };
-hidspecial SID_EXPLORERCONTENT_RENAME { HelpId = SID_EXPLORERCONTENT_RENAME; };
-hidspecial SID_EXPLORERCONTENT_COPY { HelpId = SID_EXPLORERCONTENT_COPY; };
-hidspecial SID_EXPLORERCONTENT_PASTE { HelpId = SID_EXPLORERCONTENT_PASTE; };
-hidspecial SID_EXPLORERCONTENT_CREATELINK { HelpId = SID_EXPLORERCONTENT_CREATELINK; };
-hidspecial SID_EXPLORERCONTENT_MAKEROOT { HelpId = SID_EXPLORERCONTENT_MAKEROOT; };
-hidspecial SID_EXPLORERCONTENT_DEFAULTTEMPLATE { HelpId = SID_EXPLORERCONTENT_DEFAULTTEMPLATE; };
-hidspecial SID_PROPERTIES { HelpId = SID_PROPERTIES; };
-hidspecial SID_EXPLORER_BOOKMARKDIR { HelpId = SID_EXPLORER_BOOKMARKDIR; };
-hidspecial SID_EXPLORER_SEARCHORIG { HelpId = SID_EXPLORER_SEARCHORIG; };
hidspecial HID_TEMPLDLG_TOOLBOX_LEFT { HelpId = HID_TEMPLDLG_TOOLBOX_LEFT;};
hidspecial HID_EXPLORER_SRCH_COUNT { HelpId = HID_EXPLORER_SRCH_COUNT;};
-hidspecial SID_EXPLORER_PASTE_ASLINK { HelpId = SID_EXPLORER_PASTE_ASLINK;};
hidspecial HID_INTERFACE_SFXPLUGINVIEW { HelpID = HID_INTERFACE_SFXPLUGINVIEW; };
hidspecial HID_TABDLG_RESET_BTN { HelpID = HID_TABDLG_RESET_BTN; };
hidspecial HID_TABDLG_STANDARD_BTN { HelpID = HID_TABDLG_STANDARD_BTN; };
-hidspecial SID_EXPLORER_RESETURL { HelpID = SID_EXPLORER_RESETURL; };
-hidspecial SID_ORIG_PROPERTIES { HelpID = SID_ORIG_PROPERTIES; };
hidspecial HID_CONFIG_EVENT_OFFICE_BASED { HelpID = HID_CONFIG_EVENT_OFFICE_BASED; };
hidspecial HID_CONFIG_EVENT_DOCUMENT_BASED { HelpID = HID_CONFIG_EVENT_DOCUMENT_BASED; };
hidspecial HID_EXPLORER_SRCH_LATEST_COUNT { HelpID = HID_EXPLORER_SRCH_LATEST_COUNT; };
@@ -97,10 +74,6 @@ hidspecial HID_CHAOSDOC_WIN { HelpID = HID_CHAOSDOC_WIN; };
hidspecial HID_CHAOSDOC_WIN_HEADER { HelpID = HID_CHAOSDOC_WIN_HEADER; };
hidspecial HID_CHAOSDOC_WIN_PARTS { HelpID = HID_CHAOSDOC_WIN_PARTS; };
hidspecial HID_CHAOSDOC_WIN_BODY { HelpID = HID_CHAOSDOC_WIN_BODY; };
-hidspecial SID_CHAOSDOC_LAYOUT1 { HelpID = SID_CHAOSDOC_LAYOUT1; };
-hidspecial SID_CHAOSDOC_LAYOUT2 { HelpID = SID_CHAOSDOC_LAYOUT2; };
-hidspecial SID_CHAOSDOC_LAYOUT3 { HelpID = SID_CHAOSDOC_LAYOUT3; };
-hidspecial SID_CHAOSDOC_LAYOUT4 { HelpID = SID_CHAOSDOC_LAYOUT4; };
hidspecial HID_BRWBOX_HEADERBAR { HelpID = HID_BRWBOX_HEADERBAR; };
hidspecial HID_TASKBAR { HelpID = HID_TASKBAR; };
hidspecial HID_TASKBUTTONBAR { HelpID = HID_TASKBUTTONBAR; };
@@ -126,9 +99,6 @@ hidspecial HID_CHAOS_NEW_SUBSCR_BOX { HelpID = HID_CHAOS_NEW_SUBSCR_BOX; };
hidspecial HID_CHAOS_NEW_BOOKMARK { HelpID = HID_CHAOS_NEW_BOOKMARK; };
hidspecial HID_CHAOS_NEW_PUB_BOX { HelpID = HID_CHAOS_NEW_PUB_BOX; };
hidspecial HID_UUI_END { HelpID = HID_UUI_END; }; // aka HID_CHAOS_NEW_DATABASE
-hidspecial SID_EXPLORER_SHOWEXTENSION { HelpID = SID_EXPLORER_SHOWEXTENSION; };
-hidspecial SID_EXPLORER_MAIL_HEADER { HelpID = SID_EXPLORER_MAIL_HEADER; };
-hidspecial SID_EXPLORER_MAIL_BODY { HelpID = SID_EXPLORER_MAIL_BODY; };
hidspecial HID_CNT_DLG_SEARCH_BT_SHOW { HelpID = HID_CNT_DLG_SEARCH_BT_SHOW; };
hidspecial HID_CNT_DLG_SEARCH_BT_UPDATE { HelpID = HID_CNT_DLG_SEARCH_BT_UPDATE; };
hidspecial HID_CNT_DLG_SEARCH_BT_SYNCHRONIZE { HelpID = HID_CNT_DLG_SEARCH_BT_SYNCHRONIZE; };
diff --git a/shell/qa/makefile.mk b/shell/qa/makefile.mk
index a9047f97cf..cc91a6b1ad 100755
--- a/shell/qa/makefile.mk
+++ b/shell/qa/makefile.mk
@@ -37,6 +37,8 @@ ENABLE_EXCEPTIONS=TRUE
.INCLUDE : settings.mk
+CFLAGSCXX += $(CPPUNIT_CFLAGS)
+
# BEGIN ----------------------------------------------------------------
# auto generated Target:testjob by codegen.pl
diff --git a/shell/source/backends/desktopbe/desktopbackend.cxx b/shell/source/backends/desktopbe/desktopbackend.cxx
new file mode 100644
index 0000000000..21371755b4
--- /dev/null
+++ b/shell/source/backends/desktopbe/desktopbackend.cxx
@@ -0,0 +1,290 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_shell.hxx"
+#include "sal/config.h"
+
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/beans/Optional.hpp"
+#include "com/sun/star/beans/PropertyVetoException.hpp"
+#include "com/sun/star/beans/UnknownPropertyException.hpp"
+#include "com/sun/star/beans/XPropertyChangeListener.hpp"
+#include "com/sun/star/beans/XPropertySet.hpp"
+#include "com/sun/star/beans/XPropertySetInfo.hpp"
+#include "com/sun/star/beans/XVetoableChangeListener.hpp"
+#include "com/sun/star/lang/IllegalArgumentException.hpp"
+#include "com/sun/star/lang/WrappedTargetException.hpp"
+#include "com/sun/star/lang/XMultiComponentFactory.hpp"
+#include "com/sun/star/lang/XServiceInfo.hpp"
+#include "com/sun/star/lang/WrappedTargetException.hpp"
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/Exception.hpp"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/uno/XCurrentContext.hpp"
+#include "cppuhelper/factory.hxx"
+#include "cppuhelper/implbase2.hxx"
+#include "cppuhelper/implementationentry.hxx"
+#include "cppuhelper/weak.hxx"
+#include "osl/diagnose.h"
+#include "rtl/string.h"
+#include "rtl/textenc.h"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+#include "uno/current_context.hxx"
+#include "uno/lbnames.h"
+
+namespace {
+
+namespace css = com::sun::star;
+
+rtl::OUString SAL_CALL getDefaultImplementationName() {
+ return rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.comp.configuration.backend.DesktopBackend"));
+}
+
+css::uno::Sequence< rtl::OUString > SAL_CALL getDefaultSupportedServiceNames() {
+ rtl::OUString name(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.backend.DesktopBackend"));
+ return css::uno::Sequence< rtl::OUString >(&name, 1);
+}
+
+class Default:
+ public cppu::WeakImplHelper2<
+ css::lang::XServiceInfo, css::beans::XPropertySet >,
+ private boost::noncopyable
+{
+public:
+ Default() {}
+
+private:
+ virtual ~Default() {}
+
+ virtual rtl::OUString SAL_CALL getImplementationName()
+ throw (css::uno::RuntimeException)
+ { return getDefaultImplementationName(); }
+
+ virtual sal_Bool SAL_CALL supportsService(rtl::OUString const & ServiceName)
+ throw (css::uno::RuntimeException)
+ { return ServiceName == getSupportedServiceNames()[0]; }
+
+ virtual css::uno::Sequence< rtl::OUString > SAL_CALL
+ getSupportedServiceNames() throw (css::uno::RuntimeException)
+ { return getDefaultSupportedServiceNames(); }
+
+ virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
+ getPropertySetInfo() throw (css::uno::RuntimeException)
+ { return css::uno::Reference< css::beans::XPropertySetInfo >(); }
+
+ virtual void SAL_CALL setPropertyValue(
+ rtl::OUString const &, css::uno::Any const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::beans::PropertyVetoException,
+ css::lang::IllegalArgumentException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException);
+
+ virtual css::uno::Any SAL_CALL getPropertyValue(
+ rtl::OUString const & PropertyName)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException);
+
+ virtual void SAL_CALL addPropertyChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XPropertyChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
+ virtual void SAL_CALL removePropertyChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XPropertyChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
+ virtual void SAL_CALL addVetoableChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XVetoableChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
+ virtual void SAL_CALL removeVetoableChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XVetoableChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+};
+
+void Default::setPropertyValue(rtl::OUString const &, css::uno::Any const &)
+ throw (
+ css::beans::UnknownPropertyException, css::beans::PropertyVetoException,
+ css::lang::IllegalArgumentException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
+{
+ throw css::lang::IllegalArgumentException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("setPropertyValue not supported")),
+ static_cast< cppu::OWeakObject * >(this), -1);
+}
+
+css::uno::Any Default::getPropertyValue(rtl::OUString const & PropertyName)
+ throw (
+ css::beans::UnknownPropertyException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
+{
+ if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("EnableATToolSupport")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ExternalMailer")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("SourceViewFontHeight")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("SourceViewFontName")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("WorkPathVariable")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyName")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyPort")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyName")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyPort")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyName")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyPort")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetNoProxy")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetProxyType")))
+ {
+ return css::uno::makeAny(css::beans::Optional< css::uno::Any >());
+ }
+ throw css::beans::UnknownPropertyException(
+ PropertyName, static_cast< cppu::OWeakObject * >(this));
+}
+
+css::uno::Reference< css::uno::XInterface > createBackend(
+ css::uno::Reference< css::uno::XComponentContext > const & context,
+ rtl::OUString const & name)
+{
+ try {
+ return css::uno::Reference< css::lang::XMultiComponentFactory >(
+ context->getServiceManager(), css::uno::UNO_SET_THROW)->
+ createInstanceWithContext(name, context);
+ } catch (css::uno::RuntimeException &) {
+ // Assuming these exceptions are real errors:
+ throw;
+ } catch (css::uno::Exception & e) {
+ // Assuming these exceptions indicate that the service is not installed:
+ OSL_TRACE(
+ "createInstance(%s) failed with %s",
+ rtl::OUStringToOString(name, RTL_TEXTENCODING_UTF8).getStr(),
+ rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr());
+ return css::uno::Reference< css::uno::XInterface >();
+ }
+}
+
+css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance(
+ css::uno::Reference< css::uno::XComponentContext > const & context)
+{
+ rtl::OUString desktop;
+ css::uno::Reference< css::uno::XCurrentContext > current(
+ css::uno::getCurrentContext());
+ if (current.is()) {
+ current->getValueByName(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("system.desktop-environment"))) >>=
+ desktop;
+ }
+ // Fall back to the default if the specific backend is not available:
+ css::uno::Reference< css::uno::XInterface > backend;
+ if (desktop.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("GNOME"))) {
+ backend = createBackend(
+ context,
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.backend.GconfBackend")));
+ } else if (desktop.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("KDE"))) {
+ backend = createBackend(
+ context,
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.backend.KDEBackend")));
+ } else if (desktop.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("KDE4"))) {
+ backend = createBackend(
+ context,
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.backend.KDE4Backend")));
+ }
+ return backend.is()
+ ? backend : static_cast< cppu::OWeakObject * >(new Default);
+}
+
+static cppu::ImplementationEntry const services[] = {
+ { &createInstance, &getDefaultImplementationName,
+ &getDefaultSupportedServiceNames, &cppu::createSingleComponentFactory, 0,
+ 0 },
+ { 0, 0, 0, 0, 0, 0 }
+};
+
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
+ char const * pImplName, void * pServiceManager, void * pRegistryKey)
+{
+ return cppu::component_getFactoryHelper(
+ pImplName, pServiceManager, pRegistryKey, services);
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL
+component_getImplementationEnvironment(
+ char const ** ppEnvTypeName, uno_Environment **)
+{
+ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
+ void * pServiceManager, void * pRegistryKey)
+{
+ return component_writeInfoHelper(pServiceManager, pRegistryKey, services);
+}
diff --git a/shell/source/backends/desktopbe/desktopbe.xml b/shell/source/backends/desktopbe/desktopbe.xml
deleted file mode 100644
index 78156ad468..0000000000
--- a/shell/source/backends/desktopbe/desktopbe.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd">
-<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
- <module-name>desktopbe</module-name>
- <component-description>
- <author> Jan Holesovsky </author>
- <name>com.sun.star.comp.configuration.backend.DesktopBackend</name>
- <description> The shared gconf/KDE backend; will load GconfBackend or
- KDEBackend depending on the desktop environment.</description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language>c++</language>
- <status value="beta"/>
- <supported-service>com.sun.star.comp.configuration.backend.DesktopBackend</supported-service>
- <supported-service>com.sun.star.comp.configuration.backend.PlatformBackend</supported-service>
- <service-dependency>...</service-dependency>
- <type>com.sun.star.configuration.backend.XBackendChangesListener</type>
- <type>com.sun.star.configuration.backend.XBackendChangesNotifier</type>
- <type>com.sun.star.configuration.backend.XLayerHandler</type>
- <type>com.sun.star.configuration.backend.XSingleLayerStratum</type>
- <type>com.sun.star.lang.XMultiComponentFactory</type>
- <type>com.sun.star.lang.XServiceInfo</type>
- <type>com.sun.star.lang.XSingleComponentFactory</type>
- <type>com.sun.star.lang.XTypeProvider</type>
- <type>com.sun.star.uno.TypeClass</type>
- <type>com.sun.star.uno.XAggregation</type>
- <type>com.sun.star.uno.XComponentContext</type>
- <type>com.sun.star.uno.XCurrentContext</type>
- <type>com.sun.star.uno.XWeak</type>
- <type>com.sun.star.registry.XRegistryKey</type>
- </component-description>
- <project-build-dependency>cppuhelper</project-build-dependency>
- <project-build-dependency>cppu</project-build-dependency>
- <project-build-dependency>sal</project-build-dependency>
- <runtime-module-dependency>cppuhelper3$(COM)</runtime-module-dependency>
- <runtime-module-dependency>cppu3</runtime-module-dependency>
- <runtime-module-dependency>sal3</runtime-module-dependency>
-</module-description>
diff --git a/shell/source/backends/desktopbe/desktopbe1-ucd.txt b/shell/source/backends/desktopbe/desktopbe1-ucd.txt
index c1df460103..fd874a82ea 100644
--- a/shell/source/backends/desktopbe/desktopbe1-ucd.txt
+++ b/shell/source/backends/desktopbe/desktopbe1-ucd.txt
@@ -2,8 +2,5 @@
ImplementationName=com.sun.star.comp.configuration.backend.DesktopBackend
ComponentName=desktopbe1.uno.so
LoaderName=com.sun.star.loader.SharedLibrary
-[Data]
-SupportedComponents=org.openoffice.VCL;org.openoffice.Inet;org.openoffice.Office.Common;org.openoffice.Office.Paths;org.openoffice.UserProfile;org.openoffice.Office.Recovery;org.openoffice.Setup
[SupportedServices]
com.sun.star.configuration.backend.DesktopBackend
-com.sun.star.configuration.backend.PlatformBackend
diff --git a/shell/source/backends/desktopbe/desktopbecdef.cxx b/shell/source/backends/desktopbe/desktopbecdef.cxx
deleted file mode 100644
index 774c449ac3..0000000000
--- a/shell/source/backends/desktopbe/desktopbecdef.cxx
+++ /dev/null
@@ -1,202 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-
-#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XSCHEMASUPPLIER_HPP_
-#include <com/sun/star/configuration/backend/XSingleLayerStratum.hpp>
-#endif
-#include <com/sun/star/registry/XRegistryKey.hpp>
-
-#ifndef _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_
-#include <cppuhelper/implementationentry.hxx>
-#endif
-#include <com/sun/star/uno/XComponentContext.hpp>
-
-#include "uno/current_context.hxx"
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-
-//==============================================================================
-
-static uno::Reference<uno::XInterface> SAL_CALL createDesktopBackend(const uno::Reference<uno::XComponentContext>& xContext)
-{
- try {
- uno::Reference< uno::XCurrentContext > xCurrentContext(uno::getCurrentContext());
-
- if (xCurrentContext.is())
- {
- uno::Any aValue = xCurrentContext->getValueByName(
- rtl::OUString::createFromAscii( "system.desktop-environment" ) );
-
- rtl::OUString aDesktopEnvironment;
- if ( aValue >>= aDesktopEnvironment )
- {
- rtl::OUString aDesktopService;
- if ( aDesktopEnvironment.equalsIgnoreAsciiCaseAscii( "gnome" ) )
- aDesktopService = rtl::OUString::createFromAscii( "com.sun.star.configuration.backend.GconfBackend" );
- else if ( aDesktopEnvironment.equalsIgnoreAsciiCaseAscii( "kde" ) )
- aDesktopService = rtl::OUString::createFromAscii( "com.sun.star.configuration.backend.KDEBackend" );
- else
- return uno::Reference<uno::XInterface>();
-
- uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
- if( xServiceManager.is() )
- {
- return uno::Reference< backend::XSingleLayerStratum >::query(
- xServiceManager->createInstanceWithContext( aDesktopService, xContext) );
- }
- }
- }
- } catch (uno::RuntimeException e) {
- }
-
- return uno::Reference<uno::XInterface>();
-}
-
-static rtl::OUString SAL_CALL getBackendName(void) {
- return rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.configuration.backend.DesktopBackend") );
-}
-
-static uno::Sequence<rtl::OUString> SAL_CALL getBackendServiceNames(void)
-{
- uno::Sequence<rtl::OUString> aServices(2) ;
- aServices[0] = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.DesktopBackend")) ;
- aServices[1] = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.PlatformBackend")) ;
-
- return aServices ;
-}
-
-static uno::Sequence<rtl::OUString> SAL_CALL getSupportedComponents(void)
-{
- const sal_Int32 nComponents = 7;
-
- uno::Sequence<rtl::OUString> aSupportedComponentsList(nComponents) ;
-
- aSupportedComponentsList[0] = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("org.openoffice.VCL")) ;
- aSupportedComponentsList[1] = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Inet")) ;
- aSupportedComponentsList[2] = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Common")) ;
- aSupportedComponentsList[3] = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Paths")) ;
-
- aSupportedComponentsList[4] = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("org.openoffice.UserProfile")) ;
- aSupportedComponentsList[5] = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Recovery")) ;
- aSupportedComponentsList[6] = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Setup")) ;
-
- return aSupportedComponentsList ;
-}
-//==============================================================================
-
-static const cppu::ImplementationEntry kImplementations_entries[] =
-{
- {
- createDesktopBackend,
- getBackendName,
- getBackendServiceNames,
- cppu::createSingleComponentFactory,
- NULL,
- 0
- },
- { NULL, NULL, NULL, NULL, NULL, 0 }
-} ;
-//------------------------------------------------------------------------------
-
-extern "C" void SAL_CALL component_getImplementationEnvironment(
- const sal_Char **aEnvTypeName,
- uno_Environment ** /* aEnvironment */)
-{
- *aEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ;
-}
-
-//------------------------------------------------------------------------------
-
-extern "C" sal_Bool SAL_CALL component_writeInfo(void * /* pServiceManager */,
- void *pRegistryKey)
-{
- using namespace ::com::sun::star::registry;
- if (pRegistryKey)
- {
- try
- {
- uno::Reference< XRegistryKey > xImplKey = static_cast< XRegistryKey* >( pRegistryKey )->createKey(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + getBackendName()
- );
-
- // Register associated service names
- uno::Reference< XRegistryKey > xServicesKey = xImplKey->createKey(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES") )
- );
-
- uno::Sequence<rtl::OUString> sServiceNames = getBackendServiceNames();
- for (sal_Int32 i = 0 ; i < sServiceNames.getLength() ; ++ i)
- xServicesKey->createKey(sServiceNames[i]);
-
- // Register supported components
- uno::Reference<XRegistryKey> xComponentKey = xImplKey->createKey(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/DATA/SupportedComponents") )
- );
-
- xComponentKey->setAsciiListValue( getSupportedComponents() );
-
- return sal_True;
- }
-
- catch( InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "InvalidRegistryException caught");
- }
- }
-
- return sal_False;
-}
-
-//------------------------------------------------------------------------------
-
-extern "C" void *component_getFactory(const sal_Char *aImplementationName,
- void *aServiceManager,
- void *aRegistryKey)
-{
- return cppu::component_getFactoryHelper(
- aImplementationName,
- aServiceManager,
- aRegistryKey,
- kImplementations_entries) ;
-}
-//------------------------------------------------------------------------------
diff --git a/shell/source/backends/desktopbe/exports.map b/shell/source/backends/desktopbe/exports.map
deleted file mode 100644
index ba501f9ae0..0000000000
--- a/shell/source/backends/desktopbe/exports.map
+++ /dev/null
@@ -1,10 +0,0 @@
-UDK_3_0_0 {
- global:
- GetVersionInfo;
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/shell/source/backends/desktopbe/makefile.mk b/shell/source/backends/desktopbe/makefile.mk
index dd0afd88fe..29260821d5 100644
--- a/shell/source/backends/desktopbe/makefile.mk
+++ b/shell/source/backends/desktopbe/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -23,49 +23,31 @@
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
-#*************************************************************************
-PRJ=..$/..$/..
-
-PRJNAME=shell
-TARGET=desktopbe
-
-LIBTARGET=NO
-ENABLE_EXCEPTIONS=TRUE
+#***********************************************************************/
-COMP1TYPELIST=$(TARGET)
-COMPRDB=$(SOLARBINDIR)$/types.rdb
-UNOUCROUT=$(OUT)$/inc$/$(TARGET)
-INCPRE=$(UNOUCROUT)
+PRJ = ../../..
+PRJNAME = shell
+TARGET = desktopbe
-# --- Settings ---
+ENABLE_EXCEPTIONS = TRUE
+VISIBILITY_HIDDEN = TRUE
-.INCLUDE : settings.mk
+.INCLUDE: settings.mk
-UNIXTEXT=$(MISC)/$(TARGET)1-ucd.txt
-
-# no "lib" prefix
DLLPRE =
-# --- Files ---
-
-SLOFILES=\
- $(SLO)$/desktopbecdef.obj
-
-SHL1NOCHECK=TRUE
-SHL1TARGET=$(TARGET)1.uno
-SHL1OBJS=$(SLOFILES)
-SHL1DEF=$(MISC)$/$(SHL1TARGET).def
+SLOFILES = $(SLO)/desktopbackend.obj
-SHL1IMPLIB=i$(SHL1TARGET)
-SHL1STDLIBS= \
- $(CPPUHELPERLIB) \
- $(CPPULIB) \
- $(SALLIB)
-
-SHL1VERSIONMAP=exports.map
-SHL1DEF=$(MISC)$/$(SHL1TARGET).def
-DEF1NAME=$(SHL1TARGET)
+SHL1IMPLIB = i$(SHL1TARGET)
+SHL1OBJS = $(SLOFILES)
+SHL1STDLIBS = \
+ $(CPPUHELPERLIB) \
+ $(CPPULIB) \
+ $(SALLIB)
+SHL1TARGET = desktopbe1.uno
+SHL1USE_EXPORTS = name
+DEF1NAME = $(SHL1TARGET)
-# --- Targets ---
+UNIXTEXT = $(MISC)/desktopbe1-ucd.txt
-.INCLUDE : target.mk
+.INCLUDE: target.mk
diff --git a/shell/source/backends/gconfbe/exports.map b/shell/source/backends/gconfbe/exports.map
deleted file mode 100644
index ba501f9ae0..0000000000
--- a/shell/source/backends/gconfbe/exports.map
+++ /dev/null
@@ -1,10 +0,0 @@
-UDK_3_0_0 {
- global:
- GetVersionInfo;
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/shell/source/backends/gconfbe/gconflayer.cxx b/shell/source/backends/gconfbe/gconfaccess.cxx
index e197f66f95..e2347572ee 100644
--- a/shell/source/backends/gconfbe/gconflayer.cxx
+++ b/shell/source/backends/gconfbe/gconfaccess.cxx
@@ -1,78 +1,102 @@
/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
#include "precompiled_shell.hxx"
-#include "gconflayer.hxx"
-#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
-
-#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#endif
-#include <rtl/strbuf.hxx>
-#include <rtl/ustrbuf.hxx>
-#include <osl/security.hxx>
-#include <osl/file.hxx>
-#include <osl/thread.h>
-#include <com/sun/star/uno/Sequence.hxx>
+#include "sal/config.h"
#include <string.h>
-using namespace rtl;
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "osl/file.hxx"
+#include "osl/security.hxx"
+#include "osl/thread.h"
+#include "rtl/strbuf.hxx"
+#include "rtl/ustrbuf.hxx"
-//==============================================================================
+#include "gconfaccess.hxx"
-GconfLayer::GconfLayer( const uno::Reference<uno::XComponentContext>& xContext,
- const ConfigurationValue pConfigurationValuesList[],
- const sal_Int32 nConfigurationValues,
- const char * pPreloadValuesList[] )
- :m_pConfigurationValuesList( pConfigurationValuesList )
- ,m_nConfigurationValues( nConfigurationValues )
- ,m_pPreloadValuesList( pPreloadValuesList )
-{
- //Create instance of LayerContentDescriber Service
- rtl::OUString const k_sLayerDescriberService( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.configuration.backend.LayerDescriber" ) );
+#define GCONF_PROXY_MODE_KEY "/system/proxy/mode"
+#define GCONF_AUTO_SAVE_KEY "/apps/openoffice/auto_save"
- typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber;
- uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
- if( xServiceManager.is() )
- {
- m_xLayerContentDescriber = LayerDescriber::query(
- xServiceManager->createInstanceWithContext( k_sLayerDescriberService, xContext ) );
- }
- else
+namespace gconfaccess {
+
+namespace {
+
+namespace css = com::sun::star ;
+namespace uno = css::uno ;
+using namespace rtl;
+
+GConfClient* getGconfClient()
+{
+ static GConfClient* mClient= 0;
+ if (mClient == NULL)
{
- OSL_TRACE( "Could not retrieve ServiceManager" );
- }
-}
+ /* initialize glib object type library */
+ g_type_init();
+
+ GError* aError = NULL;
+ if (!gconf_init(0, NULL, &aError))
+ {
+ rtl::OUStringBuffer msg;
+ msg.appendAscii("GconfBackend:GconfLayer: Cannot Initialize Gconf connection - " );
+ msg.appendAscii(aError->message);
+
+ g_error_free(aError);
+ aError = NULL;
+ throw uno::RuntimeException(msg.makeStringAndClear(),NULL);
+ }
+
+ mClient = gconf_client_get_default();
+ if (!mClient)
+ {
+ throw uno::RuntimeException(rtl::OUString::createFromAscii
+ ("GconfBackend:GconfLayer: Cannot Initialize Gconf connection"),NULL);
+ }
-//------------------------------------------------------------------------------
+ static const char * const PreloadValuesList[] =
+ {
+ "/desktop/gnome/interface",
+ "/system/proxy",
+ "/system/http_proxy/host",
+ "/desktop/gnome/url-handlers/mailto",
+#ifdef ENABLE_LOCKDOWN
+ "/apps/openoffice",
+ "/desktop/gnome/lockdown",
+ "/apps/openoffice/lockdown",
+#endif // ENABLE_LOCKDOWN
+ NULL
+ };
+ int i = 0;
+ while( PreloadValuesList[i] != NULL )
+ gconf_client_preload( mClient, PreloadValuesList[i++], GCONF_CLIENT_PRELOAD_ONELEVEL, NULL );
+ }
+
+ return mClient;
+}
static OUString xdg_user_dir_lookup (const char *type)
{
@@ -373,13 +397,12 @@ uno::Any translateToOOo( const ConfigurationValue aValue, GConfValue *aGconfValu
//------------------------------------------------------------------------------
-sal_Bool SAL_CALL isDependencySatisfied( const ConfigurationValue aValue )
+sal_Bool SAL_CALL isDependencySatisfied( GConfClient* aClient, const ConfigurationValue aValue )
{
switch( aValue.nDependsOn )
{
case SETTING_PROXY_MODE:
{
- GConfClient* aClient = GconfBackend::getGconfClient();
GConfValue* aGconfValue = gconf_client_get( aClient, GCONF_PROXY_MODE_KEY, NULL );
if ( aGconfValue != NULL )
@@ -446,116 +469,381 @@ sal_Bool SAL_CALL isDependencySatisfied( const ConfigurationValue aValue )
return sal_False;
}
-//------------------------------------------------------------------------------
+}
-void SAL_CALL GconfLayer::readData( const uno::Reference<backend::XLayerHandler>& xHandler )
- throw ( backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, uno::RuntimeException )
+ConfigurationValue const ConfigurationValues[] =
{
- if( ! m_xLayerContentDescriber.is() )
{
- throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"
- ) ), static_cast < backend::XLayer * > (this) );
- }
+ SETTING_ENABLE_ACCESSIBILITY,
+ "/desktop/gnome/interface/accessibility",
+ "EnableATToolSupport",
+ sal_True,
+ SETTINGS_LAST
+ },
- uno::Sequence<backend::PropertyInfo> aPropInfoList( m_nConfigurationValues );
- sal_Int32 nProperties = 0;
+ {
+ SETTING_PROXY_MODE,
+ GCONF_PROXY_MODE_KEY,
+ "ooInetProxyType",
+ sal_True,
+ SETTINGS_LAST
+ },
- GConfClient* aClient = GconfBackend::getGconfClient();
- GConfValue* aGconfValue;
- int i = 0;
+ {
+ SETTING_PROXY_HTTP_HOST,
+ "/system/http_proxy/host",
+ "ooInetHTTPProxyName",
+ sal_False,
+ SETTING_PROXY_MODE
+ },
- while( m_pPreloadValuesList[i] != NULL )
- gconf_client_preload( aClient, m_pPreloadValuesList[i++], GCONF_CLIENT_PRELOAD_ONELEVEL, NULL );
+ {
+ SETTING_PROXY_HTTP_PORT,
+ "/system/http_proxy/port",
+ "ooInetHTTPProxyPort",
+ sal_False,
+ SETTING_PROXY_MODE
+ },
+
+ {
+ SETTING_PROXY_HTTPS_HOST,
+ "/system/proxy/secure_host",
+ "ooInetHTTPSProxyName",
+ sal_False,
+ SETTING_PROXY_MODE
+ },
- for( i = 0; i < m_nConfigurationValues; i++ )
{
- if( ( m_pConfigurationValuesList[i].nDependsOn != SETTINGS_LAST ) && !isDependencySatisfied( m_pConfigurationValuesList[i] ) )
- continue;
+ SETTING_PROXY_HTTPS_PORT,
+ "/system/proxy/secure_port",
+ "ooInetHTTPSProxyPort",
+ sal_False,
+ SETTING_PROXY_MODE
+ },
- aGconfValue = gconf_client_get( aClient, m_pConfigurationValuesList[i].GconfItem, NULL );
+ {
+ SETTING_PROXY_FTP_HOST,
+ "/system/proxy/ftp_host",
+ "ooInetFTPProxyName",
+ sal_False,
+ SETTING_PROXY_MODE
+ },
- if( aGconfValue != NULL )
- {
- aPropInfoList[nProperties].Name = rtl::OUString::createFromAscii( m_pConfigurationValuesList[i].OOoConfItem );
- aPropInfoList[nProperties].Type = rtl::OUString::createFromAscii( m_pConfigurationValuesList[i].OOoConfValueType );
- aPropInfoList[nProperties].Protected = m_pConfigurationValuesList[i].bLocked;
+ {
+ SETTING_PROXY_FTP_PORT,
+ "/system/proxy/ftp_port",
+ "ooInetFTPProxyPort",
+ sal_False,
+ SETTING_PROXY_MODE
+ },
+
+ {
+ SETTING_NO_PROXY_FOR,
+ "/system/http_proxy/ignore_hosts",
+ "ooInetNoProxy",
+ sal_True,
+ SETTING_PROXY_MODE
+ },
- if( m_pConfigurationValuesList[i].bNeedsTranslation )
- aPropInfoList[nProperties].Value = translateToOOo( m_pConfigurationValuesList[i], aGconfValue );
- else
- aPropInfoList[nProperties].Value = makeAnyOfGconfValue( aGconfValue );
+ {
+ SETTING_MAILER_PROGRAM,
+ "/desktop/gnome/url-handlers/mailto/command",
+ "ExternalMailer",
+ sal_True,
+ SETTINGS_LAST
+ },
+ {
+ SETTING_SOURCEVIEWFONT_NAME,
+ "/desktop/gnome/interface/monospace_font_name",
+ "SourceViewFontName",
+ sal_True,
+ SETTINGS_LAST
+ },
+ {
+ SETTING_SOURCEVIEWFONT_HEIGHT,
+ "/desktop/gnome/interface/monospace_font_name",
+ "SourceViewFontHeight",
+ sal_True,
+ SETTINGS_LAST
+ },
- gconf_value_free( aGconfValue );
+ {
+ SETTING_WORK_DIRECTORY,
+ "/desktop/gnome/url-handlers/mailto/command", // dummy
+ "WorkPathVariable",
+ sal_True,
+ SETTING_WORK_DIRECTORY, // so that the existence of the dir can be checked
+ },
- nProperties++;
- }
- }
+#ifdef ENABLE_LOCKDOWN
+ {
+ SETTING_WRITER_DEFAULT_DOC_FORMAT,
+ "/apps/openoffice/writer_default_document_format",
+ "TextDocumentSetupFactoryDefaultFilter",
+ sal_False,
+ SETTINGS_LAST
+ },
- if( nProperties > 0 )
{
- aPropInfoList.realloc( nProperties );
- m_xLayerContentDescriber->describeLayer( xHandler, aPropInfoList );
- }
-}
+ SETTING_IMPRESS_DEFAULT_DOC_FORMAT,
+ "/apps/openoffice/impress_default_document_format",
+ "PresentationDocumentSetupFactoryDefaultFilter",
+ sal_False,
+ SETTINGS_LAST
+ },
-//------------------------------------------------------------------------------
+ {
+ SETTING_CALC_DEFAULT_DOC_FORMAT,
+ "/apps/openoffice/calc_default_document_format",
+ "SpreadsheetDocumentSetupFactoryDefaultFilter",
+ sal_False,
+ SETTINGS_LAST
+ },
-rtl::OUString SAL_CALL GconfLayer::getTimestamp( void )
- throw (uno::RuntimeException)
-{
- // Return a hash of the values as timestamp to avoid regenerating
- // the binary cache on each office launch.
- rtl::OStringBuffer aTimeStamp;
+ {
+ SETTING_AUTO_SAVE,
+ GCONF_AUTO_SAVE_KEY,
+ "AutoSaveEnabled",
+ sal_False,
+ SETTINGS_LAST
+ },
- // Make sure the timestamp differs from beta
- sal_Int32 nHashCode = 0;
-
- GConfClient* aClient = GconfBackend::getGconfClient();
- GConfValue* aGconfValue;
- int i = 0;
+ {
+ SETTING_AUTO_SAVE_INTERVAL,
+ "/apps/openoffice/auto_save_interval",
+ "AutoSaveTimeIntervall",
+ sal_False,
+ SETTING_AUTO_SAVE
+ },
+
+ {
+ SETTING_USER_GIVENNAME,
+ "/desktop/gnome/url-handlers/mailto/command", // dummy
+ "givenname",
+ sal_True,
+ SETTING_USER_GIVENNAME
+ },
+
+ {
+ SETTING_USER_SURNAME,
+ "/desktop/gnome/url-handlers/mailto/command", // dummy
+ "sn",
+ sal_True,
+ SETTING_USER_SURNAME
+ },
+
+ {
+ SETTING_DISABLE_PRINTING,
+ "/desktop/gnome/lockdown/disable_printing",
+ "DisablePrinting",
+ sal_True,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_USE_SYSTEM_FILE_DIALOG,
+ "/apps/openoffice/use_system_file_dialog",
+ "UseSystemFileDialog",
+ sal_False,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_PRINTING_MODIFIES_DOCUMENT,
+ "/apps/openoffice/printing_modifies_doc",
+ "PrintingModifiesDocument",
+ sal_False,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_SHOW_ICONS_IN_MENUS,
+ "/apps/openoffice/show_menu_icons",
+ "ShowIconsInMenues",
+ sal_False,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_SHOW_INACTIVE_MENUITEMS,
+ "/apps/openoffice/show_menu_inactive_items",
+ "DontHideDisabledEntry",
+ sal_False,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_SHOW_FONT_PREVIEW,
+ "/apps/openoffice/show_font_preview",
+ "ShowFontBoxWYSIWYG",
+ sal_False,
+ SETTINGS_LAST
+ },
- while( m_pPreloadValuesList[i] != NULL )
- gconf_client_preload( aClient, m_pPreloadValuesList[i++], GCONF_CLIENT_PRELOAD_ONELEVEL, NULL );
+ {
+ SETTING_SHOW_FONT_HISTORY,
+ "/apps/openoffice/show_font_history",
+ "FontViewHistory",
+ sal_False,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_ENABLE_OPENGL,
+ "/apps/openoffice/use_opengl",
+ "OpenGL",
+ sal_False,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_OPTIMIZE_OPENGL,
+ "/apps/openoffice/optimize_opengl",
+ "OpenGL_Faster",
+ sal_False,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_USE_SYSTEM_FONT,
+ "/apps/openoffice/use_system_font",
+ "AccessibilityIsSystemFont",
+ sal_False,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_USE_FONT_ANTI_ALIASING,
+ "/apps/openoffice/use_font_anti_aliasing",
+ "FontAntiAliasingEnabled",
+ sal_False,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_FONT_ANTI_ALIASING_MIN_PIXEL,
+ "/apps/openoffice/font_anti_aliasing_min_pixel",
+ "FontAntiAliasingMinPixelHeight",
+ sal_True,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_WARN_CREATE_PDF,
+ "/apps/openoffice/lockdown/warn_info_create_pdf",
+ "WarnCreatePDF",
+ sal_False,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_WARN_PRINT_DOC,
+ "/apps/openoffice/lockdown/warn_info_printing",
+ "WarnPrintDoc",
+ sal_False,
+ SETTINGS_LAST
+ },
- for( i = 0; i < m_nConfigurationValues; i++ )
{
- aGconfValue = gconf_client_get( aClient, m_pConfigurationValuesList[i].GconfItem, NULL );
+ SETTING_WARN_SAVEORSEND_DOC,
+ "/apps/openoffice/lockdown/warn_info_saving",
+ "WarnSaveOrSendDoc",
+ sal_False,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_WARN_SIGN_DOC,
+ "/apps/openoffice/lockdown/warn_info_signing",
+ "WarnSignDoc",
+ sal_False,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_REMOVE_PERSONAL_INFO,
+ "/apps/openoffice/lockdown/remove_personal_info_on_save",
+ "Scripting/RemovePersonalInfoOnSaving",
+ sal_False,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_RECOMMEND_PASSWORD,
+ "/apps/openoffice/lockdown/recommend_password_on_save",
+ "RecommendPasswordProtection",
+ sal_False,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_UNDO_STEPS,
+ "/apps/openoffice/undo_steps",
+ "UndoSteps",
+ sal_False,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_SYMBOL_SET,
+ "/apps/openoffice/icon_size",
+ "SymbolSet",
+ sal_True,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_MACRO_SECURITY_LEVEL,
+ "/apps/openoffice/lockdown/macro_security_level",
+ "MacroSecurityLevel",
+ sal_False,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_CREATE_BACKUP,
+ "/apps/openoffice/create_backup",
+ "CreateBackup",
+ sal_False,
+ SETTINGS_LAST
+ },
+
+ {
+ SETTING_WARN_ALIEN_FORMAT,
+ "/apps/openoffice/warn_alien_format",
+ "WarnAlienFormat",
+ sal_False,
+ SETTINGS_LAST
+ },
+
+#endif // ENABLE_LOCKDOWN
+};
+
+std::size_t const nConfigurationValues =
+ sizeof ConfigurationValues / sizeof ConfigurationValues[0];
+
+css::beans::Optional< css::uno::Any > getValue(ConfigurationValue const & data)
+{
+ GConfClient* aClient = getGconfClient();
+ GConfValue* aGconfValue;
+ if( ( data.nDependsOn == SETTINGS_LAST ) || isDependencySatisfied( aClient, data ) )
+ {
+ aGconfValue = gconf_client_get( aClient, data.GconfItem, NULL );
if( aGconfValue != NULL )
{
- switch( aGconfValue->type )
- {
- case GCONF_VALUE_BOOL:
- nHashCode ^= (sal_Int32) !gconf_value_get_bool( aGconfValue );
- break;
-
- case GCONF_VALUE_INT:
- nHashCode ^= (sal_Int32) gconf_value_get_int( aGconfValue );
- break;
-
- case GCONF_VALUE_STRING:
- nHashCode ^= (sal_Int32) g_str_hash( gconf_value_get_string( aGconfValue ) );
- break;
-
- case GCONF_VALUE_LIST:
- if( GCONF_VALUE_STRING == gconf_value_get_list_type( aGconfValue ) )
- {
- GSList *list = gconf_value_get_list( aGconfValue );
- for(; list; list = g_slist_next(list))
- nHashCode ^= (sal_Int32) g_str_hash( gconf_value_get_string((GConfValue *) list->data) );
- break;
- }
-
- default:
- fprintf( stderr, "getTimestamp: Type not handled.\n" );
- break;
- }
- nHashCode = (nHashCode << 5) - nHashCode;
+ css::uno::Any value;
+ if( data.bNeedsTranslation )
+ value = translateToOOo( data, aGconfValue );
+ else
+ value = makeAnyOfGconfValue( aGconfValue );
+
gconf_value_free( aGconfValue );
+
+ return css::beans::Optional< css::uno::Any >(true, value);
}
}
+ return css::beans::Optional< css::uno::Any >();
+}
- return rtl::OUString::valueOf( nHashCode );
}
diff --git a/shell/source/backends/gconfbe/gconfaccess.hxx b/shell/source/backends/gconfbe/gconfaccess.hxx
new file mode 100644
index 0000000000..6406b4419e
--- /dev/null
+++ b/shell/source/backends/gconfbe/gconfaccess.hxx
@@ -0,0 +1,119 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_SHELL_SOURCE_BACKENDS_GCONFBE_GCONFACCESS_HXX
+#define INCLUDED_SHELL_SOURCE_BACKENDS_GCONFBE_GCONFACCESS_HXX
+
+#include "sal/config.h"
+
+#include <cstddef>
+
+#include "com/sun/star/beans/Optional.hpp"
+#include "gconf/gconf-client.h"
+#include "sal/types.h"
+
+namespace com { namespace sun { namespace star { namespace uno {
+ class Any;
+} } } }
+
+namespace gconfaccess {
+
+enum ConfigurationSetting
+{
+ SETTING_PROXY_MODE,
+ SETTING_PROXY_HTTP_HOST,
+ SETTING_PROXY_HTTP_PORT,
+ SETTING_PROXY_HTTPS_HOST,
+ SETTING_PROXY_HTTPS_PORT,
+ SETTING_PROXY_FTP_HOST,
+ SETTING_PROXY_FTP_PORT,
+ SETTING_NO_PROXY_FOR,
+ SETTING_ENABLE_ACCESSIBILITY,
+ SETTING_MAILER_PROGRAM,
+ SETTING_WORK_DIRECTORY,
+ SETTING_SOURCEVIEWFONT_NAME,
+ SETTING_SOURCEVIEWFONT_HEIGHT,
+ SETTING_USER_GIVENNAME,
+ SETTING_USER_SURNAME,
+
+#ifdef ENABLE_LOCKDOWN
+
+ SETTING_DISABLE_PRINTING,
+ SETTING_USE_SYSTEM_FILE_DIALOG,
+ SETTING_PRINTING_MODIFIES_DOCUMENT,
+ SETTING_SHOW_ICONS_IN_MENUS,
+ SETTING_SHOW_INACTIVE_MENUITEMS,
+ SETTING_SHOW_FONT_PREVIEW,
+ SETTING_SHOW_FONT_HISTORY,
+ SETTING_ENABLE_OPENGL,
+ SETTING_OPTIMIZE_OPENGL,
+ SETTING_SAVE_DOCUMENT_WINDOWS,
+ SETTING_SAVE_DOCUMENT_VIEW_INFO,
+ SETTING_USE_SYSTEM_FONT,
+ SETTING_USE_FONT_ANTI_ALIASING,
+ SETTING_FONT_ANTI_ALIASING_MIN_PIXEL,
+ SETTING_WARN_CREATE_PDF,
+ SETTING_WARN_PRINT_DOC,
+ SETTING_WARN_SAVEORSEND_DOC,
+ SETTING_WARN_SIGN_DOC,
+ SETTING_REMOVE_PERSONAL_INFO,
+ SETTING_RECOMMEND_PASSWORD,
+ SETTING_UNDO_STEPS,
+ SETTING_SYMBOL_SET,
+ SETTING_MACRO_SECURITY_LEVEL,
+ SETTING_CREATE_BACKUP,
+ SETTING_WARN_ALIEN_FORMAT,
+ SETTING_AUTO_SAVE,
+ SETTING_AUTO_SAVE_INTERVAL,
+ SETTING_WRITER_DEFAULT_DOC_FORMAT,
+ SETTING_IMPRESS_DEFAULT_DOC_FORMAT,
+ SETTING_CALC_DEFAULT_DOC_FORMAT,
+
+#endif // ENABLE_LOCKDOWN
+
+ SETTINGS_LAST
+};
+
+struct ConfigurationValue
+{
+ const ConfigurationSetting nSettingId;
+ const gchar *GconfItem;
+ const char *OOoConfItem;
+ const sal_Bool bNeedsTranslation;
+ const ConfigurationSetting nDependsOn;
+};
+
+extern ConfigurationValue const ConfigurationValues[];
+
+extern std::size_t const nConfigurationValues;
+
+com::sun::star::beans::Optional< com::sun::star::uno::Any > getValue(
+ ConfigurationValue const & data);
+
+}
+
+#endif
diff --git a/shell/source/backends/gconfbe/gconfbackend.cxx b/shell/source/backends/gconfbe/gconfbackend.cxx
index bb26cc0829..122d1cad02 100644
--- a/shell/source/backends/gconfbe/gconfbackend.cxx
+++ b/shell/source/backends/gconfbe/gconfbackend.cxx
@@ -1,1007 +1,239 @@
/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
-// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_shell.hxx"
-
-#include "gconfbackend.hxx"
-#include "gconflayer.hxx"
-#include <com/sun/star/configuration/backend/ComponentChangeEvent.hpp>
-
-#ifndef INCLUDED_VECTOR
-#include <vector>
-#define INCLUDED_VECTOR
-#endif
-#include <osl/process.h>
-#include <osl/time.h>
-#include <rtl/ustrbuf.hxx>
-#include <rtl/byteseq.h>
-
-#include <stdio.h>
-
-#ifdef ENABLE_LOCKDOWN
-// each entry should have an identifying ConfigurationSetting
-static const ConfigurationValue SetupConfigurationValuesList[] =
-{
- {
- SETTING_WRITER_DEFAULT_DOC_FORMAT,
- "/apps/openoffice/writer_default_document_format",
- "org.openoffice.Setup/Office/Factories/com.sun.star.text.TextDocument/ooSetupFactoryDefaultFilter",
- "string",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_IMPRESS_DEFAULT_DOC_FORMAT,
- "/apps/openoffice/impress_default_document_format",
- "org.openoffice.Setup/Office/Factories/com.sun.star.presentation.PresentationDocument/ooSetupFactoryDefaultFilter",
- "string",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_CALC_DEFAULT_DOC_FORMAT,
- "/apps/openoffice/calc_default_document_format",
- "org.openoffice.Setup/Office/Factories/com.sun.star.sheet.SpreadsheetDocument/ooSetupFactoryDefaultFilter",
- "string",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-};
-#endif // ENABLE_LOCKDOWN
-
-#ifdef ENABLE_LOCKDOWN
-// each entry should have an identifying ConfigurationSetting
-static const ConfigurationValue RecoveryConfigurationValuesList[] =
-{
- {
- SETTING_AUTO_SAVE,
- GCONF_AUTO_SAVE_KEY,
- "org.openoffice.Office.Recovery/AutoSave/Enabled",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_AUTO_SAVE_INTERVAL,
- "/apps/openoffice/auto_save_interval",
- "org.openoffice.Office.Recovery/AutoSave/TimeIntervall",
- "int",
- sal_False,
- sal_False,
- SETTING_AUTO_SAVE
- },
-};
-#endif // ENABLE_LOCKDOWN
-
-/*
- * This should be in a different backend actually, but this has to wait ..
- */
-
-#ifdef ENABLE_LOCKDOWN
-// each entry should have an identifying ConfigurationSetting
-static const ConfigurationValue UserProfileConfigurationValuesList[] =
-{
- {
- SETTING_USER_GIVENNAME,
- "/desktop/gnome/url-handlers/mailto/command", // dummy, needed for getTimestamp
- "org.openoffice.UserProfile/Data/givenname",
- "string",
- sal_False,
- sal_True,
- SETTING_USER_GIVENNAME
- },
-
- {
- SETTING_USER_SURNAME,
- "/desktop/gnome/url-handlers/mailto/command", // dummy, needed for getTimestamp
- "org.openoffice.UserProfile/Data/sn",
- "string",
- sal_False,
- sal_True,
- SETTING_USER_SURNAME
- },
-};
-#endif // ENABLE_LOCKDOWN
-
-// each entry should have an identifying ConfigurationSetting
-static const ConfigurationValue VCLConfigurationValuesList[] =
-{
- {
- SETTING_ENABLE_ACCESSIBILITY,
- "/desktop/gnome/interface/accessibility",
- "org.openoffice.VCL/Settings/Accessibility/EnableATToolSupport",
- "string",
- sal_False,
- sal_True,
- SETTINGS_LAST
- },
-
-#ifdef ENABLE_LOCKDOWN
-
- {
- SETTING_DISABLE_PRINTING,
- "/desktop/gnome/lockdown/disable_printing",
- "org.openoffice.VCL/Settings/DesktopManagement/DisablePrinting",
- "string",
- sal_False,
- sal_True,
- SETTINGS_LAST
- },
-
-#endif // ENABLE_LOCKDOWN
-
-};
-
-// each entry should have an identifying ConfigurationSetting
-static const ConfigurationValue InetConfigurationValuesList[] =
-{
- {
- SETTING_PROXY_MODE,
- GCONF_PROXY_MODE_KEY,
- "org.openoffice.Inet/Settings/ooInetProxyType",
- "int",
- sal_False,
- sal_True,
- SETTINGS_LAST
- },
-
- {
- SETTING_PROXY_HTTP_HOST,
- "/system/http_proxy/host",
- "org.openoffice.Inet/Settings/ooInetHTTPProxyName",
- "string",
- sal_False,
- sal_False,
- SETTING_PROXY_MODE
- },
-
- {
- SETTING_PROXY_HTTP_PORT,
- "/system/http_proxy/port",
- "org.openoffice.Inet/Settings/ooInetHTTPProxyPort",
- "int",
- sal_False,
- sal_False,
- SETTING_PROXY_MODE
- },
-
- {
- SETTING_PROXY_HTTPS_HOST,
- "/system/proxy/secure_host",
- "org.openoffice.Inet/Settings/ooInetHTTPSProxyName",
- "string",
- sal_False,
- sal_False,
- SETTING_PROXY_MODE
- },
-
- {
- SETTING_PROXY_HTTPS_PORT,
- "/system/proxy/secure_port",
- "org.openoffice.Inet/Settings/ooInetHTTPSProxyPort",
- "int",
- sal_False,
- sal_False,
- SETTING_PROXY_MODE
- },
-
- {
- SETTING_PROXY_FTP_HOST,
- "/system/proxy/ftp_host",
- "org.openoffice.Inet/Settings/ooInetFTPProxyName",
- "string",
- sal_False,
- sal_False,
- SETTING_PROXY_MODE
- },
-
- {
- SETTING_PROXY_FTP_PORT,
- "/system/proxy/ftp_port",
- "org.openoffice.Inet/Settings/ooInetFTPProxyPort",
- "int",
- sal_False,
- sal_False,
- SETTING_PROXY_MODE
- },
-
- {
- SETTING_NO_PROXY_FOR,
- "/system/http_proxy/ignore_hosts",
- "org.openoffice.Inet/Settings/ooInetNoProxy",
- "string",
- sal_False,
- sal_True,
- SETTING_PROXY_MODE
- },
-};
-
-// each entry should have an identifying ConfigurationSetting
-static const ConfigurationValue CommonConfigurationValuesList[] =
-{
- {
- SETTING_MAILER_PROGRAM,
- "/desktop/gnome/url-handlers/mailto/command",
- "org.openoffice.Office.Common/ExternalMailer/Program",
- "string",
- sal_False,
- sal_True,
- SETTINGS_LAST
- },
- {
- SETTING_SOURCEVIEWFONT_NAME,
- "/desktop/gnome/interface/monospace_font_name",
- "org.openoffice.Office.Common/Font/SourceViewFont/FontName",
- "string",
- sal_False,
- sal_True,
- SETTINGS_LAST
- },
- {
- SETTING_SOURCEVIEWFONT_HEIGHT,
- "/desktop/gnome/interface/monospace_font_name",
- "org.openoffice.Office.Common/Font/SourceViewFont/FontHeight",
- "short",
- sal_False,
- sal_True,
- SETTINGS_LAST
- },
-
-#ifdef ENABLE_LOCKDOWN
-
- {
- SETTING_USE_SYSTEM_FILE_DIALOG,
- "/apps/openoffice/use_system_file_dialog",
- "org.openoffice.Office.Common/Misc/UseSystemFileDialog",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_DISABLE_UI_CUSTOMIZATION,
- "/apps/openoffice/lockdown/disable_ui_customization",
- "org.openoffice.Office.Common/Misc/DisableUICustomization",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_PRINTING_MODIFIES_DOCUMENT,
- "/apps/openoffice/printing_modifies_doc",
- "org.openoffice.Office.Common/Print/PrintingModifiesDocument",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_SHOW_ICONS_IN_MENUS,
- "/apps/openoffice/show_menu_icons",
- "org.openoffice.Office.Common/View/Menu/ShowIconsInMenues",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_SHOW_INACTIVE_MENUITEMS,
- "/apps/openoffice/show_menu_inactive_items",
- "org.openoffice.Office.Common/View/Menu/DontHideDisabledEntry",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_SHOW_FONT_PREVIEW,
- "/apps/openoffice/show_font_preview",
- "org.openoffice.Office.Common/Font/View/ShowFontBoxWYSIWYG",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_SHOW_FONT_HISTORY,
- "/apps/openoffice/show_font_history",
- "org.openoffice.Office.Common/Font/View/History",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_ENABLE_OPENGL,
- "/apps/openoffice/use_opengl",
- "org.openoffice.Office.Common/_3D_Engine/OpenGL",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_OPTIMIZE_OPENGL,
- "/apps/openoffice/optimize_opengl",
- "org.openoffice.Office.Common/_3D_Engine/OpenGL_Faster",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_USE_SYSTEM_FONT,
- "/apps/openoffice/use_system_font",
- "org.openoffice.Office.Common/Accessibility/IsSystemFont",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_USE_FONT_ANTI_ALIASING,
- "/apps/openoffice/use_font_anti_aliasing",
- "org.openoffice.Office.Common/View/FontAntiAliasing/Enabled",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_FONT_ANTI_ALIASING_MIN_PIXEL,
- "/apps/openoffice/font_anti_aliasing_min_pixel",
- "org.openoffice.Office.Common/View/FontAntiAliasing/MinPixelHeight",
- "short",
- sal_False,
- sal_True,
- SETTINGS_LAST
- },
-
- {
- SETTING_WARN_CREATE_PDF,
- "/apps/openoffice/lockdown/warn_info_create_pdf",
- "org.openoffice.Office.Common/Security/Scripting/WarnCreatePDF",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_WARN_PRINT_DOC,
- "/apps/openoffice/lockdown/warn_info_printing",
- "org.openoffice.Office.Common/Security/Scripting/WarnPrintDoc",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_WARN_SAVEORSEND_DOC,
- "/apps/openoffice/lockdown/warn_info_saving",
- "org.openoffice.Office.Common/Security/Scripting/WarnSaveOrSendDoc",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_WARN_SIGN_DOC,
- "/apps/openoffice/lockdown/warn_info_signing",
- "org.openoffice.Office.Common/Security/Scripting/WarnSignDoc",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_REMOVE_PERSONAL_INFO,
- "/apps/openoffice/lockdown/remove_personal_info_on_save",
- "org.openoffice.Office.Common/Security/Scripting/RemovePersonalInfoOnSaving",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_RECOMMEND_PASSWORD,
- "/apps/openoffice/lockdown/recommend_password_on_save",
- "org.openoffice.Office.Common/Security/Scripting/RecommendPasswordProtection",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_UNDO_STEPS,
- "/apps/openoffice/undo_steps",
- "org.openoffice.Office.Common/Undo/Steps",
- "int",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_SYMBOL_SET,
- "/apps/openoffice/icon_size",
- "org.openoffice.Office.Common/Misc/SymbolSet",
- "short",
- sal_False,
- sal_True,
- SETTINGS_LAST
- },
-
- {
- SETTING_MACRO_SECURITY_LEVEL,
- "/apps/openoffice/lockdown/macro_security_level",
- "org.openoffice.Office.Common/Security/Scripting/MacroSecurityLevel",
- "int",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_CREATE_BACKUP,
- "/apps/openoffice/create_backup",
- "org.openoffice.Office.Common/Save/Document/CreateBackup",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
- {
- SETTING_WARN_ALIEN_FORMAT,
- "/apps/openoffice/warn_alien_format",
- "org.openoffice.Office.Common/Save/Document/WarnAlienFormat",
- "boolean",
- sal_False,
- sal_False,
- SETTINGS_LAST
- },
-
-#endif // ENABLE_LOCKDOWN
-
-};
-
-static const ConfigurationValue PathsConfigurationValuesList[] =
-{
- {
- SETTING_WORK_DIRECTORY,
- "/desktop/gnome/url-handlers/mailto/command", // dummy, needed for getTimestamp
- "org.openoffice.Office.Paths/Variables/Work",
- "string",
- sal_False,
- sal_True,
- SETTING_WORK_DIRECTORY, // so that the existence of the dir can be checked
- },
-};
-
-#ifdef ENABLE_LOCKDOWN
-static const char * SetupPreloadValuesList[] =
-{
- "/apps/openoffice",
- NULL
-};
-#endif // ENABLE_LOCKDOWN
-
-#ifdef ENABLE_LOCKDOWN
-static const char * RecoveryPreloadValuesList[] =
-{
- "/apps/openoffice",
- NULL
-};
-#endif // ENABLE_LOCKDOWN
-
-#ifdef ENABLE_LOCKDOWN
-static const char * UserProfilePreloadValuesList[] =
-{
- NULL
-};
-#endif // ENABLE_LOCKDOWN
-
-static const char * VCLPreloadValuesList[] =
-{
- "/desktop/gnome/interface",
-#ifdef ENABLE_LOCKDOWN
- "/desktop/gnome/lockdown",
-#endif // ENABLE_LOCKDOWN
- NULL
-};
-
-static const char * InetPreloadValuesList[] =
-{
- "/system/proxy",
- "/system/http_proxy/host",
- NULL
-};
-
-static const char * CommonPreloadValuesList[] =
-{
- "/desktop/gnome/url-handlers/mailto",
-#ifdef ENABLE_LOCKDOWN
- "/apps/openoffice/lockdown",
- "/apps/openoffice",
-#endif // ENABLE_LOCKDOWN
- NULL
-};
-
-static const char * PathsPreloadValuesList[] =
-{
- NULL
-};
-
-//==============================================================================
-
-/*
-void ONotificationThread::run()
-{
- mLoop= NULL;
- //Need to start a GMain loop for notifications to work
- mLoop=g_main_loop_new(g_main_context_default(),FALSE);
- g_main_loop_run(mLoop);
-} ;
-
-*/
-
-//------------------------------------------------------------------------------
-
-GconfBackend* GconfBackend::mInstance= 0;
-
-GconfBackend* GconfBackend::createInstance(const uno::Reference<uno::XComponentContext>& xContext)
-{
- if(mInstance == 0)
- {
- mInstance = new GconfBackend (xContext);
- }
-
- return mInstance;
-}
-
-//------------------------------------------------------------------------------
-
-GconfBackend::GconfBackend(const uno::Reference<uno::XComponentContext>& xContext)
- throw (backend::BackendAccessException)
- : BackendBase(mMutex), m_xContext(xContext)
-// , mNotificationThread(NULL)
-
-
-{
+#include "sal/config.h"
+
+#include <cstddef>
+
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/beans/Optional.hpp"
+#include "com/sun/star/beans/PropertyVetoException.hpp"
+#include "com/sun/star/beans/UnknownPropertyException.hpp"
+#include "com/sun/star/beans/XPropertyChangeListener.hpp"
+#include "com/sun/star/beans/XPropertySet.hpp"
+#include "com/sun/star/beans/XPropertySetInfo.hpp"
+#include "com/sun/star/beans/XVetoableChangeListener.hpp"
+#include "com/sun/star/lang/IllegalArgumentException.hpp"
+#include "com/sun/star/lang/WrappedTargetException.hpp"
+#include "com/sun/star/lang/XMultiComponentFactory.hpp"
+#include "com/sun/star/lang/XServiceInfo.hpp"
+#include "com/sun/star/lang/WrappedTargetException.hpp"
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/uno/XCurrentContext.hpp"
+#include "cppuhelper/factory.hxx"
+#include "cppuhelper/implbase2.hxx"
+#include "cppuhelper/implementationentry.hxx"
+#include "cppuhelper/weak.hxx"
+#include "rtl/string.h"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+#include "uno/current_context.hxx"
+#include "uno/lbnames.h"
+
+#include "gconfaccess.hxx"
+#include "orbit.h"
+
+namespace {
+
+namespace css = com::sun::star;
+
+rtl::OUString SAL_CALL getServiceImplementationName() {
+ return rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.comp.configuration.backend.GconfBackend"));
}
-//------------------------------------------------------------------------------
-
-GconfBackend::~GconfBackend(void) {
-
-
-// delete (mNotificationThread);
- GconfBackend::mClient = NULL;
-
+css::uno::Sequence< rtl::OUString > SAL_CALL getServiceSupportedServiceNames() {
+ rtl::OUString name(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.backend.GconfBackend"));
+ return css::uno::Sequence< rtl::OUString >(&name, 1);
}
-//------------------------------------------------------------------------------
-
-GConfClient* GconfBackend::mClient= 0;
-
-
-GConfClient* GconfBackend::getGconfClient()
-{
-
- if (mClient == NULL)
- {
- /* initialize glib object type library */
- g_type_init();
-
- GError* aError = NULL;
- if (!gconf_init(0, NULL, &aError))
- {
- rtl::OUStringBuffer msg;
- msg.appendAscii("GconfBackend:GconfLayer: Cannot Initialize Gconf connection - " );
- msg.appendAscii(aError->message);
-
- g_error_free(aError);
- aError = NULL;
- throw uno::RuntimeException(msg.makeStringAndClear(),NULL);
- }
-
- mClient = gconf_client_get_default();
- if (!mClient)
- {
- throw uno::RuntimeException(rtl::OUString::createFromAscii
- ("GconfBackend:GconfLayer: Cannot Initialize Gconf connection"),NULL);
- }
- }
-
- return mClient;
-}
-
-//------------------------------------------------------------------------------
-
-uno::Reference<backend::XLayer> SAL_CALL GconfBackend::getLayer(
- const rtl::OUString& aComponent, const rtl::OUString& /*aTimestamp*/)
- throw (backend::BackendAccessException, lang::IllegalArgumentException)
-{
- uno::Reference<backend::XLayer> xLayer;
-
- if( aComponent.equalsAscii("org.openoffice.Office.Common" ) )
- {
- xLayer = new GconfLayer( m_xContext,
- CommonConfigurationValuesList,
- G_N_ELEMENTS( CommonConfigurationValuesList ),
- CommonPreloadValuesList );
- }
- else if( aComponent.equalsAscii("org.openoffice.Inet" ) )
- {
- xLayer = new GconfLayer( m_xContext,
- InetConfigurationValuesList,
- G_N_ELEMENTS( InetConfigurationValuesList ),
- InetPreloadValuesList );
- }
- else if( aComponent.equalsAscii("org.openoffice.VCL" ) )
- {
- xLayer = new GconfLayer( m_xContext,
- VCLConfigurationValuesList,
- G_N_ELEMENTS( VCLConfigurationValuesList ),
- VCLPreloadValuesList );
- }
- else if( aComponent.equalsAscii("org.openoffice.Office.Paths" ) )
- {
- xLayer = new GconfLayer( m_xContext,
- PathsConfigurationValuesList,
- G_N_ELEMENTS( PathsConfigurationValuesList ),
- PathsPreloadValuesList );
- }
+class Service:
+ public cppu::WeakImplHelper2<
+ css::lang::XServiceInfo, css::beans::XPropertySet >,
+ private boost::noncopyable
+{
+public:
+ Service();
+
+private:
+ virtual ~Service() {}
+
+ virtual rtl::OUString SAL_CALL getImplementationName()
+ throw (css::uno::RuntimeException)
+ { return getServiceImplementationName(); }
+
+ virtual sal_Bool SAL_CALL supportsService(rtl::OUString const & ServiceName)
+ throw (css::uno::RuntimeException)
+ { return ServiceName == getSupportedServiceNames()[0]; }
+
+ virtual css::uno::Sequence< rtl::OUString > SAL_CALL
+ getSupportedServiceNames() throw (css::uno::RuntimeException)
+ { return getServiceSupportedServiceNames(); }
+
+ virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
+ getPropertySetInfo() throw (css::uno::RuntimeException)
+ { return css::uno::Reference< css::beans::XPropertySetInfo >(); }
+
+ virtual void SAL_CALL setPropertyValue(
+ rtl::OUString const &, css::uno::Any const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::beans::PropertyVetoException,
+ css::lang::IllegalArgumentException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException);
+
+ virtual css::uno::Any SAL_CALL getPropertyValue(
+ rtl::OUString const & PropertyName)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException);
+
+ virtual void SAL_CALL addPropertyChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XPropertyChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
+ virtual void SAL_CALL removePropertyChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XPropertyChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
+ virtual void SAL_CALL addVetoableChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XVetoableChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
+ virtual void SAL_CALL removeVetoableChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XVetoableChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
+ bool enabled_;
+};
-#ifdef ENABLE_LOCKDOWN
- else if( aComponent.equalsAscii("org.openoffice.UserProfile" ) )
- {
- xLayer = new GconfLayer( m_xContext,
- UserProfileConfigurationValuesList,
- G_N_ELEMENTS( UserProfileConfigurationValuesList ),
- UserProfilePreloadValuesList );
- }
- else if( aComponent.equalsAscii("org.openoffice.Office.Recovery" ) )
- {
- xLayer = new GconfLayer( m_xContext,
- RecoveryConfigurationValuesList,
- G_N_ELEMENTS( RecoveryConfigurationValuesList ),
- RecoveryPreloadValuesList );
- }
- else if( aComponent.equalsAscii("org.openoffice.Setup" ) )
- {
- xLayer = new GconfLayer( m_xContext,
- SetupConfigurationValuesList,
- G_N_ELEMENTS( SetupConfigurationValuesList ),
- SetupPreloadValuesList );
+Service::Service(): enabled_(false) {
+ css::uno::Reference< css::uno::XCurrentContext > context(
+ css::uno::getCurrentContext());
+ if (context.is()) {
+ rtl::OUString desktop;
+ context->getValueByName(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("system.desktop-environment"))) >>=
+ desktop;
+ enabled_ = desktop.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("GNOME")) &&
+ ((orbit_major_version == 2 && orbit_minor_version >= 8) ||
+ orbit_major_version > 2);
+ // ORBit-2 versions < 2.8 cause a deadlock with the gtk+ VCL plugin
}
-#endif // ENABLE_LOCKDOWN
-
- return xLayer;
}
-//------------------------------------------------------------------------------
-
-uno::Reference<backend::XUpdatableLayer> SAL_CALL
-GconfBackend::getUpdatableLayer(const rtl::OUString& /*aComponent*/)
- throw (backend::BackendAccessException,lang::NoSupportException,
- lang::IllegalArgumentException)
+void Service::setPropertyValue(rtl::OUString const &, css::uno::Any const &)
+ throw (
+ css::beans::UnknownPropertyException, css::beans::PropertyVetoException,
+ css::lang::IllegalArgumentException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
{
- throw lang::NoSupportException( rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("GconfBackend: No Update Operation allowed, Read Only access") ),
- *this) ;
+ throw css::lang::IllegalArgumentException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("setPropertyValue not supported")),
+ static_cast< cppu::OWeakObject * >(this), -1);
}
-//------------------------------------------------------------------------------
-
-// currently not used
-#if 0
-static void
-keyChangedCallback(GConfClient* aClient,
- guint aID,
- GConfEntry* aEntry,
- gpointer aBackend)
+css::uno::Any Service::getPropertyValue(rtl::OUString const & PropertyName)
+ throw (
+ css::beans::UnknownPropertyException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
{
-
- OSL_TRACE("In KeyChangedCallback Function");
- rtl::OUString aGconfKey= rtl::OUString::createFromAscii(aEntry->key);
- GconfBackend * aGconfBe = (GconfBackend*) aBackend;
-
- aGconfBe->notifyListeners(aGconfKey);
-
-}
-
-//------------------------------------------------------------------------------
-
-void GconfBackend::notifyListeners(const rtl::OUString& /*aGconfKey*/)
-{
-/*
- //look up associated component from Map using GconfKey
- KeyMappingTable::iterator aIter;
- rtl::OUString aComponent;
- for( aIter= mKeyMap.begin(); aIter != mKeyMap.end(); aIter++)
- {
- if (aIter->second.mGconfName == aGconfKey)
- {
- aComponent = aIter->first;
- break;
- }
-
- }
-
-
- //Need to store updated layer TimeStamp as Gconf library
- //has no access to TimeStamp via its api
- TimeValue aTimeValue ={0,0} ;
- osl_getSystemTime(&aTimeValue);
-
- oslDateTime aLayerTS;
- rtl::OUString aTimeStamp;
-
- if (osl_getDateTimeFromTimeValue(&aTimeValue, &aLayerTS)) {
- sal_Char asciiStamp [20] ;
-
- sprintf(asciiStamp, "%04d%02d%02d%02d%02d%02dZ",
- aLayerTS.Year, aLayerTS.Month, aLayerTS.Day,
- aLayerTS.Hours, aLayerTS.Minutes, aLayerTS.Seconds) ;
- aTimeStamp = rtl::OUString::createFromAscii(asciiStamp) ;
- }
-
-
- TSMappingTable::iterator aTSIter;
- aTSIter = mTSMap.find(aComponent);
- if (aTSIter == mTSMap.end())
- {
- mTSMap.insert(TSMappingTable::value_type(aComponent,aTimeStamp));
- }
- else
- {
- aTSIter->second = aTimeStamp;
-
- }
- typedef ListenerList::iterator LLIter;
- typedef std::pair<LLIter, LLIter> BFRange;
- BFRange aRange = mListenerList.equal_range(aComponent);
- while (aRange.first != aRange.second)
- {
- LLIter cur = aRange.first++;
- backend::ComponentChangeEvent aEvent;
- aEvent.Component = aComponent;
- aEvent.Source = *this;
- cur->second->componentDataChanged(aEvent);
-
- }
-*/
-}
-#endif
-
-//------------------------------------------------------------------------------
-void SAL_CALL GconfBackend::addChangesListener(
- const uno::Reference<backend::XBackendChangesListener>& xListener,
- const rtl::OUString& aComponent)
- throw (::com::sun::star::uno::RuntimeException)
-{
-/*
- osl::MutexGuard aGuard(mMutex);
-
- GConfClient* aClient = getGconfClient();
-
- ListenerList::iterator aIter;
- aIter = mListenerList.find(aComponent);
- if (aIter == mListenerList.end())
- {
- typedef KeyMappingTable::iterator KMTIter;
- typedef std::pair<KMTIter, KMTIter> BFRange;
-
- BFRange aRange = mKeyMap.equal_range(aComponent);
-
- while (aRange.first != aRange.second)
- {
- KMTIter cur = aRange.first++;
-
- sal_Int32 nIndex = cur->second.mGconfName.lastIndexOf('/');
- rtl::OUString aDirectory = cur->second.mGconfName.copy(0, nIndex);
- rtl::OString aDirectoryStr= rtl::OUStringToOString(aDirectory, RTL_TEXTENCODING_ASCII_US);
- GError* aError = NULL;
- gconf_client_add_dir(aClient,
- aDirectoryStr.getStr(),
- GCONF_CLIENT_PRELOAD_NONE,
- &aError);
-
- if(aError != NULL)
- {
- OSL_TRACE("GconfBackend:: Cannot register listener for Component %s",
- rtl::OUStringToOString(aComponent, RTL_TEXTENCODING_ASCII_US).getStr() );
- }
-
- rtl::OString aKey = rtl::OUStringToOString(cur->second.mGconfName,
- RTL_TEXTENCODING_ASCII_US);
-
- GConfClientNotifyFunc aNotifyFunc = &keyChangedCallback;
- sal_uInt32 aID = gconf_client_notify_add(
- aClient,
- aKey.getStr(),
- aNotifyFunc,
- this,
- NULL,
- &aError);
- if(aError != NULL)
- {
- OSL_TRACE("GconfBackend:: Cannot register listener for Component %s",
- rtl::OUStringToOString(aComponent, RTL_TEXTENCODING_ASCII_US).getStr() );
- }
-
-
-
- }
-
- }
-*/
-
-/*
- if (mNotificationThread == NULL)
- {
-
- mNotificationThread = new ONotificationThread();
-
- if ( mNotificationThread == NULL)
- {
- OSL_ENSURE(false,"Could not start Notification Thread ");
- }
- else
+ for (std::size_t i = 0; i < gconfaccess::nConfigurationValues; ++i) {
+ if (PropertyName.equalsAscii(
+ gconfaccess::ConfigurationValues[i].OOoConfItem))
{
- mNotificationThread->create();
+ return css::uno::makeAny(
+ enabled_
+ ? gconfaccess::getValue(gconfaccess::ConfigurationValues[i])
+ : css::beans::Optional< css::uno::Any >());
}
}
-*/
- //Store listener in list
- mListenerList.insert(ListenerList::value_type(aComponent, xListener));
-
-
-}
-//------------------------------------------------------------------------------
-void SAL_CALL GconfBackend::removeChangesListener(
- const uno::Reference<backend::XBackendChangesListener>& /*xListener*/,
- const rtl::OUString& /*aComponent*/)
- throw (::com::sun::star::uno::RuntimeException)
-{
-/*
- osl::MutexGuard aGuard(mMutex);
- GConfClient* aClient = GconfBackend::getGconfClient();
- ListenerList::iterator aIter;
- aIter = mListenerList.find(aComponent);
- if (aIter == mListenerList.end())
- {
-
- OSL_TRACE("GconfBackend:: Cannot deregister listener for Component %s - Listner not registered",
- rtl::OUStringToOString(aComponent, RTL_TEXTENCODING_ASCII_US).getStr() );
-
- typedef KeyMappingTable::iterator KMTIter;
- typedef std::pair<KMTIter, KMTIter> BFRange;
-
- BFRange aRange = mKeyMap.equal_range(aComponent);
-
- while (aRange.first != aRange.second)
- {
- KMTIter cur = aRange.first++;
-
- sal_Int32 nIndex = cur->second.mGconfName.lastIndexOf('/');
- rtl::OUString aDirectory = cur->second.mGconfName.copy(0, nIndex);
- rtl::OString aDirectoryStr= rtl::OUStringToOString(aDirectory, RTL_TEXTENCODING_ASCII_US);
- GError* aError = NULL;
- gconf_client_remove_dir(aClient,
- aDirectoryStr.getStr(),
- &aError);
-
- if(aError != NULL)
- {
- OSL_TRACE("GconfBackend:: Cannot deRegister listener for Component %s",
- rtl::OUStringToOString(aComponent, RTL_TEXTENCODING_ASCII_US).getStr() );
- }
- }
- }
-*/
+ throw css::beans::UnknownPropertyException(
+ PropertyName, static_cast< cppu::OWeakObject * >(this));
}
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL GconfBackend::getBackendName(void) {
- return rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.configuration.backend.GconfBackend") );
+css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance(
+ css::uno::Reference< css::uno::XComponentContext > const &)
+{
+ return static_cast< cppu::OWeakObject * >(new Service);
}
-//------------------------------------------------------------------------------
+static cppu::ImplementationEntry const services[] = {
+ { &createInstance, &getServiceImplementationName,
+ &getServiceSupportedServiceNames, &cppu::createSingleComponentFactory, 0,
+ 0 },
+ { 0, 0, 0, 0, 0, 0 }
+};
-rtl::OUString SAL_CALL GconfBackend::getImplementationName(void)
- throw (uno::RuntimeException)
-{
- return getBackendName() ;
}
-//------------------------------------------------------------------------------
-
-uno::Sequence<rtl::OUString> SAL_CALL GconfBackend::getBackendServiceNames(void)
+extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
+ char const * pImplName, void * pServiceManager, void * pRegistryKey)
{
- uno::Sequence<rtl::OUString> aServices(1) ;
- aServices[0] = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.GconfBackend")) ;
-
- return aServices ;
+ return cppu::component_getFactoryHelper(
+ pImplName, pServiceManager, pRegistryKey, services);
}
-//------------------------------------------------------------------------------
-
-sal_Bool SAL_CALL GconfBackend::supportsService(const rtl::OUString& aServiceName)
- throw (uno::RuntimeException)
+extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL
+component_getImplementationEnvironment(
+ char const ** ppEnvTypeName, uno_Environment **)
{
- uno::Sequence< rtl::OUString > const svc = getBackendServiceNames();
-
- for(sal_Int32 i = 0; i < svc.getLength(); ++i )
- if(svc[i] == aServiceName)
- return true;
-
- return false;
+ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-//------------------------------------------------------------------------------
-
-uno::Sequence<rtl::OUString>
-SAL_CALL GconfBackend::getSupportedServiceNames(void)
- throw (uno::RuntimeException)
+extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
+ void * pServiceManager, void * pRegistryKey)
{
- return getBackendServiceNames() ;
+ return component_writeInfoHelper(pServiceManager, pRegistryKey, services);
}
-
-// ---------------------------------------------------------------------------------------
-
-
diff --git a/shell/source/backends/gconfbe/gconfbackend.hxx b/shell/source/backends/gconfbe/gconfbackend.hxx
deleted file mode 100644
index 1a2935907d..0000000000
--- a/shell/source/backends/gconfbe/gconfbackend.hxx
+++ /dev/null
@@ -1,223 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef GCONFBACKEND_HXX_
-#define GCONFBACKEND_HXX_
-
-#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XSCHEMASUPPLIER_HPP_
-#include <com/sun/star/configuration/backend/XSingleLayerStratum.hpp>
-#endif
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-
-//#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
-//#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-//#endif // _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
-#include <com/sun/star/configuration/InvalidBootstrapFileException.hpp>
-#include <com/sun/star/configuration/backend/CannotConnectException.hpp>
-#include <com/sun/star/configuration/backend/XBackendChangesNotifier.hpp>
-#include <cppuhelper/compbase3.hxx>
-
-#ifndef INCLUDED_MAP
-#include <map>
-#define INCLUDED_MAP
-#endif
-//#ifndef _VOS_THREAD_HXX_
-//#include <vos/thread.hxx>
-//#endif
-
-#include <gconf/gconf-client.h>
-
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-
-
-/** Structure containing the mapping between OOffice and Gconf keys.
- AlOO specifies whether the key is protected, if key is protected it
- can not be over riden in subsequent higher layers
-*/
-struct keyMapping
-{
- keyMapping(){};
- rtl::OUString mOOName;
- rtl::OUString mOOType;
- rtl::OUString mGconfName;
- sal_Bool mbProtected;
-};
-
-typedef keyMapping KeyMappingInfo;
-typedef std::multimap<rtl::OUString, KeyMappingInfo> KeyMappingTable;
-
-/*Time Stamp mapping table used to store timestamps of updated components
- when a notification is recieved. It is needed as you cannot access gconf key
- timestamps via the Gconf api */
-
-typedef std::multimap<rtl::OUString, rtl::OUString> TSMappingTable;
-
-//------------------------------------------------------------------------------
-
-/*
-class ONotificationThread: public vos::OThread
-{
-
-
-public:
- ONotificationThread()
- {}
-
- ~ONotificationThread()
- {
- g_main_loop_quit(mLoop);
- }
-
-private:
- virtual void SAL_CALL onTerminated()
- {
- delete this;
- }
-
- virtual void SAL_CALL run();
- GMainLoop* mLoop;
-};
-
-*/
-
-//------------------------------------------------------------------------------
-typedef cppu::WeakComponentImplHelper3<backend::XSingleLayerStratum,
- backend::XBackendChangesNotifier,
- lang::XServiceInfo> BackendBase ;
-
-/**
- Implements the SingleLayerStratum service for gconf access.
- */
-class GconfBackend : public BackendBase {
- public :
-
- static GconfBackend* createInstance(const uno::Reference<uno::XComponentContext>& xContext);
-
- // XServiceInfo
- virtual rtl::OUString SAL_CALL getImplementationName( )
- throw (uno::RuntimeException) ;
-
- virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& aServiceName )
- throw (uno::RuntimeException) ;
-
- virtual uno::Sequence<rtl::OUString> SAL_CALL getSupportedServiceNames( )
- throw (uno::RuntimeException) ;
-
- /**
- Provides the implementation name.
-
- @return implementation name
- */
- static rtl::OUString SAL_CALL getBackendName(void) ;
-
- /**
- Provides the supported services names
-
- @return service names
- */
- static uno::Sequence<rtl::OUString> SAL_CALL getBackendServiceNames(void) ;
-
- /* returns a GconfClient */
- static GConfClient* getGconfClient();
-
- //XSingleLayerStratum
- virtual uno::Reference<backend::XLayer> SAL_CALL
- getLayer( const rtl::OUString& aLayerId, const rtl::OUString& aTimestamp )
- throw (backend::BackendAccessException, lang::IllegalArgumentException) ;
-
- virtual uno::Reference<backend::XUpdatableLayer> SAL_CALL
- getUpdatableLayer( const rtl::OUString& aLayerId )
- throw (backend::BackendAccessException, lang::NoSupportException,
- lang::IllegalArgumentException) ;
-
- // XBackendChangesNotifier
- virtual void SAL_CALL addChangesListener(
- const uno::Reference<backend::XBackendChangesListener>& xListener,
- const rtl::OUString& aComponent)
- throw (::com::sun::star::uno::RuntimeException);
-
-
- virtual void SAL_CALL removeChangesListener(
- const uno::Reference<backend::XBackendChangesListener>& xListener,
- const rtl::OUString& aComponent)
- throw (::com::sun::star::uno::RuntimeException);
-// currently not used
-#if 0
- //Notify all listener of component change
- void notifyListeners(const rtl::OUString& aGconfKey);
-#endif
- protected:
- /**
- Service constructor from a service factory.
-
- @param xContext component context
- */
- GconfBackend(const uno::Reference<uno::XComponentContext>& xContext)
- throw (backend::BackendAccessException);
-
- /** Destructor */
- ~GconfBackend(void) ;
-
- private:
-
- typedef uno::Reference<backend::XBackendChangesListener> ListenerRef;
- typedef std::multimap<rtl::OUString,ListenerRef> ListenerList;
-
- /** Build Gconf/OO mapping table */
- void initializeMappingTable ();
-
-
- /** The component context */
- uno::Reference<uno::XComponentContext> m_xContext;
-
- /** Mutex for reOOurces protection */
- osl::Mutex mMutex ;
-
- KeyMappingTable mKeyMap;
-
- /** List of component TimeStamps */
- TSMappingTable mTSMap;
-
- static GconfBackend* mInstance;
-
- /** List of listener */
- ListenerList mListenerList;
-
- /**Connection to Gconf */
- static GConfClient* mClient;
-
-// ONotificationThread* mNotificationThread;
-} ;
-
-
-#endif // CONFIGMGR_LOCALBE_LOCALSINGLESTRATUM_HXX_
diff --git a/shell/source/backends/gconfbe/gconfbe.xml b/shell/source/backends/gconfbe/gconfbe.xml
deleted file mode 100644
index 4f795f6160..0000000000
--- a/shell/source/backends/gconfbe/gconfbe.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd">
-<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
- <module-name>gconfbe</module-name>
- <component-description>
- <author> Oliver Braun </author>
- <name>com.sun.star.comp.configuration.backend.GconfBackend</name>
- <description> The </description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language>c++</language>
- <status value="beta"/>
- <supported-service>com.sun.star.comp.configuration.backend.GconfBackend</supported-service>
- <service-dependency>...</service-dependency>
- <type>com.sun.star.configuration.backend.XBackendChangesListener</type>
- <type>com.sun.star.configuration.backend.XBackendChangesNotifier</type>
- <type>com.sun.star.configuration.backend.XLayerHandler</type>
- <type>com.sun.star.configuration.backend.XSingleLayerStratum</type>
- <type>com.sun.star.lang.XMultiComponentFactory</type>
- <type>com.sun.star.lang.XServiceInfo</type>
- <type>com.sun.star.lang.XSingleComponentFactory</type>
- <type>com.sun.star.lang.XTypeProvider</type>
- <type>com.sun.star.uno.TypeClass</type>
- <type>com.sun.star.uno.XAggregation</type>
- <type>com.sun.star.uno.XComponentContext</type>
- <type>com.sun.star.uno.XCurrentContext</type>
- <type>com.sun.star.uno.XWeak</type>
- <type>com.sun.star.registry.XRegistryKey</type>
- </component-description>
- <project-build-dependency>cppuhelper</project-build-dependency>
- <project-build-dependency>cppu</project-build-dependency>
- <project-build-dependency>sal</project-build-dependency>
- <runtime-module-dependency>cppuhelper3$(COM)</runtime-module-dependency>
- <runtime-module-dependency>cppu3</runtime-module-dependency>
- <runtime-module-dependency>sal3</runtime-module-dependency>
-</module-description>
diff --git a/shell/source/backends/gconfbe/gconfbecdef.cxx b/shell/source/backends/gconfbe/gconfbecdef.cxx
deleted file mode 100644
index 6cc086f51b..0000000000
--- a/shell/source/backends/gconfbe/gconfbecdef.cxx
+++ /dev/null
@@ -1,148 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-#include "gconfbackend.hxx"
-#include <com/sun/star/registry/XRegistryKey.hpp>
-
-#ifndef _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_
-#include <cppuhelper/implementationentry.hxx>
-#endif // _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <rtl/ustrbuf.hxx>
-
-#include "uno/current_context.hxx"
-#include <stdio.h>
-#include "orbit.h"
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-
-//==============================================================================
-
-static uno::Reference<uno::XInterface> SAL_CALL createGconfBackend(const uno::Reference<uno::XComponentContext>& xContext)
-{
- try {
- uno::Reference< uno::XCurrentContext > xCurrentContext(uno::getCurrentContext());
-
- if (xCurrentContext.is())
- {
- uno::Any aValue = xCurrentContext->getValueByName(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "system.desktop-environment" ) ) );
-
- rtl::OUString aDesktopEnvironment;
- if ( (aValue >>= aDesktopEnvironment) && (aDesktopEnvironment.equalsAscii("GNOME")) )
- {
- // ORBit-2 versions < 2.8 cause a deadlock with the gtk+ VCL plugin
- if ( (orbit_major_version >= 2) && (orbit_minor_version >= 8) )
- {
- return * GconfBackend::createInstance(xContext);
- }
- }
- }
-
- return uno::Reference<uno::XInterface>();
-
- } catch (uno::RuntimeException e) {
- return uno::Reference<uno::XInterface>();
- }
-
-}
-
-//==============================================================================
-
-static const cppu::ImplementationEntry kImplementations_entries[] =
-{
- {
- createGconfBackend,
- GconfBackend::getBackendName,
- GconfBackend::getBackendServiceNames,
- cppu::createSingleComponentFactory,
- NULL,
- 0
- },
- { NULL, NULL, NULL, NULL, NULL, 0 }
-} ;
-//------------------------------------------------------------------------------
-
-extern "C" void SAL_CALL component_getImplementationEnvironment(
- const sal_Char **aEnvTypeName,
- uno_Environment **/*aEnvironment*/) {
- *aEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ;
-}
-
-//------------------------------------------------------------------------------
-
-extern "C" sal_Bool SAL_CALL component_writeInfo(void */*pServiceManager*/,
- void *pRegistryKey) {
-
- using namespace ::com::sun::star::registry;
- if (pRegistryKey)
- {
- try
- {
- uno::Reference< XRegistryKey > xImplKey = static_cast< XRegistryKey* >( pRegistryKey )->createKey(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + GconfBackend::getBackendName()
- );
-
- // Register associated service names
- uno::Reference< XRegistryKey > xServicesKey = xImplKey->createKey(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES") )
- );
-
- uno::Sequence<rtl::OUString> sServiceNames = GconfBackend::getBackendServiceNames();
- for (sal_Int32 i = 0 ; i < sServiceNames.getLength() ; ++ i)
- xServicesKey->createKey(sServiceNames[i]);
-
- return sal_True;
- }
-
- catch( InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "InvalidRegistryException caught");
- }
- }
-
- return sal_False;
-}
-
-//------------------------------------------------------------------------------
-
-extern "C" void *component_getFactory(const sal_Char *aImplementationName,
- void *aServiceManager,
- void *aRegistryKey) {
-
- return cppu::component_getFactoryHelper(
- aImplementationName,
- aServiceManager,
- aRegistryKey,
- kImplementations_entries) ;
-}
-//------------------------------------------------------------------------------
diff --git a/shell/source/backends/gconfbe/gconflayer.hxx b/shell/source/backends/gconfbe/gconflayer.hxx
deleted file mode 100644
index e3e0e67313..0000000000
--- a/shell/source/backends/gconfbe/gconflayer.hxx
+++ /dev/null
@@ -1,133 +0,0 @@
-#ifndef GCONFLAYER_HXX_
-#define GCONFLAYER_HXX_
-
-#include "gconfbackend.hxx"
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
-
-#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#endif // _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
-#include <com/sun/star/util/XTimeStamped.hpp>
-#include <cppuhelper/implbase2.hxx>
-
-#define GCONF_PROXY_MODE_KEY "/system/proxy/mode"
-#define GCONF_AUTO_SAVE_KEY "/apps/openoffice/auto_save"
-
-enum ConfigurationSetting
-{
- SETTING_PROXY_MODE,
- SETTING_PROXY_HTTP_HOST,
- SETTING_PROXY_HTTP_PORT,
- SETTING_PROXY_HTTPS_HOST,
- SETTING_PROXY_HTTPS_PORT,
- SETTING_PROXY_FTP_HOST,
- SETTING_PROXY_FTP_PORT,
- SETTING_NO_PROXY_FOR,
- SETTING_ENABLE_ACCESSIBILITY,
- SETTING_MAILER_PROGRAM,
- SETTING_WORK_DIRECTORY,
- SETTING_SOURCEVIEWFONT_NAME,
- SETTING_SOURCEVIEWFONT_HEIGHT,
- SETTING_USER_GIVENNAME,
- SETTING_USER_SURNAME,
-
-#ifdef ENABLE_LOCKDOWN
-
- SETTING_DISABLE_PRINTING,
- SETTING_USE_SYSTEM_FILE_DIALOG,
- SETTING_DISABLE_UI_CUSTOMIZATION,
- SETTING_PRINTING_MODIFIES_DOCUMENT,
- SETTING_SHOW_ICONS_IN_MENUS,
- SETTING_SHOW_INACTIVE_MENUITEMS,
- SETTING_SHOW_FONT_PREVIEW,
- SETTING_SHOW_FONT_HISTORY,
- SETTING_ENABLE_OPENGL,
- SETTING_OPTIMIZE_OPENGL,
- SETTING_SAVE_DOCUMENT_WINDOWS,
- SETTING_SAVE_DOCUMENT_VIEW_INFO,
- SETTING_USE_SYSTEM_FONT,
- SETTING_USE_FONT_ANTI_ALIASING,
- SETTING_FONT_ANTI_ALIASING_MIN_PIXEL,
- SETTING_WARN_CREATE_PDF,
- SETTING_WARN_PRINT_DOC,
- SETTING_WARN_SAVEORSEND_DOC,
- SETTING_WARN_SIGN_DOC,
- SETTING_REMOVE_PERSONAL_INFO,
- SETTING_RECOMMEND_PASSWORD,
- SETTING_UNDO_STEPS,
- SETTING_SYMBOL_SET,
- SETTING_MACRO_SECURITY_LEVEL,
- SETTING_CREATE_BACKUP,
- SETTING_WARN_ALIEN_FORMAT,
- SETTING_AUTO_SAVE,
- SETTING_AUTO_SAVE_INTERVAL,
- SETTING_WRITER_DEFAULT_DOC_FORMAT,
- SETTING_IMPRESS_DEFAULT_DOC_FORMAT,
- SETTING_CALC_DEFAULT_DOC_FORMAT,
-
-#endif // ENABLE_LOCKDOWN
-
- SETTINGS_LAST
-};
-
-struct ConfigurationValue
-{
- const ConfigurationSetting nSettingId;
- const gchar *GconfItem;
- const char *OOoConfItem;
- const char *OOoConfValueType;
- const sal_Bool bLocked;
- const sal_Bool bNeedsTranslation;
- const ConfigurationSetting nDependsOn;
-};
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-namespace util = css::util ;
-
-/**
- Implementation of the XLayer interface for the Gconf values mapped into
- the org.openoffice.* configuration component.
- */
-class GconfLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped>
-{
-public :
- /**
- Constructor given the component context
-
- @param xContext The component context
- */
-
- GconfLayer( const uno::Reference<uno::XComponentContext>& xContext,
- const ConfigurationValue pConfigurationValuesList[],
- const sal_Int32 nConfigurationValues,
- const char * pPreloadValuesList[] );
-
- // XLayer
- virtual void SAL_CALL readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException );
-
- // XTimeStamped
- virtual rtl::OUString SAL_CALL getTimestamp(void)
- throw (uno::RuntimeException);
-
- protected:
-
- /** Destructor */
- ~GconfLayer(void) {}
-
-private :
- uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber;
- const ConfigurationValue* m_pConfigurationValuesList;
- const sal_Int32 m_nConfigurationValues;
- const char** m_pPreloadValuesList;
- } ;
-
-#endif // GCONFLAYER
diff --git a/shell/source/backends/gconfbe/makefile.mk b/shell/source/backends/gconfbe/makefile.mk
index 9a17d3aeae..a8d9b23aa9 100644
--- a/shell/source/backends/gconfbe/makefile.mk
+++ b/shell/source/backends/gconfbe/makefile.mk
@@ -31,8 +31,7 @@ TARGET=gconfbe
LIBTARGET=NO
ENABLE_EXCEPTIONS=TRUE
-
-COMP1TYPELIST=$(TARGET)
+VISIBILITY_HIDDEN=TRUE
# --- Settings ---
@@ -65,9 +64,8 @@ PKGCONFIG_LIBS!:=-Wl,--export-dynamic $(PKGCONFIG_LIBS)
SLOFILES=\
- $(SLO)$/gconfbecdef.obj \
- $(SLO)$/gconfbackend.obj \
- $(SLO)$/gconflayer.obj
+ $(SLO)$/gconfaccess.obj \
+ $(SLO)$/gconfbackend.obj
SHL1NOCHECK=TRUE
SHL1TARGET=$(TARGET)1.uno
@@ -82,7 +80,6 @@ SHL1STDLIBS= \
SHL1STDLIBS+=$(PKGCONFIG_LIBS)
-SHL1VERSIONMAP=exports.map
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
diff --git a/shell/source/backends/kde4be/exports.map b/shell/source/backends/kde4be/exports.map
deleted file mode 100644
index ba501f9ae0..0000000000
--- a/shell/source/backends/kde4be/exports.map
+++ /dev/null
@@ -1,10 +0,0 @@
-UDK_3_0_0 {
- global:
- GetVersionInfo;
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/shell/source/backends/kde4be/kde4access.cxx b/shell/source/backends/kde4be/kde4access.cxx
new file mode 100644
index 0000000000..336d2d4a45
--- /dev/null
+++ b/shell/source/backends/kde4be/kde4access.cxx
@@ -0,0 +1,319 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_shell.hxx"
+#include "sal/config.h"
+
+#include "QFont"
+#include "QString"
+#include "kemailsettings.h"
+#include "kglobalsettings.h"
+#include "kprotocolmanager.h"
+
+#include "com/sun/star/uno/Any.hxx"
+#include "cppu/unotype.hxx"
+#include "osl/diagnose.h"
+#include "osl/file.h"
+#include "rtl/string.h"
+#include "rtl/ustring.hxx"
+
+#include "kde4access.hxx"
+
+#define SPACE ' '
+#define COMMA ','
+#define SEMI_COLON ';'
+
+namespace kde4access {
+
+namespace {
+
+namespace css = com::sun::star ;
+namespace uno = css::uno ;
+
+}
+
+css::beans::Optional< css::uno::Any > getValue(rtl::OUString const & id) {
+ if (id.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ExternalMailer"))) {
+ KEMailSettings aEmailSettings;
+ QString aClientProgram;
+ ::rtl::OUString sClientProgram;
+
+ aClientProgram = aEmailSettings.getSetting( KEMailSettings::ClientProgram );
+ if ( aClientProgram.isEmpty() )
+ aClientProgram = "kmail";
+ else
+ aClientProgram = aClientProgram.section(SPACE, 0, 0);
+ sClientProgram = (const sal_Unicode *) aClientProgram.utf16();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( sClientProgram ) );
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("SourceViewFontHeight")))
+ {
+ QFont aFixedFont;
+ short nFontHeight;
+
+ aFixedFont = KGlobalSettings::fixedFont();
+ nFontHeight = aFixedFont.pointSize();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( nFontHeight ) );
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("SourceViewFontName")))
+ {
+ QFont aFixedFont;
+ QString aFontName;
+ :: rtl::OUString sFontName;
+
+ aFixedFont = KGlobalSettings::fixedFont();
+ aFontName = aFixedFont.family();
+ sFontName = (const sal_Unicode *) aFontName.utf16();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( sFontName ) );
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("EnableATToolSupport")))
+ {
+ /* does not make much sense without an accessibility bridge */
+ sal_Bool ATToolSupport = sal_False;
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( rtl::OUString::valueOf( ATToolSupport ) ) );
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("WorkPathVariable")))
+ {
+ QString aDocumentsDir( KGlobalSettings::documentPath() );
+ rtl::OUString sDocumentsDir;
+ rtl::OUString sDocumentsURL;
+ if ( aDocumentsDir.endsWith(QChar('/')) )
+ aDocumentsDir.truncate ( aDocumentsDir.length() - 1 );
+ sDocumentsDir = (const sal_Unicode *) aDocumentsDir.utf16();
+ osl_getFileURLFromSystemPath( sDocumentsDir.pData, &sDocumentsURL.pData );
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( sDocumentsURL ) );
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyName")))
+ {
+ QString aFTPProxy;
+ switch ( KProtocolManager::proxyType() )
+ {
+ case KProtocolManager::ManualProxy: // Proxies are manually configured
+ aFTPProxy = KProtocolManager::proxyFor( "FTP" );
+ break;
+ case KProtocolManager::PACProxy: // A proxy configuration URL has been given
+ case KProtocolManager::WPADProxy: // A proxy should be automatically discovered
+ case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
+// In such cases, the proxy address is not stored in KDE, but determined dynamically.
+// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind...
+// The best we can do here is to ask the current value for a given address.
+ aFTPProxy = KProtocolManager::proxyForUrl( KUrl("ftp://ftp.openoffice.org") );
+ break;
+ default: // No proxy is used
+ break;
+ }
+ if ( !aFTPProxy.isEmpty() )
+ {
+ KUrl aProxy(aFTPProxy);
+ ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().utf16();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( sProxy ) );
+ }
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyPort")))
+ {
+ QString aFTPProxy;
+ switch ( KProtocolManager::proxyType() )
+ {
+ case KProtocolManager::ManualProxy: // Proxies are manually configured
+ aFTPProxy = KProtocolManager::proxyFor( "FTP" );
+ break;
+ case KProtocolManager::PACProxy: // A proxy configuration URL has been given
+ case KProtocolManager::WPADProxy: // A proxy should be automatically discovered
+ case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
+// In such cases, the proxy address is not stored in KDE, but determined dynamically.
+// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind...
+// The best we can do here is to ask the current value for a given address.
+ aFTPProxy = KProtocolManager::proxyForUrl( KUrl("ftp://ftp.openoffice.org") );
+ break;
+ default: // No proxy is used
+ break;
+ }
+ if ( !aFTPProxy.isEmpty() )
+ {
+ KUrl aProxy(aFTPProxy);
+ sal_Int32 nPort = aProxy.port();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( nPort ) );
+ }
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyName")))
+ {
+ QString aHTTPProxy;
+ switch ( KProtocolManager::proxyType() )
+ {
+ case KProtocolManager::ManualProxy: // Proxies are manually configured
+ aHTTPProxy = KProtocolManager::proxyFor( "HTTP" );
+ break;
+ case KProtocolManager::PACProxy: // A proxy configuration URL has been given
+ case KProtocolManager::WPADProxy: // A proxy should be automatically discovered
+ case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
+// In such cases, the proxy address is not stored in KDE, but determined dynamically.
+// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind...
+// The best we can do here is to ask the current value for a given address.
+ aHTTPProxy = KProtocolManager::proxyForUrl( KUrl("http://http.openoffice.org") );
+ break;
+ default: // No proxy is used
+ break;
+ }
+ if ( !aHTTPProxy.isEmpty() )
+ {
+ KUrl aProxy(aHTTPProxy);
+ ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().utf16();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( sProxy ) );
+ }
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyPort")))
+ {
+ QString aHTTPProxy;
+ switch ( KProtocolManager::proxyType() )
+ {
+ case KProtocolManager::ManualProxy: // Proxies are manually configured
+ aHTTPProxy = KProtocolManager::proxyFor( "HTTP" );
+ break;
+ case KProtocolManager::PACProxy: // A proxy configuration URL has been given
+ case KProtocolManager::WPADProxy: // A proxy should be automatically discovered
+ case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
+// In such cases, the proxy address is not stored in KDE, but determined dynamically.
+// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind...
+// The best we can do here is to ask the current value for a given address.
+ aHTTPProxy = KProtocolManager::proxyForUrl( KUrl("http://http.openoffice.org") );
+ break;
+ default: // No proxy is used
+ break;
+ }
+ if ( !aHTTPProxy.isEmpty() )
+ {
+ KUrl aProxy(aHTTPProxy);
+ sal_Int32 nPort = aProxy.port();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( nPort ) );
+ }
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyName")))
+ {
+ QString aHTTPSProxy;
+ switch ( KProtocolManager::proxyType() )
+ {
+ case KProtocolManager::ManualProxy: // Proxies are manually configured
+ aHTTPSProxy = KProtocolManager::proxyFor( "HTTPS" );
+ break;
+ case KProtocolManager::PACProxy: // A proxy configuration URL has been given
+ case KProtocolManager::WPADProxy: // A proxy should be automatically discovered
+ case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
+// In such cases, the proxy address is not stored in KDE, but determined dynamically.
+// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind...
+// The best we can do here is to ask the current value for a given address.
+ aHTTPSProxy = KProtocolManager::proxyForUrl( KUrl("https://https.openoffice.org") );
+ break;
+ default: // No proxy is used
+ break;
+ }
+ if ( !aHTTPSProxy.isEmpty() )
+ {
+ KUrl aProxy(aHTTPSProxy);
+ ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().utf16();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( sProxy ) );
+ }
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyPort")))
+ {
+ QString aHTTPSProxy;
+ switch ( KProtocolManager::proxyType() )
+ {
+ case KProtocolManager::ManualProxy: // Proxies are manually configured
+ aHTTPSProxy = KProtocolManager::proxyFor( "HTTPS" );
+ break;
+ case KProtocolManager::PACProxy: // A proxy configuration URL has been given
+ case KProtocolManager::WPADProxy: // A proxy should be automatically discovered
+ case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
+// In such cases, the proxy address is not stored in KDE, but determined dynamically.
+// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind...
+// The best we can do here is to ask the current value for a given address.
+ aHTTPSProxy = KProtocolManager::proxyForUrl( KUrl("https://https.openoffice.org") );
+ break;
+ default: // No proxy is used
+ break;
+ }
+ if ( !aHTTPSProxy.isEmpty() )
+ {
+ KUrl aProxy(aHTTPSProxy);
+ sal_Int32 nPort = aProxy.port();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( nPort ) );
+ }
+ } else if (id.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetNoProxy"))) {
+ QString aNoProxyFor;
+ switch ( KProtocolManager::proxyType() )
+ {
+ case KProtocolManager::ManualProxy: // Proxies are manually configured
+ case KProtocolManager::PACProxy: // A proxy configuration URL has been given
+ case KProtocolManager::WPADProxy: // A proxy should be automatically discovered
+ case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
+ aNoProxyFor = KProtocolManager::noProxyFor();
+ break;
+ default: // No proxy is used
+ break;
+ }
+ if ( !aNoProxyFor.isEmpty() )
+ {
+ ::rtl::OUString sNoProxyFor;
+
+ aNoProxyFor = aNoProxyFor.replace( COMMA, SEMI_COLON );
+ sNoProxyFor = (const sal_Unicode *) aNoProxyFor.utf16();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( sNoProxyFor ) );
+ }
+ } else if (id.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetProxyType"))) {
+ int nProxyType;
+ switch ( KProtocolManager::proxyType() )
+ {
+ case KProtocolManager::ManualProxy: // Proxies are manually configured
+ case KProtocolManager::PACProxy: // A proxy configuration URL has been given
+ case KProtocolManager::WPADProxy: // A proxy should be automatically discovered
+ case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
+ nProxyType = 1;
+ break;
+ default: // No proxy is used
+ nProxyType = 0;
+ }
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( (sal_Int32) nProxyType ) );
+ } else {
+ OSL_ASSERT(false); // this cannot happen
+ }
+ return css::beans::Optional< css::uno::Any >();
+}
+
+}
diff --git a/shell/source/backends/kde4be/kde4access.hxx b/shell/source/backends/kde4be/kde4access.hxx
new file mode 100644
index 0000000000..bfb7bc1ac9
--- /dev/null
+++ b/shell/source/backends/kde4be/kde4access.hxx
@@ -0,0 +1,47 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_SHELL_SOURCE_BACKENDS_KDE4BE_KDE4ACCESS_HXX
+#define INCLUDED_SHELL_SOURCE_BACKENDS_KDE4BE_KDE4ACCESS_HXX
+
+#include "sal/config.h"
+
+#include "com/sun/star/beans/Optional.hpp"
+
+namespace com { namespace sun { namespace star { namespace uno {
+ class Any;
+} } } }
+namespace rtl { class OUString; }
+
+namespace kde4access {
+
+com::sun::star::beans::Optional< com::sun::star::uno::Any > getValue(
+ rtl::OUString const & id);
+
+}
+
+#endif
diff --git a/shell/source/backends/kde4be/kde4backend.cxx b/shell/source/backends/kde4be/kde4backend.cxx
index 6e35fe412c..44ddb49bd0 100644
--- a/shell/source/backends/kde4be/kde4backend.cxx
+++ b/shell/source/backends/kde4be/kde4backend.cxx
@@ -1,155 +1,258 @@
/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
#include "precompiled_shell.hxx"
+#include "sal/config.h"
-#include "kde4backend.hxx"
-#include "kde4commonlayer.hxx"
-#include "kde4inetlayer.hxx"
-#include "kde4vcllayer.hxx"
-#include "kde4pathslayer.hxx"
+#include "kapplication.h"
-//------------------------------------------------------------------------------
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/beans/Optional.hpp"
+#include "com/sun/star/beans/PropertyVetoException.hpp"
+#include "com/sun/star/beans/UnknownPropertyException.hpp"
+#include "com/sun/star/beans/XPropertyChangeListener.hpp"
+#include "com/sun/star/beans/XPropertySet.hpp"
+#include "com/sun/star/beans/XPropertySetInfo.hpp"
+#include "com/sun/star/beans/XVetoableChangeListener.hpp"
+#include "com/sun/star/lang/IllegalArgumentException.hpp"
+#include "com/sun/star/lang/WrappedTargetException.hpp"
+#include "com/sun/star/lang/XMultiComponentFactory.hpp"
+#include "com/sun/star/lang/XServiceInfo.hpp"
+#include "com/sun/star/lang/WrappedTargetException.hpp"
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/uno/XCurrentContext.hpp"
+#include "cppuhelper/factory.hxx"
+#include "cppuhelper/implbase2.hxx"
+#include "cppuhelper/implementationentry.hxx"
+#include "cppuhelper/weak.hxx"
+#include "rtl/string.h"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+#include "uno/current_context.hxx"
+#include "uno/lbnames.h"
-KDEBackend* KDEBackend::mInstance= 0;
+#include "kde4access.hxx"
-KDEBackend* KDEBackend::createInstance(const uno::Reference<uno::XComponentContext>& xContext)
-{
- if (mInstance == 0)
- {
- mInstance = new KDEBackend (xContext);
- }
-
- return mInstance;
-}
+namespace {
-//------------------------------------------------------------------------------
+namespace css = com::sun::star;
-KDEBackend::KDEBackend(const uno::Reference<uno::XComponentContext>& xContext)
- throw (backend::BackendAccessException)
- : BackendBase(mMutex), m_xContext(xContext)
-{
+rtl::OUString SAL_CALL getServiceImplementationName() {
+ return rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.comp.configuration.backend.KDE4Backend"));
}
-//------------------------------------------------------------------------------
+css::uno::Sequence< rtl::OUString > SAL_CALL getServiceSupportedServiceNames() {
+ rtl::OUString name(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.backend.KDE4Backend"));
+ return css::uno::Sequence< rtl::OUString >(&name, 1);
+}
-KDEBackend::~KDEBackend(void)
+class Service:
+ public cppu::WeakImplHelper2<
+ css::lang::XServiceInfo, css::beans::XPropertySet >,
+ private boost::noncopyable
{
-}
+public:
+ Service();
-//------------------------------------------------------------------------------
+private:
+ virtual ~Service() {}
-uno::Reference<backend::XLayer> SAL_CALL KDEBackend::getLayer(
- const rtl::OUString& aComponent, const rtl::OUString& /* aTimestamp */)
- throw (backend::BackendAccessException, lang::IllegalArgumentException)
-{
- uno::Reference<backend::XLayer> xLayer;
-
- if( aComponent.equalsAscii("org.openoffice.Office.Common" ) )
- {
- xLayer = new KDECommonLayer(m_xContext);
- }
- else if( aComponent.equalsAscii("org.openoffice.Inet" ) )
- {
- xLayer = new KDEInetLayer(m_xContext);
- }
- else if( aComponent.equalsAscii("org.openoffice.VCL" ) )
- {
- xLayer = new KDEVCLLayer(m_xContext);
- }
- else if( aComponent.equalsAscii("org.openoffice.Office.Paths" ) )
- {
- xLayer = new KDEPathsLayer(m_xContext);
- }
-
- return xLayer;
-}
+ virtual rtl::OUString SAL_CALL getImplementationName()
+ throw (css::uno::RuntimeException)
+ { return getServiceImplementationName(); }
-//------------------------------------------------------------------------------
+ virtual sal_Bool SAL_CALL supportsService(rtl::OUString const & ServiceName)
+ throw (css::uno::RuntimeException)
+ { return ServiceName == getSupportedServiceNames()[0]; }
-uno::Reference<backend::XUpdatableLayer> SAL_CALL
-KDEBackend::getUpdatableLayer(const rtl::OUString& /* aComponent */)
- throw (backend::BackendAccessException,lang::NoSupportException,
- lang::IllegalArgumentException)
-{
- throw lang::NoSupportException( rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("KDEBackend: No Update Operation allowed, Read Only access") ),
- *this) ;
-}
+ virtual css::uno::Sequence< rtl::OUString > SAL_CALL
+ getSupportedServiceNames() throw (css::uno::RuntimeException)
+ { return getServiceSupportedServiceNames(); }
-//------------------------------------------------------------------------------
+ virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
+ getPropertySetInfo() throw (css::uno::RuntimeException)
+ { return css::uno::Reference< css::beans::XPropertySetInfo >(); }
-rtl::OUString SAL_CALL KDEBackend::getBackendName(void)
-{
- return rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.configuration.backend.KDE4Backend") );
-}
+ virtual void SAL_CALL setPropertyValue(
+ rtl::OUString const &, css::uno::Any const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::beans::PropertyVetoException,
+ css::lang::IllegalArgumentException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException);
-//------------------------------------------------------------------------------
+ virtual css::uno::Any SAL_CALL getPropertyValue(
+ rtl::OUString const & PropertyName)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException);
-rtl::OUString SAL_CALL KDEBackend::getImplementationName(void)
- throw (uno::RuntimeException)
-{
- return getBackendName() ;
-}
+ virtual void SAL_CALL addPropertyChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XPropertyChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
-//------------------------------------------------------------------------------
+ virtual void SAL_CALL removePropertyChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XPropertyChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
-uno::Sequence<rtl::OUString> SAL_CALL KDEBackend::getBackendServiceNames(void)
-{
- uno::Sequence<rtl::OUString> aServices(1) ;
- aServices[0] = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.KDE4Backend")) ;
+ virtual void SAL_CALL addVetoableChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XVetoableChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
+ virtual void SAL_CALL removeVetoableChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XVetoableChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
+ bool enabled_;
+};
+
+Service::Service(): enabled_(false) {
+ css::uno::Reference< css::uno::XCurrentContext > context(
+ css::uno::getCurrentContext());
+ if (context.is()) {
+ rtl::OUString desktop;
+ context->getValueByName(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("system.desktop-environment"))) >>=
+ desktop;
+ enabled_ = desktop.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("KDE4")) &&
+ KApplication::kApplication() != 0;
+ }
+}
- return aServices ;
+void Service::setPropertyValue(rtl::OUString const &, css::uno::Any const &)
+ throw (
+ css::beans::UnknownPropertyException, css::beans::PropertyVetoException,
+ css::lang::IllegalArgumentException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
+{
+ throw css::lang::IllegalArgumentException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("setPropertyValue not supported")),
+ static_cast< cppu::OWeakObject * >(this), -1);
}
-//------------------------------------------------------------------------------
+css::uno::Any Service::getPropertyValue(rtl::OUString const & PropertyName)
+ throw (
+ css::beans::UnknownPropertyException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
+{
+ if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("EnableATToolSupport")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ExternalMailer")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("SourceViewFontHeight")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("SourceViewFontName")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("WorkPathVariable")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyName")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyPort")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyName")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyPort")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyName")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyPort")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetNoProxy")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetProxyType")))
+ {
+ return css::uno::makeAny(
+ enabled_
+ ? kde4access::getValue(PropertyName)
+ : css::beans::Optional< css::uno::Any >());
+ }
+ throw css::beans::UnknownPropertyException(
+ PropertyName, static_cast< cppu::OWeakObject * >(this));
+}
-sal_Bool SAL_CALL KDEBackend::supportsService(const rtl::OUString& aServiceName)
- throw (uno::RuntimeException)
+css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance(
+ css::uno::Reference< css::uno::XComponentContext > const &)
{
- uno::Sequence< rtl::OUString > const svc = getBackendServiceNames();
+ return static_cast< cppu::OWeakObject * >(new Service);
+}
- for(sal_Int32 i = 0; i < svc.getLength(); ++i )
- if(svc[i] == aServiceName)
- return true;
+static cppu::ImplementationEntry const services[] = {
+ { &createInstance, &getServiceImplementationName,
+ &getServiceSupportedServiceNames, &cppu::createSingleComponentFactory, 0,
+ 0 },
+ { 0, 0, 0, 0, 0, 0 }
+};
- return false;
}
-//------------------------------------------------------------------------------
+extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
+ char const * pImplName, void * pServiceManager, void * pRegistryKey)
+{
+ return cppu::component_getFactoryHelper(
+ pImplName, pServiceManager, pRegistryKey, services);
+}
-uno::Sequence<rtl::OUString>
-SAL_CALL KDEBackend::getSupportedServiceNames(void)
- throw (uno::RuntimeException)
+extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL
+component_getImplementationEnvironment(
+ char const ** ppEnvTypeName, uno_Environment **)
{
- return getBackendServiceNames() ;
+ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-// ---------------------------------------------------------------------------------------
+extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
+ void * pServiceManager, void * pRegistryKey)
+{
+ return component_writeInfoHelper(pServiceManager, pRegistryKey, services);
+}
diff --git a/shell/source/backends/kde4be/kde4backend.hxx b/shell/source/backends/kde4be/kde4backend.hxx
deleted file mode 100644
index 8d8c633ab3..0000000000
--- a/shell/source/backends/kde4be/kde4backend.hxx
+++ /dev/null
@@ -1,120 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#pragma once
-
-#include <com/sun/star/configuration/backend/XSingleLayerStratum.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/configuration/InvalidBootstrapFileException.hpp>
-#include <com/sun/star/configuration/backend/CannotConnectException.hpp>
-#include <cppuhelper/compbase2.hxx>
-
-#ifndef INCLUDED_MAP
-#include <map>
-#define INCLUDED_MAP
-#endif
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-
-
-//------------------------------------------------------------------------------
-typedef cppu::WeakComponentImplHelper2<backend::XSingleLayerStratum,
- lang::XServiceInfo> BackendBase ;
-
-/**
- Implements the SingleLayerStratum service for KDE access.
- */
-class KDEBackend : public BackendBase {
- public :
-
- static KDEBackend* createInstance(const uno::Reference<uno::XComponentContext>& xContext);
-
- // XServiceInfo
- virtual rtl::OUString SAL_CALL getImplementationName( )
- throw (uno::RuntimeException) ;
-
- virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& aServiceName )
- throw (uno::RuntimeException) ;
-
- virtual uno::Sequence<rtl::OUString> SAL_CALL getSupportedServiceNames( )
- throw (uno::RuntimeException) ;
-
- /**
- Provides the implementation name.
-
- @return implementation name
- */
- static rtl::OUString SAL_CALL getBackendName(void) ;
-
- /**
- Provides the supported services names
-
- @return service names
- */
- static uno::Sequence<rtl::OUString> SAL_CALL getBackendServiceNames(void) ;
-
- //XSingleLayerStratum
- virtual uno::Reference<backend::XLayer> SAL_CALL
- getLayer( const rtl::OUString& aLayerId, const rtl::OUString& aTimestamp )
- throw (backend::BackendAccessException, lang::IllegalArgumentException) ;
-
- virtual uno::Reference<backend::XUpdatableLayer> SAL_CALL
- getUpdatableLayer( const rtl::OUString& aLayerId )
- throw (backend::BackendAccessException, lang::NoSupportException,
- lang::IllegalArgumentException) ;
-
- protected:
- /**
- Service constructor from a service factory.
-
- @param xContext component context
- */
- KDEBackend(const uno::Reference<uno::XComponentContext>& xContext)
- throw (backend::BackendAccessException);
-
- /** Destructor */
- ~KDEBackend(void) ;
-
- private:
-
- /** Build KDE/OO mapping table */
- void initializeMappingTable ();
-
-
- /** The component context */
- uno::Reference<uno::XComponentContext> m_xContext;
-
- /** Mutex for reOOurces protection */
- osl::Mutex mMutex ;
-
- static KDEBackend* mInstance;
-};
diff --git a/shell/source/backends/kde4be/kde4be.xml b/shell/source/backends/kde4be/kde4be.xml
deleted file mode 100644
index 93961672e5..0000000000
--- a/shell/source/backends/kde4be/kde4be.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd">
-<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
- <module-name>kde4be</module-name>
- <component-description>
- <author> Éric Bischoff </author>
- <name>com.sun.star.comp.configuration.backend.KDE4Backend</name>
- <description> The KDE4 configuration backend </description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language>c++</language>
- <status value="beta"/>
- <supported-service>com.sun.star.comp.configuration.backend.KDE4Backend</supported-service>
- <service-dependency>...</service-dependency>
- <type>com.sun.star.configuration.backend.XBackendChangesListener</type>
- <type>com.sun.star.configuration.backend.XBackendChangesNotifier</type>
- <type>com.sun.star.configuration.backend.XLayerHandler</type>
- <type>com.sun.star.configuration.backend.XSingleLayerStratum</type>
- <type>com.sun.star.lang.XMultiComponentFactory</type>
- <type>com.sun.star.lang.XServiceInfo</type>
- <type>com.sun.star.lang.XSingleComponentFactory</type>
- <type>com.sun.star.lang.XTypeProvider</type>
- <type>com.sun.star.uno.TypeClass</type>
- <type>com.sun.star.uno.XAggregation</type>
- <type>com.sun.star.uno.XComponentContext</type>
- <type>com.sun.star.uno.XCurrentContext</type>
- <type>com.sun.star.uno.XWeak</type>
- <type>com.sun.star.registry.XRegistryKey</type>
- </component-description>
- <project-build-dependency>cppuhelper</project-build-dependency>
- <project-build-dependency>cppu</project-build-dependency>
- <project-build-dependency>sal</project-build-dependency>
- <runtime-module-dependency>cppuhelper3$(COM)</runtime-module-dependency>
- <runtime-module-dependency>cppu3</runtime-module-dependency>
- <runtime-module-dependency>sal3</runtime-module-dependency>
-</module-description>
diff --git a/shell/source/backends/kde4be/kde4becdef.cxx b/shell/source/backends/kde4be/kde4becdef.cxx
deleted file mode 100644
index b3a1de2580..0000000000
--- a/shell/source/backends/kde4be/kde4becdef.cxx
+++ /dev/null
@@ -1,140 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-#include "kde4backend.hxx"
-
-#include <kapplication.h>
-
-#include <cppuhelper/implementationentry.hxx>
-
-#include <com/sun/star/registry/XRegistryKey.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-
-#include "uno/current_context.hxx"
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-
-//==============================================================================
-
-static uno::Reference<uno::XInterface> SAL_CALL createKDEBackend(const uno::Reference<uno::XComponentContext>& xContext)
-{
- try {
- uno::Reference< uno::XCurrentContext > xCurrentContext(uno::getCurrentContext());
-
- if (xCurrentContext.is())
- {
- uno::Any aValue = xCurrentContext->getValueByName(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "system.desktop-environment" ) ) );
-
- rtl::OUString aDesktopEnvironment;
- if ( (aValue >>= aDesktopEnvironment) && (aDesktopEnvironment.equalsAscii("KDE")) && (KApplication::kApplication() != NULL) )
- return * KDEBackend::createInstance(xContext);
- }
-
- return uno::Reference<uno::XInterface>();
-
- } catch (uno::RuntimeException e) {
- return uno::Reference<uno::XInterface>();
- }
-
-}
-
-//==============================================================================
-
-static const cppu::ImplementationEntry kImplementations_entries[] =
-{
- {
- createKDEBackend,
- KDEBackend::getBackendName,
- KDEBackend::getBackendServiceNames,
- cppu::createSingleComponentFactory,
- NULL,
- 0
- },
- { NULL, NULL, NULL, NULL, NULL, 0 }
-} ;
-//------------------------------------------------------------------------------
-
-extern "C" void SAL_CALL component_getImplementationEnvironment(
- const sal_Char **aEnvTypeName,
- uno_Environment **) {
- *aEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ;
-}
-
-//------------------------------------------------------------------------------
-
-extern "C" sal_Bool SAL_CALL component_writeInfo(void *,
- void *pRegistryKey) {
-
- using namespace ::com::sun::star::registry;
- if (pRegistryKey)
- {
- try
- {
- uno::Reference< XRegistryKey > xImplKey = static_cast< XRegistryKey* >( pRegistryKey )->createKey(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + KDEBackend::getBackendName()
- );
-
- // Register associated service names
- uno::Reference< XRegistryKey > xServicesKey = xImplKey->createKey(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES") )
- );
-
- uno::Sequence<rtl::OUString> sServiceNames = KDEBackend::getBackendServiceNames();
- for (sal_Int32 i = 0 ; i < sServiceNames.getLength() ; ++ i)
- xServicesKey->createKey(sServiceNames[i]);
-
- return sal_True;
- }
-
- catch( InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "InvalidRegistryException caught");
- }
- }
-
- return sal_False;
-}
-
-//------------------------------------------------------------------------------
-
-extern "C" void *component_getFactory(const sal_Char *aImplementationName,
- void *aServiceManager,
- void *aRegistryKey) {
-
- return cppu::component_getFactoryHelper(
- aImplementationName,
- aServiceManager,
- aRegistryKey,
- kImplementations_entries) ;
-}
-//------------------------------------------------------------------------------
diff --git a/shell/source/backends/kde4be/kde4commonlayer.cxx b/shell/source/backends/kde4be/kde4commonlayer.cxx
deleted file mode 100644
index de64a5e863..0000000000
--- a/shell/source/backends/kde4be/kde4commonlayer.cxx
+++ /dev/null
@@ -1,154 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-
-#include "kde4commonlayer.hxx"
-
-#include <kemailsettings.h>
-#include <kglobalsettings.h>
-
-#include <QFont>
-
-#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#include <com/sun/star/uno/Sequence.hxx>
-
-#define SPACE ' '
-
-//==============================================================================
-
-KDECommonLayer::KDECommonLayer(const uno::Reference<uno::XComponentContext>& xContext)
-{
- //Create instance of LayerContentDescriber Service
- rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.configuration.backend.LayerDescriber"));
-
- typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber;
- uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
- if( xServiceManager.is() )
- {
- m_xLayerContentDescriber = LayerDescriber::query(
- xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext));
- }
- else
- {
- OSL_TRACE("Could not retrieve ServiceManager");
- }
-}
-
-//------------------------------------------------------------------------------
-
-void SAL_CALL KDECommonLayer::readData( const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- if( ! m_xLayerContentDescriber.is() )
- {
- throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"
- ) ), static_cast < backend::XLayer * > (this) );
- }
-
- uno::Sequence<backend::PropertyInfo> aPropInfoList(3);
- sal_Int32 nProperties = 0;
-
- // Email client settings
- KEMailSettings aEmailSettings;
- QString aClientProgram;
- ::rtl::OUString sClientProgram;
-
- aClientProgram = aEmailSettings.getSetting( KEMailSettings::ClientProgram );
- if ( aClientProgram.isEmpty() )
- aClientProgram = "kmail";
- else
- aClientProgram = aClientProgram.section(SPACE, 0, 0);
- sClientProgram = (const sal_Unicode *) aClientProgram.utf16();
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Common/ExternalMailer/Program") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( sClientProgram );
-
- // Source code font settings
- QFont aFixedFont;
- QString aFontName;
- :: rtl::OUString sFontName;
- short nFontHeight;
-
- aFixedFont = KGlobalSettings::fixedFont();
- aFontName = aFixedFont.family();
- sFontName = (const sal_Unicode *) aFontName.utf16();
- nFontHeight = aFixedFont.pointSize();
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Common/Font/SourceViewFont/FontName") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( sFontName );
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Common/Font/SourceViewFont/FontHeight") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "short" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( nFontHeight );
-
- if( nProperties > 0 )
- {
- aPropInfoList.realloc(nProperties);
- m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList);
- }
-}
-
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL KDECommonLayer::getTimestamp(void)
- throw (uno::RuntimeException)
-{
- // Return the value as timestamp to avoid regenerating the binary cache
- // on each office launch.
-
- KEMailSettings aEmailSettings;
- QString aClientProgram = aEmailSettings.getSetting( KEMailSettings::ClientProgram );
- aClientProgram = aClientProgram.section(SPACE, 0, 0);
-
- QString aFixedFont = KGlobalSettings::fixedFont().toString();
-
- ::rtl::OUString sTimeStamp,
- sep( RTL_CONSTASCII_USTRINGPARAM( "$" ) );
-
- sTimeStamp = (const sal_Unicode *) aClientProgram.utf16();
- sTimeStamp += sep;
- sTimeStamp += (const sal_Unicode *) aFixedFont.utf16();
-
- return sTimeStamp;
-}
diff --git a/shell/source/backends/kde4be/kde4commonlayer.hxx b/shell/source/backends/kde4be/kde4commonlayer.hxx
deleted file mode 100644
index d37bab8627..0000000000
--- a/shell/source/backends/kde4be/kde4commonlayer.hxx
+++ /dev/null
@@ -1,51 +0,0 @@
-#pragma once
-
-#include "kde4backend.hxx"
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#include <com/sun/star/util/XTimeStamped.hpp>
-#include <cppuhelper/implbase2.hxx>
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-namespace util = css::util ;
-
-/**
- Implementation of the XLayer interface for the KDE values mapped into
- the org.openoffice.Office.Common configuration component.
- */
-class KDECommonLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped>
-{
-public :
- /**
- Constructor given the component context
-
- @param xContext The component context
- */
-
- KDECommonLayer(const uno::Reference<uno::XComponentContext>& xContext);
-
- // XLayer
- virtual void SAL_CALL readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException) ;
-
- // XTimeStamped
- virtual rtl::OUString SAL_CALL getTimestamp(void)
- throw (uno::RuntimeException);
-
- protected:
-
- /** Destructor */
- ~KDECommonLayer(void) {}
-
- private :
- uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber ;
-};
diff --git a/shell/source/backends/kde4be/kde4inetlayer.cxx b/shell/source/backends/kde4be/kde4inetlayer.cxx
deleted file mode 100644
index a50c8a8353..0000000000
--- a/shell/source/backends/kde4be/kde4inetlayer.cxx
+++ /dev/null
@@ -1,252 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-
-#include <kprotocolmanager.h>
-
-#include "kde4inetlayer.hxx"
-#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#include <com/sun/star/uno/Sequence.hxx>
-
-#define COMMA ','
-#define SEMI_COLON ';'
-
-//==============================================================================
-
-KDEInetLayer::KDEInetLayer(const uno::Reference<uno::XComponentContext>& xContext)
-{
- //Create instance of LayerContentDescriber Service
- rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.configuration.backend.LayerDescriber"));
-
- typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber;
- uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
- if( xServiceManager.is() )
- {
- m_xLayerContentDescriber = LayerDescriber::query(
- xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext));
- }
- else
- {
- OSL_TRACE("Could not retrieve ServiceManager");
- }
-}
-
-//------------------------------------------------------------------------------
-
-void SAL_CALL KDEInetLayer::readData( const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- if( ! m_xLayerContentDescriber.is() )
- {
- throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"
- ) ), static_cast < backend::XLayer * > (this) );
- }
-
- uno::Sequence<backend::PropertyInfo> aPropInfoList(8);
- sal_Int32 nProperties = 0;
-
- switch ( KProtocolManager::proxyType() )
- {
- case KProtocolManager::ManualProxy: // Proxies are manually configured
- setProxy(aPropInfoList, nProperties, 1,
- KProtocolManager::noProxyFor(),
- KProtocolManager::proxyFor( "HTTP" ),
- KProtocolManager::proxyFor( "FTP" ),
- KProtocolManager::proxyFor( "HTTPS" ));
- break;
- case KProtocolManager::PACProxy: // A proxy configuration URL has been given
- case KProtocolManager::WPADProxy: // A proxy should be automatically discovered
- case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
-// In such cases, the proxy address is not stored in KDE, but determined dynamically.
-// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind...
-// The best we can do here is to ask the current value for a given address.
- setProxy(aPropInfoList, nProperties, 1,
- KProtocolManager::noProxyFor(),
- KProtocolManager::proxyForUrl( KUrl("http://www.openoffice.org") ),
- KProtocolManager::proxyForUrl( KUrl("ftp://ftp.openoffice.org") ),
- KProtocolManager::proxyForUrl( KUrl("https://www.openoffice.org") ));
- break;
- default: // No proxy is used
- setProxy(aPropInfoList, nProperties, 0);
- }
-
- if ( nProperties > 0 )
- {
- aPropInfoList.realloc(nProperties);
- m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList);
- }
-}
-
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL KDEInetLayer::getTimestamp(void)
- throw (uno::RuntimeException)
-{
- // Return the value as timestamp to avoid regenerating the binary cache
- // on each office launch.
-
- QString aProxyType, aNoProxyFor, aHTTPProxy, aHTTPSProxy, aFTPProxy;
-
- switch ( KProtocolManager::proxyType() )
- {
- case KProtocolManager::ManualProxy:
- aProxyType = '1';
- aNoProxyFor = KProtocolManager::noProxyFor();
- aHTTPProxy = KProtocolManager::proxyFor( "HTTP" );
- aHTTPProxy = KProtocolManager::proxyFor( "HTTPS" );
- aFTPProxy = KProtocolManager::proxyFor( "FTP" );
- break;
- case KProtocolManager::PACProxy:
- case KProtocolManager::WPADProxy:
- case KProtocolManager::EnvVarProxy:
- aProxyType = '1';
- aNoProxyFor = KProtocolManager::noProxyFor();
- aHTTPProxy = KProtocolManager::proxyForUrl( KUrl("http://www.openoffice.org") );
- aHTTPSProxy = KProtocolManager::proxyForUrl( KUrl("https://www.openoffice.org") );
- aFTPProxy = KProtocolManager::proxyForUrl( KUrl("ftp://ftp.openoffice.org") );
- break;
- default:
- aProxyType = '0';
- }
-
- ::rtl::OUString sTimeStamp,
- sep( RTL_CONSTASCII_USTRINGPARAM( "$" ) );
-
- sTimeStamp = (const sal_Unicode *) aProxyType.utf16();
- sTimeStamp += sep;
- sTimeStamp += (const sal_Unicode *) aNoProxyFor.utf16();
- sTimeStamp += sep;
- sTimeStamp += (const sal_Unicode *) aHTTPProxy.utf16();
- sTimeStamp += sep;
- sTimeStamp += (const sal_Unicode *) aHTTPSProxy.utf16();
- sTimeStamp += sep;
- sTimeStamp += (const sal_Unicode *) aFTPProxy.utf16();
-
- return sTimeStamp;
-}
-
-//------------------------------------------------------------------------------
-
-void SAL_CALL KDEInetLayer::setProxy
- (uno::Sequence<backend::PropertyInfo> &aPropInfoList, sal_Int32 &nProperties,
- int nProxyType, const QString &aNoProxy, const QString &aHTTPProxy, const QString &aFTPProxy, const QString &aHTTPSProxy ) const
-{
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetProxyType") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "int" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( (sal_Int32) nProxyType );
-
- if (nProxyType == 0) return;
-
- if ( !aNoProxy.isEmpty() )
- {
- QString aNoProxyFor(aNoProxy);
- ::rtl::OUString sNoProxyFor;
-
- aNoProxyFor = aNoProxyFor.replace( COMMA, SEMI_COLON );
- sNoProxyFor = (const sal_Unicode *) aNoProxyFor.utf16();
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetNoProxy") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( sNoProxyFor );
- }
-
- if ( !aHTTPProxy.isEmpty() )
- {
- KUrl aProxy(aHTTPProxy);
- ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().utf16();
- sal_Int32 nPort = aProxy.port();
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPProxyName") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( sProxy );
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPProxyPort") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "int" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( nPort );
- }
-
- if ( !aHTTPSProxy.isEmpty() )
- {
- KUrl aProxy(aHTTPSProxy);
- ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().utf16();
- sal_Int32 nPort = aProxy.port();
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPSProxyName") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( sProxy );
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPSProxyPort") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "int" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( nPort );
- }
-
- if ( !aFTPProxy.isEmpty() )
- {
- KUrl aProxy(aFTPProxy);
- ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().utf16();
- sal_Int32 nPort = aProxy.port();
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetFTPProxyName") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( sProxy );
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetFTPProxyPort") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "int" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( nPort );
- }
-}
-
diff --git a/shell/source/backends/kde4be/kde4inetlayer.hxx b/shell/source/backends/kde4be/kde4inetlayer.hxx
deleted file mode 100644
index 1724628f9f..0000000000
--- a/shell/source/backends/kde4be/kde4inetlayer.hxx
+++ /dev/null
@@ -1,59 +0,0 @@
-#pragma once
-
-#include <QString>
-
-#include "kde4backend.hxx"
-
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#include <com/sun/star/util/XTimeStamped.hpp>
-#include <cppuhelper/implbase2.hxx>
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-namespace util = css::util ;
-
-/**
- Implementation of the XLayer interface for the KDE values mapped into
- the org.openoffice.Inet configuration component.
- */
-class KDEInetLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped>
-{
-public :
- /**
- Constructor given the component context
-
- @param xContext The component context
- */
-
- KDEInetLayer(const uno::Reference<uno::XComponentContext>& xContext);
-
- // XLayer
- virtual void SAL_CALL readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException) ;
-
- // XTimeStamped
- virtual rtl::OUString SAL_CALL getTimestamp(void)
- throw (uno::RuntimeException);
-
- protected:
-
- /** Destructor */
- ~KDEInetLayer(void) {}
-
-private :
- uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber ;
-
- void SAL_CALL setProxy
- (uno::Sequence<backend::PropertyInfo> &aPropInfoList, sal_Int32 &nProperties,
- int nProxyType, const QString &aNoProxyfor = QString(),
- const QString &aHTTPProxy = QString(), const QString &aFTPProxy = QString(), const QString &aHTTPSProxy = QString()) const;
-};
diff --git a/shell/source/backends/kde4be/kde4pathslayer.cxx b/shell/source/backends/kde4be/kde4pathslayer.cxx
deleted file mode 100644
index 8752f062ba..0000000000
--- a/shell/source/backends/kde4be/kde4pathslayer.cxx
+++ /dev/null
@@ -1,121 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-
-#include "kde4pathslayer.hxx"
-
-#include <QString>
-#include <kglobalsettings.h>
-
-#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-
-#include <osl/security.hxx>
-#include <osl/file.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-
-#define SPACE ' '
-
-//==============================================================================
-
-KDEPathsLayer::KDEPathsLayer(const uno::Reference<uno::XComponentContext>& xContext)
-{
- //Create instance of LayerContentDescriber Service
- rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.configuration.backend.LayerDescriber"));
-
- typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber;
- uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
- if( xServiceManager.is() )
- {
- m_xLayerContentDescriber = LayerDescriber::query(
- xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext));
- }
- else
- {
- OSL_TRACE("Could not retrieve ServiceManager");
- }
-}
-
-//------------------------------------------------------------------------------
-
-void SAL_CALL KDEPathsLayer::readData( const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- if( ! m_xLayerContentDescriber.is() )
- {
- throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"
- ) ), static_cast < backend::XLayer * > (this) );
- }
-
- uno::Sequence<backend::PropertyInfo> aPropInfoList(1);
- sal_Int32 nProperties = 0;
-
- QString aDocumentsDir( KGlobalSettings::documentPath() );
- rtl::OUString sDocumentsDir;
- rtl::OUString sDocumentsURL;
- if ( aDocumentsDir.endsWith(QChar('/')) )
- aDocumentsDir.truncate ( aDocumentsDir.length() - 1 );
- sDocumentsDir = (const sal_Unicode *) aDocumentsDir.utf16();
- osl_getFileURLFromSystemPath( sDocumentsDir.pData, &sDocumentsURL.pData );
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Paths/Variables/Work") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( sDocumentsURL );
-
- if( nProperties > 0 )
- {
- aPropInfoList.realloc(nProperties);
- m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList);
- }
-}
-
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL KDEPathsLayer::getTimestamp(void)
- throw (uno::RuntimeException)
-{
- // Return the value as timestamp to avoid regenerating the binary cache
- // on each office launch.
-
- ::rtl::OUString sTimeStamp,
- sep( RTL_CONSTASCII_USTRINGPARAM( "$" ) );
-
- QString aDocumentsDir;
- aDocumentsDir = KGlobalSettings::documentPath();
-
- sTimeStamp += (const sal_Unicode *) aDocumentsDir.utf16();
-
- return sTimeStamp;
-}
diff --git a/shell/source/backends/kde4be/kde4pathslayer.hxx b/shell/source/backends/kde4be/kde4pathslayer.hxx
deleted file mode 100644
index d78e5b66f6..0000000000
--- a/shell/source/backends/kde4be/kde4pathslayer.hxx
+++ /dev/null
@@ -1,79 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#pragma once
-
-#include "kde4backend.hxx"
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#include <com/sun/star/util/XTimeStamped.hpp>
-
-#include <cppuhelper/implbase2.hxx>
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-namespace util = css::util ;
-
-/**
- Implementation of the XLayer interface for the KDE values mapped into
- the org.openoffice.Office.Paths configuration component.
- */
-class KDEPathsLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped>
-{
-public :
- /**
- Constructor given the component context
-
- @param xContext The component context
- */
-
- KDEPathsLayer(const uno::Reference<uno::XComponentContext>& xContext);
-
- // XLayer
- virtual void SAL_CALL readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException) ;
-
- // XTimeStamped
- virtual rtl::OUString SAL_CALL getTimestamp(void)
- throw (uno::RuntimeException);
-
- protected:
-
- /** Destructor */
- ~KDEPathsLayer(void) {}
-
- private :
- uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber ;
-};
diff --git a/shell/source/backends/kde4be/kde4vcllayer.cxx b/shell/source/backends/kde4be/kde4vcllayer.cxx
deleted file mode 100644
index 10f4a835d7..0000000000
--- a/shell/source/backends/kde4be/kde4vcllayer.cxx
+++ /dev/null
@@ -1,112 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-
-#include "kde4vcllayer.hxx"
-
-#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#include <com/sun/star/uno/Sequence.hxx>
-
-//==============================================================================
-
-KDEVCLLayer::KDEVCLLayer(const uno::Reference<uno::XComponentContext>& xContext)
-{
- //Create instance of LayerContentDescriber Service
- rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.configuration.backend.LayerDescriber"));
-
- typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber;
- uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
- if( xServiceManager.is() )
- {
- m_xLayerContentDescriber = LayerDescriber::query(
- xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext));
- }
- else
- {
- OSL_TRACE("Could not retrieve ServiceManager");
- }
-}
-
-//------------------------------------------------------------------------------
-
-void SAL_CALL KDEVCLLayer::readData( const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- if( ! m_xLayerContentDescriber.is() )
- {
- throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"
- ) ), static_cast < backend::XLayer * > (this) );
- }
-
- uno::Sequence<backend::PropertyInfo> aPropInfoList(1);
-
-/*
- Commenting out, does not make much sense without an accessibility bridge
-===========================================================================
-#if defined(QT_ACCESSIBILITY_SUPPORT)
-// Accessibility tools under Qt for UNIX are available starting with Qt 4.0
- int nVersionMajor = 0;
- const char *q = qVersion(); // "3.1.0" for example
- while ('0' <= *q && *q <= '9')
- nVersionMajor = nVersionMajor * 10 + *q++ - '0';
- sal_Bool ATToolSupport = (sal_Bool) (nVersionMajor >= 4);
-#else
- sal_Bool ATToolSupport = sal_False;
-#endif
-===========================================================================
- End of commented out section
-*/ sal_Bool ATToolSupport = sal_False;
-
- aPropInfoList[0].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.VCL/Settings/Accessibility/EnableATToolSupport") );
- aPropInfoList[0].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[0].Protected = sal_False;
- aPropInfoList[0].Value = uno::makeAny( rtl::OUString::valueOf( ATToolSupport ) );
-
- m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList);
-}
-
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL KDEVCLLayer::getTimestamp(void)
- throw (uno::RuntimeException)
-{
- // Return the value as timestamp to avoid regenerating the binary cache
- // on each office launch.
-
- ::rtl::OUString sTimeStamp(
- RTL_CONSTASCII_USTRINGPARAM( "FALSE" ) );
-
- return sTimeStamp;
-}
diff --git a/shell/source/backends/kde4be/kde4vcllayer.hxx b/shell/source/backends/kde4be/kde4vcllayer.hxx
deleted file mode 100644
index aeed4e668a..0000000000
--- a/shell/source/backends/kde4be/kde4vcllayer.hxx
+++ /dev/null
@@ -1,53 +0,0 @@
-#pragma once
-
-#include "kde4backend.hxx"
-
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#include <com/sun/star/util/XTimeStamped.hpp>
-
-#include <cppuhelper/implbase2.hxx>
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-namespace util = css::util ;
-
-/**
- Implementation of the XLayer interface for the KDE values mapped into
- the org.openoffice.VCL configuration component.
- */
-class KDEVCLLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped>
-{
-public :
- /**
- Constructor given the component context
-
- @param xContext The component context
- */
-
- KDEVCLLayer(const uno::Reference<uno::XComponentContext>& xContext);
-
- // XLayer
- virtual void SAL_CALL readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException) ;
-
- // XTimeStamped
- virtual rtl::OUString SAL_CALL getTimestamp(void)
- throw (uno::RuntimeException);
-
- protected:
-
- /** Destructor */
- ~KDEVCLLayer(void) {}
-
- private :
- uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber ;
-};
diff --git a/shell/source/backends/kde4be/makefile.mk b/shell/source/backends/kde4be/makefile.mk
index cc7a51ab0f..1f9093a95a 100644
--- a/shell/source/backends/kde4be/makefile.mk
+++ b/shell/source/backends/kde4be/makefile.mk
@@ -31,11 +31,7 @@ TARGET=kde4be
LIBTARGET=NO
ENABLE_EXCEPTIONS=TRUE
-
-COMP1TYPELIST=$(TARGET)
-COMPRDB=$(SOLARBINDIR)$/types.rdb
-UNOUCROUT=$(OUT)$/inc$/$(TARGET)
-INCPRE=$(UNOUCROUT)
+VISIBILITY_HIDDEN=TRUE
# --- Settings ---
@@ -60,12 +56,8 @@ CFLAGS+=$(KDE4_CFLAGS)
# --- Files ---
SLOFILES=\
- $(SLO)$/kde4backend.obj \
- $(SLO)$/kde4commonlayer.obj \
- $(SLO)$/kde4inetlayer.obj \
- $(SLO)$/kde4vcllayer.obj \
- $(SLO)$/kde4pathslayer.obj \
- $(SLO)$/kde4becdef.obj
+ $(SLO)$/kde4access.obj \
+ $(SLO)$/kde4backend.obj
SHL1NOCHECK=TRUE
SHL1TARGET=$(TARGET)1.uno
@@ -78,8 +70,7 @@ SHL1STDLIBS= \
$(CPPULIB) \
$(SALLIB) \
$(KDE4_LIBS) -lkio
-
-SHL1VERSIONMAP=exports.map
+
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
diff --git a/shell/source/backends/kdebe/exports.map b/shell/source/backends/kdebe/exports.map
deleted file mode 100644
index ba501f9ae0..0000000000
--- a/shell/source/backends/kdebe/exports.map
+++ /dev/null
@@ -1,10 +0,0 @@
-UDK_3_0_0 {
- global:
- GetVersionInfo;
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/shell/source/backends/kdebe/kdeaccess.cxx b/shell/source/backends/kdebe/kdeaccess.cxx
new file mode 100644
index 0000000000..618d74b5ea
--- /dev/null
+++ b/shell/source/backends/kdebe/kdeaccess.cxx
@@ -0,0 +1,315 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_shell.hxx"
+#include "sal/config.h"
+
+#include "com/sun/star/uno/Any.hxx"
+#include "cppu/unotype.hxx"
+#include "osl/diagnose.h"
+#include "osl/file.h"
+#include "rtl/string.h"
+#include "rtl/ustring.hxx"
+
+#include "kde_headers.h"
+
+#include "kdeaccess.hxx"
+
+#define SPACE ' '
+#define COMMA ','
+#define SEMI_COLON ';'
+
+namespace kdeaccess {
+
+namespace {
+
+namespace css = com::sun::star ;
+namespace uno = css::uno ;
+
+}
+
+css::beans::Optional< css::uno::Any > getValue(rtl::OUString const & id) {
+ if (id.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ExternalMailer"))) {
+ KEMailSettings aEmailSettings;
+ QString aClientProgram;
+ ::rtl::OUString sClientProgram;
+
+ aClientProgram = aEmailSettings.getSetting( KEMailSettings::ClientProgram );
+ if ( aClientProgram.isEmpty() )
+ aClientProgram = "kmail";
+ else
+ aClientProgram = aClientProgram.section(SPACE, 0, 0);
+ sClientProgram = (const sal_Unicode *) aClientProgram.ucs2();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( sClientProgram ) );
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("SourceViewFontHeight")))
+ {
+ QFont aFixedFont;
+ short nFontHeight;
+
+ aFixedFont = KGlobalSettings::fixedFont();
+ nFontHeight = aFixedFont.pointSize();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( nFontHeight ) );
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("SourceViewFontName")))
+ {
+ QFont aFixedFont;
+ QString aFontName;
+ :: rtl::OUString sFontName;
+
+ aFixedFont = KGlobalSettings::fixedFont();
+ aFontName = aFixedFont.family();
+ sFontName = (const sal_Unicode *) aFontName.ucs2();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( sFontName ) );
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("EnableATToolSupport")))
+ {
+ /* does not make much sense without an accessibility bridge */
+ sal_Bool ATToolSupport = sal_False;
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( rtl::OUString::valueOf( ATToolSupport ) ) );
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("WorkPathVariable")))
+ {
+ QString aDocumentsDir( KGlobalSettings::documentPath() );
+ rtl::OUString sDocumentsDir;
+ rtl::OUString sDocumentsURL;
+ if ( aDocumentsDir.endsWith(QChar('/')) )
+ aDocumentsDir.truncate ( aDocumentsDir.length() - 1 );
+ sDocumentsDir = (const sal_Unicode *) aDocumentsDir.ucs2();
+ osl_getFileURLFromSystemPath( sDocumentsDir.pData, &sDocumentsURL.pData );
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( sDocumentsURL ) );
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyName")))
+ {
+ QString aFTPProxy;
+ switch ( KProtocolManager::proxyType() )
+ {
+ case KProtocolManager::ManualProxy: // Proxies are manually configured
+ aFTPProxy = KProtocolManager::proxyFor( "FTP" );
+ break;
+ case KProtocolManager::PACProxy: // A proxy configuration URL has been given
+ case KProtocolManager::WPADProxy: // A proxy should be automatically discovered
+ case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
+// In such cases, the proxy address is not stored in KDE, but determined dynamically.
+// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind...
+// The best we can do here is to ask the current value for a given address.
+ aFTPProxy = KProtocolManager::proxyForURL( "ftp://ftp.openoffice.org" );
+ break;
+ default: // No proxy is used
+ break;
+ }
+ if ( !aFTPProxy.isEmpty() )
+ {
+ KURL aProxy(aFTPProxy);
+ ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().ucs2();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( sProxy ) );
+ }
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyPort")))
+ {
+ QString aFTPProxy;
+ switch ( KProtocolManager::proxyType() )
+ {
+ case KProtocolManager::ManualProxy: // Proxies are manually configured
+ aFTPProxy = KProtocolManager::proxyFor( "FTP" );
+ break;
+ case KProtocolManager::PACProxy: // A proxy configuration URL has been given
+ case KProtocolManager::WPADProxy: // A proxy should be automatically discovered
+ case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
+// In such cases, the proxy address is not stored in KDE, but determined dynamically.
+// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind...
+// The best we can do here is to ask the current value for a given address.
+ aFTPProxy = KProtocolManager::proxyForURL( "ftp://ftp.openoffice.org" );
+ break;
+ default: // No proxy is used
+ break;
+ }
+ if ( !aFTPProxy.isEmpty() )
+ {
+ KURL aProxy(aFTPProxy);
+ sal_Int32 nPort = aProxy.port();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( nPort ) );
+ }
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyName")))
+ {
+ QString aHTTPProxy;
+ switch ( KProtocolManager::proxyType() )
+ {
+ case KProtocolManager::ManualProxy: // Proxies are manually configured
+ aHTTPProxy = KProtocolManager::proxyFor( "HTTP" );
+ break;
+ case KProtocolManager::PACProxy: // A proxy configuration URL has been given
+ case KProtocolManager::WPADProxy: // A proxy should be automatically discovered
+ case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
+// In such cases, the proxy address is not stored in KDE, but determined dynamically.
+// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind...
+// The best we can do here is to ask the current value for a given address.
+ aHTTPProxy = KProtocolManager::proxyForURL( "http://http.openoffice.org" );
+ break;
+ default: // No proxy is used
+ break;
+ }
+ if ( !aHTTPProxy.isEmpty() )
+ {
+ KURL aProxy(aHTTPProxy);
+ ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().ucs2();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( sProxy ) );
+ }
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyPort")))
+ {
+ QString aHTTPProxy;
+ switch ( KProtocolManager::proxyType() )
+ {
+ case KProtocolManager::ManualProxy: // Proxies are manually configured
+ aHTTPProxy = KProtocolManager::proxyFor( "HTTP" );
+ break;
+ case KProtocolManager::PACProxy: // A proxy configuration URL has been given
+ case KProtocolManager::WPADProxy: // A proxy should be automatically discovered
+ case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
+// In such cases, the proxy address is not stored in KDE, but determined dynamically.
+// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind...
+// The best we can do here is to ask the current value for a given address.
+ aHTTPProxy = KProtocolManager::proxyForURL( "http://http.openoffice.org" );
+ break;
+ default: // No proxy is used
+ break;
+ }
+ if ( !aHTTPProxy.isEmpty() )
+ {
+ KURL aProxy(aHTTPProxy);
+ sal_Int32 nPort = aProxy.port();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( nPort ) );
+ }
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyName")))
+ {
+ QString aHTTPSProxy;
+ switch ( KProtocolManager::proxyType() )
+ {
+ case KProtocolManager::ManualProxy: // Proxies are manually configured
+ aHTTPSProxy = KProtocolManager::proxyFor( "HTTPS" );
+ break;
+ case KProtocolManager::PACProxy: // A proxy configuration URL has been given
+ case KProtocolManager::WPADProxy: // A proxy should be automatically discovered
+ case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
+// In such cases, the proxy address is not stored in KDE, but determined dynamically.
+// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind...
+// The best we can do here is to ask the current value for a given address.
+ aHTTPSProxy = KProtocolManager::proxyForURL( "https://https.openoffice.org" );
+ break;
+ default: // No proxy is used
+ break;
+ }
+ if ( !aHTTPSProxy.isEmpty() )
+ {
+ KURL aProxy(aHTTPSProxy);
+ ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().ucs2();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( sProxy ) );
+ }
+ } else if (id.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyPort")))
+ {
+ QString aHTTPSProxy;
+ switch ( KProtocolManager::proxyType() )
+ {
+ case KProtocolManager::ManualProxy: // Proxies are manually configured
+ aHTTPSProxy = KProtocolManager::proxyFor( "HTTPS" );
+ break;
+ case KProtocolManager::PACProxy: // A proxy configuration URL has been given
+ case KProtocolManager::WPADProxy: // A proxy should be automatically discovered
+ case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
+// In such cases, the proxy address is not stored in KDE, but determined dynamically.
+// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind...
+// The best we can do here is to ask the current value for a given address.
+ aHTTPSProxy = KProtocolManager::proxyForURL( "https://https.openoffice.org" );
+ break;
+ default: // No proxy is used
+ break;
+ }
+ if ( !aHTTPSProxy.isEmpty() )
+ {
+ KURL aProxy(aHTTPSProxy);
+ sal_Int32 nPort = aProxy.port();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( nPort ) );
+ }
+ } else if (id.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetNoProxy"))) {
+ QString aNoProxyFor;
+ switch ( KProtocolManager::proxyType() )
+ {
+ case KProtocolManager::ManualProxy: // Proxies are manually configured
+ case KProtocolManager::PACProxy: // A proxy configuration URL has been given
+ case KProtocolManager::WPADProxy: // A proxy should be automatically discovered
+ case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
+ aNoProxyFor = KProtocolManager::noProxyFor();
+ break;
+ default: // No proxy is used
+ break;
+ }
+ if ( !aNoProxyFor.isEmpty() )
+ {
+ ::rtl::OUString sNoProxyFor;
+
+ aNoProxyFor = aNoProxyFor.replace( COMMA, SEMI_COLON );
+ sNoProxyFor = (const sal_Unicode *) aNoProxyFor.ucs2();
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( sNoProxyFor ) );
+ }
+ } else if (id.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooInetProxyType"))) {
+ int nProxyType;
+ switch ( KProtocolManager::proxyType() )
+ {
+ case KProtocolManager::ManualProxy: // Proxies are manually configured
+ case KProtocolManager::PACProxy: // A proxy configuration URL has been given
+ case KProtocolManager::WPADProxy: // A proxy should be automatically discovered
+ case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
+ nProxyType = 1;
+ break;
+ default: // No proxy is used
+ nProxyType = 0;
+ }
+ return css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( (sal_Int32) nProxyType ) );
+ } else {
+ OSL_ASSERT(false); // this cannot happen
+ }
+ return css::beans::Optional< css::uno::Any >();
+}
+
+}
diff --git a/shell/source/backends/kdebe/kdeaccess.hxx b/shell/source/backends/kdebe/kdeaccess.hxx
new file mode 100644
index 0000000000..36a22e23db
--- /dev/null
+++ b/shell/source/backends/kdebe/kdeaccess.hxx
@@ -0,0 +1,47 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef INCLUDED_SHELL_SOURCE_BACKENDS_KDEBE_KDEACCESS_HXX
+#define INCLUDED_SHELL_SOURCE_BACKENDS_KDEBE_KDEACCESS_HXX
+
+#include "sal/config.h"
+
+#include "com/sun/star/beans/Optional.hpp"
+
+namespace com { namespace sun { namespace star { namespace uno {
+ class Any;
+} } } }
+namespace rtl { class OUString; }
+
+namespace kdeaccess {
+
+com::sun::star::beans::Optional< com::sun::star::uno::Any > getValue(
+ rtl::OUString const & id);
+
+}
+
+#endif
diff --git a/shell/source/backends/kdebe/kdebackend.cxx b/shell/source/backends/kdebe/kdebackend.cxx
index 5443082d9e..53a00cf359 100644
--- a/shell/source/backends/kdebe/kdebackend.cxx
+++ b/shell/source/backends/kdebe/kdebackend.cxx
@@ -1,155 +1,258 @@
/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
#include "precompiled_shell.hxx"
+#include "sal/config.h"
-#include "kdebackend.hxx"
-#include "kdecommonlayer.hxx"
-#include "kdeinetlayer.hxx"
-#include "kdevcllayer.hxx"
-#include "kdepathslayer.hxx"
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/beans/Optional.hpp"
+#include "com/sun/star/beans/PropertyVetoException.hpp"
+#include "com/sun/star/beans/UnknownPropertyException.hpp"
+#include "com/sun/star/beans/XPropertyChangeListener.hpp"
+#include "com/sun/star/beans/XPropertySet.hpp"
+#include "com/sun/star/beans/XPropertySetInfo.hpp"
+#include "com/sun/star/beans/XVetoableChangeListener.hpp"
+#include "com/sun/star/lang/IllegalArgumentException.hpp"
+#include "com/sun/star/lang/WrappedTargetException.hpp"
+#include "com/sun/star/lang/XMultiComponentFactory.hpp"
+#include "com/sun/star/lang/XServiceInfo.hpp"
+#include "com/sun/star/lang/WrappedTargetException.hpp"
+#include "com/sun/star/uno/Any.hxx"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/uno/XCurrentContext.hpp"
+#include "cppuhelper/factory.hxx"
+#include "cppuhelper/implbase2.hxx"
+#include "cppuhelper/implementationentry.hxx"
+#include "cppuhelper/weak.hxx"
+#include "rtl/string.h"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+#include "uno/current_context.hxx"
+#include "uno/lbnames.h"
-//------------------------------------------------------------------------------
+#include "kde_headers.h"
-KDEBackend* KDEBackend::mInstance= 0;
+#include "kdeaccess.hxx"
-KDEBackend* KDEBackend::createInstance(const uno::Reference<uno::XComponentContext>& xContext)
-{
- if (mInstance == 0)
- {
- mInstance = new KDEBackend (xContext);
- }
-
- return mInstance;
-}
+namespace {
-//------------------------------------------------------------------------------
+namespace css = com::sun::star;
-KDEBackend::KDEBackend(const uno::Reference<uno::XComponentContext>& xContext)
- throw (backend::BackendAccessException)
- : BackendBase(mMutex), m_xContext(xContext)
-{
+rtl::OUString SAL_CALL getServiceImplementationName() {
+ return rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.comp.configuration.backend.KDEBackend"));
}
-//------------------------------------------------------------------------------
+css::uno::Sequence< rtl::OUString > SAL_CALL getServiceSupportedServiceNames() {
+ rtl::OUString name(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.backend.KDEBackend"));
+ return css::uno::Sequence< rtl::OUString >(&name, 1);
+}
-KDEBackend::~KDEBackend(void)
+class Service:
+ public cppu::WeakImplHelper2<
+ css::lang::XServiceInfo, css::beans::XPropertySet >,
+ private boost::noncopyable
{
-}
+public:
+ Service();
-//------------------------------------------------------------------------------
+private:
+ virtual ~Service() {}
-uno::Reference<backend::XLayer> SAL_CALL KDEBackend::getLayer(
- const rtl::OUString& aComponent, const rtl::OUString& /* aTimestamp */)
- throw (backend::BackendAccessException, lang::IllegalArgumentException)
-{
- uno::Reference<backend::XLayer> xLayer;
-
- if( aComponent.equalsAscii("org.openoffice.Office.Common" ) )
- {
- xLayer = new KDECommonLayer(m_xContext);
- }
- else if( aComponent.equalsAscii("org.openoffice.Inet" ) )
- {
- xLayer = new KDEInetLayer(m_xContext);
- }
- else if( aComponent.equalsAscii("org.openoffice.VCL" ) )
- {
- xLayer = new KDEVCLLayer(m_xContext);
- }
- else if( aComponent.equalsAscii("org.openoffice.Office.Paths" ) )
- {
- xLayer = new KDEPathsLayer(m_xContext);
- }
-
- return xLayer;
-}
+ virtual rtl::OUString SAL_CALL getImplementationName()
+ throw (css::uno::RuntimeException)
+ { return getServiceImplementationName(); }
-//------------------------------------------------------------------------------
+ virtual sal_Bool SAL_CALL supportsService(rtl::OUString const & ServiceName)
+ throw (css::uno::RuntimeException)
+ { return ServiceName == getSupportedServiceNames()[0]; }
-uno::Reference<backend::XUpdatableLayer> SAL_CALL
-KDEBackend::getUpdatableLayer(const rtl::OUString& /* aComponent */)
- throw (backend::BackendAccessException,lang::NoSupportException,
- lang::IllegalArgumentException)
-{
- throw lang::NoSupportException( rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("KDEBackend: No Update Operation allowed, Read Only access") ),
- *this) ;
-}
+ virtual css::uno::Sequence< rtl::OUString > SAL_CALL
+ getSupportedServiceNames() throw (css::uno::RuntimeException)
+ { return getServiceSupportedServiceNames(); }
-//------------------------------------------------------------------------------
+ virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
+ getPropertySetInfo() throw (css::uno::RuntimeException)
+ { return css::uno::Reference< css::beans::XPropertySetInfo >(); }
-rtl::OUString SAL_CALL KDEBackend::getBackendName(void)
-{
- return rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.configuration.backend.KDEBackend") );
-}
+ virtual void SAL_CALL setPropertyValue(
+ rtl::OUString const &, css::uno::Any const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::beans::PropertyVetoException,
+ css::lang::IllegalArgumentException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException);
-//------------------------------------------------------------------------------
+ virtual css::uno::Any SAL_CALL getPropertyValue(
+ rtl::OUString const & PropertyName)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException);
-rtl::OUString SAL_CALL KDEBackend::getImplementationName(void)
- throw (uno::RuntimeException)
-{
- return getBackendName() ;
-}
+ virtual void SAL_CALL addPropertyChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XPropertyChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
-//------------------------------------------------------------------------------
+ virtual void SAL_CALL removePropertyChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XPropertyChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
-uno::Sequence<rtl::OUString> SAL_CALL KDEBackend::getBackendServiceNames(void)
-{
- uno::Sequence<rtl::OUString> aServices(1) ;
- aServices[0] = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.KDEBackend")) ;
+ virtual void SAL_CALL addVetoableChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XVetoableChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
+ virtual void SAL_CALL removeVetoableChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XVetoableChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
+ bool enabled_;
+};
+
+Service::Service(): enabled_(false) {
+ css::uno::Reference< css::uno::XCurrentContext > context(
+ css::uno::getCurrentContext());
+ if (context.is()) {
+ rtl::OUString desktop;
+ context->getValueByName(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("system.desktop-environment"))) >>=
+ desktop;
+ enabled_ = desktop.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("KDE")) &&
+ KApplication::kApplication() != 0;
+ }
+}
- return aServices ;
+void Service::setPropertyValue(rtl::OUString const &, css::uno::Any const &)
+ throw (
+ css::beans::UnknownPropertyException, css::beans::PropertyVetoException,
+ css::lang::IllegalArgumentException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
+{
+ throw css::lang::IllegalArgumentException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("setPropertyValue not supported")),
+ static_cast< cppu::OWeakObject * >(this), -1);
}
-//------------------------------------------------------------------------------
+css::uno::Any Service::getPropertyValue(rtl::OUString const & PropertyName)
+ throw (
+ css::beans::UnknownPropertyException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
+{
+ if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("EnableATToolSupport")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ExternalMailer")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("SourceViewFontHeight")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("SourceViewFontName")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("WorkPathVariable")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyName")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyPort")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyName")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyPort")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyName")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyPort")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetNoProxy")) ||
+ PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetProxyType")))
+ {
+ return css::uno::makeAny(
+ enabled_
+ ? kdeaccess::getValue(PropertyName)
+ : css::beans::Optional< css::uno::Any >());
+ }
+ throw css::beans::UnknownPropertyException(
+ PropertyName, static_cast< cppu::OWeakObject * >(this));
+}
-sal_Bool SAL_CALL KDEBackend::supportsService(const rtl::OUString& aServiceName)
- throw (uno::RuntimeException)
+css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance(
+ css::uno::Reference< css::uno::XComponentContext > const &)
{
- uno::Sequence< rtl::OUString > const svc = getBackendServiceNames();
+ return static_cast< cppu::OWeakObject * >(new Service);
+}
- for(sal_Int32 i = 0; i < svc.getLength(); ++i )
- if(svc[i] == aServiceName)
- return true;
+static cppu::ImplementationEntry const services[] = {
+ { &createInstance, &getServiceImplementationName,
+ &getServiceSupportedServiceNames, &cppu::createSingleComponentFactory, 0,
+ 0 },
+ { 0, 0, 0, 0, 0, 0 }
+};
- return false;
}
-//------------------------------------------------------------------------------
+extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
+ char const * pImplName, void * pServiceManager, void * pRegistryKey)
+{
+ return cppu::component_getFactoryHelper(
+ pImplName, pServiceManager, pRegistryKey, services);
+}
-uno::Sequence<rtl::OUString>
-SAL_CALL KDEBackend::getSupportedServiceNames(void)
- throw (uno::RuntimeException)
+extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL
+component_getImplementationEnvironment(
+ char const ** ppEnvTypeName, uno_Environment **)
{
- return getBackendServiceNames() ;
+ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
-// ---------------------------------------------------------------------------------------
+extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
+ void * pServiceManager, void * pRegistryKey)
+{
+ return component_writeInfoHelper(pServiceManager, pRegistryKey, services);
+}
diff --git a/shell/source/backends/kdebe/kdebackend.hxx b/shell/source/backends/kdebe/kdebackend.hxx
deleted file mode 100644
index e046519575..0000000000
--- a/shell/source/backends/kdebe/kdebackend.hxx
+++ /dev/null
@@ -1,125 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef KDEBACKEND_HXX_
-#define KDEBACKEND_HXX_
-
-#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XSCHEMASUPPLIER_HPP_
-#include <com/sun/star/configuration/backend/XSingleLayerStratum.hpp>
-#endif
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/configuration/InvalidBootstrapFileException.hpp>
-#include <com/sun/star/configuration/backend/CannotConnectException.hpp>
-#include <cppuhelper/compbase2.hxx>
-
-#ifndef INCLUDED_MAP
-#include <map>
-#define INCLUDED_MAP
-#endif
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-
-
-//------------------------------------------------------------------------------
-typedef cppu::WeakComponentImplHelper2<backend::XSingleLayerStratum,
- lang::XServiceInfo> BackendBase ;
-
-/**
- Implements the SingleLayerStratum service for KDE access.
- */
-class KDEBackend : public BackendBase {
- public :
-
- static KDEBackend* createInstance(const uno::Reference<uno::XComponentContext>& xContext);
-
- // XServiceInfo
- virtual rtl::OUString SAL_CALL getImplementationName( )
- throw (uno::RuntimeException) ;
-
- virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& aServiceName )
- throw (uno::RuntimeException) ;
-
- virtual uno::Sequence<rtl::OUString> SAL_CALL getSupportedServiceNames( )
- throw (uno::RuntimeException) ;
-
- /**
- Provides the implementation name.
-
- @return implementation name
- */
- static rtl::OUString SAL_CALL getBackendName(void) ;
-
- /**
- Provides the supported services names
-
- @return service names
- */
- static uno::Sequence<rtl::OUString> SAL_CALL getBackendServiceNames(void) ;
-
- //XSingleLayerStratum
- virtual uno::Reference<backend::XLayer> SAL_CALL
- getLayer( const rtl::OUString& aLayerId, const rtl::OUString& aTimestamp )
- throw (backend::BackendAccessException, lang::IllegalArgumentException) ;
-
- virtual uno::Reference<backend::XUpdatableLayer> SAL_CALL
- getUpdatableLayer( const rtl::OUString& aLayerId )
- throw (backend::BackendAccessException, lang::NoSupportException,
- lang::IllegalArgumentException) ;
-
- protected:
- /**
- Service constructor from a service factory.
-
- @param xContext component context
- */
- KDEBackend(const uno::Reference<uno::XComponentContext>& xContext)
- throw (backend::BackendAccessException);
-
- /** Destructor */
- ~KDEBackend(void) ;
-
- private:
-
- /** Build KDE/OO mapping table */
- void initializeMappingTable ();
-
-
- /** The component context */
- uno::Reference<uno::XComponentContext> m_xContext;
-
- /** Mutex for reOOurces protection */
- osl::Mutex mMutex ;
-
- static KDEBackend* mInstance;
-};
-
-#endif // CONFIGMGR_LOCALBE_LOCALSINGLESTRATUM_HXX_
diff --git a/shell/source/backends/kdebe/kdebe.xml b/shell/source/backends/kdebe/kdebe.xml
deleted file mode 100644
index 7f4856be98..0000000000
--- a/shell/source/backends/kdebe/kdebe.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd">
-<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
- <module-name>kdebe</module-name>
- <component-description>
- <author> Éric Bischoff </author>
- <name>com.sun.star.comp.configuration.backend.KDEBackend</name>
- <description> The KDE configuration backend </description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language>c++</language>
- <status value="beta"/>
- <supported-service>com.sun.star.comp.configuration.backend.KDEBackend</supported-service>
- <service-dependency>...</service-dependency>
- <type>com.sun.star.configuration.backend.XBackendChangesListener</type>
- <type>com.sun.star.configuration.backend.XBackendChangesNotifier</type>
- <type>com.sun.star.configuration.backend.XLayerHandler</type>
- <type>com.sun.star.configuration.backend.XSingleLayerStratum</type>
- <type>com.sun.star.lang.XMultiComponentFactory</type>
- <type>com.sun.star.lang.XServiceInfo</type>
- <type>com.sun.star.lang.XSingleComponentFactory</type>
- <type>com.sun.star.lang.XTypeProvider</type>
- <type>com.sun.star.uno.TypeClass</type>
- <type>com.sun.star.uno.XAggregation</type>
- <type>com.sun.star.uno.XComponentContext</type>
- <type>com.sun.star.uno.XCurrentContext</type>
- <type>com.sun.star.uno.XWeak</type>
- <type>com.sun.star.registry.XRegistryKey</type>
- </component-description>
- <project-build-dependency>cppuhelper</project-build-dependency>
- <project-build-dependency>cppu</project-build-dependency>
- <project-build-dependency>sal</project-build-dependency>
- <runtime-module-dependency>cppuhelper3$(COM)</runtime-module-dependency>
- <runtime-module-dependency>cppu3</runtime-module-dependency>
- <runtime-module-dependency>sal3</runtime-module-dependency>
-</module-description>
diff --git a/shell/source/backends/kdebe/kdebecdef.cxx b/shell/source/backends/kdebe/kdebecdef.cxx
deleted file mode 100644
index c34ce82dfe..0000000000
--- a/shell/source/backends/kdebe/kdebecdef.cxx
+++ /dev/null
@@ -1,140 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-#include "kdebackend.hxx"
-#include <com/sun/star/registry/XRegistryKey.hpp>
-
-#ifndef _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_
-#include <cppuhelper/implementationentry.hxx>
-#endif
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include "kde_headers.h"
-
-#include "uno/current_context.hxx"
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-
-//==============================================================================
-
-static uno::Reference<uno::XInterface> SAL_CALL createKDEBackend(const uno::Reference<uno::XComponentContext>& xContext)
-{
- try {
- uno::Reference< uno::XCurrentContext > xCurrentContext(uno::getCurrentContext());
-
- if (xCurrentContext.is())
- {
- uno::Any aValue = xCurrentContext->getValueByName(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "system.desktop-environment" ) ) );
-
- rtl::OUString aDesktopEnvironment;
- if ( (aValue >>= aDesktopEnvironment) && (aDesktopEnvironment.equalsAscii("KDE")) && (KApplication::kApplication() != NULL) )
- return * KDEBackend::createInstance(xContext);
- }
-
- return uno::Reference<uno::XInterface>();
-
- } catch (uno::RuntimeException e) {
- return uno::Reference<uno::XInterface>();
- }
-
-}
-
-//==============================================================================
-
-static const cppu::ImplementationEntry kImplementations_entries[] =
-{
- {
- createKDEBackend,
- KDEBackend::getBackendName,
- KDEBackend::getBackendServiceNames,
- cppu::createSingleComponentFactory,
- NULL,
- 0
- },
- { NULL, NULL, NULL, NULL, NULL, 0 }
-} ;
-//------------------------------------------------------------------------------
-
-extern "C" void SAL_CALL component_getImplementationEnvironment(
- const sal_Char **aEnvTypeName,
- uno_Environment **) {
- *aEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ;
-}
-
-//------------------------------------------------------------------------------
-
-extern "C" sal_Bool SAL_CALL component_writeInfo(void *,
- void *pRegistryKey) {
-
- using namespace ::com::sun::star::registry;
- if (pRegistryKey)
- {
- try
- {
- uno::Reference< XRegistryKey > xImplKey = static_cast< XRegistryKey* >( pRegistryKey )->createKey(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + KDEBackend::getBackendName()
- );
-
- // Register associated service names
- uno::Reference< XRegistryKey > xServicesKey = xImplKey->createKey(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES") )
- );
-
- uno::Sequence<rtl::OUString> sServiceNames = KDEBackend::getBackendServiceNames();
- for (sal_Int32 i = 0 ; i < sServiceNames.getLength() ; ++ i)
- xServicesKey->createKey(sServiceNames[i]);
-
- return sal_True;
- }
-
- catch( InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "InvalidRegistryException caught");
- }
- }
-
- return sal_False;
-}
-
-//------------------------------------------------------------------------------
-
-extern "C" void *component_getFactory(const sal_Char *aImplementationName,
- void *aServiceManager,
- void *aRegistryKey) {
-
- return cppu::component_getFactoryHelper(
- aImplementationName,
- aServiceManager,
- aRegistryKey,
- kImplementations_entries) ;
-}
-//------------------------------------------------------------------------------
diff --git a/shell/source/backends/kdebe/kdecommonlayer.cxx b/shell/source/backends/kdebe/kdecommonlayer.cxx
deleted file mode 100644
index 02d9306b32..0000000000
--- a/shell/source/backends/kdebe/kdecommonlayer.cxx
+++ /dev/null
@@ -1,150 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-#include "kdecommonlayer.hxx"
-#include "kde_headers.h"
-#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
-#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#endif
-#include <com/sun/star/uno/Sequence.hxx>
-
-#define SPACE ' '
-
-//==============================================================================
-
-KDECommonLayer::KDECommonLayer(const uno::Reference<uno::XComponentContext>& xContext)
-{
- //Create instance of LayerContentDescriber Service
- rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.configuration.backend.LayerDescriber"));
-
- typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber;
- uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
- if( xServiceManager.is() )
- {
- m_xLayerContentDescriber = LayerDescriber::query(
- xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext));
- }
- else
- {
- OSL_TRACE("Could not retrieve ServiceManager");
- }
-}
-
-//------------------------------------------------------------------------------
-
-void SAL_CALL KDECommonLayer::readData( const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- if( ! m_xLayerContentDescriber.is() )
- {
- throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"
- ) ), static_cast < backend::XLayer * > (this) );
- }
-
- uno::Sequence<backend::PropertyInfo> aPropInfoList(3);
- sal_Int32 nProperties = 0;
-
- // Email client settings
- KEMailSettings aEmailSettings;
- QString aClientProgram;
- ::rtl::OUString sClientProgram;
-
- aClientProgram = aEmailSettings.getSetting( KEMailSettings::ClientProgram );
- if ( aClientProgram.isEmpty() )
- aClientProgram = "kmail";
- else
- aClientProgram = aClientProgram.section(SPACE, 0, 0);
- sClientProgram = (const sal_Unicode *) aClientProgram.ucs2();
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Common/ExternalMailer/Program") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( sClientProgram );
-
- // Source code font settings
- QFont aFixedFont;
- QString aFontName;
- :: rtl::OUString sFontName;
- short nFontHeight;
-
- aFixedFont = KGlobalSettings::fixedFont();
- aFontName = aFixedFont.family();
- sFontName = (const sal_Unicode *) aFontName.ucs2();
- nFontHeight = aFixedFont.pointSize();
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Common/Font/SourceViewFont/FontName") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( sFontName );
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Common/Font/SourceViewFont/FontHeight") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "short" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( nFontHeight );
-
- if( nProperties > 0 )
- {
- aPropInfoList.realloc(nProperties);
- m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList);
- }
-}
-
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL KDECommonLayer::getTimestamp(void)
- throw (uno::RuntimeException)
-{
- // Return the value as timestamp to avoid regenerating the binary cache
- // on each office launch.
-
- KEMailSettings aEmailSettings;
- QString aClientProgram = aEmailSettings.getSetting( KEMailSettings::ClientProgram );
- aClientProgram = aClientProgram.section(SPACE, 0, 0);
-
- QString aFixedFont = KGlobalSettings::fixedFont().toString();
-
- ::rtl::OUString sTimeStamp,
- sep( RTL_CONSTASCII_USTRINGPARAM( "$" ) );
-
- sTimeStamp = (const sal_Unicode *) aClientProgram.ucs2();
- sTimeStamp += sep;
- sTimeStamp += (const sal_Unicode *) aFixedFont.ucs2();
-
- return sTimeStamp;
-}
diff --git a/shell/source/backends/kdebe/kdecommonlayer.hxx b/shell/source/backends/kdebe/kdecommonlayer.hxx
deleted file mode 100644
index 84bcf35544..0000000000
--- a/shell/source/backends/kdebe/kdecommonlayer.hxx
+++ /dev/null
@@ -1,56 +0,0 @@
-#ifndef KDECOMMONLAYER_HXX_
-#define KDECOMMONLAYER_HXX_
-
-#include "kdebackend.hxx"
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
-#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#endif
-#include <com/sun/star/util/XTimeStamped.hpp>
-#include <cppuhelper/implbase2.hxx>
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-namespace util = css::util ;
-
-/**
- Implementation of the XLayer interface for the KDE values mapped into
- the org.openoffice.Office.Common configuration component.
- */
-class KDECommonLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped>
-{
-public :
- /**
- Constructor given the component context
-
- @param xContext The component context
- */
-
- KDECommonLayer(const uno::Reference<uno::XComponentContext>& xContext);
-
- // XLayer
- virtual void SAL_CALL readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException) ;
-
- // XTimeStamped
- virtual rtl::OUString SAL_CALL getTimestamp(void)
- throw (uno::RuntimeException);
-
- protected:
-
- /** Destructor */
- ~KDECommonLayer(void) {}
-
- private :
- uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber ;
- } ;
-
-#endif // KDECOMMONLAYER
diff --git a/shell/source/backends/kdebe/kdeinetlayer.cxx b/shell/source/backends/kdebe/kdeinetlayer.cxx
deleted file mode 100644
index 53621782e1..0000000000
--- a/shell/source/backends/kdebe/kdeinetlayer.cxx
+++ /dev/null
@@ -1,251 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-#include "kdeinetlayer.hxx"
-#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
-#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#endif
-#include <com/sun/star/uno/Sequence.hxx>
-
-#define COMMA ','
-#define SEMI_COLON ';'
-
-//==============================================================================
-
-KDEInetLayer::KDEInetLayer(const uno::Reference<uno::XComponentContext>& xContext)
-{
- //Create instance of LayerContentDescriber Service
- rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.configuration.backend.LayerDescriber"));
-
- typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber;
- uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
- if( xServiceManager.is() )
- {
- m_xLayerContentDescriber = LayerDescriber::query(
- xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext));
- }
- else
- {
- OSL_TRACE("Could not retrieve ServiceManager");
- }
-}
-
-//------------------------------------------------------------------------------
-
-void SAL_CALL KDEInetLayer::readData( const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- if( ! m_xLayerContentDescriber.is() )
- {
- throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"
- ) ), static_cast < backend::XLayer * > (this) );
- }
-
- uno::Sequence<backend::PropertyInfo> aPropInfoList(8);
- sal_Int32 nProperties = 0;
-
- switch ( KProtocolManager::proxyType() )
- {
- case KProtocolManager::ManualProxy: // Proxies are manually configured
- setProxy(aPropInfoList, nProperties, 1,
- KProtocolManager::noProxyFor(),
- KProtocolManager::proxyFor( "HTTP" ),
- KProtocolManager::proxyFor( "FTP" ),
- KProtocolManager::proxyFor( "HTTPS" ));
- break;
- case KProtocolManager::PACProxy: // A proxy configuration URL has been given
- case KProtocolManager::WPADProxy: // A proxy should be automatically discovered
- case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
-// In such cases, the proxy address is not stored in KDE, but determined dynamically.
-// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind...
-// The best we can do here is to ask the current value for a given address.
- setProxy(aPropInfoList, nProperties, 1,
- KProtocolManager::noProxyFor(),
- KProtocolManager::proxyForURL( "http://www.openoffice.org" ),
- KProtocolManager::proxyForURL( "ftp://ftp.openoffice.org" ),
- KProtocolManager::proxyForURL( "https://www.openoffice.org" ));
- break;
- default: // No proxy is used
- setProxy(aPropInfoList, nProperties, 0);
- }
-
- if ( nProperties > 0 )
- {
- aPropInfoList.realloc(nProperties);
- m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList);
- }
-}
-
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL KDEInetLayer::getTimestamp(void)
- throw (uno::RuntimeException)
-{
- // Return the value as timestamp to avoid regenerating the binary cache
- // on each office launch.
-
- QString aProxyType, aNoProxyFor, aHTTPProxy, aHTTPSProxy, aFTPProxy;
-
- switch ( KProtocolManager::proxyType() )
- {
- case KProtocolManager::ManualProxy:
- aProxyType = '1';
- aNoProxyFor = KProtocolManager::noProxyFor();
- aHTTPProxy = KProtocolManager::proxyFor( "HTTP" );
- aHTTPProxy = KProtocolManager::proxyFor( "HTTPS" );
- aFTPProxy = KProtocolManager::proxyFor( "FTP" );
- break;
- case KProtocolManager::PACProxy:
- case KProtocolManager::WPADProxy:
- case KProtocolManager::EnvVarProxy:
- aProxyType = '1';
- aNoProxyFor = KProtocolManager::noProxyFor();
- aHTTPProxy = KProtocolManager::proxyForURL( "http://www.openoffice.org" );
- aHTTPSProxy = KProtocolManager::proxyForURL( "https://www.openoffice.org" );
- aFTPProxy = KProtocolManager::proxyForURL( "ftp://ftp.openoffice.org" );
- break;
- default:
- aProxyType = '0';
- }
-
- ::rtl::OUString sTimeStamp,
- sep( RTL_CONSTASCII_USTRINGPARAM( "$" ) );
-
- sTimeStamp = (const sal_Unicode *) aProxyType.ucs2();
- sTimeStamp += sep;
- sTimeStamp += (const sal_Unicode *) aNoProxyFor.ucs2();
- sTimeStamp += sep;
- sTimeStamp += (const sal_Unicode *) aHTTPProxy.ucs2();
- sTimeStamp += sep;
- sTimeStamp += (const sal_Unicode *) aHTTPSProxy.ucs2();
- sTimeStamp += sep;
- sTimeStamp += (const sal_Unicode *) aFTPProxy.ucs2();
-
- return sTimeStamp;
-}
-
-//------------------------------------------------------------------------------
-
-void SAL_CALL KDEInetLayer::setProxy
- (uno::Sequence<backend::PropertyInfo> &aPropInfoList, sal_Int32 &nProperties,
- int nProxyType, const QString &aNoProxy, const QString &aHTTPProxy, const QString &aFTPProxy, const QString &aHTTPSProxy ) const
-{
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetProxyType") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "int" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( (sal_Int32) nProxyType );
-
- if (nProxyType == 0) return;
-
- if ( !aNoProxy.isEmpty() )
- {
- QString aNoProxyFor(aNoProxy);
- ::rtl::OUString sNoProxyFor;
-
- aNoProxyFor = aNoProxyFor.replace( COMMA, SEMI_COLON );
- sNoProxyFor = (const sal_Unicode *) aNoProxyFor.ucs2();
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetNoProxy") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( sNoProxyFor );
- }
-
- if ( !aHTTPProxy.isEmpty() )
- {
- KURL aProxy(aHTTPProxy);
- ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().ucs2();
- sal_Int32 nPort = aProxy.port();
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPProxyName") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( sProxy );
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPProxyPort") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "int" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( nPort );
- }
-
- if ( !aHTTPSProxy.isEmpty() )
- {
- KURL aProxy(aHTTPSProxy);
- ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().ucs2();
- sal_Int32 nPort = aProxy.port();
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPSProxyName") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( sProxy );
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPSProxyPort") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "int" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( nPort );
- }
-
- if ( !aFTPProxy.isEmpty() )
- {
- KURL aProxy(aFTPProxy);
- ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().ucs2();
- sal_Int32 nPort = aProxy.port();
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetFTPProxyName") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( sProxy );
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetFTPProxyPort") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "int" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( nPort );
- }
-}
-
diff --git a/shell/source/backends/kdebe/kdeinetlayer.hxx b/shell/source/backends/kdebe/kdeinetlayer.hxx
deleted file mode 100755
index 1a7427b1cb..0000000000
--- a/shell/source/backends/kdebe/kdeinetlayer.hxx
+++ /dev/null
@@ -1,62 +0,0 @@
-#ifndef KDEINETLAYER_HXX_
-#define KDEINETLAYER_HXX_
-
-#include "kdebackend.hxx"
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
-#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#endif
-#include <com/sun/star/util/XTimeStamped.hpp>
-#include <cppuhelper/implbase2.hxx>
-#include <kde_headers.h>
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-namespace util = css::util ;
-
-/**
- Implementation of the XLayer interface for the KDE values mapped into
- the org.openoffice.Inet configuration component.
- */
-class KDEInetLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped>
-{
-public :
- /**
- Constructor given the component context
-
- @param xContext The component context
- */
-
- KDEInetLayer(const uno::Reference<uno::XComponentContext>& xContext);
-
- // XLayer
- virtual void SAL_CALL readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException) ;
-
- // XTimeStamped
- virtual rtl::OUString SAL_CALL getTimestamp(void)
- throw (uno::RuntimeException);
-
- protected:
-
- /** Destructor */
- ~KDEInetLayer(void) {}
-
-private :
- uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber ;
-
- void SAL_CALL setProxy
- (uno::Sequence<backend::PropertyInfo> &aPropInfoList, sal_Int32 &nProperties,
- int nProxyType, const QString &aNoProxyfor = QString(),
- const QString &aHTTPProxy = QString(), const QString &aFTPProxy = QString(), const QString &aHTTPSProxy = QString()) const;
- } ;
-
-#endif // KDEINETLAYER
diff --git a/shell/source/backends/kdebe/kdepathslayer.cxx b/shell/source/backends/kdebe/kdepathslayer.cxx
deleted file mode 100644
index 73c1b8dc0c..0000000000
--- a/shell/source/backends/kdebe/kdepathslayer.cxx
+++ /dev/null
@@ -1,118 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-#include "kdepathslayer.hxx"
-#include "kde_headers.h"
-#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
-#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#endif
-#include <osl/security.hxx>
-#include <osl/file.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-
-#define SPACE ' '
-
-//==============================================================================
-
-KDEPathsLayer::KDEPathsLayer(const uno::Reference<uno::XComponentContext>& xContext)
-{
- //Create instance of LayerContentDescriber Service
- rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.configuration.backend.LayerDescriber"));
-
- typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber;
- uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
- if( xServiceManager.is() )
- {
- m_xLayerContentDescriber = LayerDescriber::query(
- xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext));
- }
- else
- {
- OSL_TRACE("Could not retrieve ServiceManager");
- }
-}
-
-//------------------------------------------------------------------------------
-
-void SAL_CALL KDEPathsLayer::readData( const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- if( ! m_xLayerContentDescriber.is() )
- {
- throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"
- ) ), static_cast < backend::XLayer * > (this) );
- }
-
- uno::Sequence<backend::PropertyInfo> aPropInfoList(1);
- sal_Int32 nProperties = 0;
-
- QString aDocumentsDir( KGlobalSettings::documentPath() );
- rtl::OUString sDocumentsDir;
- rtl::OUString sDocumentsURL;
- if ( aDocumentsDir.endsWith(QChar('/')) )
- aDocumentsDir.truncate ( aDocumentsDir.length() - 1 );
- sDocumentsDir = (const sal_Unicode *) aDocumentsDir.ucs2();
- osl_getFileURLFromSystemPath( sDocumentsDir.pData, &sDocumentsURL.pData );
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Paths/Variables/Work") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( sDocumentsURL );
-
- if( nProperties > 0 )
- {
- aPropInfoList.realloc(nProperties);
- m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList);
- }
-}
-
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL KDEPathsLayer::getTimestamp(void)
- throw (uno::RuntimeException)
-{
- // Return the value as timestamp to avoid regenerating the binary cache
- // on each office launch.
-
- ::rtl::OUString sTimeStamp,
- sep( RTL_CONSTASCII_USTRINGPARAM( "$" ) );
-
- QString aDocumentsDir;
- aDocumentsDir = KGlobalSettings::documentPath();
-
- sTimeStamp += (const sal_Unicode *) aDocumentsDir.ucs2();
-
- return sTimeStamp;
-}
diff --git a/shell/source/backends/kdebe/kdepathslayer.hxx b/shell/source/backends/kdebe/kdepathslayer.hxx
deleted file mode 100644
index e1586378ea..0000000000
--- a/shell/source/backends/kdebe/kdepathslayer.hxx
+++ /dev/null
@@ -1,83 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef KDEPATHSLAYER_HXX_
-#define KDEPATHSLAYER_HXX_
-
-#include "kdebackend.hxx"
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
-#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#endif
-#include <com/sun/star/util/XTimeStamped.hpp>
-#include <cppuhelper/implbase2.hxx>
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-namespace util = css::util ;
-
-/**
- Implementation of the XLayer interface for the KDE values mapped into
- the org.openoffice.Office.Paths configuration component.
- */
-class KDEPathsLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped>
-{
-public :
- /**
- Constructor given the component context
-
- @param xContext The component context
- */
-
- KDEPathsLayer(const uno::Reference<uno::XComponentContext>& xContext);
-
- // XLayer
- virtual void SAL_CALL readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException) ;
-
- // XTimeStamped
- virtual rtl::OUString SAL_CALL getTimestamp(void)
- throw (uno::RuntimeException);
-
- protected:
-
- /** Destructor */
- ~KDEPathsLayer(void) {}
-
- private :
- uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber ;
- } ;
-
-#endif // KDEPATHSLAYER
diff --git a/shell/source/backends/kdebe/kdevcllayer.cxx b/shell/source/backends/kdebe/kdevcllayer.cxx
deleted file mode 100644
index c4c1e03e2a..0000000000
--- a/shell/source/backends/kdebe/kdevcllayer.cxx
+++ /dev/null
@@ -1,113 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-#include "kdevcllayer.hxx"
-#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
-#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#endif
-#include <com/sun/star/uno/Sequence.hxx>
-#include "kde_headers.h"
-
-//==============================================================================
-
-KDEVCLLayer::KDEVCLLayer(const uno::Reference<uno::XComponentContext>& xContext)
-{
- //Create instance of LayerContentDescriber Service
- rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.configuration.backend.LayerDescriber"));
-
- typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber;
- uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
- if( xServiceManager.is() )
- {
- m_xLayerContentDescriber = LayerDescriber::query(
- xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext));
- }
- else
- {
- OSL_TRACE("Could not retrieve ServiceManager");
- }
-}
-
-//------------------------------------------------------------------------------
-
-void SAL_CALL KDEVCLLayer::readData( const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException, lang::NullPointerException,
- lang::WrappedTargetException, uno::RuntimeException)
-{
- if( ! m_xLayerContentDescriber.is() )
- {
- throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"
- ) ), static_cast < backend::XLayer * > (this) );
- }
-
- uno::Sequence<backend::PropertyInfo> aPropInfoList(1);
-
-/*
- Commenting out, does not make much sense without an accessibility bridge
-===========================================================================
-#if defined(QT_ACCESSIBILITY_SUPPORT)
-// Accessibility tools under Qt for UNIX are available starting with Qt 4.0
- int nVersionMajor = 0;
- const char *q = qVersion(); // "3.1.0" for example
- while ('0' <= *q && *q <= '9')
- nVersionMajor = nVersionMajor * 10 + *q++ - '0';
- sal_Bool ATToolSupport = (sal_Bool) (nVersionMajor >= 4);
-#else
- sal_Bool ATToolSupport = sal_False;
-#endif
-===========================================================================
- End of commented out section
-*/ sal_Bool ATToolSupport = sal_False;
-
- aPropInfoList[0].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.VCL/Settings/Accessibility/EnableATToolSupport") );
- aPropInfoList[0].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[0].Protected = sal_False;
- aPropInfoList[0].Value = uno::makeAny( rtl::OUString::valueOf( ATToolSupport ) );
-
- m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList);
-}
-
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL KDEVCLLayer::getTimestamp(void)
- throw (uno::RuntimeException)
-{
- // Return the value as timestamp to avoid regenerating the binary cache
- // on each office launch.
-
- ::rtl::OUString sTimeStamp(
- RTL_CONSTASCII_USTRINGPARAM( "FALSE" ) );
-
- return sTimeStamp;
-}
diff --git a/shell/source/backends/kdebe/kdevcllayer.hxx b/shell/source/backends/kdebe/kdevcllayer.hxx
deleted file mode 100644
index 32b541a3c3..0000000000
--- a/shell/source/backends/kdebe/kdevcllayer.hxx
+++ /dev/null
@@ -1,56 +0,0 @@
-#ifndef KDEVCLLAYER_HXX_
-#define KDEVCLLAYER_HXX_
-
-#include "kdebackend.hxx"
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
-#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#endif
-#include <com/sun/star/util/XTimeStamped.hpp>
-#include <cppuhelper/implbase2.hxx>
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-namespace util = css::util ;
-
-/**
- Implementation of the XLayer interface for the KDE values mapped into
- the org.openoffice.VCL configuration component.
- */
-class KDEVCLLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped>
-{
-public :
- /**
- Constructor given the component context
-
- @param xContext The component context
- */
-
- KDEVCLLayer(const uno::Reference<uno::XComponentContext>& xContext);
-
- // XLayer
- virtual void SAL_CALL readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException) ;
-
- // XTimeStamped
- virtual rtl::OUString SAL_CALL getTimestamp(void)
- throw (uno::RuntimeException);
-
- protected:
-
- /** Destructor */
- ~KDEVCLLayer(void) {}
-
- private :
- uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber ;
- } ;
-
-#endif // KDEVCLLAYER
diff --git a/shell/source/backends/kdebe/makefile.mk b/shell/source/backends/kdebe/makefile.mk
index 7bf8d53568..31bf77b47b 100644
--- a/shell/source/backends/kdebe/makefile.mk
+++ b/shell/source/backends/kdebe/makefile.mk
@@ -31,11 +31,7 @@ TARGET=kdebe
LIBTARGET=NO
ENABLE_EXCEPTIONS=TRUE
-
-COMP1TYPELIST=$(TARGET)
-COMPRDB=$(SOLARBINDIR)$/types.rdb
-UNOUCROUT=$(OUT)$/inc$/$(TARGET)
-INCPRE=$(UNOUCROUT)
+VISIBILITY_HIDDEN=TRUE
# --- Settings ---
@@ -60,12 +56,8 @@ CFLAGS+=$(KDE_CFLAGS)
# --- Files ---
SLOFILES=\
- $(SLO)$/kdebackend.obj \
- $(SLO)$/kdecommonlayer.obj \
- $(SLO)$/kdeinetlayer.obj \
- $(SLO)$/kdevcllayer.obj \
- $(SLO)$/kdepathslayer.obj \
- $(SLO)$/kdebecdef.obj
+ $(SLO)$/kdeaccess.obj \
+ $(SLO)$/kdebackend.obj
SHL1NOCHECK=TRUE
SHL1TARGET=$(TARGET)1.uno
@@ -78,8 +70,7 @@ SHL1STDLIBS= \
$(CPPUHELPERLIB) \
$(CPPULIB) \
$(SALLIB)
-
-SHL1VERSIONMAP=exports.map
+
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
diff --git a/shell/source/backends/localebe/exports.map b/shell/source/backends/localebe/exports.map
deleted file mode 100644
index ba501f9ae0..0000000000
--- a/shell/source/backends/localebe/exports.map
+++ /dev/null
@@ -1,10 +0,0 @@
-UDK_3_0_0 {
- global:
- GetVersionInfo;
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/shell/source/backends/localebe/localebackend.cxx b/shell/source/backends/localebe/localebackend.cxx
index 7dfdb62524..e98d7d752f 100644
--- a/shell/source/backends/localebe/localebackend.cxx
+++ b/shell/source/backends/localebe/localebackend.cxx
@@ -29,9 +29,7 @@
#include "precompiled_shell.hxx"
#include "localebackend.hxx"
-#include "localelayer.hxx"
-#include <com/sun/star/configuration/backend/ComponentChangeEvent.hpp>
-#include <uno/current_context.hxx>
+#include <com/sun/star/beans/Optional.hpp>
#include <osl/time.h>
#include <stdio.h>
@@ -226,11 +224,7 @@ rtl::OUString ImplGetLocale(LCID lcid)
// -------------------------------------------------------------------------------
-LocaleBackend::LocaleBackend(const uno::Reference<uno::XComponentContext>& xContext)
- throw (backend::BackendAccessException) :
- ::cppu::WeakImplHelper2 < backend::XSingleLayerStratum, lang::XServiceInfo > (),
- m_xContext(xContext)
-
+LocaleBackend::LocaleBackend()
{
}
@@ -242,11 +236,9 @@ LocaleBackend::~LocaleBackend(void)
//------------------------------------------------------------------------------
-LocaleBackend* LocaleBackend::createInstance(
- const uno::Reference<uno::XComponentContext>& xContext
-)
+LocaleBackend* LocaleBackend::createInstance()
{
- return new LocaleBackend(xContext);
+ return new LocaleBackend;
}
// ---------------------------------------------------------------------------------------
@@ -288,61 +280,45 @@ rtl::OUString LocaleBackend::getSystemLocale(void)
}
//------------------------------------------------------------------------------
-rtl::OUString LocaleBackend::createTimeStamp()
+void LocaleBackend::setPropertyValue(
+ rtl::OUString const &, css::uno::Any const &)
+ throw (
+ css::beans::UnknownPropertyException, css::beans::PropertyVetoException,
+ css::lang::IllegalArgumentException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
{
- // the time stamp is free text, so just returning the values here.
- return getLocale() + getUILocale() + getSystemLocale();
+ throw css::lang::IllegalArgumentException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("setPropertyValue not supported")),
+ static_cast< cppu::OWeakObject * >(this), -1);
}
-//------------------------------------------------------------------------------
-
-uno::Reference<backend::XLayer> SAL_CALL LocaleBackend::getLayer(
- const rtl::OUString& aComponent, const rtl::OUString& /*aTimestamp*/)
- throw (backend::BackendAccessException, lang::IllegalArgumentException)
+css::uno::Any LocaleBackend::getPropertyValue(
+ rtl::OUString const & PropertyName)
+ throw (
+ css::beans::UnknownPropertyException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
{
-
- uno::Sequence<rtl::OUString> aComps( getSupportedComponents() );
- if( aComponent.equals( aComps[0]) )
+ if (PropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Locale"))) {
+ return css::uno::makeAny(
+ css::beans::Optional< css::uno::Any >(
+ true, css::uno::makeAny(getLocale())));
+ } else if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("SystemLocale")))
{
- if( ! m_xSystemLayer.is() )
- {
- uno::Sequence<backend::PropertyInfo> aPropInfoList(3);
-
- aPropInfoList[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.System/L10N/UILocale") );
- aPropInfoList[0].Type = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[0].Protected = sal_False;
- aPropInfoList[0].Value = uno::makeAny( getUILocale() );
-
- aPropInfoList[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.System/L10N/Locale") );
- aPropInfoList[1].Type = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "string" ));
- aPropInfoList[1].Protected = sal_False;
- aPropInfoList[1].Value = uno::makeAny( getLocale() );
-
- aPropInfoList[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.System/L10N/SystemLocale") );
- aPropInfoList[2].Type = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "string" ));
- aPropInfoList[2].Protected = sal_False;
- aPropInfoList[2].Value = uno::makeAny( getSystemLocale() );
-
- m_xSystemLayer = new LocaleLayer(aPropInfoList, createTimeStamp(), m_xContext);
- }
-
- return m_xSystemLayer;
+ return css::uno::makeAny(
+ css::beans::Optional< css::uno::Any >(
+ true, css::uno::makeAny(getSystemLocale())));
+ } else if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("UILocale")))
+ {
+ return css::uno::makeAny(
+ css::beans::Optional< css::uno::Any >(
+ true, css::uno::makeAny(getUILocale())));
+ } else {
+ throw css::beans::UnknownPropertyException(
+ PropertyName, static_cast< cppu::OWeakObject * >(this));
}
-
- return uno::Reference<backend::XLayer>();
-}
-
-//------------------------------------------------------------------------------
-
-uno::Reference<backend::XUpdatableLayer> SAL_CALL
-LocaleBackend::getUpdatableLayer(const rtl::OUString& /*aComponent*/)
- throw (backend::BackendAccessException,lang::NoSupportException,
- lang::IllegalArgumentException)
-{
- throw lang::NoSupportException(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "LocaleBackend: No Update Operation allowed, Read Only access") ),
- *this) ;
}
//------------------------------------------------------------------------------
@@ -363,10 +339,8 @@ rtl::OUString SAL_CALL LocaleBackend::getImplementationName(void)
uno::Sequence<rtl::OUString> SAL_CALL LocaleBackend::getBackendServiceNames(void)
{
- uno::Sequence<rtl::OUString> aServiceNameList(2);
+ uno::Sequence<rtl::OUString> aServiceNameList(1);
aServiceNameList[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.LocaleBackend")) ;
- aServiceNameList[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.PlatformBackend")) ;
-
return aServiceNameList ;
}
@@ -391,16 +365,3 @@ uno::Sequence<rtl::OUString> SAL_CALL LocaleBackend::getSupportedServiceNames(vo
{
return getBackendServiceNames() ;
}
-
-// ---------------------------------------------------------------------------------------
-
-uno::Sequence<rtl::OUString> SAL_CALL LocaleBackend::getSupportedComponents(void)
-{
- uno::Sequence<rtl::OUString> aSupportedComponentList(1);
- aSupportedComponentList[0] = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.System" )
- );
-
- return aSupportedComponentList;
-}
-
diff --git a/shell/source/backends/localebe/localebackend.hxx b/shell/source/backends/localebe/localebackend.hxx
index 8a51c6141c..e927f95aa9 100644
--- a/shell/source/backends/localebe/localebackend.hxx
+++ b/shell/source/backends/localebe/localebackend.hxx
@@ -28,10 +28,8 @@
#ifndef _FIXEDVALUEBACKEND_HXX_
#define _FIXEDVALUEBACKEND_HXX_
-#include <com/sun/star/configuration/backend/XSingleLayerStratum.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/configuration/backend/XBackendChangesNotifier.hpp>
#include <cppuhelper/implbase2.hxx>
#include <rtl/string.hxx>
@@ -39,19 +37,14 @@
namespace css = com::sun::star ;
namespace uno = css::uno ;
namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-
-/**
- Implements the SingleLayerStratum service.
- */
class LocaleBackend : public ::cppu::WeakImplHelper2 <
- backend::XSingleLayerStratum,
+ css::beans::XPropertySet,
lang::XServiceInfo > {
public :
- static LocaleBackend* createInstance(const uno::Reference<uno::XComponentContext>& xContext);
+ static LocaleBackend* createInstance();
// XServiceInfo
virtual rtl::OUString SAL_CALL
@@ -78,45 +71,70 @@ class LocaleBackend : public ::cppu::WeakImplHelper2 <
@return service names
*/
static uno::Sequence<rtl::OUString> SAL_CALL getBackendServiceNames(void) ;
- /**
- Provides the supported component nodes
-
- @return supported component nodes
- */
- static uno::Sequence<rtl::OUString> SAL_CALL getSupportedComponents(void) ;
-
- //XSingleLayerStratum
- virtual uno::Reference<backend::XLayer> SAL_CALL
- getLayer( const rtl::OUString& aLayerId, const rtl::OUString& aTimestamp )
- throw (backend::BackendAccessException,
- lang::IllegalArgumentException) ;
-
- virtual uno::Reference<backend::XUpdatableLayer> SAL_CALL
- getUpdatableLayer( const rtl::OUString& aLayerId )
- throw (backend::BackendAccessException,
- lang::NoSupportException,
- lang::IllegalArgumentException) ;
+
+ // XPropertySet
+ virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
+ getPropertySetInfo() throw (css::uno::RuntimeException)
+ { return css::uno::Reference< css::beans::XPropertySetInfo >(); }
+
+ virtual void SAL_CALL setPropertyValue(
+ rtl::OUString const &, css::uno::Any const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::beans::PropertyVetoException,
+ css::lang::IllegalArgumentException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException);
+
+ virtual css::uno::Any SAL_CALL getPropertyValue(
+ rtl::OUString const & PropertyName)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException);
+
+ virtual void SAL_CALL addPropertyChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XPropertyChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
+ virtual void SAL_CALL removePropertyChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XPropertyChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
+ virtual void SAL_CALL addVetoableChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XVetoableChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
+ virtual void SAL_CALL removeVetoableChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XVetoableChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
protected:
/**
Service constructor from a service factory.
@param xContext component context
*/
- LocaleBackend(const uno::Reference<uno::XComponentContext>& xContext)
- throw (backend::BackendAccessException);
+ LocaleBackend();
/** Destructor */
~LocaleBackend(void) ;
private:
-
- uno::Reference<uno::XComponentContext> m_xContext ;
- uno::Reference<backend::XLayer> m_xSystemLayer ;
-
- // Returns a time stamp in the appropriate format
- // for configuration layers.
- static rtl::OUString createTimeStamp(void);
-
// Returns the user locale
static rtl::OUString getLocale(void);
diff --git a/shell/source/backends/localebe/localebe.xml b/shell/source/backends/localebe/localebe.xml
index d3778f30e3..fe641db7fc 100644
--- a/shell/source/backends/localebe/localebe.xml
+++ b/shell/source/backends/localebe/localebe.xml
@@ -10,7 +10,6 @@
<language>c++</language>
<status value="beta"/>
<supported-service>com.sun.star.comp.configuration.backend.LocaleBackend</supported-service>
- <supported-service>com.sun.star.comp.configuration.backend.PlatformBackend</supported-service>
<service-dependency>...</service-dependency>
<type>com.sun.star.configuration.backend.XBackendChangesListener</type>
<type>com.sun.star.configuration.backend.XBackendChangesNotifier</type>
diff --git a/shell/source/backends/localebe/localebecdef.cxx b/shell/source/backends/localebe/localebecdef.cxx
index 36579dee4c..8326c65075 100644
--- a/shell/source/backends/localebe/localebecdef.cxx
+++ b/shell/source/backends/localebe/localebecdef.cxx
@@ -29,7 +29,6 @@
#include "precompiled_shell.hxx"
#include <localebackend.hxx>
-#include <com/sun/star/registry/XRegistryKey.hpp>
#ifndef _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_
#include <cppuhelper/implementationentry.hxx>
@@ -39,14 +38,13 @@
namespace css = com::sun::star ;
namespace uno = css::uno ;
namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
//------------------------------------------------------------------------------
static uno::Reference<uno::XInterface> SAL_CALL createLocaleBackend(
- const uno::Reference<uno::XComponentContext>& xContext){
+ const uno::Reference<uno::XComponentContext>&){
- return * LocaleBackend::createInstance(xContext);
+ return * LocaleBackend::createInstance();
}
//------------------------------------------------------------------------------
@@ -74,41 +72,9 @@ extern "C" void SAL_CALL component_getImplementationEnvironment(
//------------------------------------------------------------------------------
-extern "C" sal_Bool SAL_CALL component_writeInfo(void * /*pServiceManager*/, void *pRegistryKey) {
-
- using namespace ::com::sun::star::registry;
- if (pRegistryKey)
- {
- try
- {
- uno::Reference< XRegistryKey > xImplKey = static_cast< XRegistryKey* >( pRegistryKey )->createKey(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + LocaleBackend::getBackendName()
- );
-
- // Register associated service names
- uno::Reference< XRegistryKey > xServicesKey = xImplKey->createKey(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES") )
- );
-
- uno::Sequence<rtl::OUString> sServiceNames = LocaleBackend::getBackendServiceNames();
- for (sal_Int32 i = 0 ; i < sServiceNames.getLength() ; ++ i)
- xServicesKey->createKey(sServiceNames[i]);
-
- // Register supported components
- uno::Reference<XRegistryKey> xComponentKey = xImplKey->createKey(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/DATA/SupportedComponents") )
- );
-
- xComponentKey->setAsciiListValue( LocaleBackend::getSupportedComponents() );
-
- return sal_True;
- }
- catch( InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "InvalidRegistryException caught");
- }
- }
- return sal_False;
+extern "C" sal_Bool SAL_CALL component_writeInfo(void * pServiceManager, void *pRegistryKey) {
+ return cppu::component_writeInfoHelper(
+ pServiceManager, pRegistryKey, kImplementations_entries);
}
//------------------------------------------------------------------------------
diff --git a/shell/source/backends/localebe/localelayer.cxx b/shell/source/backends/localebe/localelayer.cxx
deleted file mode 100644
index d3ef527868..0000000000
--- a/shell/source/backends/localebe/localelayer.cxx
+++ /dev/null
@@ -1,85 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-#include "localelayer.hxx"
-
-//------------------------------------------------------------------------------
-
-LocaleLayer::LocaleLayer( const uno::Sequence<backend::PropertyInfo>& aPropInfoList,
- const rtl::OUString& aTimestamp,
- const uno::Reference<uno::XComponentContext>& xContext)
- : m_aTimestamp(aTimestamp), m_aPropInfoList(aPropInfoList)
-{
- //Create instance of LayerContentDescriber Service
- rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.configuration.backend.LayerDescriber"));
-
- typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber;
- uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
- if( xServiceManager.is() )
- {
- m_xLayerContentDescriber = LayerDescriber::query(
- xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext));
- }
- else
- {
- OSL_TRACE("Could not retrieve ServiceManager");
- }
-
-}
-
-//------------------------------------------------------------------------------
-
-void SAL_CALL LocaleLayer::readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException)
-{
-
- if (m_xLayerContentDescriber.is())
- {
- m_xLayerContentDescriber->describeLayer(xHandler, m_aPropInfoList);
- }
- else
- {
- OSL_TRACE("Could not create com.sun.star.configuration.backend.LayerContentDescriber Service");
- }
-}
-
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL LocaleLayer::getTimestamp(void)
- throw (uno::RuntimeException)
-{
- return m_aTimestamp;
-}
-
-//------------------------------------------------------------------------------
diff --git a/shell/source/backends/localebe/localelayer.hxx b/shell/source/backends/localebe/localelayer.hxx
deleted file mode 100644
index c720efca49..0000000000
--- a/shell/source/backends/localebe/localelayer.hxx
+++ /dev/null
@@ -1,64 +0,0 @@
-#ifndef _LOCALELAYER_HXX_
-#define _LOCALELAYER_HXX_
-
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
-#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
-
-#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#endif
-#include <com/sun/star/util/XTimeStamped.hpp>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <cppuhelper/implbase2.hxx>
-
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-namespace util = css::util ;
-
-/**
- Implementation of the XLayer interfaces for fixed values
- */
-
-class LocaleLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped>
-{
- public :
- /**
- Constructor given the requested component name
-
- @param aPropInfoListyMap Gconf->OO key map
- @param aCompoentName Requested Component Name
- @param sTimestamp timestamp indicating last modifictaion
- */
- LocaleLayer(const uno::Sequence<backend::PropertyInfo>& aPropInfoList,
- const rtl::OUString& aTimestamp,
- const uno::Reference<uno::XComponentContext>& xContext);
-
- /** Destructor */
- ~LocaleLayer(void) {}
-
- // XLayer
- virtual void SAL_CALL readData(const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException) ;
-
- // XTimeStamped
- virtual rtl::OUString SAL_CALL getTimestamp(void)
- throw (uno::RuntimeException);
-
- private :
-
- rtl::OUString m_aTimestamp ;
- rtl::OUString m_aComponent ;
-
- uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber ;
- uno::Sequence<backend::PropertyInfo> m_aPropInfoList ;
-} ;
-
-#endif // _LOCALELAYER_HXX_
diff --git a/shell/source/backends/localebe/makefile.mk b/shell/source/backends/localebe/makefile.mk
index 51a95344aa..bd12bcdb28 100644
--- a/shell/source/backends/localebe/makefile.mk
+++ b/shell/source/backends/localebe/makefile.mk
@@ -45,9 +45,8 @@ DLLPRE =
SLOFILES=\
$(SLO)$/localebecdef.obj \
- $(SLO)$/localebackend.obj \
- $(SLO)$/localelayer.obj
-
+ $(SLO)$/localebackend.obj
+
SHL1TARGET=$(TARGET)1.uno
SHL1OBJS=$(SLOFILES)
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
@@ -63,7 +62,7 @@ SHL1STDLIBS= \
SHL1STDLIBS+= -framework CoreServices
.ENDIF
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
diff --git a/shell/source/backends/macbe/exports.map b/shell/source/backends/macbe/exports.map
deleted file mode 100644
index ba501f9ae0..0000000000
--- a/shell/source/backends/macbe/exports.map
+++ /dev/null
@@ -1,10 +0,0 @@
-UDK_3_0_0 {
- global:
- GetVersionInfo;
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/shell/source/backends/macbe/macbackend.cxx b/shell/source/backends/macbe/macbackend.cxx
index 5a15b0bc49..2d4eb169be 100644
--- a/shell/source/backends/macbe/macbackend.cxx
+++ b/shell/source/backends/macbe/macbackend.cxx
@@ -28,18 +28,140 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_shell.hxx"
+// For MAXHOSTNAMELEN constant
+#include <sys/param.h>
+
+#include <premac.h>
+#include <SystemConfiguration/SystemConfiguration.h>
+#include <Foundation/NSPathUtilities.h>
+#include <postmac.h>
+
#include "macbackend.hxx"
-#include "macbelayer.hxx"
-#include <com/sun/star/configuration/backend/ComponentChangeEvent.hpp>
-#include <uno/current_context.hxx>
-#define MACBE_INET_COMPONENT "org.openoffice.Inet"
-#define MACBE_PATHS_COMPONENT "org.openoffice.Office.Paths"
+#include "com/sun/star/beans/Optional.hpp"
+#include "rtl/ustrbuf.hxx"
+#include "osl/file.h"
+
+#define SPACE ' '
+#define SEMI_COLON ';'
+
+typedef struct
+{
+ rtl::OUString Server;
+ sal_Int32 Port;
+} ProxyEntry;
+
+typedef enum {
+ sHTTP,
+ sHTTPS,
+ sFTP
+} ServiceType;
+
+//------------------------------------------------------------------------
+// helper functions
+//------------------------------------------------------------------------
+
+namespace // private
+{
+
+/*
+ * Returns current proxy settings for selected service type (HTTP or
+ * FTP) as a C string (in the buffer specified by host and hostSize)
+ * and a port number.
+ */
+
+bool GetProxySetting(ServiceType sType, char *host, size_t hostSize, UInt16 *port)
+{
+ bool result;
+ CFDictionaryRef proxyDict;
+ CFNumberRef enableNum;
+ int enable;
+ CFStringRef hostStr;
+ CFNumberRef portNum;
+ int portInt;
+
+ proxyDict = SCDynamicStoreCopyProxies(NULL);
+
+ if (!proxyDict)
+ return false;
+
+ CFStringRef proxiesEnable;
+ CFStringRef proxiesProxy;
+ CFStringRef proxiesPort;
+
+ switch ( sType )
+ {
+ case sHTTP : proxiesEnable = kSCPropNetProxiesHTTPEnable;
+ proxiesProxy = kSCPropNetProxiesHTTPProxy;
+ proxiesPort = kSCPropNetProxiesHTTPPort;
+ break;
+ case sHTTPS: proxiesEnable = kSCPropNetProxiesHTTPSEnable;
+ proxiesProxy = kSCPropNetProxiesHTTPSProxy;
+ proxiesPort = kSCPropNetProxiesHTTPSPort;
+ break;
+ default: proxiesEnable = kSCPropNetProxiesFTPEnable;
+ proxiesProxy = kSCPropNetProxiesFTPProxy;
+ proxiesPort = kSCPropNetProxiesFTPPort;
+ break;
+ }
+ // Proxy enabled?
+ enableNum = (CFNumberRef) CFDictionaryGetValue( proxyDict,
+ proxiesEnable );
+
+ result = (enableNum != NULL) && (CFGetTypeID(enableNum) == CFNumberGetTypeID());
+
+ if (result)
+ result = CFNumberGetValue(enableNum, kCFNumberIntType, &enable) && (enable != 0);
+
+ // Proxy enabled -> get hostname
+ if (result)
+ {
+ hostStr = (CFStringRef) CFDictionaryGetValue( proxyDict,
+ proxiesProxy );
+
+ result = (hostStr != NULL) && (CFGetTypeID(hostStr) == CFStringGetTypeID());
+ }
+
+ if (result)
+ result = CFStringGetCString(hostStr, host, (CFIndex) hostSize, kCFStringEncodingASCII);
+
+ // Get proxy port
+ if (result)
+ {
+ portNum = (CFNumberRef) CFDictionaryGetValue( proxyDict,
+ proxiesPort );
+
+ result = (portNum != NULL) && (CFGetTypeID(portNum) == CFNumberGetTypeID());
+ }
+ else
+ {
+ CFRelease(proxyDict);
+ return false;
+ }
+
+ if (result)
+ result = CFNumberGetValue(portNum, kCFNumberIntType, &portInt);
+
+ if (result)
+ *port = (UInt16) portInt;
+
+ if (proxyDict)
+ CFRelease(proxyDict);
+
+ if (!result)
+ {
+ *host = 0;
+ *port = 0;
+ }
+
+ return result;
+}
-MacOSXBackend::MacOSXBackend(const uno::Reference<uno::XComponentContext>& xContext)
- throw (backend::BackendAccessException) :
- ::cppu::WeakImplHelper2 < backend::XSingleLayerStratum, lang::XServiceInfo > (),
- m_xContext(xContext)
+} // end private namespace
+
+//------------------------------------------------------------------------------
+
+MacOSXBackend::MacOSXBackend()
{
}
@@ -51,46 +173,282 @@ MacOSXBackend::~MacOSXBackend(void)
//------------------------------------------------------------------------------
-MacOSXBackend* MacOSXBackend::createInstance(const uno::Reference<uno::XComponentContext>& xContext)
+MacOSXBackend* MacOSXBackend::createInstance()
{
- return new MacOSXBackend(xContext);
+ return new MacOSXBackend;
}
// ---------------------------------------------------------------------------------------
-uno::Reference<backend::XLayer> SAL_CALL MacOSXBackend::getLayer(const rtl::OUString& aComponent, const rtl::OUString& /*aTimestamp*/)
- throw (backend::BackendAccessException, lang::IllegalArgumentException)
-{
- if( aComponent.equalsAscii( MACBE_INET_COMPONENT ) )
- {
- if( ! m_xSystemLayer.is() )
- m_xSystemLayer = new MacOSXLayer( m_xContext );
+rtl::OUString CFStringToOUString(const CFStringRef sOrig) {
+ CFRetain(sOrig);
- return m_xSystemLayer;
- }
- else if( aComponent.equalsAscii( MACBE_PATHS_COMPONENT ) )
- {
- if( ! m_xPathLayer.is() )
- m_xPathLayer = new MacOSXPathLayer( m_xContext );
- return m_xPathLayer;
- }
+ CFIndex nStringLen = CFStringGetLength(sOrig)+1;
+
+ // Allocate a c string buffer
+ char sBuffer[nStringLen];
+
+ CFStringGetCString(sOrig, sBuffer, nStringLen, kCFStringEncodingASCII);
+
+ CFRelease(sOrig);
- return uno::Reference<backend::XLayer>();
+ return rtl::OUString::createFromAscii((sal_Char*)sBuffer);
}
-//------------------------------------------------------------------------------
+rtl::OUString GetOUString( NSString* pStr )
+{
+ if( ! pStr )
+ return rtl::OUString();
+ int nLen = [pStr length];
+ if( nLen == 0 )
+ return rtl::OUString();
+
+ rtl::OUStringBuffer aBuf( nLen+1 );
+ aBuf.setLength( nLen );
+ [pStr getCharacters: const_cast<sal_Unicode*>(aBuf.getStr())];
+ return aBuf.makeStringAndClear();
+}
-uno::Reference<backend::XUpdatableLayer> SAL_CALL
- MacOSXBackend::getUpdatableLayer(const rtl::OUString& /*aComponent*/)
- throw (backend::BackendAccessException,lang::NoSupportException,
- lang::IllegalArgumentException)
+void MacOSXBackend::setPropertyValue(
+ rtl::OUString const &, css::uno::Any const &)
+ throw (
+ css::beans::UnknownPropertyException, css::beans::PropertyVetoException,
+ css::lang::IllegalArgumentException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
{
- throw lang::NoSupportException(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "MacOSXBackend: No Update Operation allowed, Read Only access") ),
- *this);
+ throw css::lang::IllegalArgumentException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("setPropertyValue not supported")),
+ static_cast< cppu::OWeakObject * >(this), -1);
+}
- return NULL;
+css::uno::Any MacOSXBackend::getPropertyValue(
+ rtl::OUString const & PropertyName)
+ throw (
+ css::beans::UnknownPropertyException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
+{
+ if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("WorkPathVariable")))
+ {
+ rtl::OUString aDocDir;
+ NSArray* pPaths = NSSearchPathForDirectoriesInDomains( NSDocumentDirectory, NSUserDomainMask, true );
+ if( pPaths && [pPaths count] > 0 )
+ {
+ aDocDir = GetOUString( [pPaths objectAtIndex: 0] );
+
+ rtl::OUString aDocURL;
+ if( aDocDir.getLength() > 0 &&
+ osl_getFileURLFromSystemPath( aDocDir.pData, &aDocURL.pData ) == osl_File_E_None )
+ {
+ return css::uno::makeAny(
+ css::beans::Optional< css::uno::Any >(
+ true, css::uno::makeAny( aDocURL ) ) );
+ }
+ else
+ {
+ OSL_TRACE( "user documents list contains empty file path or conversion failed" );
+ }
+ }
+ else
+ {
+ OSL_TRACE( "Got nil or empty list of user document directories" );
+ }
+ return css::uno::makeAny(css::beans::Optional< css::uno::Any >());
+ } else if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyName")))
+ {
+ ProxyEntry aFtpProxy;
+
+ char host[MAXHOSTNAMELEN];
+ UInt16 port;
+ bool retVal;
+
+ retVal = GetProxySetting(sFTP, host, 100, &port);
+
+ if (retVal)
+ {
+ aFtpProxy.Server = rtl::OUString::createFromAscii( host );
+ }
+
+ // ftp proxy name
+ if( aFtpProxy.Server.getLength() > 0 )
+ {
+ return css::uno::makeAny(
+ css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( aFtpProxy.Server ) ) );
+ }
+ return css::uno::makeAny(css::beans::Optional< css::uno::Any >());
+ } else if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyPort")))
+ {
+ ProxyEntry aFtpProxy;
+
+ char host[MAXHOSTNAMELEN];
+ UInt16 port;
+ bool retVal;
+
+ retVal = GetProxySetting(sFTP, host, 100, &port);
+
+ if (retVal)
+ {
+ aFtpProxy.Port = port;
+ }
+
+ // ftp proxy port
+ if( aFtpProxy.Port > 0 )
+ {
+ return css::uno::makeAny(
+ css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( aFtpProxy.Port ) ) );
+ }
+ return css::uno::makeAny(css::beans::Optional< css::uno::Any >());
+ } else if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyName")))
+ {
+ ProxyEntry aHttpProxy;
+
+ char host[MAXHOSTNAMELEN];
+ UInt16 port;
+ bool retVal;
+
+ retVal = GetProxySetting(sHTTP, host, 100, &port);
+
+ if (retVal)
+ {
+ aHttpProxy.Server = rtl::OUString::createFromAscii( host );
+ }
+
+ // http proxy name
+ if( aHttpProxy.Server.getLength() > 0 )
+ {
+ return css::uno::makeAny(
+ css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( aHttpProxy.Server ) ) );
+ }
+ return css::uno::makeAny(css::beans::Optional< css::uno::Any >());
+ } else if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyPort")))
+ {
+ ProxyEntry aHttpProxy;
+
+ char host[MAXHOSTNAMELEN];
+ UInt16 port;
+ bool retVal;
+
+ retVal = GetProxySetting(sHTTP, host, 100, &port);
+
+ if (retVal)
+ {
+ aHttpProxy.Port = port;
+ }
+
+ // http proxy port
+ if( aHttpProxy.Port > 0 )
+ {
+ return css::uno::makeAny(
+ css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( aHttpProxy.Port ) ) );
+ }
+ return css::uno::makeAny(css::beans::Optional< css::uno::Any >());
+ } else if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyName")))
+ {
+ ProxyEntry aHttpsProxy;
+
+ char host[MAXHOSTNAMELEN];
+ UInt16 port;
+ bool retVal;
+
+ retVal = GetProxySetting(sHTTPS, host, 100, &port);
+
+ if (retVal)
+ {
+ aHttpsProxy.Server = rtl::OUString::createFromAscii( host );
+ }
+
+ // https proxy name
+ if( aHttpsProxy.Server.getLength() > 0 )
+ {
+ return css::uno::makeAny(
+ css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( aHttpsProxy.Server ) ) );
+ }
+ return css::uno::makeAny(css::beans::Optional< css::uno::Any >());
+ } else if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyPort")))
+ {
+ ProxyEntry aHttpsProxy;
+
+ char host[MAXHOSTNAMELEN];
+ UInt16 port;
+ bool retVal;
+
+ retVal = GetProxySetting(sHTTPS, host, 100, &port);
+
+ if (retVal)
+ {
+ aHttpsProxy.Port = port;
+ }
+
+ // https proxy port
+ if( aHttpsProxy.Port > 0 )
+ {
+ return css::uno::makeAny(
+ css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( aHttpsProxy.Port ) ) );
+ }
+ return css::uno::makeAny(css::beans::Optional< css::uno::Any >());
+ } else if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetProxyType")))
+ {
+ // override default for ProxyType, which is "0" meaning "No proxies".
+ sal_Int32 nProperties = 1;
+ return css::uno::makeAny(
+ css::beans::Optional< css::uno::Any >(
+ true, uno::makeAny( nProperties ) ) );
+ } else if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetNoProxy")))
+ {
+ rtl::OUString aProxyBypassList;
+
+ CFArrayRef rExceptionsList;
+ CFDictionaryRef rProxyDict = SCDynamicStoreCopyProxies(NULL);
+
+ if (!rProxyDict)
+ rExceptionsList = false;
+ else
+ rExceptionsList = (CFArrayRef) CFDictionaryGetValue(rProxyDict, kSCPropNetProxiesExceptionsList);
+
+ if (rExceptionsList)
+ {
+ for (CFIndex idx = 0; idx < CFArrayGetCount(rExceptionsList); idx++)
+ {
+ CFStringRef rException = (CFStringRef) CFArrayGetValueAtIndex(rExceptionsList, idx);
+
+ if (idx>0)
+ aProxyBypassList += rtl::OUString::createFromAscii( ";" );
+
+ aProxyBypassList += CFStringToOUString(rException);
+ }
+ }
+
+ if (rProxyDict)
+ CFRelease(rProxyDict);
+
+ // fill proxy bypass list
+ if( aProxyBypassList.getLength() > 0 )
+ {
+ return css::uno::makeAny(
+ css::beans::Optional< css::uno::Any >(
+ true,
+ uno::makeAny( aProxyBypassList.replace( SPACE, SEMI_COLON ) ) ) );
+ }
+ return css::uno::makeAny(css::beans::Optional< css::uno::Any >());
+ } else {
+ throw css::beans::UnknownPropertyException(
+ PropertyName, static_cast< cppu::OWeakObject * >(this));
+ }
}
//------------------------------------------------------------------------------
@@ -112,9 +470,8 @@ rtl::OUString SAL_CALL MacOSXBackend::getImplementationName(void)
uno::Sequence<rtl::OUString> SAL_CALL MacOSXBackend::getBackendServiceNames(void)
{
- uno::Sequence<rtl::OUString> aServiceNameList(2);
+ uno::Sequence<rtl::OUString> aServiceNameList(1);
aServiceNameList[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.MacOSXBackend"));
- aServiceNameList[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.PlatformBackend"));
return aServiceNameList;
}
@@ -140,15 +497,3 @@ uno::Sequence<rtl::OUString> SAL_CALL MacOSXBackend::getSupportedServiceNames(vo
{
return getBackendServiceNames();
}
-
-// ---------------------------------------------------------------------------------------
-
-uno::Sequence<rtl::OUString> SAL_CALL MacOSXBackend::getSupportedComponents(void)
-{
- uno::Sequence<rtl::OUString> aSupportedComponentList(2);
- aSupportedComponentList[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( MACBE_INET_COMPONENT ) );
- aSupportedComponentList[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( MACBE_PATHS_COMPONENT ) );
-
- return aSupportedComponentList;
-}
-
diff --git a/shell/source/backends/macbe/macbackend.hxx b/shell/source/backends/macbe/macbackend.hxx
index 0fe37a0e6a..9c4210b4d5 100644
--- a/shell/source/backends/macbe/macbackend.hxx
+++ b/shell/source/backends/macbe/macbackend.hxx
@@ -28,10 +28,8 @@
#ifndef _MACBACKEND_HXX_
#define _MACBACKEND_HXX_
-#include <com/sun/star/configuration/backend/XSingleLayerStratum.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/configuration/backend/XBackendChangesNotifier.hpp>
#include <cppuhelper/implbase2.hxx>
#include <rtl/string.hxx>
@@ -41,18 +39,13 @@
namespace css = com::sun::star;
namespace uno = css::uno;
namespace lang = css::lang;
-namespace backend = css::configuration::backend;
-
-/**
- Implements the SingleLayerStratum service.
- */
-class MacOSXBackend : public ::cppu::WeakImplHelper2 <backend::XSingleLayerStratum, lang::XServiceInfo >
+class MacOSXBackend : public ::cppu::WeakImplHelper2 <css::beans::XPropertySet, lang::XServiceInfo >
{
public:
- static MacOSXBackend* createInstance(const uno::Reference<uno::XComponentContext>& xContext);
+ static MacOSXBackend* createInstance();
// XServiceInfo
virtual rtl::OUString SAL_CALL getImplementationName()
@@ -78,19 +71,56 @@ public:
*/
static uno::Sequence<rtl::OUString> SAL_CALL getBackendServiceNames(void);
- /**
- Provides the supported component nodes
-
- @return supported component nodes
- */
- static uno::Sequence<rtl::OUString> SAL_CALL getSupportedComponents(void);
-
- // XSingleLayerStratum
- virtual uno::Reference<backend::XLayer> SAL_CALL getLayer(const rtl::OUString& aLayerId, const rtl::OUString& aTimestamp)
- throw (backend::BackendAccessException, lang::IllegalArgumentException);
-
- virtual uno::Reference<backend::XUpdatableLayer> SAL_CALL getUpdatableLayer(const rtl::OUString& aLayerId)
- throw (backend::BackendAccessException, lang::NoSupportException, lang::IllegalArgumentException);
+ // XPropertySet
+ virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
+ getPropertySetInfo() throw (css::uno::RuntimeException)
+ { return css::uno::Reference< css::beans::XPropertySetInfo >(); }
+
+ virtual void SAL_CALL setPropertyValue(
+ rtl::OUString const &, css::uno::Any const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::beans::PropertyVetoException,
+ css::lang::IllegalArgumentException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException);
+
+ virtual css::uno::Any SAL_CALL getPropertyValue(
+ rtl::OUString const & PropertyName)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException);
+
+ virtual void SAL_CALL addPropertyChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XPropertyChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
+ virtual void SAL_CALL removePropertyChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XPropertyChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
+ virtual void SAL_CALL addVetoableChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XVetoableChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
+ virtual void SAL_CALL removeVetoableChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XVetoableChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
protected:
@@ -99,18 +129,10 @@ protected:
@param xContext component context
*/
- MacOSXBackend(const uno::Reference<uno::XComponentContext>& xContext)
- throw (backend::BackendAccessException);
+ MacOSXBackend();
/** Destructor */
~MacOSXBackend(void);
-
-private:
-
- uno::Reference<uno::XComponentContext> m_xContext;
- uno::Reference<backend::XLayer> m_xSystemLayer;
- uno::Reference<backend::XLayer> m_xPathLayer;
-
};
#endif // _MACBACKEND_HXX_
diff --git a/shell/source/backends/macbe/macbe.xml b/shell/source/backends/macbe/macbe.xml
index 85854250cf..7cee5bb14d 100644
--- a/shell/source/backends/macbe/macbe.xml
+++ b/shell/source/backends/macbe/macbe.xml
@@ -10,7 +10,6 @@
<language>c++</language>
<status value="beta"/>
<supported-service>com.sun.star.comp.configuration.backend.MacOSXBackend</supported-service>
- <supported-service>com.sun.star.comp.configuration.backend.PlatformBackend</supported-service>
<service-dependency>...</service-dependency>
<type>com.sun.star.configuration.backend.XBackendChangesListener</type>
<type>com.sun.star.configuration.backend.XBackendChangesNotifier</type>
diff --git a/shell/source/backends/macbe/macbecdef.cxx b/shell/source/backends/macbe/macbecdef.cxx
index 72622f7bc2..e0609dd06b 100644
--- a/shell/source/backends/macbe/macbecdef.cxx
+++ b/shell/source/backends/macbe/macbecdef.cxx
@@ -39,14 +39,13 @@
namespace css = com::sun::star;
namespace uno = css::uno;
namespace lang = css::lang;
-namespace backend = css::configuration::backend;
//------------------------------------------------------------------------------
static uno::Reference<uno::XInterface> SAL_CALL createMacOSXBackend(
- const uno::Reference<uno::XComponentContext>& xContext)
+ const uno::Reference<uno::XComponentContext>&)
{
- return * MacOSXBackend::createInstance(xContext);
+ return * MacOSXBackend::createInstance();
}
//------------------------------------------------------------------------------
@@ -74,41 +73,9 @@ extern "C" void SAL_CALL component_getImplementationEnvironment(
//------------------------------------------------------------------------------
-extern "C" sal_Bool SAL_CALL component_writeInfo(void * /*pServiceManager*/, void *pRegistryKey) {
-
- using namespace ::com::sun::star::registry;
- if (pRegistryKey)
- {
- try
- {
- uno::Reference< XRegistryKey > xImplKey = static_cast< XRegistryKey* >( pRegistryKey )->createKey(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + MacOSXBackend::getBackendName()
- );
-
- // Register associated service names
- uno::Reference< XRegistryKey > xServicesKey = xImplKey->createKey(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES") )
- );
-
- uno::Sequence<rtl::OUString> sServiceNames = MacOSXBackend::getBackendServiceNames();
- for (sal_Int32 i = 0; i < sServiceNames.getLength(); ++ i)
- xServicesKey->createKey(sServiceNames[i]);
-
- // Register supported components
- uno::Reference<XRegistryKey> xComponentKey = xImplKey->createKey(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/DATA/SupportedComponents") )
- );
-
- xComponentKey->setAsciiListValue( MacOSXBackend::getSupportedComponents() );
-
- return sal_True;
- }
- catch( InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "InvalidRegistryException caught");
- }
- }
- return sal_False;
+extern "C" sal_Bool SAL_CALL component_writeInfo(void * pServiceManager, void *pRegistryKey) {
+ return cppu::component_writeInfoHelper(
+ pServiceManager, pRegistryKey, kImplementations_entries);
}
//------------------------------------------------------------------------------
diff --git a/shell/source/backends/macbe/macbelayer.cxx b/shell/source/backends/macbe/macbelayer.cxx
deleted file mode 100644
index cc8213baa5..0000000000
--- a/shell/source/backends/macbe/macbelayer.cxx
+++ /dev/null
@@ -1,440 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-
-// For MAXHOSTNAMELEN constant
-#include <sys/param.h>
-
-#include <premac.h>
-#include <SystemConfiguration/SystemConfiguration.h>
-#include <Foundation/NSPathUtilities.h>
-#include <postmac.h>
-
-#include "macbelayer.hxx"
-
-#include "rtl/ustrbuf.hxx"
-#include "osl/file.h"
-
-#define SPACE ' '
-#define SEMI_COLON ';'
-
-typedef struct
-{
- rtl::OUString Server;
- sal_Int32 Port;
-} ProxyEntry;
-
-typedef enum {
- sHTTP,
- sHTTPS,
- sFTP
-} ServiceType;
-
-//------------------------------------------------------------------------
-// helper functions
-//------------------------------------------------------------------------
-
-namespace // private
-{
-
-/*
- * Returns current proxy settings for selected service type (HTTP or
- * FTP) as a C string (in the buffer specified by host and hostSize)
- * and a port number.
- */
-
-bool GetProxySetting(ServiceType sType, char *host, size_t hostSize, UInt16 *port)
-{
- bool result;
- CFDictionaryRef proxyDict;
- CFNumberRef enableNum;
- int enable;
- CFStringRef hostStr;
- CFNumberRef portNum;
- int portInt;
-
- proxyDict = SCDynamicStoreCopyProxies(NULL);
-
- if (!proxyDict)
- return false;
-
- CFStringRef proxiesEnable;
- CFStringRef proxiesProxy;
- CFStringRef proxiesPort;
-
- switch ( sType )
- {
- case sHTTP : proxiesEnable = kSCPropNetProxiesHTTPEnable;
- proxiesProxy = kSCPropNetProxiesHTTPProxy;
- proxiesPort = kSCPropNetProxiesHTTPPort;
- break;
- case sHTTPS: proxiesEnable = kSCPropNetProxiesHTTPSEnable;
- proxiesProxy = kSCPropNetProxiesHTTPSProxy;
- proxiesPort = kSCPropNetProxiesHTTPSPort;
- break;
- default: proxiesEnable = kSCPropNetProxiesFTPEnable;
- proxiesProxy = kSCPropNetProxiesFTPProxy;
- proxiesPort = kSCPropNetProxiesFTPPort;
- break;
- }
- // Proxy enabled?
- enableNum = (CFNumberRef) CFDictionaryGetValue( proxyDict,
- proxiesEnable );
-
- result = (enableNum != NULL) && (CFGetTypeID(enableNum) == CFNumberGetTypeID());
-
- if (result)
- result = CFNumberGetValue(enableNum, kCFNumberIntType, &enable) && (enable != 0);
-
- // Proxy enabled -> get hostname
- if (result)
- {
- hostStr = (CFStringRef) CFDictionaryGetValue( proxyDict,
- proxiesProxy );
-
- result = (hostStr != NULL) && (CFGetTypeID(hostStr) == CFStringGetTypeID());
- }
-
- if (result)
- result = CFStringGetCString(hostStr, host, (CFIndex) hostSize, kCFStringEncodingASCII);
-
- // Get proxy port
- if (result)
- {
- portNum = (CFNumberRef) CFDictionaryGetValue( proxyDict,
- proxiesPort );
-
- result = (portNum != NULL) && (CFGetTypeID(portNum) == CFNumberGetTypeID());
- }
- else
- {
- CFRelease(proxyDict);
- return false;
- }
-
- if (result)
- result = CFNumberGetValue(portNum, kCFNumberIntType, &portInt);
-
- if (result)
- *port = (UInt16) portInt;
-
- if (proxyDict)
- CFRelease(proxyDict);
-
- if (!result)
- {
- *host = 0;
- *port = 0;
- }
-
- return result;
-}
-
-} // end private namespace
-
-//------------------------------------------------------------------------------
-
-MacOSXLayer::MacOSXLayer( const uno::Reference<uno::XComponentContext>& xContext)
-{
- //Create instance of LayerContentDescriber Service
- rtl::OUString const k_sLayerDescriberService(
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.configuration.backend.LayerDescriber"));
-
- typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber;
- uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
- if( xServiceManager.is() )
- {
- m_xLayerContentDescriber = LayerDescriber::query(
- xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext));
- }
- else
- {
- OSL_TRACE("Could not retrieve ServiceManager");
- }
-
-}
-
-//------------------------------------------------------------------------------
-
-rtl::OUString CFStringToOUString(const CFStringRef sOrig) {
- CFRetain(sOrig);
-
- CFIndex nStringLen = CFStringGetLength(sOrig)+1;
-
- // Allocate a c string buffer
- char sBuffer[nStringLen];
-
- CFStringGetCString(sOrig, sBuffer, nStringLen, kCFStringEncodingASCII);
-
- CFRelease(sOrig);
-
- return rtl::OUString::createFromAscii((sal_Char*)sBuffer);
-}
-
-void SAL_CALL MacOSXLayer::readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException)
-{
-
- if (m_xLayerContentDescriber.is())
- {
- rtl::OUString aProxyBypassList;
-
- CFArrayRef rExceptionsList;
- CFDictionaryRef rProxyDict = SCDynamicStoreCopyProxies(NULL);
-
- if (!rProxyDict)
- rExceptionsList = false;
- else
- rExceptionsList = (CFArrayRef) CFDictionaryGetValue(rProxyDict, kSCPropNetProxiesExceptionsList);
-
- if (rExceptionsList)
- {
- for (CFIndex idx = 0; idx < CFArrayGetCount(rExceptionsList); idx++)
- {
- CFStringRef rException = (CFStringRef) CFArrayGetValueAtIndex(rExceptionsList, idx);
-
- if (idx>0)
- aProxyBypassList += rtl::OUString::createFromAscii( ";" );
-
- aProxyBypassList += CFStringToOUString(rException);
- }
- }
-
- if (rProxyDict)
- CFRelease(rProxyDict);
-
- // override default for ProxyType, which is "0" meaning "No proxies".
- // CAUTION: if you add properties, please increase the sequence size here !
- uno::Sequence<backend::PropertyInfo> aPropInfoList(8);
- sal_Int32 nProperties = 1;
-
- aPropInfoList[0].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetProxyType") );
- aPropInfoList[0].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "int" ) );
- aPropInfoList[0].Protected = sal_False;
- aPropInfoList[0].Value = uno::makeAny( nProperties );
-
- // fill proxy bypass list
- if( aProxyBypassList.getLength() > 0 )
- {
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetNoProxy") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( aProxyBypassList.replace( SPACE, SEMI_COLON ) );
- }
-
- ProxyEntry aHttpProxy;
- ProxyEntry aHttpsProxy;
- ProxyEntry aFtpProxy;
-
- char host[MAXHOSTNAMELEN];
- UInt16 port;
- bool retVal;
-
- retVal = GetProxySetting(sHTTP, host, 100, &port);
-
- if (retVal)
- {
- aHttpProxy.Server = rtl::OUString::createFromAscii( host );
- aHttpProxy.Port = port;
- }
-
- retVal = GetProxySetting(sHTTPS, host, 100, &port);
-
- if (retVal)
- {
- aHttpsProxy.Server = rtl::OUString::createFromAscii( host );
- aHttpsProxy.Port = port;
- }
-
- retVal = GetProxySetting(sFTP, host, 100, &port);
-
- if (retVal)
- {
- aFtpProxy.Server = rtl::OUString::createFromAscii( host );
- aFtpProxy.Port = port;
- }
-
- // http proxy name
- if( aHttpProxy.Server.getLength() > 0 )
- {
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPProxyName") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( aHttpProxy.Server );
- }
-
- // http proxy port
- if( aHttpProxy.Port > 0 )
- {
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPProxyPort") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "int" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( aHttpProxy.Port );
- }
-
- // https proxy name
- if( aHttpsProxy.Server.getLength() > 0 )
- {
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPSProxyName") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( aHttpsProxy.Server );
- }
-
- // https proxy port
- if( aHttpsProxy.Port > 0 )
- {
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPSProxyPort") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "int" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( aHttpsProxy.Port );
- }
-
- // ftp proxy name
- if( aFtpProxy.Server.getLength() > 0 )
- {
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetFTPProxyName") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( aFtpProxy.Server );
- }
-
- // ftp proxy port
- if( aFtpProxy.Port > 0 )
- {
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetFTPProxyPort") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "int" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( aFtpProxy.Port );
- }
-
- // resize the property info list appropriately
- aPropInfoList.realloc(nProperties);
-
- m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList);
- }
- else
- {
- OSL_TRACE("Could not create com.sun.star.configuration.backend.LayerContentDescriber Service");
- }
-}
-
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL MacOSXLayer::getTimestamp(void)
- throw (uno::RuntimeException)
-{
- // FIXME: Always new timestamp!?
- rtl::OUString aTimestamp = rtl::OUString::valueOf( time(NULL) );
-
- return aTimestamp;
-}
-
-//------------------------------------------------------------------------------
-
-rtl::OUString GetOUString( NSString* pStr )
-{
- if( ! pStr )
- return rtl::OUString();
- int nLen = [pStr length];
- if( nLen == 0 )
- return rtl::OUString();
-
- rtl::OUStringBuffer aBuf( nLen+1 );
- aBuf.setLength( nLen );
- [pStr getCharacters: const_cast<sal_Unicode*>(aBuf.getStr())];
- return aBuf.makeStringAndClear();
-}
-
-void SAL_CALL MacOSXPathLayer::readData(
- const uno::Reference<backend::XLayerHandler>& i_xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException)
-{
- if (m_xLayerContentDescriber.is())
- {
- rtl::OUString aDocDir;
- NSArray* pPaths = NSSearchPathForDirectoriesInDomains( NSDocumentDirectory, NSUserDomainMask, true );
- if( pPaths && [pPaths count] > 0 )
- {
- aDocDir = GetOUString( [pPaths objectAtIndex: 0] );
-
- rtl::OUString aDocURL;
- if( aDocDir.getLength() > 0 &&
- osl_getFileURLFromSystemPath( aDocDir.pData, &aDocURL.pData ) == osl_File_E_None )
- {
- uno::Sequence<backend::PropertyInfo> aPropInfoList(1);
-
- aPropInfoList[0].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Paths/Variables/Work" ) );
- aPropInfoList[0].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[0].Protected = sal_False;
- aPropInfoList[0].Value <<= aDocURL;
-
- m_xLayerContentDescriber->describeLayer(i_xHandler, aPropInfoList);
- }
- else
- {
- OSL_TRACE( "user documents list contains empty file path or conversion failed" );
- }
- }
- else
- {
- OSL_TRACE( "Got nil or empty list of user document directories" );
- }
- }
- else
- {
- OSL_TRACE("Could not create com.sun.star.configuration.backend.LayerContentDescriber Service");
- }
-}
-
diff --git a/shell/source/backends/macbe/macbelayer.hxx b/shell/source/backends/macbe/macbelayer.hxx
deleted file mode 100644
index fa4d7ab2db..0000000000
--- a/shell/source/backends/macbe/macbelayer.hxx
+++ /dev/null
@@ -1,101 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _MACBELAYER_HXX_
-#define _MACBELAYER_HXX_
-
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
-#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
-
-#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#endif
-#include <com/sun/star/util/XTimeStamped.hpp>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <cppuhelper/implbase2.hxx>
-
-namespace css = com::sun::star;
-namespace uno = css::uno;
-namespace lang = css::lang;
-namespace backend = css::configuration::backend;
-namespace util = css::util;
-
-/**
- Implementation of the XLayer interfaces for fixed values
- */
-
-class MacOSXLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped>
-{
-public:
-
- /**
- Constructor given the requested component name
-
- @param aTimestamp timestamp indicating last modifictaion
- */
- MacOSXLayer(const uno::Reference<uno::XComponentContext>& xContext);
-
- /** Destructor */
- virtual ~MacOSXLayer(void) {}
-
- // XLayer
- virtual void SAL_CALL readData(const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException);
-
- // XTimeStamped
- virtual rtl::OUString SAL_CALL getTimestamp(void)
- throw (uno::RuntimeException);
-
-protected:
-
- rtl::OUString m_aComponent;
-
- uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber;
-
-};
-
-class MacOSXPathLayer : public MacOSXLayer
-{
- public:
- MacOSXPathLayer(const uno::Reference<uno::XComponentContext>& i_xContext) :
- MacOSXLayer( i_xContext ) {}
- virtual ~MacOSXPathLayer() {}
-
- // XLayer
- virtual void SAL_CALL readData(const uno::Reference<backend::XLayerHandler>& i_xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException);
-};
-
-#endif // _MACBELAYER_HXX_
diff --git a/shell/source/backends/macbe/makefile.mk b/shell/source/backends/macbe/makefile.mk
index 1d5d68a1f6..c3a58ec9f5 100644
--- a/shell/source/backends/macbe/makefile.mk
+++ b/shell/source/backends/macbe/makefile.mk
@@ -54,8 +54,7 @@ CFLAGSCXX+=$(OBJCXXFLAGS)
SLOFILES= \
$(SLO)$/macbecdef.obj \
- $(SLO)$/macbackend.obj \
- $(SLO)$/macbelayer.obj
+ $(SLO)$/macbackend.obj
SHL1TARGET=$(TARGET)1.uno
SHL1OBJS=$(SLOFILES)
@@ -68,7 +67,7 @@ SHL1STDLIBS= \
$(SALLIB) \
-framework Cocoa -framework SystemConfiguration
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
diff --git a/shell/source/backends/wininetbe/exports.map b/shell/source/backends/wininetbe/exports.map
deleted file mode 100644
index ba501f9ae0..0000000000
--- a/shell/source/backends/wininetbe/exports.map
+++ /dev/null
@@ -1,10 +0,0 @@
-UDK_3_0_0 {
- global:
- GetVersionInfo;
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/shell/source/backends/wininetbe/makefile.mk b/shell/source/backends/wininetbe/makefile.mk
index fd87b92684..9f79fa706f 100644
--- a/shell/source/backends/wininetbe/makefile.mk
+++ b/shell/source/backends/wininetbe/makefile.mk
@@ -46,9 +46,8 @@ DLLPRE =
SLOFILES=\
$(SLO)$/wininetbecdef.obj \
- $(SLO)$/wininetbackend.obj \
- $(SLO)$/wininetlayer.obj
-
+ $(SLO)$/wininetbackend.obj
+
SHL1TARGET=$(TARGET)1.uno
SHL1OBJS=$(SLOFILES)
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
@@ -59,7 +58,7 @@ SHL1STDLIBS= \
$(CPPULIB) \
$(SALLIB)
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
diff --git a/shell/source/backends/wininetbe/wininetbackend.cxx b/shell/source/backends/wininetbe/wininetbackend.cxx
index 892f0b7173..c62ff6ffe1 100644
--- a/shell/source/backends/wininetbe/wininetbackend.cxx
+++ b/shell/source/backends/wininetbe/wininetbackend.cxx
@@ -28,76 +28,332 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_shell.hxx"
+#include "rtl/ustrbuf.hxx"
+
#include "wininetbackend.hxx"
-#include "wininetlayer.hxx"
-#include <com/sun/star/configuration/backend/ComponentChangeEvent.hpp>
-#include <uno/current_context.hxx>
+
+#if defined _MSC_VER
+#pragma warning(push, 1)
+#endif
+#include <windows.h>
+#include <wininet.h>
+#include <sal/alloca.h>
+#if defined _MSC_VER
+#pragma warning(pop)
+#endif
#define WININET_DLL_NAME "wininet.dll"
+#define EQUAL_SIGN '='
+#define COLON ':'
+#define SPACE ' '
+#define SEMI_COLON ';'
+
+namespace {
+
+struct Library {
+ HMODULE module;
+
+ Library(HMODULE theModule): module(theModule) {}
+
+ ~Library() { if (module) FreeLibrary(module); }
+};
+
+}
+
+typedef struct
+{
+ rtl::OUString Server;
+ rtl::OUString Port;
+} ProxyEntry;
+
+//------------------------------------------------------------------------
+// helper functions
+//------------------------------------------------------------------------
+
+namespace // private
+{
+ ProxyEntry ReadProxyEntry(const rtl::OUString& aProxy, sal_Int32& i)
+ {
+ ProxyEntry aProxyEntry;
+
+ aProxyEntry.Server = aProxy.getToken( 0, COLON, i );
+ if ( i > -1 )
+ aProxyEntry.Port = aProxy.getToken( 0, COLON, i );
+
+ return aProxyEntry;
+ }
+
+ ProxyEntry FindProxyEntry(const rtl::OUString& aProxyList, const rtl::OUString& aType)
+ {
+ sal_Int32 nIndex = 0;
+
+ do
+ {
+ // get the next token, e.g. ftp=server:port
+ rtl::OUString nextToken = aProxyList.getToken( 0, SPACE, nIndex );
+
+ // split the next token again into the parts separated
+ // through '=', e.g. ftp=server:port -> ftp and server:port
+ sal_Int32 i = 0;
+ if( nextToken.indexOf( EQUAL_SIGN ) > -1 )
+ {
+ if( aType.equals( nextToken.getToken( 0, EQUAL_SIGN, i ) ) )
+ return ReadProxyEntry(nextToken, i);
+ }
+ else if( aType.getLength() == 0)
+ return ReadProxyEntry(nextToken, i);
+
+ } while ( nIndex >= 0 );
+
+ return ProxyEntry();
+ }
+
+} // end private namespace
+
+//------------------------------------------------------------------------------
-WinInetBackend::WinInetBackend(const uno::Reference<uno::XComponentContext>& xContext)
- throw (backend::BackendAccessException) :
- ::cppu::WeakImplHelper2 < backend::XSingleLayerStratum, lang::XServiceInfo > (),
- m_xContext(xContext)
+WinInetBackend::WinInetBackend()
{
- m_hWinInetDll = LoadLibrary( WININET_DLL_NAME );
+ Library hWinInetDll( LoadLibrary( WININET_DLL_NAME ) );
+ if( hWinInetDll.module )
+ {
+ typedef BOOL ( WINAPI *InternetQueryOption_Proc_T )( HINTERNET, DWORD, LPVOID, LPDWORD );
+
+ InternetQueryOption_Proc_T lpfnInternetQueryOption =
+ reinterpret_cast< InternetQueryOption_Proc_T >(
+ GetProcAddress( hWinInetDll.module, "InternetQueryOptionA" ) );
+ if (lpfnInternetQueryOption)
+ {
+ LPINTERNET_PROXY_INFO lpi = NULL;
+
+ // query for the neccessary space
+ DWORD dwLength = 0;
+ BOOL bRet = lpfnInternetQueryOption(
+ NULL,
+ INTERNET_OPTION_PROXY,
+ (LPVOID)lpi,
+ &dwLength );
+
+ // allocate sufficient space on the heap
+ // insufficient space on the heap results
+ // in a stack overflow exception, we assume
+ // this never happens, because of the relatively
+ // small amount of memory we need
+ // alloca is nice because it is fast and we don't
+ // have to free the allocated memory, it will be
+ // automatically done
+ lpi = reinterpret_cast< LPINTERNET_PROXY_INFO >(
+ alloca( dwLength ) );
+
+ bRet = lpfnInternetQueryOption(
+ NULL,
+ INTERNET_OPTION_PROXY,
+ (LPVOID)lpi,
+ &dwLength );
+
+ // if a proxy is disabled, InternetQueryOption returns
+ // an empty proxy list, so we don't have to check if
+ // proxy is enabled or not
+
+ rtl::OUString aProxyList = rtl::OUString::createFromAscii( lpi->lpszProxy );
+ rtl::OUString aProxyBypassList = rtl::OUString::createFromAscii( lpi->lpszProxyBypass );
+
+ // override default for ProxyType, which is "0" meaning "No proxies".
+ sal_Int32 nProperties = 1;
+
+ valueProxyType_.IsPresent = true;
+ valueProxyType_.Value <<= nProperties;
+
+ // fill proxy bypass list
+ if( aProxyBypassList.getLength() > 0 )
+ {
+ rtl::OUStringBuffer aReverseList;
+ sal_Int32 nIndex = 0;
+ do
+ {
+ rtl::OUString aToken = aProxyBypassList.getToken( 0, SPACE, nIndex );
+ if ( aProxyList.indexOf( aToken ) == -1 )
+ {
+ if ( aReverseList.getLength() )
+ {
+ aReverseList.insert( 0, sal_Unicode( SEMI_COLON ) );
+ aReverseList.insert( 0, aToken );
+ }
+ else
+ aReverseList = aToken;
+ }
+ }
+ while ( nIndex >= 0 );
+
+ aProxyBypassList = aReverseList.makeStringAndClear();
+
+ valueNoProxy_.IsPresent = true;
+ valueNoProxy_.Value <<= aProxyBypassList.replace( SPACE, SEMI_COLON );
+ }
+
+ if( aProxyList.getLength() > 0 )
+ {
+ //-------------------------------------------------
+ // this implementation follows the algorithm
+ // of the internet explorer
+ // if there are type-dependent proxy settings
+ // and type independent proxy settings in the
+ // registry the internet explorer chooses the
+ // type independent proxy for all settings
+ // e.g. imagine the following registry entry
+ // ftp=server:port;http=server:port;server:port
+ // the last token server:port is type independent
+ // so the ie chooses this proxy server
+
+ // if there is no port specified for a type independent
+ // server the ie uses the port of an http server if
+ // there is one and it has a port
+ //-------------------------------------------------
+
+ ProxyEntry aTypeIndepProxy = FindProxyEntry( aProxyList, rtl::OUString());
+ ProxyEntry aHttpProxy = FindProxyEntry( aProxyList, rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "http" ) ) );
+ ProxyEntry aHttpsProxy = FindProxyEntry( aProxyList, rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "https" ) ) );
+
+ ProxyEntry aFtpProxy = FindProxyEntry( aProxyList, rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "ftp" ) ) );
+
+ if( aTypeIndepProxy.Server.getLength() )
+ {
+ aHttpProxy.Server = aTypeIndepProxy.Server;
+ aHttpsProxy.Server = aTypeIndepProxy.Server;
+ aFtpProxy.Server = aTypeIndepProxy.Server;
+
+ if( aTypeIndepProxy.Port.getLength() )
+ {
+ aHttpProxy.Port = aTypeIndepProxy.Port;
+ aHttpsProxy.Port = aTypeIndepProxy.Port;
+ aFtpProxy.Port = aTypeIndepProxy.Port;
+ }
+ else
+ {
+ aFtpProxy.Port = aHttpProxy.Port;
+ aHttpsProxy.Port = aHttpProxy.Port;
+ }
+ }
+
+ // http proxy name
+ if( aHttpProxy.Server.getLength() > 0 )
+ {
+ valueHttpProxyName_.IsPresent = true;
+ valueHttpProxyName_.Value <<= aHttpProxy.Server;
+ }
+
+ // http proxy port
+ if( aHttpProxy.Port.getLength() > 0 )
+ {
+ valueHttpProxyPort_.IsPresent = true;
+ valueHttpProxyPort_.Value <<= aHttpProxy.Port.toInt32();
+ }
+
+ // https proxy name
+ if( aHttpsProxy.Server.getLength() > 0 )
+ {
+ valueHttpsProxyName_.IsPresent = true;
+ valueHttpsProxyName_.Value <<= aHttpsProxy.Server;
+ }
+
+ // https proxy port
+ if( aHttpsProxy.Port.getLength() > 0 )
+ {
+ valueHttpsProxyPort_.IsPresent = true;
+ valueHttpsProxyPort_.Value <<= aHttpsProxy.Port.toInt32();
+ }
+
+ // ftp proxy name
+ if( aFtpProxy.Server.getLength() > 0 )
+ {
+ valueFtpProxyName_.IsPresent = true;
+ valueFtpProxyName_.Value <<= aFtpProxy.Server;
+ }
+
+ // ftp proxy port
+ if( aFtpProxy.Port.getLength() > 0 )
+ {
+ valueFtpProxyPort_.IsPresent = true;
+ valueFtpProxyPort_.Value <<= aFtpProxy.Port.toInt32();
+ }
+ }
+ }
+ }
}
//------------------------------------------------------------------------------
WinInetBackend::~WinInetBackend(void)
{
- if ( m_hWinInetDll )
- FreeLibrary( m_hWinInetDll );
}
//------------------------------------------------------------------------------
-WinInetBackend* WinInetBackend::createInstance(
- const uno::Reference<uno::XComponentContext>& xContext
-)
+WinInetBackend* WinInetBackend::createInstance()
{
- return new WinInetBackend(xContext);
+ return new WinInetBackend;
}
// ---------------------------------------------------------------------------------------
-uno::Reference<backend::XLayer> SAL_CALL WinInetBackend::getLayer(
- const rtl::OUString& aComponent, const rtl::OUString& /*aTimestamp*/)
- throw (backend::BackendAccessException, lang::IllegalArgumentException)
+void WinInetBackend::setPropertyValue(
+ rtl::OUString const &, css::uno::Any const &)
+ throw (
+ css::beans::UnknownPropertyException, css::beans::PropertyVetoException,
+ css::lang::IllegalArgumentException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
{
+ throw css::lang::IllegalArgumentException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("setPropertyValue not supported")),
+ static_cast< cppu::OWeakObject * >(this), -1);
+}
- if( aComponent.equals( getSupportedComponents()[0]) )
+css::uno::Any WinInetBackend::getPropertyValue(
+ rtl::OUString const & PropertyName)
+ throw (
+ css::beans::UnknownPropertyException, css::lang::WrappedTargetException,
+ css::uno::RuntimeException)
+{
+ if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyName")))
{
- if( ! m_xSystemLayer.is() && m_hWinInetDll )
- {
- WinInetLayer::InternetQueryOption_Proc_T lpfnInternetQueryOption =
- reinterpret_cast< WinInetLayer::InternetQueryOption_Proc_T >(
- GetProcAddress( m_hWinInetDll, "InternetQueryOptionA" ) );
-
- if( lpfnInternetQueryOption )
- m_xSystemLayer = new WinInetLayer(lpfnInternetQueryOption, m_xContext);
- }
-
- return m_xSystemLayer;
+ return css::uno::makeAny(valueFtpProxyName_);
+ } else if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetFTPProxyPort")))
+ {
+ return css::uno::makeAny(valueFtpProxyPort_);
+ } else if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyName")))
+ {
+ return css::uno::makeAny(valueHttpProxyName_);
+ } else if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPProxyPort")))
+ {
+ return css::uno::makeAny(valueHttpProxyPort_);
+ } else if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyName")))
+ {
+ return css::uno::makeAny(valueHttpsProxyName_);
+ } else if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetHTTPSProxyPort")))
+ {
+ return css::uno::makeAny(valueHttpsProxyPort_);
+ } else if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetNoProxy")))
+ {
+ return css::uno::makeAny(valueNoProxy_);
+ } else if (PropertyName.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("ooInetProxyType")))
+ {
+ return css::uno::makeAny(valueProxyType_);
+ } else {
+ throw css::beans::UnknownPropertyException(
+ PropertyName, static_cast< cppu::OWeakObject * >(this));
}
-
- return uno::Reference<backend::XLayer>();
-}
-
-//------------------------------------------------------------------------------
-
-uno::Reference<backend::XUpdatableLayer> SAL_CALL
-WinInetBackend::getUpdatableLayer(const rtl::OUString& /*aComponent*/)
- throw (backend::BackendAccessException,lang::NoSupportException,
- lang::IllegalArgumentException)
-{
- throw lang::NoSupportException(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "WinInetBackend: No Update Operation allowed, Read Only access") ),
- *this) ;
-
- return NULL;
}
//------------------------------------------------------------------------------
@@ -118,10 +374,9 @@ rtl::OUString SAL_CALL WinInetBackend::getImplementationName(void)
uno::Sequence<rtl::OUString> SAL_CALL WinInetBackend::getBackendServiceNames(void)
{
- uno::Sequence<rtl::OUString> aServiceNameList(2);
+ uno::Sequence<rtl::OUString> aServiceNameList(1);
aServiceNameList[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.WinInetBackend")) ;
- aServiceNameList[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.PlatformBackend")) ;
-
+
return aServiceNameList ;
}
@@ -146,16 +401,3 @@ uno::Sequence<rtl::OUString> SAL_CALL WinInetBackend::getSupportedServiceNames(v
{
return getBackendServiceNames() ;
}
-
-// ---------------------------------------------------------------------------------------
-
-uno::Sequence<rtl::OUString> SAL_CALL WinInetBackend::getSupportedComponents(void)
-{
- uno::Sequence<rtl::OUString> aSupportedComponentList(1);
- aSupportedComponentList[0] = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet" )
- );
-
- return aSupportedComponentList;
-}
-
diff --git a/shell/source/backends/wininetbe/wininetbackend.hxx b/shell/source/backends/wininetbe/wininetbackend.hxx
index ae0fb5fc4e..711cde7151 100644
--- a/shell/source/backends/wininetbe/wininetbackend.hxx
+++ b/shell/source/backends/wininetbe/wininetbackend.hxx
@@ -28,38 +28,23 @@
#ifndef _FIXEDVALUEBACKEND_HXX_
#define _FIXEDVALUEBACKEND_HXX_
-#include <com/sun/star/configuration/backend/XSingleLayerStratum.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/beans/Optional.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/configuration/backend/XBackendChangesNotifier.hpp>
#include <cppuhelper/implbase2.hxx>
#include <rtl/string.hxx>
-#if defined _MSC_VER
-#pragma warning(push, 1)
-#endif
-#include <windows.h>
-#include <wininet.h>
-#if defined _MSC_VER
-#pragma warning(pop)
-#endif
-
namespace css = com::sun::star ;
namespace uno = css::uno ;
namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-
-/**
- Implements the SingleLayerStratum service.
- */
class WinInetBackend : public ::cppu::WeakImplHelper2 <
- backend::XSingleLayerStratum,
+ css::beans::XPropertySet,
lang::XServiceInfo > {
public :
- static WinInetBackend* createInstance(const uno::Reference<uno::XComponentContext>& xContext);
+ static WinInetBackend* createInstance();
// XServiceInfo
virtual rtl::OUString SAL_CALL
@@ -86,43 +71,86 @@ class WinInetBackend : public ::cppu::WeakImplHelper2 <
@return service names
*/
static uno::Sequence<rtl::OUString> SAL_CALL getBackendServiceNames(void) ;
- /**
- Provides the supported component nodes
-
- @return supported component nodes
- */
- static uno::Sequence<rtl::OUString> SAL_CALL getSupportedComponents(void) ;
-
- //XSingleLayerStratum
- virtual uno::Reference<backend::XLayer> SAL_CALL
- getLayer( const rtl::OUString& aLayerId, const rtl::OUString& aTimestamp )
- throw (backend::BackendAccessException,
- lang::IllegalArgumentException) ;
-
- virtual uno::Reference<backend::XUpdatableLayer> SAL_CALL
- getUpdatableLayer( const rtl::OUString& aLayerId )
- throw (backend::BackendAccessException,
- lang::NoSupportException,
- lang::IllegalArgumentException) ;
+
+ // XPropertySet
+ virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
+ getPropertySetInfo() throw (css::uno::RuntimeException)
+ { return css::uno::Reference< css::beans::XPropertySetInfo >(); }
+
+ virtual void SAL_CALL setPropertyValue(
+ rtl::OUString const &, css::uno::Any const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::beans::PropertyVetoException,
+ css::lang::IllegalArgumentException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException);
+
+ virtual css::uno::Any SAL_CALL getPropertyValue(
+ rtl::OUString const & PropertyName)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException);
+
+ virtual void SAL_CALL addPropertyChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XPropertyChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
+ virtual void SAL_CALL removePropertyChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XPropertyChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
+ virtual void SAL_CALL addVetoableChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XVetoableChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
+ virtual void SAL_CALL removeVetoableChangeListener(
+ rtl::OUString const &,
+ css::uno::Reference< css::beans::XVetoableChangeListener > const &)
+ throw (
+ css::beans::UnknownPropertyException,
+ css::lang::WrappedTargetException, css::uno::RuntimeException)
+ {}
+
protected:
/**
Service constructor from a service factory.
@param xContext component context
*/
- WinInetBackend(const uno::Reference<uno::XComponentContext>& xContext)
- throw (backend::BackendAccessException);
+ WinInetBackend();
/** Destructor */
~WinInetBackend(void) ;
private:
-
- uno::Reference<uno::XComponentContext> m_xContext ;
- uno::Reference<backend::XLayer> m_xSystemLayer ;
-
- // The wininet.dll module handle
- HMODULE m_hWinInetDll;
+ com::sun::star::beans::Optional< com::sun::star::uno::Any >
+ valueProxyType_;
+ com::sun::star::beans::Optional< com::sun::star::uno::Any >
+ valueNoProxy_;
+ com::sun::star::beans::Optional< com::sun::star::uno::Any >
+ valueHttpProxyName_;
+ com::sun::star::beans::Optional< com::sun::star::uno::Any >
+ valueHttpProxyPort_;
+ com::sun::star::beans::Optional< com::sun::star::uno::Any >
+ valueHttpsProxyName_;
+ com::sun::star::beans::Optional< com::sun::star::uno::Any >
+ valueHttpsProxyPort_;
+ com::sun::star::beans::Optional< com::sun::star::uno::Any >
+ valueFtpProxyName_;
+ com::sun::star::beans::Optional< com::sun::star::uno::Any >
+ valueFtpProxyPort_;
} ;
diff --git a/shell/source/backends/wininetbe/wininetbe.xml b/shell/source/backends/wininetbe/wininetbe.xml
index 0f84d3a43d..070ac5111a 100644
--- a/shell/source/backends/wininetbe/wininetbe.xml
+++ b/shell/source/backends/wininetbe/wininetbe.xml
@@ -10,7 +10,6 @@
<language>c++</language>
<status value="beta"/>
<supported-service>com.sun.star.comp.configuration.backend.Win32Backend</supported-service>
- <supported-service>com.sun.star.comp.configuration.backend.PlatformBackend</supported-service>
<service-dependency>...</service-dependency>
<type>com.sun.star.configuration.backend.XBackendChangesListener</type>
<type>com.sun.star.configuration.backend.XBackendChangesNotifier</type>
diff --git a/shell/source/backends/wininetbe/wininetbecdef.cxx b/shell/source/backends/wininetbe/wininetbecdef.cxx
index 391e34313e..7ecdbecf32 100644
--- a/shell/source/backends/wininetbe/wininetbecdef.cxx
+++ b/shell/source/backends/wininetbe/wininetbecdef.cxx
@@ -39,14 +39,13 @@
namespace css = com::sun::star ;
namespace uno = css::uno ;
namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
//------------------------------------------------------------------------------
static uno::Reference<uno::XInterface> SAL_CALL createWinInetBackend(
- const uno::Reference<uno::XComponentContext>& xContext){
+ const uno::Reference<uno::XComponentContext>&){
- return * WinInetBackend::createInstance(xContext);
+ return * WinInetBackend::createInstance();
}
//------------------------------------------------------------------------------
@@ -74,41 +73,9 @@ extern "C" void SAL_CALL component_getImplementationEnvironment(
//------------------------------------------------------------------------------
-extern "C" sal_Bool SAL_CALL component_writeInfo(void * /*pServiceManager*/, void *pRegistryKey) {
-
- using namespace ::com::sun::star::registry;
- if (pRegistryKey)
- {
- try
- {
- uno::Reference< XRegistryKey > xImplKey = static_cast< XRegistryKey* >( pRegistryKey )->createKey(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + WinInetBackend::getBackendName()
- );
-
- // Register associated service names
- uno::Reference< XRegistryKey > xServicesKey = xImplKey->createKey(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES") )
- );
-
- uno::Sequence<rtl::OUString> sServiceNames = WinInetBackend::getBackendServiceNames();
- for (sal_Int32 i = 0 ; i < sServiceNames.getLength() ; ++ i)
- xServicesKey->createKey(sServiceNames[i]);
-
- // Register supported components
- uno::Reference<XRegistryKey> xComponentKey = xImplKey->createKey(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/DATA/SupportedComponents") )
- );
-
- xComponentKey->setAsciiListValue( WinInetBackend::getSupportedComponents() );
-
- return sal_True;
- }
- catch( InvalidRegistryException& )
- {
- OSL_ENSURE(sal_False, "InvalidRegistryException caught");
- }
- }
- return sal_False;
+extern "C" sal_Bool SAL_CALL component_writeInfo(void * pServiceManager, void *pRegistryKey) {
+ return cppu::component_writeInfoHelper(
+ pServiceManager, pRegistryKey, kImplementations_entries);
}
//------------------------------------------------------------------------------
diff --git a/shell/source/backends/wininetbe/wininetlayer.cxx b/shell/source/backends/wininetbe/wininetlayer.cxx
deleted file mode 100644
index 4da27fadd9..0000000000
--- a/shell/source/backends/wininetbe/wininetlayer.cxx
+++ /dev/null
@@ -1,374 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_shell.hxx"
-
-#ifndef _WININETLAYER_HXX_
-#include "wininetlayer.hxx"
-#endif
-
-#include <malloc.h>
-
-#include <rtl/ustrbuf.hxx>
-
-#define EQUAL_SIGN '='
-#define COLON ':'
-#define SPACE ' '
-#define SEMI_COLON ';'
-
-typedef struct
-{
- rtl::OUString Server;
- rtl::OUString Port;
-} ProxyEntry;
-
-//------------------------------------------------------------------------
-// helper functions
-//------------------------------------------------------------------------
-
-namespace // private
-{
- ProxyEntry ReadProxyEntry(const rtl::OUString& aProxy, sal_Int32& i)
- {
- ProxyEntry aProxyEntry;
-
- aProxyEntry.Server = aProxy.getToken( 0, COLON, i );
- if ( i > -1 )
- aProxyEntry.Port = aProxy.getToken( 0, COLON, i );
-
- return aProxyEntry;
- }
-
- ProxyEntry FindProxyEntry(const rtl::OUString& aProxyList, const rtl::OUString& aType)
- {
- sal_Int32 nIndex = 0;
-
- do
- {
- // get the next token, e.g. ftp=server:port
- rtl::OUString nextToken = aProxyList.getToken( 0, SPACE, nIndex );
-
- // split the next token again into the parts separated
- // through '=', e.g. ftp=server:port -> ftp and server:port
- sal_Int32 i = 0;
- if( nextToken.indexOf( EQUAL_SIGN ) > -1 )
- {
- if( aType.equals( nextToken.getToken( 0, EQUAL_SIGN, i ) ) )
- return ReadProxyEntry(nextToken, i);
- }
- else if( aType.getLength() == 0)
- return ReadProxyEntry(nextToken, i);
-
- } while ( nIndex >= 0 );
-
- return ProxyEntry();
- }
-
-} // end private namespace
-
-//------------------------------------------------------------------------------
-
-WinInetLayer::WinInetLayer( InternetQueryOption_Proc_T lpfnInternetQueryOption,
- const uno::Reference<uno::XComponentContext>& xContext)
- : m_lpfnInternetQueryOption(lpfnInternetQueryOption)
-{
- //Create instance of LayerContentDescriber Service
- rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.comp.configuration.backend.LayerDescriber"));
-
- typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber;
- uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
- if( xServiceManager.is() )
- {
- m_xLayerContentDescriber = LayerDescriber::query(
- xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext));
- }
- else
- {
- OSL_TRACE("Could not retrieve ServiceManager");
- }
-
-}
-
-//------------------------------------------------------------------------------
-
-void SAL_CALL WinInetLayer::readData(
- const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException)
-{
-
- if (m_xLayerContentDescriber.is() && m_lpfnInternetQueryOption)
- {
- LPINTERNET_PROXY_INFO lpi = NULL;
-
- // query for the neccessary space
- DWORD dwLength = 0;
- BOOL bRet = m_lpfnInternetQueryOption(
- NULL,
- INTERNET_OPTION_PROXY,
- (LPVOID)lpi,
- &dwLength );
-
- // allocate sufficient space on the heap
- // insufficient space on the heap results
- // in a stack overflow exception, we assume
- // this never happens, because of the relatively
- // small amount of memory we need
- // _alloca is nice because it is fast and we don't
- // have to free the allocated memory, it will be
- // automatically done
- lpi = reinterpret_cast< LPINTERNET_PROXY_INFO >(
- _alloca( dwLength ) );
-
- bRet = m_lpfnInternetQueryOption(
- NULL,
- INTERNET_OPTION_PROXY,
- (LPVOID)lpi,
- &dwLength );
-
- // if a proxy is disabled, InternetQueryOption returns
- // an empty proxy list, so we don't have to check if
- // proxy is enabled or not
-
- rtl::OUString aProxyList = rtl::OUString::createFromAscii( lpi->lpszProxy );
- rtl::OUString aProxyBypassList = rtl::OUString::createFromAscii( lpi->lpszProxyBypass );
-
- // override default for ProxyType, which is "0" meaning "No proxies".
- uno::Sequence<backend::PropertyInfo> aPropInfoList(8);
- sal_Int32 nProperties = 1;
-
- aPropInfoList[0].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetProxyType") );
- aPropInfoList[0].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "int" ) );
- aPropInfoList[0].Protected = sal_False;
- aPropInfoList[0].Value = uno::makeAny( nProperties );
-
- // fill proxy bypass list
- if( aProxyBypassList.getLength() > 0 )
- {
- rtl::OUStringBuffer aReverseList;
- sal_Int32 nIndex = 0;
- do
- {
- rtl::OUString aToken = aProxyBypassList.getToken( 0, SPACE, nIndex );
- if ( aProxyList.indexOf( aToken ) == -1 )
- {
- if ( aReverseList.getLength() )
- {
- aReverseList.insert( 0, sal_Unicode( SEMI_COLON ) );
- aReverseList.insert( 0, aToken );
- }
- else
- aReverseList = aToken;
- }
- }
- while ( nIndex >= 0 );
-
- aProxyBypassList = aReverseList.makeStringAndClear();
-
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetNoProxy") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( aProxyBypassList.replace( SPACE, SEMI_COLON ) );
- }
-
- if( aProxyList.getLength() > 0 )
- {
- //-------------------------------------------------
- // this implementation follows the algorithm
- // of the internet explorer
- // if there are type-dependent proxy settings
- // and type independent proxy settings in the
- // registry the internet explorer chooses the
- // type independent proxy for all settings
- // e.g. imagine the following registry entry
- // ftp=server:port;http=server:port;server:port
- // the last token server:port is type independent
- // so the ie chooses this proxy server
-
- // if there is no port specified for a type independent
- // server the ie uses the port of an http server if
- // there is one and it has a port
- //-------------------------------------------------
-
- ProxyEntry aTypeIndepProxy = FindProxyEntry( aProxyList, rtl::OUString());
- ProxyEntry aHttpProxy = FindProxyEntry( aProxyList, rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "http" ) ) );
- ProxyEntry aHttpsProxy = FindProxyEntry( aProxyList, rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "https" ) ) );
-
- ProxyEntry aFtpProxy = FindProxyEntry( aProxyList, rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "ftp" ) ) );
-
- if( aTypeIndepProxy.Server.getLength() )
- {
- aHttpProxy.Server = aTypeIndepProxy.Server;
- aHttpsProxy.Server = aTypeIndepProxy.Server;
- aFtpProxy.Server = aTypeIndepProxy.Server;
-
- if( aTypeIndepProxy.Port.getLength() )
- {
- aHttpProxy.Port = aTypeIndepProxy.Port;
- aHttpsProxy.Port = aTypeIndepProxy.Port;
- aFtpProxy.Port = aTypeIndepProxy.Port;
- }
- else
- {
- aFtpProxy.Port = aHttpProxy.Port;
- aHttpsProxy.Port = aHttpProxy.Port;
- }
- }
-
- // http proxy name
- if( aHttpProxy.Server.getLength() > 0 )
- {
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPProxyName") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( aHttpProxy.Server );
- }
-
- // http proxy port
- if( aHttpProxy.Port.getLength() > 0 )
- {
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPProxyPort") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "int" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( aHttpProxy.Port.toInt32() );
- }
-
- // https proxy name
- if( aHttpsProxy.Server.getLength() > 0 )
- {
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPSProxyName") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( aHttpsProxy.Server );
- }
-
- // https proxy port
- if( aHttpsProxy.Port.getLength() > 0 )
- {
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPSProxyPort") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "int" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( aHttpsProxy.Port.toInt32() );
- }
-
- // ftp proxy name
- if( aFtpProxy.Server.getLength() > 0 )
- {
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetFTPProxyName") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "string" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( aFtpProxy.Server );
- }
-
- // ftp proxy port
- if( aFtpProxy.Port.getLength() > 0 )
- {
- aPropInfoList[nProperties].Name = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetFTPProxyPort") );
- aPropInfoList[nProperties].Type = rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "int" ) );
- aPropInfoList[nProperties].Protected = sal_False;
- aPropInfoList[nProperties++].Value = uno::makeAny( aFtpProxy.Port.toInt32() );
- }
- }
-
- // resize the property info list appropriately
- aPropInfoList.realloc(nProperties);
-
- m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList);
- }
- else
- {
- OSL_TRACE("Could not create com.sun.star.configuration.backend.LayerContentDescriber Service");
- }
-}
-
-//------------------------------------------------------------------------------
-
-rtl::OUString SAL_CALL WinInetLayer::getTimestamp(void)
- throw (uno::RuntimeException)
-{
- rtl::OUString aTimestamp;
-
- if (m_lpfnInternetQueryOption)
- {
- LPINTERNET_PROXY_INFO lpi = NULL;
-
- // query for the neccessary space
- DWORD dwLength = 0;
- BOOL bRet = m_lpfnInternetQueryOption(
- NULL,
- INTERNET_OPTION_PROXY,
- (LPVOID)lpi,
- &dwLength );
-
- // allocate sufficient space on the heap
- // insufficient space on the heap results
- // in a stack overflow exception, we assume
- // this never happens, because of the relatively
- // small amount of memory we need
- // _alloca is nice because it is fast and we don't
- // have to free the allocated memory, it will be
- // automatically done
- lpi = reinterpret_cast< LPINTERNET_PROXY_INFO >(
- _alloca( dwLength ) );
-
- bRet = m_lpfnInternetQueryOption(
- NULL,
- INTERNET_OPTION_PROXY,
- (LPVOID)lpi,
- &dwLength );
-
- aTimestamp = rtl::OUString::createFromAscii( lpi->lpszProxy );
- aTimestamp += rtl::OUString::createFromAscii( lpi->lpszProxyBypass );
- }
-
- return aTimestamp;
-}
-
-//------------------------------------------------------------------------------
diff --git a/shell/source/backends/wininetbe/wininetlayer.hxx b/shell/source/backends/wininetbe/wininetlayer.hxx
deleted file mode 100644
index 540433362c..0000000000
--- a/shell/source/backends/wininetbe/wininetlayer.hxx
+++ /dev/null
@@ -1,73 +0,0 @@
-#ifndef _WinInetLayer_HXX_
-#define _WinInetLayer_HXX_
-
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/configuration/backend/XLayer.hpp>
-#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
-#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
-
-#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
-#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
-#endif
-#include <com/sun/star/util/XTimeStamped.hpp>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <cppuhelper/implbase2.hxx>
-
-#if defined _MSC_VER
-#pragma warning(push, 1)
-#endif
-#include <windows.h>
-#include <wininet.h>
-#if defined _MSC_VER
-#pragma warning(pop)
-#endif
-
-namespace css = com::sun::star ;
-namespace uno = css::uno ;
-namespace lang = css::lang ;
-namespace backend = css::configuration::backend ;
-namespace util = css::util ;
-
-/**
- Implementation of the XLayer interfaces for fixed values
- */
-
-class WinInetLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped>
-{
- public :
- typedef BOOL ( WINAPI *InternetQueryOption_Proc_T )( HINTERNET, DWORD, LPVOID, LPDWORD );
-
- /**
- Constructor given the requested component name
-
- @param lpfnInternetQueryOption function pointer into wininet.dll
- @param aTimestamp timestamp indicating last modifictaion
- */
- WinInetLayer(InternetQueryOption_Proc_T lpfnInternetQueryOption,
- const uno::Reference<uno::XComponentContext>& xContext);
-
- /** Destructor */
- ~WinInetLayer(void) {}
-
- // XLayer
- virtual void SAL_CALL readData(const uno::Reference<backend::XLayerHandler>& xHandler)
- throw ( backend::MalformedDataException,
- lang::NullPointerException,
- lang::WrappedTargetException,
- uno::RuntimeException) ;
-
- // XTimeStamped
- virtual rtl::OUString SAL_CALL getTimestamp(void)
- throw (uno::RuntimeException);
-
- private :
-
- rtl::OUString m_aComponent ;
-
- uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber ;
-
- // The InternetQueryOption function pointer
- InternetQueryOption_Proc_T m_lpfnInternetQueryOption;
-} ;
-
-#endif // _WinInetLayer_HXX_
diff --git a/shell/source/cmdmail/exports.map b/shell/source/cmdmail/exports.map
deleted file mode 100644
index ba501f9ae0..0000000000
--- a/shell/source/cmdmail/exports.map
+++ /dev/null
@@ -1,10 +0,0 @@
-UDK_3_0_0 {
- global:
- GetVersionInfo;
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/shell/source/cmdmail/makefile.mk b/shell/source/cmdmail/makefile.mk
index a7eaec1f89..5781afe8f5 100644
--- a/shell/source/cmdmail/makefile.mk
+++ b/shell/source/cmdmail/makefile.mk
@@ -53,7 +53,7 @@ SHL1STDLIBS=$(CPPULIB)\
$(CPPUHELPERLIB)\
$(SALLIB)
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
diff --git a/shell/source/tools/lngconvex/lngconvex.cxx b/shell/source/tools/lngconvex/lngconvex.cxx
index 2405925705..19456fe2f5 100644
--- a/shell/source/tools/lngconvex/lngconvex.cxx
+++ b/shell/source/tools/lngconvex/lngconvex.cxx
@@ -45,6 +45,7 @@
#include "osl/thread.h"
#include "osl/process.h"
#include "osl/file.hxx"
+#include "sal/main.h"
#include "tools/config.hxx"
#include "i18npool/mslangid.hxx"
@@ -565,7 +566,7 @@ void inflate_rc_template_to_file(
#define RC_HEADER(c) MAKE_ABSOLUTE((c).get_arg("-rch"))
#define RC_FOOTER(c) MAKE_ABSOLUTE((c).get_arg("-rcf"))
-int main(int argc, char* argv[])
+SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
{
try
{
diff --git a/shell/source/unix/exec/exports.map b/shell/source/unix/exec/exports.map
deleted file mode 100644
index ba501f9ae0..0000000000
--- a/shell/source/unix/exec/exports.map
+++ /dev/null
@@ -1,10 +0,0 @@
-UDK_3_0_0 {
- global:
- GetVersionInfo;
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/shell/source/unix/exec/makefile.mk b/shell/source/unix/exec/makefile.mk
index 2d9d5d250d..4bf77436f6 100644
--- a/shell/source/unix/exec/makefile.mk
+++ b/shell/source/unix/exec/makefile.mk
@@ -56,7 +56,7 @@ SHL1IMPLIB=i$(TARGET)
SHL1IMPLIB=
.ENDIF
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
diff --git a/shell/source/unix/sysshell/recfile.map b/shell/source/unix/sysshell/recfile.map
index 0823ea937c..2af2083f9a 100755
--- a/shell/source/unix/sysshell/recfile.map
+++ b/shell/source/unix/sysshell/recfile.map
@@ -1,4 +1,4 @@
-RECFILE_1_0_0 {
+UDK_3_0_0 {
global:
add_to_recently_used_file_list;
local:
diff --git a/shell/source/win32/shlxthandler/makefile.mk b/shell/source/win32/shlxthandler/makefile.mk
index 0c2abb405b..4452cb1a90 100755..100644
--- a/shell/source/win32/shlxthandler/makefile.mk
+++ b/shell/source/win32/shlxthandler/makefile.mk
@@ -75,8 +75,14 @@ SHL1STDLIBS+=\
$(SHELL32LIB)\
$(KERNEL32LIB)\
$(GDI32LIB)\
- $(GDIPLUSLIB)\
- msvcprt.lib \
+ $(GDIPLUSLIB)
+
+.IF "$(COM)"!="GCC"
+SHL1STDLIBS+=\
+ msvcprt.lib
+.ENDIF
+
+SHL1STDLIBS+=\
$(SHLWAPILIB)
SHL1LIBS+=$(SLB)$/util.lib\
diff --git a/shell/source/win32/shlxthandler/ooofilt/makefile.mk b/shell/source/win32/shlxthandler/ooofilt/makefile.mk
index 0d2a40e147..9111069ab8 100755..100644
--- a/shell/source/win32/shlxthandler/ooofilt/makefile.mk
+++ b/shell/source/win32/shlxthandler/ooofilt/makefile.mk
@@ -73,12 +73,15 @@ SHL1STDLIBS+=$(OLE32LIB)\
$(UUIDLIB)\
$(SHELL32LIB)\
$(KERNEL32LIB)\
- $(OLDNAMESLIB)\
- msvcprt.lib
+ $(OLDNAMESLIB)
+
+.IF "$(COM)"!="GCC"
+SHL1STDLIBS+=msvcprt.lib
.IF "$(PRODUCT)"!="full"
SHL1STDLIBS+=msvcrt.lib
.ENDIF
+.ENDIF
# $(LIBSTLPORTST)
diff --git a/shell/source/win32/shlxthandler/prophdl/makefile.mk b/shell/source/win32/shlxthandler/prophdl/makefile.mk
index 572dcb9385..dc6d0e1590 100755..100644
--- a/shell/source/win32/shlxthandler/prophdl/makefile.mk
+++ b/shell/source/win32/shlxthandler/prophdl/makefile.mk
@@ -73,12 +73,16 @@ SHL1STDLIBS+=\
$(GDI32LIB)\
$(GDIPLUSLIB)\
$(SHLWAPILIB)\
- $(PROPSYSLIB) \
+ $(PROPSYSLIB)
+
+.IF "$(COM)"!="GCC"
+SHL1STDLIBS+=\
msvcprt.lib
.IF "$(PRODUCT)"!="full"
SHL1STDLIBS+=msvcrt.lib
.ENDIF
+.ENDIF
SHL1LIBS+=$(SLB)$/util.lib\
$(SLB)$/ooofilereader.lib
diff --git a/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx b/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx
index cbe4638658..cb5d7e2627 100755..100644
--- a/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx
+++ b/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx
@@ -222,7 +222,11 @@ HRESULT STDMETHODCALLTYPE CPropertyHdl::Initialize( IStream *pStream, DWORD grfM
if ( !m_pCache )
{
+#ifdef __MINGW32__
+ if ( FAILED( PSCreateMemoryPropertyStore( IID_IPropertyStoreCache, reinterpret_cast<void**>(&m_pCache) ) ) )
+#else
if ( FAILED( PSCreateMemoryPropertyStore( IID_PPV_ARGS( &m_pCache ) ) ) )
+#endif
OutputDebugStringFormat( "CPropertyHdl::Initialize: PSCreateMemoryPropertyStore failed" );
zlib_filefunc_def z_filefunc;
diff --git a/shell/source/win32/shlxthandler/propsheets/makefile.mk b/shell/source/win32/shlxthandler/propsheets/makefile.mk
index fd83f33b99..55a31c9c59 100644
--- a/shell/source/win32/shlxthandler/propsheets/makefile.mk
+++ b/shell/source/win32/shlxthandler/propsheets/makefile.mk
@@ -35,13 +35,14 @@ ENABLE_EXCEPTIONS=TRUE
.INCLUDE : settings.mk
-CFLAGS+=-DISOLATION_AWARE_ENABLED -DWIN32_LEAN_AND_MEAN -DXML_UNICODE -D_NTSDK -DUNICODE -D_UNICODE -D_WIN32_WINNT=0x0501
+CFLAGS+=-DISOLATION_AWARE_ENABLED -DWIN32_LEAN_AND_MEAN -DXML_UNICODE -D_NTSDK -DUNICODE -D_UNICODE
+CDEFS+=-U_WIN32_WINNT -D_WIN32_WINNT=0x0501 -U_WIN32_IE -D_WIN32_IE=0x501
+.IF "$(COM)"!="GCC"
CFLAGS+=-wd4710 -wd4711 -wd4514 -wd4619 -wd4217 -wd4820
-CDEFS+=-D_WIN32_IE=0x501
-
-CFLAGS_X64+=-DISOLATION_AWARE_ENABLED -DWIN32_LEAN_AND_MEAN -DXML_UNICODE -D_NTSDK -DUNICODE -D_UNICODE -D_WIN32_WINNT=0x0501
+CFLAGS_X64+=-DISOLATION_AWARE_ENABLED -DWIN32_LEAN_AND_MEAN -DXML_UNICODE -D_NTSDK -DUNICODE -D_UNICODE
CFLAGS_X64+=-wd4710 -wd4711 -wd4514 -wd4619 -wd4217 -wd4820
-CDEFS_X64+=-D_WIN32_IE=0x501
+CDEFS_X64+=-D_WIN32_WINNT=0x0501 -D_WIN32_IE=0x501
+.ENDIF
# --- Files --------------------------------------------------------
diff --git a/svx/inc/globlmn_tmpl.hrc b/svx/inc/globlmn_tmpl.hrc
index a67019088d..41d0d42bdf 100644
--- a/svx/inc/globlmn_tmpl.hrc
+++ b/svx/inc/globlmn_tmpl.hrc
@@ -468,12 +468,6 @@
HelpID = SID_LOGOUT ; \
Text [ en-US ] = "Logout" ; \
-#define ITEM_FILE_BACKTOWEBTOP \
- Identifier = SID_BACKTOWEBTOP ; \
- Command = ".uno:BackToWebtop" ; \
- HelpID = SID_BACKTOWEBTOP ; \
- Text [ en-US ] = "Back to Webtop"; \
-
#define ITEM_EDIT_UNDO \
Identifier = SID_UNDO ; \
Command = ".uno:UndoAction" ; \
diff --git a/svx/inc/pch/precompiled_svx.hxx b/svx/inc/pch/precompiled_svx.hxx
index 1c22c9b815..8dda799ab3 100644
--- a/svx/inc/pch/precompiled_svx.hxx
+++ b/svx/inc/pch/precompiled_svx.hxx
@@ -754,7 +754,6 @@
#include "svtools/apearcfg.hxx"
#include "svl/brdcst.hxx"
#include "unotools/cacheoptions.hxx"
-#include "svl/cancel.hxx"
#include "svl/cjkoptions.hxx"
#include "unotools/cmdoptions.hxx"
#include "svl/cntwall.hxx"
diff --git a/svx/inc/svx/cube3d.hxx b/svx/inc/svx/cube3d.hxx
index 0afdcfbdc7..39be134f0d 100644
--- a/svx/inc/svx/cube3d.hxx
+++ b/svx/inc/svx/cube3d.hxx
@@ -52,10 +52,6 @@ enum { CUBE_BOTTOM = 0x0001, CUBE_BACK = 0x0002, CUBE_LEFT = 0x0004,
class SVX_DLLPUBLIC E3dCubeObj : public E3dCompoundObject
{
private:
- // Zur Geometrieerzeugung eines Cubes notwendige
- // #110094# DrawContact section
- virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
-
// Parameter
basegfx::B3DPoint aCubePos;
basegfx::B3DVector aCubeSize;
@@ -66,6 +62,7 @@ private:
protected:
void SetDefaultAttributes(E3dDefaultAttributes& rDefault);
+ virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
public:
TYPEINFO();
diff --git a/svx/inc/svx/extrud3d.hxx b/svx/inc/svx/extrud3d.hxx
index d56532533e..73a4fc7645 100644
--- a/svx/inc/svx/extrud3d.hxx
+++ b/svx/inc/svx/extrud3d.hxx
@@ -40,11 +40,6 @@
class SVX_DLLPUBLIC E3dExtrudeObj : public E3dCompoundObject
{
private:
- // #110094# DrawContact section
- virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
-
- virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
-
// to allow sdr::properties::E3dExtrudeProperties access to SetGeometryValid()
friend class sdr::properties::E3dExtrudeProperties;
@@ -52,6 +47,8 @@ private:
basegfx::B2DPolyPolygon maExtrudePolygon;
protected:
+ virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+ virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
void SetDefaultAttributes(E3dDefaultAttributes& rDefault);
public:
diff --git a/svx/inc/svx/lathe3d.hxx b/svx/inc/svx/lathe3d.hxx
index 3b20cccd61..eb1ce3e118 100644
--- a/svx/inc/svx/lathe3d.hxx
+++ b/svx/inc/svx/lathe3d.hxx
@@ -44,16 +44,13 @@
class SVX_DLLPUBLIC E3dLatheObj : public E3dCompoundObject
{
private:
- // #110094# DrawContact section
- virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
-
- virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
-
// Partcodes fuer Wireframe-Generierung: Standard oder Deckelflaeche
enum { LATHE_PART_STD = 1, LATHE_PART_COVER = 2 };
basegfx::B2DPolyPolygon maPolyPoly2D;
protected:
+ virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+ virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
void SetDefaultAttributes(E3dDefaultAttributes& rDefault);
public:
diff --git a/svx/inc/svx/obj3d.hxx b/svx/inc/svx/obj3d.hxx
index 6cf2a210f5..775c3fbb58 100644
--- a/svx/inc/svx/obj3d.hxx
+++ b/svx/inc/svx/obj3d.hxx
@@ -106,8 +106,7 @@ public:
class SVX_DLLPUBLIC E3dObject : public SdrAttrObj
{
- virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
-
+private:
// to allow sdr::properties::E3dProperties access to StructureChanged()
friend class sdr::properties::E3dProperties;
@@ -116,6 +115,8 @@ class SVX_DLLPUBLIC E3dObject : public SdrAttrObj
friend class E3dDragMethod;
protected:
+ virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
+
E3dObjList maSubList; // Subliste (Childobjekte)
basegfx::B3DRange maLocalBoundVol; // umschliessendes Volumen des Objekts (aus geometrieerzeugung)
@@ -220,8 +221,7 @@ public:
class SVX_DLLPUBLIC E3dCompoundObject : public E3dObject
{
- virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
-
+private:
// to allow sdr::properties::E3dCompoundProperties access to SetGeometryValid()
friend class sdr::properties::E3dCompoundProperties;
friend class sdr::properties::E3dExtrudeProperties;
@@ -229,6 +229,8 @@ class SVX_DLLPUBLIC E3dCompoundObject : public E3dObject
friend class sdr::properties::E3dSphereProperties;
protected:
+ virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
+
// Material des Objektes
Color aMaterialAmbientColor;
diff --git a/svx/inc/svx/polygn3d.hxx b/svx/inc/svx/polygn3d.hxx
index c49f995bd2..2078925c44 100644
--- a/svx/inc/svx/polygn3d.hxx
+++ b/svx/inc/svx/polygn3d.hxx
@@ -34,9 +34,6 @@
class SVX_DLLPUBLIC E3dPolygonObj : public E3dCompoundObject
{
private:
- // #110094# DrawContact section
- virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
-
// Parameter
basegfx::B3DPolyPolygon aPolyPoly3D;
basegfx::B3DPolyPolygon aPolyNormals3D;
@@ -46,6 +43,9 @@ private:
SVX_DLLPRIVATE void CreateDefaultNormals();
SVX_DLLPRIVATE void CreateDefaultTexture();
+protected:
+ virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+
public:
void SetPolyPolygon3D(const basegfx::B3DPolyPolygon& rNewPolyPoly3D);
void SetPolyNormals3D(const basegfx::B3DPolyPolygon& rNewPolyPoly3D);
diff --git a/svx/inc/svx/scene3d.hxx b/svx/inc/svx/scene3d.hxx
index e10400e935..3021447ed6 100644
--- a/svx/inc/svx/scene3d.hxx
+++ b/svx/inc/svx/scene3d.hxx
@@ -68,17 +68,14 @@ class Imp3DDepthRemapper;
class SVX_DLLPUBLIC E3dScene : public E3dObject
{
- // BaseProperties section
- virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
-
+private:
// to allow sdr::properties::E3dSceneProperties access to StructureChanged()
friend class sdr::properties::E3dSceneProperties;
- // #110094# DrawContact section
-private:
+protected:
+ virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
-protected:
// Transformationen
B3dCamera aCameraSet;
Camera3D aCamera;
@@ -108,6 +105,8 @@ public:
E3dScene(E3dDefaultAttributes& rDefault);
virtual ~E3dScene();
+ virtual void SetBoundRectDirty();
+
// access to cleanup of depth mapper
void Cleanup3DDepthMapper() { ImpCleanup3DDepthMapper(); }
diff --git a/svx/inc/svx/sdr/attribute/sdrallattribute.hxx b/svx/inc/svx/sdr/attribute/sdrallattribute.hxx
deleted file mode 100644
index 4e132a280a..0000000000
--- a/svx/inc/svx/sdr/attribute/sdrallattribute.hxx
+++ /dev/null
@@ -1,198 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SDR_ATTRIBUTE_SDRALLATTRIBUTE_HXX
-#define _SDR_ATTRIBUTE_SDRALLATTRIBUTE_HXX
-
-#include <sal/types.h>
-
-//////////////////////////////////////////////////////////////////////////////
-// predefines
-
-namespace drawinglayer { namespace attribute {
- class SdrLineAttribute;
- class SdrFillAttribute;
- class SdrLineStartEndAttribute;
- class SdrShadowAttribute;
- class FillGradientAttribute;
- class SdrTextAttribute;
-}}
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- class SdrShadowTextAttribute
- {
- // shadow and text attributes
- SdrShadowAttribute* mpShadow; // shadow attributes (if used)
- SdrTextAttribute* mpTextAttribute; // text and text attributes (if used)
-
- public:
- SdrShadowTextAttribute(
- SdrShadowAttribute* pShadow = 0,
- SdrTextAttribute* pTextAttribute = 0);
- ~SdrShadowTextAttribute();
-
- // copy constructor and assigment operator
- SdrShadowTextAttribute(const SdrShadowTextAttribute& rCandidate);
- SdrShadowTextAttribute& operator=(const SdrShadowTextAttribute& rCandidate);
-
- // compare operator
- bool operator==(const SdrShadowTextAttribute& rCandidate) const;
-
- // bool access
- bool isVisible() const { return (0 != mpTextAttribute); }
-
- // data access
- const SdrShadowAttribute* getShadow() const { return mpShadow; }
- const SdrTextAttribute* getText() const { return mpTextAttribute; }
- };
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- class SdrFillTextAttribute
- {
- // shadow and text attributes
- SdrFillAttribute* mpFill; // fill attributes (if used)
- FillGradientAttribute* mpFillFloatTransGradient; // fill float transparence gradient (if used)
- SdrTextAttribute* mpTextAttribute; // text and text attributes (if used)
-
- public:
- SdrFillTextAttribute(
- SdrFillAttribute* pFill = 0,
- FillGradientAttribute* pFillFloatTransGradient = 0,
- SdrTextAttribute* pTextAttribute = 0);
- ~SdrFillTextAttribute();
-
- // copy constructor and assigment operator
- SdrFillTextAttribute(const SdrFillTextAttribute& rCandidate);
- SdrFillTextAttribute& operator=(const SdrFillTextAttribute& rCandidate);
-
- // compare operator
- bool operator==(const SdrFillTextAttribute& rCandidate) const;
-
- // bool access
- bool isVisible() const { return ((mpTextAttribute) || (mpFill)); }
-
- // data access
- const SdrFillAttribute* getFill() const { return mpFill; }
- const FillGradientAttribute* getFillFloatTransGradient() const { return mpFillFloatTransGradient; }
- const SdrTextAttribute* getText() const { return mpTextAttribute; }
- };
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- class SdrLineShadowTextAttribute : public SdrShadowTextAttribute
- {
- // line, shadow, lineStartEnd and text attributes
- SdrLineAttribute* mpLine; // line attributes (if used)
- SdrLineStartEndAttribute* mpLineStartEnd; // line start end (if used)
-
- public:
- SdrLineShadowTextAttribute(
- SdrLineAttribute* pLine = 0,
- SdrLineStartEndAttribute* pLineStartEnd = 0,
- SdrShadowAttribute* pShadow = 0,
- SdrTextAttribute* pTextAttribute = 0);
- ~SdrLineShadowTextAttribute();
-
- // copy constructor and assigment operator
- SdrLineShadowTextAttribute(const SdrLineShadowTextAttribute& rCandidate);
- SdrLineShadowTextAttribute& operator=(const SdrLineShadowTextAttribute& rCandidate);
-
- // compare operator
- bool operator==(const SdrLineShadowTextAttribute& rCandidate) const;
-
- // bool access
- bool isVisible() const { return (mpLine || (SdrShadowTextAttribute::isVisible())); }
-
- // data access
- const SdrLineAttribute* getLine() const { return mpLine; }
- const SdrLineStartEndAttribute* getLineStartEnd() const { return mpLineStartEnd; }
- };
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- class SdrLineFillShadowTextAttribute : public SdrLineShadowTextAttribute
- {
- // add fill and transGradient attributes
- SdrFillAttribute* mpFill; // fill attributes (if used)
- FillGradientAttribute* mpFillFloatTransGradient; // fill float transparence gradient (if used)
-
- public:
- SdrLineFillShadowTextAttribute(
- SdrLineAttribute* pLine = 0,
- SdrFillAttribute* pFill = 0,
- SdrLineStartEndAttribute* pLineStartEnd = 0,
- SdrShadowAttribute* pShadow = 0,
- FillGradientAttribute* pFillFloatTransGradient = 0,
- SdrTextAttribute* pTextAttribute = 0);
- ~SdrLineFillShadowTextAttribute();
-
- // copy constructor and assigment operator
- SdrLineFillShadowTextAttribute(const SdrLineFillShadowTextAttribute& rCandidate);
- SdrLineFillShadowTextAttribute& operator=(const SdrLineFillShadowTextAttribute& rCandidate);
-
- // compare operator
- bool operator==(const SdrLineFillShadowTextAttribute& rCandidate) const;
-
- // bool access
- bool isVisible() const { return (mpFill || (SdrLineShadowTextAttribute::isVisible())); }
-
- // data access
- const SdrFillAttribute* getFill() const { return mpFill; }
- const FillGradientAttribute* getFillFloatTransGradient() const { return mpFillFloatTransGradient; }
- };
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-#endif // _SDR_ATTRIBUTE_SDRALLATTRIBUTE_HXX
-
-// eof
diff --git a/svx/inc/svx/sdr/attribute/sdrfilltextattribute.hxx b/svx/inc/svx/sdr/attribute/sdrfilltextattribute.hxx
new file mode 100644
index 0000000000..ac4e4e96fc
--- /dev/null
+++ b/svx/inc/svx/sdr/attribute/sdrfilltextattribute.hxx
@@ -0,0 +1,80 @@
+/*************************************************************************
+ *
+ * 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: sdrallattribute.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SDR_ATTRIBUTE_SDRFILLTEXTATTRIBUTE_HXX
+#define _SDR_ATTRIBUTE_SDRFILLTEXTATTRIBUTE_HXX
+
+#include <sal/types.h>
+#include <drawinglayer/attribute/sdrfillattribute.hxx>
+#include <drawinglayer/attribute/fillgradientattribute.hxx>
+#include <svx/sdr/attribute/sdrtextattribute.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class SdrFillTextAttribute
+ {
+ // shadow and text attributes
+ SdrFillAttribute maFill; // fill attributes (if used)
+ FillGradientAttribute maFillFloatTransGradient; // fill float transparence gradient (if used)
+ SdrTextAttribute maTextAttribute; // text and text attributes (if used)
+
+ public:
+ SdrFillTextAttribute(
+ const SdrFillAttribute& rFill,
+ const FillGradientAttribute& rFillFloatTransGradient,
+ const SdrTextAttribute& rTextAttribute);
+ SdrFillTextAttribute();
+ SdrFillTextAttribute(const SdrFillTextAttribute& rCandidate);
+ SdrFillTextAttribute& operator=(const SdrFillTextAttribute& rCandidate);
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const SdrFillTextAttribute& rCandidate) const;
+
+ // data access
+ const SdrFillAttribute& getFill() const { return maFill; }
+ const FillGradientAttribute& getFillFloatTransGradient() const { return maFillFloatTransGradient; }
+ const SdrTextAttribute& getText() const { return maTextAttribute; }
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // _SDR_ATTRIBUTE_SDRFILLTEXTATTRIBUTE_HXX
+
+// eof
diff --git a/svx/inc/svx/sdr/attribute/sdrformtextattribute.hxx b/svx/inc/svx/sdr/attribute/sdrformtextattribute.hxx
index 8b484e2bea..7328320ad6 100644
--- a/svx/inc/svx/sdr/attribute/sdrformtextattribute.hxx
+++ b/svx/inc/svx/sdr/attribute/sdrformtextattribute.hxx
@@ -34,8 +34,13 @@
//////////////////////////////////////////////////////////////////////////////
// predefines
+
class SfxItemSet;
-namespace drawinglayer { namespace attribute { class SdrFormTextOutlineAttribute; }}
+
+namespace drawinglayer { namespace attribute {
+ class ImpSdrFormTextAttribute;
+ class SdrFormTextOutlineAttribute;
+}}
//////////////////////////////////////////////////////////////////////////////
@@ -46,53 +51,36 @@ namespace drawinglayer
class SdrFormTextAttribute
{
private:
- // FormText (FontWork) Attributes
- sal_Int32 mnFormTextDistance; // distance from line in upright direction
- sal_Int32 mnFormTextStart; // shift from polygon start
- sal_Int32 mnFormTextShdwXVal; // shadow distance or 10th degrees
- sal_Int32 mnFormTextShdwYVal; // shadow distance or scaling
- sal_uInt16 mnFormTextShdwTransp; // shadow transparence
- XFormTextStyle meFormTextStyle; // on/off and char orientation
- XFormTextAdjust meFormTextAdjust; // adjustment (left/right/center) and scale
- XFormTextShadow meFormTextShadow; // shadow mode
- Color maFormTextShdwColor; // shadow color
-
- // outline attributes; used when getFormTextOutline() is true and (for
- // shadow) when getFormTextShadow() != XFTSHADOW_NONE
- SdrFormTextOutlineAttribute* mpOutline;
- SdrFormTextOutlineAttribute* mpShadowOutline;
-
- // bitfield
- unsigned mbFormTextMirror : 1; // change orientation
- unsigned mbFormTextOutline : 1; // show contour of objects
+ ImpSdrFormTextAttribute* mpSdrFormTextAttribute;
public:
+ /// constructors/assignmentoperator/destructor
SdrFormTextAttribute(const SfxItemSet& rSet);
- ~SdrFormTextAttribute();
-
- // copy constructor and assigment operator
+ SdrFormTextAttribute();
SdrFormTextAttribute(const SdrFormTextAttribute& rCandidate);
SdrFormTextAttribute& operator=(const SdrFormTextAttribute& rCandidate);
+ ~SdrFormTextAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
// compare operator
bool operator==(const SdrFormTextAttribute& rCandidate) const;
- // data access
- sal_Int32 getFormTextDistance() const { return mnFormTextDistance; }
- sal_Int32 getFormTextStart() const { return mnFormTextStart; }
- sal_Int32 getFormTextShdwXVal() const { return mnFormTextShdwXVal; }
- sal_Int32 getFormTextShdwYVal() const { return mnFormTextShdwYVal; }
- sal_uInt16 getFormTextShdwTransp() const { return mnFormTextShdwTransp; }
- XFormTextStyle getFormTextStyle() const { return meFormTextStyle; }
- XFormTextAdjust getFormTextAdjust() const { return meFormTextAdjust; }
- XFormTextShadow getFormTextShadow() const { return meFormTextShadow; }
- Color getFormTextShdwColor() const { return maFormTextShdwColor; }
-
- const SdrFormTextOutlineAttribute* getOutline() const { return mpOutline; }
- const SdrFormTextOutlineAttribute* getShadowOutline() const { return mpShadowOutline; }
-
- bool getFormTextMirror() const { return mbFormTextMirror; }
- bool getFormTextOutline() const { return mbFormTextOutline; }
+ // data read access
+ sal_Int32 getFormTextDistance() const;
+ sal_Int32 getFormTextStart() const;
+ sal_Int32 getFormTextShdwXVal() const;
+ sal_Int32 getFormTextShdwYVal() const;
+ sal_uInt16 getFormTextShdwTransp() const;
+ XFormTextStyle getFormTextStyle() const;
+ XFormTextAdjust getFormTextAdjust() const;
+ XFormTextShadow getFormTextShadow() const;
+ Color getFormTextShdwColor() const;
+ const SdrFormTextOutlineAttribute& getOutline() const;
+ const SdrFormTextOutlineAttribute& getShadowOutline() const;
+ bool getFormTextMirror() const;
+ bool getFormTextOutline() const;
};
} // end of namespace attribute
} // end of namespace drawinglayer
diff --git a/svx/inc/svx/sdr/attribute/sdrformtextoutlineattribute.hxx b/svx/inc/svx/sdr/attribute/sdrformtextoutlineattribute.hxx
index 048f882f1e..ff6de4176c 100644
--- a/svx/inc/svx/sdr/attribute/sdrformtextoutlineattribute.hxx
+++ b/svx/inc/svx/sdr/attribute/sdrformtextoutlineattribute.hxx
@@ -29,8 +29,15 @@
#define _SDR_ATTRIBUTE_SDRFORMTEXTOUTLINEATTRIBUTE_HXX
#include <sal/types.h>
-#include <drawinglayer/attribute/lineattribute.hxx>
-#include <drawinglayer/attribute/strokeattribute.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+
+namespace drawinglayer { namespace attribute {
+ class ImpSdrFormTextOutlineAttribute;
+ class LineAttribute;
+ class StrokeAttribute;
+}}
//////////////////////////////////////////////////////////////////////////////
@@ -41,24 +48,29 @@ namespace drawinglayer
class SdrFormTextOutlineAttribute
{
private:
- // one set of attributes for FormText (FontWork) outline visualisation
- LineAttribute maLineAttribute;
- StrokeAttribute maStrokeAttribute;
- sal_uInt8 mnTransparence;
+ ImpSdrFormTextOutlineAttribute* mpSdrFormTextOutlineAttribute;
public:
+ /// constructors/assignmentoperator/destructor
SdrFormTextOutlineAttribute(
const LineAttribute& rLineAttribute,
const StrokeAttribute& rStrokeAttribute,
sal_uInt8 nTransparence);
+ SdrFormTextOutlineAttribute();
+ SdrFormTextOutlineAttribute(const SdrFormTextOutlineAttribute& rCandidate);
+ SdrFormTextOutlineAttribute& operator=(const SdrFormTextOutlineAttribute& rCandidate);
+ ~SdrFormTextOutlineAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
// compare operator
bool operator==(const SdrFormTextOutlineAttribute& rCandidate) const;
// data read access
- const LineAttribute& getLineAttribute() const { return maLineAttribute; }
- const StrokeAttribute getStrokeAttribute() const { return maStrokeAttribute; }
- sal_uInt8 getTransparence() const { return mnTransparence; }
+ const LineAttribute& getLineAttribute() const;
+ const StrokeAttribute& getStrokeAttribute() const;
+ sal_uInt8 getTransparence() const;
};
} // end of namespace attribute
} // end of namespace drawinglayer
diff --git a/svx/inc/svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx b/svx/inc/svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx
new file mode 100644
index 0000000000..5c6674da6b
--- /dev/null
+++ b/svx/inc/svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx
@@ -0,0 +1,81 @@
+/*************************************************************************
+ *
+ * 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: sdrallattribute.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SDR_ATTRIBUTE_SDRLINEFILLSHADOWTEXTATTRIBUTE_HXX
+#define _SDR_ATTRIBUTE_SDRLINEFILLSHADOWTEXTATTRIBUTE_HXX
+
+#include <sal/types.h>
+#include <svx/sdr/attribute/sdrlineshadowtextattribute.hxx>
+#include <drawinglayer/attribute/sdrfillattribute.hxx>
+#include <drawinglayer/attribute/fillgradientattribute.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class SdrLineFillShadowTextAttribute : public SdrLineShadowTextAttribute
+ {
+ // add fill and transGradient attributes
+ SdrFillAttribute maFill; // fill attributes (if used)
+ FillGradientAttribute maFillFloatTransGradient; // fill float transparence gradient (if used)
+
+ public:
+ SdrLineFillShadowTextAttribute(
+ const SdrLineAttribute& rLine,
+ const SdrFillAttribute& rFill,
+ const SdrLineStartEndAttribute& rLineStartEnd,
+ const SdrShadowAttribute& rShadow,
+ const FillGradientAttribute& rFillFloatTransGradient,
+ const SdrTextAttribute& rTextAttribute);
+ SdrLineFillShadowTextAttribute();
+ SdrLineFillShadowTextAttribute(const SdrLineFillShadowTextAttribute& rCandidate);
+ SdrLineFillShadowTextAttribute& operator=(const SdrLineFillShadowTextAttribute& rCandidate);
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const SdrLineFillShadowTextAttribute& rCandidate) const;
+
+ // data access
+ const SdrFillAttribute& getFill() const { return maFill; }
+ const FillGradientAttribute& getFillFloatTransGradient() const { return maFillFloatTransGradient; }
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // _SDR_ATTRIBUTE_SDRLINEFILLSHADOWTEXTATTRIBUTE_HXX
+
+// eof
diff --git a/svx/inc/svx/sdr/attribute/sdrlineshadowtextattribute.hxx b/svx/inc/svx/sdr/attribute/sdrlineshadowtextattribute.hxx
new file mode 100644
index 0000000000..8c17cdec13
--- /dev/null
+++ b/svx/inc/svx/sdr/attribute/sdrlineshadowtextattribute.hxx
@@ -0,0 +1,79 @@
+/*************************************************************************
+ *
+ * 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: sdrallattribute.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SDR_ATTRIBUTE_SDRLINESHADOWTEXTATTRIBUTE_HXX
+#define _SDR_ATTRIBUTE_SDRLINESHADOWTEXTATTRIBUTE_HXX
+
+#include <sal/types.h>
+#include <svx/sdr/attribute/sdrshadowtextattribute.hxx>
+#include <drawinglayer/attribute/sdrlineattribute.hxx>
+#include <drawinglayer/attribute/sdrlinestartendattribute.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class SdrLineShadowTextAttribute : public SdrShadowTextAttribute
+ {
+ // line, shadow, lineStartEnd and text attributes
+ SdrLineAttribute maLine; // line attributes (if used)
+ SdrLineStartEndAttribute maLineStartEnd; // line start end (if used)
+
+ public:
+ SdrLineShadowTextAttribute(
+ const SdrLineAttribute& rLine,
+ const SdrLineStartEndAttribute& rLineStartEnd,
+ const SdrShadowAttribute& rShadow,
+ const SdrTextAttribute& rTextAttribute);
+ SdrLineShadowTextAttribute();
+ SdrLineShadowTextAttribute(const SdrLineShadowTextAttribute& rCandidate);
+ SdrLineShadowTextAttribute& operator=(const SdrLineShadowTextAttribute& rCandidate);
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const SdrLineShadowTextAttribute& rCandidate) const;
+
+ // data access
+ const SdrLineAttribute& getLine() const { return maLine; }
+ const SdrLineStartEndAttribute& getLineStartEnd() const { return maLineStartEnd; }
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // _SDR_ATTRIBUTE_SDRLINESHADOWTEXTATTRIBUTE_HXX
+
+// eof
diff --git a/svx/inc/svx/sdr/attribute/sdrshadowtextattribute.hxx b/svx/inc/svx/sdr/attribute/sdrshadowtextattribute.hxx
new file mode 100644
index 0000000000..453a398ee7
--- /dev/null
+++ b/svx/inc/svx/sdr/attribute/sdrshadowtextattribute.hxx
@@ -0,0 +1,76 @@
+/*************************************************************************
+ *
+ * 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: sdrallattribute.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _SDR_ATTRIBUTE_SDRSHADOWTEXTATTRIBUTE_HXX
+#define _SDR_ATTRIBUTE_SDRSHADOWTEXTATTRIBUTE_HXX
+
+#include <sal/types.h>
+#include <drawinglayer/attribute/sdrshadowattribute.hxx>
+#include <svx/sdr/attribute/sdrtextattribute.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ class SdrShadowTextAttribute
+ {
+ // shadow and text attributes
+ SdrShadowAttribute maShadow; // shadow attributes (if used)
+ SdrTextAttribute maTextAttribute; // text and text attributes (if used)
+
+ public:
+ SdrShadowTextAttribute(
+ const SdrShadowAttribute& rShadow,
+ const SdrTextAttribute& rTextAttribute);
+ SdrShadowTextAttribute();
+ SdrShadowTextAttribute(const SdrShadowTextAttribute& rCandidate);
+ SdrShadowTextAttribute& operator=(const SdrShadowTextAttribute& rCandidate);
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
+ // compare operator
+ bool operator==(const SdrShadowTextAttribute& rCandidate) const;
+
+ // data access
+ const SdrShadowAttribute& getShadow() const { return maShadow; }
+ const SdrTextAttribute& getText() const { return maTextAttribute; }
+ };
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+
+#endif // _SDR_ATTRIBUTE_SDRSHADOWTEXTATTRIBUTE_HXX
+
+// eof
diff --git a/svx/inc/svx/sdr/attribute/sdrtextattribute.hxx b/svx/inc/svx/sdr/attribute/sdrtextattribute.hxx
index 5023a16520..a31c6b1617 100644
--- a/svx/inc/svx/sdr/attribute/sdrtextattribute.hxx
+++ b/svx/inc/svx/sdr/attribute/sdrtextattribute.hxx
@@ -35,9 +35,20 @@
//////////////////////////////////////////////////////////////////////////////
// predefines
+
class SdrText;
-namespace drawinglayer { namespace animation { class AnimationEntryList; }}
-namespace drawinglayer { namespace attribute { class SdrFormTextAttribute; }}
+
+namespace drawinglayer { namespace animation {
+ class AnimationEntryList;
+}}
+
+namespace drawinglayer { namespace attribute {
+ class SdrFormTextAttribute;
+}}
+
+namespace drawinglayer { namespace attribute {
+ class ImpSdrTextAttribute;
+}}
//////////////////////////////////////////////////////////////////////////////
@@ -48,40 +59,13 @@ namespace drawinglayer
class SdrTextAttribute
{
private:
- // all-text attributes. The SdrText itself and a copy
- // of te OPO
- const SdrText* mpSdrText;
- OutlinerParaObject maOutlinerParaObject;
-
- // Set when it's a FormText; contains all FormText attributes
- SdrFormTextAttribute* mpSdrFormTextAttribute;
-
- // text distances
- sal_Int32 maTextLeftDistance;
- sal_Int32 maTextUpperDistance;
- sal_Int32 maTextRightDistance;
- sal_Int32 maTextLowerDistance;
-
- // #i101556# use versioning from text attributes to detect changes
- sal_uInt32 maPropertiesVersion;
-
- // text alignments
- SdrTextHorzAdjust maSdrTextHorzAdjust;
- SdrTextVertAdjust maSdrTextVertAdjust;
-
- // bitfield
- unsigned mbContour : 1;
- unsigned mbFitToSize : 1;
- unsigned mbHideContour : 1;
- unsigned mbBlink : 1;
- unsigned mbScroll : 1;
- unsigned mbInEditMode : 1;
- unsigned mbFixedCellHeight : 1;
+ ImpSdrTextAttribute* mpSdrTextAttribute;
public:
+ /// constructors/assignmentoperator/destructor
SdrTextAttribute(
const SdrText& rSdrText,
- const OutlinerParaObject& rOutlinerParaObjectPtr,
+ const OutlinerParaObject& rOutlinerParaObject,
XFormTextStyle eFormTextStyle,
sal_Int32 aTextLeftDistance,
sal_Int32 aTextUpperDistance,
@@ -95,38 +79,46 @@ namespace drawinglayer
bool bBlink,
bool bScroll,
bool bInEditMode,
- bool bFixedCellHeight);
- ~SdrTextAttribute();
-
- // copy constructor and assigment operator
+ bool bFixedCellHeight,
+ bool bWrongSpell);
+ SdrTextAttribute();
SdrTextAttribute(const SdrTextAttribute& rCandidate);
SdrTextAttribute& operator=(const SdrTextAttribute& rCandidate);
+ ~SdrTextAttribute();
+
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
// compare operator
bool operator==(const SdrTextAttribute& rCandidate) const;
- // data access
- const SdrText& getSdrText() const { return *mpSdrText; }
- const OutlinerParaObject& getOutlinerParaObject() const { return maOutlinerParaObject; }
- bool isContour() const { return mbContour; }
- bool isFitToSize() const { return mbFitToSize; }
- bool isHideContour() const { return mbHideContour; }
- bool isBlink() const { return mbBlink; }
- bool isScroll() const { return mbScroll; }
- bool isInEditMode() const { return mbInEditMode; }
- bool isFixedCellHeight() const { return mbFixedCellHeight; }
- const SdrFormTextAttribute* getSdrFormTextAttribute() const { return mpSdrFormTextAttribute; }
- sal_Int32 getTextLeftDistance() const { return maTextLeftDistance; }
- sal_Int32 getTextUpperDistance() const { return maTextUpperDistance; }
- sal_Int32 getTextRightDistance() const { return maTextRightDistance; }
- sal_Int32 getTextLowerDistance() const { return maTextLowerDistance; }
- sal_uInt32 getPropertiesVersion() const { return maPropertiesVersion; }
- SdrTextHorzAdjust getSdrTextHorzAdjust() const { return maSdrTextHorzAdjust; }
- SdrTextVertAdjust getSdrTextVertAdjust() const { return maSdrTextVertAdjust; }
-
- // animation timing generation
- void getBlinkTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList) const;
- void getScrollTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList, double fFrameLength, double fTextLength) const;
+ // data read access
+ const SdrText& getSdrText() const;
+ const OutlinerParaObject& getOutlinerParaObject() const;
+ bool isContour() const;
+ bool isFitToSize() const;
+ bool isHideContour() const;
+ bool isBlink() const;
+ bool isScroll() const;
+ bool isInEditMode() const;
+ bool isFixedCellHeight() const;
+ bool isWrongSpell() const;
+ const SdrFormTextAttribute& getSdrFormTextAttribute() const;
+ sal_Int32 getTextLeftDistance() const;
+ sal_Int32 getTextUpperDistance() const;
+ sal_Int32 getTextRightDistance() const;
+ sal_Int32 getTextLowerDistance() const;
+ sal_uInt32 getPropertiesVersion() const;
+ SdrTextHorzAdjust getSdrTextHorzAdjust() const;
+ SdrTextVertAdjust getSdrTextVertAdjust() const;
+
+ // helpers: animation timing generators
+ void getBlinkTextTiming(
+ drawinglayer::animation::AnimationEntryList& rAnimList) const;
+ void getScrollTextTiming(
+ drawinglayer::animation::AnimationEntryList& rAnimList,
+ double fFrameLength,
+ double fTextLength) const;
};
} // end of namespace attribute
} // end of namespace drawinglayer
diff --git a/svx/inc/svx/sdr/contact/viewcontactofe3dscene.hxx b/svx/inc/svx/sdr/contact/viewcontactofe3dscene.hxx
index c6beae062a..7c0d792e68 100644
--- a/svx/inc/svx/sdr/contact/viewcontactofe3dscene.hxx
+++ b/svx/inc/svx/sdr/contact/viewcontactofe3dscene.hxx
@@ -30,22 +30,16 @@
#include <svx/sdr/contact/viewcontactofsdrobj.hxx>
#include <drawinglayer/primitive3d/baseprimitive3d.hxx>
+#include <drawinglayer/attribute/sdrsceneattribute3d.hxx>
+#include <drawinglayer/attribute/sdrlightingattribute3d.hxx>
+#include <drawinglayer/geometry/viewinformation3d.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
//////////////////////////////////////////////////////////////////////////////
// predeclarations
class E3dScene;
-namespace drawinglayer {
- namespace geometry {
- class ViewInformation3D;
- }
- namespace attribute {
- class SdrSceneAttribute;
- class SdrLightingAttribute;
- }
-}
-
namespace basegfx {
class B3DRange;
}
@@ -67,7 +61,6 @@ namespace sdr
public:
// basic constructor, used from SdrObject.
ViewContactOfE3dScene(E3dScene& rScene);
- virtual ~ViewContactOfE3dScene();
// access to SdrObject
E3dScene& GetE3dScene() const
@@ -98,14 +91,14 @@ namespace sdr
protected:
// the 3d transformation stack
- drawinglayer::geometry::ViewInformation3D* mpViewInformation3D;
+ drawinglayer::geometry::ViewInformation3D maViewInformation3D;
// the object transformation
- basegfx::B2DHomMatrix* mpObjectTransformation;
+ basegfx::B2DHomMatrix maObjectTransformation;
// attributes
- drawinglayer::attribute::SdrSceneAttribute* mpSdrSceneAttribute;
- drawinglayer::attribute::SdrLightingAttribute* mpSdrLightingAttribute;
+ drawinglayer::attribute::SdrSceneAttribute maSdrSceneAttribute;
+ drawinglayer::attribute::SdrLightingAttribute maSdrLightingAttribute;
// create methods for ViewInformation3D and ObjectTransformation
void createViewInformation3D(const ::basegfx::B3DRange& rContentRange);
diff --git a/svx/inc/svx/sdr/contact/viewobjectcontactofgroup.hxx b/svx/inc/svx/sdr/contact/viewobjectcontactofgroup.hxx
index 89008bfd6b..c4da9afd4b 100644
--- a/svx/inc/svx/sdr/contact/viewobjectcontactofgroup.hxx
+++ b/svx/inc/svx/sdr/contact/viewobjectcontactofgroup.hxx
@@ -46,9 +46,6 @@ namespace sdr
ViewObjectContactOfGroup(ObjectContact& rObjectContact, ViewContact& rViewContact);
virtual ~ViewObjectContactOfGroup();
- // test this VOC for visibility concerning model-view stuff like e.g. Layer
- virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const;
-
// This method recursively paints the draw hierarchy.
virtual drawinglayer::primitive2d::Primitive2DSequence getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const;
};
diff --git a/svx/inc/svx/sdr/primitive2d/sdrattributecreator.hxx b/svx/inc/svx/sdr/primitive2d/sdrattributecreator.hxx
index d5a313d4c1..56881364da 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrattributecreator.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrattributecreator.hxx
@@ -46,7 +46,7 @@ namespace drawinglayer { namespace attribute {
class SdrShadowTextAttribute;
class SdrLineShadowTextAttribute;
class SdrLineFillShadowTextAttribute;
- class SdrLineFillShadowAttribute;
+ class SdrLineFillShadowAttribute3D;
class SdrSceneAttribute;
class SdrLightingAttribute;
class SdrFillTextAttribute;
@@ -63,13 +63,21 @@ namespace drawinglayer
namespace primitive2d
{
// SdrAttribute creators
- attribute::SdrLineAttribute* createNewSdrLineAttribute(const SfxItemSet& rSet);
- attribute::SdrLineStartEndAttribute* createNewSdrLineStartEndAttribute(const SfxItemSet& rSet, double fWidth);
- attribute::SdrShadowAttribute* createNewSdrShadowAttribute(const SfxItemSet& rSet);
- attribute::SdrFillAttribute* createNewSdrFillAttribute(const SfxItemSet& rSet);
+ attribute::SdrLineAttribute createNewSdrLineAttribute(
+ const SfxItemSet& rSet);
+
+ attribute::SdrLineStartEndAttribute createNewSdrLineStartEndAttribute(
+ const SfxItemSet& rSet,
+ double fWidth);
+
+ attribute::SdrShadowAttribute createNewSdrShadowAttribute(
+ const SfxItemSet& rSet);
+
+ attribute::SdrFillAttribute createNewSdrFillAttribute(
+ const SfxItemSet& rSet);
// #i101508# Support handing over given text-to-border distances
- attribute::SdrTextAttribute* createNewSdrTextAttribute(
+ attribute::SdrTextAttribute createNewSdrTextAttribute(
const SfxItemSet& rSet,
const SdrText& rText,
const sal_Int32* pLeft = 0,
@@ -77,20 +85,37 @@ namespace drawinglayer
const sal_Int32* pRight = 0,
const sal_Int32* pLower = 0);
- attribute::FillGradientAttribute* createNewTransparenceGradientAttribute(const SfxItemSet& rSet);
- attribute::SdrFillBitmapAttribute* createNewSdrFillBitmapAttribute(const SfxItemSet& rSet);
- attribute::SdrShadowTextAttribute* createNewSdrShadowTextAttribute(
+ attribute::FillGradientAttribute createNewTransparenceGradientAttribute(
+ const SfxItemSet& rSet);
+
+ attribute::SdrFillBitmapAttribute createNewSdrFillBitmapAttribute(
+ const SfxItemSet& rSet);
+
+ attribute::SdrShadowTextAttribute createNewSdrShadowTextAttribute(
const SfxItemSet& rSet,
- const SdrText& rText,
+ const SdrText* pText,
bool bSuppressText); // #i98072# added option to suppress text on demand
- attribute::SdrLineShadowTextAttribute* createNewSdrLineShadowTextAttribute(const SfxItemSet& rSet, const SdrText& rText);
- attribute::SdrLineFillShadowTextAttribute* createNewSdrLineFillShadowTextAttribute(const SfxItemSet& rSet, const SdrText& rText);
- attribute::SdrLineFillShadowAttribute* createNewSdrLineFillShadowAttribute(const SfxItemSet& rSet, bool bSuppressFill);
- attribute::SdrSceneAttribute* createNewSdrSceneAttribute(const SfxItemSet& rSet);
- attribute::SdrLightingAttribute* createNewSdrLightingAttribute(const SfxItemSet& rSet);
+
+ attribute::SdrLineShadowTextAttribute createNewSdrLineShadowTextAttribute(
+ const SfxItemSet& rSet,
+ const SdrText* pText);
+
+ attribute::SdrLineFillShadowTextAttribute createNewSdrLineFillShadowTextAttribute(
+ const SfxItemSet& rSet,
+ const SdrText* pText);
+
+ attribute::SdrLineFillShadowAttribute3D createNewSdrLineFillShadowAttribute(
+ const SfxItemSet& rSet,
+ bool bSuppressFill);
+
+ attribute::SdrSceneAttribute createNewSdrSceneAttribute(
+ const SfxItemSet& rSet);
+
+ attribute::SdrLightingAttribute createNewSdrLightingAttribute(
+ const SfxItemSet& rSet);
// #i101508# Support handing over given text-to-border distances
- attribute::SdrFillTextAttribute* createNewSdrFillTextAttribute(
+ attribute::SdrFillTextAttribute createNewSdrFillTextAttribute(
const SfxItemSet& rSet,
const SdrText* pSdrText,
const sal_Int32* pLeft = 0,
@@ -99,7 +124,11 @@ namespace drawinglayer
const sal_Int32* pLower = 0);
// helpers
- void calculateRelativeCornerRadius(sal_Int32 nRadius, const ::basegfx::B2DRange& rObjectRange, double& rfCornerRadiusX, double& rfCornerRadiusY);
+ void calculateRelativeCornerRadius(
+ sal_Int32 nRadius,
+ const ::basegfx::B2DRange& rObjectRange,
+ double& rfCornerRadiusX,
+ double& rfCornerRadiusY);
} // end of namespace primitive2d
} // end of namespace drawinglayer
diff --git a/svx/inc/svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx
index c9adedf13f..be6ac39390 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx
@@ -30,8 +30,8 @@
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
+#include <svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
//////////////////////////////////////////////////////////////////////////////
// predefines
diff --git a/svx/inc/svx/sdr/primitive2d/sdrconnectorprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrconnectorprimitive2d.hxx
index 5b8a0fef9e..670b05882d 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrconnectorprimitive2d.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrconnectorprimitive2d.hxx
@@ -29,8 +29,8 @@
#define INCLUDED_SDR_PRIMITIVE2D_SDRCONNECTORPRIMITIVE2D_HXX
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
+#include <svx/sdr/attribute/sdrlineshadowtextattribute.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
//////////////////////////////////////////////////////////////////////////////
// predefines
diff --git a/svx/inc/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx
index cb821091d1..438551480e 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx
@@ -29,8 +29,8 @@
#define INCLUDED_SDR_PRIMITIVE2D_SDCUSTOMSHAPEPRIMITIVE2D_HXX
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <svx/sdr/attribute/sdrshadowtextattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
// predefines
diff --git a/svx/inc/svx/sdr/primitive2d/sdrdecompositiontools.hxx b/svx/inc/svx/sdr/primitive2d/sdrdecompositiontools.hxx
index 91628b73b9..6b24c5b18e 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrdecompositiontools.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrdecompositiontools.hxx
@@ -54,22 +54,22 @@ namespace drawinglayer
namespace primitive2d
{
Primitive2DReference createPolyPolygonFillPrimitive(
- const ::basegfx::B2DPolyPolygon& rUnitPolyPolygon,
- const ::basegfx::B2DHomMatrix& rObjectTransform,
+ const basegfx::B2DPolyPolygon& rUnitPolyPolygon,
+ const basegfx::B2DHomMatrix& rObjectTransform,
const attribute::SdrFillAttribute& rFill,
- const attribute::FillGradientAttribute* pFillGradient = 0L);
+ const attribute::FillGradientAttribute& rFillGradient);
Primitive2DReference createPolygonLinePrimitive(
- const ::basegfx::B2DPolygon& rUnitPolygon,
- const ::basegfx::B2DHomMatrix& rObjectTransform,
+ const basegfx::B2DPolygon& rUnitPolygon,
+ const basegfx::B2DHomMatrix& rObjectTransform,
const attribute::SdrLineAttribute& rLine,
- const attribute::SdrLineStartEndAttribute* pStroke = 0L);
+ const attribute::SdrLineStartEndAttribute& rStroke);
Primitive2DReference createTextPrimitive(
- const ::basegfx::B2DPolyPolygon& rUnitPolyPolygon,
- const ::basegfx::B2DHomMatrix& rObjectTransform,
+ const basegfx::B2DPolyPolygon& rUnitPolyPolygon,
+ const basegfx::B2DHomMatrix& rObjectTransform,
const attribute::SdrTextAttribute& rText,
- const attribute::SdrLineAttribute* pStroke,
+ const attribute::SdrLineAttribute& rStroke,
bool bCellText,
bool bWordWrap,
bool bClipOnBounds);
diff --git a/svx/inc/svx/sdr/primitive2d/sdrellipseprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrellipseprimitive2d.hxx
index 092b35f040..9ebec978cf 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrellipseprimitive2d.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrellipseprimitive2d.hxx
@@ -30,7 +30,7 @@
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
+#include <svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
// predefines
diff --git a/svx/inc/svx/sdr/primitive2d/sdrgrafprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrgrafprimitive2d.hxx
index cabc7092c3..052dda33ac 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrgrafprimitive2d.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrgrafprimitive2d.hxx
@@ -30,9 +30,8 @@
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <svtools/grfmgr.hxx>
+#include <svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
// predefines
diff --git a/svx/inc/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx
index 5e417e13ff..fca73f4a68 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrmeasureprimitive2d.hxx
@@ -29,8 +29,7 @@
#define INCLUDED_SDR_PRIMITIVE2D_SDRMEASUREPRIMITIVE2D_HXX
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
+#include <svx/sdr/attribute/sdrlineshadowtextattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
// predefines
diff --git a/svx/inc/svx/sdr/primitive2d/sdrole2primitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrole2primitive2d.hxx
index ef68326e5e..89415c7ecf 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrole2primitive2d.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrole2primitive2d.hxx
@@ -30,8 +30,7 @@
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
+#include <svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
// predefines
diff --git a/svx/inc/svx/sdr/primitive2d/sdrpathprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrpathprimitive2d.hxx
index f12793b12a..1b77622831 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrpathprimitive2d.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrpathprimitive2d.hxx
@@ -30,8 +30,8 @@
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
+#include <svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
//////////////////////////////////////////////////////////////////////////////
// predefines
diff --git a/svx/inc/svx/sdr/primitive2d/sdrprimitivetools.hxx b/svx/inc/svx/sdr/primitive2d/sdrprimitivetools.hxx
index a96d2cab18..1b034b56ef 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrprimitivetools.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrprimitivetools.hxx
@@ -36,7 +36,6 @@
namespace basegfx {
class BColor;
- class B2DHomMatrix;
}
//////////////////////////////////////////////////////////////////////////////
@@ -51,10 +50,6 @@ namespace drawinglayer
// create a 7x7 gluepoint symbol in given colors as BitmapEx
BitmapEx createDefaultGluepoint_7x7(const basegfx::BColor& rBColorA, const basegfx::BColor& rBColorB);
-
- // #i99123#
- Primitive2DReference createFallbackHitTestPrimitive(const basegfx::B2DHomMatrix& rMatrix);
-
} // end of namespace primitive2d
} // end of namespace drawinglayer
diff --git a/svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx
index 364e86643e..ef63701576 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx
@@ -30,8 +30,8 @@
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
+#include <svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx>
+#include <svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
// predefines
diff --git a/drawinglayer/source/primitive2d/alphaprimitive2d.cxx b/svx/inc/svx/sdr/properties/oleproperties.hxx
index 3d0f1ed69d..c2621b124f 100644
--- a/drawinglayer/source/primitive2d/alphaprimitive2d.cxx
+++ b/svx/inc/svx/sdr/properties/oleproperties.hxx
@@ -2,10 +2,13 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2000, 2010 Oracle and/or its affiliates.
+ * Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
*
+ * $RCSfile: graphicproperties.hxx,v $
+ * $Revision: 1.6 $
+ *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -25,46 +28,42 @@
*
************************************************************************/
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_drawinglayer.hxx"
-
-#include <drawinglayer/primitive2d/alphaprimitive2d.hxx>
-#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
-
-//////////////////////////////////////////////////////////////////////////////
+#ifndef _SDR_PROPERTIES_OLEPROPERTIES_HXX
+#define _SDR_PROPERTIES_OLEPROPERTIES_HXX
-using namespace com::sun::star;
+#include <svx/sdr/properties/rectangleproperties.hxx>
//////////////////////////////////////////////////////////////////////////////
-namespace drawinglayer
+namespace sdr
{
- namespace primitive2d
+ namespace properties
{
- AlphaPrimitive2D::AlphaPrimitive2D(
- const Primitive2DSequence& rChildren,
- const Primitive2DSequence& rAlpha)
- : GroupPrimitive2D(rChildren),
- maAlpha(rAlpha)
+ class OleProperties : public RectangleProperties
{
- }
+ protected:
+ public:
+ // basic constructor
+ OleProperties(SdrObject& rObj);
- bool AlphaPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
- {
- if(GroupPrimitive2D::operator==(rPrimitive))
- {
- const AlphaPrimitive2D& rCompare = (AlphaPrimitive2D&)rPrimitive;
+ // constructor for copying, but using new object
+ OleProperties(const OleProperties& rProps, SdrObject& rObj);
- return (getAlpha() == rCompare.getAlpha());
- }
+ // destructor
+ virtual ~OleProperties();
- return false;
- }
+ // Clone() operator, normally just calls the local copy constructor
+ virtual BaseProperties& Clone(SdrObject& rObj) const;
- // provide unique ID
- ImplPrimitrive2DIDBlock(AlphaPrimitive2D, PRIMITIVE2D_ID_ALPHAPRIMITIVE2D)
- } // end of namespace primitive2d
-} // end of namespace drawinglayer
+ // force default attributes for a specific object type, called from
+ // DefaultProperties::GetObjectItemSet() if a new ItemSet is created
+ virtual void ForceDefaultAttributes();
+ };
+ } // end of namespace properties
+} // end of namespace sdr
//////////////////////////////////////////////////////////////////////////////
+
+#endif //_SDR_PROPERTIES_OLEPROPERTIES_HXX
+
// eof
diff --git a/svx/inc/svx/sdrmasterpagedescriptor.hxx b/svx/inc/svx/sdrmasterpagedescriptor.hxx
index c5e83fcd6f..2fa6a603dd 100644
--- a/svx/inc/svx/sdrmasterpagedescriptor.hxx
+++ b/svx/inc/svx/sdrmasterpagedescriptor.hxx
@@ -34,6 +34,7 @@
//////////////////////////////////////////////////////////////////////////////
// predeclarations
class SdrObject;
+class SfxItemSet;
namespace sdr
{
@@ -49,17 +50,20 @@ namespace sdr
{
class MasterPageDescriptor : public sdr::PageUser
{
+ private:
SdrPage& maOwnerPage;
SdrPage& maUsedPage;
SetOfByte maVisibleLayers;
// ViewContact part
sdr::contact::ViewContact* mpViewContact;
- virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
// assignment operator defined, but not implemented
void operator=(const MasterPageDescriptor& rCandidate);
+ protected:
+ virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+
public:
MasterPageDescriptor(SdrPage& aOwnerPage, SdrPage& aUsedPage);
virtual ~MasterPageDescriptor();
@@ -86,8 +90,7 @@ namespace sdr
sal_Bool operator==(const MasterPageDescriptor& rCandidate) const;
sal_Bool operator!=(const MasterPageDescriptor& rCandidate) const;
- // #i42075# Get the correct BackgroundObject
- SdrObject* GetBackgroundObject() const;
+ const SfxItemSet& getCorrectFillAttributes() const;
};
} // end of namespace sdr
diff --git a/svx/inc/svx/sphere3d.hxx b/svx/inc/svx/sphere3d.hxx
index 4bfb958c24..0d02126497 100644
--- a/svx/inc/svx/sphere3d.hxx
+++ b/svx/inc/svx/sphere3d.hxx
@@ -41,15 +41,12 @@
class SVX_DLLPUBLIC E3dSphereObj : public E3dCompoundObject
{
private:
- // #110094# DrawContact section
- virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
-
- virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
-
basegfx::B3DPoint aCenter;
basegfx::B3DVector aSize;
protected:
+ virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+ virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
void SetDefaultAttributes(E3dDefaultAttributes& rDefault);
public:
diff --git a/svx/inc/svx/svdoashp.hxx b/svx/inc/svx/svdoashp.hxx
index c2e10c8ba1..572212c2fb 100644
--- a/svx/inc/svx/svdoashp.hxx
+++ b/svx/inc/svx/svdoashp.hxx
@@ -85,15 +85,16 @@ struct SdrCustomShapeInteraction
class SVX_DLLPUBLIC SdrObjCustomShape : public SdrTextObj
{
+private:
// fObjectRotation is containing the object rotation in degrees.
double fObjectRotation;
-private:
- // BaseProperties section
- virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
-
+protected:
virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+public:
+ virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
+
// to allow sdr::properties::CustomShapeProperties access
friend class sdr::properties::CustomShapeProperties;
diff --git a/svx/inc/svx/svdoattr.hxx b/svx/inc/svx/svdoattr.hxx
index 7f4f2ef7fb..4ca52d79e8 100644
--- a/svx/inc/svx/svdoattr.hxx
+++ b/svx/inc/svx/svdoattr.hxx
@@ -52,11 +52,12 @@ class SfxItemPool;
class SVX_DLLPUBLIC SdrAttrObj : public SdrObject
{
- virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
-
+private:
friend class SdrOutliner;
protected:
+ virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
+
Rectangle maSnapRect;
protected:
diff --git a/svx/inc/svx/svdobj.hxx b/svx/inc/svx/svdobj.hxx
index 53e40ead03..ecc954cd8d 100644
--- a/svx/inc/svx/svdobj.hxx
+++ b/svx/inc/svx/svdobj.hxx
@@ -423,6 +423,7 @@ public:
// BaseProperties section
private:
sdr::properties::BaseProperties* mpProperties;
+protected:
virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
public:
virtual sdr::properties::BaseProperties& GetProperties() const;
@@ -431,6 +432,7 @@ public:
// #110094# DrawContact section
private:
sdr::contact::ViewContact* mpViewContact;
+protected:
virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
public:
sdr::contact::ViewContact& GetViewContact() const;
@@ -1097,11 +1099,6 @@ public:
sal_Bool IsTransparent( BOOL bCheckForAlphaChannel = FALSE ) const;
- // #111111#
- // Needed again and again i will now add a test for finding out if
- // this object is the BackgroundObject of the page.
- sal_Bool IsMasterPageBackgroundObject() const;
-
// #116168#
// Give info if object is in destruction
sal_Bool IsInDestruction() const;
diff --git a/svx/inc/svx/svdocapt.hxx b/svx/inc/svx/svdocapt.hxx
index 018422e905..dd1e33c1ec 100644
--- a/svx/inc/svx/svdocapt.hxx
+++ b/svx/inc/svx/svdocapt.hxx
@@ -60,19 +60,16 @@ public:
class SVX_DLLPUBLIC SdrCaptionObj : public SdrRectObj
{
- virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
private:
-
// to allow sdr::properties::CaptionProperties access to ImpRecalcTail()
friend class sdr::properties::CaptionProperties;
-
friend class SdrTextObj; // fuer ImpRecalcTail() bei AutoGrow
protected:
- // DrawContact section
-private:
+ virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+private:
Polygon aTailPoly; // das ganze Polygon des Schwanzes
sal_Bool mbSpecialTextBoxShadow; // for calc special shadow, default FALSE
sal_Bool mbFixedTail; // for calc note box fixed tail, default FALSE
diff --git a/svx/inc/svx/svdocirc.hxx b/svx/inc/svx/svdocirc.hxx
index 8271a7c283..c7ff437385 100644
--- a/svx/inc/svx/svdocirc.hxx
+++ b/svx/inc/svx/svdocirc.hxx
@@ -58,20 +58,17 @@ public:
class SVX_DLLPUBLIC SdrCircObj : public SdrRectObj
{
private:
- virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
-
// to allow sdr::properties::CircleProperties access to ImpSetAttrToCircInfo()
friend class sdr::properties::CircleProperties;
// only for SdrCircleAttributes
SdrObjKind GetCircleKind() const { return meCircleKind; }
- // DrawContact section
-private:
+protected:
virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+ virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
-protected:
- SdrObjKind meCircleKind;
+ SdrObjKind meCircleKind;
long nStartWink;
long nEndWink;
diff --git a/svx/inc/svx/svdoedge.hxx b/svx/inc/svx/svdoedge.hxx
index 9b965db9df..57ad25b0bf 100644
--- a/svx/inc/svx/svdoedge.hxx
+++ b/svx/inc/svx/svdoedge.hxx
@@ -157,19 +157,16 @@ public:
class SVX_DLLPUBLIC SdrEdgeObj : public SdrTextObj
{
private:
- virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
-
// to allow sdr::properties::ConnectorProperties access to ImpSetAttrToEdgeInfo()
friend class sdr::properties::ConnectorProperties;
friend class SdrCreateView;
friend class ImpEdgeHdl;
- // DrawContact section
-private:
+protected:
virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+ virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
-protected:
SdrObjConnection aCon1; // Verbindungszustand des Linienanfangs
SdrObjConnection aCon2; // Verbindungszustand des Linienendes
diff --git a/svx/inc/svx/svdograf.hxx b/svx/inc/svx/svdograf.hxx
index 6e0a3e92d3..c949be4ceb 100644
--- a/svx/inc/svx/svdograf.hxx
+++ b/svx/inc/svx/svdograf.hxx
@@ -85,22 +85,16 @@ class SdrGraphicLink;
class SVX_DLLPUBLIC SdrGrafObj : public SdrRectObj
{
private:
- // BaseProperties section
- SVX_DLLPRIVATE virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
-
- // DrawContact section
-private:
- virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
-
// to allow sdr::properties::GraphicProperties access to SetXPolyDirty()
friend class sdr::properties::GraphicProperties;
// to allow sdr::contact::ViewObjectContactOfGraphic access to ImpUpdateGraphicLink()
friend class sdr::contact::ViewObjectContactOfGraphic;
-
friend class SdrGraphicLink;
protected:
+ virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+ virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
void ImpSetAttrToGrafInfo(); // Werte vom Pool kopieren
void ImpSetGrafInfoToAttr(); // Werte in den Pool kopieren
diff --git a/svx/inc/svx/svdogrp.hxx b/svx/inc/svx/svdogrp.hxx
index fdcfb34203..bd99b55d86 100644
--- a/svx/inc/svx/svdogrp.hxx
+++ b/svx/inc/svx/svdogrp.hxx
@@ -46,14 +46,11 @@ class SfxItemSet;
class SVX_DLLPUBLIC SdrObjGroup : public SdrObject
{
- // BaseProperties section
- virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
-
- // #110094# DrawContact section
private:
+protected:
virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+ virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
-protected:
SdrObjList* pSub; // Subliste (Kinder)
long nDrehWink;
long nShearWink;
@@ -66,6 +63,7 @@ public:
SdrObjGroup();
virtual ~SdrObjGroup();
+ virtual void SetBoundRectDirty();
virtual UINT16 GetObjIdentifier() const;
virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const;
virtual SdrLayerID GetLayer() const;
diff --git a/svx/inc/svx/svdomeas.hxx b/svx/inc/svx/svdomeas.hxx
index 951fc3d464..f46c6147a8 100644
--- a/svx/inc/svx/svdomeas.hxx
+++ b/svx/inc/svx/svdomeas.hxx
@@ -66,18 +66,15 @@ public:
class SVX_DLLPUBLIC SdrMeasureObj : public SdrTextObj
{
private:
- virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
-
// to allow sdr::properties::MeasureProperties access to SetTextDirty()
friend class sdr::properties::MeasureProperties;
friend class SdrMeasureField;
- // DrawContact section
-private:
+protected:
virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+ virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
-protected:
Point aPt1;
Point aPt2;
FASTBOOL bTextDirty;
diff --git a/svx/inc/svx/svdomedia.hxx b/svx/inc/svx/svdomedia.hxx
index 9ece24349f..e76a3cc42c 100644
--- a/svx/inc/svx/svdomedia.hxx
+++ b/svx/inc/svx/svdomedia.hxx
@@ -80,11 +80,10 @@ public:
protected:
virtual void mediaPropertiesChanged( const ::avmedia::MediaItem& rNewState );
+ virtual ::sdr::contact::ViewContact* CreateObjectSpecificViewContact();
private:
- virtual ::sdr::contact::ViewContact* CreateObjectSpecificViewContact();
-
::avmedia::MediaItem maMediaProperties;
::std::auto_ptr< Graphic > mapGraphic;
};
diff --git a/svx/inc/svx/svdoole2.hxx b/svx/inc/svx/svdoole2.hxx
index ae70b42215..9312adde08 100644
--- a/svx/inc/svx/svdoole2.hxx
+++ b/svx/inc/svx/svdoole2.hxx
@@ -59,11 +59,10 @@ private:
SVX_DLLPRIVATE void GetObjRef_Impl();
SVX_DLLPRIVATE void SetGraphic_Impl(const Graphic* pGrf);
- // DrawContact section
-private:
+protected:
virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+ virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
-protected:
svt::EmbeddedObjectRef xObjRef;
Graphic* pGraphic;
String aProgName;
diff --git a/svx/inc/svx/svdopage.hxx b/svx/inc/svx/svdopage.hxx
index a53f41db4c..5b8d2661f7 100644
--- a/svx/inc/svx/svdopage.hxx
+++ b/svx/inc/svx/svdopage.hxx
@@ -41,17 +41,14 @@ public:
virtual void PageInDestruction(const SdrPage& rPage);
private:
- // BaseProperties section
- virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
-
- // DrawContact section
-private:
- virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
-
// #111111#
// To make things more safe, remember the page, not a number
SdrPage* mpShownPage;
+protected:
+ virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+ virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
+
public:
TYPEINFO();
SdrPageObj(SdrPage* pNewPage = 0L);
diff --git a/svx/inc/svx/svdopath.hxx b/svx/inc/svx/svdopath.hxx
index 1b2b33c196..471f5208f6 100644
--- a/svx/inc/svx/svdopath.hxx
+++ b/svx/inc/svx/svdopath.hxx
@@ -62,13 +62,12 @@ public:
class SVX_DLLPUBLIC SdrPathObj : public SdrTextObj
{
+private:
friend class ImpPathForDragAndCreate;
- // DrawContact section
-private:
+protected:
virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
-protected:
basegfx::B2DPolyPolygon maPathPolygon;
SdrObjKind meKind;
diff --git a/svx/inc/svx/svdorect.hxx b/svx/inc/svx/svdorect.hxx
index 79a8293883..b817b8e98f 100644
--- a/svx/inc/svx/svdorect.hxx
+++ b/svx/inc/svx/svdorect.hxx
@@ -51,19 +51,14 @@ namespace sdr { namespace properties {
class SVX_DLLPUBLIC SdrRectObj : public SdrTextObj
{
private:
- // BaseProperties section
- virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
-
// to allow sdr::properties::RectangleProperties access to SetXPolyDirty()
friend class sdr::properties::RectangleProperties;
-
- // DrawContact section
-private:
- virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
-
friend class SdrTextObj; // wg SetXPolyDirty bei GrowAdjust
protected:
+ virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+ virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
+
XPolygon* mpXPoly;
protected:
diff --git a/svx/inc/svx/svdotable.hxx b/svx/inc/svx/svdotable.hxx
index a6f617ec92..40f7a49a33 100644
--- a/svx/inc/svx/svdotable.hxx
+++ b/svx/inc/svx/svdotable.hxx
@@ -312,14 +312,10 @@ public:
private:
void init( sal_Int32 nColumns, sal_Int32 nRows );
- // BaseProperties section
- SVX_DLLPRIVATE virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
-
- // DrawContact section
-private:
+protected:
+ virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
-protected:
virtual SdrObjGeoData* NewGeoData() const;
virtual void SaveGeoData(SdrObjGeoData& rGeo) const;
virtual void RestGeoData(const SdrObjGeoData& rGeo);
diff --git a/svx/inc/svx/svdotext.hxx b/svx/inc/svx/svdotext.hxx
index db544f7b7b..0592401aaa 100644
--- a/svx/inc/svx/svdotext.hxx
+++ b/svx/inc/svx/svdotext.hxx
@@ -142,13 +142,11 @@ private:
// CustomShapeproperties need to access the "bTextFrame" member:
friend class sdr::properties::CustomShapeProperties;
- // BaseProperties section
- SVX_DLLPRIVATE virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
-
- // DrawContact section
-private:
+protected:
+ virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties();
virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
+private:
// This method is only allowed for sdr::properties::TextProperties
SVX_DLLPRIVATE SdrOutliner* GetTextEditOutliner() const
{
diff --git a/svx/inc/svx/svdovirt.hxx b/svx/inc/svx/svdovirt.hxx
index 1aa504ad80..8568b284e5 100644
--- a/svx/inc/svx/svdovirt.hxx
+++ b/svx/inc/svx/svdovirt.hxx
@@ -46,11 +46,9 @@ class SVX_DLLPUBLIC SdrVirtObj : public SdrObject
public:
virtual sdr::properties::BaseProperties& GetProperties() const;
-private:
- // AW, OD 2004-05-03 #i27224#
+protected:
virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
-protected:
SdrObject& rRefObj; // Referenziertes Zeichenobjekt
Rectangle aSnapRect;
diff --git a/svx/inc/svx/svdpage.hxx b/svx/inc/svx/svdpage.hxx
index e9b9d0287b..6b387da6fe 100644
--- a/svx/inc/svx/svdpage.hxx
+++ b/svx/inc/svx/svdpage.hxx
@@ -29,58 +29,26 @@
#define _SVDPAGE_HXX
#include <vcl/bitmap.hxx>
-
-#ifndef _PRINT_HXX //autogen
#include <vcl/print.hxx>
-#endif
-#ifndef _GDIMTF_HXX //autogen
#include <vcl/gdimtf.hxx>
-#endif
#include <tools/weakbase.hxx>
#include <cppuhelper/weakref.hxx>
#include <svx/svdtypes.hxx>
#include <svx/svdlayer.hxx>
-
-//////////////////////////////////////////////////////////////////////////////
-// sdr::Comment interface
#include <svx/sdrcomment.hxx>
-
-// #111111#
#include <vector>
#include <svx/sdrpageuser.hxx>
-
-// StandardCheckVisisbilityRedirector
#include <svx/sdr/contact/viewobjectcontactredirector.hxx>
#include <svx/sdrmasterpagedescriptor.hxx>
#include "svx/svxdllapi.h"
-
#include <com/sun/star/container/XIndexAccess.hpp>
#include <svx/svdobj.hxx>
#include <boost/scoped_ptr.hpp>
-// #110094#
-namespace sdr
-{
- namespace contact
- {
- class ViewContact;
- } // end of namespace contact
-} // end of namespace sdr
-
-// ------------------------------
-// - intern benutzte Paint-Modi -
-// ------------------------------
-
-//#if 0 // _SOLAR__PRIVATE
-
-#define IMP_PAGEPAINT_NORMAL 0
-#define IMP_PAGEPAINT_PREPARE_CACHE 1
-#define IMP_PAGEPAINT_PAINT_CACHE 2
-#define IMP_PAGEPAINT_PREPARE_BG_CACHE 3
-#define IMP_PAGEPAINT_PAINT_BG_CACHE 4
-
-//#endif // __PRIVATE
+//////////////////////////////////////////////////////////////////////////////
+// predefines
+namespace sdr { namespace contact { class ViewContact; }}
class SdrPage;
class SdrModel;
class SfxItemPool;
@@ -110,7 +78,11 @@ public:
SdrInsertReasonKind GetReason() const { return eReason; }
};
-class SVX_DLLPUBLIC SdrObjList {
+//////////////////////////////////////////////////////////////////////////////
+// class SdrObjList
+
+class SVX_DLLPUBLIC SdrObjList
+{
private:
typedef ::std::vector<SdrObject*> SdrObjectContainerType;
SdrObjectContainerType maList;
@@ -347,8 +319,12 @@ Objektes abgefragt sowie direkt gesetzt werden.
// Used for all methods which return a page number
#define SDRPAGE_NOTFOUND 0xFFFF
+//////////////////////////////////////////////////////////////////////////////
+// class SdrPageGridFrame
+
// Fuer das Fangraster/Punkgitter im Writer
-class SdrPageGridFrame {
+class SdrPageGridFrame
+{
Rectangle aPaper;
Rectangle aUserArea;
public:
@@ -380,8 +356,47 @@ public:
};
////////////////////////////////////////////////////////////////////////////////////////////////////
+// class SdrPageProperties
-class SVX_DLLPUBLIC SdrPage: public SdrObjList, public tools::WeakBase< SdrPage >
+class SVX_DLLPUBLIC SdrPageProperties : public SfxListener
+{
+private:
+ // data
+ SdrPage* mpSdrPage;
+ SfxStyleSheet* mpStyleSheet;
+ SfxItemSet* mpProperties;
+
+ // internal helpers
+ void ImpRemoveStyleSheet();
+ void ImpAddStyleSheet(SfxStyleSheet& rNewStyleSheet);
+
+ // not implemented
+ SdrPageProperties& operator=(const SdrPageProperties& rCandidate);
+
+public:
+ // construct/destruct
+ SdrPageProperties(SdrPage& rSdrPage);
+ SdrPageProperties(const SdrPageProperties& rCandidate);
+ virtual ~SdrPageProperties();
+
+ // Notify(...) from baseclass SfxListener
+ virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
+
+ // data read/write
+ const SfxItemSet& GetItemSet() const;
+ void PutItemSet(const SfxItemSet& rSet);
+ void PutItem(const SfxPoolItem& rItem);
+ void ClearItem(const sal_uInt16 nWhich = 0);
+
+ // StyleSheet access
+ void SetStyleSheet(SfxStyleSheet* pStyleSheet);
+ SfxStyleSheet* GetStyleSheet() const;
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// class SdrPage
+
+class SVX_DLLPUBLIC SdrPage : public SdrObjList, public tools::WeakBase< SdrPage >
{
///////////////////////////////////////////////////////////////////////////////
// start PageUser section
@@ -400,6 +415,7 @@ public:
// #110094# DrawContact section
private:
sdr::contact::ViewContact* mpViewContact;
+protected:
virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact();
public:
sdr::contact::ViewContact& GetViewContact() const;
@@ -426,9 +442,15 @@ friend class ChXChartDocument;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxUnoPage;
protected:
- SdrLayerAdmin* pLayerAdmin;
- SdrObject* pBackgroundObj;
+ SdrLayerAdmin* pLayerAdmin;
+private:
+ SdrPageProperties* mpSdrPageProperties;
+public:
+ SdrPageProperties& getSdrPageProperties() { return *mpSdrPageProperties; }
+ const SdrPageProperties& getSdrPageProperties() const { return *mpSdrPageProperties; }
+
+protected:
// new MasterPageDescriptorVector
::sdr::MasterPageDescriptor* mpMasterPageDescriptor;
@@ -533,9 +555,6 @@ public:
bool IsSwappingLocked() const { return mbSwappingLocked; }
void SetSwappingLocked(bool bLock) { mbSwappingLocked = bLock; }
- SdrObject* GetBackgroundObj() const { return pBackgroundObj; }
- void SetBackgroundObj( SdrObject* pObj );
-
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getUnoPage();
virtual SfxStyleSheet* GetTextStyleSheetForObject( SdrObject* pObj ) const;
@@ -563,8 +582,8 @@ public:
/** Check if page is the HandoutMasterPage (in SVX, no PK_HANDOUT available) */
bool isHandoutMasterPage() const;
-//////////////////////////////////////////////////////////////////////////////
-// sdr::Comment interface
+ //////////////////////////////////////////////////////////////////////////////
+ // sdr::Comment interface
private:
sdr::CommentVector maComments;
@@ -573,8 +592,6 @@ public:
const sdr::Comment& GetCommentByIndex(sal_uInt32 nIndex);
void AddComment(const sdr::Comment& rNew);
void ReplaceCommentByIndex(sal_uInt32 nIndex, const sdr::Comment& rNew);
-
-//////////////////////////////////////////////////////////////////////////////
};
typedef tools::WeakReference< SdrPage > SdrPageWeakRef;
diff --git a/svx/inc/svx/unomodel.hxx b/svx/inc/svx/unomodel.hxx
index 99dcd35ec4..0f13b9eeb3 100644
--- a/svx/inc/svx/unomodel.hxx
+++ b/svx/inc/svx/unomodel.hxx
@@ -99,12 +99,12 @@ public:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XAnyCompare > SAL_CALL createAnyCompareByName( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
};
-SVX_DLLPUBLIC extern sal_Bool SvxDrawingLayerExport( SdrModel* pModel, com::sun::star::uno::Reference<com::sun::star::io::XOutputStream> xOut );
-SVX_DLLPUBLIC extern sal_Bool SvxDrawingLayerExport( SdrModel* pModel, com::sun::star::uno::Reference<com::sun::star::io::XOutputStream> xOut, com::sun::star::uno::Reference< com::sun::star::lang::XComponent > xComponent );
-SVX_DLLPUBLIC extern sal_Bool SvxDrawingLayerExport( SdrModel* pModel, com::sun::star::uno::Reference<com::sun::star::io::XOutputStream> xOut, com::sun::star::uno::Reference< com::sun::star::lang::XComponent > xComponent, const char* pExportService );
-SVX_DLLPUBLIC extern sal_Bool SvxDrawingLayerImport( SdrModel* pModel, com::sun::star::uno::Reference<com::sun::star::io::XInputStream> xInputStream );
-SVX_DLLPUBLIC extern sal_Bool SvxDrawingLayerImport( SdrModel* pModel, com::sun::star::uno::Reference<com::sun::star::io::XInputStream> xInputStream, com::sun::star::uno::Reference< com::sun::star::lang::XComponent > xComponent );
-SVX_DLLPUBLIC extern sal_Bool SvxDrawingLayerImport( SdrModel* pModel, com::sun::star::uno::Reference<com::sun::star::io::XInputStream> xInputStream, com::sun::star::uno::Reference< com::sun::star::lang::XComponent > xComponent, const char* pImportService );
+SVX_DLLPUBLIC extern sal_Bool SvxDrawingLayerExport( SdrModel* pModel, const com::sun::star::uno::Reference<com::sun::star::io::XOutputStream>& xOut );
+SVX_DLLPUBLIC extern sal_Bool SvxDrawingLayerExport( SdrModel* pModel, const com::sun::star::uno::Reference<com::sun::star::io::XOutputStream>& xOut, const com::sun::star::uno::Reference< com::sun::star::lang::XComponent >& xComponent );
+SVX_DLLPUBLIC extern sal_Bool SvxDrawingLayerExport( SdrModel* pModel, const com::sun::star::uno::Reference<com::sun::star::io::XOutputStream>& xOut, const com::sun::star::uno::Reference< com::sun::star::lang::XComponent >& xComponent, const char* pExportService );
+SVX_DLLPUBLIC extern sal_Bool SvxDrawingLayerImport( SdrModel* pModel, const com::sun::star::uno::Reference<com::sun::star::io::XInputStream>& xInputStream );
+SVX_DLLPUBLIC extern sal_Bool SvxDrawingLayerImport( SdrModel* pModel, const com::sun::star::uno::Reference<com::sun::star::io::XInputStream>& xInputStream, const com::sun::star::uno::Reference< com::sun::star::lang::XComponent >& xComponent );
+SVX_DLLPUBLIC extern sal_Bool SvxDrawingLayerImport( SdrModel* pModel, const com::sun::star::uno::Reference<com::sun::star::io::XInputStream>& xInputStream, const com::sun::star::uno::Reference< com::sun::star::lang::XComponent >& xComponent, const char* pImportService );
#endif
diff --git a/svx/prj/build.lst b/svx/prj/build.lst
index 5b99711eda..7fe1114e7e 100644
--- a/svx/prj/build.lst
+++ b/svx/prj/build.lst
@@ -35,3 +35,4 @@ sx svx\source\customshapes nmake - all sx_customshapes sx_inc NULL
sx svx\source\toolbars nmake - all sx_toolbars sx_inc NULL
sx svx\util nmake - all sx_util sx_3deng sx_dlg sx_draw sx_attribute sx_properties sx_contact sx_event sx_animation sx_primitive2d sx_primitive3d sx_overlay sx_fmcmp sx_form sx_gall sx_items sx_mnuc sx_sdi sx_stbc sx_tbxc sx_undrw sx_ungal sx_xml sx_xout sx_accessibility sx_intro sx_customshapes sx_toolbars sx_table sx_smarttags NULL
sx svx\source\gengal nmake - all sx_gengal sx_util NULL
+sx svx\qa\unoapi nmake - all sx_qa_unoapi NULL
diff --git a/svx/prj/d.lst b/svx/prj/d.lst
index 8b4675feb3..7d2f508d9d 100644
--- a/svx/prj/d.lst
+++ b/svx/prj/d.lst
@@ -637,6 +637,9 @@ mkdir: %_DEST%\inc%_EXT%\svx\sdr\overlay
..\inc\svx\sdr\overlay\overlayselection.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlayselection.hxx
..\inc\svx\sdr\overlay\overlaytools.hxx %_DEST%\inc%_EXT%\svx\sdr\overlay\overlaytools.hxx
+mkdir: %_DEST%\inc%_EXT%\svx\sdr\primitive2d
+..\inc\svx\sdr\primitive2d\sdrprimitivetools.hxx %_DEST%\inc%_EXT%\svx\sdr\primitive2d\sdrprimitivetools.hxx
+
mkdir: %_DEST%\inc%_EXT%\svx\sdr\animation
..\inc\svx\sdr\animation\ainfographic.hxx %_DEST%\inc%_EXT%\svx\sdr\animation\ainfographic.hxx
..\inc\svx\sdr\animation\ainfoscrolltext.hxx %_DEST%\inc%_EXT%\svx\sdr\animation\ainfoscrolltext.hxx
diff --git a/svx/qa/unoapi/Test.java b/svx/qa/unoapi/Test.java
new file mode 100644
index 0000000000..90abd12776
--- /dev/null
+++ b/svx/qa/unoapi/Test.java
@@ -0,0 +1,51 @@
+/*************************************************************************
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+************************************************************************/
+
+package org.openoffice.svx.qa.unoapi;
+
+import org.openoffice.Runner;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
+
+public final class Test {
+ @org.junit.Before public void setUp() throws Exception {
+ connection.setUp();
+ }
+
+ @org.junit.After public void tearDown()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ connection.tearDown();
+ }
+
+ @org.junit.Test public void test() {
+ assertTrue(
+ Runner.run(
+ "-sce", "svx.sce", "-xcl", "knownissues.xcl", "-tdoc",
+ "testdocuments", "-cs", connection.getDescription()));
+ }
+
+ private final OfficeConnection connection = new OfficeConnection();
+}
diff --git a/svx/qa/unoapi/makefile.mk b/svx/qa/unoapi/makefile.mk
index a64401995a..133e9a3458 100644
--- a/svx/qa/unoapi/makefile.mk
+++ b/svx/qa/unoapi/makefile.mk
@@ -1,7 +1,6 @@
#*************************************************************************
-#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -22,19 +21,28 @@
# version 3 along with OpenOffice.org. If not, see
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
+#***********************************************************************/
-PRJ=..$/..
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
-PRJNAME=svx
-TARGET=qa_unoapi
+PRJ = ../..
+PRJNAME = svx
+TARGET = qa_unoapi
-.INCLUDE: settings.mk
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = org/openoffice/svx/qa/unoapi
+JAVATESTFILES = Test.java
+JAVAFILES = $(JAVATESTFILES)
+JARFILES = OOoRunner.jar ridl.jar test.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+.END
+.INCLUDE: settings.mk
.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
-ALLTAR : UNOAPI_TEST
+ALLTAR : javatest
-UNOAPI_TEST:
- +$(SOLARENV)$/bin$/checkapi -sce svx.sce -xcl knownissues.xcl -tdoc $(PWD)$/testdocuments
+.END
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index 912a620f4b..bf8b234493 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -13165,31 +13165,6 @@ SfxVoidItem SpellCheckerChanged SID_SPELLCHECKER_CHANGED
]
//--------------------------------------------------------------------------
-SfxVoidItem PrepareMailExport SID_MAIL_PREPAREEXPORT
-()
-[
- /* flags: */
- AutoUpdate = FALSE,
- Cachable = Cachable,
- FastCall = FALSE,
- HasCoreId = FALSE,
- HasDialog = FALSE,
- ReadOnlyDoc = FALSE,
- Toggle = FALSE,
- Container = FALSE,
- RecordAbsolute = FALSE,
- RecordPerSet;
- Synchron;
-
- /* config: */
- AccelConfig = FALSE,
- MenuConfig = FALSE,
- StatusBarConfig = FALSE,
- ToolBoxConfig = FALSE,
- GroupId = GID_EXPLORER;
-]
-
-//--------------------------------------------------------------------------
SfxUInt16Item Year2000 SID_ATTR_YEAR2000
()
[
diff --git a/svx/source/accessibility/AccessibleEmptyEditSource.cxx b/svx/source/accessibility/AccessibleEmptyEditSource.cxx
index 89f3e20f54..42c1b5a114 100644
--- a/svx/source/accessibility/AccessibleEmptyEditSource.cxx
+++ b/svx/source/accessibility/AccessibleEmptyEditSource.cxx
@@ -122,7 +122,7 @@ namespace accessibility
USHORT GetItemState( const ESelection& /*rSel*/, USHORT /*nWhich*/ ) const { return 0; }
USHORT GetItemState( USHORT /*nPara*/, USHORT /*nWhich*/ ) const { return 0; }
-
+
SfxItemPool* GetPool() const { return NULL; }
void QuickInsertText( const String& /*rText*/, const ESelection& /*rSel*/ ) {}
@@ -142,6 +142,8 @@ namespace accessibility
{
return XubString();
}
+ void FieldClicked( const SvxFieldItem&, USHORT, xub_StrLen ) {;}
+
BOOL IsValid() const { return sal_True; }
void SetNotifyHdl( const Link& ) {}
diff --git a/svx/source/accessibility/AccessibleTextHelper.cxx b/svx/source/accessibility/AccessibleTextHelper.cxx
index d723b0cc51..b9d82c6eac 100644
--- a/svx/source/accessibility/AccessibleTextHelper.cxx
+++ b/svx/source/accessibility/AccessibleTextHelper.cxx
@@ -49,10 +49,6 @@
#include <com/sun/star/accessibility/XAccessible.hpp>
#include <com/sun/star/accessibility/XAccessibleContext.hpp>
#include <com/sun/star/accessibility/XAccessibleComponent.hpp>
-#include <com/sun/star/accessibility/AccessibleRole.hpp>
-#include <com/sun/star/accessibility/AccessibleTextType.hpp>
-#include <com/sun/star/accessibility/XAccessibleText.hpp>
-#include <com/sun/star/accessibility/XAccessibleEditableText.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <comphelper/accessibleeventnotifier.hxx>
#include <unotools/accessiblestatesethelper.hxx>
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx
index 3644b2b3a2..410f792fd1 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx
@@ -1706,19 +1706,6 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm
if(aNewB2DPolyPolygon.count())
{
- if( !bLineGeometryNeededOnly )
- {
- // hack aNewB2DPolyPolygon to fill logic rect - this is
- // needed to produce gradient fills that look like mso
- aNewB2DPolygon.clear();
- aNewB2DPolygon.append(basegfx::B2DPoint(0,0));
- aNewB2DPolyPolygon.append(aNewB2DPolygon);
-
- aNewB2DPolygon.clear();
- aNewB2DPolygon.append(basegfx::B2DPoint(aLogicRect.GetWidth(),
- aLogicRect.GetHeight()));
- aNewB2DPolyPolygon.append(aNewB2DPolygon);
- }
// #i37011#
bool bForceCreateTwoObjects(false);
diff --git a/svx/source/dialog/dlgctl3d.cxx b/svx/source/dialog/dlgctl3d.cxx
index 8923ca6776..9d6644f5fb 100644
--- a/svx/source/dialog/dlgctl3d.cxx
+++ b/svx/source/dialog/dlgctl3d.cxx
@@ -511,8 +511,17 @@ void Svx3DLightControl::TrySelection(Point aPosPixel)
if(aResult.size())
{
- // take the frontmost one
- const E3dCompoundObject* pResult = aResult[0];
+ // exclude expansion object which will be part of
+ // the hits. It's invisible, but for HitTest, it's included
+ const E3dCompoundObject* pResult = 0;
+
+ for(sal_uInt32 b(0); !pResult && b < aResult.size(); b++)
+ {
+ if(aResult[b] && aResult[b] != mpExpansionObject)
+ {
+ pResult = aResult[b];
+ }
+ }
if(pResult == mp3DObj)
{
@@ -777,8 +786,8 @@ void Svx3DLightControl::GetPosition(double& rHor, double& rVer)
}
if(IsGeometrySelected())
{
- rHor = mfRotateY;
- rVer = mfRotateX;
+ rHor = mfRotateY / F_PI180; // 0..360.0
+ rVer = mfRotateX / F_PI180; // -90.0..90.0
}
}
@@ -821,8 +830,8 @@ void Svx3DLightControl::SetPosition(double fHor, double fVer)
{
if(mfRotateX != fVer || mfRotateY != fHor)
{
- mfRotateX = fVer;
- mfRotateY = fHor;
+ mfRotateX = fVer * F_PI180;
+ mfRotateY = fHor * F_PI180;
if(mp3DObj)
{
diff --git a/svx/source/dialog/docrecovery.src b/svx/source/dialog/docrecovery.src
index 67df927ee8..32c3560031 100644
--- a/svx/source/dialog/docrecovery.src
+++ b/svx/source/dialog/docrecovery.src
@@ -370,7 +370,7 @@ TabPage RID_SVXPAGE_ERR_REP_WELCOME
Pos = MAP_APPFONT( RECOV_COL1, RECOV_ROW2 );
Size = MAP_APPFONT( RECOV_CONTROLWIDTH, (RECOV_ROW7-RECOV_ROW2-RSC_SP_CTRL_Y) );
WordBreak = TRUE;
- Text[ en-US ] = "This error report tool gathers information about how %PRODUCTNAME is working and sends it to Sun Microsystems to help improve future versions.\n\nIt's easy - just send the report without any further effort on your part by clicking 'Send' in the next dialog, or you can briefly describe how the error occurred and then click 'Send'. If you want to see the report, click the 'Show Report' button. No data will be sent if you click 'Do Not Send'.\n\nCustomer Privacy\nThe information gathered is limited to data concerning the state of %PRODUCTNAME %PRODUCTVERSION when the error occurred. Other information about passwords or document contents is not collected.\n\nThe information will only be used to improve the quality of %PRODUCTNAME and will not be shared with third parties.\nFor more information on Sun Microsystems' privacy policy, visit\nhttp://www.sun.com/privacy/";
+ Text[ en-US ] = "This error report tool gathers information about how %PRODUCTNAME is working and sends it to Oracle to help improve future versions.\n\nIt's easy - just send the report without any further effort on your part by clicking 'Send' in the next dialog, or you can briefly describe how the error occurred and then click 'Send'. If you want to see the report, click the 'Show Report' button. No data will be sent if you click 'Do Not Send'.\n\nCustomer Privacy\nThe information gathered is limited to data concerning the state of %PRODUCTNAME %PRODUCTVERSION when the error occurred. Other information about passwords or document contents is not collected.\n\nThe information will only be used to improve the quality of %PRODUCTNAME and will not be shared with third parties.\nFor more information on Oracle's privacy policy, visit\nwww.oracle.com/html/services-privacy-policy.html";
};
FixedLine FL_RECOV_BOTTOM
{
@@ -472,7 +472,7 @@ TabPage RID_SVXPAGE_ERR_REP_SEND
Pos = MAP_APPFONT( ERRSEND_COL0, ERRSEND_ROW12 );
Size = MAP_APPFONT( ERRSEND_CONTROLWIDTH2, RSC_CD_CHECKBOX_HEIGHT );
Check = FALSE;
- Text[ en-US ] = "~I allow Sun Microsystems to contact me regarding this report.";
+ Text[ en-US ] = "~I allow Oracle to contact me regarding this report.";
};
FixedText FT_ERRSEND_EMAILADDR
{
diff --git a/svx/source/dialog/hyprlink.cxx b/svx/source/dialog/hyprlink.cxx
index 082c4a9651..985e2e4b9b 100644
--- a/svx/source/dialog/hyprlink.cxx
+++ b/svx/source/dialog/hyprlink.cxx
@@ -482,7 +482,7 @@ void SvxHyperlinkDlg::TargetMenu(const String& rSelEntry, BOOL bExecute)
if (pVwFrm) // Alle moeglichen Target Frames zusammensammeln und anzeigen
{
TargetList aList;
- pVwFrm->GetTopFrame()->GetTargetList(aList);
+ pVwFrm->GetTopFrame().GetTargetList(aList);
USHORT nCount = (USHORT)aList.Count();
if( nCount )
@@ -960,7 +960,7 @@ void SvxHyperlinkDlg::OpenDoc( const String& rURL, SfxViewFrame* pViewFrame )
if ( pViewFrame )
{
- SfxFrameItem aView( SID_DOCFRAME, pViewFrame ? pViewFrame->GetFrame() : NULL );
+ SfxFrameItem aView( SID_DOCFRAME, pViewFrame ? &pViewFrame->GetFrame() : NULL );
if ( pDisp )
pDisp->Execute( SID_OPENDOC, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD,
&aName, &aView, &aNewView, &aSilent, &aReadOnly, &aReferer, &aExternal, 0L );
diff --git a/svx/source/dialog/rubydialog.cxx b/svx/source/dialog/rubydialog.cxx
index ebe71cf370..e152afc2b9 100644
--- a/svx/source/dialog/rubydialog.cxx
+++ b/svx/source/dialog/rubydialog.cxx
@@ -321,7 +321,7 @@ void SvxRubyDialog::Activate()
aStylistPB.Enable(bEnable);
//get selection from current view frame
SfxViewFrame* pCurFrm = SfxViewFrame::Current();
- Reference< XController > xCtrl = pCurFrm->GetFrame()->GetController();
+ Reference< XController > xCtrl = pCurFrm->GetFrame().GetController();
pImpl->SetController(xCtrl);
if(pImpl->HasSelectionChanged())
{
diff --git a/svx/source/dialog/srchdlg.src b/svx/source/dialog/srchdlg.src
index feba788b1c..f00a6c8093 100644
--- a/svx/source/dialog/srchdlg.src
+++ b/svx/source/dialog/srchdlg.src
@@ -237,7 +237,7 @@ ModelessDialog RID_SVXDLG_SEARCH
{
Pos = MAP_APPFONT ( 12 , 163 ) ;
Size = MAP_APPFONT ( 126 , 10 ) ;
- Text [ en-US ] = "Current selection ~only" ;
+ Text [ en-US ] = "C~urrent selection only" ;
TabStop = TRUE ;
Hide = TRUE ;
};
@@ -346,7 +346,7 @@ ModelessDialog RID_SVXDLG_SEARCH
{
Pos = MAP_APPFONT ( 12 , 285 ) ;
Size = MAP_APPFONT ( 60 , 8 ) ;
- Text [ en-US ] = "~Search in" ;
+ Text [ en-US ] = "Search i~n" ;
Hide = TRUE ;
};
ListBox LB_CALC_SEARCHIN
@@ -368,7 +368,7 @@ ModelessDialog RID_SVXDLG_SEARCH
{
Pos = MAP_APPFONT ( 12 , 300 ) ;
Size = MAP_APPFONT ( 60 , 8 ) ;
- Text [ en-US ] = "~Search direction" ;
+ Text [ en-US ] = "Search ~direction" ;
Hide = TRUE ;
};
RadioButton RB_CALC_ROWS
@@ -382,7 +382,7 @@ ModelessDialog RID_SVXDLG_SEARCH
{
Pos = MAP_APPFONT ( 75 , 313 ) ;
Size = MAP_APPFONT ( 63 , 10 ) ;
- Text [ en-US ] = "Col~umns" ;
+ Text [ en-US ] = "Colu~mns" ;
Hide = TRUE ;
};
CheckBox CB_ALL_SHEETS
diff --git a/svx/source/engine3d/dragmt3d.cxx b/svx/source/engine3d/dragmt3d.cxx
index 22ad196dab..61f17c167e 100644
--- a/svx/source/engine3d/dragmt3d.cxx
+++ b/svx/source/engine3d/dragmt3d.cxx
@@ -67,8 +67,33 @@ E3dDragMethod::E3dDragMethod (
// eine Unit anlegen
const long nCnt(rMark.GetMarkCount());
static bool bDoInvalidate(false);
+ long nObjs(0);
- for(long nObjs = 0;nObjs < nCnt;nObjs++)
+ if(mbMoveFull)
+ {
+ // for non-visible 3D objects fallback to wireframe interaction
+ bool bInvisibleObjects(false);
+
+ for(nObjs = 0;!bInvisibleObjects && nObjs < nCnt;nObjs++)
+ {
+ E3dObject* pE3dObj = dynamic_cast< E3dObject* >(rMark.GetMark(nObjs)->GetMarkedSdrObj());
+
+ if(pE3dObj)
+ {
+ if(!pE3dObj->HasFillStyle() && !pE3dObj->HasLineStyle())
+ {
+ bInvisibleObjects = true;
+ }
+ }
+ }
+
+ if(bInvisibleObjects)
+ {
+ mbMoveFull = false;
+ }
+ }
+
+ for(nObjs = 0;nObjs < nCnt;nObjs++)
{
E3dObject* pE3dObj = dynamic_cast< E3dObject* >(rMark.GetMark(nObjs)->GetMarkedSdrObj());
diff --git a/svx/source/engine3d/makefile.mk b/svx/source/engine3d/makefile.mk
index 6e6e3f97c5..71916df4a8 100644
--- a/svx/source/engine3d/makefile.mk
+++ b/svx/source/engine3d/makefile.mk
@@ -64,18 +64,10 @@ LIB1OBJFILES= \
LIB2TARGET= $(SLB)$/$(TARGET).lib
LIB2OBJFILES= \
- $(SLO)$/volume3d.obj \
- $(SLO)$/viewpt3d.obj \
$(SLO)$/float3d.obj
SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES)
-#disable optimizer for MSCompiler and ICC
-.IF "$(COM)"=="ICC" || "$(COM)"=="MSC"
-NOOPTFILES=\
- $(SLO)$/viewpt3d.obj
-.ENDIF
-
SRS1NAME=engine3d
SRC1FILES=\
string3d.src \
diff --git a/svx/source/engine3d/scene3d.cxx b/svx/source/engine3d/scene3d.cxx
index 94a3668f2c..01ddb1f308 100644
--- a/svx/source/engine3d/scene3d.cxx
+++ b/svx/source/engine3d/scene3d.cxx
@@ -334,6 +334,12 @@ UINT16 E3dScene::GetObjIdentifier() const
return E3D_SCENE_ID;
}
+void E3dScene::SetBoundRectDirty()
+{
+ // avoid resetting aOutRect which in case of this object is model data,
+ // not re-creatable view data
+}
+
/*************************************************************************
|*
|* SetSnapRect
diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx
index 6b5ef8235b..0487ef0530 100644
--- a/svx/source/engine3d/view3d.cxx
+++ b/svx/source/engine3d/view3d.cxx
@@ -71,7 +71,7 @@
#include <svx/sdr/contact/displayinfo.hxx>
#include <svx/sdr/contact/objectcontact.hxx>
#include <svx/sdr/contact/viewobjectcontact.hxx>
-#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
#include <svx/sdr/overlay/overlayprimitive2dsequenceobject.hxx>
#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
@@ -205,8 +205,8 @@ void Impl3DMirrorConstructOverlay::SetMirrorAxis(Point aMirrorAxisA, Point aMirr
// if we have full overlay from selected objects, embed with 50% transparence, the
// transformation is added to the OverlayPrimitive2DSequenceObject
- drawinglayer::primitive2d::Primitive2DReference aUnifiedAlphaPrimitive2D(new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D(aContent, 0.5));
- aContent = drawinglayer::primitive2d::Primitive2DSequence(&aUnifiedAlphaPrimitive2D, 1);
+ drawinglayer::primitive2d::Primitive2DReference aUnifiedTransparencePrimitive2D(new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(aContent, 0.5));
+ aContent = drawinglayer::primitive2d::Primitive2DSequence(&aUnifiedTransparencePrimitive2D, 1);
sdr::overlay::OverlayPrimitive2DSequenceObject* pNew = new sdr::overlay::OverlayPrimitive2DSequenceObject(aContent);
diff --git a/svx/source/engine3d/viewpt3d.cxx b/svx/source/engine3d/viewpt3d.cxx
deleted file mode 100644
index 61357e19cd..0000000000
--- a/svx/source/engine3d/viewpt3d.cxx
+++ /dev/null
@@ -1,32 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-#include <svx/viewpt3d.hxx>
-
-// eof
diff --git a/svx/source/engine3d/volume3d.cxx b/svx/source/engine3d/volume3d.cxx
deleted file mode 100644
index c0d6db9d7c..0000000000
--- a/svx/source/engine3d/volume3d.cxx
+++ /dev/null
@@ -1,32 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-#include <svx/volume3d.hxx>
-
-// eof
diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx
index ead28a0978..6070adb015 100644
--- a/svx/source/form/datanavi.cxx
+++ b/svx/source/form/datanavi.cxx
@@ -1608,7 +1608,7 @@ namespace svxform
DBG_ASSERT( pBindings != NULL,
"DataNavigatorWindow::LoadModels(): no SfxBindings; can't get frame" );
m_xFrame = Reference<XFrame>(
- pBindings->GetDispatcher()->GetFrame()->GetFrame()->GetFrameInterface(),
+ pBindings->GetDispatcher()->GetFrame()->GetFrame().GetFrameInterface(),
UNO_QUERY );
DBG_ASSERT( m_xFrame.is(), "DataNavigatorWindow::LoadModels(): no frame" );
// add frameaction listener
diff --git a/svx/source/form/fmPropBrw.cxx b/svx/source/form/fmPropBrw.cxx
index b190f888e7..7ab661c758 100644
--- a/svx/source/form/fmPropBrw.cxx
+++ b/svx/source/form/fmPropBrw.cxx
@@ -245,7 +245,7 @@ FmPropBrw::FmPropBrw( const Reference< XMultiServiceFactory >& _xORB, SfxBinding
if ( _pBindings->GetDispatcher() )
{
::com::sun::star::uno::Reference < ::com::sun::star::frame::XFramesSupplier >
- xSupp ( _pBindings->GetDispatcher()->GetFrame()->GetFrame()->GetFrameInterface(), ::com::sun::star::uno::UNO_QUERY );
+ xSupp ( _pBindings->GetDispatcher()->GetFrame()->GetFrame().GetFrameInterface(), ::com::sun::star::uno::UNO_QUERY );
// if ( xSupp.is() )
// xSupp->getFrames()->append( m_xMeAsFrame );
// Don't append frame to frame hierachy to prevent UI_DEACTIVATE messages
diff --git a/svx/source/form/fmobj.cxx b/svx/source/form/fmobj.cxx
index 9fee3a83a6..eb747e0bf5 100644
--- a/svx/source/form/fmobj.cxx
+++ b/svx/source/form/fmobj.cxx
@@ -516,7 +516,7 @@ Reference< XInterface > FmFormObj::ensureModelEnv(const Reference< XInterface >
while (nCurrentSourceIndex <= nIndex)
{
sal_Bool bEqualDSS = sal_False;
- while (!bEqualDSS) // (we don't have to check nCurrentSourceIndex here : it's bounded by nIndex)
+ while (!bEqualDSS) // (we don't have to check nCurrentSourceIndex here : it's bound by nIndex)
{
xSourceContainer->getByIndex(nCurrentSourceIndex) >>= xCurrentSourceForm;
DBG_ASSERT(xCurrentSourceForm.is(), "FmFormObj::ensureModelEnv : invalid form ancestor (2) !");
@@ -578,12 +578,11 @@ Reference< XInterface > FmFormObj::ensureModelEnv(const Reference< XInterface >
// correct this ...
try
{
- Reference< XPersistObject > xSourcePersist(xCurrentSourceForm, UNO_QUERY);
- DBG_ASSERT(xSourcePersist.is(), "FmFormObj::ensureModelEnv : invalid form (no persist object) !");
-
- // create and insert (into the destination) a clone of the form
- Reference< XCloneable > xCloneable( xSourcePersist, UNO_QUERY_THROW );
- xCurrentDestForm.set( xCloneable->createClone(), UNO_QUERY_THROW );
+ // create and insert (into the destination) a copy of the form
+ xCurrentDestForm.set(
+ ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii( "com.sun.star.form.component.DataForm" ) ),
+ UNO_QUERY_THROW );
+ ::comphelper::copyProperties( xCurrentSourceForm, xCurrentDestForm );
DBG_ASSERT(nCurrentDestIndex == xDestContainer->getCount(), "FmFormObj::ensureModelEnv : something went wrong with the numbers !");
xDestContainer->insertByIndex(nCurrentDestIndex, makeAny(xCurrentDestForm));
@@ -601,7 +600,7 @@ Reference< XInterface > FmFormObj::ensureModelEnv(const Reference< XInterface >
}
}
- // now xCurrentDestForm is a form aequivalent to xSourceForm (which means they have the same DSS and the same number
+ // now xCurrentDestForm is a form equivalent to xSourceForm (which means they have the same DSS and the same number
// of left siblings with the same DSS, which counts for all their ancestors, too)
// go down
diff --git a/svx/source/form/fmshell.cxx b/svx/source/form/fmshell.cxx
index 7826a3b6e3..c40841f221 100644
--- a/svx/source/form/fmshell.cxx
+++ b/svx/source/form/fmshell.cxx
@@ -298,9 +298,6 @@ sal_uInt16 FmFormShell::PrepareClose(sal_Bool bUI, sal_Bool bForBrowsing)
m_pFormView && m_pFormView->GetActualOutDev() &&
m_pFormView->GetActualOutDev()->GetOutDevType() == OUTDEV_WINDOW)
{
- if (GetImpl()->HasAnyPendingCursorAction())
- GetImpl()->CancelAnyPendingCursorAction();
-
SdrPageView* pCurPageView = m_pFormView->GetSdrPageView();
// sal_uInt16 nPos = pCurPageView ? pCurPageView->GetWinList().Find((OutputDevice*)m_pFormView->GetActualOutDev()) : SDRPAGEVIEWWIN_NOTFOUND;
@@ -1128,9 +1125,6 @@ void FmFormShell::GetFormState(SfxItemSet &rSet, sal_uInt16 nWhich)
|| m_bDesignMode
|| !GetImpl()->getActiveForm().is()
|| GetImpl()->isInFilterMode()
- || ( GetImpl()->HasPendingCursorAction(GetImpl()->getNavController())
- && (SID_FM_RECORD_TOTAL != nWhich)
- )
)
rSet.DisableItem(nWhich);
else
@@ -1417,11 +1411,6 @@ void FmFormShell::SetDesignMode( sal_Bool _bDesignMode )
if ( _bDesignMode == m_bDesignMode )
return;
- // if we are moving our data source cursor currently ....
- if ( GetImpl()->HasAnyPendingCursorAction() )
- // ... cancel this
- GetImpl()->CancelAnyPendingCursorAction();
-
FmFormModel* pModel = GetFormModel();
if (pModel)
// fuer die Zeit des Uebergangs das Undo-Environment ausschalten, das sichert, dass man dort auch nicht-transiente
diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx
index b414a93dfd..29beb4d637 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -570,11 +570,6 @@ sal_Bool FmXBoundFormFieldIterator::ShouldHandleElement(const Reference< XInterf
return aVal.hasValue();
}
-//==============================================================================
-
-DECL_CURSOR_ACTION_THREAD(FmMoveToLastThread)
-IMPL_CURSOR_ACTION_THREAD(FmMoveToLastThread, SVX_RES(RID_STR_MOVING_CURSOR), last());
-
//------------------------------------------------------------------------------
sal_Bool isControlList(const SdrMarkList& rMarkList)
{
@@ -684,9 +679,8 @@ FmXFormShell::FmXFormShell( FmFormShell& _rShell, SfxViewFrame* _pViewFrame )
m_aMarkTimer.SetTimeout(100);
m_aMarkTimer.SetTimeoutHdl(LINK(this,FmXFormShell,OnTimeOut));
- SfxFrame* pFrame = _pViewFrame ? _pViewFrame->GetFrame() : NULL;
- if ( pFrame )
- m_xAttachedFrame = pFrame->GetFrameInterface();
+ if ( _pViewFrame )
+ m_xAttachedFrame = _pViewFrame->GetFrame().GetFrameInterface();
// to prevent deletion of this we acquire our refcounter once
::comphelper::increment(FmXFormShell_BASE::m_refCount);
@@ -988,8 +982,6 @@ void FmXFormShell::disposing()
{
::osl::ClearableMutexGuard aGuard(m_aAsyncSafety);
- if (HasAnyPendingCursorAction())
- CancelAnyPendingCursorAction();
aGuard.clear();
DBG_ASSERT(!m_nInvalidationEvent, "FmXFormShell::~FmXFormShell : still have an invalidation event !");
@@ -1587,22 +1579,25 @@ void FmXFormShell::ExecuteSearch()
return;
// filter out the forms which do not contain valid controls at all
- FmFormArray::reverse_iterator form = m_aSearchForms.rbegin();
- ::std::vector< String >::reverse_iterator contextName = aContextNames.rbegin();
- sal_Int32 i = m_aSearchForms.size();
- for ( ;
- form != m_aSearchForms.rend();
- ++form, ++contextName, --i
- )
{
- FmSearchContext aTestContext;
- aTestContext.nContext = static_cast< sal_Int16 >( i-1 );
- sal_uInt32 nValidControls = OnSearchContextRequest( &aTestContext );
- if ( nValidControls == 0 )
+ FmFormArray aValidForms;
+ ::std::vector< String > aValidContexts;
+ FmFormArray::const_iterator form = m_aSearchForms.begin();
+ ::std::vector< String >::const_iterator contextName = aContextNames.begin();
+ for ( ; form != m_aSearchForms.end(); ++form, ++contextName )
{
- m_aSearchForms.erase( form.base() - 1 );
- aContextNames.erase( contextName.base() - 1 );
+ FmSearchContext aTestContext;
+ aTestContext.nContext = static_cast< sal_Int16 >( form - m_aSearchForms.begin() );
+ sal_uInt32 nValidControls = OnSearchContextRequest( &aTestContext );
+ if ( nValidControls > 0 )
+ {
+ aValidForms.push_back( *form );
+ aValidContexts.push_back( *contextName );
+ }
}
+
+ m_aSearchForms.swap( aValidForms );
+ aContextNames.swap( aValidContexts );
}
if (m_aSearchForms.size() == 0)
@@ -1614,7 +1609,7 @@ void FmXFormShell::ExecuteSearch()
// jetzt brauche ich noch einen 'initial context'
sal_Int16 nInitialContext = 0;
Reference< XForm> xActiveForm( getActiveForm());
- for (i=0; i<(sal_Int32)m_aSearchForms.size(); ++i)
+ for ( size_t i=0; i<m_aSearchForms.size(); ++i )
{
if (m_aSearchForms.at(i) == xActiveForm)
{
@@ -1982,10 +1977,6 @@ void FmXFormShell::setActiveController( const Reference< runtime::XFormControlle
if (xController != m_xActiveController)
{
- // if there is a async cursor action running we have to restore the locking state of the controls of the old controller
- if (HasPendingCursorAction(Reference< XResultSet>(m_xActiveForm, UNO_QUERY)))
- restoreControlLocks();
-
::osl::ClearableMutexGuard aGuard(m_aAsyncSafety);
// switch all nav dispatchers belonging to the form of the current nav controller to 'non active'
Reference< XResultSet> xNavigationForm;
@@ -2065,10 +2056,6 @@ void FmXFormShell::setActiveController( const Reference< runtime::XFormControlle
if (m_xNavigationController.is())
xNavigationForm = Reference< XResultSet>(m_xNavigationController->getModel(), UNO_QUERY);
- // if there is a async cursor action running we have to lock the controls of the new controller
- if (HasPendingCursorAction(Reference< XResultSet>(m_xActiveForm, UNO_QUERY)))
- setControlLocks();
-
m_bInActivate = sal_False;
m_pShell->UIFeatureChanged();
@@ -2389,6 +2376,8 @@ IMPL_LINK(FmXFormShell, OnFoundData, FmFoundRecordInformation*, pfriWhere)
FmFormObj* pFormObject = FmFormObj::GetFormObject( pObject );
Reference< XControlModel > xControlModel( pFormObject ? pFormObject->GetUnoControlModel() : Reference< XControlModel >() );
DBG_ASSERT( xControlModel.is(), "FmXFormShell::OnFoundData: invalid control!" );
+ if ( !xControlModel.is() )
+ return 0;
// disable the permanent cursor for the last grid we found a record
if (m_xLastGridFound.is() && (m_xLastGridFound != xControlModel))
@@ -2406,7 +2395,7 @@ IMPL_LINK(FmXFormShell, OnFoundData, FmFoundRecordInformation*, pfriWhere)
sal_Int32 nGridColumn = m_arrRelativeGridColumn.GetObject(pfriWhere->nFieldPos);
if (nGridColumn != -1)
{ // dummer weise muss ich mir das Control erst wieder besorgen
- Reference< XControl> xControl( GetControlFromModel(xControlModel));
+ Reference< XControl> xControl( impl_getControl( xControlModel, *pFormObject ) );
Reference< XGrid> xGrid(xControl, UNO_QUERY);
DBG_ASSERT(xGrid.is(), "FmXFormShell::OnFoundData : ungueltiges Control !");
// wenn eine der Asserts anschlaegt, habe ich beim Aufbauen von m_arrSearchedControls wohl was falsch gemacht
@@ -2418,7 +2407,8 @@ IMPL_LINK(FmXFormShell, OnFoundData, FmFoundRecordInformation*, pfriWhere)
xModelSet->setPropertyValue( FM_PROP_CURSORCOLOR, makeAny( sal_Int32( COL_LIGHTRED ) ) );
m_xLastGridFound = xControlModel;
- xGrid->setCurrentColumnPosition((sal_Int16)nGridColumn);
+ if ( xGrid.is() )
+ xGrid->setCurrentColumnPosition((sal_Int16)nGridColumn);
}
// als der Cursor neu positioniert wurde, habe ich (in positioned) meine Formularleisten-Slots invalidiert, aber das greift
@@ -2526,7 +2516,7 @@ IMPL_LINK(FmXFormShell, OnSearchContextRequest, FmSearchContext*, pfmscContextIn
// ... nach der ControlSource-Eigenschaft fragen
SearchableControlIterator iter( xCurrentFormComponent );
- Reference< XControl> xControlBehindModel;
+ Reference< XControl> xControl;
// das Control, das als Model xControlModel hat
// (das folgende while kann mehrmals durchlaufen werden, ohne dass das Control sich aendert, dann muss
// ich nicht jedesmal neu suchen)
@@ -2538,10 +2528,12 @@ IMPL_LINK(FmXFormShell, OnSearchContextRequest, FmSearchContext*, pfmscContextIn
if ( sControlSource.getLength() == 0 )
{ // das aktuelle Element hat keine ControlSource, also ist es ein GridControl (das ist das einzige, was
// der SearchableControlIterator noch zulaesst)
- xControlBehindModel = GetControlFromModel(xControlModel);
- DBG_ASSERT(xControlBehindModel.is(), "FmXFormShell::OnSearchContextRequest : didn't ::std::find a control with requested model !");
+ xControl = impl_getControl( xControlModel, *pFormObject );
+ DBG_ASSERT(xControl.is(), "FmXFormShell::OnSearchContextRequest : didn't ::std::find a control with requested model !");
- Reference< XGridPeer> xGridPeer(xControlBehindModel->getPeer(), UNO_QUERY);
+ Reference< XGridPeer> xGridPeer;
+ if ( xControl.is() )
+ xGridPeer.set( xControl->getPeer(), UNO_QUERY );
do
{
if (!xGridPeer.is())
@@ -2595,13 +2587,13 @@ IMPL_LINK(FmXFormShell, OnSearchContextRequest, FmSearchContext*, pfmscContextIn
if (sControlSource.getLength() && xValidFormFields->hasByName(sControlSource))
{
// jetzt brauche ich das Control zum SdrObject
- if (!xControlBehindModel.is())
+ if (!xControl.is())
{
- xControlBehindModel = GetControlFromModel(xControlModel);
- DBG_ASSERT(xControlBehindModel.is(), "FmXFormShell::OnSearchContextRequest : didn't ::std::find a control with requested model !");
+ xControl = impl_getControl( xControlModel, *pFormObject );
+ DBG_ASSERT(xControl.is(), "FmXFormShell::OnSearchContextRequest : didn't ::std::find a control with requested model !");
}
- if (IsSearchableControl(xControlBehindModel))
+ if (IsSearchableControl(xControl))
{ // alle Tests ueberstanden -> in die Liste mit aufnehmen
strFieldList += sControlSource.getStr();
strFieldList += ';';
@@ -2617,7 +2609,7 @@ IMPL_LINK(FmXFormShell, OnSearchContextRequest, FmSearchContext*, pfmscContextIn
m_arrRelativeGridColumn.Insert(-1, m_arrRelativeGridColumn.Count());
// und fuer die formatierte Suche ...
- pfmscContextInfo->arrFields.push_back(Reference< XInterface>(xControlBehindModel, UNO_QUERY));
+ pfmscContextInfo->arrFields.push_back(Reference< XInterface>(xControl, UNO_QUERY));
}
}
}
@@ -2991,24 +2983,48 @@ void FmXFormShell::SetDesignMode(sal_Bool bDesign)
}
//------------------------------------------------------------------------------
-Reference< XControl> FmXFormShell::GetControlFromModel(const Reference< XControlModel>& xModel)
+Reference< XControl> FmXFormShell::impl_getControl( const Reference< XControlModel >& i_rxModel, const FmFormObj& i_rKnownFormObj )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::GetControlFromModel" );
if ( impl_checkDisposed() )
return NULL;
- Reference< XControlContainer> xControlContainer( getControlContainerForView() );
+ Reference< XControl > xControl;
+ try
+ {
+ Reference< XControlContainer> xControlContainer( getControlContainerForView(), UNO_SET_THROW );
+
+ Sequence< Reference< XControl > > seqControls( xControlContainer->getControls() );
+ const Reference< XControl >* pControls = seqControls.getArray();
+ // ... die ich dann durchsuchen kann
+ for (sal_Int32 i=0; i<seqControls.getLength(); ++i)
+ {
+ xControl.set( pControls[i], UNO_SET_THROW );
+ Reference< XControlModel > xCurrentModel( xControl->getModel() );
+ if ( xCurrentModel == i_rxModel )
+ break;
+ xControl.clear();
+ }
+
+ if ( !xControl.is() )
+ {
+ // fallabck (some controls might not have been created, yet, since they were never visible so far)
+ Reference< XControl > xContainerControl( xControlContainer, UNO_QUERY_THROW );
+ const Window* pContainerWindow = VCLUnoHelper::GetWindow( xContainerControl->getPeer() );
+ ENSURE_OR_THROW( pContainerWindow, "unexpected control container implementation" );
+
+ const SdrView* pSdrView = m_pShell ? m_pShell->GetFormView() : NULL;
+ ENSURE_OR_THROW( pSdrView, "no current view" );
- Sequence< Reference< XControl> > seqControls( xControlContainer->getControls() );
- Reference< XControl>* pControls = seqControls.getArray();
- // ... die ich dann durchsuchen kann
- for (int i=0; i<seqControls.getLength(); ++i)
+ xControl.set( i_rKnownFormObj.GetUnoControl( *pSdrView, *pContainerWindow ), UNO_QUERY_THROW );
+ }
+ }
+ catch( const Exception& )
{
- Reference< XControlModel> xSearchLoopModel( pControls[i]->getModel());
- if ((XControlModel*)xSearchLoopModel.get() == (XControlModel*)xModel.get())
- return pControls[i];
+ DBG_UNHANDLED_EXCEPTION();
}
- return Reference< XControl>(NULL);
+
+ OSL_ENSURE( xControl.is(), "FmXFormShell::impl_getControl: no control found!" );
+ return xControl;
}
//------------------------------------------------------------------------------
@@ -3313,312 +3329,6 @@ void FmXFormShell::clearFilter()
}
//------------------------------------------------------------------------------
-void FmXFormShell::setControlLocks()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::setControlLocks" );
- if ( impl_checkDisposed() )
- return;
-
- Reference< XTabController> xCtrler(getActiveController(), UNO_QUERY);
- if (!xCtrler.is())
- return;
-
- Reference< XControlContainer> xControls(xCtrler->getContainer(), UNO_QUERY);
- if (!xControls.is())
- return;
-
- DBG_ASSERT( m_aControlLocks.empty(), "FmXFormShell::setControlLocks: locking state array isn't empty (called me twice ?)!" );
-
- Sequence< Reference< XControl> > aControls = xControls->getControls();
- const Reference< XControl>* pControls = aControls.getConstArray();
-
- // iterate through all bound controls, remember the old locking state, set the lock
- for (sal_Int32 i=0; i<aControls.getLength(); ++i)
- {
- Reference< XBoundControl> xCtrl(pControls[i], UNO_QUERY);
- if (!xCtrl.is())
- {
- // it may be a container of controls
- Reference< XIndexAccess> xContainer(pControls[i], UNO_QUERY);
- if (xContainer.is())
- { // no recursion. we only know top level control containers (e.g. grid controls)
- for (sal_Int16 j=0; j<xContainer->getCount(); ++j)
- {
- xContainer->getByIndex(j) >>= xCtrl;
- if (!xCtrl.is())
- continue;
-
- m_aControlLocks.push_back( xCtrl->getLock() );
- xCtrl->setLock(sal_True);
- }
- }
- continue;
- }
-
- m_aControlLocks.push_back( xCtrl->getLock() );
- xCtrl->setLock(sal_True);
- }
-}
-
-//------------------------------------------------------------------------------
-void FmXFormShell::restoreControlLocks()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::restoreControlLocks" );
- if ( impl_checkDisposed() )
- return;
-
- Reference< XTabController> xCtrler(getActiveController(), UNO_QUERY);
- if (!xCtrler.is())
- return;
-
- Reference< XControlContainer> xControls(xCtrler->getContainer(), UNO_QUERY);
- if (!xControls.is())
- return;
-
- Sequence< Reference< XControl> > aControls(xControls->getControls());
- const Reference< XControl>* pControls = aControls.getConstArray();
-
- // iterate through all bound controls, restore the old locking state
- size_t nBoundControl = 0;
- for (sal_Int32 i=0; i<aControls.getLength(); ++i)
- {
- Reference< XBoundControl> xCtrl(pControls[i], UNO_QUERY);
- if (!xCtrl.is())
- {
- // it may be a container of controls
- Reference< XIndexAccess> xContainer(pControls[i], UNO_QUERY);
- if (xContainer.is())
- { // no recursion. we only know top level control containers (e.g. grid controls)
- for (sal_Int16 j=0; j<xContainer->getCount(); ++j)
- {
- xContainer->getByIndex(j) >>= xCtrl;
- if (!xCtrl.is())
- continue;
-
- DBG_ASSERT( nBoundControl < m_aControlLocks.size(), "FmXFormShell::restoreControlLocks: m_aControlLocks is invalid!" );
- xCtrl->setLock( m_aControlLocks[ nBoundControl ] );
- ++nBoundControl;
- }
- }
- continue;
- }
-
- DBG_ASSERT( nBoundControl < m_aControlLocks.size(), "FmXFormShell::restoreControlLocks: m_aControlLocks is invalid!" );
- // a violation of this condition would mean a) setControlLocks hasn't been called or b) the ControlContainer
- // has changed since the last call to setControlLocks.
- // a) clearly is a fault of the programmer and b) shouldn't be possible (as we are in alive mode)
- xCtrl->setLock( m_aControlLocks[ nBoundControl ] );
- ++nBoundControl;
- }
- ::std::vector< sal_Bool > aEmpty;
- m_aControlLocks.swap( aEmpty );
-}
-
-//------------------------------------------------------------------------------
-void FmXFormShell::DoAsyncCursorAction(const Reference< runtime::XFormController >& _xController, CURSOR_ACTION _eWhat)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::DoAsyncCursorAction" );
- if ( impl_checkDisposed() )
- return;
-
- DBG_ASSERT(_xController.is(), "FmXFormShell::DoAsyncCursorAction : invalid argument !");
- DoAsyncCursorAction(Reference< XResultSet>(_xController->getModel(), UNO_QUERY), _eWhat);
-}
-
-//------------------------------------------------------------------------------
-void FmXFormShell::DoAsyncCursorAction(const Reference< XResultSet>& _xForm, CURSOR_ACTION _eWhat)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::DoAsyncCursorAction" );
- if ( impl_checkDisposed() )
- return;
-
- ::osl::MutexGuard aGuard(m_aAsyncSafety);
- DBG_ASSERT(_xForm.is(), "FmXFormShell::DoAsyncCursorAction : invalid argument !");
-
- // build the access path for the form
- if (HasPendingCursorAction(_xForm))
- {
- DBG_ERROR("FmXFormShell::DoAsyncCursorAction : invalid call !");
- return;
- }
-
- CursorActionDescription& rDesc = m_aCursorActions[ _xForm ];
- // [] will create a new one if non-existent
- DBG_ASSERT(rDesc.pThread == NULL, "FmXFormShell::DoAsyncCursorAction : the cursor action thread for this form is still alive !");
-
- Reference< XResultSet > xCursor( getInternalForm( _xForm ), UNO_QUERY );
- switch (_eWhat)
- {
- case CA_MOVE_TO_LAST :
- rDesc.pThread = new FmMoveToLastThread( xCursor );
- break;
- case CA_MOVE_ABSOLUTE:
- DBG_ERROR("FmXFormShell::DoAsyncCursorAction : CA_MOVE_ABSOLUTE not supported yet !");
- return;
- }
- rDesc.pThread->SetTerminationHdl(LINK(this, FmXFormShell, OnCursorActionDone));
- rDesc.pThread->EnableSelfDelete(sal_False);
-
- rDesc.bCanceling = sal_False;
-
- // set the control locks before starting the thread
- DBG_ASSERT(getInternalForm(m_xActiveForm) == m_xActiveForm, "FmXFormShell::DoAsyncCursorAction : the active form should always be a internal one !");
- if (getInternalForm(_xForm) == m_xActiveForm)
- setControlLocks();
-
- // go ...
- rDesc.pThread->create();
-
- // set a priority slightly below normal
- rDesc.pThread->setPriority(::vos::OThread::TPriority_BelowNormal);
-}
-
-//------------------------------------------------------------------------------
-sal_Bool FmXFormShell::HasPendingCursorAction(const Reference< XResultSet>& _xForm) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::HasPendingCursorAction" );
- if ( impl_checkDisposed() )
- return sal_False;
-
- if (!_xForm.is())
- return sal_False;
-
- // TODO: if we ever re-implement the asynchronous cursor actions, then this will happen
- // in the controller, and not in the form. In such a case, we here probably need to check
- // whether the controller for the form has this "pending cursor action"
-
- return sal_False;
-}
-
-//------------------------------------------------------------------------------
-sal_Bool FmXFormShell::HasPendingCursorAction(const Reference< runtime::XFormController >& xController) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::HasPendingCursorAction" );
- if ( impl_checkDisposed() )
- return sal_False;
-
- if (!xController.is())
- return sal_False;
-
- return HasPendingCursorAction(Reference< XResultSet>(xController->getModel(), UNO_QUERY));
-}
-
-//------------------------------------------------------------------------------
-sal_Bool FmXFormShell::HasAnyPendingCursorAction() const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::HasAnyPendingCursorAction" );
- ::osl::MutexGuard aGuard( const_cast< FmXFormShell* >( this )->m_aAsyncSafety );
-
- for ( CursorActions::const_iterator aIter = m_aCursorActions.begin(); aIter != m_aCursorActions.end(); ++aIter )
- {
- if (((*aIter).second.pThread != NULL) || ((*aIter).second.nFinishedEvent != 0))
- return sal_True;
- }
- return sal_False;
-}
-
-//------------------------------------------------------------------------------
-void FmXFormShell::CancelAnyPendingCursorAction()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::CancelAnyPendingCursorAction" );
- if ( impl_checkDisposed() )
- return;
-
- ::osl::ResettableMutexGuard aGuard( m_aAsyncSafety );
-
- CursorActions::iterator aIter;
- for (aIter = m_aCursorActions.begin(); aIter != m_aCursorActions.end(); ++aIter)
- {
- if (!(*aIter).second.nFinishedEvent && (*aIter).second.pThread)
- { // the thread is really running
- (*aIter).second.bCanceling = sal_True;
-
- aGuard.clear();
- (*aIter).second.pThread->StopItWait();
- // StopItWait returns after the termination handler (our OnCursorActionDone) has been called
- aGuard.reset();
- }
- }
-
- // all threads are finished (means canceled), now do the cleanup
- for (aIter = m_aCursorActions.begin(); aIter != m_aCursorActions.end(); ++aIter)
- {
- if ((*aIter).second.pThread)
- {
- LINK(this, FmXFormShell, OnCursorActionDoneMainThread).Call((*aIter).second.pThread);
- DBG_ASSERT((*aIter).second.pThread == NULL, "FmXFormShell::CancelAnyPendingCursorAction : strange behaviour of OnCursorActionDoneMainThread !");
- }
- }
-}
-
-//------------------------------------------------------------------------------
-IMPL_LINK(FmXFormShell, OnCursorActionDone, FmCursorActionThread*, pThread)
-{
- if ( impl_checkDisposed() )
- return 0L;
-
- ::osl::MutexGuard aGuard(m_aAsyncSafety);
-
- // search the pos of the thread within m_aCursorActions
- CursorActions::iterator aIter;
- for (aIter = m_aCursorActions.begin(); aIter != m_aCursorActions.end(); ++aIter)
- {
- if ((*aIter).second.pThread == pThread)
- break;
- }
-
- DBG_ASSERT(aIter != m_aCursorActions.end(), "FmXFormShell::OnCursorActionDone : could not ::std::find the thread !");
- DBG_ASSERT((*aIter).second.nFinishedEvent == 0, "FmXFormShell::OnCursorActionDone : another 'ActionDone' for this thread is pending !");
- // as we allow only one async action at a time (per form) this shouldn't happen
-
- if (!(*aIter).second.bCanceling)
- (*aIter).second.nFinishedEvent = Application::PostUserEvent(LINK(this, FmXFormShell, OnCursorActionDoneMainThread), pThread);
- // if bCanceling is sal_True an other thread's execution is in CancelAnyPendingCursorAction
- return 0L;
-}
-
-//------------------------------------------------------------------------------
-IMPL_LINK(FmXFormShell, OnCursorActionDoneMainThread, FmCursorActionThread*, pThread)
-{
- if ( impl_checkDisposed() )
- return 0L;
-
- ::osl::MutexGuard aGuard(m_aAsyncSafety);
-
- // search the pos of the thread within m_aCursorActions
- CursorActions::iterator aIter = m_aCursorActions.find( pThread->getDataSource() );
- DBG_ASSERT(aIter != m_aCursorActions.end(), "FmXFormShell::OnCursorActionDoneMainThread : could not ::std::find the thread data !");
- DBG_ASSERT((*aIter).second.pThread == pThread, "FmXFormShell::OnCursorActionDoneMainThread : invalid thread data !");
-
- // remember some thread parameters
- Reference< XResultSet> xForm(pThread->getDataSource(), UNO_QUERY);
-
- // throw away the thread
- delete (*aIter).second.pThread;
- (*aIter).second.pThread = NULL;
- (*aIter).second.nFinishedEvent = 0;
- (*aIter).second.bCanceling = sal_False;
- // as we allow exactly one thread per form we may remove this ones data from m_aCursorActions
- m_aCursorActions.erase(aIter);
-
- DBG_ASSERT(getInternalForm(m_xActiveForm) == m_xActiveForm, "FmXFormShell::DoAsyncCursorAction : the active form should always be a internal one !");
- DBG_ASSERT(getInternalForm(xForm) == xForm, "FmXFormShell::DoAsyncCursorAction : the thread's form should always be a internal one !");
- // if one of the two asserts above fails the upcoming comparison is senseless
- if (xForm == m_xActiveForm)
- {
- // the active controller belongs to the form where the action is finished
- // -> re-enable the controls if they are not locked because of another running thread
- if (!HasPendingCursorAction(xForm))
- restoreControlLocks();
- }
-
- m_pShell->GetViewShell()->GetViewFrame()->GetBindings().Invalidate(DatabaseSlotMap);
- // it may not be neccessary but me thinks it's faster without the check if we really have to do this
-
- return 0L;
-}
-
-//------------------------------------------------------------------------------
void FmXFormShell::CreateExternalView()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::CreateExternalView" );
@@ -4604,155 +4314,4 @@ void ControlConversionMenuController::StateChanged(sal_uInt16 nSID, SfxItemState
}
}
-//==================================================================
-
-FmCursorActionThread::FmCursorActionThread(const Reference< XResultSet>& _xDataSource, const UniString& _rStopperCaption)
- :m_xDataSource(_xDataSource)
- ,m_sStopperCaption(_rStopperCaption)
- ,m_bCanceled(sal_False)
- ,m_bDeleteMyself(sal_False)
- ,m_bDisposeCursor(sal_False)
- ,m_bTerminated(sal_False)
- ,m_bRunFailed(sal_False)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmCursorActionThread::FmCursorActionThread" );
- DBG_ASSERT(m_xDataSource.is() && Reference< XCancellable>(m_xDataSource, UNO_QUERY).is(),
- "FmCursorActionThread::FmCursorActionThread : invalid cursor !");
-}
-
-//------------------------------------------------------------------------------
-void FmCursorActionThread::run()
-{
- // On instantiation of a SfxCancellable the application is notified and 'switches on' the red stop button.
- // Unfortunally this is conditioned with the acquirement of the solar mutex, and the application tries
- // only once and ignores the notification if it fails.
- // To prevent that we get the solar mutex and _block_ 'til we got it.
- // As we are in the 'top level execution' of this thread (with a rather small stack and no other mutexes locked)
- // we shouldn't experience problems with deadlocks ...
- ::vos::OClearableGuard aSolarGuard(Application::GetSolarMutex());
- ThreadStopper* pStopper = new ThreadStopper(this, m_sStopperCaption);
- aSolarGuard.clear();
-
- // we're not canceled yet
- ::osl::ClearableMutexGuard aInitGuard(m_aAccessSafety);
- m_bCanceled = sal_False;
- m_bRunFailed = sal_False;
- aInitGuard.clear();
-
- // start it
- try
- {
- RunImpl();
- }
- catch(SQLException e)
- {
- ::osl::MutexGuard aErrorGuard(m_aAccessSafety);
- m_bRunFailed = sal_True;
- m_aRunException = e;
- }
- catch(Exception&)
- {
- DBG_ERROR("FmCursorActionThread::run : catched a non-database exception !");
- }
-
-
- sal_Bool bReallyCanceled;
- ::osl::ClearableMutexGuard aEvalGuard(m_aAccessSafety);
- bReallyCanceled = m_bCanceled;
- aEvalGuard.clear();
-
- pStopper->OwnerTerminated();
- // this will cause the stopper to delete itself (in the main thread) so we don't have to care of the
- // solar mutex
-}
-
-//------------------------------------------------------------------------------
-void FmCursorActionThread::onTerminated()
-{
- ::osl::ClearableMutexGuard aResetGuard(m_aAccessSafety);
- if (m_aTerminationHandler.IsSet())
- m_aTerminationHandler.Call(this);
-
- if (IsCursorDisposeEnabled())
- {
- Reference< ::com::sun::star::lang::XComponent> xDataSourceComponent(m_xDataSource, UNO_QUERY);
- if (xDataSourceComponent.is())
- xDataSourceComponent->dispose();
- }
-
- aResetGuard.clear();
- // with this StopItWait has a chance to do it's Terminated()
-
- ::osl::MutexGuard aGuard(m_aFinalExitControl);
- // Terminated() in StopItWait still returns sal_False
- m_bTerminated = sal_True;
- // Terminated() now returns sal_True, but StopItWait can't exit until this method exits (because of the guarded m_aFinalExitControl)
-
- if (IsSelfDeleteEnabled())
- delete this;
-}
-
-//------------------------------------------------------------------------------
-void FmCursorActionThread::StopIt()
-{
- ::osl::MutexGuard aGuard(m_aAccessSafety);
- m_bCanceled = sal_True;
-
- Reference< XCancellable> xCancel(m_xDataSource, UNO_QUERY);
- DBG_ASSERT(xCancel.is(), "FmCursorActionThread::StopIt : invalid cursor !");
- xCancel->cancel();
-}
-
-//------------------------------------------------------------------------------
-void FmCursorActionThread::StopItWait()
-{
- StopIt();
-
- while (!Terminated())
- ;
-
- // OnTerminated has been called, but we can't simply exit : Suppose the caller want's to delete the thread object
- // immediately after returning from StopItWait. With the following guard we ensure that we exit this method
- // only after onTerminated has exited.
- ::osl::ClearableMutexGuard aGuard(m_aFinalExitControl);
-
- // now onTerminated has exited, so we can leave, too
-}
-
-//------------------------------------------------------------------------------
-FmCursorActionThread::ThreadStopper::ThreadStopper(FmCursorActionThread* pOwner, const UniString& rTitle)
- :SfxCancellable(SFX_APP()->GetCancelManager(), rTitle)
- ,m_pOwner(pOwner)
-{
-}
-
-//------------------------------------------------------------------------------
-void FmCursorActionThread::ThreadStopper::Cancel()
-{
- if (!m_pOwner) // the owner is already terminated and we're waiting for the OnDeleteInMainThread event
- return;
-
- ::osl::MutexGuard aGuard(m_pOwner->m_aAccessSafety);
- if (IsCancelled())
- // we already did pass this to our owner
- return;
-
- SfxCancellable::Cancel();
- m_pOwner->StopIt();
-}
-
-//------------------------------------------------------------------------------
-void FmCursorActionThread::ThreadStopper::OwnerTerminated()
-{
- m_pOwner = NULL;
- Application::PostUserEvent(LINK(this, FmCursorActionThread::ThreadStopper, OnDeleteInMainThread), this);
-}
-
-//------------------------------------------------------------------------------
-IMPL_LINK(FmCursorActionThread::ThreadStopper, OnDeleteInMainThread, FmCursorActionThread::ThreadStopper*, pThis)
-{
- delete pThis;
- return 0L;
-}
-
//==============================================================================
diff --git a/svx/source/form/fmstring.src b/svx/source/form/fmstring.src
index 0b281ca766..89771f126b 100644
--- a/svx/source/form/fmstring.src
+++ b/svx/source/form/fmstring.src
@@ -214,10 +214,6 @@ String RID_STR_PROPTITLE_FORMATTED
{
Text [ en-US ] = "Formatted Field";
};
-String RID_STR_MOVING_CURSOR
-{
- Text [ en-US ] = "align data source";
-};
String RID_STR_PROPTITLE_LISTBOX
{
Text [ en-US ] = "List Box";
diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx
index e8a549a898..3ab380dc15 100644
--- a/svx/source/form/formcontroller.cxx
+++ b/svx/source/form/formcontroller.cxx
@@ -4254,7 +4254,7 @@ bool FormController::ensureInteractionHandler()
return false;
m_bAttemptedHandlerCreation = true;
- m_xInteractionHandler.set( m_aContext.createComponent( (::rtl::OUString)SRV_SDB_INTERACTION_HANDLER ), UNO_QUERY );
+ m_xInteractionHandler.set( m_aContext.createComponent( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.task.InteractionHandler" ) ) ), UNO_QUERY );
OSL_ENSURE( m_xInteractionHandler.is(), "FormController::ensureInteractionHandler: could not create an interaction handler!" );
return m_xInteractionHandler.is();
}
diff --git a/svx/source/inc/fmresids.hrc b/svx/source/inc/fmresids.hrc
index fae54cd90f..08982d8444 100644
--- a/svx/source/inc/fmresids.hrc
+++ b/svx/source/inc/fmresids.hrc
@@ -183,7 +183,7 @@
#define RID_STR_FILTER_FILTER_OR (RID_FORMS_START + 80)
#define RID_STR_PROPTITLE_FORMATTED (RID_FORMS_START + 81)
#define RID_STR_SYNTAXERROR (RID_FORMS_START + 82)
-#define RID_STR_MOVING_CURSOR (RID_FORMS_START + 83)
+ // FREE
#define RID_STR_NOCONTROLS_FOR_EXTERNALDISPLAY (RID_FORMS_START + 84)
#define RID_STR_AUTOFIELD (RID_FORMS_START + 89)
#define RID_STR_SVT_SQL_SYNTAX_ERROR (RID_FORMS_START + 90)
diff --git a/svx/source/inc/fmservs.hxx b/svx/source/inc/fmservs.hxx
index 863be0dfae..6c1136a405 100644
--- a/svx/source/inc/fmservs.hxx
+++ b/svx/source/inc/fmservs.hxx
@@ -56,7 +56,6 @@
#define FM_CONTROL_GRIDCONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.control.GridControl" ) )
#define FM_FORM_CONTROLLER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.runtime.FormController" ) )
#define SRV_SDB_CONNECTION rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdb.Connection" ) )
-#define SRV_SDB_INTERACTION_HANDLER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdb.InteractionHandler" ) )
#define FM_SUN_COMPONENT_FORM rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.Form" ) )
#define FM_SUN_COMPONENT_TEXTFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.TextField" ) )
#define FM_SUN_COMPONENT_LISTBOX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.ListBox" ) )
diff --git a/svx/source/inc/fmshimp.hxx b/svx/source/inc/fmshimp.hxx
index a02d91d9a3..ef38edc7e8 100644
--- a/svx/source/inc/fmshimp.hxx
+++ b/svx/source/inc/fmshimp.hxx
@@ -68,7 +68,6 @@
#include "fmsrccfg.hxx"
#include <osl/mutex.hxx>
#include <vos/thread.hxx>
-#include <svl/cancel.hxx>
#include <tools/debug.hxx>
#include <cppuhelper/component.hxx>
#include <comphelper/stl_types.hxx>
@@ -119,21 +118,6 @@ protected:
virtual sal_Bool ShouldStepInto(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& _rContainer) const;
};
-//========================================================================
-// I would prefer this to be a struct local to FmXFormShell but unfortunately local structs/classes
-// are somewhat difficult with some of our compilers
-class FmCursorActionThread;
-struct SAL_DLLPRIVATE CursorActionDescription
-{
- FmCursorActionThread* pThread;
- ULONG nFinishedEvent;
- // we want to do the cleanup of the thread in the main thread so we post an event to ourself
- sal_Bool bCanceling;
- // this thread is being canceled
-
- CursorActionDescription() : pThread(NULL), nFinishedEvent(0), bCanceling(sal_False) { }
-};
-
class FmFormPage;
//========================================================================
struct SAL_DLLPRIVATE FmLoadAction
@@ -179,6 +163,7 @@ typedef ::utl::ConfigItem FmXFormShell_CFGBASE;
struct SdrViewEvent;
class FmFormShell;
class FmFormView;
+class FmFormObj;
class SAL_DLLPRIVATE FmXFormShell :public FmXFormShell_BASE
,public FmXFormShell_CFGBASE
,public ::svxform::OStaticDataAccessTools
@@ -202,18 +187,6 @@ class SAL_DLLPRIVATE FmXFormShell :public FmXFormShell_BASE
// we explicitly switch off the propbrw before leaving the design mode
// this flag tells us if we have to switch it on again when reentering
- typedef ::std::map<
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet >,
- CursorActionDescription,
- ::comphelper::OInterfaceCompare< ::com::sun::star::sdbc::XResultSet >
- > CursorActions;
- CursorActions m_aCursorActions;
- // all actions on async cursors
-
- ::std::vector< sal_Bool >
- m_aControlLocks;
- // while doing a async cursor action we have to lock all controls of the active controller.
- // m_aControlLocks remembers the previous lock states to be restored afterwards.
::osl::Mutex m_aAsyncSafety;
// secure the access to our thread related members
::osl::Mutex m_aInvalidationSafety;
@@ -377,8 +350,11 @@ protected:
void startListening();
void stopListening();
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl> GetControlFromModel(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel>& xModel);
- // liefert das Control, welches das angegebene Model hat
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >
+ impl_getControl(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel>& i_rxModel,
+ const FmFormObj& i_rKnownFormObj
+ );
// sammelt in strNames die Namen aller Formulare
static void impl_collectFormSearchContexts_nothrow(
@@ -559,20 +535,7 @@ private:
// ---------------------------------------------------
// asyncronous cursor actions/navigation slot handling
- void setControlLocks(); // lock all controls of the active controller
- void restoreControlLocks(); // restore the lock state of all controls of the active controller
-
public:
- enum CURSOR_ACTION { CA_MOVE_TO_LAST, CA_MOVE_ABSOLUTE };
- void DoAsyncCursorAction(const ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormController>& _xController, CURSOR_ACTION _eWhat);
- void DoAsyncCursorAction(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _xForm, CURSOR_ACTION _eWhat);
-
- sal_Bool HasAnyPendingCursorAction() const;
- void CancelAnyPendingCursorAction();
-
- sal_Bool HasPendingCursorAction(const ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormController>& _xController) const;
- sal_Bool HasPendingCursorAction(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _xForm) const;
-
/** execute the given form slot
<p>Warning. Only a small set of slots implemented currently.</p>
@param _nSlot
@@ -585,9 +548,6 @@ public:
bool IsFormSlotEnabled( sal_Int32 _nSlot, ::com::sun::star::form::runtime::FeatureState* _pCompleteState = NULL );
protected:
- DECL_LINK(OnCursorActionDone, FmCursorActionThread*);
- DECL_LINK(OnCursorActionDoneMainThread, FmCursorActionThread*);
-
DECL_LINK( OnLoadForms, FmFormPage* );
};
@@ -642,127 +602,4 @@ public:
SVX_DLLPRIVATE virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState);
};
-//==================================================================
-// FmCursorActionThread
-//==================================================================
-
-class SAL_DLLPRIVATE FmCursorActionThread : public ::vos::OThread
-{
- Link m_aTerminationHandler; // the handler to be called upon termination
- ::com::sun::star::sdbc::SQLException m_aRunException; // the database exception thrown by RunImpl
- ::osl::Mutex m_aAccessSafety; // for securing the multi-thread access
- ::osl::Mutex m_aFinalExitControl; // see StopItWait
-
-protected:
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet> m_xDataSource; // the cursor which we work with
-
-private:
-
- UniString m_sStopperCaption; // the caption for the ThreadStopper
- sal_Bool m_bCanceled:1; // StopIt has been called ?
- sal_Bool m_bDeleteMyself:1; // delete the thread upon termination (defaults to sal_False) ?
- sal_Bool m_bDisposeCursor:1; // dispose the cursor upon termination (defaults to sal_False) ?
- sal_Bool m_bTerminated:1; // onTerminated already called ?
- sal_Bool m_bRunFailed:1; // a database execption occured in RunImpl ?
-
- // a ThreadStopper will be instantiated so that the open can be canceled via the UI
- class ThreadStopper : protected SfxCancellable
- {
- FmCursorActionThread* m_pOwner;
-
- virtual ~ThreadStopper() { }
-
- public:
- ThreadStopper(FmCursorActionThread* pOwner, const UniString& rTitle);
-
- virtual void Cancel();
-
- virtual void OwnerTerminated();
- // Normally the Owner (a FmCursorActionThread) would delete the stopper when terminated.
- // Unfortunally the application doesn't remove the 'red light' when a SfxCancellable is deleted
- // if it (the app) can't acquire the solar mutex. The deletion is IGNORED then. So we have make
- // sure that a) the stopper is deleted from inside the main thread (where the solar mutex is locked)
- // and b) that in the time between the termination of the thread and the deletion of the stopper
- // the latter doesn't access the former.
- // The OwnerTerminated cares for both aspects.
- // SO DON'T DELETE THE STOPPER EXPLICITLY !
-
- protected:
- // HACK HACK HACK HACK HACK : this should be private, but MSVC doesn't accept the LINK-macro then ....
- DECL_LINK(OnDeleteInMainThread, ThreadStopper*);
- };
- friend class FmCursorActionThread::ThreadStopper;
-
-
-public:
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet> getDataSource() const { return m_xDataSource; }
-
-private:
- sal_Bool Terminated() { ::osl::MutexGuard aGuard(m_aAccessSafety); return m_bTerminated; }
-
-public:
- FmCursorActionThread(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _xDataSource, const UniString& _rStopperCaption);
- virtual ~FmCursorActionThread() {}
-
- // control of self-deletion
- sal_Bool IsSelfDeleteEnabled() { ::osl::MutexGuard aGuard(m_aAccessSafety); return m_bDeleteMyself; }
- void EnableSelfDelete(sal_Bool bEnable) { ::osl::MutexGuard aGuard(m_aAccessSafety); m_bDeleteMyself = bEnable; }
-
- // control of cursor-dipose
- sal_Bool IsCursorDisposeEnabled() { ::osl::MutexGuard aGuard(m_aAccessSafety); return m_bDisposeCursor; }
- void EnableCursorDispose(sal_Bool bEnable) { ::osl::MutexGuard aGuard(m_aAccessSafety); m_bDisposeCursor = bEnable; }
-
- // error-access
- sal_Bool RunFailed() { ::osl::MutexGuard aGuard(m_aAccessSafety); return m_bRunFailed; }
- ::com::sun::star::sdbc::SQLException GetRunException() { ::osl::MutexGuard aGuard(m_aAccessSafety); return m_aRunException; }
-
- /// the excution (within the method "run") was canceled ?
- sal_Bool WasCanceled() { ::osl::MutexGuard aGuard(m_aAccessSafety); return m_bCanceled; }
-
- /// the handler will be called synchronously (the parameter is a pointer to the thread)
- void SetTerminationHdl(const Link& aTermHdl) { ::osl::MutexGuard aGuard(m_aAccessSafety); m_aTerminationHandler = aTermHdl; }
-
- /// cancels the process. returns to the caller immediately. to be called from another thread (of course ;)
- void StopIt();
-
- /// cancels the process. does not return to the caller until the thread is terminated.
- void StopItWait();
-
-protected:
- virtual void SAL_CALL run();
- virtual void SAL_CALL onTerminated();
-
- /// called from within run. run itself handles (de)initialisation of the cancel handling.
- virtual void RunImpl() = 0;
-};
-
-//------------------------------------------------------------------------------
-
-#define DECL_CURSOR_ACTION_THREAD(classname) \
- \
-class SAL_DLLPRIVATE classname : public FmCursorActionThread \
-{ \
-public: \
- classname(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _xDataSource); \
-protected: \
- virtual void RunImpl(); \
-}; \
-
-
-//------------------------------------------------------------------------------
-
-#define IMPL_CURSOR_ACTION_THREAD(classname, caption, action) \
- \
-classname::classname(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _xDataSource) \
- :FmCursorActionThread(_xDataSource, caption) \
-{ \
-} \
- \
-void classname::RunImpl() \
-{ \
- m_xDataSource->action; \
-} \
-
-
-
#endif // _SVX_FMSHIMP_HXX
diff --git a/svx/source/intro/iso.src b/svx/source/intro/iso.src
index 00a8ffe342..d1fcbc3420 100644
--- a/svx/source/intro/iso.src
+++ b/svx/source/intro/iso.src
@@ -59,7 +59,7 @@ String RID_BUILDVERSION
ModalDialog RID_DEFAULTABOUT
{
OutputSize = TRUE ;
- Size = MAP_APPFONT ( 245 , 200 ) ;
+ Size = MAP_APPFONT ( 245 , 260 ) ;
Moveable = TRUE ;
SVLook = TRUE ;
TEXT_DEFAULTABOUT
@@ -76,12 +76,18 @@ ModalDialog RID_DEFAULTABOUT
WordBreak = TRUE ;
Text = "%PRODUCTNAME %ABOUTBOXPRODUCTVERSION %PRODUCTEXTENSION" ;
};
- FixedText ABOUT_FTXT_COPYRIGHT
+ MultiLineEdit ABOUT_FTXT_COPYRIGHT
{
+ Border = TRUE ;
Pos = MAP_APPFONT ( 54 , 25 ) ;
Size = MAP_APPFONT ( 168 , 51 ) ;
- WordBreak = TRUE ;
- Text[ en-US ] = "Copyright © 2005-2009 Sun Microsystems, Inc. All rights reserved. Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product that is described in this document. In particular, and without limitation, these intellectual property rights may include one or more of the U.S. patents listed at http://www.sun.com/patents and one or more additional patents or pending patent applications in the U.S. and in other countries. U.S. Government Rights - Commercial software. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements. Use is subject to license terms. This distribution may include materials developed by third parties. Sun, Sun Microsystems, the Sun logo, Java, Solaris and StarOffice are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the U.S. and other countries. UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open Company, Ltd.\n\nThis product is based on the OpenOffice.org project." ;
+ IgnoreTab = TRUE ;
+ ReadOnly = TRUE ;
+ AutoVScroll = TRUE ;
+ };
+ String ABOUT_STR_COPYRIGHT
+ {
+ Text[ en-US ] = "Copyright © 1995, 2010, Oracle and/or its affiliates. All rights reserved.\n\nThis software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.\n\nThe information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing.\n\nIf this software or related documentation is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, the following notice is applicable:\n\nU.S. GOVERNMENT RIGHTS\nPrograms, software, databases, and related documentation and technical data delivered to U.S. Government customers are \"commercial computer software\" or \"commercial technical data\" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, the use, duplication, disclosure, modification, and adaptation shall be subject to the restrictions and license terms set forth in the applicable Government contract, and, to the extent applicable by the terms of the Government contract, the additional rights set forth in FAR 52.227-19, Commercial Computer Software License (December 2007). Oracle USA, Inc., 500 Oracle Parkway, Redwood City, CA 94065.\n\nThis software is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications which may create a risk of personal injury. If you use this software in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure the safe use of this software. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software in dangerous applications.\n\nOracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.\n\nThis software and documentation may provide access to or information on content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services.\n\nThis product is based on the OpenOffice.org project.";
};
StringArray ABOUT_STR_DEVELOPER_ARY
{
@@ -89,7 +95,7 @@ ModalDialog RID_DEFAULTABOUT
};
String ABOUT_STR_FRENCH_COPYRIGHT
{
- Text = "Copyright © 2005-2009 Sun Microsystems, Inc. Tous droits réservés. Sun Microsystems, Inc. détient les droits de propriété intellectuels relatifs á la technologie incorporée dans le produit qui est décrit dans ce document. En particulier, et ce sans limitation, ces droits de propriété intellectuelle peuvent inclure un ou plus des brevets américains listés á l'adresse http://www.sun.com/patents et un ou les brevets supplémentaires ou les applications de brevet en attente aux Etats - Unis et dans les autres pays. L'utilisation est soumise aux termes du contrat de licence. Cette distribution peut comprendre des composants développés par des tierces parties. Sun, Sun Microsystems, le logo Sun, Java, Solaris et StarOffice sont des marques de fabrique ou des marques déposées de Sun Microsystems, Inc. aux Etats-Unis et dans d'autres pays. Toutes les marques SPARC sont utilisées sous licence et sont des marques de fabrique ou des marques déposées de SPARC International, Inc. aux Etats-Unis et dans d'autres pays. UNIX est une marque déposée aux Etats-Unis et dans d'autres pays et licenciée exlusivement par X/Open Company, Ltd.\n\nCe produit a été créé á partir du projet OpenOffice.org." ;
+ Text = "Copyright © 1995, 2010, Oracle and/or its affiliates. All rights reserved.\n\nThis software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.\n\nThe information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing.\n\nIf this software or related documentation is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, the following notice is applicable:\n\nU.S. GOVERNMENT RIGHTS\nPrograms, software, databases, and related documentation and technical data delivered to U.S. Government customers are ""commercial computer software"" or ""commercial technical data"" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, the use, duplication, disclosure, modification, and adaptation shall be subject to the restrictions and license terms set forth in the applicable Government contract, and, to the extent applicable by the terms of the Government contract, the additional rights set forth in FAR 52.227-19, Commercial Computer Software License (December 2007). Oracle USA, Inc., 500 Oracle Parkway, Redwood City, CA 94065.\n\nThis software is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications which may create a risk of personal injury. If you use this software in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure the safe use of this software. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software in dangerous applications.\n\nOracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.\n\nThis software and documentation may provide access to or information on content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services.\n\nThis product is based on the OpenOffice.org project." ;
};
String ABOUT_STR_ACCEL
{
diff --git a/svx/source/intro/ooo.src b/svx/source/intro/ooo.src
index f025fb9de0..4c17838687 100644
--- a/svx/source/intro/ooo.src
+++ b/svx/source/intro/ooo.src
@@ -1,4 +1,4 @@
-/*************************************************************************
+/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -65,7 +65,7 @@ String RID_BUILDVERSION
ModalDialog RID_DEFAULTABOUT
{
OutputSize = TRUE ;
- Size = MAP_APPFONT ( 245 , 200 ) ;
+ Size = MAP_APPFONT ( 245 , 260 ) ;
Moveable = TRUE ;
SVLook = TRUE ;
TEXT_DEFAULTABOUT
@@ -81,13 +81,19 @@ ModalDialog RID_DEFAULTABOUT
Size = MAP_APPFONT ( 118 , 16 ) ;
WordBreak = TRUE ;
Text = "%PRODUCTNAME %ABOUTBOXPRODUCTVERSION %PRODUCTEXTENSION" ;
- };
- FixedText ABOUT_FTXT_COPYRIGHT
+ };
+ MultiLineEdit ABOUT_FTXT_COPYRIGHT
{
+ Border = TRUE ;
Pos = MAP_APPFONT ( 54 , 25 ) ;
Size = MAP_APPFONT ( 168 , 51 ) ;
- Text[ en-US ] ="Copyright 2000-2009 Sun Microsystems Inc.\nThis product was created by " OOO_VENDOR ", based on OpenOffice.org.\nOpenOffice.org acknowledges all community members, especially those mentioned at http://www.openoffice.org/welcome/credits.html.";
- WordBreak = TRUE ;
+ IgnoreTab = TRUE ;
+ ReadOnly = TRUE ;
+ AutoVScroll = TRUE ;
+ };
+ String ABOUT_STR_COPYRIGHT
+ {
+ Text[ en-US ] = "Copyright © 2000, 2010 Oracle and/or its affiliates. All rights reserved.\nThis product was created by " OOO_VENDOR ", based on OpenOffice.org.\nOpenOffice.org acknowledges all community members, especially those mentioned at\n http://www.openoffice.org/welcome/credits.html.";
};
StringArray ABOUT_STR_DEVELOPER_ARY
{
diff --git a/svx/source/items/svxitems.src b/svx/source/items/svxitems.src
index a2fd85293c..d70e69ea99 100644
--- a/svx/source/items/svxitems.src
+++ b/svx/source/items/svxitems.src
@@ -26,8 +26,8 @@
************************************************************************/
// include ------------------------------------------------------------------
-#include <svx/svxitems.hrc>
-#include <svx/svxids.hrc>
+#include "svx/svxitems.hrc"
+#include "svx/svxids.hrc"
#include <editeng/editids.hrc>
StringArray RID_ATTR_NAMES
diff --git a/svx/source/sdr/attribute/makefile.mk b/svx/source/sdr/attribute/makefile.mk
index 5ca44ee5c2..177654ff1e 100644
--- a/svx/source/sdr/attribute/makefile.mk
+++ b/svx/source/sdr/attribute/makefile.mk
@@ -39,7 +39,10 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files --------------------------------------------------------
SLOFILES=\
- $(SLO)$/sdrallattribute.obj \
+ $(SLO)$/sdrfilltextattribute.obj \
+ $(SLO)$/sdrlinefillshadowtextattribute.obj \
+ $(SLO)$/sdrlineshadowtextattribute.obj \
+ $(SLO)$/sdrshadowtextattribute.obj \
$(SLO)$/sdrtextattribute.obj \
$(SLO)$/sdrformtextattribute.obj \
$(SLO)$/sdrformtextoutlineattribute.obj
diff --git a/svx/source/sdr/attribute/sdrallattribute.cxx b/svx/source/sdr/attribute/sdrallattribute.cxx
deleted file mode 100644
index 605c023c50..0000000000
--- a/svx/source/sdr/attribute/sdrallattribute.cxx
+++ /dev/null
@@ -1,408 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "precompiled_svx.hxx"
-
-#include <svx/sdr/attribute/sdrallattribute.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
-#include <drawinglayer/attribute/fillattribute.hxx>
-#include <svx/sdr/attribute/sdrtextattribute.hxx>
-
-//////////////////////////////////////////////////////////////////////////////
-// pointer compare define
-#define pointerOrContentEqual(p, q) ((p == q) || (p && q && *p == *q))
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- SdrShadowTextAttribute::SdrShadowTextAttribute(
- SdrShadowAttribute* pShadow,
- SdrTextAttribute* pTextAttribute)
- : mpShadow(pShadow),
- mpTextAttribute(pTextAttribute)
- {
- }
-
- SdrShadowTextAttribute::SdrShadowTextAttribute(
- const SdrShadowTextAttribute& rCandidate)
- : mpShadow(0),
- mpTextAttribute(0)
- {
- *this = rCandidate;
- }
-
- SdrShadowTextAttribute::~SdrShadowTextAttribute()
- {
- delete mpShadow;
- delete mpTextAttribute;
- }
-
- SdrShadowTextAttribute& SdrShadowTextAttribute::operator=(const SdrShadowTextAttribute& rCandidate)
- {
- // handle mpShadow
- {
- // delete local mpShadow if necessary
- if(mpShadow)
- {
- delete mpShadow;
- mpShadow = 0;
- }
-
- // copy mpShadow if necessary
- if(rCandidate.mpShadow)
- {
- mpShadow = new SdrShadowAttribute(*rCandidate.mpShadow);
- }
- }
-
- // handle mpTextAttribute
- {
- // delete local mpTextAttribute if necessary
- if(mpTextAttribute)
- {
- delete mpTextAttribute;
- mpTextAttribute = 0;
- }
-
- // copy mpTextAttribute if necessary
- if(rCandidate.mpTextAttribute)
- {
- mpTextAttribute = new SdrTextAttribute(*rCandidate.mpTextAttribute);
- }
- }
-
- return *this;
- }
-
- bool SdrShadowTextAttribute::operator==(const SdrShadowTextAttribute& rCandidate) const
- {
- // handle mpShadow
- if(!pointerOrContentEqual(mpShadow, rCandidate.mpShadow))
- return false;
-
- // handle mpTextAttribute
- if(!pointerOrContentEqual(mpTextAttribute, rCandidate.mpTextAttribute))
- return false;
-
- return true;
- }
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- SdrFillTextAttribute::SdrFillTextAttribute(
- SdrFillAttribute* pFill,
- FillGradientAttribute* pFillFloatTransGradient,
- SdrTextAttribute* pTextAttribute)
- : mpFill(pFill),
- mpFillFloatTransGradient(pFillFloatTransGradient),
- mpTextAttribute(pTextAttribute)
- {
- }
-
- SdrFillTextAttribute::SdrFillTextAttribute(
- const SdrFillTextAttribute& rCandidate)
- : mpFill(0),
- mpFillFloatTransGradient(0),
- mpTextAttribute(0)
- {
- *this = rCandidate;
- }
-
- SdrFillTextAttribute::~SdrFillTextAttribute()
- {
- delete mpFill;
- delete mpFillFloatTransGradient;
- delete mpTextAttribute;
- }
-
- SdrFillTextAttribute& SdrFillTextAttribute::operator=(const SdrFillTextAttribute& rCandidate)
- {
- // handle mpFill
- {
- // delete local mpFill if necessary
- if(mpFill)
- {
- delete mpFill;
- mpFill = 0;
- }
-
- // copy mpFill if necessary
- if(rCandidate.mpFill)
- {
- mpFill = new attribute::SdrFillAttribute(*rCandidate.mpFill);
- }
- }
-
- // handle mpFillFloatTransGradient
- {
- // delete local mpFillFloatTransGradient if necessary
- if(mpFillFloatTransGradient)
- {
- delete mpFillFloatTransGradient;
- mpFillFloatTransGradient = 0;
- }
-
- // copy mpFillFloatTransGradient if necessary
- if(rCandidate.mpFillFloatTransGradient)
- {
- mpFillFloatTransGradient = new FillGradientAttribute(*rCandidate.mpFillFloatTransGradient);
- }
- }
-
- // handle mpTextAttribute
- {
- // delete local mpTextAttribute if necessary
- if(mpTextAttribute)
- {
- delete mpTextAttribute;
- mpTextAttribute = 0;
- }
-
- // copy mpTextAttribute if necessary
- if(rCandidate.mpTextAttribute)
- {
- mpTextAttribute = new SdrTextAttribute(*rCandidate.mpTextAttribute);
- }
- }
-
- return *this;
- }
-
- bool SdrFillTextAttribute::operator==(const SdrFillTextAttribute& rCandidate) const
- {
- // handle mpFill
- if(!pointerOrContentEqual(mpFill, rCandidate.mpFill))
- return false;
-
- // handle mpFillFloatTransGradient
- if(!pointerOrContentEqual(mpFillFloatTransGradient, rCandidate.mpFillFloatTransGradient))
- return false;
-
- // handle mpTextAttribute
- if(!pointerOrContentEqual(mpTextAttribute, rCandidate.mpTextAttribute))
- return false;
-
- return true;
- }
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- SdrLineShadowTextAttribute::SdrLineShadowTextAttribute(
- SdrLineAttribute* pLine,
- SdrLineStartEndAttribute* pLineStartEnd,
- SdrShadowAttribute* pShadow,
- SdrTextAttribute* pTextAttribute)
- : SdrShadowTextAttribute(pShadow, pTextAttribute),
- mpLine(pLine),
- mpLineStartEnd(pLineStartEnd)
- {
- }
-
- SdrLineShadowTextAttribute::SdrLineShadowTextAttribute(
- const SdrLineShadowTextAttribute& rCandidate)
- : SdrShadowTextAttribute(0, 0),
- mpLine(0),
- mpLineStartEnd(0)
- {
- *this = rCandidate;
- }
-
- SdrLineShadowTextAttribute::~SdrLineShadowTextAttribute()
- {
- delete mpLine;
- delete mpLineStartEnd;
- }
-
- SdrLineShadowTextAttribute& SdrLineShadowTextAttribute::operator=(const SdrLineShadowTextAttribute& rCandidate)
- {
- // call parent
- SdrShadowTextAttribute::operator=(rCandidate);
-
- // handle mpLine
- {
- // delete local mpLine if necessary
- if(mpLine)
- {
- delete mpLine;
- mpLine = 0;
- }
-
- // copy mpLine if necessary
- if(rCandidate.mpLine)
- {
- mpLine = new SdrLineAttribute(*rCandidate.mpLine);
- }
- }
-
- // handle mpLineStartEnd
- {
- // delete local mpLineStartEnd if necessary
- if(mpLineStartEnd)
- {
- delete mpLineStartEnd;
- mpLineStartEnd = 0;
- }
-
- // copy mpLineStartEnd if necessary
- if(rCandidate.mpLineStartEnd)
- {
- mpLineStartEnd = new SdrLineStartEndAttribute(*rCandidate.mpLineStartEnd);
- }
- }
-
- return *this;
- }
-
- bool SdrLineShadowTextAttribute::operator==(const SdrLineShadowTextAttribute& rCandidate) const
- {
- // call parent
- if(!(SdrShadowTextAttribute::operator==(rCandidate)))
- return false;
-
- // handle mpLine
- if(!pointerOrContentEqual(mpLine, rCandidate.mpLine))
- return false;
-
- // handle mpLineStartEnd
- if(!pointerOrContentEqual(mpLineStartEnd, rCandidate.mpLineStartEnd))
- return false;
-
- return true;
- }
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- SdrLineFillShadowTextAttribute::SdrLineFillShadowTextAttribute(
- SdrLineAttribute* pLine,
- attribute::SdrFillAttribute* pFill,
- SdrLineStartEndAttribute* pLineStartEnd,
- SdrShadowAttribute* pShadow,
- FillGradientAttribute* pFillFloatTransGradient,
- SdrTextAttribute* pTextAttribute)
- : SdrLineShadowTextAttribute(pLine, pLineStartEnd, pShadow, pTextAttribute),
- mpFill(pFill),
- mpFillFloatTransGradient(pFillFloatTransGradient)
- {
- }
-
- SdrLineFillShadowTextAttribute::SdrLineFillShadowTextAttribute(
- const SdrLineFillShadowTextAttribute& rCandidate)
- : SdrLineShadowTextAttribute(0, 0, 0, 0),
- mpFill(0),
- mpFillFloatTransGradient(0)
- {
- *this = rCandidate;
- }
-
- SdrLineFillShadowTextAttribute::~SdrLineFillShadowTextAttribute()
- {
- delete mpFill;
- delete mpFillFloatTransGradient;
- }
-
- SdrLineFillShadowTextAttribute& SdrLineFillShadowTextAttribute::operator=(const SdrLineFillShadowTextAttribute& rCandidate)
- {
- // call parent
- SdrLineShadowTextAttribute::operator=(rCandidate);
-
- // handle mpFill
- {
- // delete local mpFill if necessary
- if(mpFill)
- {
- delete mpFill;
- mpFill = 0;
- }
-
- // copy mpFill if necessary
- if(rCandidate.mpFill)
- {
- mpFill = new attribute::SdrFillAttribute(*rCandidate.mpFill);
- }
- }
-
- // handle mpFillFloatTransGradient
- {
- // delete local mpFillFloatTransGradient if necessary
- if(mpFillFloatTransGradient)
- {
- delete mpFillFloatTransGradient;
- mpFillFloatTransGradient = 0;
- }
-
- // copy mpFillFloatTransGradient if necessary
- if(rCandidate.mpFillFloatTransGradient)
- {
- mpFillFloatTransGradient = new FillGradientAttribute(*rCandidate.mpFillFloatTransGradient);
- }
- }
-
- return *this;
- }
-
- bool SdrLineFillShadowTextAttribute::operator==(const SdrLineFillShadowTextAttribute& rCandidate) const
- {
- // call parent
- if(!(SdrLineShadowTextAttribute::operator==(rCandidate)))
- return false;
-
- // handle mpFill
- if(!pointerOrContentEqual(mpFill, rCandidate.mpFill))
- return false;
-
- // handle mpFillFloatTransGradient
- if(!pointerOrContentEqual(mpFillFloatTransGradient, rCandidate.mpFillFloatTransGradient))
- return false;
-
- return true;
- }
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-// eof
diff --git a/svx/source/sdr/attribute/sdrfilltextattribute.cxx b/svx/source/sdr/attribute/sdrfilltextattribute.cxx
new file mode 100644
index 0000000000..f31622bfc8
--- /dev/null
+++ b/svx/source/sdr/attribute/sdrfilltextattribute.cxx
@@ -0,0 +1,92 @@
+/*************************************************************************
+ *
+ * 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: sdrallattribute.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "precompiled_svx.hxx"
+
+#include <svx/sdr/attribute/sdrfilltextattribute.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ SdrFillTextAttribute::SdrFillTextAttribute(
+ const SdrFillAttribute& rFill,
+ const FillGradientAttribute& rFillFloatTransGradient,
+ const SdrTextAttribute& rTextAttribute)
+ : maFill(rFill),
+ maFillFloatTransGradient(rFillFloatTransGradient),
+ maTextAttribute(rTextAttribute)
+ {
+ }
+
+ SdrFillTextAttribute::SdrFillTextAttribute()
+ : maFill(),
+ maFillFloatTransGradient(),
+ maTextAttribute()
+ {
+ }
+
+ SdrFillTextAttribute::SdrFillTextAttribute(const SdrFillTextAttribute& rCandidate)
+ : maFill(rCandidate.getFill()),
+ maFillFloatTransGradient(rCandidate.getFillFloatTransGradient()),
+ maTextAttribute(rCandidate.getText())
+ {
+ }
+
+ SdrFillTextAttribute& SdrFillTextAttribute::operator=(const SdrFillTextAttribute& rCandidate)
+ {
+ maFill = rCandidate.getFill();
+ maFillFloatTransGradient = rCandidate.getFillFloatTransGradient();
+ maTextAttribute = rCandidate.getText();
+
+ return *this;
+ }
+
+ bool SdrFillTextAttribute::isDefault() const
+ {
+ return(getFill().isDefault()
+ && getFillFloatTransGradient().isDefault()
+ && getText().isDefault());
+ }
+
+ bool SdrFillTextAttribute::operator==(const SdrFillTextAttribute& rCandidate) const
+ {
+ return(getFill() == rCandidate.getFill()
+ && getFillFloatTransGradient() == rCandidate.getFillFloatTransGradient()
+ && getText() == rCandidate.getText());
+ }
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/sdr/attribute/sdrformtextattribute.cxx b/svx/source/sdr/attribute/sdrformtextattribute.cxx
index d475bd3f60..7cf7b58789 100644
--- a/svx/source/sdr/attribute/sdrformtextattribute.cxx
+++ b/svx/source/sdr/attribute/sdrformtextattribute.cxx
@@ -28,8 +28,8 @@
#include "precompiled_svx.hxx"
#include <svx/sdr/attribute/sdrformtextattribute.hxx>
+#include <basegfx/vector/b2enums.hxx>
#include <svl/itemset.hxx>
-
#include <svx/xftdiit.hxx>
#include <svx/xftstit.hxx>
#include <svx/xftshxy.hxx>
@@ -40,11 +40,8 @@
#include <svx/xftshcit.hxx>
#include <svx/xftmrit.hxx>
#include <svx/xftouit.hxx>
-
#include <svx/sdshtitm.hxx>
#include <svx/xlntrit.hxx>
-#include <drawinglayer/attribute/lineattribute.hxx>
-#include <drawinglayer/attribute/strokeattribute.hxx>
#include <svx/sdshcitm.hxx>
#include <svx/xlnclit.hxx>
#include <svx/xlnwtit.hxx>
@@ -52,13 +49,11 @@
#include <svx/xlineit0.hxx>
#include <svx/xdash.hxx>
#include <svx/xlndsit.hxx>
+#include <drawinglayer/attribute/lineattribute.hxx>
+#include <drawinglayer/attribute/strokeattribute.hxx>
#include <svx/sdr/attribute/sdrformtextoutlineattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
-// pointer compare define
-#define pointerOrContentEqual(p, q) ((p == q) || (p && q && *p == *q))
-
-//////////////////////////////////////////////////////////////////////////////
// helper to get line, stroke and transparence attributes from SfxItemSet
namespace
@@ -154,144 +149,272 @@ namespace drawinglayer
{
namespace attribute
{
- SdrFormTextAttribute::SdrFormTextAttribute(const SfxItemSet& rSet)
- : mnFormTextDistance(((const XFormTextDistanceItem&)rSet.Get(XATTR_FORMTXTDISTANCE)).GetValue()),
- mnFormTextStart(((const XFormTextStartItem&)rSet.Get(XATTR_FORMTXTSTART)).GetValue()),
- mnFormTextShdwXVal(((const XFormTextShadowXValItem&)rSet.Get(XATTR_FORMTXTSHDWXVAL)).GetValue()),
- mnFormTextShdwYVal(((const XFormTextShadowYValItem&)rSet.Get(XATTR_FORMTXTSHDWYVAL)).GetValue()),
- mnFormTextShdwTransp(((const XFormTextShadowTranspItem&)rSet.Get(XATTR_FORMTXTSHDWTRANSP)).GetValue()),
- meFormTextStyle(((const XFormTextStyleItem&)rSet.Get(XATTR_FORMTXTSTYLE)).GetValue()),
- meFormTextAdjust(((const XFormTextAdjustItem&)rSet.Get(XATTR_FORMTXTADJUST)).GetValue()),
- meFormTextShadow(((const XFormTextShadowItem&)rSet.Get(XATTR_FORMTXTSHADOW)).GetValue()),
- maFormTextShdwColor(((const XFormTextShadowColorItem&)rSet.Get(XATTR_FORMTXTSHDWCOLOR)).GetColorValue()),
- mpOutline(0),
- mpShadowOutline(0),
- mbFormTextMirror(((const XFormTextMirrorItem&)rSet.Get(XATTR_FORMTXTMIRROR)).GetValue()),
- mbFormTextOutline(((const XFormTextOutlineItem&)rSet.Get(XATTR_FORMTXTOUTLINE)).GetValue())
+ class ImpSdrFormTextAttribute
{
- if(getFormTextOutline())
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ // FormText (FontWork) Attributes
+ sal_Int32 mnFormTextDistance; // distance from line in upright direction
+ sal_Int32 mnFormTextStart; // shift from polygon start
+ sal_Int32 mnFormTextShdwXVal; // shadow distance or 10th degrees
+ sal_Int32 mnFormTextShdwYVal; // shadow distance or scaling
+ sal_uInt16 mnFormTextShdwTransp; // shadow transparence
+ XFormTextStyle meFormTextStyle; // on/off and char orientation
+ XFormTextAdjust meFormTextAdjust; // adjustment (left/right/center) and scale
+ XFormTextShadow meFormTextShadow; // shadow mode
+ Color maFormTextShdwColor; // shadow color
+
+ // outline attributes; used when getFormTextOutline() is true and (for
+ // shadow) when getFormTextShadow() != XFTSHADOW_NONE
+ SdrFormTextOutlineAttribute maOutline;
+ SdrFormTextOutlineAttribute maShadowOutline;
+
+ // bitfield
+ unsigned mbFormTextMirror : 1; // change orientation
+ unsigned mbFormTextOutline : 1; // show contour of objects
+
+ ImpSdrFormTextAttribute(const SfxItemSet& rSet)
+ : mnRefCount(0),
+ mnFormTextDistance(((const XFormTextDistanceItem&)rSet.Get(XATTR_FORMTXTDISTANCE)).GetValue()),
+ mnFormTextStart(((const XFormTextStartItem&)rSet.Get(XATTR_FORMTXTSTART)).GetValue()),
+ mnFormTextShdwXVal(((const XFormTextShadowXValItem&)rSet.Get(XATTR_FORMTXTSHDWXVAL)).GetValue()),
+ mnFormTextShdwYVal(((const XFormTextShadowYValItem&)rSet.Get(XATTR_FORMTXTSHDWYVAL)).GetValue()),
+ mnFormTextShdwTransp(((const XFormTextShadowTranspItem&)rSet.Get(XATTR_FORMTXTSHDWTRANSP)).GetValue()),
+ meFormTextStyle(((const XFormTextStyleItem&)rSet.Get(XATTR_FORMTXTSTYLE)).GetValue()),
+ meFormTextAdjust(((const XFormTextAdjustItem&)rSet.Get(XATTR_FORMTXTADJUST)).GetValue()),
+ meFormTextShadow(((const XFormTextShadowItem&)rSet.Get(XATTR_FORMTXTSHADOW)).GetValue()),
+ maFormTextShdwColor(((const XFormTextShadowColorItem&)rSet.Get(XATTR_FORMTXTSHDWCOLOR)).GetColorValue()),
+ maOutline(),
+ maShadowOutline(),
+ mbFormTextMirror(((const XFormTextMirrorItem&)rSet.Get(XATTR_FORMTXTMIRROR)).GetValue()),
+ mbFormTextOutline(((const XFormTextOutlineItem&)rSet.Get(XATTR_FORMTXTOUTLINE)).GetValue())
{
- const StrokeAttribute aStrokeAttribute(impGetStrokeAttribute(rSet));
-
- // also need to prepare attributes for outlines
+ if(getFormTextOutline())
{
- const LineAttribute aLineAttribute(impGetLineAttribute(false, rSet));
- const sal_uInt8 nTransparence(impGetStrokeTransparence(false, rSet));
-
- mpOutline = new SdrFormTextOutlineAttribute(
- aLineAttribute, aStrokeAttribute, nTransparence);
+ const StrokeAttribute aStrokeAttribute(impGetStrokeAttribute(rSet));
+
+ // also need to prepare attributes for outlines
+ {
+ const LineAttribute aLineAttribute(impGetLineAttribute(false, rSet));
+ const sal_uInt8 nTransparence(impGetStrokeTransparence(false, rSet));
+
+ maOutline = SdrFormTextOutlineAttribute(
+ aLineAttribute, aStrokeAttribute, nTransparence);
+ }
+
+ if(XFTSHADOW_NONE != getFormTextShadow())
+ {
+ // also need to prepare attributes for shadow outlines
+ const LineAttribute aLineAttribute(impGetLineAttribute(true, rSet));
+ const sal_uInt8 nTransparence(impGetStrokeTransparence(true, rSet));
+
+ maShadowOutline = SdrFormTextOutlineAttribute(
+ aLineAttribute, aStrokeAttribute, nTransparence);
+ }
}
+ }
- if(XFTSHADOW_NONE != getFormTextShadow())
- {
- // also need to prepare attributes for shadow outlines
- const LineAttribute aLineAttribute(impGetLineAttribute(true, rSet));
- const sal_uInt8 nTransparence(impGetStrokeTransparence(true, rSet));
-
- mpShadowOutline = new SdrFormTextOutlineAttribute(
- aLineAttribute, aStrokeAttribute, nTransparence);
- }
+ ImpSdrFormTextAttribute()
+ : mnRefCount(0),
+ mnFormTextDistance(0),
+ mnFormTextStart(0),
+ mnFormTextShdwXVal(0),
+ mnFormTextShdwYVal(0),
+ mnFormTextShdwTransp(0),
+ meFormTextStyle(XFT_NONE),
+ meFormTextAdjust(XFT_CENTER),
+ meFormTextShadow(XFTSHADOW_NONE),
+ maFormTextShdwColor(),
+ maOutline(),
+ maShadowOutline(),
+ mbFormTextMirror(false),
+ mbFormTextOutline(false)
+ {
}
- }
- SdrFormTextAttribute::~SdrFormTextAttribute()
- {
- if(mpOutline)
+ // data read access
+ sal_Int32 getFormTextDistance() const { return mnFormTextDistance; }
+ sal_Int32 getFormTextStart() const { return mnFormTextStart; }
+ sal_Int32 getFormTextShdwXVal() const { return mnFormTextShdwXVal; }
+ sal_Int32 getFormTextShdwYVal() const { return mnFormTextShdwYVal; }
+ sal_uInt16 getFormTextShdwTransp() const { return mnFormTextShdwTransp; }
+ XFormTextStyle getFormTextStyle() const { return meFormTextStyle; }
+ XFormTextAdjust getFormTextAdjust() const { return meFormTextAdjust; }
+ XFormTextShadow getFormTextShadow() const { return meFormTextShadow; }
+ Color getFormTextShdwColor() const { return maFormTextShdwColor; }
+ const SdrFormTextOutlineAttribute& getOutline() const { return maOutline; }
+ const SdrFormTextOutlineAttribute& getShadowOutline() const { return maShadowOutline; }
+ bool getFormTextMirror() const { return mbFormTextMirror; }
+ bool getFormTextOutline() const { return mbFormTextOutline; }
+
+ // compare operator
+ bool operator==(const ImpSdrFormTextAttribute& rCandidate) const
{
- delete mpOutline;
- mpOutline = 0;
+ return (getFormTextDistance() == rCandidate.getFormTextDistance()
+ && getFormTextStart() == rCandidate.getFormTextStart()
+ && getFormTextShdwXVal() == rCandidate.getFormTextShdwXVal()
+ && getFormTextShdwYVal() == rCandidate.getFormTextShdwYVal()
+ && getFormTextShdwTransp() == rCandidate.getFormTextShdwTransp()
+ && getFormTextStyle() == rCandidate.getFormTextStyle()
+ && getFormTextAdjust() == rCandidate.getFormTextAdjust()
+ && getFormTextShadow() == rCandidate.getFormTextShadow()
+ && getFormTextShdwColor() == rCandidate.getFormTextShdwColor()
+ && getOutline() == rCandidate.getOutline()
+ && getShadowOutline() == rCandidate.getShadowOutline()
+ && getFormTextMirror() == rCandidate.getFormTextMirror()
+ && getFormTextOutline() == rCandidate.getFormTextOutline());
}
- if(mpShadowOutline)
+ static ImpSdrFormTextAttribute* get_global_default()
{
- delete mpShadowOutline;
- mpShadowOutline = 0;
+ static ImpSdrFormTextAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpSdrFormTextAttribute();
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
}
+ };
+
+ SdrFormTextAttribute::SdrFormTextAttribute(const SfxItemSet& rSet)
+ : mpSdrFormTextAttribute(new ImpSdrFormTextAttribute(rSet))
+ {
+ }
+
+ SdrFormTextAttribute::SdrFormTextAttribute()
+ : mpSdrFormTextAttribute(ImpSdrFormTextAttribute::get_global_default())
+ {
+ mpSdrFormTextAttribute->mnRefCount++;
}
SdrFormTextAttribute::SdrFormTextAttribute(const SdrFormTextAttribute& rCandidate)
- : mnFormTextDistance(rCandidate.getFormTextDistance()),
- mnFormTextStart(rCandidate.getFormTextStart()),
- mnFormTextShdwXVal(rCandidate.getFormTextShdwXVal()),
- mnFormTextShdwYVal(rCandidate.getFormTextShdwYVal()),
- mnFormTextShdwTransp(rCandidate.getFormTextShdwTransp()),
- meFormTextStyle(rCandidate.getFormTextStyle()),
- meFormTextAdjust(rCandidate.getFormTextAdjust()),
- meFormTextShadow(rCandidate.getFormTextShadow()),
- maFormTextShdwColor(rCandidate.getFormTextShdwColor()),
- mpOutline(0),
- mpShadowOutline(0),
- mbFormTextMirror(rCandidate.getFormTextMirror()),
- mbFormTextOutline(rCandidate.getFormTextOutline())
+ : mpSdrFormTextAttribute(rCandidate.mpSdrFormTextAttribute)
{
- if(rCandidate.getOutline())
+ mpSdrFormTextAttribute->mnRefCount++;
+ }
+
+ SdrFormTextAttribute::~SdrFormTextAttribute()
+ {
+ if(mpSdrFormTextAttribute->mnRefCount)
{
- mpOutline = new SdrFormTextOutlineAttribute(*rCandidate.getOutline());
+ mpSdrFormTextAttribute->mnRefCount--;
}
-
- if(rCandidate.getShadowOutline())
+ else
{
- mpShadowOutline = new SdrFormTextOutlineAttribute(*rCandidate.getShadowOutline());
+ delete mpSdrFormTextAttribute;
}
}
+ bool SdrFormTextAttribute::isDefault() const
+ {
+ return mpSdrFormTextAttribute == ImpSdrFormTextAttribute::get_global_default();
+ }
+
SdrFormTextAttribute& SdrFormTextAttribute::operator=(const SdrFormTextAttribute& rCandidate)
{
- mnFormTextDistance = rCandidate.getFormTextDistance();
- mnFormTextStart = rCandidate.getFormTextStart();
- mnFormTextShdwXVal = rCandidate.getFormTextShdwXVal();
- mnFormTextShdwYVal = rCandidate.getFormTextShdwYVal();
- mnFormTextShdwTransp = rCandidate.getFormTextShdwTransp();
- meFormTextStyle = rCandidate.getFormTextStyle();
- meFormTextAdjust = rCandidate.getFormTextAdjust();
- meFormTextShadow = rCandidate.getFormTextShadow();
- maFormTextShdwColor = rCandidate.getFormTextShdwColor();
-
- if(mpOutline)
+ if(rCandidate.mpSdrFormTextAttribute != mpSdrFormTextAttribute)
{
- delete mpOutline;
+ if(mpSdrFormTextAttribute->mnRefCount)
+ {
+ mpSdrFormTextAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrFormTextAttribute;
+ }
+
+ mpSdrFormTextAttribute = rCandidate.mpSdrFormTextAttribute;
+ mpSdrFormTextAttribute->mnRefCount++;
}
- mpOutline = 0;
+ return *this;
+ }
- if(rCandidate.getOutline())
+ bool SdrFormTextAttribute::operator==(const SdrFormTextAttribute& rCandidate) const
+ {
+ if(rCandidate.mpSdrFormTextAttribute == mpSdrFormTextAttribute)
{
- mpOutline = new SdrFormTextOutlineAttribute(*rCandidate.getOutline());
+ return true;
}
- if(mpShadowOutline)
+ if(rCandidate.isDefault() != isDefault())
{
- delete mpShadowOutline;
+ return false;
}
- mpShadowOutline = 0;
-
- if(rCandidate.getShadowOutline())
- {
- mpShadowOutline = new SdrFormTextOutlineAttribute(*rCandidate.getShadowOutline());
- }
+ return (*rCandidate.mpSdrFormTextAttribute == *mpSdrFormTextAttribute);
+ }
+
+ sal_Int32 SdrFormTextAttribute::getFormTextDistance() const
+ {
+ return mpSdrFormTextAttribute->getFormTextDistance();
+ }
- mbFormTextMirror = rCandidate.getFormTextMirror();
- mbFormTextOutline = rCandidate.getFormTextOutline();
+ sal_Int32 SdrFormTextAttribute::getFormTextStart() const
+ {
+ return mpSdrFormTextAttribute->getFormTextStart();
+ }
- return *this;
+ sal_Int32 SdrFormTextAttribute::getFormTextShdwXVal() const
+ {
+ return mpSdrFormTextAttribute->getFormTextShdwXVal();
}
- bool SdrFormTextAttribute::operator==(const SdrFormTextAttribute& rCandidate) const
- {
- return (getFormTextDistance() == rCandidate.getFormTextDistance()
- && getFormTextStart() == rCandidate.getFormTextStart()
- && getFormTextShdwXVal() == rCandidate.getFormTextShdwXVal()
- && getFormTextShdwYVal() == rCandidate.getFormTextShdwYVal()
- && getFormTextShdwTransp() == rCandidate.getFormTextShdwTransp()
- && getFormTextStyle() == rCandidate.getFormTextStyle()
- && getFormTextAdjust() == rCandidate.getFormTextAdjust()
- && getFormTextShadow() == rCandidate.getFormTextShadow()
- && getFormTextShdwColor() == rCandidate.getFormTextShdwColor()
- && pointerOrContentEqual(getOutline(), rCandidate.getOutline())
- && pointerOrContentEqual(getShadowOutline(), rCandidate.getShadowOutline())
- && getFormTextMirror() == rCandidate.getFormTextMirror()
- && getFormTextOutline() == rCandidate.getFormTextOutline());
+ sal_Int32 SdrFormTextAttribute::getFormTextShdwYVal() const
+ {
+ return mpSdrFormTextAttribute->getFormTextShdwYVal();
+ }
+
+ sal_uInt16 SdrFormTextAttribute::getFormTextShdwTransp() const
+ {
+ return mpSdrFormTextAttribute->getFormTextShdwTransp();
+ }
+
+ XFormTextStyle SdrFormTextAttribute::getFormTextStyle() const
+ {
+ return mpSdrFormTextAttribute->getFormTextStyle();
+ }
+
+ XFormTextAdjust SdrFormTextAttribute::getFormTextAdjust() const
+ {
+ return mpSdrFormTextAttribute->getFormTextAdjust();
+ }
+
+ XFormTextShadow SdrFormTextAttribute::getFormTextShadow() const
+ {
+ return mpSdrFormTextAttribute->getFormTextShadow();
+ }
+
+ Color SdrFormTextAttribute::getFormTextShdwColor() const
+ {
+ return mpSdrFormTextAttribute->getFormTextShdwColor();
+ }
+
+ const SdrFormTextOutlineAttribute& SdrFormTextAttribute::getOutline() const
+ {
+ return mpSdrFormTextAttribute->getOutline();
+ }
+
+ const SdrFormTextOutlineAttribute& SdrFormTextAttribute::getShadowOutline() const
+ {
+ return mpSdrFormTextAttribute->getShadowOutline();
+ }
+
+ bool SdrFormTextAttribute::getFormTextMirror() const
+ {
+ return mpSdrFormTextAttribute->getFormTextMirror();
+ }
+
+ bool SdrFormTextAttribute::getFormTextOutline() const
+ {
+ return mpSdrFormTextAttribute->getFormTextOutline();
}
} // end of namespace attribute
} // end of namespace drawinglayer
diff --git a/svx/source/sdr/attribute/sdrformtextoutlineattribute.cxx b/svx/source/sdr/attribute/sdrformtextoutlineattribute.cxx
index cfa1cf49d6..be33783023 100644
--- a/svx/source/sdr/attribute/sdrformtextoutlineattribute.cxx
+++ b/svx/source/sdr/attribute/sdrformtextoutlineattribute.cxx
@@ -28,10 +28,8 @@
#include "precompiled_svx.hxx"
#include <svx/sdr/attribute/sdrformtextoutlineattribute.hxx>
-
-//////////////////////////////////////////////////////////////////////////////
-// pointer compare define
-#define pointerOrContentEqual(p, q) ((p == q) || (p && q && *p == *q))
+#include <drawinglayer/attribute/lineattribute.hxx>
+#include <drawinglayer/attribute/strokeattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -39,21 +37,146 @@ namespace drawinglayer
{
namespace attribute
{
+ class ImpSdrFormTextOutlineAttribute
+ {
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ // one set of attributes for FormText (FontWork) outline visualisation
+ LineAttribute maLineAttribute;
+ StrokeAttribute maStrokeAttribute;
+ sal_uInt8 mnTransparence;
+
+ ImpSdrFormTextOutlineAttribute(
+ const LineAttribute& rLineAttribute,
+ const StrokeAttribute& rStrokeAttribute,
+ sal_uInt8 nTransparence)
+ : mnRefCount(0),
+ maLineAttribute(rLineAttribute),
+ maStrokeAttribute(rStrokeAttribute),
+ mnTransparence(nTransparence)
+ {
+ }
+
+ // data read access
+ const LineAttribute& getLineAttribute() const { return maLineAttribute; }
+ const StrokeAttribute& getStrokeAttribute() const { return maStrokeAttribute; }
+ sal_uInt8 getTransparence() const { return mnTransparence; }
+
+ // compare operator
+ bool operator==(const ImpSdrFormTextOutlineAttribute& rCandidate) const
+ {
+ return (getLineAttribute() == rCandidate.getLineAttribute()
+ && getStrokeAttribute() == rCandidate.getStrokeAttribute()
+ && getTransparence() == rCandidate.getTransparence());
+ }
+
+ static ImpSdrFormTextOutlineAttribute* get_global_default()
+ {
+ static ImpSdrFormTextOutlineAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpSdrFormTextOutlineAttribute(
+ LineAttribute(),
+ StrokeAttribute(),
+ 0);
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
+ };
+
SdrFormTextOutlineAttribute::SdrFormTextOutlineAttribute(
const LineAttribute& rLineAttribute,
const StrokeAttribute& rStrokeAttribute,
sal_uInt8 nTransparence)
- : maLineAttribute(rLineAttribute),
- maStrokeAttribute(rStrokeAttribute),
- mnTransparence(nTransparence)
+ : mpSdrFormTextOutlineAttribute(new ImpSdrFormTextOutlineAttribute(
+ rLineAttribute, rStrokeAttribute, nTransparence))
+ {
+ }
+
+ SdrFormTextOutlineAttribute::SdrFormTextOutlineAttribute()
+ : mpSdrFormTextOutlineAttribute(ImpSdrFormTextOutlineAttribute::get_global_default())
+ {
+ mpSdrFormTextOutlineAttribute->mnRefCount++;
+ }
+
+ SdrFormTextOutlineAttribute::SdrFormTextOutlineAttribute(const SdrFormTextOutlineAttribute& rCandidate)
+ : mpSdrFormTextOutlineAttribute(rCandidate.mpSdrFormTextOutlineAttribute)
{
+ mpSdrFormTextOutlineAttribute->mnRefCount++;
+ }
+
+ SdrFormTextOutlineAttribute::~SdrFormTextOutlineAttribute()
+ {
+ if(mpSdrFormTextOutlineAttribute->mnRefCount)
+ {
+ mpSdrFormTextOutlineAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrFormTextOutlineAttribute;
+ }
+ }
+
+ bool SdrFormTextOutlineAttribute::isDefault() const
+ {
+ return mpSdrFormTextOutlineAttribute == ImpSdrFormTextOutlineAttribute::get_global_default();
+ }
+
+ SdrFormTextOutlineAttribute& SdrFormTextOutlineAttribute::operator=(const SdrFormTextOutlineAttribute& rCandidate)
+ {
+ if(rCandidate.mpSdrFormTextOutlineAttribute != mpSdrFormTextOutlineAttribute)
+ {
+ if(mpSdrFormTextOutlineAttribute->mnRefCount)
+ {
+ mpSdrFormTextOutlineAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrFormTextOutlineAttribute;
+ }
+
+ mpSdrFormTextOutlineAttribute = rCandidate.mpSdrFormTextOutlineAttribute;
+ mpSdrFormTextOutlineAttribute->mnRefCount++;
+ }
+
+ return *this;
}
bool SdrFormTextOutlineAttribute::operator==(const SdrFormTextOutlineAttribute& rCandidate) const
{
- return (getLineAttribute() == rCandidate.getLineAttribute()
- && getStrokeAttribute() == rCandidate.getStrokeAttribute()
- && getTransparence() == rCandidate.getTransparence());
+ if(rCandidate.mpSdrFormTextOutlineAttribute == mpSdrFormTextOutlineAttribute)
+ {
+ return true;
+ }
+
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
+ return (*rCandidate.mpSdrFormTextOutlineAttribute == *mpSdrFormTextOutlineAttribute);
+ }
+
+ const LineAttribute& SdrFormTextOutlineAttribute::getLineAttribute() const
+ {
+ return mpSdrFormTextOutlineAttribute->getLineAttribute();
+ }
+
+ const StrokeAttribute& SdrFormTextOutlineAttribute::getStrokeAttribute() const
+ {
+ return mpSdrFormTextOutlineAttribute->getStrokeAttribute();
+ }
+
+ sal_uInt8 SdrFormTextOutlineAttribute::getTransparence() const
+ {
+ return mpSdrFormTextOutlineAttribute->getTransparence();
}
} // end of namespace attribute
} // end of namespace drawinglayer
diff --git a/svx/source/sdr/attribute/sdrlinefillshadowtextattribute.cxx b/svx/source/sdr/attribute/sdrlinefillshadowtextattribute.cxx
new file mode 100644
index 0000000000..073d9b7cf8
--- /dev/null
+++ b/svx/source/sdr/attribute/sdrlinefillshadowtextattribute.cxx
@@ -0,0 +1,95 @@
+/*************************************************************************
+ *
+ * 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: sdrallattribute.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "precompiled_svx.hxx"
+
+#include <svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ SdrLineFillShadowTextAttribute::SdrLineFillShadowTextAttribute(
+ const SdrLineAttribute& rLine,
+ const SdrFillAttribute& rFill,
+ const SdrLineStartEndAttribute& rLineStartEnd,
+ const SdrShadowAttribute& rShadow,
+ const FillGradientAttribute& rFillFloatTransGradient,
+ const SdrTextAttribute& rTextAttribute)
+ : SdrLineShadowTextAttribute(rLine, rLineStartEnd, rShadow, rTextAttribute),
+ maFill(rFill),
+ maFillFloatTransGradient(rFillFloatTransGradient)
+ {
+ }
+
+ SdrLineFillShadowTextAttribute::SdrLineFillShadowTextAttribute()
+ : SdrLineShadowTextAttribute(),
+ maFill(),
+ maFillFloatTransGradient()
+ {
+ }
+
+ SdrLineFillShadowTextAttribute::SdrLineFillShadowTextAttribute(const SdrLineFillShadowTextAttribute& rCandidate)
+ : SdrLineShadowTextAttribute(rCandidate),
+ maFill(rCandidate.getFill()),
+ maFillFloatTransGradient(rCandidate.getFillFloatTransGradient())
+ {
+ }
+
+ SdrLineFillShadowTextAttribute& SdrLineFillShadowTextAttribute::operator=(const SdrLineFillShadowTextAttribute& rCandidate)
+ {
+ SdrLineShadowTextAttribute::operator=(rCandidate);
+ maFill = rCandidate.getFill();
+ maFillFloatTransGradient = rCandidate.getFillFloatTransGradient();
+
+ return *this;
+ }
+
+ bool SdrLineFillShadowTextAttribute::isDefault() const
+ {
+ return (SdrLineShadowTextAttribute::isDefault()
+ && getFill().isDefault()
+ && getFillFloatTransGradient().isDefault());
+ }
+
+ bool SdrLineFillShadowTextAttribute::operator==(const SdrLineFillShadowTextAttribute& rCandidate) const
+ {
+ return(SdrLineShadowTextAttribute::operator==(rCandidate)
+ && getFill() == rCandidate.getFill()
+ && getFillFloatTransGradient() == rCandidate.getFillFloatTransGradient());
+ }
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/sdr/attribute/sdrlineshadowtextattribute.cxx b/svx/source/sdr/attribute/sdrlineshadowtextattribute.cxx
new file mode 100644
index 0000000000..f2042d6d0c
--- /dev/null
+++ b/svx/source/sdr/attribute/sdrlineshadowtextattribute.cxx
@@ -0,0 +1,93 @@
+/*************************************************************************
+ *
+ * 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: sdrallattribute.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "precompiled_svx.hxx"
+
+#include <svx/sdr/attribute/sdrlineshadowtextattribute.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ SdrLineShadowTextAttribute::SdrLineShadowTextAttribute(
+ const SdrLineAttribute& rLine,
+ const SdrLineStartEndAttribute& rLineStartEnd,
+ const SdrShadowAttribute& rShadow,
+ const SdrTextAttribute& rTextAttribute)
+ : SdrShadowTextAttribute(rShadow, rTextAttribute),
+ maLine(rLine),
+ maLineStartEnd(rLineStartEnd)
+ {
+ }
+
+ SdrLineShadowTextAttribute::SdrLineShadowTextAttribute()
+ : SdrShadowTextAttribute(),
+ maLine(),
+ maLineStartEnd()
+ {
+ }
+
+ SdrLineShadowTextAttribute::SdrLineShadowTextAttribute(const SdrLineShadowTextAttribute& rCandidate)
+ : SdrShadowTextAttribute(rCandidate),
+ maLine(rCandidate.getLine()),
+ maLineStartEnd(rCandidate.getLineStartEnd())
+ {
+ }
+
+ SdrLineShadowTextAttribute& SdrLineShadowTextAttribute::operator=(const SdrLineShadowTextAttribute& rCandidate)
+ {
+ SdrShadowTextAttribute::operator=(rCandidate);
+ maLine = rCandidate.getLine();
+ maLineStartEnd = rCandidate.getLineStartEnd();
+
+ return *this;
+ }
+
+ bool SdrLineShadowTextAttribute::isDefault() const
+ {
+ return(SdrShadowTextAttribute::isDefault()
+ && getLine().isDefault()
+ && getLineStartEnd().isDefault());
+ }
+
+ bool SdrLineShadowTextAttribute::operator==(const SdrLineShadowTextAttribute& rCandidate) const
+ {
+ return(SdrShadowTextAttribute::operator==(rCandidate)
+ && getLine() == rCandidate.getLine()
+ && getLineStartEnd() == rCandidate.getLineStartEnd());
+ }
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/sdr/attribute/sdrshadowtextattribute.cxx b/svx/source/sdr/attribute/sdrshadowtextattribute.cxx
new file mode 100644
index 0000000000..d1da426a79
--- /dev/null
+++ b/svx/source/sdr/attribute/sdrshadowtextattribute.cxx
@@ -0,0 +1,85 @@
+/*************************************************************************
+ *
+ * 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: sdrallattribute.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "precompiled_svx.hxx"
+
+#include <svx/sdr/attribute/sdrshadowtextattribute.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ SdrShadowTextAttribute::SdrShadowTextAttribute(
+ const SdrShadowAttribute& rShadow,
+ const SdrTextAttribute& rTextAttribute)
+ : maShadow(rShadow),
+ maTextAttribute(rTextAttribute)
+ {
+ }
+
+ SdrShadowTextAttribute::SdrShadowTextAttribute()
+ : maShadow(),
+ maTextAttribute()
+ {
+ }
+
+ SdrShadowTextAttribute::SdrShadowTextAttribute(const SdrShadowTextAttribute& rCandidate)
+ : maShadow(rCandidate.getShadow()),
+ maTextAttribute(rCandidate.getText())
+ {
+ }
+
+ SdrShadowTextAttribute& SdrShadowTextAttribute::operator=(const SdrShadowTextAttribute& rCandidate)
+ {
+ maShadow = rCandidate.getShadow();
+ maTextAttribute = rCandidate.getText();
+
+ return *this;
+ }
+
+ bool SdrShadowTextAttribute::isDefault() const
+ {
+ return (getShadow().isDefault()
+ && getText().isDefault());
+ }
+
+ bool SdrShadowTextAttribute::operator==(const SdrShadowTextAttribute& rCandidate) const
+ {
+ return (getShadow() == rCandidate.getShadow()
+ && getText() == rCandidate.getText());
+ }
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/sdr/attribute/sdrtextattribute.cxx b/svx/source/sdr/attribute/sdrtextattribute.cxx
index b322d82346..c231f2aed4 100644
--- a/svx/source/sdr/attribute/sdrtextattribute.cxx
+++ b/svx/source/sdr/attribute/sdrtextattribute.cxx
@@ -36,15 +36,230 @@
#include <svx/sdr/properties/properties.hxx>
//////////////////////////////////////////////////////////////////////////////
-// pointer compare define
-#define pointerOrContentEqual(p, q) ((p == q) || (p && q && *p == *q))
-
-//////////////////////////////////////////////////////////////////////////////
namespace drawinglayer
{
namespace attribute
{
+ class ImpSdrTextAttribute
+ {
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ // all-text attributes. The SdrText itself and a copy
+ // of te OPO
+ const SdrText* mpSdrText;
+ const OutlinerParaObject* mpOutlinerParaObject;
+
+ // Set when it's a FormText; contains all FormText attributes
+ SdrFormTextAttribute maSdrFormTextAttribute;
+
+ // text distances
+ sal_Int32 maTextLeftDistance;
+ sal_Int32 maTextUpperDistance;
+ sal_Int32 maTextRightDistance;
+ sal_Int32 maTextLowerDistance;
+
+ // #i101556# use versioning from text attributes to detect changes
+ sal_uInt32 maPropertiesVersion;
+
+ // text alignments
+ SdrTextHorzAdjust maSdrTextHorzAdjust;
+ SdrTextVertAdjust maSdrTextVertAdjust;
+
+ // bitfield
+ unsigned mbContour : 1;
+ unsigned mbFitToSize : 1;
+ unsigned mbHideContour : 1;
+ unsigned mbBlink : 1;
+ unsigned mbScroll : 1;
+ unsigned mbInEditMode : 1;
+ unsigned mbFixedCellHeight : 1;
+ unsigned mbWrongSpell : 1;
+
+ public:
+ ImpSdrTextAttribute(
+ const SdrText* pSdrText,
+ const OutlinerParaObject& rOutlinerParaObject,
+ XFormTextStyle eFormTextStyle,
+ sal_Int32 aTextLeftDistance,
+ sal_Int32 aTextUpperDistance,
+ sal_Int32 aTextRightDistance,
+ sal_Int32 aTextLowerDistance,
+ SdrTextHorzAdjust aSdrTextHorzAdjust,
+ SdrTextVertAdjust aSdrTextVertAdjust,
+ bool bContour,
+ bool bFitToSize,
+ bool bHideContour,
+ bool bBlink,
+ bool bScroll,
+ bool bInEditMode,
+ bool bFixedCellHeight,
+ bool bWrongSpell)
+ : mnRefCount(0),
+ mpSdrText(pSdrText),
+ mpOutlinerParaObject(new OutlinerParaObject(rOutlinerParaObject)),
+ maSdrFormTextAttribute(),
+ maTextLeftDistance(aTextLeftDistance),
+ maTextUpperDistance(aTextUpperDistance),
+ maTextRightDistance(aTextRightDistance),
+ maTextLowerDistance(aTextLowerDistance),
+ maPropertiesVersion(0),
+ maSdrTextHorzAdjust(aSdrTextHorzAdjust),
+ maSdrTextVertAdjust(aSdrTextVertAdjust),
+ mbContour(bContour),
+ mbFitToSize(bFitToSize),
+ mbHideContour(bHideContour),
+ mbBlink(bBlink),
+ mbScroll(bScroll),
+ mbInEditMode(bInEditMode),
+ mbFixedCellHeight(bFixedCellHeight),
+ mbWrongSpell(bWrongSpell)
+ {
+ if(pSdrText)
+ {
+ if(XFT_NONE != eFormTextStyle)
+ {
+ // text on path. Create FormText attribute
+ const SfxItemSet& rSet = pSdrText->GetItemSet();
+ maSdrFormTextAttribute = SdrFormTextAttribute(rSet);
+ }
+
+ // #i101556# init with version number to detect changes of single text
+ // attribute and/or style sheets in primitive data without having to
+ // copy that data locally (which would be better from principle)
+ maPropertiesVersion = pSdrText->GetObject().GetProperties().getVersion();
+ }
+ }
+
+ ImpSdrTextAttribute()
+ : mnRefCount(0),
+ mpSdrText(0),
+ mpOutlinerParaObject(0),
+ maSdrFormTextAttribute(),
+ maTextLeftDistance(0),
+ maTextUpperDistance(0),
+ maTextRightDistance(0),
+ maTextLowerDistance(0),
+ maPropertiesVersion(0),
+ maSdrTextHorzAdjust(SDRTEXTHORZADJUST_LEFT),
+ maSdrTextVertAdjust(SDRTEXTVERTADJUST_TOP),
+ mbContour(false),
+ mbFitToSize(false),
+ mbHideContour(false),
+ mbBlink(false),
+ mbScroll(false),
+ mbInEditMode(false),
+ mbFixedCellHeight(false),
+ mbWrongSpell(false)
+ {
+ }
+
+ ~ImpSdrTextAttribute()
+ {
+ if(mpOutlinerParaObject)
+ {
+ delete mpOutlinerParaObject;
+ }
+ }
+
+ // data read access
+ const SdrText& getSdrText() const
+ {
+ OSL_ENSURE(mpSdrText, "Access to text of default version of ImpSdrTextAttribute (!)");
+ return *mpSdrText;
+ }
+ const OutlinerParaObject& getOutlinerParaObject() const
+ {
+ OSL_ENSURE(mpOutlinerParaObject, "Access to OutlinerParaObject of default version of ImpSdrTextAttribute (!)");
+ return *mpOutlinerParaObject;
+ }
+ bool isContour() const { return mbContour; }
+ bool isFitToSize() const { return mbFitToSize; }
+ bool isHideContour() const { return mbHideContour; }
+ bool isBlink() const { return mbBlink; }
+ bool isScroll() const { return mbScroll; }
+ bool isInEditMode() const { return mbInEditMode; }
+ bool isFixedCellHeight() const { return mbFixedCellHeight; }
+ bool isWrongSpell() const { return mbWrongSpell; }
+ const SdrFormTextAttribute& getSdrFormTextAttribute() const { return maSdrFormTextAttribute; }
+ sal_Int32 getTextLeftDistance() const { return maTextLeftDistance; }
+ sal_Int32 getTextUpperDistance() const { return maTextUpperDistance; }
+ sal_Int32 getTextRightDistance() const { return maTextRightDistance; }
+ sal_Int32 getTextLowerDistance() const { return maTextLowerDistance; }
+ sal_uInt32 getPropertiesVersion() const { return maPropertiesVersion; }
+ SdrTextHorzAdjust getSdrTextHorzAdjust() const { return maSdrTextHorzAdjust; }
+ SdrTextVertAdjust getSdrTextVertAdjust() const { return maSdrTextVertAdjust; }
+
+ // compare operator
+ bool operator==(const ImpSdrTextAttribute& rCandidate) const
+ {
+ if(mpOutlinerParaObject != rCandidate.mpOutlinerParaObject)
+ {
+ if(mpOutlinerParaObject && rCandidate.mpOutlinerParaObject)
+ {
+ // compares OPO and it's contents, but traditionally not the RedLining
+ // which is not seen as model, but as temporary information
+ if(!(getOutlinerParaObject() == rCandidate.getOutlinerParaObject()))
+ {
+ return false;
+ }
+
+ // #i102062# for primitive visualisation, the WrongList (SpellChecking)
+ // is important, too, so use isWrongListEqual since there is no WrongList
+ // comparison in the regular OutlinerParaObject compare (since it's
+ // not-persistent data)
+ if(!(getOutlinerParaObject().isWrongListEqual(rCandidate.getOutlinerParaObject())))
+ {
+ return false;
+ }
+ }
+ else
+ {
+ // only one is zero; not equal
+ return false;
+ }
+ }
+
+ return (
+ getSdrFormTextAttribute() == rCandidate.getSdrFormTextAttribute()
+ && getTextLeftDistance() == rCandidate.getTextLeftDistance()
+ && getTextUpperDistance() == rCandidate.getTextUpperDistance()
+ && getTextRightDistance() == rCandidate.getTextRightDistance()
+ && getTextLowerDistance() == rCandidate.getTextLowerDistance()
+ && getPropertiesVersion() == rCandidate.getPropertiesVersion()
+
+ && getSdrTextHorzAdjust() == rCandidate.getSdrTextHorzAdjust()
+ && getSdrTextVertAdjust() == rCandidate.getSdrTextVertAdjust()
+
+ && isContour() == rCandidate.isContour()
+ && isFitToSize() == rCandidate.isFitToSize()
+ && isHideContour() == rCandidate.isHideContour()
+ && isBlink() == rCandidate.isBlink()
+ && isScroll() == rCandidate.isScroll()
+ && isInEditMode() == rCandidate.isInEditMode()
+ && isFixedCellHeight() == rCandidate.isFixedCellHeight()
+ && isWrongSpell() == rCandidate.isWrongSpell());
+ }
+
+ static ImpSdrTextAttribute* get_global_default()
+ {
+ static ImpSdrTextAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ // use default constructor
+ pDefault = new ImpSdrTextAttribute();
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
+ };
+
SdrTextAttribute::SdrTextAttribute(
const SdrText& rSdrText,
const OutlinerParaObject& rOutlinerParaObject,
@@ -61,146 +276,174 @@ namespace drawinglayer
bool bBlink,
bool bScroll,
bool bInEditMode,
- bool bFixedCellHeight)
- : mpSdrText(&rSdrText),
- maOutlinerParaObject(rOutlinerParaObject),
- mpSdrFormTextAttribute(0),
- maTextLeftDistance(aTextLeftDistance),
- maTextUpperDistance(aTextUpperDistance),
- maTextRightDistance(aTextRightDistance),
- maTextLowerDistance(aTextLowerDistance),
- maPropertiesVersion(0),
- maSdrTextHorzAdjust(aSdrTextHorzAdjust),
- maSdrTextVertAdjust(aSdrTextVertAdjust),
- mbContour(bContour),
- mbFitToSize(bFitToSize),
- mbHideContour(bHideContour),
- mbBlink(bBlink),
- mbScroll(bScroll),
- mbInEditMode(bInEditMode),
- mbFixedCellHeight(bFixedCellHeight)
+ bool bFixedCellHeight,
+ bool bWrongSpell)
+ : mpSdrTextAttribute(new ImpSdrTextAttribute(
+ &rSdrText, rOutlinerParaObject, eFormTextStyle, aTextLeftDistance, aTextUpperDistance,
+ aTextRightDistance, aTextLowerDistance, aSdrTextHorzAdjust, aSdrTextVertAdjust, bContour,
+ bFitToSize, bHideContour, bBlink, bScroll, bInEditMode, bFixedCellHeight, bWrongSpell))
{
- if(XFT_NONE != eFormTextStyle)
- {
- // text on path. Create FormText attribute
- const SfxItemSet& rSet = getSdrText().GetItemSet();
- mpSdrFormTextAttribute = new SdrFormTextAttribute(rSet);
- }
+ }
- // #i101556# init with version number to detect changes of single text
- // attribute and/or style sheets in primitive data without having to
- // copy that data locally (which would be better from principle)
- maPropertiesVersion = rSdrText.GetObject().GetProperties().getVersion();
+ SdrTextAttribute::SdrTextAttribute()
+ : mpSdrTextAttribute(ImpSdrTextAttribute::get_global_default())
+ {
+ mpSdrTextAttribute->mnRefCount++;
+ }
+
+ SdrTextAttribute::SdrTextAttribute(const SdrTextAttribute& rCandidate)
+ : mpSdrTextAttribute(rCandidate.mpSdrTextAttribute)
+ {
+ mpSdrTextAttribute->mnRefCount++;
}
SdrTextAttribute::~SdrTextAttribute()
{
- if(mpSdrFormTextAttribute)
+ if(mpSdrTextAttribute->mnRefCount)
{
- delete mpSdrFormTextAttribute;
- mpSdrFormTextAttribute = 0;
+ mpSdrTextAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrTextAttribute;
}
}
- SdrTextAttribute::SdrTextAttribute(const SdrTextAttribute& rCandidate)
- : mpSdrText(&rCandidate.getSdrText()),
- maOutlinerParaObject(rCandidate.getOutlinerParaObject()),
- mpSdrFormTextAttribute(0),
- maTextLeftDistance(rCandidate.getTextLeftDistance()),
- maTextUpperDistance(rCandidate.getTextUpperDistance()),
- maTextRightDistance(rCandidate.getTextRightDistance()),
- maTextLowerDistance(rCandidate.getTextLowerDistance()),
- maPropertiesVersion(rCandidate.getPropertiesVersion()),
- maSdrTextHorzAdjust(rCandidate.getSdrTextHorzAdjust()),
- maSdrTextVertAdjust(rCandidate.getSdrTextVertAdjust()),
- mbContour(rCandidate.isContour()),
- mbFitToSize(rCandidate.isFitToSize()),
- mbHideContour(rCandidate.isHideContour()),
- mbBlink(rCandidate.isBlink()),
- mbScroll(rCandidate.isScroll()),
- mbInEditMode(rCandidate.isInEditMode()),
- mbFixedCellHeight(rCandidate.isFixedCellHeight())
+ bool SdrTextAttribute::isDefault() const
{
- if(rCandidate.getSdrFormTextAttribute())
- {
- mpSdrFormTextAttribute = new SdrFormTextAttribute(*rCandidate.getSdrFormTextAttribute());
- }
+ return mpSdrTextAttribute == ImpSdrTextAttribute::get_global_default();
}
SdrTextAttribute& SdrTextAttribute::operator=(const SdrTextAttribute& rCandidate)
{
- mpSdrText = &rCandidate.getSdrText();
- maOutlinerParaObject = rCandidate.getOutlinerParaObject();
+ if(rCandidate.mpSdrTextAttribute != mpSdrTextAttribute)
+ {
+ if(mpSdrTextAttribute->mnRefCount)
+ {
+ mpSdrTextAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrTextAttribute;
+ }
+
+ mpSdrTextAttribute = rCandidate.mpSdrTextAttribute;
+ mpSdrTextAttribute->mnRefCount++;
+ }
+
+ return *this;
+ }
- if(mpSdrFormTextAttribute)
+ bool SdrTextAttribute::operator==(const SdrTextAttribute& rCandidate) const
+ {
+ if(rCandidate.mpSdrTextAttribute == mpSdrTextAttribute)
{
- delete mpSdrFormTextAttribute;
+ return true;
}
-
- mpSdrFormTextAttribute = 0;
- if(rCandidate.getSdrFormTextAttribute())
+ if(rCandidate.isDefault() != isDefault())
{
- mpSdrFormTextAttribute = new SdrFormTextAttribute(*rCandidate.getSdrFormTextAttribute());
+ return false;
}
- maTextLeftDistance = rCandidate.getTextLeftDistance();
- maTextUpperDistance = rCandidate.getTextUpperDistance();
- maTextRightDistance = rCandidate.getTextRightDistance();
- maTextLowerDistance = rCandidate.getTextLowerDistance();
- maPropertiesVersion = rCandidate.getPropertiesVersion();
-
- maSdrTextHorzAdjust = rCandidate.getSdrTextHorzAdjust();
- maSdrTextVertAdjust = rCandidate.getSdrTextVertAdjust();
-
- mbContour = rCandidate.isContour();
- mbFitToSize = rCandidate.isFitToSize();
- mbHideContour = rCandidate.isHideContour();
- mbBlink = rCandidate.isBlink();
- mbScroll = rCandidate.isScroll();
- mbInEditMode = rCandidate.isInEditMode();
- mbFixedCellHeight = rCandidate.isFixedCellHeight();
+ return (*rCandidate.mpSdrTextAttribute == *mpSdrTextAttribute);
+ }
- return *this;
+ const SdrText& SdrTextAttribute::getSdrText() const
+ {
+ return mpSdrTextAttribute->getSdrText();
}
- bool SdrTextAttribute::operator==(const SdrTextAttribute& rCandidate) const
- {
- return (
- // compares OPO and it's contents, but traditionally not the RedLining
- // which is not seen as model, but as temporary information
- getOutlinerParaObject() == rCandidate.getOutlinerParaObject()
-
- // #i102062# for primitive visualisation, the WrongList (SpellChecking)
- // is important, too, so use isWrongListEqual since there is no WrongList
- // comparison in the regular OutlinerParaObject compare (since it's
- // not-persistent data)
- && getOutlinerParaObject().isWrongListEqual(rCandidate.getOutlinerParaObject())
-
- && pointerOrContentEqual(getSdrFormTextAttribute(), rCandidate.getSdrFormTextAttribute())
- && getTextLeftDistance() == rCandidate.getTextLeftDistance()
- && getTextUpperDistance() == rCandidate.getTextUpperDistance()
- && getTextRightDistance() == rCandidate.getTextRightDistance()
- && getTextLowerDistance() == rCandidate.getTextLowerDistance()
- && getPropertiesVersion() == rCandidate.getPropertiesVersion()
+ const OutlinerParaObject& SdrTextAttribute::getOutlinerParaObject() const
+ {
+ return mpSdrTextAttribute->getOutlinerParaObject();
+ }
+
+ bool SdrTextAttribute::isContour() const
+ {
+ return mpSdrTextAttribute->isContour();
+ }
+
+ bool SdrTextAttribute::isFitToSize() const
+ {
+ return mpSdrTextAttribute->isFitToSize();
+ }
+
+ bool SdrTextAttribute::isHideContour() const
+ {
+ return mpSdrTextAttribute->isHideContour();
+ }
- && getSdrTextHorzAdjust() == rCandidate.getSdrTextHorzAdjust()
- && getSdrTextVertAdjust() == rCandidate.getSdrTextVertAdjust()
+ bool SdrTextAttribute::isBlink() const
+ {
+ return mpSdrTextAttribute->isBlink();
+ }
+
+ bool SdrTextAttribute::isScroll() const
+ {
+ return mpSdrTextAttribute->isScroll();
+ }
+
+ bool SdrTextAttribute::isInEditMode() const
+ {
+ return mpSdrTextAttribute->isInEditMode();
+ }
+
+ bool SdrTextAttribute::isFixedCellHeight() const
+ {
+ return mpSdrTextAttribute->isFixedCellHeight();
+ }
+
+ bool SdrTextAttribute::isWrongSpell() const
+ {
+ return mpSdrTextAttribute->isWrongSpell();
+ }
+
+ const SdrFormTextAttribute& SdrTextAttribute::getSdrFormTextAttribute() const
+ {
+ return mpSdrTextAttribute->getSdrFormTextAttribute();
+ }
+
+ sal_Int32 SdrTextAttribute::getTextLeftDistance() const
+ {
+ return mpSdrTextAttribute->getTextLeftDistance();
+ }
+
+ sal_Int32 SdrTextAttribute::getTextUpperDistance() const
+ {
+ return mpSdrTextAttribute->getTextUpperDistance();
+ }
+
+ sal_Int32 SdrTextAttribute::getTextRightDistance() const
+ {
+ return mpSdrTextAttribute->getTextRightDistance();
+ }
+
+ sal_Int32 SdrTextAttribute::getTextLowerDistance() const
+ {
+ return mpSdrTextAttribute->getTextLowerDistance();
+ }
+
+ sal_uInt32 SdrTextAttribute::getPropertiesVersion() const
+ {
+ return mpSdrTextAttribute->getPropertiesVersion();
+ }
+
+ SdrTextHorzAdjust SdrTextAttribute::getSdrTextHorzAdjust() const
+ {
+ return mpSdrTextAttribute->getSdrTextHorzAdjust();
+ }
- && isContour() == rCandidate.isContour()
- && isFitToSize() == rCandidate.isFitToSize()
- && isHideContour() == rCandidate.isHideContour()
- && isBlink() == rCandidate.isBlink()
- && isScroll() == rCandidate.isScroll()
- && isInEditMode() == rCandidate.isInEditMode()
- && isFixedCellHeight() == rCandidate.isFixedCellHeight());
+ SdrTextVertAdjust SdrTextAttribute::getSdrTextVertAdjust() const
+ {
+ return mpSdrTextAttribute->getSdrTextVertAdjust();
}
void SdrTextAttribute::getBlinkTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList) const
{
if(isBlink())
{
- mpSdrText->GetObject().impGetBlinkTextTiming(rAnimList);
+ getSdrText().GetObject().impGetBlinkTextTiming(rAnimList);
}
}
@@ -208,7 +451,7 @@ namespace drawinglayer
{
if(isScroll())
{
- mpSdrText->GetObject().impGetScrollTextTiming(rAnimList, fFrameLength, fTextLength);
+ getSdrText().GetObject().impGetScrollTextTiming(rAnimList, fFrameLength, fTextLength);
}
}
} // end of namespace attribute
diff --git a/svx/source/sdr/contact/viewcontact.cxx b/svx/source/sdr/contact/viewcontact.cxx
index 35e7412401..afc2513e8d 100644
--- a/svx/source/sdr/contact/viewcontact.cxx
+++ b/svx/source/sdr/contact/viewcontact.cxx
@@ -277,7 +277,8 @@ namespace sdr
DBG_ERROR("ViewContact::createViewIndependentPrimitive2DSequence(): Never call the fallback base implementation, this is always an error (!)");
const basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(1000.0, 1000.0, 5000.0, 3000.0)));
const basegfx::BColor aYellow(1.0, 1.0, 0.0);
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aOutline, aYellow));
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aOutline, aYellow));
return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
diff --git a/svx/source/sdr/contact/viewcontactofe3d.cxx b/svx/source/sdr/contact/viewcontactofe3d.cxx
index 03643420e4..ff9cd5059f 100644
--- a/svx/source/sdr/contact/viewcontactofe3d.cxx
+++ b/svx/source/sdr/contact/viewcontactofe3d.cxx
@@ -33,10 +33,12 @@
#include <svx/obj3d.hxx>
#include <drawinglayer/primitive2d/embedded3dprimitive2d.hxx>
#include <svx/sdr/contact/viewcontactofe3dscene.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
-#include <drawinglayer/attribute/sdrattribute3d.hxx>
#include <svx/scene3d.hxx>
#include <drawinglayer/primitive3d/transformprimitive3d.hxx>
+#include <drawinglayer/attribute/sdrsceneattribute3d.hxx>
+#include <drawinglayer/attribute/sdrlightingattribute3d.hxx>
+#include <drawinglayer/attribute/sdrlightattribute3d.hxx>
+#include <drawinglayer/attribute/sdrlineattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -124,13 +126,14 @@ namespace sdr
// create embedded 2d primitive and add. LightNormal and ShadowSlant are needed for evtl.
// 3D shadow extraction for correct B2DRange calculation (shadow is part of the object)
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::Embedded3DPrimitive2D(
- rxContent3D,
- pVCOfE3DScene->getObjectTransformation(),
- aViewInformation3D,
- aLightNormal,
- fShadowSlant,
- rAllContentRange));
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::Embedded3DPrimitive2D(
+ rxContent3D,
+ pVCOfE3DScene->getObjectTransformation(),
+ aViewInformation3D,
+ aLightNormal,
+ fShadowSlant,
+ rAllContentRange));
xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
@@ -175,9 +178,12 @@ namespace sdr
if(!rObjectTransform.isIdentity())
{
- const drawinglayer::primitive3d::Primitive3DReference xReference(new drawinglayer::primitive3d::TransformPrimitive3D(
- rObjectTransform, xRetval));
- return drawinglayer::primitive3d::Primitive3DSequence(&xReference, 1);
+ const drawinglayer::primitive3d::Primitive3DReference xReference(
+ new drawinglayer::primitive3d::TransformPrimitive3D(
+ rObjectTransform,
+ xRetval));
+
+ xRetval = drawinglayer::primitive3d::Primitive3DSequence(&xReference, 1);
}
}
diff --git a/svx/source/sdr/contact/viewcontactofe3dcube.cxx b/svx/source/sdr/contact/viewcontactofe3dcube.cxx
index c4e08c50b9..b7497995c4 100644
--- a/svx/source/sdr/contact/viewcontactofe3dcube.cxx
+++ b/svx/source/sdr/contact/viewcontactofe3dcube.cxx
@@ -54,16 +54,8 @@ namespace sdr
{
drawinglayer::primitive3d::Primitive3DSequence xRetval;
const SfxItemSet& rItemSet = GetE3dCubeObj().GetMergedItemSet();
- drawinglayer::attribute::SdrLineFillShadowAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, false);
-
- // for 3D Objects, always create a primitive even when not visible. This is necessary ATM
- // since e.g. chart geometries rely on the occupied space of non-visible objects
- if(!pAttribute)
- {
- pAttribute = new drawinglayer::attribute::SdrLineFillShadowAttribute(
- impCreateFallbackLineAttribute(basegfx::BColor(0.0, 1.0, 0.0)),
- 0, 0, 0, 0);
- }
+ const drawinglayer::attribute::SdrLineFillShadowAttribute3D aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, false));
// get cube geometry and use as traslation and scaling for unit cube
basegfx::B3DRange aCubeRange;
@@ -96,13 +88,14 @@ namespace sdr
const basegfx::B2DVector aTextureSize(aCubeSize.getX(), aCubeSize.getY());
// create primitive and add
- const drawinglayer::primitive3d::Primitive3DReference xReference(new drawinglayer::primitive3d::SdrCubePrimitive3D(aWorldTransform, aTextureSize, *pAttribute, *pSdr3DObjectAttribute));
+ const drawinglayer::primitive3d::Primitive3DReference xReference(
+ new drawinglayer::primitive3d::SdrCubePrimitive3D(
+ aWorldTransform, aTextureSize, aAttribute, *pSdr3DObjectAttribute));
xRetval = drawinglayer::primitive3d::Primitive3DSequence(&xReference, 1);
// delete 3D Object Attributes
delete pSdr3DObjectAttribute;
- delete pAttribute;
-
+
return xRetval;
}
} // end of namespace contact
diff --git a/svx/source/sdr/contact/viewcontactofe3dextrude.cxx b/svx/source/sdr/contact/viewcontactofe3dextrude.cxx
index 85f05dea45..f0dd9197ff 100644
--- a/svx/source/sdr/contact/viewcontactofe3dextrude.cxx
+++ b/svx/source/sdr/contact/viewcontactofe3dextrude.cxx
@@ -54,16 +54,8 @@ namespace sdr
{
drawinglayer::primitive3d::Primitive3DSequence xRetval;
const SfxItemSet& rItemSet = GetE3dExtrudeObj().GetMergedItemSet();
- drawinglayer::attribute::SdrLineFillShadowAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, false);
-
- // for 3D Objects, always create a primitive even when not visible. This is necessary ATM
- // since e.g. chart geometries rely on the occupied space of non-visible objects
- if(!pAttribute)
- {
- pAttribute = new drawinglayer::attribute::SdrLineFillShadowAttribute(
- impCreateFallbackLineAttribute(basegfx::BColor(0.0, 1.0, 0.0)),
- 0, 0, 0, 0);
- }
+ const drawinglayer::attribute::SdrLineFillShadowAttribute3D aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, false));
// get extrude geometry
const basegfx::B2DPolyPolygon aPolyPolygon(GetE3dExtrudeObj().GetExtrudePolygon());
@@ -89,15 +81,15 @@ namespace sdr
// create primitive and add
const basegfx::B3DHomMatrix aWorldTransform;
- const drawinglayer::primitive3d::Primitive3DReference xReference(new drawinglayer::primitive3d::SdrExtrudePrimitive3D(
- aWorldTransform, aTextureSize, *pAttribute, *pSdr3DObjectAttribute,
- aPolyPolygon, fDepth, fDiagonal, fBackScale, bSmoothNormals, true, bSmoothLids,
- bCharacterMode, bCloseFront, bCloseBack));
+ const drawinglayer::primitive3d::Primitive3DReference xReference(
+ new drawinglayer::primitive3d::SdrExtrudePrimitive3D(
+ aWorldTransform, aTextureSize, aAttribute, *pSdr3DObjectAttribute,
+ aPolyPolygon, fDepth, fDiagonal, fBackScale, bSmoothNormals, true, bSmoothLids,
+ bCharacterMode, bCloseFront, bCloseBack));
xRetval = drawinglayer::primitive3d::Primitive3DSequence(&xReference, 1);
// delete 3D Object Attributes
delete pSdr3DObjectAttribute;
- delete pAttribute;
return xRetval;
}
diff --git a/svx/source/sdr/contact/viewcontactofe3dlathe.cxx b/svx/source/sdr/contact/viewcontactofe3dlathe.cxx
index dbe9460bbf..495a1f6df9 100644
--- a/svx/source/sdr/contact/viewcontactofe3dlathe.cxx
+++ b/svx/source/sdr/contact/viewcontactofe3dlathe.cxx
@@ -54,16 +54,8 @@ namespace sdr
{
drawinglayer::primitive3d::Primitive3DSequence xRetval;
const SfxItemSet& rItemSet = GetE3dLatheObj().GetMergedItemSet();
- drawinglayer::attribute::SdrLineFillShadowAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, false);
-
- // for 3D Objects, always create a primitive even when not visible. This is necessary ATM
- // since e.g. chart geometries rely on the occupied space of non-visible objects
- if(!pAttribute)
- {
- pAttribute = new drawinglayer::attribute::SdrLineFillShadowAttribute(
- impCreateFallbackLineAttribute(basegfx::BColor(0.0, 1.0, 0.0)),
- 0, 0, 0, 0);
- }
+ const drawinglayer::attribute::SdrLineFillShadowAttribute3D aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, false));
// get extrude geometry
const basegfx::B2DPolyPolygon aPolyPolygon(GetE3dLatheObj().GetPolyPoly2D());
@@ -103,16 +95,16 @@ namespace sdr
// create primitive and add
const basegfx::B3DHomMatrix aWorldTransform;
- const drawinglayer::primitive3d::Primitive3DReference xReference(new drawinglayer::primitive3d::SdrLathePrimitive3D(
- aWorldTransform, aTextureSize, *pAttribute, *pSdr3DObjectAttribute,
- aPolyPolygon, nHorizontalSegments, nVerticalSegments,
- fDiagonal, fBackScale, fRotation,
- bSmoothNormals, true, bSmoothLids, bCharacterMode, bCloseFront, bCloseBack));
+ const drawinglayer::primitive3d::Primitive3DReference xReference(
+ new drawinglayer::primitive3d::SdrLathePrimitive3D(
+ aWorldTransform, aTextureSize, aAttribute, *pSdr3DObjectAttribute,
+ aPolyPolygon, nHorizontalSegments, nVerticalSegments,
+ fDiagonal, fBackScale, fRotation,
+ bSmoothNormals, true, bSmoothLids, bCharacterMode, bCloseFront, bCloseBack));
xRetval = drawinglayer::primitive3d::Primitive3DSequence(&xReference, 1);
// delete 3D Object Attributes
delete pSdr3DObjectAttribute;
- delete pAttribute;
return xRetval;
}
diff --git a/svx/source/sdr/contact/viewcontactofe3dpolygon.cxx b/svx/source/sdr/contact/viewcontactofe3dpolygon.cxx
index 6d39d8eae9..b8e8c352e5 100644
--- a/svx/source/sdr/contact/viewcontactofe3dpolygon.cxx
+++ b/svx/source/sdr/contact/viewcontactofe3dpolygon.cxx
@@ -56,16 +56,8 @@ namespace sdr
drawinglayer::primitive3d::Primitive3DSequence xRetval;
const SfxItemSet& rItemSet = GetE3dPolygonObj().GetMergedItemSet();
const bool bSuppressFill(GetE3dPolygonObj().GetLineOnly());
- drawinglayer::attribute::SdrLineFillShadowAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, bSuppressFill);
-
- // for 3D Objects, always create a primitive even when not visible. This is necessary ATM
- // since e.g. chart geometries rely on the occupied space of non-visible objects
- if(!pAttribute)
- {
- pAttribute = new drawinglayer::attribute::SdrLineFillShadowAttribute(
- impCreateFallbackLineAttribute(basegfx::BColor(0.0, 1.0, 0.0)),
- 0, 0, 0, 0);
- }
+ const drawinglayer::attribute::SdrLineFillShadowAttribute3D aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, bSuppressFill));
// get extrude geometry
basegfx::B3DPolyPolygon aPolyPolygon3D(GetE3dPolygonObj().GetPolyPolygon3D());
@@ -177,13 +169,13 @@ namespace sdr
// create primitive and add
const basegfx::B3DHomMatrix aWorldTransform;
- const drawinglayer::primitive3d::Primitive3DReference xReference(new drawinglayer::primitive3d::SdrPolyPolygonPrimitive3D(
- aPolyPolygon3D, aWorldTransform, aTextureSize, *pAttribute, *pSdr3DObjectAttribute));
+ const drawinglayer::primitive3d::Primitive3DReference xReference(
+ new drawinglayer::primitive3d::SdrPolyPolygonPrimitive3D(
+ aPolyPolygon3D, aWorldTransform, aTextureSize, aAttribute, *pSdr3DObjectAttribute));
xRetval = drawinglayer::primitive3d::Primitive3DSequence(&xReference, 1);
// delete 3D Object Attributes
delete pSdr3DObjectAttribute;
- delete pAttribute;
return xRetval;
}
diff --git a/svx/source/sdr/contact/viewcontactofe3dscene.cxx b/svx/source/sdr/contact/viewcontactofe3dscene.cxx
index 7658ef7dde..36231a3ac7 100644
--- a/svx/source/sdr/contact/viewcontactofe3dscene.cxx
+++ b/svx/source/sdr/contact/viewcontactofe3dscene.cxx
@@ -38,11 +38,11 @@
#include <svx/sdr/contact/viewobjectcontactofe3dscene.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/range/b3drange.hxx>
-#include <drawinglayer/attribute/sdrattribute3d.hxx>
#include <drawinglayer/primitive3d/baseprimitive3d.hxx>
#include <svx/sdr/contact/viewcontactofe3d.hxx>
#include <drawinglayer/primitive2d/sceneprimitive2d.hxx>
#include <drawinglayer/primitive3d/transformprimitive3d.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -164,21 +164,13 @@ namespace sdr
ViewContactOfE3dScene::ViewContactOfE3dScene(E3dScene& rScene)
: ViewContactOfSdrObj(rScene),
- mpViewInformation3D(0),
- mpObjectTransformation(0),
- mpSdrSceneAttribute(0),
- mpSdrLightingAttribute(0)
+ maViewInformation3D(),
+ maObjectTransformation(),
+ maSdrSceneAttribute(),
+ maSdrLightingAttribute()
{
}
- ViewContactOfE3dScene::~ViewContactOfE3dScene()
- {
- delete mpViewInformation3D;
- delete mpObjectTransformation;
- delete mpSdrSceneAttribute;
- delete mpSdrLightingAttribute;
- }
-
void ViewContactOfE3dScene::createViewInformation3D(const basegfx::B3DRange& rContentRange)
{
basegfx::B3DHomMatrix aTransformation;
@@ -262,34 +254,36 @@ namespace sdr
}
const uno::Sequence< beans::PropertyValue > aEmptyProperties;
- mpViewInformation3D = new drawinglayer::geometry::ViewInformation3D(aTransformation, aOrientation, aProjection, aDeviceToView, 0.0, aEmptyProperties);
+ maViewInformation3D = drawinglayer::geometry::ViewInformation3D(
+ aTransformation, aOrientation, aProjection,
+ aDeviceToView, 0.0, aEmptyProperties);
}
void ViewContactOfE3dScene::createObjectTransformation()
{
// create 2d Object Transformation from relative point in 2d scene to world
- mpObjectTransformation = new basegfx::B2DHomMatrix;
const Rectangle& rRectangle = GetE3dScene().GetSnapRect();
- mpObjectTransformation->set(0, 0, rRectangle.getWidth());
- mpObjectTransformation->set(1, 1, rRectangle.getHeight());
- mpObjectTransformation->set(0, 2, rRectangle.Left());
- mpObjectTransformation->set(1, 2, rRectangle.Top());
+ maObjectTransformation.set(0, 0, rRectangle.getWidth());
+ maObjectTransformation.set(1, 1, rRectangle.getHeight());
+ maObjectTransformation.set(0, 2, rRectangle.Left());
+ maObjectTransformation.set(1, 2, rRectangle.Top());
}
void ViewContactOfE3dScene::createSdrSceneAttribute()
{
const SfxItemSet& rItemSet = GetE3dScene().GetMergedItemSet();
- mpSdrSceneAttribute = drawinglayer::primitive2d::createNewSdrSceneAttribute(rItemSet);
+ maSdrSceneAttribute = drawinglayer::primitive2d::createNewSdrSceneAttribute(rItemSet);
}
void ViewContactOfE3dScene::createSdrLightingAttribute()
{
const SfxItemSet& rItemSet = GetE3dScene().GetMergedItemSet();
- mpSdrLightingAttribute = drawinglayer::primitive2d::createNewSdrLightingAttribute(rItemSet);
+ maSdrLightingAttribute = drawinglayer::primitive2d::createNewSdrLightingAttribute(rItemSet);
}
- drawinglayer::primitive2d::Primitive2DSequence ViewContactOfE3dScene::createScenePrimitive2DSequence(const SetOfByte* pLayerVisibility) const
+ drawinglayer::primitive2d::Primitive2DSequence ViewContactOfE3dScene::createScenePrimitive2DSequence(
+ const SetOfByte* pLayerVisibility) const
{
drawinglayer::primitive2d::Primitive2DSequence xRetval;
const sal_uInt32 nChildrenCount(GetObjectCount());
@@ -329,19 +323,27 @@ namespace sdr
// on identity and the time on 0.0.
const uno::Sequence< beans::PropertyValue > aEmptyProperties;
const drawinglayer::geometry::ViewInformation3D aNeutralViewInformation3D(aEmptyProperties);
- const basegfx::B3DRange aContentRange(drawinglayer::primitive3d::getB3DRangeFromPrimitive3DSequence(aAllSequence, aNeutralViewInformation3D));
+ const basegfx::B3DRange aContentRange(
+ drawinglayer::primitive3d::getB3DRangeFromPrimitive3DSequence(aAllSequence, aNeutralViewInformation3D));
// create 2d primitive 3dscene with generated sub-list from collector
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::ScenePrimitive2D(
- bTestVisibility ? aVisibleSequence : aAllSequence,
- getSdrSceneAttribute(),
- getSdrLightingAttribute(),
- getObjectTransformation(),
- getViewInformation3D(aContentRange)));
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::ScenePrimitive2D(
+ bTestVisibility ? aVisibleSequence : aAllSequence,
+ getSdrSceneAttribute(),
+ getSdrLightingAttribute(),
+ getObjectTransformation(),
+ getViewInformation3D(aContentRange)));
+
xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
}
+ // always append an invisible outline for the cases where no visible content exists
+ drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval,
+ drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
+ false, getObjectTransformation()));
+
return xRetval;
}
@@ -355,27 +357,7 @@ namespace sdr
xRetval = createScenePrimitive2DSequence(0);
}
- if(xRetval.hasElements())
- {
- return xRetval;
- }
- else
- {
- // create a gray placeholder hairline polygon in object size as empty 3D scene marker. Use object size
- // model information directly, NOT getBoundRect()/getSnapRect() since these will
- // be using the geometry data we get just asked for. AFAIK for empty 3D Scenes, the model data
- // is SdrObject::aOutRect which i can access directly using GetLastBoundRect() here
- const Rectangle aEmptySceneGeometry(GetE3dScene().GetLastBoundRect());
- const basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(
- aEmptySceneGeometry.Left(), aEmptySceneGeometry.Top(),
- aEmptySceneGeometry.Right(), aEmptySceneGeometry.Bottom())));
- const double fGrayTone(0xc0 / 255.0);
- const basegfx::BColor aGrayTone(fGrayTone, fGrayTone, fGrayTone);
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aOutline, aGrayTone));
-
- // The replacement object may also get a text like 'empty 3D Scene' here later
- return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
+ return xRetval;
}
void ViewContactOfE3dScene::ActionChanged()
@@ -384,22 +366,15 @@ namespace sdr
ViewContactOfSdrObj::ActionChanged();
// mark locally cached values as invalid
- delete mpViewInformation3D;
- mpViewInformation3D = 0;
-
- delete mpObjectTransformation;
- mpObjectTransformation = 0;
-
- delete mpSdrSceneAttribute;
- mpSdrSceneAttribute = 0;
-
- delete mpSdrLightingAttribute;
- mpSdrLightingAttribute = 0;
+ maViewInformation3D = drawinglayer::geometry::ViewInformation3D();
+ maObjectTransformation.identity();
+ maSdrSceneAttribute = drawinglayer::attribute::SdrSceneAttribute();
+ maSdrLightingAttribute = drawinglayer::attribute::SdrLightingAttribute();
}
const drawinglayer::geometry::ViewInformation3D& ViewContactOfE3dScene::getViewInformation3D() const
{
- if(!mpViewInformation3D)
+ if(maViewInformation3D.isDefault())
{
// this version will create the content range on demand locally and thus is less
// performant than the other one. Since the information is buffered the planned
@@ -418,47 +393,47 @@ namespace sdr
const_cast < ViewContactOfE3dScene* >(this)->createViewInformation3D(aContentRange);
}
- return *mpViewInformation3D;
+ return maViewInformation3D;
}
const drawinglayer::geometry::ViewInformation3D& ViewContactOfE3dScene::getViewInformation3D(const basegfx::B3DRange& rContentRange) const
{
- if(!mpViewInformation3D)
+ if(maViewInformation3D.isDefault())
{
const_cast < ViewContactOfE3dScene* >(this)->createViewInformation3D(rContentRange);
}
- return *mpViewInformation3D;
+ return maViewInformation3D;
}
const basegfx::B2DHomMatrix& ViewContactOfE3dScene::getObjectTransformation() const
{
- if(!mpObjectTransformation)
+ if(maObjectTransformation.isIdentity())
{
const_cast < ViewContactOfE3dScene* >(this)->createObjectTransformation();
}
- return *mpObjectTransformation;
+ return maObjectTransformation;
}
const drawinglayer::attribute::SdrSceneAttribute& ViewContactOfE3dScene::getSdrSceneAttribute() const
{
- if(!mpSdrSceneAttribute)
+ if(maSdrSceneAttribute.isDefault())
{
const_cast < ViewContactOfE3dScene* >(this)->createSdrSceneAttribute();
}
- return *mpSdrSceneAttribute;
+ return maSdrSceneAttribute;
}
const drawinglayer::attribute::SdrLightingAttribute& ViewContactOfE3dScene::getSdrLightingAttribute() const
{
- if(!mpSdrLightingAttribute)
+ if(maSdrLightingAttribute.isDefault())
{
const_cast < ViewContactOfE3dScene* >(this)->createSdrLightingAttribute();
}
- return *mpSdrLightingAttribute;
+ return maSdrLightingAttribute;
}
drawinglayer::primitive3d::Primitive3DSequence ViewContactOfE3dScene::getAllPrimitive3DSequence() const
diff --git a/svx/source/sdr/contact/viewcontactofe3dsphere.cxx b/svx/source/sdr/contact/viewcontactofe3dsphere.cxx
index 4e30ae592c..9a3d673ca3 100644
--- a/svx/source/sdr/contact/viewcontactofe3dsphere.cxx
+++ b/svx/source/sdr/contact/viewcontactofe3dsphere.cxx
@@ -53,16 +53,8 @@ namespace sdr
{
drawinglayer::primitive3d::Primitive3DSequence xRetval;
const SfxItemSet& rItemSet = GetE3dSphereObj().GetMergedItemSet();
- drawinglayer::attribute::SdrLineFillShadowAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, false);
-
- // for 3D Objects, always create a primitive even when not visible. This is necessary ATM
- // since e.g. chart geometries rely on the occupied space of non-visible objects
- if(!pAttribute)
- {
- pAttribute = new drawinglayer::attribute::SdrLineFillShadowAttribute(
- impCreateFallbackLineAttribute(basegfx::BColor(0.0, 1.0, 0.0)),
- 0, 0, 0, 0);
- }
+ const drawinglayer::attribute::SdrLineFillShadowAttribute3D aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, false));
// get sphere center and size for geometry
basegfx::B3DRange aSphereRange;
@@ -88,14 +80,14 @@ namespace sdr
F_PI2 * aSphereSize.getY()); // half outline, (PI * d)/2 -> PI/2 * d
// create primitive and add
- const drawinglayer::primitive3d::Primitive3DReference xReference(new drawinglayer::primitive3d::SdrSpherePrimitive3D(
- aWorldTransform, aTextureSize, *pAttribute, *pSdr3DObjectAttribute,
- nHorizontalSegments, nVerticalSegments));
+ const drawinglayer::primitive3d::Primitive3DReference xReference(
+ new drawinglayer::primitive3d::SdrSpherePrimitive3D(
+ aWorldTransform, aTextureSize, aAttribute, *pSdr3DObjectAttribute,
+ nHorizontalSegments, nVerticalSegments));
xRetval = drawinglayer::primitive3d::Primitive3DSequence(&xReference, 1);
// delete 3D Object Attributes
delete pSdr3DObjectAttribute;
- delete pAttribute;
return xRetval;
}
diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx b/svx/source/sdr/contact/viewcontactofgraphic.cxx
index 62aa3c6840..019ec8d159 100644
--- a/svx/source/sdr/contact/viewcontactofgraphic.cxx
+++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx
@@ -30,7 +30,6 @@
#include <svx/sdr/contact/viewcontactofgraphic.hxx>
#include <svx/sdr/contact/viewobjectcontactofgraphic.hxx>
#include <svx/svdograf.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
#include <svl/itemset.hxx>
@@ -39,7 +38,6 @@
#endif
#include <svx/sdgcpitm.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
#include <svx/sdr/contact/displayinfo.hxx>
#include <svx/sdr/contact/viewobjectcontact.hxx>
#include <svx/sdr/contact/objectcontact.hxx>
@@ -59,6 +57,7 @@
#include <editeng/eeitem.hxx>
#include <editeng/colritem.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -148,10 +147,9 @@ namespace sdr
* aSmallerMatrix;
const GraphicObject& rGraphicObject = GetGrafObject().GetGraphicObject(false);
- const drawinglayer::attribute::SdrLineFillShadowTextAttribute aEmptyAttributes(0, 0, 0, 0, 0, 0);
const drawinglayer::primitive2d::Primitive2DReference xReferenceB(new drawinglayer::primitive2d::SdrGrafPrimitive2D(
aSmallerMatrix,
- aEmptyAttributes,
+ drawinglayer::attribute::SdrLineFillShadowTextAttribute(),
rGraphicObject,
rLocalGrafInfo));
@@ -177,14 +175,12 @@ namespace sdr
aEmptyGraphicAttr));
xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReferenceA, 1);
- if(!rAttribute.getLine())
+ if(rAttribute.getLine().isDefault())
{
// create a surrounding frame when no linestyle given
const Color aColor(Application::GetSettings().GetStyleSettings().GetShadowColor());
const basegfx::BColor aBColor(aColor.getBColor());
- const basegfx::B2DRange aUnitRange(0.0, 0.0, 1.0, 1.0);
-
- basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(aUnitRange));
+ basegfx::B2DPolygon aOutline(basegfx::tools::createUnitPolygon());
aOutline.transform(rObjectMatrix);
drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval,
@@ -314,127 +310,123 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfGraphic::createViewIndependentPrimitive2DSequence() const
{
drawinglayer::primitive2d::Primitive2DSequence xRetval;
- SdrText* pSdrText = GetGrafObject().getText(0);
-
- if(pSdrText)
+ const SfxItemSet& rItemSet = GetGrafObject().GetMergedItemSet();
+ drawinglayer::attribute::SdrLineFillShadowTextAttribute aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(
+ rItemSet,
+ GetGrafObject().getText(0)));
+
+ // create and fill GraphicAttr
+ GraphicAttr aLocalGrafInfo;
+ const sal_uInt16 nTrans(((SdrGrafTransparenceItem&)rItemSet.Get(SDRATTR_GRAFTRANSPARENCE)).GetValue());
+ const SdrGrafCropItem& rCrop((const SdrGrafCropItem&)rItemSet.Get(SDRATTR_GRAFCROP));
+ aLocalGrafInfo.SetLuminance(((SdrGrafLuminanceItem&)rItemSet.Get(SDRATTR_GRAFLUMINANCE)).GetValue());
+ aLocalGrafInfo.SetContrast(((SdrGrafContrastItem&)rItemSet.Get(SDRATTR_GRAFCONTRAST)).GetValue());
+ aLocalGrafInfo.SetChannelR(((SdrGrafRedItem&)rItemSet.Get(SDRATTR_GRAFRED)).GetValue());
+ aLocalGrafInfo.SetChannelG(((SdrGrafGreenItem&)rItemSet.Get(SDRATTR_GRAFGREEN)).GetValue());
+ aLocalGrafInfo.SetChannelB(((SdrGrafBlueItem&)rItemSet.Get(SDRATTR_GRAFBLUE)).GetValue());
+ aLocalGrafInfo.SetGamma(((SdrGrafGamma100Item&)rItemSet.Get(SDRATTR_GRAFGAMMA)).GetValue() * 0.01);
+ aLocalGrafInfo.SetTransparency((BYTE)::basegfx::fround(Min(nTrans, (USHORT)100) * 2.55));
+ aLocalGrafInfo.SetInvert(((SdrGrafInvertItem&)rItemSet.Get(SDRATTR_GRAFINVERT)).GetValue());
+ aLocalGrafInfo.SetDrawMode(((SdrGrafModeItem&)rItemSet.Get(SDRATTR_GRAFMODE)).GetValue());
+ aLocalGrafInfo.SetCrop(rCrop.GetLeft(), rCrop.GetTop(), rCrop.GetRight(), rCrop.GetBottom());
+
+ if(aAttribute.isDefault() && 255L != aLocalGrafInfo.GetTransparency())
{
- const SfxItemSet& rItemSet = GetGrafObject().GetMergedItemSet();
- drawinglayer::attribute::SdrLineFillShadowTextAttribute* pAttribute =
- drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(rItemSet, *pSdrText);
- bool bVisible(pAttribute && pAttribute->isVisible());
-
- // create and fill GraphicAttr
- GraphicAttr aLocalGrafInfo;
- const sal_uInt16 nTrans(((SdrGrafTransparenceItem&)rItemSet.Get(SDRATTR_GRAFTRANSPARENCE)).GetValue());
- const SdrGrafCropItem& rCrop((const SdrGrafCropItem&)rItemSet.Get(SDRATTR_GRAFCROP));
- aLocalGrafInfo.SetLuminance(((SdrGrafLuminanceItem&)rItemSet.Get(SDRATTR_GRAFLUMINANCE)).GetValue());
- aLocalGrafInfo.SetContrast(((SdrGrafContrastItem&)rItemSet.Get(SDRATTR_GRAFCONTRAST)).GetValue());
- aLocalGrafInfo.SetChannelR(((SdrGrafRedItem&)rItemSet.Get(SDRATTR_GRAFRED)).GetValue());
- aLocalGrafInfo.SetChannelG(((SdrGrafGreenItem&)rItemSet.Get(SDRATTR_GRAFGREEN)).GetValue());
- aLocalGrafInfo.SetChannelB(((SdrGrafBlueItem&)rItemSet.Get(SDRATTR_GRAFBLUE)).GetValue());
- aLocalGrafInfo.SetGamma(((SdrGrafGamma100Item&)rItemSet.Get(SDRATTR_GRAFGAMMA)).GetValue() * 0.01);
- aLocalGrafInfo.SetTransparency((BYTE)::basegfx::fround(Min(nTrans, (USHORT)100) * 2.55));
- aLocalGrafInfo.SetInvert(((SdrGrafInvertItem&)rItemSet.Get(SDRATTR_GRAFINVERT)).GetValue());
- aLocalGrafInfo.SetDrawMode(((SdrGrafModeItem&)rItemSet.Get(SDRATTR_GRAFMODE)).GetValue());
- aLocalGrafInfo.SetCrop(rCrop.GetLeft(), rCrop.GetTop(), rCrop.GetRight(), rCrop.GetBottom());
-
- if(!bVisible && 255L != aLocalGrafInfo.GetTransparency())
+ // no fill, no line, no text (invisible), but the graphic content is visible.
+ // Create evtl. shadow for content which was not created by createNewSdrLineFillShadowTextAttribute yet
+ const drawinglayer::attribute::SdrShadowAttribute aShadow(
+ drawinglayer::primitive2d::createNewSdrShadowAttribute(rItemSet));
+
+ if(!aShadow.isDefault())
{
- // content is visible, so force some fill stuff
- delete pAttribute;
- bVisible = true;
+ // create new attribute set if indeed shadow is used
+ aAttribute = drawinglayer::attribute::SdrLineFillShadowTextAttribute(
+ aAttribute.getLine(),
+ aAttribute.getFill(),
+ aAttribute.getLineStartEnd(),
+ aShadow,
+ aAttribute.getFillFloatTransGradient(),
+ aAttribute.getText());
+ }
+ }
- // check shadow
- drawinglayer::attribute::SdrShadowAttribute* pShadow = drawinglayer::primitive2d::createNewSdrShadowAttribute(rItemSet);
+ // take unrotated snap rect for position and size. Directly use model data, not getBoundRect() or getSnapRect()
+ // which will use the primitive data we just create in the near future
+ const Rectangle& rRectangle = GetGrafObject().GetGeoRect();
+ const ::basegfx::B2DRange aObjectRange(
+ rRectangle.Left(), rRectangle.Top(),
+ rRectangle.Right(), rRectangle.Bottom());
+
+ // look for mirroring
+ const GeoStat& rGeoStat(GetGrafObject().GetGeoStat());
+ const sal_Int32 nDrehWink(rGeoStat.nDrehWink);
+ const bool bRota180(18000 == nDrehWink);
+ const bool bMirrored(GetGrafObject().IsMirrored());
+ const sal_uInt16 nMirrorCase(bRota180 ? (bMirrored ? 3 : 4) : (bMirrored ? 2 : 1));
+ bool bHMirr((2 == nMirrorCase ) || (4 == nMirrorCase));
+ bool bVMirr((3 == nMirrorCase ) || (4 == nMirrorCase));
+
+ // set mirror flags at LocalGrafInfo. Take into account that the geometry in
+ // aObjectRange is already changed and rotated when bRota180 is used. To rebuild
+ // that old behaviour (as long as part of the model data), correct the H/V flags
+ // accordingly. The created bitmapPrimitive WILL use the rotation, too.
+ if(bRota180)
+ {
+ // if bRota180 which is used for vertical mirroring, the graphic will already be rotated
+ // by 180 degrees. To correct, switch off VMirror and invert HMirroring.
+ bHMirr = !bHMirr;
+ bVMirr = false;
+ }
- if(pShadow && !pShadow->isVisible())
- {
- delete pShadow;
- pShadow = 0L;
- }
+ if(bHMirr || bVMirr)
+ {
+ aLocalGrafInfo.SetMirrorFlags((bHMirr ? BMP_MIRROR_HORZ : 0)|(bVMirr ? BMP_MIRROR_VERT : 0));
+ }
- // create new attribute set
- pAttribute = new drawinglayer::attribute::SdrLineFillShadowTextAttribute(0L, 0L, 0L, pShadow, 0L, 0L);
- }
+ // fill object matrix
+ const double fShearX(rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0);
+ const double fRotate(nDrehWink ? (36000 - nDrehWink) * F_PI18000 : 0.0);
+ const basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ aObjectRange.getWidth(), aObjectRange.getHeight(),
+ fShearX, fRotate,
+ aObjectRange.getMinX(), aObjectRange.getMinY()));
- if(pAttribute)
- {
- if(pAttribute->isVisible() || bVisible)
- {
- // take unrotated snap rect for position and size. Directly use model data, not getBoundRect() or getSnapRect()
- // which will use the primitive data we just create in the near future
- const Rectangle& rRectangle = GetGrafObject().GetGeoRect();
- const ::basegfx::B2DRange aObjectRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom());
-
- // look for mirroring
- const GeoStat& rGeoStat(GetGrafObject().GetGeoStat());
- const sal_Int32 nDrehWink(rGeoStat.nDrehWink);
- const bool bRota180(18000 == nDrehWink);
- const bool bMirrored(GetGrafObject().IsMirrored());
- const sal_uInt16 nMirrorCase(bRota180 ? (bMirrored ? 3 : 4) : (bMirrored ? 2 : 1));
- bool bHMirr((2 == nMirrorCase ) || (4 == nMirrorCase));
- bool bVMirr((3 == nMirrorCase ) || (4 == nMirrorCase));
-
- // set mirror flags at LocalGrafInfo. Take into account that the geometry in
- // aObjectRange is already changed and rotated when bRota180 is used. To rebuild
- // that old behaviour (as long as part of the model data), correct the H/V flags
- // accordingly. The created bitmapPrimitive WILL use the rotation, too.
- if(bRota180)
- {
- // if bRota180 which is used for vertical mirroring, the graphic will already be rotated
- // by 180 degrees. To correct, switch off VMirror and invert HMirroring.
- bHMirr = !bHMirr;
- bVMirr = false;
- }
-
- if(bHMirr || bVMirr)
- {
- aLocalGrafInfo.SetMirrorFlags((bHMirr ? BMP_MIRROR_HORZ : 0)|(bVMirr ? BMP_MIRROR_VERT : 0));
- }
-
- // fill object matrix
- const double fShearX(rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0);
- const double fRotate(nDrehWink ? (36000 - nDrehWink) * F_PI18000 : 0.0);
- const basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- aObjectRange.getWidth(), aObjectRange.getHeight(),
- fShearX, fRotate,
- aObjectRange.getMinX(), aObjectRange.getMinY()));
-
- // get the current, unchenged graphic obect from SdrGrafObj
- const GraphicObject& rGraphicObject = GetGrafObject().GetGraphicObject(false);
-
- if(visualisationUsesPresObj())
- {
- // it's an EmptyPresObj, create the SdrGrafPrimitive2D without content and another scaled one
- // with the content which is the placeholder graphic
- xRetval = createVIP2DSForPresObj(aObjectMatrix, *pAttribute, aLocalGrafInfo);
- }
- else if(visualisationUsesDraft())
- {
- // #i102380# The graphic is swapped out. To not force a swap-in here, there is a mechanism
- // which shows a swapped-out-visualisation (which gets created here now) and an asynchronious
- // visual update mechanism for swapped-out grapgics when they were loaded (see AsynchGraphicLoadingEvent
- // and ViewObjectContactOfGraphic implementation). Not forcing the swap-in here allows faster
- // (non-blocking) processing here and thus in the effect e.g. fast scrolling through pages
- xRetval = createVIP2DSForDraft(aObjectMatrix, *pAttribute);
- }
- else
- {
- // create primitive. Info: Calling the copy-constructor of GraphicObject in this
- // SdrGrafPrimitive2D constructor will force a full swap-in of the graphic
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrGrafPrimitive2D(
- aObjectMatrix,
- *pAttribute,
- rGraphicObject,
- aLocalGrafInfo));
-
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
- }
-
- delete pAttribute;
- }
+ // get the current, unchenged graphic obect from SdrGrafObj
+ const GraphicObject& rGraphicObject = GetGrafObject().GetGraphicObject(false);
+
+ if(visualisationUsesPresObj())
+ {
+ // it's an EmptyPresObj, create the SdrGrafPrimitive2D without content and another scaled one
+ // with the content which is the placeholder graphic
+ xRetval = createVIP2DSForPresObj(aObjectMatrix, aAttribute, aLocalGrafInfo);
+ }
+ else if(visualisationUsesDraft())
+ {
+ // #i102380# The graphic is swapped out. To not force a swap-in here, there is a mechanism
+ // which shows a swapped-out-visualisation (which gets created here now) and an asynchronious
+ // visual update mechanism for swapped-out grapgics when they were loaded (see AsynchGraphicLoadingEvent
+ // and ViewObjectContactOfGraphic implementation). Not forcing the swap-in here allows faster
+ // (non-blocking) processing here and thus in the effect e.g. fast scrolling through pages
+ xRetval = createVIP2DSForDraft(aObjectMatrix, aAttribute);
}
+ else
+ {
+ // create primitive. Info: Calling the copy-constructor of GraphicObject in this
+ // SdrGrafPrimitive2D constructor will force a full swap-in of the graphic
+ const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrGrafPrimitive2D(
+ aObjectMatrix,
+ aAttribute,
+ rGraphicObject,
+ aLocalGrafInfo));
+
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+ }
+
+ // always append an invisible outline for the cases where no visible content exists
+ drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval,
+ drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
+ false, aObjectMatrix));
return xRetval;
}
diff --git a/svx/source/sdr/contact/viewcontactofgroup.cxx b/svx/source/sdr/contact/viewcontactofgroup.cxx
index 72683559e1..3595c1a8f6 100644
--- a/svx/source/sdr/contact/viewcontactofgroup.cxx
+++ b/svx/source/sdr/contact/viewcontactofgroup.cxx
@@ -36,6 +36,7 @@
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/color/bcolor.hxx>
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -78,25 +79,22 @@ namespace sdr
drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(xRetval, aCandSeq);
}
}
-
- if(xRetval.hasElements())
- {
- return xRetval;
- }
else
{
- // create a gray placeholder hairline polygon in object size. Use the model data directly. For empty groups,
- // this is SdrObject::aOutRect, as can be seen in SdrObjGroup::GetSnapRect(). Access that using GetLastBoundRect()
- // to not execute anything.
+ // append an invisible outline for the cases where no visible content exists
const Rectangle aCurrentBoundRect(GetSdrObjGroup().GetLastBoundRect());
- const basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(
- aCurrentBoundRect.Left(), aCurrentBoundRect.Top(), aCurrentBoundRect.Right(), aCurrentBoundRect.Bottom())));
- const basegfx::BColor aGrayTone(0xc0 / 255.0, 0xc0 / 255.0, 0xc0 / 255.0);
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aOutline, aGrayTone));
+ const basegfx::B2DRange aCurrentRange(
+ aCurrentBoundRect.Left(), aCurrentBoundRect.Top(),
+ aCurrentBoundRect.Right(), aCurrentBoundRect.Bottom());
+
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
+ false, aCurrentRange));
- // The replacement object may also get a text like 'empty group' here later
- return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
+
+ return xRetval;
}
} // end of namespace contact
} // end of namespace sdr
diff --git a/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx b/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx
index 3b8dc097a2..d397917edf 100644
--- a/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx
+++ b/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx
@@ -38,12 +38,14 @@
#include <svx/svdview.hxx>
#include <svx/sdr/contact/viewcontactofsdrpage.hxx>
#include <svx/sdr/contact/viewobjectcontactofmasterpagedescriptor.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
#include <svx/svdpage.hxx>
+#include <drawinglayer/attribute/sdrfillattribute.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <drawinglayer/attribute/fillgradientattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -59,33 +61,30 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfMasterPageDescriptor::createViewIndependentPrimitive2DSequence() const
{
drawinglayer::primitive2d::Primitive2DSequence xRetval;
- const SdrObject* pBackgroundCandidate = GetMasterPageDescriptor().GetBackgroundObject();
- if(pBackgroundCandidate)
- {
- // build primitive from pBackgroundCandidate's attributes
- const SfxItemSet& rFillProperties = pBackgroundCandidate->GetMergedItemSet();
- drawinglayer::attribute::SdrFillAttribute* pFill = drawinglayer::primitive2d::createNewSdrFillAttribute(rFillProperties);
-
- if(pFill)
- {
- if(pFill->isVisible())
- {
- // direct model data is the page size, get and use it
- const SdrPage& rOwnerPage = GetMasterPageDescriptor().GetOwnerPage();
- const basegfx::B2DRange aInnerRange(
- rOwnerPage.GetLftBorder(), rOwnerPage.GetUppBorder(),
- rOwnerPage.GetWdt() - rOwnerPage.GetRgtBorder(), rOwnerPage.GetHgt() - rOwnerPage.GetLwrBorder());
- const basegfx::B2DPolygon aInnerPolgon(basegfx::tools::createPolygonFromRect(aInnerRange));
- const basegfx::B2DHomMatrix aEmptyTransform;
- const drawinglayer::primitive2d::Primitive2DReference xReference(drawinglayer::primitive2d::createPolyPolygonFillPrimitive(
- basegfx::B2DPolyPolygon(aInnerPolgon), aEmptyTransform, *pFill));
-
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
+ // build primitive from page fill attributes
+ const SfxItemSet& rPageFillAttributes = GetMasterPageDescriptor().getCorrectFillAttributes();
+ const drawinglayer::attribute::SdrFillAttribute aFill(
+ drawinglayer::primitive2d::createNewSdrFillAttribute(rPageFillAttributes));
- delete pFill;
- }
+ if(!aFill.isDefault())
+ {
+ // direct model data is the page size, get and use it
+ const SdrPage& rOwnerPage = GetMasterPageDescriptor().GetOwnerPage();
+ const basegfx::B2DRange aInnerRange(
+ rOwnerPage.GetLftBorder(), rOwnerPage.GetUppBorder(),
+ rOwnerPage.GetWdt() - rOwnerPage.GetRgtBorder(),
+ rOwnerPage.GetHgt() - rOwnerPage.GetLwrBorder());
+ const basegfx::B2DPolygon aInnerPolgon(basegfx::tools::createPolygonFromRect(aInnerRange));
+ const basegfx::B2DHomMatrix aEmptyTransform;
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ drawinglayer::primitive2d::createPolyPolygonFillPrimitive(
+ basegfx::B2DPolyPolygon(aInnerPolgon),
+ aEmptyTransform,
+ aFill,
+ drawinglayer::attribute::FillGradientAttribute()));
+
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
return xRetval;
@@ -105,23 +104,11 @@ namespace sdr
sal_uInt32 ViewContactOfMasterPageDescriptor::GetObjectCount() const
{
- sal_uInt32 nRetval(GetMasterPageDescriptor().GetUsedPage().GetObjCount());
-
- if(nRetval && GetMasterPageDescriptor().GetUsedPage().GetObj(0)->IsMasterPageBackgroundObject())
- {
- nRetval--;
- }
-
- return nRetval;
+ return GetMasterPageDescriptor().GetUsedPage().GetObjCount();
}
ViewContact& ViewContactOfMasterPageDescriptor::GetViewContact(sal_uInt32 nIndex) const
{
- if(GetMasterPageDescriptor().GetUsedPage().GetObjCount() && GetMasterPageDescriptor().GetUsedPage().GetObj(0)->IsMasterPageBackgroundObject())
- {
- nIndex++;
- }
-
return GetMasterPageDescriptor().GetUsedPage().GetObj(nIndex)->GetViewContact();
}
diff --git a/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx b/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx
index 85dd101da9..f13d30c8db 100644
--- a/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx
@@ -31,7 +31,6 @@
#include <svx/sdr/contact/viewcontactofsdrcaptionobj.hxx>
#include <svx/svdocapt.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
@@ -66,107 +65,108 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence xRetval;
const SdrCaptionObj& rCaptionObj(GetCaptionObj());
const SfxItemSet& rItemSet = rCaptionObj.GetMergedItemSet();
- SdrText* pSdrText = rCaptionObj.getText(0);
-
- if(pSdrText)
+ const drawinglayer::attribute::SdrLineFillShadowTextAttribute aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(
+ rItemSet,
+ rCaptionObj.getText(0)));
+
+ // take unrotated snap rect (direct model data) for position and size
+ const Rectangle& rRectangle = rCaptionObj.GetGeoRect();
+ const ::basegfx::B2DRange aObjectRange(
+ rRectangle.Left(), rRectangle.Top(),
+ rRectangle.Right(), rRectangle.Bottom());
+ const GeoStat& rGeoStat(rCaptionObj.GetGeoStat());
+
+ // fill object matrix
+ basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ aObjectRange.getWidth(), aObjectRange.getHeight(),
+ rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0,
+ rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0,
+ aObjectRange.getMinX(), aObjectRange.getMinY()));
+
+ // calculate corner radius
+ double fCornerRadiusX;
+ double fCornerRadiusY;
+ drawinglayer::primitive2d::calculateRelativeCornerRadius(
+ rCaptionObj.GetEckenradius(), aObjectRange, fCornerRadiusX, fCornerRadiusY);
+
+ // create primitive. Always create one (even if invisible) to let the decomposition
+ // of SdrCaptionPrimitive2D create needed invisible elements for HitTest and BoundRect
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::SdrCaptionPrimitive2D(
+ aObjectMatrix,
+ aAttribute,
+ rCaptionObj.getTailPolygon(),
+ fCornerRadiusX,
+ fCornerRadiusY));
+
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+
+ if(!aAttribute.isDefault() && rCaptionObj.GetSpecialTextBoxShadow())
{
- drawinglayer::attribute::SdrLineFillShadowTextAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(rItemSet, *pSdrText);
-
- if(pAttribute)
+ // for SC, the caption object may have a specialized shadow. The usual object shadow is off
+ // and a specialized shadow gets created here (see old paint)
+ const SdrShadowColorItem& rShadColItem = (SdrShadowColorItem&)(rItemSet.Get(SDRATTR_SHADOWCOLOR));
+ const sal_uInt16 nTransp(((SdrShadowTransparenceItem&)(rItemSet.Get(SDRATTR_SHADOWTRANSPARENCE))).GetValue());
+ const Color aShadCol(rShadColItem.GetColorValue());
+ const XFillStyle eStyle = ((XFillStyleItem&)(rItemSet.Get(XATTR_FILLSTYLE))).GetValue();
+
+ // Create own ItemSet and modify as needed
+ // Always hide lines for special calc shadow
+ SfxItemSet aSet(rItemSet);
+ aSet.Put(XLineStyleItem(XLINE_NONE));
+
+ if(XFILL_HATCH == eStyle)
+ {
+ // #41666# Hatch color is set hard to shadow color
+ XHatch aHatch = ((XFillHatchItem&)(rItemSet.Get(XATTR_FILLHATCH))).GetHatchValue();
+ aHatch.SetColor(aShadCol);
+ aSet.Put(XFillHatchItem(String(),aHatch));
+ }
+ else
{
- if(pAttribute->isVisible())
+ if(XFILL_NONE != eStyle && XFILL_SOLID != eStyle)
{
- // take unrotated snap rect (direct model data) for position and size
- const Rectangle& rRectangle = rCaptionObj.GetGeoRect();
- const ::basegfx::B2DRange aObjectRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom());
- const GeoStat& rGeoStat(rCaptionObj.GetGeoStat());
-
- // fill object matrix
- basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- aObjectRange.getWidth(), aObjectRange.getHeight(),
- rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0,
- rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0,
- aObjectRange.getMinX(), aObjectRange.getMinY()));
-
- // calculate corner radius
- double fCornerRadiusX;
- double fCornerRadiusY;
- drawinglayer::primitive2d::calculateRelativeCornerRadius(rCaptionObj.GetEckenradius(), aObjectRange, fCornerRadiusX, fCornerRadiusY);
-
- // create primitive
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrCaptionPrimitive2D(
- aObjectMatrix, *pAttribute, rCaptionObj.getTailPolygon(), fCornerRadiusX, fCornerRadiusY));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
-
- if(rCaptionObj.GetSpecialTextBoxShadow())
- {
- // for SC, the caption object may have a specialized shadow. The usual object shadow is off
- // and a specialized shadow gets created here (see old paint)
- const SdrShadowColorItem& rShadColItem = (SdrShadowColorItem&)(rItemSet.Get(SDRATTR_SHADOWCOLOR));
- const sal_uInt16 nTransp(((SdrShadowTransparenceItem&)(rItemSet.Get(SDRATTR_SHADOWTRANSPARENCE))).GetValue());
- const Color aShadCol(rShadColItem.GetColorValue());
- const XFillStyle eStyle = ((XFillStyleItem&)(rItemSet.Get(XATTR_FILLSTYLE))).GetValue();
-
- // Create own ItemSet and modify as needed
- // Always hide lines for special calc shadow
- SfxItemSet aSet(rItemSet);
- aSet.Put(XLineStyleItem(XLINE_NONE));
-
- if(XFILL_HATCH == eStyle)
- {
- // #41666# Hatch color is set hard to shadow color
- XHatch aHatch = ((XFillHatchItem&)(rItemSet.Get(XATTR_FILLHATCH))).GetHatchValue();
- aHatch.SetColor(aShadCol);
- aSet.Put(XFillHatchItem(String(),aHatch));
- }
- else
- {
- if(XFILL_NONE != eStyle && XFILL_SOLID != eStyle)
- {
- // force fill to solid (for Gradient and Bitmap)
- aSet.Put(XFillStyleItem(XFILL_SOLID));
- }
-
- aSet.Put(XFillColorItem(String(),aShadCol));
- aSet.Put(XFillTransparenceItem(nTransp));
- }
-
- // crete FillAttribute from modified ItemSet
- drawinglayer::attribute::SdrFillAttribute* pFill = drawinglayer::primitive2d::createNewSdrFillAttribute(aSet);
- drawinglayer::primitive2d::Primitive2DReference xSpecialShadow;
-
- if(pFill)
- {
- if(pFill->isVisible())
- {
- // add shadow offset to object matrix
- const sal_uInt32 nXDist(((SdrShadowXDistItem&)(rItemSet.Get(SDRATTR_SHADOWXDIST))).GetValue());
- const sal_uInt32 nYDist(((SdrShadowYDistItem&)(rItemSet.Get(SDRATTR_SHADOWYDIST))).GetValue());
- aObjectMatrix.translate(nXDist, nYDist);
-
- // create unit outline polygon as geometry (see SdrCaptionPrimitive2D::create2DDecomposition)
- basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0), fCornerRadiusX, fCornerRadiusY));
-
- // create the specialized shadow primitive
- xSpecialShadow = drawinglayer::primitive2d::createPolyPolygonFillPrimitive(basegfx::B2DPolyPolygon(aUnitOutline), aObjectMatrix, *pFill);
- }
-
- delete pFill;
- }
-
- if(xSpecialShadow.is())
- {
- // if we really got a special shadow, create a two-element retval with the shadow
- // behind the standard object's geometry
- xRetval.realloc(2);
-
- xRetval[0] = xSpecialShadow;
- xRetval[1] = xReference;
- }
- }
+ // force fill to solid (for Gradient and Bitmap)
+ aSet.Put(XFillStyleItem(XFILL_SOLID));
}
- delete pAttribute;
+ aSet.Put(XFillColorItem(String(),aShadCol));
+ aSet.Put(XFillTransparenceItem(nTransp));
+ }
+
+ // crete FillAttribute from modified ItemSet
+ const drawinglayer::attribute::SdrFillAttribute aFill(
+ drawinglayer::primitive2d::createNewSdrFillAttribute(aSet));
+ drawinglayer::primitive2d::Primitive2DReference xSpecialShadow;
+
+ if(!aFill.isDefault() && 1.0 != aFill.getTransparence())
+ {
+ // add shadow offset to object matrix
+ const sal_uInt32 nXDist(((SdrShadowXDistItem&)(rItemSet.Get(SDRATTR_SHADOWXDIST))).GetValue());
+ const sal_uInt32 nYDist(((SdrShadowYDistItem&)(rItemSet.Get(SDRATTR_SHADOWYDIST))).GetValue());
+ aObjectMatrix.translate(nXDist, nYDist);
+
+ // create unit outline polygon as geometry (see SdrCaptionPrimitive2D::create2DDecomposition)
+ basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect(
+ basegfx::B2DRange(0.0, 0.0, 1.0, 1.0), fCornerRadiusX, fCornerRadiusY));
+
+ // create the specialized shadow primitive
+ xSpecialShadow = drawinglayer::primitive2d::createPolyPolygonFillPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ aObjectMatrix,
+ aFill,
+ drawinglayer::attribute::FillGradientAttribute());
+ }
+
+ if(xSpecialShadow.is())
+ {
+ // if we really got a special shadow, create a two-element retval with the shadow
+ // behind the standard object's geometry
+ xRetval.realloc(2);
+
+ xRetval[0] = xSpecialShadow;
+ xRetval[1] = xReference;
}
}
diff --git a/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx b/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx
index 12db5086bd..10a0d3f733 100644
--- a/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx
@@ -31,7 +31,6 @@
#include <svx/sdr/contact/viewcontactofsdrcircobj.hxx>
#include <svx/svdocirc.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <svx/sdr/primitive2d/sdrellipseprimitive2d.hxx>
#include <svl/itemset.hxx>
#include <svx/sxciaitm.hxx>
@@ -54,56 +53,62 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrCircObj::createViewIndependentPrimitive2DSequence() const
{
- drawinglayer::primitive2d::Primitive2DSequence xRetval;
const SfxItemSet& rItemSet = GetCircObj().GetMergedItemSet();
- SdrText* pSdrText = GetCircObj().getText(0);
+ const drawinglayer::attribute::SdrLineFillShadowTextAttribute aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(
+ rItemSet,
+ GetCircObj().getText(0)));
- if(pSdrText)
- {
- drawinglayer::attribute::SdrLineFillShadowTextAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(rItemSet, *pSdrText);
-
- if(pAttribute)
- {
- if(pAttribute->isVisible())
- {
- // take unrotated snap rect (direct model data) for position and size
- const Rectangle& rRectangle = GetCircObj().GetGeoRect();
- const ::basegfx::B2DRange aObjectRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom());
- const GeoStat& rGeoStat(GetCircObj().GetGeoStat());
-
- // fill object matrix
- const basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- aObjectRange.getWidth(), aObjectRange.getHeight(),
- rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0,
- rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0,
- aObjectRange.getMinX(), aObjectRange.getMinY()));
+ // take unrotated snap rect (direct model data) for position and size
+ const Rectangle& rRectangle = GetCircObj().GetGeoRect();
+ const basegfx::B2DRange aObjectRange(
+ rRectangle.Left(), rRectangle.Top(),
+ rRectangle.Right(), rRectangle.Bottom());
+ const GeoStat& rGeoStat(GetCircObj().GetGeoStat());
- // create primitive data
- const sal_uInt16 nIdentifier(GetCircObj().GetObjIdentifier());
+ // fill object matrix
+ const basegfx::B2DHomMatrix aObjectMatrix(
+ basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ aObjectRange.getWidth(), aObjectRange.getHeight(),
+ rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0,
+ rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0,
+ aObjectRange.getMinX(), aObjectRange.getMinY()));
- if(OBJ_CIRC == nIdentifier)
- {
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrEllipsePrimitive2D(aObjectMatrix, *pAttribute));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
- else
- {
- const sal_Int32 nNewStart(((SdrCircStartAngleItem&)rItemSet.Get(SDRATTR_CIRCSTARTANGLE)).GetValue());
- const sal_Int32 nNewEnd(((SdrCircEndAngleItem&)rItemSet.Get(SDRATTR_CIRCENDANGLE)).GetValue());
- const double fStart(((36000 - nNewEnd) % 36000) * F_PI18000);
- const double fEnd(((36000 - nNewStart) % 36000) * F_PI18000);
- const bool bCloseSegment(OBJ_CARC != nIdentifier);
- const bool bCloseUsingCenter(OBJ_SECT == nIdentifier);
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrEllipseSegmentPrimitive2D(aObjectMatrix, *pAttribute, fStart, fEnd, bCloseSegment, bCloseUsingCenter));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
- }
+ // create primitive data
+ const sal_uInt16 nIdentifier(GetCircObj().GetObjIdentifier());
- delete pAttribute;
- }
+ // always create primitives to allow the decomposition of SdrEllipsePrimitive2D
+ // or SdrEllipseSegmentPrimitive2D to create needed invisible elements for HitTest
+ // and/or BoundRect
+ if(OBJ_CIRC == nIdentifier)
+ {
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::SdrEllipsePrimitive2D(
+ aObjectMatrix,
+ aAttribute));
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
+ else
+ {
+ const sal_Int32 nNewStart(((SdrCircStartAngleItem&)rItemSet.Get(SDRATTR_CIRCSTARTANGLE)).GetValue());
+ const sal_Int32 nNewEnd(((SdrCircEndAngleItem&)rItemSet.Get(SDRATTR_CIRCENDANGLE)).GetValue());
+ const double fStart(((36000 - nNewEnd) % 36000) * F_PI18000);
+ const double fEnd(((36000 - nNewStart) % 36000) * F_PI18000);
+ const bool bCloseSegment(OBJ_CARC != nIdentifier);
+ const bool bCloseUsingCenter(OBJ_SECT == nIdentifier);
- return xRetval;
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::SdrEllipseSegmentPrimitive2D(
+ aObjectMatrix,
+ aAttribute,
+ fStart,
+ fEnd,
+ bCloseSegment,
+ bCloseUsingCenter));
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+ }
}
} // end of namespace contact
} // end of namespace sdr
diff --git a/svx/source/sdr/contact/viewcontactofsdredgeobj.cxx b/svx/source/sdr/contact/viewcontactofsdredgeobj.cxx
index 6f131479c3..6fdd107669 100644
--- a/svx/source/sdr/contact/viewcontactofsdredgeobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdredgeobj.cxx
@@ -31,7 +31,6 @@
#include <svx/sdr/contact/viewcontactofsdredgeobj.hxx>
#include <svx/svdoedge.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <svx/sdr/primitive2d/sdrconnectorprimitive2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -51,35 +50,27 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrEdgeObj::createViewIndependentPrimitive2DSequence() const
{
- drawinglayer::primitive2d::Primitive2DSequence xRetval;
- ::basegfx::B2DPolygon aEdgeTrack(GetEdgeObj().getEdgeTrack());
+ const basegfx::B2DPolygon& rEdgeTrack = GetEdgeObj().getEdgeTrack();
- // base visualisation on EdgeTrack
- if(aEdgeTrack.count())
- {
- // ckeck attributes
- const SfxItemSet& rItemSet = GetEdgeObj().GetMergedItemSet();
- SdrText* pSdrText = GetEdgeObj().getText(0);
+ // what to do when no EdgeTrack is provided (HitTest and selectability) ?
+ OSL_ENSURE(0 != rEdgeTrack.count(), "Connectors with no geometry are not allowed (!)");
- if(pSdrText)
- {
- drawinglayer::attribute::SdrLineShadowTextAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineShadowTextAttribute(rItemSet, *pSdrText);
+ // ckeck attributes
+ const SfxItemSet& rItemSet = GetEdgeObj().GetMergedItemSet();
+ const drawinglayer::attribute::SdrLineShadowTextAttribute aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineShadowTextAttribute(
+ rItemSet,
+ GetEdgeObj().getText(0)));
- if(pAttribute)
- {
- if(pAttribute->isVisible())
- {
- // create primitive
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrConnectorPrimitive2D(*pAttribute, aEdgeTrack));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
+ // create primitive. Always create primitives to allow the decomposition of
+ // SdrConnectorPrimitive2D to create needed invisible elements for HitTest
+ // and/or BoundRect
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::SdrConnectorPrimitive2D(
+ aAttribute,
+ rEdgeTrack));
- delete pAttribute;
- }
- }
- }
-
- return xRetval;
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
} // end of namespace contact
} // end of namespace sdr
diff --git a/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx b/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx
index aea0144d47..2ee955d980 100644
--- a/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx
@@ -31,7 +31,6 @@
#include <svx/sdr/contact/viewcontactofsdrmeasureobj.hxx>
#include <svx/svdomeas.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <svl/itemset.hxx>
#include <svx/sxmbritm.hxx>
#include <svx/sxmlhitm.hxx>
@@ -57,91 +56,85 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrMeasureObj::createViewIndependentPrimitive2DSequence() const
{
- drawinglayer::primitive2d::Primitive2DSequence xRetval;
const SfxItemSet& rItemSet = GetMeasureObj().GetMergedItemSet();
- SdrText* pSdrText = GetMeasureObj().getText(0);
+ const drawinglayer::attribute::SdrLineShadowTextAttribute aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineShadowTextAttribute(
+ rItemSet,
+ GetMeasureObj().getText(0)));
- if(pSdrText)
- {
- drawinglayer::attribute::SdrLineShadowTextAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineShadowTextAttribute(rItemSet, *pSdrText);
+ // take properties which are the model data.
+ const ::basegfx::B2DPoint aStart(GetMeasureObj().GetPoint(0).X(), GetMeasureObj().GetPoint(0).Y());
+ const ::basegfx::B2DPoint aEnd(GetMeasureObj().GetPoint(1).X(), GetMeasureObj().GetPoint(1).Y());
+ const double fDistance(((SdrMeasureLineDistItem&)rItemSet.Get(SDRATTR_MEASURELINEDIST)).GetValue());
+ const double fUpperDistance(((SdrMeasureHelplineOverhangItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINEOVERHANG)).GetValue());
+ const double fLowerDistance(((SdrMeasureHelplineDistItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINEDIST)).GetValue());
+ const double fLeftDelta(((SdrMeasureHelpline1LenItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINE1LEN)).GetValue());
+ const double fRightDelta(((SdrMeasureHelpline2LenItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINE2LEN)).GetValue());
+ const bool bBelow(((SdrMeasureBelowRefEdgeItem&)rItemSet.Get(SDRATTR_MEASUREBELOWREFEDGE)).GetValue());
+ const bool bTextRotation(((SdrMeasureTextRota90Item&)rItemSet.Get(SDRATTR_MEASURETEXTROTA90)).GetValue());
+ const bool bTextAutoAngle(((SdrMeasureTextAutoAngleItem&)rItemSet.Get(SDRATTR_MEASURETEXTAUTOANGLE)).GetValue());
+ drawinglayer::primitive2d::MeasureTextPosition aMTPHor(drawinglayer::primitive2d::MEASURETEXTPOSITION_AUTOMATIC);
+ drawinglayer::primitive2d::MeasureTextPosition aMTPVer(drawinglayer::primitive2d::MEASURETEXTPOSITION_AUTOMATIC);
- if(pAttribute)
+ switch(((SdrMeasureTextHPosItem&)rItemSet.Get(SDRATTR_MEASURETEXTHPOS)).GetValue())
+ {
+ case SDRMEASURE_TEXTLEFTOUTSIDE :
{
- if(pAttribute->isVisible())
- {
- // take properties which are the model data.
- const ::basegfx::B2DPoint aStart(GetMeasureObj().GetPoint(0).X(), GetMeasureObj().GetPoint(0).Y());
- const ::basegfx::B2DPoint aEnd(GetMeasureObj().GetPoint(1).X(), GetMeasureObj().GetPoint(1).Y());
- const double fDistance(((SdrMeasureLineDistItem&)rItemSet.Get(SDRATTR_MEASURELINEDIST)).GetValue());
- const double fUpperDistance(((SdrMeasureHelplineOverhangItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINEOVERHANG)).GetValue());
- const double fLowerDistance(((SdrMeasureHelplineDistItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINEDIST)).GetValue());
- const double fLeftDelta(((SdrMeasureHelpline1LenItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINE1LEN)).GetValue());
- const double fRightDelta(((SdrMeasureHelpline2LenItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINE2LEN)).GetValue());
- const bool bBelow(((SdrMeasureBelowRefEdgeItem&)rItemSet.Get(SDRATTR_MEASUREBELOWREFEDGE)).GetValue());
- const bool bTextRotation(((SdrMeasureTextRota90Item&)rItemSet.Get(SDRATTR_MEASURETEXTROTA90)).GetValue());
- const bool bTextAutoAngle(((SdrMeasureTextAutoAngleItem&)rItemSet.Get(SDRATTR_MEASURETEXTAUTOANGLE)).GetValue());
- drawinglayer::primitive2d::MeasureTextPosition aMTPHor(drawinglayer::primitive2d::MEASURETEXTPOSITION_AUTOMATIC);
- drawinglayer::primitive2d::MeasureTextPosition aMTPVer(drawinglayer::primitive2d::MEASURETEXTPOSITION_AUTOMATIC);
-
- switch(((SdrMeasureTextHPosItem&)rItemSet.Get(SDRATTR_MEASURETEXTHPOS)).GetValue())
- {
- case SDRMEASURE_TEXTLEFTOUTSIDE :
- {
- aMTPHor = drawinglayer::primitive2d::MEASURETEXTPOSITION_NEGATIVE;
- break;
- }
- case SDRMEASURE_TEXTINSIDE :
- {
- aMTPHor = drawinglayer::primitive2d::MEASURETEXTPOSITION_CENTERED;
- break;
- }
- case SDRMEASURE_TEXTRIGHTOUTSIDE :
- {
- aMTPHor = drawinglayer::primitive2d::MEASURETEXTPOSITION_POSITIVE;
- break;
- }
- default : // SDRMEASURE_TEXTHAUTO
- {
- break;
- }
- }
-
- switch(((SdrMeasureTextVPosItem&)rItemSet.Get(SDRATTR_MEASURETEXTVPOS)).GetValue())
- {
- case SDRMEASURE_ABOVE :
- {
- aMTPVer = drawinglayer::primitive2d::MEASURETEXTPOSITION_NEGATIVE;
- break;
- }
- case SDRMEASURETEXT_BREAKEDLINE :
- case SDRMEASURETEXT_VERTICALCENTERED :
- {
- aMTPVer = drawinglayer::primitive2d::MEASURETEXTPOSITION_CENTERED;
- break;
- }
- case SDRMEASURE_BELOW :
- {
- aMTPVer = drawinglayer::primitive2d::MEASURETEXTPOSITION_POSITIVE;
- break;
- }
- default : // SDRMEASURE_TEXTVAUTO
- {
- break;
- }
- }
-
- // create primitive with the model data
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrMeasurePrimitive2D(*pAttribute,
- aStart, aEnd, aMTPHor, aMTPVer, fDistance, fUpperDistance, fLowerDistance, fLeftDelta, fRightDelta,
- bBelow, bTextRotation, bTextAutoAngle));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
+ aMTPHor = drawinglayer::primitive2d::MEASURETEXTPOSITION_NEGATIVE;
+ break;
+ }
+ case SDRMEASURE_TEXTINSIDE :
+ {
+ aMTPHor = drawinglayer::primitive2d::MEASURETEXTPOSITION_CENTERED;
+ break;
+ }
+ case SDRMEASURE_TEXTRIGHTOUTSIDE :
+ {
+ aMTPHor = drawinglayer::primitive2d::MEASURETEXTPOSITION_POSITIVE;
+ break;
+ }
+ default : // SDRMEASURE_TEXTHAUTO
+ {
+ break;
+ }
+ }
- delete pAttribute;
+ switch(((SdrMeasureTextVPosItem&)rItemSet.Get(SDRATTR_MEASURETEXTVPOS)).GetValue())
+ {
+ case SDRMEASURE_ABOVE :
+ {
+ aMTPVer = drawinglayer::primitive2d::MEASURETEXTPOSITION_NEGATIVE;
+ break;
+ }
+ case SDRMEASURETEXT_BREAKEDLINE :
+ case SDRMEASURETEXT_VERTICALCENTERED :
+ {
+ aMTPVer = drawinglayer::primitive2d::MEASURETEXTPOSITION_CENTERED;
+ break;
+ }
+ case SDRMEASURE_BELOW :
+ {
+ aMTPVer = drawinglayer::primitive2d::MEASURETEXTPOSITION_POSITIVE;
+ break;
+ }
+ default : // SDRMEASURE_TEXTVAUTO
+ {
+ break;
}
}
- return xRetval;
+ // create primitive with the model data. Always create primitives to allow the
+ // decomposition of SdrMeasurePrimitive2D to create needed invisible elements for HitTest
+ // and/or BoundRect
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::SdrMeasurePrimitive2D(
+ aAttribute, aStart, aEnd,
+ aMTPHor, aMTPVer, fDistance,
+ fUpperDistance, fLowerDistance,
+ fLeftDelta, fRightDelta, bBelow,
+ bTextRotation, bTextAutoAngle));
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
} // end of namespace contact
} // end of namespace sdr
diff --git a/svx/source/sdr/contact/viewcontactofsdrmediaobj.cxx b/svx/source/sdr/contact/viewcontactofsdrmediaobj.cxx
index af9686e9d6..5a38d50543 100644
--- a/svx/source/sdr/contact/viewcontactofsdrmediaobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrmediaobj.cxx
@@ -154,7 +154,9 @@ namespace sdr
// create range using the model data directly. This is in SdrTextObj::aRect which i will access using
// GetGeoRect() to not trigger any calculations. It's the unrotated geometry which is okay for MediaObjects ATM.
const Rectangle& rRectangle(GetSdrMediaObj().GetGeoRect());
- const basegfx::B2DRange aRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom());
+ const basegfx::B2DRange aRange(
+ rRectangle.Left(), rRectangle.Top(),
+ rRectangle.Right(), rRectangle.Bottom());
// create object transform
basegfx::B2DHomMatrix aTransform;
@@ -163,12 +165,15 @@ namespace sdr
aTransform.set(0, 2, aRange.getMinX());
aTransform.set(1, 2, aRange.getMinY());
- // create media primitive
+ // create media primitive. Always create primitives to allow the
+ // decomposition of MediaPrimitive2D to create needed invisible elements for HitTest
+ // and/or BoundRect
const basegfx::BColor aBackgroundColor(67.0 / 255.0, 67.0 / 255.0, 67.0 / 255.0);
const rtl::OUString& rURL(GetSdrMediaObj().getURL());
const sal_uInt32 nPixelBorder(4L);
- const drawinglayer::primitive2d::Primitive2DReference xRetval(new drawinglayer::primitive2d::MediaPrimitive2D(
- aTransform, rURL, aBackgroundColor, nPixelBorder));
+ const drawinglayer::primitive2d::Primitive2DReference xRetval(
+ new drawinglayer::primitive2d::MediaPrimitive2D(
+ aTransform, rURL, aBackgroundColor, nPixelBorder));
return drawinglayer::primitive2d::Primitive2DSequence(&xRetval, 1);
}
diff --git a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
index 9c0d1f5fc8..c998a65591 100644
--- a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
@@ -31,13 +31,13 @@
#include <svx/svdoashp.hxx>
#include <svx/sdr/contact/displayinfo.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <svditer.hxx>
#include <svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <svx/obj3d.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -112,131 +112,126 @@ namespace sdr
{
drawinglayer::primitive2d::Primitive2DSequence xRetval;
const SfxItemSet& rItemSet = GetCustomShapeObj().GetMergedItemSet();
- SdrText* pSdrText = GetCustomShapeObj().getText(0);
- if(pSdrText)
- {
- // #i98072# Get shandow and text; eventually suppress the text if it's
- // a TextPath FontworkGallery object
- drawinglayer::attribute::SdrShadowTextAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrShadowTextAttribute(
+ // #i98072# Get shandow and text; eventually suppress the text if it's
+ // a TextPath FontworkGallery object
+ const drawinglayer::attribute::SdrShadowTextAttribute aAttribute(
+ drawinglayer::primitive2d::createNewSdrShadowTextAttribute(
rItemSet,
- *pSdrText,
- GetCustomShapeObj().IsTextPath());
- drawinglayer::primitive2d::Primitive2DSequence xGroup;
- bool bHasText(pAttribute && pAttribute->getText());
+ GetCustomShapeObj().getText(0),
+ GetCustomShapeObj().IsTextPath()));
+ drawinglayer::primitive2d::Primitive2DSequence xGroup;
+ bool bHasText(!aAttribute.getText().isDefault());
- // create Primitive2DSequence from sub-geometry
- const SdrObject* pSdrObjRepresentation = GetCustomShapeObj().GetSdrObjectFromCustomShape();
- bool b3DShape(false);
+ // create Primitive2DSequence from sub-geometry
+ const SdrObject* pSdrObjRepresentation = GetCustomShapeObj().GetSdrObjectFromCustomShape();
+ bool b3DShape(false);
- if(pSdrObjRepresentation)
+ if(pSdrObjRepresentation)
+ {
+ SdrObjListIter aIterator(*pSdrObjRepresentation);
+
+ while(aIterator.IsMore())
{
- SdrObjListIter aIterator(*pSdrObjRepresentation);
-
- while(aIterator.IsMore())
- {
- SdrObject& rCandidate = *aIterator.Next();
+ SdrObject& rCandidate = *aIterator.Next();
- if(!b3DShape && dynamic_cast< E3dObject* >(&rCandidate))
- {
- b3DShape = true;
- }
-
- const drawinglayer::primitive2d::Primitive2DSequence xNew(rCandidate.GetViewContact().getViewIndependentPrimitive2DSequence());
- drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(xGroup, xNew);
+ if(!b3DShape && dynamic_cast< E3dObject* >(&rCandidate))
+ {
+ b3DShape = true;
}
+
+ const drawinglayer::primitive2d::Primitive2DSequence xNew(rCandidate.GetViewContact().getViewIndependentPrimitive2DSequence());
+ drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(xGroup, xNew);
}
+ }
+
+ if(bHasText || xGroup.hasElements())
+ {
+ // prepare text box geometry
+ basegfx::B2DHomMatrix aTextBoxMatrix;
+ bool bWordWrap(false);
- if(bHasText || xGroup.hasElements())
+ if(bHasText)
{
- // prepare text box geometry
- basegfx::B2DHomMatrix aTextBoxMatrix;
- bool bWordWrap(false);
+ // take unrotated snap rect as default, then get the
+ // unrotated text box. Rotation needs to be done centered
+ const Rectangle aObjectBound(GetCustomShapeObj().GetGeoRect());
+ const basegfx::B2DRange aObjectRange(aObjectBound.Left(), aObjectBound.Top(), aObjectBound.Right(), aObjectBound.Bottom());
- if(bHasText)
- {
- // take unrotated snap rect as default, then get the
- // unrotated text box. Rotation needs to be done centered
- const Rectangle aObjectBound(GetCustomShapeObj().GetGeoRect());
- const basegfx::B2DRange aObjectRange(aObjectBound.Left(), aObjectBound.Top(), aObjectBound.Right(), aObjectBound.Bottom());
+ // #i101684# get the text range unrotated and absolute to the object range
+ const basegfx::B2DRange aTextRange(getCorrectedTextBoundRect());
- // #i101684# get the text range unrotated and absolute to the object range
- const basegfx::B2DRange aTextRange(getCorrectedTextBoundRect());
+ // give text object a size
+ aTextBoxMatrix.scale(aTextRange.getWidth(), aTextRange.getHeight());
- // give text object a size
- aTextBoxMatrix.scale(aTextRange.getWidth(), aTextRange.getHeight());
+ // check if we have a rotation/shear at all to take care of
+ const double fExtraTextRotation(GetCustomShapeObj().GetExtraTextRotation());
+ const GeoStat& rGeoStat(GetCustomShapeObj().GetGeoStat());
- // check if we have a rotation/shear at all to take care of
- const double fExtraTextRotation(GetCustomShapeObj().GetExtraTextRotation());
- const GeoStat& rGeoStat(GetCustomShapeObj().GetGeoStat());
+ if(rGeoStat.nShearWink || rGeoStat.nDrehWink || !basegfx::fTools::equalZero(fExtraTextRotation))
+ {
+ if(aObjectRange != aTextRange)
+ {
+ // move relative to unrotated object range
+ aTextBoxMatrix.translate(
+ aTextRange.getMinX() - aObjectRange.getMinimum().getX(),
+ aTextRange.getMinY() - aObjectRange.getMinimum().getY());
+ }
- if(rGeoStat.nShearWink || rGeoStat.nDrehWink || !basegfx::fTools::equalZero(fExtraTextRotation))
+ if(!basegfx::fTools::equalZero(fExtraTextRotation))
{
- if(aObjectRange != aTextRange)
- {
- // move relative to unrotated object range
- aTextBoxMatrix.translate(
- aTextRange.getMinX() - aObjectRange.getMinimum().getX(),
- aTextRange.getMinY() - aObjectRange.getMinimum().getY());
- }
-
- if(!basegfx::fTools::equalZero(fExtraTextRotation))
- {
- basegfx::B2DVector aTranslation(
- ( aTextRange.getWidth() / 2 ) + ( aTextRange.getMinX() - aObjectRange.getMinimum().getX() ),
- ( aTextRange.getHeight() / 2 ) + ( aTextRange.getMinY() - aObjectRange.getMinimum().getY() ) );
- aTextBoxMatrix.translate( -aTranslation.getX(), -aTranslation.getY() );
- aTextBoxMatrix.rotate((360.0 - fExtraTextRotation) * F_PI180);
- aTextBoxMatrix.translate( aTranslation.getX(), aTranslation.getY() );
- }
-
- if(rGeoStat.nShearWink)
- {
- aTextBoxMatrix.shearX(tan((36000 - rGeoStat.nShearWink) * F_PI18000));
- }
-
- if(rGeoStat.nDrehWink)
- {
- aTextBoxMatrix.rotate((36000 - rGeoStat.nDrehWink) * F_PI18000);
- }
-
- // give text it's target position
- aTextBoxMatrix.translate(aObjectRange.getMinimum().getX(), aObjectRange.getMinimum().getY());
+ basegfx::B2DVector aTranslation(
+ ( aTextRange.getWidth() / 2 ) + ( aTextRange.getMinX() - aObjectRange.getMinimum().getX() ),
+ ( aTextRange.getHeight() / 2 ) + ( aTextRange.getMinY() - aObjectRange.getMinimum().getY() ) );
+ aTextBoxMatrix.translate( -aTranslation.getX(), -aTranslation.getY() );
+ aTextBoxMatrix.rotate((360.0 - fExtraTextRotation) * F_PI180);
+ aTextBoxMatrix.translate( aTranslation.getX(), aTranslation.getY() );
}
- else
+
+ if(rGeoStat.nShearWink)
{
- aTextBoxMatrix.translate(aTextRange.getMinX(), aTextRange.getMinY());
+ aTextBoxMatrix.shearX(tan((36000 - rGeoStat.nShearWink) * F_PI18000));
}
- // check if SdrTextWordWrapItem is set
- bWordWrap = ((SdrTextWordWrapItem&)(GetCustomShapeObj().GetMergedItem(SDRATTR_TEXT_WORDWRAP))).GetValue();
- }
+ if(rGeoStat.nDrehWink)
+ {
+ aTextBoxMatrix.rotate((36000 - rGeoStat.nDrehWink) * F_PI18000);
+ }
- // make sure a (even empty) SdrShadowTextAttribute exists for
- // primitive creation
- if(!pAttribute)
+ // give text it's target position
+ aTextBoxMatrix.translate(aObjectRange.getMinimum().getX(), aObjectRange.getMinimum().getY());
+ }
+ else
{
- pAttribute = new drawinglayer::attribute::SdrShadowTextAttribute(0L, 0L);
+ aTextBoxMatrix.translate(aTextRange.getMinX(), aTextRange.getMinY());
}
- // create primitive
- const drawinglayer::primitive2d::Primitive2DReference xReference(
- new drawinglayer::primitive2d::SdrCustomShapePrimitive2D(
- *pAttribute,
- xGroup,
- aTextBoxMatrix,
- bWordWrap,
- b3DShape,
- false)); // #SJ# New parameter to force to clipped BlockText for SC
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+ // check if SdrTextWordWrapItem is set
+ bWordWrap = ((SdrTextWordWrapItem&)(GetCustomShapeObj().GetMergedItem(SDRATTR_TEXT_WORDWRAP))).GetValue();
}
- if(pAttribute)
- {
- delete pAttribute;
- }
+ // create primitive
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::SdrCustomShapePrimitive2D(
+ aAttribute,
+ xGroup,
+ aTextBoxMatrix,
+ bWordWrap,
+ b3DShape,
+ false)); // #SJ# New parameter to force to clipped BlockText for SC
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
+ // always append an invisible outline for the cases where no visible content exists
+ const Rectangle aObjectBound(GetCustomShapeObj().GetGeoRect());
+ const basegfx::B2DRange aObjectRange(
+ aObjectBound.Left(), aObjectBound.Top(),
+ aObjectBound.Right(), aObjectBound.Bottom());
+
+ drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval,
+ drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
+ false, aObjectRange));
+
return xRetval;
}
} // end of namespace contact
diff --git a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx
index ddbae27a9e..b802b2e363 100644
--- a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx
@@ -30,7 +30,6 @@
#include <svx/sdr/contact/viewcontactofsdrole2obj.hxx>
#include <svx/svdoole2.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <svx/sdr/contact/viewobjectcontactofsdrole2obj.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <svx/sdr/primitive2d/sdrole2primitive2d.hxx>
@@ -72,59 +71,51 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrOle2Obj::createPrimitive2DSequenceWithParameters(
bool bHighContrast) const
{
- drawinglayer::primitive2d::Primitive2DSequence xRetval;
- SdrText* pSdrText = GetOle2Obj().getText(0);
-
- if(pSdrText)
- {
- // take unrotated snap rect (direct model data) for position and size
- const Rectangle& rRectangle = GetOle2Obj().GetGeoRect();
- const basegfx::B2DRange aObjectRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom());
-
- // create object matrix
- const GeoStat& rGeoStat(GetOle2Obj().GetGeoStat());
- const double fShearX(rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0);
- const double fRotate(rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0);
- const basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- aObjectRange.getWidth(), aObjectRange.getHeight(), fShearX, fRotate,
- aObjectRange.getMinX(), aObjectRange.getMinY()));
-
- // Prepare attribute settings, will be used soon anyways
- const SfxItemSet& rItemSet = GetOle2Obj().GetMergedItemSet();
- drawinglayer::attribute::SdrLineFillShadowTextAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(rItemSet, *pSdrText);
-
- if(!pAttribute)
- {
- // force existence, even when not visible
- pAttribute = new drawinglayer::attribute::SdrLineFillShadowTextAttribute(0, 0, 0, 0, 0, 0);
- }
-
- // #i102063# embed OLE content in an own primitive; this will be able to decompose accessing
- // the weak SdrOle2 reference and will also implement getB2DRange() for fast BoundRect
- // calculations without OLE Graphic access (which may trigger e.g. chart recalculation).
- // It will also take care of HighContrast and ScaleContent
- const drawinglayer::primitive2d::Primitive2DReference xOleContent(
- new drawinglayer::primitive2d::SdrOleContentPrimitive2D(
- GetOle2Obj(),
- aObjectMatrix,
-
- // #i104867# add GraphicVersion number to be able to check for
- // content change in the primitive later
- GetOle2Obj().getEmbeddedObjectRef().getGraphicVersion(),
-
- bHighContrast));
-
- // create primitive. Use Ole2 primitive here. Prepare attribute settings, will be used soon anyways.
- const drawinglayer::primitive2d::Primitive2DSequence xOLEContent(&xOleContent, 1);
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrOle2Primitive2D(
+ // take unrotated snap rect (direct model data) for position and size
+ const Rectangle& rRectangle = GetOle2Obj().GetGeoRect();
+ const basegfx::B2DRange aObjectRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom());
+
+ // create object matrix
+ const GeoStat& rGeoStat(GetOle2Obj().GetGeoStat());
+ const double fShearX(rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0);
+ const double fRotate(rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0);
+ const basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ aObjectRange.getWidth(), aObjectRange.getHeight(), fShearX, fRotate,
+ aObjectRange.getMinX(), aObjectRange.getMinY()));
+
+ // Prepare attribute settings, will be used soon anyways
+ const SfxItemSet& rItemSet = GetOle2Obj().GetMergedItemSet();
+ const drawinglayer::attribute::SdrLineFillShadowTextAttribute aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(
+ rItemSet,
+ GetOle2Obj().getText(0)));
+
+ // #i102063# embed OLE content in an own primitive; this will be able to decompose accessing
+ // the weak SdrOle2 reference and will also implement getB2DRange() for fast BoundRect
+ // calculations without OLE Graphic access (which may trigger e.g. chart recalculation).
+ // It will also take care of HighContrast and ScaleContent
+ const drawinglayer::primitive2d::Primitive2DReference xOleContent(
+ new drawinglayer::primitive2d::SdrOleContentPrimitive2D(
+ GetOle2Obj(),
+ aObjectMatrix,
+
+ // #i104867# add GraphicVersion number to be able to check for
+ // content change in the primitive later
+ GetOle2Obj().getEmbeddedObjectRef().getGraphicVersion(),
+
+ bHighContrast));
+
+ // create primitive. Use Ole2 primitive here. Prepare attribute settings, will
+ // be used soon anyways. Always create primitives to allow the decomposition of
+ // SdrOle2Primitive2D to create needed invisible elements for HitTest and/or BoundRect
+ const drawinglayer::primitive2d::Primitive2DSequence xOLEContent(&xOleContent, 1);
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::SdrOle2Primitive2D(
xOLEContent,
aObjectMatrix,
- *pAttribute));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- delete pAttribute;
- }
+ aAttribute));
- return xRetval;
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrOle2Obj::createViewIndependentPrimitive2DSequence() const
diff --git a/svx/source/sdr/contact/viewcontactofsdrpage.cxx b/svx/source/sdr/contact/viewcontactofsdrpage.cxx
index fdfcd53d05..0bf51d58f9 100644
--- a/svx/source/sdr/contact/viewcontactofsdrpage.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrpage.cxx
@@ -42,9 +42,9 @@
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
#include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
+#include <drawinglayer/attribute/sdrfillattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -98,7 +98,8 @@ namespace sdr
const svtools::ColorConfig aColorConfig;
const Color aInitColor(aColorConfig.GetColorValue(svtools::DOCCOLOR).nColor);
const basegfx::BColor aRGBColor(aInitColor.getBColor());
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::BackgroundColorPrimitive2D(aRGBColor));
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::BackgroundColorPrimitive2D(aRGBColor));
return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
@@ -202,38 +203,27 @@ namespace sdr
}
else
{
- OSL_ENSURE(0 != rPage.GetObjCount(), "MasterPage without MPBGO detected (!)");
+ // build primitive from pObject's attributes
+ const SfxItemSet& rFillAttributes = rPage.getSdrPageProperties().GetItemSet();
+ const drawinglayer::attribute::SdrFillAttribute aFill(
+ drawinglayer::primitive2d::createNewSdrFillAttribute(rFillAttributes));
- if(rPage.GetObjCount())
+ if(!aFill.isDefault())
{
- SdrObject* pObject = rPage.GetObj(0);
- OSL_ENSURE(pObject && pObject->IsMasterPageBackgroundObject(), "MasterPage with wrong MPBGO detected (!)");
-
- if(pObject && pObject->IsMasterPageBackgroundObject())
- {
- // build primitive from pObject's attributes
- const SfxItemSet& rFillProperties = pObject->GetMergedItemSet();
- drawinglayer::attribute::SdrFillAttribute* pFill = drawinglayer::primitive2d::createNewSdrFillAttribute(rFillProperties);
-
- if(pFill)
- {
- if(pFill->isVisible())
- {
- // direct model data is the page size, get and use it
- const basegfx::B2DRange aInnerRange(
- rPage.GetLftBorder(), rPage.GetUppBorder(),
- rPage.GetWdt() - rPage.GetRgtBorder(), rPage.GetHgt() - rPage.GetLwrBorder());
- const basegfx::B2DPolygon aInnerPolgon(basegfx::tools::createPolygonFromRect(aInnerRange));
- const basegfx::B2DHomMatrix aEmptyTransform;
- const drawinglayer::primitive2d::Primitive2DReference xReference(drawinglayer::primitive2d::createPolyPolygonFillPrimitive(
- basegfx::B2DPolyPolygon(aInnerPolgon), aEmptyTransform, *pFill));
-
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
-
- delete pFill;
- }
- }
+ // direct model data is the page size, get and use it
+ const basegfx::B2DRange aInnerRange(
+ rPage.GetLftBorder(), rPage.GetUppBorder(),
+ rPage.GetWdt() - rPage.GetRgtBorder(), rPage.GetHgt() - rPage.GetLwrBorder());
+ const basegfx::B2DPolygon aInnerPolgon(basegfx::tools::createPolygonFromRect(aInnerRange));
+ const basegfx::B2DHomMatrix aEmptyTransform;
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ drawinglayer::primitive2d::createPolyPolygonFillPrimitive(
+ basegfx::B2DPolyPolygon(aInnerPolgon),
+ aEmptyTransform,
+ aFill,
+ drawinglayer::attribute::FillGradientAttribute()));
+
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
}
}
@@ -455,23 +445,11 @@ namespace sdr
sal_uInt32 ViewContactOfPageHierarchy::GetObjectCount() const
{
- sal_uInt32 nSubObjectCount(getPage().GetObjCount());
-
- if(nSubObjectCount && getPage().GetObj(0L)->IsMasterPageBackgroundObject())
- {
- nSubObjectCount--;
- }
-
- return nSubObjectCount;
+ return getPage().GetObjCount();
}
ViewContact& ViewContactOfPageHierarchy::GetViewContact(sal_uInt32 nIndex) const
{
- if(getPage().GetObjCount() && getPage().GetObj(0L)->IsMasterPageBackgroundObject())
- {
- nIndex++;
- }
-
SdrObject* pObj = getPage().GetObj(nIndex);
DBG_ASSERT(pObj, "ViewContactOfPageHierarchy::GetViewContact: Corrupt SdrObjList (!)");
return pObj->GetViewContact();
diff --git a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx
index 21cbb4ef94..78f90a54d9 100644
--- a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx
@@ -31,7 +31,6 @@
#include <svx/sdr/contact/viewcontactofsdrpathobj.hxx>
#include <svx/svdopath.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <svx/sdr/primitive2d/sdrpathprimitive2d.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
@@ -53,93 +52,91 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrPathObj::createViewIndependentPrimitive2DSequence() const
{
- drawinglayer::primitive2d::Primitive2DSequence xRetval;
const SfxItemSet& rItemSet = GetPathObj().GetMergedItemSet();
- SdrText* pSdrText = GetPathObj().getText(0);
+ const drawinglayer::attribute::SdrLineFillShadowTextAttribute aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(
+ rItemSet,
+ GetPathObj().getText(0)));
+ basegfx::B2DPolyPolygon aUnitPolyPolygon(GetPathObj().GetPathPoly());
+ sal_uInt32 nPolyCount(aUnitPolyPolygon.count());
+ sal_uInt32 nPointCount(0);
+
+ for(sal_uInt32 a(0); a < nPolyCount; a++)
+ {
+ nPointCount += aUnitPolyPolygon.getB2DPolygon(a).count();
+ }
- if(pSdrText)
+ if(!nPointCount)
{
- drawinglayer::attribute::SdrLineFillShadowTextAttribute* pAttribute =
- drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(
- rItemSet,
- *pSdrText);
-
- if(pAttribute)
- {
- if(pAttribute->isVisible())
- {
- basegfx::B2DPolyPolygon aUnitPolyPolygon(GetPathObj().GetPathPoly());
- const sal_uInt32 nPolyCount(aUnitPolyPolygon.count());
-
- if(nPolyCount)
- {
- // prepare object transformation and unit polygon (direct model data)
- basegfx::B2DHomMatrix aObjectMatrix;
- const bool bIsLine(
- !aUnitPolyPolygon.areControlPointsUsed()
- && 1 == nPolyCount
- && 2 == aUnitPolyPolygon.getB2DPolygon(0).count());
-
- if(bIsLine)
- {
- // special handling for single line mode (2 points)
- const basegfx::B2DPolygon aSubPolygon(aUnitPolyPolygon.getB2DPolygon(0));
- const basegfx::B2DPoint aStart(aSubPolygon.getB2DPoint(0));
- const basegfx::B2DPoint aEnd(aSubPolygon.getB2DPoint(1));
- const basegfx::B2DVector aLine(aEnd - aStart);
-
- // #i102548# create new unit polygon for line (horizontal)
- basegfx::B2DPolygon aNewPolygon;
- aNewPolygon.append(basegfx::B2DPoint(0.0, 0.0));
- aNewPolygon.append(basegfx::B2DPoint(1.0, 0.0));
- aUnitPolyPolygon.setB2DPolygon(0, aNewPolygon);
-
- // #i102548# fill objectMatrix with rotation and offset (no shear for lines)
- aObjectMatrix = basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- aLine.getLength(), 1.0,
- 0.0,
- atan2(aLine.getY(), aLine.getX()),
- aStart.getX(), aStart.getY());
- }
- else
- {
- // #i102548# create unscaled, unsheared, unrotated and untranslated polygon
- // (unit polygon) by creating the object matrix and back-transforming the polygon
- const basegfx::B2DRange aObjectRange(basegfx::tools::getRange(aUnitPolyPolygon));
- const GeoStat& rGeoStat(GetPathObj().GetGeoStat());
- const double fWidth(aObjectRange.getWidth());
- const double fHeight(aObjectRange.getHeight());
- const double fScaleX(basegfx::fTools::equalZero(fWidth) ? 1.0 : fWidth);
- const double fScaleY(basegfx::fTools::equalZero(fHeight) ? 1.0 : fHeight);
-
- aObjectMatrix = basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- fScaleX, fScaleY,
- rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0,
- rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0,
- aObjectRange.getMinX(), aObjectRange.getMinY());
-
- // ceate unit polygon from object's absolute path
- basegfx::B2DHomMatrix aInverse(aObjectMatrix);
- aInverse.invert();
- aUnitPolyPolygon.transform(aInverse);
- }
-
- // create primitive
- const drawinglayer::primitive2d::Primitive2DReference xReference(
- new drawinglayer::primitive2d::SdrPathPrimitive2D(
- aObjectMatrix,
- *pAttribute,
- aUnitPolyPolygon));
-
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
- }
-
- delete pAttribute;
- }
+ OSL_ENSURE(false, "PolyPolygon object without geometry detected, this should not be created (!)");
+ basegfx::B2DPolygon aFallbackLine;
+ aFallbackLine.append(basegfx::B2DPoint(0.0, 0.0));
+ aFallbackLine.append(basegfx::B2DPoint(1000.0, 1000.0));
+ aUnitPolyPolygon = basegfx::B2DPolyPolygon(aFallbackLine);
+
+ nPolyCount = 1;
}
- return xRetval;
+ // prepare object transformation and unit polygon (direct model data)
+ basegfx::B2DHomMatrix aObjectMatrix;
+ const bool bIsLine(
+ !aUnitPolyPolygon.areControlPointsUsed()
+ && 1 == nPolyCount
+ && 2 == aUnitPolyPolygon.getB2DPolygon(0).count());
+
+ if(bIsLine)
+ {
+ // special handling for single line mode (2 points)
+ const basegfx::B2DPolygon aSubPolygon(aUnitPolyPolygon.getB2DPolygon(0));
+ const basegfx::B2DPoint aStart(aSubPolygon.getB2DPoint(0));
+ const basegfx::B2DPoint aEnd(aSubPolygon.getB2DPoint(1));
+ const basegfx::B2DVector aLine(aEnd - aStart);
+
+ // #i102548# create new unit polygon for line (horizontal)
+ basegfx::B2DPolygon aNewPolygon;
+ aNewPolygon.append(basegfx::B2DPoint(0.0, 0.0));
+ aNewPolygon.append(basegfx::B2DPoint(1.0, 0.0));
+ aUnitPolyPolygon.setB2DPolygon(0, aNewPolygon);
+
+ // #i102548# fill objectMatrix with rotation and offset (no shear for lines)
+ aObjectMatrix = basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ aLine.getLength(), 1.0,
+ 0.0,
+ atan2(aLine.getY(), aLine.getX()),
+ aStart.getX(), aStart.getY());
+ }
+ else
+ {
+ // #i102548# create unscaled, unsheared, unrotated and untranslated polygon
+ // (unit polygon) by creating the object matrix and back-transforming the polygon
+ const basegfx::B2DRange aObjectRange(basegfx::tools::getRange(aUnitPolyPolygon));
+ const GeoStat& rGeoStat(GetPathObj().GetGeoStat());
+ const double fWidth(aObjectRange.getWidth());
+ const double fHeight(aObjectRange.getHeight());
+ const double fScaleX(basegfx::fTools::equalZero(fWidth) ? 1.0 : fWidth);
+ const double fScaleY(basegfx::fTools::equalZero(fHeight) ? 1.0 : fHeight);
+
+ aObjectMatrix = basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ fScaleX, fScaleY,
+ rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0,
+ rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0,
+ aObjectRange.getMinX(), aObjectRange.getMinY());
+
+ // ceate unit polygon from object's absolute path
+ basegfx::B2DHomMatrix aInverse(aObjectMatrix);
+ aInverse.invert();
+ aUnitPolyPolygon.transform(aInverse);
+ }
+
+ // create primitive. Always create primitives to allow the decomposition of
+ // SdrPathPrimitive2D to create needed invisible elements for HitTest and/or BoundRect
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::SdrPathPrimitive2D(
+ aObjectMatrix,
+ aAttribute,
+ aUnitPolyPolygon));
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
} // end of namespace contact
} // end of namespace sdr
diff --git a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx
index 9b9b3a838e..cf2cf35033 100644
--- a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx
@@ -31,7 +31,6 @@
#include <svx/sdr/contact/viewcontactofsdrrectobj.hxx>
#include <svx/svdorect.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx>
#include <svl/itemset.hxx>
#include <svx/sdr/primitive2d/sdrprimitivetools.hxx>
@@ -55,70 +54,48 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrRectObj::createViewIndependentPrimitive2DSequence() const
{
- drawinglayer::primitive2d::Primitive2DSequence xRetval;
const SfxItemSet& rItemSet = GetRectObj().GetMergedItemSet();
- SdrText* pSdrText = GetRectObj().getText(0);
+ const drawinglayer::attribute::SdrLineFillShadowTextAttribute aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(
+ rItemSet,
+ GetRectObj().getText(0)));
- if(pSdrText)
- {
- drawinglayer::attribute::SdrLineFillShadowTextAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(rItemSet, *pSdrText);
+ // take unrotated snap rect (direct model data) for position and size
+ const Rectangle& rRectangle = GetRectObj().GetGeoRect();
+ const ::basegfx::B2DRange aObjectRange(
+ rRectangle.Left(), rRectangle.Top(),
+ rRectangle.Right(), rRectangle.Bottom());
+ const GeoStat& rGeoStat(GetRectObj().GetGeoStat());
+
+ // fill object matrix
+ basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ aObjectRange.getWidth(), aObjectRange.getHeight(),
+ rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0,
+ rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0,
+ aObjectRange.getMinX(), aObjectRange.getMinY()));
- if(pAttribute)
- {
- if(pAttribute->isVisible())
- {
- // take unrotated snap rect (direct model data) for position and size
- const Rectangle& rRectangle = GetRectObj().GetGeoRect();
- const ::basegfx::B2DRange aObjectRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom());
- const GeoStat& rGeoStat(GetRectObj().GetGeoStat());
-
- // fill object matrix
- basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- aObjectRange.getWidth(), aObjectRange.getHeight(),
- rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0,
- rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0,
- aObjectRange.getMinX(), aObjectRange.getMinY()));
+ // calculate corner radius
+ sal_uInt32 nCornerRadius(((SdrEckenradiusItem&)(rItemSet.Get(SDRATTR_ECKENRADIUS))).GetValue());
+ double fCornerRadiusX;
+ double fCornerRadiusY;
+ drawinglayer::primitive2d::calculateRelativeCornerRadius(nCornerRadius, aObjectRange, fCornerRadiusX, fCornerRadiusY);
- // calculate corner radius
- sal_uInt32 nCornerRadius(((SdrEckenradiusItem&)(rItemSet.Get(SDRATTR_ECKENRADIUS))).GetValue());
- double fCornerRadiusX;
- double fCornerRadiusY;
- drawinglayer::primitive2d::calculateRelativeCornerRadius(nCornerRadius, aObjectRange, fCornerRadiusX, fCornerRadiusY);
+ // #i105856# use knowledge about pickthrough from the model
+ const bool bPickThroughTransparentTextFrames(
+ GetRectObj().GetModel() && GetRectObj().GetModel()->IsPickThroughTransparentTextFrames());
- // #i105856# use knowledge about pickthrough from the model
- const bool bPickThroughTransparentTextFrames(
- GetRectObj().GetModel() && GetRectObj().GetModel()->IsPickThroughTransparentTextFrames());
-
- // create primitive
- const drawinglayer::primitive2d::Primitive2DReference xReference(
- new drawinglayer::primitive2d::SdrRectanglePrimitive2D(
- aObjectMatrix,
- *pAttribute,
- fCornerRadiusX,
- fCornerRadiusY,
- // #i105856# use fill for HitTest when TextFrame and not PickThrough
- GetRectObj().IsTextFrame() && !bPickThroughTransparentTextFrames));
-
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
-
- delete pAttribute;
- }
-
- if(!xRetval.hasElements())
- {
- // #i99123#
- // Object is invisible. Create a fallback primitive for HitTest
- basegfx::B2DHomMatrix aObjectMatrix;
- basegfx::B2DPolyPolygon aObjectPolyPolygon;
- GetRectObj().TRGetBaseGeometry(aObjectMatrix, aObjectPolyPolygon);
- const drawinglayer::primitive2d::Primitive2DReference xReference(
- drawinglayer::primitive2d::createFallbackHitTestPrimitive(aObjectMatrix));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
- }
-
- return xRetval;
+ // create primitive. Always create primitives to allow the decomposition of
+ // SdrRectanglePrimitive2D to create needed invisible elements for HitTest and/or BoundRect
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::SdrRectanglePrimitive2D(
+ aObjectMatrix,
+ aAttribute,
+ fCornerRadiusX,
+ fCornerRadiusY,
+ // #i105856# use fill for HitTest when TextFrame and not PickThrough
+ GetRectObj().IsTextFrame() && !bPickThroughTransparentTextFrames));
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
} // end of namespace contact
} // end of namespace sdr
diff --git a/svx/source/sdr/contact/viewcontactofunocontrol.cxx b/svx/source/sdr/contact/viewcontactofunocontrol.cxx
index 16756cd8a8..1e34db7575 100644
--- a/svx/source/sdr/contact/viewcontactofunocontrol.cxx
+++ b/svx/source/sdr/contact/viewcontactofunocontrol.cxx
@@ -47,6 +47,7 @@
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <drawinglayer/primitive2d/controlprimitive2d.hxx>
#include <svx/sdr/contact/displayinfo.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
//........................................................................
namespace sdr { namespace contact {
@@ -135,35 +136,43 @@ namespace sdr { namespace contact {
//--------------------------------------------------------------------
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfUnoControl::createViewIndependentPrimitive2DSequence() const
{
+ // create range. Use model data directly, not getBoundRect()/getSnapRect; these will use
+ // the primitive data themselves in the long run. Use SdrUnoObj's (which is a SdrRectObj)
+ // call to GetGeoRect() to access SdrTextObj::aRect directly and without executing anything
+ const Rectangle& rRectangle(GetSdrUnoObj().GetGeoRect());
+ const basegfx::B2DRange aRange(
+ rRectangle.Left(), rRectangle.Top(),
+ rRectangle.Right(), rRectangle.Bottom());
+
+ // create object transform
+ basegfx::B2DHomMatrix aTransform;
+
+ aTransform.set(0, 0, aRange.getWidth());
+ aTransform.set(1, 1, aRange.getHeight());
+ aTransform.set(0, 2, aRange.getMinX());
+ aTransform.set(1, 2, aRange.getMinY());
+
Reference< XControlModel > xControlModel = GetSdrUnoObj().GetUnoControlModel();
if(xControlModel.is())
{
- // create range. Use model data directly, not getBoundRect()/getSnapRect; these will use
- // the primitive data themselves in the long run. Use SdrUnoObj's (which is a SdrRectObj)
- // call to GetGeoRect() to access SdrTextObj::aRect directly and without executing anything
- const Rectangle& rRectangle(GetSdrUnoObj().GetGeoRect());
- const basegfx::B2DRange aRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom());
-
- // create object transform
- basegfx::B2DHomMatrix aTransform;
- aTransform.set(0, 0, aRange.getWidth());
- aTransform.set(1, 1, aRange.getHeight());
- aTransform.set(0, 2, aRange.getMinX());
- aTransform.set(1, 2, aRange.getMinY());
-
// create control primitive WITHOUT possibly existing XControl; this would be done in
// the VOC in createPrimitive2DSequence()
- const drawinglayer::primitive2d::Primitive2DReference xRetval(new drawinglayer::primitive2d::ControlPrimitive2D(
- aTransform, xControlModel));
+ const drawinglayer::primitive2d::Primitive2DReference xRetval(
+ new drawinglayer::primitive2d::ControlPrimitive2D(
+ aTransform,
+ xControlModel));
return drawinglayer::primitive2d::Primitive2DSequence(&xRetval, 1);
}
else
{
- // #i93161# This UnoControl does not yet have a xControlModel (can happen
- // during diverse creations). Without a model, create no visualisation.
- return drawinglayer::primitive2d::Primitive2DSequence();
+ // always append an invisible outline for the cases where no visible content exists
+ const drawinglayer::primitive2d::Primitive2DReference xRetval(
+ drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
+ false, aTransform));
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&xRetval, 1);
}
}
diff --git a/svx/source/sdr/contact/viewcontactofvirtobj.cxx b/svx/source/sdr/contact/viewcontactofvirtobj.cxx
index 5269faedfd..a6ccb2b45f 100644
--- a/svx/source/sdr/contact/viewcontactofvirtobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofvirtobj.cxx
@@ -33,6 +33,7 @@
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
#include <vcl/outdev.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -74,29 +75,39 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfVirtObj::createViewIndependentPrimitive2DSequence() const
{
- drawinglayer::primitive2d::Primitive2DSequence xRetval;
+ // create displacement transformation if we have content
+ basegfx::B2DHomMatrix aObjectMatrix;
+ Point aAnchor(GetVirtObj().GetAnchorPos());
+
+ if(aAnchor.X() || aAnchor.Y())
+ {
+ aObjectMatrix.set(0, 2, aAnchor.X());
+ aObjectMatrix.set(1, 2, aAnchor.Y());
+ }
// use method from referenced object to get the Primitive2DSequence
- const drawinglayer::primitive2d::Primitive2DSequence xSequenceVirtual(GetVirtObj().GetReferencedObj().GetViewContact().getViewIndependentPrimitive2DSequence());
+ const drawinglayer::primitive2d::Primitive2DSequence xSequenceVirtual(
+ GetVirtObj().GetReferencedObj().GetViewContact().getViewIndependentPrimitive2DSequence());
if(xSequenceVirtual.hasElements())
{
- // create displacement transformation if we have content
- ::basegfx::B2DHomMatrix aObjectMatrix;
- Point aAnchor(GetVirtObj().GetAnchorPos());
-
- if(aAnchor.X() || aAnchor.Y())
- {
- aObjectMatrix.set(0, 2, aAnchor.X());
- aObjectMatrix.set(1, 2, aAnchor.Y());
- }
-
// create transform primitive
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::TransformPrimitive2D(aObjectMatrix, xSequenceVirtual));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::TransformPrimitive2D(
+ aObjectMatrix,
+ xSequenceVirtual));
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
+ else
+ {
+ // always append an invisible outline for the cases where no visible content exists
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
+ false, aObjectMatrix));
- return xRetval;
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+ }
}
} // end of namespace contact
} // end of namespace sdr
diff --git a/svx/source/sdr/contact/viewobjectcontactofe3d.cxx b/svx/source/sdr/contact/viewobjectcontactofe3d.cxx
index 2109789ade..0873ef1806 100644
--- a/svx/source/sdr/contact/viewobjectcontactofe3d.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofe3d.cxx
@@ -35,7 +35,6 @@
#include <svx/sdr/contact/viewobjectcontactofe3dscene.hxx>
#include <drawinglayer/primitive2d/embedded3dprimitive2d.hxx>
#include <svx/sdr/contact/viewcontactofe3dscene.hxx>
-#include <drawinglayer/attribute/sdrattribute3d.hxx>
//////////////////////////////////////////////////////////////////////////////
// predeclarations
diff --git a/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx b/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx
index 3e13d81f95..01c666b56c 100644
--- a/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx
@@ -121,17 +121,6 @@ namespace sdr
xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
}
- else
- {
- // do neither print nor PDF export the fallback visualisation
- if(!GetObjectContact().isOutputToPrinter() && !GetObjectContact().isOutputToRecordingMetaFile())
- {
- // empty group, fallback to parent method which will create the default
- // grayed frame for empty 3d scenes by using model data and
- // createViewIndependentPrimitive2DSequence::ViewContactOfE3dScene
- xRetval = ViewObjectContactOfSdrObj::createPrimitive2DSequence(rDisplayInfo);
- }
- }
if(bIsActiveVC)
{
diff --git a/svx/source/sdr/contact/viewobjectcontactofgroup.cxx b/svx/source/sdr/contact/viewobjectcontactofgroup.cxx
index f5f522608a..88e7e842f7 100644
--- a/svx/source/sdr/contact/viewobjectcontactofgroup.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofgroup.cxx
@@ -55,20 +55,6 @@ namespace sdr
{
}
- bool ViewObjectContactOfGroup::isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const
- {
- const bool bHasChildren(0 != GetViewContact().GetObjectCount());
-
- if(!bHasChildren && (GetObjectContact().isOutputToPrinter() || GetObjectContact().isOutputToRecordingMetaFile()))
- {
- // empty group uses fallback gray empty frame display. Do neither print nor PDF export it
- return false;
- }
-
- // call parent
- return ViewObjectContactOfSdrObj::isPrimitiveVisible(rDisplayInfo);
- }
-
drawinglayer::primitive2d::Primitive2DSequence ViewObjectContactOfGroup::getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const
{
const sal_uInt32 nSubHierarchyCount(GetViewContact().GetObjectCount());
diff --git a/svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx b/svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx
index 8744fd14a8..85c4068d4f 100644
--- a/svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx
@@ -94,15 +94,13 @@ namespace sdr
rDisplayInfo.SetProcessLayers(aPreprocessedLayers);
rDisplayInfo.SetSubContentActive(true);
- // check if there is a MasterPageBackgroundObject and if it's visible in the LayerSet
- const SdrObject* pBackgroundCandidate = rDescriptor.GetBackgroundObject();
-
- if(pBackgroundCandidate && aPreprocessedLayers.IsSet(pBackgroundCandidate->GetLayer()))
+ // check layer visibility (traditionally was member of layer 1)
+ if(aPreprocessedLayers.IsSet(1))
{
// hide PageBackground for special DrawModes; historical reasons
if(!GetObjectContact().isDrawModeGray() && !GetObjectContact().isDrawModeHighContrast())
{
- // if yes, create the default background primitive sequence
+ // if visible, create the default background primitive sequence
xRetval = static_cast< ViewContactOfMasterPageDescriptor& >(GetViewContact()).getViewIndependentPrimitive2DSequence();
}
}
diff --git a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx
index b406620e08..fb497d09d3 100644
--- a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx
@@ -40,7 +40,7 @@
#include <svx/svdpage.hxx>
#include <unoapi.hxx>
#include <drawinglayer/primitive2d/pagepreviewprimitive2d.hxx>
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -292,28 +292,19 @@ namespace sdr
else if(bCreateGrayFrame)
{
// #i105146# no content, but frame display. To make hitting the page preview objects
- // on the handout page more simple, add a HitTest fill primitive
- const basegfx::B2DRange aUnitRange(0.0, 0.0, 1.0, 1.0);
- basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(aUnitRange));
- aOutline.transform(aPageObjectTransform);
-
- const drawinglayer::primitive2d::Primitive2DReference xHitFill(
- new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
- basegfx::B2DPolyPolygon(aOutline),
- basegfx::BColor(0.0, 0.0, 0.0)));
-
- const drawinglayer::primitive2d::Primitive2DReference xHit(
- new drawinglayer::primitive2d::HitTestPrimitive2D(
- drawinglayer::primitive2d::Primitive2DSequence(&xHitFill, 1)));
-
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xHit, 1);
+ // on the handout page more simple, add hidden fill geometry
+ const drawinglayer::primitive2d::Primitive2DReference xFrameHit(
+ drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
+ false,
+ aPageObjectTransform));
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xFrameHit, 1);
}
// add a gray outline frame, except not when printing
if(bCreateGrayFrame)
{
const Color aFrameColor(aColorConfig.GetColorValue(svtools::OBJECTBOUNDARIES).nColor);
- basegfx::B2DPolygon aOwnOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ basegfx::B2DPolygon aOwnOutline(basegfx::tools::createUnitPolygon());
aOwnOutline.transform(aPageObjectTransform);
const drawinglayer::primitive2d::Primitive2DReference xGrayFrame(
diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx
index 645a980a1c..182f790fe1 100644
--- a/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx
@@ -35,11 +35,11 @@
#include <svx/sdr/contact/objectcontact.hxx>
#include <svx/svdview.hxx>
#include <drawinglayer/primitive2d/chartprimitive2d.hxx>
-#include <drawinglayer/attribute/fillattribute.hxx>
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <com/sun/star/embed/EmbedMisc.hpp>
#include <com/sun/star/embed/EmbedStates.hpp>
+#include <basegfx/polygon/b2dpolygon.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -203,7 +203,7 @@ namespace sdr
if(!GetObjectContact().isOutputToPrinter() && !GetObjectContact().isOutputToRecordingMetaFile())
{
// shade the representation if the object is activated outplace
- basegfx::B2DPolygon aObjectOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ basegfx::B2DPolygon aObjectOutline(basegfx::tools::createUnitPolygon());
aObjectOutline.transform(aObjectTransform);
// Use a FillHatchPrimitive2D with necessary attributes
diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
index 3b53a9c543..1e8f4c79de 100644
--- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
@@ -1689,6 +1689,9 @@ namespace sdr { namespace contact {
if ( !bHadControl && rControl.is() && rControl.isVisible() )
rControl.invalidate();
+ if ( !bHadControl && rControl.is() && rControl.isVisible() )
+ rControl.invalidate();
+
// check if we already have an XControl.
if ( !xControlModel.is() || !rControl.is() )
// use the default mechanism. This will create a ControlPrimitive2D without
diff --git a/svx/source/sdr/overlay/overlayobjectcell.cxx b/svx/source/sdr/overlay/overlayobjectcell.cxx
index 2a908256f7..e7a8a3eae1 100644
--- a/svx/source/sdr/overlay/overlayobjectcell.cxx
+++ b/svx/source/sdr/overlay/overlayobjectcell.cxx
@@ -35,7 +35,7 @@
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
-#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
#include <drawinglayer/primitive2d/invertprimitive2d.hxx>
using namespace ::basegfx;
@@ -84,12 +84,12 @@ namespace sdr
if(mePaintType == CELL_OVERLAY_TRANSPARENT)
{
// embed in 50% transparent paint
- const drawinglayer::primitive2d::Primitive2DReference aUnifiedAlpha(
- new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D(
+ const drawinglayer::primitive2d::Primitive2DReference aUnifiedTransparence(
+ new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(
aRetval,
0.5));
- aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aUnifiedAlpha, 1);
+ aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aUnifiedTransparence, 1);
}
else // CELL_OVERLAY_INVERT
{
diff --git a/svx/source/sdr/overlay/overlayselection.cxx b/svx/source/sdr/overlay/overlayselection.cxx
index 4b5a952548..bcf80b7c1d 100644
--- a/svx/source/sdr/overlay/overlayselection.cxx
+++ b/svx/source/sdr/overlay/overlayselection.cxx
@@ -35,7 +35,7 @@
#include <vcl/svapp.hxx>
#include <vcl/outdev.hxx>
#include <drawinglayer/primitive2d/invertprimitive2d.hxx>
-#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
#include <basegfx/polygon/b2dpolypolygoncutter.hxx>
#include <svx/sdr/overlay/overlaymanager.hxx>
@@ -141,8 +141,8 @@ namespace sdr
{
// embed all rectangles in transparent paint
const double fTransparence(mnLastTransparence / 100.0);
- const drawinglayer::primitive2d::Primitive2DReference aUnifiedAlpha(
- new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D(
+ const drawinglayer::primitive2d::Primitive2DReference aUnifiedTransparence(
+ new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(
aRetval,
fTransparence));
@@ -156,13 +156,13 @@ namespace sdr
// add both to result
aRetval.realloc(2);
- aRetval[0] = aUnifiedAlpha;
+ aRetval[0] = aUnifiedTransparence;
aRetval[1] = aSelectionOutline;
}
else
{
// just add transparent part
- aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aUnifiedAlpha, 1);
+ aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aUnifiedTransparence, 1);
}
}
}
diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
index c0f9fd57d9..d18345dd0b 100644
--- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx
+++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
@@ -54,14 +54,11 @@
#include <svx/sdsxyitm.hxx>
#include <svx/sdshcitm.hxx>
#include <svx/sdshtitm.hxx>
-#include <drawinglayer/attribute/fillattribute.hxx>
#include <drawinglayer/attribute/sdrfillbitmapattribute.hxx>
#include <basegfx/polygon/b2dlinegeometry.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
#include <svx/svdotext.hxx>
#include <drawinglayer/attribute/fillbitmapattribute.hxx>
#include <svx/sdr/attribute/sdrtextattribute.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <svx/xbtmpit.hxx>
#include <svl/itempool.hxx>
#include <vcl/svapp.hxx>
@@ -69,10 +66,22 @@
#include <svx/svx3ditems.hxx>
#include <com/sun/star/drawing/ProjectionMode.hpp>
#include <com/sun/star/drawing/ShadeMode.hpp>
-#include <drawinglayer/attribute/sdrattribute3d.hxx>
#include <drawinglayer/attribute/sdrallattribute3d.hxx>
#include <svx/rectenum.hxx>
#include <svx/sdtfchim.hxx>
+#include <svx/svdoutl.hxx>
+#include <svx/svdmodel.hxx>
+#include <editeng/editstat.hxx>
+#include <drawinglayer/attribute/fillhatchattribute.hxx>
+#include <drawinglayer/attribute/fillgradientattribute.hxx>
+#include <svx/sdr/attribute/sdrshadowtextattribute.hxx>
+#include <svx/sdr/attribute/sdrlineshadowtextattribute.hxx>
+#include <svx/sdr/attribute/sdrformtextattribute.hxx>
+#include <svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx>
+#include <drawinglayer/attribute/sdrsceneattribute3d.hxx>
+#include <drawinglayer/attribute/sdrlightingattribute3d.hxx>
+#include <drawinglayer/attribute/sdrlightattribute3d.hxx>
+#include <svx/sdr/attribute/sdrfilltextattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -214,9 +223,8 @@ namespace drawinglayer
{
namespace primitive2d
{
- attribute::SdrLineAttribute* createNewSdrLineAttribute(const SfxItemSet& rSet)
+ attribute::SdrLineAttribute createNewSdrLineAttribute(const SfxItemSet& rSet)
{
- attribute::SdrLineAttribute* pRetval(0L);
const XLineStyle eStyle(((XLineStyleItem&)(rSet.Get(XATTR_LINESTYLE))).GetValue());
if(XLINE_NONE != eStyle)
@@ -246,7 +254,7 @@ namespace drawinglayer
}
}
- pRetval = new attribute::SdrLineAttribute(
+ return attribute::SdrLineAttribute(
XLineJointtoB2DLineJoin(eJoint),
(double)nWidth,
(double)nTransparence * 0.01,
@@ -256,12 +264,13 @@ namespace drawinglayer
}
}
- return pRetval;
+ return attribute::SdrLineAttribute();
}
- attribute::SdrLineStartEndAttribute* createNewSdrLineStartEndAttribute(const SfxItemSet& rSet, double fWidth)
+ attribute::SdrLineStartEndAttribute createNewSdrLineStartEndAttribute(
+ const SfxItemSet& rSet,
+ double fWidth)
{
- attribute::SdrLineStartEndAttribute* pRetval(0L);
const sal_Int32 nTempStartWidth(((const XLineStartWidthItem&)(rSet.Get(XATTR_LINESTARTWIDTH))).GetValue());
const sal_Int32 nTempEndWidth(((const XLineEndWidthItem&)(rSet.Get(XATTR_LINEENDWIDTH))).GetValue());
basegfx::B2DPolyPolygon aStartPolyPolygon;
@@ -321,15 +330,16 @@ namespace drawinglayer
if(bStartActive || bEndActive)
{
- pRetval = new attribute::SdrLineStartEndAttribute(aStartPolyPolygon, aEndPolyPolygon, fStartWidth, fEndWidth, bStartActive, bEndActive, bStartCentered, bEndCentered);
+ return attribute::SdrLineStartEndAttribute(
+ aStartPolyPolygon, aEndPolyPolygon, fStartWidth, fEndWidth,
+ bStartActive, bEndActive, bStartCentered, bEndCentered);
}
- return pRetval;
+ return attribute::SdrLineStartEndAttribute();
}
- attribute::SdrShadowAttribute* createNewSdrShadowAttribute(const SfxItemSet& rSet)
+ attribute::SdrShadowAttribute createNewSdrShadowAttribute(const SfxItemSet& rSet)
{
- attribute::SdrShadowAttribute* pRetval(0L);
const bool bShadow(((SdrShadowItem&)rSet.Get(SDRATTR_SHADOW)).GetValue());
if(bShadow)
@@ -367,16 +377,15 @@ namespace drawinglayer
(double)((SdrShadowYDistItem&)(rSet.Get(SDRATTR_SHADOWYDIST))).GetValue());
const Color aColor(((SdrShadowColorItem&)(rSet.Get(SDRATTR_SHADOWCOLOR))).GetColorValue());
- pRetval = new attribute::SdrShadowAttribute(aOffset, (double)nTransparence * 0.01, aColor.getBColor());
+ return attribute::SdrShadowAttribute(aOffset, (double)nTransparence * 0.01, aColor.getBColor());
}
}
- return pRetval;
+ return attribute::SdrShadowAttribute();
}
- attribute::SdrFillAttribute* createNewSdrFillAttribute(const SfxItemSet& rSet)
+ attribute::SdrFillAttribute createNewSdrFillAttribute(const SfxItemSet& rSet)
{
- attribute::SdrFillAttribute* pRetval(0L);
const XFillStyle eStyle(((XFillStyleItem&)(rSet.Get(XATTR_FILLSTYLE))).GetValue());
if(XFILL_NONE != eStyle)
@@ -391,9 +400,9 @@ namespace drawinglayer
if(100 != nTransparence)
{
const Color aColor(((const XFillColorItem&)(rSet.Get(XATTR_FILLCOLOR))).GetColorValue());
- attribute::FillGradientAttribute* pGradient(0L);
- attribute::FillHatchAttribute* pHatch(0L);
- attribute::SdrFillBitmapAttribute* pBitmap(0L);
+ attribute::FillGradientAttribute aGradient;
+ attribute::FillHatchAttribute aHatch;
+ attribute::SdrFillBitmapAttribute aBitmap;
switch(eStyle)
{
@@ -405,10 +414,10 @@ namespace drawinglayer
}
case XFILL_GRADIENT :
{
- XGradient aGradient(((XFillGradientItem&)(rSet.Get(XATTR_FILLGRADIENT))).GetGradientValue());
+ XGradient aXGradient(((XFillGradientItem&)(rSet.Get(XATTR_FILLGRADIENT))).GetGradientValue());
- const Color aStartColor(aGradient.GetStartColor());
- const sal_uInt16 nStartIntens(aGradient.GetStartIntens());
+ const Color aStartColor(aXGradient.GetStartColor());
+ const sal_uInt16 nStartIntens(aXGradient.GetStartIntens());
basegfx::BColor aStart(aStartColor.getBColor());
if(nStartIntens != 100)
@@ -417,8 +426,8 @@ namespace drawinglayer
aStart = interpolate(aBlack, aStart, (double)nStartIntens * 0.01);
}
- const Color aEndColor(aGradient.GetEndColor());
- const sal_uInt16 nEndIntens(aGradient.GetEndIntens());
+ const Color aEndColor(aXGradient.GetEndColor());
+ const sal_uInt16 nEndIntens(aXGradient.GetEndIntens());
basegfx::BColor aEnd(aEndColor.getBColor());
if(nEndIntens != 100)
@@ -427,12 +436,12 @@ namespace drawinglayer
aEnd = interpolate(aBlack, aEnd, (double)nEndIntens * 0.01);
}
- pGradient = new attribute::FillGradientAttribute(
- XGradientStyleToGradientStyle(aGradient.GetGradientStyle()),
- (double)aGradient.GetBorder() * 0.01,
- (double)aGradient.GetXOffset() * 0.01,
- (double)aGradient.GetYOffset() * 0.01,
- (double)aGradient.GetAngle() * F_PI1800,
+ aGradient = attribute::FillGradientAttribute(
+ XGradientStyleToGradientStyle(aXGradient.GetGradientStyle()),
+ (double)aXGradient.GetBorder() * 0.01,
+ (double)aXGradient.GetXOffset() * 0.01,
+ (double)aXGradient.GetYOffset() * 0.01,
+ (double)aXGradient.GetAngle() * F_PI1800,
aStart,
aEnd,
((const XGradientStepCountItem&)rSet.Get(XATTR_GRADIENTSTEPCOUNT)).GetValue());
@@ -444,7 +453,7 @@ namespace drawinglayer
const XHatch& rHatch(((XFillHatchItem&)(rSet.Get(XATTR_FILLHATCH))).GetHatchValue());
const Color aColorB(rHatch.GetColor());
- pHatch = new attribute::FillHatchAttribute(
+ aHatch = attribute::FillHatchAttribute(
XHatchStyleToHatchStyle(rHatch.GetHatchStyle()),
(double)rHatch.GetDistance(),
(double)rHatch.GetAngle() * F_PI1800,
@@ -455,23 +464,25 @@ namespace drawinglayer
}
case XFILL_BITMAP :
{
- pBitmap = createNewSdrFillBitmapAttribute(rSet);
+ aBitmap = createNewSdrFillBitmapAttribute(rSet);
break;
}
}
- pRetval = new attribute::SdrFillAttribute(
+ return attribute::SdrFillAttribute(
(double)nTransparence * 0.01,
aColor.getBColor(),
- pGradient, pHatch, pBitmap);
+ aGradient,
+ aHatch,
+ aBitmap);
}
}
- return pRetval;
+ return attribute::SdrFillAttribute();
}
// #i101508# Support handing over given text-to-border distances
- attribute::SdrTextAttribute* createNewSdrTextAttribute(
+ attribute::SdrTextAttribute createNewSdrTextAttribute(
const SfxItemSet& rSet,
const SdrText& rText,
const sal_Int32* pLeft,
@@ -479,7 +490,6 @@ namespace drawinglayer
const sal_Int32* pRight,
const sal_Int32* pLower)
{
- attribute::SdrTextAttribute* pRetval(0);
const SdrTextObj& rTextObj = rText.GetObject();
if(rText.GetOutlinerParaObject() && rText.GetModel())
@@ -519,7 +529,11 @@ namespace drawinglayer
const SdrFitToSizeType eFit(rTextObj.GetFitToSize());
const SdrTextAniKind eAniKind(rTextObj.GetTextAniKind());
- pRetval = new attribute::SdrTextAttribute(
+ // #i107346#
+ const SdrOutliner& rDrawTextOutliner = rText.GetModel()->GetDrawOutliner(&rTextObj);
+ const bool bWrongSpell(rDrawTextOutliner.GetControlWord() & EE_CNTRL_ONLINESPELLING);
+
+ return attribute::SdrTextAttribute(
rText,
aOutlinerParaObject,
((const XFormTextStyleItem&)rSet.Get(XATTR_FORMTXTSTYLE)).GetValue(),
@@ -535,18 +549,19 @@ namespace drawinglayer
SDRTEXTANI_BLINK == eAniKind,
SDRTEXTANI_SCROLL == eAniKind || SDRTEXTANI_ALTERNATE == eAniKind || SDRTEXTANI_SLIDE == eAniKind,
bInEditMode,
- ((const SdrTextFixedCellHeightItem&)rSet.Get(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue());
+ ((const SdrTextFixedCellHeightItem&)rSet.Get(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue(),
+ bWrongSpell);
}
- return pRetval;
+ return attribute::SdrTextAttribute();
}
- attribute::FillGradientAttribute* createNewTransparenceGradientAttribute(const SfxItemSet& rSet)
+ attribute::FillGradientAttribute createNewTransparenceGradientAttribute(const SfxItemSet& rSet)
{
- attribute::FillGradientAttribute* pRetval = 0L;
const SfxPoolItem* pGradientItem;
- if(SFX_ITEM_SET == rSet.GetItemState(XATTR_FILLFLOATTRANSPARENCE, TRUE, &pGradientItem) && ((XFillFloatTransparenceItem*)pGradientItem)->IsEnabled())
+ if(SFX_ITEM_SET == rSet.GetItemState(XATTR_FILLFLOATTRANSPARENCE, TRUE, &pGradientItem)
+ && ((XFillFloatTransparenceItem*)pGradientItem)->IsEnabled())
{
// test if float transparence is completely transparent
const XGradient& rGradient = ((XFillFloatTransparenceItem*)pGradientItem)->GetGradientValue();
@@ -559,7 +574,7 @@ namespace drawinglayer
const double fStartLum(nStartLuminance / 255.0);
const double fEndLum(nEndLuminance / 255.0);
- pRetval = new attribute::FillGradientAttribute(
+ return attribute::FillGradientAttribute(
XGradientStyleToGradientStyle(rGradient.GetGradientStyle()),
(double)rGradient.GetBorder() * 0.01,
(double)rGradient.GetXOffset() * 0.01,
@@ -571,12 +586,11 @@ namespace drawinglayer
}
}
- return pRetval;
+ return attribute::FillGradientAttribute();
}
- attribute::SdrFillBitmapAttribute* createNewSdrFillBitmapAttribute(const SfxItemSet& rSet)
+ attribute::SdrFillBitmapAttribute createNewSdrFillBitmapAttribute(const SfxItemSet& rSet)
{
- attribute::SdrFillBitmapAttribute* pRetval(0L);
Bitmap aBitmap((((const XFillBitmapItem&)(rSet.Get(XATTR_FILLBITMAP))).GetBitmapValue()).GetBitmap());
// make sure it's not empty, use default instead
@@ -623,7 +637,7 @@ namespace drawinglayer
(double)((const SfxUInt16Item&) (rSet.Get(XATTR_FILLBMP_POSOFFSETX))).GetValue(),
(double)((const SfxUInt16Item&) (rSet.Get(XATTR_FILLBMP_POSOFFSETY))).GetValue());
- pRetval = new attribute::SdrFillBitmapAttribute(
+ return attribute::SdrFillBitmapAttribute(
aBitmap,
aSize,
aOffset,
@@ -632,252 +646,174 @@ namespace drawinglayer
((const SfxBoolItem&) (rSet.Get(XATTR_FILLBMP_TILE))).GetValue(),
((const SfxBoolItem&) (rSet.Get(XATTR_FILLBMP_STRETCH))).GetValue(),
((const SfxBoolItem&) (rSet.Get(XATTR_FILLBMP_SIZELOG))).GetValue());
-
- return pRetval;
}
- attribute::SdrShadowTextAttribute* createNewSdrShadowTextAttribute(const SfxItemSet& rSet, const SdrText& rText, bool bSuppressText)
+ attribute::SdrShadowTextAttribute createNewSdrShadowTextAttribute(
+ const SfxItemSet& rSet,
+ const SdrText* pText,
+ bool bSuppressText)
{
- attribute::SdrShadowTextAttribute* pRetval(0L);
- attribute::SdrShadowAttribute* pShadow(0L);
- attribute::SdrTextAttribute* pText(0L);
+ attribute::SdrTextAttribute aText;
// #i98072# added option to suppress text
// look for text first
- if(!bSuppressText)
+ if(!bSuppressText && pText)
{
- pText = createNewSdrTextAttribute(rSet, rText);
+ aText = createNewSdrTextAttribute(rSet, *pText);
}
// try shadow
- pShadow = createNewSdrShadowAttribute(rSet);
-
- if(pShadow && !pShadow->isVisible())
- {
- delete pShadow;
- pShadow = 0L;
- }
-
- if(pText || pShadow)
- {
- pRetval = new attribute::SdrShadowTextAttribute(pShadow, pText);
- }
+ const attribute::SdrShadowAttribute aShadow(createNewSdrShadowAttribute(rSet));
- return pRetval;
+ return attribute::SdrShadowTextAttribute(aShadow, aText);
}
- attribute::SdrLineShadowTextAttribute* createNewSdrLineShadowTextAttribute(const SfxItemSet& rSet, const SdrText& rText)
+ attribute::SdrLineShadowTextAttribute createNewSdrLineShadowTextAttribute(
+ const SfxItemSet& rSet,
+ const SdrText* pText)
{
- attribute::SdrLineShadowTextAttribute* pRetval(0L);
- attribute::SdrLineAttribute* pLine(0L);
- attribute::SdrLineStartEndAttribute* pLineStartEnd(0L);
- attribute::SdrShadowAttribute* pShadow(0L);
- attribute::SdrTextAttribute* pText(0L);
+ attribute::SdrLineAttribute aLine;
+ attribute::SdrLineStartEndAttribute aLineStartEnd;
+ attribute::SdrTextAttribute aText;
bool bFontworkHideContour(false);
// look for text first
- pText = createNewSdrTextAttribute(rSet, rText);
-
- // when object has text and text is fontwork and hide contour is set for fontwork, force
- // line and fill style to empty
- if(pText && pText->getSdrFormTextAttribute() && pText->isHideContour())
+ if(pText)
{
- bFontworkHideContour = true;
+ aText = createNewSdrTextAttribute(rSet, *pText);
+
+ // when object has text and text is fontwork and hide contour is set for fontwork, force
+ // line and fill style to empty
+ if(!aText.isDefault()
+ && !aText.getSdrFormTextAttribute().isDefault()
+ && aText.isHideContour())
+ {
+ bFontworkHideContour = true;
+ }
}
// try line style
if(!bFontworkHideContour)
{
- pLine = createNewSdrLineAttribute(rSet);
+ aLine = createNewSdrLineAttribute(rSet);
- if(pLine && !pLine->isVisible())
- {
- delete pLine;
- pLine = 0L;
- }
-
- if(pLine)
+ if(!aLine.isDefault())
{
// try LineStartEnd
- pLineStartEnd = createNewSdrLineStartEndAttribute(rSet, pLine->getWidth());
-
- if(pLineStartEnd && !pLineStartEnd->isVisible())
- {
- delete pLineStartEnd;
- pLineStartEnd = 0L;
- }
+ aLineStartEnd = createNewSdrLineStartEndAttribute(rSet, aLine.getWidth());
}
}
- // try shadow
- if(pLine || pText)
+ if(!aLine.isDefault() || !aText.isDefault())
{
- pShadow = createNewSdrShadowAttribute(rSet);
+ // try shadow
+ const attribute::SdrShadowAttribute aShadow(createNewSdrShadowAttribute(rSet));
- if(pShadow && !pShadow->isVisible())
- {
- delete pShadow;
- pShadow = 0L;
- }
+ return attribute::SdrLineShadowTextAttribute(aLine, aLineStartEnd, aShadow, aText);
}
- if(pLine || pText)
- {
- pRetval = new attribute::SdrLineShadowTextAttribute(pLine, pLineStartEnd, pShadow, pText);
- }
-
- return pRetval;
+ return attribute::SdrLineShadowTextAttribute();
}
- attribute::SdrLineFillShadowTextAttribute* createNewSdrLineFillShadowTextAttribute(const SfxItemSet& rSet, const SdrText& rText)
+ attribute::SdrLineFillShadowTextAttribute createNewSdrLineFillShadowTextAttribute(
+ const SfxItemSet& rSet,
+ const SdrText* pText)
{
- attribute::SdrLineFillShadowTextAttribute* pRetval(0L);
- attribute::SdrLineAttribute* pLine(0L);
- attribute::SdrFillAttribute* pFill(0L);
- attribute::SdrLineStartEndAttribute* pLineStartEnd(0L);
- attribute::SdrShadowAttribute* pShadow(0L);
- attribute::FillGradientAttribute* pFillFloatTransGradient(0L);
- attribute::SdrTextAttribute* pText(0L);
+ attribute::SdrLineAttribute aLine;
+ attribute::SdrFillAttribute aFill;
+ attribute::SdrLineStartEndAttribute aLineStartEnd;
+ attribute::SdrShadowAttribute aShadow;
+ attribute::FillGradientAttribute aFillFloatTransGradient;
+ attribute::SdrTextAttribute aText;
bool bFontworkHideContour(false);
// look for text first
- pText = createNewSdrTextAttribute(rSet, rText);
-
- // when object has text and text is fontwork and hide contour is set for fontwork, force
- // line and fill style to empty
- if(pText && pText->getSdrFormTextAttribute() && pText->isHideContour())
+ if(pText)
{
- bFontworkHideContour = true;
- }
-
- // try line style
- if(!bFontworkHideContour)
- {
- pLine = createNewSdrLineAttribute(rSet);
-
- if(pLine && !pLine->isVisible())
- {
- delete pLine;
- pLine = 0L;
- }
+ aText = createNewSdrTextAttribute(rSet, *pText);
- if(pLine)
+ // when object has text and text is fontwork and hide contour is set for fontwork, force
+ // line and fill style to empty
+ if(!aText.getSdrFormTextAttribute().isDefault() && aText.isHideContour())
{
- // try LineStartEnd
- pLineStartEnd = createNewSdrLineStartEndAttribute(rSet, pLine->getWidth());
-
- if(pLineStartEnd && !pLineStartEnd->isVisible())
- {
- delete pLineStartEnd;
- pLineStartEnd = 0L;
- }
+ bFontworkHideContour = true;
}
}
- // try fill style
if(!bFontworkHideContour)
{
- pFill = createNewSdrFillAttribute(rSet);
+ // try line style
+ aLine = createNewSdrLineAttribute(rSet);
- if(pFill && !pFill->isVisible())
+ if(!aLine.isDefault())
{
- delete pFill;
- pFill = 0L;
+ // try LineStartEnd
+ aLineStartEnd = createNewSdrLineStartEndAttribute(rSet, aLine.getWidth());
}
- if(pFill)
+ // try fill style
+ aFill = createNewSdrFillAttribute(rSet);
+
+ if(!aFill.isDefault())
{
// try fillfloattransparence
- pFillFloatTransGradient = createNewTransparenceGradientAttribute(rSet);
+ aFillFloatTransGradient = createNewTransparenceGradientAttribute(rSet);
}
}
- // try shadow
- if(pLine || pFill || pText)
+ if(!aLine.isDefault() || !aFill.isDefault() || !aText.isDefault())
{
- pShadow = createNewSdrShadowAttribute(rSet);
+ // try shadow
+ aShadow = createNewSdrShadowAttribute(rSet);
- if(pShadow && !pShadow->isVisible())
- {
- delete pShadow;
- pShadow = 0L;
- }
+ return attribute::SdrLineFillShadowTextAttribute(
+ aLine, aFill, aLineStartEnd, aShadow, aFillFloatTransGradient, aText);
}
- if(pLine || pFill || pText)
- {
- pRetval = new attribute::SdrLineFillShadowTextAttribute(pLine, pFill, pLineStartEnd, pShadow, pFillFloatTransGradient, pText);
- }
-
- return pRetval;
+ return attribute::SdrLineFillShadowTextAttribute();
}
- attribute::SdrLineFillShadowAttribute* createNewSdrLineFillShadowAttribute(const SfxItemSet& rSet, bool bSuppressFill)
+ attribute::SdrLineFillShadowAttribute3D createNewSdrLineFillShadowAttribute(const SfxItemSet& rSet, bool bSuppressFill)
{
- attribute::SdrLineFillShadowAttribute* pRetval(0L);
- attribute::SdrLineAttribute* pLine(0L);
- attribute::SdrFillAttribute* pFill(0L);
- attribute::SdrLineStartEndAttribute* pLineStartEnd(0L);
- attribute::SdrShadowAttribute* pShadow(0L);
- attribute::FillGradientAttribute* pFillFloatTransGradient(0L);
+ attribute::SdrFillAttribute aFill;
+ attribute::SdrLineStartEndAttribute aLineStartEnd;
+ attribute::SdrShadowAttribute aShadow;
+ attribute::FillGradientAttribute aFillFloatTransGradient;
// try line style
- pLine = createNewSdrLineAttribute(rSet);
+ const attribute::SdrLineAttribute aLine(createNewSdrLineAttribute(rSet));
- if(pLine && !pLine->isVisible())
- {
- delete pLine;
- pLine = 0L;
- }
-
- if(pLine)
+ if(!aLine.isDefault())
{
// try LineStartEnd
- pLineStartEnd = createNewSdrLineStartEndAttribute(rSet, pLine->getWidth());
-
- if(pLineStartEnd && !pLineStartEnd->isVisible())
- {
- delete pLineStartEnd;
- pLineStartEnd = 0L;
- }
+ aLineStartEnd = createNewSdrLineStartEndAttribute(rSet, aLine.getWidth());
}
// try fill style
- pFill = bSuppressFill ? 0 : createNewSdrFillAttribute(rSet);
-
- if(pFill && !pFill->isVisible())
+ if(!bSuppressFill)
{
- delete pFill;
- pFill = 0L;
- }
-
- if(pFill)
- {
- // try fillfloattransparence
- pFillFloatTransGradient = createNewTransparenceGradientAttribute(rSet);
- }
+ aFill = createNewSdrFillAttribute(rSet);
- // try shadow
- if(pLine || pFill)
- {
- pShadow = createNewSdrShadowAttribute(rSet);
-
- if(pShadow && !pShadow->isVisible())
+ if(!aFill.isDefault())
{
- delete pShadow;
- pShadow = 0L;
+ // try fillfloattransparence
+ aFillFloatTransGradient = createNewTransparenceGradientAttribute(rSet);
}
}
- if(pLine || pFill)
+ if(!aLine.isDefault() || !aFill.isDefault())
{
- pRetval = new attribute::SdrLineFillShadowAttribute(pLine, pFill, pLineStartEnd, pShadow, pFillFloatTransGradient);
+ // try shadow
+ aShadow = createNewSdrShadowAttribute(rSet);
+
+ return attribute::SdrLineFillShadowAttribute3D(
+ aLine, aFill, aLineStartEnd, aShadow, aFillFloatTransGradient);
}
- return pRetval;
+ return attribute::SdrLineFillShadowAttribute3D();
}
- attribute::SdrSceneAttribute* createNewSdrSceneAttribute(const SfxItemSet& rSet)
+ attribute::SdrSceneAttribute createNewSdrSceneAttribute(const SfxItemSet& rSet)
{
// get perspective
::com::sun::star::drawing::ProjectionMode aProjectionMode(::com::sun::star::drawing::ProjectionMode_PARALLEL);
@@ -914,10 +850,10 @@ namespace drawinglayer
// get two sided lighting
const bool bTwoSidedLighting(((const Svx3DTwoSidedLightingItem&)rSet.Get(SDRATTR_3DSCENE_TWO_SIDED_LIGHTING)).GetValue());
- return new attribute::SdrSceneAttribute(fDistance, fShadowSlant, aProjectionMode, aShadeMode, bTwoSidedLighting);
+ return attribute::SdrSceneAttribute(fDistance, fShadowSlant, aProjectionMode, aShadeMode, bTwoSidedLighting);
}
- attribute::SdrLightingAttribute* createNewSdrLightingAttribute(const SfxItemSet& rSet)
+ attribute::SdrLightingAttribute createNewSdrLightingAttribute(const SfxItemSet& rSet)
{
// extract lights from given SfxItemSet (from scene)
::std::vector< attribute::Sdr3DLightAttribute > aLightVector;
@@ -982,7 +918,7 @@ namespace drawinglayer
const Color aAmbientValue(((const Svx3DAmbientcolorItem&)rSet.Get(SDRATTR_3DSCENE_AMBIENTCOLOR)).GetValue());
const basegfx::BColor aAmbientLight(aAmbientValue.getBColor());
- return new attribute::SdrLightingAttribute(aAmbientLight, aLightVector);
+ return attribute::SdrLightingAttribute(aAmbientLight, aLightVector);
}
void calculateRelativeCornerRadius(sal_Int32 nRadius, const basegfx::B2DRange& rObjectRange, double& rfCornerRadiusX, double& rfCornerRadiusY)
@@ -1039,57 +975,50 @@ namespace drawinglayer
}
// #i101508# Support handing over given text-to-border distances
- attribute::SdrFillTextAttribute* createNewSdrFillTextAttribute(
+ attribute::SdrFillTextAttribute createNewSdrFillTextAttribute(
const SfxItemSet& rSet,
- const SdrText* pSdrText,
+ const SdrText* pText,
const sal_Int32* pLeft,
const sal_Int32* pUpper,
const sal_Int32* pRight,
const sal_Int32* pLower)
{
- attribute::SdrFillTextAttribute* pRetval(0L);
- attribute::SdrFillAttribute* pFill(0L);
- attribute::FillGradientAttribute* pFillFloatTransGradient(0L);
- attribute::SdrTextAttribute* pText(0L);
+ attribute::SdrFillAttribute aFill;
+ attribute::FillGradientAttribute aFillFloatTransGradient;
+ attribute::SdrTextAttribute aText;
bool bFontworkHideContour(false);
// look for text first
- if(pSdrText)
+ if(pText)
{
- pText = createNewSdrTextAttribute(rSet, *pSdrText, pLeft, pUpper, pRight, pLower);
- }
+ aText = createNewSdrTextAttribute(rSet, *pText, pLeft, pUpper, pRight, pLower);
- // when object has text and text is fontwork and hide contour is set for fontwork, force
- // fill style to empty
- if(pText && pText->getSdrFormTextAttribute() && pText->isHideContour())
- {
- bFontworkHideContour = true;
+ // when object has text and text is fontwork and hide contour is set for fontwork, force
+ // fill style to empty
+ if(!aText.getSdrFormTextAttribute().isDefault() && aText.isHideContour())
+ {
+ bFontworkHideContour = true;
+ }
}
- // try fill style
if(!bFontworkHideContour)
{
- pFill = createNewSdrFillAttribute(rSet);
-
- if(pFill && !pFill->isVisible())
- {
- delete pFill;
- pFill = 0L;
- }
+ // try fill style
+ aFill = createNewSdrFillAttribute(rSet);
- if(pFill)
+ if(!aFill.isDefault())
{
// try fillfloattransparence
- pFillFloatTransGradient = createNewTransparenceGradientAttribute(rSet);
+ aFillFloatTransGradient = createNewTransparenceGradientAttribute(rSet);
}
}
- if(pFill || pText)
+ if(!aFill.isDefault() || !aText.isDefault())
{
- pRetval = new attribute::SdrFillTextAttribute(pFill, pFillFloatTransGradient, pText);
+ return attribute::SdrFillTextAttribute(aFill, aFillFloatTransGradient, aText);
}
- return pRetval;
+ return attribute::SdrFillTextAttribute();
}
} // end of namespace primitive2d
diff --git a/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx
index f7c32f5040..b3ee43b883 100644
--- a/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx
@@ -31,7 +31,7 @@
#include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -46,7 +46,6 @@ namespace drawinglayer
Primitive2DSequence SdrCaptionPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const
{
Primitive2DSequence aRetval;
- Primitive2DSequence aHitTestContent;
// create unit outline polygon
const basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect(
@@ -55,68 +54,66 @@ namespace drawinglayer
getCornerRadiusY()));
// add fill
- if(getSdrLFSTAttribute().getFill())
+ if(getSdrLFSTAttribute().getFill().isDefault())
{
+ // create invisible fill for HitTest
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
- createPolyPolygonFillPrimitive(
- basegfx::B2DPolyPolygon(aUnitOutline),
- getTransform(),
- *getSdrLFSTAttribute().getFill(),
- getSdrLFSTAttribute().getFillFloatTransGradient()));
+ createHiddenGeometryPrimitives2D(
+ true,
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform()));
}
else
{
- // if no fill, create one for HitTest and BoundRect fallback
- appendPrimitive2DReferenceToPrimitive2DSequence(aHitTestContent,
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
createPolyPolygonFillPrimitive(
basegfx::B2DPolyPolygon(aUnitOutline),
getTransform(),
- attribute::SdrFillAttribute(0.0, basegfx::BColor(0.0, 0.0, 0.0)),
+ getSdrLFSTAttribute().getFill(),
getSdrLFSTAttribute().getFillFloatTransGradient()));
}
// add line
- if(getSdrLFSTAttribute().getLine())
+ if(getSdrLFSTAttribute().getLine().isDefault())
{
+ // create invisible line for HitTest/BoundRect
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
- createPolygonLinePrimitive(
- aUnitOutline,
- getTransform(),
- *getSdrLFSTAttribute().getLine()));
+ createHiddenGeometryPrimitives2D(
+ false,
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform()));
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
- createPolygonLinePrimitive(
- getTail(),
- getTransform(),
- *getSdrLFSTAttribute().getLine(),
- getSdrLFSTAttribute().getLineStartEnd()));
+ createHiddenGeometryPrimitives2D(
+ false,
+ basegfx::B2DPolyPolygon(getTail()),
+ getTransform()));
}
else
{
- // if initially no line is defined, create one for HitTest and BoundRect. It
- // is sufficient to use the tail; the body is already ensured with fill creation
- appendPrimitive2DReferenceToPrimitive2DSequence(aHitTestContent,
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
createPolygonLinePrimitive(
- getTail(),
+ aUnitOutline,
getTransform(),
- attribute::SdrLineAttribute(basegfx::BColor(0.0, 0.0, 0.0))));
- }
+ getSdrLFSTAttribute().getLine(),
+ attribute::SdrLineStartEndAttribute()));
- // add HitTest and BoundRect helper geometry (if exists)
- if(aHitTestContent.hasElements())
- {
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
- Primitive2DReference(new HitTestPrimitive2D(aHitTestContent)));
+ createPolygonLinePrimitive(
+ getTail(),
+ getTransform(),
+ getSdrLFSTAttribute().getLine(),
+ getSdrLFSTAttribute().getLineStartEnd()));
}
// add text
- if(getSdrLFSTAttribute().getText())
+ if(!getSdrLFSTAttribute().getText().isDefault())
{
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
createTextPrimitive(
basegfx::B2DPolyPolygon(aUnitOutline),
getTransform(),
- *getSdrLFSTAttribute().getText(),
+ getSdrLFSTAttribute().getText(),
getSdrLFSTAttribute().getLine(),
false,
false,
@@ -124,9 +121,9 @@ namespace drawinglayer
}
// add shadow
- if(getSdrLFSTAttribute().getShadow())
+ if(!getSdrLFSTAttribute().getShadow().isDefault())
{
- aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow());
+ aRetval = createEmbeddedShadowPrimitive(aRetval, getSdrLFSTAttribute().getShadow());
}
return aRetval;
diff --git a/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx
index e4e0c68d6d..2d0148744b 100644
--- a/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx
@@ -31,7 +31,8 @@
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -47,34 +48,45 @@ namespace drawinglayer
{
Primitive2DSequence aRetval;
- // prepare unit transform
- ::basegfx::B2DHomMatrix aEmptyMatrix;
-
// add line
- if(getSdrLSTAttribute().getLine())
+ if(getSdrLSTAttribute().getLine().isDefault())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(getUnitPolygon(), aEmptyMatrix, *getSdrLSTAttribute().getLine(), getSdrLSTAttribute().getLineStartEnd()));
+ // create invisible line for HitTest/BoundRect
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createHiddenGeometryPrimitives2D(
+ false,
+ basegfx::B2DPolyPolygon(getUnitPolygon())));
}
else
{
- // if initially no line is defined, create one for HitTest and BoundRect
- const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0));
- const Primitive2DReference xHiddenLineReference(createPolygonLinePrimitive(getUnitPolygon(), aEmptyMatrix, aBlackHairline));
- const Primitive2DSequence xHiddenLineSequence(&xHiddenLineReference, 1);
-
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(xHiddenLineSequence)));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolygonLinePrimitive(
+ getUnitPolygon(),
+ basegfx::B2DHomMatrix(),
+ getSdrLSTAttribute().getLine(),
+ getSdrLSTAttribute().getLineStartEnd()));
}
// add text
- if(getSdrLSTAttribute().getText())
+ if(!getSdrLSTAttribute().getText().isDefault())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(::basegfx::B2DPolyPolygon(getUnitPolygon()), aEmptyMatrix, *getSdrLSTAttribute().getText(), getSdrLSTAttribute().getLine(), false, false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createTextPrimitive(
+ basegfx::B2DPolyPolygon(getUnitPolygon()),
+ basegfx::B2DHomMatrix(),
+ getSdrLSTAttribute().getText(),
+ getSdrLSTAttribute().getLine(),
+ false,
+ false,
+ false));
}
// add shadow
- if(getSdrLSTAttribute().getShadow())
+ if(!getSdrLSTAttribute().getShadow().isDefault())
{
- aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLSTAttribute().getShadow());
+ aRetval = createEmbeddedShadowPrimitive(
+ aRetval,
+ getSdrLSTAttribute().getShadow());
}
return aRetval;
diff --git a/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx
index 4359d8b7fe..d3aab33c98 100644
--- a/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx
@@ -32,6 +32,7 @@
#include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
+#include <drawinglayer/attribute/sdrlineattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -48,21 +49,23 @@ namespace drawinglayer
Primitive2DSequence aRetval(getSubPrimitives());
// add text
- if(getSdrSTAttribute().getText())
+ if(!getSdrSTAttribute().getText().isDefault())
{
- const basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(
- basegfx::B2DPolyPolygon(aUnitOutline),
- getTextBox(),
- *getSdrSTAttribute().getText(),
- 0,
- false,
- getWordWrap(),
- isForceTextClipToTextRange()));
+ const basegfx::B2DPolygon aUnitOutline(basegfx::tools::createUnitPolygon());
+
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createTextPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTextBox(),
+ getSdrSTAttribute().getText(),
+ attribute::SdrLineAttribute(),
+ false,
+ getWordWrap(),
+ isForceTextClipToTextRange()));
}
// add shadow
- if(aRetval.hasElements() && getSdrSTAttribute().getShadow())
+ if(aRetval.hasElements() && !getSdrSTAttribute().getShadow().isDefault())
{
// #i105323# add generic shadow only for 2D shapes. For
// 3D shapes shadow will be set at the individual created
@@ -76,7 +79,7 @@ namespace drawinglayer
// shadow will be correct (using ColorModifierStack), but expensive.
if(!get3DShape())
{
- aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrSTAttribute().getShadow());
+ aRetval = createEmbeddedShadowPrimitive(aRetval, getSdrSTAttribute().getShadow());
}
}
diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
index bc8d928f7b..bccf3afc99 100644
--- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
+++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
@@ -27,12 +27,10 @@
#include "precompiled_svx.hxx"
#include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
-#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
-#include <drawinglayer/primitive2d/alphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
+#include <drawinglayer/primitive2d/transparenceprimitive2d.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <drawinglayer/primitive2d/fillgradientprimitive2d.hxx>
#include <drawinglayer/attribute/strokeattribute.hxx>
@@ -51,6 +49,10 @@
#include <basegfx/tools/canvastools.hxx>
#include <drawinglayer/geometry/viewinformation2d.hxx>
#include <drawinglayer/primitive2d/texthierarchyprimitive2d.hxx>
+#include <drawinglayer/attribute/sdrfillattribute.hxx>
+#include <drawinglayer/attribute/sdrlineattribute.hxx>
+#include <drawinglayer/attribute/sdrlinestartendattribute.hxx>
+#include <drawinglayer/attribute/sdrshadowattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -66,25 +68,25 @@ namespace drawinglayer
const basegfx::B2DPolyPolygon& rUnitPolyPolygon,
const basegfx::B2DHomMatrix& rObjectTransform,
const attribute::SdrFillAttribute& rFill,
- const attribute::FillGradientAttribute* pFillGradient)
+ const attribute::FillGradientAttribute& rFillGradient)
{
// prepare fully scaled polygon
basegfx::B2DPolyPolygon aScaledPolyPolygon(rUnitPolyPolygon);
aScaledPolyPolygon.transform(rObjectTransform);
BasePrimitive2D* pNewFillPrimitive = 0;
- if(rFill.isGradient())
+ if(!rFill.getGradient().isDefault())
{
- pNewFillPrimitive = new PolyPolygonGradientPrimitive2D(aScaledPolyPolygon, *rFill.getGradient());
+ pNewFillPrimitive = new PolyPolygonGradientPrimitive2D(aScaledPolyPolygon, rFill.getGradient());
}
- else if(rFill.isHatch())
+ else if(!rFill.getHatch().isDefault())
{
- pNewFillPrimitive = new PolyPolygonHatchPrimitive2D(aScaledPolyPolygon, rFill.getColor(), *rFill.getHatch());
+ pNewFillPrimitive = new PolyPolygonHatchPrimitive2D(aScaledPolyPolygon, rFill.getColor(), rFill.getHatch());
}
- else if(rFill.isBitmap())
+ else if(!rFill.getBitmap().isDefault())
{
const basegfx::B2DRange aRange(basegfx::tools::getRange(aScaledPolyPolygon));
- pNewFillPrimitive = new PolyPolygonBitmapPrimitive2D(aScaledPolyPolygon, rFill.getBitmap()->getFillBitmapAttribute(aRange));
+ pNewFillPrimitive = new PolyPolygonBitmapPrimitive2D(aScaledPolyPolygon, rFill.getBitmap().getFillBitmapAttribute(aRange));
}
else
{
@@ -96,9 +98,9 @@ namespace drawinglayer
// create simpleTransparencePrimitive, add created fill primitive
const Primitive2DReference xRefA(pNewFillPrimitive);
const Primitive2DSequence aContent(&xRefA, 1L);
- return Primitive2DReference(new UnifiedAlphaPrimitive2D(aContent, rFill.getTransparence()));
+ return Primitive2DReference(new UnifiedTransparencePrimitive2D(aContent, rFill.getTransparence()));
}
- else if(pFillGradient)
+ else if(!rFillGradient.isDefault())
{
// create sequence with created fill primitive
const Primitive2DReference xRefA(pNewFillPrimitive);
@@ -107,11 +109,11 @@ namespace drawinglayer
// create FillGradientPrimitive2D for transparence and add to new sequence
// fillGradientPrimitive is enough here (compared to PolyPolygonGradientPrimitive2D) since float transparence will be masked anyways
const basegfx::B2DRange aRange(basegfx::tools::getRange(aScaledPolyPolygon));
- const Primitive2DReference xRefB(new FillGradientPrimitive2D(aRange, *pFillGradient));
+ const Primitive2DReference xRefB(new FillGradientPrimitive2D(aRange, rFillGradient));
const Primitive2DSequence aAlpha(&xRefB, 1L);
- // create AlphaPrimitive2D using alpha and content
- return Primitive2DReference(new AlphaPrimitive2D(aContent, aAlpha));
+ // create TransparencePrimitive2D using alpha and content
+ return Primitive2DReference(new TransparencePrimitive2D(aContent, aAlpha));
}
else
{
@@ -124,7 +126,7 @@ namespace drawinglayer
const basegfx::B2DPolygon& rUnitPolygon,
const basegfx::B2DHomMatrix& rObjectTransform,
const attribute::SdrLineAttribute& rLine,
- const attribute::SdrLineStartEndAttribute* pStroke)
+ const attribute::SdrLineStartEndAttribute& rStroke)
{
// prepare fully scaled polygon
basegfx::B2DPolygon aScaledPolygon(rUnitPolygon);
@@ -135,10 +137,10 @@ namespace drawinglayer
const attribute::StrokeAttribute aStrokeAttribute(rLine.getDotDashArray(), rLine.getFullDotDashLen());
BasePrimitive2D* pNewLinePrimitive = 0L;
- if(!rUnitPolygon.isClosed() && pStroke)
+ if(!rUnitPolygon.isClosed() && !rStroke.isDefault())
{
- attribute::LineStartEndAttribute aStart(pStroke->getStartWidth(), pStroke->getStartPolyPolygon(), pStroke->isStartCentered());
- attribute::LineStartEndAttribute aEnd(pStroke->getEndWidth(), pStroke->getEndPolyPolygon(), pStroke->isEndCentered());
+ attribute::LineStartEndAttribute aStart(rStroke.getStartWidth(), rStroke.getStartPolyPolygon(), rStroke.isStartCentered());
+ attribute::LineStartEndAttribute aEnd(rStroke.getEndWidth(), rStroke.getEndPolyPolygon(), rStroke.isEndCentered());
// create data
pNewLinePrimitive = new PolygonStrokeArrowPrimitive2D(aScaledPolygon, aLineAttribute, aStrokeAttribute, aStart, aEnd);
@@ -154,7 +156,7 @@ namespace drawinglayer
// create simpleTransparencePrimitive, add created fill primitive
const Primitive2DReference xRefA(pNewLinePrimitive);
const Primitive2DSequence aContent(&xRefA, 1L);
- return Primitive2DReference(new UnifiedAlphaPrimitive2D(aContent, rLine.getTransparence()));
+ return Primitive2DReference(new UnifiedTransparencePrimitive2D(aContent, rLine.getTransparence()));
}
else
{
@@ -167,7 +169,7 @@ namespace drawinglayer
const basegfx::B2DPolyPolygon& rUnitPolyPolygon,
const basegfx::B2DHomMatrix& rObjectTransform,
const attribute::SdrTextAttribute& rText,
- const attribute::SdrLineAttribute* pStroke,
+ const attribute::SdrLineAttribute& rStroke,
bool bCellText,
bool bWordWrap,
bool bClipOnBounds)
@@ -178,7 +180,7 @@ namespace drawinglayer
if(rText.isContour())
{
// contour text
- if(pStroke && 0.0 != pStroke->getWidth())
+ if(!rStroke.isDefault() && 0.0 != rStroke.getWidth())
{
// take line width into account and shrink contour polygon accordingly
// decompose to get scale
@@ -193,7 +195,7 @@ namespace drawinglayer
fabs(aScale.getX()), fabs(aScale.getY())));
// grow the polygon. To shrink, use negative value (half width)
- aScaledUnitPolyPolygon = basegfx::tools::growInNormalDirection(aScaledUnitPolyPolygon, -(pStroke->getWidth() * 0.5));
+ aScaledUnitPolyPolygon = basegfx::tools::growInNormalDirection(aScaledUnitPolyPolygon, -(rStroke.getWidth() * 0.5));
// scale back to unit polygon
aScaledUnitPolyPolygon.transform(basegfx::tools::createScaleB2DHomMatrix(
@@ -217,7 +219,7 @@ namespace drawinglayer
rObjectTransform);
}
}
- else if(rText.getSdrFormTextAttribute())
+ else if(!rText.getSdrFormTextAttribute().isDefault())
{
// text on path, use scaled polygon
basegfx::B2DPolyPolygon aScaledPolyPolygon(rUnitPolyPolygon);
@@ -226,7 +228,7 @@ namespace drawinglayer
&rText.getSdrText(),
rText.getOutlinerParaObject(),
aScaledPolyPolygon,
- *rText.getSdrFormTextAttribute());
+ rText.getSdrFormTextAttribute());
}
else
{
@@ -323,7 +325,7 @@ namespace drawinglayer
if(rText.isScroll())
{
// suppress scroll when FontWork
- if(!rText.getSdrFormTextAttribute())
+ if(rText.getSdrFormTextAttribute().isDefault())
{
// get scroll direction
const SdrTextAniDirection eDirection(rText.getSdrText().GetObject().GetTextAniDirection());
@@ -464,7 +466,7 @@ namespace drawinglayer
const Primitive2DSequence aTempContent(&aRetval[0], 1);
aRetval[0] = Primitive2DReference(
- new UnifiedAlphaPrimitive2D(
+ new UnifiedTransparencePrimitive2D(
aTempContent,
rShadow.getTransparence()));
}
diff --git a/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx
index 0ad7c86810..8c78c51ea5 100644
--- a/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx
@@ -32,10 +32,9 @@
#include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
#include <basegfx/color/bcolor.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -55,52 +54,73 @@ namespace drawinglayer
// Do use createPolygonFromUnitCircle, but let create from first quadrant to mimic old geometry creation.
// This is needed to have the same look when stroke is used since the polygon start point defines the
// stroke start, too.
- ::basegfx::B2DPolygon aUnitOutline(::basegfx::tools::createPolygonFromUnitCircle(1));
+ basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromUnitCircle(1));
// scale and move UnitEllipse to UnitObject (-1,-1 1,1) -> (0,0 1,1)
- const basegfx::B2DHomMatrix aUnitCorrectionMatrix(basegfx::tools::createScaleTranslateB2DHomMatrix(0.5, 0.5, 0.5, 0.5));
+ const basegfx::B2DHomMatrix aUnitCorrectionMatrix(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(0.5, 0.5, 0.5, 0.5));
// apply to the geometry
aUnitOutline.transform(aUnitCorrectionMatrix);
// add fill
- if(getSdrLFSTAttribute().getFill())
+ if(!getSdrLFSTAttribute().getFill().isDefault())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolyPolygonFillPrimitive(::basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getFill(), getSdrLFSTAttribute().getFillFloatTransGradient()));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolyPolygonFillPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform(),
+ getSdrLFSTAttribute().getFill(),
+ getSdrLFSTAttribute().getFillFloatTransGradient()));
}
// add line
- if(getSdrLFSTAttribute().getLine())
+ if(getSdrLFSTAttribute().getLine().isDefault())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aUnitOutline, getTransform(), *getSdrLFSTAttribute().getLine()));
+ // create invisible line for HitTest/BoundRect
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createHiddenGeometryPrimitives2D(
+ false,
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform()));
}
else
{
- // if initially no line is defined, create one for HitTest and BoundRect
- const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0));
- const Primitive2DReference xHiddenLineReference(createPolygonLinePrimitive(aUnitOutline, getTransform(), aBlackHairline));
- const Primitive2DSequence xHiddenLineSequence(&xHiddenLineReference, 1);
-
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(xHiddenLineSequence)));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolygonLinePrimitive(
+ aUnitOutline,
+ getTransform(),
+ getSdrLFSTAttribute().getLine(),
+ attribute::SdrLineStartEndAttribute()));
}
// add text
- if(getSdrLFSTAttribute().getText())
+ if(!getSdrLFSTAttribute().getText().isDefault())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(::basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false, false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createTextPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform(),
+ getSdrLFSTAttribute().getText(),
+ getSdrLFSTAttribute().getLine(),
+ false,
+ false,
+ false));
}
// add shadow
- if(getSdrLFSTAttribute().getShadow())
+ if(!getSdrLFSTAttribute().getShadow().isDefault())
{
- aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow());
+ aRetval = createEmbeddedShadowPrimitive(
+ aRetval,
+ getSdrLFSTAttribute().getShadow());
}
return aRetval;
}
SdrEllipsePrimitive2D::SdrEllipsePrimitive2D(
- const ::basegfx::B2DHomMatrix& rTransform,
+ const basegfx::B2DHomMatrix& rTransform,
const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute)
: BufferedDecompositionPrimitive2D(),
maTransform(rTransform),
@@ -138,7 +158,7 @@ namespace drawinglayer
Primitive2DSequence aRetval;
// create unit outline polygon
- ::basegfx::B2DPolygon aUnitOutline(::basegfx::tools::createPolygonFromUnitEllipseSegment(mfStartAngle, mfEndAngle));
+ basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromUnitEllipseSegment(mfStartAngle, mfEndAngle));
if(mbCloseSegment)
{
@@ -146,57 +166,77 @@ namespace drawinglayer
{
// for compatibility, insert the center point at polygon start to get the same
// line stroking pattern as the old painting mechanisms.
- aUnitOutline.insert(0L, ::basegfx::B2DPoint(0.0, 0.0));
+ aUnitOutline.insert(0L, basegfx::B2DPoint(0.0, 0.0));
}
aUnitOutline.setClosed(true);
}
// move and scale UnitEllipse to UnitObject (-1,-1 1,1) -> (0,0 1,1)
- basegfx::B2DHomMatrix aUnitCorrectionMatrix(basegfx::tools::createTranslateB2DHomMatrix(1.0, 1.0));
- aUnitCorrectionMatrix.scale(0.5, 0.5);
+ const basegfx::B2DHomMatrix aUnitCorrectionMatrix(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(0.5, 0.5, 0.5, 0.5));
// apply to the geometry
aUnitOutline.transform(aUnitCorrectionMatrix);
// add fill
- if(getSdrLFSTAttribute().getFill() && aUnitOutline.isClosed())
+ if(!getSdrLFSTAttribute().getFill().isDefault() && aUnitOutline.isClosed())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolyPolygonFillPrimitive(::basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getFill(), getSdrLFSTAttribute().getFillFloatTransGradient()));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolyPolygonFillPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform(),
+ getSdrLFSTAttribute().getFill(),
+ getSdrLFSTAttribute().getFillFloatTransGradient()));
}
// add line
- if(getSdrLFSTAttribute().getLine())
+ if(getSdrLFSTAttribute().getLine().isDefault())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aUnitOutline, getTransform(), *getSdrLFSTAttribute().getLine(), getSdrLFSTAttribute().getLineStartEnd()));
+ // create invisible line for HitTest/BoundRect
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createHiddenGeometryPrimitives2D(
+ false,
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform()));
}
else
{
- // if initially no line is defined, create one for HitTest and BoundRect
- const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0));
- const Primitive2DReference xHiddenLineReference(createPolygonLinePrimitive(aUnitOutline, getTransform(), aBlackHairline));
- const Primitive2DSequence xHiddenLineSequence(&xHiddenLineReference, 1);
-
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(xHiddenLineSequence)));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolygonLinePrimitive(
+ aUnitOutline,
+ getTransform(),
+ getSdrLFSTAttribute().getLine(),
+ getSdrLFSTAttribute().getLineStartEnd()));
}
// add text
- if(getSdrLFSTAttribute().getText())
+ if(!getSdrLFSTAttribute().getText().isDefault())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(::basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false, false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createTextPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform(),
+ getSdrLFSTAttribute().getText(),
+ getSdrLFSTAttribute().getLine(),
+ false,
+ false,
+ false));
}
// add shadow
- if(getSdrLFSTAttribute().getShadow())
+ if(!getSdrLFSTAttribute().getShadow().isDefault())
{
- aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow());
+ aRetval = createEmbeddedShadowPrimitive(
+ aRetval,
+ getSdrLFSTAttribute().getShadow());
}
return aRetval;
}
SdrEllipseSegmentPrimitive2D::SdrEllipseSegmentPrimitive2D(
- const ::basegfx::B2DHomMatrix& rTransform,
+ const basegfx::B2DHomMatrix& rTransform,
const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute,
double fStartAngle,
double fEndAngle,
diff --git a/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx
index 9ef9aba423..e7428ede50 100644
--- a/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx
@@ -32,7 +32,8 @@
#include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -45,21 +46,25 @@ namespace drawinglayer
Primitive2DSequence aRetval;
// create unit outline polygon
- basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ basegfx::B2DPolygon aUnitOutline(basegfx::tools::createUnitPolygon());
// add fill, but only when graphic ist transparent
- if(getSdrLFSTAttribute().getFill() && isTransparent())
+ if(!getSdrLFSTAttribute().getFill().isDefault() && isTransparent())
{
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
- createPolyPolygonFillPrimitive(basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getFill(), getSdrLFSTAttribute().getFillFloatTransGradient()));
+ createPolyPolygonFillPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform(),
+ getSdrLFSTAttribute().getFill(),
+ getSdrLFSTAttribute().getFillFloatTransGradient()));
}
// add line
- if(getSdrLFSTAttribute().getLine())
+ if(!getSdrLFSTAttribute().getLine().isDefault())
{
// if line width is given, polygon needs to be grown by half of it to make the
// outline to be outside of the bitmap
- if(0.0 != getSdrLFSTAttribute().getLine()->getWidth())
+ if(0.0 != getSdrLFSTAttribute().getLine().getWidth())
{
// decompose to get scale
basegfx::B2DVector aScale, aTranslate;
@@ -67,46 +72,61 @@ namespace drawinglayer
getTransform().decompose(aScale, aTranslate, fRotate, fShearX);
// create expanded range (add relative half line width to unit rectangle)
- double fHalfLineWidth(getSdrLFSTAttribute().getLine()->getWidth() * 0.5);
+ double fHalfLineWidth(getSdrLFSTAttribute().getLine().getWidth() * 0.5);
double fScaleX(0.0 != aScale.getX() ? fHalfLineWidth / fabs(aScale.getX()) : 1.0);
double fScaleY(0.0 != aScale.getY() ? fHalfLineWidth / fabs(aScale.getY()) : 1.0);
const basegfx::B2DRange aExpandedRange(-fScaleX, -fScaleY, 1.0 + fScaleX, 1.0 + fScaleY);
basegfx::B2DPolygon aExpandedUnitOutline(basegfx::tools::createPolygonFromRect(aExpandedRange));
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aExpandedUnitOutline, getTransform(), *getSdrLFSTAttribute().getLine()));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolygonLinePrimitive(
+ aExpandedUnitOutline,
+ getTransform(),
+ getSdrLFSTAttribute().getLine(),
+ attribute::SdrLineStartEndAttribute()));
}
else
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aUnitOutline, getTransform(), *getSdrLFSTAttribute().getLine()));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolygonLinePrimitive(
+ aUnitOutline, getTransform(),
+ getSdrLFSTAttribute().getLine(),
+ attribute::SdrLineStartEndAttribute()));
}
}
- else
- {
- // if initially no line is defined, create one for HitTest and BoundRect
- const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0));
- const Primitive2DReference xHiddenLineReference(createPolygonLinePrimitive(aUnitOutline, getTransform(), aBlackHairline));
- const Primitive2DSequence xHiddenLineSequence(&xHiddenLineReference, 1);
-
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(xHiddenLineSequence)));
- }
// add graphic content
if(255L != getGraphicAttr().GetTransparency())
{
- Primitive2DReference xGraphicContentPrimitive(new GraphicPrimitive2D(getTransform(), getGraphicObject(), getGraphicAttr()));
+ const Primitive2DReference xGraphicContentPrimitive(
+ new GraphicPrimitive2D(
+ getTransform(),
+ getGraphicObject(),
+ getGraphicAttr()));
+
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, xGraphicContentPrimitive);
}
// add text
- if(getSdrLFSTAttribute().getText())
+ if(!getSdrLFSTAttribute().getText().isDefault())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false, false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createTextPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform(),
+ getSdrLFSTAttribute().getText(),
+ getSdrLFSTAttribute().getLine(),
+ false,
+ false,
+ false));
}
// add shadow
- if(getSdrLFSTAttribute().getShadow())
+ if(!getSdrLFSTAttribute().getShadow().isDefault())
{
- aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow());
+ aRetval = createEmbeddedShadowPrimitive(
+ aRetval,
+ getSdrLFSTAttribute().getShadow());
}
return aRetval;
diff --git a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx
index 5ed2734071..5f7e3a047d 100644
--- a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx
@@ -35,8 +35,8 @@
#include <basegfx/tools/canvastools.hxx>
#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -56,36 +56,44 @@ namespace drawinglayer
bool bLeftActive,
bool bRightActive) const
{
- const attribute::SdrLineStartEndAttribute* pLineStartEnd = getSdrLSTAttribute().getLineStartEnd();
+ const attribute::SdrLineStartEndAttribute& rLineStartEnd = getSdrLSTAttribute().getLineStartEnd();
basegfx::B2DPolygon aPolygon;
aPolygon.append(rStart);
aPolygon.append(rEnd);
- if(!pLineStartEnd || (!bLeftActive && !bRightActive))
+ if(rLineStartEnd.isDefault() || (!bLeftActive && !bRightActive))
{
- return createPolygonLinePrimitive(aPolygon, rObjectMatrix, rLineAttribute, 0);
+ return createPolygonLinePrimitive(
+ aPolygon,
+ rObjectMatrix,
+ rLineAttribute,
+ attribute::SdrLineStartEndAttribute());
}
if(bLeftActive && bRightActive)
{
- return createPolygonLinePrimitive(aPolygon, rObjectMatrix, rLineAttribute, pLineStartEnd);
+ return createPolygonLinePrimitive(
+ aPolygon,
+ rObjectMatrix,
+ rLineAttribute,
+ rLineStartEnd);
}
const basegfx::B2DPolyPolygon aEmpty;
const attribute::SdrLineStartEndAttribute aLineStartEnd(
- bLeftActive ? pLineStartEnd->getStartPolyPolygon() : aEmpty, bRightActive ? pLineStartEnd->getEndPolyPolygon() : aEmpty,
- bLeftActive ? pLineStartEnd->getStartWidth() : 0.0, bRightActive ? pLineStartEnd->getEndWidth() : 0.0,
- bLeftActive ? pLineStartEnd->isStartActive() : false, bRightActive ? pLineStartEnd->isEndActive() : false,
- bLeftActive ? pLineStartEnd->isStartCentered() : false, bRightActive? pLineStartEnd->isEndCentered() : false);
+ bLeftActive ? rLineStartEnd.getStartPolyPolygon() : aEmpty, bRightActive ? rLineStartEnd.getEndPolyPolygon() : aEmpty,
+ bLeftActive ? rLineStartEnd.getStartWidth() : 0.0, bRightActive ? rLineStartEnd.getEndWidth() : 0.0,
+ bLeftActive ? rLineStartEnd.isStartActive() : false, bRightActive ? rLineStartEnd.isEndActive() : false,
+ bLeftActive ? rLineStartEnd.isStartCentered() : false, bRightActive? rLineStartEnd.isEndCentered() : false);
- return createPolygonLinePrimitive(aPolygon, rObjectMatrix, rLineAttribute, &aLineStartEnd);
+ return createPolygonLinePrimitive(aPolygon, rObjectMatrix, rLineAttribute, aLineStartEnd);
}
Primitive2DSequence SdrMeasurePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const
{
Primitive2DSequence aRetval;
- SdrBlockTextPrimitive2D* pBlockText = 0L;
+ SdrBlockTextPrimitive2D* pBlockText = 0;
basegfx::B2DRange aTextRange;
double fTextX((getStart().getX() + getEnd().getX()) * 0.5);
double fTextY((getStart().getX() + getEnd().getX()) * 0.5);
@@ -93,11 +101,13 @@ namespace drawinglayer
const double fDistance(aLine.getLength());
const double fAngle(atan2(aLine.getY(), aLine.getX()));
bool bAutoUpsideDown(false);
- const attribute::SdrTextAttribute* pTextAttribute = getSdrLSTAttribute().getText();
+ const attribute::SdrTextAttribute rTextAttribute = getSdrLSTAttribute().getText();
const basegfx::B2DHomMatrix aObjectMatrix(
basegfx::tools::createShearXRotateTranslateB2DHomMatrix(0.0, fAngle, getStart()));
- if(pTextAttribute)
+ // preapare text, but do not add yet; it needs to be aligned to
+ // the line geometry
+ if(!rTextAttribute.isDefault())
{
basegfx::B2DHomMatrix aTextMatrix;
double fTestAngle(fAngle);
@@ -123,58 +133,52 @@ namespace drawinglayer
// create primitive and get text range
pBlockText = new SdrBlockTextPrimitive2D(
- &pTextAttribute->getSdrText(),
- pTextAttribute->getOutlinerParaObject(),
+ &rTextAttribute.getSdrText(),
+ rTextAttribute.getOutlinerParaObject(),
aTextMatrix,
SDRTEXTHORZADJUST_CENTER,
SDRTEXTVERTADJUST_CENTER,
- pTextAttribute->isScroll(),
+ rTextAttribute.isScroll(),
false,
false,
false,
false);
+
aTextRange = pBlockText->getB2DRange(aViewInformation);
}
// prepare line attribute and result
- const attribute::SdrLineAttribute* pLineAttribute(getSdrLSTAttribute().getLine());
-
- if(!pLineAttribute)
- {
- // if initially no line is defined, create one for HitTest and BoundRect
- pLineAttribute = new attribute::SdrLineAttribute(basegfx::BColor(0.0, 0.0, 0.0));
- }
-
{
+ const attribute::SdrLineAttribute rLineAttribute(getSdrLSTAttribute().getLine());
bool bArrowsOutside(false);
bool bMainLineSplitted(false);
- const attribute::SdrLineStartEndAttribute* pLineStartEnd = getSdrLSTAttribute().getLineStartEnd();
+ const attribute::SdrLineStartEndAttribute& rLineStartEnd = getSdrLSTAttribute().getLineStartEnd();
double fStartArrowW(0.0);
double fStartArrowH(0.0);
double fEndArrowW(0.0);
double fEndArrowH(0.0);
- if(pLineStartEnd)
+ if(!rLineStartEnd.isDefault())
{
- if(pLineStartEnd->isStartActive())
+ if(rLineStartEnd.isStartActive())
{
- const basegfx::B2DRange aArrowRange(basegfx::tools::getRange(pLineStartEnd->getStartPolyPolygon()));
- fStartArrowW = pLineStartEnd->getStartWidth();
+ const basegfx::B2DRange aArrowRange(basegfx::tools::getRange(rLineStartEnd.getStartPolyPolygon()));
+ fStartArrowW = rLineStartEnd.getStartWidth();
fStartArrowH = aArrowRange.getHeight() * fStartArrowW / aArrowRange.getWidth();
- if(pLineStartEnd->isStartCentered())
+ if(rLineStartEnd.isStartCentered())
{
fStartArrowH *= 0.5;
}
}
- if(pLineStartEnd->isEndActive())
+ if(rLineStartEnd.isEndActive())
{
- const basegfx::B2DRange aArrowRange(basegfx::tools::getRange(pLineStartEnd->getEndPolyPolygon()));
- fEndArrowW = pLineStartEnd->getEndWidth();
+ const basegfx::B2DRange aArrowRange(basegfx::tools::getRange(rLineStartEnd.getEndPolyPolygon()));
+ fEndArrowW = rLineStartEnd.getEndWidth();
fEndArrowH = aArrowRange.getHeight() * fEndArrowW / aArrowRange.getWidth();
- if(pLineStartEnd->isEndCentered())
+ if(rLineStartEnd.isEndCentered())
{
fEndArrowH *= 0.5;
}
@@ -183,7 +187,7 @@ namespace drawinglayer
const double fSpaceNeededByArrows(fStartArrowH + fEndArrowH + ((fStartArrowW + fEndArrowW) * 0.5));
const double fArrowsOutsideLen((fStartArrowH + fEndArrowH + fStartArrowW + fEndArrowW) * 0.5);
- const double fHalfLineWidth(pLineAttribute->getWidth() * 0.5);
+ const double fHalfLineWidth(rLineAttribute.getWidth() * 0.5);
if(fSpaceNeededByArrows > fDistance)
{
@@ -275,12 +279,12 @@ namespace drawinglayer
const basegfx::B2DPoint aMainLeftLeft(aMainLeft.getX() - fLenLeft, aMainLeft.getY());
const basegfx::B2DPoint aMainRightRight(aMainRight.getX() + fLenRight, aMainRight.getY());
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(*pLineAttribute, aObjectMatrix, aMainLeftLeft, aMainLeft, false, true));
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(*pLineAttribute, aObjectMatrix, aMainRight, aMainRightRight, true, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(rLineAttribute, aObjectMatrix, aMainLeftLeft, aMainLeft, false, true));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(rLineAttribute, aObjectMatrix, aMainRight, aMainRightRight, true, false));
if(!bMainLineSplitted || MEASURETEXTPOSITION_CENTERED != eHorizontal)
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(* pLineAttribute, aObjectMatrix, aMainLeft, aMainRight, false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(rLineAttribute, aObjectMatrix, aMainLeft, aMainRight, false, false));
}
}
else
@@ -291,12 +295,12 @@ namespace drawinglayer
const basegfx::B2DPoint aMainInnerLeft(aMainLeft.getX() + fHalfLength, aMainLeft.getY());
const basegfx::B2DPoint aMainInnerRight(aMainRight.getX() - fHalfLength, aMainRight.getY());
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(*pLineAttribute, aObjectMatrix, aMainLeft, aMainInnerLeft, true, false));
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(*pLineAttribute, aObjectMatrix, aMainInnerRight, aMainRight, false, true));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(rLineAttribute, aObjectMatrix, aMainLeft, aMainInnerLeft, true, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(rLineAttribute, aObjectMatrix, aMainInnerRight, aMainRight, false, true));
}
else
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(*pLineAttribute, aObjectMatrix, aMainLeft, aMainRight, true, true));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(rLineAttribute, aObjectMatrix, aMainLeft, aMainRight, true, true));
}
}
@@ -309,13 +313,13 @@ namespace drawinglayer
const basegfx::B2DPoint aLeftUp(0.0, fTopEdge);
const basegfx::B2DPoint aLeftDown(0.0, fBottomLeft);
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(*pLineAttribute, aObjectMatrix, aLeftDown, aLeftUp, false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(rLineAttribute, aObjectMatrix, aLeftDown, aLeftUp, false, false));
// right help line
const basegfx::B2DPoint aRightUp(fDistance, fTopEdge);
const basegfx::B2DPoint aRightDown(fDistance, fBottomRight);
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(*pLineAttribute, aObjectMatrix, aRightDown, aRightUp, false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(rLineAttribute, aObjectMatrix, aRightDown, aRightUp, false, false));
// text horizontal position
if(MEASURETEXTPOSITION_NEGATIVE == eHorizontal)
@@ -329,9 +333,9 @@ namespace drawinglayer
fTextX -= (fArrowsOutsideLen - fStartArrowH);
}
- if(pTextAttribute)
+ if(!rTextAttribute.isDefault())
{
- fTextX -= pTextAttribute->getTextRightDistance();
+ fTextX -= rTextAttribute.getTextRightDistance();
}
}
else if(MEASURETEXTPOSITION_POSITIVE == eHorizontal)
@@ -345,9 +349,9 @@ namespace drawinglayer
fTextX += (fArrowsOutsideLen - fEndArrowH);
}
- if(pTextAttribute)
+ if(!rTextAttribute.isDefault())
{
- fTextX += pTextAttribute->getTextLeftDistance();
+ fTextX += rTextAttribute.getTextLeftDistance();
}
}
else // MEASURETEXTPOSITION_CENTERED
@@ -355,9 +359,9 @@ namespace drawinglayer
// centered
fTextX = aMainLeft.getX() + ((fDistance - aTextRange.getWidth()) * 0.5);
- if(pTextAttribute)
+ if(!rTextAttribute.isDefault())
{
- fTextX += (pTextAttribute->getTextLeftDistance() - pTextAttribute->getTextRightDistance()) / 2L;
+ fTextX += (rTextAttribute.getTextLeftDistance() - rTextAttribute.getTextRightDistance()) / 2L;
}
}
@@ -368,9 +372,9 @@ namespace drawinglayer
const double fSmall(fArrowsOutsideLen * 0.10);
fTextY = aMainLeft.getY() - (aTextRange.getHeight() + fSmall + fHalfLineWidth);
- if(pTextAttribute)
+ if(!rTextAttribute.isDefault())
{
- fTextY -= pTextAttribute->getTextLowerDistance();
+ fTextY -= rTextAttribute.getTextLowerDistance();
}
}
else if(MEASURETEXTPOSITION_POSITIVE == eVertical)
@@ -379,9 +383,9 @@ namespace drawinglayer
const double fSmall(fArrowsOutsideLen * 0.10);
fTextY = aMainLeft.getY() + (fSmall + fHalfLineWidth);
- if(pTextAttribute)
+ if(!rTextAttribute.isDefault())
{
- fTextY += pTextAttribute->getTextUpperDistance();
+ fTextY += rTextAttribute.getTextUpperDistance();
}
}
else // MEASURETEXTPOSITION_CENTERED
@@ -389,21 +393,19 @@ namespace drawinglayer
// centered
fTextY = aMainLeft.getY() - (aTextRange.getHeight() * 0.5);
- if(pTextAttribute)
+ if(!rTextAttribute.isDefault())
{
- fTextY += (pTextAttribute->getTextUpperDistance() - pTextAttribute->getTextLowerDistance()) / 2L;
+ fTextY += (rTextAttribute.getTextUpperDistance() - rTextAttribute.getTextLowerDistance()) / 2L;
}
}
}
- if(!getSdrLSTAttribute().getLine())
+ if(getSdrLSTAttribute().getLine().isDefault())
{
- // embed line geometry to invisible line group
- const Primitive2DReference xHiddenLines(new HitTestPrimitive2D(aRetval));
+ // embed line geometry to invisible (100% transparent) line group for HitTest
+ const Primitive2DReference xHiddenLines(new HiddenGeometryPrimitive2D(aRetval));
+
aRetval = Primitive2DSequence(&xHiddenLines, 1);
-
- // delete temporary LineAttribute again
- delete pLineAttribute;
}
if(pBlockText)
@@ -433,9 +435,11 @@ namespace drawinglayer
}
// add shadow
- if(getSdrLSTAttribute().getShadow())
+ if(!getSdrLSTAttribute().getShadow().isDefault())
{
- aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLSTAttribute().getShadow());
+ aRetval = createEmbeddedShadowPrimitive(
+ aRetval,
+ getSdrLSTAttribute().getShadow());
}
return aRetval;
diff --git a/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx b/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx
index e4c13a51f6..9bef2207f5 100644
--- a/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx
@@ -30,7 +30,8 @@
#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -58,8 +59,14 @@ namespace drawinglayer
if(BasePrimitive2D::operator==(rPrimitive))
{
const SdrOle2Primitive2D& rCompare = (SdrOle2Primitive2D&)rPrimitive;
-
- if(getOLEContent() == rCompare.getOLEContent()
+
+ // #i108636# The standard operator== on two UNO sequences did not work as i
+ // would have expected; it just checks the .is() states and the data type
+ // of the sequence. What i need here is detection of equality of the whole
+ // sequence content, thus i need to use the arePrimitive2DSequencesEqual helper
+ // here instead of the operator== which lead to always returning false and thus
+ // always re-decompositions of the subcontent.
+ if(arePrimitive2DSequencesEqual(getOLEContent(), rCompare.getOLEContent())
&& getTransform() == rCompare.getTransform()
&& getSdrLFSTAttribute() == rCompare.getSdrLFSTAttribute())
{
@@ -80,23 +87,29 @@ namespace drawinglayer
Primitive2DSequence aRetval;
// create unit outline polygon
- basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ const basegfx::B2DPolygon aUnitOutline(basegfx::tools::createUnitPolygon());
// add fill
- if(!bBehaveCompatibleToPaintVersion && getSdrLFSTAttribute().getFill())
+ if(!bBehaveCompatibleToPaintVersion
+ && !getSdrLFSTAttribute().getFill().isDefault())
{
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
- createPolyPolygonFillPrimitive(basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getFill(), getSdrLFSTAttribute().getFillFloatTransGradient()));
+ createPolyPolygonFillPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform(),
+ getSdrLFSTAttribute().getFill(),
+ getSdrLFSTAttribute().getFillFloatTransGradient()));
}
// add line
// #i97981# condition was inverse to purpose. When being compatible to paint version,
// border needs to be suppressed
- if(!bBehaveCompatibleToPaintVersion && getSdrLFSTAttribute().getLine())
+ if(!bBehaveCompatibleToPaintVersion
+ && !getSdrLFSTAttribute().getLine().isDefault())
{
// if line width is given, polygon needs to be grown by half of it to make the
// outline to be outside of the bitmap
- if(0.0 != getSdrLFSTAttribute().getLine()->getWidth())
+ if(0.0 != getSdrLFSTAttribute().getLine().getWidth())
{
// decompose to get scale
basegfx::B2DVector aScale, aTranslate;
@@ -104,27 +117,37 @@ namespace drawinglayer
getTransform().decompose(aScale, aTranslate, fRotate, fShearX);
// create expanded range (add relative half line width to unit rectangle)
- double fHalfLineWidth(getSdrLFSTAttribute().getLine()->getWidth() * 0.5);
+ double fHalfLineWidth(getSdrLFSTAttribute().getLine().getWidth() * 0.5);
double fScaleX(0.0 != aScale.getX() ? fHalfLineWidth / fabs(aScale.getX()) : 1.0);
double fScaleY(0.0 != aScale.getY() ? fHalfLineWidth / fabs(aScale.getY()) : 1.0);
const basegfx::B2DRange aExpandedRange(-fScaleX, -fScaleY, 1.0 + fScaleX, 1.0 + fScaleY);
basegfx::B2DPolygon aExpandedUnitOutline(basegfx::tools::createPolygonFromRect(aExpandedRange));
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aExpandedUnitOutline, getTransform(), *getSdrLFSTAttribute().getLine()));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolygonLinePrimitive(
+ aExpandedUnitOutline,
+ getTransform(),
+ getSdrLFSTAttribute().getLine(),
+ attribute::SdrLineStartEndAttribute()));
}
else
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aUnitOutline, getTransform(), *getSdrLFSTAttribute().getLine()));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolygonLinePrimitive(
+ aUnitOutline,
+ getTransform(),
+ getSdrLFSTAttribute().getLine(),
+ attribute::SdrLineStartEndAttribute()));
}
}
else
{
// if initially no line is defined, create one for HitTest and BoundRect
- const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0));
- const Primitive2DReference xHiddenLineReference(createPolygonLinePrimitive(aUnitOutline, getTransform(), aBlackHairline));
- const Primitive2DSequence xHiddenLineSequence(&xHiddenLineReference, 1);
-
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(xHiddenLineSequence)));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createHiddenGeometryPrimitives2D(
+ false,
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform()));
}
// add graphic content
@@ -132,15 +155,26 @@ namespace drawinglayer
// add text, no need to supress to stay compatible since text was
// always supported by the old paints, too
- if(getSdrLFSTAttribute().getText())
+ if(!getSdrLFSTAttribute().getText().isDefault())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false, false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createTextPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform(),
+ getSdrLFSTAttribute().getText(),
+ getSdrLFSTAttribute().getLine(),
+ false,
+ false,
+ false));
}
// add shadow
- if(!bBehaveCompatibleToPaintVersion && getSdrLFSTAttribute().getShadow())
+ if(!bBehaveCompatibleToPaintVersion
+ && !getSdrLFSTAttribute().getShadow().isDefault())
{
- aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow());
+ aRetval = createEmbeddedShadowPrimitive(
+ aRetval,
+ getSdrLFSTAttribute().getShadow());
}
return aRetval;
diff --git a/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx
index a77f0b0380..12569813c5 100644
--- a/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx
@@ -134,7 +134,7 @@ namespace drawinglayer
if(aColor.bIsVisible)
{
- basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ basegfx::B2DPolygon aOutline(basegfx::tools::createUnitPolygon());
const Color aVclColor(aColor.nColor);
aOutline.transform(getObjectTransform());
const drawinglayer::primitive2d::Primitive2DReference xOutline(
diff --git a/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx
index e117e97f0d..9c36397600 100644
--- a/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx
@@ -31,7 +31,7 @@
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -48,50 +48,67 @@ namespace drawinglayer
Primitive2DSequence aRetval;
// add fill
- if(getSdrLFSTAttribute().getFill() && getUnitPolyPolygon().isClosed())
+ if(!getSdrLFSTAttribute().getFill().isDefault()
+ && getUnitPolyPolygon().isClosed())
{
// take care for orientations
- basegfx::B2DPolyPolygon aOrientedUnitPolyPolygon(basegfx::tools::correctOrientations(getUnitPolyPolygon()));
-
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolyPolygonFillPrimitive(aOrientedUnitPolyPolygon, getTransform(), *getSdrLFSTAttribute().getFill(), getSdrLFSTAttribute().getFillFloatTransGradient()));
+ const basegfx::B2DPolyPolygon aOrientedUnitPolyPolygon(
+ basegfx::tools::correctOrientations(getUnitPolyPolygon()));
+
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolyPolygonFillPrimitive(
+ aOrientedUnitPolyPolygon,
+ getTransform(),
+ getSdrLFSTAttribute().getFill(),
+ getSdrLFSTAttribute().getFillFloatTransGradient()));
}
// add line
- if(getSdrLFSTAttribute().getLine())
+ if(getSdrLFSTAttribute().getLine().isDefault())
{
- Primitive2DSequence aTemp(getUnitPolyPolygon().count());
-
- for(sal_uInt32 a(0L); a < getUnitPolyPolygon().count(); a++)
- {
- aTemp[a] = createPolygonLinePrimitive(getUnitPolyPolygon().getB2DPolygon(a), getTransform(), *getSdrLFSTAttribute().getLine(), getSdrLFSTAttribute().getLineStartEnd());
- }
-
- appendPrimitive2DSequenceToPrimitive2DSequence(aRetval, aTemp);
+ // if initially no line is defined, create one for HitTest and BoundRect
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createHiddenGeometryPrimitives2D(
+ false,
+ getUnitPolyPolygon(),
+ getTransform()));
}
else
{
- // if initially no line is defined, create one for HitTest and BoundRect
- const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0));
- Primitive2DSequence xHiddenLineSequence(getUnitPolyPolygon().count());
-
+ Primitive2DSequence aTemp(getUnitPolyPolygon().count());
+
for(sal_uInt32 a(0); a < getUnitPolyPolygon().count(); a++)
{
- xHiddenLineSequence[a] = createPolygonLinePrimitive(getUnitPolyPolygon().getB2DPolygon(a), getTransform(), aBlackHairline);
+ aTemp[a] = createPolygonLinePrimitive(
+ getUnitPolyPolygon().getB2DPolygon(a),
+ getTransform(),
+ getSdrLFSTAttribute().getLine(),
+ getSdrLFSTAttribute().getLineStartEnd());
}
-
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(xHiddenLineSequence)));
+
+ appendPrimitive2DSequenceToPrimitive2DSequence(aRetval, aTemp);
}
// add text
- if(getSdrLFSTAttribute().getText())
+ if(!getSdrLFSTAttribute().getText().isDefault())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(getUnitPolyPolygon(), getTransform(), *getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false, false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createTextPrimitive(
+ getUnitPolyPolygon(),
+ getTransform(),
+ getSdrLFSTAttribute().getText(),
+ getSdrLFSTAttribute().getLine(),
+ false,
+ false,
+ false));
}
// add shadow
- if(getSdrLFSTAttribute().getShadow())
+ if(!getSdrLFSTAttribute().getShadow().isDefault())
{
- aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow());
+ aRetval = createEmbeddedShadowPrimitive(
+ aRetval,
+ getSdrLFSTAttribute().getShadow());
}
return aRetval;
diff --git a/svx/source/sdr/primitive2d/sdrprimitivetools.cxx b/svx/source/sdr/primitive2d/sdrprimitivetools.cxx
index 6361e15a49..fbe23b9450 100644
--- a/svx/source/sdr/primitive2d/sdrprimitivetools.cxx
+++ b/svx/source/sdr/primitive2d/sdrprimitivetools.cxx
@@ -29,10 +29,6 @@
#include <svx/sdr/primitive2d/sdrprimitivetools.hxx>
#include <vcl/bmpacc.hxx>
#include <osl/mutex.hxx>
-#include <basegfx/polygon/b2dpolygon.hxx>
-#include <basegfx/polygon/b2dpolygontools.hxx>
-#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
#include <vcl/lazydelete.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -173,19 +169,6 @@ namespace drawinglayer
return aRetVal.get() ? *aRetVal.get() : BitmapEx();
}
- // #i99123#
- Primitive2DReference createFallbackHitTestPrimitive(const basegfx::B2DHomMatrix& rMatrix)
- {
- // create PolygonHairlinePrimitive2D
- basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
- aUnitOutline.transform(rMatrix);
- const basegfx::BColor aBlack(0.0, 0.0, 0.0);
- const Primitive2DReference xReference(new PolygonHairlinePrimitive2D(aUnitOutline, aBlack));
-
- // create HitTestPrimitive2D with it
- const Primitive2DSequence xSequence(&xReference, 1);
- return Primitive2DReference(new HitTestPrimitive2D(xSequence));
- }
} // end of namespace primitive2d
} // end of namespace drawinglayer
diff --git a/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx
index 575bfe004f..cb628a19ce 100644
--- a/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx
@@ -31,7 +31,8 @@
#include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -46,7 +47,6 @@ namespace drawinglayer
Primitive2DSequence SdrRectanglePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const
{
Primitive2DSequence aRetval;
- Primitive2DSequence aHitTestContent;
// create unit outline polygon
const basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect(
@@ -55,64 +55,67 @@ namespace drawinglayer
getCornerRadiusY()));
// add fill
- if(getSdrLFSTAttribute().getFill())
+ if(!getSdrLFSTAttribute().getFill().isDefault())
{
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
createPolyPolygonFillPrimitive(
basegfx::B2DPolyPolygon(aUnitOutline),
getTransform(),
- *getSdrLFSTAttribute().getFill(),
+ getSdrLFSTAttribute().getFill(),
getSdrLFSTAttribute().getFillFloatTransGradient()));
}
else if(getForceFillForHitTest())
{
// if no fill and it's a text frame, create a fill for HitTest and
// BoundRect fallback
- appendPrimitive2DReferenceToPrimitive2DSequence(aHitTestContent,
- createPolyPolygonFillPrimitive(
- basegfx::B2DPolyPolygon(aUnitOutline),
- getTransform(),
- attribute::SdrFillAttribute(0.0, basegfx::BColor(0.0, 0.0, 0.0)),
- getSdrLFSTAttribute().getFillFloatTransGradient()));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createHiddenGeometryPrimitives2D(
+ true,
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform()));
}
// add line
- if(getSdrLFSTAttribute().getLine())
+ if(!getSdrLFSTAttribute().getLine().isDefault())
{
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
createPolygonLinePrimitive(
aUnitOutline,
getTransform(),
- *getSdrLFSTAttribute().getLine()));
+ getSdrLFSTAttribute().getLine(),
+ attribute::SdrLineStartEndAttribute()));
}
else if(!getForceFillForHitTest())
{
// if initially no line is defined and it's not a text frame, create
// a line for HitTest and BoundRect
- appendPrimitive2DReferenceToPrimitive2DSequence(aHitTestContent,
- createPolygonLinePrimitive(
- aUnitOutline,
- getTransform(),
- attribute::SdrLineAttribute(basegfx::BColor(0.0, 0.0, 0.0))));
- }
-
- // add HitTest and BoundRect helper geometry (if exists)
- if(aHitTestContent.hasElements())
- {
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
- Primitive2DReference(new HitTestPrimitive2D(aHitTestContent)));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createHiddenGeometryPrimitives2D(
+ false,
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform()));
}
// add text
- if(getSdrLFSTAttribute().getText())
+ if(!getSdrLFSTAttribute().getText().isDefault())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false, false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createTextPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform(),
+ getSdrLFSTAttribute().getText(),
+ getSdrLFSTAttribute().getLine(),
+ false,
+ false,
+ false));
}
// add shadow
- if(getSdrLFSTAttribute().getShadow())
+ if(!getSdrLFSTAttribute().getShadow().isDefault())
{
- aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow());
+ aRetval = createEmbeddedShadowPrimitive(
+ aRetval,
+ getSdrLFSTAttribute().getShadow());
}
return aRetval;
diff --git a/svx/source/sdr/primitive3d/sdrattributecreator3d.cxx b/svx/source/sdr/primitive3d/sdrattributecreator3d.cxx
index b20c08e319..83fed6ca42 100644
--- a/svx/source/sdr/primitive3d/sdrattributecreator3d.cxx
+++ b/svx/source/sdr/primitive3d/sdrattributecreator3d.cxx
@@ -30,8 +30,11 @@
#include <svl/itemset.hxx>
#include <com/sun/star/drawing/NormalsKind.hpp>
#include <com/sun/star/drawing/TextureProjectionMode.hpp>
-#include <drawinglayer/attribute/sdrattribute3d.hxx>
+#include <com/sun/star/drawing/TextureKind2.hpp>
+#include <com/sun/star/drawing/TextureMode.hpp>
#include <svx/xflclit.hxx>
+#include <drawinglayer/attribute/materialattribute3d.hxx>
+#include <drawinglayer/attribute/sdrobjectattribute3d.hxx>
//////////////////////////////////////////////////////////////////////////////
diff --git a/svx/source/sdr/properties/attributeproperties.cxx b/svx/source/sdr/properties/attributeproperties.cxx
index e53117a4b4..8c97ea69bd 100644
--- a/svx/source/sdr/properties/attributeproperties.cxx
+++ b/svx/source/sdr/properties/attributeproperties.cxx
@@ -281,7 +281,19 @@ namespace sdr
// set stylesheet (if used)
if(pStySheet)
{
- ImpAddStyleSheet(pStySheet, sal_True);
+ // #i109515#
+ SfxItemPool* pStyleSheetPool = &pStySheet->GetPool().GetPool();
+
+ if(pStyleSheetPool == pDestPool)
+ {
+ // just re-set stylesheet
+ ImpAddStyleSheet(pStySheet, sal_True);
+ }
+ else
+ {
+ // StyleSheet is NOT from the correct pool; use default
+ ImpAddStyleSheet(pNewModel->GetDefaultStyleSheet(), sal_True);
+ }
}
delete pOldSet;
@@ -584,22 +596,6 @@ namespace sdr
bHintUsed = sal_True;
}
- // #111111#
- // When it's the BackgroundObject, set the MasterPage to changed to
- // get a refresh for the evtl. changed BackgroundStyle
-
- // #114265#
- // To only invalidate the page when the StyleSheet change happens,
- // some more rigid testing is necessary.
- const SfxSimpleHint *pSimpleHint = PTR_CAST(SfxSimpleHint, &rHint);
-
- if(pSimpleHint
- && pSimpleHint->GetId() == SFX_HINT_DATACHANGED
- && GetSdrObject().IsMasterPageBackgroundObject())
- {
- GetSdrObject().GetPage()->ActionChanged();
- }
-
if(!bHintUsed)
{
// forward to SdrObject ATM. Not sure if this will be necessary
diff --git a/svx/source/sdr/properties/makefile.mk b/svx/source/sdr/properties/makefile.mk
index 2ab52e18ae..5296765769 100644
--- a/svx/source/sdr/properties/makefile.mk
+++ b/svx/source/sdr/properties/makefile.mk
@@ -47,6 +47,7 @@ SLOFILES=\
$(SLO)$/textproperties.obj \
$(SLO)$/customshapeproperties.obj \
$(SLO)$/rectangleproperties.obj \
+ $(SLO)$/oleproperties.obj \
$(SLO)$/captionproperties.obj \
$(SLO)$/circleproperties.obj \
$(SLO)$/connectorproperties.obj \
diff --git a/drawinglayer/source/primitive3d/hittestprimitive3d.cxx b/svx/source/sdr/properties/oleproperties.cxx
index 8bf457008b..5c6fae24da 100644
--- a/drawinglayer/source/primitive3d/hittestprimitive3d.cxx
+++ b/svx/source/sdr/properties/oleproperties.cxx
@@ -2,10 +2,13 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2000, 2010 Oracle and/or its affiliates.
+ * Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
*
+ * $RCSfile: graphicproperties.cxx,v $
+ * $Revision: 1.12.76.1 $
+ *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -26,43 +29,52 @@
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_drawinglayer.hxx"
+#include "precompiled_svx.hxx"
-#include <drawinglayer/primitive3d/hittestprimitive3d.hxx>
-#include <drawinglayer/primitive3d/drawinglayer_primitivetypes3d.hxx>
+#include <svx/sdr/properties/oleproperties.hxx>
+#include <svl/itemset.hxx>
+#include <svx/xfillit0.hxx>
+#include <svx/xlineit0.hxx>
//////////////////////////////////////////////////////////////////////////////
-using namespace com::sun::star;
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
+namespace sdr
{
- namespace primitive3d
+ namespace properties
{
- HitTestPrimitive3D::HitTestPrimitive3D(
- const Primitive3DSequence& rChildren)
- : GroupPrimitive3D(rChildren)
+ OleProperties::OleProperties(SdrObject& rObj)
+ : RectangleProperties(rObj)
+ {
+ }
+
+ OleProperties::OleProperties(const OleProperties& rProps, SdrObject& rObj)
+ : RectangleProperties(rProps, rObj)
{
}
- basegfx::B3DRange HitTestPrimitive3D::getB3DRange(const geometry::ViewInformation3D& rViewInformation) const
+ OleProperties::~OleProperties()
{
- return getB3DRangeFromPrimitive3DSequence(getChildren(), rViewInformation);
}
- Primitive3DSequence HitTestPrimitive3D::get3DDecomposition(const geometry::ViewInformation3D& /*rViewInformation*/) const
+ BaseProperties& OleProperties::Clone(SdrObject& rObj) const
{
- // return empty sequence
- return Primitive3DSequence();
+ return *(new OleProperties(*this, rObj));
}
- // provide unique ID
- ImplPrimitrive3DIDBlock(HitTestPrimitive3D, PRIMITIVE3D_ID_HITTESTPRIMITIVE3D)
+ void OleProperties::ForceDefaultAttributes()
+ {
+ // call parent
+ RectangleProperties::ForceDefaultAttributes();
- } // end of namespace primitive3d
-} // end of namespace drawinglayer
+ // force ItemSet
+ GetObjectItemSet();
+
+ // #i108221#
+ mpItemSet->Put( XFillStyleItem(XFILL_NONE) );
+ mpItemSet->Put( XLineStyleItem(XLINE_NONE) );
+ }
+ } // end of namespace properties
+} // end of namespace sdr
//////////////////////////////////////////////////////////////////////////////
// eof
diff --git a/svx/source/svdraw/makefile.mk b/svx/source/svdraw/makefile.mk
index 0108615b10..514c5b6d2c 100644
--- a/svx/source/svdraw/makefile.mk
+++ b/svx/source/svdraw/makefile.mk
@@ -113,8 +113,6 @@ LIB1OBJFILES= \
LIB2TARGET= $(SLB)$/$(TARGET).lib
LIB2OBJFILES= \
- $(SLO)$/svdoimp.obj \
- $(SLO)$/svdscrol.obj \
$(SLO)$/ActionDescriptionProvider.obj \
$(SLO)$/impgrfll.obj
diff --git a/svx/source/svdraw/sdrmasterpagedescriptor.cxx b/svx/source/svdraw/sdrmasterpagedescriptor.cxx
index 0d01693740..3437567da3 100644
--- a/svx/source/svdraw/sdrmasterpagedescriptor.cxx
+++ b/svx/source/svdraw/sdrmasterpagedescriptor.cxx
@@ -33,6 +33,8 @@
// #i42075#
#include <svx/svdobj.hxx>
+#include <svx/xfillit0.hxx>
+#include <svl/itemset.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -73,7 +75,8 @@ namespace sdr
{
if(!mpViewContact)
{
- ((MasterPageDescriptor*)this)->mpViewContact = ((MasterPageDescriptor*)this)->CreateObjectSpecificViewContact();
+ const_cast< MasterPageDescriptor* >(this)->mpViewContact =
+ const_cast< MasterPageDescriptor* >(this)->CreateObjectSpecificViewContact();
}
return *mpViewContact;
@@ -93,14 +96,6 @@ namespace sdr
{
maVisibleLayers = rNew;
GetViewContact().ActionChanged();
-
- // #i42075# For AFs convenience, do a change notify at the MasterPageBackgroundObject, too
- SdrObject* pObject = GetBackgroundObject();
-
- if(pObject)
- {
- pObject->BroadcastObjectChange();
- }
}
}
@@ -119,40 +114,16 @@ namespace sdr
|| maVisibleLayers != rCandidate.maVisibleLayers);
}
- // #i42075# Get the correct BackgroundObject
- SdrObject* MasterPageDescriptor::GetBackgroundObject() const
+ const SfxItemSet& MasterPageDescriptor::getCorrectFillAttributes() const
{
- SdrObject* pRetval = 0L;
- const SdrPage& rMasterPage = GetUsedPage();
-
- // Here i will rely on old knowledge about the 0'st element of a masterpage
- // being the PageBackgroundObject. This will be removed again when that definition
- // will be changed.
-#ifdef DBG_UTIL
- const sal_uInt32 nMasterPageObjectCount(rMasterPage.GetObjCount());
- DBG_ASSERT(1 <= nMasterPageObjectCount,
- "MasterPageDescriptor::GetBackgroundObject(): MasterPageBackgroundObject missing (!)");
-#endif
- pRetval = rMasterPage.GetObj(0L);
-
- // Test if it's really what we need. There are known problems where
- // the 0th object is not the MasterPageBackgroundObject at all.
- if(pRetval && !pRetval->IsMasterPageBackgroundObject())
- {
- pRetval = 0L;
- }
-
- // Get the evtl. existing page background object from the using page and use it
- // preferred to the MasterPageBackgroundObject
- const SdrPage& rOwnerPage = GetOwnerPage();
- SdrObject* pCandidate = rOwnerPage.GetBackgroundObj();
+ const SfxItemSet& rOwnerPageAtributes = GetOwnerPage().getSdrPageProperties().GetItemSet();
- if(pCandidate)
+ if(XFILL_NONE != ((const XFillStyleItem&)rOwnerPageAtributes.Get(XATTR_FILLSTYLE)).GetValue())
{
- pRetval = pCandidate;
+ return rOwnerPageAtributes;
}
- return pRetval;
+ return GetUsedPage().getSdrPageProperties().GetItemSet();
}
} // end of namespace sdr
diff --git a/svx/source/svdraw/svdcrtmt.hxx b/svx/source/svdraw/svdcrtmt.hxx
deleted file mode 100644
index 2b99c4a550..0000000000
--- a/svx/source/svdraw/svdcrtmt.hxx
+++ /dev/null
@@ -1,32 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SVDCRTMT_HXX
-#define _SVDCRTMT_HXX
-
-#endif //_SVDCRTMT_HXX
-
diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx
index 083c819489..0710279c0f 100644
--- a/svx/source/svdraw/svddrgmt.cxx
+++ b/svx/source/svdraw/svddrgmt.cxx
@@ -66,7 +66,7 @@
#include <svx/sdr/contact/viewcontact.hxx>
#include <svx/sdr/contact/displayinfo.hxx>
#include <svx/sdr/overlay/overlayprimitive2dsequenceobject.hxx>
-#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
#include <svx/sdr/contact/objectcontact.hxx>
#include "svditer.hxx"
#include <svx/svdopath.hxx>
@@ -75,13 +75,14 @@
#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
#include <drawinglayer/primitive2d/markerarrayprimitive2d.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
#include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
#include <svx/svdoole2.hxx>
#include <svx/svdovirt.hxx>
#include <svx/svdouno.hxx>
#include <svx/sdr/primitive2d/sdrprimitivetools.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <drawinglayer/attribute/sdrlineattribute.hxx>
+#include <drawinglayer/attribute/sdrlinestartendattribute.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -674,7 +675,7 @@ void SdrDragMethod::CreateOverlayGeometry(sdr::overlay::OverlayManager& rOverlay
createSdrDragEntries();
}
- // if there are entries, derive OverlayObjects fromthe entries, including
+ // if there are entries, derive OverlayObjects from the entries, including
// modification from current interactive state
if(maSdrDragEntries.size())
{
@@ -723,8 +724,8 @@ void SdrDragMethod::CreateOverlayGeometry(sdr::overlay::OverlayManager& rOverlay
if(aResultTransparent.hasElements())
{
- drawinglayer::primitive2d::Primitive2DReference aUnifiedAlphaPrimitive2D(new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D(aResultTransparent, 0.5));
- aResultTransparent = drawinglayer::primitive2d::Primitive2DSequence(&aUnifiedAlphaPrimitive2D, 1);
+ drawinglayer::primitive2d::Primitive2DReference aUnifiedTransparencePrimitive2D(new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(aResultTransparent, 0.5));
+ aResultTransparent = drawinglayer::primitive2d::Primitive2DSequence(&aUnifiedTransparencePrimitive2D, 1);
sdr::overlay::OverlayObject* pNewOverlayObject = new sdr::overlay::OverlayPrimitive2DSequenceObject(aResultTransparent);
rOverlayManager.add(*pNewOverlayObject);
@@ -819,38 +820,36 @@ drawinglayer::primitive2d::Primitive2DSequence SdrDragMethod::AddConnectorOverla
// this polygon is a temporary calculated connector path, so it is not possible to fetch
// the needed primitives directly from the pEdge object which does not get changed. If full
// drag is on, use the SdrObjects ItemSet to create a adequate representation
- if(getSolidDraggingActive())
- {
- const SfxItemSet& rItemSet = pEdge->GetMergedItemSet();
- drawinglayer::attribute::SdrLineAttribute* pLine = drawinglayer::primitive2d::createNewSdrLineAttribute(rItemSet);
- drawinglayer::attribute::SdrLineStartEndAttribute* pLineStartEnd = 0;
+ bool bUseSolidDragging(getSolidDraggingActive());
- if(pLine && !pLine->isVisible())
+ if(bUseSolidDragging)
+ {
+ // switch off solid dragging if connector is not visible
+ if(!pEdge->HasLineStyle())
{
- delete pLine;
- pLine = 0;
+ bUseSolidDragging = false;
}
+ }
- if(pLine)
- {
- pLineStartEnd = drawinglayer::primitive2d::createNewSdrLineStartEndAttribute(rItemSet, pLine->getWidth());
+ if(bUseSolidDragging)
+ {
+ const SfxItemSet& rItemSet = pEdge->GetMergedItemSet();
+ const drawinglayer::attribute::SdrLineAttribute aLine(
+ drawinglayer::primitive2d::createNewSdrLineAttribute(rItemSet));
- if(pLineStartEnd && !pLineStartEnd->isVisible())
- {
- delete pLineStartEnd;
- pLineStartEnd = 0;
- }
+ if(!aLine.isDefault())
+ {
+ const drawinglayer::attribute::SdrLineStartEndAttribute aLineStartEnd(
+ drawinglayer::primitive2d::createNewSdrLineStartEndAttribute(
+ rItemSet,
+ aLine.getWidth()));
drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(
aRetval, drawinglayer::primitive2d::createPolygonLinePrimitive(
- aEdgePolygon, basegfx::B2DHomMatrix(), *pLine, pLineStartEnd));
-
- if(pLineStartEnd)
- {
- delete pLineStartEnd;
- }
-
- delete pLine;
+ aEdgePolygon,
+ basegfx::B2DHomMatrix(),
+ aLine,
+ aLineStartEnd));
}
}
else
diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx
index 47aff72541..7023aa8913 100644
--- a/svx/source/svdraw/svdedtv.cxx
+++ b/svx/source/svdraw/svdedtv.cxx
@@ -805,16 +805,101 @@ void SdrEditView::DeleteMarkedList(const SdrMarkList& rMark)
void SdrEditView::DeleteMarkedObj()
{
- if (GetMarkedObjectCount()) {
- BrkAction();
- //HMHHideMarkHdl();
- BegUndo(ImpGetResStr(STR_EditDelete),GetDescriptionOfMarkedObjects(),SDRREPFUNC_OBJ_DELETE);
+ // moved breaking action and undo start outside loop
+ BrkAction();
+ BegUndo(ImpGetResStr(STR_EditDelete),GetDescriptionOfMarkedObjects(),SDRREPFUNC_OBJ_DELETE);
+
+ // remove as long as something is selected. This allows to schedule objects for
+ // removal for a next run as needed
+ while(GetMarkedObjectCount())
+ {
+ // vector to remember the parents which may be empty after object removal
+ std::vector< SdrObject* > aParents;
+
+ {
+ const SdrMarkList& rMarkList = GetMarkedObjectList();
+ const sal_uInt32 nCount(rMarkList.GetMarkCount());
+ sal_uInt32 a(0);
+
+ for(a = 0; a < nCount; a++)
+ {
+ // in the first run, add all found parents, but only once
+ SdrMark* pMark = rMarkList.GetMark(a);
+ SdrObject* pObject = pMark->GetMarkedSdrObj();
+ SdrObject* pParent = pObject->GetObjList()->GetOwnerObj();
+
+ if(pParent)
+ {
+ if(aParents.size())
+ {
+ std::vector< SdrObject* >::iterator aFindResult =
+ std::find(aParents.begin(), aParents.end(), pParent);
+
+ if(aFindResult == aParents.end())
+ {
+ aParents.push_back(pParent);
+ }
+ }
+ else
+ {
+ aParents.push_back(pParent);
+ }
+ }
+ }
+
+ if(aParents.size())
+ {
+ // in a 2nd run, remove all objects which may already be scheduled for
+ // removal. I am not sure if this can happen, but theoretically
+ // a to-be-removed object may already be the group/3DScene itself
+ for(a = 0; a < nCount; a++)
+ {
+ SdrMark* pMark = rMarkList.GetMark(a);
+ SdrObject* pObject = pMark->GetMarkedSdrObj();
+
+ std::vector< SdrObject* >::iterator aFindResult =
+ std::find(aParents.begin(), aParents.end(), pObject);
+
+ if(aFindResult != aParents.end())
+ {
+ aParents.erase(aFindResult);
+ }
+ }
+ }
+ }
+
+ // original stuff: remove selected objects. Handle clear will
+ // do something only once
DeleteMarkedList(GetMarkedObjectList());
GetMarkedObjectListWriteAccess().Clear();
aHdl.Clear();
- EndUndo();
- MarkListHasChanged();
+
+ while(aParents.size() && !GetMarkedObjectCount())
+ {
+ // iterate over remembered parents
+ SdrObject* pParent = aParents.back();
+ aParents.pop_back();
+
+ if(pParent->GetSubList() && 0 == pParent->GetSubList()->GetObjCount())
+ {
+ // we detected an empty parent, a candidate to leave group/3DScene
+ // if entered
+ if(GetSdrPageView()->GetAktGroup()
+ && GetSdrPageView()->GetAktGroup() == pParent)
+ {
+ GetSdrPageView()->LeaveOneGroup();
+ }
+
+ // schedule empty parent for removal
+ GetMarkedObjectListWriteAccess().InsertEntry(
+ SdrMark(pParent, GetSdrPageView()));
+ }
+ }
}
+
+ // end undo and change messaging moved at the end
+ EndUndo();
+ MarkListHasChanged();
}
void SdrEditView::CopyMarkedObj()
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index 0be05fbe12..5711ed7d80 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -281,13 +281,13 @@ SdrHdlBitmapSet& getSimpleSet()
SdrHdlBitmapSet& getModernSet()
{
- static vcl::DeleteOnDeinit< SdrHdlBitmapSet > aModernSet(new SdrHdlBitmapSet(SIP_SA_MARKERS));
+ static vcl::DeleteOnDeinit< SdrHdlBitmapSet > aModernSet(new SdrHdlBitmapSet(SIP_SA_FINE_MARKERS));
return *aModernSet.get();
}
SdrHdlBitmapSet& getHighContrastSet()
{
- static vcl::DeleteOnDeinit< SdrHdlBitmapSet > aHighContrastSet(new SdrHdlBitmapSet(SIP_SA_MARKERS));
+ static vcl::DeleteOnDeinit< SdrHdlBitmapSet > aHighContrastSet(new SdrHdlBitmapSet(SIP_SA_ACCESSIBILITY_MARKERS));
return *aHighContrastSet.get();
}
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index bcf81b91ef..b10fab6a67 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -47,7 +47,6 @@
#include <svx/svdpage.hxx>
#include <svx/svdovirt.hxx> // Fuer Add/Del Ref
#include <svx/svdview.hxx> // fuer Dragging (Ortho abfragen)
-#include "svdscrol.hxx"
#include "svdglob.hxx" // StringCache
#include "svdstr.hrc" // Objektname
#include <svx/svdogrp.hxx> // Factory
@@ -326,7 +325,8 @@ sdr::properties::BaseProperties& SdrObject::GetProperties() const
{
if(!mpProperties)
{
- ((SdrObject*)this)->mpProperties = ((SdrObject*)this)->CreateObjectSpecificProperties();
+ const_cast< SdrObject* >(this)->mpProperties =
+ const_cast< SdrObject* >(this)->CreateObjectSpecificProperties();
}
return *mpProperties;
@@ -361,7 +361,8 @@ sdr::contact::ViewContact& SdrObject::GetViewContact() const
{
if(!mpViewContact)
{
- ((SdrObject*)this)->mpViewContact = ((SdrObject*)this)->CreateObjectSpecificViewContact();
+ const_cast< SdrObject* >(this)->mpViewContact =
+ const_cast< SdrObject* >(this)->CreateObjectSpecificViewContact();
}
return *mpViewContact;
@@ -370,51 +371,6 @@ sdr::contact::ViewContact& SdrObject::GetViewContact() const
// DrawContact support: Methods for handling Object changes
void SdrObject::ActionChanged() const
{
- // Forward change call to MasterPageDescriptor if BackgroundObject was changed
- const SdrPage* pObjectsPage = GetPage();
-
- if(pObjectsPage)
- {
- // do the necessary ActionChange() forwards when a MasterPageBackgroundObject
- // gets changed. This can be removed as soon as the MasterPageBackgroundObject
- // handling is replaced with the proper ItemSet handling at the SdrPages. The
- // needed ActionChanged calls will then be triggered by changing those ItemSets.
- if(pObjectsPage->IsMasterPage())
- {
- if(IsMasterPageBackgroundObject())
- {
- SdrModel* pObjectsModel = GetModel();
-
- if(pObjectsModel)
- {
- const sal_uInt16 nCount(pObjectsModel->GetPageCount());
-
- for(sal_uInt16 a(0); a < nCount; a++)
- {
- const SdrPage* pUserPage = pObjectsModel->GetPage(a);
-
- if(pUserPage && pUserPage->TRG_HasMasterPage())
- {
- SdrPage& rUsedMasterPage = pUserPage->TRG_GetMasterPage();
-
- if(&rUsedMasterPage == pObjectsPage)
- {
- pUserPage->TRG_GetMasterPageDescriptorViewContact().ActionChanged();
- }
- }
- }
- }
- }
- }
- else
- {
- if(pObjectsPage->TRG_HasMasterPage() && pObjectsPage->GetBackgroundObj() == this)
- {
- pObjectsPage->TRG_GetMasterPageDescriptorViewContact().ActionChanged();
- }
- }
- }
-
// Do necessary ViewContact actions
GetViewContact().ActionChanged();
}
@@ -3112,26 +3068,6 @@ void SdrObject::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const ba
SetSnapRect(aBaseRect);
}
-// #111111#
-// Needed again and again i will now add a test for finding out if
-// this object is the BackgroundObject of the page.
-sal_Bool SdrObject::IsMasterPageBackgroundObject() const
-{
- if(pObjList
- && pObjList == pPage
- && pPage->IsMasterPage()
- && pObjList->GetObj(0) == this
- && 1L == (pPage->GetPageNum() % 2))
- {
- // 0'th object, directly on page, page is MasterPage,
- // MasterPagePageNum is 1,3,5,...
- // --> It's the background object (!)
- return sal_True;
- }
-
- return sal_False;
-}
-
// #116168#
// Give info if object is in destruction
sal_Bool SdrObject::IsInDestruction() const
diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx
index 8ef96e7d50..7e88f485d0 100644
--- a/svx/source/svdraw/svdocapt.cxx
+++ b/svx/source/svdraw/svdocapt.cxx
@@ -843,7 +843,7 @@ void SdrCaptionObj::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, cons
}
// geometry access
-::basegfx::B2DPolygon SdrCaptionObj::getTailPolygon() const
+basegfx::B2DPolygon SdrCaptionObj::getTailPolygon() const
{
return aTailPoly.getB2DPolygon();
}
diff --git a/svx/source/svdraw/svdogrp.cxx b/svx/source/svdraw/svdogrp.cxx
index 1d30a85acc..428ff28482 100644
--- a/svx/source/svdraw/svdogrp.cxx
+++ b/svx/source/svdraw/svdogrp.cxx
@@ -80,7 +80,7 @@
sdr::properties::BaseProperties* SdrObjGroup::CreateObjectSpecificProperties()
{
- return new sdr::properties::GroupProperties((SdrObject&)(*this));
+ return new sdr::properties::GroupProperties(*this);
}
//////////////////////////////////////////////////////////////////////////////
@@ -163,6 +163,12 @@ void SdrObjGroup::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
}
+void SdrObjGroup::SetBoundRectDirty()
+{
+ // avoid resetting aOutRect which in case of this object is model data,
+ // not re-creatable view data
+}
+
UINT16 SdrObjGroup::GetObjIdentifier() const
{
return UINT16(OBJ_GRUP);
diff --git a/svx/source/svdraw/svdoimp.cxx b/svx/source/svdraw/svdoimp.cxx
deleted file mode 100644
index 4362f5599e..0000000000
--- a/svx/source/svdraw/svdoimp.cxx
+++ /dev/null
@@ -1,33 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-#include <svdoimp.hxx>
-
-///////////////////////////////////////////////////////////////////////////////
-// eof
diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index dd106da535..68ebcca102 100644
--- a/svx/source/svdraw/svdoole2.cxx
+++ b/svx/source/svdraw/svdoole2.cxx
@@ -85,6 +85,7 @@
#include <svtools/chartprettypainter.hxx>
#include <svx/sdr/contact/viewcontactofsdrole2obj.hxx>
#include <svx/svdograf.hxx>
+#include <svx/sdr/properties/oleproperties.hxx>
// #i100710#
#include <svx/xlnclit.hxx>
@@ -732,6 +733,14 @@ static bool ImplIsMathObj( const uno::Reference < embed::XEmbeddedObject >& rObj
}
//////////////////////////////////////////////////////////////////////////////
+// BaseProperties section
+
+sdr::properties::BaseProperties* SdrOle2Obj::CreateObjectSpecificProperties()
+{
+ return new sdr::properties::OleProperties(*this);
+}
+
+//////////////////////////////////////////////////////////////////////////////
// DrawContact section
sdr::contact::ViewContact* SdrOle2Obj::CreateObjectSpecificViewContact()
diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx
index e7407cd8ec..063a847b75 100644
--- a/svx/source/svdraw/svdopath.cxx
+++ b/svx/source/svdraw/svdopath.cxx
@@ -76,6 +76,7 @@ inline double ImplMMToTwips(double fVal) { return (fVal * (72.0 / 127.0)); }
#include <svx/sdr/attribute/sdrtextattribute.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <svx/sdr/attribute/sdrformtextattribute.hxx>
using namespace sdr;
@@ -2741,13 +2742,10 @@ SdrObject* SdrPathObj::RipPoint(sal_uInt32 nHdlNum, sal_uInt32& rNewPt0Index)
SdrObject* SdrPathObj::DoConvertToPolyObj(BOOL bBezier) const
{
// #i89784# check for FontWork with activated HideContour
- bool bHideContour(false);
-
- {
- drawinglayer::attribute::SdrTextAttribute* pText = drawinglayer::primitive2d::createNewSdrTextAttribute(GetObjectItemSet(), *getText(0));
- bHideContour = pText && pText->getSdrFormTextAttribute() && pText->isHideContour();
- delete pText;
- }
+ const drawinglayer::attribute::SdrTextAttribute aText(
+ drawinglayer::primitive2d::createNewSdrTextAttribute(GetObjectItemSet(), *getText(0)));
+ const bool bHideContour(
+ !aText.isDefault() && !aText.getSdrFormTextAttribute().isDefault() && aText.isHideContour());
SdrObject* pRet = bHideContour ?
0 :
diff --git a/svx/source/svdraw/svdorect.cxx b/svx/source/svdraw/svdorect.cxx
index f8a1534fd2..e84b403cee 100644
--- a/svx/source/svdraw/svdorect.cxx
+++ b/svx/source/svdraw/svdorect.cxx
@@ -316,50 +316,67 @@ void SdrRectObj::NbcSetLogicRect(const Rectangle& rRect)
sal_uInt32 SdrRectObj::GetHdlCount() const
{
- return 9L;
+ return IsTextFrame() ? 10 : 9;
}
SdrHdl* SdrRectObj::GetHdl(sal_uInt32 nHdlNum) const
{
- SdrHdl* pH=NULL;
+ SdrHdl* pH = NULL;
Point aPnt;
- SdrHdlKind eKind=HDL_MOVE;
- if( IsTextFrame() && !nHdlNum )
+ SdrHdlKind eKind = HDL_MOVE;
+
+ if(!IsTextFrame())
{
- pH=new ImpTextframeHdl(aRect);
- pH->SetObj((SdrObject*)this);
- pH->SetDrehWink(aGeo.nDrehWink);
- return pH;
+ nHdlNum++;
}
- else
+
+ switch(nHdlNum)
{
- switch (nHdlNum) {
- case 0: {
- long a=GetEckenradius();
- long b=Max(aRect.GetWidth(),aRect.GetHeight())/2; // Wird aufgerundet, da GetWidth() eins draufaddiert
- if (a>b) a=b;
- if (a<0) a=0;
- aPnt=aRect.TopLeft();
- aPnt.X()+=a;
- eKind=HDL_CIRC;
- } break; // Eckenradius
- case 1: aPnt=aRect.TopLeft(); eKind=HDL_UPLFT; break; // Oben links
- case 2: aPnt=aRect.TopCenter(); eKind=HDL_UPPER; break; // Oben
- case 3: aPnt=aRect.TopRight(); eKind=HDL_UPRGT; break; // Oben rechts
- case 4: aPnt=aRect.LeftCenter(); eKind=HDL_LEFT ; break; // Links
- case 5: aPnt=aRect.RightCenter(); eKind=HDL_RIGHT; break; // Rechts
- case 6: aPnt=aRect.BottomLeft(); eKind=HDL_LWLFT; break; // Unten links
- case 7: aPnt=aRect.BottomCenter(); eKind=HDL_LOWER; break; // Unten
- case 8: aPnt=aRect.BottomRight(); eKind=HDL_LWRGT; break; // Unten rechts
+ case 0:
+ {
+ pH = new ImpTextframeHdl(aRect);
+ pH->SetObj((SdrObject*)this);
+ pH->SetDrehWink(aGeo.nDrehWink);
+ break;
+ }
+ case 1:
+ {
+ long a = GetEckenradius();
+ long b = Max(aRect.GetWidth(),aRect.GetHeight())/2; // Wird aufgerundet, da GetWidth() eins draufaddiert
+ if (a>b) a=b;
+ if (a<0) a=0;
+ aPnt=aRect.TopLeft();
+ aPnt.X()+=a;
+ eKind = HDL_CIRC;
+ break;
}
+ case 2: aPnt=aRect.TopLeft(); eKind = HDL_UPLFT; break; // Oben links
+ case 3: aPnt=aRect.TopCenter(); eKind = HDL_UPPER; break; // Oben
+ case 4: aPnt=aRect.TopRight(); eKind = HDL_UPRGT; break; // Oben rechts
+ case 5: aPnt=aRect.LeftCenter(); eKind = HDL_LEFT ; break; // Links
+ case 6: aPnt=aRect.RightCenter(); eKind = HDL_RIGHT; break; // Rechts
+ case 7: aPnt=aRect.BottomLeft(); eKind = HDL_LWLFT; break; // Unten links
+ case 8: aPnt=aRect.BottomCenter(); eKind = HDL_LOWER; break; // Unten
+ case 9: aPnt=aRect.BottomRight(); eKind = HDL_LWRGT; break; // Unten rechts
}
- if (aGeo.nShearWink!=0) ShearPoint(aPnt,aRect.TopLeft(),aGeo.nTan);
- if (aGeo.nDrehWink!=0) RotatePoint(aPnt,aRect.TopLeft(),aGeo.nSin,aGeo.nCos);
- if (eKind!=HDL_MOVE) {
- pH=new SdrHdl(aPnt,eKind);
+
+ if(!pH)
+ {
+ if(aGeo.nShearWink)
+ {
+ ShearPoint(aPnt,aRect.TopLeft(),aGeo.nTan);
+ }
+
+ if(aGeo.nDrehWink)
+ {
+ RotatePoint(aPnt,aRect.TopLeft(),aGeo.nSin,aGeo.nCos);
+ }
+
+ pH = new SdrHdl(aPnt,eKind);
pH->SetObj((SdrObject*)this);
pH->SetDrehWink(aGeo.nDrehWink);
}
+
return pH;
}
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 173abeba43..b65bde818f 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -35,7 +35,6 @@
#include <svx/svdpage.hxx> // und fuer AnimationHandler (Laufschrift)
#include <svx/svdetc.hxx>
#include <svx/svdoutl.hxx>
-#include "svdscrol.hxx" // fuer Laufschrift
#include <svx/svdmodel.hxx> // OutlinerDefaults
#include "svdglob.hxx" // Stringcache
#include "svdstr.hrc" // Objektname
diff --git a/svx/source/svdraw/svdotextpathdecomposition.cxx b/svx/source/svdraw/svdotextpathdecomposition.cxx
index 0c33a54dc3..afcef6b1b2 100644
--- a/svx/source/svdraw/svdotextpathdecomposition.cxx
+++ b/svx/source/svdraw/svdotextpathdecomposition.cxx
@@ -62,7 +62,7 @@
#include <svx/xlinjoit.hxx>
#include <svx/xlndsit.hxx>
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
-#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
#include <editeng/editstat.hxx>
#include <unoapi.hxx>
#include <drawinglayer/geometry/viewinformation2d.hxx>
@@ -226,7 +226,7 @@ namespace
{
class impPolygonParagraphHandler
{
- const drawinglayer::attribute::SdrFormTextAttribute& mrSdrFormTextAttribute; // FormText parameters
+ const drawinglayer::attribute::SdrFormTextAttribute maSdrFormTextAttribute; // FormText parameters
std::vector< drawinglayer::primitive2d::BasePrimitive2D* >& mrDecomposition; // destination primitive list
std::vector< drawinglayer::primitive2d::BasePrimitive2D* >& mrShadowDecomposition; // destination primitive list for shadow
Reference < com::sun::star::i18n::XBreakIterator > mxBreak; // break iterator
@@ -269,7 +269,7 @@ namespace
const drawinglayer::attribute::SdrFormTextAttribute& rSdrFormTextAttribute,
std::vector< drawinglayer::primitive2d::BasePrimitive2D* >& rDecomposition,
std::vector< drawinglayer::primitive2d::BasePrimitive2D* >& rShadowDecomposition)
- : mrSdrFormTextAttribute(rSdrFormTextAttribute),
+ : maSdrFormTextAttribute(rSdrFormTextAttribute),
mrDecomposition(rDecomposition),
mrShadowDecomposition(rShadowDecomposition)
{
@@ -293,18 +293,18 @@ namespace
double fPolyStart(0.0);
double fScaleFactor(1.0);
- if(mrSdrFormTextAttribute.getFormTextMirror())
+ if(maSdrFormTextAttribute.getFormTextMirror())
{
aPolygonCandidate.flip();
}
- if(mrSdrFormTextAttribute.getFormTextStart()
- && (XFT_LEFT == mrSdrFormTextAttribute.getFormTextAdjust()
- || XFT_RIGHT == mrSdrFormTextAttribute.getFormTextAdjust()))
+ if(maSdrFormTextAttribute.getFormTextStart()
+ && (XFT_LEFT == maSdrFormTextAttribute.getFormTextAdjust()
+ || XFT_RIGHT == maSdrFormTextAttribute.getFormTextAdjust()))
{
- if(XFT_LEFT == mrSdrFormTextAttribute.getFormTextAdjust())
+ if(XFT_LEFT == maSdrFormTextAttribute.getFormTextAdjust())
{
- fPolyStart += mrSdrFormTextAttribute.getFormTextStart();
+ fPolyStart += maSdrFormTextAttribute.getFormTextStart();
if(fPolyStart > fPolyEnd)
{
@@ -313,7 +313,7 @@ namespace
}
else
{
- fPolyEnd -= mrSdrFormTextAttribute.getFormTextStart();
+ fPolyEnd -= maSdrFormTextAttribute.getFormTextStart();
if(fPolyEnd < fPolyStart)
{
@@ -322,7 +322,7 @@ namespace
}
}
- if(XFT_LEFT != mrSdrFormTextAttribute.getFormTextAdjust())
+ if(XFT_LEFT != maSdrFormTextAttribute.getFormTextAdjust())
{
// calculate total text length of this paragraph, some layout needs to be done
const double fParagraphTextLength(getParagraphTextLength(rTextPortions));
@@ -331,7 +331,7 @@ namespace
// but still take care of XFT_AUTOSIZE in that case
const bool bTextTooLong(fParagraphTextLength > (fPolyEnd - fPolyStart));
- if(XFT_RIGHT == mrSdrFormTextAttribute.getFormTextAdjust())
+ if(XFT_RIGHT == maSdrFormTextAttribute.getFormTextAdjust())
{
if(!bTextTooLong)
{
@@ -339,7 +339,7 @@ namespace
fPolyStart += ((fPolyEnd - fPolyStart) - fParagraphTextLength);
}
}
- else if(XFT_CENTER == mrSdrFormTextAttribute.getFormTextAdjust())
+ else if(XFT_CENTER == maSdrFormTextAttribute.getFormTextAdjust())
{
if(!bTextTooLong)
{
@@ -347,7 +347,7 @@ namespace
fPolyStart += ((fPolyEnd - fPolyStart) - fParagraphTextLength) / 2.0;
}
}
- else if(XFT_AUTOSIZE == mrSdrFormTextAttribute.getFormTextAdjust())
+ else if(XFT_AUTOSIZE == maSdrFormTextAttribute.getFormTextAdjust())
{
// if scale, prepare scale factor between curve length and text length
if(0.0 != fParagraphTextLength)
@@ -382,7 +382,7 @@ namespace
// prepare portion length. Takes RTL sections into account.
double fPortionLength(pCandidate->getDisplayLength(nUsedTextLength, nNextGlyphLen));
- if(XFT_AUTOSIZE == mrSdrFormTextAttribute.getFormTextAdjust())
+ if(XFT_AUTOSIZE == maSdrFormTextAttribute.getFormTextAdjust())
{
// when scaling, expand portion length
fPortionLength *= fScaleFactor;
@@ -397,27 +397,27 @@ namespace
aNewTransformA.scale(aFontScaling.getX(), aFontScaling.getY());
// prepare scaling of text primitive
- if(XFT_AUTOSIZE == mrSdrFormTextAttribute.getFormTextAdjust())
+ if(XFT_AUTOSIZE == maSdrFormTextAttribute.getFormTextAdjust())
{
// when scaling, expand text primitive scaling
aNewTransformA.scale(fScaleFactor, fScaleFactor);
}
// eventually create shadow primitives from aDecomposition and add to rDecomposition
- const bool bShadow(XFTSHADOW_NONE != mrSdrFormTextAttribute.getFormTextShadow());
+ const bool bShadow(XFTSHADOW_NONE != maSdrFormTextAttribute.getFormTextShadow());
if(bShadow)
{
- if(XFTSHADOW_NORMAL == mrSdrFormTextAttribute.getFormTextShadow())
+ if(XFTSHADOW_NORMAL == maSdrFormTextAttribute.getFormTextShadow())
{
aNewShadowTransform.translate(
- mrSdrFormTextAttribute.getFormTextShdwXVal(),
- -mrSdrFormTextAttribute.getFormTextShdwYVal());
+ maSdrFormTextAttribute.getFormTextShdwXVal(),
+ -maSdrFormTextAttribute.getFormTextShdwYVal());
}
else // XFTSHADOW_SLANT
{
- double fScaleValue(mrSdrFormTextAttribute.getFormTextShdwYVal() / 100.0);
- double fShearValue(-mrSdrFormTextAttribute.getFormTextShdwXVal() * F_PI1800);
+ double fScaleValue(maSdrFormTextAttribute.getFormTextShdwYVal() / 100.0);
+ double fShearValue(-maSdrFormTextAttribute.getFormTextShdwXVal() * F_PI1800);
aNewShadowTransform.scale(1.0, fScaleValue);
aNewShadowTransform.shearX(sin(fShearValue));
@@ -425,7 +425,7 @@ namespace
}
}
- switch(mrSdrFormTextAttribute.getFormTextStyle())
+ switch(maSdrFormTextAttribute.getFormTextStyle())
{
case XFT_ROTATE :
{
@@ -483,7 +483,7 @@ namespace
}
// distance from path?
- if(mrSdrFormTextAttribute.getFormTextDistance())
+ if(maSdrFormTextAttribute.getFormTextDistance())
{
if(aEndPos.equal(aStartPos))
{
@@ -493,7 +493,7 @@ namespace
// use back vector (aStartPos - aEndPos) here to get mirrored perpendicular as in old stuff
const basegfx::B2DVector aPerpendicular(
basegfx::getNormalizedPerpendicular(aStartPos - aEndPos) *
- mrSdrFormTextAttribute.getFormTextDistance());
+ maSdrFormTextAttribute.getFormTextDistance());
aNewTransformB.translate(aPerpendicular.getX(), aPerpendicular.getY());
}
@@ -502,7 +502,7 @@ namespace
{
if(pCandidate->getText().Len() && nNextGlyphLen)
{
- const Color aShadowColor(mrSdrFormTextAttribute.getFormTextShdwColor());
+ const Color aShadowColor(maSdrFormTextAttribute.getFormTextShdwColor());
const basegfx::BColor aRGBShadowColor(aShadowColor.getBColor());
const xub_StrLen nPortionIndex(pCandidate->getPortionIndex(nUsedTextLength, nNextGlyphLen));
const ::std::vector< double > aNewDXArray(
@@ -623,7 +623,7 @@ namespace
{
if(rOutlineAttribute.getTransparence())
{
- // create UnifiedAlphaPrimitive2D
+ // create UnifiedTransparencePrimitive2D
drawinglayer::primitive2d::Primitive2DSequence aStrokePrimitiveSequence(nStrokeCount);
for(sal_uInt32 b(0L); b < nStrokeCount; b++)
@@ -631,8 +631,8 @@ namespace
aStrokePrimitiveSequence[b] = drawinglayer::primitive2d::Primitive2DReference(aStrokePrimitives[b]);
}
- drawinglayer::primitive2d::UnifiedAlphaPrimitive2D* pNew2 =
- new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D(
+ drawinglayer::primitive2d::UnifiedTransparencePrimitive2D* pNew2 =
+ new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(
aStrokePrimitiveSequence,
(double)rOutlineAttribute.getTransparence() / 100.0);
aNewPrimitives.push_back(pNew2);
@@ -712,7 +712,9 @@ void SdrTextObj::impDecomposePathTextPrimitive(
std::vector< drawinglayer::primitive2d::BasePrimitive2D* > aRegularDecomposition;
std::vector< drawinglayer::primitive2d::BasePrimitive2D* > aShadowDecomposition;
impPolygonParagraphHandler aPolygonParagraphHandler(
- rFormTextAttribute, aRegularDecomposition, aShadowDecomposition);
+ rFormTextAttribute,
+ aRegularDecomposition,
+ aShadowDecomposition);
sal_uInt32 a;
for(a = 0L; a < nLoopCount; a++)
@@ -751,10 +753,14 @@ void SdrTextObj::impDecomposePathTextPrimitive(
}
// evtl. add shadow outlines
- if(rFormTextAttribute.getFormTextOutline() && rFormTextAttribute.getShadowOutline())
+ if(rFormTextAttribute.getFormTextOutline()
+ && !rFormTextAttribute.getShadowOutline().isDefault())
{
const drawinglayer::primitive2d::Primitive2DSequence aOutlines(
- impAddPathTextOutlines(aShadowDecomposition, *rFormTextAttribute.getShadowOutline()));
+ impAddPathTextOutlines(
+ aShadowDecomposition,
+ rFormTextAttribute.getShadowOutline()));
+
drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(aRetvalA, aOutlines);
}
}
@@ -770,10 +776,14 @@ void SdrTextObj::impDecomposePathTextPrimitive(
}
// evtl. add outlines
- if(rFormTextAttribute.getFormTextOutline() && rFormTextAttribute.getOutline())
+ if(rFormTextAttribute.getFormTextOutline()
+ && !rFormTextAttribute.getOutline().isDefault())
{
const drawinglayer::primitive2d::Primitive2DSequence aOutlines(
- impAddPathTextOutlines(aRegularDecomposition, *rFormTextAttribute.getOutline()));
+ impAddPathTextOutlines(
+ aRegularDecomposition,
+ rFormTextAttribute.getOutline()));
+
drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(aRetvalB, aOutlines);
}
}
diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index 119141eca5..8cb92ceeb1 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -66,6 +66,7 @@
#include <svx/sdr/contact/viewobjectcontact.hxx>
#include <svx/sdr/contact/displayinfo.hxx>
#include <algorithm>
+#include <svl/smplhint.hxx>
using namespace ::com::sun::star;
@@ -1165,7 +1166,8 @@ sdr::contact::ViewContact& SdrPage::GetViewContact() const
{
if(!mpViewContact)
{
- ((SdrPage*)this)->mpViewContact = ((SdrPage*)this)->CreateObjectSpecificViewContact();
+ const_cast< SdrPage* >(this)->mpViewContact =
+ const_cast< SdrPage* >(this)->CreateObjectSpecificViewContact();
}
return *mpViewContact;
@@ -1173,6 +1175,140 @@ sdr::contact::ViewContact& SdrPage::GetViewContact() const
////////////////////////////////////////////////////////////////////////////////////////////////////
+void SdrPageProperties::ImpRemoveStyleSheet()
+{
+ if(mpStyleSheet)
+ {
+ EndListening(*mpStyleSheet);
+ mpProperties->SetParent(0);
+ mpStyleSheet = 0;
+ }
+}
+
+void SdrPageProperties::ImpAddStyleSheet(SfxStyleSheet& rNewStyleSheet)
+{
+ if(mpStyleSheet != &rNewStyleSheet)
+ {
+ ImpRemoveStyleSheet();
+ mpStyleSheet = &rNewStyleSheet;
+ StartListening(rNewStyleSheet);
+ mpProperties->SetParent(&rNewStyleSheet.GetItemSet());
+ }
+}
+
+void ImpPageChange(SdrPage& rSdrPage)
+{
+ rSdrPage.ActionChanged();
+
+ if(rSdrPage.GetModel())
+ {
+ rSdrPage.GetModel()->SetChanged(true);
+ SdrHint aHint(HINT_PAGEORDERCHG);
+ aHint.SetPage(&rSdrPage);
+ rSdrPage.GetModel()->Broadcast(aHint);
+ }
+}
+
+SdrPageProperties::SdrPageProperties(SdrPage& rSdrPage)
+: SfxListener(),
+ mpSdrPage(&rSdrPage),
+ mpStyleSheet(0),
+ mpProperties(new SfxItemSet(mpSdrPage->GetModel()->GetItemPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST))
+{
+ if(!rSdrPage.IsMasterPage())
+ {
+ mpProperties->Put(XFillStyleItem(XFILL_NONE));
+ }
+}
+
+SdrPageProperties::SdrPageProperties(const SdrPageProperties& rCandidate)
+: SfxListener(),
+ mpSdrPage(rCandidate.mpSdrPage),
+ mpStyleSheet(0),
+ mpProperties(new SfxItemSet(*rCandidate.mpProperties))
+{
+ if(rCandidate.GetStyleSheet())
+ {
+ ImpAddStyleSheet(*rCandidate.GetStyleSheet());
+ }
+}
+
+SdrPageProperties::~SdrPageProperties()
+{
+ ImpRemoveStyleSheet();
+ delete mpProperties;
+}
+
+void SdrPageProperties::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
+{
+ const SfxSimpleHint* pSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if(pSimpleHint)
+ {
+ switch(pSimpleHint->GetId())
+ {
+ case SFX_HINT_DATACHANGED :
+ {
+ // notify change, broadcast
+ ImpPageChange(*mpSdrPage);
+ break;
+ }
+ case SFX_HINT_DYING :
+ {
+ // Style needs to be forgotten
+ ImpRemoveStyleSheet();
+ break;
+ }
+ }
+ }
+}
+
+const SfxItemSet& SdrPageProperties::GetItemSet() const
+{
+ return *mpProperties;
+}
+
+void SdrPageProperties::PutItemSet(const SfxItemSet& rSet)
+{
+ OSL_ENSURE(!mpSdrPage->IsMasterPage(), "Item set at MasterPage Attributes (!)");
+ mpProperties->Put(rSet);
+ ImpPageChange(*mpSdrPage);
+}
+
+void SdrPageProperties::PutItem(const SfxPoolItem& rItem)
+{
+ OSL_ENSURE(!mpSdrPage->IsMasterPage(), "Item set at MasterPage Attributes (!)");
+ mpProperties->Put(rItem);
+ ImpPageChange(*mpSdrPage);
+}
+
+void SdrPageProperties::ClearItem(const sal_uInt16 nWhich)
+{
+ mpProperties->ClearItem(nWhich);
+ ImpPageChange(*mpSdrPage);
+}
+
+void SdrPageProperties::SetStyleSheet(SfxStyleSheet* pStyleSheet)
+{
+ if(pStyleSheet)
+ {
+ ImpAddStyleSheet(*pStyleSheet);
+ }
+ else
+ {
+ ImpRemoveStyleSheet();
+ }
+
+ ImpPageChange(*mpSdrPage);
+}
+
+SfxStyleSheet* SdrPageProperties::GetStyleSheet() const
+{
+ return mpStyleSheet;
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
TYPEINIT1(SdrPage,SdrObjList);
DBG_NAME(SdrPage)
SdrPage::SdrPage(SdrModel& rNewModel, bool bMasterPage)
@@ -1185,7 +1321,7 @@ SdrPage::SdrPage(SdrModel& rNewModel, bool bMasterPage)
nBordRgt(0L),
nBordLwr(0L),
pLayerAdmin(new SdrLayerAdmin(&rNewModel.GetLayerAdmin())),
- pBackgroundObj(0L),
+ mpSdrPageProperties(0),
mpMasterPageDescriptor(0L),
nPageNum(0L),
mbMaster(bMasterPage),
@@ -1197,6 +1333,8 @@ SdrPage::SdrPage(SdrModel& rNewModel, bool bMasterPage)
DBG_CTOR(SdrPage,NULL);
aPrefVisiLayers.SetAll();
eListKind = (bMasterPage) ? SDROBJLIST_MASTERPAGE : SDROBJLIST_DRAWPAGE;
+
+ mpSdrPageProperties = new SdrPageProperties(*this);
}
SdrPage::SdrPage(const SdrPage& rSrcPage)
@@ -1210,7 +1348,7 @@ SdrPage::SdrPage(const SdrPage& rSrcPage)
nBordRgt(rSrcPage.nBordRgt),
nBordLwr(rSrcPage.nBordLwr),
pLayerAdmin(new SdrLayerAdmin(rSrcPage.pModel->GetLayerAdmin())),
- pBackgroundObj(0L),
+ mpSdrPageProperties(0),
mpMasterPageDescriptor(0L),
nPageNum(rSrcPage.nPageNum),
mbMaster(rSrcPage.mbMaster),
@@ -1244,6 +1382,8 @@ SdrPage::SdrPage(const SdrPage& rSrcPage)
mxUnoPage = NULL;
xComponent->dispose();
}
+
+ mpSdrPageProperties = new SdrPageProperties(rSrcPage.getSdrPageProperties());
}
SdrPage::~SdrPage()
@@ -1277,7 +1417,6 @@ SdrPage::~SdrPage()
// when they get called from PageInDestruction().
maPageUsers.clear();
- SdrObject::Free( pBackgroundObj );
delete pLayerAdmin;
TRG_ClearMasterPage();
@@ -1289,6 +1428,11 @@ SdrPage::~SdrPage()
mpViewContact = 0L;
}
+ {
+ delete mpSdrPageProperties;
+ mpSdrPageProperties = 0;
+ }
+
DBG_DTOR(SdrPage,NULL);
}
@@ -1300,8 +1444,6 @@ void SdrPage::operator=(const SdrPage& rSrcPage)
mpViewContact = 0L;
}
- SdrObject::Free( pBackgroundObj );
-
// Joe also sets some parameters for the class this one
// is derived from. SdrObjList does the same bad handling of
// copy constructor and operator=, so i better let it stand here.
@@ -1335,14 +1477,9 @@ void SdrPage::operator=(const SdrPage& rSrcPage)
mbObjectsNotPersistent = rSrcPage.mbObjectsNotPersistent;
- if(rSrcPage.pBackgroundObj)
{
- pBackgroundObj = rSrcPage.pBackgroundObj->Clone();
- pBackgroundObj->SetPage( this );
- pBackgroundObj->SetModel( pModel );
-
- // #i62000# for single-page MPBGO, force no line
- pBackgroundObj->SetMergedItem(XLineStyleItem(XLINE_NONE));
+ delete mpSdrPageProperties;
+ mpSdrPageProperties = new SdrPageProperties(rSrcPage.getSdrPageProperties());
}
// Now copy the contained obejcts (by cloning them)
@@ -1522,8 +1659,9 @@ void SdrPage::SetModel(SdrModel* pNewModel)
}
pLayerAdmin->SetModel(pNewModel);
- if( pBackgroundObj )
- pBackgroundObj->SetModel( pNewModel );
+ SdrPageProperties *pNew = new SdrPageProperties(getSdrPageProperties());
+ delete mpSdrPageProperties;
+ mpSdrPageProperties = pNew;
}
// update listeners at possible api wrapper object
@@ -1657,22 +1795,6 @@ XubString SdrPage::GetLayoutName() const
return String();
}
-void SdrPage::SetBackgroundObj( SdrObject* pObj )
-{
- if ( pObj )
- {
- pObj->SetPage( this );
- pObj->SetModel( pModel );
- pObj->SetLayer( 1 ); // Nothing known about the backgroundlayer...
-
- // #i62000# for single-page MPBGO, force no line
- pObj->SetMergedItem(XLineStyleItem(XLINE_NONE));
- }
-
- SdrObject::Free( pBackgroundObj );
- pBackgroundObj = pObj;
-}
-
void SdrPage::SetInserted( bool bIns )
{
if( mbInserted != bIns )
@@ -1746,38 +1868,17 @@ Color SdrPage::GetPageBackgroundColor( SdrPageView* pView, bool bScreenDisplay )
aColor = pView->GetApplicationDocumentColor();
}
- // first, see if we have a background object
- SdrObject* pBackgroundObj2 = NULL;
-
+ const SfxItemSet* pBackgroundFill = &getSdrPageProperties().GetItemSet();
- if( IsMasterPage() )
- {
- if( GetObjCount() )
- pBackgroundObj2 = GetObj( 0 );
- }
- else
+ if(!IsMasterPage() && TRG_HasMasterPage())
{
- pBackgroundObj2 = GetBackgroundObj();
- if( NULL == pBackgroundObj2 )
+ if(XFILL_NONE == ((const XFillStyleItem&)pBackgroundFill->Get(XATTR_FILLSTYLE)).GetValue())
{
- // if not, see if we have a masterpage and get that background object
- if(TRG_HasMasterPage())
- {
- SdrPage& rMasterPage = TRG_GetMasterPage();
-
- if(rMasterPage.GetObjCount())
- {
- pBackgroundObj2 = rMasterPage.GetObj( 0 );
- }
- }
+ pBackgroundFill = &TRG_GetMasterPage().getSdrPageProperties().GetItemSet();
}
}
- if( pBackgroundObj2 )
- {
- const SfxItemSet& rSet = pBackgroundObj2->GetMergedItemSet();
- GetDraftFillColor( rSet, aColor );
- }
+ GetDraftFillColor(*pBackgroundFill, aColor);
return aColor;
}
diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index 17c5b6be1f..6b58e623e4 100644..100755
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -294,6 +294,9 @@ SdrPaintView::SdrPaintView(SdrModel* pModel1, OutputDevice* pOut)
SdrPaintView::~SdrPaintView()
{
DBG_DTOR(SdrPaintView,NULL);
+ if (pDefaultStyleSheet)
+ EndListening(*pDefaultStyleSheet);
+
maColorConfig.RemoveListener(this);
ClearPageView();
@@ -317,8 +320,16 @@ SdrPaintView::~SdrPaintView()
////////////////////////////////////////////////////////////////////////////////////////////////////
-void __EXPORT SdrPaintView::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
+void __EXPORT SdrPaintView::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
{
+ //If the stylesheet has been destroyed
+ if (&rBC == pDefaultStyleSheet)
+ {
+ if (rHint.ISA(SfxSimpleHint) && ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING)
+ pDefaultStyleSheet = NULL;
+ return;
+ }
+
BOOL bObjChg=!bSomeObjChgdFlag; // TRUE= auswerten fuer ComeBack-Timer
if (bObjChg) {
SdrHint* pSdrHint=PTR_CAST(SdrHint,&rHint);
@@ -333,7 +344,7 @@ void __EXPORT SdrPaintView::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint
if (eKind==HINT_PAGEORDERCHG) {
const SdrPage* pPg=pSdrHint->GetPage();
- if(!pPg->IsInserted())
+ if(pPg && !pPg->IsInserted())
{
if(mpPageView && mpPageView->GetPage() == pPg)
{
@@ -1238,7 +1249,12 @@ void SdrPaintView::SetDefaultAttr(const SfxItemSet& rAttr, BOOL bReplaceAll)
void SdrPaintView::SetDefaultStyleSheet(SfxStyleSheet* pStyleSheet, BOOL bDontRemoveHardAttr)
{
+ if (pDefaultStyleSheet)
+ EndListening(*pDefaultStyleSheet);
pDefaultStyleSheet=pStyleSheet;
+ if (pDefaultStyleSheet)
+ StartListening(*pDefaultStyleSheet);
+
if (pStyleSheet!=NULL && !bDontRemoveHardAttr) {
SfxWhichIter aIter(pStyleSheet->GetItemSet());
USHORT nWhich=aIter.FirstWhich();
diff --git a/svx/source/svdraw/svdscrol.cxx b/svx/source/svdraw/svdscrol.cxx
deleted file mode 100644
index 0e7ebaf7eb..0000000000
--- a/svx/source/svdraw/svdscrol.cxx
+++ /dev/null
@@ -1,33 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#include "svdscrol.hxx"
-
-// eof
diff --git a/svx/source/svdraw/svdscrol.hxx b/svx/source/svdraw/svdscrol.hxx
deleted file mode 100644
index bf900c6380..0000000000
--- a/svx/source/svdraw/svdscrol.hxx
+++ /dev/null
@@ -1,31 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SVDSCROL_HXX
-#define _SVDSCROL_HXX
-
-#endif //_SVDSCROL_HXX
diff --git a/svx/source/table/tablehandles.cxx b/svx/source/table/tablehandles.cxx
index daa2d0242b..648f1fd6b4 100644
--- a/svx/source/table/tablehandles.cxx
+++ b/svx/source/table/tablehandles.cxx
@@ -47,7 +47,7 @@
#include <svx/svdpagv.hxx>
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
#include <svx/sdr/overlay/overlayhatchrect.hxx>
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
+#include <drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx>
namespace sdr { namespace table {
@@ -242,10 +242,11 @@ drawinglayer::primitive2d::Primitive2DSequence OverlayTableEdge::createOverlayOb
}
else
{
- // embed in HitTest primitive to support HitTest of this overlay object
+ // embed in HiddenGeometryPrimitive2D to support HitTest of this invisible
+ // overlay object
const drawinglayer::primitive2d::Primitive2DSequence aSequence(&aReference, 1);
const drawinglayer::primitive2d::Primitive2DReference aNewReference(
- new drawinglayer::primitive2d::HitTestPrimitive2D(aSequence));
+ new drawinglayer::primitive2d::HiddenGeometryPrimitive2D(aSequence));
aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aNewReference, 1);
}
}
diff --git a/svx/source/table/viewcontactoftableobj.cxx b/svx/source/table/viewcontactoftableobj.cxx
index 48c6264caa..5f0af00fc5 100644
--- a/svx/source/table/viewcontactoftableobj.cxx
+++ b/svx/source/table/viewcontactoftableobj.cxx
@@ -34,19 +34,20 @@
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
#include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
-#include <drawinglayer/attribute/fillattribute.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <svx/sdr/attribute/sdrtextattribute.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
#include <editeng/borderline.hxx>
#include <drawinglayer/primitive2d/borderlineprimitive2d.hxx>
+#include <svx/sdr/attribute/sdrfilltextattribute.hxx>
+#include <drawinglayer/attribute/sdrlineattribute.hxx>
+#include <drawinglayer/attribute/sdrshadowattribute.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include "cell.hxx"
#include "tablelayouter.hxx"
@@ -94,34 +95,42 @@ namespace drawinglayer
Primitive2DSequence SdrCellPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const
{
+ // prepare unit polygon
Primitive2DSequence aRetval;
+ const basegfx::B2DPolyPolygon aUnitPolyPolygon(basegfx::tools::createUnitPolygon());
- if(getSdrFTAttribute().getFill() || getSdrFTAttribute().getText())
+ // add fill
+ if(!getSdrFTAttribute().getFill().isDefault())
{
- // prepare unit polygon
- const basegfx::B2DRange aUnitRange(0.0, 0.0, 1.0, 1.0);
- const basegfx::B2DPolyPolygon aUnitPolyPolygon(basegfx::tools::createPolygonFromRect(aUnitRange));
-
- // add fill
- if(getSdrFTAttribute().getFill())
- {
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolyPolygonFillPrimitive(
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolyPolygonFillPrimitive(
aUnitPolyPolygon,
getTransform(),
- *getSdrFTAttribute().getFill(),
+ getSdrFTAttribute().getFill(),
getSdrFTAttribute().getFillFloatTransGradient()));
- }
+ }
+ else
+ {
+ // if no fill create one for HitTest and BoundRect fallback
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createHiddenGeometryPrimitives2D(
+ true,
+ aUnitPolyPolygon,
+ getTransform()));
+ }
- // add text
- if(getSdrFTAttribute().getText())
- {
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(
+ // add text
+ if(!getSdrFTAttribute().getText().isDefault())
+ {
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createTextPrimitive(
aUnitPolyPolygon,
getTransform(),
- *getSdrFTAttribute().getText(),
- 0,
- true, false, false));
- }
+ getSdrFTAttribute().getText(),
+ attribute::SdrLineAttribute(),
+ true,
+ false,
+ false));
}
return aRetval;
@@ -536,14 +545,13 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfTableObj::createViewIndependentPrimitive2DSequence() const
{
- drawinglayer::primitive2d::Primitive2DSequence xRetval;
const sdr::table::SdrTableObj& rTableObj = GetTableObj();
const uno::Reference< com::sun::star::table::XTable > xTable = rTableObj.getTable();
- const SfxItemSet& rObjectItemSet = rTableObj.GetMergedItemSet();
if(xTable.is())
{
// create primitive representation for table
+ drawinglayer::primitive2d::Primitive2DSequence xRetval;
const sal_Int32 nRowCount(xTable->getRowCount());
const sal_Int32 nColCount(xTable->getColumnCount());
const sal_Int32 nAllCount(nRowCount * nColCount);
@@ -596,7 +604,7 @@ namespace sdr
const SfxItemSet& rCellItemSet = xCurrentCell->GetItemSet();
const sal_uInt32 nTextIndex(nColCount * aCellPos.mnRow + aCellPos.mnCol);
const SdrText* pSdrText = rTableObj.getText(nTextIndex);
- drawinglayer::attribute::SdrFillTextAttribute* pAttribute = 0;
+ drawinglayer::attribute::SdrFillTextAttribute aAttribute;
if(pSdrText)
{
@@ -606,7 +614,7 @@ namespace sdr
const sal_Int32 nUpper(xCurrentCell->GetTextUpperDistance());
const sal_Int32 nLower(xCurrentCell->GetTextLowerDistance());
- pAttribute = drawinglayer::primitive2d::createNewSdrFillTextAttribute(
+ aAttribute = drawinglayer::primitive2d::createNewSdrFillTextAttribute(
rCellItemSet,
pSdrText,
&nLeft,
@@ -616,21 +624,17 @@ namespace sdr
}
else
{
- pAttribute = drawinglayer::primitive2d::createNewSdrFillTextAttribute(
+ aAttribute = drawinglayer::primitive2d::createNewSdrFillTextAttribute(
rCellItemSet,
pSdrText);
}
- if(pAttribute)
+ // always create cell primitives for BoundRect and HitTest
{
- if(pAttribute->isVisible())
- {
- const drawinglayer::primitive2d::Primitive2DReference xCellReference(new drawinglayer::primitive2d::SdrCellPrimitive2D(
- aCellMatrix, *pAttribute));
- xCellSequence[nCellInsert++] = xCellReference;
- }
-
- delete pAttribute;
+ const drawinglayer::primitive2d::Primitive2DReference xCellReference(
+ new drawinglayer::primitive2d::SdrCellPrimitive2D(
+ aCellMatrix, aAttribute));
+ xCellSequence[nCellInsert++] = xCellReference;
}
// handle cell borders
@@ -675,21 +679,46 @@ namespace sdr
xRetval = xCellSequence;
drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(xRetval, xBorderSequence);
}
- }
- if(xRetval.hasElements())
- {
- // check and create evtl. shadow for created content
- drawinglayer::attribute::SdrShadowAttribute* pNewShadowAttribute = drawinglayer::primitive2d::createNewSdrShadowAttribute(rObjectItemSet);
-
- if(pNewShadowAttribute)
+ if(xRetval.hasElements())
{
- xRetval = drawinglayer::primitive2d::createEmbeddedShadowPrimitive(xRetval, *pNewShadowAttribute);
- delete pNewShadowAttribute;
+ // check and create evtl. shadow for created content
+ const SfxItemSet& rObjectItemSet = rTableObj.GetMergedItemSet();
+ const drawinglayer::attribute::SdrShadowAttribute aNewShadowAttribute(
+ drawinglayer::primitive2d::createNewSdrShadowAttribute(rObjectItemSet));
+
+ if(!aNewShadowAttribute.isDefault())
+ {
+ xRetval = drawinglayer::primitive2d::createEmbeddedShadowPrimitive(xRetval, aNewShadowAttribute);
+ }
}
- }
- return xRetval;
+ return xRetval;
+ }
+ else
+ {
+ // take unrotated snap rect (direct model data) for position and size
+ const Rectangle& rRectangle = rTableObj.GetGeoRect();
+ const basegfx::B2DRange aObjectRange(
+ rRectangle.Left(), rRectangle.Top(),
+ rRectangle.Right(), rRectangle.Bottom());
+
+ // create object matrix
+ const GeoStat& rGeoStat(rTableObj.GetGeoStat());
+ const double fShearX(rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0);
+ const double fRotate(rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0);
+ const basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ aObjectRange.getWidth(), aObjectRange.getHeight(), fShearX, fRotate,
+ aObjectRange.getMinX(), aObjectRange.getMinY()));
+
+ // credate an invisible outline for the cases where no visible content exists
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
+ false,
+ aObjectMatrix));
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+ }
}
ViewContactOfTableObj::ViewContactOfTableObj(::sdr::table::SdrTableObj& rTableObj)
diff --git a/svx/source/tbxctrls/tbxcolor.cxx b/svx/source/tbxctrls/tbxcolor.cxx
index 65dff84084..40082c4624 100644
--- a/svx/source/tbxctrls/tbxcolor.cxx
+++ b/svx/source/tbxctrls/tbxcolor.cxx
@@ -62,7 +62,7 @@ namespace svx
{
try
{
- Reference< XFrame > xFrame = SfxViewFrame::Current()->GetFrame()->GetFrameInterface();
+ Reference< XFrame > xFrame = SfxViewFrame::Current()->GetFrame().GetFrameInterface();
Reference< XPropertySet > xFrameProps( xFrame, UNO_QUERY );
if ( xFrameProps.is() )
xFrameProps->getPropertyValue( PROPNAME_LAYOUTMANAGER ) >>= m_xLayouter;
diff --git a/svx/source/unodialogs/textconversiondlgs/export.map b/svx/source/unodialogs/textconversiondlgs/export.map
deleted file mode 100644
index ff4971857d..0000000000
--- a/svx/source/unodialogs/textconversiondlgs/export.map
+++ /dev/null
@@ -1,8 +0,0 @@
-EXTDBI_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/svx/source/unodialogs/textconversiondlgs/makefile.mk b/svx/source/unodialogs/textconversiondlgs/makefile.mk
index 6cdec3906c..b5013ca9d1 100644
--- a/svx/source/unodialogs/textconversiondlgs/makefile.mk
+++ b/svx/source/unodialogs/textconversiondlgs/makefile.mk
@@ -59,7 +59,7 @@ SHL1TARGET= txcnvdlg
.ELSE
SHL1TARGET= $(TARGET)$(DLLPOSTFIX)
.ENDIF
-SHL1VERSIONMAP= export.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1STDLIBS= \
$(CPPULIB) \
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx
index be91f08fe5..1c6a0a17eb 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -615,32 +615,17 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
VirtualDevice aVDev;
const MapMode aMap( mpDoc->GetScaleUnit(), Point(), rSettings.maScaleX, rSettings.maScaleY );
- // create a view
- SdrView* pView;
-
- if( PTR_CAST( FmFormModel, mpDoc ) )
- {
- pView = new FmFormView( PTR_CAST( FmFormModel, mpDoc ), &aVDev );
- }
- else
- {
- pView = new SdrView( mpDoc, &aVDev );
- }
-
- pView->SetBordVisible( FALSE );
- pView->SetPageVisible( FALSE );
- pView->ShowSdrPage( pPage );
-
SdrOutliner& rOutl=mpDoc->GetDrawOutliner(NULL);
maOldCalcFieldValueHdl = rOutl.GetCalcFieldValueHdl();
rOutl.SetCalcFieldValueHdl( LINK(this, GraphicExporter, CalcFieldValueHdl) );
- rOutl.SetBackgroundColor( pPage->GetPageBackgroundColor(pView->GetSdrPageView()) );
+ rOutl.SetBackgroundColor( pPage->GetPageBackgroundColor() );
// #i102251#
const sal_uInt32 nOldCntrl(rOutl.GetControlWord());
sal_uInt32 nCntrl = nOldCntrl & ~EE_CNTRL_ONLINESPELLING;
rOutl.SetControlWord(nCntrl);
+ SdrObject* pTempBackgroundShape = 0;
std::vector< SdrObject* > aShapes;
bool bRet = true;
@@ -649,19 +634,10 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
{
if( rSettings.mbExportOnlyBackground )
{
- SdrObject* pShape = 0;
- if( pPage->IsMasterPage() )
- {
- if( pPage->GetObjCount() > 0 )
- pShape = pPage->GetObj(0);
- }
- else
- {
- pShape = pPage->GetBackgroundObj();
- }
-
- if( pShape )
- aShapes.push_back( pShape );
+ pTempBackgroundShape = new SdrRectObj(Rectangle(Point(0,0), pPage->GetSize()));
+ pTempBackgroundShape->SetMergedItemSet(pPage->getSdrPageProperties().GetItemSet());
+ pTempBackgroundShape->SetMergedItem(XLineStyleItem(XLINE_NONE));
+ aShapes.push_back(pTempBackgroundShape);
}
else
{
@@ -738,8 +714,24 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
aVDev.SetDrawMode( aVDev.GetDrawMode() | DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT );
aVDev.EnableOutput( FALSE );
aMtf.Record( &aVDev );
-
Size aNewSize;
+
+ // create a view
+ SdrView* pView;
+
+ if( PTR_CAST( FmFormModel, mpDoc ) )
+ {
+ pView = new FmFormView( PTR_CAST( FmFormModel, mpDoc ), &aVDev );
+ }
+ else
+ {
+ pView = new SdrView( mpDoc, &aVDev );
+ }
+
+ pView->SetBordVisible( FALSE );
+ pView->SetPageVisible( FALSE );
+ pView->ShowSdrPage( pPage );
+
if ( pView && pPage )
{
pView->SetBordVisible( FALSE );
@@ -780,6 +772,12 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
aGraphic = Graphic(aMtf);
}
+ if ( pView )
+ {
+ pView->HideSdrPage();
+ delete pView;
+ }
+
if( rSettings.mbTranslucent )
{
Size aOutSize;
@@ -904,15 +902,6 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
// calculate bound rect for all shapes
Rectangle aBound;
- if(rSettings.mbExportOnlyBackground)
- {
- // shape is MPBGO and if it's not yet set, it's size will
- // be empty when using GetCurrentBoundRect(). Since anyways
- // the page size is used by MPBGO and MPBGO is EOLd, get
- // the wanted size from the page model directly
- aBound = Rectangle(Point(0,0), pPage->GetSize());
- }
- else
{
std::vector< SdrObject* >::iterator aIter = aShapes.begin();
const std::vector< SdrObject* >::iterator aEnd = aShapes.end();
@@ -986,10 +975,9 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
}
}
- if ( pView )
+ if(pTempBackgroundShape)
{
- pView->HideSdrPage();
- delete pView;
+ SdrObject::Free(pTempBackgroundShape);
}
rOutl.SetCalcFieldValueHdl( maOldCalcFieldValueHdl );
diff --git a/svx/source/xml/xmlexport.cxx b/svx/source/xml/xmlexport.cxx
index 87c53533c1..25577a3fed 100644
--- a/svx/source/xml/xmlexport.cxx
+++ b/svx/source/xml/xmlexport.cxx
@@ -28,6 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
#include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
#include <com/sun/star/xml/sax/InputSource.hpp>
#include <com/sun/star/xml/sax/XParser.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -52,12 +53,12 @@ using ::rtl::OUString;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
-sal_Bool SvxDrawingLayerExport( SdrModel* pModel, uno::Reference<io::XOutputStream> xOut, Reference< lang::XComponent > xComponent )
+sal_Bool SvxDrawingLayerExport( SdrModel* pModel, const uno::Reference<io::XOutputStream>& xOut, const Reference< lang::XComponent >& xComponent )
{
return SvxDrawingLayerExport( pModel, xOut, xComponent, "com.sun.star.comp.DrawingLayer.XMLExporter" );
}
-sal_Bool SvxDrawingLayerExport( SdrModel* pModel, uno::Reference<io::XOutputStream> xOut, Reference< lang::XComponent > xComponent, const char* pExportService )
+sal_Bool SvxDrawingLayerExport( SdrModel* pModel, const uno::Reference<io::XOutputStream>& xOut, const Reference< lang::XComponent >& xComponent, const char* pExportService )
{
sal_Bool bDocRet = xOut.is();
@@ -67,12 +68,13 @@ sal_Bool SvxDrawingLayerExport( SdrModel* pModel, uno::Reference<io::XOutputStre
Reference< document::XEmbeddedObjectResolver > xObjectResolver;
SvXMLEmbeddedObjectHelper *pObjectHelper = 0;
+ Reference< lang::XComponent > xSourceDoc( xComponent );
try
{
- if( !xComponent.is() )
+ if( !xSourceDoc.is() )
{
- xComponent = new SvxUnoDrawingModel( pModel );
- pModel->setUnoModel( Reference< XInterface >::query( xComponent ) );
+ xSourceDoc = new SvxUnoDrawingModel( pModel );
+ pModel->setUnoModel( Reference< XInterface >::query( xSourceDoc ) );
}
uno::Reference< lang::XMultiServiceFactory> xServiceFactory( ::comphelper::getProcessServiceFactory() );
@@ -127,7 +129,7 @@ sal_Bool SvxDrawingLayerExport( SdrModel* pModel, uno::Reference<io::XOutputStre
uno::Reference< document::XExporter > xExporter( xFilter, uno::UNO_QUERY );
if( xExporter.is() )
{
- xExporter->setSourceDocument( xComponent );
+ xExporter->setSourceDocument( xSourceDoc );
uno::Sequence< beans::PropertyValue > aDescriptor( 0 );
bDocRet = xFilter->filter( aDescriptor );
@@ -138,11 +140,7 @@ sal_Bool SvxDrawingLayerExport( SdrModel* pModel, uno::Reference<io::XOutputStre
}
catch(uno::Exception e)
{
-#if OSL_DEBUG_LEVEL > 1
- ByteString aError( "uno Exception caught while exporting:\n" );
- aError += ByteString( String( e.Message), RTL_TEXTENCODING_ASCII_US );
- DBG_ERROR( aError.GetBuffer() );
-#endif
+ DBG_UNHANDLED_EXCEPTION();
bDocRet = sal_False;
}
@@ -157,7 +155,7 @@ sal_Bool SvxDrawingLayerExport( SdrModel* pModel, uno::Reference<io::XOutputStre
return bDocRet;
}
-sal_Bool SvxDrawingLayerExport( SdrModel* pModel, uno::Reference<io::XOutputStream> xOut )
+sal_Bool SvxDrawingLayerExport( SdrModel* pModel, const uno::Reference<io::XOutputStream>& xOut )
{
Reference< lang::XComponent > xComponent;
return SvxDrawingLayerExport( pModel, xOut, xComponent );
@@ -165,12 +163,12 @@ sal_Bool SvxDrawingLayerExport( SdrModel* pModel, uno::Reference<io::XOutputStre
//-////////////////////////////////////////////////////////////////////
-sal_Bool SvxDrawingLayerImport( SdrModel* pModel, uno::Reference<io::XInputStream> xInputStream, Reference< lang::XComponent > xComponent )
+sal_Bool SvxDrawingLayerImport( SdrModel* pModel, const uno::Reference<io::XInputStream>& xInputStream, const Reference< lang::XComponent >& xComponent )
{
return SvxDrawingLayerImport( pModel, xInputStream, xComponent, "com.sun.star.comp.Draw.XMLOasisImporter" );
}
-sal_Bool SvxDrawingLayerImport( SdrModel* pModel, uno::Reference<io::XInputStream> xInputStream, Reference< lang::XComponent > xComponent, const char* pImportService )
+sal_Bool SvxDrawingLayerImport( SdrModel* pModel, const uno::Reference<io::XInputStream>& xInputStream, const Reference< lang::XComponent >& xComponent, const char* pImportService )
{
sal_uInt32 nRet = 0;
@@ -180,13 +178,14 @@ sal_Bool SvxDrawingLayerImport( SdrModel* pModel, uno::Reference<io::XInputStrea
Reference< document::XEmbeddedObjectResolver > xObjectResolver;
SvXMLEmbeddedObjectHelper *pObjectHelper = 0;
- if( !xComponent.is() )
+ Reference< lang::XComponent > xTargetDocument( xComponent );
+ if( !xTargetDocument.is() )
{
- xComponent = new SvxUnoDrawingModel( pModel );
- pModel->setUnoModel( Reference< XInterface >::query( xComponent ) );
+ xTargetDocument = new SvxUnoDrawingModel( pModel );
+ pModel->setUnoModel( Reference< XInterface >::query( xTargetDocument ) );
}
- Reference< frame::XModel > xModel( xComponent, UNO_QUERY );
+ Reference< frame::XModel > xTargetModel( xTargetDocument, UNO_QUERY );
try
{
@@ -199,7 +198,8 @@ sal_Bool SvxDrawingLayerImport( SdrModel* pModel, uno::Reference<io::XInputStrea
if( 0 == nRet )
{
- xModel->lockControllers();
+ if ( xTargetModel.is() )
+ xTargetModel->lockControllers();
// -------------------------------------
@@ -248,7 +248,7 @@ sal_Bool SvxDrawingLayerImport( SdrModel* pModel, uno::Reference<io::XInputStrea
// connect model and filter
uno::Reference < document::XImporter > xImporter( xFilter, UNO_QUERY );
- xImporter->setTargetDocument( xComponent );
+ xImporter->setTargetDocument( xTargetDocument );
// finally, parser the stream
xParser->parseStream( aParserInput );
@@ -257,45 +257,9 @@ sal_Bool SvxDrawingLayerImport( SdrModel* pModel, uno::Reference<io::XInputStrea
}
}
}
- catch( xml::sax::SAXParseException& r )
- {
-#if OSL_DEBUG_LEVEL > 1
- ByteString aError( "SAX parse exception catched while importing:\n" );
- aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US );
- DBG_ERROR( aError.GetBuffer() );
-#else
- (void) r; // avoid warnings
-#endif
- }
- catch( xml::sax::SAXException& r )
- {
-#if OSL_DEBUG_LEVEL > 1
- ByteString aError( "SAX exception catched while importing:\n" );
- aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US );
- DBG_ERROR( aError.GetBuffer() );
-#else
- (void) r; // avoid warnings
-#endif
- }
- catch( io::IOException& r )
- {
-#if OSL_DEBUG_LEVEL > 1
- ByteString aError( "IO exception catched while importing:\n" );
- aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US );
- DBG_ERROR( aError.GetBuffer() );
-#else
- (void) r; // avoid warnings
-#endif
- }
catch( uno::Exception& r )
{
-#if OSL_DEBUG_LEVEL > 1
- ByteString aError( "uno exception catched while importing:\n" );
- aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US );
- DBG_ERROR( aError.GetBuffer() );
-#else
- (void) r; // avoid warnings
-#endif
+ DBG_UNHANDLED_EXCEPTION();
}
if( pGraphicHelper )
@@ -306,13 +270,13 @@ sal_Bool SvxDrawingLayerImport( SdrModel* pModel, uno::Reference<io::XInputStrea
SvXMLEmbeddedObjectHelper::Destroy( pObjectHelper );
xObjectResolver = 0;
- if( xModel.is() )
- xModel->unlockControllers();
+ if ( xTargetModel.is() )
+ xTargetModel->unlockControllers();
return nRet == 0;
}
-sal_Bool SvxDrawingLayerImport( SdrModel* pModel, uno::Reference<io::XInputStream> xInputStream )
+sal_Bool SvxDrawingLayerImport( SdrModel* pModel, const uno::Reference<io::XInputStream>& xInputStream )
{
Reference< lang::XComponent > xComponent;
return SvxDrawingLayerImport( pModel, xInputStream, xComponent );
diff --git a/svx/xml/AccessibleEditableTextPara.xml b/svx/xml/AccessibleEditableTextPara.xml
index 1859980760..affb15f4dd 100644
--- a/svx/xml/AccessibleEditableTextPara.xml
+++ b/svx/xml/AccessibleEditableTextPara.xml
@@ -28,6 +28,7 @@ title="Link to a general description of UNO accessibility"/>
<type>com.sun.star.accessibility.XAccessibleEventBroadcaster</type>
<type>com.sun.star.accessibility.XAccessibleComponent</type>
<type>com.sun.star.accessibility.XAccessibleEditableText</type>
+<type>com.sun.star.accessibility.XAccessibleHyperext</type>
<type>com.sun.star.accessibility.XAccessibleTextAttributes</type>
<type>com.sun.star.lang.XTypeProvider</type>
<type>com.sun.star.lang.XServiceInfo</type>
diff --git a/sysui/desktop/freedesktop/freedesktop-menus.spec b/sysui/desktop/freedesktop/freedesktop-menus.spec
index 14a7c7795b..501f8432d9 100644
--- a/sysui/desktop/freedesktop/freedesktop-menus.spec
+++ b/sysui/desktop/freedesktop/freedesktop-menus.spec
@@ -325,6 +325,7 @@ done
/usr/share/applications/%unixfilename-printeradmin.desktop
/usr/share/applications/%unixfilename-writer.desktop
/usr/share/applications/%unixfilename-startcenter.desktop
+/usr/share/applications/%unixfilename-javafilter.desktop
/usr/share/icons/gnome/*/apps/*png
/usr/share/icons/gnome/*/mimetypes/*png
/usr/share/icons/hicolor/*/apps/*png
diff --git a/sysui/desktop/icons/database.icns b/sysui/desktop/icons/database.icns
new file mode 100644
index 0000000000..115dc859cd
--- /dev/null
+++ b/sysui/desktop/icons/database.icns
Binary files differ
diff --git a/sysui/desktop/icons/database.ico b/sysui/desktop/icons/database.ico
new file mode 100644
index 0000000000..171d39bb96
--- /dev/null
+++ b/sysui/desktop/icons/database.ico
Binary files differ
diff --git a/sysui/desktop/icons/drawing-template.icns b/sysui/desktop/icons/drawing-template.icns
index 359164f314..407484582f 100644
--- a/sysui/desktop/icons/drawing-template.icns
+++ b/sysui/desktop/icons/drawing-template.icns
Binary files differ
diff --git a/sysui/desktop/icons/drawing-template.ico b/sysui/desktop/icons/drawing-template.ico
new file mode 100644
index 0000000000..5b5a74e99f
--- /dev/null
+++ b/sysui/desktop/icons/drawing-template.ico
Binary files differ
diff --git a/sysui/desktop/icons/drawing.icns b/sysui/desktop/icons/drawing.icns
index 81777c7f92..5322625b05 100644
--- a/sysui/desktop/icons/drawing.icns
+++ b/sysui/desktop/icons/drawing.icns
Binary files differ
diff --git a/sysui/desktop/icons/drawing.ico b/sysui/desktop/icons/drawing.ico
new file mode 100644
index 0000000000..1065490a28
--- /dev/null
+++ b/sysui/desktop/icons/drawing.ico
Binary files differ
diff --git a/sysui/desktop/icons/empty-document.icns b/sysui/desktop/icons/empty-document.icns
index 18d1133eb6..ab676f6ef8 100644
--- a/sysui/desktop/icons/empty-document.icns
+++ b/sysui/desktop/icons/empty-document.icns
Binary files differ
diff --git a/sysui/desktop/icons/empty-document.ico b/sysui/desktop/icons/empty-document.ico
new file mode 100644
index 0000000000..4115c30896
--- /dev/null
+++ b/sysui/desktop/icons/empty-document.ico
Binary files differ
diff --git a/sysui/desktop/icons/empty-template.icns b/sysui/desktop/icons/empty-template.icns
index 034d30bccb..50e63b9425 100644
--- a/sysui/desktop/icons/empty-template.icns
+++ b/sysui/desktop/icons/empty-template.icns
Binary files differ
diff --git a/sysui/desktop/icons/empty-template.ico b/sysui/desktop/icons/empty-template.ico
new file mode 100644
index 0000000000..dec147610a
--- /dev/null
+++ b/sysui/desktop/icons/empty-template.ico
Binary files differ
diff --git a/sysui/desktop/icons/formula.icns b/sysui/desktop/icons/formula.icns
index 61cd00a0e0..4620688c79 100644
--- a/sysui/desktop/icons/formula.icns
+++ b/sysui/desktop/icons/formula.icns
Binary files differ
diff --git a/sysui/desktop/icons/formula.ico b/sysui/desktop/icons/formula.ico
new file mode 100644
index 0000000000..e06aef1877
--- /dev/null
+++ b/sysui/desktop/icons/formula.ico
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/128x128/apps/base.png b/sysui/desktop/icons/hicolor/128x128/apps/base.png
index 42b027626c..398c2f058d 100755
--- a/sysui/desktop/icons/hicolor/128x128/apps/base.png
+++ b/sysui/desktop/icons/hicolor/128x128/apps/base.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/128x128/apps/calc.png b/sysui/desktop/icons/hicolor/128x128/apps/calc.png
index 368fb03e2d..8156308833 100644
--- a/sysui/desktop/icons/hicolor/128x128/apps/calc.png
+++ b/sysui/desktop/icons/hicolor/128x128/apps/calc.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/128x128/apps/draw.png b/sysui/desktop/icons/hicolor/128x128/apps/draw.png
index 72b67c8312..3f71b25fe1 100755
--- a/sysui/desktop/icons/hicolor/128x128/apps/draw.png
+++ b/sysui/desktop/icons/hicolor/128x128/apps/draw.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/128x128/apps/impress.png b/sysui/desktop/icons/hicolor/128x128/apps/impress.png
index 32ad785e16..b62b449e57 100755
--- a/sysui/desktop/icons/hicolor/128x128/apps/impress.png
+++ b/sysui/desktop/icons/hicolor/128x128/apps/impress.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/128x128/apps/main.png b/sysui/desktop/icons/hicolor/128x128/apps/main.png
index fd68a10960..1b51a60bdd 100755
--- a/sysui/desktop/icons/hicolor/128x128/apps/main.png
+++ b/sysui/desktop/icons/hicolor/128x128/apps/main.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/128x128/apps/math.png b/sysui/desktop/icons/hicolor/128x128/apps/math.png
index 79e71ce223..d37c98aa40 100755
--- a/sysui/desktop/icons/hicolor/128x128/apps/math.png
+++ b/sysui/desktop/icons/hicolor/128x128/apps/math.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/128x128/apps/writer.png b/sysui/desktop/icons/hicolor/128x128/apps/writer.png
index 0d057fa4ba..b991a6d2e2 100755
--- a/sysui/desktop/icons/hicolor/128x128/apps/writer.png
+++ b/sysui/desktop/icons/hicolor/128x128/apps/writer.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/database.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/database.png
new file mode 100644
index 0000000000..93b8e60cb2
--- /dev/null
+++ b/sysui/desktop/icons/hicolor/128x128/mimetypes/database.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/drawing-template.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/drawing-template.png
new file mode 100644
index 0000000000..15b80e0393
--- /dev/null
+++ b/sysui/desktop/icons/hicolor/128x128/mimetypes/drawing-template.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/drawing.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/drawing.png
new file mode 100644
index 0000000000..9d47f747df
--- /dev/null
+++ b/sysui/desktop/icons/hicolor/128x128/mimetypes/drawing.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/formula.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/formula.png
new file mode 100644
index 0000000000..184dd0ca6c
--- /dev/null
+++ b/sysui/desktop/icons/hicolor/128x128/mimetypes/formula.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/master-document.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/master-document.png
new file mode 100644
index 0000000000..acf19ff835
--- /dev/null
+++ b/sysui/desktop/icons/hicolor/128x128/mimetypes/master-document.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-database.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-database.png
index 1429d82ce8..f95bbf137a 100755
--- a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-database.png
+++ b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-database.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-drawing-template.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-drawing-template.png
index 4fdde3c34c..630a51ebb4 100755
--- a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-drawing-template.png
+++ b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-drawing-template.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-drawing.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-drawing.png
index 7272482a04..82ac8d15bf 100755
--- a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-drawing.png
+++ b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-drawing.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-formula.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-formula.png
index 9e4c72eab7..c838eaa128 100755
--- a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-formula.png
+++ b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-formula.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-master-document.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-master-document.png
index 6f191e2cf0..640e2d9861 100755
--- a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-master-document.png
+++ b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-master-document.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-presentation-template.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-presentation-template.png
index bf8229c1f5..c4954802e8 100755
--- a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-presentation-template.png
+++ b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-presentation-template.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-presentation.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-presentation.png
index 2b3a5bb900..1d5acededb 100755
--- a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-presentation.png
+++ b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-presentation.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-spreadsheet-template.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-spreadsheet-template.png
index 18c00ad4bb..01781db415 100644
--- a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-spreadsheet-template.png
+++ b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-spreadsheet-template.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-spreadsheet.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-spreadsheet.png
index ca480522d8..bc46714afa 100644
--- a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-spreadsheet.png
+++ b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-spreadsheet.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-text-template.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-text-template.png
index ef5b5dd7a5..569bd514fc 100755
--- a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-text-template.png
+++ b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-text-template.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-text.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-text.png
index 178d4e26d9..b45244ac1a 100755
--- a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-text.png
+++ b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-text.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-web-template.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-web-template.png
index 7edd66d369..8e6c4580e9 100755
--- a/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-web-template.png
+++ b/sysui/desktop/icons/hicolor/128x128/mimetypes/oasis-web-template.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/presentation-template.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/presentation-template.png
new file mode 100644
index 0000000000..c8a3813188
--- /dev/null
+++ b/sysui/desktop/icons/hicolor/128x128/mimetypes/presentation-template.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/presentation.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/presentation.png
new file mode 100644
index 0000000000..2a0552eb62
--- /dev/null
+++ b/sysui/desktop/icons/hicolor/128x128/mimetypes/presentation.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/spreadsheet-template.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/spreadsheet-template.png
new file mode 100644
index 0000000000..cc7aa51bcb
--- /dev/null
+++ b/sysui/desktop/icons/hicolor/128x128/mimetypes/spreadsheet-template.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/spreadsheet.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/spreadsheet.png
new file mode 100644
index 0000000000..c701fd7b5d
--- /dev/null
+++ b/sysui/desktop/icons/hicolor/128x128/mimetypes/spreadsheet.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/text-template.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/text-template.png
new file mode 100644
index 0000000000..652c1ce480
--- /dev/null
+++ b/sysui/desktop/icons/hicolor/128x128/mimetypes/text-template.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/128x128/mimetypes/text.png b/sysui/desktop/icons/hicolor/128x128/mimetypes/text.png
new file mode 100644
index 0000000000..f881aca218
--- /dev/null
+++ b/sysui/desktop/icons/hicolor/128x128/mimetypes/text.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/16x16/apps/base.png b/sysui/desktop/icons/hicolor/16x16/apps/base.png
index 3a08ee1182..57a4477cc6 100644
--- a/sysui/desktop/icons/hicolor/16x16/apps/base.png
+++ b/sysui/desktop/icons/hicolor/16x16/apps/base.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/16x16/apps/calc.png b/sysui/desktop/icons/hicolor/16x16/apps/calc.png
index 2dc540711b..78f923d0ed 100644
--- a/sysui/desktop/icons/hicolor/16x16/apps/calc.png
+++ b/sysui/desktop/icons/hicolor/16x16/apps/calc.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/16x16/apps/draw.png b/sysui/desktop/icons/hicolor/16x16/apps/draw.png
index afc037060d..7779dd46f3 100644
--- a/sysui/desktop/icons/hicolor/16x16/apps/draw.png
+++ b/sysui/desktop/icons/hicolor/16x16/apps/draw.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/16x16/apps/impress.png b/sysui/desktop/icons/hicolor/16x16/apps/impress.png
index f1957da748..ff07597b1d 100644
--- a/sysui/desktop/icons/hicolor/16x16/apps/impress.png
+++ b/sysui/desktop/icons/hicolor/16x16/apps/impress.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/16x16/apps/main.png b/sysui/desktop/icons/hicolor/16x16/apps/main.png
new file mode 100755
index 0000000000..3aa8f08a8c
--- /dev/null
+++ b/sysui/desktop/icons/hicolor/16x16/apps/main.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/16x16/apps/math.png b/sysui/desktop/icons/hicolor/16x16/apps/math.png
index de1488226a..10c71e6caa 100644
--- a/sysui/desktop/icons/hicolor/16x16/apps/math.png
+++ b/sysui/desktop/icons/hicolor/16x16/apps/math.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/16x16/apps/printeradmin.png b/sysui/desktop/icons/hicolor/16x16/apps/printeradmin.png
index 4e8eb0e49d..399076c993 100644..100755
--- a/sysui/desktop/icons/hicolor/16x16/apps/printeradmin.png
+++ b/sysui/desktop/icons/hicolor/16x16/apps/printeradmin.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/16x16/apps/writer.png b/sysui/desktop/icons/hicolor/16x16/apps/writer.png
index 8304269862..2b82110e18 100644
--- a/sysui/desktop/icons/hicolor/16x16/apps/writer.png
+++ b/sysui/desktop/icons/hicolor/16x16/apps/writer.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/database.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/database.png
index bbf485561e..fb32e00a1b 100644
--- a/sysui/desktop/icons/hicolor/16x16/mimetypes/database.png
+++ b/sysui/desktop/icons/hicolor/16x16/mimetypes/database.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/drawing-template.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/drawing-template.png
index 74770d5d48..f045190f39 100644
--- a/sysui/desktop/icons/hicolor/16x16/mimetypes/drawing-template.png
+++ b/sysui/desktop/icons/hicolor/16x16/mimetypes/drawing-template.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/drawing.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/drawing.png
index 30303797ba..3bd7b7d29c 100644
--- a/sysui/desktop/icons/hicolor/16x16/mimetypes/drawing.png
+++ b/sysui/desktop/icons/hicolor/16x16/mimetypes/drawing.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/formula.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/formula.png
index 3eb7f884f9..e7e95875ef 100644
--- a/sysui/desktop/icons/hicolor/16x16/mimetypes/formula.png
+++ b/sysui/desktop/icons/hicolor/16x16/mimetypes/formula.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/master-document.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/master-document.png
index c424e4fbf4..e442a0c098 100644
--- a/sysui/desktop/icons/hicolor/16x16/mimetypes/master-document.png
+++ b/sysui/desktop/icons/hicolor/16x16/mimetypes/master-document.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-database.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-database.png
index 2f2d56dd0d..e4ae28570f 100644
--- a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-database.png
+++ b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-database.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-drawing-template.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-drawing-template.png
index 94f4ac9ec5..eaad54fcdf 100644
--- a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-drawing-template.png
+++ b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-drawing-template.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-drawing.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-drawing.png
index d65439afbc..3d66cc97eb 100644
--- a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-drawing.png
+++ b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-drawing.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-formula.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-formula.png
index 9c628ce789..4cefbb690d 100644
--- a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-formula.png
+++ b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-formula.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-master-document.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-master-document.png
index 137778d11f..12aab4a27c 100644
--- a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-master-document.png
+++ b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-master-document.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-presentation-template.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-presentation-template.png
index 3153d8e3c7..9f281836d7 100644
--- a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-presentation-template.png
+++ b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-presentation-template.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-presentation.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-presentation.png
index c642127abc..46942cba28 100644
--- a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-presentation.png
+++ b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-presentation.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-spreadsheet-template.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-spreadsheet-template.png
index 689bb5aef4..4781bfc3a6 100644
--- a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-spreadsheet-template.png
+++ b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-spreadsheet-template.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-spreadsheet.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-spreadsheet.png
index f51a29a854..abc38d4310 100644
--- a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-spreadsheet.png
+++ b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-spreadsheet.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-text-template.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-text-template.png
index 1c20ed072b..9836814c6c 100644
--- a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-text-template.png
+++ b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-text-template.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-text.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-text.png
index 8b095bfcba..06c1f30c8f 100644
--- a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-text.png
+++ b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-text.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-web-template.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-web-template.png
index 795d92615e..01c04a0ea6 100644
--- a/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-web-template.png
+++ b/sysui/desktop/icons/hicolor/16x16/mimetypes/oasis-web-template.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/presentation-template.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/presentation-template.png
index bb20d139e1..df1d5293a8 100644
--- a/sysui/desktop/icons/hicolor/16x16/mimetypes/presentation-template.png
+++ b/sysui/desktop/icons/hicolor/16x16/mimetypes/presentation-template.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/presentation.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/presentation.png
index b82ddf7209..6803ae4c74 100644
--- a/sysui/desktop/icons/hicolor/16x16/mimetypes/presentation.png
+++ b/sysui/desktop/icons/hicolor/16x16/mimetypes/presentation.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/spreadsheet-template.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/spreadsheet-template.png
index 3546349b59..5be785e40f 100644
--- a/sysui/desktop/icons/hicolor/16x16/mimetypes/spreadsheet-template.png
+++ b/sysui/desktop/icons/hicolor/16x16/mimetypes/spreadsheet-template.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/spreadsheet.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/spreadsheet.png
index df164ff2ca..46c72242a0 100644
--- a/sysui/desktop/icons/hicolor/16x16/mimetypes/spreadsheet.png
+++ b/sysui/desktop/icons/hicolor/16x16/mimetypes/spreadsheet.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/text-template.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/text-template.png
index 4d89528825..2827f29f3a 100644
--- a/sysui/desktop/icons/hicolor/16x16/mimetypes/text-template.png
+++ b/sysui/desktop/icons/hicolor/16x16/mimetypes/text-template.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/16x16/mimetypes/text.png b/sysui/desktop/icons/hicolor/16x16/mimetypes/text.png
index 6ff2517af4..c0d1cd3dcc 100644
--- a/sysui/desktop/icons/hicolor/16x16/mimetypes/text.png
+++ b/sysui/desktop/icons/hicolor/16x16/mimetypes/text.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/32x32/apps/base.png b/sysui/desktop/icons/hicolor/32x32/apps/base.png
index f30fe4a53c..f4772d75da 100644
--- a/sysui/desktop/icons/hicolor/32x32/apps/base.png
+++ b/sysui/desktop/icons/hicolor/32x32/apps/base.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/32x32/apps/calc.png b/sysui/desktop/icons/hicolor/32x32/apps/calc.png
index 4e7e423d71..a1eae7b37a 100644
--- a/sysui/desktop/icons/hicolor/32x32/apps/calc.png
+++ b/sysui/desktop/icons/hicolor/32x32/apps/calc.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/32x32/apps/draw.png b/sysui/desktop/icons/hicolor/32x32/apps/draw.png
index f34faf5b51..4dc928a351 100644
--- a/sysui/desktop/icons/hicolor/32x32/apps/draw.png
+++ b/sysui/desktop/icons/hicolor/32x32/apps/draw.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/32x32/apps/impress.png b/sysui/desktop/icons/hicolor/32x32/apps/impress.png
index 7b8ec6432f..9abced7df4 100644
--- a/sysui/desktop/icons/hicolor/32x32/apps/impress.png
+++ b/sysui/desktop/icons/hicolor/32x32/apps/impress.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/32x32/apps/main.png b/sysui/desktop/icons/hicolor/32x32/apps/main.png
new file mode 100755
index 0000000000..296c6f4c58
--- /dev/null
+++ b/sysui/desktop/icons/hicolor/32x32/apps/main.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/32x32/apps/math.png b/sysui/desktop/icons/hicolor/32x32/apps/math.png
index 6c3c3b68f0..146a7dea71 100644
--- a/sysui/desktop/icons/hicolor/32x32/apps/math.png
+++ b/sysui/desktop/icons/hicolor/32x32/apps/math.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/32x32/apps/printeradmin.png b/sysui/desktop/icons/hicolor/32x32/apps/printeradmin.png
index 2c7a0c03f8..b09999c7d0 100644..100755
--- a/sysui/desktop/icons/hicolor/32x32/apps/printeradmin.png
+++ b/sysui/desktop/icons/hicolor/32x32/apps/printeradmin.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/32x32/apps/writer.png b/sysui/desktop/icons/hicolor/32x32/apps/writer.png
index 8a59432558..97b9d3f5cf 100644
--- a/sysui/desktop/icons/hicolor/32x32/apps/writer.png
+++ b/sysui/desktop/icons/hicolor/32x32/apps/writer.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/database.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/database.png
index 709903d46c..6e0a4b8f60 100644
--- a/sysui/desktop/icons/hicolor/32x32/mimetypes/database.png
+++ b/sysui/desktop/icons/hicolor/32x32/mimetypes/database.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/drawing-template.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/drawing-template.png
index 76e5abdab9..a341632dab 100644
--- a/sysui/desktop/icons/hicolor/32x32/mimetypes/drawing-template.png
+++ b/sysui/desktop/icons/hicolor/32x32/mimetypes/drawing-template.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/drawing.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/drawing.png
index 380c60a7df..4abe5c0f80 100644
--- a/sysui/desktop/icons/hicolor/32x32/mimetypes/drawing.png
+++ b/sysui/desktop/icons/hicolor/32x32/mimetypes/drawing.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/formula.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/formula.png
index 37306ac617..d989593924 100644
--- a/sysui/desktop/icons/hicolor/32x32/mimetypes/formula.png
+++ b/sysui/desktop/icons/hicolor/32x32/mimetypes/formula.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/master-document.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/master-document.png
index 1f3e799276..d4b033f4aa 100644
--- a/sysui/desktop/icons/hicolor/32x32/mimetypes/master-document.png
+++ b/sysui/desktop/icons/hicolor/32x32/mimetypes/master-document.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-database.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-database.png
index ddfcd7d195..461bdf37b7 100644
--- a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-database.png
+++ b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-database.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-drawing-template.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-drawing-template.png
index e742adc402..cdc2f2df0f 100644
--- a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-drawing-template.png
+++ b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-drawing-template.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-drawing.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-drawing.png
index 8d78d91c18..55dda2143e 100644
--- a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-drawing.png
+++ b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-drawing.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-formula.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-formula.png
index 302c7ab633..6b8f2f7322 100644
--- a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-formula.png
+++ b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-formula.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-master-document.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-master-document.png
index fc032402b7..234bac461e 100644
--- a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-master-document.png
+++ b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-master-document.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-presentation-template.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-presentation-template.png
index 03c96f8dd8..0125160652 100644
--- a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-presentation-template.png
+++ b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-presentation-template.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-presentation.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-presentation.png
index 465583b9b0..fedeb0620a 100644
--- a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-presentation.png
+++ b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-presentation.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-spreadsheet-template.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-spreadsheet-template.png
index 383906a70a..9d63063e67 100644
--- a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-spreadsheet-template.png
+++ b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-spreadsheet-template.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-spreadsheet.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-spreadsheet.png
index 67da85c10b..020d95bef3 100644
--- a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-spreadsheet.png
+++ b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-spreadsheet.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-text-template.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-text-template.png
index feb935cc1d..983b39e611 100644
--- a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-text-template.png
+++ b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-text-template.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-text.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-text.png
index 571e6a0e4a..ac350cb409 100644
--- a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-text.png
+++ b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-text.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-web-template.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-web-template.png
index e3bd788ea1..8e906f8be1 100644
--- a/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-web-template.png
+++ b/sysui/desktop/icons/hicolor/32x32/mimetypes/oasis-web-template.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/presentation-template.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/presentation-template.png
index 0edabbc86f..5163f44103 100644
--- a/sysui/desktop/icons/hicolor/32x32/mimetypes/presentation-template.png
+++ b/sysui/desktop/icons/hicolor/32x32/mimetypes/presentation-template.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/presentation.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/presentation.png
index 0eee1162ce..730f86f0ba 100644
--- a/sysui/desktop/icons/hicolor/32x32/mimetypes/presentation.png
+++ b/sysui/desktop/icons/hicolor/32x32/mimetypes/presentation.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/spreadsheet-template.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/spreadsheet-template.png
index 158a63a58c..d81cd27dd9 100644
--- a/sysui/desktop/icons/hicolor/32x32/mimetypes/spreadsheet-template.png
+++ b/sysui/desktop/icons/hicolor/32x32/mimetypes/spreadsheet-template.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/spreadsheet.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/spreadsheet.png
index f7352ab517..dc9bd083c2 100644
--- a/sysui/desktop/icons/hicolor/32x32/mimetypes/spreadsheet.png
+++ b/sysui/desktop/icons/hicolor/32x32/mimetypes/spreadsheet.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/text-template.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/text-template.png
index cfba261023..7c738c21eb 100644
--- a/sysui/desktop/icons/hicolor/32x32/mimetypes/text-template.png
+++ b/sysui/desktop/icons/hicolor/32x32/mimetypes/text-template.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/32x32/mimetypes/text.png b/sysui/desktop/icons/hicolor/32x32/mimetypes/text.png
index 77f87e777b..1454b20fd5 100644
--- a/sysui/desktop/icons/hicolor/32x32/mimetypes/text.png
+++ b/sysui/desktop/icons/hicolor/32x32/mimetypes/text.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/48x48/apps/base.png b/sysui/desktop/icons/hicolor/48x48/apps/base.png
index d68e712812..382ad3e6ec 100644
--- a/sysui/desktop/icons/hicolor/48x48/apps/base.png
+++ b/sysui/desktop/icons/hicolor/48x48/apps/base.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/48x48/apps/calc.png b/sysui/desktop/icons/hicolor/48x48/apps/calc.png
index 33690ba3c2..d94aae38fb 100644
--- a/sysui/desktop/icons/hicolor/48x48/apps/calc.png
+++ b/sysui/desktop/icons/hicolor/48x48/apps/calc.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/48x48/apps/draw.png b/sysui/desktop/icons/hicolor/48x48/apps/draw.png
index 2acb57226d..1a2d252c7c 100644
--- a/sysui/desktop/icons/hicolor/48x48/apps/draw.png
+++ b/sysui/desktop/icons/hicolor/48x48/apps/draw.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/48x48/apps/impress.png b/sysui/desktop/icons/hicolor/48x48/apps/impress.png
index a46324e006..35d3b25c55 100644
--- a/sysui/desktop/icons/hicolor/48x48/apps/impress.png
+++ b/sysui/desktop/icons/hicolor/48x48/apps/impress.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/48x48/apps/main.png b/sysui/desktop/icons/hicolor/48x48/apps/main.png
new file mode 100755
index 0000000000..86bcf59955
--- /dev/null
+++ b/sysui/desktop/icons/hicolor/48x48/apps/main.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/48x48/apps/math.png b/sysui/desktop/icons/hicolor/48x48/apps/math.png
index 691ef832b1..3572d76b6b 100644
--- a/sysui/desktop/icons/hicolor/48x48/apps/math.png
+++ b/sysui/desktop/icons/hicolor/48x48/apps/math.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/48x48/apps/printeradmin.png b/sysui/desktop/icons/hicolor/48x48/apps/printeradmin.png
index 41971c9652..a11cbe5ab1 100644..100755
--- a/sysui/desktop/icons/hicolor/48x48/apps/printeradmin.png
+++ b/sysui/desktop/icons/hicolor/48x48/apps/printeradmin.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/48x48/apps/writer.png b/sysui/desktop/icons/hicolor/48x48/apps/writer.png
index 9ae7402374..8041a209dd 100644
--- a/sysui/desktop/icons/hicolor/48x48/apps/writer.png
+++ b/sysui/desktop/icons/hicolor/48x48/apps/writer.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/database.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/database.png
index 224943b0e9..b385ed9db5 100644
--- a/sysui/desktop/icons/hicolor/48x48/mimetypes/database.png
+++ b/sysui/desktop/icons/hicolor/48x48/mimetypes/database.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/drawing-template.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/drawing-template.png
index 043dd5dfae..b7da9bfa2c 100644
--- a/sysui/desktop/icons/hicolor/48x48/mimetypes/drawing-template.png
+++ b/sysui/desktop/icons/hicolor/48x48/mimetypes/drawing-template.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/drawing.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/drawing.png
index 8857034ce2..85499fd219 100644
--- a/sysui/desktop/icons/hicolor/48x48/mimetypes/drawing.png
+++ b/sysui/desktop/icons/hicolor/48x48/mimetypes/drawing.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/formula.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/formula.png
index 45f6d91938..bcc61b432b 100644
--- a/sysui/desktop/icons/hicolor/48x48/mimetypes/formula.png
+++ b/sysui/desktop/icons/hicolor/48x48/mimetypes/formula.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/master-document.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/master-document.png
index 191a619f7c..7a7b869565 100644
--- a/sysui/desktop/icons/hicolor/48x48/mimetypes/master-document.png
+++ b/sysui/desktop/icons/hicolor/48x48/mimetypes/master-document.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-database.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-database.png
index 2c2ffb86e6..77e684960e 100644
--- a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-database.png
+++ b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-database.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-drawing-template.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-drawing-template.png
index 655a938f82..8cb4dd3fa7 100644
--- a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-drawing-template.png
+++ b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-drawing-template.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-drawing.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-drawing.png
index c1bbdc4de6..258b3b2fc1 100644
--- a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-drawing.png
+++ b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-drawing.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-formula.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-formula.png
index fbdede243a..f6508de453 100644
--- a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-formula.png
+++ b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-formula.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-master-document.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-master-document.png
index d06b5ca8b1..1923fc9b9f 100644
--- a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-master-document.png
+++ b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-master-document.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-presentation-template.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-presentation-template.png
index f77c9c6e9a..00d3113175 100644
--- a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-presentation-template.png
+++ b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-presentation-template.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-presentation.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-presentation.png
index 7336f35303..635953e1c7 100644
--- a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-presentation.png
+++ b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-presentation.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-spreadsheet-template.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-spreadsheet-template.png
index 850250c71a..7c4beda53d 100644
--- a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-spreadsheet-template.png
+++ b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-spreadsheet-template.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-spreadsheet.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-spreadsheet.png
index 6f6328cece..4c407a0f5f 100644
--- a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-spreadsheet.png
+++ b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-spreadsheet.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-text-template.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-text-template.png
index ac0d373a03..64b8694088 100644
--- a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-text-template.png
+++ b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-text-template.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-text.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-text.png
index 8c2b714b29..0c04210a0c 100644
--- a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-text.png
+++ b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-text.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-web-template.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-web-template.png
index a7cf8d0f7d..0ff92ec7a2 100644
--- a/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-web-template.png
+++ b/sysui/desktop/icons/hicolor/48x48/mimetypes/oasis-web-template.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/presentation-template.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/presentation-template.png
index 2193c98931..d9651bf654 100644
--- a/sysui/desktop/icons/hicolor/48x48/mimetypes/presentation-template.png
+++ b/sysui/desktop/icons/hicolor/48x48/mimetypes/presentation-template.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/presentation.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/presentation.png
index bd59fbbbaf..e058d25f82 100644
--- a/sysui/desktop/icons/hicolor/48x48/mimetypes/presentation.png
+++ b/sysui/desktop/icons/hicolor/48x48/mimetypes/presentation.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/spreadsheet-template.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/spreadsheet-template.png
index 34c60c2819..5d5e46e21b 100644
--- a/sysui/desktop/icons/hicolor/48x48/mimetypes/spreadsheet-template.png
+++ b/sysui/desktop/icons/hicolor/48x48/mimetypes/spreadsheet-template.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/spreadsheet.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/spreadsheet.png
index 6868f577ce..c352966320 100644
--- a/sysui/desktop/icons/hicolor/48x48/mimetypes/spreadsheet.png
+++ b/sysui/desktop/icons/hicolor/48x48/mimetypes/spreadsheet.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/text-template.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/text-template.png
index 52a28fb3af..ad51297748 100644
--- a/sysui/desktop/icons/hicolor/48x48/mimetypes/text-template.png
+++ b/sysui/desktop/icons/hicolor/48x48/mimetypes/text-template.png
Binary files differ
diff --git a/sysui/desktop/icons/hicolor/48x48/mimetypes/text.png b/sysui/desktop/icons/hicolor/48x48/mimetypes/text.png
index 7ead079cad..2a1707006d 100644
--- a/sysui/desktop/icons/hicolor/48x48/mimetypes/text.png
+++ b/sysui/desktop/icons/hicolor/48x48/mimetypes/text.png
Binary files differ
diff --git a/sysui/desktop/icons/main.icns b/sysui/desktop/icons/main.icns
index c7ee5d7552..8357c09c0c 100644..100755
--- a/sysui/desktop/icons/main.icns
+++ b/sysui/desktop/icons/main.icns
Binary files differ
diff --git a/sysui/desktop/icons/makefile.mk b/sysui/desktop/icons/makefile.mk
index f98b235d12..ac32cdbe45 100644
--- a/sysui/desktop/icons/makefile.mk
+++ b/sysui/desktop/icons/makefile.mk
@@ -37,6 +37,33 @@ TARGET=icons
# --- Targets -------------------------------------------------------------
all: \
+ $(MISC)$/oasis-database.ico \
+ $(MISC)$/oasis-drawing-template.ico \
+ $(MISC)$/oasis-drawing.ico \
+ $(MISC)$/oasis-empty-template.ico \
+ $(MISC)$/oasis-empty-document.ico \
+ $(MISC)$/oasis-formula.ico \
+ $(MISC)$/oasis-master-document.ico \
+ $(MISC)$/oasis-presentation-template.ico \
+ $(MISC)$/oasis-presentation.ico \
+ $(MISC)$/oasis-spreadsheet-template.ico \
+ $(MISC)$/oasis-spreadsheet.ico \
+ $(MISC)$/oasis-text-template.ico \
+ $(MISC)$/oasis-text.ico \
+ $(MISC)$/oasis-web-template.ico \
+ $(MISC)$/database.ico \
+ $(MISC)$/drawing-template.ico \
+ $(MISC)$/drawing.ico \
+ $(MISC)$/empty-template.ico \
+ $(MISC)$/empty-document.ico \
+ $(MISC)$/formula.ico \
+ $(MISC)$/master-document.ico \
+ $(MISC)$/presentation-template.ico \
+ $(MISC)$/presentation.ico \
+ $(MISC)$/spreadsheet-template.ico \
+ $(MISC)$/spreadsheet.ico \
+ $(MISC)$/text-template.ico \
+ $(MISC)$/text.ico \
$(MISC)$/ooo-base-app.ico \
$(MISC)$/ooo-base-doc.ico \
$(MISC)$/ooo-calc-app.ico \
@@ -87,6 +114,7 @@ all: \
$(MISC)$/ooo3_math_doc.ico \
$(MISC)$/ooo3_writer_tem.ico \
$(MISC)$/ooo3_empty_tem.ico \
+ $(MISC)$/ooo3_open.ico \
$(MISC)$/ooo11-base-doc.ico \
$(MISC)$/ooo11-calc-doc.ico \
$(MISC)$/ooo11-calc-tem.ico \
@@ -149,6 +177,7 @@ all: \
$(MISC)$/so9_chart_doc.ico \
$(MISC)$/so9_writer_app.ico \
$(MISC)$/so9_draw_app.ico \
+ $(MISC)$/so9_open.ico \
$(MISC)$/so7-base-doc.ico \
$(MISC)$/so7-calc-doc.ico \
$(MISC)$/so7-calc-tem.ico \
diff --git a/sysui/desktop/icons/master-document.icns b/sysui/desktop/icons/master-document.icns
index 2089b9a660..33fdae3d47 100644
--- a/sysui/desktop/icons/master-document.icns
+++ b/sysui/desktop/icons/master-document.icns
Binary files differ
diff --git a/sysui/desktop/icons/master-document.ico b/sysui/desktop/icons/master-document.ico
new file mode 100644
index 0000000000..2c581f59a2
--- /dev/null
+++ b/sysui/desktop/icons/master-document.ico
Binary files differ
diff --git a/sysui/desktop/icons/oasis-database.icns b/sysui/desktop/icons/oasis-database.icns
index f64c6d2570..4d70286b0d 100644
--- a/sysui/desktop/icons/oasis-database.icns
+++ b/sysui/desktop/icons/oasis-database.icns
Binary files differ
diff --git a/sysui/desktop/icons/oasis-database.ico b/sysui/desktop/icons/oasis-database.ico
new file mode 100644
index 0000000000..3157568c32
--- /dev/null
+++ b/sysui/desktop/icons/oasis-database.ico
Binary files differ
diff --git a/sysui/desktop/icons/oasis-drawing-template.icns b/sysui/desktop/icons/oasis-drawing-template.icns
index bb357bae58..dcb55db8e9 100644
--- a/sysui/desktop/icons/oasis-drawing-template.icns
+++ b/sysui/desktop/icons/oasis-drawing-template.icns
Binary files differ
diff --git a/sysui/desktop/icons/oasis-drawing-template.ico b/sysui/desktop/icons/oasis-drawing-template.ico
new file mode 100644
index 0000000000..f98a2d6f44
--- /dev/null
+++ b/sysui/desktop/icons/oasis-drawing-template.ico
Binary files differ
diff --git a/sysui/desktop/icons/oasis-drawing.icns b/sysui/desktop/icons/oasis-drawing.icns
index 80adc9feaa..3802af5ef3 100644
--- a/sysui/desktop/icons/oasis-drawing.icns
+++ b/sysui/desktop/icons/oasis-drawing.icns
Binary files differ
diff --git a/sysui/desktop/icons/oasis-drawing.ico b/sysui/desktop/icons/oasis-drawing.ico
new file mode 100644
index 0000000000..b24f2dadbe
--- /dev/null
+++ b/sysui/desktop/icons/oasis-drawing.ico
Binary files differ
diff --git a/sysui/desktop/icons/oasis-empty-document.icns b/sysui/desktop/icons/oasis-empty-document.icns
new file mode 100644
index 0000000000..c52970324b
--- /dev/null
+++ b/sysui/desktop/icons/oasis-empty-document.icns
Binary files differ
diff --git a/sysui/desktop/icons/oasis-empty-document.ico b/sysui/desktop/icons/oasis-empty-document.ico
new file mode 100644
index 0000000000..a12b54c2a2
--- /dev/null
+++ b/sysui/desktop/icons/oasis-empty-document.ico
Binary files differ
diff --git a/sysui/desktop/icons/oasis-empty-template.icns b/sysui/desktop/icons/oasis-empty-template.icns
new file mode 100644
index 0000000000..ee6d299991
--- /dev/null
+++ b/sysui/desktop/icons/oasis-empty-template.icns
Binary files differ
diff --git a/sysui/desktop/icons/oasis-empty-template.ico b/sysui/desktop/icons/oasis-empty-template.ico
new file mode 100644
index 0000000000..63ac9f348f
--- /dev/null
+++ b/sysui/desktop/icons/oasis-empty-template.ico
Binary files differ
diff --git a/sysui/desktop/icons/oasis-formula.icns b/sysui/desktop/icons/oasis-formula.icns
index a7bded196c..657ea29eb9 100644
--- a/sysui/desktop/icons/oasis-formula.icns
+++ b/sysui/desktop/icons/oasis-formula.icns
Binary files differ
diff --git a/sysui/desktop/icons/oasis-formula.ico b/sysui/desktop/icons/oasis-formula.ico
new file mode 100644
index 0000000000..8ba738304e
--- /dev/null
+++ b/sysui/desktop/icons/oasis-formula.ico
Binary files differ
diff --git a/sysui/desktop/icons/oasis-master-document.icns b/sysui/desktop/icons/oasis-master-document.icns
index 1891c129ad..c39cb8963c 100644
--- a/sysui/desktop/icons/oasis-master-document.icns
+++ b/sysui/desktop/icons/oasis-master-document.icns
Binary files differ
diff --git a/sysui/desktop/icons/oasis-master-document.ico b/sysui/desktop/icons/oasis-master-document.ico
new file mode 100644
index 0000000000..2104eafef5
--- /dev/null
+++ b/sysui/desktop/icons/oasis-master-document.ico
Binary files differ
diff --git a/sysui/desktop/icons/oasis-presentation-template.icns b/sysui/desktop/icons/oasis-presentation-template.icns
index 337df2fa7b..57455ada70 100644
--- a/sysui/desktop/icons/oasis-presentation-template.icns
+++ b/sysui/desktop/icons/oasis-presentation-template.icns
Binary files differ
diff --git a/sysui/desktop/icons/oasis-presentation-template.ico b/sysui/desktop/icons/oasis-presentation-template.ico
new file mode 100644
index 0000000000..ef561b8215
--- /dev/null
+++ b/sysui/desktop/icons/oasis-presentation-template.ico
Binary files differ
diff --git a/sysui/desktop/icons/oasis-presentation.icns b/sysui/desktop/icons/oasis-presentation.icns
index 4b9ba4231f..cf768ac47b 100644
--- a/sysui/desktop/icons/oasis-presentation.icns
+++ b/sysui/desktop/icons/oasis-presentation.icns
Binary files differ
diff --git a/sysui/desktop/icons/oasis-presentation.ico b/sysui/desktop/icons/oasis-presentation.ico
new file mode 100644
index 0000000000..6f2c1602ef
--- /dev/null
+++ b/sysui/desktop/icons/oasis-presentation.ico
Binary files differ
diff --git a/sysui/desktop/icons/oasis-spreadsheet-template.icns b/sysui/desktop/icons/oasis-spreadsheet-template.icns
index 2bae7e38a8..8235e52878 100644
--- a/sysui/desktop/icons/oasis-spreadsheet-template.icns
+++ b/sysui/desktop/icons/oasis-spreadsheet-template.icns
Binary files differ
diff --git a/sysui/desktop/icons/oasis-spreadsheet-template.ico b/sysui/desktop/icons/oasis-spreadsheet-template.ico
new file mode 100644
index 0000000000..1124d9f433
--- /dev/null
+++ b/sysui/desktop/icons/oasis-spreadsheet-template.ico
Binary files differ
diff --git a/sysui/desktop/icons/oasis-spreadsheet.icns b/sysui/desktop/icons/oasis-spreadsheet.icns
index 69b46c2a1d..5facf50dbc 100644
--- a/sysui/desktop/icons/oasis-spreadsheet.icns
+++ b/sysui/desktop/icons/oasis-spreadsheet.icns
Binary files differ
diff --git a/sysui/desktop/icons/oasis-spreadsheet.ico b/sysui/desktop/icons/oasis-spreadsheet.ico
new file mode 100644
index 0000000000..160ab0cbf3
--- /dev/null
+++ b/sysui/desktop/icons/oasis-spreadsheet.ico
Binary files differ
diff --git a/sysui/desktop/icons/oasis-text-template.icns b/sysui/desktop/icons/oasis-text-template.icns
index 1986a329cb..0f0fe3f897 100644
--- a/sysui/desktop/icons/oasis-text-template.icns
+++ b/sysui/desktop/icons/oasis-text-template.icns
Binary files differ
diff --git a/sysui/desktop/icons/oasis-text-template.ico b/sysui/desktop/icons/oasis-text-template.ico
new file mode 100644
index 0000000000..602124fabe
--- /dev/null
+++ b/sysui/desktop/icons/oasis-text-template.ico
Binary files differ
diff --git a/sysui/desktop/icons/oasis-text.icns b/sysui/desktop/icons/oasis-text.icns
index 21a44a91d6..2d031fe499 100644
--- a/sysui/desktop/icons/oasis-text.icns
+++ b/sysui/desktop/icons/oasis-text.icns
Binary files differ
diff --git a/sysui/desktop/icons/oasis-text.ico b/sysui/desktop/icons/oasis-text.ico
new file mode 100644
index 0000000000..d2bd594316
--- /dev/null
+++ b/sysui/desktop/icons/oasis-text.ico
Binary files differ
diff --git a/sysui/desktop/icons/oasis-web-template.icns b/sysui/desktop/icons/oasis-web-template.icns
index 66b0db74ad..ee6d299991 100644
--- a/sysui/desktop/icons/oasis-web-template.icns
+++ b/sysui/desktop/icons/oasis-web-template.icns
Binary files differ
diff --git a/sysui/desktop/icons/oasis-web-template.ico b/sysui/desktop/icons/oasis-web-template.ico
new file mode 100644
index 0000000000..63ac9f348f
--- /dev/null
+++ b/sysui/desktop/icons/oasis-web-template.ico
Binary files differ
diff --git a/sysui/desktop/icons/ooo3_base_app.ico b/sysui/desktop/icons/ooo3_base_app.ico
index c728e83027..ba96b79876 100644..100755
--- a/sysui/desktop/icons/ooo3_base_app.ico
+++ b/sysui/desktop/icons/ooo3_base_app.ico
Binary files differ
diff --git a/sysui/desktop/icons/ooo3_calc_app.ico b/sysui/desktop/icons/ooo3_calc_app.ico
index f46433ec08..c960415415 100644..100755
--- a/sysui/desktop/icons/ooo3_calc_app.ico
+++ b/sysui/desktop/icons/ooo3_calc_app.ico
Binary files differ
diff --git a/sysui/desktop/icons/ooo3_draw_app.ico b/sysui/desktop/icons/ooo3_draw_app.ico
index 74abe03ace..6e00cb8937 100644..100755
--- a/sysui/desktop/icons/ooo3_draw_app.ico
+++ b/sysui/desktop/icons/ooo3_draw_app.ico
Binary files differ
diff --git a/sysui/desktop/icons/ooo3_impress_app.ico b/sysui/desktop/icons/ooo3_impress_app.ico
index 1eed9c1f17..23ee3ecc5e 100644..100755
--- a/sysui/desktop/icons/ooo3_impress_app.ico
+++ b/sysui/desktop/icons/ooo3_impress_app.ico
Binary files differ
diff --git a/sysui/desktop/icons/ooo3_main_app.ico b/sysui/desktop/icons/ooo3_main_app.ico
index f858d92bdd..98fcea3748 100644..100755
--- a/sysui/desktop/icons/ooo3_main_app.ico
+++ b/sysui/desktop/icons/ooo3_main_app.ico
Binary files differ
diff --git a/sysui/desktop/icons/ooo3_math_app.ico b/sysui/desktop/icons/ooo3_math_app.ico
index a712362795..605814c96e 100644..100755
--- a/sysui/desktop/icons/ooo3_math_app.ico
+++ b/sysui/desktop/icons/ooo3_math_app.ico
Binary files differ
diff --git a/sysui/desktop/icons/ooo3_open.ico b/sysui/desktop/icons/ooo3_open.ico
new file mode 100755
index 0000000000..98fcea3748
--- /dev/null
+++ b/sysui/desktop/icons/ooo3_open.ico
Binary files differ
diff --git a/sysui/desktop/icons/ooo3_writer_app.ico b/sysui/desktop/icons/ooo3_writer_app.ico
index 3e7efa610b..005bd58766 100644..100755
--- a/sysui/desktop/icons/ooo3_writer_app.ico
+++ b/sysui/desktop/icons/ooo3_writer_app.ico
Binary files differ
diff --git a/sysui/desktop/icons/presentation-template.icns b/sysui/desktop/icons/presentation-template.icns
index 5cdf700d97..f4d01878b9 100644
--- a/sysui/desktop/icons/presentation-template.icns
+++ b/sysui/desktop/icons/presentation-template.icns
Binary files differ
diff --git a/sysui/desktop/icons/presentation-template.ico b/sysui/desktop/icons/presentation-template.ico
new file mode 100644
index 0000000000..471940369a
--- /dev/null
+++ b/sysui/desktop/icons/presentation-template.ico
Binary files differ
diff --git a/sysui/desktop/icons/presentation.icns b/sysui/desktop/icons/presentation.icns
index 3f6e268c68..091be5b136 100644
--- a/sysui/desktop/icons/presentation.icns
+++ b/sysui/desktop/icons/presentation.icns
Binary files differ
diff --git a/sysui/desktop/icons/presentation.ico b/sysui/desktop/icons/presentation.ico
new file mode 100644
index 0000000000..360ef79e18
--- /dev/null
+++ b/sysui/desktop/icons/presentation.ico
Binary files differ
diff --git a/sysui/desktop/icons/so9_base_app.ico b/sysui/desktop/icons/so9_base_app.ico
index 56a323c07e..aa7036eb90 100644..100755
--- a/sysui/desktop/icons/so9_base_app.ico
+++ b/sysui/desktop/icons/so9_base_app.ico
Binary files differ
diff --git a/sysui/desktop/icons/so9_calc_app.ico b/sysui/desktop/icons/so9_calc_app.ico
index 81e6948d39..d7182cad09 100644..100755
--- a/sysui/desktop/icons/so9_calc_app.ico
+++ b/sysui/desktop/icons/so9_calc_app.ico
Binary files differ
diff --git a/sysui/desktop/icons/so9_draw_app.ico b/sysui/desktop/icons/so9_draw_app.ico
index a2c108ad6f..a8b3c3270f 100644..100755
--- a/sysui/desktop/icons/so9_draw_app.ico
+++ b/sysui/desktop/icons/so9_draw_app.ico
Binary files differ
diff --git a/sysui/desktop/icons/so9_impress_app.ico b/sysui/desktop/icons/so9_impress_app.ico
index 0fe4cea9f2..cf10331c5f 100644..100755
--- a/sysui/desktop/icons/so9_impress_app.ico
+++ b/sysui/desktop/icons/so9_impress_app.ico
Binary files differ
diff --git a/sysui/desktop/icons/so9_main_app.ico b/sysui/desktop/icons/so9_main_app.ico
index 197b924d33..90f193d80d 100644..100755
--- a/sysui/desktop/icons/so9_main_app.ico
+++ b/sysui/desktop/icons/so9_main_app.ico
Binary files differ
diff --git a/sysui/desktop/icons/so9_math_app.ico b/sysui/desktop/icons/so9_math_app.ico
index 4d947c2e59..11fbbf9a49 100644..100755
--- a/sysui/desktop/icons/so9_math_app.ico
+++ b/sysui/desktop/icons/so9_math_app.ico
Binary files differ
diff --git a/sysui/desktop/icons/so9_open.ico b/sysui/desktop/icons/so9_open.ico
new file mode 100755
index 0000000000..90f193d80d
--- /dev/null
+++ b/sysui/desktop/icons/so9_open.ico
Binary files differ
diff --git a/sysui/desktop/icons/so9_writer_app.ico b/sysui/desktop/icons/so9_writer_app.ico
index 2df20830d9..10c964dba9 100644..100755
--- a/sysui/desktop/icons/so9_writer_app.ico
+++ b/sysui/desktop/icons/so9_writer_app.ico
Binary files differ
diff --git a/sysui/desktop/icons/spreadsheet-template.icns b/sysui/desktop/icons/spreadsheet-template.icns
index 058a147b50..d2dfa84929 100644
--- a/sysui/desktop/icons/spreadsheet-template.icns
+++ b/sysui/desktop/icons/spreadsheet-template.icns
Binary files differ
diff --git a/sysui/desktop/icons/spreadsheet-template.ico b/sysui/desktop/icons/spreadsheet-template.ico
new file mode 100644
index 0000000000..be267eb21b
--- /dev/null
+++ b/sysui/desktop/icons/spreadsheet-template.ico
Binary files differ
diff --git a/sysui/desktop/icons/spreadsheet.icns b/sysui/desktop/icons/spreadsheet.icns
index 8594b9ba86..5c89354195 100644
--- a/sysui/desktop/icons/spreadsheet.icns
+++ b/sysui/desktop/icons/spreadsheet.icns
Binary files differ
diff --git a/sysui/desktop/icons/spreadsheet.ico b/sysui/desktop/icons/spreadsheet.ico
new file mode 100644
index 0000000000..a88045e9c1
--- /dev/null
+++ b/sysui/desktop/icons/spreadsheet.ico
Binary files differ
diff --git a/sysui/desktop/icons/text-template.icns b/sysui/desktop/icons/text-template.icns
index 0f7c006b42..8b9694ac75 100644
--- a/sysui/desktop/icons/text-template.icns
+++ b/sysui/desktop/icons/text-template.icns
Binary files differ
diff --git a/sysui/desktop/icons/text-template.ico b/sysui/desktop/icons/text-template.ico
new file mode 100644
index 0000000000..07986929a6
--- /dev/null
+++ b/sysui/desktop/icons/text-template.ico
Binary files differ
diff --git a/sysui/desktop/icons/text.icns b/sysui/desktop/icons/text.icns
index 169ef0961d..401d2b9dbf 100644
--- a/sysui/desktop/icons/text.icns
+++ b/sysui/desktop/icons/text.icns
Binary files differ
diff --git a/sysui/desktop/icons/text.ico b/sysui/desktop/icons/text.ico
new file mode 100644
index 0000000000..f19a7812b1
--- /dev/null
+++ b/sysui/desktop/icons/text.ico
Binary files differ
diff --git a/sysui/desktop/menus/javafilter.desktop b/sysui/desktop/menus/javafilter.desktop
new file mode 100644
index 0000000000..9d230f954a
--- /dev/null
+++ b/sysui/desktop/menus/javafilter.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Version=1.0
+Terminal=false
+Type=Application
+Exec=openoffice -writer %U
+MimeType=application/x-aportisdoc;application/x-pocket-word;application/x-pocket-excel;
+Name=%PRODUCTNAME Small Device Format Importer
+GenericName=Small Device Format Importer
+NoDisplay=true
diff --git a/sysui/desktop/redhat/redhat-menus.spec b/sysui/desktop/redhat/redhat-menus.spec
index 4ad74ad1b3..e153b55c3f 100644
--- a/sysui/desktop/redhat/redhat-menus.spec
+++ b/sysui/desktop/redhat/redhat-menus.spec
@@ -279,6 +279,7 @@ done
/usr/share/applications/%unixfilename-base.desktop
/usr/share/applications/%unixfilename-printeradmin.desktop
/usr/share/applications/%unixfilename-startcenter.desktop
+/usr/share/applications/%unixfilename-javafilter.desktop
/usr/share/applnk-redhat/Office/%unixfilename-writer.desktop
/usr/share/applnk-redhat/Office/%unixfilename-calc.desktop
/usr/share/applnk-redhat/Office/%unixfilename-draw.desktop
@@ -287,6 +288,7 @@ done
/usr/share/applnk-redhat/Office/%unixfilename-base.desktop
/usr/share/applnk-redhat/Office/%unixfilename-printeradmin.desktop
/usr/share/applnk-redhat/Office/%unixfilename-startcenter.desktop
+/usr/share/applnk-redhat/Office/%unixfilename-javafilter.desktop
/usr/share/mime-info/*.keys
/usr/share/mime-info/*.mime
/usr/share/mimelnk/application/*.desktop
diff --git a/sysui/desktop/share/launcher_comment.ulf b/sysui/desktop/share/launcher_comment.ulf
index e3abc7c7ea..6aeab6d94c 100644
--- a/sysui/desktop/share/launcher_comment.ulf
+++ b/sysui/desktop/share/launcher_comment.ulf
@@ -17,5 +17,5 @@ en-US = "Create and edit scientific formulas and equations by using Math."
en-US = "Manage databases, create queries and reports to track and manage your information by using Base."
[startcenter]
-en-US = "The office productivity suite compatible to the open and standardized ODF document format. Supported by Sun Microsystems."
+en-US = "The office productivity suite compatible to the open and standardized ODF document format. Supported by Oracle."
diff --git a/sysui/desktop/share/launcher_genericname.ulf b/sysui/desktop/share/launcher_genericname.ulf
index ea11da04e0..ff8041a155 100644
--- a/sysui/desktop/share/launcher_genericname.ulf
+++ b/sysui/desktop/share/launcher_genericname.ulf
@@ -18,3 +18,6 @@ en-US = "Drawing Program"
[startcenter]
en-US = "Office"
+
+[javafilter]
+en-US = "Small Device Format Importer"
diff --git a/sysui/desktop/share/makefile.mk b/sysui/desktop/share/makefile.mk
index 9668272a56..e1e47648b0 100644
--- a/sysui/desktop/share/makefile.mk
+++ b/sysui/desktop/share/makefile.mk
@@ -52,7 +52,7 @@ ULFFILES= \
launcher_genericname.ulf \
launcher_name.ulf
-LAUNCHERLIST = writer calc draw impress math base printeradmin qstart startcenter
+LAUNCHERLIST = writer calc draw impress math base printeradmin qstart startcenter javafilter
LAUNCHERDEPN = ../menus/{$(LAUNCHERLIST)}.desktop
LAUNCHERFLAGFILE = $(COMMONMISC)/$(TARGET)/xdg.flag
@@ -126,9 +126,9 @@ MIMEICONLIST = \
extension
ICONDEPN = \
- ../icons/hicolor/{16x16 32x32 48x48}/apps/{$(LAUNCHERLIST:s/qstart//)}.png \
+ ../icons/hicolor/{16x16 32x32 48x48}/apps/{$(LAUNCHERLIST:s/qstart//:s/javafilter//)}.png \
../icons/hicolor/{16x16 32x32 48x48}/mimetypes/{$(MIMEICONLIST)}.png \
- ../icons/locolor/{16x16 32x32}/apps/{$(LAUNCHERLIST:s/qstart//)}.png \
+ ../icons/locolor/{16x16 32x32}/apps/{$(LAUNCHERLIST:s/qstart//:s/javafilter//)}.png \
../icons/locolor/{16x16 32x32}/mimetypes/{$(MIMEICONLIST)}.png
# --- Targets ------------------------------------------------------
diff --git a/sysui/desktop/slackware/makefile.mk b/sysui/desktop/slackware/makefile.mk
index 7327aa469f..6fde1caf65 100644
--- a/sysui/desktop/slackware/makefile.mk
+++ b/sysui/desktop/slackware/makefile.mk
@@ -42,10 +42,6 @@ TARGET=slackware
MENUFILES=$(PKGDIR)$/{$(PRODUCTLIST)}3.3-$(TARGET)-menus-$(PKGVERSION)-noarch-$(PKGREV).tgz
-.IF "$(USE_SHELL)"=="bash"
-ECHOPARAM=-e
-.ENDIF
-
# --- Targets -------------------------------------------------------
.INCLUDE : target.mk
@@ -74,7 +70,7 @@ $(MISC)/$(TARGET)/usr/share/applications/ :
@echo "( cd etc ; ln -snf /opt/$(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.3//):s/-//) $(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.3//)) )" >> $@
@echo "( cd usr/bin ; rm -rf soffice )" >> $@
@echo "( cd usr/bin ; ln -sf /etc/$(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.3//))/program/soffice soffice )" >> $@
- @echo $(ECHOPARAM) $(foreach,i,$(shell @cat $(COMMONMISC)$/$(*:b:s/-/ /:1:s/3.3//)/launcherlist) "\n( cd usr/share/applications ; rm -rf $(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.3//))-$i )\n( cd usr/share/applications ; ln -sf /etc/$(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.3//))/share/xdg/$i $(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.3//))-$i )") >> $@
+ @echo -e $(foreach,i,$(shell @cat $(COMMONMISC)$/$(*:b:s/-/ /:1:s/3.3//)/launcherlist) "\n( cd usr/share/applications ; rm -rf $(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.3//))-$i )\n( cd usr/share/applications ; ln -sf /etc/$(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.3//))/share/xdg/$i $(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.3//))-$i )") >> $@
@cat $< >> $@
%$/install$/slack-desc : slack-desc
diff --git a/sysui/desktop/suse/suse-menus.spec b/sysui/desktop/suse/suse-menus.spec
index a1bd2b0359..7280d9dbae 100644
--- a/sysui/desktop/suse/suse-menus.spec
+++ b/sysui/desktop/suse/suse-menus.spec
@@ -291,6 +291,7 @@ done
/usr/share/applications/%unixfilename-base.desktop
/usr/share/applications/%unixfilename-printeradmin.desktop
/usr/share/applications/%unixfilename-startcenter.desktop
+/usr/share/applications/%unixfilename-javafilter.desktop
/opt/gnome/share/mime-info/*.keys
/opt/gnome/share/mime-info/*.mime
/opt/kde3/share/mimelnk/application/*.desktop
diff --git a/sysui/prj/d.lst b/sysui/prj/d.lst
index 126376930c..c6019cea9a 100644
--- a/sysui/prj/d.lst
+++ b/sysui/prj/d.lst
@@ -20,6 +20,8 @@ mkdir: %_DEST%\bin%_EXT%\desktop-integration\pkg
..\%__SRC%\bin\soquickstart.exe %_DEST%\bin%_EXT%\so\quickstart.exe
..\%__SRC%\bin\soquickstart.exe %_DEST%\bin%_EXT%\so\install_quickstart.exe
+..\%__SRC%\misc\ooo3_main_app.ico %_DEST%\bin%_EXT%\soffice.ico
+
..\%__SRC%\misc\desktopshare\*.desktop %_DEST%\pck%_EXT%\*.desktop
..\%__SRC%\misc\PkgInfo %_DEST%\pck%_EXT%\PkgInfo
..\%__SRC%\misc\Info.plist %_DEST%\pck%_EXT%\Info.plist
diff --git a/sysui/source/win32/QuickStart/OOQuickStart.rc b/sysui/source/win32/QuickStart/OOQuickStart.rc
index ebeed2560d..0dc4dab256 100644
--- a/sysui/source/win32/QuickStart/OOQuickStart.rc
+++ b/sysui/source/win32/QuickStart/OOQuickStart.rc
@@ -31,10 +31,10 @@ LANGUAGE LANG_GERMAN, SUBLANG_GERMAN
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
-ICON_ACTIVE ICON DISCARDABLE "../../desktop/icons/ooo-main-app.ico"
-IDI_QUICKSTART ICON DISCARDABLE "../../desktop/icons/ooo-main-app.ico"
-IDI_SMALL ICON DISCARDABLE "../../desktop/icons/ooo-main-app.ico"
-ICON_INACTIVE ICON DISCARDABLE "../../desktop/icons/ooo-main-app.ico"
+ICON_ACTIVE ICON DISCARDABLE "../../desktop/icons/ooo3_main_app.ico"
+IDI_QUICKSTART ICON DISCARDABLE "../../desktop/icons/ooo3_main_app.ico"
+IDI_SMALL ICON DISCARDABLE "../../desktop/icons/ooo3_main_app.ico"
+ICON_INACTIVE ICON DISCARDABLE "../../desktop/icons/ooo3_main_app.ico"
/////////////////////////////////////////////////////////////////////////////
diff --git a/sysui/source/win32/QuickStart/so/QuickStart.rc b/sysui/source/win32/QuickStart/so/QuickStart.rc
index 48da2388b1..c48dc2358d 100644
--- a/sysui/source/win32/QuickStart/so/QuickStart.rc
+++ b/sysui/source/win32/QuickStart/so/QuickStart.rc
@@ -31,10 +31,10 @@ LANGUAGE LANG_GERMAN, SUBLANG_GERMAN
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
-ICON_ACTIVE ICON DISCARDABLE "../../../desktop/icons/so8-main-app.ico"
-IDI_QUICKSTART ICON DISCARDABLE "../../../desktop/icons/so8-main-app.ico"
-IDI_SMALL ICON DISCARDABLE "../../../desktop/icons/so8-main-app.ico"
-ICON_INACTIVE ICON DISCARDABLE "../../../desktop/icons/so8-main-app.ico"
+ICON_ACTIVE ICON DISCARDABLE "../../../desktop/icons/so9_main_app.ico"
+IDI_QUICKSTART ICON DISCARDABLE "../../../desktop/icons/so9_main_app.ico"
+IDI_SMALL ICON DISCARDABLE "../../../desktop/icons/so9_main_app.ico"
+ICON_INACTIVE ICON DISCARDABLE "../../../desktop/icons/so9_main_app.ico"
/////////////////////////////////////////////////////////////////////////////
@@ -105,7 +105,7 @@ STRINGTABLE DISCARDABLE
BEGIN
IDS_APP_TITLE "SoQuickStart"
IDC_QUICKSTART "QUICKSTART"
- IDS_TOOLTIP "StarOffice 6.0 QuickStart"
+ IDS_TOOLTIP "Oracle Open Office 3.2 QuickStart"
END
STRINGTABLE DISCARDABLE
diff --git a/ucb/prj/build.lst b/ucb/prj/build.lst
index f0eb0da839..a4d7ef6b4f 100644
--- a/ucb/prj/build.lst
+++ b/ucb/prj/build.lst
@@ -14,3 +14,4 @@ uc ucb\source\ucp\webdav nmake - all uc_webdav uc_inc NULL
uc ucb\source\ucp\package nmake - all uc_package uc_inc NULL
uc ucb\source\ucp\tdoc nmake - all uc_tdoc uc_inc NULL
uc ucb\source\ucp\expand nmake - all uc_expand uc_inc NULL
+uc ucb\qa\unoapi nmake - all uc_qa_unoapi NULL
diff --git a/ucb/qa/unoapi/Test.java b/ucb/qa/unoapi/Test.java
new file mode 100644
index 0000000000..145716d871
--- /dev/null
+++ b/ucb/qa/unoapi/Test.java
@@ -0,0 +1,51 @@
+/*************************************************************************
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+************************************************************************/
+
+package org.openoffice.ucb.qa.unoapi;
+
+import org.openoffice.Runner;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
+
+public final class Test {
+ @org.junit.Before public void setUp() throws Exception {
+ connection.setUp();
+ }
+
+ @org.junit.After public void tearDown()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ connection.tearDown();
+ }
+
+ @org.junit.Test public void test() {
+ assertTrue(
+ Runner.run(
+ "-sce", "ucb.sce", "-xcl", "knownissues.xcl", "-cs",
+ connection.getDescription()));
+ }
+
+ private final OfficeConnection connection = new OfficeConnection();
+}
diff --git a/ucb/qa/unoapi/makefile.mk b/ucb/qa/unoapi/makefile.mk
index 1ceb8eb641..80c7caae73 100644
--- a/ucb/qa/unoapi/makefile.mk
+++ b/ucb/qa/unoapi/makefile.mk
@@ -1,7 +1,6 @@
#*************************************************************************
-#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -22,19 +21,28 @@
# version 3 along with OpenOffice.org. If not, see
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
+#***********************************************************************/
-PRJ=..$/..
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
-PRJNAME=ucb
-TARGET=qa_unoapi
+PRJ = ../..
+PRJNAME = ucb
+TARGET = qa_unoapi
-.INCLUDE: settings.mk
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = org/openoffice/ucb/qa/unoapi
+JAVATESTFILES = Test.java
+JAVAFILES = $(JAVATESTFILES)
+JARFILES = OOoRunner.jar ridl.jar test.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+.END
+.INCLUDE: settings.mk
.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
-ALLTAR : UNOAPI_TEST
+ALLTAR : javatest
-UNOAPI_TEST:
- +$(SOLARENV)$/bin$/checkapi -sce ucb.sce -xcl knownissues.xcl -tdoc $(PWD)$/testdocuments
+.END
diff --git a/ucb/source/cacher/exports.map b/ucb/source/cacher/exports.map
deleted file mode 100644
index bd32ad4747..0000000000
--- a/ucb/source/cacher/exports.map
+++ /dev/null
@@ -1,8 +0,0 @@
-CAC_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/ucb/source/cacher/makefile.mk b/ucb/source/cacher/makefile.mk
index 20179f8ce7..600fefc174 100644
--- a/ucb/source/cacher/makefile.mk
+++ b/ucb/source/cacher/makefile.mk
@@ -59,7 +59,7 @@ SHL1STDLIBS=\
SHL1LIBS=$(LIB1TARGET)
SHL1IMPLIB=i$(TARGET)
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
DEF1NAME=$(SHL1TARGET)
.ENDIF # L10N_framework
diff --git a/ucb/source/core/exports.map b/ucb/source/core/exports.map
deleted file mode 100644
index 5ab48b9e42..0000000000
--- a/ucb/source/core/exports.map
+++ /dev/null
@@ -1,8 +0,0 @@
-UCB_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/ucb/source/core/makefile.mk b/ucb/source/core/makefile.mk
index 5095dbef94..34765eb742 100644
--- a/ucb/source/core/makefile.mk
+++ b/ucb/source/core/makefile.mk
@@ -65,7 +65,7 @@ SHL1IMPLIB=i$(TARGET)
.IF "$(GUI)" == "OS2"
DEF1EXPORTFILE=exports2.dxp
.ELSE
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
.ENDIF
DEF1NAME=$(SHL1TARGET)
diff --git a/ucb/source/core/ucbstore.cxx b/ucb/source/core/ucbstore.cxx
index d44f32fff6..7bf58a2001 100644
--- a/ucb/source/core/ucbstore.cxx
+++ b/ucb/source/core/ucbstore.cxx
@@ -1567,7 +1567,9 @@ void SAL_CALL PersistentPropertySet::setPropertyValue(
// Write state ( Now it is a directly set value )
xNameReplace->replaceByName(
OUString::createFromAscii( "State" ),
- makeAny( PropertyState_DIRECT_VALUE ) );
+ makeAny(
+ sal_Int32(
+ PropertyState_DIRECT_VALUE ) ) );
// Commit changes.
xBatch->commitChanges();
@@ -1851,7 +1853,9 @@ void SAL_CALL PersistentPropertySet::addProperty(
// Set state ( always "default" )
xNameReplace->replaceByName(
OUString::createFromAscii( "State" ),
- makeAny( PropertyState_DEFAULT_VALUE ) );
+ makeAny(
+ sal_Int32(
+ PropertyState_DEFAULT_VALUE ) ) );
// Set attributes
xNameReplace->replaceByName(
@@ -2327,7 +2331,9 @@ void SAL_CALL PersistentPropertySet::setPropertyValues(
// Write state ( Now it is a directly set value )
xNameReplace->replaceByName(
OUString::createFromAscii( "State" ),
- makeAny( PropertyState_DIRECT_VALUE ) );
+ makeAny(
+ sal_Int32(
+ PropertyState_DIRECT_VALUE ) ) );
// Commit changes.
xBatch->commitChanges();
diff --git a/ucb/source/sorter/exports.map b/ucb/source/sorter/exports.map
deleted file mode 100644
index 953380b4a9..0000000000
--- a/ucb/source/sorter/exports.map
+++ /dev/null
@@ -1,8 +0,0 @@
-SRT_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/ucb/source/sorter/makefile.mk b/ucb/source/sorter/makefile.mk
index 5077be80b4..68a9959589 100644
--- a/ucb/source/sorter/makefile.mk
+++ b/ucb/source/sorter/makefile.mk
@@ -54,7 +54,7 @@ SHL1STDLIBS=\
SHL1LIBS=$(LIB1TARGET)
SHL1IMPLIB=i$(TARGET)
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
DEF1NAME=$(SHL1TARGET)
.ENDIF # L10N_framework
diff --git a/ucb/source/ucp/expand/makefile.mk b/ucb/source/ucp/expand/makefile.mk
index aaa7b85edb..32de160318 100644
--- a/ucb/source/ucp/expand/makefile.mk
+++ b/ucb/source/ucp/expand/makefile.mk
@@ -46,7 +46,7 @@ SHL1STDLIBS = \
$(CPPULIB) \
$(SALLIB)
-SHL1VERSIONMAP = $(TARGET).map
+SHL1VERSIONMAP = $(SOLARENV)/src/component.map
SHL1TARGET = $(TARGET)
SHL1DEPN =
diff --git a/ucb/source/ucp/expand/ucpexpand1.uno.map b/ucb/source/ucp/expand/ucpexpand1.uno.map
deleted file mode 100644
index 563b3d86a5..0000000000
--- a/ucb/source/ucp/expand/ucpexpand1.uno.map
+++ /dev/null
@@ -1,8 +0,0 @@
-UDK_3_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/ucb/source/ucp/file/exports.map b/ucb/source/ucp/file/exports.map
deleted file mode 100644
index a8bd267fc9..0000000000
--- a/ucb/source/ucp/file/exports.map
+++ /dev/null
@@ -1,8 +0,0 @@
-FIL_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/ucb/source/ucp/file/makefile.mk b/ucb/source/ucp/file/makefile.mk
index b11fdd8081..8007a24923 100644
--- a/ucb/source/ucp/file/makefile.mk
+++ b/ucb/source/ucp/file/makefile.mk
@@ -67,7 +67,7 @@ SHL1STDLIBS=\
$(SALLIB) \
$(UCBHELPERLIB)
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
.IF "$(GUI)" == "OS2"
DEF1EXPORTFILE=exports2.dxp
diff --git a/ucb/source/ucp/ftp/makefile.mk b/ucb/source/ucp/ftp/makefile.mk
index d9b674b786..a0f1410040 100644
--- a/ucb/source/ucp/ftp/makefile.mk
+++ b/ucb/source/ucp/ftp/makefile.mk
@@ -68,7 +68,7 @@ LIB1OBJFILES=$(SLOFILES1)
SHL1TARGET=$(TARGET)$(UCPFTP_MAJOR)
SHL1IMPLIB=i$(TARGET)
-SHL1VERSIONMAP= $(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1STDLIBS=\
$(CPPUHELPERLIB) \
diff --git a/ucb/source/ucp/ftp/ucpftp.map b/ucb/source/ucp/ftp/ucpftp.map
deleted file mode 100644
index 0ce3cd3ad8..0000000000
--- a/ucb/source/ucp/ftp/ucpftp.map
+++ /dev/null
@@ -1,8 +0,0 @@
-FTP_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/ucb/source/ucp/gio/exports.map b/ucb/source/ucp/gio/exports.map
deleted file mode 100644
index 5ec50ad779..0000000000
--- a/ucb/source/ucp/gio/exports.map
+++ /dev/null
@@ -1,8 +0,0 @@
-UDK_3_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/ucb/source/ucp/gio/gio_content.hxx b/ucb/source/ucp/gio/gio_content.hxx
index 7d004d5242..b48a018680 100644
--- a/ucb/source/ucp/gio/gio_content.hxx
+++ b/ucb/source/ucp/gio/gio_content.hxx
@@ -140,7 +140,7 @@ public:
virtual ~Content();
- static com::sun::star::uno::Reference< com::sun::star::sdbc::XRow > getPropertyValuesFromGFileInfo(
+ com::sun::star::uno::Reference< com::sun::star::sdbc::XRow > getPropertyValuesFromGFileInfo(
GFileInfo *pInfo, const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rSMgr,
const com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment > & xEnv,
const com::sun::star::uno::Sequence< com::sun::star::beans::Property >& rProperties);
diff --git a/ucb/source/ucp/gio/gio_datasupplier.cxx b/ucb/source/ucp/gio/gio_datasupplier.cxx
index 2bf26bbd6b..ec849a3beb 100644
--- a/ucb/source/ucp/gio/gio_datasupplier.cxx
+++ b/ucb/source/ucp/gio/gio_datasupplier.cxx
@@ -236,11 +236,31 @@ uno::Reference< sdbc::XRow > DataSupplier::queryPropertyValues( sal_uInt32 nInde
if ( getResult( nIndex ) )
{
- uno::Reference< sdbc::XRow > xRow = Content::getPropertyValuesFromGFileInfo(
- maResults[ nIndex ]->pInfo, m_xSMgr, getResultSet()->getEnvironment(), getResultSet()->getProperties());
-
- maResults[ nIndex ]->xRow = xRow;
- return xRow;
+ uno::Reference< ucb::XContent > xContent( queryContent( nIndex ) );
+ if ( xContent.is() )
+ {
+ try
+ {
+ uno::Reference< ucb::XCommandProcessor > xCmdProc(
+ xContent, uno::UNO_QUERY_THROW );
+ sal_Int32 nCmdId( xCmdProc->createCommandIdentifier() );
+ ucb::Command aCmd;
+ aCmd.Name = rtl::OUString::createFromAscii( "getPropertyValues" );
+ aCmd.Handle = -1;
+ aCmd.Argument <<= getResultSet()->getProperties();
+ uno::Any aResult( xCmdProc->execute(
+ aCmd, nCmdId, getResultSet()->getEnvironment() ) );
+ uno::Reference< sdbc::XRow > xRow;
+ if ( aResult >>= xRow )
+ {
+ maResults[ nIndex ]->xRow = xRow;
+ return xRow;
+ }
+ }
+ catch ( uno::Exception const & )
+ {
+ }
+ }
}
return uno::Reference< sdbc::XRow >();
}
diff --git a/ucb/source/ucp/gio/makefile.mk b/ucb/source/ucp/gio/makefile.mk
index e6ebe2413e..86b32fbc07 100644
--- a/ucb/source/ucp/gio/makefile.mk
+++ b/ucb/source/ucp/gio/makefile.mk
@@ -73,7 +73,7 @@ SHL1STDLIBS=\
SHL1STDLIBS+=$(PKGCONFIG_LIBS)
-SHL1VERSIONMAP= exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
.ENDIF # "$(ENABLE_GIO)"!=""
.ENDIF # L10N_framework
diff --git a/ucb/source/ucp/gvfs/exports.map b/ucb/source/ucp/gvfs/exports.map
deleted file mode 100644
index 5ec50ad779..0000000000
--- a/ucb/source/ucp/gvfs/exports.map
+++ /dev/null
@@ -1,8 +0,0 @@
-UDK_3_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/ucb/source/ucp/gvfs/makefile.mk b/ucb/source/ucp/gvfs/makefile.mk
index b69455777c..a0e8a0bda3 100644
--- a/ucb/source/ucp/gvfs/makefile.mk
+++ b/ucb/source/ucp/gvfs/makefile.mk
@@ -77,7 +77,7 @@ SHL1STDLIBS=\
SHL1STDLIBS+=$(PKGCONFIG_LIBS)
-SHL1VERSIONMAP= exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
.ENDIF # "$(ENABLE_GNOMEVFS)"!=""
.ENDIF # L10N_framework
diff --git a/ucb/source/ucp/hierarchy/makefile.mk b/ucb/source/ucp/hierarchy/makefile.mk
index a968537873..00b481b5e7 100644
--- a/ucb/source/ucp/hierarchy/makefile.mk
+++ b/ucb/source/ucp/hierarchy/makefile.mk
@@ -61,7 +61,7 @@ LIB1OBJFILES=$(SLOFILES)
SHL1TARGET=$(TARGET)$(UCPHIER_MAJOR)
SHL1IMPLIB=i$(TARGET)
-SHL1VERSIONMAP= $(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1STDLIBS=\
$(CPPUHELPERLIB) \
diff --git a/ucb/source/ucp/hierarchy/ucphier.map b/ucb/source/ucp/hierarchy/ucphier.map
deleted file mode 100644
index 319e7b11a9..0000000000
--- a/ucb/source/ucp/hierarchy/ucphier.map
+++ /dev/null
@@ -1,8 +0,0 @@
-HIER_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/ucb/source/ucp/odma/exports.map b/ucb/source/ucp/odma/exports.map
deleted file mode 100644
index 14a2531f23..0000000000
--- a/ucb/source/ucp/odma/exports.map
+++ /dev/null
@@ -1,8 +0,0 @@
-VERS_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/ucb/source/ucp/odma/makefile.mk b/ucb/source/ucp/odma/makefile.mk
index d9ddcbfdf0..14a7d3d45c 100644
--- a/ucb/source/ucp/odma/makefile.mk
+++ b/ucb/source/ucp/odma/makefile.mk
@@ -64,7 +64,7 @@ LIB1OBJFILES=$(SLOFILES)
SHL1TARGET=$(TARGET)$(UCP_VERSION)
SHL1IMPLIB=i$(TARGET)
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1STDLIBS=\
$(CPPUHELPERLIB) \
diff --git a/ucb/source/ucp/package/exports.map b/ucb/source/ucp/package/exports.map
deleted file mode 100644
index 7e12f34d1b..0000000000
--- a/ucb/source/ucp/package/exports.map
+++ /dev/null
@@ -1,8 +0,0 @@
-PKG_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/ucb/source/ucp/package/makefile.mk b/ucb/source/ucp/package/makefile.mk
index bd4707cccc..8c6dcda318 100644
--- a/ucb/source/ucp/package/makefile.mk
+++ b/ucb/source/ucp/package/makefile.mk
@@ -65,7 +65,7 @@ LIB1OBJFILES=$(SLOFILES)
SHL1TARGET=$(TARGET)$(UCP_VERSION)
SHL1IMPLIB=i$(TARGET)
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1STDLIBS=\
$(CPPUHELPERLIB) \
diff --git a/ucb/source/ucp/tdoc/exports.map b/ucb/source/ucp/tdoc/exports.map
deleted file mode 100644
index 5ec50ad779..0000000000
--- a/ucb/source/ucp/tdoc/exports.map
+++ /dev/null
@@ -1,8 +0,0 @@
-UDK_3_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/ucb/source/ucp/tdoc/makefile.mk b/ucb/source/ucp/tdoc/makefile.mk
index 2c85514ef9..83e9599eed 100644
--- a/ucb/source/ucp/tdoc/makefile.mk
+++ b/ucb/source/ucp/tdoc/makefile.mk
@@ -66,7 +66,7 @@ LIB1OBJFILES=$(SLOFILES)
SHL1TARGET=$(TARGET)
SHL1IMPLIB=i$(TARGET)
-SHL1VERSIONMAP= exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1STDLIBS=\
$(COMPHELPERLIB) \
diff --git a/ucb/source/ucp/webdav/DAVResourceAccess.cxx b/ucb/source/ucp/webdav/DAVResourceAccess.cxx
index 076d92d214..71d4eabdbf 100644
--- a/ucb/source/ucp/webdav/DAVResourceAccess.cxx
+++ b/ucb/source/ucp/webdav/DAVResourceAccess.cxx
@@ -960,6 +960,7 @@ void DAVResourceAccess::LOCK(
while ( bRetry );
}
+#if 0 // currently not used, but please don't remove code
//=========================================================================
// refresh existing lock.
sal_Int64 DAVResourceAccess::LOCK(
@@ -1003,6 +1004,7 @@ sal_Int64 DAVResourceAccess::LOCK(
return nNewTimeout;
}
+#endif
//=========================================================================
void DAVResourceAccess::UNLOCK(
diff --git a/ucb/source/ucp/webdav/DAVResourceAccess.hxx b/ucb/source/ucp/webdav/DAVResourceAccess.hxx
index 31b9bbbfd8..38ffa714a3 100644
--- a/ucb/source/ucp/webdav/DAVResourceAccess.hxx
+++ b/ucb/source/ucp/webdav/DAVResourceAccess.hxx
@@ -209,12 +209,14 @@ public:
com::sun::star::ucb::XCommandEnvironment > & xEnv )
throw( DAVException );
+#if 0 // currently not used, but please don't remove code
// refresh existing lock.
sal_Int64
LOCK( sal_Int64 nTimeout,
const com::sun::star::uno::Reference<
com::sun::star::ucb::XCommandEnvironment > & xEnv )
throw ( DAVException );
+#endif
void
UNLOCK( const com::sun::star::uno::Reference<
diff --git a/ucb/source/ucp/webdav/NeonSession.cxx b/ucb/source/ucp/webdav/NeonSession.cxx
index d9ff4c0290..6ab782b322 100644
--- a/ucb/source/ucp/webdav/NeonSession.cxx
+++ b/ucb/source/ucp/webdav/NeonSession.cxx
@@ -435,7 +435,7 @@ extern "C" int NeonSession_CertificationNotify( void *userdata,
char * dn = ne_ssl_readable_dname( ne_ssl_cert_subject( cert ) );
rtl::OUString cert_subject( dn, strlen( dn ), RTL_TEXTENCODING_UTF8, 0 );
- free( dn );
+ ne_free( dn );
security::CertificateContainerStatus certificateContainer(
xCertificateContainer->hasCertificate(
diff --git a/ucb/source/ucp/webdav/NeonUri.cxx b/ucb/source/ucp/webdav/NeonUri.cxx
index 9b97c264a6..85b9d1fbfe 100644
--- a/ucb/source/ucp/webdav/NeonUri.cxx
+++ b/ucb/source/ucp/webdav/NeonUri.cxx
@@ -32,6 +32,7 @@
#include <rtl/uri.hxx>
#include <rtl/ustring.hxx>
#include <rtl/ustrbuf.hxx>
+#include "ne_alloc.h"
#include "NeonUri.hxx"
#include "DAVException.hxx"
@@ -127,7 +128,7 @@ NeonUri::NeonUri( const ne_uri * inUri )
throw DAVException( DAVException::DAV_INVALID_ARG );
init( rtl::OString( uri ), inUri );
- free( uri );
+ ne_free( uri );
calculateURI();
}
diff --git a/ucb/source/ucp/webdav/exports.map b/ucb/source/ucp/webdav/exports.map
deleted file mode 100644
index 73671aa978..0000000000
--- a/ucb/source/ucp/webdav/exports.map
+++ /dev/null
@@ -1,8 +0,0 @@
-DAV_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/ucb/source/ucp/webdav/makefile.mk b/ucb/source/ucp/webdav/makefile.mk
index 551efb6f06..73ee298697 100644
--- a/ucb/source/ucp/webdav/makefile.mk
+++ b/ucb/source/ucp/webdav/makefile.mk
@@ -113,7 +113,7 @@ LIB1OBJFILES=$(SLOFILES)
SHL1TARGET=$(TARGET)$(UCP_VERSION)
SHL1IMPLIB=i$(TARGET)
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1STDLIBS=\
$(CPPUHELPERLIB) \
diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx
index 4b0d466b27..2c1d4d7395 100644
--- a/uui/source/iahndl.cxx
+++ b/uui/source/iahndl.cxx
@@ -34,13 +34,11 @@
#include "com/sun/star/container/XHierarchicalNameAccess.hpp"
#include "com/sun/star/document/BrokenPackageRequest.hpp"
#include "com/sun/star/task/DocumentMacroConfirmationRequest.hpp"
-#include "com/sun/star/task/DocumentMacroConfirmationRequest2.hpp"
#include "com/sun/star/java/WrongJavaVersionException.hpp"
#include "com/sun/star/lang/XInitialization.hpp"
#include "com/sun/star/lang/XMultiServiceFactory.hpp"
#include "com/sun/star/script/ModuleSizeExceededRequest.hpp"
#include "com/sun/star/sync2/BadPartnershipException.hpp"
-#include "com/sun/star/task/DocumentMacroConfirmationRequest2.hpp"
#include "com/sun/star/task/ErrorCodeIOException.hpp"
#include "com/sun/star/task/ErrorCodeRequest.hpp"
#include "com/sun/star/task/FutureDocumentVersionProductUpdateRequest.hpp"
@@ -73,12 +71,16 @@
#include "tools/rcid.h" // RSC_STRING
#include "tools/errinf.hxx" // ErrorHandler, ErrorContext, ...
#include "vos/mutex.hxx"
+#include "tools/diagnose_ex.h"
#include "comphelper/documentconstants.hxx" // ODFVER_012_TEXT
#include "svtools/sfxecode.hxx" // ERRCODE_SFX_*
#include "vcl/msgbox.hxx"
#include "vcl/svapp.hxx"
#include "unotools/configmgr.hxx"
#include "toolkit/helper/vclunohelper.hxx"
+#include "comphelper/namedvaluecollection.hxx"
+#include "typelib/typedescription.hxx"
+#include "unotools/confignode.hxx"
#include "ids.hrc"
@@ -88,7 +90,26 @@
#include "iahndl.hxx"
-using namespace com::sun::star;
+/** === begin UNO using === **/
+using ::com::sun::star::uno::Sequence;
+using ::com::sun::star::uno::UNO_QUERY;
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::task::XInteractionContinuation;
+using ::com::sun::star::task::XInteractionAbort;
+using ::com::sun::star::task::XInteractionApprove;
+using ::com::sun::star::task::XInteractionAskLater;
+using ::com::sun::star::task::FutureDocumentVersionProductUpdateRequest;
+using ::com::sun::star::uno::XInterface;
+using ::com::sun::star::lang::XInitialization;
+using ::com::sun::star::uno::UNO_QUERY_THROW;
+using ::com::sun::star::task::XInteractionHandler2;
+using ::com::sun::star::uno::Exception;
+using ::com::sun::star::uno::Any;
+using ::com::sun::star::task::XInteractionRequest;
+using ::com::sun::star::lang::XMultiServiceFactory;
+/** === end UNO using === **/
+
+using namespace ::com::sun::star;
namespace {
@@ -310,47 +331,116 @@ UUIInteractionHelper::tryOtherInteractionHandler(
aIt != aEnd;
++aIt)
{
- uno::Reference< uno::XInterface > xIfc;
+ if ( handleCustomRequest( rRequest, aIt->ServiceName ) )
+ return true;
+ }
+ return false;
+}
- try
- {
- xIfc = m_xServiceFactory->createInstance(aIt->ServiceName);
- }
- catch ( uno::RuntimeException const & )
- {
- throw;
- }
- catch ( uno::Exception const & )
+namespace
+{
+ // .................................................................................................................
+ static bool lcl_matchesRequest( const Any& i_rRequest, const ::rtl::OUString& i_rTypeName, const ::rtl::OUString& i_rPropagation )
+ {
+ const ::com::sun::star::uno::TypeDescription aTypeDesc( i_rTypeName );
+ const typelib_TypeDescription* pTypeDesc = aTypeDesc.get();
+ if ( !pTypeDesc || !pTypeDesc->pWeakRef )
{
+#if OSL_DEBUG_LEVEL > 0
+ ::rtl::OStringBuffer aMessage;
+ aMessage.append( "no type found for '" );
+ aMessage.append( ::rtl::OUStringToOString( i_rTypeName, RTL_TEXTENCODING_UTF8 ) );
+ aMessage.append( "'" );
+ OSL_ENSURE( false, aMessage.makeStringAndClear().getStr() );
+#endif
+ return false;
}
+ const ::com::sun::star::uno::Type aType( pTypeDesc->pWeakRef );
- uno::Reference< lang::XInitialization >
- xInitialization( xIfc, uno::UNO_QUERY );
+ const bool bExactMatch = ( i_rPropagation.compareToAscii( "named-only" ) == 0 );
+ if ( bExactMatch )
+ return i_rRequest.getValueType().equals( aType );
- OSL_ENSURE( xInitialization.is(),
- "Custom Interactionhandler does not "
- "implement mandatory interface XInitialization!" );
- if (xInitialization.is())
- {
- uno::Sequence< uno::Any > propertyValues(1);
- beans::PropertyValue aProperty;
+ return i_rRequest.isExtractableTo( aType );
+ }
+}
- aProperty.Name = rtl::OUString::createFromAscii( "Parent" );
- aProperty.Value <<= getParentXWindow();
- propertyValues[ 0 ] <<= aProperty;
+// ---------------------------------------------------------------------------------------------------------------------
+bool UUIInteractionHelper::handleCustomRequest( const Reference< XInteractionRequest >& i_rRequest, const ::rtl::OUString& i_rServiceName ) const
+{
+ try
+ {
+ Reference< XInteractionHandler2 > xHandler( m_xServiceFactory->createInstance( i_rServiceName ), UNO_QUERY_THROW );
- xInitialization->initialize(propertyValues);
+ Reference< XInitialization > xHandlerInit( xHandler, UNO_QUERY );
+ if ( xHandlerInit.is() )
+ {
+ ::comphelper::NamedValueCollection aInitArgs;
+ aInitArgs.put( "Parent", getParentXWindow() );
+ xHandlerInit->initialize( aInitArgs.getWrappedPropertyValues() );
}
- uno::Reference< task::XInteractionHandler2 >
- xIH( xIfc, uno::UNO_QUERY );
-
- OSL_ENSURE( xIH.is(),
- "Custom Interactionhandler does not "
- "implement mandatory interface XInteractionHandler2!" );
- if (xIH.is() && xIH->handleInteractionRequest(rRequest))
+ if ( xHandler->handleInteractionRequest( i_rRequest ) )
return true;
}
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return false;
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+bool UUIInteractionHelper::handleTypedHandlerImplementations( Reference< XInteractionRequest > const & rRequest )
+{
+ // the request
+ const Any aRequest( rRequest->getRequest() );
+
+ const StringHashMap::const_iterator aCacheHitTest = m_aTypedCustomHandlers.find( aRequest.getValueTypeName() );
+ if ( aCacheHitTest != m_aTypedCustomHandlers.end() )
+ return handleCustomRequest( rRequest, aCacheHitTest->second );
+
+ // the base registration node for "typed" interaction handlers
+ const ::utl::OConfigurationTreeRoot aConfigRoot( ::utl::OConfigurationTreeRoot::createWithServiceFactory(
+ m_xServiceFactory,
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Interaction/InteractionHandlers" ) ),
+ -1,
+ ::utl::OConfigurationTreeRoot::CM_READONLY
+ ) );
+
+ // loop through all registered implementations
+ const Sequence< ::rtl::OUString > aRegisteredHandlers( aConfigRoot.getNodeNames() );
+ const ::rtl::OUString* pHandlerName = aRegisteredHandlers.getConstArray();
+ const ::rtl::OUString* pHandlersEnd = aRegisteredHandlers.getConstArray() + aRegisteredHandlers.getLength();
+ for ( ; pHandlerName != pHandlersEnd; ++pHandlerName )
+ {
+ const ::utl::OConfigurationNode aHandlerNode( aConfigRoot.openNode( *pHandlerName ) );
+ const ::utl::OConfigurationNode aTypesNode( aHandlerNode.openNode( "HandledRequestTypes" ) );
+
+ // loop through all the types which the current handler is registered for
+ const Sequence< ::rtl::OUString > aHandledTypes( aTypesNode.getNodeNames() );
+ const ::rtl::OUString* pType = aHandledTypes.getConstArray();
+ const ::rtl::OUString* pTypesEnd = aHandledTypes.getConstArray() + aHandledTypes.getLength();
+ for ( ; pType != pTypesEnd; ++pType )
+ {
+ // the UNO type is the node name
+ ::utl::OConfigurationNode aType( aTypesNode.openNode( *pType ) );
+ // and there's a child denoting how the responsibility propagates
+ ::rtl::OUString sPropagation;
+ OSL_VERIFY( aType.getNodeValue( "Propagation" ) >>= sPropagation );
+ if ( lcl_matchesRequest( aRequest, *pType, sPropagation ) )
+ {
+ // retrieve the service/implementation name of the handler
+ ::rtl::OUString sServiceName;
+ OSL_VERIFY( aHandlerNode.getNodeValue( "ServiceName" ) >>= sServiceName );
+ // cache the information who feels responsible for requests of this type
+ m_aTypedCustomHandlers[ aRequest.getValueTypeName() ] = sServiceName;
+ // actually handle the request
+ return handleCustomRequest( rRequest, sServiceName );
+ }
+ }
+ }
+
return false;
}
@@ -819,24 +909,12 @@ UUIInteractionHelper::handleRequest_impl(
handleMacroConfirmRequest(
aMacroConfirmRequest.DocumentURL,
aMacroConfirmRequest.DocumentStorage,
- ODFVER_012_TEXT,
+ aMacroConfirmRequest.DocumentVersion.getLength() ? aMacroConfirmRequest.DocumentVersion : ODFVER_012_TEXT,
aMacroConfirmRequest.DocumentSignatureInformation,
rRequest->getContinuations());
return true;
}
- task::DocumentMacroConfirmationRequest2 aMacroConfirmRequest2;
- if (aAnyRequest >>= aMacroConfirmRequest2)
- {
- handleMacroConfirmRequest(
- aMacroConfirmRequest2.DocumentURL,
- aMacroConfirmRequest2.DocumentZipStorage,
- aMacroConfirmRequest2.DocumentVersion,
- aMacroConfirmRequest2.DocumentSignatureInformation,
- rRequest->getContinuations());
- return true;
- }
-
task::FutureDocumentVersionProductUpdateRequest
aProductUpdateRequest;
if (aAnyRequest >>= aProductUpdateRequest)
@@ -848,8 +926,14 @@ UUIInteractionHelper::handleRequest_impl(
}
///////////////////////////////////////////////////////////////
- // Last chance: try to find and use another IH for the request.
+ // Last chance: interaction handlers registered in the configuration
///////////////////////////////////////////////////////////////
+
+ // typed InteractionHandlers (ooo.Interactions)
+ if ( handleTypedHandlerImplementations( rRequest ) )
+ return true;
+
+ // legacy configuration (ooo.ucb.InteractionHandlers)
if (tryOtherInteractionHandler( rRequest ))
return true;
}
@@ -863,6 +947,15 @@ UUIInteractionHelper::handleRequest_impl(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),
uno::Reference< uno::XInterface >());
}
+ catch( const uno::RuntimeException& )
+ {
+ throw; // allowed to leave here
+ }
+ catch( const uno::Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return false;
}
void
@@ -997,21 +1090,16 @@ UUIInteractionHelper::getParentProperty()
}
uno::Reference< awt::XWindow>
-UUIInteractionHelper::getParentXWindow()
+UUIInteractionHelper::getParentXWindow() const
SAL_THROW(())
{
osl::MutexGuard aGuard(m_aPropertyMutex);
- for (sal_Int32 i = 0; i < m_aProperties.getLength(); ++i)
+ ::comphelper::NamedValueCollection aProperties( m_aProperties );
+ if ( aProperties.has( "Parent" ) )
{
- beans::PropertyValue aProperty;
- if ((m_aProperties[i] >>= aProperty)
- && aProperty.
- Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Parent")))
- {
- uno::Reference< awt::XWindow > xWindow;
- aProperty.Value >>= xWindow;
- return xWindow;
- }
+ uno::Reference< awt::XWindow > xWindow;
+ OSL_VERIFY( aProperties.get( "Parent" ) >>= xWindow );
+ return xWindow;
}
return 0;
}
@@ -1350,11 +1438,8 @@ UUIInteractionHelper::handleFutureDocumentVersionUpdateRequest(
// suitable place), again, and we would only have one place where we remember the s_bDeferredToNextSession
// flag.
//
- // The side effect (well, actually the more important effect) would be that we do not need to burden
- // this central implementation with all interactions which are possible. Instead, separate parts of OOo
- // can define/implement different requests. (for instance, everything which today is done in the
- // css.sdb.InteractionHandler can then be routed through a "normal" interaction handler, where today we
- // always need to tell people to instantiate the SDB-version of the handler, not the normal one.)
+ // Note: The above pattern has been implemented in CWS autorecovery. Now the remaining task is to move the
+ // handling of this interaction to SFX, again.
if ( !s_bDeferredToNextSession )
{
diff --git a/uui/source/iahndl.hxx b/uui/source/iahndl.hxx
index 810ab6a244..b77032e3cf 100644
--- a/uui/source/iahndl.hxx
+++ b/uui/source/iahndl.hxx
@@ -68,6 +68,8 @@ namespace com { namespace sun { namespace star {
}
} } }
+#include <hash_map>
+
class Window;
//============================================================================
@@ -84,15 +86,18 @@ struct InteractionHandlerData
typedef std::vector< InteractionHandlerData > InteractionHandlerDataList;
+typedef ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > Continuations;
+
+typedef ::std::hash_map< ::rtl::OUString, ::rtl::OUString, ::rtl::OUStringHash > StringHashMap;
+
//============================================================================
class UUIInteractionHelper
{
private:
- osl::Mutex m_aPropertyMutex;
- com::sun::star::uno::Reference<
- com::sun::star::lang::XMultiServiceFactory > m_xServiceFactory;
- com::sun::star::uno::Sequence< com::sun::star::uno::Any > m_aProperties;
-
+ mutable osl::Mutex m_aPropertyMutex;
+ ::com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xServiceFactory;
+ ::com::sun::star::uno::Sequence< com::sun::star::uno::Any > m_aProperties;
+ StringHashMap m_aTypedCustomHandlers;
UUIInteractionHelper(UUIInteractionHelper &); // not implemented
void operator =(UUIInteractionHelper); // not implemented
@@ -155,7 +160,7 @@ private:
SAL_THROW(());
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow>
- getParentXWindow()
+ getParentXWindow() const
SAL_THROW(());
rtl::OUString
@@ -166,6 +171,10 @@ private:
getInteractionHandler()
SAL_THROW((com::sun::star::uno::RuntimeException));
+ bool handleTypedHandlerImplementations(
+ ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionRequest > const & rRequest
+ );
+
bool
tryOtherInteractionHandler(
com::sun::star::uno::Reference<
@@ -328,6 +337,11 @@ private:
com::sun::star::uno::Reference<
com::sun::star::task::XInteractionRequest > const & rRequest)
SAL_THROW((::com::sun::star::uno::RuntimeException));
+
+ bool handleCustomRequest(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionRequest >& i_rRequest,
+ const ::rtl::OUString& i_rServiceName
+ ) const;
};
class ErrorResource: private Resource
diff --git a/uui/source/lockfailed.src b/uui/source/lockfailed.src
index c4057387ed..4ccc1c78b3 100644
--- a/uui/source/lockfailed.src
+++ b/uui/source/lockfailed.src
@@ -37,7 +37,7 @@ String STR_LOCKFAILED_TITLE
};
String STR_LOCKFAILED_MSG
{
- Text [ en-US ] = "The file could not be locked for exclusive access by %PRODUCTNAME, due to missing permission to created a lock file on that file location.";
+ Text [ en-US ] = "The file could not be locked for exclusive access by %PRODUCTNAME, due to missing permission to create a lock file on that file location.";
};
String STR_LOCKFAILED_DONTSHOWAGAIN
{
diff --git a/uui/util/exports.map b/uui/util/exports.map
deleted file mode 100644
index ba501f9ae0..0000000000
--- a/uui/util/exports.map
+++ /dev/null
@@ -1,10 +0,0 @@
-UDK_3_0_0 {
- global:
- GetVersionInfo;
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/uui/util/makefile.mk b/uui/util/makefile.mk
index 78d726d0ee..163a7bb550 100644
--- a/uui/util/makefile.mk
+++ b/uui/util/makefile.mk
@@ -38,7 +38,7 @@ NO_BSYMBOLIC = true
SHL1TARGET = $(TARGET)$(DLLPOSTFIX)
SHL1IMPLIB = i$(TARGET)
-SHL1VERSIONMAP = exports.map
+SHL1VERSIONMAP = $(SOLARENV)/src/component.map
SHL1DEF = $(MISC)$/$(SHL1TARGET).def
DEF1NAME = $(SHL1TARGET)
diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx
index 1350accebb..004d9eeb17 100644
--- a/vbahelper/source/vbahelper/vbahelper.cxx
+++ b/vbahelper/source/vbahelper/vbahelper.cxx
@@ -608,7 +608,7 @@ void PrintOutHelper( SfxViewShell* pViewShell, const uno::Any& From, const uno::
{
if ( bPreview )
{
- if ( !pViewFrame->GetFrame()->IsInPlace() )
+ if ( !pViewFrame->GetFrame().IsInPlace() )
{
// #TODO is this necessary ( calc specific )
// SC_MOD()->InputEnterHandler();
diff --git a/vbahelper/util/makefile.mk b/vbahelper/util/makefile.mk
index 09f3866c54..98adae420e 100644
--- a/vbahelper/util/makefile.mk
+++ b/vbahelper/util/makefile.mk
@@ -72,7 +72,7 @@ TARGET_MSFORMS=msforms
SHL2TARGET=$(TARGET_MSFORMS)$(DLLPOSTFIX).uno
SHL2IMPLIB= i$(TARGET_MSFORMS)
-SHL2VERSIONMAP=$(TARGET_MSFORMS).map
+SHL2VERSIONMAP=$(SOLARENV)/src/component.map
SHL2DEF=$(MISC)$/$(SHL2TARGET).def
DEF2NAME=$(SHL2TARGET)
SHL2STDLIBS= \
diff --git a/vbahelper/util/msforms.map b/vbahelper/util/msforms.map
deleted file mode 100644
index 737cddbfe3..0000000000
--- a/vbahelper/util/msforms.map
+++ /dev/null
@@ -1,9 +0,0 @@
-OOO_1.1 {
- global:
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};
diff --git a/xmlhelp/source/com/sun/star/help/makefile.mk b/xmlhelp/source/com/sun/star/help/makefile.mk
index f802ad2467..ffa08b30cf 100644
--- a/xmlhelp/source/com/sun/star/help/makefile.mk
+++ b/xmlhelp/source/com/sun/star/help/makefile.mk
@@ -28,42 +28,18 @@
PRJ = ..$/..$/..$/..$/..
PRJNAME = xmlhelp
TARGET = HelpLinker
-LIBBASENAME = helplinker
PACKAGE = com$/sun$/star$/help
-TARGETTYPE=CUI
.IF "$(SOLAR_JAVA)"!=""
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
-.INCLUDE : helplinker.pmk
-.IF "$(SYSTEM_LIBXSLT)" == "YES"
-CFLAGS+= $(LIBXSLT_CFLAGS)
-.ELSE
-LIBXSLTINCDIR=external$/libxslt
-CFLAGS+= -I$(SOLARINCDIR)$/$(LIBXSLTINCDIR)
-.ENDIF
-
-.IF "$(SYSTEM_DB)" == "YES"
-CFLAGS+=-DSYSTEM_DB -I$(DB_INCLUDES)
-.ENDIF
-
-.IF "$(SYSTEM_EXPAT)" == "YES"
-CFLAGS+=-DSYSTEM_EXPAT
-.ENDIF
-
-
JAVACLASSFILES = \
$(CLASSDIR)$/$(PACKAGE)$/HelpSearch.class \
$(CLASSDIR)$/$(PACKAGE)$/HelpComponent.class \
$(CLASSDIR)$/$(PACKAGE)$/HelpIndexer.class
-JAVAFILES = \
- HelpSearch.java \
- HelpComponent.java \
- HelpIndexer.java
-
TRANSEX3FILES = \
$(SOLARBINDIR)$/help$/$(PACKAGE)$/HelpIndexerTool.class \
$(SOLARBINDIR)$/help$/$(PACKAGE)$/HelpFileDocument.class
@@ -72,8 +48,8 @@ ADDFILES = $(subst,$(SOLARBINDIR)$/help,$(CLASSDIR) $(TRANSEX3FILES))
JARFILES = ridl.jar jurt.jar unoil.jar juh.jar
.IF "$(SYSTEM_LUCENE)" == "YES"
-XCLASSPATH!:=$(XCLASSPATH)$(PATH_SEPERATOR)$(LUCENE_CORE_JAR)$(PATH_SEPERATOR)$(LUCENE_ANALYZERS_JAR)
-JARCLASSPATH = file://$(LUCENE_CORE_JAR) file://$(LUCENE_ANALYZERS_JAR)
+EXTRAJARFILES = $(LUCENE_CORE_JAR) $(LUCENE_ANALYZERS_JAR)
+JARCLASSPATH = $(EXTRAJARFILES)
.ELSE
JARFILES += lucene-core-2.3.jar lucene-analyzers-2.3.jar
JARCLASSPATH = lucene-core-2.3.jar lucene-analyzers-2.3.jar
@@ -87,14 +63,12 @@ CUSTOMMANIFESTFILE = MANIFEST.MF
.INCLUDE : target.mk
-ALLTAR : $(ADDFILES)
-
.IF "$(JARTARGETN)"!=""
$(JAVATARGET) : $(ADDFILES)
$(JARTARGETN) : $(ADDFILES)
.ENDIF
-$(CLASSDIR)$/$(PACKAGE)$/%.class : $(SOLARBINDIR)$/help$/$(PACKAGE)$/%.class
+$(ADDFILES) : $(SOLARBINDIR)$/help$/$(PACKAGE)$/$$(@:f)
$(MKDIRHIER) $(@:d)
$(COPY) $< $@
diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx
index 4ed58e89eb..6693d69d5d 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.cxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.cxx
@@ -57,6 +57,12 @@
#include <com/sun/star/script/XInvocation.hpp>
#include <comphelper/locale.hxx>
+#include <com/sun/star/awt/XToolkit.hpp>
+#include <com/sun/star/awt/XExtendedToolkit.hpp>
+#include <com/sun/star/awt/XWindowPeer.hpp>
+#include <com/sun/star/awt/XVclWindowPeer.hpp>
+#include <com/sun/star/awt/XTopWindow.hpp>
+
#include <l10ntools/compilehelp.hxx>
#include <comphelper/storagehelper.hxx>
@@ -134,26 +140,11 @@ rtl::OUString Databases::expandURL( const rtl::OUString& aURL, Reference< uno::X
return aRetURL;
}
-
-// Hold Packages to improve performance (#i106100)
-// The PackageManager implementation seems to completely throw away all cached data
-// as soon as the last reference to a XPackage dies. Maybe this should be changed.
-struct ImplPackageSequenceHolder
-{
- Sequence< Reference< deployment::XPackage > > m_aUserPackagesSeq;
- Sequence< Reference< deployment::XPackage > > m_aSharedPackagesSeq;
-};
-
-static ImplPackageSequenceHolder* GpPackageSequenceHolder = NULL;
-
Databases::Databases( sal_Bool showBasic,
const rtl::OUString& instPath,
const com::sun::star::uno::Sequence< rtl::OUString >& imagesZipPaths,
const rtl::OUString& productName,
const rtl::OUString& productVersion,
- const rtl::OUString& vendorName,
- const rtl::OUString& vendorVersion,
- const rtl::OUString& vendorShort,
const rtl::OUString& styleSheet,
Reference< uno::XComponentContext > xContext )
: m_xContext( xContext ),
@@ -185,9 +176,7 @@ Databases::Databases( sal_Bool showBasic,
m_vReplacement[0] = productName;
m_vReplacement[1] = productVersion;
- m_vReplacement[2] = vendorName;
- m_vReplacement[3] = vendorVersion;
- m_vReplacement[4] = vendorShort;
+ // m_vReplacement[2...4] (vendorName/-Version/-Short) are empty strings
m_vReplacement[5] = productName;
m_vReplacement[6] = productVersion;
@@ -196,7 +185,6 @@ Databases::Databases( sal_Bool showBasic,
m_xSFA = Reference< ucb::XSimpleFileAccess >(
m_xSMgr->createInstanceWithContext( rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ),
m_xContext ), UNO_QUERY_THROW );
- GpPackageSequenceHolder = new ImplPackageSequenceHolder();
}
Databases::~Databases()
@@ -244,8 +232,6 @@ Databases::~Databases()
++it;
}
}
-
- delete GpPackageSequenceHolder;
}
static bool impl_getZipFile(
@@ -1290,20 +1276,48 @@ void Databases::cascadingStylesheet( const rtl::OUString& Language,
int retry = 2;
bool error = true;
rtl::OUString fileURL;
+
+ sal_Bool bHighContrastMode = sal_False;
+ rtl::OUString aCSS( m_aCSS );
+ if ( aCSS.compareToAscii( "default" ) == 0 )
+ {
+ // #i50760: "default" needs to adapt HC mode
+ uno::Reference< awt::XToolkit > xToolkit = uno::Reference< awt::XToolkit >(
+ ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.Toolkit" ) ) ), uno::UNO_QUERY );
+ if ( xToolkit.is() )
+ {
+ uno::Reference< awt::XExtendedToolkit > xExtToolkit( xToolkit, uno::UNO_QUERY );
+ if ( xExtToolkit.is() )
+ {
+ uno::Reference< awt::XTopWindow > xTopWindow = xExtToolkit->getActiveTopWindow();
+ if ( xTopWindow.is() )
+ {
+ uno::Reference< awt::XVclWindowPeer > xVclWindowPeer( xTopWindow, uno::UNO_QUERY );
+ if ( xVclWindowPeer.is() )
+ {
+ uno::Any aHCMode = xVclWindowPeer->getProperty( rtl::OUString::createFromAscii( "HighContrastMode" ) );
+ if ( ( aHCMode >>= bHighContrastMode ) && bHighContrastMode )
+ aCSS = rtl::OUString::createFromAscii( "highcontrastblack" );
+ }
+ }
+ }
+ }
+ }
while( error && retry )
{
+
if( retry == 2 )
fileURL =
getInstallPathAsURL() +
processLang( Language ) +
rtl::OUString::createFromAscii( "/" ) +
- m_aCSS +
+ aCSS +
rtl::OUString::createFromAscii( ".css" );
else if( retry == 1 )
fileURL =
getInstallPathAsURL() +
- m_aCSS +
+ aCSS +
rtl::OUString::createFromAscii( ".css" );
osl::DirectoryItem aDirItem;
@@ -1324,6 +1338,13 @@ void Databases::cascadingStylesheet( const rtl::OUString& Language,
}
--retry;
+ if ( !retry && error && bHighContrastMode )
+ {
+ // fall back to default css
+ aCSS = rtl::OUString::createFromAscii( "default" );
+ retry = 2;
+ bHighContrastMode = sal_False;
+ }
}
if( error )
@@ -1567,9 +1588,6 @@ Reference< deployment::XPackage > ExtensionIteratorBase::implGetNextUserHelpPack
thePackageManagerFactory::get( m_xContext )->getPackageManager( rtl::OUString::createFromAscii("user") );
m_aUserPackagesSeq = xUserManager->getDeployedPackages
( Reference< task::XAbortChannel >(), Reference< ucb::XCommandEnvironment >() );
- if( GpPackageSequenceHolder != NULL )
- GpPackageSequenceHolder->m_aUserPackagesSeq = m_aUserPackagesSeq;
-
m_bUserPackagesLoaded = true;
}
@@ -1599,9 +1617,6 @@ Reference< deployment::XPackage > ExtensionIteratorBase::implGetNextSharedHelpPa
thePackageManagerFactory::get( m_xContext )->getPackageManager( rtl::OUString::createFromAscii("shared") );
m_aSharedPackagesSeq = xSharedManager->getDeployedPackages
( Reference< task::XAbortChannel >(), Reference< ucb::XCommandEnvironment >() );
- if( GpPackageSequenceHolder != NULL )
- GpPackageSequenceHolder->m_aSharedPackagesSeq = m_aSharedPackagesSeq;
-
m_bSharedPackagesLoaded = true;
}
diff --git a/xmlhelp/source/cxxhelp/provider/databases.hxx b/xmlhelp/source/cxxhelp/provider/databases.hxx
index 249729f829..51b469cfa0 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.hxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.hxx
@@ -189,9 +189,6 @@ namespace chelp {
const com::sun::star::uno::Sequence< rtl::OUString >& imagesZipPaths,
const rtl::OUString& productName,
const rtl::OUString& productVersion,
- const rtl::OUString& vendorName,
- const rtl::OUString& vendorVersion,
- const rtl::OUString& vendorShort,
const rtl::OUString& styleSheet,
com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > xContext );
@@ -291,9 +288,6 @@ namespace chelp {
rtl::OUString getProductName() const { return m_vReplacement[0]; }
rtl::OUString getProductVersion() const { return m_vReplacement[1]; }
- rtl::OUString getVendorName() const { return m_vReplacement[2]; }
- rtl::OUString getVendorVersion() const { return m_vReplacement[3]; }
- rtl::OUString getVendorShort() const { return m_vReplacement[4]; }
rtl::OUString expandURL( const rtl::OUString& aURL );
diff --git a/xmlhelp/source/cxxhelp/provider/provider.cxx b/xmlhelp/source/cxxhelp/provider/provider.cxx
index 765fffdc02..0a16022a89 100644
--- a/xmlhelp/source/cxxhelp/provider/provider.cxx
+++ b/xmlhelp/source/cxxhelp/provider/provider.cxx
@@ -45,7 +45,6 @@
#include <com/sun/star/beans/PropertyAttribute.hpp>
#endif
#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/beans/PropertyState.hpp>
#include <com/sun/star/container/XContainer.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/container/XNameReplace.hpp>
@@ -308,9 +307,6 @@ void ContentProvider::init()
* now determing
* productname,
* productversion,
- * vendorname,
- * vendorversion,
- * vendorshort
*/
xHierAccess = getHierAccess( sProvider, "org.openoffice.Setup" );
@@ -351,20 +347,6 @@ void ContentProvider::init()
rtl::OUString::createFromAscii( " " ) +
setupextension );
- xHierAccess = getHierAccess( sProvider, "org.openoffice.Webtop.Common" );
- rtl::OUString vendorname(
- getKey( xHierAccess,"Product/ooName" ) );
-
- setupversion = rtl::OUString(
- getKey( xHierAccess,"Product/ooSetupVersion" ) );
- setupextension = rtl::OUString(
- getKey( xHierAccess,"Product/ooSetupExtension") );
- rtl::OUString vendorversion(
- setupversion +
- rtl::OUString::createFromAscii( " " ) +
- setupextension );
- rtl::OUString vendorshort = vendorname;
-
uno::Sequence< rtl::OUString > aImagesZipPaths( 2 );
xHierAccess = getHierAccess( sProvider, "org.openoffice.Office.Common" );
@@ -392,9 +374,6 @@ void ContentProvider::init()
aImagesZipPaths,
productname,
productversion,
- vendorname,
- vendorversion,
- vendorshort,
stylesheet,
xContext );
}
@@ -405,17 +384,6 @@ ContentProvider::getConfiguration() const
uno::Reference< lang::XMultiServiceFactory > sProvider;
if( m_xSMgr.is() )
{
- uno::Any aAny;
- aAny <<= rtl::OUString::createFromAscii( "plugin" );
- beans::PropertyValue aProp(
- rtl::OUString::createFromAscii( "servertype" ),
- -1,
- aAny,
- beans::PropertyState_DIRECT_VALUE );
-
- uno::Sequence< uno::Any > seq(1);
- seq[0] <<= aProp;
-
try
{
rtl::OUString sProviderService =
@@ -423,8 +391,7 @@ ContentProvider::getConfiguration() const
"com.sun.star.configuration.ConfigurationProvider" );
sProvider =
uno::Reference< lang::XMultiServiceFactory >(
- m_xSMgr->createInstanceWithArguments(
- sProviderService,seq ),
+ m_xSMgr->createInstance( sProviderService ),
uno::UNO_QUERY );
}
catch( const uno::Exception& )
diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
index e52a0fac91..646c55ab8b 100644
--- a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
+++ b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
@@ -992,20 +992,11 @@ InputStreamTransformer::InputStreamTransformer( URLParameter* urlParam,
parString[last++] = "'css'";
parString[last++] = "vendorname";
- parString[last++] = rtl::OString('\'') +
- rtl::OString( pDatabases->getVendorName().getStr(),
- pDatabases->getVendorName().getLength(),
- RTL_TEXTENCODING_UTF8 ) + rtl::OString('\'');
+ parString[last++] = rtl::OString("''");
parString[last++] = "vendorversion";
- parString[last++] = rtl::OString('\'') +
- rtl::OString( pDatabases->getVendorVersion().getStr(),
- pDatabases->getVendorVersion().getLength(),
- RTL_TEXTENCODING_UTF8 ) + rtl::OString('\'');
+ parString[last++] = rtl::OString("''");
parString[last++] = "vendorshort";
- parString[last++] = rtl::OString('\'') +
- rtl::OString( pDatabases->getVendorShort().getStr(),
- pDatabases->getVendorShort().getLength(),
- RTL_TEXTENCODING_UTF8 ) + rtl::OString('\'');
+ parString[last++] = rtl::OString("''");
}
// Do we need to add extension path?
diff --git a/xmlhelp/source/treeview/makefile.mk b/xmlhelp/source/treeview/makefile.mk
index df01c8a55e..0c385862d7 100644
--- a/xmlhelp/source/treeview/makefile.mk
+++ b/xmlhelp/source/treeview/makefile.mk
@@ -58,7 +58,7 @@ SHL1STDLIBS=\
$(COMPHELPERLIB) \
$(EXPATASCII3RDLIB) \
$(SALLIB)
-SHL1VERSIONMAP= $(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
DEF1NAME=$(SHL1TARGET)
DEF1DES=UCB : Treeview help
diff --git a/xmlhelp/source/treeview/tvhlp.map b/xmlhelp/source/treeview/tvhlp.map
deleted file mode 100644
index d432afe363..0000000000
--- a/xmlhelp/source/treeview/tvhlp.map
+++ /dev/null
@@ -1,9 +0,0 @@
-TVHLP_1_0 {
- global:
- GetVersionInfo;
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-}; \ No newline at end of file
diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx
index a7931bfbb7..02ba6b9eaa 100644
--- a/xmlhelp/source/treeview/tvread.cxx
+++ b/xmlhelp/source/treeview/tvread.cxx
@@ -39,7 +39,6 @@
#include <osl/file.hxx>
#include <com/sun/star/frame/XConfigManager.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/beans/PropertyState.hpp>
#include <comphelper/processfactory.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
@@ -674,22 +673,6 @@ ConfigData TVChildTarget::init( const Reference< XMultiServiceFactory >& xSMgr )
// replace anything like $(instpath);
subst( xSMgr,instPath );
-
- /**********************************************************************/
- /* reading Webtop.Common */
- /**********************************************************************/
-
- xHierAccess = getHierAccess( sProvider,
- "org.openoffice.Webtop.Common" );
- rtl::OUString vendorName( getKey( xHierAccess,"Product/ooName" ) );
-
- rtl::OUString setupversion( getKey( xHierAccess,"Product/ooSetupVersion" ) );
- rtl::OUString setupextension( getKey( xHierAccess,"Product/ooSetupExtension") );
- rtl::OUString vendorVersion( setupversion +
- rtl::OUString::createFromAscii( " " ) +
- setupextension );
- rtl::OUString vendorShort = vendorName;
-
/**********************************************************************/
/* reading setup */
/**********************************************************************/
@@ -698,8 +681,8 @@ ConfigData TVChildTarget::init( const Reference< XMultiServiceFactory >& xSMgr )
"org.openoffice.Setup" );
rtl::OUString productName( getKey( xHierAccess,"Product/ooName" ) );
- setupversion = getKey( xHierAccess,"Product/ooSetupVersion" );
- setupextension = rtl::OUString();
+ rtl::OUString setupversion( getKey( xHierAccess,"Product/ooSetupVersion" ) );
+ rtl::OUString setupextension;
try
{
@@ -813,9 +796,7 @@ ConfigData TVChildTarget::init( const Reference< XMultiServiceFactory >& xSMgr )
configData.m_vAdd[4] = 12;
configData.m_vReplacement[0] = productName;
configData.m_vReplacement[1] = productVersion;
- configData.m_vReplacement[2] = vendorName;
- configData.m_vReplacement[3] = vendorVersion;
- configData.m_vReplacement[4] = vendorShort;
+ // m_vReplacement[2...4] (vendorName/-Version/-Short) are empty strings
configData.system = system;
configData.locale = locale;
@@ -843,23 +824,13 @@ TVChildTarget::getConfiguration(const Reference< XMultiServiceFactory >& m_xSMgr
Reference< XMultiServiceFactory > sProvider;
if( m_xSMgr.is() )
{
- Any aAny;
- aAny <<= rtl::OUString::createFromAscii( "plugin" );
- PropertyValue aProp( rtl::OUString::createFromAscii( "servertype" ),
- -1,
- aAny,
- PropertyState_DIRECT_VALUE );
-
- Sequence< Any > seq(1);
- seq[0] <<= aProp;
-
try
{
rtl::OUString sProviderService =
rtl::OUString::createFromAscii( "com.sun.star.configuration.ConfigurationProvider" );
sProvider =
Reference< XMultiServiceFactory >(
- m_xSMgr->createInstanceWithArguments( sProviderService,seq ),
+ m_xSMgr->createInstance( sProviderService ),
UNO_QUERY );
}
catch( const com::sun::star::uno::Exception& )
diff --git a/xmlhelp/util/exports.map b/xmlhelp/util/exports.map
deleted file mode 100644
index 14a2531f23..0000000000
--- a/xmlhelp/util/exports.map
+++ /dev/null
@@ -1,8 +0,0 @@
-VERS_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/xmlhelp/util/makefile.mk b/xmlhelp/util/makefile.mk
index e6cd48d34c..10206670b5 100644
--- a/xmlhelp/util/makefile.mk
+++ b/xmlhelp/util/makefile.mk
@@ -50,7 +50,7 @@ CFLAGS+=-GR
SHL1TARGET=$(TARGET)$(UCP_VERSION)
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
SHL1IMPLIB=i$(TARGET)
-SHL1VERSIONMAP=exports.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
# Add additional libs here.
SHL1STDLIBS= \
diff --git a/xmloff/inc/SchXMLExport.hxx b/xmloff/inc/SchXMLExport.hxx
index 9fc1085c44..da776a9934 100644
--- a/xmloff/inc/SchXMLExport.hxx
+++ b/xmloff/inc/SchXMLExport.hxx
@@ -38,7 +38,6 @@ namespace com { namespace sun { namespace star {
namespace chart {
class XDiagram;
class XChartDocument;
- class XChartDataArray;
struct ChartSeriesAddress;
}
namespace drawing {
diff --git a/xmloff/inc/xmloff/SchXMLExportHelper.hxx b/xmloff/inc/xmloff/SchXMLExportHelper.hxx
index cbe38e10d3..e2d175c006 100644
--- a/xmloff/inc/xmloff/SchXMLExportHelper.hxx
+++ b/xmloff/inc/xmloff/SchXMLExportHelper.hxx
@@ -44,7 +44,6 @@ namespace com { namespace sun { namespace star {
namespace chart {
class XDiagram;
class XChartDocument;
- class XChartDataArray;
struct ChartSeriesAddress;
}
namespace chart2 {
@@ -114,6 +113,7 @@ private:
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > mxAdditionalShapes;
tDataSequenceCont m_aDataSequencesToExport;
+ rtl::OUString maCategoriesRange;
/** first parseDocument: collect autostyles and store names in this queue
second parseDocument: export content and use names from this queue
@@ -179,8 +179,6 @@ private:
SAL_DLLPRIVATE void addSize( com::sun::star::uno::Reference< com::sun::star::drawing::XShape > xShape );
/// fills the member msString with the appropriate String (i.e. "A3")
SAL_DLLPRIVATE void getCellAddress( sal_Int32 nCol, sal_Int32 nRow );
- /// interchanges rows and columns of the sequence given
- SAL_DLLPRIVATE void swapDataArray( com::sun::star::uno::Sequence< com::sun::star::uno::Sequence< double > >& rSequence );
/// exports a string as a paragraph element
SAL_DLLPRIVATE void exportText( const ::rtl::OUString& rText, bool bConvertTabsLFs = false );
SAL_DLLPRIVATE void exportErrorBarRanges();
diff --git a/xmloff/inc/xmloff/SchXMLImportHelper.hxx b/xmloff/inc/xmloff/SchXMLImportHelper.hxx
index 6d48f5f6dc..21e1464f88 100644
--- a/xmloff/inc/xmloff/SchXMLImportHelper.hxx
+++ b/xmloff/inc/xmloff/SchXMLImportHelper.hxx
@@ -136,10 +136,6 @@ public:
static sal_uInt16 GetChartFamilyID() { return XML_STYLE_FAMILY_SCH_CHART_ID; }
- sal_Int32 GetNumberOfSeries();
- sal_Int32 GetLengthOfSeries();
- void ResizeChartData( sal_Int32 nSeries, sal_Int32 nDataPoints = -1 );
-
/** @param bPushLastChartType If </FALSE>, in case a new chart type has to
be added (because it does not exist yet), it is appended at the
end of the chart-type container. When </TRUE>, a new chart type
diff --git a/xmloff/inc/xmloff/SettingsExportHelper.hxx b/xmloff/inc/xmloff/SettingsExportHelper.hxx
index 6926b94ef9..6dc9d51bfa 100644
--- a/xmloff/inc/xmloff/SettingsExportHelper.hxx
+++ b/xmloff/inc/xmloff/SettingsExportHelper.hxx
@@ -28,6 +28,8 @@
#ifndef _XMLOFF_SETTINGSEXPORTHELPER_HXX
#define _XMLOFF_SETTINGSEXPORTHELPER_HXX
+#include "xmloff/dllapi.h"
+
#include <com/sun/star/awt/Rectangle.hpp>
#include <com/sun/star/formula/SymbolDescriptor.hpp>
#include <com/sun/star/util/XStringSubstitution.hpp>
@@ -40,9 +42,15 @@ namespace com
namespace util { struct DateTime; }
} }
}
-class XMLSettingsExportHelper
+
+namespace xmloff
+{
+ class XMLSettingsExportContext;
+}
+
+class XMLOFF_DLLPUBLIC XMLSettingsExportHelper
{
- SvXMLExport& rExport;
+ ::xmloff::XMLSettingsExportContext& m_rContext;
::com::sun::star::uno::Reference< ::com::sun::star::util::XStringSubstitution > mxStringSubsitution;
@@ -91,10 +99,10 @@ class XMLSettingsExportHelper
const rtl::OUString rName) const;
public:
- XMLSettingsExportHelper(SvXMLExport& rExport);
+ XMLSettingsExportHelper( ::xmloff::XMLSettingsExportContext& i_rContext );
~XMLSettingsExportHelper();
- void exportSettings(
+ void exportAllSettings(
const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aProps,
const rtl::OUString& rName) const;
};
diff --git a/xmloff/inc/xmloff/XMLSettingsExportContext.hxx b/xmloff/inc/xmloff/XMLSettingsExportContext.hxx
new file mode 100644
index 0000000000..d26a7e46a3
--- /dev/null
+++ b/xmloff/inc/xmloff/XMLSettingsExportContext.hxx
@@ -0,0 +1,66 @@
+/*************************************************************************
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2009 by Sun Microsystems, Inc.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+************************************************************************/
+
+#ifndef XML_SETTINGS_EXPORT_CONTEXT_HXX
+#define XML_SETTINGS_EXPORT_CONTEXT_HXX
+
+/** === begin UNO includes === **/
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+/** === end UNO includes === **/
+
+#include "xmloff/xmltoken.hxx"
+
+//........................................................................
+namespace xmloff
+{
+//........................................................................
+
+ //====================================================================
+ //= XMLExporter
+ //====================================================================
+ class SAL_NO_VTABLE XMLSettingsExportContext
+ {
+ public:
+ virtual void AddAttribute( enum ::xmloff::token::XMLTokenEnum i_eName,
+ const ::rtl::OUString& i_rValue ) = 0;
+ virtual void AddAttribute( enum ::xmloff::token::XMLTokenEnum i_eName,
+ enum ::xmloff::token::XMLTokenEnum i_eValue ) = 0;
+
+ virtual void StartElement( enum ::xmloff::token::XMLTokenEnum i_eName,
+ const sal_Bool i_bIgnoreWhitespace ) = 0;
+ virtual void EndElement( const sal_Bool i_bIgnoreWhitespace ) = 0;
+
+ virtual void Characters( const ::rtl::OUString& i_rCharacters ) = 0;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
+ GetServiceFactory() const = 0;
+
+ };
+
+//........................................................................
+} // namespace xmloff
+//........................................................................
+
+#endif // XML_SETTINGS_EXPORT_CONTEXT_HXX
diff --git a/configmgr/source/inc/utility.hxx b/xmloff/inc/xmloff/odffields.hxx
index a7acc77f86..ef8121a081 100644
--- a/configmgr/source/inc/utility.hxx
+++ b/xmloff/inc/xmloff/odffields.hxx
@@ -2,10 +2,13 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2000, 2010 Oracle and/or its affiliates.
+ * Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
*
+ * $RCSfile: $
+ * $Revision: $
+ *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -25,26 +28,29 @@
*
************************************************************************/
-#ifndef INCLUDED_CONFIGMGR_SOURCE_INC_UTILITY_HXX
-#define INCLUDED_CONFIGMGR_SOURCE_INC_UTILITY_HXX
+/*
+ * Copyright 2008 by Novell, Inc.
+ */
+
+#ifndef _ODFFIELDS_HXX
+#define _ODFFIELDS_HXX
+
-#include "sal/config.h"
+#define ODF_FORMTEXT "vnd.oasis.opendocument.field.FORMTEXT"
-#include "rtl/ustring.h"
-#include "rtl/ustring.hxx"
+#define ODF_FORMCHECKBOX "vnd.oasis.opendocument.field.FORMCHECKBOX"
+#define ODF_FORMCHECKBOX_HELPTEXT "Checkbox_HelpText"
+#define ODF_FORMCHECKBOX_NAME "Checkbox_Name"
+#define ODF_FORMCHECKBOX_RESULT "Checkbox_Checked"
-#if defined _MSC_VER && _MSC_VER >= 1400
-#pragma warning(disable: 4350)
- // behavior change: 'member1' called instead of 'member2'
-#endif
+#define ODF_FORMDROPDOWN "vnd.oasis.opendocument.field.FORMDROPDOWN"
+#define ODF_FORMDROPDOWN_LISTENTRY "Dropdown_ListEntry"
+#define ODF_FORMDROPDOWN_RESULT "Dropdown_Selected"
-namespace configmgr {
+#define ODF_TOC "vnd.oasis.opendocument.field.TOC"
- inline rtl_uString * acquireString(rtl::OUString const & string) {
- rtl_uString_acquire(string.pData);
- return string.pData;
- }
+#define ODF_HYPERLINK "vnd.oasis.opendocument.field.HYPERLINK"
-}
+#define ODF_PAGEREF "vnd.oasis.opendocument.field.PAGEREF"
-#endif
+#endif /* _ODFFIELDS_HXX */
diff --git a/xmloff/prj/build.lst b/xmloff/prj/build.lst
index 8817d45907..7b68ed08ff 100644
--- a/xmloff/prj/build.lst
+++ b/xmloff/prj/build.lst
@@ -14,3 +14,4 @@ xo xmloff\source\transform nmake - all xo_transform xo_util
xo xmloff\source\xforms nmake - all xo_xforms xo_inc NULL
xo xmloff\source\table nmake - all xo_table xo_inc NULL
xo xmloff\util nmake - all xo_util xo_chart xo_core xo_draw xo_forms xo_meta xo_script xo_style xo_text xo_xforms xo_table NULL
+xo xmloff\qa\unoapi nmake - all xo_qa_unoapi NULL
diff --git a/xmloff/prj/d.lst b/xmloff/prj/d.lst
index 686b4b70a0..0b51b0dd97 100644
--- a/xmloff/prj/d.lst
+++ b/xmloff/prj/d.lst
@@ -10,6 +10,7 @@ mkdir: %_DEST%\inc%_EXT%\xmloff
..\dtd\* %_DEST%\bin%_EXT%
+..\inc\xmloff\odffields.hxx %_DEST%\inc%_EXT%\xmloff\odffields.hxx
..\inc\xmloff\dllapi.h %_DEST%\inc%_EXT%\xmloff\dllapi.h
..\inc\xmloff\attrlist.hxx %_DEST%\inc%_EXT%\xmloff\attrlist.hxx
..\inc\i18nmap.hxx %_DEST%\inc%_EXT%\xmloff\i18nmap.hxx
@@ -87,6 +88,7 @@ mkdir: %_DEST%\inc%_EXT%\xmloff
..\inc\HatchStyle.hxx %_DEST%\inc%_EXT%\xmloff\HatchStyle.hxx
..\inc\ImageStyle.hxx %_DEST%\inc%_EXT%\xmloff\ImageStyle.hxx
..\inc\xmloff\SettingsExportHelper.hxx %_DEST%\inc%_EXT%\xmloff\SettingsExportHelper.hxx
+..\inc\xmloff\XMLSettingsExportContext.hxx %_DEST%\inc%_EXT%\xmloff\XMLSettingsExportContext.hxx
..\inc\xmloff\DocumentSettingsContext.hxx %_DEST%\inc%_EXT%\xmloff\DocumentSettingsContext.hxx
..\inc\xmloff\XMLGraphicsDefaultStyle.hxx %_DEST%\inc%_EXT%\xmloff\XMLGraphicsDefaultStyle.hxx
..\inc\XMLEmbeddedObjectExportFilter.hxx %_DEST%\inc%_EXT%\xmloff\XMLEmbeddedObjectExportFilter.hxx
diff --git a/xmloff/qa/unoapi/Test.java b/xmloff/qa/unoapi/Test.java
new file mode 100644
index 0000000000..d66144f108
--- /dev/null
+++ b/xmloff/qa/unoapi/Test.java
@@ -0,0 +1,51 @@
+/*************************************************************************
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+************************************************************************/
+
+package org.openoffice.xmloff.qa.unoapi;
+
+import org.openoffice.Runner;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
+
+public final class Test {
+ @org.junit.Before public void setUp() throws Exception {
+ connection.setUp();
+ }
+
+ @org.junit.After public void tearDown()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ connection.tearDown();
+ }
+
+ @org.junit.Test public void test() {
+ assertTrue(
+ Runner.run(
+ "-sce", "xmloff.sce", "-xcl", "knownissues.xcl", "-tdoc",
+ "testdocuments", "-cs", connection.getDescription()));
+ }
+
+ private final OfficeConnection connection = new OfficeConnection();
+}
diff --git a/xmloff/qa/unoapi/makefile.mk b/xmloff/qa/unoapi/makefile.mk
index 0b8d1ebf92..3cbbc5f2a7 100644
--- a/xmloff/qa/unoapi/makefile.mk
+++ b/xmloff/qa/unoapi/makefile.mk
@@ -1,7 +1,6 @@
#*************************************************************************
-#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -22,19 +21,28 @@
# version 3 along with OpenOffice.org. If not, see
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
+#***********************************************************************/
-PRJ=..$/..
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
-PRJNAME=xmloff
-TARGET=qa_unoapi
+PRJ = ../..
+PRJNAME = xmloff
+TARGET = qa_unoapi
-.INCLUDE: settings.mk
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = org/openoffice/xmloff/qa/unoapi
+JAVATESTFILES = Test.java
+JAVAFILES = $(JAVATESTFILES)
+JARFILES = OOoRunner.jar ridl.jar test.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+.END
+.INCLUDE: settings.mk
.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
-ALLTAR : UNOAPI_TEST
+ALLTAR : javatest
-UNOAPI_TEST:
- +$(SOLARENV)$/bin$/checkapi -sce xmloff.sce -xcl knownissues.xcl -tdoc $(PWD)$/testdocuments
+.END
diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx
index 075e3f66bc..e3d9727b4a 100644
--- a/xmloff/source/chart/SchXMLChartContext.cxx
+++ b/xmloff/source/chart/SchXMLChartContext.cxx
@@ -57,7 +57,6 @@
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
#include <com/sun/star/drawing/XDrawPage.hpp>
#include <com/sun/star/chart/ChartDataRowSource.hpp>
-#include <com/sun/star/chart/XChartDataArray.hpp>
#include <com/sun/star/awt/PosSize.hpp>
#include <com/sun/star/embed/Aspects.hpp>
#include <com/sun/star/embed/XVisualObject.hpp>
@@ -874,6 +873,9 @@ void SchXMLChartContext::EndElement()
{
//own data or only rectangular range available
+ if( xNewDoc->hasInternalDataProvider() )
+ SchXMLTableHelper::applyTableToInternalDataProvider( maTable, xNewDoc );
+
bool bOlderThan2_3 = SchXMLTools::isDocumentGeneratedWithOpenOfficeOlderThan2_3( Reference< frame::XModel >( xNewDoc, uno::UNO_QUERY ));
bool bOldFileWithOwnDataFromRows = (bOlderThan2_3 && bHasOwnData && (meDataRowSource==chart::ChartDataRowSource_ROWS)); // in this case there are range addresses that are simply wrong.
@@ -882,21 +884,12 @@ void SchXMLChartContext::EndElement()
{
//bHasOwnData is true in this case!
//e.g. for normal files with own data or also in case of copy paste scenario (e.g. calc to impress)
- if( xNewDoc->hasInternalDataProvider() )
- SchXMLTableHelper::applyTableToInternalDataProvider( maTable, xNewDoc );
bSwitchRangesFromOuterToInternalIfNecessary = true;
}
else
{
//apply data from rectangular range
- // apply data read from the table sub-element to the chart
- // if the data provider supports the XChartDataArray interface like
- // the internal data provider
- uno::Reference< chart::XChartDataArray > xChartData( xNewDoc->getDataProvider(), uno::UNO_QUERY );
- if( xChartData.is())
- SchXMLTableHelper::applyTableSimple( maTable, xChartData );
-
// create datasource from data provider with rectangular range
// parameters and change the diagram via template mechanism
try
@@ -919,9 +912,7 @@ void SchXMLChartContext::EndElement()
if( !xNewDoc->hasInternalDataProvider() )
{
xNewDoc->createInternalDataProvider( sal_False /* bCloneExistingData */ );
- xChartData = uno::Reference< chart::XChartDataArray >( xNewDoc->getDataProvider(), uno::UNO_QUERY );
- if( xChartData.is())
- SchXMLTableHelper::applyTableSimple( maTable, xChartData );
+ SchXMLTableHelper::applyTableToInternalDataProvider( maTable, xNewDoc );
try
{
lcl_ApplyDataFromRectangularRangeToDiagram( xNewDoc, msChartAddress, meDataRowSource, mbRowHasLabels, mbColHasLabels, bHasOwnData, msColTrans, msRowTrans );
diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx
index 5141f23e88..b566acb259 100644
--- a/xmloff/source/chart/SchXMLExport.cxx
+++ b/xmloff/source/chart/SchXMLExport.cxx
@@ -71,7 +71,7 @@
#include <com/sun/star/chart/XTwoAxisXSupplier.hpp>
#include <com/sun/star/chart/XTwoAxisYSupplier.hpp>
#include <com/sun/star/chart/XAxisZSupplier.hpp>
-#include <com/sun/star/chart/XChartDataArray.hpp>
+#include <com/sun/star/chart/XComplexDescriptionAccess.hpp>
#include <com/sun/star/chart/ChartDataRowSource.hpp>
#include <com/sun/star/chart/ChartAxisAssign.hpp>
#include <com/sun/star/chart/ChartSeriesAddress.hpp>
@@ -116,6 +116,7 @@ using ::rtl::OUStringToOString;
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Any;
+using ::std::vector;
namespace
{
@@ -166,6 +167,13 @@ template< typename T >
::std::back_inserter( rDestination ));
}
+template< typename T >
+ void lcl_SequenceToVector( const Sequence< T > & rSource, ::std::vector< T > & rDestination )
+{
+ rDestination.clear();
+ lcl_SequenceToVectorAppend( rSource, rDestination );
+}
+
Reference< chart2::data::XLabeledDataSequence > lcl_getCategories( const Reference< chart2::XDiagram > & xDiagram )
{
Reference< chart2::data::XLabeledDataSequence > xResult;
@@ -209,24 +217,6 @@ Reference< chart2::data::XLabeledDataSequence > lcl_getCategories( const Referen
ex.Message, RTL_TEXTENCODING_ASCII_US ).getStr());
}
- /*
- //unused ranges are very problematic as they bear the risk to damage the rectangular structure completly
- if(!xResult.is())
- {
- Sequence< Reference< chart2::data::XLabeledDataSequence > > aUnusedSequences( xDiagram->getUnusedData() );
-
- lcl_MatchesRole aHasCategories( OUString::createFromAscii("categories" ) );
- for( sal_Int32 nN=0; nN<aUnusedSequences.getLength(); nN++ )
- {
- if( aHasCategories( aUnusedSequences[nN] ) )
- {
- xResult.set( aUnusedSequences[nN] );
- break;
- }
- }
- }
- */
-
return xResult;
}
@@ -471,12 +461,6 @@ sal_Int32 lcl_getMaxSequenceLength(
for( SchXMLExportHelper::tDataSequenceCont::const_iterator aIt( rContainer.begin());
aIt != rContainer.end(); ++aIt )
{
- if( aIt->first.is())
- {
- sal_Int32 nSeqLength = aIt->first->getData().getLength();
- if( nSeqLength > nResult )
- nResult = nSeqLength;
- }
if( aIt->second.is())
{
sal_Int32 nSeqLength = aIt->second->getData().getLength();
@@ -487,30 +471,6 @@ sal_Int32 lcl_getMaxSequenceLength(
return nResult;
}
-void lcl_fillCategoriesIntoStringVector(
- const Reference< chart2::data::XDataSequence > & xCategories,
- ::std::vector< OUString > & rOutCategories )
-{
- OSL_ASSERT( xCategories.is());
- if( !xCategories.is())
- return;
- Reference< chart2::data::XTextualDataSequence > xTextualDataSequence( xCategories, uno::UNO_QUERY );
- if( xTextualDataSequence.is())
- {
- rOutCategories.clear();
- Sequence< OUString > aTextData( xTextualDataSequence->getTextualData());
- ::std::copy( aTextData.getConstArray(), aTextData.getConstArray() + aTextData.getLength(),
- ::std::back_inserter( rOutCategories ));
- }
- else
- {
- Sequence< uno::Any > aAnies( xCategories->getData());
- rOutCategories.resize( aAnies.getLength());
- for( sal_Int32 i=0; i<aAnies.getLength(); ++i )
- aAnies[i] >>= rOutCategories[i];
- }
-}
-
double lcl_getValueFromSequence( const Reference< chart2::data::XDataSequence > & xSeq, sal_Int32 nIndex )
{
double fResult = 0.0;
@@ -579,17 +539,23 @@ bool lcl_SequenceHasUnhiddenData( const uno::Reference< chart2::data::XDataSeque
return false;
}
+typedef vector< OUString > tStringVector;
+typedef vector< vector< OUString > > t2DStringVector;
+typedef vector< vector< double > > t2DNumberContainer;
+
struct lcl_TableData
{
- typedef ::std::vector< OUString > tStringContainer;
- typedef ::std::vector< ::std::vector< double > > tTwoDimNumberContainer;
+ t2DNumberContainer aDataInRows;
+ tStringVector aDataRangeRepresentations;
- tTwoDimNumberContainer aDataInRows;
- tStringContainer aDataRangeRepresentations;
- tStringContainer aFirstRowStrings;
- tStringContainer aFirstRowRangeRepresentations;
- tStringContainer aFirstColumnStrings;
- tStringContainer aFirstColumnRangeRepresentations;
+ tStringVector aColumnDescriptions;
+ tStringVector aColumnDescriptions_Ranges;
+
+ tStringVector aRowDescriptions;
+ tStringVector aRowDescriptions_Ranges;
+
+ Sequence< Sequence< OUString > > aComplexColumnDescriptions;//outer index is columns - inner index is level
+ Sequence< Sequence< OUString > > aComplexRowDescriptions;//outer index is rows - inner index is level
::std::vector< sal_Int32 > aHiddenColumns;
};
@@ -613,39 +579,29 @@ typedef ::std::map< sal_Int32, SchXMLExportHelper::tLabelValuesDataPair >
struct lcl_SequenceToMapElement :
public ::std::unary_function< lcl_DataSequenceMap::mapped_type, lcl_DataSequenceMap::value_type >
{
- lcl_SequenceToMapElement( sal_Int32 nOffset = 0 ) :
- m_nOffset( nOffset )
+ lcl_SequenceToMapElement()
{}
result_type operator() ( const argument_type & rContent )
{
sal_Int32 nIndex = -1;
- if( rContent.second.is())
+ if( rContent.second.is()) //has values
{
OUString aRangeRep( rContent.second->getSourceRangeRepresentation());
- if( aRangeRep.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("categories")))
- {
- OSL_ASSERT( m_nOffset > 0 );
- nIndex = 0;
- }
- else
- nIndex = aRangeRep.toInt32() + m_nOffset;
+ nIndex = aRangeRep.toInt32();
}
- else if( rContent.first.is())
- nIndex = rContent.first->getSourceRangeRepresentation().copy( sizeof("label ")).toInt32() + m_nOffset;
+ else if( rContent.first.is()) //has labels
+ nIndex = rContent.first->getSourceRangeRepresentation().copy( sizeof("label ")).toInt32();
return result_type( nIndex, rContent );
}
-private:
- sal_Int32 m_nOffset;
};
-void lcl_PrepareInternalSequencesForTableExport(
- SchXMLExportHelper::tDataSequenceCont & rInOutSequences, bool bHasCategories )
+void lcl_ReorderInternalSequencesAccordingToTheirRangeName(
+ SchXMLExportHelper::tDataSequenceCont & rInOutSequences )
{
lcl_DataSequenceMap aIndexSequenceMap;
- const sal_Int32 nOffset = bHasCategories ? 1 : 0;
::std::transform( rInOutSequences.begin(), rInOutSequences.end(),
::std::inserter( aIndexSequenceMap, aIndexSequenceMap.begin()),
- lcl_SequenceToMapElement( nOffset ));
+ lcl_SequenceToMapElement());
rInOutSequences.clear();
sal_Int32 nIndex = 0;
@@ -665,113 +621,113 @@ void lcl_PrepareInternalSequencesForTableExport(
lcl_TableData lcl_getDataForLocalTable(
- const SchXMLExportHelper::tDataSequenceCont & aPassedSequences, bool bHasCategoryLabels,
- bool bSwap,
- bool bHasOwnData,
+ const SchXMLExportHelper::tDataSequenceCont & aSequencesToExport,
+ const Reference< chart::XComplexDescriptionAccess >& xComplexDescriptionAccess,
+ const OUString& rCategoriesRange,
+ bool bSeriesFromColumns,
const Reference< chart2::data::XRangeXMLConversion > & xRangeConversion )
{
lcl_TableData aResult;
- SchXMLExportHelper::tDataSequenceCont aSequencesToExport( aPassedSequences );
- if( bHasOwnData )
- lcl_PrepareInternalSequencesForTableExport( aSequencesToExport, bHasCategoryLabels );
+ try
+ {
+ Sequence< OUString > aSimpleCategories;
+ if( xComplexDescriptionAccess.is() )
+ {
+ if( bSeriesFromColumns )
+ aSimpleCategories = xComplexDescriptionAccess->getRowDescriptions();
+ else
+ aSimpleCategories = xComplexDescriptionAccess->getColumnDescriptions();
- SchXMLExportHelper::tDataSequenceCont::size_type nNumSequences = aSequencesToExport.size();
- SchXMLExportHelper::tDataSequenceCont::const_iterator aBegin( aSequencesToExport.begin());
- SchXMLExportHelper::tDataSequenceCont::const_iterator aEnd( aSequencesToExport.end());
- SchXMLExportHelper::tDataSequenceCont::const_iterator aIt( aBegin );
+ aResult.aComplexColumnDescriptions = xComplexDescriptionAccess->getComplexColumnDescriptions();
+ aResult.aComplexRowDescriptions = xComplexDescriptionAccess->getComplexRowDescriptions();
+ }
- if( bHasCategoryLabels )
- {
- if( nNumSequences>=1 ) //#i83537#
- --nNumSequences;
- else
- bHasCategoryLabels=false;
- }
- size_t nMaxSequenceLength( lcl_getMaxSequenceLength( aSequencesToExport ));
- size_t nNumColumns( bSwap ? nMaxSequenceLength : nNumSequences );
- size_t nNumRows( bSwap ? nNumSequences : nMaxSequenceLength );
+ SchXMLExportHelper::tDataSequenceCont::size_type nNumSequences = aSequencesToExport.size();
+ SchXMLExportHelper::tDataSequenceCont::const_iterator aBegin( aSequencesToExport.begin());
+ SchXMLExportHelper::tDataSequenceCont::const_iterator aEnd( aSequencesToExport.end());
+ SchXMLExportHelper::tDataSequenceCont::const_iterator aIt( aBegin );
- // resize data
- aResult.aDataInRows.resize( nNumRows );
- double fNan = 0.0;
- ::rtl::math::setNan( &fNan );
- ::std::for_each( aResult.aDataInRows.begin(), aResult.aDataInRows.end(),
- lcl_resize< lcl_TableData::tTwoDimNumberContainer::value_type >( nNumColumns, fNan ));
- aResult.aFirstRowStrings.resize( nNumColumns );
- aResult.aFirstColumnStrings.resize( nNumRows );
+ size_t nMaxSequenceLength( lcl_getMaxSequenceLength( aSequencesToExport ));
+ nMaxSequenceLength = std::max( nMaxSequenceLength, size_t( aSimpleCategories.getLength() ) );
+ size_t nNumColumns( bSeriesFromColumns ? nNumSequences : nMaxSequenceLength );
+ size_t nNumRows( bSeriesFromColumns ? nMaxSequenceLength : nNumSequences );
- lcl_TableData::tStringContainer & rCategories =
- (bSwap ? aResult.aFirstRowStrings : aResult.aFirstColumnStrings );
- lcl_TableData::tStringContainer & rLabels =
- (bSwap ? aResult.aFirstColumnStrings : aResult.aFirstRowStrings );
+ // resize data
+ aResult.aDataInRows.resize( nNumRows );
+ double fNan = 0.0;
+ ::rtl::math::setNan( &fNan );
+ ::std::for_each( aResult.aDataInRows.begin(), aResult.aDataInRows.end(),
+ lcl_resize< t2DNumberContainer::value_type >( nNumColumns, fNan ));
+ aResult.aColumnDescriptions.resize( nNumColumns );
+ aResult.aComplexColumnDescriptions.realloc( nNumColumns );
+ aResult.aRowDescriptions.resize( nNumRows );
+ aResult.aComplexRowDescriptions.realloc( nNumRows );
- if( aIt != aEnd )
- {
- if( bHasCategoryLabels )
- {
- lcl_fillCategoriesIntoStringVector( aIt->second, rCategories );
- if( aIt->second.is())
- {
- OUString aRange( aIt->second->getSourceRangeRepresentation());
- if( xRangeConversion.is())
- aRange = xRangeConversion->convertRangeToXML( aRange );
- if( bSwap )
- aResult.aFirstRowRangeRepresentations.push_back( aRange );
- else
- aResult.aFirstColumnRangeRepresentations.push_back( aRange );
- }
- ++aIt;
- }
- else
- {
- // autogenerated categories
- rCategories.clear();
- lcl_SequenceToVectorAppend( aIt->second->generateLabel( chart2::data::LabelOrigin_LONG_SIDE ), rCategories );
- }
- }
+ tStringVector& rCategories = bSeriesFromColumns ? aResult.aRowDescriptions : aResult.aColumnDescriptions;
+ tStringVector& rLabels = bSeriesFromColumns ? aResult.aColumnDescriptions : aResult.aRowDescriptions;
- // iterate over all sequences
- size_t nSeqIdx = 0;
- for( ; aIt != aEnd; ++aIt, ++nSeqIdx )
- {
- OUString aRange;
- if( aIt->first.is())
+ //categories
+ lcl_SequenceToVector( aSimpleCategories, rCategories );
+ if( rCategoriesRange.getLength() )
{
- rLabels[nSeqIdx] = lcl_getLabelString( aIt->first );
- aRange = aIt->first->getSourceRangeRepresentation();
+ OUString aRange(rCategoriesRange);
if( xRangeConversion.is())
aRange = xRangeConversion->convertRangeToXML( aRange );
+ if( bSeriesFromColumns )
+ aResult.aRowDescriptions_Ranges.push_back( aRange );
+ else
+ aResult.aColumnDescriptions_Ranges.push_back( aRange );
}
- else if( aIt->second.is())
- rLabels[nSeqIdx] = lcl_flattenStringSequence(
- aIt->second->generateLabel( chart2::data::LabelOrigin_SHORT_SIDE ));
- if( bSwap )
- aResult.aFirstColumnRangeRepresentations.push_back( aRange );
- else
- aResult.aFirstRowRangeRepresentations.push_back( aRange );
- ::std::vector< double > aNumbers( lcl_getAllValuesFromSequence( aIt->second ));
- if( bSwap )
- aResult.aDataInRows[nSeqIdx] = aNumbers;
- else
+ // iterate over all sequences
+ size_t nSeqIdx = 0;
+ for( ; aIt != aEnd; ++aIt, ++nSeqIdx )
{
- const sal_Int32 nSize( static_cast< sal_Int32 >( aNumbers.size()));
- for( sal_Int32 nIdx=0; nIdx<nSize; ++nIdx )
- aResult.aDataInRows[nIdx][nSeqIdx] = aNumbers[nIdx];
- }
+ OUString aRange;
+ if( aIt->first.is())
+ {
+ rLabels[nSeqIdx] = lcl_getLabelString( aIt->first );
+ aRange = aIt->first->getSourceRangeRepresentation();
+ if( xRangeConversion.is())
+ aRange = xRangeConversion->convertRangeToXML( aRange );
+ }
+ else if( aIt->second.is())
+ rLabels[nSeqIdx] = lcl_flattenStringSequence(
+ aIt->second->generateLabel( chart2::data::LabelOrigin_SHORT_SIDE ));
+ if( bSeriesFromColumns )
+ aResult.aColumnDescriptions_Ranges.push_back( aRange );
+ else
+ aResult.aRowDescriptions_Ranges.push_back( aRange );
- if( aIt->second.is())
- {
- aRange = aIt->second->getSourceRangeRepresentation();
- if( xRangeConversion.is())
- aRange = xRangeConversion->convertRangeToXML( aRange );
- }
- aResult.aDataRangeRepresentations.push_back( aRange );
+ ::std::vector< double > aNumbers( lcl_getAllValuesFromSequence( aIt->second ));
+ if( bSeriesFromColumns )
+ {
+ const sal_Int32 nSize( static_cast< sal_Int32 >( aNumbers.size()));
+ for( sal_Int32 nIdx=0; nIdx<nSize; ++nIdx )
+ aResult.aDataInRows[nIdx][nSeqIdx] = aNumbers[nIdx];
+ }
+ else
+ aResult.aDataInRows[nSeqIdx] = aNumbers;
+
+ if( aIt->second.is())
+ {
+ aRange = aIt->second->getSourceRangeRepresentation();
+ if( xRangeConversion.is())
+ aRange = xRangeConversion->convertRangeToXML( aRange );
+ }
+ aResult.aDataRangeRepresentations.push_back( aRange );
- //is column hidden?
- if( !lcl_SequenceHasUnhiddenData(aIt->first) && !lcl_SequenceHasUnhiddenData(aIt->second) )
- aResult.aHiddenColumns.push_back(nSeqIdx);
+ //is column hidden?
+ if( !lcl_SequenceHasUnhiddenData(aIt->first) && !lcl_SequenceHasUnhiddenData(aIt->second) )
+ aResult.aHiddenColumns.push_back(nSeqIdx);
+ }
+ }
+ catch( uno::Exception & rEx )
+ {
+ (void)rEx; // avoid warning for pro build
+ OSL_TRACE( OUStringToOString( OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "something went wrong during table data collection: " )) + rEx.Message, RTL_TEXTENCODING_ASCII_US ).getStr());
}
return aResult;
@@ -1452,6 +1408,19 @@ void SchXMLExportHelper::parseDocument( Reference< chart::XChartDocument >& rCha
delete pElChart;
}
+void lcl_exportComplexLabel( const Sequence< OUString >& rComplexLabel, SvXMLExport& rExport )
+{
+ sal_Int32 nLength = rComplexLabel.getLength();
+ if( nLength<=1 )
+ return;
+ SvXMLElementExport aTextList( rExport, XML_NAMESPACE_TEXT, XML_LIST, sal_True, sal_True );
+ for(sal_Int32 nN=0; nN<nLength; nN++)
+ {
+ SvXMLElementExport aListItem( rExport, XML_NAMESPACE_TEXT, XML_LIST_ITEM, sal_True, sal_True );
+ SchXMLTools::exportText( rExport, rComplexLabel[nN], false /*bConvertTabsLFs*/ );
+ }
+}
+
void SchXMLExportHelper::exportTable()
{
// table element
@@ -1468,13 +1437,24 @@ void SchXMLExportHelper::exportTable()
xRangeConversion.set( xNewDoc->getDataProvider(), uno::UNO_QUERY );
}
- lcl_TableData aData( lcl_getDataForLocalTable(
- m_aDataSequencesToExport, mbHasCategoryLabels, !mbRowSourceColumns, bHasOwnData, xRangeConversion ));
+ Reference< chart::XComplexDescriptionAccess > xComplexDescriptionAccess;
+ {
+ Reference< chart::XChartDocument > xChartDoc( mrExport.GetModel(), uno::UNO_QUERY );
+ if( xChartDoc.is() )
+ xComplexDescriptionAccess = Reference< chart::XComplexDescriptionAccess >( xChartDoc->getData(), uno::UNO_QUERY );
+ }
+
+ if( bHasOwnData )
+ lcl_ReorderInternalSequencesAccordingToTheirRangeName( m_aDataSequencesToExport );
+ lcl_TableData aData( lcl_getDataForLocalTable( m_aDataSequencesToExport
+ , xComplexDescriptionAccess, maCategoriesRange
+ , mbRowSourceColumns, xRangeConversion ));
+
+ tStringVector::const_iterator aDataRangeIter( aData.aDataRangeRepresentations.begin());
+ const tStringVector::const_iterator aDataRangeEndIter( aData.aDataRangeRepresentations.end());
- lcl_TableData::tStringContainer::const_iterator aDataRangeIter( aData.aDataRangeRepresentations.begin());
- const lcl_TableData::tStringContainer::const_iterator aDataRangeEndIter( aData.aDataRangeRepresentations.end());
- lcl_TableData::tStringContainer::const_iterator aFirstColumnRangeIter( aData.aFirstColumnRangeRepresentations.begin());
- const lcl_TableData::tStringContainer::const_iterator aFirstColumnRangeEndIter( aData.aFirstColumnRangeRepresentations.end());
+ tStringVector::const_iterator aRowDescriptions_RangeIter( aData.aRowDescriptions_Ranges.begin());
+ const tStringVector::const_iterator aRowDescriptions_RangeEnd( aData.aRowDescriptions_Ranges.end());
// declare columns
{
@@ -1502,7 +1482,7 @@ void SchXMLExportHelper::exportTable()
nNextIndex = nHiddenIndex+1;
}
- sal_Int32 nEndIndex = aData.aFirstRowStrings.size()-1;
+ sal_Int32 nEndIndex = aData.aColumnDescriptions.size()-1;
if( nEndIndex >= nNextIndex )
{
sal_Int64 nRepeat = static_cast< sal_Int64 >( nEndIndex - nNextIndex + 1 );
@@ -1514,59 +1494,78 @@ void SchXMLExportHelper::exportTable()
}
// export rows with content
+ //export header row
{
SvXMLElementExport aHeaderRows( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_HEADER_ROWS, sal_True, sal_True );
SvXMLElementExport aRow( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_ROW, sal_True, sal_True );
+
+ //first one empty cell for the row descriptions
{
SvXMLElementExport aEmptyCell( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_CELL, sal_True, sal_True );
SvXMLElementExport aEmptyParagraph( mrExport, XML_NAMESPACE_TEXT, XML_P, sal_True, sal_True );
}
- lcl_TableData::tStringContainer::const_iterator aFirstRowRangeIter( aData.aFirstRowRangeRepresentations.begin());
- const lcl_TableData::tStringContainer::const_iterator aFirstRowRangeEndIter( aData.aFirstRowRangeRepresentations.end());
- for( lcl_TableData::tStringContainer::const_iterator aIt( aData.aFirstRowStrings.begin());
- aIt != aData.aFirstRowStrings.end(); ++aIt )
+ //export column descriptions
+ tStringVector::const_iterator aColumnDescriptions_RangeIter( aData.aColumnDescriptions_Ranges.begin());
+ const tStringVector::const_iterator aColumnDescriptions_RangeEnd( aData.aColumnDescriptions_Ranges.end());
+ const Sequence< Sequence< OUString > >& rComplexColumnDescriptions = aData.aComplexColumnDescriptions;
+ sal_Int32 nComplexCount = rComplexColumnDescriptions.getLength();
+ sal_Int32 nC = 0;
+ for( tStringVector::const_iterator aIt( aData.aColumnDescriptions.begin());
+ aIt != aData.aColumnDescriptions.end(); ++aIt )
{
mrExport.AddAttribute( XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_STRING );
SvXMLElementExport aCell( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_CELL, sal_True, sal_True );
// write the original range name as id into the local table
// to allow a correct re-association when copying via clipboard
- if( !bHasOwnData && aFirstRowRangeIter != aFirstRowRangeEndIter )
+ if( !bHasOwnData && aColumnDescriptions_RangeIter != aColumnDescriptions_RangeEnd )
{
- if( (*aFirstRowRangeIter).getLength())
- mrExport.AddAttribute( XML_NAMESPACE_TEXT, XML_ID, *aFirstRowRangeIter );
- ++aFirstRowRangeIter;
+ if( (*aColumnDescriptions_RangeIter).getLength())
+ mrExport.AddAttribute( XML_NAMESPACE_TEXT, XML_ID, *aColumnDescriptions_RangeIter );
+ ++aColumnDescriptions_RangeIter;
}
exportText( *aIt );
+ if( nC < nComplexCount )
+ lcl_exportComplexLabel( rComplexColumnDescriptions[nC++], mrExport );
}
- OSL_ASSERT( bHasOwnData || aFirstRowRangeIter == aFirstRowRangeEndIter );
+ OSL_ASSERT( bHasOwnData || aColumnDescriptions_RangeIter == aColumnDescriptions_RangeEnd );
} // closing row and header-rows elements
- // value rows
+ // export value rows
{
SvXMLElementExport aRows( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_ROWS, sal_True, sal_True );
- lcl_TableData::tStringContainer::const_iterator aFirstColIt( aData.aFirstColumnStrings.begin());
- for( lcl_TableData::tTwoDimNumberContainer::const_iterator aColIt( aData.aDataInRows.begin());
- aColIt != aData.aDataInRows.end(); ++aColIt )
+ tStringVector::const_iterator aRowDescriptionsIter( aData.aRowDescriptions.begin());
+ const Sequence< Sequence< OUString > >& rComplexRowDescriptions = aData.aComplexRowDescriptions;
+ sal_Int32 nComplexCount = rComplexRowDescriptions.getLength();
+ sal_Int32 nC = 0;
+
+ for( t2DNumberContainer::const_iterator aRowIt( aData.aDataInRows.begin());
+ aRowIt != aData.aDataInRows.end(); ++aRowIt )
{
SvXMLElementExport aRow( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_ROW, sal_True, sal_True );
+
+ //export row descriptions
{
mrExport.AddAttribute( XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_STRING );
SvXMLElementExport aCell( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_CELL, sal_True, sal_True );
- if( aFirstColIt != aData.aFirstColumnStrings.end())
+ if( aRowDescriptionsIter != aData.aRowDescriptions.end())
{
// write the original range name as id into the local table
// to allow a correct re-association when copying via clipboard
- if( !bHasOwnData && aFirstColumnRangeIter != aFirstColumnRangeEndIter )
- mrExport.AddAttribute( XML_NAMESPACE_TEXT, XML_ID, *aFirstColumnRangeIter++ );
- exportText( *aFirstColIt );
- ++aFirstColIt;
+ if( !bHasOwnData && aRowDescriptions_RangeIter != aRowDescriptions_RangeEnd )
+ mrExport.AddAttribute( XML_NAMESPACE_TEXT, XML_ID, *aRowDescriptions_RangeIter++ );
+ exportText( *aRowDescriptionsIter );
+ ++aRowDescriptionsIter;
+ if( nC < nComplexCount )
+ lcl_exportComplexLabel( rComplexRowDescriptions[nC++], mrExport );
}
}
- for( lcl_TableData::tTwoDimNumberContainer::value_type::const_iterator aInnerIt( aColIt->begin());
- aInnerIt != aColIt->end(); ++aInnerIt )
+
+ //export row values
+ for( t2DNumberContainer::value_type::const_iterator aColIt( aRowIt->begin());
+ aColIt != aRowIt->end(); ++aColIt )
{
- SvXMLUnitConverter::convertDouble( msStringBuffer, *aInnerIt );
+ SvXMLUnitConverter::convertDouble( msStringBuffer, *aColIt );
msString = msStringBuffer.makeStringAndClear();
mrExport.AddAttribute( XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_FLOAT );
mrExport.AddAttribute( XML_NAMESPACE_OFFICE, XML_VALUE, msString );
@@ -1574,7 +1573,7 @@ void SchXMLExportHelper::exportTable()
// write the original range name as id into the local table to
// allow a correct re-association when copying via clipboard
if( ( !bHasOwnData && aDataRangeIter != aDataRangeEndIter ) &&
- ( mbRowSourceColumns || (aInnerIt == aColIt->begin())) )
+ ( mbRowSourceColumns || (aColIt == aRowIt->begin())) )
{
if( (*aDataRangeIter).getLength())
mrExport.AddAttribute( XML_NAMESPACE_TEXT, XML_ID, *aDataRangeIter );
@@ -1587,7 +1586,7 @@ void SchXMLExportHelper::exportTable()
// if range iterator was used it should have reached its end
OSL_ASSERT( bHasOwnData || (aDataRangeIter == aDataRangeEndIter) );
- OSL_ASSERT( bHasOwnData || (aFirstColumnRangeIter == aFirstColumnRangeEndIter) );
+ OSL_ASSERT( bHasOwnData || (aRowDescriptions_RangeIter == aRowDescriptions_RangeEnd) );
}
void SchXMLExportHelper::exportPlotArea(
@@ -2112,8 +2111,8 @@ void SchXMLExportHelper::exportAxes(
if( xValues.is())
{
Reference< chart2::XChartDocument > xNewDoc( mrExport.GetModel(), uno::UNO_QUERY );
- aCategoriesRange = lcl_ConvertRange( xValues->getSourceRangeRepresentation(), xNewDoc );
- m_aDataSequencesToExport.push_back( tLabelValuesDataPair( 0, xValues ));
+ maCategoriesRange = xValues->getSourceRangeRepresentation();
+ aCategoriesRange = lcl_ConvertRange( maCategoriesRange, xNewDoc );
}
}
}
@@ -3422,24 +3421,6 @@ awt::Size SchXMLExportHelper::getPageSize( const Reference< chart2::XChartDocume
return aSize;
}
-void SchXMLExportHelper::swapDataArray( Sequence< Sequence< double > >& rSequence )
-{
- sal_Int32 nOuterSize = rSequence.getLength();
- sal_Int32 nInnerSize = rSequence[0].getLength(); // assume that all subsequences have same length
- sal_Int32 i, o;
-
- Sequence< Sequence< double > > aResult( nInnerSize );
- Sequence< double >* pArray = aResult.getArray();
- for( i = 0; i < nInnerSize; i++ )
- {
- pArray[ i ].realloc( nOuterSize );
- for( o = 0 ; o < nOuterSize ; o++ )
- aResult[ i ][ o ] = rSequence[ o ][ i ];
- }
-
- rSequence = aResult;
-}
-
void SchXMLExportHelper::CollectAutoStyle( const std::vector< XMLPropertyState >& aStates )
{
if( !aStates.empty() )
diff --git a/xmloff/source/chart/SchXMLImport.cxx b/xmloff/source/chart/SchXMLImport.cxx
index 888191c994..b8e06e3da8 100644
--- a/xmloff/source/chart/SchXMLImport.cxx
+++ b/xmloff/source/chart/SchXMLImport.cxx
@@ -47,7 +47,6 @@
#include <xmloff/xmlstyle.hxx>
#include <com/sun/star/task/XStatusIndicatorSupplier.hpp>
#include <com/sun/star/chart/XChartDocument.hpp>
-#include <com/sun/star/chart/XChartDataArray.hpp>
#include <com/sun/star/chart/ChartDataRowSource.hpp>
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
@@ -507,113 +506,6 @@ const SvXMLTokenMap& SchXMLImportHelper::GetRegEquationAttrTokenMap()
// ----------------------------------------
-sal_Int32 SchXMLImportHelper::GetNumberOfSeries()
-{
- if( mxChartDoc.is())
- {
- Reference< chart::XChartDataArray > xData( mxChartDoc->getData(), uno::UNO_QUERY );
- if( xData.is())
- {
- Sequence< Sequence< double > > xArray = xData->getData();
-
- if( xArray.getLength())
- return xArray[ 0 ].getLength();
- }
- }
-
- return 0;
-}
-
-sal_Int32 SchXMLImportHelper::GetLengthOfSeries()
-{
- if( mxChartDoc.is())
- {
- Reference< chart::XChartDataArray > xData( mxChartDoc->getData(), uno::UNO_QUERY );
- if( xData.is())
- {
- Sequence< Sequence< double > > xArray = xData->getData();
-
- return xArray.getLength();
- }
- }
-
- return 0;
-}
-
-// -1 means don't change
-void SchXMLImportHelper::ResizeChartData( sal_Int32 nSeries, sal_Int32 nDataPoints )
-{
- if( mxChartDoc.is())
- {
- sal_Bool bWasChanged = sal_False;
-
- sal_Bool bDataInColumns = sal_True;
- Reference< beans::XPropertySet > xDiaProp( mxChartDoc->getDiagram(), uno::UNO_QUERY );
- if( xDiaProp.is())
- {
- chart::ChartDataRowSource eRowSource;
- xDiaProp->getPropertyValue( OUString::createFromAscii( "DataRowSource" )) >>= eRowSource;
- bDataInColumns = ( eRowSource == chart::ChartDataRowSource_COLUMNS );
-
- // the chart core treats donut chart with interchanged rows/columns
- Reference< chart::XDiagram > xDiagram( xDiaProp, uno::UNO_QUERY );
- if( xDiagram.is())
- {
- OUString sChartType = xDiagram->getDiagramType();
- if( 0 == sChartType.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart.DonutDiagram" )))
- {
- bDataInColumns = ! bDataInColumns;
- }
- }
- }
- sal_Int32 nColCount = bDataInColumns ? nSeries : nDataPoints;
- sal_Int32 nRowCount = bDataInColumns ? nDataPoints : nSeries;
-
- Reference< chart::XChartDataArray > xData( mxChartDoc->getData(), uno::UNO_QUERY );
- if( xData.is())
- {
- Sequence< Sequence< double > > xArray = xData->getData();
-
- // increase number of rows
- if( xArray.getLength() < nRowCount )
- {
- sal_Int32 nOldLen = xArray.getLength();
- xArray.realloc( nRowCount );
- if( nColCount == -1 )
- {
- sal_Int32 nSize = xArray[ 0 ].getLength();
- for( sal_Int32 i = nOldLen; i < nRowCount; i++ )
- xArray[ i ].realloc( nSize );
- }
- bWasChanged = sal_True;
- }
-
- if( nSeries == -1 &&
- nRowCount > 0 )
- nColCount = xArray[ 0 ].getLength();
-
- // columns
- if( nColCount > 0 &&
- xArray[ 0 ].getLength() < nColCount )
- {
- if( nDataPoints == -1 )
- nRowCount = xArray.getLength();
-
- for( sal_Int32 i = 0; i < nRowCount; i++ )
- xArray[ i ].realloc( nColCount );
- bWasChanged = sal_True;
- }
-
- if( bWasChanged )
- {
- xData->setData( xArray );
- mxChartDoc->attachData(
- Reference< chart::XChartData >( xData, uno::UNO_QUERY ));
- }
- }
- }
-}
-
//static
void SchXMLImportHelper::DeleteDataSeries(
const Reference< chart2::XDataSeries > & xSeries,
diff --git a/xmloff/source/chart/SchXMLTableContext.cxx b/xmloff/source/chart/SchXMLTableContext.cxx
index 5649848e05..6b4bb5097d 100644
--- a/xmloff/source/chart/SchXMLTableContext.cxx
+++ b/xmloff/source/chart/SchXMLTableContext.cxx
@@ -30,6 +30,7 @@
#include "SchXMLTableContext.hxx"
#include "SchXMLParagraphContext.hxx"
+#include "SchXMLTextListContext.hxx"
#include "SchXMLImport.hxx"
#include "SchXMLTools.hxx"
#include "transporttypes.hxx"
@@ -44,7 +45,7 @@
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/XChartTypeContainer.hpp>
#include <com/sun/star/chart2/XInternalDataProvider.hpp>
-#include <com/sun/star/chart/XChartDataArray.hpp>
+#include <com/sun/star/chart/XComplexDescriptionAccess.hpp>
#include <com/sun/star/chart/ChartSeriesAddress.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/XPropertySetInfo.hpp>
@@ -138,26 +139,10 @@ std::vector< Reference< chart2::XAxis > > lcl_getAxesHoldingCategoriesFromDiagra
return aRet;
}
-void lcl_ApplyColumnLabels(
- const ::std::vector< SchXMLCell > & rFirstRow,
- Sequence< OUString > & rOutColumnLabels,
- sal_Int32 nOffset )
-{
- const sal_Int32 nColumnLabelsSize = rOutColumnLabels.getLength();
- const sal_Int32 nMax = ::std::min< sal_Int32 >( nColumnLabelsSize,
- static_cast< sal_Int32 >( rFirstRow.size()) - nOffset );
- OSL_ASSERT( nMax == nColumnLabelsSize );
- for( sal_Int32 i=0; i<nMax; ++i )
- if( rFirstRow[i+nOffset].eType == SCH_CELL_TYPE_STRING )
- rOutColumnLabels[i] = rFirstRow[i+nOffset].aString;
-}
-
struct lcl_ApplyCellToData : public ::std::unary_function< SchXMLCell, void >
{
- lcl_ApplyCellToData( Sequence< double > & rOutData,
- Sequence< OUString > & rOutRowLabels ) :
+ lcl_ApplyCellToData( Sequence< double > & rOutData ) :
m_rData( rOutData ),
- m_rRowLabels( rOutRowLabels ),
m_nIndex( 0 ),
m_nSize( rOutData.getLength())
{
@@ -178,49 +163,11 @@ struct lcl_ApplyCellToData : public ::std::unary_function< SchXMLCell, void >
private:
Sequence< double > & m_rData;
- Sequence< OUString > & m_rRowLabels;
sal_Int32 m_nIndex;
sal_Int32 m_nSize;
double m_fNaN;
};
-struct lcl_ApplyRowsToData : public ::std::unary_function< ::std::vector< SchXMLCell >, void >
-{
- lcl_ApplyRowsToData( Sequence< Sequence< double > > & rOutData,
- Sequence< OUString > & rOutRowLabels,
- sal_Int32 nOffset,
- bool bHasHeader ) :
- m_rData( rOutData ),
- m_rRowLabels( rOutRowLabels ),
- m_nIndex( 0 ),
- m_nOuterSize( rOutData.getLength()),
- m_nOffset( nOffset ),
- m_bHasHeader( bHasHeader )
- {}
- void operator() ( const ::std::vector< SchXMLCell > & rRow )
- {
- if( ! rRow.empty())
- {
- // label
- if( m_bHasHeader && m_nIndex < m_rRowLabels.getLength() && rRow.front().eType == SCH_CELL_TYPE_STRING )
- m_rRowLabels[m_nIndex] = rRow.front().aString;
-
- // values
- if( m_nIndex < m_nOuterSize )
- ::std::for_each( rRow.begin() + m_nOffset, rRow.end(), lcl_ApplyCellToData( m_rData[m_nIndex], m_rRowLabels ));
- }
- ++m_nIndex;
- }
-
-private:
- Sequence< Sequence< double > > & m_rData;
- Sequence< OUString > & m_rRowLabels;
- sal_Int32 m_nIndex;
- sal_Int32 m_nOuterSize;
- sal_Int32 m_nOffset;
- bool m_bHasHeader;
-};
-
Sequence< Sequence< double > > lcl_getSwappedArray( const Sequence< Sequence< double > > & rData )
{
sal_Int32 nOldOuterSize = rData.getLength();
@@ -237,47 +184,6 @@ Sequence< Sequence< double > > lcl_getSwappedArray( const Sequence< Sequence< do
return aResult;
}
-void lcl_applyXMLTableToInternalDataprovider(
- const SchXMLTable & rTable,
- const Reference< chart::XChartDataArray > & xDataArray )
-{
- sal_Int32 nNumRows( static_cast< sal_Int32 >( rTable.aData.size()));
- sal_Int32 nRowOffset = 0;
- if( rTable.bHasHeaderRow )
- {
- --nNumRows;
- nRowOffset = 1;
- }
- sal_Int32 nNumColumns( rTable.nMaxColumnIndex + 1 );
- sal_Int32 nColOffset = 0;
- if( rTable.bHasHeaderColumn )
- {
- --nNumColumns;
- nColOffset = 1;
- }
-
- Sequence< Sequence< double > > aData( nNumRows );
- Sequence< OUString > aRowLabels( nNumRows );
- Sequence< OUString > aColumnLabels( nNumColumns );
- for( sal_Int32 i=0; i<nNumRows; ++i )
- aData[i].realloc( nNumColumns );
-
- if( rTable.aData.begin() != rTable.aData.end())
- {
- if( rTable.bHasHeaderRow )
- lcl_ApplyColumnLabels( rTable.aData.front(), aColumnLabels, nColOffset );
- ::std::for_each( rTable.aData.begin() + nRowOffset, rTable.aData.end(),
- lcl_ApplyRowsToData( aData, aRowLabels, nColOffset, rTable.bHasHeaderColumn ));
- }
-
- xDataArray->setData( aData );
-
- if( rTable.bHasHeaderColumn )
- xDataArray->setRowDescriptions( aRowLabels );
- if( rTable.bHasHeaderRow )
- xDataArray->setColumnDescriptions( aColumnLabels );
-}
-
void lcl_fillRangeMapping(
const SchXMLTable & rTable,
lcl_tOriginalRangeToInternalRangeMap & rOutRangeMap,
@@ -830,7 +736,7 @@ void SchXMLTableCellContext::StartElement( const uno::Reference< xml::sax::XAttr
}
}
- mbReadPara = sal_True;
+ mbReadText = sal_True;
SchXMLCell aCell;
aCell.eType = eValueType;
@@ -841,8 +747,8 @@ void SchXMLTableCellContext::StartElement( const uno::Reference< xml::sax::XAttr
SvXMLUnitConverter::convertDouble( fData, aCellContent );
aCell.fValue = fData;
- // dont read following <text:p> element
- mbReadPara = sal_False;
+ // dont read text from following <text:p> or <text:list> element
+ mbReadText = sal_False;
}
mrTable.aData[ mrTable.nRowIndex ].push_back( aCell );
@@ -858,9 +764,17 @@ SvXMLImportContext* SchXMLTableCellContext::CreateChildContext(
{
SvXMLImportContext* pContext = 0;
- // <text:p> element
- if( nPrefix == XML_NAMESPACE_TEXT &&
- IsXMLToken( rLocalName, XML_P ) )
+ // <text:list> element
+ if( nPrefix == XML_NAMESPACE_TEXT && IsXMLToken( rLocalName, XML_LIST ) && mbReadText )
+ {
+ SchXMLCell& rCell = mrTable.aData[ mrTable.nRowIndex ][ mrTable.nColumnIndex ];
+ rCell.pComplexString = new Sequence< OUString >();
+ rCell.eType = SCH_CELL_TYPE_COMPLEX_STRING;
+ pContext = new SchXMLTextListContext( GetImport(), rLocalName, *rCell.pComplexString );
+ mbReadText = sal_False;//don't apply text from <text:p>
+ }
+ // <text:p> element - read text and range-id
+ else if( nPrefix == XML_NAMESPACE_TEXT && IsXMLToken( rLocalName, XML_P ) )
{
pContext = new SchXMLParagraphContext( GetImport(), rLocalName, maCellContent, &maRangeId );
}
@@ -874,7 +788,7 @@ SvXMLImportContext* SchXMLTableCellContext::CreateChildContext(
void SchXMLTableCellContext::EndElement()
{
- if( mbReadPara && maCellContent.getLength())
+ if( mbReadText && maCellContent.getLength() ) //apply text from <text:p> element
mrTable.aData[ mrTable.nRowIndex ][ mrTable.nColumnIndex ].aString = maCellContent;
if( maRangeId.getLength())
mrTable.aData[ mrTable.nRowIndex ][ mrTable.nColumnIndex ].aRangeId = maRangeId;
@@ -882,133 +796,90 @@ void SchXMLTableCellContext::EndElement()
// ========================================
-// just interpret the table in a linear way with no references used
-// (this is just a workaround for clipboard handling in EA2)
-void SchXMLTableHelper::applyTableSimple(
- const SchXMLTable& rTable,
- const uno::Reference< chart::XChartDataArray > & xData )
+void lcl_ApplyCellToComplexLabel( const SchXMLCell& rCell, Sequence< OUString >& rComplexLabel )
{
- // interpret table like this:
- //
- // series ----+---+
- // | |
- // categories | |
- // | | |
- // V V V
- // A B C ...
- // 1 x x <--- labels
- // 2 x 0 0
- // 3 x 0 0
- // ...
-
- // Standard Role-interpretation:
-
- // Column 1 contains the Categories
-
- // Chart Type/Class | Col 2 Col 3 Col 4 Col 5 Col 6 | Series | Domain
- // -----------------+-----------------------------------+--------+-------
- // Category Charts | Y 1 Y 2 Y 3 Y 4 ... | Y | -
- // XY Chart | X all Y 1 Y 2 Y 3 ... | Y | X
- // Stock Chart 1 | Min Max Close - - | Close | -
- // Stock Chart 2 | Open Min Max Close - | Close | -
- // Stock Chart 3 | Volume Min Max Close - | Close | -
- // Stock Chart 4 | Volume Open Min Max Close | Close | -
-
- if( xData.is())
+ if( rCell.eType == SCH_CELL_TYPE_STRING )
{
- // get NaN
- double fSolarNaN;
- ::rtl::math::setNan( &fSolarNaN );
- double fNaN = fSolarNaN;
- sal_Bool bConvertNaN = sal_False;
-
- uno::Reference< chart::XChartData > xChartData( xData, uno::UNO_QUERY );
- if( xChartData.is())
- {
- fNaN = xChartData->getNotANumber();
- bConvertNaN = ( ! ::rtl::math::isNan( fNaN ));
- }
-
- sal_Int32 nRowCount = rTable.aData.size();
- sal_Int32 nColumnCount = 0;
- sal_Int32 nCol = 0, nRow = 0;
- if( nRowCount )
- {
- nColumnCount = rTable.aData[ 0 ].size();
- ::std::vector< ::std::vector< SchXMLCell > >::const_iterator iRow = rTable.aData.begin();
- while( iRow != rTable.aData.end() )
- {
- nColumnCount = ::std::max( nColumnCount, static_cast<sal_Int32>(iRow->size()) );
- iRow++;
- }
- }
-
- // #i27909# avoid illegal index access for empty tables
- if( nColumnCount == 0 || nRowCount == 0 )
- return;
+ rComplexLabel.realloc(1);
+ rComplexLabel[0] = rCell.aString;
+ }
+ else if( rCell.pComplexString && rCell.eType == SCH_CELL_TYPE_COMPLEX_STRING )
+ rComplexLabel = *rCell.pComplexString;
+}
- uno::Sequence< ::rtl::OUString > aCategories( nRowCount - 1 );
- uno::Sequence< ::rtl::OUString > aLabels( nColumnCount - 1 );
- uno::Sequence< uno::Sequence< double > > aData( nRowCount - 1 );
- for( nRow = 0; nRow < nRowCount - 1; nRow++ )
- aData[ nRow ].realloc( nColumnCount - 1 );
+void SchXMLTableHelper::applyTableToInternalDataProvider(
+ const SchXMLTable& rTable,
+ uno::Reference< chart2::XChartDocument > xChartDoc )
+{
+ // apply all data read from the local table to the internal data provider
+ if( !xChartDoc.is() || !xChartDoc->hasInternalDataProvider() )
+ return;
+ Reference< chart2::data::XDataProvider > xDataProv( xChartDoc->getDataProvider() );
+ if( !xDataProv.is() )
+ return;
+
+ //prepare the read local table data
+ sal_Int32 nNumRows( static_cast< sal_Int32 >( rTable.aData.size()));
+ sal_Int32 nRowOffset = 0;
+ if( rTable.bHasHeaderRow )
+ {
+ --nNumRows;
+ nRowOffset = 1;
+ }
+ sal_Int32 nNumColumns( rTable.nMaxColumnIndex + 1 );
+ sal_Int32 nColOffset = 0;
+ if( rTable.bHasHeaderColumn )
+ {
+ --nNumColumns;
+ nColOffset = 1;
+ }
+
+ Sequence< Sequence< double > > aDataInRows( nNumRows );
+ Sequence< Sequence< OUString > > aComplexRowDescriptions( nNumRows );
+ Sequence< Sequence< OUString > > aComplexColumnDescriptions( nNumColumns );
+ for( sal_Int32 i=0; i<nNumRows; ++i )
+ aDataInRows[i].realloc( nNumColumns );
- // set labels
- ::std::vector< ::std::vector< SchXMLCell > >::const_iterator iRow = rTable.aData.begin();
- sal_Int32 nColumnCountOnFirstRow = iRow->size();
- for( nCol = 1; nCol < nColumnCountOnFirstRow; nCol++ )
+ if( rTable.aData.begin() != rTable.aData.end())
+ {
+ //apply column labels
+ if( rTable.bHasHeaderRow )
{
- aLabels[ nCol - 1 ] = (*iRow)[ nCol ].aString;
+ const ::std::vector< SchXMLCell >& rFirstRow = rTable.aData.front();
+ const sal_Int32 nColumnLabelsSize = aComplexColumnDescriptions.getLength();
+ const sal_Int32 nMax = ::std::min< sal_Int32 >( nColumnLabelsSize, static_cast< sal_Int32 >( rFirstRow.size()) - nColOffset );
+ OSL_ASSERT( nMax == nColumnLabelsSize );
+ for( sal_Int32 i=0; i<nMax; ++i )
+ lcl_ApplyCellToComplexLabel( rFirstRow[i+nColOffset], aComplexColumnDescriptions[i] );
}
- xData->setColumnDescriptions( aLabels );
- double fVal;
- const sal_Bool bConstConvertNan = bConvertNaN;
- for( ++iRow, nRow = 0; iRow != rTable.aData.end(); iRow++, nRow++ )
+ std::vector< ::std::vector< SchXMLCell > >::const_iterator aRowIter( rTable.aData.begin() + nRowOffset );
+ std::vector< ::std::vector< SchXMLCell > >::const_iterator aEnd( rTable.aData.end() );
+ for( sal_Int32 nRow = 0; aRowIter != aEnd && nRow < nNumRows; ++aRowIter, ++nRow )
{
- aCategories[ nRow ] = (*iRow)[ 0 ].aString;
- sal_Int32 nTableColCount( static_cast< sal_Int32 >((*iRow).size()));
- for( nCol = 1; nCol < nTableColCount; nCol++ )
+ const ::std::vector< SchXMLCell >& rRow = *aRowIter;
+ if( !rRow.empty() )
{
- fVal = (*iRow)[ nCol ].fValue;
- if( bConstConvertNan &&
- ::rtl::math::isNan( fVal ))
- aData[ nRow ][ nCol - 1 ] = fNaN;
- else
- aData[ nRow ][ nCol - 1 ] = fVal;
+ // row label
+ if( rTable.bHasHeaderColumn )
+ lcl_ApplyCellToComplexLabel( rRow.front(), aComplexRowDescriptions[nRow] );
+
+ // values
+ ::std::for_each( rRow.begin() + nColOffset, rRow.end(), lcl_ApplyCellToData( aDataInRows[nRow] ));
}
- // set remaining cells to NaN
- for( ; nCol < nColumnCount; ++nCol )
- if( bConstConvertNan )
- aData[ nRow ][nCol - 1 ] = fNaN;
- else
- ::rtl::math::setNan( &(aData[ nRow ][nCol - 1 ]));
}
- xData->setRowDescriptions( aCategories );
- xData->setData( aData );
}
-}
-// ----------------------------------------
-
-void SchXMLTableHelper::applyTableToInternalDataProvider(
- const SchXMLTable& rTable,
- uno::Reference< chart2::XChartDocument > xChartDoc )
-{
- if( ! (xChartDoc.is() && xChartDoc->hasInternalDataProvider()))
- return;
- Reference< chart2::data::XDataProvider > xDataProv( xChartDoc->getDataProvider());
- Reference< chart::XChartDataArray > xDataArray( xDataProv, uno::UNO_QUERY );
- if( ! xDataArray.is())
+ //apply the collected data to the chart
+ Reference< chart::XComplexDescriptionAccess > xDataAccess( xDataProv, uno::UNO_QUERY );
+ if( !xDataAccess.is() )
return;
- OSL_ASSERT( xDataProv.is());
- // prerequisite for this method: all objects (data series, domains, etc.)
- // need their own range string.
-
- // apply all data read in the table to the chart data-array of the internal
- // data provider
- lcl_applyXMLTableToInternalDataprovider( rTable, xDataArray );
+ xDataAccess->setData( aDataInRows );
+ if( rTable.bHasHeaderColumn )
+ xDataAccess->setComplexRowDescriptions( aComplexRowDescriptions );
+ if( rTable.bHasHeaderRow )
+ xDataAccess->setComplexColumnDescriptions( aComplexColumnDescriptions );
}
void SchXMLTableHelper::switchRangesFromOuterToInternalIfNecessary(
diff --git a/xmloff/source/chart/SchXMLTableContext.hxx b/xmloff/source/chart/SchXMLTableContext.hxx
index f8485ed571..c6ecd060c5 100644
--- a/xmloff/source/chart/SchXMLTableContext.hxx
+++ b/xmloff/source/chart/SchXMLTableContext.hxx
@@ -45,7 +45,6 @@ namespace com { namespace sun { namespace star {
}}
namespace chart {
class XChartDocument;
- class XChartDataArray;
struct ChartSeriesAddress;
}}}}
@@ -96,21 +95,11 @@ private:
sal_Int32& nRows, sal_Int32& nColumns );
public:
- /// The data for the ChartDocument is applied linearly
- static void applyTableSimple(
- const SchXMLTable& rTable,
- const com::sun::star::uno::Reference< com::sun::star::chart::XChartDataArray > & xData );
-
- /** The data for the ChartDocument is applied by reading the
- table, the addresses of series, the addresses of labels,
- the cell-range-address for the categories
- */
static void applyTableToInternalDataProvider( const SchXMLTable& rTable,
com::sun::star::uno::Reference< com::sun::star::chart2::XChartDocument > xChartDoc );
- /** Second part of applyTableToInternalDataProvider that has to be called after the data series
- got their styles set. This function reorders local data to fit the
- correct data structure.
+ /** This function reorders local data to fit the correct data structure.
+ Call it after the data series got their styles set.
*/
static void switchRangesFromOuterToInternalIfNecessary( const SchXMLTable& rTable,
const tSchXMLLSequencesPerIndex & rLSequencesPerIndex,
@@ -220,7 +209,7 @@ private:
SchXMLTable& mrTable;
rtl::OUString maCellContent;
rtl::OUString maRangeId;
- sal_Bool mbReadPara;
+ sal_Bool mbReadText;
public:
SchXMLTableCellContext( SchXMLImportHelper& rImpHelper,
diff --git a/xmloff/source/chart/SchXMLTextListContext.cxx b/xmloff/source/chart/SchXMLTextListContext.cxx
new file mode 100644
index 0000000000..2a1cad74b9
--- /dev/null
+++ b/xmloff/source/chart/SchXMLTextListContext.cxx
@@ -0,0 +1,136 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General 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_xmloff.hxx"
+
+#include "SchXMLImport.hxx"
+#include "SchXMLTextListContext.hxx"
+#include "SchXMLParagraphContext.hxx"
+
+#include "xmlnmspe.hxx"
+#include <xmloff/xmltoken.hxx>
+#include <xmloff/nmspmap.hxx>
+
+using ::rtl::OUString;
+using ::com::sun::star::uno::Sequence;
+using ::com::sun::star::uno::Reference;
+using namespace com::sun::star;
+using namespace ::xmloff::token;
+
+//-------------------------------------------------
+class SchXMLListItemContext : public SvXMLImportContext
+{
+public:
+ SchXMLListItemContext( SvXMLImport& rImport, const OUString& rLocalName, OUString& rText );
+ virtual ~SchXMLListItemContext();
+ virtual void StartElement( const Reference< xml::sax::XAttributeList >& xAttrList );
+ virtual void EndElement();
+
+ virtual SvXMLImportContext* CreateChildContext(
+ USHORT nPrefix,
+ const ::rtl::OUString& rLocalName,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList );
+
+private:
+ ::rtl::OUString& m_rText;
+};
+
+SchXMLListItemContext::SchXMLListItemContext(
+ SvXMLImport& rImport
+ , const OUString& rLocalName
+ , OUString& rText )
+ : SvXMLImportContext( rImport, XML_NAMESPACE_TEXT, rLocalName )
+ , m_rText( rText )
+{
+}
+
+SchXMLListItemContext::~SchXMLListItemContext()
+{}
+
+void SchXMLListItemContext::StartElement( const Reference< xml::sax::XAttributeList >& /*xAttrList*/ )
+{
+}
+
+void SchXMLListItemContext::EndElement()
+{
+}
+
+SvXMLImportContext* SchXMLListItemContext::CreateChildContext(
+ USHORT nPrefix, const OUString& rLocalName,
+ const uno::Reference< xml::sax::XAttributeList >& )
+{
+ SvXMLImportContext* pContext = 0;
+ if( nPrefix == XML_NAMESPACE_TEXT && IsXMLToken( rLocalName, XML_P ) )
+ pContext = new SchXMLParagraphContext( GetImport(), rLocalName, m_rText );
+ else
+ pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
+ return pContext;
+}
+
+//-------------------------------------------------
+
+SchXMLTextListContext::SchXMLTextListContext(
+ SvXMLImport& rImport
+ , const OUString& rLocalName
+ , Sequence< OUString>& rTextList )
+ : SvXMLImportContext( rImport, XML_NAMESPACE_TEXT, rLocalName )
+ , m_rTextList( rTextList )
+ , m_aTextVector()
+{
+}
+
+SchXMLTextListContext::~SchXMLTextListContext()
+{
+}
+
+void SchXMLTextListContext::StartElement( const Reference< xml::sax::XAttributeList >& /*xAttrList*/ )
+{
+}
+
+void SchXMLTextListContext::EndElement()
+{
+ sal_Int32 nCount = m_aTextVector.size();
+ m_rTextList.realloc(nCount);
+ for( sal_Int32 nN=0; nN<nCount; nN++ )
+ m_rTextList[nN]=m_aTextVector[nN];
+}
+
+SvXMLImportContext* SchXMLTextListContext::CreateChildContext(
+ USHORT nPrefix, const OUString& rLocalName,
+ const uno::Reference< xml::sax::XAttributeList >& )
+{
+ SvXMLImportContext* pContext = 0;
+ if( nPrefix == XML_NAMESPACE_TEXT && IsXMLToken( rLocalName, XML_LIST_ITEM ) )
+ {
+ m_aTextVector.push_back( OUString() );
+ pContext = new SchXMLListItemContext( GetImport(), rLocalName, m_aTextVector.back() );
+ }
+ else
+ pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
+ return pContext;
+}
diff --git a/configmgr/source/inc/bufferedfile.hxx b/xmloff/source/chart/SchXMLTextListContext.hxx
index 3fe8a08f37..f80be8bbc7 100644
--- a/configmgr/source/inc/bufferedfile.hxx
+++ b/xmloff/source/chart/SchXMLTextListContext.hxx
@@ -24,42 +24,35 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
+#ifndef _SCH_XMLTEXTLISTCONTEXT_HXX_
+#define _SCH_XMLTEXTLISTCONTEXT_HXX_
-#ifndef CONFIGMGR_BUFFEREDFILE_HXX
-#define CONFIGMGR_BUFFEREDFILE_HXX
-
-#include "utility.hxx"
-#include <boost/utility.hpp>
-#include <osl/file.hxx>
-#include <com/sun/star/io/IOException.hpp>
-
-#ifndef INCLUDED_VECTOR
+#include <xmloff/xmlictxt.hxx>
+#include "rtl/ustring.hxx"
#include <vector>
-#define INCLUDED_VECTOR
-#endif
-namespace configmgr
+namespace com { namespace sun { namespace star { namespace xml { namespace sax {
+ class XAttributeList;
+}}}}}
+
+class SchXMLTextListContext : public SvXMLImportContext
{
-
- namespace io = com::sun::star::io;
+public:
+ SchXMLTextListContext( SvXMLImport& rImport,
+ const ::rtl::OUString& rLocalName,
+ ::com::sun::star::uno::Sequence< ::rtl::OUString>& rTextList );
+ virtual ~SchXMLTextListContext();
+ virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
+ virtual void EndElement();
- class BufferedOutputFile: private boost::noncopyable, public osl::FileBase
- {
- osl::File * m_pFile;
- std::vector<sal_uInt8> m_buffer;
- public:
- BufferedOutputFile( rtl::OUString const& aFileURL, sal_uInt32 nBufferSizeHint = 0 );
- ~BufferedOutputFile ();
-
- RC open( sal_uInt32 uFlags );
- RC close();
-
- //RC getPos( sal_uInt64& uPos )
- RC write(const void *pBuffer, sal_uInt64 uBytesToWrite, sal_uInt64& rBytesWritten);
+ virtual SvXMLImportContext* CreateChildContext(
+ USHORT nPrefix,
+ const ::rtl::OUString& rLocalName,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList );
- // as opposed to osl::File, this method is not const here
- RC sync();
- };
-} // namespace
+private:
+ ::com::sun::star::uno::Sequence< ::rtl::OUString>& m_rTextList;
+ std::vector< ::rtl::OUString> m_aTextVector;
+};
-#endif
+#endif // _SCH_XMLTEXTLISTCONTEXT_HXX_
diff --git a/xmloff/source/chart/contexts.cxx b/xmloff/source/chart/contexts.cxx
index 72d5b2e591..b747280e08 100644
--- a/xmloff/source/chart/contexts.cxx
+++ b/xmloff/source/chart/contexts.cxx
@@ -35,13 +35,6 @@
#include "SchXMLImport.hxx"
#include "SchXMLCalculationSettingsContext.hxx"
-// #ifndef _XMLOFF_XMLCHARTSTYLECONTEXT_HXX_
-// #include "XMLChartStyleContext.hxx"
-// #endif
-#include <com/sun/star/chart/XChartDocument.hpp>
-#include <com/sun/star/chart/XChartDataArray.hpp>
-#include <com/sun/star/chart/ChartDataRowSource.hpp>
-
#include "contexts.hxx"
#include "SchXMLChartContext.hxx"
diff --git a/xmloff/source/chart/makefile.mk b/xmloff/source/chart/makefile.mk
index 33c217e513..bfdc9aeb5e 100644
--- a/xmloff/source/chart/makefile.mk
+++ b/xmloff/source/chart/makefile.mk
@@ -47,6 +47,7 @@ SLOFILES = $(SLO)$/ColorPropertySet.obj \
$(SLO)$/SchXMLChartContext.obj \
$(SLO)$/SchXMLPlotAreaContext.obj \
$(SLO)$/SchXMLParagraphContext.obj \
+ $(SLO)$/SchXMLTextListContext.obj \
$(SLO)$/SchXMLSeriesHelper.obj \
$(SLO)$/SchXMLSeries2Context.obj \
$(SLO)$/PropertyMaps.obj \
diff --git a/xmloff/source/chart/transporttypes.hxx b/xmloff/source/chart/transporttypes.hxx
index 00806d2af1..125f14d50a 100644
--- a/xmloff/source/chart/transporttypes.hxx
+++ b/xmloff/source/chart/transporttypes.hxx
@@ -37,17 +37,37 @@ enum SchXMLCellType
{
SCH_CELL_TYPE_UNKNOWN,
SCH_CELL_TYPE_FLOAT,
- SCH_CELL_TYPE_STRING
+ SCH_CELL_TYPE_STRING,
+ SCH_CELL_TYPE_COMPLEX_STRING
};
struct SchXMLCell
{
rtl::OUString aString;
+ ::com::sun::star::uno::Sequence< rtl::OUString >* pComplexString;
double fValue;
SchXMLCellType eType;
rtl::OUString aRangeId;
- SchXMLCell() : fValue( 0.0 ), eType( SCH_CELL_TYPE_UNKNOWN ) {}
+ SchXMLCell() : pComplexString(0), fValue( 0.0 ), eType( SCH_CELL_TYPE_UNKNOWN )
+ {}
+
+ SchXMLCell( const SchXMLCell& rOther )
+ : aString( rOther.aString )
+ , pComplexString( rOther.pComplexString ? new ::com::sun::star::uno::Sequence< rtl::OUString >( *rOther.pComplexString ) : 0 )
+ , fValue( rOther.fValue )
+ , eType( rOther.eType )
+ , aRangeId( rOther.aRangeId )
+ {}
+
+ ~SchXMLCell()
+ {
+ if(pComplexString)
+ {
+ delete pComplexString;
+ pComplexString=0;
+ }
+ }
};
struct SchXMLTable
diff --git a/xmloff/source/core/SettingsExportHelper.cxx b/xmloff/source/core/SettingsExportHelper.cxx
index 182ab6f9a2..31611faacc 100644
--- a/xmloff/source/core/SettingsExportHelper.cxx
+++ b/xmloff/source/core/SettingsExportHelper.cxx
@@ -32,32 +32,27 @@
#include <xmloff/xmltoken.hxx>
#include <xmloff/xmluconv.hxx>
#include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
#include <comphelper/extract.hxx>
-// #110680#
-//#ifndef _COMPHELPER_PROCESSFACTORYHXX_
-//#include <comphelper/processfactory.hxx>
-//#endif
#include <com/sun/star/linguistic2/XSupportedLocales.hpp>
#include <com/sun/star/i18n/XForbiddenCharacters.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
-#ifndef _COM_SUN_STAR_CONTAINER_XIndexCONTAINER_HPP_
#include <com/sun/star/container/XIndexContainer.hpp>
-#endif
#include <com/sun/star/util/DateTime.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/container/XIndexContainer.hpp>
#include <com/sun/star/formula/SymbolDescriptor.hpp>
#include <com/sun/star/document/PrinterIndependentLayout.hpp>
-#include <xmloff/nmspmap.hxx>
+#include <xmloff/XMLSettingsExportContext.hxx>
#include <xmlenums.hxx>
using namespace ::com::sun::star;
using namespace ::xmloff::token;
-XMLSettingsExportHelper::XMLSettingsExportHelper(SvXMLExport& rTempExport)
-: rExport(rTempExport)
+XMLSettingsExportHelper::XMLSettingsExportHelper( ::xmloff::XMLSettingsExportContext& i_rContext )
+: m_rContext( i_rContext )
, msPrinterIndependentLayout( RTL_CONSTASCII_USTRINGPARAM( "PrinterIndependentLayout" ) )
, msColorTableURL( RTL_CONSTASCII_USTRINGPARAM( "ColorTableURL" ) )
, msLineEndTableURL( RTL_CONSTASCII_USTRINGPARAM( "LineEndTableURL" ) )
@@ -194,89 +189,97 @@ void XMLSettingsExportHelper::CallTypeFunction(const uno::Any& rAny,
void XMLSettingsExportHelper::exportBool(const sal_Bool bValue, const rtl::OUString& rName) const
{
DBG_ASSERT(rName.getLength(), "no name");
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName);
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_TYPE, XML_BOOLEAN);
- SvXMLElementExport aBoolElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM, sal_True, sal_False);
+ m_rContext.AddAttribute( XML_NAME, rName );
+ m_rContext.AddAttribute( XML_TYPE, XML_BOOLEAN );
+ m_rContext.StartElement( XML_CONFIG_ITEM, sal_True );
rtl::OUString sValue;
if (bValue)
sValue = GetXMLToken(XML_TRUE);
else
sValue = GetXMLToken(XML_FALSE);
- rExport.GetDocHandler()->characters(sValue);
+ m_rContext.Characters( sValue );
+ m_rContext.EndElement( sal_False );
}
void XMLSettingsExportHelper::exportByte(const sal_Int8 nValue, const rtl::OUString& rName) const
{
DBG_ASSERT(rName.getLength(), "no name");
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName);
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_TYPE, XML_BYTE);
- SvXMLElementExport aShortElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM, sal_True, sal_False);
+ m_rContext.AddAttribute( XML_NAME, rName );
+ m_rContext.AddAttribute( XML_TYPE, XML_BYTE );
+ m_rContext.StartElement( XML_CONFIG_ITEM, sal_True );
rtl::OUStringBuffer sBuffer;
SvXMLUnitConverter::convertNumber(sBuffer, sal_Int32(nValue));
- rExport.GetDocHandler()->characters(sBuffer.makeStringAndClear());
+ m_rContext.Characters( sBuffer.makeStringAndClear() );
+ m_rContext.EndElement( sal_False );
}
void XMLSettingsExportHelper::exportShort(const sal_Int16 nValue, const rtl::OUString& rName) const
{
DBG_ASSERT(rName.getLength(), "no name");
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName);
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_TYPE, XML_SHORT);
- SvXMLElementExport aShortElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM, sal_True, sal_False);
+ m_rContext.AddAttribute( XML_NAME, rName );
+ m_rContext.AddAttribute( XML_TYPE, XML_SHORT );
+ m_rContext.StartElement( XML_CONFIG_ITEM, sal_True );
rtl::OUStringBuffer sBuffer;
SvXMLUnitConverter::convertNumber(sBuffer, sal_Int32(nValue));
- rExport.GetDocHandler()->characters(sBuffer.makeStringAndClear());
+ m_rContext.Characters( sBuffer.makeStringAndClear() );
+ m_rContext.EndElement( sal_False );
}
void XMLSettingsExportHelper::exportInt(const sal_Int32 nValue, const rtl::OUString& rName) const
{
DBG_ASSERT(rName.getLength(), "no name");
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName);
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_TYPE, XML_INT);
- SvXMLElementExport aIntElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM, sal_True, sal_False);
+ m_rContext.AddAttribute( XML_NAME, rName );
+ m_rContext.AddAttribute( XML_TYPE, XML_INT );
+ m_rContext.StartElement( XML_CONFIG_ITEM, sal_True );
rtl::OUStringBuffer sBuffer;
SvXMLUnitConverter::convertNumber(sBuffer, nValue);
- rExport.GetDocHandler()->characters(sBuffer.makeStringAndClear());
+ m_rContext.Characters( sBuffer.makeStringAndClear() );
+ m_rContext.EndElement( sal_False );
}
void XMLSettingsExportHelper::exportLong(const sal_Int64 nValue, const rtl::OUString& rName) const
{
DBG_ASSERT(rName.getLength(), "no name");
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName);
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_TYPE, XML_LONG);
- SvXMLElementExport aIntElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM, sal_True, sal_False);
+ m_rContext.AddAttribute( XML_NAME, rName );
+ m_rContext.AddAttribute( XML_TYPE, XML_LONG );
+ m_rContext.StartElement( XML_CONFIG_ITEM, sal_True );
rtl::OUString sValue(rtl::OUString::valueOf(nValue));
- rExport.GetDocHandler()->characters(sValue);
+ m_rContext.Characters( sValue );
+ m_rContext.EndElement( sal_False );
}
void XMLSettingsExportHelper::exportDouble(const double fValue, const rtl::OUString& rName) const
{
DBG_ASSERT(rName.getLength(), "no name");
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName);
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_TYPE, XML_DOUBLE);
- SvXMLElementExport aDoubleElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM, sal_True, sal_False);
+ m_rContext.AddAttribute( XML_NAME, rName );
+ m_rContext.AddAttribute( XML_TYPE, XML_DOUBLE );
+ m_rContext.StartElement( XML_CONFIG_ITEM, sal_True );
rtl::OUStringBuffer sBuffer;
SvXMLUnitConverter::convertDouble(sBuffer, fValue);
- rExport.GetDocHandler()->characters(sBuffer.makeStringAndClear());
+ m_rContext.Characters( sBuffer.makeStringAndClear() );
+ m_rContext.EndElement( sal_False );
}
void XMLSettingsExportHelper::exportString(const rtl::OUString& sValue, const rtl::OUString& rName) const
{
DBG_ASSERT(rName.getLength(), "no name");
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName);
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_TYPE, XML_STRING);
- SvXMLElementExport aDoubleElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM, sal_True, sal_False);
+ m_rContext.AddAttribute( XML_NAME, rName );
+ m_rContext.AddAttribute( XML_TYPE, XML_STRING );
+ m_rContext.StartElement( XML_CONFIG_ITEM, sal_True );
if (sValue.getLength())
- rExport.GetDocHandler()->characters(sValue);
+ m_rContext.Characters( sValue );
+ m_rContext.EndElement( sal_False );
}
void XMLSettingsExportHelper::exportDateTime(const util::DateTime& aValue, const rtl::OUString& rName) const
{
DBG_ASSERT(rName.getLength(), "no name");
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName);
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_TYPE, XML_DATETIME);
+ m_rContext.AddAttribute( XML_NAME, rName );
+ m_rContext.AddAttribute( XML_TYPE, XML_DATETIME );
rtl::OUStringBuffer sBuffer;
SvXMLUnitConverter::convertDateTime(sBuffer, aValue);
- SvXMLElementExport aDoubleElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM, sal_True, sal_False);
- rExport.GetDocHandler()->characters(sBuffer.makeStringAndClear());
+ m_rContext.StartElement( XML_CONFIG_ITEM, sal_True );
+ m_rContext.Characters( sBuffer.makeStringAndClear() );
+ m_rContext.EndElement( sal_False );
}
void XMLSettingsExportHelper::exportSequencePropertyValue(
@@ -287,10 +290,11 @@ void XMLSettingsExportHelper::exportSequencePropertyValue(
sal_Int32 nLength(aProps.getLength());
if(nLength)
{
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName);
- SvXMLElementExport aSequenceElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM_SET, sal_True, sal_True);
+ m_rContext.AddAttribute( XML_NAME, rName );
+ m_rContext.StartElement( XML_CONFIG_ITEM_SET, sal_True );
for (sal_Int32 i = 0; i < nLength; i++)
CallTypeFunction(aProps[i].Value, aProps[i].Name);
+ m_rContext.EndElement( sal_True );
}
}
void XMLSettingsExportHelper::exportSymbolDescriptors(
@@ -299,7 +303,7 @@ void XMLSettingsExportHelper::exportSymbolDescriptors(
{
// #110680#
// uno::Reference< lang::XMultiServiceFactory > xServiceFactory( comphelper::getProcessServiceFactory() );
- uno::Reference< lang::XMultiServiceFactory > xServiceFactory( rExport.getServiceFactory() );
+ uno::Reference< lang::XMultiServiceFactory > xServiceFactory( m_rContext.GetServiceFactory() );
DBG_ASSERT( xServiceFactory.is(), "XMLSettingsExportHelper::exportSymbolDescriptors: got no service manager" );
if( xServiceFactory.is() )
@@ -362,15 +366,16 @@ void XMLSettingsExportHelper::exportbase64Binary(
{
DBG_ASSERT(rName.getLength(), "no name");
sal_Int32 nLength(aProps.getLength());
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName);
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_TYPE, XML_BASE64BINARY);
- SvXMLElementExport aDoubleElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM, sal_True, sal_False);
+ m_rContext.AddAttribute( XML_NAME, rName );
+ m_rContext.AddAttribute( XML_TYPE, XML_BASE64BINARY );
+ m_rContext.StartElement( XML_CONFIG_ITEM, sal_True );
if(nLength)
{
rtl::OUStringBuffer sBuffer;
SvXMLUnitConverter::encodeBase64(sBuffer, aProps);
- rExport.GetDocHandler()->characters(sBuffer.makeStringAndClear());
+ m_rContext.Characters( sBuffer.makeStringAndClear() );
}
+ m_rContext.EndElement( sal_False );
}
void XMLSettingsExportHelper::exportMapEntry(const uno::Any& rAny,
@@ -384,10 +389,11 @@ void XMLSettingsExportHelper::exportMapEntry(const uno::Any& rAny,
if (nLength)
{
if (bNameAccess)
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName);
- SvXMLElementExport aEntryElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM_MAP_ENTRY, sal_True, sal_True);
+ m_rContext.AddAttribute( XML_NAME, rName );
+ m_rContext.StartElement( XML_CONFIG_ITEM_MAP_ENTRY, sal_True );
for (sal_Int32 i = 0; i < nLength; i++)
CallTypeFunction(aProps[i].Value, aProps[i].Name);
+ m_rContext.EndElement( sal_True );
}
}
@@ -400,11 +406,12 @@ void XMLSettingsExportHelper::exportNameAccess(
"wrong NameAccess" );
if(aNamed->hasElements())
{
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName);
- SvXMLElementExport aNamedElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM_MAP_NAMED, sal_True, sal_True);
+ m_rContext.AddAttribute( XML_NAME, rName );
+ m_rContext.StartElement( XML_CONFIG_ITEM_MAP_NAMED, sal_True );
uno::Sequence< rtl::OUString > aNames(aNamed->getElementNames());
for (sal_Int32 i = 0; i < aNames.getLength(); i++)
exportMapEntry(aNamed->getByName(aNames[i]), aNames[i], sal_True);
+ m_rContext.EndElement( sal_True );
}
}
@@ -414,17 +421,18 @@ void XMLSettingsExportHelper::exportIndexAccess(
{
DBG_ASSERT(rName.getLength(), "no name");
DBG_ASSERT(aIndexed->getElementType().equals(getCppuType( (uno::Sequence<beans::PropertyValue> *)0 ) ),
- "wrong NameAccess" );
+ "wrong IndexAccess" );
rtl::OUString sEmpty;// ( RTLCONSTASCII_USTRINGPARAM( "View" ) );
if(aIndexed->hasElements())
{
- rExport.AddAttribute(XML_NAMESPACE_CONFIG, XML_NAME, rName);
- SvXMLElementExport aIndexedElem(rExport, XML_NAMESPACE_CONFIG, XML_CONFIG_ITEM_MAP_INDEXED, sal_True, sal_True);
+ m_rContext.AddAttribute( XML_NAME, rName );
+ m_rContext.StartElement( XML_CONFIG_ITEM_MAP_INDEXED, sal_True );
sal_Int32 nCount = aIndexed->getCount();
for (sal_Int32 i = 0; i < nCount; i++)
{
exportMapEntry(aIndexed->getByIndex(i), sEmpty, sal_False);
}
+ m_rContext.EndElement( sal_True );
}
}
@@ -445,7 +453,7 @@ void XMLSettingsExportHelper::exportForbiddenCharacters(
// #110680#
// uno::Reference< lang::XMultiServiceFactory > xServiceFactory( comphelper::getProcessServiceFactory() );
- uno::Reference< lang::XMultiServiceFactory > xServiceFactory( rExport.getServiceFactory() );
+ uno::Reference< lang::XMultiServiceFactory > xServiceFactory( m_rContext.GetServiceFactory() );
DBG_ASSERT( xServiceFactory.is(), "XMLSettingsExportHelper::exportForbiddenCharacters: got no service manager" );
if( xServiceFactory.is() )
@@ -496,14 +504,12 @@ void XMLSettingsExportHelper::exportForbiddenCharacters(
}
}
-void XMLSettingsExportHelper::exportSettings(
+void XMLSettingsExportHelper::exportAllSettings(
const uno::Sequence<beans::PropertyValue>& aProps,
const rtl::OUString& rName) const
{
DBG_ASSERT(rName.getLength(), "no name");
- ::rtl::OUString aQName =
- rExport.GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_OOO, rName );
- exportSequencePropertyValue(aProps, aQName);
+ exportSequencePropertyValue(aProps, rName);
}
@@ -531,15 +537,16 @@ void XMLSettingsExportHelper::ManipulateSetting( uno::Any& rAny, const rtl::OUSt
{
if( !mxStringSubsitution.is() )
{
- if( rExport.getServiceFactory().is() ) try
+ if( m_rContext.GetServiceFactory().is() ) try
{
const_cast< XMLSettingsExportHelper* >(this)->mxStringSubsitution =
uno::Reference< util::XStringSubstitution >::query(
- rExport.getServiceFactory()->
+ m_rContext.GetServiceFactory()->
createInstance(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.PathSubstitution" ) ) ) );
}
catch( uno::Exception& )
{
+ DBG_UNHANDLED_EXCEPTION();
}
}
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index 8732c143e1..a87141adf2 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -53,6 +53,7 @@
#include <xmloff/xmlexp.hxx>
#include <xmloff/xmlnumfe.hxx>
#include <xmloff/xmlmetae.hxx>
+#include <xmloff/XMLSettingsExportContext.hxx>
#include <xmloff/families.hxx>
#include <xmloff/XMLEventExport.hxx>
#include "XMLStarBasicExportHandler.hxx"
@@ -157,6 +158,72 @@ const XMLServiceMapEntry_Impl aServiceMap[] =
//==============================================================================
+class SAL_DLLPRIVATE SettingsExportFacade : public ::xmloff::XMLSettingsExportContext
+{
+public:
+ SettingsExportFacade( SvXMLExport& i_rExport )
+ :m_rExport( i_rExport )
+ {
+ }
+
+ virtual ~SettingsExportFacade()
+ {
+ }
+
+ virtual void AddAttribute( enum ::xmloff::token::XMLTokenEnum i_eName,
+ const ::rtl::OUString& i_rValue );
+ virtual void AddAttribute( enum ::xmloff::token::XMLTokenEnum i_eName,
+ enum ::xmloff::token::XMLTokenEnum i_eValue );
+
+ virtual void StartElement( enum ::xmloff::token::XMLTokenEnum i_eName,
+ const sal_Bool i_bIgnoreWhitespace );
+ virtual void EndElement( const sal_Bool i_bIgnoreWhitespace );
+
+ virtual void Characters( const ::rtl::OUString& i_rCharacters );
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
+ GetServiceFactory() const;
+private:
+ SvXMLExport& m_rExport;
+ ::std::stack< ::rtl::OUString > m_aElements;
+};
+
+void SettingsExportFacade::AddAttribute( enum ::xmloff::token::XMLTokenEnum i_eName, const ::rtl::OUString& i_rValue )
+{
+ m_rExport.AddAttribute( XML_NAMESPACE_CONFIG, i_eName, i_rValue );
+}
+
+void SettingsExportFacade::AddAttribute( enum ::xmloff::token::XMLTokenEnum i_eName, enum ::xmloff::token::XMLTokenEnum i_eValue )
+{
+ m_rExport.AddAttribute( XML_NAMESPACE_CONFIG, i_eName, i_eValue );
+}
+
+void SettingsExportFacade::StartElement( enum ::xmloff::token::XMLTokenEnum i_eName, const sal_Bool i_bIgnoreWhitespace )
+{
+ const ::rtl::OUString sElementName( m_rExport.GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_CONFIG, GetXMLToken( i_eName ) ) );
+ m_rExport.StartElement( sElementName, i_bIgnoreWhitespace );
+ m_aElements.push( sElementName );
+}
+
+void SettingsExportFacade::EndElement( const sal_Bool i_bIgnoreWhitespace )
+{
+ const ::rtl::OUString sElementName( m_aElements.top() );
+ m_rExport.EndElement( sElementName, i_bIgnoreWhitespace );
+ m_aElements.pop();
+}
+
+void SettingsExportFacade::Characters( const ::rtl::OUString& i_rCharacters )
+{
+ m_rExport.GetDocHandler()->characters( i_rCharacters );
+}
+
+Reference< XMultiServiceFactory > SettingsExportFacade::GetServiceFactory() const
+{
+ return m_rExport.getServiceFactory();
+}
+
+//==============================================================================
+
class SvXMLExportEventListener : public cppu::WeakImplHelper1<
com::sun::star::lang::XEventListener >
{
@@ -1100,7 +1167,9 @@ void SvXMLExport::ImplExportSettings()
nSettingsCount != 0,
XML_NAMESPACE_OFFICE, XML_SETTINGS,
sal_True, sal_True );
- XMLSettingsExportHelper aSettingsExportHelper(*this);
+
+ SettingsExportFacade aSettingsExportContext( *this );
+ XMLSettingsExportHelper aSettingsExportHelper( aSettingsExportContext );
for ( ::std::list< SettingsGroup >::const_iterator settings = aSettings.begin();
settings != aSettings.end();
@@ -1111,7 +1180,8 @@ void SvXMLExport::ImplExportSettings()
continue;
OUString sSettingsName( GetXMLToken( settings->eGroupName ) );
- aSettingsExportHelper.exportSettings( settings->aSettings, sSettingsName );
+ OUString sQName = GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_OOO, sSettingsName );
+ aSettingsExportHelper.exportAllSettings( settings->aSettings, sQName );
}
}
}
@@ -1244,6 +1314,23 @@ void SvXMLExport::SetBodyAttributes()
{
}
+static void
+lcl_AddGrddl(SvXMLExport & rExport, const sal_Int32 nExportMode)
+{
+ // check version >= 1.2
+ switch (rExport.getDefaultVersion()) {
+ case SvtSaveOptions::ODFVER_011: // fall thru
+ case SvtSaveOptions::ODFVER_010: return;
+ default: break;
+ }
+
+ if (EXPORT_SETTINGS != nExportMode) // meta, content, styles
+ {
+ rExport.AddAttribute( XML_NAMESPACE_GRDDL, XML_TRANSFORMATION,
+ OUString::createFromAscii(s_grddl_xsl) );
+ }
+}
+
sal_uInt32 SvXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass )
{
bool bOwnGraphicResolver = false;
@@ -1379,11 +1466,7 @@ sal_uInt32 SvXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass )
enum XMLTokenEnum eRootService = XML_TOKEN_INVALID;
const sal_Int32 nExportMode = mnExportFlags & (EXPORT_META|EXPORT_STYLES|EXPORT_CONTENT|EXPORT_SETTINGS);
- if ( EXPORT_SETTINGS != nExportMode ) // meta, content, styles
- {
- AddAttribute( XML_NAMESPACE_GRDDL, XML_TRANSFORMATION,
- OUString::createFromAscii(s_grddl_xsl) );
- }
+ lcl_AddGrddl(*this, nExportMode);
if( EXPORT_META == nExportMode )
{
diff --git a/xmloff/source/style/styleexp.cxx b/xmloff/source/style/styleexp.cxx
index 0a46816c2e..b2b2ed29e3 100644
--- a/xmloff/source/style/styleexp.cxx
+++ b/xmloff/source/style/styleexp.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -187,7 +187,7 @@ sal_Bool XMLStyleExport::exportStyle(
sal_Int32 nOutlineLevel = 0;
if( xPropSetInfo->hasPropertyByName( sOutlineLevel ) )
{
- Reference< XPropertyState > xPropState( xPropSet, uno::UNO_QUERY );
+ Reference< XPropertyState > xPropState( xPropSet, uno::UNO_QUERY );
if( PropertyState_DIRECT_VALUE == xPropState->getPropertyState( sOutlineLevel ) )
{
aAny = xPropSet->getPropertyValue( sOutlineLevel );
@@ -197,13 +197,22 @@ sal_Bool XMLStyleExport::exportStyle(
OUStringBuffer sTmp;
sTmp.append( static_cast<sal_Int32>(nOutlineLevel));
GetExport().AddAttribute( XML_NAMESPACE_STYLE,
- XML_DEFAULT_OUTLINE_LEVEL,
- sTmp.makeStringAndClear() );
+ XML_DEFAULT_OUTLINE_LEVEL,
+ sTmp.makeStringAndClear() );
}
else
{
- GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_DEFAULT_OUTLINE_LEVEL,
- OUString( RTL_CONSTASCII_USTRINGPARAM( "" )));
+ // --> OD 2009-12-29 #i104889#
+ // empty value for style:default-outline-level does exist
+ // since ODF 1.2. Thus, suppress its export for former versions.
+ if ( ( GetExport().getExportFlags() & EXPORT_OASIS ) != 0 &&
+ GetExport().getDefaultVersion() >= SvtSaveOptions::ODFVER_012 )
+ // <--
+ {
+ GetExport().AddAttribute( XML_NAMESPACE_STYLE,
+ XML_DEFAULT_OUTLINE_LEVEL,
+ OUString( RTL_CONSTASCII_USTRINGPARAM( "" )));
+ }
}
}
}//<-end,zhaojianwei
@@ -271,11 +280,11 @@ sal_Bool XMLStyleExport::exportStyle(
}
// <--
}
- }
+ }
//#outline level, add by zhaojianwei.0802
else if( nOutlineLevel > 0 )
{
-
+
bool bNoInheritedListStyle( true );
/////////////////////////////////////////////////
@@ -308,8 +317,9 @@ sal_Bool XMLStyleExport::exportStyle(
}
/////////////////////////////////////////////////
if ( bNoInheritedListStyle )
- GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_LIST_STYLE_NAME,
- OUString( RTL_CONSTASCII_USTRINGPARAM( "" )));
+ GetExport().AddAttribute( XML_NAMESPACE_STYLE,
+ XML_LIST_STYLE_NAME,
+ OUString( RTL_CONSTASCII_USTRINGPARAM( "" )));
}
//<-end,zhaojianwei
}
@@ -327,7 +337,7 @@ sal_Bool XMLStyleExport::exportStyle(
// <style:style>
SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE, XML_STYLE,
sal_True, sal_True );
-
+
rPropMapper->SetStyleName( sName );
// <style:properties>
diff --git a/xmloff/source/text/XMLTextMarkImportContext.cxx b/xmloff/source/text/XMLTextMarkImportContext.cxx
index 16a95f3046..08cb730d3a 100644
--- a/xmloff/source/text/XMLTextMarkImportContext.cxx
+++ b/xmloff/source/text/XMLTextMarkImportContext.cxx
@@ -38,6 +38,7 @@
#include <xmloff/xmltoken.hxx>
#include <xmloff/xmlimp.hxx>
#include <xmloff/nmspmap.hxx>
+#include <xmloff/odffields.hxx>
#include "xmlnmspe.hxx"
#include <com/sun/star/xml/sax/XAttributeList.hpp>
#include <com/sun/star/text/XTextContent.hpp>
@@ -135,6 +136,33 @@ static SvXMLEnumMapEntry __READONLY_DATA lcl_aMarkTypeMap[] =
{ XML_TOKEN_INVALID, 0 },
};
+
+static const char *lcl_getFormFieldmarkName(rtl::OUString &name)
+{
+ static const char sCheckbox[]=ODF_FORMCHECKBOX;
+ static const char sFormDropDown[]=ODF_FORMDROPDOWN;
+ if (name.compareToAscii("msoffice.field.FORMCHECKBOX")==0)
+ return sCheckbox;
+ else if (name.compareToAscii(ODF_FORMCHECKBOX)==0)
+ return sCheckbox;
+ if (name.compareToAscii(ODF_FORMDROPDOWN)==0)
+ return sFormDropDown;
+ else
+ return NULL;
+}
+
+static rtl::OUString lcl_getFieldmarkName(rtl::OUString &name)
+{
+ static const char sFormtext[]=ODF_FORMTEXT;
+ if (name.compareToAscii("msoffice.field.FORMTEXT")==0)
+ return rtl::OUString::createFromAscii(sFormtext);
+ else if (name.compareToAscii(ODF_FORMTEXT)==0)
+ return rtl::OUString::createFromAscii(sFormtext);
+ else
+ return name;
+}
+
+
void XMLTextMarkImportContext::StartElement(
const Reference<XAttributeList> & xAttrList)
{
@@ -191,7 +219,8 @@ void XMLTextMarkImportContext::EndElement()
case TypeFieldmark:
case TypeBookmark:
{
- bool bImportAsField=((lcl_MarkType)nTmp==TypeFieldmark && m_sFieldName.compareToAscii("msoffice.field.FORMCHECKBOX")==0); // for now only import FORMCHECKBOX boxes
+ const char *formFieldmarkName=lcl_getFormFieldmarkName(m_sFieldName);
+ bool bImportAsField=((lcl_MarkType)nTmp==TypeFieldmark && formFieldmarkName!=NULL); //@TODO handle abbreviation cases..
// export point bookmark
const Reference<XInterface> xContent(
CreateAndInsertMark(GetImport(),
@@ -210,10 +239,8 @@ void XMLTextMarkImportContext::EndElement()
if (xContent.is() && bImportAsField) {
// setup fieldmark...
Reference< ::com::sun::star::text::XFormField> xFormField(xContent, UNO_QUERY);
- xFormField->setType(1); // Checkbox...
+ xFormField->setFieldType(rtl::OUString::createFromAscii(formFieldmarkName));
if (xFormField.is() && m_rHelper.hasCurrentFieldCtx()) {
-// xFormField->setDescription(::rtl::OUString::createFromAscii("HELLO CHECKBOX"));
-// xFormField->setRes(1);
m_rHelper.setCurrentFieldParamsTo(xFormField);
}
}
@@ -260,11 +287,6 @@ void XMLTextMarkImportContext::EndElement()
xInsertionCursor, UNO_QUERY);
bool bImportAsField=((lcl_MarkType)nTmp==TypeFieldmarkEnd && m_rHelper.hasCurrentFieldCtx());
- if (bImportAsField) {
- ::rtl::OUString currentFieldType =
- m_rHelper.getCurrentFieldType();
- bImportAsField=currentFieldType.compareToAscii("msoffice.field.FORMTEXT")==0; // for now only import FORMTEXT boxes
- }
// insert reference
const Reference<XInterface> xContent(
@@ -285,10 +307,12 @@ void XMLTextMarkImportContext::EndElement()
if (xContent.is() && bImportAsField) {
// setup fieldmark...
Reference< ::com::sun::star::text::XFormField> xFormField(xContent, UNO_QUERY);
- xFormField->setType(0); // Text
if (xFormField.is() && m_rHelper.hasCurrentFieldCtx()) {
+ rtl::OUString givenTypeName=m_rHelper.getCurrentFieldType();
+ rtl::OUString fieldmarkTypeName=lcl_getFieldmarkName(givenTypeName);
+
+ xFormField->setFieldType(fieldmarkTypeName);
m_rHelper.setCurrentFieldParamsTo(xFormField);
-// xFormField->setDescription(::rtl::OUString::createFromAscii("HELLO"));
}
}
m_rHelper.popFieldCtx();
diff --git a/xmloff/source/text/XMLTextNumRuleInfo.cxx b/xmloff/source/text/XMLTextNumRuleInfo.cxx
index 84347206ab..b29cd313fc 100644
--- a/xmloff/source/text/XMLTextNumRuleInfo.cxx
+++ b/xmloff/source/text/XMLTextNumRuleInfo.cxx
@@ -120,6 +120,15 @@ void XMLTextNumRuleInfo::Set(
}
// <--
+ // --> OD 2010-01-13 #b6912256#
+ if ( mnListLevel < 0 )
+ {
+ DBG_ASSERT( false,
+ "<XMLTextNumRuleInfo::Set(..)> - unexpected numbering level" );
+ Reset();
+ return;
+ }
+
// --> OD 2006-09-27 #i69627#
bool bSuppressListStyle( false );
if ( mxNumRules.is() )
diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx
index 3f0159d5fe..153d51e71c 100644
--- a/xmloff/source/text/txtimp.cxx
+++ b/xmloff/source/text/txtimp.cxx
@@ -89,6 +89,8 @@
// --> OD 2008-04-25 #refactorlists#
#include <txtlists.hxx>
// <--
+#include <xmloff/odffields.hxx>
+#include <comphelper/stlunosequence.hxx>
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
@@ -110,6 +112,8 @@ using namespace ::com::sun::star::ucb;
using ::comphelper::UStringLess;
+
+
static __FAR_DATA SvXMLTokenMapEntry aTextElemTokenMap[] =
{
{ XML_NAMESPACE_TEXT, XML_P, XML_TOK_TEXT_P },
@@ -444,6 +448,70 @@ static __FAR_DATA SvXMLTokenMapEntry aTextMasterPageElemTokenMap[] =
#define MAX_COMBINED_CHARACTERS 6
+namespace
+{
+ class FieldParamImporter
+ {
+ public:
+ typedef pair<OUString,OUString> field_param_t;
+ typedef vector<field_param_t> field_params_t;
+ FieldParamImporter(const field_params_t* const pInParams, Reference<XNameContainer> xOutParams)
+ : m_pInParams(pInParams)
+ , m_xOutParams(xOutParams)
+ { };
+ void Import();
+
+ private:
+ const field_params_t* const m_pInParams;
+ Reference<XNameContainer> m_xOutParams;
+ };
+
+ void FieldParamImporter::Import()
+ {
+ ::std::vector<OUString> vListEntries;
+ ::std::map<OUString, Any> vOutParams;
+ for(field_params_t::const_iterator pCurrent = m_pInParams->begin();
+ pCurrent != m_pInParams->end();
+ ++pCurrent)
+ {
+ if(pCurrent->first.equalsAscii(ODF_FORMDROPDOWN_RESULT))
+ {
+ // sal_Int32
+ vOutParams[pCurrent->first] = makeAny(pCurrent->second.toInt32());
+ }
+ else if(pCurrent->first.equalsAscii(ODF_FORMCHECKBOX_RESULT))
+ {
+ // bool
+ vOutParams[pCurrent->first] = makeAny(pCurrent->second.toBoolean());
+ }
+ else if(pCurrent->first.equalsAscii(ODF_FORMDROPDOWN_LISTENTRY))
+ {
+ // sequence
+ vListEntries.push_back(pCurrent->second);
+ }
+ else
+ vOutParams[pCurrent->first] = makeAny(pCurrent->second);
+ }
+ if(!vListEntries.empty())
+ {
+ Sequence<OUString> vListEntriesSeq(vListEntries.size());
+ copy(vListEntries.begin(), vListEntries.end(), ::comphelper::stl_begin(vListEntriesSeq));
+ vOutParams[OUString::createFromAscii(ODF_FORMDROPDOWN_LISTENTRY)] = makeAny(vListEntriesSeq);
+ }
+ for(::std::map<OUString, Any>::const_iterator pCurrent = vOutParams.begin();
+ pCurrent != vOutParams.end();
+ ++pCurrent)
+ {
+ try
+ {
+ m_xOutParams->insertByName(pCurrent->first, pCurrent->second);
+ }
+ catch(ElementExistException)
+ { }
+ }
+ }
+}
+
XMLTextImportHelper::XMLTextImportHelper(
const Reference < XModel >& rModel,
SvXMLImport& rImport,
@@ -2277,18 +2345,9 @@ bool XMLTextImportHelper::hasCurrentFieldCtx()
void XMLTextImportHelper::setCurrentFieldParamsTo(::com::sun::star::uno::Reference< ::com::sun::star::text::XFormField> &xFormField)
{
DBG_ASSERT(!aFieldStack.empty(), "stack is empty: not good! Do a pushFieldCtx before...");
- if (!aFieldStack.empty() && xFormField.is()) {
- field_params_t &params=aFieldStack.top().second;
- for (field_params_t::iterator i=params.begin();i!=params.end();i++) {
- rtl::OUString name=i->first;
- rtl::OUString value=i->second;
- if (name.compareToAscii("Description")==0){
- xFormField->setDescription(value);
- } else if (name.compareToAscii("Result")==0){
- xFormField->setRes((sal_Int16)value.toInt32());
- }
-
- }
+ if (!aFieldStack.empty() && xFormField.is())
+ {
+ FieldParamImporter(&aFieldStack.top().second, xFormField->getParameters()).Import();
}
}
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index fb620eaea5..cdfbf4ca86 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -116,6 +116,7 @@
#include "MultiPropertySetHelper.hxx"
#include <xmloff/formlayerexport.hxx>
#include "XMLTextCharStyleNamesElementExport.hxx"
+#include <comphelper/stlunosequence.hxx>
// --> OD 2008-04-25 #refactorlists#
#include <txtlists.hxx>
@@ -231,6 +232,21 @@ namespace
const OUString BoundFrames::our_sAnchorType = OUString::createFromAscii("AnchorType");
const OUString BoundFrames::our_sAnchorFrame = OUString::createFromAscii("AnchorFrame");
+ class FieldParamExporter
+ {
+ public:
+ FieldParamExporter(SvXMLExport* const pExport, Reference<XNameContainer> xFieldParams)
+ : m_pExport(pExport)
+ , m_xFieldParams(xFieldParams)
+ { };
+ void Export();
+
+ private:
+ SvXMLExport* const m_pExport;
+ const Reference<XNameContainer> m_xFieldParams;
+
+ void ExportParameter(const OUString& sKey, const OUString& sValue);
+ };
}
namespace xmloff
@@ -386,6 +402,55 @@ BoundFrameSets::BoundFrameSets(const Reference<XInterface> xModel)
&lcl_ShapeFilter));
};
+void FieldParamExporter::Export()
+{
+ static const Type aStringType = ::getCppuType((OUString*)0);
+ static const Type aBoolType = ::getCppuType((sal_Bool*)0);
+ static const Type aSeqType = ::getCppuType((Sequence<OUString>*)0);
+ static const Type aIntType = ::getCppuType((sal_Int32*)0);
+ Sequence<OUString> vParameters(m_xFieldParams->getElementNames());
+ for(const OUString* pCurrent=::comphelper::stl_begin(vParameters); pCurrent!=::comphelper::stl_end(vParameters); ++pCurrent)
+ {
+ const Any aValue = m_xFieldParams->getByName(*pCurrent);
+ const Type aValueType = aValue.getValueType();
+ if(aValueType == aStringType)
+ {
+ OUString sValue;
+ aValue >>= sValue;
+ ExportParameter(*pCurrent,sValue);
+ }
+ else if(aValueType == aBoolType)
+ {
+ sal_Bool bValue = false;
+ aValue >>= bValue;
+ ExportParameter(*pCurrent,OUString::createFromAscii(bValue ? "true" : "false"));
+ }
+ else if(aValueType == aSeqType)
+ {
+ Sequence<OUString> vValue;
+ aValue >>= vValue;
+ for(OUString* pSeqCurrent = ::comphelper::stl_begin(vValue); pSeqCurrent != ::comphelper::stl_end(vValue); ++pSeqCurrent)
+ {
+ ExportParameter(*pCurrent, *pSeqCurrent);
+ }
+ }
+ else if(aValueType == aIntType)
+ {
+ sal_Int32 nValue = 0;
+ aValue >>= nValue;
+ ExportParameter(*pCurrent, OUStringBuffer().append(nValue).makeStringAndClear());
+ }
+ }
+}
+
+void FieldParamExporter::ExportParameter(const OUString& sKey, const OUString& sValue)
+{
+ m_pExport->AddAttribute(XML_NAMESPACE_FIELD, XML_NAME, sKey);
+ m_pExport->AddAttribute(XML_NAMESPACE_FIELD, XML_VALUE, sValue);
+ m_pExport->StartElement(XML_NAMESPACE_FIELD, XML_PARAM, sal_False);
+ m_pExport->EndElement(XML_NAMESPACE_FIELD, XML_PARAM, sal_False);
+}
+
void XMLTextParagraphExport::Add( sal_uInt16 nFamily,
const Reference < XPropertySet > & rPropSet,
const XMLPropertyState** ppAddStates, bool bDontSeek )
@@ -2237,19 +2302,19 @@ void XMLTextParagraphExport::exportTextRangeEnumeration(
else if (sType.equals(sTextFieldStart))
{
Reference<XNamed> xBookmark(xPropSet->getPropertyValue(sBookmark), UNO_QUERY);
- if (xBookmark.is()) {
+ if (xBookmark.is())
+ {
GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_NAME, xBookmark->getName());
}
Reference< ::com::sun::star::text::XFormField > xFormField(xPropSet->getPropertyValue(sBookmark), UNO_QUERY);
- if (xFormField.is()) {
- GetExport().AddAttribute(XML_NAMESPACE_FIELD, XML_TYPE, ::rtl::OUString::createFromAscii("msoffice.field.FORMTEXT"));
+ if (xFormField.is())
+ {
+ GetExport().AddAttribute(XML_NAMESPACE_FIELD, XML_TYPE, xFormField->getFieldType());
}
GetExport().StartElement(XML_NAMESPACE_FIELD, XML_FIELDMARK_START, sal_False);
- if (xFormField.is()) {
- GetExport().AddAttribute(XML_NAMESPACE_FIELD, XML_NAME, ::rtl::OUString::createFromAscii("Description"));
- GetExport().AddAttribute(XML_NAMESPACE_FIELD, XML_VALUE, xFormField->getDescription());
- GetExport().StartElement(XML_NAMESPACE_FIELD, XML_PARAM, sal_False);
- GetExport().EndElement(XML_NAMESPACE_FIELD, XML_PARAM, sal_False);
+ if (xFormField.is())
+ {
+ FieldParamExporter(&GetExport(), xFormField->getParameters()).Export();
}
GetExport().EndElement(XML_NAMESPACE_FIELD, XML_FIELDMARK_START, sal_False);
}
@@ -2261,32 +2326,19 @@ void XMLTextParagraphExport::exportTextRangeEnumeration(
else if (sType.equals(sTextFieldStartEnd))
{
Reference<XNamed> xBookmark(xPropSet->getPropertyValue(sBookmark), UNO_QUERY);
- if (xBookmark.is()) {
+ if (xBookmark.is())
+ {
GetExport().AddAttribute(XML_NAMESPACE_TEXT, XML_NAME, xBookmark->getName());
}
Reference< ::com::sun::star::text::XFormField > xFormField(xPropSet->getPropertyValue(sBookmark), UNO_QUERY);
- if (xFormField.is()) {
- sal_Int16 fftype=xFormField->getType();
- switch (fftype) {
- case 1:
- GetExport().AddAttribute(XML_NAMESPACE_FIELD, XML_TYPE, ::rtl::OUString::createFromAscii("msoffice.field.FORMCHECKBOX"));
- break;
- default:
- DBG_ASSERT(false, "hey ---- add your export stuff here!!");
- break;
- }
+ if (xFormField.is())
+ {
+ GetExport().AddAttribute(XML_NAMESPACE_FIELD, XML_TYPE, xFormField->getFieldType());
}
GetExport().StartElement(XML_NAMESPACE_FIELD, XML_FIELDMARK, sal_False);
- if (xFormField.is()) {
- GetExport().AddAttribute(XML_NAMESPACE_FIELD, XML_NAME, ::rtl::OUString::createFromAscii("Description"));
- GetExport().AddAttribute(XML_NAMESPACE_FIELD, XML_VALUE, xFormField->getDescription());
- GetExport().StartElement(XML_NAMESPACE_FIELD, XML_PARAM, sal_False);
- GetExport().EndElement(XML_NAMESPACE_FIELD, XML_PARAM, sal_False);
-
- GetExport().AddAttribute(XML_NAMESPACE_FIELD, XML_NAME, ::rtl::OUString::createFromAscii("Result"));
- GetExport().AddAttribute(XML_NAMESPACE_FIELD, XML_VALUE, ::rtl::OUString::valueOf((sal_Int32 )xFormField->getRes()));
- GetExport().StartElement(XML_NAMESPACE_FIELD, XML_PARAM, sal_False);
- GetExport().EndElement(XML_NAMESPACE_FIELD, XML_PARAM, sal_False);
+ if (xFormField.is())
+ {
+ FieldParamExporter(&GetExport(), xFormField->getParameters()).Export();
}
GetExport().EndElement(XML_NAMESPACE_FIELD, XML_FIELDMARK, sal_False);
}
diff --git a/xmloff/source/transform/makefile.mk b/xmloff/source/transform/makefile.mk
index 473cec5562..bba8deb6db 100644
--- a/xmloff/source/transform/makefile.mk
+++ b/xmloff/source/transform/makefile.mk
@@ -86,7 +86,7 @@ SHL1STDLIBS = \
.ELSE
SHL1STDLIBS += ixo.lib
.ENDIF
-SHL1VERSIONMAP = xof.map
+SHL1VERSIONMAP = $(SOLARENV)/src/component.map
SHL1IMPLIB = i$(SHL1TARGET)
DEF1NAME = $(SHL1TARGET)
diff --git a/xmloff/source/transform/xof.map b/xmloff/source/transform/xof.map
deleted file mode 100644
index f4ed78b9e9..0000000000
--- a/xmloff/source/transform/xof.map
+++ /dev/null
@@ -1,8 +0,0 @@
-UDK_3_0_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};